chore(earn): type Earn navigators with feature param lists (Phase 3)#33291
chore(earn): type Earn navigators with feature param lists (Phase 3)#33291weitingsun wants to merge 2 commits 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. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #33291 +/- ##
=======================================
Coverage 84.36% 84.37%
=======================================
Files 6125 6127 +2
Lines 163461 163530 +69
Branches 39884 39887 +3
=======================================
+ Hits 137901 137975 +74
+ Misses 16048 16045 -3
+ Partials 9512 9510 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
These are zero-runtime-impact TypeScript refactoring changes. No navigation logic, component behavior, or route structure was modified. The risk is that a type mismatch could cause a compile error that breaks the Earn/staking flows at runtime, so running SmokeStake is appropriate. Per SmokeStake's description, SmokeConfirmations should also be selected since staking flows involve transaction confirmations. No performance impact expected from type-only changes. Performance Test Selection: |
|



Description
Phase 3 of the incremental React Navigation typing migration — Earn feature.
Earn’s nested navigators (
EarnScreens/EarnModals) were loosely typed (EarnScreensParams/NestedNavigationParams), so nestednavigate(container, { screen, params })calls could not be checked against real screen param shapes. This PR introduces feature-level param lists and wires them into the Earn navigators andRootStackParamList, following the same pattern used for Perps / Rewards / Predict / Card.This is types-only — no intentional runtime navigation behavior change.
What changed
Feature param lists (
app/components/UI/Earn/types/navigation.ts)EarnScreensStackParamList— screen stack (EarnScreenStack): lending deposit/withdrawal confirmation, mUSD conversion education, redesigned confirmationsEarnModalsNavigationParamList— modal stack (EarnModalStack): lending max withdrawal, lending learn more, redesigned confirmationsEarnNavigationParamList— feature union + nestedEarnScreens/EarnModalsentriesRedesignedConfirmationstyped asConfirmationParams | undefinedNavigators (
app/components/UI/Earn/routes/index.tsx)createNativeStackNavigator<EarnScreensStackParamList>()forEarnScreenStackcreateNativeStackNavigator<EarnModalsNavigationParamList>()forEarnModalStackRoot stack (
app/core/NavigationService/types.ts)EarnScreens→NavigatorScreenParams<EarnScreensStackParamList>EarnModals→NavigatorScreenParams<EarnModalsNavigationParamList>Cleanup
EarnScreensParamsfromEarn.types.tsChangelog
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
Types-only refactor with no runtime navigation changes; risk is limited to possible TypeScript breakage at navigate call sites.
Overview
Phase 3 of the React Navigation typing migration for Earn: nested
EarnScreens/EarnModalsstacks now use dedicated param lists instead of looseEarnScreensParamsand generic nested params.A new
app/components/UI/Earn/types/navigation.tsdefinesEarnScreensStackParamList,EarnModalsNavigationParamList, andEarnNavigationParamList, wiring lending confirmation, mUSD education, max withdrawal, learn more, andRedesignedConfirmationsto their existing param types.EarnScreenStackandEarnModalStackpass these types intocreateNativeStackNavigator, andRootStackParamListusesNavigatorScreenParams<>for nested entry routes while leaf Earn routes alias the feature lists. UnusedEarnScreensParamsis removed fromEarn.types.ts.No intentional runtime navigation changes—compile-time safety only, aligned with Perps / Rewards / Predict / Card.
Reviewed by Cursor Bugbot for commit 0e20dec. Bugbot is set up for automated code reviews on this repo. Configure here.