Skip to content
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

Desktop: Accessibility: Add ARIA information to the sidebar's notebook and tag list #11196

Conversation

personalizedrefrigerator
Copy link
Collaborator

@personalizedrefrigerator personalizedrefrigerator commented Oct 12, 2024

Summary

This pull request:

  • Main goal: Adds appropriate aria information to the sidebar (see WCAG SC 1.3.1, WCAG SC 1.3.6):
    • role=tree is used for the sidebar tag+notebook container.
    • role=treeitem is used for individual items in the tree.
    • aria-level is used to convey notebook depth. The NOTEBOOKS heading has aria-level=1, a toplevel notebook has aria-level=2, a notebook with one parent notebook has aria-level=3.
    • Among other things, this causes NVDA, VoiceOver, and Orca to announce the depth of a notebook.

Additionally:

  • Keyboard accessibility: Makes it possible to expand/collapse the "TAGS"/"NOTEBOOKS" headings with the keyboard.
  • Side-effect of refactoring: Fixes an issue where the :focusElementSidebar command did nothing if both "NOTEBOOKS" and "TAGS" were collapsed.
  • Side-effect of refactoring: Provides screen readers with information about the currently selected item in the sidebar, even if offscreen.
  • Side-effect of refactoring: Fixes an issue where the "NOTEBOOKS" and "TAGS" headers were slightly taller than expected by the note list container.

Remaining issues & future work

  • Skip spacer items when navigating with the keyboard.
  • Fix "NOTEBOOKS" must be reselected after toggling it.
  • Remove tab override on the sidebar and note list.
  • (Optional) Improve focus-visible styling.

Testing plan

  1. Enable the screen reader.
  2. Focus "All Notes"
  3. Press the down arrow until the last notebook has focus.
  4. Move focus to a notebook that has subnotebooks. Expand it if it isn't already expanded.
  5. Toggle the notebook using space.
  6. Toggle the notebook using the arrow keys.
  7. Focus the "NOTEBOOKS" header.
  8. Hide, then show, all notebooks by pressing space.
  9. Hide, then show, all tags using the left/right arrow keys.
  10. Move focus to the "NOTEBOOKS" header.
  11. Open the context menu and create a new notebook using the context menu key.
  12. Make one notebook a subnotebook of another using the context menu key.
  13. Disable the screen reader.
  14. Drag a note from one notebook to another. Verify that the note is moved.

Screen recording comparison: NVDA + Windows

Screencast.from.2024-10-11.17-11-56.webm
Compare with before

Note: Previously, NVDA interacted with the note list in browse mode, due to its lack of a role. As such, NVDA handles the focus, rather than Joplin.

Screencast.from.2024-10-11.17-16-05.webm

@personalizedrefrigerator personalizedrefrigerator changed the title Pr/desktop/sidebar tab accessibility Desktop: Accessibility: Add ARIA information to the sidebar's notebook and tag list Oct 12, 2024
@personalizedrefrigerator personalizedrefrigerator added desktop All desktop platforms accessibility Related to accessibility labels Oct 12, 2024
@laurent22 laurent22 merged commit 38be0e8 into laurent22:dev Oct 15, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility Related to accessibility desktop All desktop platforms
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants