Repository navigation
fix(indicator): keep the thumb at the end when the list overscrolls - #18
Merged
Merged
Conversation
onScrollToOffsetPercentage dropped offsets below 0 and above 1. An iOS list reports them while it bounces past either end, so the thumb stopped where the last in-range frame left it: short of the top until the bounce settled, and short of the bottom for good when the list came to rest just past 1. On a short list one frame of a fling is a long way on the track. The handle now clamps the offset to 0..1, so the thumb sits at that end and the bar stays on screen while the list bounces. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The IndicatorBounce screen passes the indicator unclamped offsets over the scrollable height, as the production app does, and shows the last one it reported, so an iOS bounce past either end can be watched on the thumb. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
An iOS list reports offsets below 0 and above 1 while it bounces past either end.
onScrollToOffsetPercentagedropped those frames, so the thumb stayed wherever the last in-range frame left it:On a long list one frame is a pixel or two on the track. On a short list one frame of a fling covers a lot of the track, and the generic list wrapper puts an indicator on every list, short ones included.
The example gets an IndicatorBounce screen: 30 rows (about two screens) under a
FastScrollIndicator, offsets over the scrollable height and not clamped, as the production app passes them, and a readout of the last offset reported (orange when outside 0..1). The backlog item is removed fromdocs/backlog.md.Evidence
Unit test. It replaces the test that asserted the old behavior ("ignores a scroll offset outside the 0..1 range"). It fails on
mainand passes here:yarn test(101 passed, 1 todo),yarn typecheckandyarn lintpass.On a device. iPhone 17 Pro Max simulator (iOS 26.5), example app on Expo SDK 52 (Reanimated 3.16, New Architecture), IndicatorBounce screen. The same two flings each time: one to the bottom, then one back to the top.
main)Thumb position read from every frame of the recordings (30 fps, bottom edge of the thumb in screen pixels; the list spans 447 to 2868):
At rest at the bottom the readout stays orange at "1.000": the offset is just above 1, so
mainnever moves the thumb to the end.Bottom-right corner at rest after the fling to the bottom (left: before, right: after):
Top-right corner 0.3 s into the fling back to the top (left: before, right: after):
Full-resolution recordings: before.mp4, after.mp4. They are on the
pr-assetsbranch, which only holds PR media and is not meant to be merged.Merge Danger
Door: two-way
One clamp in the indicator's handle. Reverting it restores the old behavior.
Blast Radius: indicator thumb
FastScrollSectionDots.onScrollToOffsetPercentagealready accepted any value and is untouched.🤖 Generated with Claude Code