Thing 2.0 cut 7b: pointer input (hit-test from placed geometry, press, drag, wheel, render reads the session) #27
Loading…
Reference in a new issue
No description provided.
Delete branch "hands/thing2-commands-pointer"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Thing 2.0 cut 7b (
thing2:cut_spec:cut-commands-pointer.r2):Core::framenow routes the pointer.input::hit_testreads the geometry render placed: half-openPlaced::visible, reverse paint order, a modal overlay shutting out everything painted before it, and the modal's scrim as the hit when nothing inside it is under the point. It applies no scale, scroll or clip of its own.input::targetclimbs from the topmost node to the nearest Button, Toggle, Slider, Select or TextInput, or the scrim.input::Input/Pointerown press state. Up over the pressed target presses a Button or the scrim (the overlay's dismiss) and flips a Toggle's draft-or-bound value; a Slider's down and move writeDrafts(snapped frommin, clamped) and up commits once wherever it lands; a cancel restores the draft the press found. Only the primary button presses. Every commit ends inCommands::activate.ScrollOffsetsthrough the oneclamp; at the end of travel the next scroll ancestor takes it. ALineswheel is one cell in Cells and the theme's body size in Pixels.Session(drafts over bound values, busy and marked node states) through onecurrent().Session::EMPTYdraws every existing golden byte for byte; a busy Button draws disabled and a mark draws onething.errorstroke.Pointer and wheel are pinned in Pixels at scale 1 and 1.5 and in Cells; every test derives its points from
Placed. Press, drag, cancel, modal, clip, scroll chaining and frame-ordering cases are incrates/thing-core/tests/input.rs; the session goldens are inrender.rs.Verification:
cargo test --workspace --lockedon Yggdrasil, 435 passed. cargo-mutants (test_workspace = true, new.cargo/mutants.toml): 154 tested, 118 caught, 22 missed, 14 unviable; after tests were added, the 21 survivors that still existed re-ran at 20 caught, 1 missed (slider_value:rect.w > 0.0to>=, a zero-width track is never hit).The TUI example in a pty on Yggdrasil: a click on f02's sign-in Button now draws it disabled (busy); a click on f01's restart Button mints nothing visible (its command asks for confirmation, and the dialog is a later cut).
Known: this is the first live caller of activation refusals (
thing2:follow_up:activation-refusal-typed-cause): a click while a command waits on confirmation returns anActivationRefuseddiagnostic whose cause is free text. Not fixed here.🤖 Generated with Claude Code