fix(web): preserve POSIX path casing in file links
What Changed
Markdown file links now use the shared project-path comparison policy for workspace containment. POSIX paths remain case-sensitive, while Windows drive and UNC paths remain case-insensitive.
The same containment result now drives both tooltip formatting and click routing.
Why
On POSIX, link containment lowercased both paths. A link to a case-distinct sibling such as project/probe.txt could therefore be treated as Project/probe.txt inside the workspace and open the wrong file in the right-panel preview.
Fixes #4804
UI Changes
Before — outside sibling misclassified
After — outside sibling remains absolute
After — inside-workspace display remains relative
Before/after interaction recording
Verification
vp test run packages/shared/src/path.test.ts apps/web/src/markdown-links.test.ts apps/web/src/filePathDisplay.test.ts— 54 tests passed- Targeted lint passed for the changed files
vp run --filter @t3tools/shared typecheckpassedvp run --filter @t3tools/web typecheckpassed
Checklist
- [x] This PR is small and focused
- [x] I explained what changed and why
- [x] I included before/after screenshots for the UI behavior
- [x] I included a video for the interaction change
Model: GPT-5.6 Sol | Harness: Codex in T3 Code
[!NOTE]
Fix POSIX path casing preservation in file links for workspace-relative display
- Adds
resolveWorkspaceRelativePathto filePathDisplay.ts to compute workspace-relative paths with correct case sensitivity: exact-match for POSIX, case-insensitive for Windows and UNC paths.- Refactors
formatWorkspaceRelativePathto preserve drive roots (e.g.C:/) and filesystem roots (/) in display output instead of collapsing them.- Extracts
normalizePathCaseForComparisoninto packages/shared/src/path.ts as a reusable utility; Windows/UNC paths are lowercased and backslash-normalized, POSIX paths are returned unchanged.- Updates markdown-links.ts to use
resolveWorkspaceRelativePathforworkspaceRelativePathin link metadata, replacing a local helper that unconditionally lowercased paths.- Behavioral Change: POSIX file links are now case-sensitive — previously, paths were always lowercased for comparison, which could cause mismatches on case-sensitive filesystems.
Macroscope summarized 2a250cb.
[!NOTE] Medium Risk Changes core path comparison used for link preview routing and display; behavior shifts on case-sensitive filesystems but is covered by expanded tests.
Overview Fixes workspace containment for markdown file links and tooltips so POSIX paths stay case-sensitive, while Windows drive and UNC paths stay case-insensitive.
Adds shared
resolveWorkspaceRelativePath(used by display formatting and link metadata) andnormalizePathCaseForComparisonin@t3tools/shared/path, replacing logic that always lowercased paths for comparison. Display formatting now keeps drive and filesystem roots (e.g.C:/,/) and handles UNC share roots correctly.A link to a case-distinct sibling (e.g.
project/vs workspaceProject/) is no longer treated as in-workspace, so preview routing and relative labels match the real path.Reviewed by Cursor Bugbot for commit dce9bffc36d1bcf2a9d86a1e0f0690883b58b495. Bugbot is set up for automated code reviews on this repo. Configure here.
[!IMPORTANT]
Review skipped
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID:
79227a84-6fb2-4530-9c5a-dd2227c3fbfbYou can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
- [ ] 🔍 Trigger review
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
Approvability
Verdict: Needs human review
This bug fix changes path comparison behavior from unconditional case-insensitivity to platform-aware handling (POSIX case-sensitive, Windows case-insensitive). While well-tested, changes to core path resolution logic that affect runtime behavior warrant human review.
You can customize Macroscope's approvability policy. Learn more.