Skip to content

fix(money): show projected 1-year balance in USD (MUSD-1173) cp-8.3.0#33333

Merged
Kureev merged 1 commit into
mainfrom
kureev/MUSD-1173
Jul 15, 2026
Merged

fix(money): show projected 1-year balance in USD (MUSD-1173) cp-8.3.0#33333
Kureev merged 1 commit into
mainfrom
kureev/MUSD-1173

Conversation

@Kureev

@Kureev Kureev commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Description

The "Projected 1-year balance" text on the Money crypto deposit screen now always displays the amount in USD with the $ symbol, matching every other Money account surface.

Bug: with a non-USD preferred display currency selected (e.g. EUR), the projection rendered with that currency's symbol (1.040,00 €) even though the underlying value is USD-denominated — the deposit amount on this screen is a dollar input (the same value feeds ReceiveRow as inputAmountUsd), so the number was correct but mislabelled.

Fix: BalanceProjection no longer formats via useFiatFormatter (which stamps the user's selected currency onto the raw number); it renders through moneyFormatUsd (en-US, USD) — the same pattern used by Money activity rows and the Money toasts (#33330). This also removes the component's only Redux currency dependency, so it is structurally incapable of rendering a non-USD symbol.

Changelog

CHANGELOG entry: Fixed the projected 1-year balance on the Money deposit screen to always display in USD ($) instead of the user's preferred fiat currency

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/MUSD-1173

Manual testing steps

Feature: Projected 1-year balance displays USD

  Scenario: user views the balance projection with a non-USD preferred currency
    Given the user's preferred fiat currency is set to EUR
    And the user has a Money account

    When user opens the Money crypto deposit screen and enters an amount
    Then the "Projected 1-year balance" text displays the amount in USD (e.g. "$1,040.00"), not in EUR

Screenshots/Recordings

Before

After

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 display-only change in one Money component with updated unit tests; no payment, auth, or balance calculation logic changes.

Overview
BalanceProjection on the Money crypto deposit screen now formats the projected balance with moneyFormatUsd instead of useFiatFormatter, so the label always shows USD with $ (e.g. $1,040.00) even when the user’s preferred display currency is something else.

Tests drop the fiat-formatter mock, update expected strings for en-US grouping, and add coverage that euro symbols are not shown for the projection.

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

@Kureev Kureev requested a review from a team as a code owner July 15, 2026 11:20
@Kureev Kureev self-assigned this Jul 15, 2026
@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.

@metamask-ci

metamask-ci Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

PR template — items to address before "Ready for review"

Warnings — informational, address before merging:

  • Screenshots/Recordings section is empty. Add an image/video for user-facing changes, logs/console output for non-user-facing changes, or write N/A if no evidence is applicable.

See docs/readme/ready-for-review.md for the full Definition of Ready for Review.

@github-actions github-actions Bot added size-S risk:low AI analysis: low risk labels Jul 15, 2026
@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: 95%
click to see 🤖 AI reasoning details

E2E Test Selection:
The PR changes only two files within the Money/Card feature area:

  1. BalanceProjection.tsx: Swaps useFiatFormatter (user's preferred currency formatter) for moneyFormatUsd (always USD, with proper thousands separators). This fixes a display bug where projected balances showed without commas (e.g., $1040.00$1,040.00) and ensures the projection always displays in USD regardless of the user's preferred currency setting.

  2. BalanceProjection.test.tsx: Updates unit tests to match the new formatting behavior — removes the useFiatFormatter mock, updates expected values to include commas, and adds a test verifying USD-only output.

The change is entirely contained within app/components/UI/Money/components/BalanceProjection/ and only affects the balance projection display in the Money/Card deposit flow. moneyFormatUsd is already used extensively throughout the Money feature for consistent USD formatting.

SmokeMoney is the appropriate tag as this component is part of the MetaMask Card Add Funds / deposit flow. No other flows (confirmations, swaps, network, accounts) are affected. No shared infrastructure components are touched.

Performance Test Selection:
This is a pure display/formatting change — replacing one string formatter with another. No performance-sensitive code paths (rendering loops, data fetching, state management, navigation) are affected. No performance tests are warranted.

View GitHub Actions results

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.39%. Comparing base (c4cb337) to head (05613a5).
⚠️ Report is 16 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #33333      +/-   ##
==========================================
+ Coverage   84.37%   84.39%   +0.01%     
==========================================
  Files        6127     6132       +5     
  Lines      163530   163729     +199     
  Branches    39887    39925      +38     
==========================================
+ Hits       137974   138173     +199     
+ Misses      16050    16044       -6     
- Partials     9506     9512       +6     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sonarqubecloud

Copy link
Copy Markdown

@Kureev Kureev enabled auto-merge July 15, 2026 13:38
@Matt561 Matt561 changed the title fix(money): show projected 1-year balance in USD (MUSD-1173) fix(money): show projected 1-year balance in USD (MUSD-1173) cp-8.3.0 Jul 15, 2026
@Kureev Kureev added this pull request to the merge queue Jul 15, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 15, 2026
@Kureev Kureev added this pull request to the merge queue Jul 15, 2026
Merged via the queue into main with commit 273908b Jul 15, 2026
177 checks passed
@Kureev Kureev deleted the kureev/MUSD-1173 branch July 15, 2026 19:27
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 15, 2026
@metamask-ci metamask-ci Bot added the release-8.4.0 Issue or pull request that will be included in release 8.4.0 label Jul 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants