Skip to content

chore(multichain accounts): opt in useNavigation to AppNavigationProp (Phase 4) - #33627

Merged
weitingsun merged 17 commits into
mainfrom
chore/navigation-typing-phase-4-multichain-accounts
Jul 28, 2026
Merged

chore(multichain accounts): opt in useNavigation to AppNavigationProp (Phase 4)#33627
weitingsun merged 17 commits into
mainfrom
chore/navigation-typing-phase-4-multichain-accounts

Conversation

@weitingsun

@weitingsun weitingsun commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Description

Phase 4 of the navigation-typing migration for the MultichainAccounts feature (app/components/Views/MultichainAccounts), plus the remaining @MetaMask/accounts-engineers-owned navigation call sites in HardwareWallet, Identity, and the component-library/components-temp/MultichainAccounts components — all owned by the same team, so they ship together.

This opts the feature into strict, root-aware navigation typing by switching its production useNavigation() call sites to useNavigation<AppNavigationProp>(). AppNavigationProp is checked against the central RootStackParamList, so invalid route names and wrong route params now fail tsc and get autocompletion — instead of silently compiling against the loose ParamListBase.

Like previous Phase 4 PRs this is a types-only change

What changed

Opt-in (mechanical)

MultichainAccounts production files migrated from bare useNavigation() to useNavigation<AppNavigationProp>() (+ the AppNavigationProp type import).

Route registration (core/NavigationService/types.ts)

  • Added SmartAccountDetails: SmartAccountParams | undefined. The screen is registered in App.tsx and navigated to with { account }, but was missing from RootStackParamList.
  • ConfirmTurnOnBackupAndSync params typed as ConfirmTurnOnBackupAndSyncModalNavigateParams | undefined (was undefined); BackupAndSyncToggle already forwards { enableBackupAndSync, trackEnableBackupAndSyncEvent }, matching the modal's own route type.

Changelog

CHANGELOG entry:null

Related issues

Fixes:https://consensyssoftware.atlassian.net/browse/MCWP-675

Manual testing steps

N/A

Screenshots/Recordings

N/A

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

Low Risk
Compile-time navigation typing and param list alignment only; intended runtime behavior is unchanged aside from centralized navigateWithDetails calls that preserve existing navigation tuples.

Overview
Phase 4 of the navigation typing migration: MultichainAccounts (plus related HardwareWallet swaps flows, Identity backup toggle, and temp AccountCell / add-wallet UI) now use useNavigation<AppNavigationProp>() so route names and params are checked against RootStackParamList.

RootStackParamList gains SmartAccountDetails (already used in app code) and real params for ConfirmTurnOnBackupAndSync via ConfirmTurnOnBackupAndSyncModalNavigateParams. Multichain account route param types are expanded (accountGroup, nested screen/params, walletId, etc.) to match how screens navigate today.

Several call sites that used navigate(...createXNavigationDetails()) now go through navigateWithDetails (account group actions, address/private-key lists, intro → account selector, HW swap cancel, permissions connection details). account.options.entropySource is asserted as string where SRP export needs a typed keyringId. BackupAndSyncToggle drops stale commented imports while keeping typed navigation.

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

@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.

@metamask-ci metamask-ci Bot added the team-mobile-platform Mobile Platform team label Jul 21, 2026
@metamask-ci

metamask-ci Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

PR template — items to address before "Ready for review"

Warnings — informational, address before merging:

  • Pre-merge author checklist has unchecked items (e.g. "I've included tests if applicable"). Every box must be consciously checked — see docs/readme/ready-for-review.md.

See docs/readme/ready-for-review.md for the full Definition of Ready for Review.

@weitingsun weitingsun self-assigned this Jul 22, 2026
… github.com:MetaMask/metamask-mobile into chore/navigation-typing-phase-4-multichain-accounts
@codecov-commenter

codecov-commenter commented Jul 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.74468% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.79%. Comparing base (8e365c1) to head (3547507).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
...ermissionsSummary/MultichainPermissionsSummary.tsx 50.00% 1 Missing ⚠️
...ounts/sheets/RevealPrivateKey/RevealPrivateKey.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #33627   +/-   ##
=======================================
  Coverage   84.78%   84.79%           
=======================================
  Files        6246     6248    +2     
  Lines      168304   168396   +92     
  Branches    41181    41205   +24     
=======================================
+ Hits       142701   142795   +94     
  Misses      15855    15855           
+ Partials     9748     9746    -2     

☔ 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 marked this pull request as ready for review July 22, 2026 18:09
@weitingsun
weitingsun requested review from a team as code owners July 22, 2026 18:09
@github-actions github-actions Bot added the risk:low AI analysis: low risk label Jul 22, 2026
@github-actions github-actions Bot added risk:high AI analysis: high risk and removed risk:low AI analysis: low risk labels Jul 23, 2026
montelaidev
montelaidev previously approved these changes Jul 24, 2026
@weitingsun weitingsun removed the risk:high AI analysis: high risk label Jul 24, 2026
@github-actions github-actions Bot added the risk:high AI analysis: high risk label Jul 24, 2026
Cal-L
Cal-L previously approved these changes Jul 24, 2026

@Cal-L Cal-L 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.

lgtm

… github.com:MetaMask/metamask-mobile into chore/navigation-typing-phase-4-multichain-accounts
@github-actions

Copy link
Copy Markdown
Contributor

⚡ Performance Test Results

ℹ️ Performance test results are currently non-blocking and will not block this PR.

4 tests failed · 20 tests · 1 device

📱 Devices tested (1)

Android: Google Pixel 8 Pro (v14.0)

❌ Failed Tests (4)

@Accounts-team

Test Platform Device Reason Recording
Import SRP with +50 accounts, SRP 1, SRP 2, SRP 3 Android Google Pixel 8 Pro (v14.0) Test error 📹 Watch

@metamask-onboarding-team

Test Platform Device Reason Recording
Fresh SRP wallet creation performance Android Google Pixel 8 Pro (v14.0) Quality gates exceeded 📹 Watch
Seedless Onboarding: Apple Login New User Android Google Pixel 8 Pro (v14.0) Quality gates exceeded 📹 Watch

@mm-perps-engineering-team

Test Platform Device Reason Recording
Perps open position and close it Android Google Pixel 8 Pro (v14.0) Test error 📹 Watch
✅ Passed Tests (16)
Test Platform Device Duration Team Recording
Aggregated Balance Loading Time, SRP 1 + SRP 2 + SRP 3 Android Google Pixel 8 Pro (v14.0) 8.29s @assets-dev-team 📹 Watch
Asset View, SRP 1 + SRP 2 + SRP 3 Android Google Pixel 8 Pro (v14.0) 3.21s @assets-dev-team 📹 Watch
Cross-chain swap flow - ETH to SOL - 50+ accounts, SRP 1 + SRP 2 + SRP 3 Android Google Pixel 8 Pro (v14.0) 4.62s @swap-bridge-dev-team 📹 Watch
Swap flow - ETH to LINK, SRP 1 + SRP 2 + SRP 3 Android Google Pixel 8 Pro (v14.0) 1.81s @swap-bridge-dev-team 📹 Watch
Cold Start: Measure ColdStart To Login Screen Android Google Pixel 8 Pro (v14.0) 5.12s @metamask-mobile-platform 📹 Watch
Measure Warm Start: Login To Wallet Screen Android Google Pixel 8 Pro (v14.0) 1.14s @metamask-mobile-platform 📹 Watch
Measure Warm Start: Warm Start to Login Screen Android Google Pixel 8 Pro (v14.0) 0.89s @metamask-mobile-platform 📹 Watch
Predict Available Balance - Complete Flow Performance Android Google Pixel 8 Pro (v14.0) 1.20s @team-predict 📹 Watch
Perps add funds Android Google Pixel 8 Pro (v14.0) 8.33s @mm-perps-engineering-team 📹 Watch
Predict Deposit - Complete Flow Performance Android Google Pixel 8 Pro (v14.0) 10.32s @team-predict 📹 Watch
Predict Market Details - Complete Flow Performance Android Google Pixel 8 Pro (v14.0) 3.70s @team-predict 📹 Watch
Onboarding Import SRP with +50 accounts, SRP 3 Android Google Pixel 8 Pro (v14.0) 8.31s @metamask-onboarding-team 📹 Watch
Cold Start after importing a wallet Android Google Pixel 8 Pro (v14.0) 1.27s @metamask-mobile-platform 📹 Watch
Measure Cold Start To Onboarding Screen Android Google Pixel 8 Pro (v14.0) 3.48s @metamask-mobile-platform 📹 Watch
Account creation after fresh install Android Google Pixel 8 Pro (v14.0) 3.21s @metamask-onboarding-team 📹 Watch
Seedless Onboarding: Google Login New User Android Google Pixel 8 Pro (v14.0) 9.17s @metamask-onboarding-team 📹 Watch

Branch: chore/navigation-typing-phase-4-multichain-accounts · Build: Normal · Commit: 35c36e6 · View full run

@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeAccounts, SmokeConfirmations, SmokeNetworkAbstractions, SmokeNetworkExpansion, SmokeSwap, SmokeStake, SmokeWalletPlatform, SmokeMoney, SmokePerps, SmokeMultiChainAPI, SmokePredictions, SmokeSeedlessOnboarding, SmokeSeedlessOnboardingExtended, SmokeBrowser, SmokeSnaps
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: high
  • AI Confidence: 100%
click to see 🤖 AI reasoning details

E2E Test Selection:
Hard rule (global-infrastructure-change): Global infrastructure changed: app/components/hooks/useKeyringId.ts. Running all tests.

Performance Test Selection:
The changes are TypeScript type safety improvements and minor navigation refactoring (navigateWithDetails wrapper). There are no changes to rendering logic, data fetching, state management, or performance-sensitive code paths. No performance test tags are warranted.

View GitHub Actions results

@sonarqubecloud

Copy link
Copy Markdown

@Cal-L Cal-L 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.

LGTM

@weitingsun
weitingsun added this pull request to the merge queue Jul 28, 2026
Merged via the queue into main with commit d3e2b96 Jul 28, 2026
293 of 296 checks passed
@weitingsun
weitingsun deleted the chore/navigation-typing-phase-4-multichain-accounts branch July 28, 2026 06:16
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 28, 2026
@metamask-ci metamask-ci Bot added the release-8.6.0 Issue or pull request that will be included in release 8.6.0 label Jul 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-8.6.0 Issue or pull request that will be included in release 8.6.0 risk:high AI analysis: high risk size-M team-mobile-platform Mobile Platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants