Repository navigation
feat(browser): let Shift invert link routing instead of always forcing the system browser - #10991
Conversation
…g the system browser Shift+Cmd/Ctrl-click has always meant "open in the system browser", which is a no-op when that is already where links go. Users who keep Link Routing off have had no gesture to pull a single link into Orca's built-in browser. Adds "Hold Shift to open in ___", a nested toggle under Link Routing that makes the modifier open a link the opposite way from the setting. It ships off, so the one-way escape hatch is unchanged for every existing user. The title and description name the destination the modifier actually reaches and flip with the parent setting, since "the opposite" is meaningless on its own. - openHttpLink gains modifierHeld; resolveModifierRouting owns the decision so every surface (terminal URLs, OSC 8, xterm web links, markdown preview) routes identically. forceSystemBrowser stays for callers that must bypass settings. - The terminal hover hint names Orca when the modifier would open there, and is re-resolved per hover so toggling applies without recreating panes. - Link Routing's own copy drops "always uses your system browser", which the new toggle can falsify; the nested row states the live destination instead.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds a configurable 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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 |
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: c6277c45-d4fe-4fd4-a06a-3cda3e016f1d
📒 Files selected for processing (28)
src/renderer/src/components/editor/markdown-preview-links.test.tssrc/renderer/src/components/editor/markdown-preview-links.tssrc/renderer/src/components/settings/BrowserLinkRoutingModifierSetting.tsxsrc/renderer/src/components/settings/BrowserPane.tsxsrc/renderer/src/components/settings/browser-link-routing-modifier-copy.tssrc/renderer/src/components/settings/browser-search.test.tssrc/renderer/src/components/settings/browser-search.tssrc/renderer/src/components/terminal-pane/edge-wrapped-terminal-http-links.test.tssrc/renderer/src/components/terminal-pane/repro-8832-url-next-line.test.tssrc/renderer/src/components/terminal-pane/terminal-link-open-hints.test.tssrc/renderer/src/components/terminal-pane/terminal-link-open-hints.tssrc/renderer/src/components/terminal-pane/terminal-osc-link-routing.tssrc/renderer/src/components/terminal-pane/terminal-url-link-hit-testing.tssrc/renderer/src/components/terminal-pane/terminal-web-link-click.tssrc/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/renderer/src/lib/http-link-modifier-routing.test.tssrc/renderer/src/lib/http-link-routing.test.tssrc/renderer/src/lib/http-link-routing.tssrc/renderer/src/lib/pane-manager/pane-dom-creation.tssrc/renderer/src/lib/pane-manager/pane-manager-types.tssrc/shared/constants.tssrc/shared/telemetry-events.tssrc/shared/types.ts
| type UrlLinkHitTestDeps = { | ||
| worktreeId: string | ||
| forceSystemBrowser?: boolean | ||
| modifierHeld?: boolean | ||
| requestOpenLinksInAppPreference?: TerminalLinkRoutingPreferenceRequester |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift
Preserve terminal link source ownership before applying modifier inversion.
With inversion enabled and external routing selected, Shift-click can route a remote terminal URL into Orca because these paths pass no sourceOwner; openHttpLink then falls back to the global active-runtime setting rather than the clicked pane’s origin. Carry an accurate runtime/SSH sourceOwner through the terminal link dependencies and add a regression test for a remote pane while no global runtime is active.
src/renderer/src/components/terminal-pane/terminal-url-link-hit-testing.ts#L12-L15: add source ownership toUrlLinkHitTestDeps.src/renderer/src/components/terminal-pane/terminal-url-link-hit-testing.ts#L305-L309: forward that ownership toopenHttpLink.src/renderer/src/components/terminal-pane/terminal-web-link-click.ts#L30-L33: populate the dependency from the active terminal pane.src/renderer/src/components/terminal-pane/terminal-osc-link-routing.ts#L82-L85: populate the dependency from the OSC link origin.
Based on the supplied terminal call-path snippets, per-pane runtime context exists but is not forwarded as sourceOwner.
📍 Affects 3 files
src/renderer/src/components/terminal-pane/terminal-url-link-hit-testing.ts#L12-L15(this comment)src/renderer/src/components/terminal-pane/terminal-url-link-hit-testing.ts#L305-L309src/renderer/src/components/terminal-pane/terminal-web-link-click.ts#L30-L33src/renderer/src/components/terminal-pane/terminal-osc-link-routing.ts#L82-L85
…hared modifier The "Open on GitHub" button had its own Shift+Cmd/Ctrl escape hatch that passed forceSystemBrowser directly, so it kept the old one-way behavior while every other surface honored the invert setting. Route it through modifierHeld like the terminal and markdown paths. Also wraps the modifier row's description in translate(); the title in the same file was localized but the description returned raw English (caught in review).
Live QA: the "Open on GitHub" button — found and fixed a missVerifying this surface turned up a real gap, now fixed in 27b4e5a.
Verified by clicking the actual buttonDrove the real button in the running dev build (Checks panel loaded against this very PR), observing
Also fixed in the same commit: One deliberate exclusion
|
|
Tip For best results, initiate chat on the files or code changes. The Comment images show:
The deliberate exclusion in 🐇 ✅ ✏️ Learnings added
If you found this review helpful, would you consider giving us a shout-out on X? Thank you for using CodeRabbit! |
Review follow-ups on the Shift-inverts-routing change. - The nested row promised "⇧⌘+click opens one in Orca" in the present tense while its own toggle was off, so the out-of-box state described behavior the user did not have. Phrase it as enabled-state copy, matching sibling rows. - The parent Link Routing description gained "opens a link the other way", which is false in the default state and contradicts the child row when inverting is on. No fixed sentence there is true in every state, so the child row — which knows the live destination — now owns the claim. That leaves getBrowserLinkRoutingShortcutLabel unused, so drop it. - The rich markdown editor still forced the system browser while the preview of the same file honored the modifier, so one link routed two ways depending on which view it was clicked in. - A remote runtime pins every link to the system browser, so the hover hint could promise Orca for a click that lands elsewhere. Gate the hint on the same condition openHttpLink uses. - Index both modifier titles: the search entry is built with openLinksInApp false, so the row was unfindable by the title it renders when routing is on. - Drop the ariaLabel that shared no words with the visible label (WCAG 2.5.3) and add the four missing settings-search keyword keys to all five catalogs.
There was a problem hiding this comment.
🧹 Nitpick comments (2)
src/renderer/src/components/settings/browser-search.ts (2)
19-25: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueApprove; multi-line comment slightly exceeds the "preferably one line" guideline.
Content is a legitimate non-obvious rationale, but as per coding guidelines,
**/*.{ts,tsx,js,jsx}: "Comments must be concise, limited to non-obvious information, and preferably one line." Consider trimming to 1-2 lines.Source: Coding guidelines
117-148: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low valueNew modifier search entry only indexes the alternate title, not the alternate description.
Keywords index
getLinkRoutingModifierTitle(true)for the other state's title but notgetLinkRoutingModifierDescription({ openLinksInApp: true, ... }). Minor search-completeness gap; likely not worth extra indexing given the title already covers discoverability.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 4261564d-bbc5-45fa-918d-52fcc39cd41f
📒 Files selected for processing (15)
src/renderer/src/components/editor/rich-markdown-editor-click-routing.tssrc/renderer/src/components/settings/BrowserLinkRoutingModifierSetting.tsxsrc/renderer/src/components/settings/BrowserPane.tsxsrc/renderer/src/components/settings/browser-link-routing-modifier-copy.tssrc/renderer/src/components/settings/browser-search.test.tssrc/renderer/src/components/settings/browser-search.tssrc/renderer/src/components/terminal-pane/terminal-link-open-hints.test.tssrc/renderer/src/components/terminal-pane/terminal-link-open-hints.tssrc/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/renderer/src/lib/pane-manager/pane-dom-creation.test.ts
💤 Files with no reviewable changes (1)
- src/renderer/src/components/settings/BrowserLinkRoutingModifierSetting.tsx
🚧 Files skipped from review as they are similar to previous changes (7)
- src/renderer/src/i18n/locales/es.json
- src/renderer/src/components/settings/browser-link-routing-modifier-copy.ts
- src/renderer/src/components/settings/BrowserPane.tsx
- src/renderer/src/i18n/locales/zh.json
- src/renderer/src/i18n/locales/ja.json
- src/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.ts
- src/renderer/src/components/settings/browser-search.test.ts
The editor half of the modifier fix had no coverage — reverting it to forceSystemBrowser left the suite green while the same link routed one way in the markdown preview and the other way in the rich editor. Also pins that a non-local source owner survives the hop, since that is what keeps an SSH file's links out of Orca's browser.
This file is the only test of handleRichMarkdownEditorClick, and it exercised metaKey alone, so the isMac branch of modKey had no coverage off macOS. Also stop claiming the source-owner case proves SSH links stay out of Orca — it proves the owner survives the hop; http-link-routing.test.ts enforces the rest.
Both explained the change adequately in two lines; the extra lines were worked examples, not information.
…bled Removing the "⇧⌘-click always uses your system browser" sentence outright reworded the row for every user on upgrade, including everyone who never turns the opt-in on. Restore it verbatim in the default state and only hand the chord sentence to the nested row once inverting makes "always" untrue.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/renderer/src/components/editor/rich-markdown-editor-click-routing.test.ts (1)
17-18: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winShorten or remove these test comments. The test names already convey the behavior; keep only a single-line non-obvious rationale where needed.
src/renderer/src/components/editor/rich-markdown-editor-click-routing.test.ts#L17-L18: remove or reduce to one concise line.src/renderer/src/components/editor/rich-markdown-editor-click-routing.test.ts#L64-L65: reduce the platform rationale to one line.src/renderer/src/components/editor/rich-markdown-editor-click-routing.test.ts#L75-L76: reduce the routing-contract rationale to one line.Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: aca4ea48-5d42-41ab-806a-49bbf2e09a9a
📒 Files selected for processing (4)
src/renderer/src/components/editor/rich-markdown-editor-click-routing.test.tssrc/renderer/src/components/settings/BrowserPane.tsxsrc/renderer/src/components/settings/browser-search.test.tssrc/renderer/src/components/settings/browser-search.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- src/renderer/src/components/settings/browser-search.test.ts
Per Brennan: the editor's Shift path hands the link to the client OS and should not follow the invert setting — the preview opening in Orca is the intended divergence, not a bug. Restores main's call exactly; the test now pins the divergence so a future consistency pass cannot erase it silently.
The hosted-review click path now passes modifierHeld, so with inverting on and Link Routing off the chord opens in Orca — but the hint stayed gated on openLinksInApp, hiding a live gesture. Resolve the destination instead of a boolean. Default-off output is unchanged.
… fails to build The optional option fell back to a duplicated copy of the legacy hint string, so deleting the hook wiring reverted the tooltip silently with every test green.
…n-modifier-override
Greptile SummaryThis PR transforms the
Confidence Score: 5/5Safe to merge — the feature ships off by default, making the change transparent to all existing users, and each new code path has been validated against the routing truth table. The new Files Needing Attention: No files require special attention.
|
| Filename | Overview |
|---|---|
| src/renderer/src/lib/http-link-routing.ts | Core routing logic — adds resolveModifierRouting and threads modifierHeld/modifier.wantsOrca/modifier.wantsSystemBrowser cleanly into routeToOrca; logic is correct for all four (openLinksInApp × modifierInverts) combinations. |
| src/renderer/src/components/settings/BrowserPane.tsx | Inserts BrowserLinkRoutingModifierSetting at index 4 and correctly shifts showLocalhostLabels→[5] and showCookies→[6]; aligned with the updated getBrowserPaneSearchEntries() return order. |
| src/renderer/src/components/settings/BrowserLinkRoutingModifierSetting.tsx | New UI component: correctly uses SearchableSetting as a pure search-index wrapper (renders only children), with the SettingsSwitchRow providing the actual toggle UI; toggle logic is correct. |
| src/renderer/src/components/settings/browser-search.ts | Adds the modifier entry at index 4 and correctly indexes both title variants so the row is findable via search in either routing state. |
| src/renderer/src/components/terminal-pane/terminal-link-open-hints.ts | Adds getTerminalUrlOrcaBrowserHint/getTerminalUrlSystemBrowserHint and a terminalUrlOpenHintOptionsFor helper; correctly gates modifierInverts on the absence of a remote runtime so the Orca hint is never shown for non-local sources. |
| src/renderer/src/lib/pane-manager/pane-manager-types.ts | Makes linkOpenHint required (non-optional) on PaneManagerOptions, ensuring a compile error if any caller omits it; comment explains the intent. |
| src/renderer/src/components/right-sidebar/checks-panel-hosted-review-click-routing.ts | Migrates Checks panel hosted-review link modifier from forceSystemBrowser to modifierHeld; resolveChecksPanelHostedReviewModifierDestination correctly mirrors the routing inputs and properly trims activeRuntimeEnvironmentId. |
| src/renderer/src/components/editor/markdown-preview-links.ts | Migrates markdown-preview modifier from forceSystemBrowser: true to modifierHeld: true, worktreeId; now routes through resolveModifierRouting, enabling the invert feature in the preview while preserving legacy behavior by default. |
| src/shared/constants.ts | Adds openLinksInAppModifierInverts: false to the default settings, correctly defaulting the feature off for all existing users. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User clicks HTTP link] --> B{Shift+Cmd/Ctrl\nheld?}
B -- No --> C[openHttpLink\nmodifierHeld=false]
B -- Yes --> D[openHttpLink\nmodifierHeld=true]
C --> E[resolveModifierRouting returns\nwantsOrca=false wantsSystemBrowser=false]
D --> F{openLinksInAppModifierInverts\nsetting enabled?}
F -- No - default for all users --> G[Legacy: wantsSystemBrowser=true]
F -- Yes --> H{openLinksInApp?}
H -- true --> I[wantsSystemBrowser=true]
H -- false --> J[wantsOrca=true - NEW]
E --> K{routeToOrca check}
G --> K
I --> K
J --> K
K -- sourceIsLocal AND no forceSystemBrowser\nAND worktreeId present --> L[createBrowserTab\nOpens in Orca]
K -- otherwise --> M[shell.openUrl\nOpens in System Browser]
Reviews (2): Last reviewed commit: "fix(browser): trim the runtime id before..." | Re-trigger Greptile
…ifier hint openHttpLink and terminalUrlOpenHintOptionsFor both trim, so a blank runtime id hid the hint while the click still reached Orca.
…9444) The description was assembled from a bare template literal, so it stayed English under every language pack. It now lives in the catalog as two entries — description with a {{shortcut}} placeholder and descriptionBase for the invert-on variant — following the copy-module pattern from #10991. Co-authored-by: 조재중 <[email protected]>
…g the system browser (stablyai#10991) * feat(browser): let Shift invert link routing instead of always forcing the system browser Shift+Cmd/Ctrl-click has always meant "open in the system browser", which is a no-op when that is already where links go. Users who keep Link Routing off have had no gesture to pull a single link into Orca's built-in browser. Adds "Hold Shift to open in ___", a nested toggle under Link Routing that makes the modifier open a link the opposite way from the setting. It ships off, so the one-way escape hatch is unchanged for every existing user. The title and description name the destination the modifier actually reaches and flip with the parent setting, since "the opposite" is meaningless on its own. - openHttpLink gains modifierHeld; resolveModifierRouting owns the decision so every surface (terminal URLs, OSC 8, xterm web links, markdown preview) routes identically. forceSystemBrowser stays for callers that must bypass settings. - The terminal hover hint names Orca when the modifier would open there, and is re-resolved per hover so toggling applies without recreating panes. - Link Routing's own copy drops "always uses your system browser", which the new toggle can falsify; the nested row states the live destination instead. * fix(browser): route the Checks panel hosted-review link through the shared modifier The "Open on GitHub" button had its own Shift+Cmd/Ctrl escape hatch that passed forceSystemBrowser directly, so it kept the old one-way behavior while every other surface honored the invert setting. Route it through modifierHeld like the terminal and markdown paths. Also wraps the modifier row's description in translate(); the title in the same file was localized but the description returned raw English (caught in review). * fix(browser): make link-routing modifier copy true in every state Review follow-ups on the Shift-inverts-routing change. - The nested row promised "⇧⌘+click opens one in Orca" in the present tense while its own toggle was off, so the out-of-box state described behavior the user did not have. Phrase it as enabled-state copy, matching sibling rows. - The parent Link Routing description gained "opens a link the other way", which is false in the default state and contradicts the child row when inverting is on. No fixed sentence there is true in every state, so the child row — which knows the live destination — now owns the claim. That leaves getBrowserLinkRoutingShortcutLabel unused, so drop it. - The rich markdown editor still forced the system browser while the preview of the same file honored the modifier, so one link routed two ways depending on which view it was clicked in. - A remote runtime pins every link to the system browser, so the hover hint could promise Orca for a click that lands elsewhere. Gate the hint on the same condition openHttpLink uses. - Index both modifier titles: the search entry is built with openLinksInApp false, so the row was unfindable by the title it renders when routing is on. - Drop the ariaLabel that shared no words with the visible label (WCAG 2.5.3) and add the four missing settings-search keyword keys to all five catalogs. * test(editor): pin the rich markdown Shift+click routing hop The editor half of the modifier fix had no coverage — reverting it to forceSystemBrowser left the suite green while the same link routed one way in the markdown preview and the other way in the rich editor. Also pins that a non-local source owner survives the hop, since that is what keeps an SSH file's links out of Orca's browser. * test(editor): cover the Ctrl chord for rich markdown link routing This file is the only test of handleRichMarkdownEditorClick, and it exercised metaKey alone, so the isMac branch of modKey had no coverage off macOS. Also stop claiming the source-owner case proves SSH links stay out of Orca — it proves the owner survives the hop; http-link-routing.test.ts enforces the rest. * style: trim review comments to the one-line house rule Both explained the change adequately in two lines; the extra lines were worked examples, not information. * fix(browser): keep Link Routing copy unchanged until inverting is enabled Removing the "⇧⌘-click always uses your system browser" sentence outright reworded the row for every user on upgrade, including everyone who never turns the opt-in on. Restore it verbatim in the default state and only hand the chord sentence to the nested row once inverting makes "always" untrue. * revert(editor): keep rich markdown Shift+click on the system browser Per Brennan: the editor's Shift path hands the link to the client OS and should not follow the invert setting — the preview opening in Orca is the intended divergence, not a bug. Restores main's call exactly; the test now pins the divergence so a future consistency pass cannot erase it silently. * fix(browser): surface the inverted modifier on the hosted-review link The hosted-review click path now passes modifierHeld, so with inverting on and Link Routing off the chord opens in Orca — but the hint stayed gated on openLinksInApp, hiding a live gesture. Resolve the destination instead of a boolean. Default-off output is unchanged. * test(browser): pin the inert modifier hint when links already open in Orca * refactor(terminal): require the pane link hint so dropping the wiring fails to build The optional option fell back to a duplicated copy of the legacy hint string, so deleting the hook wiring reverted the tooltip silently with every test green. * fix(browser): trim the runtime id before hiding the hosted-review modifier hint openHttpLink and terminalUrlOpenHintOptionsFor both trim, so a blank runtime id hid the hint while the click still reached Orca.
…tablyai#9444) The description was assembled from a bare template literal, so it stayed English under every language pack. It now lives in the catalog as two entries — description with a {{shortcut}} placeholder and descriptionBase for the invert-on variant — following the copy-module pattern from stablyai#10991. Co-authored-by: 조재중 <[email protected]>

Problem
⇧⌘-click (Shift+Ctrloff macOS) has always meant "open in the system browser" — a one-way escape hatch, not a toggle:That works when Link Routing is on. When it's off — links already go to the system browser — the gesture is a no-op, and there's no way to pull a single link into Orca's built-in browser.
⌘-click⇧⌘-click (before)Change
A nested toggle under Link Routing: "Hold Shift to open in ___". When on, the modifier opens a link the opposite way from the setting, so the other destination is always one click away.
It ships off, so the existing one-way behavior is byte-for-byte unchanged for every current user.
The title and description name the destination the modifier actually reaches and flip with the parent setting — "the opposite" means nothing on its own:
Screenshots — real app, this branch
Default state (Link Routing off, new toggle off — identical to today):
Title and description flip live when Link Routing is turned on:
The row nests with
ml-4 border-l border-border pl-4, the same parent-toggle-with-dependent-child pattern asAgentDashboardExperimentalSetting.tsx:59andNativeChatExperimentalSetting.tsx:61.Implementation
openHttpLinkgainsmodifierHeld, andresolveModifierRoutingowns the decision in one place, so every surface routes identically — terminal URLs, OSC 8 hyperlinks, xterm web links, markdown preview, and the Checks panel's hosted-review link all just passmodifierHeld: event.shiftKey.forceSystemBrowseris retained for the callers that must bypass settings unconditionally (the resolved first-use prompt, and the rich markdown editor, whose Shift path stays one-way by design).Two copy fixes the toggle forces:
linkOpenHintPaneManager option) so toggling applies without recreating panes.⇧⌘-clickalways uses your system browser — which the new toggle can falsify. The nested row now owns that sentence and states the live destination.Testing
resolveModifierRoutingandopenHttpLink, including the negative control (inverting on + Link Routing on is identical to legacy) and that a remote/SSH source is never routed into Orca even when inverting.getBrowserPaneSearchEntries()order, sinceBrowserPanegates rows by array index and I inserted one.src/renderer/src/lib/+components/settings/(3831 passed),components/terminal-pane/+lib/pane-manager/(3085 passed). All three typecheck configs clean,oxlint0 errors,oxfmtclean.Live A/B in the running app
Exercised the real
http-link-routingmodule in the dev build over CDP, on this branch:shell.openUrlfiredshell.openUrl, no Orca tab — legacy preservedwindow.api.shellis frozen by contextBridge, so the system-browser cases invoked the genuine IPC rather than a stub.Not covered
The end-to-end gesture was driven through the real routing module, not by a synthetic
⇧⌘-click on a rendered terminal cell — the hit-testing path (installHttpLinkClickFallback) is exercised by its existing unit tests, but not by a live mouse event in this validation.