Skip to content

Chore/visual regression nav comparison#27385

Draft
asalsys wants to merge 57 commits into
mainfrom
chore/visual-regression-nav-comparison
Draft

Chore/visual regression nav comparison#27385
asalsys wants to merge 57 commits into
mainfrom
chore/visual-regression-nav-comparison

Conversation

@asalsys

@asalsys asalsys commented Mar 11, 2026

Copy link
Copy Markdown
Contributor

Description

Changelog

CHANGELOG entry:

Related issues

Fixes:

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

After

Pre-merge author checklist

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.

- 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
asalsys added 16 commits March 11, 2026 00:27
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
@github-actions

Copy link
Copy Markdown
Contributor

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.

@metamaskbot metamaskbot added the team-mobile-platform Mobile Platform team label Mar 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeWalletPlatform, SmokeAccounts, SmokeConfirmations, SmokeTrade, SmokePerps, SmokePredictions, SmokeRamps, SmokeNetworkAbstractions
  • Selected Performance tags: @PerformanceLaunch
  • Risk Level: high
  • AI Confidence: 70%
click to see 🤖 AI reasoning details

E2E Test Selection:
The PR includes changes to core navigation and layout components: TabBar, MainNavigator, NavigationProvider, and App.tsx, along with updates to shared UI components (e.g., BackupAlert, BasicFunctionalityModal, HeaderCompactStandard). These are foundational components used across nearly all wallet flows. Navigation and tab structure changes introduce high regression risk because they can affect:

  • Screen routing and stack behavior (MainNavigator, NavigationProvider)
  • Bottom tab navigation (TabBar) used to access Wallet, Activity, Explore, Trade, etc.
  • Wallet home entry points (buy/sell, trade, perps, predictions)
  • Account/network indicators and top-level header layout

Given this broad impact surface, we must validate all major user journeys accessible via tab navigation and wallet home actions.

Tag coverage rationale:

  • SmokeWalletPlatform: Core wallet home, activity, trending, and provider event handling—directly impacted by navigation and tab changes.
  • SmokeAccounts: Account selector and multi-account flows rely on navigation and header components.
  • SmokeConfirmations: All transaction/signature confirmations depend on correct navigation stack behavior.
  • SmokeTrade: Trade entry points (Swap/Bridge/Earn) are accessed via wallet actions and tabs affected by TabBar.
  • SmokePerps & SmokePredictions: Both are accessed via Trade flows and embedded within Trending; navigation/layout changes may break entry or rendering.
  • SmokeRamps: Buy/Sell flows are triggered from wallet actions on home.
  • SmokeNetworkAbstractions: Network selector bottom sheets and network filtering are tied to header and navigation context.

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:
Changes to App.tsx, navigation providers, and TabBar can impact app initialization time, routing setup, and first render timing. Running launch performance tests ensures no regression in cold/warm start and time-to-interactive due to navigation restructuring. No heavy list rendering or data-layer changes were introduced, so other performance suites are not required.

View GitHub Actions results

@asalsys asalsys changed the base branch from main to chore/add-maestro-visual-regression-tests March 11, 2026 21:05
@github-actions

Copy link
Copy Markdown
Contributor

E2E Fixture Validation — Schema is up to date
11 value mismatches detected (expected — fixture represents an existing user).
View details

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
61.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

asalsys added 3 commits March 11, 2026 17:37
Update 42 modified and add 8 new baseline screenshots for iOS visual regression testing.

Made-with: Cursor
…on' into chore/visual-regression-nav-comparison
@asalsys asalsys changed the base branch from chore/add-maestro-visual-regression-tests to feat/react-navigation-v6-migration March 12, 2026 00:09
andrepimenta pushed a commit that referenced this pull request Mar 31, 2026
## **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 -->
Base automatically changed from feat/react-navigation-v6-migration to main March 31, 2026 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants