Skip to content

chore(helpers): remove unused ui helper exports - #47518

Merged
georgewrmarshall merged 1 commit into
mainfrom
cursor/remove-dead-code-helper-constants-20261030
Nov 3, 2026
Merged

georgewrmarshall merged 1 commit into
mainfrom
cursor/remove-dead-code-helper-constants-20261030

Conversation

@georgewrmarshall

@georgewrmarshall georgewrmarshall commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Description

Removes unused exports from unowned ui/helpers files. Owner set: (none) (no CODEOWNERS match). No user-facing behavior change.

The declarations are not imported anywhere. Whole-word search only hit the definitions. None of these symbols or files are referenced by an open pull request. Declaration blame is older than 90 days, and the files themselves were not edited in the last 30 days. String values that are still locale message keys remain quoted elsewhere in ui/, so yarn verify-locales does not lose a message reference.

path removed (file / symbol / class) why dead
ui/helpers/constants/error-keys.js INSUFFICIENT_FUNDS_ERROR_KEY unused export
ui/helpers/constants/error-keys.js TRANSACTION_ERROR_KEY unused export
ui/helpers/constants/error-keys.js IS_SIGNING_OR_SUBMITTING unused export
ui/helpers/constants/gas.js PRIORITY_LEVEL_ICON_MAP unused export
ui/helpers/constants/connected-sites.js STATUS_CONNECTED_TO_SNAP unused export
ui/helpers/utils/confirm-tx.util.ts convertTokenToFiat unused export
ui/helpers/utils/confirm-tx.util.ts roundExponential unused export
ui/helpers/utils/confirm-tx.util.ts BigNumber import cascade from roundExponential

Left in place on purpose: five other unused error-key exports and getGasFormErrorText, because each is the only quoted reference to a locale message key. Locales are out of scope.

Checks that passed: yarn lint:tsc, eslint on the touched files, and yarn test:unit --coverage=false for ui/helpers/utils/confirm-tx.util.test.js and ui/helpers/constants (no snapshot updates). No stylesheets changed.

Changelog

CHANGELOG entry: null

Related issues

Fixes:

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

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

Low Risk
Deletes unreachable helper exports only; no runtime paths or security-sensitive logic are modified.

Overview
Removes dead exports from ui/helpers that are not imported anywhere—proactive cleanup with no intended user-facing behavior change.

Constants: drops STATUS_CONNECTED_TO_SNAP, three error-key constants (INSUFFICIENT_FUNDS_ERROR_KEY, TRANSACTION_ERROR_KEY, IS_SIGNING_OR_SUBMITTING), and the unused PRIORITY_LEVEL_ICON_MAP emoji map from gas helpers.

Confirm-tx utils: deletes convertTokenToFiat and roundExponential, and removes the bignumber.js import that only served roundExponential. Remaining helpers (gas totals, fee formatting, dapp gas comparison, etc.) are unchanged.

Other unused symbols were left when they still anchor locale message keys (per PR notes).

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

Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
@georgewrmarshall georgewrmarshall added the team-design-system All issues relating to design system in Extension label Oct 30, 2026 — with Cursor
@georgewrmarshall georgewrmarshall self-assigned this Oct 30, 2026
@metamask-ci

metamask-ci Bot commented Oct 30, 2026

Copy link
Copy Markdown
Contributor
Builds ready [2d41c1b]
⚡ Performance Benchmarks (Total: 🟢 7 pass · 🟡 3 warn · 🔴 3 fail)

Baseline (latest main): 171ed20 | Date: 7/28/2026 | Pipeline: 41032664046 | Baseline logs

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

Regressions (🔴 3 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: +417%
  • ↑ loadNewAccount/total: +417%
  • ↓ loadNewAccount/inp: -17%
  • ↑ confirmTx/longTaskTotalDuration: +55%
  • ↑ confirmTx/longTaskMaxDuration: +92%
  • ↑ confirmTx/tbt: +99%
  • ↓ confirmTx/inp: -17%
  • ↑ confirmTx/fcp: +11%
  • ↑ confirmTx/lcp: +10%
  • ↑ bridgeUserActions/bridge_load_page: +105%
  • ↑ bridgeUserActions/bridge_load_asset_picker: +36%
  • ↑ bridgeUserActions/longTaskCount: +67%
  • ↑ bridgeUserActions/longTaskTotalDuration: +144%
  • ↑ bridgeUserActions/longTaskMaxDuration: +64%
  • ↑ bridgeUserActions/tbt: +307%
  • ↑ bridgeUserActions/fcp: +12%
  • ↑ loadNewAccount/load_new_account: +416%
  • ↑ loadNewAccount/total: +416%
  • ↓ loadNewAccount/inp: -24%
  • ↓ loadNewAccount/fcp: -61%
  • ↑ loadNewAccount/lcp: +916%
  • ↓ confirmTx/longTaskCount: -100%
  • ↓ confirmTx/longTaskTotalDuration: -100%
  • ↓ confirmTx/longTaskMaxDuration: -100%
  • ↓ confirmTx/tbt: -100%
  • ↓ confirmTx/inp: -32%
  • ↓ confirmTx/fcp: -71%
  • ↑ confirmTx/lcp: +907%
  • ↑ bridgeUserActions/bridge_load_page: +285%
  • ↑ bridgeUserActions/bridge_load_asset_picker: +61%
  • ↓ bridgeUserActions/longTaskCount: -100%
  • ↓ bridgeUserActions/longTaskTotalDuration: -100%
  • ↓ bridgeUserActions/longTaskMaxDuration: -100%
  • ↓ bridgeUserActions/tbt: -100%
  • ↑ bridgeUserActions/total: +25%
  • ↑ bridgeUserActions/inp: +92%
  • ↓ bridgeUserActions/fcp: -71%
  • ↑ bridgeUserActions/lcp: +924%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 loadNewAccount/FCP: p75 1.9s
  • 🟡 confirmTx/FCP: p75 1.9s
  • 🟡 bridgeUserActions/FCP: p75 1.9s
Startup Benchmarks · Samples: 100
Benchmarkchrome-webpackfirefox-webpack
startupStandardHome
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • ↓ startupStandardHome/uiStartup: -13%
  • ↓ startupStandardHome/load: -15%
  • ↓ startupStandardHome/domContentLoaded: -15%
  • ↓ startupStandardHome/firstPaint: -12%
  • ↓ startupStandardHome/backgroundConnect: -23%
  • ↓ startupStandardHome/firstReactRender: -99%
  • ↓ startupStandardHome/initialActions: -33%
  • ↓ startupStandardHome/loadScripts: -16%
  • ↑ startupStandardHome/setupStore: +150%
  • ↓ startupStandardHome/longTaskCount: -33%
  • ↓ startupStandardHome/longTaskTotalDuration: -22%
  • ↓ startupStandardHome/longTaskMaxDuration: -17%
  • ↓ startupStandardHome/tbt: -20%
  • ↓ startupStandardHome/inp: -11%
  • ↓ startupStandardHome/fcp: -15%
  • ↓ startupStandardHome/uiStartup: -25%
  • ↓ startupStandardHome/load: -20%
  • ↓ startupStandardHome/domContentLoaded: -22%
  • ↓ startupStandardHome/domInteractive: -49%
  • ↓ startupStandardHome/backgroundConnect: -15%
  • ↓ startupStandardHome/firstReactRender: -99%
  • ↓ startupStandardHome/initialActions: -50%
  • ↓ startupStandardHome/loadScripts: -20%
  • ↑ startupStandardHome/setupStore: +88%
  • ↓ startupStandardHome/fcp: -37%
  • ↓ startupStandardHome/lcp: -18%
User Journey Benchmarks · Samples: 5 · mock API 🔴 1
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: +49%
  • ↑ onboardingImportWallet/confirmSrpToPwForm: +43%
  • ↑ onboardingImportWallet/pwFormToMetricsScreen: +36%
  • ↑ onboardingImportWallet/metricsToWalletReadyScreen: +37%
  • ↓ onboardingImportWallet/doneButtonToHomeScreen: -94%
  • ↓ onboardingImportWallet/openAccountMenuToAccountListLoaded: -75%
  • ↓ onboardingImportWallet/longTaskCount: -86%
  • ↓ onboardingImportWallet/longTaskTotalDuration: -96%
  • ↓ onboardingImportWallet/longTaskMaxDuration: -93%
  • ↓ onboardingImportWallet/tbt: -100%
  • ↓ onboardingImportWallet/total: -89%
  • ↑ onboardingNewWallet/srpButtonToPwForm: +37%
  • ↑ onboardingNewWallet/createPwToRecoveryScreen: +12%
  • ↑ onboardingNewWallet/skipBackupToMetricsScreen: +17%
  • ↑ onboardingNewWallet/agreeButtonToOnboardingSuccess: +24%
  • ↓ onboardingNewWallet/doneButtonToAssetList: -79%
  • ↓ onboardingNewWallet/longTaskCount: -69%
  • ↓ onboardingNewWallet/longTaskTotalDuration: -100%
  • ↓ onboardingNewWallet/longTaskMaxDuration: -52%
  • ↓ onboardingNewWallet/tbt: -100%
  • ↓ onboardingNewWallet/total: -75%
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: -55%
  • ↓ dappPageLoad/firstPaint: -37%
  • ↓ dappPageLoad/firstContentfulPaint: -37%
Bundle Size Diffs
Status Bundle Total Diff Change
✅ background 15.26 MiB +130 Bytes 0.00%
✅ ui 19.28 MiB +4 Bytes 0.00%
✅ common 0 Bytes 0 Bytes 0.00%
✅ other 4.44 MiB 0 Bytes 0.00%
✅ content scripts 3.23 MiB 0 Bytes 0.00%
✅ unzipped 79.84 MiB +139 Bytes 0.00%
✅ zip 24.06 MiB +44 Bytes 0.00%

@sonarqubecloud

Copy link
Copy Markdown

@georgewrmarshall
georgewrmarshall requested a review from a team November 2, 2026 17:51
@georgewrmarshall
georgewrmarshall added this pull request to the merge queue Nov 3, 2026
Merged via the queue into main with commit 052debe Nov 3, 2026
153 checks passed
@georgewrmarshall
georgewrmarshall deleted the cursor/remove-dead-code-helper-constants-20261030 branch November 3, 2026 04:14
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 3, 2026
@metamaskbot metamaskbot added the release-13.57.0 Issue or pull request that will be included in release 13.57.0 label Nov 9, 2026

This branch was successfully deployed

1 active and 1 inactive deployments
pr-comment — 2d41c1ba Deployed Oct 30, 2026 by georgewrmarshall via Publish prerelease / Publish prerelease #172061
segment-schema — 2d41c1ba Deployed Oct 30, 2026 by georgewrmarshall via propose #1932
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants