[PR #13610] feat(desktop): add keyboard shortcuts to switch projects (Cmd+1-9) #14735

Open
opened 2026-02-16 18:19:30 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/13610

State: open
Merged: No


What does this PR do?

Adds Mod+1 through Mod+9 keyboard shortcuts to switch between sidebar projects, similar to browser tab
switching (Chrome, VS Code).

This is a rework of #11847 based on review feedback from @alexyaroshuk. The original approach used a
macOS-only Window menu with CustomEvent — this version instead:

  • Registers 9 commands (project.switch.0–project.switch.8) via the existing command.register() system in
    layout.tsx
  • Uses mod+1–mod+9 keybinds which are cross-platform (Cmd on macOS, Ctrl on Windows/Linux)
  • Integrates with Settings > Shortcuts for user customization
  • Adds TooltipKeybind on each sidebar project tile showing the project name and keybind
  • Adds command.project.switch i18n string across all 15 supported languages

Closes #11837
Supersedes #11847

How did you verify your code works?

  • Typecheck passes (12/12 packages)
  • Tested switching between projects using Mod+1-9 in the desktop app
  • Verified tooltips appear on hover with correct keybind displayed
Screenshot 2026-02-14 at 7 00 03 AM
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/13610 **State:** open **Merged:** No --- ### What does this PR do? Adds Mod+1 through Mod+9 keyboard shortcuts to switch between sidebar projects, similar to browser tab switching (Chrome, VS Code). This is a rework of #11847 based on review feedback from @alexyaroshuk. The original approach used a macOS-only Window menu with CustomEvent — this version instead: - Registers 9 commands (project.switch.0–project.switch.8) via the existing command.register() system in layout.tsx - Uses mod+1–mod+9 keybinds which are cross-platform (Cmd on macOS, Ctrl on Windows/Linux) - Integrates with Settings > Shortcuts for user customization - Adds TooltipKeybind on each sidebar project tile showing the project name and keybind - Adds command.project.switch i18n string across all 15 supported languages Closes #11837 Supersedes #11847 ### How did you verify your code works? - Typecheck passes (12/12 packages) - Tested switching between projects using Mod+1-9 in the desktop app - Verified tooltips appear on hover with correct keybind displayed <img width="141" height="61" alt="Screenshot 2026-02-14 at 7 00 03 AM" src="https://github.com/user-attachments/assets/c0e9a931-6709-4cfe-bda9-e2fd62c620b9" />
yindo added the pull-request label 2026-02-16 18:19:30 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#14735