fix(links): respect case in POSIX file links - #9825
Closed
lnieuwenhuis wants to merge 1 commit into
Closed
Conversation
Gate workspace containment case-folding on Windows filesystem paths (drive-letter or backslash UNC) via a shared isWindowsFilesystemPath helper. POSIX paths, including double-slash paths, compare case-sensitively in both the shared resolver and the web display formatter.
Contributor
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a narrowly scoped bug fix that makes POSIX workspace-link containment case-sensitive while preserving Windows behavior. Production changes are limited to existing link metadata and path display logic, with focused cross-platform tests and no defaults, schema, deployment, security, or static-analysis changes. You can add or adjust custom eligibility rules. Learn more. |
Member
|
Superseded by merged #9309 (same POSIX case-sensitive file-link containment fix). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
File-link resolution lowercases every path, so two POSIX siblings that differ only by case resolve to the same target.
Only fold case for Windows filesystem paths (drive-letter or UNC roots); POSIX paths keep their case. Covers POSIX siblings, double-slash POSIX vs UNC, drive roots, UNC share roots, and encoded trailing spaces.
Ports the containment rule of #9309 into the current shared resolver in packages/client-runtime (consumed by web and mobile) instead of the stale web-local diff.
Built with muse-spark-1.3-contributor via OpenCode in T3 Code.
Note
Medium Risk
Changes core path containment used by markdown file links and workspace-relative display across clients; behavior shifts for POSIX case mismatches but is narrowly scoped and heavily tested.
Overview
POSIX workspace containment is now case-sensitive, so paths like
/tmp/.../projectare no longer treated as inside/tmp/.../Project. Previously, workspace-relative resolution lowercased every path and could collapse case-distinct siblings.The shared resolver in
packages/client-runtimeaddsisWindowsFilesystemPathand uses it inworkspaceRelativeFilePathso only Windows drive-letter roots and backslash UNC shares compare case-insensitively; POSIX paths (including//double-slash, which are not UNC) keep exact casing.formatWorkspaceRelativePathin the web app follows the same rule.Tests cover Windows/UNC/drive-root behavior, encoded trailing spaces on file paths, and markdown link metadata that must not mark case-mismatched POSIX paths as workspace files.
Reviewed by Cursor Bugbot for commit ca0e9c5. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix case sensitivity in POSIX workspace file links
Workspace containment checks were case-insensitive for all paths, causing case-distinct POSIX siblings to be wrongly treated as workspace members. The fix adds
isWindowsFilesystemPathto classify drive-letter and backslash UNC paths as Windows, then applies case-insensitive comparison only for those roots and case-sensitive comparison for POSIX roots.workspaceRelativeFilePathin markdownLinks.ts andformatWorkspaceRelativePathin filePathDisplay.ts both select case sensitivity from the workspace root via the new classifier.Macroscope summarized ca0e9c5.