Repository navigation
Open a chat link to a local file instead of dropping its target - #60
Merged
Merged
Conversation
Agents link files they wrote (`[results](/repo/output/REPORT.md)`).
Only http(s) and mailto targets are safe to follow, so every other
link was reduced to its label: the sentence ended with the label and
the path was gone ("... 실험 결과와 근거" with nothing after it), while
the terminal shows "label (output/REPORT.md)".
A link whose target has no scheme is now a file: its label opens the
path (without a #L12 or :12 line anchor) in the file viewer, and where
no viewer is available the path is shown after the label. Targets
with any other scheme still render as plain label text.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
devswha
added a commit
that referenced
this pull request
Sep 26, 2026
#60 was written before the Korean UI; its "Open <path>" tooltip now goes through t(), like the bare-path button next to it. Co-Authored-By: Claude Fable 5.1 <[email protected]>
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.
Problem
Agents link files they wrote. Codex ended an answer with:
In the chat the sentence ended with "실험 결과와 근거" and nothing after it. The path was gone, and there was nothing to click. The terminal shows
실험 결과와 근거 (output/test/…/REPORT.md).Cause
parseInlinefollows onlyhttp(s):andmailto:targets, which is right for an<a href>. Every other link was reduced to its bare label, so a local file target was dropped along with the unsafe ones.Fix
{ type: "file", path, children }for a link whose target has no scheme (/abs/x.md,src/x.ts#L12,~/y.md:3). A#…or:line[:col]suffix is dropped.Markdownrenders it as a.markdown-filebutton with the link's label that opens the path in the file viewer, the same viewer bare paths in the chat already open. The label is rendered with the viewer context off, so a code-span label does not nest a second button.OpenFileContextis null), the path is shown after the label, as Codex's terminal does:label (path).javascript:,data:) or a bare#anchorstill renders as the label text, as before.Tests
src/lib/markdown.test.ts: file links, with and without line anchors.javascript:,data:and#sectionstay text.bun testall pass,tsc --noEmitclean.Open /home/…/REPORT.md, and a click opens REPORT.md in the file viewer.Related: #59 fixes the same kind of answer failing to bind to its rollout while the terminal is attached.
🤖 Generated with Claude Code