Skip to content

Keep non-layout animations on the synchronous path while another view animates layout - #58763

Closed
bartlomiejbloniarz wants to merge 2 commits into
mainfrom
animated-props-per-view-routing
Closed

bartlomiejbloniarz wants to merge 2 commits into
mainfrom
animated-props-per-view-routing

Conversation

@bartlomiejbloniarz

Copy link
Copy Markdown
Contributor

Summary:

The shared animation backend decided per surface whether a frame's animated props go through a shadow tree commit or straight to the mounted views. As soon as one view animated a layout prop, every animated view on that surface went through the commit path for the whole animation, including views that only animate transform or opacity. Besides the extra commit work, on Android this moved those views from updatePropsSynchronously to regular mounts. There the synchronous mount props cache (overrideBySynchronousMountPropsAtMountingAndroid) replaced the incoming transform with its last synchronously written value, so the view froze while the other view's layout animation ran and jumped when it ended.

The decision is now made per view. SurfaceUpdates holds a surface's mutations keyed by view tag, and applySurfaceUpdates splits them into views with layout updates, which go through commitUpdates, and the rest, which are applied synchronously. AnimationMutation and AnimationMutations move to AnimationMutation.h, still included by AnimationBackend.h. AnimatedPropsRegistry::update reads the frame's batches instead of the merged per-surface map.

Changelog:

[General] [Fixed] - A view animating only non-layout props on the shared animation backend no longer freezes while another view on the surface animates a layout prop

Test Plan:

  • New Fantom test "non-layout props stay on the direct path while another view animates layout": one view animates transform while a sibling animates height. The transform must reach the direct-manipulation props. It fails before this change and passes after.
  • AnimatedBackend-itest.js and Animated-itest.js pass.

… animates layout

Summary:

The shared animation backend decided per surface whether a frame's animated props go through a shadow tree commit or straight to the mounted views. As soon as one view animated a layout prop, every animated view on that surface went through the commit path for the whole animation, including views that only animate `transform` or `opacity`. Besides the extra commit work, on Android this moved those views from `updatePropsSynchronously` to regular mounts. There the synchronous mount props cache (`overrideBySynchronousMountPropsAtMountingAndroid`) replaced the incoming transform with its last synchronously written value, so the view froze while the other view's layout animation ran and jumped when it ended.

The decision is now made per view. `SurfaceUpdates` holds a surface's mutations keyed by view tag, and `applySurfaceUpdates` splits them into views with layout updates, which go through `commitUpdates`, and the rest, which are applied synchronously. `AnimationMutation` and `AnimationMutations` move to `AnimationMutation.h`, still included by `AnimationBackend.h`. `AnimatedPropsRegistry::update` reads the frame's batches instead of the merged per-surface map.

Changelog:

[General][Fixed] - A view animating only non-layout props on the shared animation backend no longer freezes while another view on the surface animates a layout prop

Test Plan:

- New Fantom test "non-layout props stay on the direct path while another view animates layout": one view animates `transform` while a sibling animates `height`. The transform must reach the direct-manipulation props. It fails before this change and passes after.
- `AnimatedBackend-itest.js` and `Animated-itest.js` pass.
… animates layout: tests and scaffolding

Tests and C++ API snapshots for the change in the parent commit.
@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 Sep 30, 2026
@facebook-github-tools facebook-github-tools Bot added p: Software Mansion Partner: Software Mansion Partner p: Facebook Partner: Facebook labels Sep 30, 2026
@bartlomiejbloniarz
bartlomiejbloniarz added this pull request to stack #58767 September 30, 2026 13:00
@bartlomiejbloniarz
bartlomiejbloniarz deleted the animated-props-per-view-routing branch October 1, 2026 08:45
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. p: Facebook Partner: Facebook p: Software Mansion Partner: Software Mansion Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant