chore(card): type Card navigators with feature param lists (Phase 3)#33283
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:
Why only SmokeMoney: All changes are TypeScript-only (types/interfaces/generics). TypeScript types are erased at runtime, so there are no functional behavior changes. The Card feature is the only affected area. SmokeMoney covers Card home screen, navbar entry, Add Funds (Deposit/Swap paths), Advanced Card Management, and card analytics — exactly the flows that use the Card navigation stack being refactored. No other feature areas (confirmations, swaps, accounts, networks, etc.) are affected by these changes. Why not more tags: The Performance Test Selection: |
|



Description
Phase 3 of the incremental React Navigation typing migration — Card feature.
Card’s nested navigators (
CardScreens/CardModals) were still loosely typed (undefined/NestedNavigationParams), so nestednavigate(container, { screen, params })calls for Card could not be checked against real screen param shapes. This PR introduces feature-level param lists and wires them into the Card navigators andRootStackParamList, following the same pattern used for Perps / Rewards / Predict.This is types-only — no intentional runtime navigation behavior change.
What changed
Feature param lists (
app/components/UI/Card/types/navigation.ts)CardScreensStackParamList— main stack screens (MainRoutes): Home, Welcome, ChooseYourCard, ReviewOrder, OrderCompleted, Cashback, CreditRedeem, Authentication, SpendingLimit, OnboardingCardModalsNavigationParamList— modal stack screens (CardModalsRoutes)CardRootParamList— outerCardRoutesstack (CardHome→ nested main stack,CardModals→ modal stack)CardNavigationParamList— feature union + nestedCardScreens/CardModalsentriesNavigators (
app/components/UI/Card/routes/index.tsx)Stackinto typedScreensStack(CardScreensStackParamList) andRootStack(CardRootParamList)ModalsStacktyped withCardModalsNavigationParamListRoot stack (
app/core/NavigationService/types.ts)CardScreens→NavigatorScreenParams<CardRootParamList>CardModals→NavigatorScreenParams<CardModalsNavigationParamList>undefinedshapesCall-site cleanup
Changelog
CHANGELOG entry:null
Related issues
Fixes:https://consensyssoftware.atlassian.net/browse/MCWP-674
Manual testing steps
n/a type changes only
Screenshots/Recordings
n/a type changes only
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 navigation typing and export visibility changes; no deliberate behavior changes, though stricter param types may surface existing navigate() mismatches at build time.
Overview
Phase 3 adds strict React Navigation typing for Card, matching the Perps / Rewards / Predict pattern. There is no intended runtime navigation change.
A new
app/components/UI/Card/types/navigation.tsdefinesCardScreensStackParamList,CardModalsNavigationParamList,CardRootParamList, andCardNavigationParamList, with screen params pulled from existing view/modal types (and newly exported modal param interfaces on Add Funds, Asset Selection, Region Selector, Confirm, and Password sheets).In
Card/routes/index.tsx, the shared untyped stack is split into typedScreensStack,RootStack, andModalsStack;spendingLimitScreenOptionsnow keys offCardScreensStackParamList['CardSpendingLimit'](including broaderflowvalues such asenable_card).RootStackParamListinNavigationService/types.tsnow typesCardScreens/CardModalswithNavigatorScreenParams<…>and points leaf Card routes at the feature lists instead ofundefined, looseNestedNavigationParams, or duplicated ad-hoc shapes (e.g.CardConfirmModal,ChooseYourCard,OrderCompleted).Reviewed by Cursor Bugbot for commit 79be098. Bugbot is set up for automated code reviews on this repo. Configure here.