From 7451bf136855d77603112ecb914710e75fa68b1d Mon Sep 17 00:00:00 2001 From: raisulchowdhury <34920788+raisulchowdhury@users.noreply.github.com> Date: Wed, 29 Jul 2026 15:13:05 -0700 Subject: [PATCH] Prevent main window content overlap --- .../Common/NavigationSplitViewWrapper.swift | 5 ++++- Xcodes/Frontend/InfoPane/InfoPane.swift | 6 +++--- Xcodes/Frontend/MainWindow.swift | 17 ++++++++++++++++- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/Xcodes/Frontend/Common/NavigationSplitViewWrapper.swift b/Xcodes/Frontend/Common/NavigationSplitViewWrapper.swift index 92dafff3..66ef77cb 100644 --- a/Xcodes/Frontend/Common/NavigationSplitViewWrapper.swift +++ b/Xcodes/Frontend/Common/NavigationSplitViewWrapper.swift @@ -23,7 +23,10 @@ struct NavigationSplitViewWrapper: View where Sidebar: View, De NavigationSplitView { if #available(macOS 14, *) { sidebar - .navigationSplitViewColumnWidth(min: 290, ideal: 290) + .navigationSplitViewColumnWidth( + min: MainWindowLayout.sidebarMinimumWidth, + ideal: MainWindowLayout.sidebarMinimumWidth + ) } else { sidebar } diff --git a/Xcodes/Frontend/InfoPane/InfoPane.swift b/Xcodes/Frontend/InfoPane/InfoPane.swift index b557e748..4b7f7910 100644 --- a/Xcodes/Frontend/InfoPane/InfoPane.swift +++ b/Xcodes/Frontend/InfoPane/InfoPane.swift @@ -18,7 +18,7 @@ struct InfoPane: View { private var mainContent: some View { ScrollView(.vertical) { - HStack(alignment: .top) { + HStack(alignment: .top, spacing: MainWindowLayout.infoPaneColumnSpacing) { VStack { VStack(spacing: 5) { HStack { @@ -35,7 +35,7 @@ struct InfoPane: View { PlatformsView(xcode: xcode) } - .frame(minWidth: 380) + .frame(minWidth: MainWindowLayout.infoPanePrimaryColumnMinimumWidth) VStack(alignment: .leading) { ReleaseDateView(date: xcode.releaseDate, url: xcode.releaseNotesURL) @@ -43,7 +43,7 @@ struct InfoPane: View { IdenticalBuildsView(builds: xcode.identicalBuildsForCurrentVariant) SDKandCompilers } - .frame(width: 200) + .frame(width: MainWindowLayout.infoPaneSecondaryColumnWidth) } } diff --git a/Xcodes/Frontend/MainWindow.swift b/Xcodes/Frontend/MainWindow.swift index 0de18b5c..50bcef58 100644 --- a/Xcodes/Frontend/MainWindow.swift +++ b/Xcodes/Frontend/MainWindow.swift @@ -4,6 +4,21 @@ import XcodesLoginKit import Path import Version +enum MainWindowLayout { + static let sidebarMinimumWidth: CGFloat = 290 + static let infoPanePrimaryColumnMinimumWidth: CGFloat = 380 + static let infoPaneSecondaryColumnWidth: CGFloat = 200 + static let infoPaneColumnSpacing: CGFloat = 8 + static let infoPaneHorizontalMargins: CGFloat = 20 + static let detailMinimumWidth = + infoPanePrimaryColumnMinimumWidth + + infoPaneSecondaryColumnWidth + + infoPaneColumnSpacing + + infoPaneHorizontalMargins + static let splitViewDividerWidth: CGFloat = 9 + static let minimumWidth = sidebarMinimumWidth + detailMinimumWidth + splitViewDividerWidth +} + struct MainWindow: View { @EnvironmentObject var appState: AppState @State private var selectedXcodeID: Xcode.ID? @@ -68,7 +83,7 @@ struct MainWindow: View { .bottomStatusBar() .padding([.top], 0) .navigationSubtitle(subtitleText) - .frame(minWidth: 600, maxWidth: .infinity, minHeight: 300, maxHeight: .infinity) + .frame(minWidth: MainWindowLayout.minimumWidth, maxWidth: .infinity, minHeight: 300, maxHeight: .infinity) .emittingError($appState.error, recoveryHandler: { _ in }) .sheet(item: $appState.presentedSheet) { sheet in switch sheet {