Thing 2.0 cut 7b: pointer input (hit-test from placed geometry, press, drag, wheel, render reads the session) #27

Merged
eureka merged 11 commits from hands/thing2-commands-pointer into main 2026-11-29 05:16:57 +00:00
Showing only changes of commit 7e03be6efd - Show all commits

frame: the notes switch writes are said in this frame, as before the route moved

The route now runs before the switch, so the diagnostics it returns are held and joined to the notes after the
switch has pushed its own (a held resume dropped on leaving a surface is said in the same frame).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Meta Vens 2026-11-29 05:42:23 +01:00

View file

@ -124,17 +124,18 @@ impl Core {
pub fn frame(&mut self, input: FrameInput, ports: Ports<'_>) -> FrameOutput {
let FrameInput { now, viewport, scale, events } = input;
let port = ports.state;
let mut diagnostics = std::mem::take(&mut self.notes);
// Input is judged entirely against the frame the user saw: its geometry and the values bound
// into it. Nothing of this frame (the surface it switches to, the provider updates it drains,
// the tree it binds) is in place yet, so no event reads a world the user did not look at.
diagnostics.extend(self.route(&events, scale, now, ports.ids, port));
let routed = self.route(&events, scale, now, ports.ids, port);
let mut changes = Vec::new();
if self.wanted != self.shown {
self.switch(port, &mut changes);
}
changes.extend(port.drain());
let mut diagnostics = std::mem::take(&mut self.notes);
diagnostics.extend(routed);
let mut effects = Vec::new();
let mut rebound = false;
for change in &changes {