Skip to content

fix: hide network filter on mUSD tokens view#28673

Open
Kureev wants to merge 1 commit intoMetaMask:mainfrom
margelo:kureev/MUSD-643
Open

fix: hide network filter on mUSD tokens view#28673
Kureev wants to merge 1 commit intoMetaMask:mainfrom
margelo:kureev/MUSD-643

Conversation

@Kureev
Copy link
Copy Markdown
Contributor

@Kureev Kureev commented Apr 10, 2026

Description

Hides the "Popular networks" network-filter dropdown on the mUSD-only tokens view (rendered by CashTokensFullView, the "Money" screen).

The Tokens component is shared between the legacy wallet tab, the homepage redesign, and the Cash/mUSD view. In the Cash case it's mounted with showOnlyMusd={true}, which already hides the add-token button and the sort button. The only remaining control in TokenListControlBar was the network filter, which doesn't make sense on a single-token view: mUSD is deployed on a fixed set of chains and the user isn't browsing a multi-token list here.

The change guards the TokenListControlBar render in app/components/UI/Tokens/index.tsx on !showOnlyMusd. No new props, no changes to BaseControlBar (which is shared with DeFi, Activity, and Settings and must stay untouched), and every other caller of Tokens is unaffected.

Changelog

CHANGELOG entry: Removed the network filter from the Money (mUSD) tokens view.

Related issues

Fixes: MUSD-643

Manual testing steps

Feature: Money (mUSD) tokens view control bar

  Scenario: user opens the Money screen
    Given the user has the mUSD conversion flow enabled and is geo-eligible
    And the user is on the wallet homepage

    When the user taps the "Money" section to open the full mUSD tokens view
    Then the "Popular networks" dropdown is not shown above the token list
    And the mUSD token balances, "Your bonus" section, "Convert your stablecoins" section, and "Convert to mUSD" CTA are all still shown

  Scenario: user opens the main tokens tab
    Given the user is on the wallet homepage

    When the user views the main tokens list
    Then the "Popular networks" dropdown is still shown above the token list
    And the sort and add-token controls are still shown

Screenshots/Recordings

Before

After

image image

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

Low Risk
Low risk UI-conditional rendering change limited to the showOnlyMusd (Cash/mUSD) variant, with updated unit tests to prevent regressions. Main tokens views should be unaffected, but reviewers should sanity-check the Cash screen header/spacing when the control bar is removed.

Overview
Hides the TokenListControlBar entirely when Tokens is rendered with showOnlyMusd, removing the remaining network filter UI from the mUSD-only Cash view.

Updates the Cash-view unit test to assert the control bar is not rendered/called (instead of verifying specific props), while keeping the empty-state assertions intact.

Reviewed by Cursor Bugbot for commit fb57af4. 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 April 10, 2026 14:32
@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.

Copy link
Copy Markdown

@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 2 potential issues.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit fb57af4. Configure here.

<TokenListControlBar
goToAddToken={goToAddToken}
showAddToken={!showOnlyMusd}
hideSort={showOnlyMusd}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Redundant props always equal their default values

Low Severity

Inside the {!showOnlyMusd && (...)} guard, showAddToken={!showOnlyMusd} always evaluates to true and hideSort={showOnlyMusd} always evaluates to false, since the block only executes when showOnlyMusd is falsy. Both values match the component's defaults (showAddToken = true, hideSort = false), making these props redundant dead code that misleadingly suggests they could vary.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit fb57af4. Configure here.

expect(queryByTestId('tokens-empty-state')).toBeOnTheScreen();
});

expect(queryByTestId('token-list-control-bar')).toBeNull();
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Test uses toBeNull instead of not.toBeOnTheScreen

Low Severity

The assertion expect(queryByTestId('token-list-control-bar')).toBeNull() uses toBeNull() to check element absence. The unit testing guidelines require using not.toBeOnTheScreen() for absence checks, as it communicates intent more clearly and aligns with the project's preferred matcher conventions.

Fix in Cursor Fix in Web

Triggered by project rule: Unit Testing Guidelines

Reviewed by Cursor Bugbot for commit fb57af4. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants