Conversation
Adds the CONF-1385 A/B test for the mUSD conversion confirmation amount field: control loads empty, treatment pre-fills the max amount on load. Follows docs/ab-testing.md: a threshold-array remote flag (earnCONF1385AbtestPrefilledMaxAmount), a shared ab-testing config module, useABTest for assignment + Experiment Viewed exposure, and active_ab_tests enrichment on Transaction Submitted/Finalized for conversion and drop-off segmentation.
Drive the conversion confirmation pre-fill from the standard confirmations_pay_extended flag instead of the useABTest hook and a dedicated A/B flag, and tag Transaction events with mm_pay_prefilled_amount.
|
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. |
✨ Files requiring CODEOWNER review ✨✅ @MetaMask/confirmations (7 files, +342 -2)
|
Add unit coverage for selectIsPayAmountPrefillEnabled, the useTransactionCustomAmount prefill behaviour (prefilled_max input type), and the mm_pay_prefilled_amount tagging on transaction events.
Builds ready [c389aa4]
⚡ Performance Benchmarks (Total: 🟢 18 pass · 🟡 7 warn · 🔴 0 fail)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
|
CI triage result for 1 issue: Fixed — three lines added by this PR exceeded Prettier's 80-character printWidth in |
Builds ready [3755535]
⚡ Performance Benchmarks (Total: 🟢 14 pass · 🟡 10 warn · 🔴 1 fail)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Cancel the pending debounced amount update in updatePendingAmountPercentage so a stale trailing update can't undo the prefilled max, and track manual edits synchronously so a late balance can't overwrite user typing.
|
CI triage result for 1 issue: Investigated this PR feedback in follow-up run No PR code change was pushed because the agent did not identify a warranted fix. The single CI failure —
Execution: 0 files changed. Validation: passed. Review: approved. PR: #43359 |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b18deec. Configure here.
|
CI triage result for 1 issue: Investigated this PR feedback in follow-up run No PR code change was pushed because the agent did not identify a warranted fix. The single CI failure (test-e2e-chrome-api-specs-multichain) is caused by a network connectivity issue on the CI runner, not by any code change in this PR. Selenium Manager attempted to reach
Execution: 0 files changed. Validation: passed. Review: approved. PR: #43359 |
Reset the prefill refs when transactionId changes so a new conversion in the same UI instance can prefill again, and guard prefill on a synchronous user-edit ref instead of isInputChanged, which also flips from debounced sync of existing required-token USD.
|
CI triage result for 1 issue: Investigated this PR feedback in follow-up run No PR code change was pushed because the agent did not identify a warranted fix. The single CI failure — 'Critical errors shows critical error screen when background takes over 16 seconds to sync state' in critical-errors.spec.ts — is classified as flaky. It has no connection to this PR's changes (multichain / account-list UI, branch musd-a-b). No code change is warranted.
Execution: 0 files changed. Validation: passed. Review: approved. PR: #43359 |
Builds ready [e739759]
⚡ Performance Benchmarks (Total: 🟢 13 pass · 🟡 12 warn · 🔴 0 fail)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|

Description
The mUSD conversion confirmation currently loads with an empty amount field, requiring users to type or click MAX before they can proceed. This adds the ability to pre-fill the field with the user's max balance on load, so they can convert immediately or adjust.
The behaviour is configured via the existing
confirmations_pay_extendedremote flag (newprefilledAmountsection, resolved per transaction type), so control (empty field) vs treatment (pre-filled max) can be split through LaunchDarkly targeting without a code change. Every Transaction event is tagged withmm_pay_prefilled_amountso the success rate of each experience can be compared.selectIsPayAmountPrefillEnabled(state, transactionType)readingconfirmations_pay_extended.prefilledAmount(default/overrides[txType]).MusdConversionInfopre-fills the max amount on load when enabled, and emitsmm_pay_prefilled_amounton all Transaction events.confirmations_pay_extendedin the E2E feature-flag registry.Changelog
CHANGELOG entry: null
Related issues
Fixes: CONF-1385
Manual testing steps
.manifest-overrides.jsonand setMANIFEST_OVERRIDES=.manifest-overrides.jsonin.metamaskrc:{ "_flags": { "remoteFeatureFlags": { "earnMusdConversionFlowEnabled": { "enabled": true, "minimumVersion": "0.0.0" }, "confirmations_pay_extended": { "payStrategies": { "relay": { "gaslessEnabled": true } }, "prefilledAmount": { "default": { "enabled": false }, "overrides": { "musdConversion": { "enabled": true } } } } } } }yarn build:test(oryarn start:test) and load the extension.musdConversion.enabledtofalseto verify control (empty field).mm_pay_prefilled_amountappears on the Transaction events in MetaMetrics.Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Changes default pay amount and quote request timing on confirmation load when the flag is on; mitigated by remote flag defaulting off and guards against overwriting user input.
Overview
Adds flag-gated max-balance prefill for MetaMask Pay custom amount entry, wired first for mUSD conversion so users can confirm without typing or tapping MAX.
Remote config:
confirmations_pay_extended.prefilledAmount(default/overrides[transactionType]), exposed viaselectIsPayAmountPrefillEnabled, with the flag registered for E2E defaults (prefill off in prod).Behavior:
useTransactionCustomAmountacceptsprefillMaxOnLoadand, once balance > 0, applies 100% max once per transaction unless the user edits (syncuserEditedRef); prefill usesmm_pay_amount_input_type: prefilled_maxand triggers quotes like MAX.CustomAmountInfopasses the prop through;MusdConversionInforeads the flag formusdConversionand tags Transaction events withmm_pay_prefilled_amountfor A/B analysis.Reviewed by Cursor Bugbot for commit e739759. Bugbot is set up for automated code reviews on this repo. Configure here.