Before submitting#
Area#
apps/web
Steps to reproduce#
- In a thread whose workspace has a folder
patches, have the agent reply with [patches/](patches/) and [./patches/](./patches/).
- Click each link.
Expected behavior#
Both open the folder, as folder links have since #10909.
Actual behavior#
[./patches/](./patches/) is a folder chip and opens. [patches/](patches/) renders as an ordinary blue link, and clicking it does nothing, with no error or toast.
looksLikeFilePath rejects it: RELATIVE_FILE_PATH_PATTERN needs a segment after the last /, and RELATIVE_FILE_NAME_PATTERN needs an extension. The same folder passes as ./patches/, as an absolute path with a trailing slash, or as docs/My Folder without one (the test "resolves relative spaced folders"), although explicit Markdown links are meant to need less path evidence than inline code (markdown-links.ts).
The rejected link stays an <a target="_blank"> with the relative href. The click handler leaves non-web hrefs to the browser, which resolves it against the t3code: origin, and the desktop's setWindowOpenHandler denies anything that isn't http(s) without feedback. So any relative link that isn't recognized as a file is a silent dead click.
A possible fix is to accept a trailing slash on a relative link path, and to show an error instead of a dead click for a link that is neither a file nor a web URL.
Impact#
Minor bug or occasional failure
Version or commit#
0.0.46-nightly.20261003.2623 (fed41fa)
Environment#
Desktop app on Linux (NixOS, Wayland, niri); Claude Code 2.1.288
Logs or stack traces#
No response
Screenshots, recordings, or supporting files#
No response
Workaround#
No response
Note
Grok responding on behalf of Julius.
Triage#
Thanks @Vantrongs for the clear repro and for tracing it all the way down to
looksLikeFilePath.Confirmed. It's still the behavior on main (
ce90eec), which is newer than nightlyfed41fa.parseMarkdownFileLinkaccepts./patches/because of the./prefix, and it accepts/tmp/favicons/because/tmp/is a filesystem root.patches/falls through toRELATIVE_FILE_PATH_PATTERNinpackages/client-runtime/src/markdownLinks.ts, which needs a non-empty segment after the last slash, so the link isn't treated as a file. The same happens to any relative folder written with a trailing slash and no./,../, or~/prefix, includingdocs/My Folder/andapps/web/src/.docs/My Folderwithout the slash still matches, which is why that test passes. A bare name with no slash, likereadme, is rejected on purpose.Once the link isn't a file,
MarkdownAnchorleaves it as a plain<a target="_blank">. The click handler only catches same-page fragments, web media, change requests, and http(s) URLs, so a relative href falls through. On desktop,setWindowOpenHandlersilently denies anythingparseSafeExternalUrldoesn't accept, which is why nothing happens. In a regular browser, the same link opens a new tab against the app's own origin. Mobile uses the same classifier, sopatches/isn't a file chip there either.Likely fix area#
looksLikeFilePathcould treat an explicit relative link that ends in/as a folder.fileBasenamealready labels that form as a folder, and recognized folder chips already open the file tree (#10909), so recognition looks like the only missing step. Inline code could keep the stricter check ininlineCodeFilePathCandidate, so`patches/`stays plain code. The shared tests inpackages/client-runtime/src/markdownLinks.test.tswould cover both clients.mailto:and other non-http links take the same silent path on desktop, so that may be worth tracking on its own.A maintainer will decide on the fix direction.
Related, but not the same: merged #10909 and #5460, and open PRs #8254 and #14510, all deal with chips that are already recognized or with labeling a trailing separator.