The workbench and docks
The workbench (shell-dock.js) manages three tabbed docks, with resizing, drag-and-drop between zones and persistence. It installs itself on DOM ready, sets the shell.ready key, and then exposes K.shell.
Zones
| Zone | Key | Default size | Typical use |
|---|---|---|---|
| Left dock | left | 280 px | Navigation: files, database browser |
| Right dock | right | 340 px | Context: history, assistant, dashboard |
| Bottom dock | bottom | 260 px | Output: journal, problems, consoles |
Registering a panel
| Field | Required | Description |
|---|---|---|
| id | Yes | Throws if missing. The workbench automatically creates the <id>.toggle command, category panneau. |
| dock | Yes | Throws if the zone is unknown. It is the default zone: the user may move the panel elsewhere. |
| title | Yes | FR and EN labels, reused in the tab and in the toggle command. |
| factory | Yes | Called on first open. An exception shows Panneau indisponible without breaking the dock. |
| source | No | core by default. |
| icon | No | Inline SVG, using currentColor so it follows the active theme tokens. |
The factory context
| Member | Description |
|---|---|
| ctx.panelId | The panel identifier. |
| ctx.root | Root DOM element, already inserted in the dock body. |
| ctx.state | The persisted state, or null. A property, not a function. |
| ctx.saveState(o) | Persists a serialisable object. Write is debounced. |
| ctx.close() | Closes the panel from the inside. |
The factory returns a controller whose dispose() is called on close, on move, and on every navigation.
Persistence and lifecycle
The layout is stored under isofind_shell_v1 and is not per-page: a panel opened on the dashboard is still open after navigating to Samples, but it has been destroyed and rebuilt. The illusion of permanence rests entirely on ctx.saveState().
Moving a panel
A tab can be dragged from one dock to another. Closed docks open during the drag, and the panel is destroyed and rebuilt on arrival: its instance lives inside its dock body, and reattaching it elsewhere without rebuilding would leave a panel whose rendering context no longer matches its parent.
A panel dragged back to its declared zone leaves no entry in the state: otherwise a saved layout would grow indefinitely with choices that are no longer choices.
Snapshot and restore
restore() destroys all live panels before rewriting the state, not after: they are children of the dock they are in today, and the next render would look for them where the layout places them, never removing them from their old parent.
Resetting
K.shell.reset(), or View › Reset layout, returns every panel to the zone its author declared and closes everything. It is the way out when a layout becomes unusable: a panel moved into a dock that is then collapsed cannot be found again except through the palette.
The four hosts of a panel
Since V2.0 the dock is no longer the only place a panel can live. The same panel, with the same factory contract, is displayed indifferently in a dock, in a tab of the central zone, in a floating window laid over the application, or in a separate system window.
| Host | File | What it adds |
|---|---|---|
| Dock | shell-dock.js | The three zones described above, tabbed and resizable. |
| Central zone | zone-centrale.js | A tab, splittable and pinnable, for panels that need width. |
| Floating window | shell-flottant.js | A movable, resizable window inside the application frame. |
| Detached window | shell-detach.js | A system window, for a second screen. |
K.shell.placer acts as the single arbiter: it closes the panel wherever it currently is before opening it elsewhere, so two live instances of the same panel never coexist. The surfaces, the drop gestures and the detachable flag are covered on Surfaces and windows.