Repository navigation
refactor: move the command palette into its own view - #459
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 toCommandPaletteController+Focus.swift.Worth a look in review:
notificationStore,programaConfigStoreorprogramaLayoutStore; only palette code read them, and the palette view watches them now. The root view redraws a bit less.onSendFeedbackis 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.