Repository navigation
fix: keep native scroll adjustments precise - #602
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 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
LegendList anchors native scroll adjustments to a view placed 10,000,000 points down. Native layout stores positions as 32-bit floats, which hold that value only to whole points, so each adjustment was rounded while the items moved by the exact amount. On Android, a chat opened at a linked message moved up by 1-2 px when the rows above it were measured. Patch the anchor down to 1,000,000 points, as proposed upstream in LegendApp/legend-list#602. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
40 tasks done
chrispader
added a commit
to margelo/Expensify
that referenced
this pull request
Nov 9, 2026
LegendList anchors native scroll adjustments to a view placed 10,000,000 points down. Native layout stores positions as 32-bit floats, which hold that value only to whole points, so each adjustment was rounded while the items moved by the exact amount. Patch the anchor down to 1,000,000 points, as proposed upstream in LegendApp/legend-list#602. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
38 tasks done
ScrollAdjust placed its anchor view 10,000,000 points down so native maintainVisibleContentPosition always anchors to it. Native layout stores positions as 32-bit floats, which hold values of that size only to the nearest whole point. Each adjustment was rounded by up to half a point while the items moved by the exact amount, so the visible content shifted by one or two pixels when items above the viewport changed size. A bias of 1,000,000 keeps the anchor below the scroll offset and keeps positions precise to 1/16 of a point. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
chrispader
force-pushed
the
fix/precise-scroll-adjust-anchor
branch
from
November 11, 2026 12:15
7901cbd to
1142f27
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.
ScrollAdjustplaces its anchor view 10,000,000 points down, so nativemaintainVisibleContentPositionanchors to it. Native layout stores positions as 32-bit floats, and at that size a float only holds whole points. Each scroll adjustment was rounded by up to half a point, while the items above the viewport moved by the exact amount, so the visible content shifted by the difference, about 1 to 2 px on Android. With a bias of 1,000,000, the anchor's position stays precise to 1/16 of a point.The bias also sets how far the list can scroll, because native MVCP only anchors to the view while it sits below the scroll offset. Each adjustment moves the anchor and the scroll offset together, so prepended content doesn't use up the range. Only content that is scrolled through without an adjustment does, such as the initial data and appended items. 1,000,000 points is about 10,000 rows of 100 points. If you'd rather trade some precision for range, 2,097,152 doubles it and still rounds to a quarter point.
We hit this in Expensify/App#100733, which moves the chat message list to LegendList. On Android, a chat that opens at a linked message moved up by 1 to 2 px when the rows above it were measured. Expensify currently carries this fix as a patch.
Reproduction
estimatedItemSize, withmaintainVisibleContentPositionenabled.🤖 Generated with Claude Code