Skip to content

chore: AB test Buy action (QuickBuy vs Swaps) on Top Traders token screen + feed#33508

Open
zone-live wants to merge 11 commits into
mainfrom
TSA-901-abtest-buy-btn-top-traders
Open

chore: AB test Buy action (QuickBuy vs Swaps) on Top Traders token screen + feed#33508
zone-live wants to merge 11 commits into
mainfrom
TSA-901-abtest-buy-btn-top-traders

Conversation

@zone-live

@zone-live zone-live commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Description

Introduces the socialAiTSA901AbtestTopTradersBuyAction A/B test for the Top Traders spot Buy action, to measure conversion of opening the main Swaps view vs. the existing QuickBuy sheet.

  • control – Buy opens the existing QuickBuy sheet (current behavior).
  • treatment – Buy opens the main Swaps view directly, with the trader's token pre-filled as the destination.

The experiment covers two surfaces:

  • Trader position (token) screen – via the new TraderPositionBuyCta.
  • Trader feed – via the new FeedSpotBuyAction.

Perps positions are unaffected (they use a separate Trade button that navigates to Perps and never resolves the experiment).

Simulator.Screen.Recording.-.iPhone.17.Pro.-.2026-07-20.at.13.47.58.mov

Changelog

CHANGELOG entry: null

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/TSA-901

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
Changes the primary buy path for social trading surfaces and routes users into Swaps with pre-filled tokens; mitigated by control parity, QuickBuy fallback, and focus/tab cancellation, but still affects conversion-critical trading UX in production.

Overview
Adds socialAiTSA901AbtestTopTradersBuyAction: control keeps opening QuickBuy; treatment opens the main Swaps flow with the tapped token as the buy destination (follow_trader attribution).

Trader position screen — Buy is handled by TraderPositionBuyCta (replacing inline QuickBuy). Treatment resolves token metadata via useQuickBuySetup, navigates with FollowTradingTokenScreen, waits on slow metadata, falls back to QuickBuy when unresolved, and cancels pending navigation if the screen loses focus. Perps still use Trade only (no experiment exposure).

Trader feed — Spot Trade delegates to FeedSpotBuyAction (ref), mounted only when the feed has at least one spot row. Same A/B behavior with a keyed SwapDestResolver per tap (avoids stale metadata); cancels if the route blurs or the feed tab is inactive.

Also wires swap analytics locations, registers the flag and A/B analytics mapping, and bumps @metamask/bridge-controller to ^77.6.0 for the new event sources.

Reviewed by Cursor Bugbot for commit 99c6a25. Bugbot is set up for automated code reviews on this repo. Configure here.

@zone-live
zone-live requested review from a team as code owners July 20, 2026 12:46
@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.

@metamask-ci metamask-ci Bot added the team-social-ai Social & AI team label Jul 20, 2026
@metamask-ci

metamask-ci Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

PR template — items to address before "Ready for review"

Warnings — informational, address before merging:

  • Manual testing steps still contain template content (the Gherkin example title or a [...] placeholder). Replace with real steps, or write N/A — <reason>.
  • Screenshots/Recordings section is empty. Add an image/video for user-facing changes, logs/console output for non-user-facing changes, or write N/A if no evidence is applicable.
  • Pre-merge author checklist has unchecked items (e.g. "I've followed MetaMask Contributor Docs and MetaMask Mobile Coding Standards."). Every box must be consciously checked — see docs/readme/ready-for-review.md.

See docs/readme/ready-for-review.md for the full Definition of Ready for Review.

Comment thread app/components/Views/SocialLeaderboard/FeedView/components/FeedSpotBuyAction.tsx Outdated
@github-actions github-actions Bot added the risk:medium AI analysis: medium risk label Jul 20, 2026
@github-actions

This comment was marked as off-topic.

@github-actions github-actions Bot added size-XL and removed size-L labels Jul 20, 2026

@cursor cursor Bot left a comment

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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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 9e3b241. Configure here.

chrisleewilcox
chrisleewilcox previously approved these changes Jul 20, 2026
@socket-security

socket-security Bot commented Jul 20, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatednpm/​@​metamask/​bridge-controller@​77.5.0 ⏵ 77.6.099 +110079 +1100100

View full report

@github-actions github-actions Bot added risk:high AI analysis: high risk and removed risk:medium AI analysis: medium risk labels Jul 20, 2026
@zone-live
zone-live requested a review from chrisleewilcox July 20, 2026 18:16

@Cal-L Cal-L left a comment

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.

Platform LGTM

@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeAccounts, SmokeConfirmations, SmokeNetworkAbstractions, SmokeNetworkExpansion, SmokeSwap, SmokeStake, SmokeWalletPlatform, SmokeMoney, SmokePerps, SmokeMultiChainAPI, SmokePredictions, SmokeSeedlessOnboarding, SmokeBrowser, SmokeSnaps
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: high
  • AI Confidence: 100%
click to see 🤖 AI reasoning details

E2E Test Selection:
Hard rule (controller-version-update): @MetaMask controller package version updated in package.json: @metamask/bridge-controller. Running all tests.

Performance Test Selection:
No performance-sensitive changes detected. The PR refactors the Social Leaderboard buy flow (component extraction/reorganization), adds A/B test configuration, and bumps the bridge-controller minor version. None of these changes affect app launch, login, onboarding, asset loading, account list rendering, or the measured performance scenarios. The swap navigation changes are additive (new enum values) and don't alter the rendering performance of existing flows. No performance spec files were changed.

View GitHub Actions results

@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:high AI analysis: high risk size-XL team-social-ai Social & AI team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants