Repository navigation
fix: finish silent initial-scroll retries on their current target - #604
Open
chrispader wants to merge 2 commits into
Open
chrispader wants to merge 2 commits into
chrispader wants to merge 2 commits into
Conversation
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
chrispader
added a commit
to margelo/Expensify
that referenced
this pull request
Nov 9, 2026
On Android, a chat opened at a linked message appeared with the message at the top of the list and then moved down to its offset. LegendList applied the native anchor adjustments for rows measured during its initial scroll a second time, and its retries reused a stale target. Patch LegendList to skip anchor moves a later native scroll already includes, move the pending target with each adjustment, and finish its silent-scroll retry before the scroll completes (LegendApp/legend-list#604). The list also requested older actions from scroll events that arrive before the initial scroll lands, which inserted a page above the linked message while it was being positioned. Older actions now load from scroll events only once the list is ready. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
chrispader
added a commit
to margelo/Expensify
that referenced
this pull request
Nov 9, 2026
Before a list is ready, LegendList moved its native anchor a frame after the positions changed, so an initial scroll dispatched in between was shifted a second time, and retries reused a stale target. Patch LegendList as proposed upstream in LegendApp/legend-list#604. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…list Before the list is ready, requestAdjust moves state.scroll and the item positions right away but applies the native scroll adjustment on the next frame. Two things went wrong in between. setInitialRenderState could mark the list ready before that frame ran, so the containers became visible with items at the unadjusted offset and jumped once the adjustment landed. Readiness now waits until every adjustment queued before the list was ready has run, and the last one re-checks readiness. The queued callback owns the adjustingFromInitialMount counter, so the Android old-architecture workaround path releases it too. A native initial scroll dispatched in that frame already targets the adjusted offset, so moving the anchor afterwards shifted the list a second time. A deferred adjustment is now skipped when an absolute native scroll was issued after it was requested. The in-flight native initial scroll target also moves with each adjustment, so completion retries reissue the current offset instead of the one recorded at dispatch. Web retargets from the index and is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When an Android initial scroll dispatches without a native scroll event, the completion fallback retries it by nudging the offset one point away and returning to the target on the next frame. Two things could leave the list off its target. Another completion check could finish the scroll before the return frame ran. Finishing cancelled the frame, so the list stayed one point away from its target. Finishing now runs a pending return first. The return also reissued the offset recorded before the nudge. Adjustments that land in between move the target (LegendApp#600), so the return now reads the watchdog's current target offset. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
chrispader
force-pushed
the
fix/native-initial-scroll-target
branch
from
November 11, 2026 12:15
a3adce7 to
0eb9e97
Compare
38 tasks done
chrispader
added a commit
to margelo/Expensify
that referenced
this pull request
Nov 12, 2026
Each LegendList patch is now the build output of its upstream PR, so the patches change exactly what the PRs change, in every bundle the PRs touch. - 001 and 003 now also patch the native bundles, as their PRs change shared code. - 002 adds the explicit maintainVisibleContentPosition anchor option that LegendApp/legend-list#597 now proposes, instead of anchoring the last visible item in every list with alignItemsAtEnd. - 004 contains LegendApp/legend-list#600, which now also skips deferred adjustments that a later native scroll already includes and moves the initial scroll target with each adjustment. - 006 keeps only the silent-retry fix from LegendApp/legend-list#604. 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.
When an Android initial scroll dispatches without a native scroll event, the completion fallback retries it by nudging the offset one point away and returning to the target on the next frame. If another completion check finished the scroll first, the return frame was cancelled and the list stayed one point off its target. The return also reissued the offset recorded before the nudge, even when adjustments had moved the target in the meantime. With this change, finishing a scroll runs a pending return first, and the return reads the current target.
This builds on #600, which makes adjustments move the target of an in-flight initial scroll. Until #600 lands, this PR also shows its commit, and only the last commit belongs here. The deferred-adjustment fix this PR used to contain moved to #600, since both changed the same callback.
We hit this in Expensify/App#100733, which moves the chat message list to LegendList. Expensify currently carries this fix as a patch.
🤖 Generated with Claude Code