Skip to content

Conversation

@juanmigdr
Copy link
Member

@juanmigdr juanmigdr commented Nov 12, 2025

Description

As part of developing the "Trending" feature we needed to add a global search that would allow searching amongst trending tokens, perps, trending predictions...

I have developed a MODULAR search hook and global search that allows searching across all existing sections and allows for easy integration of new sections.

If a new section is added, the user will have to only modify the configuration in exploreSearchConfig like this:
image

and add the necessary hook inside useExplorerSearch:
image

Everything else is handled automatically which makes it easy for developers to add new configurations

Changelog

CHANGELOG entry: added new trending search functionality

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/ASSETS-1528 & https://consensyssoftware.atlassian.net/browse/ASSETS-1527

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

After

Screen.Recording.2025-11-12.at.14.18.22.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

Introduces an Explore Search flow with a modular search hook, UI components, navigation, i18n, and tests, enabling search across tokens, perps, and predictions from the Trending tab.

  • Trending / Explore Search:
    • UI:
      • Add ExploreSearchBar and ExploreSearchScreen with ExploreSearchResults list (headers, items, skeletons).
      • Integrate search entry in TrendingView (button + navigation), wrap with PerpsStreamProvider.
    • Hook & Config:
      • Add generic useExploreSearch (200ms debounce, top-3 on empty, per-section filtering).
      • Define configurable sections in exploreSearchConfig for tokens, perps, predictions with item renderers and key extractors.
    • Navigation:
      • Add route Routes.EXPLORE_SEARCH; register in TrendingView stack; update imports in MainNavigator.
    • i18n:
      • Extend trending strings: search_placeholder, perps, predictions, no_results.
    • Tests:
      • Add tests for ExploreSearchBar, ExploreSearchResults, useExploreSearch, and update TrendingView tests for search button and navigation.

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

@juanmigdr
Copy link
Member Author

🔴 The only thing I believe should be improved is the structure of the files. In an upcoming PR we will refactor this for the whole trending feature to centralize everything as per team decision

@juanmigdr juanmigdr marked this pull request as ready for review November 12, 2025 14:32
@juanmigdr juanmigdr enabled auto-merge November 12, 2025 14:40
@sonarqubecloud
Copy link

@juanmigdr juanmigdr added this pull request to the merge queue Nov 12, 2025
Merged via the queue into main with commit 7eec9ed Nov 12, 2025
87 of 88 checks passed
@juanmigdr juanmigdr deleted the feat/trending-search branch November 12, 2025 15:22
@github-actions github-actions bot locked and limited conversation to collaborators Nov 12, 2025
@metamaskbot metamaskbot added the release-7.60.0 Issue or pull request that will be included in release 7.60.0 label Nov 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.60.0 Issue or pull request that will be included in release 7.60.0 size-XL team-assets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants