Repository navigation
Open a chat visual in its own tab instead of the sidebar - #26728
Conversation
… 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.
Review summaryThe 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:
How the design got here:
Fixed during review:
Deferred (P3/nits):
Verified:
Not verified:
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (8)
🚧 Files skipped from review as they are similar to previous changes (4)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughChat 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 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 |
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
ede32d11-4acd-4f5c-9744-a2be106fc3a8
📒 Files selected for processing (57)
src/renderer/src/components/editor/EditorContent.tsxsrc/renderer/src/components/editor/EditorPanelHeaderPath.tsxsrc/renderer/src/components/editor/closed-editor-tab-disposal.tssrc/renderer/src/components/editor/editor-cmd-save-target.tssrc/renderer/src/components/editor/editor-header.tssrc/renderer/src/components/editor/editor-labels.tssrc/renderer/src/components/native-chat/NativeChatInlineVisual.tsxsrc/renderer/src/components/native-chat/NativeChatMarkdown.visual.test.tsxsrc/renderer/src/components/native-chat/NativeChatVisualFrame.test.tsxsrc/renderer/src/components/native-chat/NativeChatVisualFrame.tsxsrc/renderer/src/components/native-chat/NativeChatVisualPanel.tsxsrc/renderer/src/components/native-chat/NativeChatVisualTab.test.tsxsrc/renderer/src/components/native-chat/NativeChatVisualTab.tsxsrc/renderer/src/components/native-chat/native-chat-visual-markdown-extension.tsxsrc/renderer/src/components/native-chat/native-chat-visual-owner.tsxsrc/renderer/src/components/native-chat/native-chat-visual-tab.tssrc/renderer/src/components/native-chat/use-native-chat-visual-document.tssrc/renderer/src/components/right-sidebar/index.tsxsrc/renderer/src/components/right-sidebar/right-sidebar-panel-content.tsxsrc/renderer/src/components/right-sidebar/right-sidebar-width.tssrc/renderer/src/components/tab-bar/EditorFileTab.tsxsrc/renderer/src/components/tab-bar/EditorFileTabContextMenu.test.tsxsrc/renderer/src/components/tab-bar/EditorFileTabContextMenu.tsxsrc/renderer/src/components/tab-bar/RecentTabSwitcher.tsxsrc/renderer/src/components/tab-bar/tab-bar-item-model.git-status.test.tssrc/renderer/src/components/tab-bar/tab-bar-item-model.tssrc/renderer/src/components/tab-bar/tab-bar-item-surface.tsxsrc/renderer/src/components/tab-group/useTabGroupCloseScopeCommands.tssrc/renderer/src/components/tab-group/useTabGroupItemProjections.tssrc/renderer/src/components/tab-group/workspace-tab-close-commands.tssrc/renderer/src/components/terminal-workspace-model.tssrc/renderer/src/components/terminal/terminal-tab-bulk-actions.tssrc/renderer/src/hooks/editor-external-watch-targets.tssrc/renderer/src/hooks/useEditorExternalWatch-targets.test.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/fr.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/renderer/src/lib/workspace-session-unified-tabs.tssrc/renderer/src/runtime/sync-runtime-graph/mobile-session-surfaces.tssrc/renderer/src/store/slices/editor-chat-visual-tabs.test.tssrc/renderer/src/store/slices/editor/actions/chat-visual-tab-actions.tssrc/renderer/src/store/slices/editor/actions/close-file-action.tssrc/renderer/src/store/slices/editor/actions/open-file-action.tssrc/renderer/src/store/slices/editor/actions/recently-closed-editor-tabs.tssrc/renderer/src/store/slices/editor/actions/right-sidebar-state.tssrc/renderer/src/store/slices/editor/actions/right-sidebar-visual-state.test.tssrc/renderer/src/store/slices/editor/create-editor-slice.tssrc/renderer/src/store/slices/editor/tabs/editor-tab-content-type.tssrc/renderer/src/store/slices/editor/tabs/workspace-editor-item.tssrc/renderer/src/store/slices/editor/types/editor-files-slice.tssrc/renderer/src/store/slices/editor/types/open-file.tssrc/renderer/src/store/slices/tabs/tabs-surface.tssrc/renderer/src/store/slices/tabs/tabs-tab-order.tssrc/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.
| export function buildChatVisualTabId( | ||
| worktreeId: string, | ||
| visual: Pick<OpenChatVisualTabState, 'sessionId' | 'file'> | ||
| ): string { | ||
| return `${worktreeId}::chat-visual::${visual.sessionId}::${visual.file}` | ||
| } |
There was a problem hiding this comment.
🎯 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 -100Repository: 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 | headRepository: 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 -100Repository: 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.tsRepository: 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 -260Repository: 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.tsRepository: 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 -220Repository: 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.
| 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
* 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)
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).
Mechanism:
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.isEditorTabContentType, so the new kind is added once.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:
.htmlfile 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.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:
Linked Issue
Requested directly by the maintainer.
Visual Proof
Opened tab, light and dark:
Agent rewrote the visual; clicking "Open in new tab" on the new reply updates the tab in the other split:
Dropping a tab onto a pane that shows a visual:
Tab menu on a visual tab (no path items):
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-checksand 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
Notes
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)