feat(confirmations): handle hardware wallet retries in footer#40836
feat(confirmations): handle hardware wallet retries in footer#40836montelaidev merged 7 commits intomainfrom
Conversation
Preserve hardware wallet error semantics across the RPC boundary and centralize the retry, recovery, and preflight logic so confirmation flows can build on a reusable foundation. Made-with: Cursor
Apply the shared hardware-wallet error layer to confirmation flows so retry, rejection, and danger-alert handling stay consistent without pulling the whole feature into one oversized PR. Made-with: Cursor
|
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 (11 files, +1022 -154)
|
Builds ready [93b950a]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
app/_locales/en/messages.json
Outdated
| "createPasswordDetailsSocial": { | ||
| "message": "Losing this password means losing wallet access on all devices, $1", | ||
| "description": "$1 is the text 'MetaMask can't reset it.'" | ||
| "message": "Losing this password means losing wallet access on all devices, " |
There was a problem hiding this comment.
Locale removes $1 placeholder breaking styled warning text
Medium Severity
The createPasswordDetailsSocial message had its $1 placeholder removed, but the consumer in create-password-form.tsx (line 115) still calls t('createPasswordDetailsSocial', [...]) with a React element for $1. Since $1 no longer exists in the message string, the colored warning text "MetaMask can't reset it." is silently dropped and never rendered. Users see only "Losing this password means losing wallet access on all devices, " with a trailing comma and no warning.
Additional Locations (1)
Builds ready [4968d55]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚀 Bundle size reduced!]
|
There was a problem hiding this comment.
Given all this new logic should only introduce risk to the hardware wallet flow, I'll approve this given it's gone through a few iterations also.
But due to the amount of new branches and complexity in the footer, I'd strongly recommend we encapsulate all the core confirm logic into useConfirmActions so it also returns a onSubmit as well as onCancel.
Then we could create a dedicated file for the DefaultFooter rendering, plus an entirely new component (and file) such as HardwareFooter that would encapsulate the entire hardware wallet footer lifecycle, but avoid duplication via also using useConfirmActions and useAlerts as needed.
If we need to influence the default confirmation logic directly, we can add generic optional props and callbacks to useConfirmationActions so it can be extended but still decoupled.
That way the two flows are hopefully more decoupled, and its far easier for the hardware flow to be maintained in isolation, without creating this one monolithic component that overlaps logic, rendering, and the hardware wallet lifecycle.
The other files seem much lighter and logical, mostly just avoiding navigating if we're showing the new modal.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
| } | ||
| }); | ||
|
|
||
| await resolveApprovalWithHardwareWalletHandling(); |
There was a problem hiding this comment.
Transaction state reset before hardware wallet retry completes
Low Severity
When onTransactionConfirm catches a retryable hardware wallet error and returns false, the finally block in footer's onSubmit still runs resetTransactionState(), clearing the custom nonce value in Redux. If the user then retries via the hardware wallet error modal, customNonceValue is empty, so the retry uses a default nonce instead of the user-specified one.
Additional Locations (1)
Builds ready [f01bd45]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚀 Bundle size reduced!]
|
|
Builds ready [b1f95cb]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚀 Bundle size reduced!]
|





Description
This is the final pr to enable the usage of hardware wallet error management. It manages the connection lifecycle, permission handling, error states, and provides a clean interface for UI components to interact with hardware wallets.
Changelog
CHANGELOG entry: Enable hardware wallet error management in send and dapp flow.
Related issues
Related to: https://consensyssoftware.atlassian.net/browse/MUL-1299?atlOrigin=eyJpIjoiZWZlYjE4M2NiOWVmNDk0N2I3MzA4MzMzZTg2M2U1YzYiLCJwIjoiaiJ9
Manual testing steps
Screenshots/Recordings
Before
After
Dapp interaction
Screen.Recording.2026-02-11.at.20.45.31.mov
Send
Screen.Recording.2026-02-11.at.10.00.29.AM.mov
Swap/Bridge
Screen.Recording.2026-02-11.at.10.01.58.AM.mov
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Changes confirmation submit/cancel and navigation behavior for hardware-wallet accounts, including suppressing/handling error modals and retry flows. Medium risk due to impact on core approval/confirmation UX and device-specific edge cases.
Overview
Adds hardware-wallet retry/preflight handling to the confirmations footer. The footer now runs a hardware-wallet preflight before submitting where applicable, can show a dedicated Connect device button when the device isn’t ready, and wraps signature approval submission in hardware-wallet modal handling (including treating user rejected on device as a cancel-and-advance flow).
Improves alert and navigation interactions. The danger confirm modal now marks an unconfirmed danger alert as confirmed on submit, hardware-wallet error modals are suppressed while unconfirmed danger alerts are present, and confirmation pages no longer auto-navigate away while the hardware-wallet error modal is visible (to allow retries).
useTransactionConfirmnow returns success/failure and shows the hardware-wallet error modal only for retryable device errors.Updates Storybook/test render helpers to include
HardwareWalletErrorProvider, removesLedgerInfofrom the confirm page, and expands unit/e2e coverage and baselines to reflect the new hardware-wallet flows.Written by Cursor Bugbot for commit b1f95cb. This will update automatically on new commits. Configure here.