chore(multichain accounts): opt in useNavigation to AppNavigationProp (Phase 4) - #33627
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. |
PR template — items to address before "Ready for review"Warnings — informational, address before merging:
See docs/readme/ready-for-review.md for the full Definition of Ready for Review. |
… github.com:MetaMask/metamask-mobile into chore/navigation-typing-phase-4-multichain-accounts
Codecov Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
… github.com:MetaMask/metamask-mobile into chore/navigation-typing-phase-4-multichain-accounts
⚡ Performance Test Results
❌ 4 tests failed · 20 tests · 1 device 📱 Devices tested (1)Android: Google Pixel 8 Pro (v14.0) ❌ Failed Tests (4)
@metamask-onboarding-team
@mm-perps-engineering-team
✅ Passed Tests (16)
Branch: |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Performance Test Selection: |
|



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 thecomponent-library/components-temp/MultichainAccountscomponents — 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 touseNavigation<AppNavigationProp>().AppNavigationPropis checked against the centralRootStackParamList, so invalid route names and wrong route params now failtscand get autocompletion — instead of silently compiling against the looseParamListBase.Like previous Phase 4 PRs this is a types-only change
What changed
Opt-in (mechanical)
MultichainAccounts production files migrated from bare
useNavigation()touseNavigation<AppNavigationProp>()(+ theAppNavigationProptype import).Route registration (
core/NavigationService/types.ts)SmartAccountDetails: SmartAccountParams | undefined. The screen is registered inApp.tsxand navigated to with{ account }, but was missing fromRootStackParamList.ConfirmTurnOnBackupAndSyncparams typed asConfirmTurnOnBackupAndSyncModalNavigateParams | undefined(wasundefined);BackupAndSyncTogglealready 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)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Note
Low Risk
Compile-time navigation typing and param list alignment only; intended runtime behavior is unchanged aside from centralized
navigateWithDetailscalls 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 againstRootStackParamList.RootStackParamListgainsSmartAccountDetails(already used in app code) and real params forConfirmTurnOnBackupAndSyncviaConfirmTurnOnBackupAndSyncModalNavigateParams. Multichain account route param types are expanded (accountGroup, nestedscreen/params,walletId, etc.) to match how screens navigate today.Several call sites that used
navigate(...createXNavigationDetails())now go throughnavigateWithDetails(account group actions, address/private-key lists, intro → account selector, HW swap cancel, permissions connection details).account.options.entropySourceis asserted asstringwhere SRP export needs a typedkeyringId.BackupAndSyncToggledrops 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.