fix: open agent file links in the file viewer - #8098
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 |
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a localized markdown-link fix that adds support for spaced filenames and routes source-file clicks to the existing integrated viewer while retaining PDF browser behavior and modifier-click editor behavior. The change introduces no schema, security, infrastructure, or new capability risk. You can add or adjust custom eligibility rules. Learn more. |
## What's Changed * fix(web): align usage page skeleton layout by @tris203 in pingdotgg/t3code#8111 * fix(web): make terminal links appear clickable only when clickable by @flamboh in pingdotgg/t3code#7488 * fix(web): make Windows file links clickable in chat by @t3dotgg in pingdotgg/t3code#8081 * fix(web): sort usage models by token count by @RakshithBhat03 in pingdotgg/t3code#8108 * fix: open agent file links in the file viewer by @StiensWout in pingdotgg/t3code#8098 ## New Contributors * @flamboh made their first contribution in pingdotgg/t3code#7488 **Full Changelog**: pingdotgg/t3code@v0.0.34-nightly.20260824.1179...v0.0.34-nightly.20260825.1180 Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.34-nightly.20260825.1180
Agent-authored links to filenames with spaces rendered as ordinary web links, so clicks never reached the integrated file viewer. Recognized HTML links opened the browser directly instead of the source viewer.
This accepts spaced relative file paths on web and mobile, then routes normal HTML and XML link clicks through the file viewer. PDFs remain browser-first, modifier clicks still open the preferred editor, and the integrated browser remains available as a secondary action.
Before
A fresh paired web client rendered the agent-authored filenames with spaces as file links. This is the state before the click.
After
Playwright clicked
getByRole('link', { name: 'Updated cutover checklist.html' }). The integrated right-panel file viewer opened, selected that file, and exposedHTML file opened in the integrated file viewer.in its accessibility tree.Testing
Implemented by
gpt-5.6-solin T3 Code through the Codex harness.Note
Low Risk
Link-detection regex and click routing for markdown file chips only. No auth, data, or security-sensitive changes.
Overview
Agent markdown links to filenames with spaces (and HTML/XML files) now resolve as workspace files and open in the integrated file viewer instead of as ordinary web links.
Relative path/name matchers on web and mobile now allow spaces in path segments, so encoded names like
Updated cutover checklist.mdanddocs/My Folder/checklist.xmlare recognized as files.Plain clicks on HTML/XML still go to the file preview. Only PDFs stay browser-first via
shouldOpenMarkdownFileLinkInBrowserByDefault. Modifier-click still opens the preferred editor.Reviewed by Cursor Bugbot for commit 57fefdd. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix markdown file links to open in the file viewer and support spaces in paths
RELATIVE_FILE_PATH_PATTERNandRELATIVE_FILE_NAME_PATTERNin both web and mobile markdown link modules to match filenames and relative paths that contain spaces.shouldOpenMarkdownFileLinkInBrowserByDefaultin markdown-links.ts which returns true only for PDF paths, and updates theMarkdownFileLinkonClick handler in ChatMarkdown.tsx to gate browser navigation on this predicate.MarkdownFileLink.onClickrequiresshouldOpenMarkdownFileLinkInBrowserByDefaultto return true before callingonOpenInBrowser.Macroscope summarized 57fefdd.