Skip to content

Commit e924140

Browse files
committed
"feat: Update GitMac.xcodeproj and SwiftPM dependencies, refactor DiffViewWithClose, RightCommitDetailPanel, RightStagingPanel, WelcomeView, IntegrationHelpers, BranchListView, CommitGraphView, DiffView, FluidConnectionRibbonsView, KaleidoscopeDiffView, SplitDiffView, CodeEditorView, MarkdownView, DiffToolbar, BranchRow, UnifiedFileContextMenu and
1 parent d5d7275 commit e924140

22 files changed

Lines changed: 2115 additions & 864 deletions

GitMac.xcodeproj/project.pbxproj

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
1AC1766730959255403C4EA2 /* DSToggle.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAAD36D44E199613FD60C7B2 /* DSToggle.swift */; };
4242
1B17CEEE0F5A96D79AE531C6 /* ListRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F045ABAFE63E9A78313271A /* ListRow.swift */; };
4343
1B3AC04978A2FEFCB03188A5 /* StagingComponents.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA39C01D990E7F7EFCCDFE23 /* StagingComponents.swift */; };
44-
1B8CE0E16F3B54417620B0C3 /* FluidConnectionRibbonsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7E115A53C73AAFDB634EF7C /* FluidConnectionRibbonsView.swift */; };
4544
1BB7E872B52459C8C2FC36AF /* AppTheme.swift in Sources */ = {isa = PBXBuildFile; fileRef = 741C54327F7D0A9ED06C024F /* AppTheme.swift */; };
4645
1C46F1BA5158A592D442F839 /* DiffParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8FB12219D2488819C343911 /* DiffParser.swift */; };
4746
1D63613571170159A5704573 /* ExternalToolsManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47CB34938E677983AF18543E /* ExternalToolsManager.swift */; };
@@ -320,7 +319,6 @@
320319
E2DC6F1F800CEDEAB6143D2C /* PushFetchButtons.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5A83152F6E2CD6F4E437C5C3 /* PushFetchButtons.swift */; };
321320
E2DE9809294499F69934ED13 /* SyntaxHighlighter.swift in Sources */ = {isa = PBXBuildFile; fileRef = CCDBE3D0C01B79C8DA32D290 /* SyntaxHighlighter.swift */; };
322321
E31D0AE2FBC3898B195BDCC4 /* AIService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 99AA1FB5A8306B98A36E3C86 /* AIService.swift */; };
323-
E383DC04F92DA4511A25945B /* KaleidoscopeUnifiedView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAA4EEC4FE1E4989D540D97C /* KaleidoscopeUnifiedView.swift */; };
324322
E39B3EC735C63758C8855612 /* RepoGroupsService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADEC0281C1B6ECA4E3B07D30 /* RepoGroupsService.swift */; };
325323
E3F494D2DF37C541988BE1FD /* DSSpinner.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8C38069C386D2444ADE094A5 /* DSSpinner.swift */; };
326324
E40DFD849A489D0953DE0899 /* SecretRedactionService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 80BED603E9B131C466C78CE5 /* SecretRedactionService.swift */; };
@@ -368,6 +366,8 @@
368366
FED0784BE2D7966EF4DC830E /* CenterPanel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECF47093BEBDD1408A3C68E6 /* CenterPanel.swift */; };
369367
PKG001 /* KeychainAccess in Frameworks */ = {isa = PBXBuildFile; productRef = DEP001 /* KeychainAccess */; };
370368
PKG002 /* Splash in Frameworks */ = {isa = PBXBuildFile; productRef = DEP002 /* Splash */; };
369+
PKG003 /* CodeEditSourceEditor in Frameworks */ = {isa = PBXBuildFile; productRef = DEP003 /* CodeEditSourceEditor */; };
370+
CEVF01 /* CodeEditorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEVR01 /* CodeEditorView.swift */; };
371371
/* End PBXBuildFile section */
372372

373373
/* Begin PBXFileReference section */
@@ -620,14 +620,12 @@
620620
A72B4B428ACA0A1D3C01558D /* LinearContentView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = LinearContentView.swift; path = Features/Linear/LinearContentView.swift; sourceTree = "<group>"; };
621621
A78C8CA3402C6DF0DB467BE0 /* SubscriptionView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SubscriptionView.swift; path = ../Features/Settings/SubscriptionView.swift; sourceTree = "<group>"; };
622622
A7A72EC9847E8539DA57C4CE /* DSHeader.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = GitMac/UI/Components/Molecules/Display/DSHeader.swift; sourceTree = SOURCE_ROOT; };
623-
A7E115A53C73AAFDB634EF7C /* FluidConnectionRibbonsView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = FluidConnectionRibbonsView.swift; path = ../Features/Diff/FluidConnectionRibbonsView.swift; sourceTree = "<group>"; };
624623
A8BFECF7549F727776FCA676 /* DSDraggableList.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DSDraggableList.swift; path = Organisms/Lists/DSDraggableList.swift; sourceTree = "<group>"; };
625624
A9429CC1284A41A1A5A7741F /* NotificationManager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = GitMac/Core/Services/NotificationManager.swift; sourceTree = SOURCE_ROOT; };
626625
A9AD8F4D449606E5E5A4A2EC /* FileTypeIcon.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = FileTypeIcon.swift; path = Components/Icons/FileTypeIcon.swift; sourceTree = "<group>"; };
627626
AA1C6958688FFE9EDBCC16D0 /* CICDComponents.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CICDComponents.swift; sourceTree = "<group>"; };
628627
AA39C01D990E7F7EFCCDFE23 /* StagingComponents.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = StagingComponents.swift; path = GitMac/App/Panels/Right/StagingComponents.swift; sourceTree = SOURCE_ROOT; };
629628
AA7B4BEC591DFBFD7420A56D /* FileBrowserView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = GitMac/Features/FileViewer/FileBrowserView.swift; sourceTree = SOURCE_ROOT; };
630-
AAA4EEC4FE1E4989D540D97C /* KaleidoscopeUnifiedView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = KaleidoscopeUnifiedView.swift; path = ../Features/Diff/KaleidoscopeUnifiedView.swift; sourceTree = "<group>"; };
631629
ABAB2827F401F387B51BC038 /* FileListSection.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = FileListSection.swift; path = ../Components/Layout/FileListSection.swift; sourceTree = "<group>"; };
632630
AC9431972EE97AF100A59026 /* IMPLEMENTATION_ROADMAP.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = IMPLEMENTATION_ROADMAP.md; sourceTree = "<group>"; };
633631
AC9431A32EE97D6000A59026 /* BUILD_FIX.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = BUILD_FIX.md; sourceTree = "<group>"; };
@@ -764,6 +762,7 @@
764762
INFO01 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
765763
PROD01 /* GitMac.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GitMac.app; sourceTree = BUILT_PRODUCTS_DIR; };
766764
RES001 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
765+
CEVR01 /* CodeEditorView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = CodeEditorView.swift; path = GitMac/Features/Editor/CodeEditorView.swift; sourceTree = SOURCE_ROOT; };
767766
/* End PBXFileReference section */
768767

769768
/* Begin PBXFrameworksBuildPhase section */
@@ -1863,9 +1862,7 @@
18631862
C8A9F580892364D6F487D3D4 /* KaleidoscopeSplitDiffView.swift */,
18641863
C0A3477C5429FE5F172621B6 /* TiledDiffView.swift */,
18651864
B22461AAF391C4D4E7B598E2 /* KaleidoscopeFileList.swift */,
1866-
AAA4EEC4FE1E4989D540D97C /* KaleidoscopeUnifiedView.swift */,
18671865
1F038DA5BD2F2882EEDC31EA /* DiffOptions.swift */,
1868-
A7E115A53C73AAFDB634EF7C /* FluidConnectionRibbonsView.swift */,
18691866
FC7110872A0069C25C89D7CF /* DiffPreferences.swift */,
18701867
B0F7D30FD32DB6AC065F6149 /* WordLevelDiff.swift */,
18711868
B8E11127F294B1C3EB7DA927 /* DiffView.swift */,
@@ -2237,6 +2234,7 @@
22372234
DEP001 /* KeychainAccess */,
22382235
DEP002 /* Splash */,
22392236
AC28C30A2F08591500A86A78 /* DifferenceKit */,
2237+
DEP003 /* CodeEditSourceEditor */,
22402238
);
22412239
productName = GitMac;
22422240
productReference = PROD01 /* GitMac.app */;
@@ -2270,6 +2268,7 @@
22702268
PKR001 /* XCRemoteSwiftPackageReference "KeychainAccess" */,
22712269
PKR002 /* XCRemoteSwiftPackageReference "Splash" */,
22722270
AC28C3092F08591500A86A78 /* XCRemoteSwiftPackageReference "DifferenceKit" */,
2271+
PKR003 /* XCRemoteSwiftPackageReference "CodeEditSourceEditor" */,
22732272
);
22742273
productRefGroup = GRP002 /* Products */;
22752274
projectDirPath = "";
@@ -2559,8 +2558,6 @@
25592558
BEEC4A2DB5D5582D8B492BA0 /* KaleidoscopeSplitDiffView.swift in Sources */,
25602559
829F68FEF62B134675571C23 /* TiledDiffView.swift in Sources */,
25612560
DA9E7B526F5E3A719D2000E2 /* KaleidoscopeFileList.swift in Sources */,
2562-
E383DC04F92DA4511A25945B /* KaleidoscopeUnifiedView.swift in Sources */,
2563-
1B8CE0E16F3B54417620B0C3 /* FluidConnectionRibbonsView.swift in Sources */,
25642561
9378DD8648BED068B9C9095A /* WordLevelDiff.swift in Sources */,
25652562
05C72084337EFE72DF6DAA39 /* DiffView.swift in Sources */,
25662563
7D301ECE89E70C8DE39AB5C9 /* AlignedDiffView.swift in Sources */,
@@ -2653,6 +2650,7 @@
26532650
1B3AC04978A2FEFCB03188A5 /* StagingComponents.swift in Sources */,
26542651
FAE9C67E11FEF853B37CD1B2 /* JiraPanel.swift in Sources */,
26552652
3A1FBB575237C360F6C5A416 /* MemoryPressureHandler.swift in Sources */,
2653+
CEVF01 /* CodeEditorView.swift in Sources */,
26562654
);
26572655
runOnlyForDeploymentPostprocessing = 0;
26582656
};
@@ -2958,6 +2956,14 @@
29582956
minimumVersion = 0.16.0;
29592957
};
29602958
};
2959+
PKR003 /* XCRemoteSwiftPackageReference "CodeEditSourceEditor" */ = {
2960+
isa = XCRemoteSwiftPackageReference;
2961+
repositoryURL = "https://github.com/CodeEditApp/CodeEditSourceEditor.git";
2962+
requirement = {
2963+
kind = upToNextMajorVersion;
2964+
minimumVersion = 0.9.0;
2965+
};
2966+
};
29612967
/* End XCRemoteSwiftPackageReference section */
29622968

29632969
/* Begin XCSwiftPackageProductDependency section */
@@ -2976,6 +2982,11 @@
29762982
package = PKR002 /* XCRemoteSwiftPackageReference "Splash" */;
29772983
productName = Splash;
29782984
};
2985+
DEP003 /* CodeEditSourceEditor */ = {
2986+
isa = XCSwiftPackageProductDependency;
2987+
package = PKR003 /* XCRemoteSwiftPackageReference "CodeEditSourceEditor" */;
2988+
productName = CodeEditSourceEditor;
2989+
};
29792990
/* End XCSwiftPackageProductDependency section */
29802991
};
29812992
rootObject = PRJ001 /* Project object */;
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
4-
<dict/>
4+
<dict>
5+
<key>IDEPackageSupportUseBuiltinSCM</key>
6+
<true/>
7+
</dict>
58
</plist>

GitMac.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 100 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

GitMac/App/Panels/Center/DiffViewWithClose.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ struct DiffViewWithClose: View {
1212
let fileDiff: FileDiff
1313
var repoPath: String? = nil
1414
let onClose: () -> Void
15+
var onFileSaved: (() -> Void)? = nil
1516

1617
var body: some View {
17-
DiffView(fileDiff: fileDiff, repoPath: repoPath, onClose: onClose)
18+
DiffView(fileDiff: fileDiff, repoPath: repoPath, onClose: onClose, onFileSaved: onFileSaved)
1819
}
1920
}

GitMac/App/Panels/Right/RightCommitDetailPanel.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,11 @@ struct RightCommitDetailPanel: View {
119119

120120
Spacer()
121121
}
122+
.task(id: commit.sha) {
123+
// Load files when commit changes or panel appears
124+
guard let path = appState.currentRepository?.path else { return }
125+
await viewModel.loadCommitFiles(sha: commit.sha, at: path)
126+
}
122127
}
123128

124129
private func loadCommitFileDiff(_ file: CommitFile) {
@@ -130,5 +135,3 @@ struct RightCommitDetailPanel: View {
130135
}
131136
}
132137
}
133-
134-
// ViewModel is in App/ViewModels/CommitDetailViewModel.swift

GitMac/App/Panels/Right/RightStagingPanel.swift

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -57,37 +57,45 @@ struct RightStagingPanel: View {
5757
}
5858
}
5959
}
60-
.onChange(of: appState.selectedCommit) { _, newCommit in
61-
if let commit = newCommit, let path = appState.currentRepository?.path {
62-
let requestedSHA = commit.sha
60+
.onReceive(NotificationCenter.default.publisher(for: .fileSavedInEditor)) { _ in
61+
// Refresh staging when a file is saved in the editor
62+
if let path = appState.currentRepository?.path {
6363
Task {
64-
await commitDetailVM.loadCommitFiles(sha: requestedSHA, at: path)
65-
66-
let firstFile = await MainActor.run { commitDetailVM.changedFiles.first }
67-
guard let firstFile else { return }
68-
69-
let stillSelectedBefore = await MainActor.run { appState.selectedCommit?.sha == requestedSHA }
70-
guard stillSelectedBefore else { return }
71-
72-
await MainActor.run {
73-
isLoadingDiff = true
74-
selectedFileDiff = nil
75-
}
76-
77-
let diff = await commitDetailVM.getDiff(for: firstFile, commit: commit, at: path)
78-
79-
let stillSelectedAfter = await MainActor.run { appState.selectedCommit?.sha == requestedSHA }
80-
guard stillSelectedAfter else { return }
81-
82-
await MainActor.run {
83-
if let diff {
64+
await stagingVM.loadStatus(at: path)
65+
// If we have a selected diff, reload it
66+
if let currentDiff = selectedFileDiff {
67+
let file = StagingFile(path: currentDiff.newPath, status: .modified, isStaged: false)
68+
if let diff = await stagingVM.getDiff(for: file, at: path) {
8469
selectedFileDiff = diff
8570
}
86-
isLoadingDiff = false
8771
}
8872
}
8973
}
9074
}
75+
.onChange(of: appState.selectedCommit) { _, newCommit in
76+
// Single-click: only load the file list, not the diff
77+
if let commit = newCommit, let path = appState.currentRepository?.path {
78+
Task {
79+
await commitDetailVM.loadCommitFiles(sha: commit.sha, at: path)
80+
}
81+
}
82+
// Clear diff when commit changes
83+
selectedFileDiff = nil
84+
}
85+
.onReceive(NotificationCenter.default.publisher(for: .loadFirstFileDiff)) { _ in
86+
// Double-click: load diff for first file
87+
guard let commit = appState.selectedCommit,
88+
let path = appState.currentRepository?.path,
89+
let firstFile = commitDetailVM.changedFiles.first else { return }
90+
91+
Task {
92+
isLoadingDiff = true
93+
if let diff = await commitDetailVM.getDiff(for: firstFile, commit: commit, at: path) {
94+
selectedFileDiff = diff
95+
}
96+
isLoadingDiff = false
97+
}
98+
}
9199
.onChange(of: appState.selectedStash) { _, newStash in
92100
if let stash = newStash, let path = appState.currentRepository?.path {
93101
Task { await stashDetailVM.loadStashFiles(stashRef: stash.reference, at: path) }

0 commit comments

Comments
 (0)