Skip to content

Conversation

@Haleshot
Copy link
Contributor

📝 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 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

  • I have read the contributor guidelines.
  • For large changes, or changes that affect the public API: this change was discussed or approved through an issue, on Discord, or the community discussions (Please provide a link if applicable).
  • I have added tests for the changes made.
  • I have run the code and verified that it works as expected.

📜 Reviewers

@akshayka OR @Light2Dark

Haleshot added 2 commits June 21, 2025 23:48
…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>
@vercel
Copy link

vercel bot commented Jun 21, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
marimo-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 22, 2025 4:28am

@akshayka akshayka merged commit 0a9ee16 into marimo-team:main Jun 23, 2025
18 of 20 checks passed
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Windows] File Explorer Copy Path and Copy Relative Path return same path

3 participants