Skip to content

Show session-preferred path separators in the code review panel - #14556

Open
warp-agent-staging[bot] wants to merge 1 commit into
masterfrom
factory/windows-code-review-path-separators
Open

Show session-preferred path separators in the code review panel#14556
warp-agent-staging[bot] wants to merge 1 commit into
masterfrom
factory/windows-code-review-path-separators

Conversation

@warp-agent-staging

Copy link
Copy Markdown
Contributor

Description

File paths in the code review panel rendered with UNIX forward slashes on native Windows — e.g. .github/actions/prepare_environment/action.yml instead of .github\actions\prepare_environment\action.yml.

Git reports repo-relative paths with / on every platform, and the panel painted FileDiff.file_path verbatim, 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_display helper in app/src/code_review/mod.rs that rewrites separators using the focused session's existing PathSeparators (Session::path_separators() — PowerShell → for_os(), zsh/bash/fish → for_unix()), falling back to PathSeparators::for_os() when no session is available. It is applied at the display sites only:

  • file headers (code_review_view.rs)
  • renamed files' old_path in the header
  • the sidebar directory path
  • comment card titles (comment_rendering.rs, used by both the code review panel and the blocklist's imported comments)

FileDiff.file_path keeps 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" vs right: ".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 — pass

  • cargo clippy -p warp --all-targets --tests -- -D warnings — pass

  • cargo nextest run --no-fail-fast -p warp -E 'test(/code_review/) or test(/blocklist/) or test(/comment/)' — 868 passed

  • I have manually tested my changes locally with ./script/run

Manual verification used the locally built GUI (./target/debug/warp-oss) with the code review panel open on this repo's uncommitted changes:

  1. Unix session (this Linux host, unmodified build) — headers render app/src/code_review/mod.rs; forward slashes preserved, no regression.
  2. Native-Windows session simulated — with a temporary local-only patch forcing PathSeparators::for_windows() (reverted; not part of this diff), the same headers render app\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

Warp code review panel showing "Uncommitted changes" with the file header "app/src/ai/blocklist/block.rs" using forward slashes.
Warp code review panel showing all 7 uncommitted file headers, each using forward slashes as path separators.
Warp code review panel showing "Uncommitted changes" with the first file header rendered as app\src\ai\blocklist\block.rs using backslashes.
Warp code review panel listing all 7 uncommitted file headers, each rendered with backslash path separators (e.g. app\src\code_review\mod.rs).

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.

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>
@cla-bot cla-bot Bot added the cla-signed label Jul 30, 2026
@warp-agent-staging
warp-agent-staging Bot marked this pull request as ready for review July 30, 2026 21:50
@warp-agent-staging
warp-agent-staging Bot requested a review from acarl005 July 30, 2026 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant