Skip to content

Open browser links beside their source - #32907

Merged
AmethystLiang merged 15 commits into
mainfrom
open-browser-beside-source
Oct 25, 2026
Merged

AmethystLiang merged 15 commits into
mainfrom
open-browser-beside-source

Conversation

@AmethystLiang

@AmethystLiang AmethystLiang commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 33 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​3949 $\color{#cf222e}{\Huge{\mathbf{−}}}$​68 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​3881
Prod 64 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2720 $\color{#cf222e}{\Huge{\mathbf{−}}}$​758 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1962

Problem

Links from terminals, native chat, and file previews could open in an unrelated pane or reuse a browser page belonging to a different host or login profile.

Behavior

  • Reuse an exact matching page within the same workspace, execution host, runtime, and browser profile.
  • Otherwise, open a new page in a visible browser pane, preferring the focused pane and then the most recently used one. Browser tabs hidden behind other tabs do not attract new pages.
  • If no browser is visible, open a split beside the source pane so its contents stay visible.
  • Honor explicit Open in this group actions when the requested route and pane can be verified; refuse requests that cannot preserve that scope.

Implementation

Capture the source tab when a link is clicked and share destination selection across HTTP links, terminal HTML files, native chat visuals, and file previews. Preserve profile ownership through browser creation and remote session synchronization, and prevent superseded requests or later focus changes from applying stale focus or editor reveals.

Covers local, SSH, runtime, folder, and floating workspace routes. Browser popups also prefer an existing visible browser pane while retaining the opener's profile. Updates the browser documentation to describe placement and reuse.

The CI file-length failure is fixed by moving the system-default file-opening predicate into the existing file-context module and retaining its public export, without changing behavior.

Validation

  • Full Oxlint run: passed, with five existing documentation warnings.
  • Renderer typecheck (pnpm tc:web): passed.
  • Four targeted terminal-link test files: 45 tests passed, covering file routing, source placement, host workspace files, and remote SSH/runtime opens.
  • Formatting and git diff --check: passed.
  • Added and updated broader automated coverage for destination matching, profile isolation, chat and preview links, remote routes, and stale requests.

Manual UI validation and before/after screenshots have not been performed. The full test suite and build were not run locally; CI results remain separate from these targeted checks.

AI Disclosure

AI assisted with implementation and the CI investigation and fix.

@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Review in 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

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6649f131-e76d-42a8-8b7b-0ef9246865b7
Commits

Reviewing files that changed from the base of the PR and between 0b575d0 and bcf5f29.

Files selected for processing: 49
  • config/focus-setting-read-baseline.txt
  • docs/site/content/docs/browser/overview.mdx
  • src/main/browser/agent-browser-bridge-tab-routing.test.ts
  • src/main/browser/agent-browser-bridge-tabs.ts
  • src/main/browser/agent-browser-bridge-test-harness.ts
  • src/main/runtime/orca-runtime-serve-browser-restore.test.ts
  • src/main/runtime/session-lifecycle/projection/build-headless-mobile-session-browser-tabs.ts
  • src/renderer/src/components/native-chat/NativeChatInlineVisual.link-placement.test.tsx
  • src/renderer/src/components/terminal-pane/terminal-file-link-browser-open.ts
  • src/renderer/src/components/terminal-pane/terminal-file-open-routing.ts
  • src/renderer/src/components/terminal-pane/terminal-link-file-open-routing.test.ts
  • src/renderer/src/components/terminal-pane/terminal-link-host-workspace-file.test.ts
  • src/renderer/src/components/terminal-pane/terminal-link-open-beside-source.test.ts
  • src/renderer/src/components/terminal/split-group-mount.ts
  • src/renderer/src/hooks/ipc-events/browser-state-ipc-bridge.ts
  • src/renderer/src/hooks/ipc-events/browser-state-open-link-profile.test.ts
  • src/renderer/src/lib/browser-link-destination.test.ts
  • src/renderer/src/lib/browser-link-destination.ts
  • src/renderer/src/lib/browser-link-open-layout-owner.test.ts
  • src/renderer/src/lib/browser-link-open.test-fixture.ts
  • src/renderer/src/lib/browser-link-open.test.ts
  • src/renderer/src/lib/browser-link-open.ts
  • src/renderer/src/lib/browser-link-profile-isolation.test.ts
  • src/renderer/src/lib/browser-link-session.ts
  • src/renderer/src/lib/browser-page-tab-opening.ts
  • src/renderer/src/lib/client-creation-action-policy.test.ts
  • src/renderer/src/lib/client-creation-action-policy.ts
  • src/renderer/src/lib/file-preview-action-visibility.test.tsx
  • src/renderer/src/lib/file-preview-link-open.test.ts
  • src/renderer/src/lib/file-preview-link-open.ts
  • src/renderer/src/lib/file-preview.test.ts
  • src/renderer/src/lib/file-preview.ts
  • src/renderer/src/lib/http-link-browser-placement.ts
  • src/renderer/src/lib/http-link-in-group-availability.ts
  • src/renderer/src/lib/http-link-localhost-route.ts
  • src/renderer/src/lib/http-link-modifier-routing.test.ts
  • src/renderer/src/lib/http-link-routing-store.test.ts
  • src/renderer/src/lib/http-link-routing.test.ts
  • src/renderer/src/lib/http-link-routing.ts
  • src/renderer/src/lib/http-link-source-placement.test.ts
  • src/renderer/src/lib/link-open-intent.ts
  • src/renderer/src/lib/visible-browser-link-target.test.ts
  • src/renderer/src/lib/visible-browser-link-target.ts
  • src/renderer/src/lib/workspace-browser-link-open.ts
  • src/renderer/src/lib/workspace-browser-route-eligibility.ts
  • src/renderer/src/lib/workspace-browser-tab-open.ts
  • src/renderer/src/runtime/server-browser-profile-reuse.test.ts
  • src/renderer/src/runtime/sync-runtime-graph/sync-projections.ts
  • src/renderer/src/runtime/web-runtime-browser-link-open.test.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.

Walkthrough

The changes add source-aware routing for HTTP links, file previews, and browser links from native chat and terminal panes. Shared helpers capture link intent, select destination groups, match pages by host, workspace, URL, and browser session, and validate placement during opening. Runtime browser flows report materialized pages and carry profile identity through synchronization. The changes also add tests for placement, reuse, refusal, background opening, and request supersession.

Priority: Normal

Merge Risk: Moderate · up to bcf5f

The link-placement behavior looks sound, but the lint job fails because terminal-file-open-routing.ts exceeds the 300-line limit. Move part of that file, such as the HTML routing branch, into a helper module so the check passes before merging.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 26.49% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 151 functions across 85 files. (2 skipped… Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check Warning The description explains the problem, behavior, implementation, validation, and AI use. It does not provide the required linked issue, visual proof, or completed repository checklist items. Add an actual issue link under Fixes # (or the repository-approved issue reference). Add before-and-after screenshots or videos, or write N/A with a reason if there is no visual or interaction change. Complete the Testing, Review, Agent…
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title "Open browser links beside their source" matches the main change. The changeset routes terminal, chat, HTTP, HTML, and file-preview links to browser tabs placed beside the source tab, and ad…
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: Title check

Explanation

The title "Open browser links beside their source" matches the main change. The changeset routes terminal, chat, HTTP, HTML, and file-preview links to browser tabs placed beside the source tab, and adds the source-group placement logic. The title is concise and specific.

Full details: Docstring Coverage

Explanation

Docstring coverage is 26.49% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 151 functions across 85 files. (2 skipped: 2 unsupported.)

Resolution

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

Full details: Description check

Resolution

Add an actual issue link under Fixes # (or the repository-approved issue reference). Add before-and-after screenshots or videos, or write N/A with a reason if there is no visual or interaction change. Complete the Testing, Review, Agent skill upstream boundary, Notes, and Checklist sections, including the status of lint, typecheck, tests, and build.

Finishing Touches: 💡 2
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
  • 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: 2

🧹 Nitpick comments: 1
src/renderer/src/lib/file-preview-page-conversion.ts: 1

15-94: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use one implementation for convertBrowserPageToWorkspaceDoc.

The function exists in both file-preview-page-conversion.ts and file-preview.ts. Current callers still import it from @/lib/file-preview, so the implementations can diverge.

If file-preview-page-conversion.ts is the intended owner, update the callers to import it from that module and remove the duplicate implementation from file-preview.ts. Otherwise, remove the unused new module.


ℹ️ Review info
⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 48b86ecc-2f74-481e-a4a0-d8b59833d0b6
📥 Commits

Reviewing files that changed from the base of the PR and between e73ca2a and 8690393.

📒 Files selected for processing: 57
  • src/renderer/src/components/native-chat/NativeChatInlineVisual.link-placement.test.tsx
  • src/renderer/src/components/native-chat/NativeChatInlineVisual.tsx
  • src/renderer/src/components/native-chat/native-chat-link-target-actions.ts
  • src/renderer/src/components/native-chat/native-chat-visual-owner.tsx
  • src/renderer/src/components/native-chat/native-chat-web-link-actions.ts
  • src/renderer/src/components/native-chat/use-native-chat-link-actions.test.tsx
  • src/renderer/src/components/native-chat/use-native-chat-link-actions.ts
  • src/renderer/src/components/terminal-pane/terminal-file-link-actions.test.ts
  • src/renderer/src/components/terminal-pane/terminal-file-link-actions.ts
  • src/renderer/src/components/terminal-pane/terminal-file-link-browser-open.ts
  • src/renderer/src/components/terminal-pane/terminal-file-open-in-group-toast.ts
  • src/renderer/src/components/terminal-pane/terminal-file-open-routing.ts
  • src/renderer/src/components/terminal-pane/terminal-link-host-workspace-file.test.ts
  • src/renderer/src/components/terminal-pane/terminal-link-open-beside-source.test.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/lib/adjacent-link-open-group.ts
  • src/renderer/src/lib/browser-link-destination.test.ts
  • src/renderer/src/lib/browser-link-destination.ts
  • src/renderer/src/lib/browser-link-focus.ts
  • src/renderer/src/lib/browser-link-open-test-harness.ts
  • src/renderer/src/lib/browser-link-open.test.ts
  • src/renderer/src/lib/browser-link-open.ts
  • src/renderer/src/lib/browser-link-owner.ts
  • src/renderer/src/lib/browser-link-profile-isolation.test.ts
  • src/renderer/src/lib/browser-link-session.ts
  • src/renderer/src/lib/browser-workspace-tab-activation.ts
  • src/renderer/src/lib/file-preview-link-open.test.ts
  • src/renderer/src/lib/file-preview-link-open.ts
  • src/renderer/src/lib/file-preview-page-conversion.ts
  • src/renderer/src/lib/file-preview.ts
  • src/renderer/src/lib/http-link-destinations.ts
  • src/renderer/src/lib/http-link-in-group-availability.ts
  • src/renderer/src/lib/http-link-localhost-route.ts
  • src/renderer/src/lib/http-link-routing.ts
  • src/renderer/src/lib/http-link-source-placement.test.ts
  • src/renderer/src/lib/link-open-intent.ts
  • src/renderer/src/lib/link-open-request.ts
  • src/renderer/src/lib/workspace-browser-link-open.ts
  • src/renderer/src/lib/workspace-browser-route-eligibility.ts
  • src/renderer/src/lib/workspace-browser-tab-open.ts
  • src/renderer/src/runtime/web-runtime-browser-creation-context.ts
  • src/renderer/src/runtime/web-runtime-browser-creation.ts
  • src/renderer/src/runtime/web-runtime-browser-link-open.test.ts
  • src/renderer/src/runtime/web-runtime-browser-link-session.test.ts
  • src/renderer/src/runtime/web-runtime-browser-tab-staging.ts
  • src/renderer/src/runtime/web-session-tabs-sync/apply-browser-records.ts
  • src/renderer/src/runtime/web-session-tabs-sync/mirrored-browser-tabs.ts
  • src/renderer/src/runtime/web-session-tabs-sync/state.ts
  • src/renderer/src/store/index.ts
  • src/renderer/src/store/slices/browser/browser-slice-contract.ts
  • src/renderer/src/store/slices/browser/browser-tab-actions.ts
  • src/renderer/src/store/slices/editor/tabs/editor-open-adjacent-group.ts
  • src/renderer/src/store/slices/editor/tabs/editor-open-target-group.ts
  • src/renderer/src/store/slices/tabs/tabs-create-actions.ts
  • src/renderer/src/store/slices/tabs/tabs-slice-contract.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.

@AmethystLiang

Copy link
Copy Markdown
Contributor Author

@coderabbitai Fixing. Will be in the next commit

@coderabbitai

coderabbitai Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Tip

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

@AmethystLiang Thanks for the update. The finding remains unresolved pending the fix.

You are interacting with an AI system.

@AmethystLiang
AmethystLiang force-pushed the open-browser-beside-source branch from 8690393 to 71854ad Compare October 23, 2026 21:54

@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
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bfd7e7a9-1e3b-4866-9e53-f7aaaa06cfad
📥 Commits

Reviewing files that changed from the base of the PR and between 8690393 and 71854ad.

📒 Files selected for processing: 23
  • src/renderer/src/components/native-chat/native-chat-link-target-actions.ts
  • src/renderer/src/components/native-chat/native-chat-web-link-actions.ts
  • src/renderer/src/components/terminal-pane/terminal-file-link-actions.test.ts
  • src/renderer/src/components/terminal-pane/terminal-file-link-actions.ts
  • src/renderer/src/components/terminal-pane/terminal-file-link-browser-open.ts
  • src/renderer/src/components/terminal-pane/terminal-file-open-routing.ts
  • src/renderer/src/components/terminal-pane/terminal-link-file-open-routing.test.ts
  • src/renderer/src/components/terminal-pane/terminal-link-open-beside-source.test.ts
  • src/renderer/src/components/terminal-pane/terminal-link-remote-runtime-ssh-open.test.ts
  • src/renderer/src/components/terminal-pane/terminal-url-link-hit-testing.ts
  • src/renderer/src/lib/browser-link-open-layout-owner.test.ts
  • src/renderer/src/lib/browser-link-open.test.ts
  • src/renderer/src/lib/browser-link-open.ts
  • src/renderer/src/lib/browser-link-profile-isolation.test.ts
  • src/renderer/src/lib/file-preview-link-open.test.ts
  • src/renderer/src/lib/file-preview-link-open.ts
  • src/renderer/src/lib/file-preview-page-conversion.ts
  • src/renderer/src/lib/file-preview.ts
  • src/renderer/src/lib/http-link-destinations.ts
  • src/renderer/src/lib/workspace-browser-link-open.ts
  • src/renderer/src/lib/workspace-browser-route-eligibility.ts
  • src/renderer/src/lib/workspace-browser-tab-open.test.ts
  • src/renderer/src/lib/workspace-browser-tab-open.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.

@AmethystLiang

Copy link
Copy Markdown
Contributor Author

@coderabbitai Fixing. Will be in the next commit

@coderabbitai

coderabbitai Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Tip

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

@AmethystLiang Thanks for the update. The finding remains unresolved pending the fix.

You are interacting with an AI system.

@AmethystLiang
AmethystLiang force-pushed the open-browser-beside-source branch from 71854ad to 6e69c57 Compare October 23, 2026 22:58

@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
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4270844e-ef0b-4f31-bda9-669883e98844
📥 Commits

Reviewing files that changed from the base of the PR and between 71854ad and 6e69c57.

📒 Files selected for processing: 15
  • src/renderer/src/components/terminal-pane/terminal-file-link-editor-open.ts
  • src/renderer/src/components/terminal-pane/terminal-file-open-routing.ts
  • src/renderer/src/components/terminal-pane/terminal-file-open-turn.ts
  • src/renderer/src/lib/browser-link-destination.test.ts
  • src/renderer/src/lib/browser-link-open.ts
  • src/renderer/src/lib/browser-link-owner.ts
  • src/renderer/src/lib/http-link-routing.ts
  • src/renderer/src/lib/http-link-source-placement.test.ts
  • src/renderer/src/lib/workspace-browser-link-open.ts
  • src/renderer/src/lib/workspace-browser-tab-open.test.ts
  • src/renderer/src/lib/workspace-browser-tab-open.ts
  • src/renderer/src/store/index.ts
  • src/renderer/src/store/slices/browser/browser-tab-actions.ts
  • src/renderer/src/store/slices/browser/browser-tab-open-view.ts
  • src/renderer/src/store/slices/editor/tabs/editor-open-target-group.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.

Comment thread src/renderer/src/store/index.ts Resolved
@AmethystLiang
AmethystLiang force-pushed the open-browser-beside-source branch from 6e69c57 to 0b575d0 Compare October 24, 2026 18:34

@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
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8b699f15-15c9-4cee-9936-a8cc63cfd5a1
Commits

Reviewing files that changed from the base of the PR and between 6e69c57 and 0b575d0.

Files selected for processing: 22
  • src/main/runtime/orca-runtime-serve-browser-restore.test.ts
  • src/main/runtime/session-lifecycle/projection/build-headless-mobile-session-browser-tabs.ts
  • src/renderer/src/components/terminal-pane/terminal-file-open-routing.ts
  • src/renderer/src/components/terminal-pane/terminal-link-file-open-routing.test.ts
  • src/renderer/src/components/terminal-pane/terminal-link-host-workspace-file.test.ts
  • src/renderer/src/components/terminal-pane/terminal-link-open-beside-source.test.ts
  • src/renderer/src/lib/browser-link-destination.ts
  • src/renderer/src/lib/browser-link-open-layout-owner.test.ts
  • src/renderer/src/lib/browser-link-open.test.ts
  • src/renderer/src/lib/browser-link-open.ts
  • src/renderer/src/lib/browser-link-reveal.ts
  • src/renderer/src/lib/http-link-browser-placement.ts
  • src/renderer/src/lib/http-link-routing-store.test.ts
  • src/renderer/src/lib/http-link-routing.ts
  • src/renderer/src/lib/workspace-browser-link-open.ts
  • src/renderer/src/runtime/server-browser-profile-reuse.test.ts
  • src/renderer/src/runtime/sync-runtime-graph-browser.test.ts
  • src/renderer/src/runtime/sync-runtime-graph/mobile-session-browser-tabs.ts
  • src/renderer/src/runtime/sync-runtime-graph/sync-projections.ts
  • src/renderer/src/runtime/web-runtime-browser-link-open.test.ts
  • src/renderer/src/store/index.ts
  • src/renderer/src/store/slices/browser/browser-tab-actions.ts

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

Comment on lines +104 to +125
if (selection.match) {
const result = selection.match
if (request.focusOnCreate === false) {
return { status: 'opened', result }
}
selectWorkspaceSurface(state, request.workspaceId)
showWorkspaceTabs(state, request.workspaceId)
if (!currentBrowserLinkMatch(useAppStore.getState(), destination, result)) {
return { status: 'refused' }
}
const activated = activateBrowserWorkspaceTab({
worktreeId: result.worktreeId,
workspaceId: result.browserWorkspaceId,
pageId: result.browserPageId,
executionHostId: result.executionHostId
})
if (!activated) {
return { status: 'refused' }
}
focusOpenedBrowserLink(result)
return { status: 'opened', result }
}

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.

Minor · Stability & Availability · Quick win

🔎 Supported by static analysis

Script executed:

#!/bin/bash
rg -nP -C4 '\bcanReveal\b' src/renderer/src/lib/browser-link-open.ts src/renderer/src/lib/browser-link-reveal.ts src/renderer/src/lib/link-open-request.ts
rg -nP -C6 '\bprepareRuntimeBrowserLink\s*\(' src/renderer/src --glob '!**/*.test.ts'

Repository: stablyai/orca

Length of output: 5405


Script executed:

#!/bin/bash
set -e
printf '%s\n' '--- workspace-browser-link-open.ts ---'
nl -ba src/renderer/src/lib/workspace-browser-link-open.ts | sed -n '1,190p'
printf '%s\n' '--- workspace-browser-tab-open.ts caller ---'
nl -ba src/renderer/src/lib/workspace-browser-tab-open.ts | sed -n '180,270p'
printf '%s\n' '--- relevant context declarations/usages ---'
rg -n -C8 -F -- 'interface BrowserLinkOpenContext' src/renderer/src
rg -n -C8 -F -- 'type BrowserLinkOpenContext' src/renderer/src
rg -n -C8 -F -- 'isCurrentRequest' src/renderer/src/lib src/renderer/src

Repository: stablyai/orca

Length of output: 11730


Script executed:

#!/bin/bash
set -e
printf '%s\n' '--- BrowserLinkOpenContext and link-context declarations ---'
rg -n -C10 -e 'BrowserLinkOpenContext' -e 'linkContext' src/renderer/src/lib src/renderer/src/runtime src/renderer/src/store --glob '*.ts' --glob '*.tsx'
printf '%s\n' '--- browserLinkCommitIsValid and reveal helper ---'
rg -n -C15 -F -- 'export function browserLinkCommitIsValid' src/renderer/src
rg -n -C15 -F -- 'function browserLinkCommitIsValid' src/renderer/src
nl -ba src/renderer/src/lib/browser-link-open.ts | sed -n '1,180p'
nl -ba src/renderer/src/lib/browser-link-reveal.ts | sed -n '1,100p'
printf '%s\n' '--- current-request producers ---'
rg -n -C10 -e 'isCurrentRequest[ :]?=' -e 'isCurrentRequest\(\)' src/renderer/src/lib src/renderer/src/runtime --glob '*.ts' --glob '*.tsx'

Repository: stablyai/orca

Length of output: 42161


Script executed:

#!/bin/bash
set -e
printf '%s\n' '--- all canReveal assignments/usages ---'
rg -n -C5 -F -- 'canReveal' src/renderer/src --glob '*.ts' --glob '*.tsx'
printf '%s\n' '--- openWorkspaceBrowserTabForLink declaration and caller flow ---'
rg -n -C12 -F -- 'export async function openWorkspaceBrowserTabForLink' src/renderer/src/lib/workspace-browser-tab-open.ts
nl -ba src/renderer/src/lib/workspace-browser-tab-open.ts | sed -n '1,190p'

Repository: stablyai/orca

Length of output: 18002


Honor context.canReveal before focusing a reused page.

The runtime link path passes a selection-aware canReveal callback. The reuse branch ignores it and can focus the matched page after focus moved elsewhere.

Suggested fix
-    if (request.focusOnCreate === false) {
+    if (request.focusOnCreate === false || context.canReveal?.() === false) {
       return { status: 'opened', result }
     }

AmethystLiang added a commit that referenced this pull request Oct 25, 2026
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]>
@AmethystLiang
AmethystLiang force-pushed the open-browser-beside-source branch from 0b575d0 to bcf5f29 Compare October 25, 2026 04:12
AmethystLiang added a commit that referenced this pull request Oct 25, 2026
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]>
@AmethystLiang
AmethystLiang force-pushed the open-browser-beside-source branch from 9a1a80e to fdf2311 Compare October 25, 2026 06:10
AmethystLiang added a commit that referenced this pull request Oct 25, 2026
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]>
@AmethystLiang
AmethystLiang force-pushed the open-browser-beside-source branch from 12eee1a to 843ada1 Compare October 25, 2026 08:04
AmethystLiang and others added 10 commits October 25, 2026 09:25
- 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
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]>
@AmethystLiang
AmethystLiang force-pushed the open-browser-beside-source branch from 843ada1 to f3bfc61 Compare October 25, 2026 16:27
@AmethystLiang
AmethystLiang merged commit 7423928 into main Oct 25, 2026
10 of 36 checks passed
nwparker added a commit that referenced this pull request Nov 6, 2026
… tab

A link whose page is already open now reuses that tab (#32907), so the paged
preview's click of the same URL never added the second tab the spec counted.
Also route CSV viewer sources to the CSV specs.
nwparker added a commit that referenced this pull request Nov 6, 2026
… tab

A link whose page is already open now reuses that tab (#32907), so the paged
preview's click of the same URL never added the second tab the spec counted.
Also route CSV viewer sources to the CSV specs.
nwparker added a commit that referenced this pull request Nov 6, 2026
… tab

A link whose page is already open now reuses that tab (#32907), so the paged
preview's click of the same URL never added the second tab the spec counted.
Also route CSV viewer sources to the CSV specs.
nwparker added a commit that referenced this pull request Nov 6, 2026
… tab (#39196)

A link whose page is already open now reuses that tab (#32907), so the paged
preview's click of the same URL never added the second tab the spec counted.
Also route CSV viewer sources to the CSV specs.
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