-
-
Notifications
You must be signed in to change notification settings - Fork 176
Fix Windows local browse paths #212
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
Open
Nul-led
wants to merge
2
commits into
friuns2:main
Choose a base branch
from
Nul-led:agent/fix-windows-local-browse
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| import { describe, expect, it } from 'vitest' | ||
| import { decodeBrowsePath } from './localBrowseUi' | ||
|
|
||
| describe('decodeBrowsePath', () => { | ||
| it('removes the browse-route slash before Windows drive paths', () => { | ||
| expect(decodeBrowsePath('/C:/Users/Nulled/video.mp4', 'win32')).toBe('C:/Users/Nulled/video.mp4') | ||
| expect(decodeBrowsePath('/%43%3A/Users/Nulled/file.ps1', 'win32')).toBe('C:/Users/Nulled/file.ps1') | ||
| }) | ||
|
|
||
| it('preserves Unix, UNC, and already normalized paths', () => { | ||
| expect(decodeBrowsePath('/home/codex/file.txt', 'linux')).toBe('/home/codex/file.txt') | ||
| expect(decodeBrowsePath('//server/share/file.txt', 'win32')).toBe('//server/share/file.txt') | ||
| expect(decodeBrowsePath('C:/Users/Nulled/file.txt', 'win32')).toBe('C:/Users/Nulled/file.txt') | ||
| }) | ||
|
|
||
| it('leaves malformed URL encoding usable for the normal validation path', () => { | ||
| expect(decodeBrowsePath('/tmp/100%/file.txt', 'linux')).toBe('/tmp/100%/file.txt') | ||
| }) | ||
| }) |
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
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
25 changes: 25 additions & 0 deletions
25
tests/chat-composer-rendering/windows-absolute-file-links-open-local-browse.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| ### Feature: Windows absolute file links open through local browse | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - Run CodexApp on Windows. | ||
| - Open TestChat with a project that contains an existing text file and MP4 file on a drive-letter path. | ||
|
|
||
| ## Steps | ||
|
|
||
| 1. Send a message containing Markdown links to `C:/path/to/file.ps1` and `C:/path/to/video.mp4`. | ||
| 2. Inspect both rendered links and confirm their `href`, title, and visible text preserve the complete drive-letter paths. | ||
| 3. Open the text-file link and confirm the request returns the existing file instead of a 404 response. | ||
| 4. Open the MP4 link and seek within the video. | ||
| 5. Inspect the MP4 request and confirm byte-range requests return `206 Partial Content` with `Accept-Ranges: bytes`. | ||
|
|
||
| ## Expected Results | ||
|
|
||
| - Windows drive paths are decoded as `C:/...`, not `/C:/...` or `C:\\C:\\...`. | ||
| - Existing files return successfully through `/codex-local-browse/C:/...`. | ||
| - MP4 files use the correct media content type and support browser range requests. | ||
| - Unix absolute paths and UNC paths retain their existing behavior. | ||
|
Comment on lines
+8
to
+23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 2. Missing light/dark verification step The added manual test case for the changed link/browse UI does not require validation in both light and dark themes. This increases the risk of theme-specific regressions going unnoticed. Agent Prompt
|
||
|
|
||
| ## Rollback / Cleanup | ||
|
|
||
| - Close the opened file and video tabs. No files are modified by this test. | ||
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.
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.
1. Windows browse hrefs broken
🐞 Bug≡ CorrectnessAgent Prompt
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools