From d6333c9b8143c67560ffd1171856b7f4094caab5 Mon Sep 17 00:00:00 2001 From: Cyril Date: Wed, 18 Mar 2026 10:56:31 +0100 Subject: [PATCH] =?UTF-8?q?=E2=99=BF=EF=B8=8F(frontend)=20fix=20aria-label?= =?UTF-8?q?s=20for=20table=20of=20contents=20nav=20vs=20buttons?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Screen readers announce nav as "Sommaire, navigation" and button as toggle. --- CHANGELOG.md | 4 ++++ .../e2e/__tests__/app-impress/doc-table-content.spec.ts | 4 +++- .../docs/doc-table-content/components/TableContent.tsx | 6 +++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa5a74ea8..7a5abbb92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,10 @@ and this project adheres to - ♿️(frontend) add sr-only format to export download button #2088 - ♿️(frontend) announce formatting shortcuts for screen readers #2070 +### Fixed + +- ♿️(frontend) fix aria-labels for table of contents #2065 + ## [v4.8.2] - 2026-03-19 ### Added diff --git a/src/frontend/apps/e2e/__tests__/app-impress/doc-table-content.spec.ts b/src/frontend/apps/e2e/__tests__/app-impress/doc-table-content.spec.ts index acb0dc6ce..5ec43b77a 100644 --- a/src/frontend/apps/e2e/__tests__/app-impress/doc-table-content.spec.ts +++ b/src/frontend/apps/e2e/__tests__/app-impress/doc-table-content.spec.ts @@ -19,7 +19,9 @@ test.describe('Doc Table Content', () => { await page.locator('.ProseMirror').click(); - await expect(page.getByRole('button', { name: 'Summary' })).toBeHidden(); + await expect( + page.getByRole('button', { name: 'Show the table of contents' }), + ).toBeHidden(); await page.keyboard.type('# Level 1\n## Level 2\n### Level 3'); diff --git a/src/frontend/apps/impress/src/features/docs/doc-table-content/components/TableContent.tsx b/src/frontend/apps/impress/src/features/docs/doc-table-content/components/TableContent.tsx index d2c339819..19b1e8f0b 100644 --- a/src/frontend/apps/impress/src/features/docs/doc-table-content/components/TableContent.tsx +++ b/src/frontend/apps/impress/src/features/docs/doc-table-content/components/TableContent.tsx @@ -91,7 +91,7 @@ export const TableContent = () => { $height="100%" $justify="center" $align="center" - aria-label={t('Summary')} + aria-label={t('Show the table of contents')} aria-expanded={isOpen} aria-controls="toc-list" $css={css` @@ -218,8 +218,8 @@ const TableContentOpened = ({ onClick={onClose} $justify="center" $align="center" - aria-label={t('Summary')} - aria-expanded="true" + aria-label={t('Hide the table of contents')} + aria-expanded={true} aria-controls="toc-list" $css={css` transition: none !important;