From 7e03be6efd9224735f736e2aeca9bf3e6e9a3d5a Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 29 Nov 2026 05:42:23 +0100 Subject: [PATCH] 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 --- crates/thing-core/src/frame.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/thing-core/src/frame.rs b/crates/thing-core/src/frame.rs index 51f671e..57cd035 100644 --- a/crates/thing-core/src/frame.rs +++ b/crates/thing-core/src/frame.rs @@ -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 {