OpenProgram Docs

Center tabs, split panes and web-tab presentation

Renderer presentation and binding in apps/web. Cross-window transfer and main-process View geometry: see their own records.

Model

ConceptMeaning
TabChat, file or folder, terminal, web page or application page. Each keeps its own Back/Forward history.
GroupTabs shown side by side as one strip entry, laid out by a canvas. MAX_CENTER_TAB_GROUP_MEMBERS is unlimited. Created by groupTab; a preview expanded to split uses setSplitWebTab.
LeafA kind:"web" entry in the center-tabs store. Id w:<url>; a fork from nextPopupWebTabId is w:<url>:popup:…. Floating does not remove it.
PairingThe one first-class session-page relationship (pairedOwnerByTabId). A session may pair with many pages; closing either side clears it. Set when an Agent opens the page in the session, the user drags it into the session's split, or the user collapses it. Standalone pages have none, and no collapse action.
BindingAt most one active (tabId, ownerTabId) in the useWebTabPip singleton, plus previews per session. Not persisted. Rebinding keeps the old pairing.
HostWhere the page renders now: pane, chat preview or none. Derived by pipCoversCenter; components store no visibility.

A leaf has one native WebContentsView at a time. The preview is that real page, never a mask or screenshot; page tab and preview never show together.

Where one leaf is shown

Tab Preview Split Background collapseWebTabToPip end + setActive end + setSplitWebTab collapse, ungroup first hide() composer chip: show
  1. Tabto preview: collapseWebTabToPip
  2. Previewto tab: end + setActiveto split: end + setSplitWebTabto background: hide()
  3. Splitto preview: ungroup, then collapse
  4. Backgroundto preview: composer chip calls show

end() clears only the binding; the leaf stays until closeTab. Owner or leaf closing calls it. Switching session is not a transition.

Preview store fields
FieldMeaning
tabId ownerTabIdActive binding; both set or both null.
backgroundTabId backgroundOwnerTabIdRestore record left by hide().
rectMemory only, not cleared by hide/end. clampPipRect keeps it inside the pane, minimum 240×160. Default: upper right, under the session controls; a drag takes over.
show(tabId, ownerTabId)Registers the pairing, sets the binding, clears background. Replaces the old binding.
hide()Clears binding, writes background: one-action restore.
end()Clears binding and memory: no longer a preview.

When the preview renders

Binding ex.dev owned by session A, for each active center tab:

SituationLeaf is webPage not activeOwner on canvasSession matchesHost
Session A activeyesyesyesyespreview
Session B activeyesyesnonot reachednone
Page tab activeyesnonot reachednot reachedpage fills the area
File or terminal active, A not beside ityesyesnonot reachednone
Another pane focused, A visible in the splityesyesyesyespreview
A navigated to another conversationyesyesyesnonone

The binding stays in every row; pipCoversCenter just returns something else. The window overview also hides the preview. After ✕, the chip runs the same function on the background pair. In a graph view the preview docks in the side column under the minimap until pulled out.

Preview behaviour

CaseBehaviour
Coming back to a conversationapplyFollowPreview shows that conversation's own preview. With none, a preview of a pane still on the canvas stays, or one from a pane beside it comes up; otherwise it hides.
After ✕Not reopened on return; the chip brings it back. The chip names the page surfaceRefForChat reports and offers Close or Show only when that page is this chat's preview page. In a split it is a plain label. The preview folds into the on-screen chip naming its own page (data-web-surface-chip), its own pane first; with none it fades, and reopens from Preview in conversation.
Opening the bound pageBinding and follow preference stay. .webFrame measures the native bounds and fills the content area, with no reserved space.
Collapse targetOriginal owner if still there, else the session in the group, else the pairing table. None: no button or menu item. Then: leave split or group, setActive(owner), show, with no reload.
Interactive floating page
  • Reuses the Electron WebContentsView for clicks, scrolling and typing; no second Page or forwarded coordinates. Each animation frame updates host transform and native bounds; release persists geometry.
  • Plain browser: sandboxed iframe for HTTP(S), a separate document whose login and frame-ancestor limits follow browser policy. Restricted URLs show an unavailable message and keep Open page.
  • Older bridges without visible views keep a labeled image fallback (usePipSnapshots). A current Desktop bridge does no capture.
  • Hidden, switched or unmounted previews release bounds and observers without closing the Page. Menus and dialogs occlude native content.

Agent interaction

op=openResult
Has session_id or backgroundBackground: ensureExclusiveWebTab, marked agent-owned, listed in Resources. No focus change, no preview.
Otherwise, session active, desktop wide enough, a web page in its group, no owner conflictSplit: openWebTabInSplit, then registerPipPair.
Otherwise, session activePreview: show. A fork via ensureExclusiveWebTab on owner conflict or pipOpenMustFork; otherwise reuse the canonical leaf.
OtherwiseForeground tab.

Foreground paths wait for waitForWebTabReady (2 s), then activate and answer webtab_result. On failure outside split, restorePriorActiveTabAfterFailedWebOpen restores focus. Split needs width 360+480+6 (split-layout.ts); app-shell.tsx publishes it.

op=closeResult
Leaf missing or not webtab_not_found
In any group's memberIdstab_in_user_layout
Otherwise{ok:true}, then closeTab; the store subscription ends a bound preview.
  • A page private to another conversation answers page_not_accessible (agentCanAccessWebTab).
  • surfaceRefForChat picks: visible web pane in the session's group, then splitWebTabId when the session is active, then the preview leaf when the session owns it. None or no bounds: no surface.
  • op=preview/activate act on visibleWebTabById, and answer "not visible" for hidden pages; a background preview reads a selected mirror without revealing the Page.

Known differences from product intent

DifferenceDetail
Fork ignores hidden previewspipOpenMustFork checks only the active binding; B's show clears A's restore chip.
Fork knows only canonical leavesThe check is webTabId(url) === boundTabId. Each fork can leave an orphan leaf, removed by op=close or the user.
Close does not track the openerOnly group membership is checked: an Agent-opened page dragged into a group cannot be closed, and an accessible standalone user page can.
Split path skips pipOpenMustForkIt only checks agent ownership, and changes the group's web pane URL.
show does not ungroupA leaf in another group stays a member while bound as a preview.
Regions differsurfaceRefForChat marks ungrouped pages right; browserPageInventory marks them center.
Browser windows share one layoutOutside the desktop App there is no window id: every browser window of one origin saves to centerTabs. An open window keeps its layout, but a reload takes whichever window saved last.
Binding is not persistedReload loses binding, background and position; leaves return as tabs, and Resources previews reapply.

Navigation in a tab

ActionResult
Open a sessionIn place in the current session tab or new-tab page; from other page types, select an existing session tab or create one. Reopening the current session adds no history.
Back / ForwardOnly the current tab's history, at the far left of the strip; choosing after going back drops forward entries. If the destination conversation is already open in another tab, that tab is selected and the source history stays.
Default entry pageA replaced New tab page stays first in history. Back returns to it without adding a tab.
Application pagesEvery route (Settings, Agents, Abilities, Applications, History, Tasks) is a visit in the selected tab, and the label follows it. Unknown routes show their path.
A page has one tabVisiting a page another tab shows focuses that tab, moved to the route (recordRouteNavigation). Programs, Skills, MCP and Plugins are Abilities; Chats, Projects and Memory are History; every Settings section is Settings.
From inside a splitA page opens in a new top-level tab after the split. A restored member holding a page route leaves its split.
Drafts and titlesHistory keeps draft ids, input stays keyed by session id. Background ACK and title updates change matching records without activating or appending.
Reload and deleteHistory persists with version-2 tabs; legacy tabs become single-entry. Sessions confirmed removed leave every history; unloaded records do not count.

One conversation has one tab per window: see conversation tab identity.

How history is stored
  • pageHistory is the only store: page identity, session metadata, content route and file view, no nested histories, no input or messages. Session legacy history converts on first navigation.
  • Tab id is the instance, sessionId its current session. Collisions get a unique suffix; a slot whose target already belongs to another tab gets a unique identity.
  • Route sync reacts to pathname only; markSessionReady handles session ACK; navigation reacts to current-tab sessionId and draft changes.
  • Native browser URL history stays in browser controls. Web pages keep their own controls. Session history is app state, separate from browser History.
  • Window transfer checks prepared session history before and after the async ACK; a navigation change cancels a stale transfer, and rollback does not overwrite newer navigation.
  • Restoring a detail route first loads its exported host route, then replaces the URL before recording the visit. Duplicate activations share one navigation; a late host commit restores the latest target and is not a visit. Detail routes never reload the document on tab switch.
  • Provider selection derives from the route parameter. A late list response may pick a fallback only on the unqualified page; changing the detail does not reload the catalog.
  • center-tabs-store.ts composes store/ (state, commit helpers, actions) and navigation/ (pure helpers, selectors). No action module owns a second history.

The strip

CaseRule
New tab positionOpened from a tab (link, popup, conversation, file or page preview): right of it, in opening order (insertNextTo). Plus button, New chat, background Agent pages: at the end.
ControlsBack, Forward, New tab: 28px wide, 8px gap. An empty tab list takes no space. New tab has no left divider.
Closing the last tabAllowed. Window and strip stay, content blank, across routes and reloads, with no automatic draft. Session-owned hidden pages stay in Resources and are never the fallback. Close selects visible neighbors after normalizing split groups.
Press and releasePress uses the drag background and blur, changes no page. Release without drag activates by normal click; drag, Escape, cancel or lost focus consumes the click. Focus ring stays.
Drag appearanceTab and pane-label previews share background, backdrop-filter and shadow variables. Settings → General: transparency 0–100%, blur 0–40px, shadow 0–100%, live preview, Restore defaults. Defaults: 20%, 16px, saturation 1.2, 25% of the original shadow alpha. Text and icons stay opaque.
Remove from groupTakes only that tab out of its split; the other panes stay side by side, and a split left with one pane dissolves. Other splits are never touched.
New window cueStays in the strip, above native page bounds: renderer content cannot stack over an Electron child view.
Drag a page onto ResourcesA single web tab attaches that exact Page to the visible conversation on release. Targets: the Resources navigation row, plus its body when open; never one combined rectangle. One border matching the target's outer bounds, no blur. Groups, drafts and other kinds are not sources or destinations.
Page attachment and drag settings detail
  • The server checks owner authorization, the session and the live window/tab/native-target identity from the registered desktop connection, then reuses BrowserResourceStore; no URL copy.
  • Failure reports an error and does not navigate, detach or fabricate a binding. Connection changes reject stale results. Cancelling sends nothing. Success opens Resources and keeps conversation, page identity, top tab and associations. It does not interrupt another execution's operation.
  • Preferences live in local storage, normalized; the pre-paint theme script applies them before hydration; storage events sync same-origin windows. Theme changes keep them. Invalid fields use defaults, numbers are clamped, zero disables that effect. Ordinary buttons and Resources outlines are unaffected. Dragging in the strip reorders; outside it transfers windows as before.

What belongs to a window

A window's layout is its own. Nothing a window does to its tabs or splits reaches another window.

StateRule
Tabs, splits, pane sizes, focused tab, Back/ForwardPer window, saved under centerTabs:<window id>. A window reads only its own key and no window listens for another's writes, so opening, closing, resizing or changing a split stays in that window.
New windowStarts with the tabs moved into it and no split of its own; it inherits no layout.
RestartEvery window open at quit comes back under the same id (session-windows.js) and restores its own layout.
Unsent inputPer window, saved under that window's id like its layout.
Shared on purposePreferences of this device: left sidebar open, right panel open, its view and width, collapsed projects. A window reads them when it loads; changing one never moves an open window. Appearance preferences follow storage events and change every window at once.

Conversation file previews

Chat left, document right, reusing tab groups and DocumentWindow.

CaseRule
Output rowsCompleted live replies show local Markdown links and send_file attachments as compact rows.
Auto-openFirst supported output, beside its focused conversation. Never for history, failed or cancelled replies, background conversations. A manual split or dirty preview stays. Same authorized file reuses its tab.
OwnerProject files: project document owner. Other absolute paths: session-checked read-only attachment owner. Content is never executed or embedded as raw HTML, nor authorized by a model-written path.
RefreshA visible document checks authorized metadata and shows File changed with Refresh. Refresh is always available, reads disk without cache, applies only on success, and never discards local edits, pending publications or rich-editor changes. Hidden panes stop polling; failures keep the old display and offer retry.
One editor per documentFile tabs for the same project document share one persistent editor, moved into the active layout with its draft. Closed only when no tab references it. Duplicates visible together offer Show here.

Native window controls

Row
40 CSS px, shared vertical center with arrows and tab controls
macOS top inset
round((40 × zoom − 16) / 2), clamped to zero; 16 DIP button frame
Horizontal inset
Top inset + 1 DIP: the red circle sits one DIP lower in its frame
Refreshed on
Window creation, document load, renderer resize, leaving fullscreen. Not polled or persisted.
Trust
Preload sends a payload-free resize; main accepts only the owning window's main document
Other platforms
Windows keeps Window Controls Overlay, Linux native decorations

Uses setWindowButtonPosition and getZoomFactor. zoom-changed covers only wheel zoom, so renderer resize carries menu and keyboard zoom.

Where it lives

ConcernLocation
Pairing, binding, coverage, fork, collapseapps/web/lib/browser/web-tab/web-tab-pip-store.ts
Preview follow, restoreapps/web/lib/browser/browser-resource-projection.ts
Preview componentapps/web/components/center-tabs/pip/web-tab-pip.tsx, mounted in app-shell.tsx
Agent ops, surfaces, inventoryapps/web/lib/desktop/bridge/bridge-menu.ts, bridge-surfaces.ts, bridge-state.ts
Tabs and groupsapps/web/lib/tabs/center-tabs-store.ts, store/, center-tab-groups.ts, center-tab-ids.ts, center-tabs-persistence.ts
Restore chipapps/web/components/chat/composer/environment-row/chips/web-surface-chip.tsx
Behaviour testsapps/web/tests/tabs/web-split/
Implementation status

Everything above is implemented. Native acceptance still to run on an installed App: interactive floating page (changing counter, click, type, scroll, drag), tab attach to Resources, native control alignment within one DIP at normal zoom, conversation file previews.

Last updated · 2026-11-25