Skip to content

ui: unify command palette and workspace creation into one command panel - #105

Merged
vaayne merged 5 commits into
mainfrom
ui/unified-command-panel
Jul 24, 2026
Merged

vaayne merged 5 commits into
mainfrom
ui/unified-command-panel

Conversation

@vaayne

@vaayne vaayne commented Jul 24, 2026

Copy link
Copy Markdown
Owner

What

Command Palette and the New Workspace dialog were two unrelated panels with independent chrome, key handling, and theme plumbing — neither looked native and picking Create Worktree bounced you between windows. They are now one Command Panel: a single page-stack NSPanel that owns all chrome, with pages (CommandPanelPage) supplying rows and semantics.

  • Architecture: CommandPanelController (container: chrome, key routing, page stack, theming) + RootSearchPage (wraps CommandPaletteDataSource unchanged) + WorkspaceCreationPage. Pages return ConfirmResult (.dismiss(then:) / .push / .stay), so Create Worktree pushes the workspace picker in place with a "‹ New Workspace" breadcrumb chip; Esc pops.
  • Picker state machine extracted to MoriCore as WorkspacePickerModel (pure, 12 new tests: create/exact/#PR default selection, unselectable hints, stale-generation drops, selection preserved by row id across refreshes). FetchGeneration guards async fetch races.
  • Chrome: solid theme-derived surface (background lifted 4% toward foreground, footer band recessed on the raw background) — behind-window translucency mixed desktop brightness into arbitrary theme backgrounds and read as muddy gray. Search row 44pt, rows 30pt, quiet accent selection pill.
  • Deleted: CommandPaletteController, WorktreeCreationController, WorktreeCreationDataSource (net −1300 lines against +1150, most of it now testable).

Bugs fixed along the way

  • NSTableView.style defaulted to .inset (macOS 11+), offsetting row content ~10pt and hard-clipping trailing labels at the panel edge (the real cause of the "Projec" truncation). Now .fullWidth.
  • Duplicate leading constraint on the search icon meant the breadcrumb could never appear.
  • The panel now dismisses on losing key focus (Spotlight behavior); before, it lingered floating where Esc could not reach it.
  • Fixed panel height is row-aligned — no more clipped ninth-row sliver.

Out of scope

Agent Dashboard and the Remote Connect wizard keep their own windows (different interaction shapes); restyling them is a separate task.

Verification

  • mise run test green across all packages (core 753 assertions incl. the 12 new picker tests)
  • Release builds of both products exit 0; CI=1 bash scripts/bundle.sh + app launch verified
  • i18n key parity check: 0 missing (en + zh-Hans); CHANGELOG updated bilingually
  • Manual review of both pages, push flow, key edge cases (Tab→Esc, Tab→⌘⏎, IME), and entry transitions by @vaayne

vaayne added 5 commits July 24, 2026 17:37
Phase 1 of the unified command panel: CommandPanelController owns all
chrome (blur+tint material, search row, list, key routing, sizing,
theming) while pages supply rows and semantics via CommandPanelPage.
The old palette becomes RootSearchPage over the unchanged data source.

Fixes shipped with the container: trailing type labels truncate with an
ellipsis instead of clipping mid-glyph, the light-mode tint no longer
mixes into muddy gray (alpha 0.85 light / 0.7 dark), and the selection
pill is visible in light themes (accent 0.35 / 0.5 dark).

Esc and Cmd-Return route through an NSPanel subclass so they keep
working when focus sits on future accessory controls; Enter stays on
the field-delegate path with the IME marked-text guard.
Extract the picker's state machine into MoriCore as WorkspacePickerModel
(pure, tested: rows/selection/normalized-query/FetchGeneration) and wrap
it in WorkspaceCreationPage. The panel container gains breadcrumb, footer
slot, fixed-height policy, and query normalization; entry points follow
the transition table (hidden→open, root visible→push, showing→no-op).
WorktreeCreationController and its data source are deleted; the request
types move to WorktreeCreationRequest.swift for WorkspaceManager.
Also restores the missing [0.6.2] section header in the Chinese
changelog — the v0.6.2 cut (cc62781) only updated the English file,
leaving released entries under [Unreleased].
Design iteration after V's review (B opacity + A density from the
mockups): the blur+tint+mask chrome is replaced by a solid layer-backed
surface — theme background lifted 4% toward the foreground, footer band
on the raw background as a recessed strip. Search row 44pt/15pt, rows
30pt, quieter selection pill, breadcrumb as a chip.

Fixes found along the way:
- NSTableView's default .automatic style resolves to .inset on
  macOS 11+, offsetting row content ~10pt and hard-clipping trailing
  labels at the panel edge; now .fullWidth.
- searchIconView's leading was constrained twice, so the breadcrumb
  constraint swap could never win and the chip never appeared.
- The panel now dismisses on losing key focus (Spotlight behavior);
  before, it lingered floating where Esc could not reach it.
- Workspace page height is row-aligned (264 = header 24 + 8×30) so no
  ninth-row sliver.
@vaayne
vaayne merged commit 0aec224 into main Jul 24, 2026
5 checks 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.

1 participant