(frontend) improve accessibility of cdoc content with correct aria tags

added appropriate aria attributes and semantic tags to enhance accessibility

Signed-off-by: Cyril <c.gromoff@gmail.com>
This commit is contained in:
Cyril
2025-08-07 09:55:28 +02:00
parent 0a1eaa3c40
commit 9cb2b6a6fb
13 changed files with 115 additions and 87 deletions

View File

@@ -145,12 +145,12 @@ export const ModalExport = ({ onClose, doc }: ModalExportProps) => {
{t('Cancel')}
</Button>
<Button
data-testid="doc-export-download-button"
aria-label={t('Download')}
color="primary"
fullWidth
onClick={() => void onSubmit()}
disabled={isExporting}
data-testid="modal-download-button"
>
{t('Download')}
</Button>

View File

@@ -105,7 +105,7 @@ const DocTitleInput = ({ doc }: DocTitleProps) => {
}, [doc]);
return (
<Tooltip content={t('Rename')} placement="top">
<Tooltip content={t('Rename')} aria-hidden={true} placement="top">
<Box
as="span"
role="textbox"
@@ -114,7 +114,8 @@ const DocTitleInput = ({ doc }: DocTitleProps) => {
defaultValue={titleDisplay || undefined}
onKeyDownCapture={handleKeyDown}
suppressContentEditableWarning={true}
aria-label="doc title input"
aria-label={`${t('Document title')}`}
aria-multiline={false}
onBlurCapture={(event) =>
handleTitleSubmit(event.target.textContent || '')
}

View File

@@ -215,7 +215,7 @@ export const DocToolBox = ({ doc }: DocToolBoxProps) => {
>
<Button
color="tertiary"
aria-label="Share button"
aria-label={t('Share button')}
icon={
<Icon iconName="group" $theme="primary" $variation="800" />
}
@@ -233,9 +233,15 @@ export const DocToolBox = ({ doc }: DocToolBoxProps) => {
{!isSmallMobile && ModalExport && (
<Button
data-testid="doc-open-modal-download-button"
color="tertiary-text"
icon={
<Icon iconName="download" $theme="primary" $variation="800" />
<Icon
iconName="download"
$theme="primary"
$variation="800"
aria-hidden={true}
/>
}
onClick={() => {
setIsModalExportOpen(true);

View File

@@ -83,7 +83,7 @@ export const SimpleDocItem = ({
<Box $justify="center" $overflow="auto">
<Text
aria-describedby="doc-title"
aria-label={displayTitle}
aria-label={doc.title || untitledDocument}
$size="sm"
$variation="1000"
$weight="500"

View File

@@ -102,7 +102,7 @@ export const DocRoleDropdown = ({
if (!canUpdate) {
return (
<Text aria-label="doc-role-text" $variation="600">
<Text aria-label={t('Document role text')} $variation="600">
{transRole(currentRole)}
</Text>
);

View File

@@ -302,8 +302,11 @@
"Document accessible to any connected person": "Dokument für jeden angemeldeten Benutzer zugänglich",
"Document duplicated successfully!": "Dokument erfolgreich dupliziert!",
"Document owner": "Besitzer des Dokuments",
"Document title": "Dokumenttitel",
"Document sections": "Dokumentabschnitte",
"Docx": "Docx",
"Download": "Herunterladen",
"Download the document": "Dokument herunterladen",
"Download anyway": "Trotzdem herunterladen",
"Download your document in a .docx or .pdf format.": "Ihr Dokument als .docx- oder .pdf-Datei herunterladen.",
"Duplicate": "Duplizieren",
@@ -451,6 +454,7 @@
"en": {
"translation": {
"Back to homepage": "Back to Docs homepage",
"Document title": "Document title",
"Search docs": "Search docs",
"More options": "More options",
"Pinned documents": "Pinned documents",
@@ -527,8 +531,11 @@
"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.",
"Document accessible to any connected person": "Documento accesible a cualquier persona conectada",
"Document owner": "Propietario del documento",
"Document title": "Título del documento",
"Document sections": "Secciones del documento",
"Docx": "Docx",
"Download": "Descargar",
"Download the document": "Descargar el documento",
"Download anyway": "Descargar de todos modos",
"Download your document in a .docx or .pdf format.": "Descargue su documento en formato .docx o .pdf.",
"Editor": "Editor",
@@ -726,10 +733,12 @@
"Document duplicated successfully!": "Document dupliqué avec succès !",
"Document emoji icon": "Émoticônes du document",
"Document owner": "Propriétaire du document",
"Document title": "Titre du document",
"Document sections": "Sections du document",
"Document visibility": "Visibilité du document",
"Docx": "Docx",
"Download": "Télécharger",
"Download the document": "Télécharger le document",
"Download anyway": "Télécharger malgré tout",
"Download your document in a .docx or .pdf format.": "Téléchargez votre document au format .docx ou .pdf.",
"Duplicate": "Dupliquer",
@@ -1105,8 +1114,11 @@
"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.",
"Document accessible to any connected person": "Document is toegankelijk voor ieder verbonden persoon",
"Document owner": "Document eigenaar",
"Document title": "Documenttitel",
"Document sections": "Document secties",
"Docx": "Docx",
"Download": "Download",
"Download the document": "Document downloaden",
"Download anyway": "Download alsnog",
"Download your document in a .docx or .pdf format.": "Download jouw document in .docx of .pdf formaat.",
"Editor": "Bewerker",