Repository navigation
Conversation
A relative link such as ../other/notes.md was joined onto the workspace root and left .. in the path. Workspace membership treated that string as a project file, and the server rejected the escaping relative path. Collapse . and .. lexically on markdown file links only, after ~/ expansion and before the membership check, so a link outside the workspace opens as a host file. Roots stay intact, including //server/share.
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR changes production markdown-link resolution and adds substantial cross-platform path normalization for workspace and host-file targets. Although the scope is focused and well tested, the bespoke handling of POSIX, Windows, UNC, home, and position-suffix paths is complex enough to merit human review. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (4)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughMarkdown file-link resolution now collapses lexical ChangesFile Link Path Resolution
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix · Severity of issue fixed: Low Suggested reviewers: Merge Risk: ⚪ Minimal · up to Outside-workspace Markdown links can open as host files, and no actionable issue remains that would prevent merging after normal checks. Architecture SummaryArchitecture risk: 🟡 Medium · up to The change affects 1 system. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
Reliability and maintainability
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
Superseded; redoing from scratch. |
What Changed
Markdown file links collapse
.and..lexically inresolveMarkdownFileLinkTarget, after~/expansion and before the workspace-membership check.resolvePathLinkTargetis unchanged, so terminal, Git, preview, and file-manager links are untouched. A link that lands outside the workspace becomes an absolute host path. An in-workspace link such asdocs/guide/../readme.mdstays a workspace file. POSIX/, drive roots (C:\,C:/), backslash UNC (\\server\share), and forward-slash UNC (//server/share) stay intact, and..does not climb above them.:lineand:line:columnsuffixes are preserved. The server still rejects escaping relative paths.apps/mobileis unchanged.Why
A relative markdown link such as
../other/notes.mdwas joined onto the workspace root and left..in the string. Membership treated/…/project/../other/notes.mdas the workspace-relative path../other/notes.md, and the server rejected it. Absolute and~/forms of the same file already opened as host files.Fixes #16354. This supersedes #16754, which was rejected because it normalized paths inside the shared resolver and collapsed
//server/share/dir/../file.mdto/server/share/file.md.Verification
upstream/main655dfbe8ba87f0f9ef1d6fad83c20634634653aa83dfa3b0659d420e0e0a9ee4bd4fd5f1822fb73cCommands and results:
vp test run apps/web/src/terminal-links.test.ts apps/web/src/markdown-links.test.ts— 2 files, 101 tests passedvp run --filter @t3tools/web typecheck— exit 0vp run --filter @t3tools/web test— 458 files, 6162 tests passed (108.68s)vp run knip:check— exit 0vp check— all 5061 files formatted; 0 errors and 894 warnings in 4850 files (warnings pre-existing)Manual check: workspace
/tmp/fx/project, sibling file/tmp/fx/other/notes.md, andlinks.mdwith[notes.md](../other/notes.md)plus in-workspace[readme.md](docs/guide/../readme.md). Openedlinks.mdin the Files panel rendered markdown preview, hovered thenotes.mdchip, then clicked it. Before: tooltip/tmp/fx/project/../other/notes.md; click shows breadcrumbsproject / .. / other / notes.mdand “The requested path is outside the workspace.” That sentence is the preview panel’s mapping of the serverworkspace_path_outside_rootrejection, whose raw message isFailed to read workspace file '../other/notes.md' in '/tmp/fx/project'.After: tooltip/tmp/fx/other/notes.md; click opens the host file, breadcrumbstmp / fx / other / notes.md, headingSIBLING_NOTES_OUTSIDE_WORKSPACE.Surfaces: web Files preview (desktop uses the same web UI). Mobile, providers, and contracts were left alone.
Limitations: collapse is lexical and does not follow symlinks; an incomplete UNC path such as
//server/../file.mdis left unchanged; this was not run on Windows.UI Changes
Before

[before.mp4 (download)](https://raw.githubusercontent.com/macodev00/t3code/9a069c6f43588df151703253e43e11b8e557e4ac/issue-16354/before/recording.mp4)After

[after.mp4 (download)](https://raw.githubusercontent.com/macodev00/t3code/9a069c6f43588df151703253e43e11b8e557e4ac/issue-16354/after/recording.mp4)Checklist
..links outside the workspace fail to openresolvePathLinkTargetis unchanged\\server\share, and//server/shareroots stay intactvp run knip:check, andvp checkpassed