Repository navigation
Conversation
- Add multi-monitor display enumeration IPC and display manager in main process. - Support moving floating workspace to secondary monitor via window popout portal. - Fix webview capabilities, security hooks, and scoped focus in popout window. - Fix tab pointer activation across multi-window DOM boundaries. - Fix terminal paste focus checks and Radix UI portal container scoping for popouts.
…docking - Add popout window minimize, restore, and focus IPC methods in main and preload. - Invoke popout window minimize on floating workspace minimize action in detached mode. - Preserve detached workspace state on secondary display rather than docking to main monitor.
… fix popout restore - Set parent: null on popout window so Windows DWM treats it as an independent top-level window. - Track bounds across move/resize and restore popout window to last known bounds on secondary display. - Use isSurfaceActive in FloatingTerminalPanelSurface and controller so child panes render properly in detached popouts. - Add Identify Displays feature rendering temporary numbered overlays on all connected monitors. - Add FloatingTerminalDisplaysMenu dropdown to pick target display directly.
…g, and overlay portal scoping
…after window or browser blur
…mmediately on trigger click
…and popout transitions
…ence, dock progress race, and background launch policy
Resolves tab-drag-pointer-sensor conflicts: keep upstream 'ended' cancellation latch and the branch lost-capture buttons guard; synthetic drag moves in the upstream test now carry buttons:1. Extracts BrowserAddressBar initial-click selection into browser-address-bar-initial-click.ts so the merged file stays under max-lines.
…l-click.test.ts after main merge
fbe4adb to
8d7523f
Compare
There was a problem hiding this comment.
Important
Two changes reach outside the floating workspace: an app-wide autoplay switch and a display-overlay path that ignores the headless launch policy. Both have narrower fixes. A third early-return in the restore state machine can leave a stale minimized display.
Reviewed changes
- Multi-monitor targeting — new main-process
floating-workspace-display-manager.ts+floatingWorkspace:getDisplays/moveToDisplay/moveToNextDisplay/identifyDisplays/minimize/restore/isMinimized/focusIPC, sharedcalculateTargetDisplayBounds/findNextDisplay, and a renderer displays menu. - Popout retention —
floating-workspace-popout-restore.tstracks last/minimized bounds and display, repositions on minimize/restore, and reveals throughshowWindowWithoutStealingFocus;createMainWindow.tswiresdid-create-windowfororca-floating-workspace. - Portal scoping —
PopoutPortalContainerContext+useResolvedPortalContainerthread Radix portals into the popout document across dialog, dropdown, select, popover, tooltip, sheet, command, hover-card, and context-menu primitives. - Browser progress retention — captures/restores scroll, media, and URL across webview recreation (
browser-page-progress-retention.ts) with YouTube timestamp rewriting andbrowser-url-equivalence.ts. - Input/focus hardening — window-scoped listeners, tab-drag cancellation on lost button/blur, pointer-events recovery, and popout-aware address-bar/terminal handling.
- Security — popout child window is allow-listed only for
about:blank#floating-workspace+orca-floating-workspace, with sandbox/contextIsolation and the shared webview attachment guard.
ℹ️ Nitpicks
use-floating-workspace-popout.ts:255: the docked branch ofmoveToNextDisplaycomputesdisplays[(currentIndex + 1 + length) % length], so a nullcurrentDisplayId(findIndex→-1) selectsdisplays[0]. That contradicts the sharedfindNextDisplay, which prefers the first non-primary when the current display is unknown. It is unreachable through the UI today (the displays menu always passesonMoveToDisplay), so either delete the branch or route it throughfindNextDisplay.- The preload
floatingWorkspace.restoreandfloatingWorkspace.focusmethods have no renderer callers; if the popout lifecycle never calls them, drop the surface rather than ship dead IPC. floating-workspace-display-manager.test.ts:290-298pins the maximized-restore case withexpect(setBoundsCall.x).toBeGreaterThanOrEqual(1920), and themoveToNextDisplaytest never asserts the chosen display. An exact expectedx/display would have caught the selection inconsistency above.floating-workspace-popout-restore.ts:305-312: the innersetTimeoutinonRestoreis not assigned torestoreTimeoutId, soresetPopoutRestoreStatecannot cancel it; it can run against a replacement window and clobber its flags.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (27)
💤 Files with no reviewable changes (1)
🚧 Files skipped from review as they are similar to previous changes (11)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe change adds a floating workspace that can detach into a popup, move between displays, identify monitors, and restore window state. Main-process IPC and preload APIs expose these operations. Renderer components provide detached terminal rendering, display controls, portal scoping, and dialog routing. Browser progress is captured and restored across remounts. Focus, paste, drag, and pointer handling now use auxiliary-window document contexts. Tests cover the new display, popout, portal, progress, and multi-window behavior. Priority: ➖ Normal Merge Risk: 🟡 Moderate · up to In a detached floating workspace, tab drags, keyboard shortcuts, focus handling, and address-bar suggestion dismissal can fail because events and elements belong to the popout window. These core popout interactions should be corrected before merging. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description covers the change, rationale, visual proof, testing, security, compatibility, and checklist requirements. However, the required linked issue is missing because it contains only
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: 13
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
⚠️ Outside diff range comments (2)
src/renderer/src/components/tab-group/tab-drag-pointer-sensor.ts (1)
61-68: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winRemove main-window
instanceofchecks from auxiliary-document paths.A node from
window.open()is not an instance of the main window'sNode,Document, orHTMLElement.getOwnerDocumenttherefore selects the main document for a real popout target.isXtermHelperTextareaalso rejects the popout terminal helper. The sensor then misses popout events, and terminal focus ownership remains false.
src/renderer/src/components/tab-group/tab-drag-pointer-sensor.ts#L61-L68: ResolveownerDocumentwith realm-independent properties or the target realm's constructors.src/renderer/src/components/tab-group/tab-drag-pointer-sensor.test.ts#L91-L100: Use an iframe or another real browsing context so the test creates foreign-realm nodes.src/renderer/src/components/terminal-pane/use-terminal-pane-global-listeners.ts#L230-L231: MakeisXtermHelperTextarearealm-independent before using it withtargetDoc.activeElement.Proposed realm-independent checks
function getOwnerDocument(target: EventTarget | null): Document { - if (target instanceof Document) { - return target - } - if (target instanceof Node) { - return target.ownerDocument ?? document + if (target && typeof target === 'object') { + const node = target as Node + if (node.nodeType === 9) { + return node as Document + } + if (node.ownerDocument) { + return node.ownerDocument + } } return document }function isXtermHelperTextarea(target: EventTarget | null): target is HTMLElement { - return target instanceof HTMLElement && target.classList.contains('xterm-helper-textarea') + return ( + target !== null && + typeof target === 'object' && + (target as Element).nodeType === 1 && + (target as Element).classList?.contains('xterm-helper-textarea') === true + ) }src/renderer/src/components/browser-pane/assemble-chrome/use-browser-address-bar-dismissal.ts (1)
28-28: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winUse the target document realm for the element check.
When the address bar is portaled into a popout, the focused
<webview>belongs to the popout window.target instanceof HTMLElementuses the main-window constructor and returns false. Thefocusinhandler then does not dismiss the suggestions. ResolveHTMLElementfromtargetDoc.defaultViewbefore the check.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: b053dcc6-c144-4125-8dd7-cddd49decd0d
📥 Commits
Reviewing files that changed from the base of the PR and between fe4237c and fbe4adb856008f01462f1648a241625f46f2589a.
📒 Files selected for processing (82)
src/main/ipc/floating-workspace-monitor.tssrc/main/ipc/register-core-handlers/register-core-handlers.test.tssrc/main/ipc/register-core-handlers/register-core-handlers.tssrc/main/startup/configure-process.tssrc/main/window/createMainWindow.tssrc/main/window/floating-workspace-display-identify.tssrc/main/window/floating-workspace-display-manager.test.tssrc/main/window/floating-workspace-display-manager.tssrc/main/window/floating-workspace-popout-restore.tssrc/main/window/floating-workspace-webview-security.test.tssrc/main/window/main-window-webview-security.tssrc/main/window/privileged-window-navigation.test.tssrc/main/window/privileged-window-navigation.tssrc/preload/api-types.tssrc/preload/api/floating-workspace-api.tssrc/preload/api/floating-workspace-bridge.tssrc/preload/index.tssrc/renderer/src/components/browser-pane/assemble-chrome/BrowserAddressBar.tsxsrc/renderer/src/components/browser-pane/assemble-chrome/BrowserImportHintButton.tsxsrc/renderer/src/components/browser-pane/assemble-chrome/browser-address-bar-initial-click.test.tssrc/renderer/src/components/browser-pane/assemble-chrome/browser-address-bar-initial-click.tssrc/renderer/src/components/browser-pane/assemble-chrome/browser-page-guest-focus.tssrc/renderer/src/components/browser-pane/assemble-chrome/browser-toolbar-menu-dropdown.tsxsrc/renderer/src/components/browser-pane/assemble-chrome/use-browser-address-bar-dismissal.tssrc/renderer/src/components/browser-pane/assemble-chrome/use-browser-page-chrome-focus.test.tsxsrc/renderer/src/components/browser-pane/assemble-chrome/use-browser-page-chrome-focus.tssrc/renderer/src/components/browser-pane/host-guest/bind-browser-page-webview-listeners.test.tssrc/renderer/src/components/browser-pane/host-guest/bind-browser-page-webview-listeners.tssrc/renderer/src/components/browser-pane/host-guest/browser-page-progress-retention.test.tssrc/renderer/src/components/browser-pane/host-guest/browser-page-progress-retention.tssrc/renderer/src/components/browser-pane/host-guest/browser-page-viewport.tssrc/renderer/src/components/browser-pane/host-guest/browser-page-webview.tssrc/renderer/src/components/browser-pane/host-guest/webview-registry.tssrc/renderer/src/components/browser-pane/navigate/use-browser-page-webview-url-sync.test.tsxsrc/renderer/src/components/browser-pane/navigate/use-browser-page-webview-url-sync.tssrc/renderer/src/components/floating-terminal/FloatingTerminalDisplaysMenu.test.tsxsrc/renderer/src/components/floating-terminal/FloatingTerminalDisplaysMenu.tsxsrc/renderer/src/components/floating-terminal/FloatingTerminalPanel.tsxsrc/renderer/src/components/floating-terminal/FloatingTerminalPanelSurface.tsxsrc/renderer/src/components/floating-terminal/FloatingTerminalWindowControls.test.tsxsrc/renderer/src/components/floating-terminal/FloatingTerminalWindowControls.tsxsrc/renderer/src/components/floating-terminal/floating-workspace-popout-shared-state.tssrc/renderer/src/components/floating-terminal/floating-workspace-popout-styles.test.tssrc/renderer/src/components/floating-terminal/floating-workspace-popout-styles.tssrc/renderer/src/components/floating-terminal/popout-portal-container.test.tsxsrc/renderer/src/components/floating-terminal/use-floating-terminal-panel-controller.tssrc/renderer/src/components/floating-terminal/use-floating-terminal-panel-shortcuts.tssrc/renderer/src/components/floating-terminal/use-floating-workspace-popout.test.tssrc/renderer/src/components/floating-terminal/use-floating-workspace-popout.tssrc/renderer/src/components/tab-bar/tab-strip-pointer-activation.test.tsxsrc/renderer/src/components/tab-bar/tab-strip-pointer-activation.tssrc/renderer/src/components/tab-group/tab-drag-gesture-lifecycle.tssrc/renderer/src/components/tab-group/tab-drag-missed-end-listeners.test.tssrc/renderer/src/components/tab-group/tab-drag-missed-end-listeners.tssrc/renderer/src/components/tab-group/tab-drag-pointer-sensor.test.tssrc/renderer/src/components/tab-group/tab-drag-pointer-sensor.tssrc/renderer/src/components/terminal-pane/RunningTerminalCloseDialog.test.tsxsrc/renderer/src/components/terminal-pane/RunningTerminalCloseDialog.tsxsrc/renderer/src/components/terminal-pane/terminal-pane-listener-order-parity.test.tssrc/renderer/src/components/terminal-pane/terminal-pane-paste-execution.tssrc/renderer/src/components/terminal-pane/terminal-pane-paste-listeners.tssrc/renderer/src/components/terminal-pane/terminal-pane-paste-window-scoping.test.tssrc/renderer/src/components/terminal-pane/terminal-paste-target-state.test.tssrc/renderer/src/components/terminal-pane/terminal-paste-target-state.tssrc/renderer/src/components/terminal-pane/use-terminal-pane-global-listeners.tssrc/renderer/src/components/ui/command.tsxsrc/renderer/src/components/ui/context-menu.tsxsrc/renderer/src/components/ui/dialog.tsxsrc/renderer/src/components/ui/dropdown-menu.tsxsrc/renderer/src/components/ui/hover-card.tsxsrc/renderer/src/components/ui/popover.tsxsrc/renderer/src/components/ui/portal-container-context.tssrc/renderer/src/components/ui/select.tsxsrc/renderer/src/components/ui/sheet.tsxsrc/renderer/src/components/ui/tooltip-view-blur.test.tsxsrc/renderer/src/components/ui/tooltip.tsxsrc/renderer/src/hooks/useRadixBodyPointerEventsRecovery.tssrc/shared/browser-url-equivalence.test.tssrc/shared/browser-url-equivalence.tssrc/shared/floating-workspace-display.test.tssrc/shared/floating-workspace-display.tssrc/shared/source-scan/source-tree-walk.test.ts
💤 Files with no reviewable changes (1)
- src/shared/source-scan/source-tree-walk.test.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
| // workspace-doc profile is what refuses all three. The attach is also the point a live window | ||
| // exists to receive read failures for that guest. | ||
| setDocPreviewFailureSink(mainWindow.webContents) | ||
| setDocPreviewFailureSink(contents) |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
Restore the main-window failure sink when the floating host closes.
did-attach-webview overwrites the global sink with the attaching window’s WebContents. The floating installer adds no cleanup, and the floating closed handler only clears popout state. If that host is destroyed, publishDocPreviewFailure returns when sink.isDestroyed() is true. A later main-window preview failure can therefore be dropped. Fix the main-process sink lifecycle in the floating child cleanup or use host-aware sinks.
There was a problem hiding this comment.
ℹ️ No new issues in the incremental delta — the only new commit is a test-only TypeScript fix whose content matches the already-reviewed head.
Reviewed changes (incremental since fbe4adb)
8d7523ff87replaces the inline input stub inbrowser-address-bar-initial-click.test.tswith the existingstubInput()helper to clear aTS2322error after the main merge. No production code changed; the extrainput.ownerDocument.activeElement = inputstill leaves the flag down. The full PR diff at this head is byte-identical to the previously reviewedfbe4adb(same 82 files and per-file diff hashes), so the three findings from the initial review still stand.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
…ngs on restore ordering, autoplay scope, portals, and popout realms
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes (incremental since 8d7523ff)
- Scoped autoplay — removed the app-wide
autoplay-policycommand-line switch, moving it to the popout window'swebPreferences.autoplayPolicyso ordinary browser tabs keep the default policy. - Headless-safe display identification —
identifyDisplaysnow gates onisWindowlessLaunch()instead of onlyORCA_BACKGROUND_LAUNCH. - Fixed the restore state machine — the empty-displays early return clears
minimizedDisplayId/minimizedBounds, and the settle/inner restore timers are tracked throughrestoreTimeoutIdsoresetPopoutRestoreStatecan cancel them. - Cross-realm DOM handling — added
getDomRealmand routed popout-realminstanceofchecks ineditable-target,floating-workspace-terminal-actions,terminal-pane-paste-listeners,popover, andtooltipthrough it (plus React 19 ref-cleanup retention intooltip). - Portal + retention polish —
command.tsxcarries thedata-slot/data-statemarkers the body-lock recovery observer keys on; restored media that was paused at capture is now paused again; explicit YouTubettargets force navigation; a failed popout setup closes the popup instead of orphaning it; and the doc-preview failure sink is handed back to the main window when the popout closes. - Dead-surface removal — dropped the unused
floatingWorkspace.restore/:focusIPC and preload methods. - Test tightening — the maximized-restore test now pins exact bounds, and the
moveToNextDisplay/timestamp/pause paths gained failing-if-broken coverage.
All three prior findings are addressed in a724dd39. The delta's nine test files pass locally (66 tests).
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

ELI5
When you use multiple monitors, you can now move the floating workspace window to any connected display from the window controls. Moving the window between displays or docking it back won't reload or reset your browser tabs (like YouTube videos or music playback).
What Changed
&t=...s) preserved directly.pointer-events: nonestuck on the body, making the window unclickable until reload.Cmd/Ctrl+L) working when focused inside the detached window.ORCA_BACKGROUND_LAUNCHandisWindowlessLaunch) so automated tests and CI runs don't pop up visible windows or steal desktop focus.Why
<webview>across ElectronBrowserWindowinstances re-creates the DOM node. Without capturing playback state and scroll offsets before the move, tabs reload from scratch and video/audio resets to 0:00.popupWindow.document). Radix UI defaults portals todocument.bodyof the main window, which made dropdown menus appear on the wrong monitor.Linked Issue
Fixes # (N/A - standalone fix and feature for floating workspace multi-monitor support)
Visual Proof
Before
After
Testing
Tested locally on Windows 11 with a dual-monitor setup:
src/shared/browser-url-equivalence.test.tssrc/renderer/src/components/floating-terminal/use-floating-workspace-popout.test.tssrc/renderer/src/components/floating-terminal/FloatingTerminalDisplaysMenu.test.tsxsrc/renderer/src/components/browser-pane/assemble-chrome/use-browser-page-chrome-focus.test.tsxsrc/renderer/src/components/browser-pane/host-guest/browser-page-progress-retention.test.tssrc/main/window/privileged-window-navigation.test.tssrc/main/window/floating-workspace-display-manager.test.tsAI Disclosure
Used DeepInvestigator subagent for codebase review and edge case checking.
Review
x: -32000) on minimize/restore. Checked mixed-DPI work areas. Keybindings useCmdOrCtrland platform checks.unverifiedPtyLossrule for SSH disconnections. WebRTC policy is enforced on popout webviews to avoid IP leaks over SSH proxies.about:blank#floating-workspacewith context isolation and sandboxing intact. IPC handlers verifyisTrustedUIRenderer.Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
Author Twitter/X: @mfanxz
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)