Skip to content

feat(tui): universal command palette action system (#194)#461

Merged
windoliver merged 22 commits into
mainfrom
feat/194-universal-action-palette
May 29, 2026
Merged

feat(tui): universal command palette action system (#194)#461
windoliver merged 22 commits into
mainfrom
feat/194-universal-action-palette

Conversation

@windoliver
Copy link
Copy Markdown
Owner

@windoliver windoliver commented May 28, 2026

Summary

Closes #194. Turns the TUI command palette into a universal, searchable, context-sensitive action system unified on a single action model.

  • One Action model ({id,label,detail,group,keywords?,available?,enabled?,run}) replaces the old discriminated-union PaletteItem + the separate plugin switch. Built-in actions are built from live state; plugins are wrapped by an adapter into the same model.
  • Two-tier context: rich internal ActionContext for built-ins; the narrow TuiPluginContext is preserved for plugins (blast radius unchanged).
  • Relevance gating: available(ctx) hides irrelevant actions; enabled(ctx) greys unexecutable ones.
  • Grouped sections — Navigation / Agents / Workflow / View / Contributions / Plugins — collapse to a flat fuzzy-ranked list (label + keyword) when searching. Selection is a flat index over the displayed list.

Actions reachable from the palette

  • Navigation: focus any panel — core (DAG/Detail/Frontier/Claims) and operator (Terminal/VFS/…); jump to session; open contribution. Focused-panel-sensitive: frontier next/prev slice, scroll terminal to bottom.
  • Agents: spawn (per profile/role, capacity in detail + greyed at cap), kill, delegate, broadcast message, direct message.
  • Workflow: set goal, approve/deny pending question, compare, register profile.
  • View: refresh, search transcripts, cycle zoom, reset zoom, toggle layout (grid/tab), cycle view mode (grid/pipeline), quit.
  • Contributions (only when a cid is selected): open, add-to-compare, adopt.
  • Plugins: adapted registrations.

Verification

  • Unit + render tests: 28 pass / 0 fail (builders gating, plugin-adapter narrowing, visibility ordering/keyword ranking, reserved-ids, grouped/flat render, greyed-disabled, context-sensitivity, focused-panel gating, View group).
  • tsc --noEmit → 0 errors; biome clean; pre-push typecheck+build pass.
  • Adversarial 4-lens review (coverage/correctness/regression/runtime): 0 critical; the 3 important findings (view-mode toggle, core-panel reach, search-panel reveal) were all fixed in this branch.
  • Live grove TUI smoke (real grove tui → inspect overlay → Space c p): palette opens and renders all grouped sections live; fuzzy filter collapses to a flat ranked result; executing Broadcast enters Message @all mode (keyboard→run + close-before-run verified); executing Search transcripts reveals the [10:Search] panel with a visible input (third fix verified live).

🤖 Generated with Claude Code

@windoliver
Copy link
Copy Markdown
Owner Author

Hardening round (commit 44d9ed1)

Ran a second adversarial review over the gap-closure; it surfaced issues that I've now fixed:

  • Circular import removed — fuzzyMatch extracted to src/tui/actions/fuzzy.ts; visibility.ts and command-palette.tsx both import it (no cycle).
  • Duplicate spawn id — the profile loop now de-dupes by role (two profiles sharing a role → one agent.spawn.<role>); catalog ids are all-unique.
  • Reveal-not-hidejumpToSession (Terminal) and enterSearch (Search) now focus an already-visible panel instead of toggling it off.
  • Coverage — added Cycle to next/previous panel (Navigation) and Show help (View) palette actions.

Verification:

  • 30 unit/render tests pass; tsc --noEmit 0 errors; biome clean; pre-push build passes.
  • Final 2-lens adversarial review: 0 critical / 0 important / 0 real defects (consistency lens confirmed every ActionContext capability is wired, 51 actions all-unique, no genuinely-missing discrete action beyond the agreed exclusions).
  • Live grove TUI recheck: the new Cycle to next/previous panel + Show help actions render in the palette, and executing Show help opened the Keybinding Reference overlay (new capability fires through the real keyboard→run path).

@windoliver windoliver merged commit fc65f2b into main May 29, 2026
1 check passed
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.

TUI: expand command palette into a universal action system

1 participant