Skip to content

Commit 5fe360a

Browse files
committed
✨(frontend) document visible in list are now openable via enter key
the document now appears in the list and can be opened using the enter key Signed-off-by: Cyril <[email protected]>
1 parent 4f2e07f commit 5fe360a

File tree

3 files changed

+48
-4
lines changed

3 files changed

+48
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ and this project adheres to
1111
### Added
1212

1313
- ✨(api) add API route to fetch document content #1206
14-
- ♿(frontend) improve accessibility:
15-
- #1349
16-
- #1271
17-
- #1341
1814

1915
### Changed
2016

@@ -23,6 +19,10 @@ and this project adheres to
2319
- ♿(frontend) improve accessibility:
2420
- ♿(frontend) fix major accessibility issues reported by wave and axe #1344
2521
- #1341
22+
- #1349
23+
- #1271
24+
- #1341
25+
- #1365
2626
- ♻️(tilt) use helm dev-backend chart
2727

2828
## [3.6.0] - 2025-09-04

src/frontend/apps/impress/src/features/docs/docs-grid/components/DocsGridItem.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { Tooltip, useModal } from '@openfun/cunningham-react';
22
import { DateTime } from 'luxon';
3+
import { useRouter } from 'next/router';
4+
import { KeyboardEvent } from 'react';
35
import { useTranslation } from 'react-i18next';
46
import { css } from 'styled-components';
57

@@ -23,6 +25,7 @@ export const DocsGridItem = ({ doc, dragMode = false }: DocsGridItemProps) => {
2325
const { t } = useTranslation();
2426
const { isDesktop } = useResponsiveStore();
2527
const { flexLeft, flexRight } = useResponsiveDocGrid();
28+
const router = useRouter();
2629
const { spacingsTokens } = useCunninghamTheme();
2730
const shareModal = useModal();
2831
const isPublic = doc.link_reach === LinkReach.PUBLIC;
@@ -33,6 +36,13 @@ export const DocsGridItem = ({ doc, dragMode = false }: DocsGridItemProps) => {
3336
shareModal.open();
3437
};
3538

39+
const handleKeyDown = (e: KeyboardEvent) => {
40+
if (e.key === 'Enter' || e.key === ' ') {
41+
e.preventDefault();
42+
void router.push(`/docs/${doc.id}`);
43+
}
44+
};
45+
3646
return (
3747
<>
3848
<Box
@@ -52,6 +62,10 @@ export const DocsGridItem = ({ doc, dragMode = false }: DocsGridItemProps) => {
5262
}
5363
`}
5464
className="--docs--doc-grid-item"
65+
onKeyDown={handleKeyDown}
66+
aria-label={t('Open document: {{title}}', {
67+
title: doc.title || t('Untitled document'),
68+
})}
5569
>
5670
<Box
5771
$flex={flexLeft}

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

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,12 @@
371371
"Open Source": "Open Source",
372372
"Open the document options": "Öffnen Sie die Dokumentoptionen",
373373
"Open the header menu": "Öffne das Kopfzeilen-Menü",
374+
"Open document actions menu": "Dokumentaktionsmenü öffnen",
375+
"Open document: {{title}}": "Dokument öffnen: {{title}}",
376+
"Main content": "Hauptinhalt",
377+
"Home content": "Startseiten-Inhalt",
378+
"Documents grid": "Dokumentenraster",
379+
"Drag and drop status": "Drag-and-Drop-Status",
374380
"Organize": "Organisieren",
375381
"Others are editing. Your network prevent changes.": "Ihre Änderung konnte nicht übernommen werden, da andere Benutzer diesen Bereich zurzeit bearbeiten.",
376382
"Owner": "Besitzer",
@@ -458,6 +464,11 @@
458464
"Document title": "Document title",
459465
"Search docs": "Search docs",
460466
"More options": "More options",
467+
"Open document actions menu": "Open document actions menu",
468+
"Main content": "Main content",
469+
"Home content": "Home content",
470+
"Documents grid": "Documents grid",
471+
"Drag and drop status": "Drag and drop status",
461472
"Pinned documents": "Pinned documents",
462473
"Close the access request modal": "Close the access request modal",
463474
"Close the delete modal": "Close the delete modal",
@@ -468,6 +479,7 @@
468479
"Cancel the deletion": "Cancel the deletion",
469480
"Cancel the download": "Cancel the download",
470481
"Open actions menu for document: {{title}}": "Open actions menu for document: {{title}}",
482+
"Open document: {{title}}": "Open document: {{title}}",
471483
"Open the menu of actions for the document: {{title}}": "Open the menu of actions for the document: {{title}}",
472484
"Share with {{count}} users_one": "Share with {{count}} user",
473485
"Shared with {{count}} users_many": "Shared with {{count}} users",
@@ -596,6 +608,12 @@
596608
"Open Source": "Código abierto",
597609
"Open the document options": "Abrir las opciones del documento",
598610
"Open the header menu": "Abrir el menú de encabezado",
611+
"Open document actions menu": "Abrir menú de acciones del documento",
612+
"Open document: {{title}}": "Abrir documento: {{title}}",
613+
"Main content": "Contenido principal",
614+
"Home content": "Contenido de inicio",
615+
"Documents grid": "Lista de documentos",
616+
"Drag and drop status": "Estado de arrastrar y soltar",
599617
"Organize": "Organiza",
600618
"Owner": "Propietario",
601619
"PDF": "PDF",
@@ -823,7 +841,13 @@
823841
"Open Source": "Open Source",
824842
"Open the document options": "Ouvrir les options du document",
825843
"Open the header menu": "Ouvrir le menu d'en-tête",
844+
"Open document actions menu": "Ouvrir le menu d'actions du document",
845+
"Open document: {{title}}": "Ouvrir le document : {{title}}",
826846
"Open the menu of actions for the document: {{title}}": "Ouvrir le menu des actions du document : {{title}}",
847+
"Main content": "Contenu principal",
848+
"Home content": "Contenu d'accueil",
849+
"Documents grid": "Grille des documents",
850+
"Drag and drop status": "État du glisser-déposer",
827851
"Organize": "Organiser",
828852
"Others are editing this document. Unfortunately your network blocks WebSockets, the technology enabling real-time co-editing.": "D'autres sont en train de modifier ce document. Malheureusement, votre réseau bloque les web sockets, la technologie permettant la coédition en temps réel.",
829853
"Others are editing. Your network prevent changes.": "D'autres sont en cours d'édition. Votre réseau empêche les changements.",
@@ -1183,6 +1207,12 @@
11831207
"Open Source": "Open Source",
11841208
"Open the document options": "Open document opties",
11851209
"Open the header menu": "Open het hoofdmenu",
1210+
"Open document actions menu": "Open documentactiemenu",
1211+
"Open document: {{title}}": "Document openen: {{title}}",
1212+
"Main content": "Hoofdinhoud",
1213+
"Home content": "Startpagina-inhoud",
1214+
"Documents grid": "Documentenraster",
1215+
"Drag and drop status": "Slepen en neerzetten status",
11861216
"Organize": "Organiseer",
11871217
"Owner": "Eigenaar",
11881218
"PDF": "PDF",

0 commit comments

Comments
 (0)