Skip to content

Wait for vertical scroll endpoints before visual captures - #60417

Merged
dalves merged 1 commit into
react:mainfrom
dalves:export-D134586364
Dec 1, 2026
Merged

dalves merged 1 commit into
react:mainfrom
dalves:export-D134586364

Conversation

@dalves

@dalves dalves commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Summary:
The vertical scroll-to visual test can capture the previous scroll position instead of the requested one.

  1. A button requests an animated scroll.
  2. waitForAnimationToEnd can observe unchanged frames before that scroll starts and return immediately.
  3. The screenshot is then taken at the old endpoint, without checking whether the scroll reached its destination.

What changes

The RNTester example exposes its current endpoint through a nonvisual testID on its existing outer container. The marker starts at top, matching the initial zero offset. Requests for a different endpoint clear it to pending; requests at an already-acknowledged endpoint preserve it, since a no-op scroll need not emit another event. Native scroll offsets update the marker, including the final momentum event when intermediate scroll events are throttled. The flow waits for the requested endpoint before its existing animation-settling check and screenshot.

The list content, styles, animated scroll commands, screenshot IDs, and crops are unchanged. The horizontal and sticky-header flows are unchanged.

Changelog: [Internal]

Differential Revision: D134586364

Summary:
The vertical scroll-to visual test can capture the previous scroll position instead of the requested one.

1. A button requests an animated scroll.
2. `waitForAnimationToEnd` can observe unchanged frames before that scroll starts and return immediately.
3. The screenshot is then taken at the old endpoint, without checking whether the scroll reached its destination.

What changes

The RNTester example exposes its current endpoint through a nonvisual `testID` on its existing outer container. The marker starts at top, matching the initial zero offset. Requests for a different endpoint clear it to pending; requests at an already-acknowledged endpoint preserve it, since a no-op scroll need not emit another event. Native scroll offsets update the marker, including the final momentum event when intermediate scroll events are throttled. The flow waits for the requested endpoint before its existing animation-settling check and screenshot.

The list content, styles, animated scroll commands, screenshot IDs, and crops are unchanged. The horizontal and sticky-header flows are unchanged.

Changelog: [Internal]

Differential Revision: D134586364
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 1, 2026
@facebook-github-tools facebook-github-tools Bot added p: Facebook Partner: Facebook Partner labels Dec 1, 2026
@meta-codesync

meta-codesync Bot commented Dec 1, 2026

Copy link
Copy Markdown

@dalves has exported this pull request. If you are a Meta employee, you can view the originating Diff in D134586364.

@zeyap zeyap left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review automatically exported from Phabricator review in Meta.

@dalves
dalves merged commit 3c504a7 into react:main Dec 1, 2026
106 of 110 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants