From e3a34114b2bc283ee2d357b20d5c6cbf0df3f6eb Mon Sep 17 00:00:00 2001 From: austinpower1258 Date: Mon, 1 Jun 2026 04:22:46 -0700 Subject: [PATCH] fix: simplify titlebar inset and keep it in sync with sidebar snap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Address review feedback on #5102: - `rightSidebarVisible ? rightSidebarWidth : 0` is redundant — `rightSidebarWidth` already evaluates to 0 when the sidebar is hidden. Use it directly. - The right sidebar panel snaps without animation; match that on the titlebar band's trailing inset (`.animation(nil, value: rightSidebarWidth)`) so the hit-region edge can't animate out of step with the panel during toggle and briefly re-cover the mode bar. Co-Authored-By: Claude Opus 4.8 --- Sources/ContentView.swift | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Sources/ContentView.swift b/Sources/ContentView.swift index 85c9f488574..39c75f5efc6 100644 --- a/Sources/ContentView.swift +++ b/Sources/ContentView.swift @@ -2427,7 +2427,14 @@ struct ContentView: View { // not the sidebar" intent. The left sidebar's titlebar controls live in // the AppKit titlebar accessory (above this band), so only the trailing // (right-sidebar) edge needs to be ceded here. - .padding(.trailing, rightSidebarVisible ? rightSidebarWidth : 0) + // + // `rightSidebarWidth` is already `rightSidebarVisible ? fileExplorerWidth : 0`, + // so it collapses to 0 when the sidebar is hidden. The sidebar panel itself + // snaps without animation (`.transaction { $0.animation = nil }`), so we match + // that here — otherwise this inset could animate out of step with the panel on + // toggle and momentarily expose (or re-cover) the mode bar mid-transition. + .padding(.trailing, rightSidebarWidth) + .animation(nil, value: rightSidebarWidth) } .overlay(alignment: .topLeading) { if isFullScreen && sidebarState.isVisible {