You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Feature: my feature nameScenario: user [verb for user action]Given [describe expected initial app state]
When user [verb for user action]
Then [describe expected outcome]
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.
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:
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.
useTrendingSearch.test.ts: Adds unit tests for the new includeStocks option — no E2E impact.
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 TokenView → AddAsset → MainNavigator
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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Screenshots/Recordings
Before
After
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
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
includeStocksoption touseTrendingSearchto control whether search results containingrwaDataare filtered out (default) or included.Updates the token import autocomplete (
SearchTokenAutocomplete) to opt into stock/RWA results viaincludeStocks: true, and extendsuseTrendingSearchtests 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.