fix: open Windows file links in chat - #5283
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 |
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 b63420e. Configure here.
ApprovabilityVerdict: Approved e1752e5 Straightforward bug fix for Windows file path handling in chat markdown. Changes are self-contained to link processing logic, include comprehensive test coverage, and have no security or infrastructure implications. You can customize Macroscope's approvability policy. Learn more. |
e1752e5 to
3b9f4f9
Compare
3b9f4f9 to
76625da
Compare

Summary
Make chat file links in Windows native app clickable
Clicking opens sidebar with the file
Adds a relevant file icon too
Why
Chat file links in Windows native apps look clickable, act clickable, but arent, its confusing, would be nice to add clickable behavior
Validation
Have AI reply to you with file links in chat on Windows app:
Before:
After ( clickable, opens sidebar with file ):
Note
Low Risk
Localized markdown link normalization and sanitize allowlist for chat rendering; no auth or server changes, with added unit tests.
Overview
Windows drive-letter paths in chat markdown (e.g.
C:/Users/...orfile:///D:/...) now survive sanitization and are normalized so the existing file-link UI can treat them as workspace files instead of broken or external links.rehype-sanitizeis extended so single-letterhrefprotocols are allowed beforeurlTransformruns—otherwiseC:is stripped as an unknown scheme.rewriteMarkdownFileUriHrefthen canonicalizes backslashes, encoded%5C, and duplicate slashes to a leading-slash form like/C:/path, which keeps the drive letter from being parsed as a URL scheme downstream.Tests cover
file://Windows URIs, angle-bracketed destinations, and several slash/encoding variants; non-file hrefs likehttps://andx:commandstay unchanged.Reviewed by Cursor Bugbot for commit 76625da. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
[!NOTE]
Fix Windows drive letter file links opening in chat
C:) so they are not stripped beforeurlTransformruns.rewriteMarkdownFileUriHrefin markdown-links.ts to canonicalize Windows drive-style hrefs (including backslash, URL-encoded backslash, and duplicate-slash variants) to a leading-slash form like/C:/path.file://URIs, angle-bracketed paths, and various slash/encoding variants.Macroscope summarized 76625da.