refactor(MainNavigator): migrate MainNavigator to native stack#31606
Conversation
|
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. |
…tack Drop temporary Developer Options route preview used for migration QA and align MainNavigator naming with native stack navigators throughout the file. Co-authored-by: Cursor <cursoragent@cursor.com>
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Key impacts:
Since the root navigator is the backbone of ALL navigation in the app, any regression in navigation behavior (gesture handling, transitions, modal presentations, back navigation, deep links) would affect every feature area. All E2E test suites navigate through this root navigator to reach their respective screens, making this a cross-cutting change that warrants running all test tags. Performance Test Selection: |
⚡ Performance Test Results
❌ 2 tests failed · 19 tests · 1 device 📱 Devices tested (1)Android: Google Pixel 8 Pro (v14.0) ❌ Failed Tests (2)@metamask-onboarding-team
@mm-perps-engineering-team
✅ Passed Tests (17)
Branch: |
Description
Migrates the root MainNavigator stack from @react-navigation/stack to @react-navigation/native-stack. Nested navigators in this file were already native stack; this aligns the top-level app stack for native transitions and performance.
Navigation option mappings:
Tests: MainNavigator.test.tsx updated for native-stack options.
Changelog
CHANGELOG entry:null
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/MCWP-585
Manual testing steps
Screenshots/Recordings
Before
iOS Before:
https://github.com/user-attachments/assets/55f06300-848b-4e2e-9fe5-4238ce8a4156
After
iOS after part 1:
https://github.com/user-attachments/assets/85c693ed-0011-4f6d-bcb2-73ca2aaf80ff
iOS after part 2:
https://github.com/user-attachments/assets/796b5ed9-ed0f-4756-8528-f8b2de30d7ee
Android after part 1:
https://github.com/user-attachments/assets/02953307-87f7-403b-9f32-de88c6d52657
Android after part 2:
https://github.com/user-attachments/assets/cceeda19-c4ad-4bd8-9d58-b466903ba585
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
Medium Risk
Touches every root-level navigation push/modal in the app; behavior should match prior flows but regressions in transitions, gestures, or full-screen Card safe area are possible without broad manual QA.
Overview
Migrates the app’s root
MainNavigatorfrom@react-navigation/stackto@react-navigation/native-stack, so the top-level stack matches the nested navigators that were already on native stack.The JS
Stacknavigator,TransitionPresets, and localslideFromRightAnimation/fadeAnimationinterpolators are removed. Root screens use shared native presets:cardStyle→contentStyle, push animations viaslideFromRightNativeOptions/fadeNativeOptions, and overlay routes viaclearNativeStackNavigatorOptions+transparentModalScreenOptions(includingDEPRECATED_NETWORK_DETAILSastransparentModal). MetaMask Card uses newfullScreenModalSlideFromBottomNativeOptions(slide_from_bottom) instead ofModalSlideFromBottomIOS.MainNavigator.test.tsxnow asserts native-stackanimation: 'slide_from_right'instead of JS-stackanimationEnabled/cardStyleInterpolator.Reviewed by Cursor Bugbot for commit be1dc1a. Bugbot is set up for automated code reviews on this repo. Configure here.