feat: close command palette with the same shortcut#443
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
LGTM — small UX tweak; the key-repeat nit can be addressed in a follow-up.
Extended reasoning...
Overview
This PR makes two small changes to src/features/dashboard/sidebar/command.tsx: (1) the Cmd/Ctrl+K shortcut now toggles the command palette open/closed instead of always opening it, and (2) the CommandList gains scroll-py-3 and symmetric px-1 py-3 padding for a nicer arrow-scroll experience. The PR also drops a stopPropagation() call that is no longer needed.
Security risks
None. Purely client-side UI behavior — no auth, network, or data handling involved.
Level of scrutiny
Low. Single file, ~4 lines of substantive change, isolated to a sidebar UI component. No critical paths, no API surface, no CODEOWNER-sensitive area. The intent matches the title and description exactly.
Other factors
The bug hunting system surfaced one nit: holding Cmd+K past the OS key-repeat delay can flicker the palette at ~30Hz because each repeated keydown now flips state instead of being idempotent. It's a real regression but requires deliberate key-holding to trigger and is a one-line if (event.repeat) return fix — fine to land separately. Inline comment is already attached for visibility.
also closes EN-652