Skip to content

fix(web): preserve POSIX path casing in file links - #4805

Open
AksharP5 wants to merge 4 commits into
pingdotgg:mainfrom
AksharP5:fix/posix-workspace-link-containment
Open

fix(web): preserve POSIX path casing in file links#4805
AksharP5 wants to merge 4 commits into
pingdotgg:mainfrom
AksharP5:fix/posix-workspace-link-containment

Conversation

@AksharP5

@AksharP5 AksharP5 commented Jul 29, 2026

Copy link
Copy Markdown

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

A lowercase sibling link is displayed as Project/probe.txt and opens the uppercase workspace file

After — outside sibling remains absolute

The lowercase sibling link preserves its absolute path

After — inside-workspace display remains relative

An exact-case workspace file still displays as Project/probe.txt

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 passed
  • Targeted lint passed for the changed files
  • vp run --filter @t3tools/shared typecheck passed
  • vp run --filter @t3tools/web typecheck passed

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for the UI behavior
  • 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 resolveWorkspaceRelativePath to filePathDisplay.ts to compute workspace-relative paths with correct case sensitivity: exact-match for POSIX, case-insensitive for Windows and UNC paths.
  • Refactors formatWorkspaceRelativePath to preserve drive roots (e.g. C:/) and filesystem roots (/) in display output instead of collapsing them.
  • Extracts normalizePathCaseForComparison into 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 resolveWorkspaceRelativePath for workspaceRelativePath in 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 1165c05.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ab2014b9-d79b-41fd-97c2-68d052343bc4

You can disable this status message by setting the reviews.review_status to false in 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.

❤️ Share

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

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Jul 29, 2026
Comment thread apps/web/src/filePathDisplay.ts
@AksharP5
AksharP5 force-pushed the fix/posix-workspace-link-containment branch from 8356a0a to 22c08d6 Compare July 29, 2026 01:17
@AksharP5
AksharP5 marked this pull request as ready for review July 29, 2026 01:19

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ 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.

Comment thread apps/web/src/filePathDisplay.ts
@macroscopeapp

macroscopeapp Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

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.

@github-actions github-actions Bot added size:L 100-499 changed lines (additions + deletions). and removed size:M 30-99 changed lines (additions + deletions). labels Jul 29, 2026
Comment thread apps/web/src/filePathDisplay.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 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]: Case-distinct POSIX Markdown file link opens the wrong workspace file

1 participant