feat(money): conditional home CTA — primary Earn / secondary Get started (MUSD-788)#30256
Conversation
…ted (MUSD-788) Show the Money Account home CTA as a primary "Earn" button when the wallet-home onboarding stepper is not displayed, and as a secondary "Get started" button when it is, so there is never a second primary CTA competing with the stepper's own primary action. Adds selectInWalletHomeOnboardingFlow composing the existing homepage-sections, onboarding-steps-enabled and should-show-steps selectors; only the MoneyBalanceCard new-user branch consumes it.
|
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. |
… (MUSD-788) selectInWalletHomeOnboardingFlow used a module-load createSelector over selectors imported from featureFlagController/homepage. app/reducers eagerly pulls in app/selectors/onboarding, so any suite that builds a store while partially mocking featureFlagController/homepage evaluated that createSelector with an undefined input and hit reselect's input-selectors-must-be-functions assertion at require time, failing the whole test file across many shards. Compose the three (already-memoized) selectors in a plain call-time function so the imports are only dereferenced at runtime; behaviour is unchanged. Unit tests updated to drive the inputs via mocks/state.
| // Plain (non-memoized) composition: a module-load `createSelector(...)` would | ||
| // dereference these imported selectors at evaluation time, and this module is | ||
| // eagerly pulled in via `app/reducers/index.ts`. Any suite that builds a store | ||
| // while partially mocking `featureFlagController/homepage` would then hit | ||
| // reselect's "input-selectors must be functions" assertion at require time and | ||
| // take down the whole file. Composing at call time keeps it mock/cycle-safe; | ||
| // the body is a trivial boolean AND over already-memoized selectors, so there | ||
| // is nothing to memoize. |
There was a problem hiding this comment.
Can we remove this overly verbose comment please?
| const inWalletHomeOnboardingFlow = useSelector( | ||
| selectInWalletHomeOnboardingFlow, | ||
| ); |
There was a problem hiding this comment.
Feel free to ignore if you disagree.
| const inWalletHomeOnboardingFlow = useSelector( | |
| selectInWalletHomeOnboardingFlow, | |
| ); | |
| const walletHomeOnboardingFlowVisible = useSelector( | |
| selectWalletHomeOnboardingFlowVisible, | |
| ); |
…ible (MUSD-788) Address review: clearer name for the wallet-home onboarding flow visibility selector and its consumer; drop the explanatory comment.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
The Performance Test Selection: |
|
@metamaskbot update-mobile-fixture |
|
🔄 Fixture update started. Running workflow from branch |
|
❌ E2E fixture update failed.\n\nCommon causes:\n- CI workflow is still running — wait for 'Build iOS Apps' to complete\n- CI workflow was skipped — ensure your PR has iOS-impacting changes or use |
|



Description
The Money Account card on the wallet home screen showed a primary "Get started" CTA for new wallets. For a freshly created wallet the wallet-home onboarding stepper is also displayed, and that stepper owns its own primary "Add funds" CTA — resulting in two competing primary CTAs on one screen.
This adds conditional logic so the Money card CTA is secondary "Get started" while the wallet-home onboarding stepper is displayed, and primary "Earn" when it is not. The
isEmpty(seen onboarding) and funded states, the "Add" button, and the stepper itself are untouched. A newselectInWalletHomeOnboardingFlowselector composes the existing homepage-sections / onboarding-steps-enabled / should-show-steps selectors (same condition the stepper itself is gated on), and only the Money card's new-user branch consumes it.Changelog
CHANGELOG entry: Updated the Money home screen call-to-action to show a primary "Earn" button, switching to a secondary "Get started" button while the wallet-home onboarding stepper is displayed.
Related issues
Fixes: MUSD-788
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Performance checks (if applicable)
Pre-merge reviewer checklist
Note
Low Risk
Low risk UI/selector change that only affects which CTA label/variant is shown for new users and adds a small selector composed from existing feature flags/onboarding state.
Overview
Updates the Money balance card’s new-user empty state CTA to avoid competing primary actions with the wallet-home onboarding stepper: it now shows a secondary
Get startedwhen the stepper is visible, otherwise a primaryEarnbutton.Adds
selectWalletHomeOnboardingFlowVisibleto gate this behavior using existing homepage/feature-flag and onboarding-step visibility checks, introduces a newEARN_BUTTONtest ID, updates/enhances unit tests for both CTA branches, and adds the newearni18n string.Reviewed by Cursor Bugbot for commit 006412b. Bugbot is set up for automated code reviews on this repo. Configure here.