Skip to content

fix: open agent file links in the file viewer - #8098

Merged
maria-rcks merged 1 commit into
pingdotgg:mainfrom
StiensWout:t3code/fix-highlighted-file-viewer
Aug 24, 2026
Merged

fix: open agent file links in the file viewer#8098
maria-rcks merged 1 commit into
pingdotgg:mainfrom
StiensWout:t3code/fix-highlighted-file-viewer

Conversation

@StiensWout

@StiensWout StiensWout commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

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.

Agent file links before click

After

Playwright clicked getByRole('link', { name: 'Updated cutover checklist.html' }). The integrated right-panel file viewer opened, selected that file, and exposed HTML file opened in the integrated file viewer. in its accessibility tree.

Integrated file viewer after click

Testing

  • 98 focused web, mobile, and right-panel tests
  • Targeted lint for the five changed files
  • Web TypeScript check
  • Mobile TypeScript check

Implemented by gpt-5.6-sol in 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.md and docs/My Folder/checklist.xml are 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

  • Expands RELATIVE_FILE_PATH_PATTERN and RELATIVE_FILE_NAME_PATTERN in both web and mobile markdown link modules to match filenames and relative paths that contain spaces.
  • Adds shouldOpenMarkdownFileLinkInBrowserByDefault in markdown-links.ts which returns true only for PDF paths, and updates the MarkdownFileLink onClick handler in ChatMarkdown.tsx to gate browser navigation on this predicate.
  • Adds tests covering percent-encoded spaces in bare filenames and relative paths, and PDF-vs-HTML/XML browser routing.
  • Behavioral Change: file-link clicks now open in the in-app file viewer for non-PDF files instead of always opening in the browser; MarkdownFileLink.onClick requires shouldOpenMarkdownFileLinkInBrowserByDefault to return true before calling onOpenInBrowser.

Macroscope summarized 57fefdd.

@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1f5078ad-4d60-4748-95f4-435af04fa9cb

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Aug 24, 2026
@macroscopeapp

macroscopeapp Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 57fefdd

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.

@maria-rcks
maria-rcks merged commit 9996038 into pingdotgg:main Aug 24, 2026
24 checks passed
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Aug 25, 2026
## 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
frankdavidcorona pushed a commit to frankdavidcorona/t3code that referenced this pull request Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants