Repository navigation
Fix repository folder drops on the Dock icon - #765
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The document declaration is correctly updated and covered by focused unit and UI regression tests.
0 open findings
What changed in this PR
Updates GitX’s document declaration so macOS accepts repository folders dropped onto the Dock icon, resolving #305.
Changes:
- Declares folder support using
public.folderand routes it toPBGitRepositoryDocument. - Adds unit and UI regression coverage for Launch Services folder opening.
| File | Description |
|---|---|
Resources/Info.plist |
Modernizes the folder document-type declaration. |
GitXUITests/GitXScreenshotTests.m |
Tests repository opening through Launch Services. |
GitXTests/PBGitXDocumentTypesTests.m |
Verifies folder acceptance and document routing. |
GitX.xcodeproj/project.pbxproj |
Adds the document-type tests to the test target. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| @@ -0,0 +1,45 @@ | |||
| #import <XCTest/XCTest.h> | |||
There was a problem hiding this comment.
Thanks, it even includes tests.
|
Thanks for tracking this down, John. The I ran
|
|
Oh sorry, it looks like that I merged too early |
|
These are minor fixes - can be submitted as a followup if we want. |
- testRepositoryFolderOpensThroughLaunchServices: close the repository window via its close button instead of Cmd-W, which was not reliably closing the window on every machine. The expectation now asserts the wait actually completed, and a comment clarifies that any window seen after the Launch Services open event must be newly created, since the original was confirmed fully closed beforehand. - Run `make format` to apply clang-format to the lines added in PBGitXDocumentTypesTests.m and GitXScreenshotTests.m (array literal spacing, wrapped URLByAppendingPathComponent: calls, argument alignment, and brace placement on the new test method). Co-authored-by: Copilot <[email protected]>
|
These are the follow up changes #767 |
Address review feedback on PR #765 tests
- testRepositoryFolderOpensThroughLaunchServices: close the repository window via its close button instead of Cmd-W, which was not reliably closing the window on every machine. The expectation now asserts the wait actually completed, and a comment clarifies that any window seen after the Launch Services open event must be newly created, since the original was confirmed fully closed beforehand. - Run `make format` to apply clang-format to the lines added in PBGitXDocumentTypesTests.m and GitXScreenshotTests.m (array literal spacing, wrapped URLByAppendingPathComponent: calls, argument alignment, and brace placement on the new test method).
Dragging a repository folder onto GitX's Dock icon is rejected on macOS 26.6.2 because the app declares folders using the legacy
foldOSType. Declarepublic.folderwithLSItemContentTypesand associate it withPBGitRepositoryDocument, so macOS accepts the drop and AppKit opens the repository through the existing document flow.Fixes #305.
Validation:
008ad6cc) and confirmed Launch Services reportedacceptsFolder=NO..gitfolder support.xcodebuild test -only-testing:GitXTests: 324 tests passed.xcodebuild test -only-testing:GitXUITests: 8 UI tests passed, including delivery of a repository-folder open event through Launch Services.Manually verified that dragging a repository folder from Finder onto GitX’s Dock icon opens the repository successfully. Automated tests also verify macOS’s folder-drop acceptance and repository opening through Launch Services.