Add command palette (Ctrl/Cmd+P) with action search and fuzzy file search - #1415
Open
magnusrodseth wants to merge 1 commit into
Open
Add command palette (Ctrl/Cmd+P) with action search and fuzzy file search#1415magnusrodseth wants to merge 1 commit into
magnusrodseth wants to merge 1 commit into
Conversation
magnusrodseth
force-pushed
the
feat/command-palette
branch
from
July 24, 2026 09:08
6d99a3f to
5842d3e
Compare
magnusrodseth
marked this pull request as ready for review
July 24, 2026 09:20
magnusrodseth
force-pushed
the
feat/command-palette
branch
from
July 25, 2026 14:18
5842d3e to
6e8777c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Implements the command palette proposed in #1414.
Ctrl+P(Cmd+Pon macOS) opens an overlay with two levels. The root level lists every keybindable action that applies in the current context, showing each action's current combo. A pinned entry, "Search files...", drills into a fuzzy file search over the current folder. The two-level design keeps the root palette uncluttered instead of mixing dozens of filenames into the action list on the first keystroke.Design choices, following the plan in the issue since the questions there are still open:
KEYBIND_DEFINITIONSplus the user's remaps, so labels and combos stay in sync with Settings > Keybinds automatically, andopen_command_paletteitself is a regular rebindable action that shows up there like any other.shouldFireguards the keyboard hub uses, so in the library you only see library-applicable actions and in the editor the editor ones. Execution reuses the exact handler map fromuseKeyboardShortcutsthrough a small runner registered in the UI store (same pattern ascustomEscapeHandler), so palette execution and keybind execution cannot drift apart.src/utils/fuzzyMatch.ts, under 50 lines) with bonuses for consecutive and word-start matches, in keeping with howcomputeSortedLibraryhand-rolls its matching today. No new dependencies.ConfirmModal(overlay, mount/show transitions, theme variables) andDropdown(list styling). Escape backs out one level (files, then root, then closed), Backspace on an empty query in file mode also goes back, arrows navigate with wraparound, Enter executes.Opening as a draft while the design questions in #1414 are unanswered. Happy to adjust scope or details, or drop it entirely if a palette is not wanted.
Closes #1414
Type of Change
Changes Made
src/utils/keyboardUtils.ts: newopen_command_palettedefinition (Ctrl+P, library section)src/utils/fuzzyMatch.ts(new): subsequence scorer returning a score plus matched character positionssrc/store/useUIStore.ts:isCommandPaletteOpenflag and akeybindActionRunnerslotsrc/hooks/useKeyboardShortcuts.ts: handler for the new action, palette flag added to the modal guard, runner registration exposingcanRun/runover the existing handler mapsrc/components/modals/CommandPaletteModal.tsx(new): the palette itselfsrc/components/modals/AppModals.tsx: palette registration, wired tohandleImageSelectsrc/i18n/locales/*.json: 7 new keys in all 12 localesScreenshots/Videos
Screenshots of the root palette, fuzzy action filtering, and file search mode to follow.
Testing
Verified in the macOS dev build:
Ctrl+Popens the palette from both library and editor views, and respects the existing modal and input-focus guardstoggle_presets, which is correctly only offered while an image is open)npm run buildandprettier --checkpass on the changed files.tsc,eslintandi18n:checkoutputs were diffed against main and show no new issues (all three already fail on current main)Test Configuration:
Checklist
Additional Notes
Ctrl+Pis currently unbound (toggle_presetsis bareP, and the combo system distinguishes modifiers), so there is no conflict. Android behavior is unchanged since the palette only opens via the keybind. Related groundwork lives in #1413, which touches the same registry; if both land, the later one needs a trivial rebase inuseKeyboardShortcuts.tsand the locale files.AI Disclaimer:
Please state the involvement of AI in this PR: