* Inspector: a hit area's original bounds before minimum-size expansion
HitArea::bounds is the sensing shape's own rect, beside rect, which is grown to
the minimum hit size. A pointer-only part (a slider's thumb) has no access node
or Tab stop, so an app relating a value to its drawn position (a tooltip over the
thumb, a value that follows it) needs its real geometry rather than the larger
target. The trial checks the bounds match the painted knob and the value travel.
(cherry picked from commit 78cd3e98ad)
* Small additions review: a replay moves a hit area's bounds with its rect
(cherry picked from commit f9b1c60144)
* Formatting of the bounds change
* Test inspector hit bounds after a translated memo replay
---------
Co-authored-by: lightcraft-port <port@lightcraft.local>
Another component's widget over a drag band covers it only where that
component's parts take a press: a dialog's title row covers its band
with its close button, not with its whole row.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The begin hook marked a pass as stirred for every PointerMoved event, so a canvas tool host re-hovered a still pointer, with a full hit test, on every pass that repeated the pointer's position. A move now stirs the pass only when it goes to a new position or carries a pen or touch reading. The last move's position is kept per viewport and cleared when the pointer leaves the window.
Brings the pointer-move gate's per-root hover and press winners
(a885cd5f38) and the egui pin at storytold/egui#65's merge commit
932a73b2. The pointer trials keep both sides' additions.
Overlapping shapes of one root can hit both points of a move while the
nearest centre picks another winner; the move now runs a pass then.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Facts.roots held arena roots, so every view of an arena saw the pointer
over any member of it and ran. A run now notes the owners of the shapes
it registers (Facts.sensors); Under lists every owner under the point,
and Sensed keeps the hover winners, owners and root parts of the view's
own components. Egui widgets stay in Record.widgets.
Code that needs only the buttons held, the pass's press or its release read `pointer::frame`, which notes
`Input::Pointer`, so every pointer move anywhere ran the memoized view around it (PhotoCraft's canvas, FW-365 F4).
`press_state` notes `Input::Press`, which the begin hook moves on every press and release and now also when the
buttons held change. The trial checks that a reader replays on a move, with a button held or not, and runs on a press
and a release.
Each built item row of a collection declares a hover-only part over its rect,
above the collection's background and below its other parts and the row's own
shapes. Sensing reports every root's own parts under the pointer, on top or
not (pointer::Under::parts, read with pointer::parts_under), and a memoized
view's Sensed includes those of its roots. The collection takes a row's
hovered and pointer-over state, the hover lead and the rest wait from the row
part under the pointer instead of reading the hover position, so a move within
one row replays a view around the list and a move onto another row runs it.
The edge band still reads the hover position: it is drawn at the line nearest
the pointer.
Trials: a list of 10 and of 40 rows in a memoized view replays on moves within
a row, runs once on a move to another row, and the hover fill follows; a press
and its release, a wheel over a list, and a modifier change under the pointer
run the view; a replayed hovered view keeps its cursor; a tooltip runs its
view at the wake and when its layer first paints; Cx::hover_pos reads the
point over its part only and marks it as following the pointer for the
pointer-move gate.
A memoized view replays with the pointer over it unless its pointer facts
changed: the hover, parts and pointer-over of its roots and egui widgets at the
hover point (pointer::Sensed), the modifiers while it is under the pointer, a
move in a rect it follows, a wheel share or owed ease for a taker it registered,
a tap in it, or, while a drag session runs, the pointer over it. A press held
that started in it still runs it. A move within one part replays the view; a
move onto another part runs it.
Reading where the pointer hovers marks what reads it as following the pointer:
Cx::hover_pos marks the part's hit area, and pointer::hover_point_in marks the
rect it reads in. PartResult::hover_pos is crate-private, member responses carry
the pointer only for a press, and the collections' row hover, edge band, the
menus, canvas, colour, timeline and font readers go through the accessors.
design-lint's contract/pointer rule bans egui's hover-position reads.
Cursor requests are journaled, so a replay requests its cursor again. A record
notes the arena roots, follows rects and wheel takers its run registered.
pointer::gate_pointer_moves sets egui's pointer-move gate (storytold/egui#65):
a move with no button held needs a pass only when the pointer comes in, a
drag runs, either point lies in a rect that follows the pointer
(pointer::follows_pointer, journaled so replays keep it), or the layer, egui's
widgets (Context::widgets_at) or the component shapes under the two points
differ in the last finished pass. Opt-in per app. egui moves to the PR's head.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reviewer finding on #3448: entries in `docs/contract-api.md` ended mid-sentence
(`size_ok` at "a `min` that is", `label_decimals`, and the `WindowSpec`,
`pressed_part` and `icon_ink_on` summaries). The generator lists the first line
of each doc comment only, so each of those doc comments now opens with a
complete sentence and keeps the rest below it: `size_ok` says on its second line
that a `min` that is not a number counts as one unit, `label_decimals` keeps its
cases in the paragraph under the summary, and `WindowSpec`'s first line carries
the whole "what it is for, who draws its frame, where it stands and whether it
has a taskbar entry" sentence.
Regenerated with the branch's own generator; a second run leaves the file byte
for byte as it was. Every entry this branch adds or changes now ends in a full
stop. The rest of the file keeps the entries the base leaves truncated (1273 of
4820 entry lines still end mid-sentence, none of them touched here): sweeping
those, or teaching the generator to join a doc's first sentence, is a separate
change.
The regeneration also picks up two entries the branch's merges added without
regenerating (`Action::restore`, and `floated`'s doc).
The OS gives an OS window no press that went down in another window, so DockArea::continue_move had no effect
on a window the dock opens as one. The window shows in the app window while the press moves it: it follows the
pointer, marks where it would land and docks on release, as a tab drag does.
Conflicts, all resolved by keeping both sides:
- docking/config.rs: next's ColumnCards import and flush_docks setter beside our PopupLayer, PanelTabShrink and tab_shrink setter.
- docking/flyout.rs: next's docked field and Flyout::docked beside our popup_layer prop.
- docking/iconic.rs: next's ActiveLook import with our FlyoutHeight and PopupLayer; the flyout takes both popup_layer(layer) and docked(self.framed).
- dock/area.rs: the iconic column takes our flyout_layer and next's tab_look and framed.
- tests/it/docking/columns.rs: next's craft_theme import with our Button and PopupLayer imports.
- tabs/mod.rs, tabs/tab.rs: next's TabCloseLook beside our PanelTabShrink.
- docs/contract-api.md: next's host_canvas wording, keeping the generated runtime::focus::is_focused entry.
Next does not cover any of this branch's changes.
One conflict, in docs/contract-api.md at the runtime::focus listing: next
removed focus::host_stop and reworded host_canvas (c933a9062); this branch
lists focus::is_focused. Took next's host_canvas line and dropped host_stop,
kept is_focused, which is public in next's source too. The other files
merged cleanly.
The `svg_set::Layer` re-export and the `made_lookups` counter were gated
on `testing`, but their only readers, the icon and host key trials, are
gated on `suite`. A build with `testing` alone, which craft-ui-test-kit
turns on, left both unused, so
`cargo clippy -p craft-ui-test-kit --all-targets -- -D warnings` failed
on an unused import and a function that is never used.
Conflicts, resolved in next's shape keeping this branch's behaviour:
- body/window.rs: next binds the press start (for start.handed); kept the
shown rect the keep rule may have moved, and took origin from start.
- docking/group.rs: next's always-panel strip and shown_tab(); kept
panel_shrink(row.shrink).
- docking/mod.rs: export both FlyoutHeight and next's PanelDocument.
- iconic/trials.rs: imports of both (DockColumn, FlyoutHeight,
IconGroupSeparator, CELL).
- tabs/tab.rs: next counts the close button in parts and holds it beside the
first letters; kept the ellipsis least, which now takes the close button
from parts instead of adding it separately.
- docs/ui-docking.md: PanelSpec row lists FlyoutHeight and next's fields.
Conflicts:
- value_drag/slider.rs: next added the TrackPress::OnPress follow-on-down path
and kept press_at reading current(); kept next's shape and our mixed-aware
press_at, so a press on a mixed slider still jumps to the pointer.
- tests/it/text/text_field.rs: both sides appended trials at the end; kept
ours (wheel over focused fields) and next's (keeps_on_escape) side by side.
Next covers none of this branch's changes.
The press-winner rule in runtime/pointer.rs named crate::contract::MOVE_BAND, a
layer the runtime may not import (design-lint layer/import). The key is now
defined in runtime::pointer and the body step's window module uses it from there.
The pane trials a_pane_offers_and_takes_only_its_dock_edges and
escape_during_a_pane_title_drag_cancels_it_and_reaches_nothing_else pressed the
floating pane's title row at a fixed offset from its corner. A pane's window sizes
to its content, and there the offset lies on one of the row's buttons; the band
used to take the drag from under the button, which the title band rule now stops.
The trials now press a point of the row clear of every button, so the title drag
still starts the window's dock drag from the band, as they meant.
A host body keeps its presses and its egui focus, so the group takes
no focus and DockAreaOutput::focused never names the panel clicked
into. BodyCx::pressed_within reports a primary press in the body's
rect on its layer whatever took it, sharing the press geometry with
surface_pressed, and the dock area reports the group's shown panel as
pressed.
A menu absorbed a press of any button outside it, so a right-click on another
control or the canvas closed the menu and was lost. The input hook's doc said
only primary presses are absorbed; now every outside press still closes the
menu, but only a primary one is removed, so a right-click elsewhere closes the
menu and opens the menu there, as in native apps.
Adds a trial: with a control's context menu open, a right-click on the canvas
closes it and the canvas asks for its own menu at that point.
Union of the port's and upstream next's changes: document-face chains carried onto
upstream's over-interface faces (one begin-pass edit), refused/declined commands and
requested pastes onto the rewritten command board (resolve_once, Instances), drop
operations beside region tokens in drag registration, wheel layers/exit gate/modal
family beside scroll_owner_inside, locate_wheel beside press records, text_edit
scroll + submit_key, both focus/policy additions, test module lists and trials.
257 conflicted files staged with their conflict markers (630 hunks). The one
modify/delete, crates/ui-patterns/src/patterns/preferences/body.rs (deleted
upstream, modified by the port), keeps the port's file for its area to carry
into upstream's preferences/page.rs. Plan: landing/fw-sync-plan.md.