Commit Graph
463 Commits
Author SHA1 Message Date
FredApps b04d18a735 Select UI suite items through explicit registries 2026-11-19 12:20:08 +01:00
FredApps f8dddb2a55 Split UI test kit from story suite 2026-11-19 09:25:07 +01:00
aiongg a23d8c68c6 Menu bar: one MenuHelp constructor, over a function that lists the entries
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.
2026-11-18 20:59:16 +00:00
aiongg 38429defb8 Merge pull request #2082 from davidmann4/perf-frame-cost
Menus: Help entries only while Help shows, mnemonics once per level, chords without allocating (photocraft#15493)
2026-11-18 15:12:05 -05:00
David Mann 650979426d Merge pull request #2067 from davidmann4/perf-menu-hover-lag
Menus: test that the highlight moves to the next row in the frame the pointer reaches it (photocraft#15477)
2026-11-18 20:45:44 +01:00
David MannandClaude Opus 5.5 37f0d16764 menu bar tests: the two new tests run as Linux, like the rest of the file (macOS has no in-window bar)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 20:02:00 +01:00
David Mann d7c73383be Merge pull request #2065 from davidmann4/fix/task-bar-grip
Task bar: grip on the members' line, one floating surface (photocraft#15479)
2026-11-18 19:52:39 +01:00
David MannandClaude Opus 5.5 b2612c91dc Menus: test that the highlight moves to the next row in the frame the pointer reaches it
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>
2026-11-18 18:31:34 +01:00
David Mann 161ea90ec7 Merge remote-tracking branch 'origin/next' into HEAD 2026-11-18 18:30:36 +01:00
David Mann 987933fb1f Merge remote-tracking branch 'origin/next' into HEAD
# Conflicts:
#	crates/menu/src/bar.rs
#	crates/ui-widgets/tests/it/menu/bar.rs
2026-11-18 18:26:56 +01:00
aiongg 9442a099f2 Merge storytold next into themecraft-wave1 2026-11-18 16:05:01 +00:00
aiongg 016ca5425d Merge storytold next into themecraft-wave1 2026-11-18 14:01:25 +00:00
aiongg f1c8460306 Merge storytold next into picker-full 2026-11-18 14:01:22 +00:00
aiongg f9a53dd0ee Merge pull request #2129 from aiongg/settle-chrome
Dock and title chrome settle like panel bodies (photocraft#15493)
2026-11-18 08:52:26 -05:00
aiongg 999f4583c4 Merge pull request #2182 from aiongg/contract-stack
contract: a component's run keeps only what it reads after its children on the stack
2026-11-18 08:51:16 -05:00
aiongg 780c13fa81 Merge pull request #2127 from aiongg/toolbar-overlay-scroll
Toolbar: hover-only overlay scroll bar, one named drop mark per dock drag (photocraft#15524, photocraft#15526)
2026-11-18 08:50:18 -05:00
aiongg 517257dba5 settle chrome: the settled menu bar trial runs as a PC app
A Mac app's menu bar is native, so the in-window bar's F10 and Alt keys are PC behaviour; the trial sets Linux as the rig's other trials do.
2026-11-18 10:58:51 +00:00
aiongg 6d3dceca44 settle chrome: the column bar scopes without an id salt, and the tests drop the deprecated Ui::id and unused mut 2026-11-18 08:33:28 +00:00
aiongg b77d8760c3 contract: a component's run keeps only what it reads after its children on the stack
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).
2026-11-18 07:27:48 +00:00
aiongg caf0f01d00 Merge remote-tracking branch 'upstream/next' into settle-chrome 2026-11-18 05:29:08 +00:00
aiongg 36749e88a3 Merge remote-tracking branch 'upstream/next' into toolbar-overlay-scroll 2026-11-18 05:29:05 +00:00
aiongg 22d4cd8e8e Merge remote-tracking branch 'upstream/next' into picker-full 2026-11-18 05:29:03 +00:00
aiongg e157a6c330 Merge remote-tracking branch 'upstream/next' into themecraft-wave1 2026-11-18 05:29:00 +00:00
aiongg 8bb7cc1223 Merge remote-tracking branch 'upstream/next' into label-scope-nested 2026-11-18 05:28:53 +00:00
aiongg 80c7fd661c menu bar and list tests: PC keys on every runner
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.
2026-11-18 02:45:07 +00:00
aiongg 26ba3c1196 Docs: what the dock's spec version covers and when panel_rows runs; a host keeps its Arc<Host> across frames
Trial: a settled child runs again when the host switches the language.
2026-11-18 00:23:14 +00:00
aiongg b5b0e6b6fd Trials: settled dock chrome, a drop on a settled group, a theme change and a settled menu bar's keys 2026-11-17 23:59:57 +00:00
aiongg b2c8635980 Scroll: an overlay bar in the padding that shows under the pointer; the tool rail and bars use it (photocraft#15524) 2026-11-17 23:39:22 +00:00
David Mann 8c31476bd3 Menus: name the kept letters' type (clippy type_complexity)
Part of storytold/photocraft#15493.
2026-11-17 22:47:34 +01:00
David Mann 2d52fc0a0b Menus: assign a level's mnemonics once, not once per row and pass
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.
2026-11-17 22:45:22 +01:00
aiongg 1dd6bb654c ui-widgets: FitMode::Shrink is non_exhaustive 2026-11-17 21:43:23 +00:00
David Mann c78c49e2f7 Menus: collect the Help search's commands only while Help shows; shown chords without allocating
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.
2026-11-17 21:04:10 +01:00
aiongg bb56cb044f NumberField story: the unit-after row's Field holds only the field, the unit follows it 2026-11-17 19:39:34 +00:00
aiongg 949be1f915 Colour picker round 4: Grid::cells(CellAlign) sets cells at their row's top; the Full picker's halves and right half use it
- 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.
2026-11-17 18:59:32 +00:00
aiongg 7b745c75bf Colour picker: Photoshop's fixed Full arrangement, dialog buttons in a body slot
- 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.
2026-11-17 18:20:35 +00:00
aiongg 081b62b056 clippy: needless deref in docking targets; the tab strip trial drops the strip's output 2026-11-17 17:44:43 +00:00
aiongg e6f337caa1 Controls that show their own text keep their name in a labelled row (output path link, preset buttons) 2026-11-17 17:07:55 +00:00
David Mann 37bb3cbae6 Task bar: the grip sits on the members' line, one floating surface
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.
2026-11-17 17:46:08 +01:00
aiongg c4a14ef4db ThemeScope: a theme definition, mode, contrast and density for a container and everything it shows
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.
2026-11-17 16:26:20 +00:00
aiongg 2e6cc11242 Full colour picker: Photoshop arrangement (two groups, short fields, unit column, stacked compare block); NumberField UnitPlacement 2026-11-17 15:56:17 +00:00
aiongg 9840ee1b99 Framework layers fade in by the motion service only: egui's own Area fade-in is off
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.
2026-11-17 15:18:40 +00:00
aiongg b31c8c9adb Merge branch 'fx/tabs' into fx/all-1117
# Conflicts:
#	crates/ui-widgets/src/tabs/tab.rs
2026-11-17 15:06:35 +00:00
aiongg 76758ecfdd Wrap::Clip: one line cut at the room's edge without an ellipsis; panel tab labels use it 2026-11-17 15:00:38 +00:00
aiongg eae5f9b97d Tab label clip: the paint closure returns nothing 2026-11-17 14:48:39 +00:00
aiongg 86abdbad5b Merge branch 'fx/menu' into fx/all-1117 2026-11-17 14:46:03 +00:00
aiongg 96d93ab89c Merge branch 'fx/picker' into fx/all-1117 2026-11-17 14:46:03 +00:00
aiongg 75decedac1 Menu row trial: the frame egui runs after a move changes nothing and asks for none 2026-11-17 14:45:30 +00:00
aiongg dcafabbb10 Menu row trial: a menu that fits, every row 2026-11-17 14:43:08 +00:00
aiongg 924e6a5d55 Menu row trial: the rows the menu shows are those inside the menu's rect 2026-11-17 14:42:27 +00:00
aiongg f8131126d7 Menu row trial: enough rows to overflow the fixture's least screen 2026-11-17 14:41:40 +00:00