fix(perps): prevent Android crash in tutorial carousel Rive animations cp-7.81.0#31547
Conversation
…ly active Rive animation ScrollableTabView renders all children simultaneously, causing 4-5 Rive native renderer instances to compete for GPU resources on Android. Only mount the Rive component for the currently visible tab so a single instance exists at any time.
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
This is a low-risk UI-only change within the Perps tutorial carousel. It doesn't touch core logic, state management, or navigation. The primary tag is Performance Test Selection: |
|
Unable to reproduce using the build from this branch. Perps.fix.mp4 |
Description
The Perps "Learn the basics" tutorial carousel crashes on Android when navigating through the screens.
Root cause:
ScrollableTabViewrenders all child tabs simultaneously, which means 4–5<Rive>components (one per tutorial screen with an animation) are all mounted withautoplay={true}at the same time. On Android, the Rive native renderer cannot handle multiple concurrent GPU-accelerated animation instances and crashes.Fix: Only mount the
<Rive>component for the currently visible tab (currentTab === index). This ensures a single native Rive renderer instance exists at any time. When the user swipes or taps Continue, the previous instance is unmounted and the next one takes its place.iOS is unaffected because its Metal rendering pipeline handles concurrent Rive instances more gracefully.
Changelog
CHANGELOG entry: Fixed a crash on Android when navigating through the Perps tutorial carousel
Related issues
Fixes: #31540
Manual testing steps
Screenshots/Recordings
N/A — no visual change; this is a crash fix. The tutorial screens render identically, only one Rive animation is mounted at a time instead of all simultaneously.
Before
App crashes on Android when navigating through tutorial carousel screens.
After
Tutorial carousel completes without crash on Android.
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Note
Low Risk
Single conditional around Rive mounting in the tutorial carousel; behavior is unchanged except avoiding concurrent animations on Android.
Overview
Fixes an Android crash in the Perps “Learn the basics” tutorial by ensuring only one native Rive animation is mounted at a time.
ScrollableTabViewkeeps every tab’s children in the tree, so every screen withriveArtboardNameused to mount<Rive autoplay>together. The change addsindexin the screen map and renders the animation only whencurrentTab === index, so swiping or tapping Continue unmounts the previous instance before the next one loads. No intended UI change on iOS.Reviewed by Cursor Bugbot for commit 17b73bc. Bugbot is set up for automated code reviews on this repo. Configure here.