Global command palette (Ctrl+K) with plugin-contributed sources #44

Merged
parkerhdavis merged 2 commits from command-palette into main 2026-06-01 15:22:20 -06:00
parkerhdavis commented 2026-06-01 15:22:14 -06:00 (Migrated from github.com)

What

A Ctrl+K command palette to jump to anything — catalog assets, workspaces, navigation/commands — plus a plugin extension point that the Music Library uses to search albums/artists.

How

Core palette

  • Backend search_assets(query, limit) reuses list_assets_impl with a path substring + limit (serde defaults fill the rest), searching every root independent of the current view's filters.
  • CommandPalette overlay (portal, mounted in Layout for router context): search box, grouped results, full keyboard nav (arrows/Enter/Esc, hover-to-highlight). Asset search is debounced; commands and workspaces filter in-memory.
  • Ctrl/Cmd+K toggles it — handled before the editable-element guard so it works while focus is in a text field; while open it owns the keyboard so app-level shortcuts don't also fire. Listed in Keybinds.

Plugin contribution point

  • A PaletteSourceContribution (id, group, async search → items) joins workflows/automation-steps/globals in the plugin model, gated by the same enable/disable filtering.
  • The palette queries enabled sources in parallel (debounced) and groups their results; re-resolves on plugin toggle.
  • The Music Library registers a source that searches the audio library by album and artist (full library cached ~30s) and navigates into the music workspace's ?album= / ?artist= views. Returns nothing when there's no music workspace.

Testing

tsc, Biome, full-repo lint, cargo check, and the assets unit tests pass. Verified via make dev: palette opens from anywhere (incl. while typing in the filter box), keyboard nav + select work across all groups, and Music albums/artists appear under a Music group and route correctly.

## What A Ctrl+K command palette to jump to anything — catalog assets, workspaces, navigation/commands — plus a plugin extension point that the Music Library uses to search albums/artists. ## How **Core palette** - Backend `search_assets(query, limit)` reuses `list_assets_impl` with a path substring + limit (serde defaults fill the rest), searching every root independent of the current view's filters. - `CommandPalette` overlay (portal, mounted in Layout for router context): search box, grouped results, full keyboard nav (arrows/Enter/Esc, hover-to-highlight). Asset search is debounced; commands and workspaces filter in-memory. - `Ctrl/Cmd+K` toggles it — handled before the editable-element guard so it works while focus is in a text field; while open it owns the keyboard so app-level shortcuts don't also fire. Listed in Keybinds. **Plugin contribution point** - A `PaletteSourceContribution` (`id`, `group`, async `search → items`) joins workflows/automation-steps/globals in the plugin model, gated by the same enable/disable filtering. - The palette queries enabled sources in parallel (debounced) and groups their results; re-resolves on plugin toggle. - The Music Library registers a source that searches the audio library by album and artist (full library cached ~30s) and navigates into the music workspace's `?album=` / `?artist=` views. Returns nothing when there's no music workspace. ## Testing `tsc`, Biome, full-repo lint, `cargo check`, and the assets unit tests pass. Verified via `make dev`: palette opens from anywhere (incl. while typing in the filter box), keyboard nav + select work across all groups, and Music albums/artists appear under a Music group and route correctly.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
parker/garnet!44
No description provided.