Skip to content

feat(ramps): add AmountInput screen for Unified Buy V2#24814

Merged
AxelGes merged 36 commits intomainfrom
feat/ramps-unified-buy-v2-amount-input
Jan 23, 2026
Merged

feat(ramps): add AmountInput screen for Unified Buy V2#24814
AxelGes merged 36 commits intomainfrom
feat/ramps-unified-buy-v2-amount-input

Conversation

@AxelGes
Copy link
Copy Markdown
Contributor

@AxelGes AxelGes commented Jan 16, 2026

Description

This PR introduces the Amount Input screen as part of the Ramps Unified Buy V2 feature.

What changed:

  • Added AMOUNT_INPUT route constant to Routes.ts
  • Created new AmountInput component with:
    • Custom navbar showing token avatar, network badge, and "Buy [TICKER]" / "on [Network]" labels with skeleton loading state
    • Numeric keypad for amount entry
    • QuickAmounts component with preset amount buttons ($50, $100, $200, $400) - shown when no amount entered
    • PaymentMethodPill component showing selected payment method
    • "Powered by [Provider]" text always visible above quick amounts/continue button
    • "Continue" button that appears when an amount is entered (replaces quick amounts)
    • Currency formatting using formatCurrency utility
  • Created getRampsAmountInputNavbarOptions in Navbar for custom header
  • Registered the new screen in Ramp routes
  • Added V2 routing logic in useRampNavigation hook - when V2 is enabled and assetId is provided, navigation goes to AmountInput instead of the legacy flow
  • Updated TokenSelection to use centralized goToBuy navigation with conditional modal dismissal:
    • V1 flow: closes the TokenSelection modal before navigating to Deposit/Aggregator (preserves original behavior)
    • V2 flow: navigates within the same stack without closing modal
  • Added translation strings for navbar labels, payment method pill, continue button, and powered by text

Why:

When rampsUnifiedBuyV2 feature flag is enabled, users selecting a token in the token list will now navigate to this new Amount Input screen. This sets up the core UI for the V2 buy flow.

Changelog

CHANGELOG entry: null

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/TRAM-3037

Manual testing steps

Feature: Ramps Unified Buy V2 Amount Input Screen

  Scenario: user navigates to Amount Input when V2 is enabled
    Given the rampsUnifiedBuyV2 feature flag is enabled
    And the user is on the Token Selection screen
    When user selects a token
    Then user navigates to the Amount Input screen
    And the navbar shows the token avatar with network badge
    And the navbar shows "Buy [TICKER]" and "on [Network]"
    And "Powered by Transak" text is displayed
    And quick amount buttons ($50, $100, $200, $400) are displayed
    And the payment method pill shows "Debit card"
    And the keypad is displayed

  Scenario: user enters amount using keypad
    Given user is on the Amount Input screen
    When user presses keypad digits
    Then the amount display updates accordingly
    And quick amounts are replaced by Continue button
    And "Powered by Transak" text remains visible

  Scenario: user selects quick amount
    Given user is on the Amount Input screen
    When user presses the $100 quick amount button
    Then the amount display shows $100
    And quick amounts are replaced by Continue button

  Scenario: user follows legacy flow when V2 is disabled
    Given the rampsUnifiedBuyV2 feature flag is disabled
    And the user is on the Token Selection screen
    When user selects a token
    Then the TokenSelection modal closes
    And user navigates to the Deposit or Aggregator flow (legacy behavior)

Screenshots/Recordings

Before

Token selection → modal closes → Deposit/Aggregator

After

Token selection → Amount Input screen (when V2 enabled) with:

  • Custom navbar with token/network info
  • "Powered by [Provider]" text
  • Quick amount preset buttons (no amount) OR Continue button (with amount)
  • Payment method pill
  • Numeric keypad
image image
Simulator.Screen.Recording.-.iPhone.16.Pro.-.2026-01-19.at.15.13.06.mov

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

Introduces the new Unified Buy V2 amount entry flow and wires navigation to it.

  • Adds BuildQuote (Amount Input) screen with keypad-driven amount, QuickAmounts, PaymentMethodPill, and currency formatting; registered via Routes.RAMP.AMOUNT_INPUT
  • New navbar getRampsBuildQuoteNavbarOptions showing token avatar + network badge with skeleton loading and labels (Buy [TICKER] / on [Network])
  • Updates useRampNavigation to route to BuildQuote when V2 is enabled and an assetId is provided; preserves V1 behavior and error/unsupported fallbacks
  • Adjusts TokenSelection to conditionally close modal (V1) or stay in-stack (V2); updates tests accordingly
  • Centralizes formatCurrency in app/components/UI/Ramp/utils/formatCurrency and re-exports for Deposit utils; adds new i18n strings
  • Adds RampsService:getPaymentMethods to ramps controller messenger; extensive unit tests and snapshots for new components

Written by Cursor Bugbot for commit 0dcc604. This will update automatically on new commits. Configure here.

- Add AMOUNT_INPUT route constant to Routes.ts
- Create AmountInput boilerplate screen component
- Register AmountInput screen in Ramp routes
- Add V2 routing logic in useRampNavigation hook
- Update TokenSelection to use centralized goToBuy navigation
- Add comprehensive tests for V2 routing behavior
@AxelGes AxelGes requested a review from a team as a code owner January 16, 2026 15:34
@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.

@metamaskbot metamaskbot added the team-money-movement issues related to Money Movement features label Jan 16, 2026
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

- Add conditional goBack for V1 flow to close modal before navigation
- V2 flow navigates within same stack, no modal close needed
- Add useRampsUnifiedV2Enabled hook and tests for both flows
- Move ERROR and UNSUPPORTED routing decision checks before V2 routing
- Ensures ineligible/unsupported users see error modals, not AmountInput
- Add tests for error states taking precedence over V2 routing
@AxelGes
Copy link
Copy Markdown
Contributor Author

AxelGes commented Jan 18, 2026

bugbot run

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

…oading

- Add keypad input with currency formatting
- Create custom navbar with token avatar, network badge, and labels
- Use translations for 'Buy {ticker}' and 'on {networkName}'
- Add skeleton loading state when token data is loading
- Always set navigation options immediately to prevent header flash
- Update tests for new skeleton loading behavior
@github-actions github-actions bot added size-L and removed size-M labels Jan 19, 2026
- Create PaymentMethodPill component with card icon, label, and dropdown arrow
- Replace token conversion placeholder with PaymentMethodPill
- Add translation for 'Debit card'
- Match Figma design specs for spacing and sizing
- Add tests for PaymentMethodPill component
- Create QuickAmounts component with preset amount buttons (, , , )
- Use Button from design-system-react-native with Secondary variant and Lg size
- Buttons align perfectly with keypad using flex: 1 and 12px gap (spacing/3)
- Add tests for QuickAmounts component and AmountInput integration
@github-actions github-actions bot removed the size-L label Jan 19, 2026
cursor[bot]

This comment was marked as outdated.

AxelGes and others added 2 commits January 21, 2026 21:17
- Rename AmountInput folder and files to BuildQuote
- Update createAmountInputNavDetails to createBuildQuoteNavDetails
- Rename getRampsAmountInputNavbarOptions to getRampsBuildQuoteNavbarOptions
- Update all imports and references
- Update testIDs from amount-input-* to build-quote-*
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.21053% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.89%. Comparing base (129cc7c) to head (b95c6f7).
⚠️ Report is 14 commits behind head on main.

Files with missing lines Patch % Lines
app/components/UI/Navbar/index.js 0.00% 5 Missing ⚠️
...nents/UI/Ramp/components/BuildQuote/BuildQuote.tsx 84.37% 0 Missing and 5 partials ⚠️
app/components/UI/Ramp/utils/formatCurrency.ts 71.42% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main   #24814    +/-   ##
========================================
  Coverage   79.88%   79.89%            
========================================
  Files        4231     4239     +8     
  Lines      108283   108568   +285     
  Branches    22674    22728    +54     
========================================
+ Hits        86503    86741   +238     
- Misses      15722    15754    +32     
- Partials     6058     6073    +15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@amitabh94
Copy link
Copy Markdown
Contributor

Can we please add a video for this ?

AxelGes and others added 3 commits January 22, 2026 14:40
The BuildQuote component was using useRampTokens() which pulls from the
V1 endpoint. Now uses tokens from useRampsController() which uses the V2
RampsController API.
georgeweiler
georgeweiler previously approved these changes Jan 22, 2026
@georgeweiler
Copy link
Copy Markdown
Contributor

LGTM as a check point. Follow up PRs will be needed to implement the selector navigation and move the selectedToken to the controller.

cursor[bot]

This comment was marked as outdated.

@georgeweiler georgeweiler force-pushed the feat/ramps-unified-buy-v2-amount-input branch from 3805b6c to 074de30 Compare January 23, 2026 05:47
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeRamps
  • Risk Level: medium
  • AI Confidence: 85%
click to see 🤖 AI reasoning details

This PR introduces a new Ramps Unified V2 flow with the following changes:

  1. New BuildQuote Component: A new screen for entering buy amounts with keypad, quick amounts, and payment method selection. This is added to the Ramp routes.

  2. Navigation Updates:

    • New route Routes.RAMP.AMOUNT_INPUT added
    • useRampNavigation hook updated to support V2 routing logic
    • TokenSelection component modified to handle V2 flow differently (doesn't close modal before navigation)
  3. Navbar Changes: New getRampsBuildQuoteNavbarOptions function added to Navbar/index.js - this is an additive change that doesn't modify existing navbar functions.

  4. Engine Messenger: Added RampsService:getPaymentMethods to allowed actions in the ramps-controller-messenger - minimal change.

  5. New UI Components: PaymentMethodPill and QuickAmounts components with their styles and tests.

  6. Utility Refactoring: formatCurrency moved from Deposit/utils to shared Ramp/utils location.

The existing E2E test offramp-token-amount.spec.ts tagged with SmokeRamps directly tests the BuildQuote view functionality including:

  • Amount entry via keypad
  • Quick amount buttons (25%, 50%, 75%, Max)
  • Delete button functionality

This test will validate that the ramps flow continues to work correctly with the new V2 routing. The changes are additive and feature-flagged behind useRampsUnifiedV2Enabled, so existing V1 flows should remain unaffected. However, running SmokeRamps tests ensures the ramps infrastructure works correctly.

The Navbar changes are additive (new function only) and don't affect other screens, so no broader testing is needed.

View GitHub Actions results

Copy link
Copy Markdown

@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.

@sonarqubecloud
Copy link
Copy Markdown

@wachunei
Copy link
Copy Markdown
Member

wachunei commented Jan 23, 2026

There's a bug with the non-integer amounts

non-integers.mp4

I would remove decimals from the input for buy, but this will be needed in the future for selling.

edit: I'm OK with this being fixed when tackling the next stories

@AxelGes AxelGes added this pull request to the merge queue Jan 23, 2026
Merged via the queue into main with commit 9e13887 Jan 23, 2026
97 of 98 checks passed
@AxelGes AxelGes deleted the feat/ramps-unified-buy-v2-amount-input branch January 23, 2026 17:34
@github-actions github-actions bot locked and limited conversation to collaborators Jan 23, 2026
@metamaskbot metamaskbot added the release-7.64.0 Issue or pull request that will be included in release 7.64.0 label Jan 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.64.0 Issue or pull request that will be included in release 7.64.0 size-XL team-money-movement issues related to Money Movement features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants