Skip to content

feat(money): conditional home CTA — primary Earn / secondary Get started (MUSD-788)#30256

Merged
Kureev merged 4 commits into
mainfrom
kureev/MUSD-788
May 16, 2026
Merged

feat(money): conditional home CTA — primary Earn / secondary Get started (MUSD-788)#30256
Kureev merged 4 commits into
mainfrom
kureev/MUSD-788

Conversation

@Kureev
Copy link
Copy Markdown
Contributor

@Kureev Kureev commented May 15, 2026

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 new selectInWalletHomeOnboardingFlow selector 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

Feature: Money home CTA conditional logic

  Scenario: fresh wallet with the wallet-home onboarding stepper on screen
    Given a new wallet with a $0.00 Money balance
    And the wallet-home onboarding stepper is displayed
    When the user views the wallet home screen
    Then the Money card shows a secondary "Get started" button
    And no second primary CTA competes with the stepper

  Scenario: $0.00 Money balance without the onboarding stepper
    Given a wallet with a $0.00 Money balance
    And the wallet-home onboarding stepper is not displayed
    When the user views the wallet home screen
    Then the Money card shows a primary "Earn" button

  Scenario: funded Money balance
    Given a wallet with a Money balance greater than $0.00
    When the user views the wallet home screen
    Then the Money card shows the existing secondary "Add" button unchanged

Screenshots/Recordings

Before

After

image image

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
  • I've tested with a power user scenario
  • I've instrumented key operations with Sentry traces for production performance metrics

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

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 started when the stepper is visible, otherwise a primary Earn button.

Adds selectWalletHomeOnboardingFlowVisible to gate this behavior using existing homepage/feature-flag and onboarding-step visibility checks, introduces a new EARN_BUTTON test ID, updates/enhances unit tests for both CTA branches, and adds the new earn i18n string.

Reviewed by Cursor Bugbot for commit 006412b. Bugbot is set up for automated code reviews on this repo. Configure here.

…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.
@github-actions
Copy link
Copy Markdown
Contributor

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.

@github-actions github-actions Bot added the pr-not-ready-for-e2e Skip E2E and block merging. Remove this label once the PR is ready to run the E2E tests. label May 15, 2026
@Kureev Kureev marked this pull request as ready for review May 15, 2026 14:44
@Kureev Kureev requested a review from a team as a code owner May 15, 2026 14:44
@Kureev Kureev removed the pr-not-ready-for-e2e Skip E2E and block merging. Remove this label once the PR is ready to run the E2E tests. label May 15, 2026
@Kureev Kureev self-assigned this May 15, 2026
… (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.
Comment thread app/selectors/onboarding/index.ts Outdated
Comment on lines +58 to +65
// 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.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove this overly verbose comment please?

Comment on lines +50 to +52
const inWalletHomeOnboardingFlow = useSelector(
selectInWalletHomeOnboardingFlow,
);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to ignore if you disagree.

Suggested change
const inWalletHomeOnboardingFlow = useSelector(
selectInWalletHomeOnboardingFlow,
);
const walletHomeOnboardingFlowVisible = useSelector(
selectWalletHomeOnboardingFlowVisible,
);

@Kureev Kureev enabled auto-merge May 15, 2026 18:45
…ible (MUSD-788)

Address review: clearer name for the wallet-home onboarding flow
visibility selector and its consumer; drop the explanatory comment.
@Kureev Kureev requested review from a team and Matt561 May 15, 2026 18:47
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeMoney
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 82%
click to see 🤖 AI reasoning details

E2E Test Selection:
The changes are scoped to the Money/Card feature area:

  1. MoneyBalanceCard.tsx: Adds conditional logic to show different button variants for new users based on selectWalletHomeOnboardingFlowVisible. When the wallet home onboarding flow is visible, shows "Get started" (Secondary); otherwise shows "Earn" (Primary). This is a UI behavior change in the Card home screen.

  2. MoneyBalanceCard.testIds.ts: Adds EARN_BUTTON test ID for the new button.

  3. selectors/onboarding/index.ts: Adds selectWalletHomeOnboardingFlowVisible selector combining selectHomepageSectionsV1Enabled, selectWalletHomeOnboardingStepsEnabled, and selectShouldShowWalletHomeOnboardingSteps. This selector is only consumed by MoneyBalanceCard.

  4. locales/en.json: Adds "Earn" string for the new button label.

  5. Test files: Unit tests for the new selector and component behavior.

The MoneyBalanceCard is rendered in the Wallet home screen when isMoneyHomeScreenEnabled (feature-flag gated). The changes are entirely within the Money/Card feature area. No shared infrastructure, navigation, controllers, or other feature areas are affected. SmokeMoney covers the Card home screen and balance card UI, making it the appropriate tag. No other tags are needed as the changes don't touch confirmations, swaps, or other flows.

Performance Test Selection:
The changes involve simple conditional rendering logic in MoneyBalanceCard (choosing between two button variants based on a boolean selector) and a new lightweight selector combining three boolean checks. There is no impact on rendering performance, list rendering, data loading, or any performance-sensitive code paths. No performance tests are warranted.

View GitHub Actions results

@Kureev
Copy link
Copy Markdown
Contributor Author

Kureev commented May 16, 2026

@metamaskbot update-mobile-fixture

@github-actions
Copy link
Copy Markdown
Contributor

🔄 Fixture update started. Running workflow from branch kureev/MUSD-788. View workflow runs

@github-actions
Copy link
Copy Markdown
Contributor

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 skip-smart-e2e-selection label\n- iOS build failed — check the CI workflow for errors\n\nView logs and retry

@sonarqubecloud
Copy link
Copy Markdown

@Kureev Kureev added this pull request to the merge queue May 16, 2026
Merged via the queue into main with commit 554fffd May 16, 2026
189 of 192 checks passed
@Kureev Kureev deleted the kureev/MUSD-788 branch May 16, 2026 00:45
@github-actions github-actions Bot locked and limited conversation to collaborators May 16, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.79.0 Issue or pull request that will be included in release 7.79.0 label May 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.79.0 Issue or pull request that will be included in release 7.79.0 size-M team-earn

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants