Skip to content

fix(ramps): Preserve user-entered amount during Transak navigation reset -> cp-7.71.0#27742

Merged
imyugioh merged 2 commits into
mainfrom
fix/ramps-3348-preserve-amount-on-navigation-reset
Mar 21, 2026
Merged

fix(ramps): Preserve user-entered amount during Transak navigation reset -> cp-7.71.0#27742
imyugioh merged 2 commits into
mainfrom
fix/ramps-3348-preserve-amount-on-navigation-reset

Conversation

@imyugioh

@imyugioh imyugioh commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes the Buy flow amount reverting from the user-entered value back to the default $100 during the Transak native provider loading transition.

When a user enters a custom amount (e.g. $30) and taps Continue, the Transak routing callbacks use navigation.reset() to rebuild the navigation stack with a fresh BuildQuote screen as the base route. This fresh instance initialized with DEFAULT_AMOUNT = 100, causing a visible flash of $100 during the transition to the checkout/KYC screen.

The fix passes the current quote.fiatAmount as a route param (amount) to the AMOUNT_INPUT base route in every navigation.reset() call. BuildQuote now reads params?.amount as the initial state, preserving the user-entered amount through stack resets.

Changelog

CHANGELOG entry: Fixed Buy flow amount input reverting to $100 during Transak native provider checkout transition.

Related issues

Fixes: TRAM-3348

Manual testing steps

Feature: Amount persists through Transak native provider checkout transition

  Scenario: Custom amount does not revert to default during Continue loading
    Given the user is on the Buy screen with Transak Native provider
    And the default amount is $100
    When the user changes the amount to $30
    And the user taps Continue
    Then the displayed amount remains $30 during the loading transition
    And the amount does not flash back to $100

  Scenario: Default amount is preserved when no custom amount is entered
    Given the user is on the Buy screen with Transak Native provider
    And the default amount is $100
    When the user taps Continue without changing the amount
    Then the displayed amount remains $100 throughout the flow

  Scenario: Amount persists when navigating back from KYC/checkout screens
    Given the user entered $50 and proceeded through Continue
    When the user navigates back to the Buy screen
    Then the amount input shows $50 (not $100)

Screenshots/Recordings

Before

ScreenRecording_03-12-2026.10-21-58_1.MP4

After

Screen.Recording.2026-03-20.164415.mp4
Screen.Recording.2026-03-20.174939.mp4
Screenshot 2026-03-20 175035

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
Updates Transak native-provider navigation/reset logic and initial screen state; mistakes could regress Buy/KYC routing or amount display during transitions, but changes are localized and covered by tests.

Overview
Fixes the Transak native Buy flow so the user-entered fiat amount is preserved when the app uses navigation.reset() during KYC/checkout transitions.

BuildQuote now supports an amount route param to initialize the amount state (and to prevent region defaults from overriding it), and useTransakRouting propagates this amount through all reset-based navigation paths (KYC approved → checkout, KYC forms, additional verification, verify identity, and KYC webview). Tests are updated/added to assert the amount is passed through routing callbacks and used as the initial displayed value.

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

@imyugioh imyugioh requested a review from a team as a code owner March 20, 2026 14:05
@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.

@imyugioh imyugioh self-assigned this Mar 20, 2026
@imyugioh imyugioh added the team-money-movement issues related to Money Movement features label Mar 20, 2026
@github-actions github-actions Bot added size-M risk-medium Moderate testing recommended · Possible bug introduction risk labels Mar 20, 2026
@imyugioh imyugioh force-pushed the fix/ramps-3348-preserve-amount-on-navigation-reset branch from 13a8ffe to aacef99 Compare March 20, 2026 17:49
@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 Mar 20, 2026
@imyugioh imyugioh force-pushed the fix/ramps-3348-preserve-amount-on-navigation-reset branch from aacef99 to fc525b9 Compare March 20, 2026 22:12
@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 Mar 20, 2026
@imyugioh imyugioh changed the title fix(ramps): Preserve user-entered amount during Transak navigation reset fix(ramps): Preserve user-entered amount during Transak navigation reset -> cp-7.71.0 Mar 21, 2026
@imyugioh imyugioh force-pushed the fix/ramps-3348-preserve-amount-on-navigation-reset branch from fc525b9 to a8bdee0 Compare March 21, 2026 03:15
@imyugioh

Copy link
Copy Markdown
Contributor Author

@metamaskbot update-mobile-fixture

@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 Mar 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeRamps
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: medium
  • AI Confidence: 95%
click to see 🤖 AI reasoning details

E2E Test Selection:
All 6 changed files are within the Ramp feature area (app/components/UI/Ramp/). The changes add amount parameter preservation across navigation resets in the Transak native flow:

  1. BuildQuote.tsx: Accepts an amount route param to pre-fill the amount input when the navigation stack is reset (e.g., after KYC/auth flows redirect back). The userHasEnteredAmount state is also initialized based on whether the param is present.

  2. useTransakRouting.ts: All navigation callbacks now accept and forward an amount parameter to the AMOUNT_INPUT route when resetting the navigation stack. The routeAfterAuthentication function signature changed to accept amount as a second parameter.

  3. AdditionalVerification.tsx: Now extracts quote from params and passes quote.fiatAmount to navigateToKycWebview to preserve the amount.

  4. Test files: Updated to match new function signatures and verify the new behavior.

These changes are entirely isolated to the Ramp/on-ramp feature. The risk is medium because navigation resets are involved and the amount state initialization logic changed (params moved before useState calls). SmokeRamps covers the fiat on-ramp and off-ramp flows that would exercise these code paths.

No other feature areas are impacted - no shared components (TabBar, Browser, Confirmations, etc.) were modified.

Performance Test Selection:
The changes are limited to navigation parameter passing and state initialization within the Ramp feature. No rendering performance, list components, data loading, or app startup code was modified. These changes do not warrant performance testing.

View GitHub Actions results

@github-actions

Copy link
Copy Markdown
Contributor

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

@sonarqubecloud

Copy link
Copy Markdown

@imyugioh imyugioh enabled auto-merge March 21, 2026 05:52
@imyugioh imyugioh added this pull request to the merge queue Mar 21, 2026
Merged via the queue into main with commit 8a03f66 Mar 21, 2026
91 checks passed
@imyugioh imyugioh deleted the fix/ramps-3348-preserve-amount-on-navigation-reset branch March 21, 2026 06:33
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 21, 2026
@metamaskbot metamaskbot added the release-7.72.0 Issue or pull request that will be included in release 7.72.0 label Mar 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.72.0 Issue or pull request that will be included in release 7.72.0 risk-medium Moderate testing recommended · Possible bug introduction risk size-M team-money-movement issues related to Money Movement features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants