From 9a7228a1b46d0fc94e408fe000227fed23d2ef87 Mon Sep 17 00:00:00 2001 From: Tom Ludwig Date: Sat, 3 Feb 2024 21:31:07 +0100 Subject: [PATCH 1/3] Bug fixes - Correct date isn't displayed in this history tab - Branch image was slightly to big, compared to Xcode - Branch menu color was a bit off - Branch menu indicator wasn't hidden --- .../Features/CodeEditUI/Views/ToolbarBranchPicker.swift | 7 ++++--- CodeEdit/Features/Git/Client/GitClient+CommitHistory.swift | 3 ++- .../Views/SourceControlNavigatorView.swift | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CodeEdit/Features/CodeEditUI/Views/ToolbarBranchPicker.swift b/CodeEdit/Features/CodeEditUI/Views/ToolbarBranchPicker.swift index ea505fe15..91ed64835 100644 --- a/CodeEdit/Features/CodeEditUI/Views/ToolbarBranchPicker.swift +++ b/CodeEdit/Features/CodeEditUI/Views/ToolbarBranchPicker.swift @@ -35,8 +35,8 @@ struct ToolbarBranchPicker: View { if currentBranch != nil { Image.branch .font(.title3) - .imageScale(.large) - .foregroundColor(controlActive == .inactive ? inactiveColor : .primary) + .imageScale(.medium) + .foregroundColor(controlActive == .inactive ? inactiveColor : .gray) } else { Image(systemName: "folder.fill.badge.gearshape") .font(.title3) @@ -57,9 +57,10 @@ struct ToolbarBranchPicker: View { }, label: { Text(currentBranch.name) .font(.subheadline) - .foregroundColor(controlActive == .inactive ? inactiveColor : .secondary) + .foregroundColor(controlActive == .inactive ? inactiveColor : .gray) .frame(height: 11) }) + .menuIndicator(isHovering ? .visible : .hidden) .buttonStyle(.borderless) .padding(.leading, -3) } diff --git a/CodeEdit/Features/Git/Client/GitClient+CommitHistory.swift b/CodeEdit/Features/Git/Client/GitClient+CommitHistory.swift index e15d04703..61f264bcb 100644 --- a/CodeEdit/Features/Git/Client/GitClient+CommitHistory.swift +++ b/CodeEdit/Features/Git/Client/GitClient+CommitHistory.swift @@ -25,7 +25,8 @@ extension GitClient { if let branchName { branchNameString = "--first-parent \(branchName)" } if let maxCount { maxCountString = "-n \(maxCount)" } let dateFormatter = DateFormatter() - dateFormatter.locale = Locale.current + dateFormatter.locale = Locale(identifier: Locale.current.identifier) +// dateFormatter.locale = Locale(identifier: "en_US_POSIX") dateFormatter.dateFormat = "EEE, dd MMM yyyy HH:mm:ss Z" let output = try await run( "log --pretty=%h¦%H¦%s¦%aN¦%ae¦%cn¦%ce¦%aD¦ \(maxCountString) \(branchNameString) \(fileLocalPath)" diff --git a/CodeEdit/Features/NavigatorArea/SourceControlNavigator/Views/SourceControlNavigatorView.swift b/CodeEdit/Features/NavigatorArea/SourceControlNavigator/Views/SourceControlNavigatorView.swift index 627194128..ccdf86216 100644 --- a/CodeEdit/Features/NavigatorArea/SourceControlNavigator/Views/SourceControlNavigatorView.swift +++ b/CodeEdit/Features/NavigatorArea/SourceControlNavigator/Views/SourceControlNavigatorView.swift @@ -13,7 +13,7 @@ struct SourceControlNavigatorView: View { var body: some View { if let sourceControlManager = workspace.workspaceFileManager?.sourceControlManager { VStack(spacing: 0) { - SourcControlNavigatorTabs() + SourceControlNavigatorTabs() .environmentObject(sourceControlManager) .task { do { @@ -34,7 +34,7 @@ struct SourceControlNavigatorView: View { } } -struct SourcControlNavigatorTabs: View { +struct SourceControlNavigatorTabs: View { @EnvironmentObject var sourceControlManager: SourceControlManager @State private var selectedSection: Int = 0 From 2ad2649df44694412c3e801ef67af5eedd45a4ee Mon Sep 17 00:00:00 2001 From: Tom Ludwig Date: Tue, 6 Feb 2024 09:58:07 +0100 Subject: [PATCH 2/3] Update GitClient+CommitHistory.swift --- CodeEdit/Features/Git/Client/GitClient+CommitHistory.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CodeEdit/Features/Git/Client/GitClient+CommitHistory.swift b/CodeEdit/Features/Git/Client/GitClient+CommitHistory.swift index 61f264bcb..b11392288 100644 --- a/CodeEdit/Features/Git/Client/GitClient+CommitHistory.swift +++ b/CodeEdit/Features/Git/Client/GitClient+CommitHistory.swift @@ -25,9 +25,11 @@ extension GitClient { if let branchName { branchNameString = "--first-parent \(branchName)" } if let maxCount { maxCountString = "-n \(maxCount)" } let dateFormatter = DateFormatter() + + // Can't use `Locale.current`, since it'd give a nil date outside the US dateFormatter.locale = Locale(identifier: Locale.current.identifier) -// dateFormatter.locale = Locale(identifier: "en_US_POSIX") dateFormatter.dateFormat = "EEE, dd MMM yyyy HH:mm:ss Z" + let output = try await run( "log --pretty=%h¦%H¦%s¦%aN¦%ae¦%cn¦%ce¦%aD¦ \(maxCountString) \(branchNameString) \(fileLocalPath)" .trimmingCharacters(in: .whitespacesAndNewlines) From 8b533ecad6eb21d961af4f831d7b3f0114edab8c Mon Sep 17 00:00:00 2001 From: Tom Ludwig Date: Tue, 6 Feb 2024 10:00:44 +0100 Subject: [PATCH 3/3] Linter --- CodeEdit/Features/Git/Client/GitClient+CommitHistory.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CodeEdit/Features/Git/Client/GitClient+CommitHistory.swift b/CodeEdit/Features/Git/Client/GitClient+CommitHistory.swift index b11392288..8913f5704 100644 --- a/CodeEdit/Features/Git/Client/GitClient+CommitHistory.swift +++ b/CodeEdit/Features/Git/Client/GitClient+CommitHistory.swift @@ -25,11 +25,11 @@ extension GitClient { if let branchName { branchNameString = "--first-parent \(branchName)" } if let maxCount { maxCountString = "-n \(maxCount)" } let dateFormatter = DateFormatter() - + // Can't use `Locale.current`, since it'd give a nil date outside the US dateFormatter.locale = Locale(identifier: Locale.current.identifier) dateFormatter.dateFormat = "EEE, dd MMM yyyy HH:mm:ss Z" - + let output = try await run( "log --pretty=%h¦%H¦%s¦%aN¦%ae¦%cn¦%ce¦%aD¦ \(maxCountString) \(branchNameString) \(fileLocalPath)" .trimmingCharacters(in: .whitespacesAndNewlines)