Skip to content

feat(desktop): add command menu (⌘P) - #976

Closed
saddlepaddle wants to merge 1 commit into
mainfrom
satya-patel/triangle
Closed

saddlepaddle wants to merge 1 commit into
mainfrom
satya-patel/triangle

Conversation

@saddlepaddle

@saddlepaddle saddlepaddle commented Jan 26, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Add command menu (⌘P) to desktop app for quick access to commands and navigation
  • Context-aware: shows workspace-specific actions only when in a workspace
  • Displays workspace hotkeys (⌘1-9) next to first 9 workspaces
  • Includes navigation, actions, and workspace switching

Features

  • Workspace Actions: Close workspace, settings, terminal commands (new tab, split pane, clear)
  • Workspaces: Quick switch between workspaces with hotkey display
  • Actions: New workspace, open project, change theme, toggle sidebar
  • Navigation: Settings pages, contact/discord links, check for updates

Test plan

  • Press ⌘P to open command menu
  • Verify workspace actions only show when in a workspace
  • Verify workspace hotkeys (⌘1-9) display correctly
  • Test command execution (navigation, theme toggle, etc.)
  • Verify ESC closes the menu

Summary by CodeRabbit

Release Notes

  • New Features
    • Introduced a command palette accessible via Meta+P for searching and executing commands
    • Added quick workspace switching and management commands
    • Integrated contextual workspace actions including settings, terminal operations, and pane management
    • Navigation and settings shortcuts now accessible through the unified command menu

✏️ Tip: You can customize this high-level summary in your review settings.

- Add CommandMenu component with context-aware commands
- Show workspace-specific actions when in a workspace
- Display workspace hotkeys (⌘1-9) in the workspace list
- Add navigation commands for settings pages
- Include actions like new workspace, change theme, toggle sidebar
- Co-locate CommandMenu with dashboard layout
@coderabbitai

coderabbitai Bot commented Jan 26, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

The PR introduces a Command Menu system for the desktop application, featuring a command palette that integrates with workspaces and contextual commands. It adds keyboard shortcut triggering (meta+p), context-aware command grouping, and command execution handlers with workspace switching, tab management, theme control, and navigation support.

Changes

Cohort / File(s) Summary
Command Menu UI
CommandMenu.tsx, components/index.ts
New CommandMenu component implementing command palette UI that renders command groups with selection/execution, integrated with useCommandContext and useCommandActions.
Command Generation
generators.ts
Defines command group generators for contextual (workspace actions), workspaces (switching), actions (theme, sidebar toggle), and navigation (settings, external links) with hotkey mapping for first nine workspaces.
Command Context Hook
hooks/useCommandContext/...
New hook detecting workspace/settings route context and conditionally fetching workspace data via electronTrpc, exposing CommandContext with workspace and navigation state.
Command Actions Hook
hooks/useCommandActions/...
New hook aggregating command execution map with handlers for workspace operations, tab/pane management, theming, navigation, and special logic for switch-workspace commands.
Type Definitions
types.ts
New module defining Command, CommandGroup, CommandContext, and generic CommandGroupGenerator type for command structure contracts.
Dashboard Integration
layout.tsx
Wires CommandMenu into authenticated dashboard layout with isCommandMenuOpen state controlled by new OPEN_COMMAND_MENU hotkey binding.
Hotkey Configuration
shared/hotkeys.ts
Adds OPEN_COMMAND_MENU hotkey definition (meta+p, category "Help") to global hotkeys registry.

Sequence Diagram

sequenceDiagram
    participant User
    participant Dashboard as Dashboard Layout
    participant CommandMenu
    participant useCommandContext
    participant electronTrpc
    participant useCommandActions
    participant Store as Workspace/<br/>Theme Stores

    User->>Dashboard: Press meta+p
    Dashboard->>CommandMenu: isCommandMenuOpen = true
    CommandMenu->>useCommandContext: Request workspace context
    useCommandContext->>electronTrpc: Fetch workspace data
    electronTrpc-->>useCommandContext: Workspace details
    useCommandContext-->>CommandMenu: CommandContext (workspaceId, name, branch, etc.)
    CommandMenu->>CommandMenu: Build command groups<br/>(contextual, workspaces, actions, navigation)
    CommandMenu->>User: Display command palette
    User->>CommandMenu: Select command
    CommandMenu->>useCommandActions: executeCommand(commandId)
    alt Workspace Switch Command
        useCommandActions->>Store: Switch active workspace
    else Settings/Theme Command
        useCommandActions->>Store: Update theme or navigate
    else Navigation Command
        useCommandActions->>Dashboard: Navigate to settings/external
    end
    useCommandActions->>Dashboard: closeMenu()
Loading

Estimated Code Review Effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly Related PRs

  • #926 — Modifies hotkeys.ts with potential overlapping hotkey definitions or rebindings.
  • #114 — Refactors hotkey infrastructure, related to command menu's keyboard shortcut system.
  • #706 — Wires "new workspace" keyboard action via hotkey, overlaps with command menu's new-workspace command.

Suggested Reviewers

  • CharlieHelps

Poem

🐰 A menu of commands hops into sight,
Meta+P opens magic so bright!
Workspaces leap, themes dance with glee,
Every keyboard shortcut runs free! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat(desktop): add command menu (⌘P)' accurately and concisely summarizes the main feature addition—a new command menu triggered by the ⌘P hotkey for the desktop app.
Description check ✅ Passed The PR description includes a clear summary, detailed feature list, and a test plan. While it doesn't strictly follow all sections of the template (missing explicit 'Type of Change' checkboxes and 'Related Issues'), the core information is well-documented and sufficient.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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.

@Kitenite

Copy link
Copy Markdown
Member

Closing: stale command menu PR from Jan 26. Quick Open / command palette has evolved since (see #2291).

@Kitenite Kitenite closed this Mar 13, 2026
@Kitenite

Copy link
Copy Markdown
Member

Hey — just a heads up, this was closed as part of an automated stale PR cleanup. If you think this was done in error, feel free to reopen it!

@Kitenite

Copy link
Copy Markdown
Member

Hey — this was closed by an automated cleanup of PRs with major merge conflicts that are 3+ weeks old. If you think this was done incorrectly, please feel free to reopen it. Sorry for any inconvenience!

@Kitenite
Kitenite deleted the satya-patel/triangle branch March 15, 2026 16:10
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