Skip to content

feat(ramp): remove unified buy rollout flags and default buy to UB2#29630

Draft
amitabh94 wants to merge 1 commit intomainfrom
feat/ramps-unified-buy-flag-purge
Draft

feat(ramp): remove unified buy rollout flags and default buy to UB2#29630
amitabh94 wants to merge 1 commit intomainfrom
feat/ramps-unified-buy-flag-purge

Conversation

@amitabh94
Copy link
Copy Markdown
Contributor

Description

Unified Buy rollout is complete: this change removes the rampsUnifiedBuyV1 / rampsUnifiedBuyV2 feature-flag plumbing and related hooks (useRampsUnifiedV1Enabled, useRampsUnifiedV2Enabled, isRampsUnifiedV2Enabled). On-ramp buy always routes through the Unified Buy v2 token/amount stack; sell behavior is unchanged. Legacy Routes.RAMP.BUY and the unused useRampTokens hook are removed. Analytics and order handling use a small shared helper normalizeRampsOrderTypeForFiatOrder where needed. Tests, mocks, fixtures, and docs are updated accordingly.

Changelog

CHANGELOG entry: Removed unified buy rollout feature flags; on-ramp buy always uses the Unified Buy v2 flow.

Related issues

Fixes: N/A (internal rollout cleanup).

Manual testing steps

Feature: Ramps buy after unified-buy flag purge

  Scenario: User starts buy from an entry point
    Given the user is on a supported network with a funded or empty wallet

    When the user opens Buy from Accounts menu, token details, homepage tokens, or card add-funds
    Then the app navigates to the Unified Buy v2 flow (token selection / amount), not the legacy single-screen buy route

  Scenario: User starts sell
    Given the user can access Ramps sell

    When the user opens Sell from the same surfaces as before
    Then sell navigation and provider flow behave as on main (no regression)

Screenshots/Recordings

Before

N/A — behavior matches the previously flag-enabled UB2 path.

After

N/A — no visual redesign; routing and flag removal only.

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.

Co-authored-by: Cursor <cursoragent@cursor.com>
@amitabh94 amitabh94 self-assigned this May 1, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 1, 2026

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.

@metamaskbotv2 metamaskbotv2 Bot added the team-money-movement issues related to Money Movement features label May 1, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 1, 2026

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeMoney, SmokeWalletPlatform, SmokeConfirmations, SmokeSwap
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: high
  • AI Confidence: 90%
click to see 🤖 AI reasoning details

E2E Test Selection:
This PR removes the Ramps Unified Buy V1/V2 feature flag gating and makes the Unified Buy V2 flow the permanent default. Key changes:

  1. SmokeMoney (primary): All ramps buy/sell flows are directly affected. The PR removes useRampsUnifiedV1Enabled, useRampsUnifiedV2Enabled, isRampsUnifiedV2Enabled, useRampTokens, and related selectors. Navigation routing in useRampNavigation.ts is simplified to always use the V2 path. Deep link handlers (handleRampUrl.ts, handleCreateAccountUrl.ts) updated. FundActionMenu, AddFundsBottomSheet, Settings (ramp settings), TokenSelection, Checkout all simplified. E2E ramps smoke tests themselves are updated (deeplink-to-buy-flow.spec.ts, deeplink-to-sell-flow.spec.ts, onramp-unified-buy.spec.ts). The MainNavigator.js removes the Routes.RAMP.BUY screen registration entirely.

  2. SmokeWalletPlatform: AccountsMenu.tsx buy button now always visible (was gated on V1 flag). BalanceEmptyState.tsx buy button always routes to V2. FundActionMenu.tsx buy button always visible. useRampsButtonClickedEvent.ts in Homepage Tokens section simplified. These are core wallet platform surfaces.

  3. SmokeConfirmations: Per tag description, ramps/buy flows that execute transactions require confirmations. When selecting SmokeMoney, also select SmokeConfirmations.

  4. SmokeSwap: Per tag description, SmokeMoney flows that involve swaps (Card Add Funds via Swap path) require SmokeSwap. Also, the AddFundsBottomSheet changes affect Card flows that can route through swap.

The risk is HIGH because:

  • Feature flags are completely removed (no rollback path via flags)
  • Core navigation routing changed (Routes.RAMP.BUY screen removed from MainNavigator)
  • Multiple UI components changed to always show buy buttons
  • RampsController initialization simplified (always starts, no V2 flag check)
  • E2E test infrastructure updated (FixtureBuilder, feature-flags-mocks, ramps-mocks)
  • The babel.config.tests.js changes affect test build configuration

Performance Test Selection:
The changes are focused on removing feature flag gating and simplifying routing logic for the Ramps buy flow. While there are UI component changes, they are simplifications (removing conditional branches) rather than additions of new rendering complexity. The RampsController initialization is simplified (always starts, no flag check), which could marginally improve startup but not in a way that warrants performance testing. No changes to account list rendering, login flows, asset loading, or other performance-sensitive areas. No changes to tests/performance/ directory.

View GitHub Actions results

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 1, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
70.6% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

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

Labels

size-XL team-money-movement issues related to Money Movement features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant