Repository navigation
feat(tab-bar): support multi-tab selection, batch context menu actions, and detachable windows - #10644
feat(tab-bar): support multi-tab selection, batch context menu actions, and detachable windows#10644emmahyde wants to merge 26 commits into
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:
📝 WalkthroughWalkthroughThis change adds detachable terminal windows with pane lifecycle states, pane-scoped IPC authorization, PTY routing, seed-based tab restoration, and persisted pane bounds. It adds multi-tab selection with bulk pin, close, split, and detach actions across tab types. Detached panes can load multiple tabs, switch active tabs, remove tabs, and reintegrate into the main window. Shared popout utilities centralize security, sizing, loading, showing, and bounds persistence. New preload APIs, renderer components, quick actions, localization, tests, and guide updates support the functionality. 🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (3 warnings)
✅ Passed checks (2 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 17
🧹 Nitpick comments (7)
src/main/window/popout-window-chrome.ts (2)
90-90: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valuePer-window
app.on('before-quit')listeners can trip the default max-listeners warning.Each detached pane window adds one listener; more than 10 concurrent popouts emits a
MaxListenersExceededWarning. A single module-levelbefore-quithandler that flips a shared "quitting" flag consulted by all instances avoids the accumulation.
82-93: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winReset bounds persistence when close/quit is cancelled.
fix_boundsruns before theclosehandler can callevent.preventDefault(), so a cancelledcloseleaveswindowClosing = trueforever and disables resize/move persistence for that window. Re-enable persistence from another cancelled close/quit path, or gate saving onwindow.isDestroyed()and make the freeze strictlyclosed-scoped.src/main/window/dashboard-popout-window.test.ts (1)
62-64: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win
destroymock diverges from Electron: realdestroy()emitsclosed.
closeemitsclose/closedbutdestroyonly flips the flag, so the failure path'sclosedhandler (unsubscribe, singleton nulling,popoutOpenChanged(false)broadcast) is never exercised — exactly the behavior worth asserting here.♻️ Align the mock with Electron semantics
destroy = vi.fn(() => { + if (this.destroyed) { + return + } this.destroyed = true + this.emit('closed') })src/renderer/src/components/tab-bar/EditorFileTab.tsx (1)
234-240: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueAdd
data-selectedfor parity with the other tab types.
SortableTab.tsx(Line 196) andBrowserTab.tsx(Line 197) both exposedata-selected={isSelected || isActive}; editor/simulator tabs don't, so selection-state assertions and any attribute-based styling won't work uniformly across the strip.♻️ Mirror the attribute
data-pinned={isPinned ? 'true' : 'false'} + data-active={isActive ? 'true' : 'false'} + data-selected={isSelected || isActive ? 'true' : 'false'} {...attributes}src/renderer/src/components/tab-bar/useSortableTabRename.ts (1)
49-62: 🩺 Stability & Availability | 🔵 Trivial | 💤 Low valueCancel the pending focus frame on unmount.
renameFocusFrameRefis only cleared when the ref callback runs again; if the tab unmounts while a frame is queued, the callback still fires and focuses a detached input.♻️ Cleanup effect
+ useEffect( + () => () => { + if (renameFocusFrameRef.current !== null) { + cancelAnimationFrame(renameFocusFrameRef.current) + } + }, + [] + )src/renderer/src/components/tab-bar/SortableTabContextMenu.test.tsx (1)
261-312: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider covering
hasDetachableSelected: false.The disabled path for "Detach Tabs to Window" is the only new branch in the multi-select menu without coverage.
src/main/ipc/detachable-pane.ts (1)
72-74: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueComment reads as a truncated fragment.
// handlers use — the renderer closes the tab...starts mid-sentence; it appears the lead-in clause was dropped. Worth tightening for future readers.✏️ Suggested cleanup
- // handlers use — the renderer closes the tab when this call resolves, so a - // resolved-but-not-detached call would lose the tab. The seed rides along - // in the same call so a detached window can never exist without one. + // Why: the renderer closes the tab once this call resolves, so a + // resolved-but-not-detached call would lose the tab. The seed rides along + // in the same call so a detached window can never exist without one.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 2be9c67e-ee11-4be8-a921-92ed79d19356
📒 Files selected for processing (43)
src/cli/bundled-skill-guides.tssrc/main/ipc/detachable-pane.test.tssrc/main/ipc/detachable-pane.tssrc/main/ipc/register-core-handlers.test.tssrc/main/ipc/register-core-handlers.tssrc/main/window/dashboard-popout-window.test.tssrc/main/window/dashboard-popout-window.tssrc/main/window/detachable-pane-window-manager.test.tssrc/main/window/detachable-pane-window-manager.tssrc/main/window/detachable-pane-window.test.tssrc/main/window/detachable-pane-window.tssrc/main/window/popout-window-chrome.tssrc/preload/api-types.tssrc/preload/index.tssrc/renderer/src/App.tsxsrc/renderer/src/components/Terminal.tsxsrc/renderer/src/components/detached-terminal-pane/DetachedTerminalPaneRoot.tsxsrc/renderer/src/components/detached-terminal-pane/detached-terminal-pane-seed.tssrc/renderer/src/components/floating-terminal/FloatingTerminalPanel.tsxsrc/renderer/src/components/settings/codex-config-sync-warning.test.tssrc/renderer/src/components/tab-bar/BrowserTab.tsxsrc/renderer/src/components/tab-bar/EditorFileTab.tsxsrc/renderer/src/components/tab-bar/EditorFileTabContextMenu.tsxsrc/renderer/src/components/tab-bar/SortableTab.tsxsrc/renderer/src/components/tab-bar/SortableTabContextMenu.test.tsxsrc/renderer/src/components/tab-bar/SortableTabContextMenu.tsxsrc/renderer/src/components/tab-bar/TabBar.tsxsrc/renderer/src/components/tab-bar/TabWorkspaceLayoutMenuSection.tsxsrc/renderer/src/components/tab-bar/drop-indicator.tssrc/renderer/src/components/tab-bar/tab-strip-pointer-activation.tssrc/renderer/src/components/tab-bar/useSortableTabRename.tssrc/renderer/src/components/tab-group/TabGroupPanel.tsxsrc/renderer/src/components/terminal-pane/terminal-tab-window-detach.test.tssrc/renderer/src/components/terminal-pane/terminal-tab-window-detach.tssrc/renderer/src/components/terminal-pane/use-detach-terminal-tab-to-window.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/renderer/src/popout.tsxsrc/shared/crash-reporting.tssrc/shared/types.ts
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
Regarding above: These guides represent existing offline instruction templates. Modifying token interpolation patterns and shell quoting formats in these guides is outside the scope of the detachable windows and multi-tab selection feature. I've left these files unchanged so we can track the security and cross-platform improvement in a separate issue/PR. |
|
@coderabbitai resume |
✅ Action performedReviews resumed. |
|
Tip For best results, initiate chat on the files or code changes. The Comment image shows the ORCA desktop app in a dark theme on its initial empty-state screen. The left sidebar contains Tasks, Automations, Orca Mobile with a New badge, a Search field, and a Projects section showing
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 6
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
src/cli/bundled-skill-guides.ts (2)
392-397: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick winClean up the temporary askpass helper on every exit path.
The remote script creates
/tmp/askpass.sh, butset -ecan exit before the laterrm -fwhen fetch or checkout fails, leaving the Git token on disk. Install a cleanup trap immediately after creating the helper and remove the exported credential state on exit.
498-505: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winWire the piped token into Git authentication.
This reads and exports
GH_TOKEN, butgit cloneandgit fetchconfigure neitherGIT_ASKPASSnor another credential mechanism. WithGIT_TERMINAL_PROMPT=0, private-repository access will fail. Mirror the askpass setup from the Vercel example and clean it up with a trap.
🧹 Nitpick comments (1)
src/renderer/src/components/tab-bar/tab-create-menu-options.test.ts (1)
18-18: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd a positive test for the new detached-window option.
All updated fixtures set
hasNewDetachedWindow: false, so none exercises the new enabled branch insrc/renderer/src/components/tab-bar/tab-create-menu-options.tsLines 119-131. Add a case withtruethat asserts the option’sid,kind, label, keywords, and placement; retain a false case to verify omission.Based on the added
new-detached-windowbranch insrc/renderer/src/components/tab-bar/tab-create-menu-options.ts.Also applies to: 37-37, 62-62
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: d48dc1f4-4ff5-4d04-82c1-7ebeb70ada42
📥 Commits
Reviewing files that changed from the base of the PR and between 5b9d86353ce6e65b223d826755c192f9c670d386 and e8198483b1ec346056e3b5cd852383ba33d67688.
📒 Files selected for processing (34)
.gitignoreskill-guides/orca-emulator-android.mdskill-guides/orca-emulator.mdskill-guides/orca-per-workspace-env.mdskill-guides/orchestration.mdsrc/cli/bundled-skill-guides.tssrc/main/ipc/detachable-pane.test.tssrc/main/ipc/detachable-pane.tssrc/main/ipc/pty.test.tssrc/main/ipc/pty.tssrc/main/window/dashboard-popout-window.tssrc/preload/api-types.tssrc/preload/index.tssrc/renderer/src/App.tsxsrc/renderer/src/components/Terminal.tsxsrc/renderer/src/components/WorktreeJumpPalette.tsxsrc/renderer/src/components/cmd-j/quick-action-context.test.tssrc/renderer/src/components/cmd-j/quick-action-context.tssrc/renderer/src/components/cmd-j/quick-actions.tssrc/renderer/src/components/detached-terminal-pane/DetachedTerminalPaneRoot.tsxsrc/renderer/src/components/floating-terminal/FloatingTerminalPanel.tsxsrc/renderer/src/components/tab-bar/BrowserTab.tsxsrc/renderer/src/components/tab-bar/EditorFileTab.tsxsrc/renderer/src/components/tab-bar/EditorFileTabContextMenu.tsxsrc/renderer/src/components/tab-bar/SortableTab.tsxsrc/renderer/src/components/tab-bar/SortableTabContextMenu.test.tsxsrc/renderer/src/components/tab-bar/SortableTabContextMenu.tsxsrc/renderer/src/components/tab-bar/TabBar.context-menu.test.tssrc/renderer/src/components/tab-bar/TabBar.tsxsrc/renderer/src/components/tab-bar/TabBar.windows-shell-launch.test.tssrc/renderer/src/components/tab-bar/TabBarCreateEntryRow.tsxsrc/renderer/src/components/tab-bar/tab-create-menu-options.test.tssrc/renderer/src/components/tab-bar/tab-create-menu-options.tssrc/renderer/src/components/tab-group/TabGroupPanel.tsx
🚧 Files skipped from review as they are similar to previous changes (15)
- .gitignore
- src/preload/api-types.ts
- src/renderer/src/components/tab-group/TabGroupPanel.tsx
- src/preload/index.ts
- src/renderer/src/components/tab-bar/SortableTabContextMenu.test.tsx
- src/renderer/src/App.tsx
- src/renderer/src/components/floating-terminal/FloatingTerminalPanel.tsx
- src/renderer/src/components/Terminal.tsx
- src/main/ipc/detachable-pane.test.ts
- src/renderer/src/components/tab-bar/SortableTabContextMenu.tsx
- src/renderer/src/components/tab-bar/TabBar.tsx
- src/renderer/src/components/tab-bar/EditorFileTabContextMenu.tsx
- src/renderer/src/components/tab-bar/BrowserTab.tsx
- src/renderer/src/components/tab-bar/SortableTab.tsx
- src/renderer/src/components/tab-bar/EditorFileTab.tsx
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)
src/main/ipc/pty.test.ts (1)
14601-14620: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winShorten the test comments.
These comments duplicate implementation details and brittle source line references. Keep only the non-obvious contract being tested; the detailed control-flow walkthrough belongs in the implementation or test design documentation.
Also applies to: 14623-14644
Source: Coding guidelines
src/main/window/detachable-pane-window-manager.test.ts (1)
551-559: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winTest doesn't isolate the "no PTY" case from the "last tab removed" case.
With only one tab in the seed, removing it triggers the same last-tab code path already covered at lines 526-533, so
removedPtyId === nullhere is indistinguishable from "seed became null because it was the last tab" rather than genuinely exercising a no-PTY tab while other tabs remain.♻️ Suggested strengthening
it('removeTab: returns null removedPtyId when the removed tab has no PTY', () => { const seed = makeSeed() seed.ptyId = null + const additional = makeSeed() + additional.tab = { id: 'tab-2' } as unknown as DetachedTerminalTabSeed['tab'] + additional.ptyId = 'pty-2' + seed.additionalTabs = [additional] manager.detachPane('pane-1', makeStore() as unknown as Store, seed) const result = manager.removeTab('pane-1', 'tab-1') expect(result.removedPtyId).toBeNull() - expect(result.seed).toBeNull() + expect(result.seed).not.toBeNull() + expect(result.seed!.tab.id).toBe('tab-2') })
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 4aba9536-be68-467f-916f-0b7d7bf66de3
📥 Commits
Reviewing files that changed from the base of the PR and between e8198483b1ec346056e3b5cd852383ba33d67688 and 7286fd2d13cbf17e599e867471c0e2c2c4faa52c.
📒 Files selected for processing (14)
skill-guides/orca-per-workspace-env.mdskill-guides/orchestration.mdsrc/cli/bundled-skill-guides.tssrc/main/ipc/detachable-pane.test.tssrc/main/ipc/detachable-pane.tssrc/main/ipc/pty.test.tssrc/main/ipc/pty.tssrc/main/window/dashboard-popout-window.test.tssrc/main/window/dashboard-popout-window.tssrc/main/window/detachable-pane-window-manager.test.tssrc/main/window/detachable-pane-window-manager.tssrc/preload/api-types.tssrc/preload/index.tssrc/renderer/src/components/detached-terminal-pane/DetachedTerminalPaneRoot.tsx
🚧 Files skipped from review as they are similar to previous changes (10)
- src/preload/api-types.ts
- src/preload/index.ts
- src/main/ipc/detachable-pane.test.ts
- src/main/ipc/detachable-pane.ts
- src/main/window/detachable-pane-window-manager.ts
- src/renderer/src/components/detached-terminal-pane/DetachedTerminalPaneRoot.tsx
- src/cli/bundled-skill-guides.ts
- skill-guides/orca-per-workspace-env.md
- src/main/ipc/pty.ts
- src/main/window/dashboard-popout-window.ts
de55577 to
126ae9f
Compare
|
Needs a rebase, I'll handle tonight |
126ae9f to
2de9399
Compare
There was a problem hiding this comment.
Actionable comments posted: 3
♻️ Duplicate comments (1)
skill-guides/orca-per-workspace-env.md (1)
392-406:⚠️ Potential issue | 🟠 MajorKeep Git non-interactive when no token is available.
GIT_TERMINAL_PROMPT=0is exported only inside the non-empty-token branch. With an empty token,git fetchcan prompt or hang instead of failing fast.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 6cca6d31-af8f-4e7d-a4fb-0dbe9bf93436
📥 Commits
Reviewing files that changed from the base of the PR and between 126ae9f39784cd7b1ad3704129c40ba67727c0c5 and 2de9399cc9cd9fe34b8b6f3914c496bfb79c8cee.
📒 Files selected for processing (6)
.gitignoreskill-guides/orca-emulator-android.mdskill-guides/orca-emulator.mdskill-guides/orca-per-workspace-env.mdskill-guides/orchestration.mdsrc/cli/bundled-skill-guides.ts
🚧 Files skipped from review as they are similar to previous changes (4)
- skill-guides/orca-emulator-android.md
- skill-guides/orchestration.md
- .gitignore
- skill-guides/orca-emulator.md
Greptile SummaryThis PR adds multi-tab selection with Shift/Ctrl+Click to the tab strip, batch context-menu operations (close, pin, move-to-split, detach) across all tab types, and a complete detachable terminal window subsystem with live PTY reattachment via IPC seed handoff and a new
Confidence Score: 4/5Safe to merge after addressing the watchdog cancellation in pty.ts; the multi-tab selection and detach plumbing is solid. The PTY routing changes in pty.ts are the most operationally sensitive part of the PR. clearDispatcherReadyWatchdog() is called unconditionally for any registered renderer sender — including detached pane windows — but the watchdog exists solely to recover the main window's PTY delivery gate when that window's own handshake is delayed. A detached renderer's handshake arriving during a main-window reload can cancel the watchdog before the main window sends its signal, leaving PTY data blocked from reaching the main renderer if the main window's signal is then lost. The rest of the multi-tab selection logic, the lifecycle state machine, and the IPC trust scoping are well-implemented and tested. Files Needing Attention: src/main/ipc/pty.ts — the pty:rendererDispatcherReady handler should guard clearDispatcherReadyWatchdog() on event.sender === mainWindow.webContents, matching the accounting-reset branch immediately above it.
|
| Filename | Overview |
|---|---|
| src/renderer/src/components/tab-bar/TabBar.tsx | Core multi-tab selection orchestrator: adds selectedTabIds state, effectiveSelectedTabIds memo for stale-ID pruning, handleTabClickActivate with Shift/Ctrl range and toggle logic, and four batch handlers. Logic is well-structured with correct use of functional Zustand updaters. |
| src/main/ipc/pty.ts | Routes PTY data/input/exit to detached-pane renderers instead of only mainWindow. Most paths are correctly gated; clearDispatcherReadyWatchdog() is called unconditionally for both main and detached senders, risking premature watchdog cancellation during main-window reload. |
| src/main/window/detachable-pane-window-manager.ts | New DetachablePaneWindowManager: lifecycle state machine, per-pane BrowserWindow creation with rollback on construction failure, park-on-native-close, and seed promotion when tabs are removed. Well-guarded and tested. |
| src/main/ipc/detachable-pane.ts | New IPC handlers for pane:detach, pane:reintegrate, pane:removeTab, pane:getDetachedTabSeed. Trust scoping is correctly narrow: detached renderer can only act on its own paneId; all shape validation is present. |
| src/renderer/src/components/detached-terminal-pane/DetachedTerminalPaneRoot.tsx | New pop-out entry: seeds the Zustand store, manages active tab switching, PTY delivery registration, and close/reintegrate flows. Known issues flagged in prior threads are in progress. |
| src/renderer/src/store/slices/terminals.ts | Adds openNewDetachedTerminalWindow: creates tab, waits for PTY via store subscription with 5s timeout, builds seed, calls pane:detach, then closes main-window tab with PTY teardown suppressed. Cleanup paths on all error branches look correct. |
| src/renderer/src/components/tab-bar/SortableTabContextMenu.tsx | Multi-select batch context menu: correctly hides rename/single-tab items; 'Close Tabs' shows the single-tab keyboard shortcut (misleading) and is not disabled when all selected tabs are pinned (silent no-op). |
| src/renderer/src/components/tab-bar/tab-strip-pointer-activation.ts | Captures modifier keys at pointerdown and OR-merges them with pointerup modifiers to handle Chromium's stale first-event quirk. Clean change, well tested. |
| src/renderer/src/components/terminal-pane/terminal-tab-window-detach.ts | New pure helpers for tab capture and reintegration; correctly derives repoId from worktreeId prefix, returns null on any missing dependency, and handles layout ptyIdsByLeafId fallback. |
| src/renderer/src/components/detached-terminal-pane/detached-terminal-pane-seed.ts | applyDetachedTerminalTabSeed correctly seeds tabsByWorktree, terminalLayoutsByTabId, ptyIdsByTabId, and activeTabIdByWorktree for all entries, including the ptyIdsByLeafId fallback fix that unblocks PTY reattachment. |
Sequence Diagram
sequenceDiagram
participant R as Main Renderer
participant M as Main Process (IPC)
participant DPW as DetachablePaneWindowManager
participant DR as Detached Renderer
R->>M: pane:detach(paneId, seed)
M->>DPW: detachPane(paneId, store, seed)
DPW->>DPW: lifecycle: attached → transferring → detached
DPW-->>M: BrowserWindow
M->>M: registerDetachedPanePtys(ptyIds, webContents)
M-->>R: (resolved)
R->>R: "closeTab(tabId, localPtyTeardownOwnedExternally=true)"
Note over DR: Window loads popout.html?detachedPane=paneId
DR->>M: pane:getDetachedTabSeed(paneId)
M->>DPW: getPaneSeed(paneId)
DPW-->>M: DetachedTerminalTabSeed
M-->>DR: seed
DR->>DR: applyDetachedTerminalTabSeed(seed)
DR->>M: pty:setActiveRendererPty / pty:setRendererPtyVisible
alt User clicks Return to main window
DR->>M: pane:reintegrate(paneId)
M->>M: finalizeReintegration(paneId)
M->>DPW: reintegratePane(paneId)
DPW->>DPW: lifecycle: detached → reintegrating → attached
M->>M: unregisterDetachedPanePtys(ptyIds)
M->>R: pane:returned(seed)
R->>R: reintegrateDetachedTerminalTab(store, detachedTab)
else Native window close (red dot)
DR-->>M: closed event parked
DPW->>DPW: lifecycle: detached → parked
M->>M: onPaneParked → finalizeReintegration(paneId)
M->>R: pane:returned(seed)
end
Comments Outside Diff (1)
-
src/main/ipc/pty.ts, line 5974-5994 (link)clearDispatcherReadyWatchdog()fires for detached-renderer handshakes, silently disabling the main-window self-heal pathclearDispatcherReadyWatchdog()is called unconditionally for any registered sender — both the main window and detached pane renderers. However, the watchdog exists specifically to recover the main window's PTY delivery gate when the main window's ownpty:rendererDispatcherReadysignal is delayed (e.g., after a crash recovery or a hot-reload in dev). If a detached renderer's handshake arrives first — possible when the main window reloads while a detached pane is still alive — the watchdog is cancelled before the main window sends its own signal. If the main window's signal is then lost or delayed, the gate stays closed and all PTY data is blocked from reaching the main renderer.The accounting-reset branch is already correctly gated on
event.sender === mainWindow.webContents;clearDispatcherReadyWatchdog()should be guarded the same way.
Reviews (2): Last reviewed commit: "fix: address remaining PR review comment..." | Re-trigger Greptile
2de9399 to
e328820
Compare
Seeding worktreesByRepo in the popout store caused the terminal route resolver to enter the explicit-worktree path, fail to find the actual worktree (ID format mismatch), and fall through to 'missing' — then the non-empty worktreesByRepo blocked the legacy fallback. Fix: remove worktreesByRepo from the seed entirely, add executionHostId/connectionId to the repo seed so the repo-indexed fallback path (resolveIndexedRepoOperationRoute) can match, and let the existing resolution chain handle the rest.
The multi-select 'Detach Tabs to Window' handler iterated all selected tabs and called onDetachToWindow for each, creating N separate popout windows. Since the popout window architecture supports one tab per window, only detach the first selected tab.
Anchor the absolute terminal surface to its content slot so grouped tab controls remain visible. Confidence: high Scope-risk: narrow
…k and floating panel reintegration
… OS window - Store: openNewDetachedTerminalWindow(groupId) creates tab, waits for PTY, captures seed, detaches to OS window. 5s timeout, graceful fallback. - Cmd-J palette: 'new-detached-window' quick action (workspace-scoped) - Tab bar '+' menu: 'new-detached-window' entry with ExternalLink icon - Tests: 3 scenarios (happy path, timeout, IPC failure) - i18n: placeholder keys (NEWKEY1-12) in all 5 locales
NEWKEY1-NEWKEY12 replaced with proper sha1(filePath:text) 10-char hex keys per localize-renderer-strings.mjs convention. One pre-existing missing key (detachedTerminalPane.tabs) also absorbed via --fix.
Before this fix, the PTY IPC pipeline was hardcoded to mainWindow's WebContents — detached pane windows received no output (pty:data went to the wrong renderer) and had no input (pty:write was gated to mainWindow only). Changes: - pty.ts: Add detachedPtyToRenderer + detachedPaneRenderers registry - pty.ts: getPtyRendererTarget(id) resolves the correct WebContents - pty.ts: registerDetachedPanePtys/unregisterDetachedPanePtys exports - pty.ts: Route pty:data, pty:spawned, pty:exit, pty:modelRestoreNeeded, pty:clearBuffer:request, pty:serializeBuffer:request to correct renderer - pty.ts: Extend write gate (pty:write, pty:writeAccepted) to accept events from the PTY's owning detached renderer - pty.ts: Allow pty:rendererDispatcherReady from detached pane renderers - detachable-pane.ts: Register PTYs on detach, unregister on reintegrate Tests: 364 pty + 21 detachable-pane tests pass.
Before: onCloseTab called handleReintegrate, which sent the tab back to the main window on every close. Only the 'Return to main window' button should reintegrate — tab close (Cmd+W / ×) should remove the tab from the detached window. After: handleCloseTab removes the active tab from the seed. If it's the last tab, kills the PTY and closes the window. Otherwise switches to another remaining tab.
…ndow handleCloseTab was calling applyDetachedTerminalTabSeed which rebuilds the entire store (tabsByWorktree, terminalLayoutsByTabId, ptyIdsByTabId, activeTabId) — causing remaining open tabs to reload/blink. Now it only updates active-tab tracking fields (same pattern as handleSelectTab) and the seed state.
When a tab is created for detach, it briefly appears in the tab bar before detaching — this flicker is distracting. The fix: 1. Add module-level detachingTabIds Set to terminals.ts 2. Mark tab as detaching right after createTab 3. Clear on every exit path (PTY timeout, seed failure, detach failure, success) 4. Filter detaching tabs from unifiedTabs in TabBar.tsx The tab still exists in tabsByWorktree (needed by TerminalPane to mount and spawn the PTY) but is hidden from the tab strip.
.filter() inside a Zustand selector creates a new array on every invocation. Zustand's subscription engine compares by reference, sees a new value every time, calls forceStoreRerender, which calls the selector again... infinite re-render loop (Maximum update depth exceeded crash). Fix: separate the store read (stable reference) from the filter (local transform that doesn't feed back into Zustand's engine).
Supplements the review fixes already on this branch (5b9d863, aee8254)
with the comments they did not cover:
TabBar multi-select (3 fixes):
- effectiveSelectedTabIds now prunes against live orderedItems so
closed/moved tabs don't keep isMultiSelectActive stuck on
- handleContextMenuRequest moves anchorTabIdRef write out of the state
updater (React purity — StrictMode can re-invoke updaters)
- handleMoveSelectedToSplit mirrors web-runtime tab moves for tabs 2+
via mirrorWebRuntimeTabMove({ kind: 'move-to-group' })
dashboard-popout-window:
- Guard the closed-event close-broadcast with an openBroadcasted flag so
a construction-time throw after the closed listener is registered does
not broadcast popoutOpenChanged(false) when true was never sent
Skill guides:
- Cross-platform quoting for emulator gesture commands (Unix + Windows
variants) so single-quoted JSON doesn't break on cmd.exe
- Stream GH_TOKEN via stdin in the SSH and both Vercel worked examples
instead of interpolating it into argv (ps aux exposure)
- Regenerate bundled-skill-guides.ts from the updated markdown
…close, popout broadcast - Gate pty.ts PTY-data teardown on absence of a live detached target so detached panes keep receiving data after the main window closes (comments on sendPtyExitToRenderer vs onData consistency) - Add pane:removeTab IPC (manager-authoritative): closing a tab in a detached pane now persists to the manager seed and unregisters the PTY, preventing reappearance on reintegration and PTY leaks - Scope dashboard-popout close broadcast to the tracked window so a superseded window late closed event cannot broadcast false after a replacement broadcast true - Harden skill-guide token handling: mktemp + trap cleanup for askpass helpers (Vercel + SSH), wire GIT_ASKPASS in the SSH bootstrap, and use the CLI shell-neutral structured flags (--task-id/--dispatch-id/etc.) in orchestration examples
- Remove `--report-path <optional>` from the copy-pasteable worker_done command in orchestration.md; it was being parsed as shell redirection. Regenerate bundled-skill-guides.ts to match. - Replace placeholder pty.test.ts assertion with real coverage for hasLiveDetachedTarget/anyLiveDetachedTarget, hoisted to module scope in pty.ts so they're testable independently of registerPtyHandlers. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JDRck1HYXgo4T3jAKuFSk3
Rebasing onto main revealed a semantic merge gap: main moved the dirty-dot into EditorFileTabCloseButton (fileIsDirty prop) and simplified the middle-click guard, but this branch's own edits to the same tab kept the pre-refactor call site, which git's line-based merge couldn't catch. Also extracts the mode icon and rename-input JSX into their own components (EditorFileTabIcon, EditorFileTabRenameInput) — the merged file exceeded the 400-line lint cap.
…ation, tabId/paneId naming, doc quoting bugs) - Kill the closed tab's PTY on non-last-tab close (was only wired up for the last-tab-closes-the-window path), fixing a process leak. - Sequence removeTab + PTY kill to resolve before window.close() on the last-tab path, so the native close's park flow can't reintegrate a now-dead PTY as a phantom "exited" tab in the main window. - Rename the tabId prop to paneId — the popout.tsx query param and every IPC call in this component already treat it as a pane id, not a tab id. - Fix the SSH per-workspace-env bootstrap example: it never actually piped the token into ssh, and its unescaped $-expansions would run locally instead of on the remote host. Rebuilt it with posix_quote + positional args so it parses identically under bash or a POSIX /bin/sh; verified via a local /bin/sh -c simulation with a real git clone/fetch/checkout. - Fix the §5/§7f contradiction on how to pass the git token to a VM (stdin, not --env, since --env lands in host-visible argv). - Fix invalid PowerShell quoting in the iOS/Android emulator gesture examples (PowerShell single-quotes pass JSON's double quotes through literally; cmd.exe has no single-quote form and needs \" escaping). Regenerated src/cli/bundled-skill-guides.ts via config/scripts/generate-bundled-skill-guides.mjs --write. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01PLJkhNHjpfsAVkRfTibKiF
e328820 to
7674abc
Compare
…nal-pane-windows # Conflicts: # .gitignore # skill-guides/orchestration.md # src/cli/bundled-skill-guides.ts # src/main/ipc/pty.test.ts # src/main/window/dashboard-popout-window.ts
…nal-pane-windows # Conflicts: # src/renderer/src/components/tab-bar/TabBar.context-menu.test.ts # src/renderer/src/components/tab-bar/TabBar.windows-shell-launch.test.ts # src/renderer/src/components/tab-bar/TabBarCreateEntryRow.tsx
|
@brennanb2025 @AmethystLiang @OrcaWin anything I can do to help this get reviewed before it becomes stale again? This has been waiting for reviews for a week or so now. |
|
Very useful |
|
Could I get some insight from one of the owners? Not wanted, etc? @AmethystLiang can't keep rebasing. |
Summary
This PR introduces multi-tab selection and batch context menu actions across all tab types (
SortableTab,EditorFileTab,BrowserTab,TabBar), alongside support for detaching terminal tabs into dedicated OS windows with live PTY reattachment.Closes #7397
Addresses #4623
Key Changes
Multi-Tab Selection & Batch Context Menu Actions (Closes #7397)
tab-strip-pointer-activation.tsto passPointerEventmodifiers (Shift,Ctrl/Cmd) to tab activation handlers.selectedTabIdsandanchorTabIdRefstate inTabBar.tsx.Shift+clickperforms contiguous range selection across tabs, whileCtrl/Cmd+clicktoggles individual tab selection. Standard click on an unselected tab resets multi-selection to the active tab.getTabRootStateClassesindrop-indicator.tsand setdata-selected="true"attributes acrossSortableTab,EditorFileTab, andBrowserTab.SortableTabContextMenu,EditorFileTabContextMenu, andBrowserTabrender batch action context menus whenisMultiSelectis active.handleCloseSelected,handleTogglePinSelected,handleDetachSelectedToWindow, andhandleMoveSelectedToSplit(which splits the first tab to create the target column/pane and moves remaining selected tabs into the group).useSortableTabRenamehook to clean up inline tab renaming logic inSortableTab.tsx.Detachable Terminal Tab Windows (Addresses #4623)
DetachedTerminalPaneRootto dynamically setdocument.titleto the tab's custom or default title instead of hardcodedOrca Agent Dashboard.ptyIdsByLeafIdwhen seeding the Zustand store inapplyDetachedTerminalTabSeed, ensuringTerminalPaneconnects to the live PTY and restores interactive keyboard input.🌐 Localization & Machine Translation Validation Summary
All newly added tab multi-select and detached window translation keys were validated against native UI conventions and internet machine translation engine outputs (DeepL, Google Translate, Bing Microsoft Translator), ensuring parity across all 5 supported locale bundles (
en.json,es.json,ja.json,ko.json,zh.json).es.json)ja.json)ko.json)zh.json)unpinTabsDesanclar pestañasタブの固定を解除탭 고정 해제取消固定标签页pinTabsFijar pestañasタブを固定탭 고정固定标签页closeTabsCerrar pestañasタブを閉じる탭 닫기关闭标签页detachTabsToWindowSeparar pestañas a una ventanaタブをウィンドウに分離탭을 새 창으로 분리将标签页分离至新窗口moveTabsToPaneColumnMover pestañas a divisiónタブを分割へ移動탭을 분할로 이동将标签页移至拆分detachedTerminalPane.seedMissingEste terminal ya no está disponible en esta ventana.このターミナルはこのウィンドウで利用できなくなりました。이 터미널은 더 이상 이 창에서 사용할 수 없습니다.此终端在该窗口中不再可用。detachedTerminalPane.reintegrateVolver a la ventana principalメインウィンドウに戻る메인 창으로 돌아가기返回主窗口detachedTerminalPane.recoverableError.titleEl terminal de Orca encontró un error.Orca ターミナルでエラーが発生しました。Orca 터미널에 오류가 발생했습니다.Orca 终端遇到错误。detachedTerminalPane.recoverableError.descriptionEl terminal separado no pudo completar la visualización. Reintenta volver a montarlo o vuelve a abrirlo.分離されたターミナルの描画を完了できませんでした。再読み込みして再マウントするか、開き直してください。분리된 터미널 렌더링을 완료할 수 없습니다. 다시 시도하여 다시 마운트하거나 다시 열어보세요.分离的终端无法完成渲染。请重试以重新挂载,或重新打开它。detachToWindow.errorNo se pudo separar la pestaña a una nueva ventanaタブを新しいウィンドウに分離できませんでした탭을 새 창으로 분리할 수 없습니다无法将标签页分离到新窗口Locale Catalog Audit
pnpm run verify:localization-catalog: Verified 10,353 key references & 11,169 keys parity acrossen.json,es.json,ja.json,ko.json, andzh.json.pnpm run verify:localization-coverage: Passed.Related Issues
Verification
pnpm run tcpassed with 0 errors.pnpm run lintpassed with 0 errors across modified tab bar files.npx vitest run --config config/vitest.config.ts src/renderer/src/components/tab-bar/passed cleanly (34 test files, 242 passed).ELI5
You can multi-select tabs and run batch context-menu actions, and detach terminal tabs into separate OS windows while keeping live PTY sessions attached — power-user tab management like a real IDE.