feat(command palette): add View toggles (Sidebar, Active Agents, Canvas, Shelf, Show Diff)#294
Open
onevcat wants to merge 1 commit into
Open
feat(command palette): add View toggles (Sidebar, Active Agents, Canvas, Shelf, Show Diff)#294onevcat wants to merge 1 commit into
onevcat wants to merge 1 commit into
Conversation
…as, Shelf, Show Diff)
Surfaces the 5 view toggles that were previously hotkey-only:
- Toggle Sidebar (⌘⌃S)
- Toggle Active Agents Panel (⌘⌥P)
- Toggle Canvas (⌘⌥↩)
- Toggle Shelf (⌘⇧↩)
- Show Diff (⌘⇧Y) — only appears when a worktree is selected
All registered through the `.appShortcut` factory (PR3), so each is a
one-liner. They live in the new `.view` category, are suggested by default,
and ship with keyword aliases ("sidebar", "agents", "canvas", "shelf",
"diff", etc.).
Architectural change: lift `leftSidebarVisibility` from ContentView's
private @State into AppFeature.State, so the palette can dispatch
`.toggleLeftSidebar` and `.showLeftSidebar` actions via the existing
delegate-routing mechanism. The diff window keeps its own per-scene
column visibility — they're independent NavigationSplitViews.
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.
Summary
PR4 of the four-PR command palette plan (
doc-onevcat/plans/2026-05-16-command-palette-architecture-plan.md). Surfaces the 5 view toggles that were previously hotkey-only..view.view.view.view.viewEach is a one-liner through PR3's
.appShortcutfactory, with keyword aliases for fuzzy search (sidebar,agents,canvas,shelf,diff, etc.).Architectural change: lift
leftSidebarVisibilityinto AppFeature.StatePreviously the main window's sidebar visibility lived as
@StateinContentView, mutated via aFocusedValueclosure invoked from the menu's "Toggle Left Sidebar" button. The palette can't reach scene-scopedFocusedValueclosures from a reducer, so I lifted the state up:AppFeature.State.leftSidebarVisibility: NavigationSplitViewVisibility.toggleLeftSidebar,.showLeftSidebar,.setLeftSidebarVisibility(_)(last one backs the NavigationSplitView'scolumnVisibilitybinding)ContentViewconstructs aBinding(get:set:)against the storewithAnimation { ... }(in the imperative closure) to.animation(.easeOut(duration: 0.2), value: store.leftSidebarVisibility)(on the view)columnVisibility— they're independent NavigationSplitViews, so this doesn't affect the diff sidebar's behaviorThe
FocusedValueclosures (toggleLeftSidebarAction,revealInSidebarAction) still exist and now dispatch TCA actions instead of mutating local state — menu behavior unchanged.Test plan
make build-app— greenmake check(swift-format + swiftlint strict) — greenCommandPaletteFeatureTests+AppFeatureCommandPaletteTests+AppShortcutsTests— all passcommandPaletteItems_onlyGlobalWhenEmptyupdated to include the 4 new always-on view commandscommandPaletteItems_includesShowDiffWhenWorktreeSelectedcommandPaletteItems_omitsShowDiffWithoutSelectedWorktree