chore(runway): cherry-pick fix(ramps): Preserve user-entered amount during Transak navigation reset -> cp-7.71.0#27772
Merged
Conversation
…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 -->
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
approved these changes
Mar 21, 2026
Contributor
🔍 Smart E2E Test Selection⏭️ Smart E2E selection skipped - skip-smart-e2e-selection label found All E2E tests pre-selected. |
|
Contributor
|
✅ E2E Fixture Validation — Schema is up to date |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



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 thenavigation stack with a fresh
BuildQuotescreen as the base route.This fresh instance initialized with
DEFAULT_AMOUNT = 100, causing avisible flash of $100 during the transition to the checkout/KYC screen.
The fix passes the current
quote.fiatAmountas a route param(
amount) to theAMOUNT_INPUTbase route in everynavigation.reset()call.BuildQuotenow readsparams?.amountasthe 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
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
Pre-merge author checklist
Docs and MetaMask Mobile
Coding
Standards.
if applicable
guidelines).
Not required for external contributors.
Pre-merge reviewer checklist
app, test code being changed).
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/checkouttransitions.
BuildQuotenow supports anamountroute param to initialize theamount state (and to prevent region defaults from overriding it), and
useTransakRoutingpropagates this amount through all reset-basednavigation 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.