Skip to content

Open a chat visual in its own tab instead of the sidebar - #26728

Merged
brennanb2025 merged 10 commits into
mainfrom
brennanb2025/chat-visual-open-in-tab
Oct 9, 2026
Merged

brennanb2025 merged 10 commits into
mainfrom
brennanb2025/chat-visual-open-in-tab

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 8 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​286 $\color{#cf222e}{\Huge{\mathbf{−}}}$​102 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​184
Prod 49 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​291 $\color{#cf222e}{\Huge{\mathbf{−}}}$​356 $\color{#cf222e}{\Huge{\mathbf{−}}}$​65

ELI5

When an agent draws a chart or page (a "visual") in a native chat reply, you can now open it in its own tab next to your terminals and files, with room to read it. The old "Open in sidebar" button, which squeezed it into the right sidebar, is gone.

What Changed

Before: hovering a visual in a chat reply showed an "Open in sidebar" button (expand icon). It took over the right sidebar, widened it to fit, and closed when you left the chat's workspace or closed the chat.

After: the button is Open in new tab (out-arrow icon).

  • It opens the rendered visual (not its HTML source) as a tab in the chat's workspace, labelled with the visual's title and a chart icon.
  • One tab per visual. Clicking the button again focuses that tab, even if you moved it to another split. If the agent rewrote the visual, clicking again shows the new version.
  • Switching to another tab in the same split and back can reload the visual, so anything you clicked inside it may start over (the same as the common pattern). The chat's own inline copy is unchanged.
  • Close it like any tab. It is not on the "reopen closed tab" list and is not restored after a restart; the visual is still in the chat, one click away.
  • The tab menu has no Reveal / Copy Path / Copy Relative Path (there is no file path to copy).
  • The sidebar version is removed completely: its panel, its stored state and its width handling.

Mechanism:

  • New tab kind chat-visual: a virtual editor-family tab built the same way as the existing CI "check details" tab. It stores only the visual's identity (host, chat session, file name, title), never the HTML.
  • Rendering: the tab renders the same sandboxed visual frame the chat uses inline (same theme colours, same "no network" sandbox), in its fill-the-space layout. It reads the page through the same cached read client as the inline visual, so it works for local chats and chats on a paired Orca server.
  • One tab per visual: opening looks for the visual's tab in every split of the workspace and focuses it. Opening from a chat in the floating panel no longer moves the main window's selection (it uses the same selection rule as opening files).
  • Not a file: not saved in the session, not sent to paired phones or web clients, not on the reopen-closed list, no file watcher, no git status letter, no load/save/rename/reveal.
  • One shared check: the list of "editor-family" tab kinds was copy-pasted in about ten places; those now call the existing isEditorTabContentType, so the new kind is added once.
  • Dragging tabs: while you drag a tab, a visual's frame lets the pointer through (the same mechanism embedded browser panes use), so you can drop a tab onto a pane that is showing a visual.
  • Also corrects CI check-details tabs (same kind of virtual tab): no file watcher, no git status letter, no Copy Path items.

Why

You asked for this directly: open the visual in a new tab, not the sidebar.

Opening the visual's HTML file through the normal "open an HTML file" path was checked and ruled out:

  • Orca shows a rendered .html file only as a browser tab. For a local chat that page would lose the chat's theme colours (a white page with black chart fills in dark mode) and the sandbox's network block that agents are told about.
  • For chats on a paired Orca server the file sits outside the workspace, so the normal path refuses to open it at all.

So the tab renders the same frame as the inline visual. It keeps the theme and sandbox and works on every host without a new file-serving path. The design was kept to the minimum: an earlier, larger version (a kept-alive frame layer, palette listing, reopen support) was removed in review.

Differences from the common pattern, labelled:

  • Where it opens: the common pattern opens the visual in a side-panel tab; this opens it in the main tab area. Intended: you chose it over the sidebar.
  • Not restored after restart: the common pattern restores the tab. Intended: it matches Orca's other non-file tabs (CI check details, diffs), keeps no second saved copy of the visual's identity, and the visual is one click away in the chat.
  • Not on the reopen-closed list: the common pattern includes it. Intended: reopening would need its own route back through the visual's opener to avoid duplicate tabs; the chat already offers it in one click.
  • Same as the common pattern: one tab per visual; the tab renders the same themed sandboxed frame as inline; the frame reloads when you switch back to its tab.

Linked Issue

Requested directly by the maintainer.

Visual Proof

Before After
before: Open in sidebar after: Open in new tab

Opened tab, light and dark:

tab open, light
tab open, dark

Agent rewrote the visual; clicking "Open in new tab" on the new reply updates the tab in the other split:

updated visual in the other split

Dropping a tab onto a pane that shows a visual:

tab dropped onto a visual pane

Tab menu on a visual tab (no path items):

visual tab menu

Testing

  • editor-chat-visual-tabs.test.ts: one tab per visual, focus across splits, newest title, floating-panel chat leaves the main selection alone, close leaves nothing to reopen, not saved, not published to paired clients.

  • NativeChatVisualTab.test.tsx: clicking "Open in new tab" again re-reads the host.

  • NativeChatMarkdown.visual.test.tsx: the inline button opens the visual's tab with its identity.

  • Watcher, git-status, tab-menu and frame drag pass-through tests for virtual tabs.

  • Web typecheck, orca-ci-checks and CI pass.

  • Live check on macOS (hidden test window, chat backed by a local stand-in model): button and tooltip, open, refocus, split, update, switch away/back, close, restart, tab menu, tall-page scrolling, drop onto a visual.

  • Not checked live: Windows, Linux, chats on a paired Orca server, mobile (the tab is never sent there).

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

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

  • SSH / paired server: the tab keeps the chat's host and reads through the same client as the inline visual. Plain SSH workspaces have no native chat, so they have no visuals.
  • Folder workspaces: the tab is keyed by workspace id only; no git assumptions.
  • Mobile/web: never published to paired clients; older builds never see it, because it is filtered before saving.
  • Known, deferred: a tall visual scrolls inside the tab without a visible scrollbar (same as the old sidebar). Visual tabs are not listed in the Cmd/Ctrl+J tab palette.

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)

… consolidation

- Render chat visual tabs from a worktree-level retained overlay so switching
  tabs or moving the tab to another split never reloads the page.
- Reopening a visual focuses it in whichever split holds it, takes its newest
  title, and opening from the floating panel no longer takes the main
  window's editor selection (check-details opener uses the same helper).
- Visual tabs return to the reopen-closed stack and show in the tab palette.
- One editor-family list and one virtual-tab predicate: no Copy Path, Copy
  Relative Path, Reveal or git status decoration for check-details and chat
  visual tabs.
- Reopen-closed (Cmd/Ctrl+Shift+T) of a chat visual goes through the visual
  opener, so it focuses the visual in whichever split holds it and keeps its
  id when a runtime environment is active.
- A visual tab re-asks its host each time it is shown or reopened; an
  unchanged revision keeps the page as is, a changed one shows the new page,
  and an unavailable tab recovers.
- The tab palette no longer shows or matches a virtual tab's internal id; the
  new-tab search shows the chart icon for visuals.
- Cmd/Ctrl +/- uses app zoom and Alt+Z leaves word wrap alone while a virtual
  tab (CI details, chat visual) is active.
- A tab dragged over a visible visual passes through the frame, using the
  existing drag passthrough.
Remove the retained overlay, the visibility re-read, the zoom and word-wrap
rerouting, palette inclusion, reopen-closed routing and the check-details
opener change. The visual tab renders through the editor area again, stays
off the reopen-closed stack, and keeps: one tab per visual across splits,
no main-window selection change from the floating panel, the newest title on
reopen, and no Reveal or git status letter on virtual tabs.
…irtual tabs

- "Open in new tab" on a visual whose tab is already on screen in another
  split now re-asks the host, so a rewritten visual shows its new page.
- CI details and chat visual tabs no longer start a workspace file watcher.
- Drop the unreachable chat-visual case from the restore-time transient check,
  use the shared virtual-tab check in the header path, and say why visuals
  stay off the reopen-closed stack.
- A chat visual's frame joins the existing tab-drag pointer pass-through, so
  a tab dragged over a visual (in its tab or inline in a chat) can drop or
  split there instead of the frame swallowing the drag.
- The tab menu no longer offers Copy Path / Copy Relative Path for CI details
  and chat visual tabs, whose path is an internal id; no stray separator.
@brennanb2025

Copy link
Copy Markdown
Contributor Author

Review summary

The problem: a chart or page an agent draws in a native chat reply (a "visual") could only be enlarged by "Open in sidebar". That squeezed it into the right sidebar. You asked for "Open in new tab", showing the rendered visual, not its HTML.

What changes for you:

  • Hovering a visual shows Open in new tab. It opens the rendered visual as a tab in the chat's workspace, titled with the visual's name.
  • Clicking it again focuses that same tab, even in another split, and shows the newest version if the agent rewrote it.
  • Switching to another tab in the same split and back can reload the visual.
  • The tab isn't restored after a restart and isn't on the reopen-closed list; the visual stays one click away in the chat.
  • The sidebar version is gone.

How the design got here:

  • Opening the visual's HTML file through the normal open-file path was checked first and ruled out. It only opens as a browser tab, which loses the chat's theme colours and the visual's network block, and paired-server chats can't open it at all. You then chose a tab that renders the same sandboxed frame as the inline visual, kept to the minimum.
  • An earlier, larger version was removed in review. It had a kept-alive frame layer, palette listing, reopen-closed support, zoom rerouting and a CI-check tab tweak.
  • What remains:
    • one tab kind, built like the CI "check details" tab;
    • an opener that dedupes across splits;
    • the shared frame;
    • one shared "editor-family tab" check that replaces about ten copied lists.

Fixed during review:

  • Opening a visual from a chat in the floating panel moved the main window's selection. It now uses the same rule as opening files.
  • Clicking the button again with the visual in another split made a second tab that covered the chat.
  • A visual tab already on screen kept showing the old version after the agent rewrote it.
  • An open visual tab, and CI check tabs too, started a file watcher on the whole workspace.
  • Dropping a dragged tab onto a pane showing a visual did nothing. It now uses the same drag pass-through as browser panes.
  • The visual tab menu offered Copy Path / Copy Relative Path, which copied an internal id. They're hidden now, like Reveal. CI check tabs get the same fix.
  • The tab could show a git status letter belonging to a real file with the same name.

Deferred (P3/nits):

  • A tall visual scrolls inside the tab with no visible scrollbar. The old sidebar had the same problem; the cause is in the visual's page styles, owned by the sibling in-page-links PR's area.
  • Visual tabs aren't listed in the Cmd/Ctrl+J tab palette.
  • Zoom and word-wrap shortcuts on a visual or CI check tab still change the hidden editor settings. This was already true for CI check tabs on main.
  • A few small leftovers: three remaining copies of the editor-tab list, and comments on the drag pass-through still mention only webviews.

Verified:

  • Three review rounds on the first design and three on the slimmed one, with fresh reviewers each round. An architecture challenger ran on both designs.
  • A pre-release readiness checklist on the final design found no P0 or P1 issues. Its two P2s, a stale description and no CI test run on the final head, are both addressed.
  • Web typecheck, orca-ci-checks (22/22) and CI all pass on d13a610, after one main merge.
  • Live checks on macOS used a hidden test window, with a chat backed by a local stand-in model and no real credentials. Three runs passed:
    • button and tooltip, before and after;
    • opening in light and dark;
    • refocus;
    • moving to a split and refocusing there;
    • agent rewrite then reopen;
    • switch away and back;
    • close, then the reopen shortcut (nothing returns, as intended);
    • restart (not restored, no errors);
    • tab menu;
    • tall-page scrolling;
    • dropping a tab onto a visual and onto an inline visual.

Not verified:

  • Windows and Linux.
  • Chats on a paired Orca server, checked by code reading only.
  • The zoom shortcuts, which can't be sent through the test driver.
  • One live run on the final build showed the visual keeping its state across a tab switch, while an earlier run showed it reloading. I didn't pin down which layout produced each, so the description says it "can reload".

@brennanb2025
brennanb2025 marked this pull request as ready for review October 9, 2026 10:43
@coderabbitai

coderabbitai Bot commented Oct 9, 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: 17242b95-0dd2-4d22-8e7a-f25250f14e16

📥 Commits

Reviewing files that changed from the base of the PR and between dc1e7d0 and 2955552.


📒 Files selected for processing (8)
  • 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/runtime/sync-runtime-graph/mobile-session-surfaces.ts
  • src/shared/workspace-layout/tab-order.ts

🚧 Files skipped from review as they are similar to previous changes (4)
  • 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

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



📝 Walkthrough

Walkthrough

Chat visuals now open as virtual editor tabs instead of right-sidebar visuals. The change adds tab state and rendering, updates editor-tab classification and operations, and excludes chat visual tabs from session persistence and mobile publishing. The right-sidebar visual route, panel, and width handling are removed. Visual frames also disable pointer events while webview drag passthrough is active.


Priority: ⬇️ Low

Merge Risk: 🔵 Low · up to 29555

In the cross-host identifier collision case, opening a visual can reuse the other host’s tab. This is a bounded editor issue, so merge risk is low, but the tab identity concern remains open.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 20.75% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 53 functions across 49 files. (6 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title clearly and concisely describes the primary change: opening chat visuals in dedicated tabs instead of the sidebar.
Description check Passed The description is complete and focused. It covers the user-facing change, implementation, rationale, alternatives, visual proof, testing, platform considerations, known limitations, and checklist sta…
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: Docstring Coverage

Explanation

Docstring coverage is 20.75% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 53 functions across 49 files. (6 skipped: 6 unsupported.)



  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • 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: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ede32d11-4acd-4f5c-9744-a2be106fc3a8
📥 Commits

Reviewing files that changed from the base of the PR and between 4eb6c0e and d13a610.

📒 Files selected for processing (57)
  • src/renderer/src/components/editor/EditorContent.tsx
  • src/renderer/src/components/editor/EditorPanelHeaderPath.tsx
  • src/renderer/src/components/editor/closed-editor-tab-disposal.ts
  • src/renderer/src/components/editor/editor-cmd-save-target.ts
  • src/renderer/src/components/editor/editor-header.ts
  • src/renderer/src/components/editor/editor-labels.ts
  • src/renderer/src/components/native-chat/NativeChatInlineVisual.tsx
  • src/renderer/src/components/native-chat/NativeChatMarkdown.visual.test.tsx
  • src/renderer/src/components/native-chat/NativeChatVisualFrame.test.tsx
  • src/renderer/src/components/native-chat/NativeChatVisualFrame.tsx
  • src/renderer/src/components/native-chat/NativeChatVisualPanel.tsx
  • src/renderer/src/components/native-chat/NativeChatVisualTab.test.tsx
  • src/renderer/src/components/native-chat/NativeChatVisualTab.tsx
  • src/renderer/src/components/native-chat/native-chat-visual-markdown-extension.tsx
  • src/renderer/src/components/native-chat/native-chat-visual-owner.tsx
  • src/renderer/src/components/native-chat/native-chat-visual-tab.ts
  • src/renderer/src/components/native-chat/use-native-chat-visual-document.ts
  • src/renderer/src/components/right-sidebar/index.tsx
  • src/renderer/src/components/right-sidebar/right-sidebar-panel-content.tsx
  • src/renderer/src/components/right-sidebar/right-sidebar-width.ts
  • src/renderer/src/components/tab-bar/EditorFileTab.tsx
  • src/renderer/src/components/tab-bar/EditorFileTabContextMenu.test.tsx
  • src/renderer/src/components/tab-bar/EditorFileTabContextMenu.tsx
  • src/renderer/src/components/tab-bar/RecentTabSwitcher.tsx
  • src/renderer/src/components/tab-bar/tab-bar-item-model.git-status.test.ts
  • src/renderer/src/components/tab-bar/tab-bar-item-model.ts
  • src/renderer/src/components/tab-bar/tab-bar-item-surface.tsx
  • src/renderer/src/components/tab-group/useTabGroupCloseScopeCommands.ts
  • src/renderer/src/components/tab-group/useTabGroupItemProjections.ts
  • src/renderer/src/components/tab-group/workspace-tab-close-commands.ts
  • src/renderer/src/components/terminal-workspace-model.ts
  • src/renderer/src/components/terminal/terminal-tab-bulk-actions.ts
  • src/renderer/src/hooks/editor-external-watch-targets.ts
  • src/renderer/src/hooks/useEditorExternalWatch-targets.test.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/workspace-session-unified-tabs.ts
  • src/renderer/src/runtime/sync-runtime-graph/mobile-session-surfaces.ts
  • src/renderer/src/store/slices/editor-chat-visual-tabs.test.ts
  • src/renderer/src/store/slices/editor/actions/chat-visual-tab-actions.ts
  • src/renderer/src/store/slices/editor/actions/close-file-action.ts
  • src/renderer/src/store/slices/editor/actions/open-file-action.ts
  • src/renderer/src/store/slices/editor/actions/recently-closed-editor-tabs.ts
  • src/renderer/src/store/slices/editor/actions/right-sidebar-state.ts
  • src/renderer/src/store/slices/editor/actions/right-sidebar-visual-state.test.ts
  • src/renderer/src/store/slices/editor/create-editor-slice.ts
  • src/renderer/src/store/slices/editor/tabs/editor-tab-content-type.ts
  • src/renderer/src/store/slices/editor/tabs/workspace-editor-item.ts
  • src/renderer/src/store/slices/editor/types/editor-files-slice.ts
  • src/renderer/src/store/slices/editor/types/open-file.ts
  • src/renderer/src/store/slices/tabs/tabs-surface.ts
  • src/renderer/src/store/slices/tabs/tabs-tab-order.ts
  • src/shared/tab-types.ts
💤 Files with no reviewable changes (3)
  • src/renderer/src/components/native-chat/NativeChatVisualPanel.tsx
  • src/renderer/src/components/right-sidebar/right-sidebar-width.ts
  • src/renderer/src/store/slices/editor/actions/right-sidebar-visual-state.test.ts

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

Comment on lines +12 to +17
export function buildChatVisualTabId(
worktreeId: string,
visual: Pick<OpenChatVisualTabState, 'sessionId' | 'file'>
): string {
return `${worktreeId}::chat-visual::${visual.sessionId}::${visual.file}`
}

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 | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

sed -n '1,115p' src/renderer/src/store/slices/editor/actions/chat-visual-tab-actions.ts
cat src/renderer/src/components/native-chat/native-chat-visual-tab.ts
rg -n 'type RuntimeClientTarget|interface RuntimeClientTarget|environmentId|sessionId' src/renderer/src/components/native-chat/native-chat-visual-owner.tsx src/renderer/src/components/native-chat/NativeChatInlineVisual.tsx src/shared | head -100

Repository: stablyai/orca

Length of output: 12687


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- RuntimeClientTarget declaration and references ---'
rg -n -F --glob '*.ts' --glob '*.tsx' -- 'RuntimeClientTarget' src/renderer/src src/shared | head -160
printf '%s\n' '--- target kind/environment construction ---'
rg -n -F --glob '*.ts' --glob '*.tsx' -- 'kind: '\''local'\''' src/renderer/src src/shared | head -120
rg -n -F --glob '*.ts' --glob '*.tsx' -- 'kind: '\''environment'\''' src/renderer/src src/shared | head -120
printf '%s\n' '--- visual owner and inline visual complete files ---'
nl -ba src/renderer/src/components/native-chat/native-chat-visual-owner.tsx
nl -ba src/renderer/src/components/native-chat/NativeChatInlineVisual.tsx
printf '%s\n' '--- visual tab tests and direct callers ---'
rg -n -F --glob '*.ts' --glob '*.tsx' -- 'buildChatVisualTabId' src
rg -n -F --glob '*.ts' --glob '*.tsx' -- 'openChatVisualTab' src/renderer/src | head

Repository: stablyai/orca

Length of output: 41614


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- Runtime target declaration/helpers ---'
nl -ba src/renderer/src/runtime/runtime-client-target.ts
printf '%s\n' '--- visual owner provider callers and chat session owner setup ---'
rg -n -F --glob '*.ts' --glob '*.tsx' -- 'NativeChatVisualOwnerProvider' src/renderer/src
rg -n -F --glob '*.ts' --glob '*.tsx' -- 'sessionId:' src/renderer/src/components/native-chat src/renderer/src/store/slices | head -180
printf '%s\n' '--- visual document loader ---'
nl -ba src/renderer/src/components/native-chat/use-native-chat-visual-document.ts
printf '%s\n' '--- editor visual-tab tests ---'
nl -ba src/renderer/src/store/slices/editor-chat-visual-tabs.test.ts
printf '%s\n' '--- open-file and editor item identity paths ---'
rg -n -F --glob '*.ts' --glob '*.tsx' -- 'openFiles' src/renderer/src/store/slices/editor src/renderer/src/store | head -140
rg -n -F --glob '*.ts' --glob '*.tsx' -- 'openWorkspaceEditorItem' src/renderer/src/store/slices/editor src/renderer/src | head -100

Repository: stablyai/orca

Length of output: 42040


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- NativeChatView and tab owner inputs ---'
nl -ba src/renderer/src/components/native-chat/NativeChatView.tsx
nl -ba src/renderer/src/components/native-chat/use-native-chat-tab-owner.ts
rg -n -F --glob '*.ts' --glob '*.tsx' -- 'NativeChatView' src/renderer/src | head -80
printf '%s\n' '--- session launch/create and session ID assignment ---'
rg -n -E --glob '*.ts' --glob '*.tsx' 'create.*session|launch.*session|sessionId\s*=' src/renderer/src/components/native-chat src/renderer/src/lib src/renderer/src/runtime | head -220
printf '%s\n' '--- structured session launch return contracts ---'
nl -ba src/renderer/src/runtime/structured-agent-session-client.ts | sed -n '1,130p'
nl -ba src/renderer/src/lib/structured-agent-session-launch-callers.ts | sed -n '1,130p'
nl -ba src/renderer/src/components/native-chat/use-structured-agent-session.ts | sed -n '1,180p'
printf '%s\n' '--- tab placement and identity ---'
nl -ba src/renderer/src/store/slices/editor/tabs/workspace-editor-item.ts
nl -ba src/renderer/src/store/slices/editor-chat-visual-tabs.test.ts

Repository: stablyai/orca

Length of output: 42044


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- session creation contracts and IDs ---'
rg -n --glob '*.ts' --glob '*.tsx' -e 'structured-agent-session-create|agentSession\.create|sessionId.*(random|uuid|generate|create)|create.*session|launch.*session' src shared | head -260
printf '%s\n' '--- shared session-create definitions ---'
find . -path '*/node_modules' -prune -o -name '*structured-agent-session-create*' -print
for f in $(find src shared -name '*structured-agent-session-create*' -type f 2>/dev/null); do nl -ba "$f"; done
printf '%s\n' '--- chat structured prop/session sources ---'
nl -ba src/renderer/src/components/native-chat/native-chat-view-types.ts
rg -n --glob '*.ts' --glob '*.tsx' -e 'sessionId.*target|target.*sessionId|sessionId.*environment|runtimeEnvironmentId.*sessionId' src/renderer/src/store src/renderer/src/components/native-chat src/renderer/src/lib | head -220
printf '%s\n' '--- host-side session ID generation ---'
rg -n --glob '*.ts' --glob '*.tsx' -e 'randomUUID|uuid|crypto\.random|session_id|sessionId' src/main src/server src/shared 2>/dev/null | head -260

Repository: stablyai/orca

Length of output: 43149


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- structured session ID creation ---'
nl -ba src/shared/structured-agent-session-create.ts | sed -n '1,145p'
printf '%s\n' '--- structured chat view contract ---'
nl -ba src/renderer/src/components/native-chat/native-chat-view-types.ts | sed -n '1,90p'
printf '%s\n' '--- target-aware read-owner key ---'
nl -ba src/renderer/src/components/native-chat/structured-agent-session-read-owner-registry.ts

Repository: stablyai/orca

Length of output: 8720


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- chat visual OpenFile consumers ---'
rg -n --glob '*.ts' --glob '*.tsx' -e 'chatVisual|chat-visual' src/renderer/src/components src/renderer/src/store | head -220

Repository: stablyai/orca

Length of output: 8502


Include the runtime target in the visual tab ID.

buildChatVisualTabId can return the same ID for local and paired chats with equal worktreeId, sessionId, and file. openChatVisualTab then replaces the existing OpenFile, including its chatVisual.target, while the existing tab keeps the same entity ID. The tab can therefore display the second host's visual.

RuntimeClientTarget has only local and environment variants, so this discriminator covers all current targets.

🐛 Suggested fix
--- "a/src/renderer/src/components/native-chat/native-chat-visual-tab.ts"
+++ "b/src/renderer/src/components/native-chat/native-chat-visual-tab.ts"
@@ -9,9 +9,10 @@
 }
 
 /** One tab per visual, so opening the same visual again focuses its tab. */
 export function buildChatVisualTabId(
   worktreeId: string,
-  visual: Pick<OpenChatVisualTabState, 'sessionId' | 'file'>
+  visual: Pick<OpenChatVisualTabState, 'target' | 'sessionId' | 'file'>
 ): string {
-  return `${worktreeId}::chat-visual::${visual.sessionId}::${visual.file}`
+  const host = visual.target.kind === 'environment' ? `env:${visual.target.environmentId}` : 'local'
+  return `${worktreeId}::chat-visual::${host}::${visual.sessionId}::${visual.file}`
 }

Update TAB_ID in editor-chat-visual-tabs.test.ts to include local.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export function buildChatVisualTabId(
worktreeId: string,
visual: Pick<OpenChatVisualTabState, 'sessionId' | 'file'>
): string {
return `${worktreeId}::chat-visual::${visual.sessionId}::${visual.file}`
}
export function buildChatVisualTabId(
worktreeId: string,
visual: Pick<OpenChatVisualTabState, 'target' | 'sessionId' | 'file'>
): string {
const host = visual.target.kind === 'environment' ? `env:${visual.target.environmentId}` : 'local'
return `${worktreeId}::chat-visual::${host}::${visual.sessionId}::${visual.file}`
}

…ual-open-in-tab

# Conflicts:
#	src/renderer/src/hooks/editor-external-watch-targets.ts
#	src/renderer/src/store/slices/editor/actions/right-sidebar-state.ts
…ual-open-in-tab

# Conflicts:
#	src/shared/workspace-layout/tab-order.ts
@brennanb2025
brennanb2025 merged commit 2356baa into main Oct 9, 2026
41 checks passed
@brennanb2025
brennanb2025 deleted the brennanb2025/chat-visual-open-in-tab branch October 9, 2026 20:35
brennanb2025 added a commit that referenced this pull request Oct 15, 2026
* Open a chat visual in its own tab instead of the sidebar

* Keep chat visual tabs alive across tab switches and finish editor-tab consolidation

- Render chat visual tabs from a worktree-level retained overlay so switching
  tabs or moving the tab to another split never reloads the page.
- Reopening a visual focuses it in whichever split holds it, takes its newest
  title, and opening from the floating panel no longer takes the main
  window's editor selection (check-details opener uses the same helper).
- Visual tabs return to the reopen-closed stack and show in the tab palette.
- One editor-family list and one virtual-tab predicate: no Copy Path, Copy
  Relative Path, Reveal or git status decoration for check-details and chat
  visual tabs.

* Give chat visuals one open path and re-read them when shown

- Reopen-closed (Cmd/Ctrl+Shift+T) of a chat visual goes through the visual
  opener, so it focuses the visual in whichever split holds it and keeps its
  id when a runtime environment is active.
- A visual tab re-asks its host each time it is shown or reopened; an
  unchanged revision keeps the page as is, a changed one shows the new page,
  and an unavailable tab recovers.
- The tab palette no longer shows or matches a virtual tab's internal id; the
  new-tab search shows the chart icon for visuals.
- Cmd/Ctrl +/- uses app zoom and Alt+Z leaves word wrap alone while a virtual
  tab (CI details, chat visual) is active.
- A tab dragged over a visible visual passes through the frame, using the
  existing drag passthrough.

* Slim the chat visual tab back to the minimum

Remove the retained overlay, the visibility re-read, the zoom and word-wrap
rerouting, palette inclusion, reopen-closed routing and the check-details
opener change. The visual tab renders through the editor area again, stays
off the reopen-closed stack, and keeps: one tab per visual across splits,
no main-window selection change from the floating panel, the newest title on
reopen, and no Reveal or git status letter on virtual tabs.

* Re-read an open chat visual when it is opened again; no watcher for virtual tabs

- "Open in new tab" on a visual whose tab is already on screen in another
  split now re-asks the host, so a rewritten visual shows its new page.
- CI details and chat visual tabs no longer start a workspace file watcher.
- Drop the unreachable chat-visual case from the restore-time transient check,
  use the shared virtual-tab check in the header path, and say why visuals
  stay off the reopen-closed stack.

* Let tab drags pass over chat visuals; hide path copies on virtual tabs

- A chat visual's frame joins the existing tab-drag pointer pass-through, so
  a tab dragged over a visual (in its tab or inline in a chat) can drop or
  split there instead of the frame swallowing the drag.
- The tab menu no longer offers Copy Path / Copy Relative Path for CI details
  and chat visual tabs, whose path is an internal id; no stray separator.

* Reuse the hover icon for editor tab icons, so a chat visual shows its icon in both

(cherry picked from commit 2356baa)
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