Skip to content

feat: replacing stubbed modules in Money Home#29454

Merged
Matt561 merged 35 commits into
mainfrom
feat/money-home-replace-stubbed-modules
May 1, 2026
Merged

feat: replacing stubbed modules in Money Home#29454
Matt561 merged 35 commits into
mainfrom
feat/money-home-replace-stubbed-modules

Conversation

@Matt561

@Matt561 Matt561 commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

Description

This PR replaces many of the placeholder UI elements and no-ops with their production equivalents.

  • Money in bottom navbar: When selectMoneyHomeScreenEnabledFlag is on, the Activity tab is replaced by a Money tab that redirects to Money Home. Activity has been moved to the wallet header.

  • Money Home bottom sheets: The options button (top-right), Transfer action, APY info tooltip, and earnings info tooltip now navigate to their respective modals; Card CTAs route into the Card stack; “Earn on your crypto” opens-temporary "Earn on your crypto" page; wires up "Convert" buttons for assets displayed in the "Earn on your crypto" section.

  • MoneyPotentialEarningsView lists all eligible conversion tokens, shows aggregate projected yield, and reuses row-level conversion behavior.

  • Shared utilities & hooks: Adds moneyFormatFiat, centralizes temp __DEV__ vault APY handling in useMoneyAccountBalance, adds calculateProjectedEarnings helper, and refactors Money-related components to use the shared formatter instead of ad hoc Intl / useFiatFormatter usage. This means we no longer see the "US" prefix in front of USD fiat amount.

  • Updated image assets Updates Money onboarding / condensed cards / How it works images; removes the temporary How it Works header.

  • MoneyAccountHomeRow When selectMoneyHomeScreenEnabledFlag is on, The Money section on the home screen displays the Money account's balance instead of the aggregated mUSD balance. This component has 2 variants; an empty state and a funded state.

Changelog

CHANGELOG entry: Improved the Money home experience behind the feature flag by wiring real navigation (sheets, Card flows, potential earnings and conversion), replacing the Activity tab when the flag is enabled, and showing projected earnings using live APY and balance data.

Related issues

No issue: Money Home and tab-navigation workstream without a single tracking issue from the branch; see #29454 for scope and review. Add Fixes: / Closes: when a primary ticket exists.

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

Medium Risk
Introduces new Money navigation routes/modals and swaps core tab/wallet navigation behavior behind selectMoneyHomeScreenEnabledFlag, which could affect app navigation flows if misconfigured. Also changes fiat formatting and APY/projection calculations used across Money UI, so regressions would show up as incorrect amounts or broken sheets rather than data loss.

Overview
When selectMoneyHomeScreenEnabledFlag is enabled, the bottom tab bar replaces Activity with a new Money tab (new TabBarIconKey.Money) and moves Activity access to a new wallet header button (with ACTIVITY_CLICKED analytics). Navigation is updated so Money routes/modals (More, Transfer, APY info, Earnings info, plus a new MoneyPotentialEarningsView) are registered and can be opened from Money Home.

Money Home is de-stubbed: menu/transfer/card CTAs now navigate to real routes, token “Convert” actions initiate the conversion flow with error logging, and earnings UI now shows lifetime/projected values and opens an earnings info sheet. Shared Money utilities are added and adopted: moneyFormatFiat centralizes fiat formatting, calculateProjectedEarnings standardizes linear projections, useMoneyAccountBalance now returns apyDecimal/apyPercent/apyPercentFormatted and uses the shared formatter, and Money activity fiat formatting is migrated to the same utility.

Homepage Cash section now conditionally renders a new MoneyAccountHomeRow (balance/APY + Get started/Add CTA with loading skeletons) when the Money home flag is on, instead of the prior mUSD aggregated row. Tests and locales are updated accordingly.

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

@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.

@Matt561 Matt561 marked this pull request as ready for review April 29, 2026 18:44
@Matt561 Matt561 requested review from a team as code owners April 29, 2026 18:44
Comment thread app/components/UI/Money/Views/MoneyHowItWorksView/MoneyHowItWorksView.tsx Outdated
Comment thread app/components/UI/Money/hooks/useMoneyAccountBalance.ts

@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 df4364f. Configure here.

Comment thread app/components/Views/Wallet/index.tsx
Comment thread app/components/UI/Money/utils/projections.ts
Matt561 added 22 commits April 30, 2026 20:08
… button on homescreen (top-right) to be the first in the list.
…eyHomeView; make MoneyEarnings props currency-aware

refactor(money): wire useMoneyAccountBalance to moneyFormatFiat, remove inline formatter
…till centralizing to make maintenance easier.
@Matt561 Matt561 force-pushed the feat/money-home-replace-stubbed-modules branch from df4364f to bc0d0e8 Compare May 1, 2026 00:08
@metamaskbotv2 metamaskbotv2 Bot added the INVALID-PR-TEMPLATE PR's body doesn't match template label May 1, 2026
@github-actions

github-actions Bot commented May 1, 2026

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

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

E2E Test Selection:
This PR introduces significant changes to the Money (MetaMask Card/mUSD) feature area with broad navigation impact:

  1. SmokeMoney (primary): Direct changes to MoneyHomeView (major refactoring of all handlers from stubs to real implementations), new MoneyPotentialEarningsView, new modal sheets (MoneyMoreSheet, MoneyTransferSheet, MoneyApyInfoSheet, MoneyEarningsInfoSheet), new MoneyAccountHomeRow component, new routes, and new localization strings. The existing SmokeMoney tests (card-button, card-home-add-funds, ramps) need to run to verify nothing is broken.

  2. SmokeWalletPlatform: The TabBar changes (new Money tab icon key, navigation case) affect the bottom navigation bar used by all tests. The Wallet home view now conditionally shows an Activity button when Money home screen is enabled. The CashSection on the Homepage now conditionally renders MoneyAccountHomeRow instead of the existing mUSD states. These changes affect the core wallet platform navigation and homepage sections.

  3. SmokeConfirmations: MoneyHomeView and MoneyPotentialEarningsView both call initiateCustomConversion which triggers on-chain transactions going through the confirmation flow. Per SmokeMoney tag description: 'When selecting SmokeMoney for Card Add Funds or similar flows that execute swaps, also select SmokeSwap and SmokeConfirmations.'

  4. SmokeSwap: The mUSD conversion flow (initiateCustomConversion) is a swap-like mechanism. Per SmokeMoney description: 'When selecting SmokeMoney for Card Add Funds or similar flows that execute swaps, also select SmokeSwap and SmokeConfirmations.'

  5. SmokeStake: The Money account (mUSD) is a lending/staking product (earn APY). The useMoneyAccountBalance hook refactoring and APY calculation changes could affect earn/stake flows. The MoneyPotentialEarningsView directly relates to staking/lending yield projections.

The MainNavigator change is particularly impactful: when isMoneyHomeScreenEnabled is true, the Activity tab is replaced by the Money tab, and Activity becomes a stack screen. This architectural navigation change could affect any test that navigates to the Activity/Transactions view.

Performance Test Selection:
The changes are primarily feature additions to the Money/Card UI (new views, new modal sheets, new components) and navigation restructuring. While there are new components being rendered, they are behind a feature flag (selectMoneyHomeScreenEnabledFlag) and the changes don't fundamentally alter core performance-sensitive paths like app startup, login, account list rendering, or swap quote fetching. The useMoneyAccountBalance hook refactoring changes fiat formatting but doesn't introduce new expensive operations. No performance test tags are warranted.

View GitHub Actions results

@sonarqubecloud

sonarqubecloud Bot commented May 1, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
3.3% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@brianacnguyen brianacnguyen 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.

Can you provide a screenshot/recording of the change?

@Matt561

Matt561 commented May 1, 2026

Copy link
Copy Markdown
Contributor Author

@brianacnguyen here's a quick demo of the change requiring CO review. When the Money Home feature flag is enabled, we're replacing activity in the bottom navbar with "Money" and moving activity to the top-right action bar.

money_bottom_navbar_demo.mov

@Matt561 Matt561 requested a review from brianacnguyen May 1, 2026 19:38
@Matt561 Matt561 enabled auto-merge May 1, 2026 19:53
@Matt561 Matt561 added the skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. label May 1, 2026
@Matt561 Matt561 added this pull request to the merge queue May 1, 2026
Merged via the queue into main with commit 70aa719 May 1, 2026
266 of 274 checks passed
@Matt561 Matt561 deleted the feat/money-home-replace-stubbed-modules branch May 1, 2026 20:12
@github-actions github-actions Bot locked and limited conversation to collaborators May 1, 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 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

INVALID-PR-TEMPLATE PR's body doesn't match template release-7.77.0 Issue or pull request that will be included in release 7.77.0 size-XL skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. team-earn

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants