feat: add Quick Trade button to each crypto token row#31805
Conversation
Each token row in the Explore search results (both "All" and "Crypto" tabs) now shows a circular flash-icon button that opens the existing QuickBuy sheet pre-loaded for that token. Key changes: - Add optional onQuickTrade prop to TrendingTokenRowItem, rendered as a 36 px dark circle with a flash icon (DS Icon, theme-aware bg) - Thread onQuickTrade through TokenSearchRowItem -> SearchFeedRow (tokens feed only, stocks/perps/etc. are unaffected) - ExploreSearchResults: replace empty BottomSheet with TrendingQuickBuy adapter; FullFeedList in ExploreSearchScreen wired up identically - New TrendingQuickBuy UI-layer adapter maps TrendingAsset to QuickBuyTarget and renders QuickBuy.Root, keeping TrendingView isolated from SocialLeaderboard per ADR-0020 - Analytics: add 'explore_search' to SocialLeaderboardSource and QuickBuySheetSource; fire SOCIAL_QUICK_BUY_SHEET_VIEWED on open with source, caip19, and marketCap; forward analyticsContext to QuickBuy.Root so all downstream events are attributed correctly - Tests: TrendingTokenRowItem button render/press/navigation guards; TrendingQuickBuy target mapping and event firing lifecycle; SearchFeedRow onQuickTrade forwarding and isolation - Locale: add trending.quick_trade = "Quick Buy & Sell"
|
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. |
PR template — items to address before "Ready for review"Warnings — informational, address before merging:
See docs/readme/ready-for-review.md for the full Definition of Ready for Review. |
…3380 Flag: assetsASSETS3380AbtestExploreQuickBuy (LaunchDarkly JSON) - control (0–50%): button hidden — status quo - treatment (50–100%): flash button visible on each crypto token row Changes: - New abTestConfig.ts: flag key, variant enum, variant config, and analytics mapping for ASSETS-3380 - ExploreSearchResults + FullFeedList (ExploreSearchScreen): onQuickTrade is only wired when variant.showQuickTradeButton is true; useABTest auto-fires Experiment Viewed once per session - abTestAnalyticsRegistry: register EXPLORE_QUICK_BUY mapping so that SOCIAL_QUICK_BUY_SHEET_VIEWED, AMOUNT_SELECTED, TRADE_SUBMITTED, TRADE_COMPLETED, and DISMISSED are auto-enriched with active_ab_tests - abTestConfig.test.ts: 11 tests covering flag key, control/treatment behaviour, exposure metadata, and all enriched event names
There was a problem hiding this comment.
⚠️ QuickBuyRoot change causes a regression
The fix: fix bottom sheet close commit (585d816) re-adds a BottomSheetOverlay to the shared QuickBuyRoot. That reintroduces behaviour we intentionally removed from the QuickBuy sheet.
Intended behaviour of the QuickBuy sheet (by design):
- No backdrop / no dimmed scrim behind the sheet.
- The surface below stays interactive — tapping outside the sheet should do nothing, because the user must be able to keep interacting with the content underneath.
BottomSheetOverlay does exactly the opposite of both:
- It renders a full-screen
absolute inset-0 bg-overlay-defaultview animated to full opacity → dims the background. - When
onPressis set (the normal!isSubmittingTxpath) it renders aflex-1TouchableOpacitycovering the whole screen → captures all touches over the surface below and closes the sheet, so the underlying surface is no longer interactive.
Because this lives in the shared QuickBuyRoot, it forces this modal behaviour on every host of QuickBuy.Root, not just Explore search:
TraderPositionQuickBuy(Top Traders)AssetDetailsQuickBuy(Token Details / Market Insights)TrendingQuickBuy(this PR)
Suggestion: revert the overlay change. If a specific surface genuinely needs dismiss-on-outside-press, make it an opt-in prop (e.g. withOverlay / dismissOnOutsidePress, default false) wired only for that surface, rather than changing the default behaviour of the shared root. Swipe-to-dismiss / drag handle (already supported via isInteractable) or an explicit close button can cover the "can't close it" case without a blocking scrim.
- Wire Quick Buy to CryptoTab (explore_crypto), RwasTab (explore_rwas), TrendingTokensFullView (explore_trending), and RWATokensFullView (explore_stocks) with correct per-surface analytics source values - Fix TokenRowItem to forward onQuickTrade prop to TrendingTokenRowItem - Make TrendingQuickBuy accept a configurable source prop (defaults to explore_search) and thread it through TokenListPageLayout, TrendingTokensData, and TrendingTokensList - Add explore_crypto/now/rwas/trending/stocks to SocialLeaderboardSource and QuickBuySheetSource types - Extend ABTestAnalyticsMapping with excludeWhenPropertiesMatch (array support) and add array support to injectWhenPropertiesMatch - Scope socialAiTSA612AbtestQuickBuy to exclude all explore_* sources - Scope assetsASSETS3380AbtestExploreQuickBuy to inject for all explore_* sources only
Reverts the dismiss-on-outside-press regression introduced in 585d816. The QuickBuy sheet is intentionally overlay-free: no scrim, no background dimming, and the surface below stays interactive. BottomSheetOverlay was blocking all touches on the underlying content and closing the sheet when tapping outside, which is the opposite of the intended behaviour. Also removes the now-unnecessary BottomSheetOverlay stub from QuickBuySheet.test.tsx.
Resolve conflicts: - TrendingTokenRowItem.test.tsx: keep Quick Trade tests + add new memoization test from main - ExploreSearchResults.tsx: adopt main's MMDSSectionHeader/SectionDivider section header design - CryptoTab.tsx / RwasTab.tsx: adopt main's ExploreSectionList refactor while preserving Quick Buy View wrapper and TrendingQuickBuy sheet
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit db2640e. Configure here.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: SmokeWalletPlatform: The Trending tab is the primary surface affected. The tag description explicitly states "Trending is the connecting point for all subsections—changes to Perps, Predictions, or Tokens views (headers, lists, full views) that are embedded in Trending affect this tag." The existing E2E tests in tests/smoke/trending/ (trending-feed.spec.ts, trending-search.spec.ts, trending-browser.spec.ts) all use SmokeWalletPlatform and test the exact views modified in this PR. SmokeSwap: The Quick Trade button opens a QuickBuy sheet that initiates swap/trade flows. The TrendingQuickBuy component wraps the existing QuickBuy component from SocialLeaderboard. Per the SmokeSwap tag description, swap flows should be validated. SmokeConfirmations: The Quick Buy flow involves on-chain transactions that require confirmation screens. Per the SmokeSwap tag description, "when selecting SmokeSwap, also select SmokeConfirmations." SmokePerps: The RwasTab (which is modified) contains a Perps section. Per the SmokePerps tag description, "Perps is also a section inside the Trending tab (SmokeWalletPlatform); changes to Perps views affect Trending." The RwasTab changes include the Quick Trade button integration which could affect the Perps section rendering. Per SmokePerps description, "when selecting SmokePerps, also select SmokeWalletPlatform." The analytics infrastructure change (enrichWithABTests.ts adding excludeWhenPropertiesMatch logic) is a shared utility but only affects A/B test enrichment behavior, not core transaction or account flows. The localization change (en.json) adds a single "quick_trade" string. Risk is medium because: the changes are feature additions (not modifications to core flows), they're gated behind an A/B test flag, and the Quick Buy component being reused from SocialLeaderboard is already tested. However, the integration across multiple Trending views and the analytics infrastructure change warrant validation. Performance Test Selection: |
|




Each token row in the Explore search results (both "All" and "Crypto" tabs) now shows a circular flash-icon button that opens the existing QuickBuy sheet pre-loaded for that token.
Key changes:
Description
Changelog
CHANGELOG entry: add Quick Trade button to each crypto token row on explore search
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Screen.Recording.2026-06-17.at.10.41.08.mov
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
Reuses the existing Quick Buy trade path from many Explore entry points; mistakes in asset mapping or analytics gating could mis-attribute trades or affect experiment readouts, though UI is flag-gated.
Overview
Adds an Explore Quick Buy A/B test (
assetsASSETS3380AbtestExploreQuickBuy) so the treatment arm can show a flash Quick Trade control on eligible token and stock rows across Explore (search, Crypto/RWAs tabs, trending/stocks full lists).TrendingQuickBuyis a new adapter that mapsTrendingAsset→QuickBuy.Root, firesSOCIAL_QUICK_BUY_SHEET_VIEWEDwhen a sheet opens, and passes per-surfacesourcevalues (explore_search,explore_crypto,explore_trending, etc.).onQuickTradeis threaded through list layouts andTrendingTokenRowItem(press isolated from row navigation).Analytics wiring adds Explore-specific quick-buy sources, registers the new experiment mapping, extends A/B enrichment with array-based inject gates and
excludeWhenPropertiesMatchso Social AI Quick Buy attribution does not apply on Explore surfaces. Tests cover row behavior, adapter mapping/events, search row forwarding, and AB config structure.Reviewed by Cursor Bugbot for commit f520a31. Bugbot is set up for automated code reviews on this repo. Configure here.