MetaMask / MetaMask/metamask-extension
[P2] selectors: extract hardware-wallet selectors
- Dominant language
- TypeScript
- Stars
- 13.2k
- Forks
- 5.6k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 451
Description
**Parent Epic:** [#44566 — `selectors.js` decomposition](https://github.com/MetaMask/metamask-extension/issues/44566)
**Source:** `ui/selectors/selectors.js`
**Size:** S
---
## Problem
5 selectors (`getIsHardwareWalletErrorModalVisible`, `getActiveQrCodeScanRequest`, `getLastQrScanCompletedSuccessfully`, `getIsSigningQRHardwareTransaction`, `doesAddressRequireLedgerHidConnection`) — external `ducks/app` + base-selectors only, no intra-file coupling.
## Solution
Create `ui/selectors/hardware-wallet.ts` (pairs with the existing `qr-sync/` dir).
Migration seam (no barrel): repoint every site importing the moved selectors to `ui/selectors/` directly (a `ts-morph` codemod that splits any `../selectors` barrel imports into per-module imports) and delete them from `selectors.js` in the same PR — no re-export facade, per the no-barrel-files convention.
## Acceptance Criteria
- [ ] `hardware-wallet.ts`; imports repointed directly to the module (no barrel). Tests green.
Contributor guide
Research direction
Start with ui/selectors/selectors.js and inspect the five named selectors and their import sites. Create ui/selectors/hardware-wallet.ts, repoint imports directly to that module without a barrel, remove the selectors from selectors.js, and run the relevant tests to confirm they are green.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100