MetaMask / MetaMask/metamask-extension

[P2] selectors: extract unapproved-confirmations / tx-detail selectors

Open
#44,573 1 comment 0 reactions 0 assignees View on GitHub
exalate-duplicate INVALID-ISSUE-TEMPLATE mig-epic-71-child team-extension-platform
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.