From 8a310d004bad39583133e0b0cddb3028a4285e21 Mon Sep 17 00:00:00 2001 From: Cyril Date: Mon, 8 Sep 2025 11:58:06 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8(frontend)=20improve=20modal=20a11y:?= =?UTF-8?q?=20structure,=20labels,=20and=20title?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit added aria-label, structured text in p, and added title for better accessibility Signed-off-by: Cyril --- CHANGELOG.md | 8 +++---- .../__tests__/app-impress/doc-editor.spec.ts | 2 ++ .../__tests__/app-impress/doc-export.spec.ts | 4 +++- .../__tests__/app-impress/doc-grid.spec.ts | 2 +- .../__tests__/app-impress/doc-header.spec.ts | 2 +- .../__tests__/app-impress/doc-search.spec.ts | 4 ++-- .../src/components/modal/AlertModal.tsx | 21 ++++++++++++------- .../ModalConfirmDownloadUnsafe.tsx | 6 +++++- .../doc-export/components/ModalExport.tsx | 8 +++++-- .../components/ModalRemoveDoc.tsx | 17 +++++++-------- .../doc-search/components/DocSearchModal.tsx | 11 +++++++++- .../doc-share/components/DocShareModal.tsx | 13 ++++++++++-- .../components/ModalConfirmationVersion.tsx | 21 ++++++++++++------- .../components/ModalSelectVersion.tsx | 9 ++++++++ .../apps/impress/src/i18n/translations.json | 12 +++++++++++ .../apps/impress/src/pages/globals.css | 13 ++++++++++++ 16 files changed, 114 insertions(+), 39 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f96dee4d..886ff225 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,12 +8,13 @@ and this project adheres to ## [Unreleased] -- ⚡️(frontend) improve accessibility: - - #1341 - ### Added - ✨(api) add API route to fetch document content #1206 +- ♿(frontend) improve accessibility: + - #1349 + - #1271 + - #1341 ### Changed @@ -41,7 +42,6 @@ and this project adheres to - ♿(frontend) improve accessibility for decorative images in editor #1282 - #1338 - #1281 - - #1271 - ♻️(backend) fallback to email identifier when no name #1298 - 🐛(backend) allow ASCII characters in user sub field #1295 - ⚡️(frontend) improve fallback width calculation #1333 diff --git a/src/frontend/apps/e2e/__tests__/app-impress/doc-editor.spec.ts b/src/frontend/apps/e2e/__tests__/app-impress/doc-editor.spec.ts index cdfa6ccc..ca4053c6 100644 --- a/src/frontend/apps/e2e/__tests__/app-impress/doc-editor.spec.ts +++ b/src/frontend/apps/e2e/__tests__/app-impress/doc-editor.spec.ts @@ -463,12 +463,14 @@ test.describe('Doc Editor', () => { await expect( page.getByRole('button', { name: 'Download', + exact: true, }), ).toBeVisible(); void page .getByRole('button', { name: 'Download', + exact: true, }) .click(); diff --git a/src/frontend/apps/e2e/__tests__/app-impress/doc-export.spec.ts b/src/frontend/apps/e2e/__tests__/app-impress/doc-export.spec.ts index 6450da39..81a22f2c 100644 --- a/src/frontend/apps/e2e/__tests__/app-impress/doc-export.spec.ts +++ b/src/frontend/apps/e2e/__tests__/app-impress/doc-export.spec.ts @@ -38,7 +38,9 @@ test.describe('Doc Export', () => { ).toBeVisible(); await expect(page.getByRole('combobox', { name: 'Format' })).toBeVisible(); await expect( - page.getByRole('button', { name: 'Close the modal' }), + page.getByRole('button', { + name: 'Close the download modal', + }), ).toBeVisible(); await expect(page.getByTestId('doc-export-download-button')).toBeVisible(); }); diff --git a/src/frontend/apps/e2e/__tests__/app-impress/doc-grid.spec.ts b/src/frontend/apps/e2e/__tests__/app-impress/doc-grid.spec.ts index 1881541e..59a1b998 100644 --- a/src/frontend/apps/e2e/__tests__/app-impress/doc-grid.spec.ts +++ b/src/frontend/apps/e2e/__tests__/app-impress/doc-grid.spec.ts @@ -149,7 +149,7 @@ test.describe('Document grid item options', () => { await page .getByRole('button', { - name: 'Confirm deletion', + name: 'Delete document', }) .click(); diff --git a/src/frontend/apps/e2e/__tests__/app-impress/doc-header.spec.ts b/src/frontend/apps/e2e/__tests__/app-impress/doc-header.spec.ts index c707163e..7c7f7dda 100644 --- a/src/frontend/apps/e2e/__tests__/app-impress/doc-header.spec.ts +++ b/src/frontend/apps/e2e/__tests__/app-impress/doc-header.spec.ts @@ -100,7 +100,7 @@ test.describe('Doc Header', () => { await page .getByRole('button', { - name: 'Confirm deletion', + name: 'Delete document', }) .click(); diff --git a/src/frontend/apps/e2e/__tests__/app-impress/doc-search.spec.ts b/src/frontend/apps/e2e/__tests__/app-impress/doc-search.spec.ts index 412064dd..60cff9a3 100644 --- a/src/frontend/apps/e2e/__tests__/app-impress/doc-search.spec.ts +++ b/src/frontend/apps/e2e/__tests__/app-impress/doc-search.spec.ts @@ -33,7 +33,7 @@ test.describe('Document search', () => { ).toBeVisible(); await expect( - page.getByLabel('Search modal').getByText('search'), + page.getByRole('heading', { name: 'Search docs' }), ).toBeVisible(); const inputSearch = page.getByPlaceholder('Type the name of a document'); @@ -79,7 +79,7 @@ test.describe('Document search', () => { await page.keyboard.press('Control+k'); await expect( - page.getByLabel('Search modal').getByText('search'), + page.getByRole('heading', { name: 'Search docs' }), ).toBeVisible(); await page.keyboard.press('Escape'); diff --git a/src/frontend/apps/impress/src/components/modal/AlertModal.tsx b/src/frontend/apps/impress/src/components/modal/AlertModal.tsx index ffee754c..c1d038f0 100644 --- a/src/frontend/apps/impress/src/components/modal/AlertModal.tsx +++ b/src/frontend/apps/impress/src/components/modal/AlertModal.tsx @@ -30,15 +30,23 @@ export const AlertModal = ({ isOpen={isOpen} size={ModalSize.MEDIUM} onClose={onClose} + aria-describedby="alert-modal-title" title={ - + {title} } rightActions={ <>