Repository navigation
mobile: coast-frame-pacing - #854
Conversation
Part of fizzyedit/work#362 Agent-Team: macos Worker: claude Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
PM note: how this PR will be handledWhat it is for: mobile: coast-frame-pacing Rules that apply: none special. Things to watch (checked by rule):
What happens next:
A living status comment below is kept current. Nothing here is a merge decision. |
Where this PR standsStage: Done: approved What the PM needs before approving (ticks as it is met; the full CI runs only at the end, after the reviews are clean):
Reviews at the current commit (
Updated 2026-10-26 16:15 UTC by the PM. This comment is edited in place. |
Part of fizzyedit/work#362
Goal
A touch coast glides to a stop instead of stepping: its slow tail moves a fraction of a pixel a frame, and dvui's
snap_to_pixelsdrew it at whole pixels (a 1 px step every few frames).What changed and why
core/widgets/ScrollArea.zig: while either axis coasts, the area turnssnap_to_pixelsoff frominittodeinit, so its content draws at the fractional offset.deinitputs the setting back, so the first frame after the coast ends is snapped and text is crisp at rest. Decay, windowed release speed and the time-based step are untouched.How it was verified
New test "a slow coast draws at a new place every frame, then snaps at rest" (120 fps frames, 25 to 60 pt/s tail): fails without the change (
zb build test-integration: 740/741, the drawn y repeats), passes with it. Drawn displacement per frame at 51 pt/s: before -1, -1, -1, 0 px (whole-pixel steps); after -0.83, -0.79, -0.76, ... -0.47 px at 29 pt/s (fractional, never repeating). Measured in the headless dvui test window only (scale 1), not on a device; foxnne checks on the testapp. Gates run: check-fmt, build, test, test-integration, check-web, test-sdk-version, lint.Not done / follow-ups
Firefox's 60 Hz rAF cap and heavy frames during a coast (items 1 and 4 of the issue) are not touched; see linux/claude's note on the issue. No on-device numbers.
Changes (1 files, +43/-1)
Gates: 6 of 6 passed
scripts/check-fmt.sh(exit 0)scripts/zb build --summary all(exit 0)scripts/zb build test --summary all(exit 0)scripts/zb build test-integration --summary all(exit 0)scripts/zb build check-web --summary all(exit 0)scripts/zb build test-sdk-version --summary all(exit 0)