Skip to content

refactor: move the command palette into its own view - #459

Merged
arzafran merged 1 commit into
mainfrom
refactor/command-palette-view
Oct 20, 2026
Merged

arzafran merged 1 commit into
mainfrom
refactor/command-palette-view

Conversation

@arzafran

Copy link
Copy Markdown
Member

The command palette was a set of ContentView extensions, so all of its state lived on the window's root view. It is now CommandPaletteView, which owns its focus state and watches its own stores. ContentView creates the controller, mounts the view, and passes it five things (controller, update model, window id, window, and the send-feedback action).

No behavior change intended. The five palette files are renamed with history kept (ContentView+CommandPalette*.swift -> CommandPaletteView*.swift), and focus restore plus debug-state sync moved to CommandPaletteController+Focus.swift.

Worth a look in review:

  • ContentView no longer watches notificationStore, programaConfigStore or programaLayoutStore; only palette code read them, and the palette view watches them now. The root view redraws a bit less.
  • onSendFeedback is a closure on purpose: it keeps the palette view redrawing with ContentView, so the switcher list picks up title, directory and branch changes the way it did before.

Checked on a tagged build over the socket: the palette opens, rename focuses and selects the field, and dismissing hands focus back to the terminal. Switcher mode, the description editor, backdrop click and Escape were not exercised live; those paths only changed type names.

@arzafran
arzafran merged commit b133a2f into main Oct 20, 2026
12 checks passed
@arzafran
arzafran deleted the refactor/command-palette-view branch October 20, 2026 19:06
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