Skip to content

Accessibility fixes#621

Merged
lawsie merged 7 commits into
flipcomputing:mainfrom
lawsie:accessibility-fixes
May 13, 2026
Merged

Accessibility fixes#621
lawsie merged 7 commits into
flipcomputing:mainfrom
lawsie:accessibility-fixes

Conversation

@lawsie
Copy link
Copy Markdown
Collaborator

@lawsie lawsie commented May 11, 2026

Summary

Small accessibility fixes for the keyboard accessibility UI based on feedback.

  • Moved accessibility.js file to the /accessibility folder and renamed it to keyboardui.js to be clearer
  • Add scope to keyboard shortcuts table to help screen readers
  • Make the UI behind the AreaManager overlay inert (helps screen readers)
  • Restore the previous focus if the user cancels the AreaManager menu without selecting an area

AI Usage

Claude Sonnet 4.6 used for advice and code fixes.

Summary by CodeRabbit

  • Accessibility Improvements
    • Improved overlay keyboard behavior: overlays now manage focus more reliably, record/restore prior focus, and make background content non-interactive while open.
    • Modal/table semantics enhanced for better screen reader support.
    • More consistent inert/focus handling to streamline keyboard navigation and modal interactions.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 11, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: da24e6de-32e3-4e91-9178-b1db7aae407a

📥 Commits

Reviewing files that changed from the base of the PR and between 9eb0fda and b5fb1b6.

📒 Files selected for processing (2)
  • accessibility/keyboardui.js
  • main/main.js
🚧 Files skipped from review as they are similar to previous changes (2)
  • main/main.js
  • accessibility/keyboardui.js

📝 Walkthrough

Walkthrough

Module reorganization consolidates keyboard UI exports (ShortcutsPanel, GizmoMenuManager) into accessibility/keyboardui.js, corrects internal imports from ../main/* paths, strengthens AreaManager overlay with focus and inert handling, adds scope="rowgroup" to a shortcuts table header, and updates consumers' imports.

Changes

Keyboard UI Consolidation & Focus Management

Layer / File(s) Summary
Keyboard UI Module Core Changes
accessibility/keyboardui.js
Import paths corrected to ../main/*; overlay hidden initialization uses classList.add("hidden"); AreaManager.toggle(show) now records/restores focused element, inerts non-overlay body children on show and restores them on hide; ShortcutsPanel category <th> gets scope="rowgroup".
Consumer Import Updates
main/main.js, ui/addmenu.js, ui/gizmos.js
ShortcutsPanel and GizmoMenuManager imports updated to source from ../accessibility/keyboardui.js.

Sequence Diagram

sequenceDiagram
  participant User
  participant AreaManager
  participant BodyChildren
  participant FocusStore
  User->>AreaManager: toggle(true)
  AreaManager->>FocusStore: store previouslyFocused element
  AreaManager->>BodyChildren: set inert=true (except overlay)
  AreaManager->>AreaManager: focus overlay asynchronously
  User->>AreaManager: toggle(false)
  AreaManager->>BodyChildren: restore inert states
  AreaManager->>FocusStore: restore focus to previouslyFocused element
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

codex

Poem

🐰 I hopped through modules, tidy and spry,
Moved shortcuts and gizmos to one cozy sky,
I captured the focus, made backgrounds inert,
Returned every glance where it once did convert—
A grateful rabbit waves a keyboard goodbye.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Accessibility fixes' is vague and generic, lacking specificity about the nature of the fixes implemented in the changeset. Consider a more descriptive title like 'Move keyboard accessibility UI to dedicated module and improve screen reader support' to clarify the main changes.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@accessibility/keyboardui.js`:
- Around line 45-54: When toggling the overlay you currently force all
non-overlay body children to inert=true and later unconditionally set
inert=false; instead record each element's prior inert value when opening (e.g.
store a Map on the AreaManager instance like this._previousInertStates keyed by
element) and on close restore each element's inert to its saved boolean, then
clear the map; update the code around the overlay focus logic (references:
this.previousFocus and this.overlay) to save states before setting inert and to
restore them instead of blindly flipping them to false.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: cf167786-86f4-4265-9b7e-26944ec16b50

📥 Commits

Reviewing files that changed from the base of the PR and between f51576d and 9eb0fda.

📒 Files selected for processing (4)
  • accessibility/keyboardui.js
  • main/main.js
  • ui/addmenu.js
  • ui/gizmos.js

Comment thread accessibility/keyboardui.js
@lawsie lawsie merged commit d4c41a8 into flipcomputing:main May 13, 2026
9 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant