Skip to content

feat: swaps new asset picker#22712

Merged
bfullam merged 158 commits intomainfrom
swaps-new-token-picker
Jan 22, 2026
Merged

feat: swaps new asset picker#22712
bfullam merged 158 commits intomainfrom
swaps-new-token-picker

Conversation

@bfullam
Copy link
Copy Markdown
Contributor

@bfullam bfullam commented Nov 14, 2025

Description

Replaces the legacy swap asset picker interfaces with a new, unified asset selector. The new selector is full screen and utilized the new /popular and /search endpoints of the bridge API for significantly faster loading times.

Design: https://www.figma.com/design/1F3yNWYLOVPFpTPeJugH20/SWAP?node-id=9898-17382&t=7aukGCuzC3p7zFV0-0

Changelog

CHANGELOG entry: Added new swaps asset picker

Related issues

Fixes:

Manual testing steps

Feature: new asset picker

  Scenario: user wants to select a swap source or destination asset
    Given they are on the swap page

    When user clicks asset icon
    Then full screen asset picker opens and allows asset selection

Screenshots/Recordings

Before

After

Screen.Recording.2026-01-20.at.17.53.31.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

Consolidates Bridge token selection and cleans up deprecated screens.

  • Route changes: BridgeView now navigates to Routes.BRIDGE.TOKEN_SELECTOR with { type: 'source' | 'dest' }; updated tests to assert new route/params
  • Removes legacy BridgeDestNetworkSelector, BridgeDestTokenSelector, BridgeDestNetworksBar and their tests/snapshots
  • Adds isSelectingToken to view state to prevent quote-expired modal while selecting; updates related mocks
  • Simplifies fee disclaimer rendering to always show bridge.no_mm_fee_disclaimer when no fee (removes noFeeDestAssets check)
  • Component library: KeyValueRowTooltip accepts bottomPadding; KeyValueRowLabel passes it to openTooltipModal

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

davibroc
davibroc previously approved these changes Jan 22, 2026
Copy link
Copy Markdown
Contributor

@davibroc davibroc left a comment

Choose a reason for hiding this comment

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

LGTM

@github-project-automation github-project-automation bot moved this from Needs more work from the author to Review finalised - Ready to be merged in PR review queue Jan 22, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeTrade
  • Risk Level: medium
  • AI Confidence: 90%
click to see 🤖 AI reasoning details

This PR introduces significant changes to the Bridge/Swap token selector functionality:

  1. New unified BridgeTokenSelector component - Replaces separate source/dest token selectors with a single unified component that handles both source and destination token selection via a route parameter.

  2. New hooks for token management:

    • usePopularTokens - Fetches popular tokens from Bridge API with caching
    • useSearchTokens - Handles token search with debouncing and pagination
    • useTokenSelection - Manages token selection logic
    • useBalancesByAssetId - Gets balances indexed by assetId
    • useTokensWithBalances - Merges balances with token data
  3. NetworkPills component - New horizontal scrollable network filter pills for filtering tokens by network

  4. Navigation changes - Routes consolidated from separate source/dest selectors to a single TOKEN_SELECTOR route

  5. E2E test infrastructure changes:

    • QuoteView.ts - Updated tapToken method to wait for element existence and scroll to it (important for test stability)
    • bridge-mocks.ts - Added feature flags for chainRanking and popular tokens mock endpoint
    • swap-mocks.ts - Added popular tokens mock endpoint
    • constants.ts - Added popular tokens response constants for mainnet and Base
    • remoteFeatureFlagsHelper.ts - Added chainRanking to default feature flags
  6. Package update - @metamask/bridge-controller updated from 64.7.0 to 64.8.0

  7. Redux slice changes - Added isSelectingToken state to prevent quote expired modal during token selection, and selectEnabledChainRanking selector for network pills

The E2E tests that use these mocks and page objects are:

  • bridge-action-smoke.spec.ts - Uses bridge-mocks.ts and QuoteView.ts, tagged with SmokeTrade
  • swap-action-smoke.spec.ts - Uses swap-mocks.ts and related swap helpers, tagged with SmokeTrade

The SmokeTrade tag is the appropriate tag to run as it covers:

  • Token swaps (ETH to USDC flow)
  • Cross-chain bridging (ETH Mainnet to Base)
  • The unified swap/bridge interface that this PR modifies

The changes are medium risk because:

  • They modify core Bridge/Swap UI components that are user-facing
  • E2E test infrastructure has been updated to support the new token selector
  • The mocks have been updated to include new API endpoints (popular tokens)
  • Navigation flow has changed from modal-based to screen-based token selection

View GitHub Actions results

Copy link
Copy Markdown
Member

@gambinish gambinish left a comment

Choose a reason for hiding this comment

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

Approving to unblock

@bfullam bfullam enabled auto-merge January 22, 2026 20:45
@davibroc davibroc self-requested a review January 22, 2026 20:46
@sonarqubecloud
Copy link
Copy Markdown

@bfullam bfullam added this pull request to the merge queue Jan 22, 2026
Merged via the queue into main with commit c99cb33 Jan 22, 2026
112 of 146 checks passed
@bfullam bfullam deleted the swaps-new-token-picker branch January 22, 2026 21:32
@github-actions github-actions bot locked and limited conversation to collaborators Jan 22, 2026
@metamaskbot metamaskbot added the release-7.64.0 Issue or pull request that will be included in release 7.64.0 label Jan 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.64.0 Issue or pull request that will be included in release 7.64.0 size-XL team-swaps-and-bridge Swaps and Bridge team

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.