Skip to content

feat(browser): add option to open in-app browser links in the background - #31536

Closed
PatrykMilewski wants to merge 3 commits into
stablyai:mainfrom
PatrykMilewski:feat/open-in-app-links-in-background
Closed

PatrykMilewski wants to merge 3 commits into
stablyai:mainfrom
PatrykMilewski:feat/open-in-app-links-in-background

Conversation

@PatrykMilewski

Copy link
Copy Markdown

ELI5

Clicking a link that opens in Orca's browser always switches you to the new tab. This adds a switch that opens the tab quietly in the background, so you can keep working in the terminal and look at the links later.

What Changed

  • Before: openHttpLink always created the in-app tab with activate: true, so every link routed to Orca's browser stole focus from the terminal.
  • After: with Settings → Browser → Open links in Orca in the background on, the tab is created with activate: false and the terminal keeps focus.
  • Remote and SSH sources: these links now pass focusOnCreate: false to the workspace browser opener. openWorkspaceBrowserTab already honours this flag in both the client-hosted and runtime-hosted branches.
  • Default: the setting openLinksInAppInBackground is off. With it off, requests are byte-identical to today's.
  • Settings UI:
    • New row, nested under the Link Routing rows.
    • New search entry, in its own file so browser-search.ts stays under the max-lines ratchet.
    • The row isn't hidden when Link Routing is off, because the Shift modifier and link actions can still route links to Orca.
  • Telemetry: the setting is added to SETTINGS_CHANGED_WHITELIST, like the neighbouring link-routing toggles.

Why

When you queue several links (PRs, CI runs, localhost pages) while an agent keeps running, being pulled into each tab breaks the flow. createBrowserTab already supports activate: false; the browser's "Open link in new tab" context-menu item uses it. So this only threads a setting through link routing.

A modifier key was considered instead. Cmd/Ctrl+click is already the open gesture and Shift is already the routing escape hatch, so an opt-in setting is the least surprising option.

Linked Issue

Fixes #31530

Visual Proof

TODO: before/after recording to be attached.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

New tests in http-link-routing.test.ts cover:

  • the plain link opens with activate:false;
  • the labeled-localhost link opens with activate:false;
  • runtime-remote links pass focusOnCreate:false;
  • the system-browser path is unaffected.

The existing activate:true assertions still cover the setting-off case. The search-catalog tests are updated for the new entry.

Checks run locally on macOS, all passing:

  • pnpm tc
  • pnpm lint (full chain, including ratchets and localization verifies)
  • pnpm run check:code-quality:changed
  • targeted pnpm test: http-link-routing, workspace-browser-tab-open, settings, i18n, locale scripts, src/shared

AI Disclosure

Implemented with Claude Code (Claude Opus 5.5) and reviewed by the author. The zh/ja/fr/ko/es strings are machine translations and need a native-speaker check.

Review

  • Cross-platform: renderer-only routing change, with no platform branches.
  • SSH/remote: covered by passing focusOnCreate to the existing opener.
  • Performance: one settings read per link click.
  • Security: no new IPC surface and no change to URL validation.
  • Mobile: no consumer of the neighbouring link settings exists, so no parity work was needed.
  • Edge case: a tab group with no active tab still activates the new tab via the existing fallback.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Other callers affected when the setting is on:

  • The link-actions popover "Open in Orca" and the checks-panel review link both go through openHttpLink, so they also open in the background.
  • Direct openWorkspaceBrowserTab actions (ports panel, jump palette) are unchanged.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

Generated with Claude Code Agent.

@PatrykMilewski
PatrykMilewski marked this pull request as ready for review October 21, 2026 14:24
@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d8af780c-b720-4325-828f-d956086f5d84
📥 Commits

Reviewing files that changed from the base of the PR and between 0f88eaf and 9d5063c.

📒 Files selected for processing: 6
  • src/renderer/src/components/settings/BrowserPane.tsx
  • src/renderer/src/components/settings/browser-search.test.ts
  • src/renderer/src/components/settings/browser-search.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/lib/http-link-routing.test.ts
  • src/renderer/src/lib/http-link-routing.ts
🚧 Files skipped from review as they are similar to previous changes: 1
  • src/renderer/src/i18n/locales/en.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

📝 Walkthrough

Adds a default-off setting that opens links routed to Orca’s in-app browser in background tabs. Local tabs use activate: false, and remote browser requests use focusOnCreate: false when the setting is enabled. System-browser routing is unchanged. The setting appears in Browser settings with localized labels and searchable metadata.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 9d506

Background links preserve the active worktree and do not activate the new tab. No merge-blocking issue remains after normal checks.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Description check Warning The description covers the change, rationale, linked issue, testing, risks, and checklist. However, the required visual proof for this UI and behavior change is still marked TODO. Attach before-and-after screenshots or a recording. If there is no visual or interaction change, replace the TODO with N/A and briefly explain why.
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 11 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the primary change: adding an option to open in-app browser links in the background.
Linked Issues check Passed Issue [#31530] requires an opt-in Browser setting with an off default, background opening for local and remote/SSH in-app links, and unchanged system-browser behavior. default-global-settings.ts set…
Out of Scope Changes check Passed The changed files support issue [#31530]. They implement the setting, Browser UI and search integration, localization, telemetry registration, routing behavior, and focused tests. The local worktree a…
Full details: Linked Issues check

Explanation

Issue [#31530] requires an opt-in Browser setting with an off default, background opening for local and remote/SSH in-app links, and unchanged system-browser behavior. default-global-settings.ts sets openLinksInAppInBackground to false. http-link-routing.ts uses activate: false for local links and passes focusOnCreate: false for remote links when enabled. The reported tests cover local, labeled-localhost, remote, system-browser, and setting-off paths. The Browser settings row, search entry, type, and telemetry whitelist entry are also included.

Full details: Out of Scope Changes check

Explanation

The changed files support issue [#31530]. They implement the setting, Browser UI and search integration, localization, telemetry registration, routing behavior, and focused tests. The local worktree and remote focus controls support background tab behavior. No unrelated product change is established by the reviewed summary.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 11 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: df747dd1-eb43-43de-8903-9bb28d6d07f5
📥 Commits

Reviewing files that changed from the base of the PR and between ad269f4 and 0f88eaf.

📒 Files selected for processing: 17
  • src/renderer/src/components/settings/BrowserLinkRoutingBackgroundSetting.tsx
  • src/renderer/src/components/settings/BrowserPane.search-catalog.test.tsx
  • src/renderer/src/components/settings/BrowserPane.tsx
  • src/renderer/src/components/settings/browser-link-routing-background-search.ts
  • src/renderer/src/components/settings/browser-search.test.ts
  • src/renderer/src/components/settings/browser-search.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.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-routing.test.ts
  • src/renderer/src/lib/http-link-routing.ts
  • src/shared/default-global-settings.ts
  • src/shared/global-settings-types.ts
  • src/shared/telemetry-property-schemas.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

…s-in-background

# Conflicts:
#	src/renderer/src/components/settings/BrowserPane.tsx
#	src/renderer/src/components/settings/browser-search.test.ts
#	src/renderer/src/components/settings/browser-search.ts
@nwparker

nwparker commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Closing as superseded — the linked issue (#31530) has been resolved on main by #31844 (291e2e807e). Thanks for the contribution!

@nwparker nwparker closed this Nov 5, 2026
@PatrykMilewski

Copy link
Copy Markdown
Author

@nwparker Thanks but #31844 doesn't implement what #31530 requested. The idea was to open it in the same group, instead of splitting the screen.

New behaviour is frustrating and can't be disabled, where other users have similar thoughts #34437

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.

[Feature]: Option to open in-app browser links in a background tab

2 participants