mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-14 20:03:52 +00:00
00b3ba8ed3
Three simplifications from a review of where the complexity actually sat. The animation frame loop now runs for the lifetime of the view instead of being woken around each action. Waking a sleeping loop meant that every path which could move the script had to remember to do it, across eight call sites, and forgetting simply lost the action with no error. An idle frame costs one pass of arithmetic and the browser suspends the loop entirely while the tab is hidden. This removes ensureLoop, the frame handle and the work test. Running always did break something, which is worth recording: any scroll the loop had not made itself was reverted on the next frame, so a scrollbar drag or find in page would snap back. The loop now compares the scroller against where it left it and adopts the DOM position when they differ. That covers every cause rather than only the gestures which had a handler, so the adopt flag and its wiring are gone too, and there is an end to end test for it. Dropped hidePast in favour of dimPast. They read as alternatives but only one is safe during a read: removing past events shortens the document underneath the reader, while dimming is only paint. Also dropped the shade reading line variant, which drew the same gradient over the same box as dimPast, so turning both on stacked two of them. The reading line position was carried as two CSS variables, a percentage and a unitless number. That split caused the padding bug earlier. One unitless variable now serves both, scaled by 1% for the overlays and 1dvh for the padding. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Cb8RVPNQ2ETPJxdy4b8CHf