Skip to content

fix(mfa): align the code screen with the design system - #47539

Merged
mathieuartu merged 1 commit into
mainfrom
fix/mfa-code-step-ds
Nov 3, 2026
Merged

mathieuartu merged 1 commit into
mainfrom
fix/mfa-code-step-ds

Conversation

@mathieuartu

@mathieuartu mathieuartu commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Description

Changelog

CHANGELOG entry: null

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/MUL-2455

Manual testing steps

Feature: MFA email verification code entry

Background:
Given the user reaches the "Enter your verification code" screen in an MFA flow
And a 6-digit code has been sent to their email

Scenario: user no longer sees a Paste button
Then there is no "Paste" button above the code boxes
And the code boxes sit directly under the description at the standard gap

Scenario: user pastes the code with a long press
Given the user has copied the code from the email
When user long-presses any of the code boxes
Then all 6 boxes fill with the code
And the code is submitted automatically
And releasing the long press does not clear any digits

Scenario: user types the code
When user taps the boxes and types 6 digits
Then the focused box has a darker border than the others
And the code is submitted automatically after the 6th digit

Scenario: user enters a wrong code and tries again
When user enters an incorrect 6-digit code
Then the boxes clear, their borders turn red and "This code isn't correct. Try again" shows
When user types the first digit of a new code
Then the red borders and the error message disappear

Scenario: Android keyboard offers the code
Given the user is on a real Android device that has received the code
When user focuses the code boxes
Then the keyboard can suggest the one-time code

Screenshots/Recordings

Before

After

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

Low Risk
Localized MFA OTP UI and accessibility tweaks with no auth or verification logic changes.

Overview
Updates the MFA 6-digit code entry screen so invalid-code feedback matches design-system text fields and the ticket’s retry flow.

After a wrong code, the digits still clear as before, but red cell borders and the alert now use a dedicated showErrorState (error + empty input). As soon as the user types again, the message and red styling drop while aria-invalid follows the same rule.

Cell styling moves to getCellBorder: error red, border-default on the active cell, border-muted otherwise (replacing primary focus rings and a thicker border). Digit typography uses HeadingLg instead of a custom size.

The email Resend button no longer shows a loading state during verification—progress stays in the “Verifying…” row under the boxes. StepMessage drops medium font weight for step helper/error text.

Adds a test that the invalid-code alert hides once the user enters a new digit.

Reviewed by Cursor Bugbot for commit 1f91362. Bugbot is set up for automated code reviews on this repo. Configure here.

@mathieuartu mathieuartu self-assigned this Nov 2, 2026
@mathieuartu mathieuartu added the team-accounts-framework Accounts team label Nov 2, 2026
@mathieuartu
mathieuartu requested a review from a team as a code owner November 2, 2026 14:14
@github-actions

github-actions Bot commented Nov 2, 2026

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.

@github-actions github-actions Bot added the size-S label Nov 2, 2026
@metamask-ci

metamask-ci Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

✨ Files requiring CODEOWNER review ✨

🔑 @MetaMask/accounts-engineers (3 files, +30 -14)
  • 📁 ui/
    • 📁 pages/
      • 📁 mfa/
        • 📁 steps/
          • 📄 code-step.tsx +18 -12
          • 📄 step-layout.tsx +0 -2
          • 📄 steps.test.tsx +12 -0

@metamask-ci

metamask-ci Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor
Builds ready [1f91362]
⚡ Performance Benchmarks (Total: 🟢 9 pass · 🟡 1 warn · 🔴 3 fail)

Baseline (latest main): 171ed20 | Date: 7/28/2026 | Pipeline: 41460037417 | Baseline logs

Metricschrome-webpackfirefox-webpack
loadNewAccount
[Sentry log · main/release]
🔴 load_new_account(p95) [CI log]🔴 load_new_account(p95) [CI log]
onboardingNewWallet
[Sentry log · main/release]
🟢 [CI log]🔴 [CI log]

Regressions (🔴 3 failures)

Interaction Benchmarks · Samples: 5 🔴 2
Benchmarkchrome-webpackfirefox-webpack
loadNewAccount
[Sentry log · main/release]
🔴 [CI log]
🔴 load_new_account
🔴 [CI log]
🔴 load_new_account
confirmTx
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
bridgeUserActions
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • ↑ loadNewAccount/load_new_account: +415%
  • ↑ loadNewAccount/total: +415%
  • ↓ loadNewAccount/inp: -17%
  • ↓ loadNewAccount/fcp: -12%
  • ↑ loadNewAccount/cls: +1181%
  • ↑ confirmTx/longTaskTotalDuration: +39%
  • ↑ confirmTx/longTaskMaxDuration: +66%
  • ↑ confirmTx/tbt: +69%
  • ↓ confirmTx/inp: -24%
  • ↓ confirmTx/fcp: -12%
  • ↓ confirmTx/lcp: -12%
  • ↑ bridgeUserActions/bridge_load_page: +49%
  • ↑ bridgeUserActions/bridge_load_asset_picker: +61%
  • ↑ bridgeUserActions/longTaskCount: +67%
  • ↑ bridgeUserActions/longTaskTotalDuration: +47%
  • ↑ bridgeUserActions/tbt: +30%
  • ↓ bridgeUserActions/fcp: -16%
  • ↓ bridgeUserActions/lcp: -10%
  • ↑ bridgeUserActions/cls: +1181%
  • ↑ loadNewAccount/load_new_account: +419%
  • ↑ loadNewAccount/total: +419%
  • ↑ loadNewAccount/inp: +44%
  • ↓ loadNewAccount/fcp: -34%
  • ↑ loadNewAccount/lcp: +1291%
  • ↓ confirmTx/longTaskCount: -100%
  • ↓ confirmTx/longTaskTotalDuration: -100%
  • ↓ confirmTx/longTaskMaxDuration: -100%
  • ↓ confirmTx/tbt: -100%
  • ↓ confirmTx/inp: -24%
  • ↓ confirmTx/fcp: -34%
  • ↑ confirmTx/lcp: +1356%
  • ↑ bridgeUserActions/bridge_load_page: +351%
  • ↑ bridgeUserActions/bridge_load_asset_picker: +146%
  • ↓ bridgeUserActions/longTaskCount: -100%
  • ↓ bridgeUserActions/longTaskTotalDuration: -100%
  • ↓ bridgeUserActions/longTaskMaxDuration: -100%
  • ↓ bridgeUserActions/tbt: -100%
  • ↑ bridgeUserActions/total: +46%
  • ↑ bridgeUserActions/inp: +85%
  • ↓ bridgeUserActions/fcp: -30%
  • ↑ bridgeUserActions/lcp: +1287%
Startup Benchmarks · Samples: 100
Benchmarkchrome-webpackfirefox-webpack
startupStandardHome
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • ↑ startupStandardHome/domInteractive: +20%
  • ↓ startupStandardHome/firstReactRender: -99%
  • ↓ startupStandardHome/initialActions: -33%
  • ↑ startupStandardHome/setupStore: +158%
  • ↓ startupStandardHome/longTaskCount: -33%
  • ↓ startupStandardHome/uiStartup: -33%
  • ↓ startupStandardHome/load: -27%
  • ↓ startupStandardHome/domContentLoaded: -29%
  • ↓ startupStandardHome/domInteractive: -44%
  • ↓ startupStandardHome/backgroundConnect: -20%
  • ↓ startupStandardHome/firstReactRender: -99%
  • ↓ startupStandardHome/initialActions: -50%
  • ↓ startupStandardHome/loadScripts: -27%
  • ↑ startupStandardHome/setupStore: +51%
  • ↓ startupStandardHome/fcp: -26%
  • ↓ startupStandardHome/lcp: -25%
User Journey Benchmarks · Samples: 5 · mock API 🔴 1
Benchmarkchrome-webpackfirefox-webpack
onboardingImportWallet
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
🟡 total
onboardingNewWallet
[Sentry log · main/release]
🟢 [CI log]🔴 [CI log]
🔴 total

📈 Results compared to the previous 5 runs on main

  • ↑ onboardingImportWallet/srpButtonToSrpForm: +41%
  • ↑ onboardingImportWallet/confirmSrpToPwForm: +34%
  • ↑ onboardingImportWallet/pwFormToMetricsScreen: +33%
  • ↑ onboardingImportWallet/metricsToWalletReadyScreen: +33%
  • ↓ onboardingImportWallet/doneButtonToHomeScreen: -94%
  • ↓ onboardingImportWallet/openAccountMenuToAccountListLoaded: -75%
  • ↓ onboardingImportWallet/longTaskCount: -100%
  • ↓ onboardingImportWallet/longTaskTotalDuration: -100%
  • ↓ onboardingImportWallet/longTaskMaxDuration: -100%
  • ↓ onboardingImportWallet/tbt: -100%
  • ↓ onboardingImportWallet/total: -89%
  • ↑ onboardingNewWallet/srpButtonToPwForm: +38%
  • ↑ onboardingNewWallet/createPwToRecoveryScreen: +22%
  • ↑ onboardingNewWallet/skipBackupToMetricsScreen: +20%
  • ↑ onboardingNewWallet/agreeButtonToOnboardingSuccess: +11%
  • ↓ onboardingNewWallet/doneButtonToAssetList: -79%
  • ↓ onboardingNewWallet/longTaskCount: -69%
  • ↓ onboardingNewWallet/longTaskTotalDuration: -71%
  • ↓ onboardingNewWallet/longTaskMaxDuration: -31%
  • ↓ onboardingNewWallet/tbt: -74%
  • ↓ onboardingNewWallet/total: -74%
Dapp Page Load Benchmarks · Samples: 100
Benchmarkchrome-webpack
dappPageLoad
[Sentry log · main/release]
🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • ↓ dappPageLoad/pageLoadTime: -55%
  • ↓ dappPageLoad/firstPaint: -37%
  • ↓ dappPageLoad/firstContentfulPaint: -37%
Bundle Size Diffs
Status Bundle Total Diff Change
✅ background 15.26 MiB +130 Bytes 0.00%
✅ ui 19.29 MiB +109 Bytes 0.00%
✅ common 0 Bytes 0 Bytes 0.00%
✅ other 4.44 MiB 0 Bytes 0.00%
✅ content scripts 3.23 MiB 0 Bytes 0.00%
✅ unzipped 79.84 MiB +167 Bytes 0.00%
✅ zip 24.06 MiB +54 Bytes 0.00%

@sonarqubecloud

sonarqubecloud Bot commented Nov 2, 2026

Copy link
Copy Markdown

@mathieuartu mathieuartu added the retry-ci Tells GitHub Actions to retry failed jobs, label removed automatically before the retry label Nov 2, 2026
@mathieuartu
mathieuartu enabled auto-merge November 2, 2026 15:03
@mathieuartu
mathieuartu added this pull request to the merge queue Nov 2, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 2, 2026
@mathieuartu
mathieuartu added this pull request to the merge queue Nov 3, 2026
Merged via the queue into main with commit ded204d Nov 3, 2026
285 of 298 checks passed
@mathieuartu
mathieuartu deleted the fix/mfa-code-step-ds branch November 3, 2026 06:43
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 3, 2026
@github-actions github-actions Bot removed the retry-ci Tells GitHub Actions to retry failed jobs, label removed automatically before the retry label Nov 3, 2026
@metamaskbot metamaskbot added the release-13.57.0 Issue or pull request that will be included in release 13.57.0 label Nov 9, 2026
@gauthierpetetin

Copy link
Copy Markdown
Contributor

No release label on PR. Adding release label release-13.57.0 on PR, as PR was added to branch 13.57.0 when release was cut.

This branch had an error being deployed

1 failed and 1 inactive deployments
segment-schema — 1f91362b Deployed Nov 2, 2026 by mathieuartu via propose #2200
pr-comment — 1f91362b Deployed Nov 2, 2026 by mathieuartu via Publish prerelease / Publish prerelease #172173
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-13.57.0 Issue or pull request that will be included in release 13.57.0 size-S team-accounts-framework Accounts team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants