Skip to content

fix: support stocks in token import flow cp-7.74.0#29159

Merged
juanmigdr merged 1 commit into
mainfrom
fix/show-stocks-on-token-import-flow
Apr 22, 2026
Merged

fix: support stocks in token import flow cp-7.74.0#29159
juanmigdr merged 1 commit into
mainfrom
fix/show-stocks-on-token-import-flow

Conversation

@juanmigdr
Copy link
Copy Markdown
Member

@juanmigdr juanmigdr commented Apr 22, 2026

Description

Adds an includeStocks option to useTrendingSearch that controls whether real-world asset (RWA) search results are included. When false (default), items with rwaData are filtered out — preserving existing behavior. When true, stock/RWA assets are included in results. The SearchTokenAutocomplete component opts in with includeStocks: true so users can find RWA tokens when importing assets.

Changelog

CHANGELOG entry: support stocks in token import flow

Related issues

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

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

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
Medium risk because it changes which assets can appear in the token import search results (RWA/stocks), potentially affecting user-facing selection and downstream import behavior, though default behavior remains unchanged.

Overview
Adds an includeStocks option to useTrendingSearch to control whether search results containing rwaData are filtered out (default) or included.

Updates the token import autocomplete (SearchTokenAutocomplete) to opt into stock/RWA results via includeStocks: true, and extends useTrendingSearch tests to cover both default filtering and opt-in inclusion.

Reviewed by Cursor Bugbot for commit 0c84428. 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 April 22, 2026 08: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: 88%
click to see 🤖 AI reasoning details

E2E Test Selection:
The PR makes three focused changes:

  1. useTrendingSearch.ts: Adds a new includeStocks boolean option (default: false) that controls whether items with rwaData (real-world assets/stocks) are included in search results. Previously these were always filtered out.

  2. useTrendingSearch.test.ts: Adds unit tests for the new includeStocks option — no E2E impact.

  3. SearchTokenAutocomplete.tsx: Passes includeStocks: true to useTrendingSearch, enabling RWA/stock tokens to appear in the AddAsset token search autocomplete.

Impact analysis:

  • useTrendingSearch is used in TrendingTokensFullView (Trending tab) and SearchTokenAutocomplete (AddAsset flow)
  • The AddAsset flow is part of the wallet's token management
  • SearchTokenAutocomplete is used in TokenViewAddAssetMainNavigator
  • SmokeWalletPlatform covers Trending search functionality and wallet platform features including token management

Why only SmokeWalletPlatform:

  • The change is a small additive feature (new filter option) with backward-compatible defaults
  • No controller changes, no navigation changes, no security-critical changes
  • The Trending search hook is directly tested by SmokeWalletPlatform
  • No confirmation flows, no account management, no network changes involved
  • The AddAsset/token search is part of the wallet platform feature set

No performance tests needed: The change adds a simple boolean condition to an existing filter — negligible performance impact.

Performance Test Selection:
The change adds a simple boolean flag to an existing filter condition in useTrendingSearch. This has negligible performance impact — it's a single conditional check in a filter operation. No performance tests are warranted.

View GitHub Actions results

@github-actions
Copy link
Copy Markdown
Contributor

AI PR Analysis

Merge safe: true | 🟢 Risk: low

Merge decision: The changes are purely additive, introducing an optional 'includeStocks' parameter to the useTrendingSearch hook with the default behavior unchanged (filtering out rwaData items), and enabling it only in SearchTokenAutocomplete. Existing functionality remains intact, and new tests cover the added behavior.

  • Additive change to hook with unchanged defaults prevents breaking existing trending searches that exclude stocks.
  • New stock inclusion only in SearchTokenAutocomplete, affecting AddAsset flow but covered by existing component tests.
  • Comprehensive new tests for hook ensure filtering logic is verified.
  • Limited importers (3-4 UI files) mean small blast radius.

View run

@github-actions github-actions Bot added the risk:low AI analysis: low risk label Apr 22, 2026
@sonarqubecloud
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown
Contributor

E2E Fixture Validation — Schema is up to date
12 value mismatches detected (expected — fixture represents an existing user).
View details

@juanmigdr juanmigdr changed the title fix: support stocks in token import flow fix: support stocks in token import flow cp-7.74.0 Apr 22, 2026
@juanmigdr juanmigdr enabled auto-merge April 22, 2026 09:34
@juanmigdr juanmigdr added this pull request to the merge queue Apr 22, 2026
Merged via the queue into main with commit 207162c Apr 22, 2026
125 checks passed
@juanmigdr juanmigdr deleted the fix/show-stocks-on-token-import-flow branch April 22, 2026 09:36
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 22, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.75.0 Issue or pull request that will be included in release 7.75.0 label Apr 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.75.0 Issue or pull request that will be included in release 7.75.0 risk:low AI analysis: low risk size-S team-assets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants