zidane-ui/ workspace/ headless
import { … } from 'zidane-ui/workspace/headless'ui/src/workspace/headless/index.ts
Functions#
activeTabOfFunction#
The tab the panel shows: the focused group's pick, else its first.
appendPanelPageFunction#
base with page after it: its rows join the sections of the same id (a row already shown, by id, is not
repeated), its other sections follow, and its more replaces base's. The header (title, controls, search)
stays base's. Past PANEL_PAGED_ITEMS rows, the rest is dropped and there is no more.
bindingInFolderFunction#
Whether binding is one of cwd's.
bindingKeyFunction#
The binding a panel's content belongs to: the folder it loads against, and the session (or none).
chatFloorFunction#
The narrowest the chat may get with share set or not.
closeTabFunction#
Remove a tab. A group left empty collapses; when it was focused, the group before it takes the focus.
createLayoutMemoryFunction#
A new layout memory over options.storage.
createMemoryLayoutsFunction#
Layouts kept in memory for the page's life.
createOpenTargetFunction#
Builds the open decisions over the app's setting, its OS actions and its panel actions.
createPanelContentsFunction#
Creates an empty PanelContents.
createPanelFocusStoreFunction#
Creates an empty PanelFocusStore.
createStorageLayoutsFunction#
Layouts kept in a Storage under one key, as { version: 1, scopes }.
Each read is validated (parseWorkspaceLayout); unreadable or foreign
data reads as nothing stored. A write from another tab (the storage
event) is read again and notified. A full or missing storage keeps the
change in memory.
createWorkspaceOpsFunction#
Creates the panel actions over a layout store.
dropTabFunction#
A dragged tab dropped. On its own strip it is a reorder: nothing else changes (the group keeps showing what it showed). Anywhere else it moves (or splits off) and is shown, focused, where it lands.
findGroupFunction#
The group holding tabId, or null.
focusedGroupFunction#
The focused group (the first one if the stored id is stale).
focusTabFunction#
Show tabId in its group and focus that group (no-op when the tree lacks it).
groupIdsOfFunction#
The ids of every group under node, in order.
groupsOfFunction#
Every group, depth first (top/left to bottom/right).
groupViewsFunction#
Every group on screen, top/left to bottom/right.
layoutProjectKeyFunction#
The project a scope's shared layout lives under: the root, qualified by the server for a server session (the same path on two hosts is two projects).
layoutScopeKeyFunction#
A scope's identity: the session key when bound, else draft:<id> or project:<root>.
maxColumnWidthFunction#
Largest width a column may take while the chat keeps chatMin.
moveTabByFunction#
tabId moved delta slots within visible (its group's tabs on screen, in order); hidden tabs keep theirs.
panelDragResultFunction#
What a panel drag to width saves: past the usual chat floor it becomes a
share of the room beside the sidebar, otherwise a plain width.
panelTabMarkFunction#
The mark a panel's tab draws: icon.gui as an icon, else its extension's mark. undefined: a tab with
neither (an app's tab without an icon).
panelTreeOfFunction#
One group holding tabs, showing active.
parseLayoutFunction#
A stored layout, validated field by field; older shapes migrate (the flat tab strip, the bottom group).
parsePanelTreeFunction#
A stored panel tree, validated. Older layouts migrate once, on read: a bare
group tree (no focus, no counter) and, before groups, the flat strip
(panelTabs + panelActiveId), which becomes one group.
parseTreeFunction#
A stored tree, validated; null when it is not one.
parseWorkspaceLayoutFunction#
A stored layout, validated field by field: what cannot be read falls back
to fallback's, so stale or foreign data never shows an impossible state.
pickTabFunction#
Pin tabId (into groupId, default the focused group) and show it.
pinTabFunction#
Add tabId to groupId (default: the focused group) unless the tree has it.
resizeSplitFunction#
New shares for split splitId as shown: shown lists each shown child's group ids (resizeShownSplit).
resolveLayoutFunction#
Fits the sidebar, the chat and the side panel into the window (see the module comment for the order things give).
sameAttentionFunction#
Whether two attentions show the same. live is part of the value: a flip from counting to "in use" must land.
sameWorkspaceLayoutFunction#
Whether two layouts hold the same thing (the tree compared by value).
setPendingRevealFunction#
Remembers where to reveal absPath when the Files tab opens it next.
splitPanelWidthFunction#
The width a panel opens at when its project never sized it: half the room the sidebar leaves, so the panel and the chat start side by side at 50/50. A plain width, recomputed as the window changes: the chat's floor still squeezes it, then floats it, in a narrow window.
splitTabFunction#
Take tabId out into a new group beside (right) or below (bottom) its own, focused.
splitViewFunction#
The split id as shown, null when it is not on screen.
takePendingRevealFunction#
The position waiting for absPath, removed as it is returned; null when none waits.
treeTabsFunction#
Every tab in the tree, group by group.
viewOfFunction#
The tree as shown: only tabs the catalog offers here, groups left empty
collapsed, each group's active tab resolved (its pick, else its first).
With fillEmpty a strip whose tabs are all hidden here shows the
catalog's first tab instead (not stored until the user picks).
Constants#
CHAT_MINConstant#
The window's horizontal budget: sidebar | chat | side panel.
The chat never drops below its floor (CHAT_MIN). When the wanted widths do not fit,
give way in this order: shrink the panel to its minimum, shrink the
sidebar to its minimum, float the panel over the chat (overlay), and
finally collapse the sidebar. Pure; the App applies the result.
A panel dragged wider than that floor allows is kept as a share of the
room beside the sidebar (panel.share): it follows the window's width,
and the chat's floor drops to CHAT_MIN_SHARE of the window.
CHAT_MIN_SHAREConstant#
The chat's floor once the user has dragged the panel past CHAT_MIN.
DEFAULT_WORKSPACE_LABELSConstant#
The default English strings of the side panel. Override any of them through WorkspaceProvider.
EMPTY_CONTENT_ENTRYConstant#
A panel with nothing loaded.
EMPTY_LAYOUTConstant#
A layout with every default (the side panel on Artifacts, closed).
EMPTY_WORKSPACE_LAYOUTConstant#
A layout with nothing stored: closed, no tab.
LAYOUT_STORAGE_KEYConstant#
The storage key the layouts live under.
OVERLAY_CHAT_PEEKConstant#
A floating panel always leaves this much of the chat visible to click on.
PANEL_PAGED_ITEMSConstant#
Rows kept across every page of one panel, at most: past it, Show more goes away.
WORKSPACE_STORAGE_KEYConstant#
The default storage key of createStorageLayouts.
Interfaces#
LayoutMemoryInterface#
One window's layout memory; see the top of this file.
LayoutMemoryOptionsInterface#
Options of createLayoutMemory.
LayoutResolvedInterface#
The columns' effective widths and modes.
LayoutScopeInterface#
What a layout is attached to: a folder, optionally bound to a session (or
to the new-chat draft that will become one). The desktop app's Scope has
this shape, so it passes its own.
LayoutStoreOptionsInterface#
Options shared by the layout stores.
LayoutWantsInterface#
What resolveLayout fits: the window, and each column's wanted width and floor.
MemoryLayoutsInterface#
A WorkspaceLayouts kept in memory, plus a way to write as another window would.
OpenTargetApiInterface#
The decisions createOpenTarget returns.
OpenTargetDepsInterface#
What createOpenTarget needs.
OpenTargetEventInterface#
A click's modifiers.
PanelContentInterface#
JSON-safe content a panel's load returns. The host paints it with its own components.
PanelContentEntryInterface#
An extension panel's last content, with its loading and pending flags.
PanelContentsInterface#
The content cache's store.
PanelFocusEntryInterface#
The last focus asked for in one scope.
PanelFocusStoreInterface#
The focus asked per scope.
PanelGroupInterface#
A group of tabs: one strip, one body showing its active tab.
PanelGroupViewInterface#
One group of tabs on screen: its own strip and active tab.
PanelLoadContextInputInterface#
A load context as it arrives from across a boundary (the GUI renderer)
or from host UI state, before the host binds it: every field optional.
normalizePanelLoadContext reduces untrusted input to this shape;
resolvePanelLoadContext turns it into the PanelLoadContext
load / onAction receive.
PanelSplitInterface#
Groups (or splits) side by side or stacked.
PanelSplitViewInterface#
A split on screen: its children side by side (row) or stacked (col).
PanelTreeInterface#
The side panel's layout document: the tab groups, the focused one and the id counter.
SessionLayoutInterface#
How a scope's window was left: the side panel, the Files tab, the terminal drawer, the composer badges.
StorageLayoutsOptionsInterface#
Options of createStorageLayouts.
TabAttentionInterface#
A tab has something for the user. attention is the warn-toned, pulsing
kind (the agent is waiting on an answer); info is a quiet count (open
todos). Kept per scope so a badge earned on one session never shows on
another and comes back when switching back.
WorkspaceHostInterface#
Where the workspace keeps its layouts and finds extension panels. Leave a member out and what needs it falls back.
WorkspaceLayoutInterface#
One scope's side panel, as stored.
WorkspaceLayoutsInterface#
The layouts of every scope, read synchronously so a scope switch shows its layout in the same render.
WorkspaceOpsInterface#
The panel's layout actions.
WorkspaceOpsOptionsInterface#
Options of createWorkspaceOps.
WorkspaceOpsViewInterface#
What the ops read from the latest render: what is on screen.
WorkspacePanelChangeInterface#
A panel's content changed in a folder.
WorkspacePanelsInterface#
Extension-contributed panels: their catalog per folder, their content and their actions.
WorkspacePanelSummaryInterface#
One extension panel an app offers in a folder.
WorkspaceScopeInterface#
What a layout belongs to: a session, a folder, a draft. The kit only reads
key; an app adds what its host needs to find the record (the desktop
app's scope carries the folder whose template a new session copies).
WorkspaceTabInterface#
A tab the workspace can show. An app's own kinds are builtin: true and
render through its WorkspaceTabRegistry; builtin: false is an
extension panel whose content loads from WorkspaceHost.panels.
zidane/chat/pure's PanelTab (the desktop app's catalog) is one.
Types#
DropZoneType#
Where a drop lands on a group: into it, or a new group on one of its edges.
LayoutPatchType#
A changed layout, or a function of the layout stored right now.
LayoutStorageType#
The Storage calls createStorageLayouts makes (localStorage, sessionStorage or a double).
OpenTargetType#
Where a click opens: the editor (the OS) or the side panel.
PanelContentCacheType#
Every binding's entries, by panel id. Replaced (never mutated) on each change.
PanelNodeType#
A node of the group tree.
PanelTabMarkSourceType#
What panelTabMark reads of a tab.
PanelViewNodeType#
A node of the tree as shown.
SplitDirType#
How a split lays out its children: side by side (row) or stacked (col).
SplitSideType#
The edge a new group splits off at.
TabDropType#
Where a dragged tab is dropped: a strip (before a tab, null: at its end), or a group's body.
WorkspaceHostErrorType#
Why an extension panel call failed, for the panel to word through its labels.
WorkspaceLabelsType#
The shape of the workspace label dictionary. Some values are functions that build a string.
WorkspacePanelActionResultType#
What running a panel action answered.