Skip to content

feat(floating): keep the pop-out above every app and summon it from any app - #39992

Closed
tomarai85 wants to merge 28 commits into
stablyai:mainfrom
tomarai85:feat/floating-window-everywhere
Closed

tomarai85 wants to merge 28 commits into
stablyai:mainfrom
tomarai85:feat/floating-window-everywhere

Conversation

@tomarai85

Copy link
Copy Markdown
Contributor

Refs #22167. Builds on #39722; only the last two commits are new here. Draft until #39722 merges.

What this does

Only in Pop-out mode, which stays behind the experimental switch (off by default). No new setting.

  • The pop-out floats everywhere. It stays above other apps. On macOS it is on every Space and over full-screen apps; on Linux it joins every workspace where the window manager honours that; on Windows it stays above other windows on the current virtual desktop (Electron has no virtual-desktop API).
  • On macOS it is a non-activating panel that cannot go full screen. Focusing it never raises the main window, and it never opens its own Space. This removes feat(floating): open the Floating Workspace's active terminal in its own window (experimental) #39722's known limit "hiding a full-screen window leaves an empty Space". skipTransformProcessType keeps the Dock icon where it is.
  • The Floating Workspace shortcut works from any app. While a main window exists, the floatingTerminal.toggle binding (default Cmd+Opt+A / Ctrl+Alt+A) is registered as a global shortcut.
    • A press brings the window to the display under the cursor if it is minimized, hidden by the OS, or not usable on that display. Otherwise the press toggles it, and an opening press creates it on that display.
    • Placing keeps the window's size and centers it in the target work area. It shrinks only when it is larger than that area, so moving between same-sized displays sends no SIGWINCH.
    • A press within 300 ms of the previous one is ignored.
  • Rebinding follows Settings. KeybindingService gains onChange, emitted after reload() and setActionBindings(). The module swaps only the accelerator it registered.

When the chord is not registered

  • In-window mode, or the experimental switch off.
  • A background launch (ORCA_BACKGROUND_LAUNCH=1), so test instances never take a chord from the user's desktop.
  • During quit. The accelerator is dropped at before-quit, and every later sync reads the quit flag. A cancelled quit restores it.
  • A binding that does not convert to an Electron accelerator, or one with Shift as its only modifier.
  • A chord another app already holds, or Wayland: one warning is logged, and the shortcut keeps working inside Orca.

Trust boundary

No new IPC channel. A press only sends the existing toggleFloatingTerminal window action to the main window's own webContents.

Known limits

  • CI cannot see live behaviour over another app's full-screen Space, typing and paste in the panel while another app is frontmost, or the Dock icon, because the e2e suite runs windowless. These have not been checked by hand yet.
  • While registered, the global shortcut also takes the chord inside Orca. In-app presses go through the same path.

Tests

  • Unit: accelerator conversion (default to CommandOrControl+Alt+A; bare key, Shift-only and double-tap give none); registration gating by mode, main window and background launch; re-sync on a binding change unregisters the old accelerator; a failed register warns once and is retried; quit and cancelled quit; each press branch (minimized, hidden by the OS, off-display, visible on display, opening); window options per platform (panel and non-fullscreenable only on macOS; always-on-top everywhere; all workspaces with visibleOnFullScreen and skipTransformProcessType, not on Windows); onChange after reload and after a Settings write.
  • E2E: tests/e2e/floating-workspace-window.spec.ts from feat(floating): open the Floating Workspace's active terminal in its own window (experimental) #39722 still passes, with a background launch.

Size

631 inserted lines: 310 production, 321 unit tests.

  • Float everywhere: 15 production, 23 test.
  • Global shortcut: 295 production, 298 test.

Cmd+Q latches isQuitting in main and asks the renderer to confirm the
window close. Cancel on the unsaved-file or running-work prompt, a close
guard veto, and a shutdown-checkpoint veto all kept the window open but
never told main, so the latch stayed set. A later plain window close was
then handled as a quit, so a running local process got no warning, and
a renderer crash was no longer recovered.

The renderer now sends window:close-cancelled from each of those paths.
Main accepts it only from its own renderer, only while quitting, and only
once that renderer has acknowledged the newest close request, so a stale
cancel cannot end a newer quit. It then runs the same abort steps as a
beforeunload veto.
Adds the floating workspace window's main-process side: the window module,
its IPC handlers and payload checks, and the preload bridge types. Show,
hide, destroy and publish are refused from any sender but the main window,
and show is refused while the experimental flag is off. The floating
renderer may connect, write and fit only the terminal named by the last
snapshot main published. Closing the window hides it; an app or update
quit does not count as a user hide; the window is destroyed with the main
window.
popout.html?surface=floating-workspace now renders the floating workspace
window's own root: a header with the active tab's title, status dot and a
Dock button, and either the active tab's live terminal or a placeholder for
an empty workspace, a non-terminal tab or a terminal that is still starting.
Without the surface parameter the dashboard root renders as before. The
window reports its own crash and memory surface label.

AgentTerminalPreview gains focusOnResync (default true). The floating
window sets it to false, so a resync replay never moves focus there, while
the replay that creates the terminal still focuses it once.
Sprint 3 of the floating pop-out: the main renderer publishes the active
floating tab to the window, shows and hides it with the panel's open flag,
and docks it back to the in-window panel. Adds the experimental Settings
row, the title-bar Pop-out button (both off in the paired web client),
the on-screen selector split and the e2e for open, type, toggles, dock,
quit and cancelled quit.

Also fixes found while running the e2e:
- the window renderer wraps its agent state dot in a TooltipProvider,
  because the window has no App shell;
- acks from the window use their own channel, so with the dashboard
  pop-out also on each ack is applied once;
- leaving Pop-out while the window is hidden keeps the in-window panel
  closed, and a return to Pop-out during the dock fit wait keeps the
  window;
- test-file casts use the oxlint-disable SAFETY form.
…ssor left mid-dock

A main-renderer crash inside Dock's fit wait lost the pending destroy, and the
reloaded bridge assumed no window existed, so the pop-out and its grid claim
stayed behind. The bridge now starts assuming a window may exist, so its first
leave requests destroy; main treats that as a no-op when there is none.
…en app

On macOS the window is a non-activating panel that cannot go full screen,
so focusing it never raises the main window and it never opens its own
Space. It floats above other apps on every platform and joins every
workspace on macOS and Linux; Windows has no workspace API.
… any app

In Pop-out mode the floatingTerminal.toggle binding is registered as a
global shortcut while a main window exists (never in a background launch).
A press brings an open window that is minimized or off the user's display
to the display under the cursor, and otherwise toggles it; an opening
press creates it there. Quit drops the chord, a cancelled quit restores
it, and a chord another app holds keeps working inside Orca only.
…ce-window

# Conflicts:
#	src/main/window/clipboard-ipc-handlers.ts
…ce-window

# Conflicts:
#	src/renderer/src/components/dashboard/AgentDashboardExperimentalSetting.tsx
…ce-window

# Conflicts:
#	src/main/ipc/register-core-handlers/register-core-handlers.ts
#	src/main/startup/main-window/main-process-i18n-menu.ts
#	src/main/startup/main-window/main-window-actions.ts
#	src/main/startup/main-window/main-window-controller.ts
#	src/main/window/clipboard/clipboard-ipc-sender-trust.ts
#	src/renderer/src/components/dashboard/AgentDashboardExperimentalSetting.tsx
#	src/renderer/src/components/floating-terminal/floating-workspace-panel-reveal.ts
#	src/renderer/src/components/settings/advanced/experimental-search.ts
#	src/renderer/src/i18n/locales/en.json
#	src/shared/global-settings-base.ts
…ow-everywhere

# Conflicts:
#	src/main/startup/main-window/main-window-controller.ts
…ce-window

# Conflicts:
#	src/preload/api-types.ts
#	src/preload/index.ts
A restore or reload shows the pop-out without focus, but on an ordinary
foreground launch the shared no-steal helper still calls show(), which
activates the window. Use showInactive() for that path; a windowless
launch still keeps the window hidden.
The dashboard, floating and space windows load the same preload, so any
of them could send window:confirm-close, which skips the main renderer's
save and process guards. Check the sender like the sibling close
handlers do.
In pop-out mode the in-window panel stays mounted but hidden, so a pane
holds its sleeping agent until a reveal that never comes, and the window
shows a disconnected preview. The old wake request fired only on a
focused show, for the tab active at that instant, and only reached a pane
that had not connected yet.

Now whenever the tab the pop-out shows changes, including the restore,
the bridge sends the worktree wake event scoped to that tab (for a pane
already holding its agent) and marks the tab as shown outside its pane
(for a pane that connects later). The wake runs in a microtask, so a
reveal followed by a tab switch in the same task wakes only the tab left
showing. An event without tabIds still wakes every mounted pane, so the
mobile wake is unchanged.
…ce-window

# Conflicts:
#	src/renderer/src/i18n/locales/en.json
…ce-window

# Conflicts:
#	src/renderer/src/app-shell/AppBackgroundServices.tsx
#	src/renderer/src/components/dashboard-popout/AgentTerminalPreview.frame-lifecycle.test.tsx
#	src/renderer/src/components/settings/advanced/ExperimentalPane.tsx
@tomarai85

Copy link
Copy Markdown
Contributor Author

Closing: this was built on #39722, which #44303 replaces with a smaller change. Always-on-top and the summon from other apps are left out for now.

@tomarai85 tomarai85 closed this Nov 18, 2026
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