Skip to content

fix(annotate): Undo ring stops when held and drains again after - #3071

Merged
kitlangton merged 1 commit into
devfrom
fix-annotate-countdown-motion
Nov 28, 2026
Merged

kitlangton merged 1 commit into
devfrom
fix-annotate-countdown-motion

Conversation

@kitlangton

Copy link
Copy Markdown
Collaborator

The Annotate Undo countdown ring now stops when you point at the capsule and drains again when you move away, instead of running on and then freezing.
The ring around the Undo button shows how long is left to take a send back. Pointing at the capsule pauses that countdown.

❌ Before

  1. Pointing at the capsule paused the countdown, but the ring kept draining. ❌
  2. Moving away snapped the ring back to where it had paused and froze it there. ❌
  3. When the time ran out, the frozen ring vanished at once instead of fading. ❌

✅ After

  1. Pointing at the capsule stops the ring at once, and it asks for no frames while it waits.
  2. Moving away drains it from where it stopped, every frame, to the end.
  3. It fades out as the time runs out.

The ring is rebuilt whenever the countdown pauses or resumes. That rebuild happened in the next frame's update step, which didn't tell the view to redraw. The pointer had already redrawn the view, so the screen always drew the previous ring.

- pointer pauses or resumes → view redraws with the old ring
- next frame: rebuild the ring, report "nothing changed" → old ring stays on screen
+ pointer pauses or resumes → rebuild the ring → view redraws with it
+ every frame: a rebuilt ring counts as a change, so the view redraws

📊 Proof

Case Before After
Ring while the pointer holds it ❌ keeps draining ✅ stands still, no frames
Ring after the pointer leaves ❌ snaps back, frozen ✅ drains from where it stopped
Ring at the end ❌ disappears suddenly ✅ fades out
Frames after the window ends ✅ none ✅ none

A new motion test plays a send at 60 fps, points at the capsule, then moves away. It checks that the ring moves by about the same step each frame, holds still with no frames while it's held, and redraws nothing at rest, with and without Reduce Motion. It fails without the fix ("a held ring moved -1.6").

👀 Read: capture_capsule/mod.rs, where the ring now syncs with the rest of the live state and poll counts a rebuilt ring as a change. The rest is routine.

🔍 Seen in real use · reproduced in a headless motion test · no static rendering change, so goldens are unchanged

Checks run
  • scripts/check capture_capsule: 148 passed
  • cargo clippy --locked --bin hex -- -D warnings: clean
  • python3 scripts/code-shape.py: passes (only existing warnings)
  • New test without the fix: fails, "calm at 2.050 s: a held ring moved -1.6001282"

…tdown

The ring was rebuilt in poll after a hover handler had already re-run the view, and poll did not report the rebuild as a change, so the view kept the previous ring: held rings drained on and resumed ones stood frozen until the chip left.
@kitlangton
kitlangton merged commit baec073 into dev Nov 28, 2026
4 checks passed
@kitlangton
kitlangton deleted the fix-annotate-countdown-motion branch November 28, 2026 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant