Skip to content

feat(MUSD-431, MUSD-752): add Money balance card to wallet home#29724

Merged
Kureev merged 15 commits into
mainfrom
kureev/MUSD-431-752-money-balance-card
May 6, 2026
Merged

feat(MUSD-431, MUSD-752): add Money balance card to wallet home#29724
Kureev merged 15 commits into
mainfrom
kureev/MUSD-431-752-money-balance-card

Conversation

@Kureev

@Kureev Kureev commented May 5, 2026

Copy link
Copy Markdown
Contributor

Description

Adds a new Money balance card to the wallet home screen, slotted between the
wallet action bar (Buy/Swap/Send/Receive) and the Carousel/Tokens block. The
card surfaces the user's Money Account balance, current vault APY, and a
direct CTA to add funds — replacing the chevron-style "Money" section pattern
described in the Money Home Review (April 30, 2026) for users on the new
wallet home.

The card has two visual states sharing one component:

  • Empty (MUSD-431) — balance $0.00, Secondary "Add" button.
  • Funded (MUSD-752) — live totalFiatFormatted from useMoneyAccountBalance,
    Secondary "Add" button. Switches as soon as totalFiatRaw > 0.

Other behaviour:

  • Tap card body → navigates to Money home (Routes.MONEY.ROOT)
  • Tap "Add" → Routes.MONEY.MODALS.ADD_MONEY_SHEET (same flow as the existing
    Money home Add pill)
  • Tap info icon → new MoneyBalanceInfoSheet modal (registered alongside the
    existing APY/Earnings info sheets)
  • Skeleton placeholders while balance/APY are loading
  • Render-gated by selectMoneyHomeScreenEnabledFlag && isHomepageSectionsV1Enabled

The legacy MoneyAccountHomeRow and CashSection are intentionally untouched
in this PR — they continue to serve users without the Money home flag.

Changelog

CHANGELOG entry: Added a new Money balance card to the wallet home screen showing the user's Money Account balance, vault APY, and a quick action to add funds.

Related issues

Fixes: MUSD-431, MUSD-752

Manual testing steps

Feature: Money balance card on wallet home

  Scenario: user with no Money balance sees the empty state
    Given the Money home feature flag is enabled
    And the homepage sections v1 flag is enabled
    And the user has no Money Account balance

    When the user opens the wallet home screen
    Then the Money balance card is visible between the action bar and the tokens
    And the balance shows "$0.00"
    And the "Add" button uses the Secondary variant
    And the "4% APY" tag is visible

  Scenario: user with a Money balance sees the funded state
    Given the Money home feature flag is enabled
    And the homepage sections v1 flag is enabled
    And the user has a Money Account balance greater than $0.00

    When the user opens the wallet home screen
    Then the Money balance card shows the live USD balance
    And the "Add" button uses the Secondary variant

  Scenario: user taps the Money balance card body
    Given the Money balance card is visible

    When the user taps anywhere on the card outside of the Add button or info icon
    Then the app navigates to the Money home screen

  Scenario: user taps the info icon on the Money balance card
    Given the Money balance card is visible

    When the user taps the info icon next to "Money balance"
    Then the Money balance info sheet opens

  Scenario: feature flag is off
    Given the Money home feature flag is disabled

    When the user opens the wallet home screen
    Then the Money balance card is not rendered

Screenshots/Recordings

Before

After

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

Medium Risk
Adds new wallet-home UI and navigation paths (including a new modal route) gated by feature flags; risk is mainly around routing/press handlers and empty-state logic but is localized and well-covered by tests.

Overview
Adds a new MoneyBalanceCard on the wallet home header area (shown only when selectMoneyHomeScreenEnabledFlag is on) that displays Money balance + APY with loading skeletons, and provides CTAs to open the Add Money sheet, navigate to Money Home, or start the mUSD conversion education flow for new users.

Introduces a new MoneyBalanceInfoSheet bottom-sheet modal and registers it in the Money modal stack via new route Routes.MONEY.MODALS.MONEY_BALANCE_INFO_SHEET, along with new i18n strings for the card label and sheet copy.

Removes the legacy MoneyAccountHomeRow component/tests and updates CashSection so the entire Cash section is not rendered when the Money home flag is enabled; updates/extends unit tests (Wallet flag-gated rendering, Cash section null behavior, Money modal registration) accordingly.

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

Kureev added 6 commits May 5, 2026 12:37
- Wallet integration: assert MoneyBalanceCard renders only when both
  selectMoneyHomeScreenEnabledFlag and selectHomepageSectionsV1Enabled
  return true, and stays hidden when either flag is off.
- Money routes: assert MONEY_BALANCE_INFO_SHEET registers as a modal
  screen alongside MoneyAddMoneySheet.
- MoneyBalanceCard: layout resilience test for very long balances
  (APY tag and Add button stay on screen).
@github-actions

github-actions Bot commented May 5, 2026

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 size-L label May 5, 2026
Kureev added 2 commits May 5, 2026 14:16
Per design — the empty state was previously rendering a Primary Add button
based on ticket text; the canonical design specifies Secondary in both
states.
@Kureev Kureev self-assigned this May 5, 2026
@Kureev

Kureev commented May 5, 2026

Copy link
Copy Markdown
Contributor Author

waiting for #29645 to land so I can correctly wire the navigation

Kureev added 4 commits May 5, 2026 14:33
…unded

Per design clarification: Primary highlights Add as the main action when the
user has no balance; Secondary takes over once the user has funded the
account, since adding more is a follow-up rather than the primary intent.
The empty-state CTA now reflects whether the user has seen the Money
onboarding flow:

- Never seen onboarding + zero balance: Primary "Get started", routes
  through the conversion education flow with a returnTo to Money home.
- Seen onboarding + zero balance: Primary "Add" (current behaviour).
- Funded balance: Secondary "Add" (current behaviour).

Reuses the existing homepage.sections.cash_empty_state.get_started string
since it literally translates to "Get started".
@Kureev Kureev marked this pull request as ready for review May 6, 2026 16:46
@Kureev Kureev requested a review from a team as a code owner May 6, 2026 16:46
Kureev added 2 commits May 6, 2026 20:04
- Wallet view: render Carousel above MoneyBalanceCard so the promo
  reads first when the Money home flag is on.
- Homepage Cash section: drop legacy MoneyAccountHomeRow render branch;
  fold !isMoneyHomeEnabled into isCashSectionEnabled so the section
  returns null when MoneyBalanceCard supersedes it.
- Delete app/components/UI/Money/components/MoneyAccountHomeRow/* —
  fully replaced by MoneyBalanceCard.
- CashSection.test.tsx: replace the MoneyAccountHomeRow render test
  with an explicit null-render assertion when isMoneyHomeEnabled is on.
…oney-balance-card

# Conflicts:
#	app/components/Views/Wallet/index.test.tsx
#	app/components/Views/Wallet/index.tsx
@github-actions github-actions Bot added size-XL and removed size-L labels May 6, 2026

@cursor cursor Bot left a comment

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.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 71753bd. Configure here.

Comment thread app/components/Views/Homepage/Sections/Cash/CashSection.tsx
buttonVariant = ButtonVariant.Primary;
buttonLabel = strings('money.balance_card.add');
buttonTestId = MoneyBalanceCardTestIds.ADD_BUTTON;
containerTestId = MoneyBalanceCardTestIds.EMPTY_CONTAINER;

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.

Empty state uses Primary variant instead of Secondary

Medium Severity

The PR specification states the Empty state (MUSD-431) uses a Secondary "Add" button, but buttonVariant is set to ButtonVariant.Primary in the else if (isEmpty) branch. The Funded state correctly uses ButtonVariant.Secondary. This visual inconsistency contradicts the design requirement that both Empty and Funded states share a Secondary "Add" button.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 71753bd. Configure here.

Logger reason ternary previously only knew about flag_off and
geo_ineligible, so when isMoneyHomeEnabled (the new gate) was the
actual cause of CashSection returning null, the log misreported it as
geo_ineligible. Add an explicit money_home_on branch and include the
moneyHome flag value in the log line.
@github-actions

github-actions Bot commented May 6, 2026

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

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

E2E Test Selection:
The PR introduces new Money/Card UI components (MoneyBalanceCard, MoneyBalanceInfoSheet), deletes the old MoneyAccountHomeRow component, adds a new navigation route (MONEY_BALANCE_INFO_SHEET), and modifies the Wallet home screen and CashSection logic.

Key findings:

  1. SmokeMoney: Direct changes to Money/Card feature components. New MoneyBalanceCard and MoneyBalanceInfoSheet components are added to the Money modal stack. The card-home and ramps E2E tests exercise the Money home screen and card flows that are directly affected.

  2. SmokeWalletPlatform: The Wallet/index.tsx is modified to render MoneyBalanceCard when isMoneyHomeScreenEnabled flag is on. The CashSection logic is also changed to be mutually exclusive with the Money Home feature. These changes affect the wallet home screen rendering which is tested by SmokeWalletPlatform.

  3. No SmokeConfirmations needed: The changes are UI/navigation additions gated by feature flags, not transaction confirmation flows.

  4. No SmokeStake/SmokeSwap needed: While MoneyBalanceCard has a 'Get Started' button that navigates to Earn/MUSD conversion, this is a navigation entry point change, not a core swap/stake flow change.

  5. The MoneyAccountHomeRow deletion is safe - confirmed no other files import it after the CashSection was updated to remove its usage.

Risk is medium because: the Wallet home screen is a widely-used component, but changes are feature-flag gated (isMoneyHomeScreenEnabled), limiting blast radius to users with that flag enabled.

Performance Test Selection:
No performance tests needed. The changes are UI component additions/replacements (MoneyBalanceCard replacing MoneyAccountHomeRow) gated by a feature flag. These don't affect app startup, account list rendering, login flows, or other performance-critical paths measured by the available performance test tags.

View GitHub Actions results

@sonarqubecloud

sonarqubecloud Bot commented May 6, 2026

Copy link
Copy Markdown

@Kureev Kureev enabled auto-merge May 6, 2026 20:54
@Kureev Kureev added this pull request to the merge queue May 6, 2026
Merged via the queue into main with commit b3c014c May 6, 2026
93 of 94 checks passed
@Kureev Kureev deleted the kureev/MUSD-431-752-money-balance-card branch May 6, 2026 21:17
@github-actions github-actions Bot locked and limited conversation to collaborators May 6, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.77.0 Issue or pull request that will be included in release 7.77.0 label May 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.77.0 Issue or pull request that will be included in release 7.77.0 size-XL team-earn

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants