From 5b74a7c4a68f9e659b8e1f9739ba0b59ff71e469 Mon Sep 17 00:00:00 2001 From: Harald Schilly Date: Fri, 24 Oct 2025 12:07:07 +0200 Subject: [PATCH 1/3] frontend/aria: get started annotating elements --- src/AGENTS.md | 21 +- src/dev/ARIA.md | 1919 +++++++++++++++++ src/packages/frontend/app/page.tsx | 11 +- .../frontend/components/activity-display.tsx | 18 +- src/packages/frontend/components/close-x.tsx | 13 +- src/packages/frontend/components/close-x2.tsx | 13 +- .../frontend/components/copy-button.tsx | 2 + .../frontend/components/date-time-picker.tsx | 2 + .../frontend/components/dropdown-menu.tsx | 3 + src/packages/frontend/components/mark-all.tsx | 1 + .../frontend/components/number-input.tsx | 6 + src/packages/frontend/components/refresh.tsx | 2 + .../frontend/components/search-input.tsx | 2 + .../frontend/components/text-input.tsx | 2 + .../code-editor/codemirror-editor.tsx | 7 +- .../frame-editors/frame-tree/frame-tree.tsx | 11 +- .../frame-editors/frame-tree/title-bar.tsx | 11 + .../latex-editor/output-control-build.tsx | 7 +- .../latex-editor/output-control-pages.tsx | 2 +- .../latex-editor/output-control-sync.tsx | 11 +- .../latex-editor/output-control-zoom.tsx | 74 +- .../latex-editor/output-control.tsx | 7 +- .../latex-editor/output-files.tsx | 2 + .../latex-editor/output-stats.tsx | 4 + .../frame-editors/latex-editor/output.tsx | 30 +- .../frontend/jupyter/cell-buttonbar.tsx | 52 +- src/packages/frontend/jupyter/cell-list.tsx | 22 +- src/packages/frontend/project/page/page.tsx | 27 +- .../frontend/projects/filename-search.tsx | 2 +- .../frontend/projects/projects-page.tsx | 10 +- .../frontend/projects/projects-starred.tsx | 9 +- 31 files changed, 2212 insertions(+), 91 deletions(-) create mode 100644 src/dev/ARIA.md diff --git a/src/AGENTS.md b/src/AGENTS.md index 0fa74f9444d..985623d04c0 100644 --- a/src/AGENTS.md +++ b/src/AGENTS.md @@ -158,7 +158,6 @@ CoCalc is organized as a monorepo with key packages: - Prefix git commits with the package and general area. e.g. 'frontend/latex: ...' if it concerns latex editor changes in the packages/frontend/... code. - When pushing a new branch to Github, track it upstream. e.g. `git push --set-upstream origin feature-foo` for branch "feature-foo". - ## React-intl / Internationalization (i18n) CoCalc uses react-intl for internationalization with SimpleLocalize as the translation platform. @@ -210,6 +209,24 @@ Same flow as above, but **before 3. i18n:upload**, delete the key. Only new keys - `packages/frontend/i18n/trans/[locale].compiled.json` - compiled translation files for runtime - `packages/frontend/i18n/index.ts` - exports and locale loading logic +## ARIA Landmarks and Accessibility + +The CoCalc frontend should implement ARIA landmarks to enable proper landmark-based navigation for users with assistive technologies (screen readers, keyboard navigation tools, etc.). + +**Important**: See [./dev/ARIA.md](./dev/ARIA.md) for comprehensive documentation on: + +- What ARIA landmarks are and why they matter +- CoCalc's three-level navigation hierarchy +- How to implement landmarks in React/TSX components +- Best practices and implementation guidelines + +Key points: + +- Use semantic HTML elements (`
`, `