Skip to content

refactor(main navigator): migrate single routes in Main Navigator to native stack#31037

Merged
weitingsun merged 17 commits into
mainfrom
wsun/main-navigator-tab-inner-stacks-part-1
Jun 4, 2026
Merged

refactor(main navigator): migrate single routes in Main Navigator to native stack#31037
weitingsun merged 17 commits into
mainfrom
wsun/main-navigator-tab-inner-stacks-part-1

Conversation

@weitingsun

@weitingsun weitingsun commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Description

Migrates inner tab stacks (WalletTabStackFlow, TransactionsHome) from legacy JS Stack to native stack, and moves affected detail screens to in-screen HeaderStandard with headerShown: false on the navigator.

  • Adds Navigation Dev Panel entries and mock seed helpers so PR4a screens can be QA’d without real orders or bridge history. This can be ignore in review as they will be deleted after the migration.

Changes
Navigation (MainNavigator.js)

  • WalletTabStackFlow: Stack → NativeStack; cardStyle → contentStyle; Wallet tab animationEnabled: false → animation: 'none'.
  • TransactionsHome: Stack → NativeStack; headerShown: false on navigator screenOptions (all child screens use in-screen headers or ActivityView chrome); themed contentStyle.
Screen Route
Stack TransactionDetails TRANSACTION_DETAILS
Legacy aggregator OrderDetails RAMP.ORDER_DETAILS
DepositOrderDetails DEPOSIT.ORDER_DETAILS
SendTransaction RAMP.SEND_TRANSACTION
BridgeTransactionDetails BRIDGE.BRIDGE_TRANSACTION_DETAILS

-Removed navigation.setOptions usage (getNavigationOptionsTitle, getDepositNavbarOptions, getBridgeTransactionDetailsNavbar, redundant headerShown: false on OrderDetails).
-Back navigation uses navigation.goBack() with includesTopInset and back-button test IDs.


Changelog

CHANGELOG entry:null

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

Android build: https://github.com/MetaMask/metamask-mobile/actions/runs/26914955065

Wallet View

BEFORE AFTER
Wallet View Flow - BEFORE Wallet View Flow - AFTER

Transaction View

BEFORE AFTER
Transaction View - BEFORE Transaction View - AFTER

Android Test:
https://github.com/user-attachments/assets/45f29ebd-63f8-4286-ab23-a0a0c2228e40

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

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.

Note

Medium Risk
Touches core wallet/activity navigation and several money movement detail UIs; regressions would show as wrong headers, back behavior, or stack transitions rather than data loss.

Overview
Migrates WalletTabStackFlow and TransactionsHome from the legacy JS stack to native stack, using contentStyle for themed backgrounds and headerShown: false on the activity stack so pushed screens own their chrome.

Detail flows (stack TransactionDetails, legacy ramp OrderDetails, DepositOrderDetails, SendTransaction, BridgeTransactionDetails) drop navigation.setOptions / shared navbar helpers in favor of in-screen HeaderStandard with goBack(), top inset, and back-button test IDs. Missing bridge history and empty ramp order states now show a header instead of a blank screen.

RevealPrivateCredential adjusts bottom padding for the tab bar / safe area. Dev-only Navigation Dev Panel gains PR4a routes plus seed/resolver helpers to open activity-stack screens without real orders or bridge data.

Reviewed by Cursor Bugbot for commit 10e59f7. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions

github-actions Bot commented Jun 3, 2026

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please ignore DevPanel files as they will be deleted after migration is done

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ignore this file. It'll be delete after migration is done

@weitingsun weitingsun self-assigned this Jun 3, 2026
@weitingsun weitingsun added the team-mobile-platform Mobile Platform team label Jun 3, 2026
@weitingsun weitingsun marked this pull request as ready for review June 3, 2026 19:34
@weitingsun weitingsun requested review from a team as code owners June 3, 2026 19:34
@github-actions github-actions Bot added the risk:medium AI analysis: medium risk label Jun 3, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit e6fe752. Configure here.

Comment thread app/components/Nav/Main/MainNavigator.js
@weitingsun weitingsun requested a review from a team as a code owner June 3, 2026 21:45
@weitingsun weitingsun added the skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. label Jun 3, 2026
@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeAccounts, SmokeWalletPlatform, SmokeMoney, SmokeSwap, SmokeConfirmations
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: high
  • AI Confidence: 88%
click to see 🤖 AI reasoning details

E2E Test Selection:
This PR (PR4a) migrates WalletTabStackFlow and TransactionsHome from React Navigation's JS-based Stack.Navigator to NativeStack.Navigator. This is a significant navigation infrastructure change that affects multiple screens and their header rendering behavior.

Key changes and their test implications:

  1. MainNavigator.js - Core navigation change: WalletTabStackFlow (WalletView + RevealPrivateCredential) and TransactionsHome (TransactionDetails, OrderDetails, RampsOrderDetails, DepositOrderDetails, BankDetails, SendTransaction, BridgeTransactionDetails) now use NativeStack. This changes animation behavior, header rendering, and gesture handling for all these screens.

  2. RevealPrivateCredential.tsx - Added BottomTabBarHeightContext and useSafeAreaInsets for proper bottom spacing in NativeStack context → SmokeAccounts (SRP reveal flow is a core test in this tag)

  3. transaction-details.tsx + styles - Replaced navigation.setOptions header with inline HeaderStandard component, added wrapper View → SmokeWalletPlatform (transaction history display is a core test)

  4. BridgeTransactionDetails.tsx - Same header pattern migration → SmokeSwap (bridge transaction details are part of swap/bridge flows)

  5. OrderDetails.tsx - Removed useLayoutEffect that was hiding the header → SmokeMoney (ramp order details)

  6. SendTransaction.tsx - Replaced getDepositNavbarOptions with inline HeaderStandardSmokeMoney (sell/off-ramp flow)

  7. DepositOrderDetails.tsx - Replaced getDepositNavbarOptions with inline HeaderStandardSmokeMoney (deposit order details)

  8. NavigationDevPanel.tsx - Dev tool only, no production impact.

Dependent tags per descriptions:

  • SmokeSwap requires SmokeConfirmations (transaction confirmations are part of bridge/swap flows)
  • SmokeMoney requires SmokeConfirmations (fiat/card flows require confirmations)
  • SmokeAccounts is related to SmokeWalletPlatform (multi-SRP architecture)

The NativeStack migration is a high-risk change because it changes the fundamental navigation behavior (animations, gestures, header rendering) for critical wallet screens. Any regression in navigation could break multiple user flows.

Performance Test Selection:
The changes are focused on navigation stack migration (Stack to NativeStack) and header component refactoring. While NativeStack can have performance implications, these changes are UI/navigation structural changes rather than data loading, rendering performance, or state management changes that would be measured by the available performance test tags. The performance tests available (AccountList, Onboarding, Login, Swaps, Launch, AssetLoading, Predict, Perps) don't directly measure navigation transition performance or header rendering. No performance tests are warranted.

View GitHub Actions results

@github-actions github-actions Bot added risk:high AI analysis: high risk and removed risk:medium AI analysis: medium risk labels Jun 4, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 24.41860% with 130 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.91%. Comparing base (000d79f) to head (10e59f7).
⚠️ Report is 85 commits behind head on main.

Files with missing lines Patch % Lines
...avigationDevPanel/NavigationDevPanel.mockParams.ts 12.50% 91 Missing ⚠️
...ts/Views/NavigationDevPanel/NavigationDevPanel.tsx 0.00% 37 Missing ⚠️
...mponents/TransactionDetails/TransactionDetails.tsx 80.00% 1 Missing ⚠️
.../Views/DepositOrderDetails/DepositOrderDetails.tsx 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #31037      +/-   ##
==========================================
+ Coverage   82.86%   82.91%   +0.05%     
==========================================
  Files        5582     5605      +23     
  Lines      144198   144496     +298     
  Branches    33521    33572      +51     
==========================================
+ Hits       119483   119815     +332     
+ Misses      16682    16611      -71     
- Partials     8033     8070      +37     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@weitingsun weitingsun enabled auto-merge June 4, 2026 20:03
@weitingsun weitingsun added this pull request to the merge queue Jun 4, 2026
Merged via the queue into main with commit c68594d Jun 4, 2026
198 of 201 checks passed
@weitingsun weitingsun deleted the wsun/main-navigator-tab-inner-stacks-part-1 branch June 4, 2026 22:45
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 4, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.82.0 Issue or pull request that will be included in release 7.82.0 label Jun 4, 2026
@mm-token-exchange-service mm-token-exchange-service Bot added the INVALID-PR-TEMPLATE PR's body doesn't match template label Jun 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

INVALID-PR-TEMPLATE PR's body doesn't match template release-7.82.0 Issue or pull request that will be included in release 7.82.0 risk:high AI analysis: high risk size-XL skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. team-mobile-platform Mobile Platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants