Repository navigation
Open browser links beside their source - #32907
Conversation
|
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.
|
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments: 1
src/renderer/src/lib/file-preview-page-conversion.ts: 1
15-94: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse one implementation for
convertBrowserPageToWorkspaceDoc.The function exists in both
file-preview-page-conversion.tsandfile-preview.ts. Current callers still import it from@/lib/file-preview, so the implementations can diverge.If
file-preview-page-conversion.tsis the intended owner, update the callers to import it from that module and remove the duplicate implementation fromfile-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
📒 Files selected for processing: 57
src/renderer/src/components/native-chat/NativeChatInlineVisual.link-placement.test.tsxsrc/renderer/src/components/native-chat/NativeChatInlineVisual.tsxsrc/renderer/src/components/native-chat/native-chat-link-target-actions.tssrc/renderer/src/components/native-chat/native-chat-visual-owner.tsxsrc/renderer/src/components/native-chat/native-chat-web-link-actions.tssrc/renderer/src/components/native-chat/use-native-chat-link-actions.test.tsxsrc/renderer/src/components/native-chat/use-native-chat-link-actions.tssrc/renderer/src/components/terminal-pane/terminal-file-link-actions.test.tssrc/renderer/src/components/terminal-pane/terminal-file-link-actions.tssrc/renderer/src/components/terminal-pane/terminal-file-link-browser-open.tssrc/renderer/src/components/terminal-pane/terminal-file-open-in-group-toast.tssrc/renderer/src/components/terminal-pane/terminal-file-open-routing.tssrc/renderer/src/components/terminal-pane/terminal-link-host-workspace-file.test.tssrc/renderer/src/components/terminal-pane/terminal-link-open-beside-source.test.tssrc/renderer/src/components/terminal-pane/terminal-osc-link-routing.tssrc/renderer/src/components/terminal-pane/terminal-url-link-hit-testing.tssrc/renderer/src/components/terminal-pane/terminal-web-link-click.tssrc/renderer/src/lib/adjacent-link-open-group.tssrc/renderer/src/lib/browser-link-destination.test.tssrc/renderer/src/lib/browser-link-destination.tssrc/renderer/src/lib/browser-link-focus.tssrc/renderer/src/lib/browser-link-open-test-harness.tssrc/renderer/src/lib/browser-link-open.test.tssrc/renderer/src/lib/browser-link-open.tssrc/renderer/src/lib/browser-link-owner.tssrc/renderer/src/lib/browser-link-profile-isolation.test.tssrc/renderer/src/lib/browser-link-session.tssrc/renderer/src/lib/browser-workspace-tab-activation.tssrc/renderer/src/lib/file-preview-link-open.test.tssrc/renderer/src/lib/file-preview-link-open.tssrc/renderer/src/lib/file-preview-page-conversion.tssrc/renderer/src/lib/file-preview.tssrc/renderer/src/lib/http-link-destinations.tssrc/renderer/src/lib/http-link-in-group-availability.tssrc/renderer/src/lib/http-link-localhost-route.tssrc/renderer/src/lib/http-link-routing.tssrc/renderer/src/lib/http-link-source-placement.test.tssrc/renderer/src/lib/link-open-intent.tssrc/renderer/src/lib/link-open-request.tssrc/renderer/src/lib/workspace-browser-link-open.tssrc/renderer/src/lib/workspace-browser-route-eligibility.tssrc/renderer/src/lib/workspace-browser-tab-open.tssrc/renderer/src/runtime/web-runtime-browser-creation-context.tssrc/renderer/src/runtime/web-runtime-browser-creation.tssrc/renderer/src/runtime/web-runtime-browser-link-open.test.tssrc/renderer/src/runtime/web-runtime-browser-link-session.test.tssrc/renderer/src/runtime/web-runtime-browser-tab-staging.tssrc/renderer/src/runtime/web-session-tabs-sync/apply-browser-records.tssrc/renderer/src/runtime/web-session-tabs-sync/mirrored-browser-tabs.tssrc/renderer/src/runtime/web-session-tabs-sync/state.tssrc/renderer/src/store/index.tssrc/renderer/src/store/slices/browser/browser-slice-contract.tssrc/renderer/src/store/slices/browser/browser-tab-actions.tssrc/renderer/src/store/slices/editor/tabs/editor-open-adjacent-group.tssrc/renderer/src/store/slices/editor/tabs/editor-open-target-group.tssrc/renderer/src/store/slices/tabs/tabs-create-actions.tssrc/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.
|
@coderabbitai Fixing. Will be in the next commit |
|
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. |
8690393 to
71854ad
Compare
There was a problem hiding this comment.
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
📒 Files selected for processing: 23
src/renderer/src/components/native-chat/native-chat-link-target-actions.tssrc/renderer/src/components/native-chat/native-chat-web-link-actions.tssrc/renderer/src/components/terminal-pane/terminal-file-link-actions.test.tssrc/renderer/src/components/terminal-pane/terminal-file-link-actions.tssrc/renderer/src/components/terminal-pane/terminal-file-link-browser-open.tssrc/renderer/src/components/terminal-pane/terminal-file-open-routing.tssrc/renderer/src/components/terminal-pane/terminal-link-file-open-routing.test.tssrc/renderer/src/components/terminal-pane/terminal-link-open-beside-source.test.tssrc/renderer/src/components/terminal-pane/terminal-link-remote-runtime-ssh-open.test.tssrc/renderer/src/components/terminal-pane/terminal-url-link-hit-testing.tssrc/renderer/src/lib/browser-link-open-layout-owner.test.tssrc/renderer/src/lib/browser-link-open.test.tssrc/renderer/src/lib/browser-link-open.tssrc/renderer/src/lib/browser-link-profile-isolation.test.tssrc/renderer/src/lib/file-preview-link-open.test.tssrc/renderer/src/lib/file-preview-link-open.tssrc/renderer/src/lib/file-preview-page-conversion.tssrc/renderer/src/lib/file-preview.tssrc/renderer/src/lib/http-link-destinations.tssrc/renderer/src/lib/workspace-browser-link-open.tssrc/renderer/src/lib/workspace-browser-route-eligibility.tssrc/renderer/src/lib/workspace-browser-tab-open.test.tssrc/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.
|
@coderabbitai Fixing. Will be in the next commit |
|
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. |
71854ad to
6e69c57
Compare
There was a problem hiding this comment.
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
📒 Files selected for processing: 15
src/renderer/src/components/terminal-pane/terminal-file-link-editor-open.tssrc/renderer/src/components/terminal-pane/terminal-file-open-routing.tssrc/renderer/src/components/terminal-pane/terminal-file-open-turn.tssrc/renderer/src/lib/browser-link-destination.test.tssrc/renderer/src/lib/browser-link-open.tssrc/renderer/src/lib/browser-link-owner.tssrc/renderer/src/lib/http-link-routing.tssrc/renderer/src/lib/http-link-source-placement.test.tssrc/renderer/src/lib/workspace-browser-link-open.tssrc/renderer/src/lib/workspace-browser-tab-open.test.tssrc/renderer/src/lib/workspace-browser-tab-open.tssrc/renderer/src/store/index.tssrc/renderer/src/store/slices/browser/browser-tab-actions.tssrc/renderer/src/store/slices/browser/browser-tab-open-view.tssrc/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.
6e69c57 to
0b575d0
Compare
There was a problem hiding this comment.
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
Files selected for processing: 22-
src/main/runtime/orca-runtime-serve-browser-restore.test.tssrc/main/runtime/session-lifecycle/projection/build-headless-mobile-session-browser-tabs.tssrc/renderer/src/components/terminal-pane/terminal-file-open-routing.tssrc/renderer/src/components/terminal-pane/terminal-link-file-open-routing.test.tssrc/renderer/src/components/terminal-pane/terminal-link-host-workspace-file.test.tssrc/renderer/src/components/terminal-pane/terminal-link-open-beside-source.test.tssrc/renderer/src/lib/browser-link-destination.tssrc/renderer/src/lib/browser-link-open-layout-owner.test.tssrc/renderer/src/lib/browser-link-open.test.tssrc/renderer/src/lib/browser-link-open.tssrc/renderer/src/lib/browser-link-reveal.tssrc/renderer/src/lib/http-link-browser-placement.tssrc/renderer/src/lib/http-link-routing-store.test.tssrc/renderer/src/lib/http-link-routing.tssrc/renderer/src/lib/workspace-browser-link-open.tssrc/renderer/src/runtime/server-browser-profile-reuse.test.tssrc/renderer/src/runtime/sync-runtime-graph-browser.test.tssrc/renderer/src/runtime/sync-runtime-graph/mobile-session-browser-tabs.tssrc/renderer/src/runtime/sync-runtime-graph/sync-projections.tssrc/renderer/src/runtime/web-runtime-browser-link-open.test.tssrc/renderer/src/store/index.tssrc/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.
-
| 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 } | ||
| } |
There was a problem hiding this comment.
🔎 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 } }
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]>
0b575d0 to
bcf5f29
Compare
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]>
9a1a80e to
fdf2311
Compare
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]>
12eee1a to
843ada1
Compare
- 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]>
843ada1 to
f3bfc61
Compare
… 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.
… 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.
… 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.
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
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
pnpm tc:web): passed.git diff --check: passed.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.