Repository navigation
feat(web): pull request links follow the "Open links in" setting - #16585
SnaetWarre wants to merge 3 commits into
Conversation
Recognized pull request links always opened in the pull request panel, whatever "Open links in" said. They now take that setting as their plain-click destination, and Cmd/Ctrl-click opens the other one. The setting defaults to T3 Code, so pull request links keep opening in the panel unless the user picks their default browser. The setting is no longer desktop-only, because the panel exists on every client. Part of pingdotgg#11403.
…etting - pingdotgg#123 reference links decide panel or browser before the pull request lookup. Browser-bound clicks keep the anchor's own navigation, so a slow lookup can no longer outlive the click's permission to open a tab. - "Open links in" sits above the desktop-only browser group, so web no longer shows it dimmed under "Only available in the desktop app". - The description says Cmd/Ctrl swaps destinations for pull request links in the chat only; terminal links have no pull request recognition. - Schema comments describe the "app" default and that mobile ignores it.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (8)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe browser link target now defaults to the in-app option. Pull-request link handling uses the preference and click modifiers to select a destination. The setting is rendered outside the desktop-only group, and preview callbacks forward click modifiers. ChangesBrowser link routing
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
actor User
participant PullRequestLinkPreview
participant ChatMarkdown
participant openChangeRequestLink
participant openDeferredMarkdownLink
User->>PullRequestLinkPreview: Click link with modifier state
PullRequestLinkPreview->>ChatMarkdown: Pass URL and modifiers to pull-request callback
ChatMarkdown->>openChangeRequestLink: Forward URL and modifiers
opt Pull-request callback does not handle the link
PullRequestLinkPreview->>ChatMarkdown: Pass URL and modifiers to fallback callback
ChatMarkdown->>openDeferredMarkdownLink: Forward URL and modifiers as event
end
Suggested reviewers: Merge Risk: ⚪ Minimal · up to The reviewed link-routing behavior has no established merge-blocking issue. Merge after normal checks. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to Pull-request routing retains repository and capability checks, and no introduced security bypass was established. The broader default change can also send ordinary links to a connected environment’s browser; its network and profile exposure remains only partially assessed. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Problem
Clicking a recognized pull request link always opens it in T3 Code's pull request panel, even when Settings → Integrations → Open links in is set to Your default browser. People who review in GitHub have to Cmd/Ctrl-click every pull request link. On web the setting can't be changed at all, because it sits in the desktop-only browser settings group.
Change
Pull request links now follow Open links in. Cmd/Ctrl-click opens the other destination, so both stay one gesture away:
shouldOpenPullRequestExternallytakes the preference.useOpenChangeRequestLinkanduseOpenPrLinksubscribe to it, so every pull request entry point follows it: chat links,#123references in pull request descriptions, the sidebar badge, View PR, the branch toolbar, and the thread's pull request list.#123references decide panel or browser before looking up the pull request. Browser-bound clicks keep the link's own navigation, so a slow lookup can't outlive the click's permission to open a tab. Panel-bound clicks carry Cmd/Ctrl through the lookup. Before, a modified click always followed the raw/issues/123link.openExternalinstead of the anchor's default. Rows in the thread pull request list have notarget, so the anchor's default would have replaced the T3 tab on web.Scope and approval
Part of #11403: the pull request half. File links (editor vs. file viewer) are left out, because they need a new setting plus decisions for the file browser and remote environments.
This does not have explicit maintainer approval. In the triage comment, Julius asked whether the pull request part warrants revisiting #8335 and said to keep today's destinations as the defaults. #8335 was declined for adding a separate pull request preference. This PR reuses the existing Open links in setting instead, as suggested on the issue. It keeps the pull request panel as the default. The one default that does change is ordinary links where an in-app browser exists (above), which needs a maintainer call. Happy to rework it, or close it, if you want a different direction.
Verification
Automated, run locally:
vp test runon the pull request link, browser link target, settings, ChatMarkdown, chat, pull request, preview, and desktop settings suites: 2325 tests passed. New cases cover all four preference × modifier combinations.apps/webandpackages/contractstypecheck pass. Lint on the changed files is clean apart from existing warnings inChatMarkdown.tsx.Manual, in the web client against a dev server with real project data and a thread linking #16523 and #7765. To tell "handled in-app" from "handed to the browser", I watched whether the click reached the window listener, whether
window.openwas called, and what the panel showed:#9939reference calledwindow.openwith the link.#9939reference in fix(desktop): build AppImage with the static runtime toolset (fixes libfuse2 launch failure) #7765's description opened refactor: remove duplicate runtime logic and test scaffolding #9939 in the panel. Plain click on a row in the thread pull request list, and on the sidebar badge, calledwindow.openwith the link, and T3 stayed on the thread. Ctrl-click on the row opened the panel.Not checked: the desktop app. The paths are shared, but nobody has clicked through Electron's external-open path or the new in-app default for ordinary links.
Screenshots of the setting before (disabled on web, old description), the
#9939reference opening in the panel, and the thread pull request list follow in a comment.ghcan't attach images to a PR without write access to this repository. An updated "after" screenshot of the moved setting is still to come.Model: Claude Opus 5.5. Harness: Claude Code in T3 Code.