Skip to content

feat: add HardwarewalletProvider and HardwareWalletBottomSheet for HW lifecycle and error management#26520

Merged
mathieuartu merged 56 commits into
mainfrom
feat/hw-overhaul-4
Feb 26, 2026
Merged

feat: add HardwarewalletProvider and HardwareWalletBottomSheet for HW lifecycle and error management#26520
mathieuartu merged 56 commits into
mainfrom
feat/hw-overhaul-4

Conversation

@mathieuartu

@mathieuartu mathieuartu commented Feb 24, 2026

Copy link
Copy Markdown
Contributor

Description

Part 4 of the hardware wallet connection & error management overhaul. This does not introduce user facing changes.

Will close:

Final implementation will look like this (Figma designs):
image

Reference feature branch: #25519

Changelog

CHANGELOG entry: null

Related issues

Fixes:

Manual testing steps

no manual testing steps

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

Medium Risk
Moderate risk because it adds new state-management and error/transport handling paths in hardware-wallet connection flows; behavior changes are largely encapsulated but could affect connection/retry UX and edge cases.

Overview
Introduces a new unified hardware wallet connection flow via HardwareWalletProvider and a state-driven HardwareWalletBottomSheet, covering scanning/device selection, connecting, awaiting app, awaiting confirmation, error, and success states.

The provider now owns adapter lifecycle, device discovery, retry/last-operation tracking, and transport availability monitoring (surfacing transport-disabled errors when availability drops mid-flow), and wires internal actions into the bottom sheet.

Adds the bottom sheet content components (ConnectingContent, DeviceSelectionContent, AwaitingAppContent, AwaitingConfirmationContent, ErrorContent, SuccessContent), comprehensive unit tests for the provider, sheet, and content behaviors, and new en.json i18n strings under hardware_wallet.

Written by Cursor Bugbot for commit 69a47be. This will update automatically on new commits. Configure here.

Comment thread app/core/HardwareWallet/HardwareWalletProvider.tsx
Comment thread app/core/HardwareWallet/HardwareWalletProvider.tsx
Comment thread app/core/HardwareWallet/HardwareWalletProvider.test.tsx Outdated
Comment thread app/core/HardwareWallet/HardwareWalletProvider.tsx
@mathieuartu mathieuartu added the skip-e2e skip E2E test jobs label Feb 25, 2026
Comment thread app/core/HardwareWallet/HardwareWalletProvider.tsx
Comment thread app/core/HardwareWallet/HardwareWalletProvider.tsx
Comment thread app/core/HardwareWallet/HardwareWalletProvider.tsx
Comment thread app/core/HardwareWallet/HardwareWalletProvider.tsx Outdated
@mathieuartu mathieuartu marked this pull request as draft February 25, 2026 16:37
@mathieuartu mathieuartu marked this pull request as ready for review February 25, 2026 16:37
@mathieuartu mathieuartu marked this pull request as draft February 25, 2026 16:59
@mathieuartu mathieuartu marked this pull request as ready for review February 25, 2026 16:59

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeAccounts
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: medium
  • AI Confidence: 75%
click to see 🤖 AI reasoning details

E2E Test Selection:
This PR introduces a new Hardware Wallet Provider and Bottom Sheet UI components for managing hardware wallet connections (Ledger, QR hardware wallets). Key observations:

  1. All files are NEW - These are entirely new files being added to app/core/HardwareWallet/, not modifications to existing code.

  2. Not yet integrated - The HardwareWalletProvider is exported from the index but is NOT yet being used anywhere in the app. The grep search shows no consumers outside the HardwareWallet directory itself.

  3. Self-contained module - The changes are isolated within app/core/HardwareWallet/ directory with comprehensive unit tests for all new components.

  4. Localization changes are additive - Only new keys added to en.json under hardware_wallet namespace, no existing strings modified.

Since the new code is not yet integrated into the app, most E2E tests would not directly exercise this code. However, I'm selecting SmokeAccounts because:

  • Hardware wallets are related to account management (adding QR-based hardware wallet accounts)
  • The SmokeAccounts tag covers "adding QR-based hardware wallet accounts" per its description
  • This provides a sanity check that the new exports don't break existing account-related functionality

The risk is medium because while the code is in a critical path (app/core/), it's entirely new and isolated code that isn't yet wired into the app's main flows.

Performance Test Selection:
This PR adds new Hardware Wallet Provider and Bottom Sheet UI components that are not yet integrated into the app. Since the new code has no consumers and is not being used in any user flows, there is no performance impact to measure. The changes are purely additive new code that won't affect app startup, rendering, or any existing user flows until they are integrated in a future PR.

View GitHub Actions results

@mathieuartu mathieuartu changed the title feat: hw overhaul 4 feat: add HardwarewalletProvider and HardwareWalletBottomSheet for HW lifecycle and error management Feb 25, 2026

@gantunesr gantunesr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good in general, just left some minor comments

Comment thread locales/languages/en.json
Comment thread app/core/HardwareWallet/HardwareWalletProvider.tsx
Comment thread app/core/HardwareWallet/HardwareWalletProvider.tsx
@mathieuartu mathieuartu added this pull request to the merge queue Feb 26, 2026
Merged via the queue into main with commit 7774958 Feb 26, 2026
75 of 76 checks passed
@mathieuartu mathieuartu deleted the feat/hw-overhaul-4 branch February 26, 2026 23:24
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 26, 2026
@metamaskbot metamaskbot added the release-7.69.0 Issue or pull request that will be included in release 7.69.0 label Feb 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.69.0 Issue or pull request that will be included in release 7.69.0 size-XL skip-e2e skip E2E test jobs team-accounts-framework Accounts team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants