Files
hapi/web/src
68a0c4f1a5 feat(web): smooth low-rate indicator motion behind a setting (#2457)
* feat(web): smooth low-rate indicator motion behind a setting

The 8 Hz ticker trades animation smoothness for style-recalc
savings: a 22.5-degree rotation jump every 125 ms reads as a stepped
spinner, and a square opacity flip between 1 and 0.5 reads as harsh
blinking rather than breathing.

Keep the ticker and its perf win, but let the browser fill in the
frames: writers now also set a 125 ms transform/opacity transition
(compositor-only properties, no main-thread style recalc — the cost
the ticker was designed to avoid) and the pulse interpolates as a
triangle wave instead of a square one.

Users who prefer the strictest power saving can turn smoothing off in
Settings → Display → Sessions; the off path restores the exact #2447
cadence (square flips, stepped rotations). Writers re-read the flag
every tick, so the toggle takes effect on the next 125 ms step with no
React state.

* =test(web): adapt badge assertion to the smoothing triangle wave

---------

Co-authored-by: miuiadmin <miuiadmin@users.noreply.github.com>
2026-11-17 15:15:23 +08:00
..