You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(web): web search result links follow Open links in - #42882
With Settings → Browser → Open links in set to T3 Code, clicking a result link in an expanded web search entry still opened the system browser on desktop, because the link never checked that setting. Result links now use the same link-target routing as links in chat messages. They open in the thread's Browser tab when that is the chosen target, and still open externally otherwise, including on Cmd/Ctrl or middle clicks.
Commit 8f5fd28 (origin/main). Desktop dev app (T3CODE_DEV_SEED=0 vp run dev:desktop) run under headless-desktop (Xvfb) on Linux, fresh database, with a stub xdg-open first on PATH that logs the URL it receives. Steps, driven with Playwright over CDP: onboarding Start; added a local folder project; Settings -> Browser -> Open links in = T3 Code; new thread with Claude Haiku 5.5, prompt 'Use your WebFetch tool to fetch https://example.com/ and tell me its title in one line.'; expanded 'Worked for 13s', then the web search entry 'https://example.com/'. The expanded entry renders <a href="https://example.com/" target="_blank" rel="noreferrer" class="... font-medium ..."> with no click handler. Clicking it: the stub logged xdg-open https://example.com/ (Electron's setWindowOpenHandler -> shell.openExternal) and no Browser panel opened. Control: clicking the same URL in the assistant's markdown reply opened a Browser tab in the right panel of the same thread, and xdg-open was not called. Test: added one browser test to apps/web/src/components/chat/MessagesTimeline.browser.test.tsx (preview access granted, browserLinkTarget 'app', web_search item with one result). It fails on main (the click is not default-prevented) and passes once the anchor's click is intercepted; the other 76 tests in the file pass.
Evidence
Linux Electron desktop under Xvfb, 1440×900, light theme, separate fresh databases and Chromium profiles. Replay supplied the same synthetic web_search result on both commits.
Steps: select Settings → Browser → Open links in → T3 Code; open the seeded thread; expand Worked for → Web search; click https://example.com/.
Live Claude Haiku 5.5 WebFetch was not rerun; Replay generated the web_search item through the real adapter and orchestration to verify the provider-independent UI routing.
Modifier clicks, middle-click, system-browser preference, permission fallback, and other operating systems or clients were not exercised.
Tests
vp test run src/components/chat/MessagesTimeline.browser.test.tsx (apps/web): 77 passed
the same file with -t "web search result" before the fix: 1 failed (expected true to be false), which confirms the reproduction
vp run check:changed: format, lint, knip, typecheck, test and React compiler all pass
Failing repro: with Open links in set to T3 Code, clicking a result link in
an expanded web search entry is left to the native target=_blank popup,
which Electron sends to the system browser.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Result links in an expanded web search entry were plain target=_blank
anchors, so on desktop Electron's popup handler sent them to the system
browser even with Open links in set to T3 Code. They now make the same
link-target decision as chat markdown links and open in the thread's
Browser when that applies.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No actionable comments were generated in the recent review.
Walkthrough
Web-search result links now follow the configured browser-link behavior. When the target is the app, the link opens through the in-app link handler instead of native navigation. A browser test checks this behavior.
Changes: Web-search link routing
Layer / File(s)
Summary
Route and test web-search result links apps/web/src/components/chat/V2ItemInspector.tsx, apps/web/src/components/chat/MessagesTimeline.browser.test.tsx
Web-search results use the configured link target and scoped thread reference. For the app target, the component prevents native navigation and opens the URL through useOpenLink. The browser test verifies that native navigation is prevented.
Web-search result links now follow the configured "Open links in" setting. The change is small and localized, and I found no merge-blocking risk.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "fix(web): web search result links follow Open links in" is a conventional commit title that describes the main change: web search result links now respect the Settings → Browser → Open link…
Linked Issues check
Issue #42862 requires that clicking a web search result title in an expanded entry opens a Browser tab in the same thread when Settings → Browser → Open links in is T3 Code. The reviewed head changes …
Out of Scope Changes check
Changes from merge base 8f5fd28 to head 7e7eec8 are limited to two files. V2ItemInspector.tsx adds WebSearchResultLink, its imports, and the ScopedThreadRef type import. These support the #42862…
Description check
The description covers the problem (web search result links bypass the Open links in = T3 Code setting on desktop), the change (result links now use the same link-target routing as chat markdown links…
Full details: Title check
Explanation
The title "fix(web): web search result links follow Open links in" is a conventional commit title that describes the main change: web search result links now respect the Settings → Browser → Open links in target. It matches the raw summary, which routes result links through the link-target logic in V2ItemInspector and adds a browser test for it. The title is truncated at the end, so the setting name is incomplete. It reads as "Open links in" without the value, but the subject and intent are still clear.
Full details: Linked Issues check
Explanation
Issue #42862 requires that clicking a web search result title in an expanded entry opens a Browser tab in the same thread when Settings → Browser → Open links in is T3 Code. The reviewed head changes the result anchor in apps/web/src/components/chat/V2ItemInspector.tsx. The former plain target="_blank" anchor is now the WebSearchResultLink component. Its onClick calls resolveLinkTarget with the stored browserLinkTarget preference and canOpenLinksInApp(threadRef). When the result is "app", it calls preventDefault and openLink(href, { event }). Otherwise, the anchor keeps its normal external behavior. This is the same routing used for chat markdown links. The browser test in MessagesTimeline.browser.test.tsx covers the "app" target path. The PR does not change TimelineWorkEntryRow.tsx, which the issue also cites. The web search results render through V2ItemInspector, which TimelineWorkEntryRow imports, so the changed anchor covers the reported path. I did not verify the cited TimelineWorkEntryRow line range in full because the output was truncated. The PR description's evidence section is a non-coding item and does not affect this assessment. The change does not cover the other plain target="_blank" anchors that the PR description states were not audited. No issue requires them.
Full details: Out of Scope Changes check
Explanation
Changes from merge base 8f5fd28 to head 7e7eec8 are limited to two files. V2ItemInspector.tsx adds WebSearchResultLink, its imports, and the ScopedThreadRef type import. These support the #42862 fix. MessagesTimeline.browser.test.tsx adds one browser test and its mocks and cleanup. The test verifies the fixed behavior, so it supports the objective. No unrelated file or behavior change appears in the reviewed diff.
Full details: Description check
Explanation
The description covers the problem (web search result links bypass the Open links in = T3 Code setting on desktop), the change (result links now use the same link-target routing as chat markdown links), scope (links the issue #42862 and explains the bug is a fix, not a feature), and verification (a reproduction on main, a before/after comparison with screenshots and recordings, and test commands with results). The template's sections are all present and substantively filled in. Minor gaps: the Verification section is long but well-supported, and the description does not state a conventional commit title, which the template comment recommends but does not require in the body.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
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
size:M30-99 changed lines (additions + deletions).vouch:trustedAuthor is trusted by repo permissions or the VOUCHED list.
1 participant
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.
With Settings → Browser → Open links in set to T3 Code, clicking a result link in an expanded web search entry still opened the system browser on desktop, because the link never checked that setting. Result links now use the same link-target routing as links in chat messages. They open in the thread's Browser tab when that is the chosen target, and still open externally otherwise, including on Cmd/Ctrl or middle clicks.
Fixes #42862
Reproduction on main
Commit 8f5fd28 (origin/main). Desktop dev app (
T3CODE_DEV_SEED=0 vp run dev:desktop) run under headless-desktop (Xvfb) on Linux, fresh database, with a stubxdg-openfirst on PATH that logs the URL it receives. Steps, driven with Playwright over CDP: onboarding Start; added a local folder project; Settings -> Browser -> Open links in = T3 Code; new thread with Claude Haiku 5.5, prompt 'Use your WebFetch tool to fetch https://example.com/ and tell me its title in one line.'; expanded 'Worked for 13s', then the web search entry 'https://example.com/'. The expanded entry renders<a href="https://example.com/" target="_blank" rel="noreferrer" class="... font-medium ...">with no click handler. Clicking it: the stub loggedxdg-open https://example.com/(Electron's setWindowOpenHandler -> shell.openExternal) and no Browser panel opened. Control: clicking the same URL in the assistant's markdown reply opened a Browser tab in the right panel of the same thread, and xdg-open was not called. Test: added one browser test to apps/web/src/components/chat/MessagesTimeline.browser.test.tsx (preview access granted, browserLinkTarget 'app', web_search item with one result). It fails on main (the click is not default-prevented) and passes once the anchor's click is intercepted; the other 76 tests in the file pass.Evidence
Linux Electron desktop under Xvfb, 1440×900, light theme, separate fresh databases and Chromium profiles. Replay supplied the same synthetic web_search result on both commits.
Steps: select Settings → Browser → Open links in → T3 Code; open the seeded thread; expand Worked for → Web search; click https://example.com/.
xdg-open https://example.com/; Browser remains closed.The markdown-link control opened in-app on both commits without an external call.
Reproduction driver and seed scripts · Per-click observations
Not shown:
Tests
vp test run src/components/chat/MessagesTimeline.browser.test.tsx(apps/web): 77 passed-t "web search result"before the fix: 1 failed (expected true to be false), which confirms the reproductionvp run check:changed: format, lint, knip, typecheck, test and React compiler all passNot in this change
Who did the work
Run by the t3code factory in T3 Code.