fix(desktop): a plain click on a bare pull request link honors the URL links setting
What & why
Closes #9438
A bare GitHub pull request URL (https://github.com/o/r/pull/123) clicked in a workspace terminal always opened the in-app PR pane on a plain click, before the user's Settings → Browser → URL links choice was consulted. Other URLs already followed that setting, so a user who set plain click to "Open in default browser" saw /pull/123/files and /pull/123#pullrequestreview-… links open in the system browser while a bare /pull/123 link still landed in the pane. That is the "no setting changes it" in the issue.
This fix applies to a plain click only. In terminalUrlLinkAction (previously terminalPullRequestLinkAction), a plain click the user bound in URL links, whether default browser, new tab or pane, now wins for a bare PR URL exactly as it does for every other URL. An unbound plain click (the default, which otherwise shows the link menu) still opens the PR pane. The hover hint uses the same resolution, so it matches what the click does. This "bound tier, else the pane" resolution is the one the chat and page panes already use (useOpenChatPage.ts, useOpenChatLink.ts, PagePane.tsx).
Shift-click on a bare PR URL stays a fixed "system browser" override, as before, so the link menu's shift hint may still say "new tab" for bare PR links. That is kept deliberately so no default changes; a maintainer may prefer shift to follow the map too, which is a one-line change here. Cmd/ctrl-clicks and non-bare URLs still go straight to the URL links map, and runUrlLinkAction still turns "pane" or "new tab" on a bare PR URL into the PR pane. Chat's pull request links (runChatPullRequestLink) ignore the map in the same way and are out of scope for #9438.
No new setting, column or string.
How I tested it
- Manual, in the released desktop app: with Settings → Browser → URL links plain click set to "Open in default browser", a
/pull/N/fileslink and a/pull/N#pullrequestreview-…link opened in the system browser, and a bare/pull/Nlink still opened the in-app PR pane. That is the behaviour this change fixes. No screenshot was taken, and this environment cannot launch the Electron app to capture an after state. bun run lint:fix, thenbun run lint: no diagnostics.bun run typecheckinapps/desktop: passes.bun testonrunTerminalLinkAction.test.tsinapps/desktop: 11 pass, 0 fail.- Those tests: an unbound plain click on a bare PR URL opens the PR pane, also under the default map; with plain click bound to the default browser it opens externally; shift-click on a bare PR URL is external under the default map, built with
tierForover the defaulturlLinksvalues; cmd-click and ctrl-click on a bare PR URL stay with the map; a/pull/N/filesURL follows the map in every case.
Checklist
- PR title follows conventional commits (
type(scope): subject) -
bun run lintandbun run typecheckpass (CI fails on lint warnings too) - "Allow edits from maintainers" is checked on fork PRs
- I have signed the CLA (the bot asks on your first PR)
🤖 Generated with Claude Code
Summary by CodeRabbit
- New Features
- Terminal URL clicks now follow configured link actions when available, opening links in the selected destination.
- Bare pull-request links open in a workspace pane by default when no other action is selected. Shift-click opens them in the system browser, regardless of configured actions.
- Configured link behavior is respected for modified clicks and other URLs when an action is available.