Skip to content

feat(browser): let Shift invert link routing instead of always forcing the system browser - #10991

Merged
brennanb2025 merged 14 commits into
mainfrom
brennanb2025/link-open-modifier-override
Jul 29, 2026
Merged

brennanb2025 merged 14 commits into
mainfrom
brennanb2025/link-open-modifier-override

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Problem

⇧⌘-click (Shift+Ctrl off macOS) has always meant "open in the system browser" — a one-way escape hatch, not a toggle:

const routeToOrca =
  sourceIsLocal &&
  !forceSystemBrowser &&        // ← Shift only ever subtracts
  Boolean(worktreeId) &&
  state?.settings?.openLinksInApp === true

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.

Link Routing Plain ⌘-click ⇧⌘-click (before)
On Orca browser System browser ✅
Off System browser System browser ❌ dead gesture

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:

Link Routing Row title
Off Hold Shift to open in Orca
On Hold Shift to open in your web browser

Screenshots — real app, this branch

Default state (Link Routing off, new toggle off — identical to today):

default

Title and description flip live when Link Routing is turned on:

flipped

The row nests with ml-4 border-l border-border pl-4, the same parent-toggle-with-dependent-child pattern as AgentDashboardExperimentalSetting.tsx:59 and NativeChatExperimentalSetting.tsx:61.

Implementation

openHttpLink gains modifierHeld, and resolveModifierRouting owns 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 pass modifierHeld: event.shiftKey. forceSystemBrowser is 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:

  • The terminal hover hint said "for system browser" unconditionally; it now names Orca when that's where the modifier would land, and is re-resolved per hover (via a new linkOpenHint PaneManager option) so toggling applies without recreating panes.
  • Link Routing's own description said ⇧⌘-click always uses your system browser — which the new toggle can falsify. The nested row now owns that sentence and states the live destination.

Testing

  • 13 new unit tests across resolveModifierRouting and openHttpLink, 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.
  • A guard test pinning the getBrowserPaneSearchEntries() order, since BrowserPane gates rows by array index and I inserted one.
  • Full suites green: src/renderer/src/lib/ + components/settings/ (3831 passed), components/terminal-pane/ + lib/pane-manager/ (3085 passed). All three typecheck configs clean, oxlint 0 errors, oxfmt clean.

Live A/B in the running app

Exercised the real http-link-routing module in the dev build over CDP, on this branch:

Link Routing Invert Modifier Result
Off On held Orca tab created — the new behavior
Off On plain real shell.openUrl fired
Off Off held real shell.openUrl, no Orca tab — legacy preserved

window.api.shell is 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.

…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.
@coderabbitai

coderabbitai Bot commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds a configurable openLinksInAppModifierInverts setting with defaults, telemetry support, settings UI, search metadata, and translations. HTTP link routing now interprets modifier-held clicks through a shared resolver across markdown previews, hosted review links, rich markdown links, and terminal links. Terminal link hints and pane tooltips resolve current routing settings at hover time. Tests cover routing combinations, settings copy, platform-specific hints, and terminal URL handling.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly states the main browser-link routing change and matches the PR scope.
Description check ✅ Passed The description is mostly complete: it covers the change, screenshots, testing, and platform-specific behavior, with only minor template sections omitted.

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between cd05f2f and 5ee5859.

📒 Files selected for processing (28)
  • src/renderer/src/components/editor/markdown-preview-links.test.ts
  • src/renderer/src/components/editor/markdown-preview-links.ts
  • src/renderer/src/components/settings/BrowserLinkRoutingModifierSetting.tsx
  • src/renderer/src/components/settings/BrowserPane.tsx
  • src/renderer/src/components/settings/browser-link-routing-modifier-copy.ts
  • src/renderer/src/components/settings/browser-search.test.ts
  • src/renderer/src/components/settings/browser-search.ts
  • src/renderer/src/components/terminal-pane/edge-wrapped-terminal-http-links.test.ts
  • src/renderer/src/components/terminal-pane/repro-8832-url-next-line.test.ts
  • src/renderer/src/components/terminal-pane/terminal-link-open-hints.test.ts
  • src/renderer/src/components/terminal-pane/terminal-link-open-hints.ts
  • src/renderer/src/components/terminal-pane/terminal-osc-link-routing.ts
  • src/renderer/src/components/terminal-pane/terminal-url-link-hit-testing.ts
  • src/renderer/src/components/terminal-pane/terminal-web-link-click.ts
  • src/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/lib/http-link-modifier-routing.test.ts
  • src/renderer/src/lib/http-link-routing.test.ts
  • src/renderer/src/lib/http-link-routing.ts
  • src/renderer/src/lib/pane-manager/pane-dom-creation.ts
  • src/renderer/src/lib/pane-manager/pane-manager-types.ts
  • src/shared/constants.ts
  • src/shared/telemetry-events.ts
  • src/shared/types.ts

Comment on lines 12 to 15
type UrlLinkHitTestDeps = {
worktreeId: string
forceSystemBrowser?: boolean
modifierHeld?: boolean
requestOpenLinksInAppPreference?: TerminalLinkRoutingPreferenceRequester

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 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 to UrlLinkHitTestDeps.
  • src/renderer/src/components/terminal-pane/terminal-url-link-hit-testing.ts#L305-L309: forward that ownership to openHttpLink.
  • 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-L309
  • src/renderer/src/components/terminal-pane/terminal-web-link-click.ts#L30-L33
  • src/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).
@brennanb2025

Copy link
Copy Markdown
Contributor Author

Live QA: the "Open on GitHub" button — found and fixed a miss

Verifying this surface turned up a real gap, now fixed in 27b4e5a.

checks-panel-hosted-review-click-routing.ts had its own ⇧⌘ escape hatch that passed forceSystemBrowser: true directly, so the Checks-panel PR link kept the old one-way behavior while every other surface honored the new setting. It's now routed through modifierHeld like the terminal and markdown paths.

Verified by clicking the actual button

Drove the real button in the running dev build (Checks panel loaded against this very PR), observing createBrowserTab:

Link Routing Invert Real ⇧⌘-click on Open on GitHub Result
Off On yes Orca tab created with .../pull/10991 ✓
Off Off yes no Orca tab — real shell.openUrl, legacy preserved ✓

checks panel

Also fixed in the same commit: getLinkRoutingModifierDescription returned raw English while the title in the same file was localized — thanks @coderabbitai, that was a genuine inconsistency. Both branches now go through translate() with {{chord}} interpolation, catalog synced.

One deliberate exclusion

rich-markdown-editor-click-routing.ts:125 also gates on event.shiftKey, but routes to openMarkdownLinkInClientOs — a broader "hand this to the OS" path that also opens local files with the default app. Inverting only its http branch would make one gesture mean two different things depending on the target type, so I left it alone. Happy to convert it if you'd rather have strict consistency.

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

The Comment images show:

  1. The Orca Checks panel for PR #10991, with all six visible checks passing and the CodeRabbit comment identifying the missing localization in browser-link-routing-modifier-copy.ts.
  2. Browser settings with Link Routing off, where the nested setting reads “Hold Shift to open in Orca”.
  3. Browser settings with Link Routing on, where the nested setting reads “Hold Shift to open in your web browser”.

@brennanb2025 Great catch and thorough live verification. The Checks-panel route now correctly participates in modifierHeld resolution, while the invert-disabled case retains the legacy system-browser behavior. The translation fix also addresses the inconsistency cleanly.

The deliberate exclusion in rich-markdown-editor-click-routing.ts is appropriate. Since openMarkdownLinkInClientOs intentionally covers both HTTP links and local files, selectively inverting only HTTP targets would give Shift-click target-dependent semantics within the same editor path. I would keep that route unchanged for this PR.

🐇 ✅


✏️ Learnings added
Learnt from: brennanb2025
URL: https://github.com/stablyai/orca/pull/10991

Timestamp: 2026-07-27T22:22:33.674Z
Learning: In `src/renderer/src/components/editor/rich-markdown-editor-click-routing.ts`, the Shift-key path calls `openMarkdownLinkInClientOs`, an intentionally broader OS-hand-off route for both HTTP links and local files. It should not be converted to HTTP link-routing inversion alone, because that would make the same gesture behave differently depending on the target type.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
src/renderer/src/components/settings/browser-search.ts (2)

19-25: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Approve; 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 value

New modifier search entry only indexes the alternate title, not the alternate description.

Keywords index getLinkRoutingModifierTitle(true) for the other state's title but not getLinkRoutingModifierDescription({ 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

📥 Commits

Reviewing files that changed from the base of the PR and between 27b4e5a and a6f2fee.

📒 Files selected for processing (15)
  • src/renderer/src/components/editor/rich-markdown-editor-click-routing.ts
  • src/renderer/src/components/settings/BrowserLinkRoutingModifierSetting.tsx
  • src/renderer/src/components/settings/BrowserPane.tsx
  • src/renderer/src/components/settings/browser-link-routing-modifier-copy.ts
  • src/renderer/src/components/settings/browser-search.test.ts
  • src/renderer/src/components/settings/browser-search.ts
  • src/renderer/src/components/terminal-pane/terminal-link-open-hints.test.ts
  • src/renderer/src/components/terminal-pane/terminal-link-open-hints.ts
  • src/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
  • src/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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/renderer/src/components/editor/rich-markdown-editor-click-routing.test.ts (1)

17-18: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Shorten 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

📥 Commits

Reviewing files that changed from the base of the PR and between a6f2fee and 6674df9.

📒 Files selected for processing (4)
  • src/renderer/src/components/editor/rich-markdown-editor-click-routing.test.ts
  • src/renderer/src/components/settings/BrowserPane.tsx
  • src/renderer/src/components/settings/browser-search.test.ts
  • src/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.
@greptile-apps

greptile-apps Bot commented Jul 28, 2026 •

Copy link
Copy Markdown

Greptile Summary

This PR transforms the ⇧⌘/Shift+Ctrl click modifier from a one-way "always open in system browser" escape hatch into a bidirectional toggle: when the new openLinksInAppModifierInverts setting is enabled, the modifier flips whichever way Link Routing points, making the opposite destination always one click away. The feature ships off by default, so every existing user's behavior is byte-identical.

  • Core routing: A new resolveModifierRouting function centralises the Shift-modifier decision in http-link-routing.ts — all link surfaces (terminal OSC 8, terminal URL hit-test, WebLinksAddon, markdown preview, and the Checks panel hosted-review link) now forward modifierHeld: event.shiftKey and let openHttpLink resolve the destination from the settings pair.
  • Settings UI: A new BrowserLinkRoutingModifierSetting component adds a visually-nested toggle whose title and description name the actual destination the modifier reaches (flipping live with the parent Link Routing setting). The getBrowserPaneSearchEntries() array gains index 4 for this entry, with BrowserPane.tsx updated to match.
  • Terminal hint copy: terminal-link-open-hints.ts gains getTerminalUrlOrcaBrowserHint/getTerminalUrlSystemBrowserHint and updates getTerminalUrlOpenHint to name the Orca destination when modifierInverts is on; the hint is re-resolved per hover via a new required linkOpenHint: () => string option on PaneManagerOptions.

Confidence Score: 5/5

Safe 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 resolveModifierRouting function correctly handles all four combinations of openLinksInApp × modifierInverts, and the legacy one-way escape hatch is byte-identical when modifierInverts=false (the default). Remote/SSH sources are correctly excluded from Orca routing even with the modifier held. All surfaces — terminal, OSC 8, markdown preview, and Checks panel — route through the same openHttpLink path with modifierHeld. The guard test pinning getBrowserPaneSearchEntries() order prevents silent index drift. No correctness issues found.

Files Needing Attention: No files require special attention.

Important Files Changed

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]
Loading

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.
@brennanb2025
brennanb2025 merged commit c74fb3c into main Jul 29, 2026
51 of 53 checks passed
nwparker pushed a commit that referenced this pull request Aug 4, 2026
…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]>
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…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.
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant