Skip to content

Commit c1cd0d1

Browse files
committed
✨(frontend) improve accessibility of cdoc content with correct aria tags
added appropriate aria attributes and semantic tags to enhance accessibility Signed-off-by: Cyril <[email protected]>
1 parent e07f709 commit c1cd0d1

File tree

6 files changed

+24
-7
lines changed

6 files changed

+24
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ and this project adheres to
1616
- #1255
1717
- #1262
1818
- #1270
19+
- #1271
1920

2021
## [3.5.0] - 2025-07-31
2122

src/frontend/apps/impress/src/features/docs/doc-header/components/DocTitle.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ const DocTitleInput = ({ doc }: DocTitleProps) => {
107107
}, [doc]);
108108

109109
return (
110-
<Tooltip content={t('Rename')} placement="top">
110+
<Tooltip content={t('Rename')} aria-hidden={true} placement="top">
111111
<Box
112112
as="span"
113113
role="textbox"
@@ -116,7 +116,8 @@ const DocTitleInput = ({ doc }: DocTitleProps) => {
116116
defaultValue={titleDisplay || undefined}
117117
onKeyDownCapture={handleKeyDown}
118118
suppressContentEditableWarning={true}
119-
aria-label="doc title input"
119+
aria-label={`${t('Document title')} ${doc.title || untitledDocument}`}
120+
aria-multiline={false}
120121
onBlurCapture={(event) =>
121122
handleTitleSubmit(event.target.textContent || '')
122123
}
@@ -137,7 +138,7 @@ const DocTitleInput = ({ doc }: DocTitleProps) => {
137138
outline: none;
138139
`}
139140
>
140-
{titleDisplay}
141+
{titleDisplay || untitledDocument}
141142
</Box>
142143
</Tooltip>
143144
);

src/frontend/apps/impress/src/features/docs/doc-header/components/DocToolBox.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ export const DocToolBox = ({ doc }: DocToolBoxProps) => {
215215
>
216216
<Button
217217
color="tertiary"
218-
aria-label="Share button"
218+
aria-label={t('Share button')}
219219
icon={
220220
<Icon iconName="group" $theme="primary" $variation="800" />
221221
}
@@ -235,12 +235,18 @@ export const DocToolBox = ({ doc }: DocToolBoxProps) => {
235235
<Button
236236
color="tertiary-text"
237237
icon={
238-
<Icon iconName="download" $theme="primary" $variation="800" />
238+
<Icon
239+
iconName="download"
240+
$theme="primary"
241+
$variation="800"
242+
aria-hidden={true}
243+
/>
239244
}
240245
onClick={() => {
241246
setIsModalExportOpen(true);
242247
}}
243248
size={isSmallMobile ? 'small' : 'medium'}
249+
aria-label={t('Download the document')}
244250
/>
245251
)}
246252
<DropdownMenu options={options}>

src/frontend/apps/impress/src/features/docs/doc-management/components/SimpleDocItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export const SimpleDocItem = ({
7171
<Box $justify="center" $overflow="auto">
7272
<Text
7373
aria-describedby="doc-title"
74-
aria-label={doc.title}
74+
aria-label={doc.title || untitledDocument}
7575
$size="sm"
7676
$variation="1000"
7777
$weight="500"

src/frontend/apps/impress/src/features/docs/doc-share/components/DocRoleDropdown.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export const DocRoleDropdown = ({
102102

103103
if (!canUpdate) {
104104
return (
105-
<Text aria-label="doc-role-text" $variation="600">
105+
<Text aria-label={t('Document role text')} $variation="600">
106106
{transRole(currentRole)}
107107
</Text>
108108
);

src/frontend/apps/impress/src/i18n/translations.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,11 @@
217217
"Document accessible to any connected person": "Dokument für jeden angemeldeten Benutzer zugänglich",
218218
"Document duplicated successfully!": "Dokument erfolgreich dupliziert!",
219219
"Document owner": "Besitzer des Dokuments",
220+
"Document title": "Dokumenttitel",
220221
"Document sections": "Dokumentabschnitte",
221222
"Docx": "Docx",
222223
"Download": "Herunterladen",
224+
"Download the document": "Dokument herunterladen",
223225
"Download anyway": "Trotzdem herunterladen",
224226
"Download your document in a .docx or .pdf format.": "Ihr Dokument als .docx- oder .pdf-Datei herunterladen.",
225227
"Duplicate": "Duplizieren",
@@ -371,6 +373,7 @@
371373
"en": {
372374
"translation": {
373375
"Back to homepage": "Back to Docs homepage",
376+
"Document title": "Document title",
374377
"Search docs": "Search docs",
375378
"More options": "More options",
376379
"Pinned documents": "Pinned documents",
@@ -437,9 +440,11 @@
437440
"Docs: Your new companion to collaborate on documents efficiently, intuitively, and securely.": "Docs: su nuevo compañero para colaborar en documentos de forma eficiente, intuitiva y segura.",
438441
"Document accessible to any connected person": "Documento accesible a cualquier persona conectada",
439442
"Document owner": "Propietario del documento",
443+
"Document title": "Título del documento",
440444
"Document sections": "Secciones del documento",
441445
"Docx": "Docx",
442446
"Download": "Descargar",
447+
"Download the document": "Descargar el documento",
443448
"Download anyway": "Descargar de todos modos",
444449
"Download your document in a .docx or .pdf format.": "Descargue su documento en formato .docx o .pdf.",
445450
"Editor": "Editor",
@@ -633,9 +638,11 @@
633638
"Document accessible to any connected person": "Document accessible à toute personne connectée",
634639
"Document duplicated successfully!": "Document dupliqué avec succès !",
635640
"Document owner": "Propriétaire du document",
641+
"Document title": "Titre du document",
636642
"Document sections": "Sections des documents",
637643
"Docx": "Docx",
638644
"Download": "Télécharger",
645+
"Download the document": "Télécharger le document",
639646
"Download anyway": "Télécharger malgré tout",
640647
"Download your document in a .docx or .pdf format.": "Téléchargez votre document au format .docx ou .pdf.",
641648
"Duplicate": "Dupliquer",
@@ -1003,9 +1010,11 @@
10031010
"Docs: Your new companion to collaborate on documents efficiently, intuitively, and securely.": "Docs: Je nieuwe metgezel om efficiënt, intuïtief en veilig samen te werken aan documenten.",
10041011
"Document accessible to any connected person": "Document is toegankelijk voor ieder verbonden persoon",
10051012
"Document owner": "Document eigenaar",
1013+
"Document title": "Documenttitel",
10061014
"Document sections": "Document secties",
10071015
"Docx": "Docx",
10081016
"Download": "Download",
1017+
"Download the document": "Document downloaden",
10091018
"Download anyway": "Download alsnog",
10101019
"Download your document in a .docx or .pdf format.": "Download jouw document in .docx of .pdf formaat.",
10111020
"Editor": "Bewerker",

0 commit comments

Comments
 (0)