-
-
Notifications
You must be signed in to change notification settings - Fork 177
feat: add show in Finder to git file menu #335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add show in Finder to git file menu #335
Conversation
5079999 to
1e2acf2
Compare
1e2acf2 to
9fc86d4
Compare
|
@codex review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9fc86d4c45
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const rawPath = targetPaths[0]; | ||
| const absolutePath = resolvedRoot | ||
| ? joinRootAndPath(resolvedRoot, rawPath) | ||
| : rawPath; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolve relative git roots to absolute before reveal
When a user picks a git root inside the workspace, the app stores a relative path (e.g., subdir) in settings, so resolvedRoot here can be relative rather than absolute. In that case absolutePath becomes something like subdir/file, and revealItemInDir will run against a relative path (typically the app’s CWD), which can fail or reveal the wrong file. This shows up whenever the git root is a subfolder of the workspace. Consider resolving relative git roots against workspacePath before calling revealItemInDir.
Useful? React with 👍 / 👎.
|
Addressed the relative git root issue by resolving roots against workspacePath before reveal. Added a targeted test and ensured the context-menu test scopes to the current render to avoid stale rows. |
|
@codex review |
|
To use Codex here, create a Codex account and connect to github. |
|
@codex review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c3d7fd17c1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| try { | ||
| if (!resolvedRoot && !absolutePath.startsWith("/")) { | ||
| pushErrorToast({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Accept Windows absolute paths when git root is empty
The guard !resolvedRoot && !absolutePath.startsWith("/") assumes absolute paths only start with /, so on Windows an absolute path like C:/repo/file (or a UNC path) will incorrectly trigger the "Select a git root first" error even though absolutePath is already absolute. This means the new menu item will fail in cases where the diff path is already absolute but gitRoot is unset, which is plausible for external diffs or non-standard roots. Consider using the existing isAbsolutePath helper (or similar) here so Windows absolute paths are accepted.
Useful? React with 👍 / 👎.
Summary
Motivation
Provide a fast jump from a changed file in the Git panel to its location in Finder.
Testing
npm run test