Skip to content

fix: Polish token selector for Buy, Swap and Send#28711

Merged
amandaye0h merged 3 commits intomainfrom
asset-selector
Apr 15, 2026
Merged

fix: Polish token selector for Buy, Swap and Send#28711
amandaye0h merged 3 commits intomainfrom
asset-selector

Conversation

@amandaye0h
Copy link
Copy Markdown
Contributor

@amandaye0h amandaye0h commented Apr 13, 2026

Description

What is the reason for the change?

  • Inconsistent filter pill styling: Send screen network filter pills used different styling (8px radius, transparent + border) than the Bridge token selector (12px radius, solid selected/unselected pills), which made the product feel inconsistent.
  • Layout: On Send, the search bar was above the network pills; aligning with Bridge and putting filters first improves scan order when choosing a network.
  • Typography: Ramp token list subtitles (e.g. MUSD, ETH, BTC) used Body MD instead of the smaller Body SM used elsewhere for symbols/secondary labels.

What is the improvement/solution?

  • Unified filter pill UI: Send network filter pills now use the same component and styling as the Bridge token selector: ButtonToggle with 12px corner radius (rounded-xl), solid background when selected (primary) and when unselected (secondary), and no border. This matches the Bridge “Select token” filter chips.
  • Reordered Send layout: Network filter pills are rendered below the search bar on the Send asset screen
  • Ramp token list typography: Ramp TokenListItem subtitles (symbols) now use TextVariant.BodySM instead of TextVariant.BodyMD for consistent secondary label sizing.
  • Tests: Snapshots were updated for the affected components (e.g. network filter, asset view, Ramp token list, Bridge token selector, NFT confirmations) to reflect the UI changes.

Changelog

CHANGELOG entry: fix: Polish token selector for Buy, Swap and Send

Related issues

Fixes:

Manual testing steps

Feature: Send and token selector UI alignment

  Scenario: user uses network filters and sees consistent token list styling
    Given the user is on the Send screen or Ramp/Bridge token selection

    When the user views network filter pills and token list items
    Then network pills are above search on Send, use 12px radius and solid pill styling
    And Ramp token list subtitles (MUSD, ETH, BTC) use Body SM

Screenshots/Recordings

Before

Screenshot 2026-04-14 at 3 23 19 AM

After

Screenshot 2026-04-13 at 1 51 21 PM

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
Primarily UI layout/styling refactors (chip components, spacing, avatar sizes) with minimal behavioral change; risk is limited to visual regressions and testID-dependent UI tests.

Overview
Aligns token-selection UIs across Bridge, Ramp, and Send by standardizing spacing and filter chip styling.

Bridge and Ramp token selectors reorder the search bar and network pills/filters and switch to Tailwind-based layout spacing (removing some local styles). Send confirmations’ NetworkFilter is restyled to use ButtonToggle chips with AvatarNetwork icons (and new avatar test IDs), and the send asset search padding is adjusted.

Token list item visuals are polished (e.g., Bridge TokenSelectorItem row height/spacing, larger token avatar, smaller secondary balance text; NFT avatar gets rounded corners), and tests are updated to assert the new avatar test IDs.

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 13, 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.

@amandaye0h
Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@amandaye0h amandaye0h marked this pull request as ready for review April 13, 2026 08:27
@amandaye0h amandaye0h requested review from a team as code owners April 13, 2026 08:27
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 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 ad4b35f. Configure here.

@github-actions github-actions Bot added the risk-medium Moderate testing recommended · Possible bug introduction risk label Apr 13, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeTrade, SmokeConfirmations, SmokeRamps
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: medium
  • AI Confidence: 88%
click to see 🤖 AI reasoning details

E2E Test Selection:

The PR contains UI/styling and component migration changes across three main areas:

  1. Bridge Token Selector (BridgeTokenSelector.tsx, BridgeTokenSelector.styles.ts, TokenSelectorItem.tsx): Layout reorder (search bar moved above network pills), visual tweaks to token items (avatar size, padding, min-height). These changes affect the bridge token selection flow → SmokeTrade (bridge flows). Per SmokeTrade tag description, bridge flows also require SmokeConfirmations.

  2. Ramp Token Selection (TokenSelection.tsx, TokenNetworkFilterBar.tsx, TokenNetworkFilterBar.styles.ts): Layout reorder (search bar moved above network filter bar), component migration from old Button/AvatarNetwork to new ButtonToggle design system component. This affects the buy/sell token selection UI → SmokeRamps.

  3. Confirmations/Send (network-filter.tsx, network-filter.testIds.ts, network-filter.test.tsx, asset.tsx, nft.tsx): The network filter component in the send flow was refactored from Pressable+Avatar to ButtonToggle (a more significant change as it changes the interactive element). New test IDs added. Minor padding/style changes to asset search and NFT display. These affect the send/confirmation flows → SmokeConfirmations.

All changes are UI-level (no business logic, no controller changes, no state management changes). The component migration from Pressable to ButtonToggle in the network filter is the most impactful change as it changes the interactive behavior of the send flow's network selector. The layout reorders in Bridge and Ramp are cosmetic but could affect test selectors or user interaction flows.

No tags beyond SmokeTrade, SmokeConfirmations, and SmokeRamps are warranted as:

  • No account management changes (SmokeAccounts not needed)
  • No network/chain permission changes (SmokeNetworkAbstractions not needed)
  • No identity/sync changes (SmokeIdentity not needed)
  • No Snaps changes (FlaskBuildTests not needed)
  • No multi-chain API changes (SmokeMultiChainAPI not needed)

Performance Test Selection:
All changes are UI styling and component migration changes (layout reorders, padding adjustments, avatar size tweaks, ButtonToggle migration). These are cosmetic/structural UI changes that do not affect data loading, state management, app startup, or rendering performance in a measurable way. No performance-sensitive code paths (controllers, Redux, API calls, list virtualization logic) were modified.

View GitHub Actions results

@sonarqubecloud
Copy link
Copy Markdown

@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

@amandaye0h amandaye0h added this pull request to the merge queue Apr 15, 2026
Merged via the queue into main with commit 1507b42 Apr 15, 2026
172 of 181 checks passed
@amandaye0h amandaye0h deleted the asset-selector branch April 15, 2026 12:55
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 15, 2026
@metamaskbot metamaskbot added the release-7.74.0 Issue or pull request that will be included in release 7.74.0 label Apr 15, 2026
pull Bot pushed a commit to Reality2byte/metamask-mobile that referenced this pull request Apr 28, 2026
…etaMask#29391)

<!--
Please submit this PR as a draft initially.

Do not mark it as "Ready for review" until this PR meets the canonical
Definition of Ready For Review in `docs/readme/ready-for-review.md`.

In short: the template must be materially complete (not just section
titles
present), all status checks must be currently passing, and the only
expected
follow-up commits must be reviewer-driven.
-->

## **Description**

This PR polishes the filter patterns on the Market and Transactions
pages for consistency. It is part of a wider initiative to standardize
our design patterns. [See this file
](https://www.figma.com/design/aRyo0N82L0IoNlMVIKvSpc/Mobile-Papercuts?node-id=1204-1329)for
context.

## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry: null

## **Related issues**

Fixes:

MetaMask#28711
MetaMask#29396

## **Manual testing steps**

```gherkin
Feature: Perps market category filters (design system badge, no dismiss icon)

  Scenario: user selects and clears a perps market category using chip taps only
    Given I am on the Perps markets list and all category chips are visible with none selected (or a known starting filter)

    When user taps a category chip to apply that filter, then taps that same chip again
    Then the list filters when the chip is selected, no dismiss “×” appears on the chip, and tapping the selected chip again clears the filter back to all markets
```

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<img width="768" height="771" alt="Screenshot 2026-04-28 at 8 54 33 PM"
src="https://github.com/user-attachments/assets/43fb350b-68ae-438a-b6cc-f771ec0beee8"
/>

### **After**

<img width="1285" height="743" alt="Screenshot 2026-04-28 at 1 43 59 PM"
src="https://github.com/user-attachments/assets/bded9482-933e-4214-8b3f-78fd6420ef74"
/>

## **Pre-merge author checklist**


<!--
Every checklist item must be consciously assessed before marking this PR
as
"Ready for review". A checked box means you deliberately considered that
responsibility, not that you literally performed every action listed.

Unchecked boxes are ambiguous: they are not an implicit "N/A" and they
are not
a silent "skip". See `docs/readme/ready-for-review.md` for the full
checklist
semantics.
-->

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I've included tests if applicable
- [ ] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

#### 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](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/edit-v2/401401446401?draftShareId=9d77e1e1-4bdc-4be1-9ebb-ccd916988d93)
to import wallets with many accounts and tokens
- [ ] I've instrumented key operations with Sentry traces for production
performance metrics
- See [`trace()`](/app/util/trace.ts) for usage and
[`addToken`](/app/components/Views/AddAsset/components/AddCustomToken/AddCustomToken.tsx#L274)
for an example

For performance guidelines and tooling, see the [Performance
Guide](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/400085549067/Performance+Guide+for+Engineers).

## **Pre-merge reviewer checklist**

<!--
Reviewer checklist items follow the same semantics as the author
checklist: an
unchecked box is ambiguous, a checked box means the reviewer consciously
assessed that responsibility. See `docs/readme/ready-for-review.md`.
-->

- [ ] 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.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Low risk UI polish and minor component API simplification; main risk
is unintended visual/regression in Perps category filtering due to
removing the badge dismiss affordance.
> 
> **Overview**
> Polishes Perps filter UI spacing to be consistent across screens
(e.g., tighter gaps between Transactions filter tabs and adjusted Market
search bar padding).
> 
> Simplifies `PerpsMarketCategoryBadge` by removing the
`showDismiss`/`onDismiss` behavior and dismiss icon, updating
styling/typography, and adjusting `PerpsMarketCategoryBadges` plus tests
to reflect the new toggle-off-by-retap interaction without dismiss
indicators.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
5e65e5f. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.74.0 Issue or pull request that will be included in release 7.74.0 risk-medium Moderate testing recommended · Possible bug introduction risk size-M team-assets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants