Skip to content

feat: add CashTokensFullView and integrate into MainNavigator#27123

Merged
wachunei merged 39 commits into
mainfrom
TMCU-527-cash-section
Mar 11, 2026
Merged

feat: add CashTokensFullView and integrate into MainNavigator#27123
wachunei merged 39 commits into
mainfrom
TMCU-527-cash-section

Conversation

@PatrykLucka
Copy link
Copy Markdown
Contributor

@PatrykLucka PatrykLucka commented Mar 6, 2026

Description

  1. What is the reason for the change?
    The redesigned homepage needs a dedicated Cash section as the first section, surfacing mUSD (MetaMask USD) and guiding users to convert stablecoins and claim bonuses.

  2. What is the improvement/solution?

    • Cash section (homepage): When mUSD conversion is enabled and user is geo-eligible, the first section is "mUSD". It shows aggregated mUSD balance (Linea + Ethereum), annualized bonus copy (e.g. "Get 3% annualized bonus…" with the percentage in green), and a "Claim bonus" CTA on the row when a bonus is claimable. Tapping the section header navigates to the Cash token list. When the user has no mUSD, the section shows a Get mUSD empty state: the same annualized copy, a tappable mUSD token row that navigates to Token Details (Mainnet mUSD, same destination as trending tokens), and a "Get mUSD" button that routes to the Buy flow (when mUSD is buyable) or the Convert flow (when the user has convertible stablecoins e.g. USDC).
    • Cash token list screen: New full-view screen (CashTokensFullView) that shows only mUSD positions across supported networks (Ethereum Mainnet, Linea). When the user has no mUSD, the screen renders the same Get mUSD empty state (handled by CashTokensFullView via useMusdBalance); when the user has mUSD, it renders Tokens with showOnlyMusd. Same network filter as the main token list; no add-token or sort. No mUSD-specific empty-state logic inside Tokens.
    • mUSD isolation: mUSD is removed from the main Tokens section and from the generic full token list; it appears only in the Cash section and Cash full view.
    • Implementation details: Tokens supports a showOnlyMusd prop (filter list to mUSD, hide add/sort in control bar); TokenListControlBar supports showAddToken and hideSort. Empty state component CashGetMusdEmptyState is used on the homepage (in CashSection) and in CashTokensFullView; token row uses NavigationService to navigate to Token Details. New route CASH_TOKENS_FULL_VIEW and screen registration. Uses design-system components. Cash section does not expose a refresh ref (no-op removed).

Changelog

CHANGELOG entry: Added a Cash section on the homepage that shows aggregated mUSD balance, annualized bonus copy for stablecoin holders, and a dedicated Cash token list view with network filter.

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/TMCU-527

Manual testing steps

Feature: Homepage Cash section and Cash token list

  Scenario: User with mUSD conversion enabled and geo-eligible sees Cash section first
    Given the user has mUSD conversion feature enabled and is in an eligible region
    When the user opens the redesigned homepage
    Then the Cash section appears as the first section with title "Cash"
    And if the user has convertible stablecoins, the annualized bonus copy is shown (e.g. "Get 3% annualized bonus...")
    And if the user has mUSD balance, the aggregated mUSD row is shown with balance and optional "Claim bonus"

  Scenario: User navigates to Cash token list from section header
    Given the user is on the homepage with Cash section visible
    When the user taps the Cash section header (or the ">" affordance)
    Then the app navigates to the Cash token list screen
    And the screen shows only mUSD positions (per network) or the cash empty state when none
    And the network filter is visible and works; add-token and sort buttons are not shown

  Scenario: User with network filter applied sees mUSD when opening Cash list
    Given the user has a network filter applied (e.g. single network) and has mUSD on that network
    When the user opens the Cash token list from the homepage
    Then mUSD positions for the enabled network(s) are shown
    And the user can change the network filter from the control bar

Screenshots/Recordings

Before

After

musd-section.mov

Pre-merge author checklist

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 navigation routes and conditional token filtering (including excluding mUSD from main lists) gated by feature flags/geo eligibility, which could affect token visibility and analytics. Also changes fiat formatting to use currencyDisplay: 'narrowSymbol', which may alter currency rendering across the app.

Overview
Introduces a new Cash (mUSD) surface: a CashSection is added as the first homepage section when mUSD conversion is enabled and geo-eligible, showing either an aggregated mUSD row (with optional Claim bonus) or a Get mUSD empty state that deep-links to mUSD details and routes users into buy/convert flows with new home_cash_section analytics location.

Adds a dedicated CashTokensFullView route/screen and extends Tokens/TokenListControlBar to support an mUSD-only list (showOnlyMusd) that hides add-token/sort and uses cash-specific empty state messaging; when the Cash section is rendered, mUSD is filtered out of the main tokens lists (including popular tokens) to avoid duplication.

Updates mUSD-related token list items to show a non-clickable green "3% bonus" label for mUSD when no claimable reward exists (only when conversion + geo eligibility are true), expands/adjusts unit tests and snapshots accordingly, and tweaks formatFiat to prefer Intl narrow currency symbols.

Written by Cursor Bugbot for commit cc3ad61. This will update automatically on new commits. Configure here.

@PatrykLucka PatrykLucka self-assigned this Mar 6, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 6, 2026

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.

@metamaskbot metamaskbot added the team-mobile-ux Mobile UX team label Mar 6, 2026
@github-actions github-actions Bot added the size-L label Mar 6, 2026
@PatrykLucka PatrykLucka marked this pull request as ready for review March 6, 2026 15:19
@PatrykLucka PatrykLucka requested review from a team as code owners March 6, 2026 15:19
Comment thread app/components/UI/Tokens/index.tsx
Comment thread locales/languages/en.json Outdated
Comment thread app/components/Views/Homepage/Sections/Tokens/TokensSection.tsx
Comment thread app/components/Views/Homepage/Sections/Cash/MusdAggregatedRow.tsx Outdated
Comment thread app/components/UI/Tokens/index.tsx Outdated
Comment thread app/components/Views/Homepage/Sections/Cash/CashSection.tsx
@PatrykLucka PatrykLucka force-pushed the TMCU-527-cash-section branch from d249540 to 9dfd447 Compare March 6, 2026 16:50
@github-actions github-actions Bot added size-XL and removed size-L labels Mar 6, 2026
Comment thread app/components/UI/Tokens/index.test.tsx
@PatrykLucka PatrykLucka force-pushed the TMCU-527-cash-section branch from 9dfd447 to ff749b2 Compare March 9, 2026 13:27
Comment thread app/components/Views/Homepage/Sections/Cash/CashGetMusdEmptyState.tsx Outdated
Comment thread app/components/Views/CashTokensFullView/CashTokensFullView.tsx
Comment thread app/components/Views/Homepage/Homepage.tsx
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 46.01770% with 61 lines in your changes missing coverage. Please review.
✅ Project coverage is 57.91%. Comparing base (0ea672c) to head (2722691).
⚠️ Report is 18 commits behind head on main.

Files with missing lines Patch % Lines
...s/Homepage/Sections/Cash/CashGetMusdEmptyState.tsx 51.42% 15 Missing and 2 partials ⚠️
...nents/Views/Homepage/Sections/Cash/CashSection.tsx 10.52% 17 Missing ⚠️
...Views/Homepage/Sections/Cash/MusdAggregatedRow.tsx 13.33% 13 Missing ⚠️
app/components/UI/Tokens/index.tsx 64.28% 2 Missing and 3 partials ⚠️
...s/Views/Homepage/Sections/Tokens/TokensSection.tsx 0.00% 5 Missing ⚠️
app/components/Views/Homepage/Homepage.tsx 0.00% 3 Missing ⚠️
...iews/Homepage/Sections/Cash/CashAnnualizedCopy.tsx 85.71% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main   #27123       +/-   ##
===========================================
- Coverage   81.68%   57.91%   -23.78%     
===========================================
  Files        4652     4665       +13     
  Lines      121697   122035      +338     
  Branches    26740    26830       +90     
===========================================
- Hits        99412    70677    -28735     
- Misses      15369    45542    +30173     
+ Partials     6916     5816     -1100     

☔ View full report in Codecov by Sentry.
📢 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.

Comment thread app/components/Views/Homepage/Sections/Cash/MusdAggregatedRow.test.tsx Outdated
Comment thread app/components/Views/Homepage/Homepage.tsx
@Matt561
Copy link
Copy Markdown
Contributor

Matt561 commented Mar 9, 2026

Hey @PatrykLucka 👋. Some notes from testing:

  1. For brand new accounts (no tokens), the "Get mUSD" CTA is displayed and doesn't do anything on click. I'm not sure what the intended behaviour is here. Previously, in our primary conversion CTA we'd show the "Buy mUSD" variant of the asset list CTA but the redesigned home screen already has a "Buy" asset for mUSD in the "Tokens" section.

  2. Clicking on the "MetaMask USD" row in the new section fires a "Home Viewed" event while redirecting to the mUSD AssetOverview page. Not sure if this is desired.

  3. The mUSD asset icon is missing when clicking the mUSD aggregated balance row and redirecting to the AssetOverview page.

image
  1. Does it make sense for the mUSD full screen list to be accessible if the user doesn't have any mUSD? My understanding is that the same CTA as the home screen will be the only component present. Would it make more sense to only display the link (chevron) when the user has mUSD?

  2. Do you have a ticket for event tracking/analytics in your roadmap or is this something our team will handle before launch once the redesign is complete? I just want to make sure we have tracking before release. If our team is handling, I want to make sure we have ample notice.

@PatrykLucka
Copy link
Copy Markdown
Contributor Author

Hey @Matt561

  1. Actually we should not show mUSD token on the token list after this change, let me fix that. "Get mUSD" should open the same thing "Buy" is opening now and that's how it works for me. I tried with empty account and also with a brand new srp and it also works correctly.
  2. Thanks, good catch. I'll look closer at segment events.
  3. I'm not sure why that row is there in the first place 🤔 I don't see it at all. And the icon thing, were you testing with simulator? Are you sure it was still running in your terminal. I'm not able to reproduce this one as well.
  4. That's designs decision, we can discuss that with them. I think it might make sense, just to keep consistency with other sections and show users that they can click it, so they know it's clickable also when it's not empty.
  5. We don't have a separate ticket now, I'll try to look at segment events more carefully and propose something that makes sense for now, let me know if you have any comments or suggestions. And of course we can update them in the future.

@PatrykLucka PatrykLucka requested a review from a team as a code owner March 10, 2026 11:12
Comment thread app/components/UI/Tokens/TokenList/TokenListItem/TokenListItem.tsx
Comment thread app/components/Views/Homepage/Sections/Cash/CashSection.tsx
Comment thread app/components/Views/CashTokensFullView/CashTokensFullView.tsx
Comment thread app/components/Views/Homepage/Sections/Cash/MusdAggregatedRow.tsx Outdated
@DostoevskysPiano
Copy link
Copy Markdown
Contributor

Hey @Matt561 @PatrykLucka ! Jumping in here testing build 3607 that you generated yesterday @PatrykLucka.

  1. I am able to replicate this issue. Get mUSD is pressable but is not navigating anywhere. @PatrykLucka Let me know if you need help/a video on this one

  2. This is desired as when redirecting away from the homepage, it triggers a "summary" event

  3. Unable to replicate, unsure of where you are seeing this on the Asset Details page.

  4. I asked this as Product feedback in that larger thread. They stated they would like to keep the chevron in the empty state

  5. Yes @PatrykLucka is going to move some of the Segment events around. I will also audit them on the build today and tomorrow

Comment thread app/components/Views/Homepage/context/HomepageScrollContext.ts Outdated
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

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 1 potential issue.

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

);
return;
}
}
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.

Get mUSD button silently no-ops when payment token is missing

High Severity

In handleGetMusdPress, when hasConvertibleTokens is true but getPaymentTokenForSelectedNetwork() returns null, the function logs an error and returns early — it never reaches the isMusdBuyableOnAnyChain branch that would call goToBuy. Since canGetMusd = hasConvertibleTokens || isMusdBuyableOnAnyChain, the button is visible and tappable, but pressing it does nothing, which matches the PR reviewer-reported bug "Get mUSD is pressable but is not navigating anywhere."

Fix in Cursor Fix in Web

@DostoevskysPiano
Copy link
Copy Markdown
Contributor

FYI -> Just spoke with @juanmigdr on all the Product related concerns. We are all good on those

@Matt561
Copy link
Copy Markdown
Contributor

Matt561 commented Mar 11, 2026

Here I see only one token: image

When I navigate here I see 2 and one of them is linea and one is ethereum, its confusing: image

@juanmigdr I believe this is because it's an aggregated balance and not a standard token row.

import { useNavigation } from '@react-navigation/native';
import { useSelector } from 'react-redux';
import { Box } from '@metamask/design-system-react-native';
import SectionTitle from '../../components/SectionTitle';
Copy link
Copy Markdown
Contributor

@Matt561 Matt561 Mar 11, 2026

Choose a reason for hiding this comment

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

@PatrykLucka is this a new component that needs to be included in a commit?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

yes, fixed it in 696846c

SectionTitle was removed when PR #26976 merged (replaced by
SectionHeader in component-library/components-temp). Update the
import and JSX usage to fix the build.
@wachunei wachunei enabled auto-merge March 11, 2026 18:26
salimtb
salimtb previously approved these changes Mar 11, 2026
Comment thread android/app/build.gradle Outdated
targetSdkVersion rootProject.ext.targetSdkVersion
versionName "7.70.0"
versionCode 3607
versionCode 3992
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 revert changes around build number?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

done 🙏

@Matt561 Matt561 self-requested a review March 11, 2026 19:06
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeWalletPlatform, SmokeTrade, SmokeConfirmations, SmokeRamps
  • Selected Performance tags: @PerformanceAssetLoading, @PerformanceLaunch
  • Risk Level: medium
  • AI Confidence: 77%
click to see 🤖 AI reasoning details

E2E Test Selection:
Changes heavily impact the Homepage, Tokens sections, Cash (mUSD) section, TokenList components, navigation types, Routes, and MainNavigator. These areas are central to the wallet’s main screen and navigation structure.

  • Homepage and TokensSection updates directly affect core wallet UI, asset display, and wallet lifecycle surfaces → covered by SmokeWalletPlatform.
  • Changes to MainNavigator.js and navigation/Routes.ts can impact navigation to Trade flows (Swap, Bridge, Earn, etc.) → include SmokeTrade to ensure wallet action entry points and trade flows still function.
  • Since SmokeTrade includes on-chain flows, SmokeConfirmations is required (per tag dependency rules).
  • Homepage modifications may affect Buy/Sell entry points from wallet home → include SmokeRamps to validate on-ramp/off-ramp access and flows.

No controller/Engine-level changes detected, so network, identity, snaps, or multi-chain API tags are not required.

Overall risk is medium due to core homepage and navigation changes that could indirectly affect multiple user flows.

Performance Test Selection:
Homepage, token list items, fiat formatting, and popular tokens hooks were modified. These can affect asset/balance rendering performance and initial wallet load time. Running Asset Loading and Launch performance tests ensures no regression in token rendering, balance fetching, and time-to-interactive on app start.

View GitHub Actions results

@github-actions
Copy link
Copy Markdown
Contributor

E2E Fixture Validation — Schema is up to date
11 value mismatches detected (expected — fixture represents an existing user).
View details

@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor

@Matt561 Matt561 left a comment

Choose a reason for hiding this comment

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

Tests well! Approving ✅

@wachunei wachunei added this pull request to the merge queue Mar 11, 2026
Merged via the queue into main with commit 47741a3 Mar 11, 2026
197 of 200 checks passed
@wachunei wachunei deleted the TMCU-527-cash-section branch March 11, 2026 22:11
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 11, 2026
@metamaskbot metamaskbot added the release-7.70.0 Issue or pull request that will be included in release 7.70.0 label Mar 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.70.0 Issue or pull request that will be included in release 7.70.0 size-XL team-mobile-ux Mobile UX team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants