Skip to content

Commit 687249c

Browse files
committed
feat: Implement repository comparison and branch change detection in SwiftUI
1 parent f0aca03 commit 687249c

2 files changed

Lines changed: 4 additions & 8 deletions

File tree

GitMac/App/GitMacApp.swift

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,6 @@ struct GitMacApp: App {
4646
window.titleVisibility = .hidden
4747
window.title = ""
4848
window.appearance = ThemeManager.shared.appearance
49-
50-
// Set minimum window size - center panel compresses first
51-
window.minSize = NSSize(
52-
width: DesignTokens.Layout.Window.minWidth,
53-
height: DesignTokens.Layout.Window.minHeight
54-
)
5549
}
5650

5751
// Ensure the app icon is properly set
@@ -106,7 +100,8 @@ struct RepositoryTab: Identifiable, Equatable {
106100
var selectedStash: Stash?
107101

108102
static func == (lhs: RepositoryTab, rhs: RepositoryTab) -> Bool {
109-
lhs.id == rhs.id
103+
// Include repository comparison so SwiftUI detects branch changes
104+
lhs.id == rhs.id && lhs.repository == rhs.repository
110105
}
111106
}
112107

GitMac/Core/Git/Repository.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ struct Repository: Identifiable, Equatable {
4747
var commits: [Commit] = []
4848

4949
static func == (lhs: Repository, rhs: Repository) -> Bool {
50-
lhs.path == rhs.path
50+
// Include currentBranch name so SwiftUI detects checkout changes
51+
lhs.path == rhs.path && lhs.currentBranch?.name == rhs.currentBranch?.name
5152
}
5253
}
5354

0 commit comments

Comments
 (0)