Commit Graph
5966 Commits
Author SHA1 Message Date
aiongg b9c91aa76f craft-ui: a moved replay places content and registrations where a run there would
Three causes of replays that differ from a run at the new place:
- the clip a member joins its arena through, and the clip of its over parts, are clips (shift::Clip): a replay cut by
  the view takes the view's clip, as a run there does;
- a view that replays moved inside a run is kept in that run's journal at its new place;
- a scrolling body moves its content by whole physical pixels on steps of egui's UI rounding, and a kept run moves
  only by such a step (lazy::keeps_placement): paint snaps to the pixel grid, so a record moved by a fraction of a
  pixel would not be where a run puts it.
Trials (audit on): a fractional wheel step, a card scrolled partly out of view, a view replayed moved inside a run.
2026-11-20 08:28:54 +00:00
aiongg 018c7ee94c tests: a hidden page is measured once in each pass
Pages measures each hidden page once per pass (the page closure reads data the framework does not track), so a
settled frame measures it again and an edit read earlier in the pass measures it in both passes. The trials assert
that rule and that the pages take the new size in the frame of the edit.
2026-11-20 08:28:54 +00:00
aiongg e69f80e8a3 gallery tests: a story value edit runs its card in the frame of the edit 2026-11-20 08:04:20 +00:00
aiongg 0033d0c7b3 craft-ui: a kept run replays only on the font atlas it ran on
egui clears the font atlas when it fills up and rebuilds it for new text options; a kept galley's glyphs then name
other glyphs. lazy::Place holds the atlas generation (egui Fonts::atlas_generation, aiongg/egui memo-atlas-generation
dd086c7f29), so the one rule for kept paint covers it. Trial: a settled view runs after the atlas is rebuilt.
2026-11-20 08:04:19 +00:00
aiongg 417460a887 tracked: two Tracked values are equal when what they hold is
The mock's document holds a Tracked view and stays a story value, which compares by value.
2026-11-20 08:04:19 +00:00
aiongg 22835c7cf2 stories: format the scripted binds 2026-11-20 08:04:18 +00:00
aiongg 07bc5387be gallery mock: the document's view is Tracked
The canvas, the Navigator and the status bar's zoom show and edit it, so they bind it by its source.
2026-11-20 07:43:21 +00:00
aiongg 13764666ac stories: bind story values through StoryData::bind
Scripted: Bind::bound(data.value(..)) becomes data.bind(..) and Bind::bound(data.ranged(..)) data.bind_ranged(..).
2026-11-20 07:43:21 +00:00
aiongg 906be95f25 craft-ui: kept records hold no read of a place by address; Tracked bindings key by source
A place's address names it in its pass only: a record kept for a later pass (a memoized view's) keeps no
BindKey::Place read and its replay notes none, while a measure-only record used within its pass keeps them.
State more than one part shows or edits is Tracked: a bind_tracked! binding keys by the value's source and the
field's offset (BindKey::Tracked), in its read, its edit and its memo key, so a replay in a later pass re-notes the
read and an edit later in the pass reruns it. StoryData::bind binds a story value the same way, and the Properties
editor binds and notes its edits through it. The memo_settled reader and editor share a Tracked value.
2026-11-20 07:42:50 +00:00
aiongg ae4c4b0679 tests: format 2026-11-20 07:35:33 +00:00
aiongg 5098b0e3ea tests: drop the overflow trial that a bar trial already guards
bars::overflow::a_bar_too_short_for_its_members_takes_the_wheel_from_its_first_frame fails without the real run's
extent; the scroll trial passed with or without it.
2026-11-20 07:31:57 +00:00
aiongg 8af8aeffad craft-ui: a record's journal holds what its real run registered, not its measuring runs
A body inside a memoized view measures only in some passes, and what a measuring run hands forward lives in the
body's kept transcript. The journal took those entries too, so a replay added a measuring sweep's registrations in a
pass that measured nothing. Trial: a view whose body measured in its run replays as a run with the audit on.
2026-11-20 07:31:57 +00:00
aiongg afbb2d66b0 craft-ui: a number field whose value is not finite has no numeric value in its node
It shows the dash, as a mixed field does. A NaN numeric value also never equals itself in a node comparison.
2026-11-20 07:31:57 +00:00
aiongg d5ea6a0e53 craft-ui: a memoized view's run in a pass egui will discard keeps no record
egui paints nothing of a pass it will discard (Painter::is_visible is false in it), so a run there registers invisible
widgets and no nodes; a shown pass's replay of that record lacked them. The kept record stays the last shown pass's, a
settled view still replays in such a pass, and the replay audit skips it. Trial: a settled view replays through a
discarded pass, and new props there run the view again in the shown pass.
2026-11-20 07:31:57 +00:00
aiongg c3c1ef70ad craft-ui: a scrolling body's measuring run lays its content out beside the bars, and again at full view when it fits
The first sweep takes the view an overflowing body shows; content that fits leaves another view, so the sweep is
taken back through the draft journal (lazy-store writes included) and runs once more there. The body's measure no
longer keys on the last pass's extent. Trials: the first frame lays content out at the settled width, and an
overflowing body's settled memoized children run no measuring run when the body measures again.
2026-11-20 07:13:24 +00:00
aiongg d368d684c9 tests: a bar member's shown part is its interact rect
A member the bar cuts keeps its whole rect as its response rect; the part
the bar shows is the rect egui senses it in.
2026-11-20 06:19:22 +00:00
aiongg f43fb4e2c2 craft-ui: a root's egui widget takes its whole rect and egui clips its interact rect
As egui's own widgets do (Response::rect and interact_rect): a root its
clip cuts reports and reveals where it is, and egui's hit test uses the
part inside the clip. Widening a widget's sense checks its interact
rect; a secondary release opens a press opener only inside it.
2026-11-20 06:08:46 +00:00
aiongg 16952f629e tests: a tab strip places its tabs by their measure in its first frame, and reports the rects it places
The frame-0 trial uses a panel strip too narrow for its tabs that takes
its measured height, so it fails without the measure ahead. The report
trial checks tab_rects in the frame a title changes.
2026-11-20 06:08:46 +00:00
aiongg 71a764ab94 craft-ui: a collection takes its rows' measure ahead in the run that measures them
The measure ahead ran the row measure as a measuring run and set the
layout inside it, so a layout that reports its placement only outside
measuring runs (the tab strip's report: tab rects, hidden tabs, the
overflow button) kept the placement from before the measure in a pass
with no measuring run. The layout now takes the results after the
measure, in the run that called it.

The docking trial checks that a label too long for its group moves the
group's other tab to the overflow menu in the frame of the change.
2026-11-20 06:08:46 +00:00
aiongg 5ed60e5564 craft-ui: a record's clip with no area is Rect::NOTHING
A cut member's shapes record an empty clip that came about in different ways in
different passes; one clip passes nothing.
2026-11-20 05:38:29 +00:00
aiongg 2b3f149afe craft-ui: a record journals each read once
The reads are a set to what reads them. A run that measures a component again (a kept
transcript's check) reads nothing new, so its journal no longer depends on how many
times the pass measured.
2026-11-20 05:38:29 +00:00
aiongg 6b634df42e craft-ui: a scrolling body's real run decides its scroll from the content this pass measured
The measuring run records the content's extent, and the real run takes it at step 5:
whether the content overflows (the wheel, the bars, the strips) and how far it
scrolls. A bar too short for its members takes the wheel from its first frame.
2026-11-20 05:38:29 +00:00
aiongg 19b53c5edd tests: a root's widgets sense what its members sense in the same pass 2026-11-20 05:17:28 +00:00
aiongg 4953aafdf9 craft-ui: a root's widgets take this pass's member senses once its body has run
Step 8 registers the root's own sense and its parts'. After paint_over, every member
of its arena has joined, and the root's widget and its transformed body's forwarding
widget take the members' senses (egui ORs the sense of a widget registered again in a
pass). A press's untargeted check reads the root widget's sense from the pass egui's
targets come from. The union of last pass's members goes.
2026-11-20 04:58:01 +00:00
aiongg eb8ac21eda tests: a label change runs its tab row once; a reveal measures again the rows the lead moves between
The tab row measures the new label before it places its tabs, so the
frame runs one pass and no discard pass runs the row again. A row whose
measured state the pass changes after step 5 measured it is measured
again with its new state.
2026-11-20 04:33:13 +00:00
aiongg 49f60f8a12 craft-ui: a collection's measure ahead is its own content, as its largest-row probe is
The rows' measure at step 5 runs under a layout memory boundary: no
transcript around takes its records, so a body's kept transcript serves
a settled frame as it did before the rows were measured there.
2026-11-20 04:33:13 +00:00
aiongg 247860db6d craft-ui: a roving group's owner writes its members' set positions
A member that gives no place of its own marks its stop at its report;
the group's owner, at its report after its body ran, writes each marked
member's position and set size from this pass's members. The mark is on
the stop record, so a replayed member carries it. Nothing reads last
pass's stops for a set position.
2026-11-20 04:16:58 +00:00
aiongg 6432fde0ec craft-ui: a collection measures its rows in view before it sizes itself
Step 5 measures the auto rows in the view the collection takes that this
pass has not measured, widths first, then heights, and sizes and places
the rows by that measure. The measuring run and the real run of a pass
share one measure through the pass stamp on the lazy store's row entry;
the content step measures only the rows it brings in itself and the rows
whose measured state this pass's input changed, and a size other than
the one the pass placed by asks for the frame's discard pass.

The row env and the row state known before input are one function each,
shared by the measure and the content step. ItemCx documents the
row-hook contract.
2026-11-20 04:16:58 +00:00
aiongg 910a14280f craft-ui: a component joins its body's roving group in the pass it says so
Stops register after update, which calls Cx::join_roving, so a stop and its focusable parts are in the body's
roving group from the first pass that shows them. Membership is a field of the pass (roving_member), read by the
stops and the report step; the pass-stamped join slots in egui memory (join_group, member_group, join_part_group,
part_group) go. testing::focus::pass_stop_groups reads what the running pass registered.
2026-11-20 00:11:15 +00:00
aiongg cfb62ec86f craft-ui: the layout memory a run keeps is a record fact, not journal entries
A run notes each layout memory entry and kept transcript it keeps (replay::note_layout_keep, from read, record,
end_measure and kept_serves) in Facts::layout_keeps, merged outward like owners. A replay keeps them through one
layout_memory::keep and passes them to the record open around it. The journal no longer holds where the run measured,
which changes with the path layout memory takes and means nothing to a replay.
2026-11-20 00:11:15 +00:00
aiongg a818e5dc45 craft-ui: the replay audit compares a moved replay with the kept run moved where the replay adds it
A view whose room moved (a scroll) replays its record shifted. Its audit run compares with the kept record as that
replay adds it: egui's records through PassRecords::shifted, journal entries with their arguments shifted, and the
kept rect moved by the shift's offset. journal's again is Copy (every capture-free closure is).
2026-11-20 00:11:15 +00:00
aiongg bf98f15211 egui: repin to bcdeb7bb8 (a part's records after a sizing pass; no empty shapes or sizing widgets; PassRecords::shifted) 2026-11-20 00:10:09 +00:00
aiongg 4417218eca ci: the Workspace gate's Linux leg runs the UI crates' tests again with the replay audit, from the same build 2026-11-20 00:10:09 +00:00
aiongg b257b150fb craft-ui: the replay audit runs every memoized view that would replay and compares it with the replay
Test builds only. With CRAFT_UI_AUDIT_REPLAY=1 (or testing::audit_replays), the outermost view that would replay in a
real pass runs for real inside an audit record; the kept run stays as it was. The run is compared with what the replay
adds: the view's rect, paint, widget rects and AccessKit nodes (PassRecords::first_difference), focus registrations,
the journal and the output. A difference panics with the view's name and the first difference of each kind. Counters
count nothing inside an audit run, so the count trials hold under the audit.

A record that paints a paint callback is blocked: its view runs every pass, and the audit names it.
2026-11-20 00:10:09 +00:00
aiongg e163a0435a craft-ui: a record replayed inside a recorded run is in that run's journal
replay notes the replayed record's journal into the records open around it and keeps entries' calls from noting
again, so an outer record holds each entry once whether its call journals itself or not.
2026-11-19 20:32:54 +00:00
aiongg fe40ab109b craft-ui: a focus scope keeps the opener of the pass it first appeared in, in a run and a replay alike
A replayed scope takes its opener by the same rule as a run (the opener is focus-service state, not view output), and
transcripts compare without it. Transcript::first_difference names the first record two transcripts differ in.
2026-11-19 20:32:54 +00:00
aiongg ff64465e3a ui-contract: replay trials allow expect, as test code 2026-11-19 20:32:54 +00:00
aiongg 1cd0e4e7f7 craft-ui: replay records compare as replayed; replayed members take their stack positions from the arena
`Transcript` equality compares the form a replay registers (`Transcript::placed`, which `focus::replay` uses): a
record under the scope open around the run goes under the open scope, and a replayed scope is no new scope.

A replayed member join and `over` placement take their stack positions from the arena they join in the replaying
pass, as a real run does: the journal notes the members as declared with the layer and clip, and the join and the
`over` placement record their shapes themselves. The `journal` doc says the capture assert fires in a build, not in
`cargo check`.
2026-11-19 20:32:54 +00:00
aiongg 4cbcfec98e craft-ui: trials of journal entry and focus transcript equality 2026-11-19 20:30:33 +00:00
aiongg 20eec89c29 docs: regenerate contract-api.md 2026-11-19 16:41:17 +00:00
aiongg c7e4abfcfa craft-ui: memoized views are the one change mechanism; the settling path goes
Lazy::settles, Lazy::content, Key::Version, the input and unsettle rules
(Changes::input_through, unsettled_through, scan) and lazy::unsettle with its
callers are removed. frame::request_repaint marks the record of the view it
is asked in and reruns only that view; asked outside every view, every view
replays. request_own_repaint goes; ui-canvas calls request_repaint. Pages
measures each hidden page once per pass. The tests that used the old API are
memoized views, with trials for repaints in and outside views and for
given-value edits. API map rows and the framework doc describe memoized
views.
2026-11-19 16:32:30 +00:00
aiongg b82c10b0e9 craft-ui: replay a memoized view at a moved place
A kept run replays where its room is now: the room's position leaves the place comparison and
becomes the offset of one RecordShift, which moves egui's records, every journal entry and what
a memoized view returned. Room size, layer, layout, scale and environment stay compared.

- Place::shift_to: the move is a whole step of egui's UI rounding; a moved record holds no paint
  callback and sits on an untransformed layer; clip rects follow when the clip moved with the
  room, or when the run lay wholly inside its clip (nothing culled). Otherwise the view runs.
- Shift: journal arguments (A: Shift) and MemoView's R (R: Shift) move by the replay's shift
  inside replay::replay; rects and points move, Clip goes through the clip rule, the rest stays
  (stays!). Vec2 has no impl: a size and a move are both Vec2.
- The engaged test reads the moved rect; the scroll-view rule compares the view moved with the
  record while the clip moved with it; sizing extents compare the room's size.
- The scroll body moves its content by whole UI rounding steps, as egui places widget rects.
- Trials: a moved replay equals a run there (pass records, revealed rects, returned rect); a room
  of another size runs; a cut run moved under its clip runs and moved with its clip replays; the
  Overview's scroll runs only entering cards and the pointer's.
2026-11-19 16:16:19 +00:00
aiongg 92bcddee27 Repin egui to the replay-offset head 2d59bcacf2
The fork's replay_pass_records takes a RecordShift, so a settled record replays at another place.
2026-11-19 16:16:19 +00:00
aiongg c7f5e7654c craft-ui-gallery: trials for the memoized viewer panels
An idle viewer runs no panel body; a filter edit runs the tree and the
Overview; a selection change runs the panels that read it; a Properties
edit runs Properties, the Overview and one card. A saved layout round-trips
its component tabs by name and drops the ones the catalog lacks. The idle
Overview and shell-region trials account for the Overview's own view.
2026-11-19 15:53:27 +00:00
aiongg 2028470e8f craft-ui-gallery: the viewer's panels are memoized views over tracked browser state; tab names are owned and resolved through the catalog
The tree, stories, properties, inspector, Overview, component tabs and the
Variants view each read only their props. The browser's panel state is
Tracked and written only on a change; tab opens and Variants requests leave
through outboxes. The shell places the Variants view from the dock layout.
PanelId::Component holds an owned TabName; a saved layout drops the tabs the
catalog does not list, which replaces the interned static names.
2026-11-19 15:45:22 +00:00
aiongg d125e4e094 craft-ui: bind_tracked! binds a whole Tracked value; Selection, OpenSet and Level are plain data 2026-11-19 15:38:39 +00:00
aiongg 765c2ca9f7 craft-ui-gallery: story cards and their stories as memoized views
Each card is a memoized view over its spec and the states of its stories; each story's surface is a memoized view
keyed by its data's revision, which the end of its run, the Properties editors and the dialog opener move through
StoryData::settle. The story's surface is inside its view, so a story that fills takes its content's height there.
The card Lazy no longer settles; inspection records and value texts are journaled, so a replay keeps them. The
browse places and relink stories ask for their next run with the framework's repaint, which reruns the view.
Trials: an idle Overview runs no card or story, a story data edit runs one card, a scroll runs only cards in view,
a story with its dialog open runs every frame, and the inspected card replays with its run's record.
2026-11-19 15:20:13 +00:00
aiongg 9c1a2abdf9 craft-ui: story data has a revision that moves when a compare finds its values changed
StoryData's accessors hand out &mut T, so a write leaves no trace of its own: settle() compares the values with the
copy the last call kept and moves the revision only on a change. A memoized view of a story keys on the revision
(MemoProps for &mut StoryData) and settles at the end of its run; restore settles too. Pad derives MemoProps.
2026-11-19 15:20:13 +00:00
aiongg d6880de674 craft-ui: a memoized view takes its grid cell at its extent, in its run and its replay alike
The run placed a child Ui at the cell's region and moved past its content without taking the cell, so two views in a
grid row overlapped, and the replay took the cell through take_in_flow at the row's height, so the body around it found
a measure its kept transcript did not hold and discarded the pass. Both now place the view through one function: the
next cell at the view's extent in a Grid or spread Row, else past the kept rect, which a real replay has at the place
its run was.
2026-11-19 15:08:39 +00:00
aiongg 1176a26a4c craft-menu: cargo fmt 2026-11-19 14:34:08 +00:00