feat: add swap page trending tokens section#26620
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 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.
…okens # Conflicts: # app/components/UI/Bridge/Views/BridgeView/__snapshots__/BridgeView.test.tsx.snap # app/components/UI/Bridge/Views/BridgeView/index.tsx
## **Description** Adds minimal SmokeTrade E2E coverage for Bridge Swap Trending Tokens zero-state behavior as a follow-up to the feature PR to keep implementation and test review separated. Scope is intentionally narrow: - Verifies zero-state trending section visibility and filter interaction flow. - Verifies row navigation behavior from trending list. - Uses existing smoke framework/page-object patterns. ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: Follow-up coverage for #26620 (SWAPS-4038) ## **Manual testing steps** ```gherkin Feature: Swap trending tokens smoke coverage Scenario: user validates bridge zero-state trending interactions Given the app is running with swap trending tokens enabled And the user is on the Swap screen in Bridge zero state When the user opens and applies trending filters Then the trending list reflects the selected filters When the user taps a trending token row Then the user is navigated to that token's asset details ``` ## **Screenshots/Recordings** ### **Before** N/A (test-only follow-up PR) ### **After** N/A (test-only follow-up PR) ## **Pre-merge author checklist** - [x] 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). - [x] I've completed the PR template to the best of my ability - [x] I've included tests if applicable - [x] 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. ## **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. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Test-only additions; primary risk is potential flakiness due to new Detox selectors, scrolling, and network mocking for trending tokens/feature flags. > > **Overview** > Adds SmokeTrade E2E coverage for **Swap Trending Tokens (Bridge zero-state)**, including a new `SwapTrendingTokensView` page object for interacting with the trending section, filters, bottom sheets, and token rows. > > Introduces a new smoke spec that enables the `swapsTrendingTokens` remote flag, mocks the `/v3/tokens/trending` proxy responses (all networks vs Base-only), verifies filter behavior and default sort text, confirms tapping a row opens token details, and asserts the trending section hides once a swap amount is entered. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 7e90d12. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
Reverts #26910 <!-- CURSOR_SUMMARY --> --- > [!NOTE] > <sup>[Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) is generating a summary for commit 73b52d4. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
Tag Selection Rationale:
The changes are feature-flagged behind Performance Test Selection: |
The committed fixture schema is out of date. To update, comment: |
|



Description
This PR implements the mobile Swap zero-state Trending Tokens experience for Bridge and hardens related Bridge rendering behavior.
Key updates:
BridgeTrendingTokensSectionto render Trending tokens only in Swap zero state.BridgeViewcontent-mode precedence so loading/error/quote/zero states render deterministically.isLoading && activeQuote) and only show skeleton when loading without an active quote.BridgeViewtests.Changelog
CHANGELOG entry: Added Trending tokens to the mobile Swap zero state with filter controls and improved Bridge quote/loading state handling.
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/SWAPS-4038
Manual testing steps
Screenshots/Recordings
Before
N/A
After
Screen.Recording.2026-03-02.at.20.03.31.mov
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Changes Bridge/Swap screen rendering precedence (loading/error/quote/zero) and scroll behavior, which could affect quote visibility and confirm UX during refreshes. Mostly UI/state-driven with good test coverage but touches a core transaction entry flow.
Overview
Adds a Swap zero-state Trending Tokens section to
BridgeView, gated behind the temporaryswapsTrendingTokensremote feature flag, with filter bottom sheets and incremental “show more” loading triggered by button or near-bottom scroll.Refactors
BridgeViewto render deterministically via acontentModestate machine: shows aQuoteDetailsCardSkeletononly when loading without an active quote, preserves quote + confirm UI while refreshing (isLoading && activeQuote), and keeps error banners/zero-state separate from quote content.Updates styles to support a single unified scroll area (inputs + dynamic content), introduces new
testIDs, and rewrites/expands tests to avoid brittle snapshots and to assert the new loading/error/quote/zero behaviors (including mocking the trending section).Written by Cursor Bugbot for commit ab8ffe2. This will update automatically on new commits. Configure here.