Skip to content

fix(money): show "Earn up to X% APY" on input empty state (MUSD-891)#31064

Merged
Kureev merged 2 commits into
mainfrom
kureev/MUSD-891
Jun 4, 2026
Merged

fix(money): show "Earn up to X% APY" on input empty state (MUSD-891)#31064
Kureev merged 2 commits into
mainfrom
kureev/MUSD-891

Conversation

@Kureev

@Kureev Kureev commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Description

The Money account deposit input screen ("Convert crypto" / "Add funds") was missing the "Earn up to 4% APY" value prop on its empty state. Previously, when the amount was empty/zero, the subtitle slot rendered the balance projection ("Projected 1-year balance: $0.00"), which is meaningless at $0.

This makes the subtitle state-dependent: while the amount is empty/zero it shows "Earn up to {APY}% APY" (matching the Figma empty-state design), and once the user enters an amount it switches to the existing projected-balance line. When the APY is unknown/loading, nothing is rendered, as before.

The change is contained to BalanceProjection, which already owns the subtitle slot and consumes the APY hook — no parent rewiring.

Changelog

CHANGELOG entry: Added an "Earn up to X% APY" prompt on the Money account input screen empty state.

Related issues

Fixes: MUSD-891

Manual testing steps

Feature: Money account input screen empty state

  Scenario: user opens the Convert crypto / Add funds input screen
    Given the amount field is empty ($0)
    Then the subtitle reads "Earn up to 4% APY"

    When the user enters an amount
    Then the subtitle switches to "Projected 1-year balance: $X.XX"

Screenshots/Recordings

Before

After

Simulator.Screen.Recording.-.iPhone.17.-.2026-06-04.at.11.57.31.mov

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

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
Localized subtitle copy and conditional rendering in BalanceProjection only; no auth, payments, or data-path changes.

Overview
BalanceProjection now treats an empty or $0 fiat amount as an empty state: it shows "Earn up to {{percentage}}% APY" (via new confirm.custom_amount.earn_up_to_apy copy) using apyPercent from useMoneyAccountBalance, instead of a meaningless projected $0.00 line. When the user enters a positive amount, behavior is unchanged—the projected balance still compounds with apyDecimal.

If APY is loading/invalid, or apyPercent is missing on a zero amount, the component still renders nothing. Non-numeric amounts still return null. Tests were updated to cover the earn prompt, the missing-apyPercent zero case, and to split invalid input from the empty-state path.

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

@Kureev Kureev added team-earn pr-not-ready-for-e2e Skip E2E and block merging. Remove this label once the PR is ready to run the E2E tests. labels Jun 4, 2026
@github-actions

github-actions Bot commented Jun 4, 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-S label Jun 4, 2026
@Kureev Kureev self-assigned this Jun 4, 2026
@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 Jun 4, 2026
@Kureev Kureev marked this pull request as ready for review June 4, 2026 11:24
@Kureev Kureev requested a review from a team as a code owner June 4, 2026 11:24
@github-actions github-actions Bot added the risk:high AI analysis: high risk label Jun 4, 2026
@Kureev Kureev enabled auto-merge June 4, 2026 14:34
@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

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

E2E Test Selection:
The changes are focused on the balance-projection component within the confirmations flow:

  1. balance-projection.tsx: Adds a new UI state for zero/empty amounts - instead of returning null, it now shows an "Earn up to X% APY" message when apyPercent is available. This is a UI enhancement for the staking/lending (money account) deposit confirmation flow.

  2. balance-projection.test.tsx: Unit test updates covering the new zero-amount behavior.

  3. locales/languages/en.json: Adds the earn_up_to_apy i18n string used by the component.

Impact analysis:

  • The balance-projection component is imported by custom-amount-info, which is used in money account deposit/withdraw, perps deposit/withdraw, predict deposit/withdraw, and mUSD conversion confirmations.
  • The change affects the staking/lending confirmation UI (SmokeStake) and money/card flows (SmokeMoney).
  • Since these flows involve transaction confirmations, SmokeConfirmations is also required per tag descriptions ("When selecting SmokeStake, also select SmokeConfirmations").
  • SmokeMoney is relevant because the money account deposit/withdraw flows use this component.
  • The change is low risk - it's a UI-only enhancement with no logic changes to transaction processing, just adding a new display state for zero amounts.

Tags NOT selected:

  • SmokePerps/SmokePredictions: While custom-amount-info is used in perps/predict flows, the balance-projection component's new zero-amount behavior is specifically tied to useMoneyAccountBalance (which provides apyPercent), making it primarily relevant to the money/staking flows. The perps/predict flows use custom-amount-info but the APY display is specific to money account context.
  • All other tags: No impact on browser, accounts, network, swap, snaps, identity, or other areas.

Performance Test Selection:
The changes are purely UI-level enhancements to the balance-projection component - adding a new display state for zero amounts. There are no changes to data fetching, state management, list rendering, app initialization, or other performance-sensitive areas. No performance tests are warranted.

View GitHub Actions results

@Kureev Kureev added this pull request to the merge queue Jun 4, 2026
Merged via the queue into main with commit 81fda3a Jun 4, 2026
193 of 195 checks passed
@Kureev Kureev deleted the kureev/MUSD-891 branch June 4, 2026 15:39
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 4, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.81.0 Issue or pull request that will be included in release 7.81.0 label Jun 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.81.0 Issue or pull request that will be included in release 7.81.0 risk:high AI analysis: high risk size-S team-earn

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants