Commit Graph
5950 Commits
Author SHA1 Message Date
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
aiongg 541160ff27 craft-ui-panels: the tool rail's slot grid is a memoized view
The grid's events leave through an Outbox; the Edit Toolbar response is read back by id. ToolRail needs T: MemoProps.
commands::resolver_in resolves commands for a view with no component context.
2026-11-19 14:34:08 +00:00
aiongg 4208dee323 craft-ui-widgets: bar member types derive MemoProps; trials of host-written bar views
BarItem, ItemDisplay, MoreMenu, BarKind, StatusMessage, StatusProgress, StatusItem, StatusValues and StatusReadout key
a memoized view; Axis, Side and PixelSize implement MemoProps.
2026-11-19 14:30:07 +00:00
aiongg 8b784b4bdb craft-menu: the in-window menu bar is a memoized view
MenuBarUi takes its English hook as a stateless fn item or capture-free closure; the menu model derives MemoProps.
2026-11-19 14:30:07 +00:00
aiongg 8e6490f618 craft-ui: a sizing replay measures again in a room its last sizing run was not offered
Each kind's extent keeps the room the run was offered beside the key of its content.
A sizing call takes the kept sizing extent only when both match; a new room runs it
once as a measuring run, as new content does, and the real call still decides by the
settled rules. A container offered another room so follows the view's new extent.
2026-11-19 14:21:08 +00:00
aiongg fb32576d60 craft-ui: cargo fmt 2026-11-19 14:16:10 +00:00
aiongg da6e6509fd craft-ui: a sizing replay measures content its last sizing run did not
A child keeps each kind's extent with the key of the content it showed. A sizing call
of a pass that replays takes the sizing extent only when it was measured from the
kept run's content; otherwise it runs once as a measuring run, which keeps no record
and leaves the pass's decision alone, so the real run still replays. Before, the
sizing call took the extent of an older run, so a container measured a changed view
at its old size.

A change now costs one real run and one measuring run: in the sizing pass that first
measures the new content, or before the real run where the container measures first.
2026-11-19 14:16:10 +00:00
aiongg 19965d3588 craft-ui-panels: the dock's chrome views hold no size their measuring runs see as zero
The tab row's group size and the column bar's ghost extent came from the run's rect,
which is zero in a measuring run, so every re-measure ran both views in the sizing
call and again in the real one. The extent goes on the drag with drag::amend when it
starts, outside the view, as the arrangement does. GroupGrip starts its drag with no
extent and takes only the name its drop region shows.

testing::last_frame_memo_runs lists every call of the last frame, sizing and
measuring calls included; the dock trials count the frame with it.
2026-11-19 14:16:02 +00:00
aiongg 4e6ca12daa craft-ui: a sizing pass keeps the real run's enabled state, so memoized views replay there
egui's invisible() also disables the Ui, and every sizing Ui is invisible. Env::of
folded that into enabled = false, which the memo key's scope key holds, so a view's
sizing call never matched its real run and decided a run for the whole pass.
2026-11-19 14:03:30 +00:00
aiongg bf187376d2 craft-ui-panels: note why the dock's tab row and column bar replay at rest 2026-11-19 13:36:11 +00:00
aiongg 7e754a6742 craft-ui: a replayed view registers its revealed rects with the shell
ShellCx's revealed rects live in a pass-stamped record per viewport, keyed
by the shell's id, and each registration is journaled, so a memoized view
in a slot that replays registers the rects its run did. reveal_rect skips
measuring runs itself.
2026-11-19 13:36:11 +00:00
aiongg 587590fec7 craft-ui: dock chrome and shell slots as memoized views
Each dock group's tab row, each column's bar and each iconic column's bar is a memoized view on the spec values,
the arrangement and the look; what the user did on them leaves through an outbox. The containers (DockGroup,
DockColumn, IconicColumn) and the host's body, group view and group header run every pass, and the host memoizes
inside them; shell slots the same way. The group menu is one popup, opened by the panel menu button or by a
context request on a tab, and its rows are built only while it is open.

Removed: DockPanels::content and spec_version, the chrome key, DockColumn::content, IconicColumn::content,
Slot::content, Slot::content_version, AppShell::content, Lazy::show_or and Run::unkept. The gallery's mock
Navigator body is a memoized view.
2026-11-19 13:34:57 +00:00
aiongg a9929bc06d craft-ui: Outbox, the event channel out of a memoized view; replays note their widgets and nodes for the bypass walk
A run sends what its components reported in the pass; a replay sends nothing, which is complete because input
reaches only an engaged view, and an engaged view runs. The outbox feeds nothing into the key.

The testing notes of runtime-made widgets, nodes and scroll regions are journaled, so a replayed view's nodes
pass the bypass walk as its run's did.
2026-11-19 13:34:45 +00:00
aiongg 1657ce1b31 craft-ui-macros: a type parameter only hash-escaped memo props fields name is bound by Hash + Sync
A dock's chrome props hold the host's panel type through #[memo_props(hash)]; the derive bound it by MemoProps,
which a plain panel id does not implement.
2026-11-19 13:34:45 +00:00
aiongg e31c08f0f6 docs: regenerate contract-api.md 2026-11-19 13:33:23 +00:00
aiongg 52c1f953ea craft-ui: env word sets, Units, formats and the host key memoized views by generation
A word set written by words! keeps the generation of the Words it was localized in and keys by it. Format, DateFormat
and Host get a generation per instance built (clones keep it), and Units keys by its format, words and point size.
The scope key and the host's word cache use these generations, not pointers. Checks that captured env words, units
or other locals take them as check_with inputs (page range, path field, print preview and font picker stories).
2026-11-19 13:31:20 +00:00
aiongg adfc725e21 craft-ui: a replayed view reports its nested rows' places to the scroll area
The area's anchor, glide target and axes are the area's own state: lazy::begin keeps them in its Placed, and View
holds only what the children decide by. Places are journaled as offsets from the view's start, so a replayed memoized
view keeps the area's anchor where its run put it. The Scroll trial moves the scrolling body so the view's room stays
the same while its nested rows' decisions change.
2026-11-19 13:31:16 +00:00