Chore/visual regression nav comparison#27385
Conversation
- Update @react-navigation/bottom-tabs, native, and stack to v6 - Remove @react-navigation/compat dependency - Replace withNavigation HOC with useNavigation hook - Replace mode="modal" prop with screenOptions.presentation - Replace headerMode prop with screenOptions.headerShown - Rename dangerouslyGetParent/State to getParent/State - Update NavigationContainerRef types with ParamListBase generic - Update test mocks with new method names Made-with: Cursor
Update lockfile with React Navigation v6 dependencies: - @react-navigation/bottom-tabs@6.6.1 - @react-navigation/native@6.1.18 - @react-navigation/stack@6.4.1 - @react-navigation/core@6.4.17 - @react-navigation/elements@1.3.31 - @react-navigation/routers@6.1.9 - use-latest-callback@0.2.6 Made-with: Cursor
- Fix NavigationContainerRef to use ParamListBase generic - Fix BottomTabBarProps types (removed BottomTabBarOptions) - Add getId to navigation test mocks - Remove duplicate properties in test mocks - Remove unused @ts-expect-error directives Made-with: Cursor
…-v6-migration Made-with: Cursor # Conflicts: # app/components/UI/Notification/ResetNotificationsModal/ResetNotificationsModal.test.tsx
Add comprehensive visual regression testing using Maestro for iOS, covering: - Onboarding flows (wallet creation, welcome screens) - Wallet home and navigation tabs - Settings screens (main, advanced, contacts, about) - Trade flows (swaps, perps, predictions, earn) - Activity and rewards tabs - Send flow components This includes: - Maestro flow YAML configurations - Baseline screenshots for iOS - Helper scripts for baseline updates - TestIDs for send flow components Note: GitHub Actions workflow will be added separately due to OAuth scope limitations. Made-with: Cursor
Resolved modify/delete conflict by accepting main's deletion of app/components/UI/Bridge/Views/BridgeView/__snapshots__/BridgeView.test.tsx.snap Made-with: Cursor
Add mock for @metamask/geolocation-controller module which was causing multiple test suites across all shards to fail with "Cannot find module" error. This mock provides the GeolocationApiService class and Env enum required by geolocation-api-service-init.ts. Made-with: Cursor
Update snapshots for React Navigation v6 migration changes in shard 1. The navigation component structure has changed, requiring snapshot updates. Made-with: Cursor
Updated snapshots to reflect the new navigation structure from React Navigation v6. Also updated UnsupportedStateModal test to use getParent() instead of deprecated dangerouslyGetParent(). Made-with: Cursor
Updated snapshots for: - Main navigation container - OptinMetrics - Ramp Aggregator Quotes - ReceiveRequest - TransactionDetails These changes reflect the updated navigation structure from React Navigation v6. Made-with: Cursor
Updated snapshots for components across: - Bridge QuoteDetailsCard - Card components - Earn MaxInputModal - Ramp views and modals - NftDetails - Settings/Contacts - DeveloperOptions All snapshot changes reflect the updated navigation structure from React Navigation v6 migration. Made-with: Cursor
Updated remaining snapshots for: - TokenSelectModal - Root view - UpdateNeeded - AccountBackupStep1 Made-with: Cursor
…ion-tests' into chore/visual-regression-nav-comparison
- Add compare-visual-regression.sh for capturing screenshots with changes - Add generate-diffs.sh using ImageMagick for visual diff generation - Create Cursor skill for visual regression comparison guidance - Update .gitignore to exclude after-nav/ and diffs/ directories - Update README with comparison workflow documentation Made-with: Cursor
|
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:
Given this broad impact surface, we must validate all major user journeys accessible via tab navigation and wallet home actions. Tag coverage rationale:
Snaps (FlaskBuildTests), MultiChain API, and Solana expansion flows were not directly modified at the controller/provider level, so they are excluded to reduce unnecessary scope. Due to the breadth of navigation changes, this is assessed as high risk. Performance Test Selection: |
|
✅ E2E Fixture Validation — Schema is up to date |
|
Update 42 modified and add 8 new baseline screenshots for iOS visual regression testing. Made-with: Cursor
…on' into chore/visual-regression-nav-comparison
## **Description**
This PR migrates React Navigation from v5 to v6. This is a significant
infrastructure update that modernizes the navigation layer of the
application to align with the latest React Navigation best practices and
removes deprecated APIs.
Why this change?
- React Navigation v5 is no longer actively maintained
- v6 provides improved TypeScript support, better performance, and
simplified APIs
- Removes the deprecated `@react-navigation/compat` package
What changed?
| v5 API | v6 API |
|--------|--------|
| `mode="modal"` prop on Navigator | `screenOptions={{ presentation:
'modal' }}` |
| `headerMode="screen"` prop | Removed (default behavior in v6) |
| `headerMode="none"` prop | `screenOptions={{ headerShown: false }}` |
| `dangerouslyGetParent()` | `getParent()` |
| `dangerouslyGetState()` | `getState()` |
| `NavigationContainerRef` | `NavigationContainerRef<ParamListBase>` |
Dependencies updated:
- `@react-navigation/bottom-tabs`: `^5.11.11` → `^6.6.1`
- `@react-navigation/native`: `^5.9.4` → `^6.1.18`
- `@react-navigation/stack`: `^5.14.5` → `^6.4.1`
- Removed `@react-navigation/compat` (deprecated v5 compatibility
package)
## **Changelog**
CHANGELOG entry: null
## **Related issues**
fixes: [React Navigation v6
Migration](#23767)
## **Manual testing steps**
```gherkin
Feature: React Navigation v6 Migration
Scenario: user navigates between main tabs
Given the app is launched and user is logged in
When user taps on each tab (Wallet, Browser, Activity, etc.)
Then each tab screen renders correctly with proper animations
Scenario: user opens a modal screen
Given the user is on the Wallet screen
When user triggers a modal (e.g., WalletActions, NetworkSelector)
Then the modal presents with correct slide-up animation
And the modal dismisses correctly when closed
Scenario: user navigates with back button
Given the user has navigated deep into a stack (e.g., Settings > Security)
When user presses the back button or swipes back
Then navigation returns to the previous screen correctly
Scenario: user opens bottom sheets
Given the user is on any screen with bottom sheet functionality
When user triggers a bottom sheet (e.g., Account Connect, Token Sort)
Then the bottom sheet presents correctly over the current screen
And background content remains visible behind transparent areas
```
## **Screenshots/Recordings**
### **Before**
N/A - No visual changes expected
### **After**
No visual changes expected. To ensure that the ui has not changed
#27385 was created to
view the comparison of ui through the flow via visual regression
## **Pre-merge author checklist**
- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I've included tests if applicable
- [x] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **Pre-merge reviewer checklist**
- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **High Risk**
> Touches core navigation structure and presentation settings across
many stacks/modals, so regressions could break routing, back behavior,
or modal/sheet presentation. Changes also alter theming/background
handling, which can cause subtle UI layering issues.
>
> **Overview**
> Updates app navigation to React Navigation v6 patterns by removing
deprecated navigator props like `mode` and moving modal behavior to
`screenOptions.presentation` (and related per-screen options), while
centralizing `clearStackNavigatorOptions` and adjusting many flows (App,
MainNavigator, RootModalFlow, rewards/browser/etc.) to set appropriate
`cardStyle` backgrounds.
>
> Refactors navigation typings (e.g., `TabBarProps`/descriptors and
`NavigationContainerRef<ParamListBase>`), hardens `TabBar` against
missing descriptors, and expands unit tests/snapshots to cover tab
visibility/callbacks/on-leave behavior plus broad route/screen
registration validation. NavigationContainer theme background is set to
`transparent` to support transparent modals, shifting responsibility for
background color to screens.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
b6a3bcb. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->


Description
Changelog
CHANGELOG entry:
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist