Skip to content

chore(batch-sell): remove unused batch sell imports and locals - #47635

Merged
georgewrmarshall merged 1 commit into
mainfrom
cursor/remove-dead-code-batch-sell-locals-20261105
Nov 6, 2026
Merged

georgewrmarshall merged 1 commit into
mainfrom
cursor/remove-dead-code-batch-sell-locals-20261105

Conversation

@georgewrmarshall

@georgewrmarshall georgewrmarshall commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Description

Removes unused imports and locals in the batch-sell review flow and the batch-sell selector tests, as reported by tsc --noUnusedLocals. The helpers hasAnyEnabledAsset and hasAtLeastOneQuoteAvailable stay; only an unused import of them in total-received-modal.tsx is removed. The modal still receives anyEnabledAsset and atLeastOneQuoteAvailable as props.

Owner set: none (no CODEOWNERS match for any touched file).

path removed (file / symbol / class) why dead
ui/pages/batch-sell/pages/review/components/total-received-modal.tsx useMemo, hasAnyEnabledAsset, hasAtLeastOneQuoteAvailable imports unused local
ui/pages/batch-sell/pages/review/hooks/useBatchSellAggregateValidation.ts BigNumber, getNativeAssetForChainId imports unused local
ui/pages/batch-sell/pages/review/hooks/useBatchSellQuotesFetching.ts CaipAssetType import unused local
ui/pages/batch-sell/pages/review/utils/buildQuoteRequest.test.ts ASSET_ID unused local
ui/ducks/batch-sell/selectors.test.ts MOCK_SOLANA_ACCOUNT, ALL_NETWORKS, MOCK_SOLANA_NETWORK unused local (MOCK_SOLANA_NETWORK is a cascade: its only reader was ALL_NETWORKS)

Every removed item was proven with a whole-repo whole-word search. Other MOCK_SOLANA_ACCOUNT hits are a different export in test/data/bridge/mock-bridge-store.ts. Other *_ASSET_ID names in the selector test are different locals. hasAnyEnabledAsset and hasAtLeastOneQuoteAvailable remain used by the review page. Checked against the diffs of all 562 open PRs: none edit these files. Declaration blame is June–July 2026, outside the 60-day window, and these files last changed before the 30-day window. No user-facing behavior change.

Checks passed: yarn lint:tsc, eslint on the touched files, and yarn test:unit --coverage=false for ui/ducks/batch-sell plus the touched review tests (96 tests, no snapshot updates).

Docs/comments updated: none

Changelog

CHANGELOG entry: null

Related issues

Refs: proactive dead-code cleanup (extension counterpart of metamask-mobile#37948)

Manual testing steps

N/A — deletes unreachable code. There is no user-facing behavior to click through.

Screenshots/Recordings

N/A — no UI change

Before

N/A

After

N/A

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

Low Risk
Import and test-fixture deletions only; batch-sell logic and UI props are unchanged.

Overview
Dead-code cleanup in the batch-sell review flow and selector tests so tsc --noUnusedLocals stays clean. No runtime or UI behavior changes.

Review flow: Drops unused imports from total-received-modal.tsx (useMemo, hasAnyEnabledAsset, hasAtLeastOneQuoteAvailable); the modal still uses anyEnabledAsset and atLeastOneQuoteAvailable from props. useBatchSellAggregateValidation and useBatchSellQuotesFetching lose unused BigNumber, getNativeAssetForChainId, and CaipAssetType imports. buildQuoteRequest.test.ts removes an unused ASSET_ID constant.

Tests: selectors.test.ts removes unused Solana fixtures (MOCK_SOLANA_ACCOUNT, MOCK_SOLANA_NETWORK, ALL_NETWORKS) that nothing referenced after other test setup.

Reviewed by Cursor Bugbot for commit 0fe01f8. Bugbot is set up for automated code reviews on this repo. Configure here.

Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
@github-actions github-actions Bot added the size-S label Nov 5, 2026
@georgewrmarshall georgewrmarshall added team-design-system All issues relating to design system in Extension and removed size-S labels Nov 5, 2026 — with Cursor
@georgewrmarshall georgewrmarshall self-assigned this Nov 5, 2026
@metamask-ci

metamask-ci Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor
Builds ready [0fe01f8]
⚡ Performance Benchmarks (Total: 🟢 8 pass · 🟡 1 warn · 🔴 4 fail)

Baseline (latest main): f693520 | Date: 11/3/2026 | Pipeline: 42002567949 | Baseline logs

Metricschrome-webpackfirefox-webpack
loadNewAccount
[Sentry log · main/release]
🔴 load_new_account(p95) [CI log]🔴 load_new_account(p95) [CI log]
onboardingImportWallet
[Sentry log · main/release]
🟢 [CI log]🔴 [CI log]
onboardingNewWallet
[Sentry log · main/release]
🟢 [CI log]🔴 [CI log]

Regressions (🔴 4 failures)

Interaction Benchmarks · Samples: 5 🔴 2
Benchmarkchrome-webpackfirefox-webpack
loadNewAccount
[Sentry log · main/release]
🔴 [CI log]
🔴 load_new_account
🔴 [CI log]
🔴 load_new_account
confirmTx
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
bridgeUserActions
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • ↑ loadNewAccount/load_new_account: +180%
  • ↑ loadNewAccount/total: +180%
  • ↓ loadNewAccount/inp: -25%
  • ↑ loadNewAccount/cls: +278%
  • ↑ confirmTx/longTaskTotalDuration: +29%
  • ↑ confirmTx/longTaskMaxDuration: +44%
  • ↑ confirmTx/tbt: +50%
  • ↓ confirmTx/inp: -21%
  • ↓ confirmTx/fcp: -11%
  • ↑ bridgeUserActions/bridge_load_page: +21%
  • ↑ bridgeUserActions/bridge_load_asset_picker: +69%
  • ↑ bridgeUserActions/longTaskCount: +36%
  • ↑ bridgeUserActions/longTaskTotalDuration: +43%
  • ↑ bridgeUserActions/longTaskMaxDuration: +11%
  • ↑ bridgeUserActions/tbt: +56%
  • ↓ bridgeUserActions/fcp: -13%
  • ↑ bridgeUserActions/cls: +281%
  • ↑ loadNewAccount/load_new_account: +181%
  • ↑ loadNewAccount/total: +181%
  • ↓ loadNewAccount/inp: -18%
  • ↓ loadNewAccount/fcp: -57%
  • ↑ loadNewAccount/lcp: +1130%
  • ↓ confirmTx/longTaskCount: -100%
  • ↓ confirmTx/longTaskTotalDuration: -100%
  • ↓ confirmTx/longTaskMaxDuration: -100%
  • ↓ confirmTx/tbt: -100%
  • ↓ confirmTx/inp: -29%
  • ↑ confirmTx/lcp: +1020%
  • ↑ bridgeUserActions/bridge_load_page: +120%
  • ↑ bridgeUserActions/bridge_load_asset_picker: +87%
  • ↓ bridgeUserActions/longTaskCount: -100%
  • ↓ bridgeUserActions/longTaskTotalDuration: -100%
  • ↓ bridgeUserActions/longTaskMaxDuration: -100%
  • ↓ bridgeUserActions/tbt: -100%
  • ↑ bridgeUserActions/total: +25%
  • ↑ bridgeUserActions/inp: +18%
  • ↓ bridgeUserActions/fcp: -64%
  • ↑ bridgeUserActions/lcp: +1077%
Startup Benchmarks · Samples: 100
Benchmarkchrome-webpackfirefox-webpack
startupStandardHome
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
🟡 loadScripts

📈 Results compared to the previous 5 runs on main

  • ↓ startupStandardHome/uiStartup: -13%
  • ↓ startupStandardHome/load: -14%
  • ↓ startupStandardHome/domContentLoaded: -15%
  • ↓ startupStandardHome/firstPaint: -12%
  • ↓ startupStandardHome/backgroundConnect: -14%
  • ↓ startupStandardHome/firstReactRender: -98%
  • ↓ startupStandardHome/initialActions: -29%
  • ↓ startupStandardHome/loadScripts: -15%
  • ↑ startupStandardHome/setupStore: +49%
  • ↓ startupStandardHome/longTaskCount: -29%
  • ↓ startupStandardHome/longTaskTotalDuration: -20%
  • ↓ startupStandardHome/longTaskMaxDuration: -16%
  • ↓ startupStandardHome/tbt: -18%
  • ↓ startupStandardHome/inp: -11%
  • ↓ startupStandardHome/fcp: -14%
  • ↓ startupStandardHome/lcp: -11%
  • ↑ startupStandardHome/cls: +400%
  • ↓ startupStandardHome/domInteractive: -36%
  • ↓ startupStandardHome/firstReactRender: -98%
  • ↓ startupStandardHome/initialActions: -50%
  • ↓ startupStandardHome/fcp: -33%
User Journey Benchmarks · Samples: 5 · mock API 🔴 2
Benchmarkchrome-webpackfirefox-webpack
onboardingImportWallet
[Sentry log · main/release]
🟢 [CI log]🔴 [CI log]
🔴 total
onboardingNewWallet
[Sentry log · main/release]
🟢 [CI log]🔴 [CI log]
🔴 total

📈 Results compared to the previous 5 runs on main

  • ↓ onboardingImportWallet/srpButtonToSrpForm: -15%
  • ↓ onboardingImportWallet/confirmSrpToPwForm: -12%
  • ↓ onboardingImportWallet/doneButtonToHomeScreen: -92%
  • ↓ onboardingImportWallet/openAccountMenuToAccountListLoaded: -74%
  • ↓ onboardingImportWallet/longTaskCount: -100%
  • ↓ onboardingImportWallet/longTaskTotalDuration: -100%
  • ↓ onboardingImportWallet/longTaskMaxDuration: -100%
  • ↓ onboardingImportWallet/tbt: -100%
  • ↓ onboardingImportWallet/total: -85%
  • ↑ onboardingNewWallet/srpButtonToPwForm: +36%
  • ↑ onboardingNewWallet/createPwToRecoveryScreen: +18%
  • ↑ onboardingNewWallet/skipBackupToMetricsScreen: +21%
  • ↑ onboardingNewWallet/agreeButtonToOnboardingSuccess: +14%
  • ↓ onboardingNewWallet/doneButtonToAssetList: -73%
  • ↓ onboardingNewWallet/longTaskCount: -62%
  • ↓ onboardingNewWallet/longTaskTotalDuration: -74%
  • ↓ onboardingNewWallet/longTaskMaxDuration: -38%
  • ↓ onboardingNewWallet/tbt: -99%
  • ↓ onboardingNewWallet/total: -69%
Dapp Page Load Benchmarks · Samples: 100
Benchmarkchrome-webpack
dappPageLoad
[Sentry log · main/release]
🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • ↓ dappPageLoad/pageLoadTime: -61%
  • ↓ dappPageLoad/domContentLoaded: -20%
  • ↓ dappPageLoad/firstPaint: -47%
  • ↓ dappPageLoad/firstContentfulPaint: -47%
Bundle Size Diffs
Status Bundle Total Diff Change
✅ background 15.24 MiB +131 Bytes 0.00%
✅ ui 19.34 MiB +68 Bytes 0.00%
✅ common 0 Bytes 0 Bytes 0.00%
✅ other 4.44 MiB +1 Bytes 0.00%
✅ content scripts 3.22 MiB +2 Bytes 0.00%
✅ unzipped 79.65 MiB +207 Bytes 0.00%
✅ zip 23.81 MiB -9 Bytes 0.00%

@sonarqubecloud

sonarqubecloud Bot commented Nov 5, 2026

Copy link
Copy Markdown

@georgewrmarshall
georgewrmarshall added this pull request to the merge queue Nov 6, 2026
Merged via the queue into main with commit 0492f59 Nov 6, 2026
267 of 270 checks passed
@georgewrmarshall
georgewrmarshall deleted the cursor/remove-dead-code-batch-sell-locals-20261105 branch November 6, 2026 07:32
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 6, 2026
@metamaskbot metamaskbot added the release-13.58.0 Issue or pull request that will be included in release 13.58.0 label Nov 16, 2026
@gauthierpetetin

Copy link
Copy Markdown
Contributor

No release label on PR. Adding release label release-13.58.0 on PR, as PR was added to branch 13.58.0 when release was cut.

This branch was previously deployed

1 inactive deployment
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-13.58.0 Issue or pull request that will be included in release 13.58.0 team-design-system All issues relating to design system in Extension

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants