Repository navigation
Fix minimal-mode traffic-light inset and new-window Bonsplit tab bar #3055
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
81d04c2
cadf17b
30e8467
a61c4ca
afb208c
802ea0a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -990,6 +990,7 @@ class TabManager: ObservableObject { | |
| private var workspaceCycleCooldownTask: Task<Void, Never>? | ||
| private var pendingWorkspaceUnfocusTarget: (tabId: UUID, panelId: UUID)? | ||
| private var sidebarSelectedWorkspaceIds: Set<UUID> = [] | ||
| private var currentWindowTabBarLeadingInset: CGFloat? | ||
| private var closeConfirmationInFlight = false | ||
| var confirmCloseHandler: ((String, String, Bool) -> Bool)? | ||
| private struct WorkspaceCreationTabSnapshot { | ||
|
|
@@ -1943,13 +1944,26 @@ class TabManager: ObservableObject { | |
| to newWorkspace: Workspace, | ||
| from sourceWorkspace: Workspace? | ||
| ) { | ||
| guard let sourceWorkspace else { return } | ||
| // Sidebar-toggle relayout updates the live Bonsplit leading inset so minimal-mode | ||
| // workspaces reserve traffic-light space. New workspaces need that same inset | ||
| // copied immediately because creation itself does not trigger the resync path. | ||
| let inheritedLeadingInset = sourceWorkspace.bonsplitController.configuration.appearance.tabBarLeadingInset | ||
| if newWorkspace.bonsplitController.configuration.appearance.tabBarLeadingInset != inheritedLeadingInset { | ||
| newWorkspace.bonsplitController.configuration.appearance.tabBarLeadingInset = inheritedLeadingInset | ||
| let inheritedLeadingInset = currentWindowTabBarLeadingInset | ||
| ?? sourceWorkspace?.bonsplitController.configuration.appearance.tabBarLeadingInset | ||
| guard let inheritedLeadingInset else { return } | ||
|
Comment on lines
+1950
to
+1952
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
If |
||
| applyTabBarLeadingInset(inheritedLeadingInset, to: newWorkspace) | ||
| } | ||
|
|
||
| func syncWorkspaceTabBarLeadingInset(_ inset: CGFloat) { | ||
| let normalizedInset = max(0, inset) | ||
| currentWindowTabBarLeadingInset = normalizedInset | ||
| for tab in tabs { | ||
| applyTabBarLeadingInset(normalizedInset, to: tab) | ||
| } | ||
| } | ||
|
|
||
| private func applyTabBarLeadingInset(_ inset: CGFloat, to workspace: Workspace) { | ||
| if workspace.bonsplitController.configuration.appearance.tabBarLeadingInset != inset { | ||
| workspace.bonsplitController.configuration.appearance.tabBarLeadingInset = inset | ||
| } | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
onChangeclosure arityThe new handler uses the single-argument (old/deprecated)
onChangeform while the immediately-preceding handler on line 3727 uses the two-argument (oldValue, newValue) form that is consistent with the rest of this function. Both work at runtime, but mixing the two APIs may generate a deprecation warning in newer Xcode versions and is inconsistent with the surrounding code.