Repository navigation
Conversation
With `animate-layout` (parsed by nativephp/mobile, NativePHP/mobile-air#736) the Android scroll view wraps each row in animateItem(), so keyed rows slide to their new places, new ones fade in and removed ones fade out. iOS needs nothing here: core animates the node. Both scroll views read `auto_scroll_token`, so a new token asks for the same child again, and `auto_scroll_animated`, which animates every move except the one the view opens with. Under Reduce Motion a view that asked for animated moves jumps instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
simonhamp
added a commit
to NativePHP/dev-null-app
that referenced
this pull request
Nov 21, 2026
The scroll view now has animate-layout, so the rows the page keeps slide to their new places and the ones it adds or drops fade, and auto-scroll-animated, so the first move animates too. The focused commit is keyed commit-<id>, as it is among the commits above it, so moving up the tree slides that row rather than redrawing it. Going back to a row the scroll view already went to used to mount the scroll view again, which would make every row new. It now passes a new auto-scroll-token instead. These need NativePHP/mobile-air#736 and NativePHP/mobile-ui#225. Without them the move jumps, as before, and asking for the same row twice in a row doesn't scroll. The test that reads the new props skips until vendor has them (Tests\Support\LayoutAnimation). 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.
The renderer half of NativePHP/mobile-air#736. That PR parses the new attributes and does the core animation; this one makes the scroll views use them.
What changed
animate-layouton a scroll view, Android: each row of the LazyColumn / LazyRow is wrapped in a Box carryingModifier.animateItem(). Rows are already keyed by node id, so a row kept across frames slides to its new place, a new one fades in and a removed one fades out. Without the prop the rows are composed exactly as before. iOS needs nothing here because core animates the scroll view node itself.auto_scroll_token, both platforms: the request the scroll view follows is now the index plus the token. Asking for the same index with a new token scrolls again. Before, a repeated index did nothing, and the devnull app worked around that by remounting the scroll view with a new key.auto_scroll_animated, both platforms: animate every move, the first one included, except a request the scroll view already had when it appeared. A screen still opens where it's meant to be instead of flying there. Without the prop the first move jumps and later ones animate, as now. On iOS, a view that set the prop jumps under Reduce Motion. Android's scroll animations follow the animator duration scale through Compose.scroll-viewrow in the boost skill.tests/android/AnimateLayoutColumnTest: reorders a column withanimate-layout(core's FlexContainer) and checks a child passes between its old and new place before landing, and that without the flag it jumps. It needs-PmobileRootpointing at a mobile checkout with #736, since that's whereLocalAnimateLayoutChildrenlives. CI doesn't run this module.Watch for
native:listdoesn't getanimateItem()yet. Its rows go through several item builders (sections, sticky headers, the pager header) and I left it alone. iOS lists should animate through core, but I haven't checked.Testing
php -d auto_prepend_file= vendor/bin/pest: 527 passed.swiftc -typecheck -wmowith mobile-air #736'sNativeRender. Same 156 baseline errors as main, none new, and a planted error in the new scroll code showed up.compileDebugKotlinin a copy of a built app's Android project with these renderers and #736's core, plus a planted error.tests/androidagainst #736: 106 passed.🤖 Generated with Claude Code