Skip to content

Command palette can't search terms starting with 'c' or 'p' #338

Description

@cavidelizade

Summary

You can't type a search in the command palette that starts with "c" or "p". The first keystroke runs a command instead of going into the box.

Where

apps/web/src/components/layout/GlobalCommandPalette.tsx, onInputKeyDown:

if (!e.ctrlKey && !e.metaKey && !e.altKey && e.key.length === 1 && query.trim() === '') {
  const hit = filtered.find((c) => c.shortcut?.toUpperCase() === e.key.toUpperCase());
  if (hit) { e.preventDefault(); hit.run(); return; }
}

Keydown fires before the input's onChange, so with an empty query the first letter is consumed. create-issue uses shortcut C and create-project uses P, so pressing "c" opens the create-work-item modal and "p" navigates to Projects.

Repro

Open the palette, press "c". The create-work-item dialog opens instead of "c" appearing in the search box.

Fix

Only treat a bare letter as a shortcut when it isn't going to land in the search field (for example require a modifier for these single-key shortcuts, or handle them on a separate surface).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions