Skip to content

fix: show new msg when token not found on search#24569

Merged
sahar-fehri merged 3 commits intomainfrom
fix/display-custom-msg-when-search-token-not-found
Jan 16, 2026
Merged

fix: show new msg when token not found on search#24569
sahar-fehri merged 3 commits intomainfrom
fix/display-custom-msg-when-search-token-not-found

Conversation

@sahar-fehri
Copy link
Copy Markdown
Contributor

@sahar-fehri sahar-fehri commented Jan 15, 2026

Description

Show a custom msg when user searches for a token that is not found

Changelog

CHANGELOG entry: show custom error msg page when user searches for token not found on trending page

Related issues

Fixes: #24566

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

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

Adds a dedicated empty search state for Trending Tokens and wires it into the full view with tests and i18n.

  • Introduces EmptySearchResultState (design-system layout) with new i18n strings: trending.empty_search_result_state.{title,description}
  • Updates TrendingTokensFullView to render EmptySearchResultState when searchQuery.trim().length > 0 and no results; otherwise falls back to EmptyErrorTrendingState; loading still shows skeletons
  • Extends tests: new specs for EmptySearchResultState; updates TrendingTokensFullView tests to cover empty-without-search vs empty-with-search paths

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

@github-actions
Copy link
Copy Markdown
Contributor

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.

@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

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

The changes are isolated to the TrendingTokens feature, which is a feature-flagged functionality. The modifications include:

  1. Adding a new EmptySearchResultState component to display when search returns no results
  2. Updating TrendingTokensFullView to conditionally show the new empty state vs error state based on whether there's a search query
  3. Adding localization strings for the new component
  4. Adding unit tests for the new component

Key observations:

  • No E2E tests exist for TrendingTokens/TrendingView features in the codebase (grep search returned no matches)
  • The changes are purely UI/UX improvements - better handling of empty search results
  • The feature is behind a feature flag (selectAssetsTrendingTokensEnabled)
  • Changes don't touch any core wallet functionality, confirmations, accounts, networks, or other critical paths
  • Unit tests are provided for the new component
  • The changes are self-contained and don't affect other parts of the application

Since there are no E2E tests for this feature and the changes are low-risk UI improvements with proper unit test coverage, no E2E test tags need to be run.

View GitHub Actions results

<EmptySearchResultState />
) : (
<EmptyErrorTrendingState onRetry={handleRefresh} />
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Race condition shows wrong empty state during search debounce

Low Severity

The condition searchQuery.trim().length > 0 checks the component's immediate state, but searchResults comes from useTrendingSearch which uses an internal 200ms debounced query. During the debounce period, searchQuery can be non-empty while searchResults still reflects the previous (empty) trending results. If trending returns empty results, users will briefly see "No tokens found" when they start typing, before the actual search executes - implying a search was performed when it hasn't.

Fix in Cursor Fix in Web

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think this comment applies. If searchQuery is still loading, isLoading will prevent any of this from rendering.

@sonarqubecloud
Copy link
Copy Markdown

@sahar-fehri sahar-fehri enabled auto-merge January 16, 2026 12:38
@sahar-fehri sahar-fehri added this pull request to the merge queue Jan 16, 2026
Merged via the queue into main with commit 0314729 Jan 16, 2026
59 checks passed
@sahar-fehri sahar-fehri deleted the fix/display-custom-msg-when-search-token-not-found branch January 16, 2026 13:12
@github-actions github-actions bot locked and limited conversation to collaborators Jan 16, 2026
@metamaskbot metamaskbot added the release-7.63.0 Issue or pull request that will be included in release 7.63.0 label Jan 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Trending token is not available when searching for a token that doesn't exist in Trending tokens Explore

3 participants