MetaMask / MetaMask/metamask-extension
[P2] selectors: extract unapproved-confirmations / tx-detail 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:** M
---
## Problem
~13 confirmation/tx-detail selectors (`getTotalUnapprovedCount`, `getUnapprovedTxCount`, `getUnapprovedConfirmations`, `getUnapprovedTemplatedConfirmations`, `getKnownMethodData`, `getTxData`, `getUnapprovedTransaction`, `getFullTxData`, `getNumberOfAllUnapprovedTransactionsAndMessages`, `getCustomNonceValue`, `getNextSuggestedNonce`, …). External `./transactions` + approval-type constants only.
## Solution
Extend the existing `ui/selectors/transactions.js` (or a sibling `confirmations.ts` paired with `approvals.ts`).
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
- [ ] Selectors moved; imports repointed directly to the module (no barrel). Tests green.
Contributor guide
Research direction
Start with ui/selectors/selectors.js and the existing ui/selectors/transactions.js; locate the listed confirmation and transaction selectors and every site importing them, including ../selectors barrel imports. Repoint imports directly to the chosen domain module and run the selector tests. Done means the selectors are removed from selectors.js, no barrel facade remains, and tests are green.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- frontend
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 67/100