Skip to content

feat: add pagination on Explore token search#30434

Merged
juanmigdr merged 2 commits into
mainfrom
feat/pagination-on-toen-search
May 20, 2026
Merged

feat: add pagination on Explore token search#30434
juanmigdr merged 2 commits into
mainfrom
feat/pagination-on-toen-search

Conversation

@juanmigdr

@juanmigdr juanmigdr commented May 20, 2026

Copy link
Copy Markdown
Member

Description

Added pagination on Explore token search plus the "View X more" support

Changelog

CHANGELOG entry: add pagination on Explore token search

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/ASSETS-3239

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

Screen.Recording.2026-05-20.at.13.46.27.mov

After

Screen.Recording.2026-05-20.at.13.44.48.mov

Pre-merge author checklist

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 to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

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

Medium Risk
Changes token search pagination and ordering in the Explore search flow by threading API totalCount through multiple hooks and UI labels; mistakes could lead to incorrect counts, ordering, or pagination behavior. Impact is limited to Explore/trending token search surfaces and is covered by added unit tests.

Overview
Adds end-to-end support for paginated Explore token search by propagating the search API’s totalCount through useSearchRequestuseTrendingSearchuseTokensFeeduseExploreSearchV2 sections.

Updates Explore search section headers to show "View X more" for tokens using totalCount (new getViewMoreLabel logic + tests), and exposes tokens pagination controls (fetchMore/hasMore/isFetchingMore) in V2 search sections.

Adjusts useTokensFeed sorting for active queries to only sort the first page by market cap and append subsequent pages without re-sorting, preserving pagination order; adds/updates tests and mocks across affected components.

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

@juanmigdr juanmigdr requested a review from a team as a code owner May 20, 2026 11:26
@juanmigdr juanmigdr enabled auto-merge May 20, 2026 11:50
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeWalletPlatform
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 90%
click to see 🤖 AI reasoning details

E2E Test Selection:
All 15 changed files are scoped to the Trending feature area, specifically the search/explore functionality within the Trending tab. The changes add totalCount support from the search API to improve the accuracy of "View X more" labels in token search results, and improve pagination boundary tracking to preserve sort order across pages.

Key changes:

  1. useSearchRequest.ts - Added totalCount state from API response
  2. useTrendingSearch.ts - Exposed totalCount from useSearchRequest
  3. useTokensFeed.ts - Added totalCount to result interface + pagination boundary tracking with useRef/useEffect
  4. useExploreSearchV2.ts - Passes fetchMore, isFetchingMore, hasMore, totalCount to tokens section
  5. viewMoreLabel.ts - Updated logic to use totalCount for tokens to show accurate "View X more" count
  6. ExploreSearchResultsV2.tsx - Passes totalCount to getViewMoreLabel
  7. All test files - Updated mocks to include totalCount: undefined

SmokeWalletPlatform is the correct tag as it covers the Trending discovery tab including search functionality, browsing content feeds (Tokens section), and browser navigation integration. No other feature areas (confirmations, accounts, networks, swaps, etc.) are affected by these changes. The changes are purely additive (new optional field) with no breaking changes to existing interfaces.

Performance Test Selection:
The changes add a totalCount state variable and ref-based pagination boundary tracking to the Trending token search flow. These are minor additions that don't significantly impact rendering performance, list rendering, or critical user flows. The changes are additive (new optional field) and the ref/effect pattern used is lightweight. No performance-sensitive paths like account list rendering, app startup, login, or asset loading are affected.

View GitHub Actions results

@sonarqubecloud

Copy link
Copy Markdown

@juanmigdr juanmigdr added this pull request to the merge queue May 20, 2026
Merged via the queue into main with commit 3dea66a May 20, 2026
183 of 192 checks passed
@juanmigdr juanmigdr deleted the feat/pagination-on-toen-search branch May 20, 2026 12:54
@github-actions github-actions Bot locked and limited conversation to collaborators May 20, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.79.0 Issue or pull request that will be included in release 7.79.0 label May 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.79.0 Issue or pull request that will be included in release 7.79.0 size-M team-assets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants