Repository navigation
Conversation
There was a problem hiding this comment.
ℹ️ No critical issues — one minor suggestion inline.
Reviewed changes
- Visible-browser link target selector — new
findVisibleBrowserLinkTargetpicks the focused group's browser, else the most recently focused one, from the worktree's effective layout. - Link routing —
openHttpLink(terminal, markdown, editor, checks; local and remote) and the browser popup bridge pass that group astargetGroupIdand focus it, so routed links join the on-screen browser pane; explicit new-tab actions are unchanged. - Docs and tests —
overview.mdxdocuments the new placement; new selector unit tests, routing placement tests, popup bridge tests, and a real-store integration test cover the behavior.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
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:
No actionable comments were generated in the recent review. ℹ️ Recent review info
Walkthrough
Priority: Merge Risk:
|
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Description check | The description explains the user impact, implementation, rationale, testing, remote behavior, and scope. However, it omits the required linked issue and required visual proof or an explicit N/A expla… | Add the linked issue under “Linked Issue.” Add before/after screenshots or video under “Visual Proof,” or write “N/A” with a brief reason if visual proof is not applicable. Complete any remaining checklist items or explain why CI will cover… | |
| Docstring Coverage | Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 7 files. | Write docstrings for the functions missing them to satisfy the coverage threshold. |
✅ Passed checks (3 passed)
-
Check name Status Explanation Title check ✅ Passed The title clearly and concisely describes the primary change: routed links open in an existing visible browser pane. 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.
Full details: Description check
-
Explanation
The description explains the user impact, implementation, rationale, testing, remote behavior, and scope. However, it omits the required linked issue and required visual proof or an explicit N/A explanation for this behavior change.
Resolution
Add the linked issue under “Linked Issue.” Add before/after screenshots or video under “Visual Proof,” or write “N/A” with a brief reason if visual proof is not applicable. Complete any remaining checklist items or explain why CI will cover them.
- 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.
Comment @coderabbitai help to get the list of available commands.
91b83df to
a8f6ff5
Compare
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Dropped the inert
placementFixedfield —findVisibleBrowserLinkTargetnow returnsBrowserLinkPlacement = { targetGroupId: string }; both call-site forwards, the routing test stub'soptstype, and the three test assertions that referenced it are gone. This fully resolves the prior minor comment; no references to the field remain in the diff.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
322a728 to
c4793c3
Compare
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Rebased onto a newer
mainand reconciled its popup-anchor logic —browser-state-ipc-bridge.tsagain resolves the opener's unified tab and forwardsafterTabId/executionHostId, alongside the PR'stargetGroupIdplacement. - The two mechanisms compose correctly:
resolveUnifiedTabCreatePlacementkeeps the visible-browser group but drops the anchor when the anchor's group differs, so a popup routed to the on-screen browser is not anchored to a source tab in another pane. The new test setup pins this (thesplitWithVisibleBrowserassertion expects noafterTabId).
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
c4793c3 to
f6f472a
Compare
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Dropped the inert
placementFixedfield —findVisibleBrowserLinkTargetandBrowserLinkPlacementnow carry onlytargetGroupId; the selector's return sites, the routing test stub'soptstype, and the four assertions that pinned the flag are gone. No reference toplacementFixedremains anywhere in the tree, and the store consumestargetGroupId(browser-tab-actions.ts:163). This resolves the prior minor comment. - Rebased onto the current
main— the branch was force-pushed to a fresh two-commit history on a newer base; the popup bridge still reconcilesmain'safterTabId/executionHostIdanchor alongside the PR'stargetGroupIdplacement.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
| const placement = state ? findVisibleBrowserLinkTarget(state, worktreeId) : undefined | ||
| if (placement) { | ||
| // Why before: remote creation is async; focusing later could steal focus after the user moved on. | ||
| state?.focusGroup?.(worktreeId, placement.targetGroupId) | ||
| } |
There was a problem hiding this comment.
Failed opens still move focus For a remote link, this changes the focused pane before the asynchronous opener accepts the request. If the opener rejects, such as when the workspace route is unavailable, no tab opens but the user is left looking at the old browser page instead of the pane containing the link.
378c554 to
9abdf9e
Compare
c14f683 to
c1e3087
Compare
54f7e9e to
fb5c41a
Compare
bcc4189 to
7a98ec0
Compare
5699a25 to
e76d248
Compare
Links opened in Orca (terminal, markdown, editor, checks panel, remote runtime/SSH, and target=_blank popups) now land as a new active tab in a visible browser group of the same worktree, and focus moves there. With no browser on screen, placement is unchanged.
Link placement only needs the target group; createBrowserTab has no consumer for a pinned-placement flag.
e76d248 to
1d47e70
Compare
…acement state Lets partial test stores (unset map entries, mutable fixture arrays) type-check against the widened link placement types.
|
Was thinking about similar thing. Will review the PR soon |
|
@lucacri We’re incorporating your visible-browser pane selection and popup routing from this PR into our broader browser-link work in #32907, and I’ve credited you as a co-author on the integration commit. The combined behavior reuses an exact page when it is already open in the same workspace, host, and browser profile; otherwise it opens a new tab in the focused or most recently used visible browser pane, or creates a split beside the source when no browser is visible. The broader PR also covers remote workspaces and protects against stale requests and focus changes while opening. We’ll land the combined changes through #32907. Thanks for contributing this! |
Reuse matching pages within the same workspace, execution host and browser profile. Otherwise open in the focused or most recently used visible browser, or create a split beside the source when no browser is visible. Keep explicit group placement and background/focus ownership protections. Incorporate visible-browser selection and popup routing from #22686 into #32907, including selector regression coverage. Co-authored-by: Luca Critelli <[email protected]>
Reuse matching pages within the same workspace, execution host and browser profile. Otherwise open in the focused or most recently used visible browser, or create a split beside the source when no browser is visible. Keep explicit group placement and background/focus ownership protections. Incorporate visible-browser selection and popup routing from #22686 into #32907, including selector regression coverage. Co-authored-by: Luca Critelli <[email protected]>
Reuse matching pages within the same workspace, execution host and browser profile. Otherwise open in the focused or most recently used visible browser, or create a split beside the source when no browser is visible. Keep explicit group placement and background/focus ownership protections. Incorporate visible-browser selection and popup routing from #22686 into #32907, including selector regression coverage. Co-authored-by: Luca Critelli <[email protected]>
Reuse matching pages within the same workspace, execution host and browser profile. Otherwise open in the focused or most recently used visible browser, or create a split beside the source when no browser is visible. Keep explicit group placement and background/focus ownership protections. Incorporate visible-browser selection and popup routing from #22686 into #32907, including selector regression coverage. Co-authored-by: Luca Critelli <[email protected]>
* Open links beside their source and reuse matching browser pages - Preserve source-group placement across terminal, chat, file, and runtime links - Add explicit “Open in this group” actions with safe refusal handling - Match browser pages by host, session, resource, and exact page identity * Preserve file link ownership when opening beside source * Isolate browser link sessions by workspace profile * Wait for browser tabs to render before activating links * Respect explicit group requests when opening detected files * Preserve legacy link ownership when opening browser tabs * Clean up unactivated browser tabs after failed link opens * Reveal routed browser links without stealing focus * Preserve browser profile reuse and foreground ownership during link open * Prefer visible browser panes and reuse exact link destinations Reuse matching pages within the same workspace, execution host and browser profile. Otherwise open in the focused or most recently used visible browser, or create a split beside the source when no browser is visible. Keep explicit group placement and background/focus ownership protections. Incorporate visible-browser selection and popup routing from #22686 into #32907, including selector regression coverage. Co-authored-by: Luca Critelli <[email protected]> * Route browser links by workspace without reading global focus * Validate SSH browser ownership before opening links * fix branch file size limit * fix(ci): track extracted browser link ratchet entries * fix(test): follow source-aware browser link opening --------- Co-authored-by: Luca Critelli <[email protected]>

ELI5
If you already have a browser open in one pane and click a link somewhere else (a terminal, a markdown file, the checks panel), Orca opens that link in a new tab on top of the pane you clicked in. The browser that is already on screen is ignored, so the link covers your terminal. With this change the link opens as a new tab in the browser that is already showing.
What Changed
Rules:
Tab.lastFocusedAt) wins.Mechanism: one pure selector,
findVisibleBrowserLinkTargetinsrc/renderer/src/lib/visible-browser-link-target.ts, walks the layout's groups and returns{ targetGroupId }for the one to use. It reusesgetEffectiveLayoutForWorktree,collectLayoutGroupIdsandgetGroupActiveTab. Two call sites pass that target into thetargetGroupIdoptioncreateBrowserTabalready accepts:openHttpLink(http-link-routing.ts): terminal links (local, runtime, SSH), markdown preview and editor links, and checks-panel links. The remote path forwardstargetGroupIdto the existing workspace browser opener. It already accepts that field, so there is no wire change.onOpenLinkInOrcaTab(browser-state-ipc-bridge.ts):target=_blankpopups from inside a browser page, which do not go throughopenHttpLink.The labeled-localhost path opens after an
await, so it now reads the layout fresh at that moment instead of reusing the state from the click.Why
The alternatives were:
A new tab in the pane that already shows a browser keeps both pages one click apart, and reuses the tab-creation path every other browser tab uses.
Editors already have a similar rule (
resolveEditorOpenTargetGroupId), which redirects a file only when it is opened from a terminal. Links redirect from any focused pane instead. A link clicked in a markdown preview should not cover the preview when a browser is right beside it.Explicit "new browser tab" actions are unchanged: the new-tab button,
orca browser tab create, port opening and file previews. They ask for a tab, not for a link to be routed.Linked Issue
No linked issue.
Visual Proof
None yet. I have not recorded a before/after; the behavior is covered by unit tests only (see Testing).
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
visible-browser-link-target.test.ts:http-link-routing.test.ts:browser-state-open-link-profile.test.ts: a popup opens in the visible browser group with its opener's profile. A background popup is placed there without moving focus.browser-link-placement.test.ts: against the real store, a link joins the pane that shows a browser.pnpm typecheck(web), the changed-code quality gate, and the rendererlib,hooks/ipc-events,terminal-paneandstore/slicestest suites pass. Tested on macOS only; nothing here is platform-specific.AI Disclosure
Written with Claude Code (Claude Opus 5.5), reviewed by me.
Review
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
targetGroupIdfield. No new RPC field, no protocol change.docs/site/content/docs/browser/overview.mdxdescribes the new placement.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)