OpenProgram Docs

Moving tabs between windows

A desktop tab can move to another OpenProgram window, or to a new window at the release point. When the move ends the tab exists in exactly one window; any failure leaves the source as it was.

Source rendererMain processDestination renderer prepare(payload) validate, issue token: prepared inspect(token) accept(placement) lock views, reparent insert tab, journal destination-staged destination-ready awaiting-source remove-source source-removed persist committed decision reveal window: committed
  1. Sourceprepare(payload)
  2. Main processvalidate, issue token: prepared
  3. Destinationinspect(token), accept(placement)
  4. Main processlock views, reparent: destination-staged
  5. Destinationinsert tab, journal, destination-ready
  6. Main processawaiting-source, then remove-source
  7. Sourceremove tab, journal, source-removed
  8. Main processpersist decision, reveal window: committed

The destination inserts before the source removes, so a live tab always exists.

StepBehaviour
TokenOpaque, single use; expires after 15 seconds unless the move completes
PrepareRequested synchronously when the drag leaves the strip
InspectOnly the window under the pointer; not the source, not a second window
Rejectduplicate (the destination focuses its own copy) or group-full: the source is told, nothing changes. A payload the destination cannot validate is not accepted; its token expires.
Commitcommitted is written to tab-transfers.json in the app data directory by atomic replace before success is reported. Uncertain durability: same decision rewritten, backoff 100 ms to 5 s. Write fails: roll back.
New windowRelease outside every window creates a hidden torn-off window at that point. It claims the token, accepts like any destination, and fades in only once the tab is staged. Concurrent detaches share one window boot.
Empty sourceCloses after its journal is finalized
HoverThe window under the pointer gets enter and leave events and shows the drop position only then

What moves

Source kindContents
tabOne ungrouped tab
segmentOne member of a compound group; the rest stay
groupA whole compound group with members, visible members and focused member
AspectValue
Tab kindsSession, file, web, new-tab page, application, built-in page
PositionGroup id, member index and order, visible members, focused member, canvas layout
Also carriedUnsaved file drafts; per chat: composer draft and settings, pending project, channel choice, whether active; each tab's page history
LimitsPayload 20 MiB; file drafts 3 per transfer, 2 MiB each, 6 MiB total; strings and nested values bounded. A malformed payload gets no token.

Web pages keep their state

A web tab is an Electron WebContentsView. The coordinator moves that same object between windows and never calls loadURL, so redirects, sign-in, form values, scroll position, page memory and the DevTools target survive. It stays hidden until the destination reports new bounds.

Before reparenting: clear the agent action cue and control overlay, record each view's bounds and visibility, check the source still owns every view. A view in an active transfer is locked against a second transfer or an agent command.

Journals and recovery

  1. Before changing its tab store, each renderer writes a journal to window-keyed local storage (openprogram.tabTransferJournal:<windowId>): before and after layout, session state, file drafts, native-view bookkeeping.
  2. The main process records which roles opened a journal; the durable decision lists them as required.
  3. After a reload a renderer asks for pending decisions, applies committed or rolled-back, and finalizes its role.
  4. A window gone: another live window adopts the orphaned role.
  5. All required roles finalized: the decision is deleted.

Rollback

TriggerResult
Expiry, or destination or source failureRoll back
Escape, or a drag ending without a targetRoll back
A participating window destroyed or closingRoll back
Commit decision cannot be writtenRoll back
Already committedNever rolls back
StageRollback does
No journal opened yetDiscard the token, tell the source
Journal openedWrite rolled-back; destination undoes its insertion (2-second limit); every view returns to the source with original bounds and visibility; a torn-off window made for this move closes and its state is discarded
Source window goneThe moved views are closed, never left ownerless

Ordinary close rules do not apply: removing the source copy creates no close record, deletes no draft, and opens no fallback new tab before the destination acknowledges.

Routing after a move

Menu commands and agent web-tab commands go to the focused window only. Native-view messages are accepted only from the renderer whose window owns the view.

Code and related pages
PathRole
apps/desktop/main/web-views/transfers.jsMain-process coordinator
tab-transfer-validation.js, tab-transfer-store.jsDesktop validation and durable decisions
apps/web/lib/tabs/transfer/Renderer drag coordinator and journal
apps/web/lib/tabs/store/transfers.tsTab-store insertion and removal

Tab strip, groups and split layout in one window; main and torn-off windows.

Last updated · 2026-11-25