Repository navigation
fix: land initial-mount scroll adjustments once before revealing the list - #600
Open
chrispader wants to merge 1 commit into
Open
chrispader wants to merge 1 commit into
chrispader wants to merge 1 commit into
Conversation
Codex Review SummaryThis 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 5, 2026
…ents LegendList could mark a list ready and show it one frame before the native scroll adjustment for items measured during its initial layout ran. On iOS, a chat that opens at a linked message showed the message at the top and then moved it down by about 45 points. The patch carries LegendApp/legend-list#600 until it is released. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
chrispader
force-pushed
the
fix/ready-after-initial-adjustments
branch
from
November 9, 2026 10:53
062938a to
240eed4
Compare
…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>
chrispader
force-pushed
the
fix/ready-after-initial-adjustments
branch
from
November 11, 2026 12:15
240eed4 to
0e6e62b
Compare
chrispader
added a commit
to chrispader/legend-list
that referenced
this pull request
Nov 11, 2026
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>
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.
Before a list is ready,
requestAdjustmovesstate.scrolland the item positions right away but applies the native scroll adjustment on the next frame.setInitialRenderStatecould mark the list ready before that frame ran, so the items appeared at the unadjusted offset and jumped once the adjustment landed. A native initial scroll dispatched in between also already targets the adjusted offset, so the late anchor move shifted the list a second time, and completion retries reissued the offset recorded at dispatch.With this change, the list becomes ready only after every adjustment queued before that point has run. A deferred adjustment is skipped when an absolute native scroll was issued after it was requested, and the target of an in-flight native initial scroll moves with each adjustment. Web retargets from the index and is unchanged.
The queued callback now also owns the
adjustingFromInitialMountcounter. Before, only the regular path decremented it, so the Android old-architecture workaround would have kept the list hidden.This PR now also contains the deferred-adjustment fix from #604, because both change the same callback. #604 keeps only the silent-retry fix and builds on this PR.
We hit this in Expensify/App#100733, which moves the chat message list to LegendList. On iOS and Android, a chat that opens at a linked message showed the message at the top of the list and then moved it down to its offset. Expensify currently carries this fix as a patch.
Reproduction
initialScrollIndex: { index: 37, viewOffset: 40 }whose items above index 37 render smaller thanestimatedItemSize.🤖 Generated with Claude Code