Skip to content

chore(runway): cherry-pick fix(ramps): Preserve user-entered amount during Transak navigation reset -> cp-7.71.0#27772

Merged
chloeYue merged 2 commits into
release/7.71.0from
runway-cherry-pick-7.71.0-1774074841
Mar 23, 2026
Merged

chore(runway): cherry-pick fix(ramps): Preserve user-entered amount during Transak navigation reset -> cp-7.71.0#27772
chloeYue merged 2 commits into
release/7.71.0from
runway-cherry-pick-7.71.0-1774074841

Conversation

@runway-github
Copy link
Copy Markdown
Contributor

@runway-github runway-github Bot commented Mar 21, 2026

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.

[8a03f66](https://github.com/MetaMask/metamask-mobile/commit/8a03f66803964cbbe25b37cde717aeed03ec4bf7)

…uring Transak navigation reset -> cp-7.71.0 (#27742)

## **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](https://consensyssoftware.atlassian.net/browse/TRAM-3348)

## **Manual testing steps**

```gherkin
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**

<!-- Screenshot/video showing amount reverting from $30 to $100 during
loading -->



https://github.com/user-attachments/assets/ba7fb42b-c43a-43f8-b438-0484090d7895



### **After**

<!-- Screenshot/video showing amount staying at $30 during loading
transition -->



https://github.com/user-attachments/assets/6d60c1ae-f0eb-448b-b7f3-297efbce85df



https://github.com/user-attachments/assets/099ebf69-face-4bb0-8568-80357f59b35e

<img width="523" height="877" alt="Screenshot 2026-03-20 175035"
src="https://github.com/user-attachments/assets/6bebcd4a-c04d-40c6-90d4-7e50ed683824"
/>


## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I've included tests if applicable
- [ ] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [x] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [x] 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.


<!-- CURSOR_SUMMARY -->
---

> [!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.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
a8bdee0. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
@runway-github runway-github Bot requested a review from a team as a code owner March 21, 2026 06: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-bots Bot team (for MetaMask Bot, Runway Bot, etc.) label Mar 21, 2026
@github-actions github-actions Bot added size-M risk-medium Moderate testing recommended · Possible bug introduction risk labels Mar 21, 2026
@imyugioh imyugioh self-assigned this Mar 21, 2026
@chloeYue chloeYue added the skip-smart-e2e-selection Skip Smart E2E selection, i.e. select all E2E tests to run label Mar 23, 2026
@github-actions github-actions Bot added risk-high Extensive testing required · High bug introduction risk and removed risk-medium Moderate testing recommended · Possible bug introduction risk labels Mar 23, 2026
@github-actions github-actions Bot added risk-high Extensive testing required · High bug introduction risk and removed risk-high Extensive testing required · High bug introduction risk labels Mar 23, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

⏭️ Smart E2E selection skipped - skip-smart-e2e-selection label found

All E2E tests pre-selected.

View GitHub Actions results

@sonarqubecloud
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor

@chloeYue chloeYue left a comment

Choose a reason for hiding this comment

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

LGTM

@chloeYue chloeYue merged commit 5834a30 into release/7.71.0 Mar 23, 2026
185 of 189 checks passed
@chloeYue chloeYue deleted the runway-cherry-pick-7.71.0-1774074841 branch March 23, 2026 12:33
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

risk-high Extensive testing required · High bug introduction risk size-M skip-smart-e2e-selection Skip Smart E2E selection, i.e. select all E2E tests to run team-bots Bot team (for MetaMask Bot, Runway Bot, etc.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants