Skip to content

fix(app): restore keyboard project switching in open sidebar#18682

Merged
Hona merged 3 commits intoanomalyco:devfrom
Hona:fix-project-switch-enter
Mar 23, 2026
Merged

fix(app): restore keyboard project switching in open sidebar#18682
Hona merged 3 commits intoanomalyco:devfrom
Hona:fix-project-switch-enter

Conversation

@Hona
Copy link
Copy Markdown
Member

@Hona Hona commented Mar 23, 2026

Summary

  • fix the open-sidebar keyboard regression where the hover-card wrapper inserted an extra tab stop before the actual project button
  • keep HoverCard.Trigger wrappers out of the tab order so Tab lands on the real interactive child and Enter activates it normally
  • add an e2e regression for the first tabbed Enter path in the open sidebar project list

Root Cause

  • Kobalte's HoverCard.Trigger is implemented via LinkRoot
  • when rendered as a non-a element, it gets tabIndex=0
  • our @opencode-ai/ui/hover-card wrapper rendered the trigger as a div, so the wrapper itself became focusable and intercepted keyboard tab order before the nested project button

Verification

  • ran bun typecheck in packages/app
  • ran bun typecheck in packages/ui
  • ran bun test:e2e -- -g \"open sidebar project switch activates on first tabbed enter\" in packages/app (blocked locally because the backend at 127.0.0.1:4096 was unavailable)

Copilot AI review requested due to automatic review settings March 23, 2026 00:16
@Hona Hona requested a review from adamdotdevin as a code owner March 23, 2026 00:16
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves keyboard accessibility in the app’s sidebar by allowing collapsed sidebar project avatars to activate on Enter, aligning keyboard and click behavior and adding an E2E regression test to prevent future breakage.

Changes:

  • Refactors sidebar project activation into a shared open() handler and wires it to both onClick and onKeyDown(Enter).
  • Prevents default/propagation on Enter to ensure consistent activation from keyboard focus.
  • Adds an E2E test covering project switching via Enter in the collapsed sidebar.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/app/src/pages/layout/sidebar-project.tsx Adds Enter key handling and reuses a unified open() action for both click and keyboard activation.
packages/app/e2e/sidebar/sidebar-popover-actions.spec.ts Adds an E2E regression test that focuses a collapsed-sidebar project avatar and switches projects via Enter.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Hona Hona changed the title fix(app): switch sidebar projects on enter fix(app): restore keyboard project switching in open sidebar Mar 23, 2026
@Hona Hona enabled auto-merge (squash) March 23, 2026 00:34
@Hona Hona merged commit afe9b97 into anomalyco:dev Mar 23, 2026
9 checks passed
burn2delete pushed a commit to burn2delete/symbolic that referenced this pull request Mar 24, 2026
Andres77872 pushed a commit to Andres77872/opencode that referenced this pull request Mar 26, 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.

2 participants