Skip to main content

Module session

Module session 

Source
Expand description

Everything the editor is, apart from the surface it is shown on.

Session holds the document and the state derived beside it — where the editor is standing, what is selected, what one undo would take back, what the last step lit up. Every method here is a write path a front end can reach without naming a toolkit: the gesture bracket, the history walk, the command registry, and the document-scoped half of Action dispatch.

Structs§

Consequences
What the two history buttons stand over this frame: which entry each would take, and what taking it costs the log. None is an empty stack, which draws the button dead rather than hiding it.
Session
The editor, minus its surface.
Standing 🔒
Where the editor is standing, owned: the scope’s ids and the names they are spelled as. Resolving the names borrows the document index that a row’s other fields are read out of, so a call site takes this first and lends it to the attribution afterwards.
TimeMachine
A past rev on the canvas: the rev, and the log prefix folded to it.

Enums§

Diagnostic
What the frame draws over the diagram for the author’s own benefit, toggled from the palette and Off by default — this is dev tooling with no place in a diagram somebody is reading.
FrameRate
Whether the front end shows its frame-rate readout. The kernel keeps the switch, since the palette’s commands are its own; the numbers are the host’s, which is the side of the call with a clock.
NavPick
Whether a navigator pick replaces the selection or joins it.

Constants§

IMPORTED_IMAGE_CELLS 🔒
How big an imported image lands, measured in grid cells along its longer side.

Functions§

embedded_title 🔒
What an embedded document’s block is called: the file’s name without the suffixes it travelled under. engine.bwx.zip is the diagram “engine” — both extensions come off, since a container’s own name carries neither.
saturation
What a lens does to the palette: the past is drained of colour, so a rev on the canvas cannot be mistaken for the writable present.
select_shapes 🔒
The tool a set of freshly-landed shapes is left selected in.
step_label
What the record at rev is called — how the undo and redo buttons name the step they stand over.
viewed
The repo the canvas reads: the document’s own, or the prefix fold the time machine is holding. A free function over the two fields rather than a method, so the passes that also need &mut on the index, the presentation, or the gesture can still split the borrow.