fix(web): make sidebar project actions reachable by keyboard and screen reader - #5521
fix(web): make sidebar project actions reachable by keyboard and screen reader#5521akj wants to merge 3 commits into
Conversation
…en reader The per-project actions button in the 'Filter threads by project' menu was nested inside a menuitemradio, where ARIA menus cannot focus it: arrow keys move between items, Enter activates the radio, and screen readers flatten the button's label into the item's accessible name. Project settings (remove, rename, grouping) were mouse-only. Open project actions from a contextmenu event on the menu item itself, so Shift+F10 and the Context Menu key work the same way they already do on thread rows. The ellipsis button stays as a mouse-only affordance, hidden from assistive tech so item names announce cleanly. Fixes the remaining half of pingdotgg#1399.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
ApprovabilityVerdict: Approved 28b51a8 Accessibility fix that adds keyboard/screen reader support for sidebar project actions. Changes are limited to adding contextmenu handlers, proper ARIA attributes, and a defensive workaround for a Safari/macOS browser quirk. No business logic or runtime behavior changes beyond the intended accessibility improvements. You can customize Macroscope's approvability policy. Learn more. |
On macOS, Ctrl+click fires contextmenu and Safari also fires a follow-up click on the same element. That click could activate the radio item and change the project filter underneath the settings dialog. stopPropagation on contextmenu cannot block the separate click event, so briefly suppress scope changes after project actions open.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ac834d8. Configure here.
The 500ms suppression window could in principle swallow a legitimate filter selection. Suppress exactly one scope change instead, clearing the flag whenever the menu reopens: a real selection always starts by reopening the menu, so only the Safari ghost click after Ctrl+click can ever be suppressed.

What Changed
Project actions in the sidebar's "Filter threads by project" menu are now reachable by keyboard and screen reader:
aria-hidden,tabIndex={-1}), so screen readers announce each item as just the project name instead of appending phantom "Project actions for…" text.9 insertions, 2 deletions in
apps/web/src/components/SidebarV2.tsx. No visual changes.Why
The ellipsis button was nested inside a
MenuRadioItem(role="menuitemradio"). ARIA menus move focus between items with arrow keys and cannot focus a child of an item, Enter activates the radio, and screen readers flatten the button's label into the item's accessible name — so every project-level action (including Remove project) was mouse-only, and items announced incorrectly to screen readers. Full analysis in #1399 (current-state comment); this fixes the remaining half of that issue.Attaching the handler to the menu item's native
contextmenuevent mirrors the pattern thread rows in the same sidebar already use, and works because Base UI menu items hold real DOM focus while highlighted (verified againstuseListNavigationin@base-ui/react—virtualdefaults to false), so Shift+F10 dispatchescontextmenuat the focused item.UI Changes
No visual changes — the menu renders identically; only keyboard/AT interaction changed. Verified with NVDA on Windows 11 in the Electron dev build: arrowing through the filter menu announces clean project names, Shift+F10/Context Menu key on a project item opens the Project settings dialog with all actions (rename, grouping, remove) reachable, and Enter still selects the filter as before. Mouse behavior (click ellipsis, click item) is unchanged.
Checklist
Note
Low Risk
Sidebar-only accessibility and event-handling tweaks; no auth, data, or API changes.
Overview
Project settings in the “Filter threads by project” menu are now reachable without the mouse: each project row handles
onContextMenu(right-click, Shift+F10, or Context Menu key) and reuseshandleProjectActionsto open the existing Project settings dialog, matching thread rows in the same sidebar.The per-project ellipsis stays for pointer users but is
aria-hiddenwithtabIndex={-1}so screen readers announce only the project name instead of nested “Project actions…” inside amenuitemradio.Opening actions from a row can still fire a follow-up radio
onValueChange(notably macOS Safari after Ctrl+click). AsuppressNextScopeChangeRefskips that single scope update when opening project actions and resets when the filter menu opens again so normal filtering is unchanged.Reviewed by Cursor Bugbot for commit 28b51a8. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Make sidebar project actions reachable by keyboard and screen reader in
SidebarV2MenuRadioItemis now hidden from keyboard focus and assistive tech (tabIndex={-1},aria-hidden="true"), so keyboard/screen reader users are no longer stuck on it.suppressNextScopeChangeRefflag prevents an unintended scope change from firing after project actions are triggered via click or context menu.Macroscope summarized 28b51a8.