fix(money): always route add money to deposit screen and fix redirect_target (MUSD-959)#31590
fix(money): always route add money to deposit screen and fix redirect_target (MUSD-959)#31590Kureev wants to merge 1 commit into
Conversation
…_target (MUSD-959)
|
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. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
The changes are scoped to the Money/Card feature area only. No changes to core infrastructure, controllers, Engine, navigation framework, or shared components that would affect other test areas. The risk is medium because this is a functional routing change (not just cosmetic) that could affect user flows if the deposit path behaves differently than the previous conditional routing. Performance Test Selection: |
| component_name: COMPONENT_NAMES.MONEY_MUSD_TOKEN_SECTION, | ||
| redirect_target: hasMusdBalance | ||
| ? SCREEN_NAMES.MONEY_DEPOSIT | ||
| : SCREEN_NAMES.RAMP_BUY, |
There was a problem hiding this comment.
We can delete this orphaned enum if it isn't used anymore.
| MUSD_TOKEN_ADDRESS_BY_CHAIN, | ||
| MUSD_TOKEN_ASSET_ID_BY_CHAIN, | ||
| } from '../../Earn/constants/musd'; | ||
|
|
There was a problem hiding this comment.
Let's delete this hook if all it's doing is wrapping a call to initiateDeposit
Description
MoneyBalanceCard's Add button (and the mUSD row Add button on Money home, which shares the same routing hook) used to preselect mUSD as the payment token and redirect to the Ramp Buy flow when the wallet held no mUSD.Per MUSD-959, the Add press now always opens the MM Pay deposit screen with no explicit preselection. MM Pay already implements both acceptance criteria in
useAutomaticTransactionPayToken: it auto-selects the highest-balance crypto token when the user has tokens, and auto-selects a fiat payment method when the user has none (autoSelectFiatPayment || tokens.length === 0). Duplicating a "has tokens" check on our side would only risk diverging from MM Pay's authoritative token filtering (disabled tokens, minimum balances, hardware-wallet rules).useMoneyAccountAddRoutingtherefore collapses to a singlerouteAddMoneythat callsinitiateDeposit(); the now-deadmoveMusd,depositFunds,convertCrypto, andhasMusdBalancemembers are removed (no remaining consumers).The event properties part: both call sites fired
trackButtonClickedwith a predictiveredirect_target(hasMusdBalance ? money_deposit : ramp_buy) computed before routing, which no longer matched where the user actually landed. Both now report the constantmoney_deposit.Changelog
CHANGELOG entry: Fixed the wallet home balance card Add button to always open the deposit screen, preselecting fiat payment when the wallet holds no tokens
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/MUSD-959
Manual testing steps
Screenshots/Recordings
Before
After
Simulator.Screen.Recording.-.iPhone.17.-.2026-06-11.at.23.19.04.mov
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
Medium Risk
Changes end-user add-money navigation (no more Ramp Buy for zero-mUSD wallets) and simplifies a shared routing hook used from wallet home and Money home; deposit preselection now relies entirely on MM Pay.
Overview
Add money from the wallet home Money balance card and the Money home mUSD row no longer branches on whether the wallet holds mUSD or sends users to Ramp Buy. Both paths now call
routeAddMoney, which only runsinitiateDeposit()with no preselected payment token so MM Pay handles token vs fiat selection.useMoneyAccountAddRoutingis reduced to that single behavior;hasMusdBalance,moveMusd,depositFunds,convertCrypto, and Ramp/mUSD conversion wiring are removed.trackButtonClickedredirect_targeton those Add/Earn actions is alwaysmoney_depositinstead of togglingramp_buyvs deposit.Tests drop balance-based routing cases, assert the new analytics constant, add Money home coverage for condensed info card navigation (How it works, mUSD asset, learn more URL), and shrink the hook unit tests to
initiateDepositsuccess/failure handling.Reviewed by Cursor Bugbot for commit 34dd202. Bugbot is set up for automated code reviews on this repo. Configure here.