Skip to content

Add Ctrl+K / Cmd+K shortcut to open the Command Palette #107

Description

@alimaandev

Summary

desktop/src/components/command/CommandPalette.tsx already handles Escape/ArrowUp/ArrowDown/Enter once open (lines ~46-52), but there is no global keyboard shortcut to OPEN it.

Goal

Add a global keydown listener that opens the command palette on Ctrl+K (Windows/Linux) or Cmd+K (macOS). The listener should live in the component that mounts the palette (e.g. App or LeftSidebar), and should be cleaned up on unmount.

Tasks

  • Add a keydown listener for \metaKey || ctrlKey + 'k'\
  • Call \e.preventDefault()\ to avoid browser defaults
  • Open the palette; guard against double-opening if already open
  • Add/extend a Vitest test for the shortcut

Acceptance criteria

  • Ctrl+K opens the palette; Escape still closes it
  • Listener is removed on unmount (no leaks)
  • Existing palette keyboard navigation unchanged

Labels

good first issue, help wanted

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions