Skip to content

Commit 779d624

Browse files
authored
FIX: Git History Date bug (#1585)
* 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 * Update GitClient+CommitHistory.swift * Linter
1 parent 6509eed commit 779d624

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

CodeEdit/Features/CodeEditUI/Views/ToolbarBranchPicker.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ struct ToolbarBranchPicker: View {
3535
if currentBranch != nil {
3636
Image.branch
3737
.font(.title3)
38-
.imageScale(.large)
39-
.foregroundColor(controlActive == .inactive ? inactiveColor : .primary)
38+
.imageScale(.medium)
39+
.foregroundColor(controlActive == .inactive ? inactiveColor : .gray)
4040
} else {
4141
Image(systemName: "folder.fill.badge.gearshape")
4242
.font(.title3)
@@ -57,9 +57,10 @@ struct ToolbarBranchPicker: View {
5757
}, label: {
5858
Text(currentBranch.name)
5959
.font(.subheadline)
60-
.foregroundColor(controlActive == .inactive ? inactiveColor : .secondary)
60+
.foregroundColor(controlActive == .inactive ? inactiveColor : .gray)
6161
.frame(height: 11)
6262
})
63+
.menuIndicator(isHovering ? .visible : .hidden)
6364
.buttonStyle(.borderless)
6465
.padding(.leading, -3)
6566
}

CodeEdit/Features/Git/Client/GitClient+CommitHistory.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,11 @@ extension GitClient {
2525
if let branchName { branchNameString = "--first-parent \(branchName)" }
2626
if let maxCount { maxCountString = "-n \(maxCount)" }
2727
let dateFormatter = DateFormatter()
28-
dateFormatter.locale = Locale.current
28+
29+
// Can't use `Locale.current`, since it'd give a nil date outside the US
30+
dateFormatter.locale = Locale(identifier: Locale.current.identifier)
2931
dateFormatter.dateFormat = "EEE, dd MMM yyyy HH:mm:ss Z"
32+
3033
let output = try await run(
3134
"log --pretty=%h¦%H¦%s¦%aN¦%ae¦%cn¦%ce¦%aD¦ \(maxCountString) \(branchNameString) \(fileLocalPath)"
3235
.trimmingCharacters(in: .whitespacesAndNewlines)

CodeEdit/Features/NavigatorArea/SourceControlNavigator/Views/SourceControlNavigatorView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ struct SourceControlNavigatorView: View {
1313
var body: some View {
1414
if let sourceControlManager = workspace.workspaceFileManager?.sourceControlManager {
1515
VStack(spacing: 0) {
16-
SourcControlNavigatorTabs()
16+
SourceControlNavigatorTabs()
1717
.environmentObject(sourceControlManager)
1818
.task {
1919
do {
@@ -34,7 +34,7 @@ struct SourceControlNavigatorView: View {
3434
}
3535
}
3636

37-
struct SourcControlNavigatorTabs: View {
37+
struct SourceControlNavigatorTabs: View {
3838
@EnvironmentObject var sourceControlManager: SourceControlManager
3939
@State private var selectedSection: Int = 0
4040

0 commit comments

Comments
 (0)