MenuHelp had two constructors, one over a list the caller built every
frame and one over a function the bar calls only while the Help menu is
open. Only the second keeps closed menus from paying for the list, so it
is the one constructor: MenuHelp::new takes the function.
A menu row's highlight comes from the LEAD flag rule, which resolves without easing, and
the popup makes the row under the pointer active before its rows run. The new test pins
both: the frame that moves the pointer onto the next row paints that row's full highlight
and none on the row it left, with no time passing. It fails if the active row follows the
pointer a frame late, or if the highlight moves onto the eased hover mix (80 ms).
Fixture::frame_shapes_with(events) returns what the frame that took the input painted.
Part of photocraft#15477.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A component's children run inside its pipeline (the measuring run of step 5, the overlay, paint, the body and
paint_over), so every frame on that path stays on the stack for each nesting level. The level kept all of steps 1 to
17's working state there: CxCore moved by value through the dyn call into Cx, the component taken out of Typed into
with_cx, and run_steps, run_in_host and the body step each one function with every step's locals.
- Cx holds `&mut CxCore`; the run builds the core once, in run_passes, out of the frame step 5's measuring runs
recurse from. finish keeps its signature.
- The show's caller makes the component's slot; Typed borrows it and finish takes it out after the children ran.
- run_steps, run_in_host, the body step and the measuring run are drivers over per-step functions; what crosses a
child's run is a small state struct (Begun, HostStep, BodyPlan, MeasurePlan).
- Layouts, label columns and region contexts build their Ui, UiBuilder and BodyCx in helpers, and each body layout
and label-column arm runs in its own function.
- Helpers that opt-level 2 merges back into a recursive frame are inline(never).
A body sixteen containers deep shows on a 512 KiB stack (body::nesting).
The in-window menu bar, its Alt, F10 and letter keys, and Ctrl moving only a list's lead are PC behaviour. The fixtures took the host's OS, so the tests failed on macOS runners.
Every row of a menu level asks for its letter in every pass, and
`MenuLevel::mnemonic_of` assigned the letters of all the level's rows for
each of them; `end` did once more. A long menu (PhotoCraft's Filter menu,
about twenty rows) and each submenu it opened paid that many full
assignments per frame: in a profile of hovering the Filter menu's submenu
rows, `mnemonic::assign` was about 6 % of the open menus' cost, and the
frame that opens a submenu reached 12.7 ms of UI work.
The level keeps the last assignment with the labels and folder it was made
for and assigns again only when they change. `mnemonic_of` reads its entry
with `get`, so a row that is not in the list gets none instead of an
index out of range.
Part of storytold/photocraft#15493.
Two costs every frame paid, found in a profile of PhotoCraft on the
framework (storytold/photocraft#15493):
- `MenuBarUi::show` collected the Help search's entries (every row of
every menu, with English labels) on every pass whenever the bar had a
Help menu, open or not. `MenuHelp::built` takes a builder the bar runs
only in a pass that shows the Help menu; `MenuHelp::new` keeps taking a
ready list.
- `Keymap::shown_chord`, which every menu row, tooltip and button asks
each pass, built the command's key string for every `find` and ran a
full `lookup` per binding, cloning the winning commands only to look
their keys up again. `find` now looks up a command without parameters
by its id, and `press_runs` decides on catalog positions. Answers are
unchanged; a new test covers tools sharing a chord (a cycle within a
group, the first of two groups), which no test covered.
Measured in PhotoCraft (Windows 11, idle machine, three runs, together
with PhotoCraft's own storytold/photocraft#15496): UI pass with a pointer
over the canvas 8.7-11.3 ms -> 4.9-5.0 ms, during a menu hover
9.2-10.2 ms -> 6.7-7.1 ms.
Part of storytold/photocraft#15493.
- CellAlign { Center, Top } on BodyLayout::Grid and Grid::cells, with the grid_cells_top story: a cell shorter than its
row stands in its middle (default) or at its top.
- Full picker: the two halves are a fixed, top-aligned grid, so the left half keeps its width in any room and the
Only Web Colors row's button stays under the strip; the right half is top-aligned, so a shorter second field group
starts level with the first and the dialog's buttons start level with the compare block.
- FooterPlace::Body and FooterSlot: a container's footer drawn at the cell its body keeps; the footer step still
runs it, so roles, platform order, Enter, Escape and Alt-Reset stay the dialog's. Dialog::button_place(ButtonPlace
{ Foot, Side, Body }) replaces side_buttons(bool); every caller updated.
- Grid::fit(GridFit { Stack, Fixed }) and layout::empty_cell, with the grid_fixed story.
- ColorArea sizes by AreaShape { Plot, Square } from tokens, never from the room.
- CompareSwatch: one block, new over current, one edge, captions, warnings column from the block's top.
- ColorWarningChip arrangement enum (Stacked, Beside) replaces beside(bool); icon.sm chips.
- Full: area and strip over Only Web Colors and the screen-pick button; compare block and actions slot over two
field groups in grids that never stack; '#' in the radio column, hex field across the channel cells. No wrap, no
alpha row, no OKLCH column (OKLCH rows join group 2 with their radios); Only Web Colors always shown.
- Compact: width from the plot area and strip; hex row with the screen-pick button at its end.
- ColorPickerDialog puts its buttons in the picker's slot; color_picker_dialog story.
- Trials: Full arrangement across rooms, densities and themes; dialog proportions and button cell; compact width;
body-placed dialog buttons and their keys.
The grip was the layer's inline header: top-aligned in a rect as tall as
itself, on the layer's floating fill, while the members' Bar painted its
own square chrome surface beside it. The bar read as two shapes with the
grip off the line.
The grip is now the Bar's first member, so the row centres it inside the
bar's padding, and the Bar paints the one Floating surface (new
`Bar::surface`); the layer paints none. The layer keeps its empty inline
header for the move band, which still spans the whole line, so the grip
and every free point drag the bar.
Part of storytold/photocraft#15479.
A container's ThemeScope applies at its own env (step 1), so its surface, header,
rules, scroll bars, pads and focus ring resolve in the scope as well as its
regions, body and the layers opened from it; collections honour it too. The
root token cache keeps every entry read in the current frame, drops the least
recently read beyond eight, and moves a value hit onto the caller's Arc so the
next frames hit by pointer. The drag preview paints in the env of the region
the drag started in, a drop mark in its target region's tokens, and canvas
readouts in the asking region's env.
egui's fade asked for a repaint every frame until its age passed the animation time, a second open
fade beside the presence tween; with the clock still (a trial's frames) it never ended. The menu row
trial counts egui's two frames after input before asserting that the menu asks for none.