Skip to content

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

Open
ValeraZSD wants to merge 3 commits into
pingdotgg:mainfrom
ValeraZSD:fix/web-windows-path-outside-workspace-v2
Open

ValeraZSD wants to merge 3 commits into
pingdotgg:mainfrom
ValeraZSD:fix/web-windows-path-outside-workspace-v2

Conversation

@ValeraZSD

@ValeraZSD ValeraZSD commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

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.

Replaces https://git.cafe/pingdotgg/t3code/pulls/13414, which was closed for missing captures. The captures were added there on 20 Oct with a reconsideration request; this is the same fix rebuilt on current main, as the closure guide's replacement route.

Verification

Web dev server (vp run dev) from a worktree at main 8b74a69019, 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.
  • vp test run src/filePathDisplay.test.ts in apps/web: with main's filePathDisplay.ts the new case fails (1 failed, 1 passed); with the fix, 2 passed.

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 8b74a69019):

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.

Fixes #27308

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Nov 1, 2026
@macroscopeapp

macroscopeapp Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at b025102

Macroscope's review found this PR approvable — Windows paths outside the workspace retain their absolute labels rather than receiving a misleading workspace prefix. The change is limited to displayed and copied path text, without changing file targets or stored data.

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

@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The path formatter now preserves normalized Windows absolute paths outside the workspace. Tests cover external Windows paths and relative paths.

Changes: Workspace-relative path formatting

Layer / File(s) Summary
Path formatting behavior and tests
apps/web/src/filePathDisplay.ts, apps/web/src/filePathDisplay.test.ts
The relative-path fallback excludes Windows absolute paths. Tests cover an external Windows path, a drive-qualified path, and a relative path.

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

Change: Bug fix · Severity of issue fixed: Low

Possibly related PRs

  • pingdotgg/t3code#31639: Changes the same Windows absolute path fallback behavior and adds overlapping path-formatting tests.

Suggested reviewers: t3dotgg, juliusmarminge

Merge Risk: Minimal · up to e7de1

Windows paths outside the workspace will display as absolute paths, without the workspace label prefix. Paths inside the workspace are reported as unchanged. No merge-blocking risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "fix(web): don't label Windows paths outside the workspace as relative" matches the main change: Windows absolute paths outside the workspace no longer receive the workspace label in filePat…
Description check Passed The description covers the problem (Windows drive paths get the workspace label prefixed), the change (skip the relative branch for Windows absolute paths), scope (a small-fix exception under CONTRIBU…
Linked Issues check Passed Issue #27308 requires that an absolute Windows path outside the workspace stay absolute in activity headings, without the workspace basename. The reviewed head changes formatWorkspaceRelativePath in…
Out of Scope Changes check Passed The whole-PR diff against the merge base touches two files. apps/web/src/filePathDisplay.ts adds one guard clause to the relative-path branch. apps/web/src/filePathDisplay.test.ts adds a regression te…
Full details: Title check

Explanation

The title "fix(web): don't label Windows paths outside the workspace as relative" matches the main change: Windows absolute paths outside the workspace no longer receive the workspace label in filePathDisplay.ts. It is a conventional commit title in plain language, and it names the affected area (web) and the behavior.

Full details: Description check

Explanation

The description covers the problem (Windows drive paths get the workspace label prefixed), the change (skip the relative branch for Windows absolute paths), scope (a small-fix exception under CONTRIBUTING, with a replaced PR and a linked issue #27308), and verification (dev server captures, test results before and after). It also states what was not checked (Electron and mobile). The template's Problem, Change, Scope, Verification, and model/harness sections are all present. The linked issue and the small-fix claim are both stated, so the description is substantively complete.

Full details: Linked Issues check

Explanation

Issue #27308 requires that an absolute Windows path outside the workspace stay absolute in activity headings, without the workspace basename. The reviewed head changes formatWorkspaceRelativePath in apps/web/src/filePathDisplay.ts. The relative-path branch now also requires !isWindowsAbsolutePath(normalizedPath). A drive-qualified path such as C:/tmp/image.png no longer enters that branch, so it keeps its normalized form. isWindowsAbsolutePath (packages/shared/src/path.ts) matches C:/ after separator normalization, so the forward-slash and backslash inputs from the issue both take the fixed path. In-workspace paths still take the earlier workspace-root branch, and POSIX paths still skip the relative branch, which matches the issue's controls. The new test in apps/web/src/filePathDisplay.test.ts covers a backslash Windows path outside the workspace, a forward-slash D:/ path, and a relative path that still receives the label. The issue's scope excludes the image-visibility symptom, WSL, and Markdown escaping, and the PR does not claim to address them. Electron and mobile were not verified. Mobile uses a separate helper that the issue does not name as in scope. The PR's manual browser verification is not a coding requirement and is not assessed here.

Full details: Out of Scope Changes check

Explanation

The whole-PR diff against the merge base touches two files. apps/web/src/filePathDisplay.ts adds one guard clause to the relative-path branch. apps/web/src/filePathDisplay.test.ts adds a regression test for that branch. Both changes stay within the formatter behavior described in #27308. No unrelated files or refactors appear in the diff. The PR does not change the mobile helper, the image-visibility path, or WSL handling, and it does not claim to.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between b025102 and e7de164.

Files selected for processing: 1

  • apps/web/src/filePathDisplay.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

juliusmarminge and others added 2 commits November 12, 2026 20:45
AI-assisted; verified with the tests and tools listed above.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@juliusmarminge

Copy link
Copy Markdown
Member

The automated pipeline stopped on this pull request and will not merge it:

the fix is written and reviewed, but proving it needs something no worker has:

  • Permanent blocker: Native Windows with T3 Code desktop is required for the supplied reproduction using C:/work/project and C:/tmp/image.png. This Linux VM cannot execute those steps, and the brief prohibits working around unavailable Windows. External-path labels, in-workspace labels, and relative-path controls remain unverified on both commits.

It stays open for a person to finish or close.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Native Windows image-read activity prefixes external absolute paths with the project name

2 participants