fix(web): preserve POSIX path casing in file links - #4805
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
8356a0a to
22c08d6
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 22c08d6. Configure here.
ApprovabilityVerdict: 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. |

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.txtcould therefore be treated asProject/probe.txtinside 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
t3PR.mp4
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 passedvp run --filter @t3tools/shared typecheckpassedvp run --filter @t3tools/web typecheckpassedChecklist
Model: GPT-5.6 Sol | Harness: Codex in T3 Code
Note
Fix POSIX path casing preservation in file links for workspace-relative display
resolveWorkspaceRelativePathto filePathDisplay.ts to compute workspace-relative paths with correct case sensitivity: exact-match for POSIX, case-insensitive for Windows and UNC paths.formatWorkspaceRelativePathto preserve drive roots (e.g.C:/) and filesystem roots (/) in display output instead of collapsing them.normalizePathCaseForComparisoninto packages/shared/src/path.ts as a reusable utility; Windows/UNC paths are lowercased and backslash-normalized, POSIX paths are returned unchanged.resolveWorkspaceRelativePathforworkspaceRelativePathin link metadata, replacing a local helper that unconditionally lowercased paths.Macroscope summarized 1165c05.