fix: hide network filter on mUSD tokens view#28673
fix: hide network filter on mUSD tokens view#28673Kureev wants to merge 1 commit intoMetaMask:mainfrom
Conversation
|
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. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Reviewed by Cursor Bugbot for commit fb57af4. Configure here.
| <TokenListControlBar | ||
| goToAddToken={goToAddToken} | ||
| showAddToken={!showOnlyMusd} | ||
| hideSort={showOnlyMusd} |
There was a problem hiding this comment.
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.
Reviewed by Cursor Bugbot for commit fb57af4. Configure here.
| expect(queryByTestId('tokens-empty-state')).toBeOnTheScreen(); | ||
| }); | ||
|
|
||
| expect(queryByTestId('token-list-control-bar')).toBeNull(); |
There was a problem hiding this comment.
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.
Triggered by project rule: Unit Testing Guidelines
Reviewed by Cursor Bugbot for commit fb57af4. Configure here.


Description
Hides the "Popular networks" network-filter dropdown on the mUSD-only tokens view (rendered by
CashTokensFullView, the "Money" screen).The
Tokenscomponent is shared between the legacy wallet tab, the homepage redesign, and the Cash/mUSD view. In the Cash case it's mounted withshowOnlyMusd={true}, which already hides the add-token button and the sort button. The only remaining control inTokenListControlBarwas 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
TokenListControlBarrender inapp/components/UI/Tokens/index.tsxon!showOnlyMusd. No new props, no changes toBaseControlBar(which is shared with DeFi, Activity, and Settings and must stay untouched), and every other caller ofTokensis unaffected.Changelog
CHANGELOG entry: Removed the network filter from the Money (mUSD) tokens view.
Related issues
Fixes: MUSD-643
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
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
TokenListControlBarentirely whenTokensis rendered withshowOnlyMusd, 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.