Skip to content

Command palette (⌥⌘P): find and run any command by name - #200

Open
Fvzion wants to merge 1 commit into
robbietilton:mainfrom
Fvzion:feature/command-palette
Open

Fvzion wants to merge 1 commit into
robbietilton:mainfrom
Fvzion:feature/command-palette

Conversation

@Fvzion

@Fvzion Fvzion commented Sep 30, 2026

Copy link
Copy Markdown

The problem today

Compositor has a lot of menu commands. Finding one you rarely use (a filter, an adjustment layer, a Select command) means remembering which menu it's in and opening them one by one.

What changes for the user

⌥⌘P (View › Command Palette…) opens a small search window, as in Raycast, Obsidian or VS Code:

  • type a few letters (gauss, curves, trim): commands are ranked fuzzily, with word starts and runs first;
  • each row shows the command's menu path and shortcut, greyed when it can't be used right now;
  • tools are listed too ("Tool › Brush");
  • arrows move, Return runs, Escape or a click elsewhere closes.

It reads the live menu bar, so any command added later appears in it with no extra work. The shortcut is listed in Keyboard Shortcuts and can be changed.

How to try it

  1. Open a photo, press ⌥⌘P, type gauss, press Return: Gaussian Blur opens.
  2. Press ⌥⌘P, type brush, press Return: the Brush tool is selected.

In the code

  • UI/CommandPalette.swift: the fuzzy ranking, and reading entries from the main menu (it asks each menu to update first, since SwiftUI only refreshes titles and enabled state when a menu is about to open). The app, Services and Window menus are left out.
  • UI/CommandPaletteView.swift: the panel, which closes before running a command so it acts on the editor window.
  • CommandPaletteTests (11 tests), including against the app's real menu bar.

Can be trimmed

The View item can go; the shortcut works without it. This one adds surface, so I'd understand if it isn't a fit.

Tested on macOS 26.6 (Apple silicon): the full test suite passes. Not yet tried on macOS 27.

🤖 Generated with Claude Code

View › Command Palette… opens a small search window, as in Raycast or
Obsidian. It lists every command in the menu bar, read live from the
main menu (so new commands appear by themselves) with its menu path and
shortcut, greyed when disabled, and every tool. Typing ranks them
fuzzily (letters in order, word starts and runs first); arrows move,
Return runs, Escape closes. The shortcut is listed in Keyboard
Shortcuts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant