feat(desktop): Add keyboard shortcuts to switch projects (Cmd+1, Cmd+2, etc.) #8361

Open
opened 2026-02-16 18:09:46 -05:00 by yindo · 1 comment
Owner

Originally created by @athal7 on GitHub (Feb 2, 2026).

Originally assigned to: @adamdotdevin on GitHub.

Summary

Add keyboard shortcuts to quickly switch between open projects in the desktop app using Cmd+1 through Cmd+9 (or Ctrl+1-9 on Windows/Linux).

Use Case

When working with multiple projects open in the desktop app, users need a fast way to switch between them without using the mouse. This is a common UX pattern in:

  • VS Code (Cmd+1-9 switches editor tabs)
  • Chrome/Safari/Firefox (Cmd+1-9 switches browser tabs)
  • Terminal apps like iTerm2

Proposed Implementation

  1. Add a "Window" menu with numbered project entries (like browser tab lists)
  2. Register global shortcuts Cmd+1 through Cmd+9 to switch to projects by their order in the project list
  3. Show the shortcut hint next to each project in the menu

Technical Notes

The desktop package uses Tauri with @tauri-apps/api/menu for menu management. Shortcuts can be added via the accelerator property on MenuItem:

await MenuItem.new({
  text: "Project 1",
  accelerator: "CmdOrCtrl+1",
  action: () => switchToProject(0),
})

Acceptance Criteria

  • Cmd+1 through Cmd+9 switch to projects 1-9 respectively
  • Works on macOS (Cmd) and Windows/Linux (Ctrl)
  • Projects are ordered by most recently opened or alphabetically (TBD)
  • Menu shows current project with a checkmark
  • Shortcuts are discoverable in a "Window" or "Projects" menu
Originally created by @athal7 on GitHub (Feb 2, 2026). Originally assigned to: @adamdotdevin on GitHub. ## Summary Add keyboard shortcuts to quickly switch between open projects in the desktop app using Cmd+1 through Cmd+9 (or Ctrl+1-9 on Windows/Linux). ## Use Case When working with multiple projects open in the desktop app, users need a fast way to switch between them without using the mouse. This is a common UX pattern in: - VS Code (Cmd+1-9 switches editor tabs) - Chrome/Safari/Firefox (Cmd+1-9 switches browser tabs) - Terminal apps like iTerm2 ## Proposed Implementation 1. Add a "Window" menu with numbered project entries (like browser tab lists) 2. Register global shortcuts Cmd+1 through Cmd+9 to switch to projects by their order in the project list 3. Show the shortcut hint next to each project in the menu ### Technical Notes The desktop package uses Tauri with `@tauri-apps/api/menu` for menu management. Shortcuts can be added via the `accelerator` property on `MenuItem`: ```ts await MenuItem.new({ text: "Project 1", accelerator: "CmdOrCtrl+1", action: () => switchToProject(0), }) ``` ## Acceptance Criteria - [ ] Cmd+1 through Cmd+9 switch to projects 1-9 respectively - [ ] Works on macOS (Cmd) and Windows/Linux (Ctrl) - [ ] Projects are ordered by most recently opened or alphabetically (TBD) - [ ] Menu shows current project with a checkmark - [ ] Shortcuts are discoverable in a "Window" or "Projects" menu
yindo added the web label 2026-02-16 18:09:46 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 2, 2026):

For keybind-related issues, please also check our pinned keybinds documentation: #4997

@github-actions[bot] commented on GitHub (Feb 2, 2026): For keybind-related issues, please also check our pinned keybinds documentation: #4997
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8361