Skip to content

[Feature Request] Per-prompt keyboard shortcuts + quick-fire palette for the Prompt Library #80

Description

@adamatan

Use case

Firing a saved prompt today means opening the Prompts dropdown and clicking
it, every time. For prompts I use dozens of times a day (nudge an agent to
run tests, ask for a summary, etc.) that's a lot of mousing for something
that should be a single keystroke.

Proposed behavior

Two new shortcuts on top of the existing Prompt Library:

  • ⌘R (leader key) + a letter/number — press ⌘R to arm a transient
    "press a key" mode (shown as a hint pill), then press the prompt's
    assigned key to fire it straight at the focused agent tab. Falls back to
    a destination picker if there's no focused live agent to fire into.
    Cancels on Escape, an unmapped key, or ~2s idle.
  • ⇧⌘R — opens a searchable command palette of all prompts (fuzzy
    filter by title), Enter fires the highlighted one through the same
    destination logic as the leader-key path.

Each prompt gets a trigger key: an optional manual override, else the next
free slot in a default 1-9, a-z sequence, assigned stably so keys don't
shift around as prompts are enabled/disabled. Trigger keys are configurable
per-prompt in Settings → Prompts and shown as badges in the Prompts
dropdown and the palette.

Where it'd live

  • src/lib/shortcuts.tseffectiveTriggerKeys(): override-first, then
    stable auto-assignment over free 1-9/a-z slots.
  • src/lib/promptFire.ts (new) — shared fireOrPickDestination() so the
    leader-key shortcut, palette, and dropdown all resolve the destination
    agent identically.
  • src/hooks/useShortcuts.ts — leader-key arm/disarm state machine,
    capture-phase keydown + stopImmediatePropagation so the follow-up key
    is intercepted before a focused terminal/editor sees it.
  • src/components/dialogs/PromptDestinationDialog.tsx (new) — destination
    picker for when a prompt can't auto-resolve one.
  • src/components/dialogs/PromptPalette.tsx (new) — the ⇧⌘R palette.
  • src/store/prompts.ts / src/store/ui.ts — persisted per-prompt
    triggerKeys, palette/quick-fire UI state.
  • src/components/settings/PromptLibrarySection.tsx — shortcut recorder
    for per-prompt override keys.
  • docs/shortcuts.md — documents the leader-key mechanism.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions