feat: add copy file name/path to git file menu#338
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8c105844c8
ℹ️ 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".
| ? joinRootAndPath(resolvedRoot, rawPath) | ||
| : rawPath; | ||
| const projectRelativePath = | ||
| workspacePath && resolvedRoot && resolvedRoot.startsWith(workspacePath) |
There was a problem hiding this comment.
Normalize and bound-check workspace prefix before slicing
projectRelativePath is derived by checking resolvedRoot.startsWith(workspacePath) and then slicing by string length, which can misclassify roots that only share a textual prefix (for example /tmp/repo-tools vs /tmp/repo) and also fails on Windows when separators differ (C:\repo vs C:/repo). In these cases, "Copy file path" can produce incorrect values like -tools/src/file.ts or omit the expected subdirectory entirely, so this should use normalized path components and a directory-boundary check before trimming.
Useful? React with 👍 / 👎.
Co-authored-by: Ivan Borinschi <[email protected]>
Co-authored-by: Ivan Borinschi <[email protected]>
Summary
Motivation
Quickly grab a file name or full path from the git changes list without leaving the app.
Testing