tui: command palette with fuzzy search #18

Closed
opened 2026-04-11 13:02:14 +00:00 by charles · 0 comments
Owner

User story

As a user, I want a command palette to search and execute any action by name, so that I can use features without memorising every key binding.

Acceptance criteria

Activation

  • : or Ctrl+P from any screen pushes the command palette overlay
  • Esc closes it without executing anything
  • The underlying screen remains rendered behind a dimmed overlay with a centered input box

Action registry

  • ActionRegistry collects Action { id, name, screen_scope: Option<Screen>, default_binding: Option<KeyCombo>, invoke: Box<dyn Fn(&mut AppCtx)> }
  • Every screen contributes its actions during construction
  • Each action appears once; duplicates cause a panic in debug builds

Search UX

  • Fuzzy match via nucleo over name; results ranked by match score
  • Each result row shows: action name, current keybind (if any), screen scope
  • j/k and arrow keys move selection; Enter executes and closes the overlay
  • Typing an empty query shows all actions sorted alphabetically

Tests

  • Unit test: registry rejects duplicate action ids
  • Unit test: fuzzy matcher returns generate.run before generate.stop when searching "run"

Out of scope

  • Action definitions for screens that don't exist yet (added incrementally per screen ticket)
  • Keybinds table (separate ticket)

References

  • Spec §2.3 "Command palette"
  • Spec §4.10 "Command Palette"
## User story As a user, I want a command palette to search and execute any action by name, so that I can use features without memorising every key binding. ## Acceptance criteria ### Activation - [ ] `:` or `Ctrl+P` from any screen pushes the command palette overlay - [ ] `Esc` closes it without executing anything - [ ] The underlying screen remains rendered behind a dimmed overlay with a centered input box ### Action registry - [ ] `ActionRegistry` collects `Action { id, name, screen_scope: Option<Screen>, default_binding: Option<KeyCombo>, invoke: Box<dyn Fn(&mut AppCtx)> }` - [ ] Every screen contributes its actions during construction - [ ] Each action appears once; duplicates cause a panic in debug builds ### Search UX - [ ] Fuzzy match via `nucleo` over `name`; results ranked by match score - [ ] Each result row shows: action name, current keybind (if any), screen scope - [ ] `j`/`k` and arrow keys move selection; `Enter` executes and closes the overlay - [ ] Typing an empty query shows all actions sorted alphabetically ### Tests - [ ] Unit test: registry rejects duplicate action ids - [ ] Unit test: fuzzy matcher returns `generate.run` before `generate.stop` when searching "run" ## Out of scope - Action definitions for screens that don't exist yet (added incrementally per screen ticket) - Keybinds table (separate ticket) ## References - Spec §2.3 "Command palette" - Spec §4.10 "Command Palette"
charles added this to the loom-tui v0.1.0 milestone 2026-04-11 13:02:14 +00:00
Sign in to join this conversation.
No milestone
No project
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
charles/loom#18
No description provided.