Show session-preferred path separators in the code review panel - #14556
Open
warp-agent-staging[bot] wants to merge 1 commit into
Open
Show session-preferred path separators in the code review panel#14556warp-agent-staging[bot] wants to merge 1 commit into
warp-agent-staging[bot] wants to merge 1 commit into
Conversation
Git reports repo-relative paths with `/` on every platform, and the code review panel painted `FileDiff.file_path` verbatim, so a native Windows (PowerShell) session rendered `.github/actions/prepare_environment/action.yml` instead of `.github\actions\prepare_environment\action.yml`. Add a `format_path_for_display` helper that rewrites separators using the focused session's `PathSeparators` and apply it at the display sites only: file headers, renamed old paths, the sidebar directory path, and comment card titles. `FileDiff.file_path` keeps its git-style `/` form so git operations and path lookups are unaffected, and WSL/MSYS2/Unix sessions continue to render forward slashes. Co-Authored-By: Warp <agent@warp.dev> Co-Authored-By: Oz <oz-agent@warp.dev>
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
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.
Description
File paths in the code review panel rendered with UNIX forward slashes on native Windows — e.g.
.github/actions/prepare_environment/action.ymlinstead of.github\actions\prepare_environment\action.yml.Git reports repo-relative paths with
/on every platform, and the panel paintedFileDiff.file_pathverbatim, so the UNIX form leaked into a PowerShell/host-native session. WSL and MSYS2 sessions are correct as-is and must keep forward slashes.This adds a
format_path_for_displayhelper inapp/src/code_review/mod.rsthat rewrites separators using the focused session's existingPathSeparators(Session::path_separators()— PowerShell →for_os(), zsh/bash/fish →for_unix()), falling back toPathSeparators::for_os()when no session is available. It is applied at the display sites only:code_review_view.rs)old_pathin the headercomment_rendering.rs, used by both the code review panel and the blocklist's imported comments)FileDiff.file_pathkeeps its git-style/form, so git operations (discard, stash,git show), path joins, and agent/API payloads are untouched.Linked Issue
APP-5071
Testing
Regression tests:
app/src/code_review/mod_tests.rs— four cases covering a nested path, a single-segment path, a renamed old path, and a Unix session. Verified they fail against the previous raw rendering (left: ".github/actions/prepare_environment/action.yml"vsright: ".github\actions\prepare_environment\action.yml") and pass with the fix.Commands run from the repo root:
./script/format --check— pass./script/check_no_inline_test_modules— passcargo clippy -p warp --all-targets --tests -- -D warnings— passcargo nextest run --no-fail-fast -p warp -E 'test(/code_review/) or test(/blocklist/) or test(/comment/)'— 868 passedI have manually tested my changes locally with
./script/runManual verification used the locally built GUI (
./target/debug/warp-oss) with the code review panel open on this repo's uncommitted changes:app/src/code_review/mod.rs; forward slashes preserved, no regression.PathSeparators::for_windows()(reverted; not part of this diff), the same headers renderapp\src\code_review\mod.rs.A real Windows host was not available in this environment, so the Windows rendering is demonstrated via that forced-separator build plus the unit tests rather than a Windows machine.
Originating thread: https://warpdev.slack.com/archives/C0BDQDW8V5E/p1785444930395599
Computer-use screenshots
CHANGELOG-BUG-FIX: Fixed file paths in the code review panel showing UNIX-style forward slashes on Windows; native Windows sessions now render backslash separators.
Conversation: https://staging.warp.dev/conversation/4ae7f7d3-ede4-4698-9926-2ce3245a04bb
Run: https://oz.staging.warp.dev/runs/019fb4d7-3a3d-7b81-a422-349aa19c33d5
This PR was generated with Oz.