Commit Graph
259 Commits
Author SHA1 Message Date
FredApps b04d18a735 Select UI suite items through explicit registries 2026-11-19 12:20:08 +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 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 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 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 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 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 caf0f01d00 Merge remote-tracking branch 'upstream/next' into settle-chrome 2026-11-18 05:29:08 +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
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
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 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
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 86abdbad5b Merge branch 'fx/menu' 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
aiongg e414c8c9bd Menu row trial names its rows with owned labels 2026-11-17 14:40:48 +00:00
aiongg f17ae25311 A menu sets its active row from the pass's pointer resolution before its rows run
The pass that moves the pointer onto a row paints that row lit and the row it left unlit, with no
follow-up pass. Rows no longer activate themselves on hover; runtime::pointer::hovers reads the
pass's one resolution for a component. MenuItemOutput reports whether the row is active. Trial:
a pointer move over the rows of a scrolling menu, at 1x and 1.5x, down and up.
2026-11-17 14:39:36 +00:00
aiongg bf755d4228 Panel tabs: shown tab keeps its width, others keep their first letters, labels clip 2026-11-17 14:26:15 +00:00
aiongg bab1a99b85 Drop an unused import in the zero-width trials 2026-11-17 12:10:57 +00:00
aiongg 98226eb219 Merge branch 'look/align' into fw/mac1 2026-11-17 08:04:37 +00:00
aiongg 490a9e0207 Text in a control's line sits on the line's baseline: a field's mono digits and its unit share the body text's baseline 2026-11-17 07:52:46 +00:00
aiongg 1a55c72e1e Grid: each column is a column group, so the labels beside the fields of one column share a width and the fields start at one x 2026-11-17 07:52:46 +00:00
aiongg b3eae86124 A settled region's replay makes its arena registrations again (a root's step 8, members joining, over parts, the body layer): a press that arrives with the pointer reaches a member the region shows 2026-11-17 07:13:24 +00:00
aiongg 4a3c72f2db Look align: text parts ignore the host's egui size floor; options bars at the standard control size; selects in a bar fit their widest entry; check box labels in body type; title band glyphs at size.icon.sm with a faint kind caption; Inspector names its target at section weight; Transform fields fill two columns, W and H first 2026-11-17 06:13:31 +00:00
aiongg 660daa69a1 Merge branch 'red/f3' into fw/mac1 2026-11-17 05:25:10 +00:00
aiongg 6c358f48d2 A container that scrolls one axis keeps an axis it was measured unbounded along unbounded for its children, so a row given no width never lays a child out in a NaN room 2026-11-17 05:24:50 +00:00
aiongg 7617a0522d A set writes the bound value as a commit does
The apply step counted a write only for Update and Commit, so a Set (cx.set,
or a gesture that begins and commits in one pass) changed the bound place
without noting the edit: no settled region or hidden page that read the value
measured again, and no earlier reader got the edit rerun. A given binding's
Set likewise unsettled nothing. Set now carries its value in both tests.

The Pages edit trial asserts one measuring run of the hidden page in the edit
frame. The popover click trial counts the row's activations: a leaf counts a
press in every pass with a press phase, so a click that lands counts more than
one. It clicks the new page's row right after the switch frame's idle frame.
2026-11-17 05:10:23 +00:00
aiongg 73cf8de8f6 Pages: pages that take turns in one place at the size of the largest
A hidden page is measured only: a measuring run inside an invisible sizing
child, so it senses, registers and paints nothing. It reuses the size its
last measuring run found while nothing it read changed, under the settled
rules a measure reads (no input other than pointer motion, no edit of a value
it read, nothing moving, no app repaint): the measuring run opens the same
run record replay::open/close keeps for settling regions, and lazy keeps its
facts with the size. A reused page notes its reads again, so an edit of one
later in the pass reruns the pass.

PaintChip shows its paint kinds through Pages: its popover keeps the size of
its largest page, so a tab switch moves and resizes nothing.
2026-11-17 03:58:47 +00:00
aiongg 0c7c49d1aa AccessKit Scroll Into View and the scroll actions move no focus 2026-11-17 03:33:21 +00:00
aiongg d2d274e936 The wheel steps a select one entry per line, with its list open too, and its run commits when the wheel stops 2026-11-17 03:21:42 +00:00
aiongg 9db1bef17f Value gestures: a host that keeps a number in f32 echoes the proposal rounded to it; Slider, SliderField, AngleDial and TransformBox read that echo as their own value (craft_behavior::same_in_f32), so a live drag runs on as one gesture 2026-11-17 02:39:48 +00:00
aiongg 86f966d470 Wheel: over the canvas a modal dialog keeps open the wheel goes by position, as over a popup above the focused field (WheelFocus::by_position) 2026-11-17 02:39:48 +00:00
aiongg 925810d521 Open menu keys: a menu keeps only Escape, Enter and the arrows; its rows' mnemonic letters are its level's claims while focus is in it, so any other key (a tool key) reaches the app's shortcuts (Fixture::type_key sends a key with its text) 2026-11-17 02:39:48 +00:00
aiongg 5602d6f271 Trial: a pressed field's focus is judged on its text part, where focus lands 2026-11-17 01:24:19 +00:00
aiongg 6839d23016 Trial: a field pressed in part view is judged by its full height, not its response rect clipped to the view 2026-11-17 01:06:13 +00:00
aiongg 24104464da Merge branch 'red/t1e' into fw/mac1 2026-11-17 01:04:26 +00:00
aiongg d6e9997261 rustfmt the crates round D changed 2026-11-17 01:02:42 +00:00
aiongg e59501c290 Wheel: a popup the pointer is over, opened above the focused field's layer, takes the wheel by position; the field's share applies elsewhere (WheelFocus::over_popup from focus::popup_above_focus, shared with press focus) 2026-11-17 00:42:31 +00:00
aiongg db0a73dd8c Merge branch 'red/t4dd' into fw/mac1 2026-11-17 00:21:03 +00:00
aiongg 1386c169b8 A press that moves focus asks for no reveal: the stop under the pointer is focused where it lies, and only focus requests and Tab or arrow moves scroll a stop into view (a crop frame overhanging its canvas panned the view under the press); trial a_pressed_field_in_part_view_stays_put_and_tab_to_it_reveals_it 2026-11-16 23:48:40 +00:00
aiongg c9e1851acf Trial: a wheel notch down steps a free select to the next entry 2026-11-16 22:53:43 +00:00