Skip to content

Keep the macOS inspector closed unless the user opens it (851-4454) - #1450

Merged
dylanplayer merged 1 commit into
mainfrom
codevisor/kangaroo
Nov 20, 2026
Merged

dylanplayer merged 1 commit into
mainfrom
codevisor/kangaroo

Conversation

@dylanplayer

Copy link
Copy Markdown
Member

The macOS inspector could open by itself, for example while the pane's ••• menu was open to close a split. SwiftUI reported the inspector column as expanded through the .inspector binding, and the binding saved that as the setting (851-4454).

The saved setting is now the only source of truth:

  • Only the toggle (toolbar, View menu, ⌥⌘B) and the command palette open the inspector.
  • A column that expands on its own is not saved and collapses back.
  • Dragging the divider closed still saves it closed. Opening by dragging isn't supported (the collapsed divider isn't draggable today).
  • SwiftUI's late reports of the toggle's own changes are compared against the live setting, not a value captured in an earlier render.

SavedInspector / SavedInspectorColumn in CodevisorUI own the column binding; SavedInspectorColumnTests covers drag-close, an unrequested expand, and late reports.

Tophatted in the dev app: split → ••• → Close repeatedly in wide and narrow windows (inspector stays closed), toolbar / ⌥⌘B / palette still open it, AppKit-initiated expands collapse back, divider drag closes and saves.

🤖 Generated with Claude Code

The inspector could open by itself, for example while the pane menu was
open to close a split: SwiftUI reported the column as expanded through the
inspector binding, and the binding saved that as the setting.

The saved setting is now the only source of truth. Only the toggle
(toolbar, View menu, Option-Command-B) and the command palette open the
inspector. A column that expands on its own is not saved and is collapsed
back. Dragging the divider closed still saves it closed. SwiftUI's late
reports of the toggle's own changes are compared against the live setting,
not a value captured in an earlier render.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@dylanplayer
dylanplayer merged commit 3d50b52 into main Nov 20, 2026
@dylanplayer
dylanplayer deleted the codevisor/kangaroo branch November 20, 2026 23:39
dylanplayer added a commit that referenced this pull request Nov 25, 2026
Grabbing the right edge of the window opened the inspector and snapped it
shut again, even without moving the mouse: SavedInspector treated the
column reporting itself open as unrequested and forced it closed.

The inspector binding is back to the plain .inspector(isPresented:) it
used before #1450, so the column opens, closes, and is dragged the way
macOS does it, and whatever it reports is saved.

Co-authored-by: Claude Opus 5.5 <[email protected]>
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