From 05b6751729500376e66904bed27100aaebed0203 Mon Sep 17 00:00:00 2001 From: Lawrence Chen Date: Mon, 30 Mar 2026 16:32:41 -0700 Subject: [PATCH] Fix minimal mode tab bar disappearing in fullscreen Three issues caused the Bonsplit horizontal tab bar to be hidden when entering fullscreen with minimal mode enabled: 1. ignoresSafeArea(.container, edges: .top) was applied unconditionally in minimal mode, pushing content behind the fullscreen menu bar area. Now gated on !isFullScreen. 2. effectiveTitlebarPadding returned -titlebarPadding in minimal mode regardless of fullscreen state. In fullscreen there is no native titlebar to compensate for, so the negative offset pushed content off the top of the screen. Now returns 0 in fullscreen. 3. Traffic light leading inset (80px) was applied in fullscreen minimal mode even though there are no traffic light buttons. Now gated on !isFullScreen, and syncTrafficLightInset is called on fullscreen enter/exit. Closes https://github.com/manaflow-ai/cmux/issues/2317 Based on https://github.com/manaflow-ai/cmux/pull/2341 --- Sources/ContentView.swift | 10 ++++++++-- Sources/WorkspaceContentView.swift | 3 ++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Sources/ContentView.swift b/Sources/ContentView.swift index 2f2dc1372af9..dd56fe6b098e 100644 --- a/Sources/ContentView.swift +++ b/Sources/ContentView.swift @@ -2348,7 +2348,10 @@ struct ContentView: View { } private var effectiveTitlebarPadding: CGFloat { - isMinimalMode ? -titlebarPadding : titlebarPadding + if isMinimalMode { + return isFullScreen ? 0 : -titlebarPadding + } + return titlebarPadding } private var terminalContent: some View { @@ -2378,6 +2381,7 @@ struct ContentView: View { workspace: tab, isWorkspaceVisible: presentation.isPanelVisible, isWorkspaceInputActive: isInputActive, + isFullScreen: isFullScreen, workspacePortalPriority: portalPriority, onThemeRefreshRequest: { reason, eventId, source, payloadHex in scheduleTitlebarThemeRefreshFromWorkspace( @@ -2514,7 +2518,7 @@ struct ContentView: View { } private func syncTrafficLightInset() { - let inset: CGFloat = (isMinimalMode && !sidebarState.isVisible) ? 80 : 0 + let inset: CGFloat = (isMinimalMode && !sidebarState.isVisible && !isFullScreen) ? 80 : 0 for tab in tabManager.tabs { if tab.bonsplitController.configuration.appearance.tabBarLeadingInset != inset { tab.bonsplitController.configuration.appearance.tabBarLeadingInset = inset @@ -3051,6 +3055,7 @@ struct ContentView: View { isFullScreen = true setTitlebarControlsHidden(true, in: window) AppDelegate.shared?.fullscreenControlsViewModel = fullscreenControlsViewModel + syncTrafficLightInset() }) view = AnyView(view.onReceive(NotificationCenter.default.publisher(for: NSWindow.didExitFullScreenNotification)) { notification in @@ -3059,6 +3064,7 @@ struct ContentView: View { isFullScreen = false setTitlebarControlsHidden(false, in: window) AppDelegate.shared?.fullscreenControlsViewModel = nil + syncTrafficLightInset() }) view = AnyView(view.onReceive(NotificationCenter.default.publisher(for: NSWindow.didResizeNotification)) { notification in diff --git a/Sources/WorkspaceContentView.swift b/Sources/WorkspaceContentView.swift index ed1d961a63af..69cc0399c75f 100644 --- a/Sources/WorkspaceContentView.swift +++ b/Sources/WorkspaceContentView.swift @@ -225,6 +225,7 @@ struct WorkspaceContentView: View { @ObservedObject var workspace: Workspace let isWorkspaceVisible: Bool let isWorkspaceInputActive: Bool + let isFullScreen: Bool let workspacePortalPriority: Int let onThemeRefreshRequest: (( _ reason: String, @@ -377,7 +378,7 @@ struct WorkspaceContentView: View { } Group { - if isMinimalMode { + if isMinimalMode && !isFullScreen { bonsplitView .ignoresSafeArea(.container, edges: .top) } else {