Skip to main content

Module commands

Module commands 

Source
Expand description

The command registry: every invocable operation as a Command — a stable CommandId, a user-facing label, and the Act invoking it performs — computed against the current selection and mode by CommandSet::available. The overlays render the set instead of re-deriving availability, so “what can the user do right now” is encoded exactly once; the planned command palette, keyboard shortcuts, and the script command step consume the same set.

The registry answers permission and target, never flow: an Act::Effect says which picker or dialog the shell is to run and on what, and nothing about the steps of it passes through the core.

Toggle pairs (lock/unlock, hide/show tags) are distinct ids: the direction that doesn’t apply is simply absent, so a consumer can never invoke the wrong half.

Structs§

Command
One available operation: its identity, the label/hover text a view shows, and what invoking it does.
CommandContext
Everything CommandSet::available resolves availability against.
CommandSet
The frame’s available commands, in the canonical presentation order the selection overlay renders them in.
History
What the undo/redo controls stand over this frame: which entry each would take, and of which of the two kinds. None is an empty stack — the button draws dead rather than vanishing.

Enums§

Act
What invoking a command does. The registry answers permission — which commands this frame offers, and on what target — and never scripts a flow: what the core executes it hands to the core, and what the shell performs itself it hands back untouched.
CommandId
Stable identity of one invocable operation.
Effect
An effect the front end performs: a picker window, a platform dialog, a download, a document door. Each carries everything the front end needs to run it, and the front end owns every substate of the flow it opens — what a cancel means included — sending what the flow ended in back as an ordinary Action.
ExportFormat
The export formats offered in the toolbar.
ExportScope
Which surface a format list is offered on. The whole view exports the document, so it can carry the scope hierarchy PDF is made of; a selection is an excerpt of shapes with no hierarchy to navigate, so PDF is not offered there. The two lists live here rather than at the menus, so the registry and the menus cannot offer different formats.
Heading
The way an arrow key points.
Precedence
Which of a selection’s controls come first in the overlay: the selected thing’s own verbs, then the clerical ones every selection has.
Rendered
Whether a command appears as a control, or only answers to its name.
ScriptedApply
What became of an Act offered to apply_scripted: applied against the drawing — carrying the tool the arm settles on, where it settles one — handed back because it needs app machinery (clipboard, the undo stack, navigation, the lens), or not a document edit at all.

Constants§

ACCENTS
The accent target a selection maps to, or None for selections that carry no accent (an image/icon shape, a multi-selection, or a pin group — the picker targets one role-bearing object). The accent picker’s cells: “no accent” plus the eight numbered ones, in the order they are drawn, each as the command that sets it — so accent-3 on screen and accent-3 in a script name one colour, and a picker cannot offer a tenth colour the registry cannot be told about.
BINDINGS
The chord → command bindings, one table: the app’s shortcut pass consumes it and the views print it (tool-band hover text, palette rows), so a chord can never disagree with what it dispatches. Toolbar arming, the camera and the history; selection verbs join here when they earn chords.
PIN_DIRS
The I/O picker’s cells, on the same terms as ACCENTS: an arrow arriving, one arriving and leaving, one leaving — the order a picker lays them out in, which is also the order they read in.

Functions§

apply_scripted
Apply the document-scoped subset of Act — the arms that write nothing but the drawing. The app’s dispatcher routes these same arms here, so a scripted session and a live one cannot drift. The gesture the caller opened owns the sealing: every write lands in its sink, and the solve rider re-routes what these arms disturbed.
apply_transition
apply_scripted for what a tool’s own frame asks for. A hand-off to a seeded tool passes the same arming gate an Action::Arm does.
arm_available 🔒
Whether arming tool is currently allowed: adding a port inside a locked block is the one refusal — the viewed interface is frozen. Private because the views ask the resolved CommandSet instead, so a control and the command behind it cannot disagree.
armed 🔒
The last gate on arming: a read-only session refuses a tool whose whole purpose is to write, whichever door asked for it — a chord, a script’s command step, or another tool handing off.
band_act 🔒
And what invoking it does.
band_command
The command one cell of the rail invokes. Every cell but the image arms its tool; there is no image tool — artwork is picked and then placed, and the picker is the shell’s — so that cell asks for the artwork instead. Read by the rail, the registry and the chord table, so the three cannot disagree about what a cell does.
bare 🔒
A bare key, no modifier — how the tool band’s digits and the arrows are pressed.
binding
The chord bound to id, if any — for the views that print one.
chord 🔒
The chord for key with the platform command modifier.
chords
Every chord bound to id, in table order — for the views that print them all, so a tool with two keys advertises both.
delete_blocked_by_lock 🔒
Whether the Delete/Cut controls are withheld because the selection is a locked pin/port interface: any selected child-block pin whose owner is locked, or a boundary port of a locked current block.
in_overlay
Whether the selection overlay draws a control for id.
io_pins 🔒
The pin anchors an I/O-style change would retype, or None for selections with no pins to retype. A pin or pin group maps to its anchors directly; a boundary port maps to its single port pin.
role_target 🔒
shifted 🔒
The command modifier with Shift — how a chord’s opposite is pressed.