Skip to content

Add keyboard access to sidebar action menus - WIP#1558

Open
shivamhwp wants to merge 1 commit intopingdotgg:mainfrom
shivamhwp:sidebar-inaccesibilty-fix
Open

Add keyboard access to sidebar action menus - WIP#1558
shivamhwp wants to merge 1 commit intopingdotgg:mainfrom
shivamhwp:sidebar-inaccesibilty-fix

Conversation

@shivamhwp
Copy link
Copy Markdown
Collaborator

@shivamhwp shivamhwp commented Mar 29, 2026

  • Support context-menu key and Shift+F10 on threads and projects
  • Expose thread and project action menus in the sidebar UI
  • Factor shared sidebar action handlers into reusable helpers

fixed #1399

What Changed

This fixes the sidebar context-menu accessibility bug for projects and threads.

  • Added explicit action menu triggers for each project row and thread row so actions are reachable by keyboard-only and screen reader users without relying on right-click.
  • Wired Shift+F10 and the ContextMenu key on focused sidebar rows to open the same action menu.
  • Kept existing mouse right-click behavior intact.
  • Preserved thread multi-select behavior in the thread actions menu.
  • Extracted the keyboard context-menu key detection into shared sidebar logic and added regression coverage for it.

Why

Sidebar-only actions like rename, remove project, copy path, and delete were effectively inaccessible to users who cannot use a mouse.

The old behavior depended on native context-menu gestures, which are not a sufficient accessible entry point for keyboard-only users or screen reader users. This change fixes that by giving each sidebar item a proper focusable actions control and by supporting the standard keyboard context-menu shortcuts on the focused row.

This keeps the fix small and focused while solving the actual accessibility issue instead of only patching one interaction path.

UI Changes

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Medium Risk
Moderate UI/interaction change in the sidebar that alters how thread/project actions (including delete/remove) are triggered, which could introduce regressions in selection state or action routing.

Overview
Adds keyboard-accessible action menus to sidebar thread rows and project headers via new ellipsis Menu triggers, making rename/copy/delete/remove actions reachable without right-click and providing screen-reader aria-labels.

Implements support for the ContextMenu key and Shift+F10 to open the appropriate action menu on focused rows using shared isKeyboardContextMenuKey, and refactors existing context-menu handlers into reusable helpers for single vs multi-select thread actions and project actions.

Includes new unit coverage for isKeyboardContextMenuKey in Sidebar.logic.test.ts.

Written by Cursor Bugbot for commit 9e9578e. This will update automatically on new commits. Configure here.

Note

Add keyboard access to sidebar action menus via Context Menu key and Shift+F10

  • Adds ellipsis (EllipsisIcon) action menu buttons to thread rows and project headers in Sidebar.tsx, exposing actions (rename, mark unread, copy path, delete, etc.) previously only available via native context menus.
  • Pressing the Context Menu key or Shift+F10 on a focused thread row or project header programmatically clicks the corresponding action menu trigger, detected via the new isKeyboardContextMenuKey util in Sidebar.logic.ts.
  • Clicking a thread's action menu while an unrelated multi-select is active clears the selection first to prevent unintended bulk actions.
  • Refactors existing context menu handlers to delegate to shared callbacks without changing action semantics.

Macroscope summarized 9e9578e.

- Support context-menu key and Shift+F10 on threads and projects
- Expose thread and project action menus in the sidebar UI
- Factor shared sidebar action handlers into reusable helpers
@github-actions github-actions bot added size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Mar 29, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 29, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 30c5b9f3-656b-4fb1-8a48-fc8f0de4db8d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ 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.

@shivamhwp shivamhwp changed the title Add keyboard access to sidebar action menus Add keyboard access to sidebar action menus - WIP Mar 29, 2026
Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Remove project
</MenuItem>
</MenuPopup>
</Menu>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Project action trigger uses wrong data attribute for visibility

Medium Severity

The project action menu trigger uses SidebarMenuAction with showOnHover, which applies md:opacity-0 and relies on data-[state=open]:opacity-100 to stay visible while the menu is open. However, Base UI's MenuTrigger sets data-popup-open (not data-state=open) when the popup is open. Since the menu popup renders in a portal (removing group-focus-within/menu-item too), the trigger button disappears on desktop when the menu opens. The thread action button avoids this by using data-[popup-open]:opacity-100 directly in its className.

Fix in Cursor Fix in Web

Copy link
Copy Markdown
Contributor

@nmggithub nmggithub left a comment

Choose a reason for hiding this comment

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

@shivamhwp these keyboard shortcuts are built into Windows. I just tried Shift+F10 in Windoes Parallels and it worked perfectly. I'm not sure what the consequences are of adding this on top. The issue author may have some other issue on their end if Shift+F10.

@shivamhwp
Copy link
Copy Markdown
Collaborator Author

@nmggithub one issue that i found is that user is unable to load context menu using tab. which i am seeing in mac. so that fix. in case there is some other issue i'll close the pr. wdyt ?

@nmggithub
Copy link
Copy Markdown
Contributor

nmggithub commented Mar 29, 2026

@nmggithub one issue that i found is that user is unable to load context menu using tab. which i am seeing in mac. so that fix. in case there is some other issue i'll close the pr. wdyt ?

Not sure what you're saying here. Tab navigates between items, it doesn't, on its own, open the context menu. Can you clarify what exact actions you are taking so I can test on my end?

@shivamhwp
Copy link
Copy Markdown
Collaborator Author

shivamhwp commented Mar 29, 2026

image

so in here using tab, i have no option to open the context menu. like, am i making it clear ??

@nmggithub
Copy link
Copy Markdown
Contributor

nmggithub commented Mar 29, 2026

image so in here using tab, i have no option to open the context menu. like, am i making it clear ??

Are you talking about a visual indicator, or that Shift+F10 doesn't work?

  1. We shouldn't have visual indicators for allowing the opening of a context menu. That's not a common paradigm.
  2. Shift+F10 does not work on Mac because it's not a Mac keyboard shortcut. It's a Windows one. The issue author is on Windows. We should not make the shortcut work on non-Windows platforms. And, since it is already built into Windows, we shouldn't have to define it at all. If it's not working on the issue author's machine, that's indicative of some other thing on their end. It should be working because its built into Windows. Adding it manually is not the correct solution here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sidebar context menus are inaccessible to screen reader and keyboard-only users

2 participants