Repository navigation
fix(dots): center the active section when the section list opens - #13
Merged
Merged
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Pending section centering is not retried when rows are measured after the content-size notification, leaving the list at the top until the one-second retry.
1 open issue
What changed in this PR
This PR updates the dots component’s section list to center the active section when it opens, including sections beyond the initial rendered rows.
Changes:
- Tracks pending centering and retries on content-size changes, with an estimated-offset fallback for unmeasured rows.
- Adds opening and delayed-layout tests, and updates expectations for non-animated initial scrolling.
- Removes the related backlog item and updates the scrolling description.
| File | Description |
|---|---|
src/FastScrollSectionDots/FastScrollSectionFullList.tsx |
Adds pending centering, layout tracking, and failed-scroll recovery. |
src/FastScrollSectionDots/__tests__/FastScrollSectionDots.test.tsx |
Tests centering on opening and after additional rows are measured. |
docs/backlog.md |
Removes the centering backlog item and revises scrolling documentation. |
Review effort: Balanced
| }} | ||
| onLayout={onLayout} | ||
| onScrollToIndexFailed={onScrollToIndexFailed} | ||
| onContentSizeChange={centerPendingSection} |
gfrancischini
force-pushed
the
fix/section-list-center-on-open
branch
from
November 9, 2026 21:13
805e27d to
0d4016f
Compare
The section list renders nothing while closed, so the touch that opened it found no list to scroll and the list opened at its top. Only a later touch, or the retry a second later, centered the section. The section to center now waits until the list has laid out its row, and scrolls on each content size change until it does. A row past the first batch is reached by jumping to where the average row height puts it, which renders the rows around it. These scrolls are not animated: on Android an animated scroll started while the list lays out its rows does not move it. The retry a second later stays animated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The list can report its content size before it lays its rows out, and laying them out need not change that size again. Centering then found no row to estimate from and waited for the retry a second later. Try again every 50 ms until a row is laid out, until that retry takes over. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gfrancischini
force-pushed
the
fix/section-list-center-on-open
branch
from
November 11, 2026 02:46
0d4016f to
ecf378e
Compare
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
The section list renders nothing while closed. The touch that opened it found no list to scroll, so the list opened at its top. Only a later touch, or a retry, centered the section. Rows past the first batch made it worse:
scrollToIndexfailed for them, and the failure was ignored.The first scrolls are not animated. On Android, an animated scroll started while the list is still laying out its rows did not move it. With the fix but an animated scroll, the list still opened at its top. This also applies while dragging the dots with the list open: the list now jumps to the section under the finger instead of animating to it. The retry a second later stays animated.
The backlog item is removed from
docs/backlog.md.Evidence
Unit tests. Two new tests: the first fails on
main(no scroll at all), the second covers rows past the first batch. The existing centering test now expects the first scroll unanimated.yarn test(98 passed, 2 todo),yarn typecheckandyarn lintpass.On a device. Android emulator (API 36), example app, categories screen, about 45 sections. Steps: scroll the list so the dots show, then tap a dot far down (around section 30).
main)Frame by frame, 0.2 s apart from the tap (top: before, bottom: 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
The change only affects how the section list scrolls to its active row.
Blast Radius: section list scrolling
The visible change besides the fix: while the list is open, it now jumps to the section under the finger instead of animating there. The public props and handle are unchanged.
This PR and "keep the section list open while a finger rests on the dots" both change
show()inFastScrollSectionFullList.tsxand add tests at the same place. Whichever merges second needs a small rebase.🤖 Generated with Claude Code