Expand description
The chrome model: what a front end shows around the canvas, as values
the session builds and a View carries.
Every type here is owned and toolkit-free. The bar’s words, the status line’s fields, the history’s rows, the navigator’s tree, the selection bar’s swatch and the notices are all facts about the session, so they are read off it in one place each; what a widget adds — which panel is open, where the pointer is over the chrome, a rename box’s draft — stays with the widget.
Structs§
- Acknowledged
- The failure the user acknowledged, by its position among the failures.
- Ground
- The colours under the diagram.
- Lens
- What the lens is showing, and what the bar says about it.
- NavNode
- One block as the tree lists it, with the blocks it holds beneath it in the document’s one draw order.
- NavTree
- The navigator’s tree: every block the document holds under its top, nested as the document nests them, beside where the canvas is standing and what is selected on it.
- Notices
- What this session has owned up to and the user has not yet acknowledged: an error nobody can dismiss makes the editor unusable (docs/ui-issues.md). Dropped with the document it was about.
- Overlay
- The selection bar’s contents: the selection it stands over, and the readings of the document its controls and pickers show — the accent swatch’s colour, the accent index behind it, and the direction the I/O toggle reports.
- Reading
- Everything the status line could say, before its priority picks one.
- Scope
Path - Where the canvas is standing: the levels that reach it, outermost first, and the path that names them.
- Selection
- The selection the bar is drawn for: where it sits on screen, and how many things it holds.
- Title
Block - The status line’s second line: “the text in the lower left corner (let’s consider that the title block) should also indicate on a second line, the author, current rev, and date/time of that rev.”
- TopBar
- Everything the top bar says: the breadcrumb’s root and its levels, the undo and redo buttons’ entries, the lens, and the liveness dot.
Enums§
- Crumb
- One thing a breadcrumb draws.
- Hung
- Where a tree hangs from: the document’s own root, or its designated top.
- Liveness
- What the document’s own state is, as the dot beside its name reports it.
- Locked
- Why a document may not be written.
- Notice
- What the session has to tell the user about its document: why the canvas is read-only, what will be overwritten by the next save, and the load that did not work.
Constants§
- MAX_
SEGMENTS 🔒 - Past this many levels the breadcrumb collapses from the middle.
- SELECTION_
SEPARATOR 🔒 - What separates the levels of a selection path in the status line — the
mockup’s own
join(" / "). - TAIL_
SEGMENTS 🔒 - How many levels above the current one survive the collapse.
Functions§
- accent_
display_ role - The
Rolethe accent swatch displays fortargetgiven its current accent indexcurrent: the mapped accent role, or — when unset — the target’s own un-accented stroke. - block_
label - A block’s display label: its name, then its type, joined as
name/type, skipping an empty type. The name falls back to the block’s id (b3) when unnamed, so the label is never empty — and so a block that has left the document still names a row. - current_
accent 🔒 - The accent index
targetcarries now, orNonewhen it has none. - shared_
dir 🔒 - The one direction every pin in
pinsis facing, orNonewhere they disagree or the selection has gone.