The whole application-facing platform under one import. Build a tree with
the element constructors and their property records, adjust an element
with the modifiers on Elem, and answer events with the constructors on
Action: Action.none(), Action.update, Action.delegate, or Action.task.
Read one direct ordinary child file without following symbolic
links. Reads are bounded by the host and return ResourceLimit
when the file is too large for one in-memory value.
The SHA-256 digest of one direct ordinary child file, as 64
lowercase hexadecimal digits. The host streams the file without
following links, so no byte of it becomes an application value;
a file over the host's hash bound answers ResourceLimit.
Watch this directory's direct children: a child created,
removed, renamed, or written is reported by name in a Changed
wait. The watch is derived from this grant, and nothing beneath
a child directory is reported.
The shared representation behind this handle. It is the seam the
platform's own modules use to hand a directory to the host, as
Sqlite and Audio do. The representation is itself opaque, so
it grants nothing an application can act on.
An opaque, typed handle granting read access to exactly one file. It
names no directory, so it reveals no sibling, and it can be retained
in application state but not constructed by applications.
Wrap the shared representation, for the platform's own modules
that hand a file to an application, as a drop target does. An
application cannot produce the representation, so this grants
nothing.
Acquire the read-only project grant provisioned by the host. This function
does not display trusted UI; interactive hosts must source the grant from
trusted selection. Without a provisioned grant it returns AccessDenied.
Acquire a read-only grant for one file the person chooses, offering only
types. An empty list offers every file. Without trusted selection or a
provisioned file it returns AccessDenied.
What one wait on a watch resolved to. Changed reports a change; the
others end the watch, and every later wait answers the same.
Changed: what the watch covers changed. names are the names that changed since the previous wait, each once: the direct children of a watched directory that were created, removed, renamed, or written, or a watched database's own name. replaced is set when one of them may now refer to a different file, because a file was renamed over it or it was removed or created; reopen it to read what it names now. overflowed is set when more changed than a wait can name, and then names is incomplete.
Canceled: the watch was cancelled, or released, or what it watches was released.
Revoked: the grant it was derived from was withdrawn.
Gone: the watched directory itself was removed or moved away, so no later change can be reported.
An opaque, cancellable subscription to changes of a granted directory or
database. Changes are coalesced rather than queued: one wait reports every
change since the previous wait returned, once writing has paused briefly,
so a watch holds no backlog however fast its files are written. It is
derived from what it watches, so withdrawing that grant, or releasing
what it watches, ends it.
Wrap the shared representation, for the platform's own modules that
derive a watch, as Sqlite does. An application cannot produce the
representation, so this grants nothing.
One kind of file the chooser offers. extensions are written without a
leading dot, such as "rgstats"; mime_types are full types such as
"application/vnd.sqlite3". The host checks a chosen file against the
extensions of every type offered, so a file of any other extension is
refused with PickFileErr(Unsupported) whichever chooser produced it.
Why a remembered file or folder cannot be reopened, or a grant cannot
be remembered.
AccessDenied: the application may no longer read it.
Forgotten: no recent entry has this key, because it was forgotten or the list outgrew its bound.
Missing: nothing is at its place any more.
Replaced: something else is at its place now: another file renamed over it, or a folder where a file was. It is not what was chosen.
Revoked: the grant being remembered was withdrawn.
Unreadable: it could not be reached for another reason.
Unsupported: only a file or folder a person chose, dropped, or was provisioned can be remembered, not one derived from another grant.
Recent : { key : U64, name : Str, kind : [Directory, File], status : [Available, Unavailable(Unavailable)] }
One file or folder the application remembered, most recent first.
key names it for reopen_file!, reopen_directory!, and
forget_recent!, and stays the same across restarts. status is what
the host found when the list was read: whether it can be reopened now.
No path is ever part of an entry.
A colour for each appearance, 0xRRGGBB both: light on a light
window and dark on a dark one. The host chooses when it paints, so the
window follows the system, or Appearance.prefer!, without rendering the
application again.
Display a key chord, declared as a shortcut declares it (secondary-k),
in the spelling of the platform it runs on: ⌘K on macOS and ctrl-K
elsewhere, so a hint always names the keys a person presses.
Embed a renderer over a smaller part of parent state. Local updates render
this child without rebuilding siblings. get reads it; set replaces it.
Reconstructing
this unkeyed descriptor from its parent starts a fresh mounted lifetime.
Preserve a child's lifetime across parent renders and reordering using a key.
Use this when tasks or native interaction state should survive those renders.
Keys preserve the lifetime within the surviving owner and native scope.
Memoization is opt-in; its input must cover rendering and handler captures.
Display a key chord, declared as a shortcut declares it (secondary-k),
in the spelling of the platform it runs on: ⌘K on macOS and ctrl-K
elsewhere. It inherits colour and size from its container, and
with_style restyles it as it restyles text.
Handle the pointer entering an element. A button and a popover report
it themselves; any other element is wrapped in a hover region that
reports it and presents nothing.
Answer key chords anywhere in the window while elem is mounted. A
shortcut declared nearer the focused control wins over one further
out; a modal dialog leaves live only the shortcuts declared inside it.
A chord that types a character into a focused text field is text, and
Tab, Shift-Tab, and Escape belong to the host.
Move keyboard focus to the first enabled control inside elem, once for
each distinct serial: holding the same serial across later renders
leaves focus wherever a person has since moved it, and a new serial
moves it again. A serial of 0 asks for nothing.
Annotate anchor with a surface presenting content beside it. The
surface does not block the rest of the window: it opens while the pointer
rests on the anchor or keyboard focus is inside it, and Escape closes it.
Lay two panes out side by side, or one above the other, with a divider
between them that a person drags, or moves with the arrow keys while it
has keyboard focus. The size is the application's: on_resize asks for
one, and the split shows whatever size it is given next.
A strip of tabs, one of them selected, each with an optional close!
button. Selecting or closing one asks the application, which owns the
list and the selection.
Lay children out in a column that accepts files a person drops on it.
Each dropped file of an accepted type is granted to the application as
a read-only file and delivered to on_drop, with every other item
dropped named and refused. The target shows drop_bg and
drop_border while files it would accept are dragged over it.
Present count fixed-height rows, building each with render_row only
while it is near the viewport. The list is its own render boundary: when
scrolling brings unbuilt rows near, the platform renders the list alone,
from the renderer's most recent render_row, without rendering its owner.
The boundary is transparent, so an action raised by a row or by
on_range belongs to the list's owner, exactly as if the rows had been
built there.
Adapt a persistent keyed sequence into a native column. Every item is a
component boundary owned by its complete Key; item actions project by key,
so reordering never changes their target and removal cannot recreate one.
Connect a child renderer to parent state and give it a stable lifetime.
Start with key, get, and set; add policies only when needed.
get reads the child; set replaces it while preserving other parent data.
on_delegate receives the proposed parent and defaults to Action.update;
returning Action.none() rejects the whole proposal. memo defaults to None.
A comparator receives saved and incoming child states: True promises that
both the rendered UI and captured handlers remain equivalent. Retaining
that comparison snapshot can require cloning during subsequent updates.
Connect a removable child by stable identity, not a captured list position.
Omit the element when the child is already absent.
get and set return Err(Removed) when the projection no longer exists.
A rejected setter discards the whole action before delegation or task launch.
Preserve unrelated parent data and never recreate a removed child in set.
on_delegate and memo follow the same contracts as TranslateConfig.
Project : parent, (Try(child, [Removed]) -> Work) -> Work
Where a popover's surface sits against its anchor: over it, under it,
before it, or after it. The surface moves to the opposite side when the
window has no room for it on the one asked for.
Platform representation of a popover. Its first child is the anchor and
any others are the surface's content. A popover with no content is a
region of its anchor: it reports the pointer entering and leaving it,
answers its keyboard shortcuts, and asks for focus, and presents nothing.
A key chord and what pressing it does. keys names modifiers and a key
joined by -, such as ctrl-k, shift-down, or secondary-s, where
secondary is Ctrl on Linux and Windows and Cmd on macOS.
Platform representation of a split: its two panes are its children, and
it draws the divider between them. It carries the sized pane's extent,
its bounds, and whether it may and does collapse, so the host can turn a
drag into the size it asks for, and the keys its divider answers while
the divider holds keyboard focus. style dresses the divider: bg and
its hover, pressed, and focus colours; its size fields size the split.
Platform representation of a drop target: a column whose children are
laid out as col lays them out, which accepts files dropped on it. It
carries the file types it accepts, the colours it shows while files it
would accept are dragged over it, and the handler a drop is delivered
to.
Platform representation of a viewport-driven, fixed-height list. A list
built by virtual_list carries its rows in items; one built by
virtual_rows carries a provider instead and no items.
Where a list places a row it is asked to bring into view: at the leading
edge, in the middle, at the trailing edge, or wherever moves it least —
not at all when the row is already in view.
A request to bring row into view at align. The list moves once for
each distinct serial: holding the same request across later renders
leaves a person's own scrolling alone, and a new serial moves the list
again, even to the same row.
:= { key : U64, label : Str, x : I32, y : I32, width : U32, value : Str, color : Color, size : U32 ?? 12, align : CanvasTextAlign ?? Start }
A single line of text set in the box from x to x + width, with its
top at y and a line size * 5 / 4 pixels tall. align places the
text within the box; text wider than the box is not clipped. Text is
painted but never hit-tested, so a label drawn over a shape leaves the
shape as the pointer's target.
Platform representation of a native retained canvas. Coordinates are
integer logical pixels, which makes semantic gestures and deterministic
rendering agree.
Platform representation of text set in its own colour, size, weight, and
face. Only the typographic fields of style apply to a string. spans
is empty for text of one style; otherwise value is the spans' texts in
order, and each span restyles its own part of it.
Properties for popover. label is the surface's stable semantic name,
its locator as a tooltip. The surface opens delay_ms after the pointer
comes to rest on the anchor, and at once when keyboard focus enters the
anchor; it closes when both have left, or on Escape. The style fields
dress the surface, never the anchor.
:= {
label : Str,
axis : SplitAxis ?? Horizontal,
side : SplitSide ?? Start,
size : U32,
min : U32 ?? 0,
max : U32 ?? 16384,
step : U32 ?? 16,
collapsible : Bool ?? False,
collapsed : Bool ?? False,
on_resize : a, Resize => Action(a),
thickness : U32 ?? 6,
color : Color ?? Rgb(0x2a3a40),
hover_color : Color ?? Rgb(0x48666b),
active_color : Color ?? Rgb(0x5fb3a1),
focus_color : Color ?? Default,
width : Length ?? Fill,
height : Length ?? Fill,
grow : Bool ?? True,
}
Properties for split. label names the divider, its locator as a
separator. size is the extent in logical pixels of the pane on side,
held by the application and kept within min and max; the other pane
takes the rest. Dragging the divider, or the arrow keys while it has
keyboard focus, ask for a new size through on_resize, step pixels a
key. Home and End ask for the bounds. A collapsible pane is hidden
while collapsed, and stays mounted with its state: Enter on the
divider toggles it, and a drag that leaves less than half of min asks
for it.
:= {
label : Str,
tabs : List(TabItem),
selected : Str,
on_select : a, Tab => Action(a),
on_close : a, Tab => Action(a),
width : Length ?? Fill,
gap : U32 ?? 2,
font_size : U32 ?? 13,
font_face : FontFace ?? Default,
max_tab_width : U32 ?? 220,
fg : Color ?? Rgb(0x9fb0ad),
selected_fg : Color ?? Rgb(0xeeeeea),
bg : Color ?? Default,
selected_bg : Color ?? Rgb(0x1b2a30),
hover_bg : Color ?? Rgb(0x16242a),
accent : Color ?? Rgb(0x5fb3a1),
border_color : Color ?? Rgb(0x2a3a40),
focus_color : Color ?? Default,
}
Properties for tabs. label names the strip. Each tab is a control
named by its title; selected is the key of the tab shown as chosen.
Pressing a tab, or Left, Right, Home, and End while keyboard focus is in
the strip, choose one through on_select; a closable tab's close
button, or Delete, ask to close it through on_close.
Properties for drop_target. label names the target, its locator as a
drop target. types are the kinds of file it accepts, as pick_file!
offers them; an empty list accepts every file. on_drop receives the
files a person drops on it, each granted to the application as a
read-only file, and names everything else that was dropped. While files
it would accept are dragged over it, its ground becomes drop_bg and
its border drop_border. The remaining fields lay it out as col does.
Properties for action_button. caption is visible text and label is
its stable semantic name. Disabled buttons remain visible but cannot be
focused or dispatch presses. Visual fields use the same native style
vocabulary as layout controls.
Properties for a controlled single-line text field. label is its stable
semantic and accessibility name, value is authoritative application
state, and placeholder is an empty-field hint. Committed edits deliver
the complete value to on_change; Enter delivers it to on_submit.
Properties for a fixed-height list of count rows produced on demand.
render_row is called only for the rows near the viewport, so the cost
of a render follows the rows on screen rather than count.
Properties for checkbox. label is both visible text and the stable
semantic name used by specifications. on_change receives the requested
checked state. The common visual fields mirror Style.Style; defaults let a
record literal name only the properties it changes.
Properties for a controlled multiline editor. label is its stable
semantic name. value remains application-owned; every edit delivers the
complete requested value to on_input. Read-only editors expose and scroll
text without dispatching edits.
Properties for an encoded in-memory image. Bytes come from explicit
application data or a capability operation; the host never resolves a
path or URL. label is the stable semantic name.
Properties for styled_text. A string is the only thing a typographic
step is about, so these are the type fields alone: a typographic step
costs no container, and none of a container's layout is implied.
Platform action rendering the originating boundary again against the
state it already has. Its ancestors' memo snapshots stay valid, because
no state changed; only the boundary's own render inputs from the host did.
Propose a child state to the nearest translation's parent policy.
The policy may accept, revise, or reject the whole proposed change.
task : { pending : a, run : () => result, resolve : a, result -> Action(a) } -> Action(a)
Accept pending before running run on a worker. resolve receives the
state immediately before completion (prev_state) and the worker result.
Capture only the request data needed by run; derive the completion action
from prev_state so intervening edits survive. Removing the owning component
cancels the task: its completion is never delivered, and a capability wait
it is blocked in is interrupted.
keyed_task : { key : Str, pending : a, run : () => result, resolve : a, result -> Action(a) } -> Action(a)
A task that supersedes the owning component's previous task with the same
non-empty key. The superseded task is cancelled: its completion is never
delivered, a query, watch, or timer wait it is blocked in is interrupted,
and if it has not started it never runs. Keys are scoped to the component
that accepts the task, so two components may use the same key.
Install state and cancel the owning component's task with this key,
as a newer task with that key would. Cancelling a key with no task in
flight only installs state.
The authority this application was started with. Every acquisition takes
one, and there is no way to produce one, so an application holds exactly
the authority it was handed and a library holds exactly what it was
passed.
Keep it in your state if you acquire anything after the first frame; task
closures need it where they run.
Initial application data, renderer, optional native window properties,
and what the application does as its window opens.
init takes the application's authority rather than being a plain value,
because that is the only place it can enter an application from.
on_open runs once, after the first state is shown and before any
input, exactly as an event handler runs: it may act, and the action it
returns is applied. It is how an application acquires what its first
screen shows, such as the files it remembered, without waiting for a
person to ask.
Acquire the read-only project grant provisioned by the host. This does
not display trusted UI; interactive hosts source the grant from trusted
selection. Without a provisioned grant it returns AccessDenied.
Acquire a read-only grant for one file the person chooses in the
operating system's file chooser, offering only types. Canceling is
Ok(Canceled). The handle reads that file and nothing beside it.
The files and folders this application remembered, most recent first,
each checked now against what is at its place. The host keeps the list,
outside the application's own storage, so it survives a restart.
Reopen a remembered file as a new read-only grant. The host first checks
that the file at its place is still the one remembered, and answers why
not when it is missing, replaced, or no longer readable.
Remember a file a person chose or dropped, so a later run can reopen it
from recent! without asking again. Only the application's root may
remember: a library handed the file can read it, but not keep it.
A stable name for a component across parent renders and reordering.
Use a string literal for a fixed component and id for a collection entry.
Keys must be unique within the same owner and container scope. Keep the key
attached to the logical item, rather than its position in a list.
A persistent collection addressed by stable U64 identifiers. Use ordinary
lists for small collections; use an Index when replacing one entry in a large,
shared collection would otherwise copy the list. Keep display order separately.
Missing entries return Err(Missing). Older versions remain readable.
A change copies
at most sixteen radix branches, irrespective of unrelated live entries.
Leaves retain the remaining key bits and split only when keys collide;
distinct entries do not each need a sixteen-level chain of unary branches.
Keep branch children boxed so list elements remain pointer-sized. Storing the
recursive union inline makes persistent branch updates copy substantially
more data; nested-hover-grid/specs/reset-1000.scm guards this scaling path.
set_raw : KeyedSeq(value), Key, value -> Try(KeyedSeq(value), Error)
set_local : KeyedSeq(value), Key, value -> Try(KeyedSeq(value), Error)
Replace an item's value for an already-mounted item boundary without
publishing a container edit. The boundary update itself owns rendering;
structural delegates publish their complete transaction separately.
set : KeyedSeq(value), Key, value -> Try(KeyedSeq(value), Error)
Set is item-local (zero structural visits) but remains journaled so a
retained keyed child can receive its replacement value.
Common visual properties. A zero value for font_size or font_weight
selects the native default, and a non-zero font_weight is 100 through
900; hover_bg and active_bg apply during pointer interaction. A
non-zero shadow is the blur radius of a soft drop shadow, offset down
the surface by shadow_y and painted in shadow_color at
shadow_alpha percent; shadow: 0 paints none.
A native color, or the control's platform default. A colour is written as a
0xRRGGBB literal. An adaptive colour is a pair the host chooses between by
the window's appearance, light or dark, each time it paints, so a change of
appearance repaints without rendering the application again.
The system's appearance: whether it asks for a light or a dark scheme, and
whether it asks for reduced motion. Adaptive colours follow the scheme
without any of this; read it when an application decides something by it,
such as whether to animate.
Wait until the system's appearance differs from known and return it.
Call from Action.task, with a key so a newer wait supersedes it:
cancelling the task interrupts the wait, which then returns known.
Resolve adaptive colours by preference from now on. The window
repaints with the scheme it names; the application does not render
again. The choice lasts until the next prefer!, not across launches.
Root the store at a directory beside the executable. This is the
packaged-application choice: the artwork travels with the program, so
the store resolves the same way however the program was launched.
path is relative to the executable's directory and may not escape it.
Root the store at a directory relative to the process working directory.
This is what running an application from a project checkout wants: the
root follows the shell rather than the executable. path is relative to
the working directory and may not escape it.
Root the store at the content directory the host provisioned for this
application. This is the installed-layout choice, where the artwork lives
apart from the program. The application names no path: an asset store is
never a way to reach a directory the host did not hand it. Without a
provisioned content directory the open reports AccessDenied.
Require this store's roc-assets.manifest to match an expectation.
The comparison is against the manifest's own declarations. Nothing walks
or hashes the files beneath the root, so opening a store costs the same
whether it holds one asset or ten thousand.
Open the store a config describes, checking its manifest if one was
required. Call it from Action.task; it blocks on the disk.
InvalidRoot is a root path this host will not accept -- an absolute
path, one holding a NUL, or a relative form that escapes its base.
NotFound, NotDirectory, and AccessDenied describe the root itself.
ManifestMissing, ManifestUnreadable, and ManifestMalformed describe
a required manifest that is absent, unreadable, or not a manifest.
AssetSetMismatch, SchemaMismatch, ContentVersionMismatch, and
ContentHashMismatch are the four comparisons that can disagree.
InvalidExpectation is an expectation this host cannot use, such as a
Sha256 string that is not 64 hexadecimal characters.
An opened asset store: an opaque handle to one directory the host holds
open. Every read is made through that handle rather than through the
process working directory, which the host never changes.
The resource-free store value, for pure tests. It lets an application
that keeps a store in its state write that state down in an expect.
Reads through it fail; it proves nothing about asset resolution.
Read one asset's bytes, relative to the store's root. Call it from
Action.task; it blocks on the disk.
path may name a file in a subdirectory, written with /
separators. InvalidName is a path that is absolute, empty, holds a
NUL, or contains a . or .. component, and is answered before any
file is touched. NotFound is no such file beneath the root,
Unsupported is an entry that is a symbolic link or is not a regular
file, and ResourceLimit is a file larger than the host reads into
one value.
Where a store's root is. The three choices are separate names because
moving an executable, changing the working directory, and installing
content apart from the program are three different events, and none of
them may silently change what another one means.
What content a manifest must declare. AnyContent leaves it open, which
is what a directory of loose files under development wants. Sha256
carries the 64-character lowercase hexadecimal digest the manifest must
declare.
What a required manifest has to say: which asset set it describes, which
schema version it was written to, which content version it is, and which
content it declares.
Whether opening a store reads the roc-assets.manifest file at its root.
IgnoreManifest does not look. RequireManifest fails the open unless
the manifest is present and agrees with the expectation, so a
half-updated or mismatched asset set is reported at startup instead of
surfacing much later as one image that will not draw.
Where a store's root is and whether its manifest is checked. Build one
with beside_executable, working_directory, or content_directory,
and add an expectation with with_manifest.
Open a direct child database in place as a read-only connection. The
connection reads the file where it lies, including a write-ahead log a
writer is still appending to. The directory authority is consumed
normally and may be retained by application state through Roc reference
counting.
Open a granted file in place as a read-only connection, exactly as
open_read! opens a directory's child. The connection is derived from
the file grant, so withdrawing the file withdraws the connection.
Execute one read-only statement and return typed cells. Query text,
result dimensions, and aggregate value bytes are bounded by the host;
a result longer than the row limit is a ResourceLimit.
Execute one read-only statement with its ? placeholders bound, in
order, to params. Values are bound, never spliced into the text, and
the count must match the statement's placeholders.
Execute one read-only statement with bound parameters and return at
most rows rows, from 1 to the row limit. more reports whether the
result continues past the page; the next page is asked for with a
keyset or LIMIT/OFFSET bound as parameters.
Watch the database this connection reads: its file and its
write-ahead log. A committed write by any writer is a Modified
change, and a file renamed over the database's name, or the name
removed, is Replaced; the connection still reads the file it
opened, so a replaced database is read by opening it again. The
watch is derived from this connection, so withdrawing the grant the
database was opened through ends it.
Create a periodic subscription. The interval is 1..60,000 milliseconds.
Exactly one next! call may wait at a time, so backpressure is bounded
without buffering ticks.
Enter on a single-line text field, carrying its current value.
CanvasPointer : {
phase : [Begin, Move, End],
x : I32,
y : I32,
target : [None, Some(U64)],
}
A direct-manipulation gesture in canvas coordinates. target is the
topmost keyed primitive under the initial press and remains stable for the
gesture; an empty point uses None.
CanvasHover : {
phase : [Move, Leave],
x : I32,
y : I32,
target : [None, Some(U64)],
}
Pointer movement over a canvas with no button pressed, in canvas
coordinates. Move carries the topmost keyed shape under the pointer;
Leave is delivered once when the pointer leaves the canvas, with the
last point it was seen at. A pressed pointer is a CanvasPointer
gesture instead, so hovering never interrupts a drag.
One wheel or trackpad scroll over a canvas. dx and dy are the
scroll distance in logical pixels, positive towards the content's end;
a wheel that reports lines is converted at the platform's line height.
x, y, and target locate the pointer as for CanvasHover.
The size in logical pixels a canvas was laid out at: the surface its
primitives are drawn on, inside any border. Delivered once for each
size, after a drawn frame gives the canvas one it has not reported.
A key chord that matched a shortcut. keys is the chord in the host's
canonical spelling, such as ctrl-shift-k: modifiers in a fixed order,
then the key, whatever spelling the shortcut was declared with.
The rows of a virtual list that intersect its viewport, as the half-open
range start up to but not including end. Delivered when that range
changes, so an application can page in the data those rows show.
A split pane's requested extent: the size in logical pixels of the pane
the split sizes, within its minimum and maximum, and whether that pane
is collapsed. A collapsed pane keeps size to return to.
A tab chosen or closed in a tab strip, named by the key it was given.
Drop : { files : List(FileSelection), refused : List(Refused) }
Files a person dropped on a drop target. files holds each dropped
file of a type the target accepts, in the order they were dropped,
granted to the application as a read-only file exactly as pick_file!
grants a chosen one. refused names every other item dropped, and why
it was not granted: a folder or anything else that is not an ordinary
file, a file of a type the target does not accept, a file the
application may not read, or one that could not be reached.
Connect a child renderer to parent state and give it a stable lifetime.
Start with key, get, and set; add policies only when needed.
get reads the child; set replaces it while preserving other parent data.
on_delegate receives the proposed parent and defaults to Action.update;
returning Action.none() rejects the whole proposal. memo defaults to None.
A comparator receives saved and incoming child states: True promises that
both the rendered UI and captured handlers remain equivalent. Retaining
that comparison snapshot can require cloning during subsequent updates.
Connect a removable child by stable identity, not a captured list position.
Omit the element when the child is already absent.
get and set return Err(Removed) when the projection no longer exists.
A rejected setter discards the whole action before delegation or task launch.
Preserve unrelated parent data and never recreate a removed child in set.
on_delegate and memo follow the same contracts as TranslateConfig.
Adapt a persistent keyed sequence into a native column. Every item is a
component boundary owned by its complete Key; item actions project by key,
so reordering never changes their target and removal cannot recreate one.
:= { key : U64, label : Str, x : I32, y : I32, width : U32, value : Str, color : Color, size : U32 ?? 12, align : CanvasTextAlign ?? Start }
A single line of text set in the box from x to x + width, with its
top at y and a line size * 5 / 4 pixels tall. align places the
text within the box; text wider than the box is not clipped. Text is
painted but never hit-tested, so a label drawn over a shape leaves the
shape as the pointer's target.