Skip to content

chore: remove token details v2 flag#28823

Merged
juanmigdr merged 5 commits intomainfrom
chore/remove-token-details-v2-flag
Apr 15, 2026
Merged

chore: remove token details v2 flag#28823
juanmigdr merged 5 commits intomainfrom
chore/remove-token-details-v2-flag

Conversation

@juanmigdr
Copy link
Copy Markdown
Member

@juanmigdr juanmigdr commented Apr 14, 2026

Description

The tokenDetailsV2AbTest A/B test (ASSETS-2493) has been fully rolled out — the treatment variant (Token Details V2 layout) is now live for 100% of users. This PR removes all A/B test machinery since the control branch is permanently dead code.

Changes include:

  • Deleted selectTokenDetailsLayoutTestVariant selector and its tests (featureFlagController/tokenDetailsV2/)
  • Deleted useTokenDetailsABTest hook
  • Removed the control layout branch from AssetOverviewContent (AssetDetailsActions conditional render)
  • Removed displayBuyButton, displaySwapsButton, and goToSwaps props from AssetOverviewContent — they were only used by the control branch
  • Removed onOptionsPress from TokenDetailsInlineHeader — the options button was control-only
  • Removed abTestTokenDetailsLayout param from usePerpsActions and all downstream Perps navigation (PerpsOrderRedirect, PerpsOrderView, navigation.ts)
  • Removed A/B test context from analytics events in useTokenActions, useTokenDetailsOpenedTracking, useTrackSwapPageViewed, and useSubmitBridgeTx
  • Removed tokenDetailsV2AbTest from the feature flag registry and E2E remote flag mocks
  • Generalised abTestContext type in the Bridge slice and useSwapBridgeNavigation to Record<string, string> for future tests
  • Removed now-dead handleBuyPress, handleSellPress, hasEligibleStickySwapTokens, and goToSwaps exports from useTokenActions and their corresponding tests

Changelog

CHANGELOG entry: remove token details v2 flag

Related issues

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

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

Medium Risk
Mostly deletes A/B test wiring and dead control-path UI, but touches Token Details/Perps navigation params and analytics payloads, which could affect tracking and deep navigation if any callers still pass the removed params.

Overview
Removes the tokenDetailsV2AbTest rollout machinery and hardens Token Details on the V2 layout path. This deletes the feature-flag selector/hook, strips the legacy control-branch UI (including the header options button), and simplifies Token Details rendering/tests accordingly.

It also removes propagation of the assetsASSETS2493AbtestTokenDetailsLayout param through Perps navigation (usePerpsActionsPerpsOrderRedirect/PerpsOrderView/route types) and drops related A/B test properties from swap/bridge and token-details analytics (e.g., SWAP_PAGE_VIEWED, TOKEN_DETAILS_OPENED, bridge tx submission).

Finally, bridge A/B test context typing is generalized to Record<string,string> for future experiments, while current Token Details callers now pass an empty context.

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

@juanmigdr juanmigdr requested review from a team as code owners April 14, 2026 16:49
@github-actions github-actions Bot added size-XL risk-medium Moderate testing recommended · Possible bug introduction risk labels Apr 14, 2026
Comment thread app/components/UI/TokenDetails/hooks/useTokenActions.ts
@juanmigdr juanmigdr enabled auto-merge April 14, 2026 16:55
@github-actions github-actions Bot added risk-medium Moderate testing recommended · Possible bug introduction risk and removed risk-medium Moderate testing recommended · Possible bug introduction risk labels Apr 14, 2026
@github-actions github-actions Bot added risk-medium Moderate testing recommended · Possible bug introduction risk and removed risk-medium Moderate testing recommended · Possible bug introduction risk labels Apr 14, 2026
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

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 0592523. Configure here.

Comment thread app/core/redux/slices/bridge/index.ts
@github-actions github-actions Bot added risk-medium Moderate testing recommended · Possible bug introduction risk and removed risk-medium Moderate testing recommended · Possible bug introduction risk labels Apr 15, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeConfirmations, SmokeTrade, SmokePerps, SmokeWalletPlatform, SmokeRamps
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: medium
  • AI Confidence: 85%
click to see 🤖 AI reasoning details

E2E Test Selection:
This PR removes the tokenDetailsV2AbTest A/B test infrastructure and promotes the "treatment" (V2 new layout) as the permanent layout for Token Details. Key changes:

  1. TokenDetails layout permanently changed: AssetOverviewContent now always uses TokenDetailsActions (new layout) instead of conditionally switching. TokenDetailsInlineHeader no longer has an options button. TokenDetailsStickyFooter is always shown. This affects any test that navigates to token details.

  2. SmokeConfirmations: The send-btc-token.spec.ts test was directly updated to reflect the new behavior (zero-balance tokens now show Receive button instead of Send button). This test must run to validate the change.

  3. SmokeTrade: useSwapBridgeNavigation and useTrackSwapPageViewed hooks had A/B test context removed. useSubmitBridgeTx no longer passes abTests from the old A/B test. These are core swap/bridge flow hooks that need validation.

  4. SmokePerps: PerpsOrderView, PerpsOrderRedirect, and navigation.ts types all had the assetsASSETS2493AbtestTokenDetailsLayout parameter removed. The Perps order flow from token details needs validation.

  5. SmokeWalletPlatform: Token details is accessed from the wallet home screen. The permanent layout change (always showing new TokenDetailsActions, always showing sticky footer, no options button) needs validation from the wallet perspective.

  6. SmokeRamps: AssetOverviewContent removed displayBuyButton and displaySwapsButton props, and now uses useTokenBuyability hook internally. The buy/ramp flow from token details needs validation.

Tags NOT selected:

  • SmokeAccounts: No account management changes
  • SmokeIdentity: No sync/identity changes
  • SmokeNetworkAbstractions/SmokeNetworkExpansion/SmokeMultiChainAPI: No network/chain permission changes
  • SmokeCard: No card feature changes
  • SmokePredictions: No predictions changes
  • SmokeSeedlessOnboarding: No onboarding changes
  • FlaskBuildTests: No snap changes

Per tag dependency rules: SmokeTrade requires SmokeConfirmations (already selected). SmokePerps requires SmokeWalletPlatform (already selected) and SmokeConfirmations (already selected).

Performance Test Selection:
The changes are primarily about removing an A/B test infrastructure and promoting the 'treatment' layout as permanent. While the TokenDetails UI layout changed, these are not performance-sensitive changes - they remove conditional rendering (slightly simplifying the component tree) and clean up analytics tracking. No new heavy computations, list rendering changes, or data loading patterns were introduced. The changes to useSubmitBridgeTx, useSwapBridgeNavigation, and useTrackSwapPageViewed are minor analytics cleanup. No performance tests are warranted.

View GitHub Actions results

@github-actions
Copy link
Copy Markdown
Contributor

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

@sonarqubecloud
Copy link
Copy Markdown

@juanmigdr
Copy link
Copy Markdown
Member Author

@MetaMask/metamask-assets (11 files)
  • app/components/UI/TokenDetails/Views/TokenDetails.test.tsx
  • app/components/UI/TokenDetails/Views/TokenDetails.tsx
  • app/components/UI/TokenDetails/components/AssetOverviewContent.test.tsx
  • app/components/UI/TokenDetails/components/AssetOverviewContent.tsx
  • app/components/UI/TokenDetails/components/TokenDetailsInlineHeader.test.tsx
  • app/components/UI/TokenDetails/components/TokenDetailsInlineHeader.tsx
  • app/components/UI/TokenDetails/hooks/usePerpsActions.test.ts
  • app/components/UI/TokenDetails/hooks/usePerpsActions.ts
  • app/components/UI/TokenDetails/hooks/useTokenActions.test.ts
  • app/components/UI/TokenDetails/hooks/useTokenActions.ts
  • app/components/UI/TokenDetails/hooks/useTokenDetailsABTest.ts
@MetaMask/perps (4 files)
  • app/components/UI/Perps/Views/PerpsOrderRedirect.test.tsx
  • app/components/UI/Perps/Views/PerpsOrderRedirect.tsx
  • app/components/UI/Perps/Views/PerpsOrderView/PerpsOrderView.tsx
  • app/components/UI/Perps/types/navigation.ts
@MetaMask/swaps-engineers (2 files)
  • app/components/UI/Bridge/hooks/useSwapBridgeNavigation/index.ts
  • app/components/UI/Bridge/hooks/useTrackSwapPageViewed/index.ts
Unowned (6 files)
  • app/core/redux/slices/bridge/index.ts
  • app/selectors/featureFlagController/tokenDetailsV2/index.test.ts
  • app/selectors/featureFlagController/tokenDetailsV2/index.ts
  • app/util/bridge/hooks/useSubmitBridgeTx.ts
  • tests/feature-flags/feature-flag-registry.ts
  • tests/smoke/confirmations/send/send-btc-token.spec.ts

Copy link
Copy Markdown
Contributor

@bergarces bergarces left a comment

Choose a reason for hiding this comment

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

🔥 🔥 🔥 🔥 🔥

@juanmigdr juanmigdr added this pull request to the merge queue Apr 15, 2026
Merged via the queue into main with commit 07d219d Apr 15, 2026
180 of 185 checks passed
@juanmigdr juanmigdr deleted the chore/remove-token-details-v2-flag branch April 15, 2026 12:43
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 15, 2026
@metamaskbot metamaskbot added the release-7.74.0 Issue or pull request that will be included in release 7.74.0 label Apr 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.74.0 Issue or pull request that will be included in release 7.74.0 risk-medium Moderate testing recommended · Possible bug introduction risk size-XL team-assets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants