-
Notifications
You must be signed in to change notification settings - Fork 761
[Windows] Fix Copy Path and Copy Relative Path returning identical results.
#5399
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…the withTrailingSlash function with a new private method withTrailingDelimiter to ensure consistent path formatting. Removed the standalone withTrailingSlash function as it is no longer needed. Signed-off-by: Srihari Thyagarajan <hari.leo03@gmail.com>
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Light2Dark
approved these changes
Jun 22, 2025
kyrre
pushed a commit
to kyrre/marimo
that referenced
this pull request
Jun 26, 2025
…l results. (marimo-team#5399) ## 📝 Summary Fix marimo-team#5395 ## 🔍 Description of Changes Both copy path options in the file explorer's (View File sidebar panel) context menu were returning the same absolute path on Windows systems. The relative path should show only the portion relative to the workspace root, not the full/absolute path. Fixed by replacing the slash logic with a new `withTrailingDelimiter` method that uses the existing `PathBuilder.deliminator` to append the correct path separator accordingly. Added tests covering both Unix and Windows path scenarios. **Before**: Both options returned `D:\full\path\to\file.py` **After**: Copy Path returns `D:\full\path\to\file.py`, Copy Relative Path returns `subfolder\file.py` ## Checklist - [x] I have read the [contributor guidelines](https://github.com/marimo-team/marimo/blob/main/CONTRIBUTING.md). - [ ] For large changes, or changes that affect the public API: this change was discussed or approved through an issue, on [Discord](https://marimo.io/discord?ref=pr), or the community [discussions](https://github.com/marimo-team/marimo/discussions) (Please provide a link if applicable). - [x] I have added tests for the changes made. - [x] I have run the code and verified that it works as expected. ## 📜 Reviewers @akshayka OR @Light2Dark --------- Signed-off-by: Srihari Thyagarajan <hari.leo03@gmail.com> Co-authored-by: Shahmir Varqha <sham9871@gmail.com>
sebbeutler
pushed a commit
to sebbeutler/marimo
that referenced
this pull request
Jun 28, 2025
…l results. (marimo-team#5399) ## 📝 Summary Fix marimo-team#5395 ## 🔍 Description of Changes Both copy path options in the file explorer's (View File sidebar panel) context menu were returning the same absolute path on Windows systems. The relative path should show only the portion relative to the workspace root, not the full/absolute path. Fixed by replacing the slash logic with a new `withTrailingDelimiter` method that uses the existing `PathBuilder.deliminator` to append the correct path separator accordingly. Added tests covering both Unix and Windows path scenarios. **Before**: Both options returned `D:\full\path\to\file.py` **After**: Copy Path returns `D:\full\path\to\file.py`, Copy Relative Path returns `subfolder\file.py` ## Checklist - [x] I have read the [contributor guidelines](https://github.com/marimo-team/marimo/blob/main/CONTRIBUTING.md). - [ ] For large changes, or changes that affect the public API: this change was discussed or approved through an issue, on [Discord](https://marimo.io/discord?ref=pr), or the community [discussions](https://github.com/marimo-team/marimo/discussions) (Please provide a link if applicable). - [x] I have added tests for the changes made. - [x] I have run the code and verified that it works as expected. ## 📜 Reviewers @akshayka OR @Light2Dark --------- Signed-off-by: Srihari Thyagarajan <hari.leo03@gmail.com> Co-authored-by: Shahmir Varqha <sham9871@gmail.com>
sebbeutler
pushed a commit
to sebbeutler/marimo
that referenced
this pull request
Jul 7, 2025
…l results. (marimo-team#5399) ## 📝 Summary Fix marimo-team#5395 ## 🔍 Description of Changes Both copy path options in the file explorer's (View File sidebar panel) context menu were returning the same absolute path on Windows systems. The relative path should show only the portion relative to the workspace root, not the full/absolute path. Fixed by replacing the slash logic with a new `withTrailingDelimiter` method that uses the existing `PathBuilder.deliminator` to append the correct path separator accordingly. Added tests covering both Unix and Windows path scenarios. **Before**: Both options returned `D:\full\path\to\file.py` **After**: Copy Path returns `D:\full\path\to\file.py`, Copy Relative Path returns `subfolder\file.py` ## Checklist - [x] I have read the [contributor guidelines](https://github.com/marimo-team/marimo/blob/main/CONTRIBUTING.md). - [ ] For large changes, or changes that affect the public API: this change was discussed or approved through an issue, on [Discord](https://marimo.io/discord?ref=pr), or the community [discussions](https://github.com/marimo-team/marimo/discussions) (Please provide a link if applicable). - [x] I have added tests for the changes made. - [x] I have run the code and verified that it works as expected. ## 📜 Reviewers @akshayka OR @Light2Dark --------- Signed-off-by: Srihari Thyagarajan <hari.leo03@gmail.com> Co-authored-by: Shahmir Varqha <sham9871@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📝 Summary
Fix #5395
🔍 Description of Changes
Both copy path options in the file explorer's (View File sidebar panel) context menu were returning the same absolute path on Windows systems. The relative path should show only the portion relative to the workspace root, not the full/absolute path.
Fixed by replacing the slash logic with a new
withTrailingDelimitermethod that uses the existingPathBuilder.deliminatorto append the correct path separator accordingly.Added tests covering both Unix and Windows path scenarios.
Before: Both options returned
D:\full\path\to\file.pyAfter: Copy Path returns
D:\full\path\to\file.py, Copy Relative Path returnssubfolder\file.pyChecklist
📜 Reviewers
@akshayka OR @Light2Dark