chore(bridge): type Bridge navigators with feature param lists (Phase 3)#33292
chore(bridge): type Bridge navigators with feature param lists (Phase 3)#33292weitingsun wants to merge 1 commit into
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. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
Risk assessment: Low. This is a pure TypeScript refactoring with no functional logic changes. The actual navigation routes, screen components, and params remain the same — only the type organization changed. However, since Bridge/Swap navigation is touched, running SmokeSwap validates the swap/bridge flow still works end-to-end. SmokeConfirmations is included per the SmokeSwap tag description (transaction confirmations are part of the swap flow). Performance Test Selection: |
|



Description
Phase 3 of the incremental React Navigation typing migration — Bridge feature.
Bridge’s nested navigators (
Bridge/BridgeModals) were loosely typed (BridgeRouteParamson the root entry /undefinedfor modals), so nestednavigate(container, { screen, params })calls could not be checked against real screen param shapes. Call sites already navigate with{ screen, params }(e.g. intoBridgeView); this PR aligns the types with that runtime pattern.This is types-only — no intentional runtime navigation behavior change.
What changed
Feature param lists (
app/components/UI/Bridge/types/navigation.ts)BridgeScreensStackParamList— screen stack (BridgeScreenStack): BridgeView, token selector, batch sell flows, quote selector, hardware wallet / QR scannerBridgeModalsNavigationParamList— modal stack (BridgeModalStack): slippage, block explorer, Blockaid, recipient selector, market closed, network list, price/token warnings, post-trade, batch-sell info sheets, etc.BridgeNavigationParamList— feature union + nestedBridge/BridgeModalsentriesNavigators (
app/components/UI/Bridge/routes.tsx)createNativeStackNavigator<BridgeScreensStackParamList>()forBridgeScreenStackcreateNativeStackNavigator<BridgeModalsNavigationParamList>()forBridgeModalStackRoot stack (
app/core/NavigationService/types.ts)Bridge→NavigatorScreenParams<BridgeScreensStackParamList>(was incorrectlyBridgeRouteParams)BridgeModals→NavigatorScreenParams<BridgeModalsNavigationParamList>Why
useNavigationto strict route checking app-wideBridgeentry type so it matches nested{ screen, params }navigation already used throughout the appRootStackParamListChangelog
CHANGELOG entry: null
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/MCWP-674
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-only refactor with no navigation logic changes; main risk is incorrect param typings surfacing as TypeScript errors at call sites.
Overview
Phase 3 React Navigation typing for Bridge — types only; no intended runtime navigation changes.
Adds
app/components/UI/Bridge/types/navigation.tswithBridgeScreensStackParamList,BridgeModalsNavigationParamList, andBridgeNavigationParamList, consolidating screen/modal route params that were previously scattered acrossRootStackParamListimports.BridgeScreenStackandBridgeModalStacknow usecreateNativeStackNavigatorwith those param lists instead of untyped stacks.In
RootStackParamList,Bridgeis typed asNavigatorScreenParams<BridgeScreensStackParamList>(replacing incorrectBridgeRouteParamson the root entry),BridgeModalsgetsNavigatorScreenParams<BridgeModalsNavigationParamList>, and flat Bridge routes are aliased from the feature lists (includingHardwareWalletsSwapson the root list).Reviewed by Cursor Bugbot for commit f5cf5cd. Bugbot is set up for automated code reviews on this repo. Configure here.