fix(web): don't label Windows paths outside the workspace as relative#13414

closed1
main
GitHub fork: fix/web-windows-path-outside-workspace
openedSep 24, 2026byVValeraZSD
View on GitHubTwo-way sync enabledPR last imported 12d ago

On Windows, a file outside the project, like an agent editing C:\Users\me\.claude\settings.json, shows up in the timeline as repo/C:/Users/me/.claude/settings.json, and "Copy relative path" on a chat file link copies that same string. formatWorkspaceRelativePath only treated paths starting with / as absolute, so a drive path fell into the relative branch and got the workspace label put in front of it.

It now skips the relative branch for Windows absolute paths too, which is what already happens to /Users/... on macOS. Paths inside the workspace are unchanged.

This is a one-line fix for an obvious display bug, so it goes under the small-fix exception in CONTRIBUTING rather than a prior issue.

Verification

Web dev server (vp run dev) from a worktree at main 3982f20ce4, Windows 10, isolated .t3 state, headless Edge at 1000×640 (2x). One seeded thread whose agent changed C:\Users\demo\.claude\settings.json (outside the project) and src\config.ts (inside it). The project root ends in apps\server, so the workspace label is server. No provider ran.

  • Timeline, "Changed 2 files" expanded. Main: server/C:/Users/demo/.claude/settings.json. Fix: C:/Users/demo/.claude/settings.json. The file inside the project reads server/src/config.ts in both.
  • Right-click the settings.json chat link, "Copy relative path", read the clipboard back. Main: server/C:/Users/demo/.claude/settings.json. Fix: C:/Users/demo/.claude/settings.json.
  • vp test run src/filePathDisplay.test.ts in apps/web: with main's filePathDisplay.ts the new case fails (1 failed, 5 passed); with the fix, 6 passed.
  • On current main 67c0fc0cda, filePathDisplay.ts is unchanged and the branch still merges cleanly.

Not checked: the Electron shell, and mobile, which formats paths with its own helper in apps/mobile/src/features/files/filePath.ts and is not touched here.

Before (main 3982f20ce4):

Before: timeline shows server/C:/Users/demo/.claude/settings.json

Before, light theme

After (with this fix):

After: timeline shows C:/Users/demo/.claude/settings.json

After, light theme

Model and harness

Claude Opus 5.5 (high effort) in Claude Code, run from T3 Code.

Summary by CodeRabbit

  • Bug Fixes
    • Windows absolute paths outside the workspace are now displayed as normalized absolute paths instead of being incorrectly shown as workspace-relative.

Checks

10 successful · 6 skipped
All checks passed
9b37e42

Added 1 commit

  • fix(web): Windows paths outside the workspace9b37e42
Synced from GitHub

Approvability

Verdict: Approved at 9b37e42

Macroscope's review found this PR approvable — This is a narrowly scoped web formatting fix that prevents external Windows absolute paths from being mislabeled as workspace-relative. It includes focused regression coverage and does not alter defaults, APIs, infrastructure, or static-analysis settings.

You can add or adjust custom eligibility rules. Learn more.

Synced from GitHub

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 3fdabeb2-17ca-4dce-a3dd-946133927ea8

📥 Commits

Reviewing files that changed from the base of the PR and between b2b43bef73447c483ceae486890cb79f01c369cb and 9b37e42f8292ac3f91671be420b9f62413b03cd8.

📒 Files selected for processing (2)
  • apps/web/src/filePathDisplay.test.ts
  • apps/web/src/filePathDisplay.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 4 remain after this review.


📝 Walkthrough

Walkthrough

The path formatter now excludes Windows absolute paths from workspace-relative formatting. A test checks normalized backslash paths and paths on a different drive.

Changes

Windows Path Display

Layer / File(s)Summary
Exclude Windows absolute paths from workspace-relative formatting
apps/web/src/filePathDisplay.ts, apps/web/src/filePathDisplay.test.ts
The formatter returns normalized Windows absolute paths outside the workspace without applying workspace-label formatting. The test checks a backslash path and a path on a different drive.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix · Severity of issue fixed: Low

Merge Risk: ⚪ Minimal · up to 9b37e

Outside-workspace Windows paths retain normalized absolute display, while paths inside the workspace remain workspace-relative. The supplied tests cover these behaviors; no concrete merge risk remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check nameStatusExplanationResolution
Docstring Coverage⚠️ WarningDocstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files.Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check nameStatusExplanation
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
Title check✅ PassedThe title clearly and concisely describes the main change: preventing Windows paths outside the workspace from being labeled as relative.
Description check✅ PassedThe description explains the Windows path bug, the affected behavior, and the implemented fix. It does not use the template headings or include the checklist, but it contains the required core informa…
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

Note

This comment is posted by Julius' dot

This changes path labels in the timeline and chat, but the PR has no before/after screenshots. The verification rule requires them for UI changes; the formatting regression alone doesn't show the rendered result. Closing for that missing evidence. Please add captures of an external Windows path and request reconsideration.

Synced from GitHub

Added the captures the closure asked for: an agent edit to C:\Users\demo\.claude\settings.json outside the workspace, before and after, in both themes, plus what "Copy relative path" copies in each case. The run, the focused test (red on main, green with the fix) and what was not checked are in the description under Verification. The bug is still on main 67c0fc0cda and the branch merges cleanly. Requesting reconsideration.

Synced from GitHub

Replaced by #28469, the same fix rebuilt on current main with fresh captures.