feat(sidebar): show sidebar only in the active window#285
Merged
Conversation
opt-in Interface setting: with multiple windows open, only the frontmost window shows its sidebar and every other collapses. Sidebar visibility follows window focus, so switching windows moves the sidebar with focus; switching to another app leaves every sidebar untouched. - AppSettings.autoHideSidebarInactiveWindows (nil = off), mirrored into GhosttyApp; host-free driver WindowLibrary.applyInactiveWindowSidebarHiding sets the active window's sidebar visible and the rest hidden - WindowAccessor.reportFrontmost fires the driver on real frontmost changes only (never on resign); the toggle applies immediately when flipped on - absolute rule, no per-window intent: a manual hide on the active window is transient and re-shows on refocus acceptsFirstMouse returns false while the setting is on: the click that activates an inactive window would otherwise press the terminal button, and the sidebar expanding mid-gesture resized the surface under the held press into a phantom selection. Now the activating click only raises the window. GUI-only, keep-in-sync exempt like every other settings toggle (the sidebar capability already has full control coverage via `sidebar` + sidebarVisible).
- [major] [WindowAccessor.swift] run the auto-hide sidebar driver on every window activation report, not only on a frontmost-id change. newWindow() pre-sets frontmostWindowID before the window keys and launch restores it, so the old guard skipped those paths and left the prior window's sidebar showing (or the restored frontmost collapsed). Persist + frontmost-changed post stay gated to a real change; the driver is idempotent so an unchanged re-key is cheap. - [major] [WindowLibraryTests.swift] strengthen the single-window driver test to hide the sidebar first, then assert the driver re-shows it (was passing even with the driver deleted, since sidebarVisible defaults to true). - [minor] [WindowLibrary.swift] correct the driver doc comment: a single-window library force-shows the sole window's sidebar, it is not a no-op. - [docs] [windows.md] inventory the new applyInactiveWindowSidebarHiding method.
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.
opt-in Interface setting: with multiple windows open, only the frontmost window shows its sidebar and every other collapses. Sidebar visibility follows window focus, so switching windows moves the sidebar with focus; switching to another app leaves every sidebar untouched. Off by default.
Behavior
Implementation
AppSettings.autoHideSidebarInactiveWindows(nil = off), mirrored intoGhosttyApp(the non-observable chrome-mirror pattern the other toggles use)WindowLibrary.applyInactiveWindowSidebarHiding()sets the active window's sidebar visible and the rest hiddenWindowAccessor.reportFrontmoston every window activation, and once when the toggle flips on, so new-window and launch reconcile tooacceptsFirstMousereturns false while the setting is on, so the click that activates an inactive window doesn't press the terminal button and turn the mid-gesture sidebar-resize into a phantom selectionGUI-only, keep-in-sync exempt like the other settings toggles (the sidebar capability already has full control coverage via
sidebar+sidebarVisible).verified: host-free round-trip + driver tests (
swift test, 1737 pass), app build + swiftlint strict clean, and by hand in a dev instance.