Skip to content

Conversation

Ovgodd
Copy link
Collaborator

@Ovgodd Ovgodd commented Aug 1, 2025

Purpose

This PR improves the keyboard accessibility of the document tree following the WAI-ARIA Authoring Practices (APG) and WCAG 2.1 guidelines.

Issue: #1160

Sub-document navigation is now fully accessible: users can navigate and open sub-documents using the keyboard.

Keyboard interactions

Key Behavior
↑ / ↓ Move between tree items
→ / ← Expand/collapse items in the tree (if available)
Enter / Space Activate the currently focused document (open / navigate)
F2 Move focus into the action menu (e.g., “more options” button)
← / → (menu) Navigate between actions inside the toolbar
Tab / Shift+Tab Leave the tree and move to the next/previous focusable element

Accessibility compliance

  • WCAG 2.1 – 2.1.1 Keyboard: All functionality is operable via keyboard.
  • WAI-ARIA TreeView & Toolbar patterns:
    • Enter / Space for activation
    • F2 to switch between navigation and action mode

Benefits

  • Keyboard users can fully navigate the tree, open documents, and access contextual actions.
  • Screen reader users benefit from proper roles, states, and expected keyboard behavior.
  • The interaction model now matches desktop and web accessibility standards.

Proposal

For the action buttons (like “more options” or “add child document”) that appear when a tree item is focused:

  • React-Arborist uses a roving tabindex by default, so these buttons were not reachable with Tab.
  • To fix this and make them keyboard-accessible:
    • Added a useActionableMode hook to manage focus and keyboard interactions.
    • Added :focus-within on the tree item wrapper to show the contextual action menu when a child receives focus.
    • Added :focus-visible outlines on buttons inside the menu for clear visual feedback.
    • Added aria-label attributes to make icon-only buttons screen reader accessible (e.g., “More options”, “Add child document”).
    • Added onKeyDown handlers to support Enter and Space on icon buttons.

@Ovgodd Ovgodd requested a review from AntoLC August 1, 2025 13:01
@Ovgodd Ovgodd self-assigned this Aug 1, 2025
@Ovgodd Ovgodd force-pushed the fix/1160-sub-doc-access branch 2 times, most recently from 3463226 to a4249b3 Compare August 1, 2025 13:02
@Ovgodd Ovgodd marked this pull request as ready for review August 1, 2025 13:02
@Ovgodd Ovgodd force-pushed the fix/1160-sub-doc-access branch 23 times, most recently from 6d0eba4 to 069359a Compare August 6, 2025 15:28
@Ovgodd Ovgodd marked this pull request as draft August 13, 2025 14:11
@Ovgodd Ovgodd force-pushed the fix/1160-sub-doc-access branch 2 times, most recently from 6b4c0e9 to 6eb9036 Compare August 13, 2025 16:12
@Ovgodd Ovgodd marked this pull request as ready for review August 13, 2025 16:12
@Ovgodd
Copy link
Collaborator Author

Ovgodd commented Aug 13, 2025

When there is a subdocs, I cannot unfold the doc with keyboard.

Enregistrement.de.l.ecran.2025-08-12.125242.mp4

subdocnavarrow.mp4

Fixed !

@Ovgodd Ovgodd force-pushed the fix/1160-sub-doc-access branch 2 times, most recently from 161ec74 to 46f6274 Compare August 14, 2025 06:24
@Ovgodd Ovgodd force-pushed the fix/1160-sub-doc-access branch from 46f6274 to 43a996f Compare September 4, 2025 08:27
adds focus style to make the sub-menu accessible unify dropdownmenu

Signed-off-by: Cyril <[email protected]>
enter/space now trigger only on real focus add useTreeItemKeyboardActivate hook

Signed-off-by: Cyril <[email protected]>
adds proper aria props and translation keys for accessibility support

Signed-off-by: Cyril <[email protected]>
@Ovgodd Ovgodd force-pushed the fix/1160-sub-doc-access branch 2 times, most recently from f9cf2a9 to 2907b3e Compare September 4, 2025 09:50
Copy link

github-actions bot commented Sep 4, 2025

Size Change: +2.86 kB (+0.08%)

Total Size: 3.64 MB

Filename Size Change
apps/impress/out/_next/static/ad5f7d28/_buildManifest.js 0 B -867 B (removed) 🏆
apps/impress/out/_next/static/chunks/9237.js 50.9 kB +1.85 kB (+3.77%)
apps/impress/out/_next/static/chunks/pages/_app.js 402 kB +1 kB (+0.25%)
apps/impress/out/_next/static/28eeca05/_buildManifest.js 866 B +866 B (new file) 🆕

compressed-size-action

@Ovgodd Ovgodd force-pushed the fix/1160-sub-doc-access branch from 2907b3e to ae9f348 Compare September 4, 2025 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants