-
Notifications
You must be signed in to change notification settings - Fork 472
♿️Improve keyboard accessibility for the document tree #1681
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
c49c1f7 to
f72df6c
Compare
|
Size Change: +687 B (+0.02%) Total Size: 4.11 MB
|
5f35f48 to
2914ea9
Compare
2480747 to
86d98f0
Compare
| opacity: 1; | ||
| } | ||
| } | ||
| /* Retirer le focus visuel du root item quand le focus est sur les actions */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| /* Retirer le focus visuel du root item quand le focus est sur les actions */ | |
| /* Remove visual focus from the root item when focus is on the actions */ |
| display: flex; | ||
| } | ||
| } | ||
| /* Retirer le focus visuel du tree item quand le focus est sur les actions */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments should be in english.
src/frontend/apps/impress/src/features/docs/doc-tree/components/DocTreeItemActions.tsx
Outdated
Show resolved
Hide resolved
src/frontend/apps/impress/src/features/docs/doc-tree/hooks/useActionableMode.ts
Outdated
Show resolved
Hide resolved
src/frontend/apps/impress/src/features/docs/doc-tree/hooks/useActionableMode.ts
Outdated
Show resolved
Hide resolved
9504a1c to
fa7d602
Compare
adds f2 shortcut to open options menu in sub-documents Signed-off-by: Cyril <[email protected]>
b177dfa to
7d22f33
Compare
…treeview struct Signed-off-by: Cyril <[email protected]>
improves screen reader support with contextual accessibility guidance Signed-off-by: Cyril <[email protected]>
…e treeview struct
7d22f33 to
cf8e1d5
Compare
…de the treeview struct
AntoLC
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found the problem about the double f2, it is intercepted by treeitem.
It positions the focus on the emojipicker ^^ If you do f2 then enter, the picker open.
I suppose it is not the best that :
https://github.com/suitenumerique/ui-kit/blob/0b6f80100a85641c8227b4a61720722ec12691e2/src/components/tree-view/TreeView.tsx#L351-L359
From here: suitenumerique/ui-kit@c40f7f6
We need a way to pass props easily to this part, if we can have the hand on props.attr we should be able to add our own onKeyDown, but for that we need to move this line (l378 {...props.attrs}) to the line under onKeyDown (l390).(https://github.com/suitenumerique/ui-kit/blob/0b6f80100a85641c8227b4a61720722ec12691e2/src/components/tree-view/TreeView.tsx#L378-L379).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be removed as well.
| const handleRootKeyDown = useCallback( | ||
| (e: React.KeyboardEvent) => { | ||
| // F2: focus first action button | ||
| if (e.key === 'F2' && !rootActionsOpen) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we assert that in a e2e test ?
| } | ||
| `} | ||
| > | ||
| {/* Instructions clavier pour les lecteurs d'écran */} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
English
| $css={css` | ||
| background: transparent; | ||
| border: none; | ||
| padding: 0; | ||
| cursor: pointer; | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| &:focus-visible { | ||
| outline: 2px solid var(--c--globals--colors--brand-500) !important; | ||
| outline-offset: -2px; | ||
| border-radius: var(--c--globals--spacings--st); | ||
| } | ||
| `} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BoxButton has already all that:
docs/src/frontend/apps/impress/src/components/BoxButton.tsx
Lines 38 to 53 in c109288
| $css={css` | |
| cursor: ${props.disabled ? 'not-allowed' : 'pointer'}; | |
| border: none; | |
| outline: none; | |
| font-family: inherit; | |
| color: ${props.disabled && | |
| `var(--c--contextuals--content--semantic--disabled--primary)`}; | |
| &:focus-visible { | |
| transition: none; | |
| outline: 2px solid | |
| var(--c--contextuals--content--semantic--${theme}--${variation}); | |
| border-radius: 1px; | |
| outline-offset: var(--c--globals--spacings--st); | |
| } | |
| ${$css || ''} | |
| `} |
| aria-label={t('Add a sub page')} | ||
| data-testid="doc-tree-item-actions-add-child" | ||
| tabIndex={-1} | ||
| $css={css` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same BoxButton has already that, you just need to set the correct theme and variation props:
docs/src/frontend/apps/impress/src/components/BoxButton.tsx
Lines 45 to 51 in c109288
| &:focus-visible { | |
| transition: none; | |
| outline: 2px solid | |
| var(--c--contextuals--content--semantic--${theme}--${variation}); | |
| border-radius: 1px; | |
| outline-offset: var(--c--globals--spacings--st); | |
| } |
Purpose
Improve keyboard accessibility for the document tree by implementing F2 navigation to access action buttons (three dots menu and add child button) for both root items and sub-pages.
issues : 1160
Enregistrement.de.l.ecran.2025-12-02.131853.mp4
Proposal
Keyboard Navigation
Changes
Accessibility