Skip to content

feat: add a HeroAmountInput component for large amount inputs - #47564

Merged
georgewrmarshall merged 6 commits into
mainfrom
cursor/grotzec-amount-input-scale-f3b4
Nov 5, 2026
Merged

georgewrmarshall merged 6 commits into
mainfrom
cursor/grotzec-amount-input-scale-f3b4

Conversation

@georgewrmarshall

@georgewrmarshall georgewrmarshall commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Description

This adds HeroAmountInput, a shared component under ui/components/ui/hero-amount-input/ for the large Grotzec (Hero) amount inputs. It is the base of the Grotzec amount input stack; the UAT build in #47557 combines it with every consumer.

What is the reason for the change? Swap/Bridge, Ramps Buy, Perps withdraw and the MM Pay custom amount each had their own amount field and their own font-size rules, so the same amount rendered at different sizes on different screens and long amounts overflowed in some of them (for example a 10-digit KRW amount in Ramps). Design asked for one aligned behavior for every large number input.

What is the improvement? One component owns the field, the optional currency prefix, the font-size scale and the loading skeleton:

  • Scale: 88, 72, 60, 48, 40, 32, 24, 20px (HERO_AMOUNT_FONT_SIZES), the same 88px start and 20px floor as the Mobile Grotzec inputs. Line height always equals font size so the row keeps one height. maxFontSize lets a tight layout (Swap/Bridge) start lower on the same steps. Values that don't fit at 20px stay at 20px and scroll inside the field.
  • Choosing a step: the component picks the largest step at which the prefix plus the amount fits the row's measured width. Amount characters count at the widest Grotzec digit (0.43em), so the size depends only on how many characters are typed, not which ones.
  • Measuring: the row width is read once before paint and then only from a single ResizeObserver, so typing never reads layout. The prefix is measured from an offscreen probe at a fixed 100px size, remeasured when web fonts load and when the probe mounts after the loading skeleton. Until then the prefix is estimated at prefix.length * 0.43em. Before the row has a width (for example in jsdom) the popup content width of 328px is used.
  • Layout: the prefix is shrink-0 and the digit box is min-w-0 overflow-hidden, so long amounts never paint over the $. Font size changes animate with a short transition that respects prefers-reduced-motion.
  • Input: inputMode="decimal", at most one . or , separator, and an optional maxDecimals limit. Error, disabled (muted text) and loading states are built in.
  • Testability: every part has a test ID derived from data-testid (-prefix, -value, -input, -skeleton), and prefixProps, valueProps and inputProps reach the child elements, so consumer tests don't need to mock the component. test/lib/mock-resize-observer.ts lets tests drive row widths.
  • Design system: built with MMDS Text/Input/Skeleton and Tailwind, with no SCSS. The six smaller steps map to --font-size-10 … --font-size-5; 88 and 72 have no token yet, so the chosen step is applied as an inline font size. The mapping is documented in hero-amount-input.constants.ts for a later move to tokens.
  • Storybook: Components/UI/HeroAmountInput covers the default, long amount, currency code, max decimals, error, disabled, read-only, loading, swap field and wide layouts.

This branch also fixes two tests that #46148 broke on main when it removed "Please" from locale strings, which fails every PR based on main:

  • token-list-item.test.tsx builds the native-token scam warning from the locale message.
  • The bridge-alert-banner-list.test.tsx snapshot uses "Select a different quote."

Currency-sign alignment across experiences is tracked separately in TMCU-1761. Send is out of scope.

Merge order. Merge this PR first. The consumer PRs are stacked on this branch (cursor/grotzec-amount-input-scale-f3b4); retarget each to main after this merges:

Changelog

CHANGELOG entry: null

Related issues

Epic: TMCU-1741

Manual testing steps

  1. Run yarn storybook and open Components / UI / HeroAmountInput.
  2. In the Default story, type a long amount and verify the font size steps down from 88px toward 20px and the $ stays fully visible.
  3. Resize the canvas narrower and wider and verify the font size follows the available width.
  4. Check the Currency code, Max decimals, With error, Disabled, Read only and Loading stories render as named.
  5. For the component in real flows, test the consumer PRs or the UAT build in chore: Grotzec large number amount inputs (UAT) #47557.

Screenshots/Recordings

Before

No Before: HeroAmountInput is a new component.

After

Screen.Recording.2026-11-04.at.8.16.37.PM.mov

Each editable story has 500000000000000000 typed into it:

  • Default, LongAmount, MaxDecimals: 88 → 72 → 60 → 48 → 40px (4 steps)
  • CurrencyCode (KRW): 88 → 72 → 60 → 48 → 40 → 32px (5 steps)
  • Wide (640px frame): 88 → 72px (1 step)
  • SwapField (maxFontSize 40): stays at 40px
  • WithError, Disabled, ReadOnly, Loading: shown as named, without typing

Firefox

firefox.mov

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.
Open in Web Open in Cursor 

Note

Low Risk
Additive UI module with no production wiring in this PR; behavior is covered by unit tests and Storybook, with only local amount-string validation logic.

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

@metamask-ci

metamask-ci Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor
Builds ready [12dab28]
⚡ Performance Benchmarks (Total: 🟢 10 pass · 🟡 0 warn · 🔴 3 fail)

Baseline (latest main): 171ed20 | Date: 7/28/2026 | Pipeline: 41560405135 | 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: +414%
  • ↑ loadNewAccount/total: +414%
  • ↓ loadNewAccount/inp: -24%
  • ↓ loadNewAccount/fcp: -16%
  • ↑ loadNewAccount/cls: +1181%
  • ↑ confirmTx/longTaskTotalDuration: +37%
  • ↑ confirmTx/longTaskMaxDuration: +63%
  • ↑ confirmTx/tbt: +64%
  • ↓ confirmTx/inp: -32%
  • ↑ bridgeUserActions/bridge_load_page: +58%
  • ↑ bridgeUserActions/bridge_load_asset_picker: +72%
  • ↑ bridgeUserActions/longTaskCount: +67%
  • ↑ bridgeUserActions/longTaskTotalDuration: +59%
  • ↑ bridgeUserActions/tbt: +45%
  • ↓ bridgeUserActions/fcp: -13%
  • ↑ bridgeUserActions/cls: +1181%
  • ↑ loadNewAccount/load_new_account: +416%
  • ↑ loadNewAccount/total: +416%
  • ↓ loadNewAccount/inp: -24%
  • ↓ loadNewAccount/fcp: -59%
  • ↑ loadNewAccount/lcp: +1076%
  • ↓ confirmTx/longTaskCount: -100%
  • ↓ confirmTx/longTaskTotalDuration: -100%
  • ↓ confirmTx/longTaskMaxDuration: -100%
  • ↓ confirmTx/tbt: -100%
  • ↑ confirmTx/inp: +74%
  • ↓ confirmTx/fcp: -11%
  • ↑ confirmTx/lcp: +984%
  • ↑ bridgeUserActions/bridge_load_page: +308%
  • ↑ bridgeUserActions/bridge_load_asset_picker: +59%
  • ↓ bridgeUserActions/bridge_search_token: -15%
  • ↓ bridgeUserActions/longTaskCount: -100%
  • ↓ bridgeUserActions/longTaskTotalDuration: -100%
  • ↓ bridgeUserActions/longTaskMaxDuration: -100%
  • ↓ bridgeUserActions/tbt: -100%
  • ↑ bridgeUserActions/total: +22%
  • ↓ bridgeUserActions/fcp: -63%
  • ↑ bridgeUserActions/lcp: +840%
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/domInteractive: +13%
  • ↓ startupStandardHome/firstReactRender: -99%
  • ↓ startupStandardHome/initialActions: -33%
  • ↑ startupStandardHome/setupStore: +158%
  • ↑ startupStandardHome/numNetworkReqs: +10%
  • ↓ startupStandardHome/longTaskCount: -33%
  • ↑ startupStandardHome/domInteractive: +42%
  • ↓ startupStandardHome/firstReactRender: -99%
  • ↓ startupStandardHome/initialActions: -50%
  • ↑ startupStandardHome/setupStore: +115%
  • ↑ startupStandardHome/fcp: +44%
User Journey Benchmarks · Samples: 5 · mock API 🔴 1
Benchmarkchrome-webpackfirefox-webpack
onboardingImportWallet
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
onboardingNewWallet
[Sentry log · main/release]
🟢 [CI log]🔴 [CI log]
🔴 total

📈 Results compared to the previous 5 runs on main

  • ↑ onboardingImportWallet/srpButtonToSrpForm: +47%
  • ↑ onboardingImportWallet/confirmSrpToPwForm: +42%
  • ↑ onboardingImportWallet/pwFormToMetricsScreen: +30%
  • ↑ onboardingImportWallet/metricsToWalletReadyScreen: +15%
  • ↓ onboardingImportWallet/doneButtonToHomeScreen: -94%
  • ↓ onboardingImportWallet/openAccountMenuToAccountListLoaded: -75%
  • ↓ onboardingImportWallet/longTaskCount: -86%
  • ↓ onboardingImportWallet/longTaskTotalDuration: -96%
  • ↓ onboardingImportWallet/longTaskMaxDuration: -93%
  • ↓ onboardingImportWallet/tbt: -100%
  • ↓ onboardingImportWallet/total: -89%
  • ↑ onboardingNewWallet/srpButtonToPwForm: +38%
  • ↑ onboardingNewWallet/createPwToRecoveryScreen: +20%
  • ↑ onboardingNewWallet/skipBackupToMetricsScreen: +20%
  • ↑ onboardingNewWallet/agreeButtonToOnboardingSuccess: +28%
  • ↓ onboardingNewWallet/doneButtonToAssetList: -79%
  • ↓ onboardingNewWallet/longTaskCount: -69%
  • ↓ onboardingNewWallet/longTaskTotalDuration: -79%
  • ↓ onboardingNewWallet/longTaskMaxDuration: -50%
  • ↓ 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: -72%
  • ↓ dappPageLoad/domContentLoaded: -34%
  • ↓ dappPageLoad/firstPaint: -55%
  • ↓ dappPageLoad/firstContentfulPaint: -55%
Bundle Size Diffs
Status Bundle Total Diff Change
✅ background 15.26 MiB +130 Bytes 0.00%
✅ ui 19.33 MiB +91 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.89 MiB +226 Bytes 0.00%
✅ zip 24.07 MiB +85 Bytes 0.00%

@metamask-ci

metamask-ci Bot commented Nov 3, 2026

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

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

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

Regressions (🔴 2 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: +178%
  • ↑ loadNewAccount/total: +178%
  • ↓ loadNewAccount/inp: -33%
  • ↓ loadNewAccount/fcp: -31%
  • ↓ loadNewAccount/lcp: -19%
  • ↑ loadNewAccount/cls: +282%
  • ↓ confirmTx/inp: -44%
  • ↓ confirmTx/fcp: -29%
  • ↓ bridgeUserActions/bridge_load_asset_picker: -28%
  • ↓ bridgeUserActions/bridge_search_token: -11%
  • ↓ bridgeUserActions/longTaskTotalDuration: -31%
  • ↓ bridgeUserActions/longTaskMaxDuration: -36%
  • ↓ bridgeUserActions/tbt: -65%
  • ↓ bridgeUserActions/total: -12%
  • ↓ bridgeUserActions/inp: -19%
  • ↓ bridgeUserActions/fcp: -33%
  • ↓ bridgeUserActions/lcp: -26%
  • ↑ bridgeUserActions/cls: +281%
  • ↑ loadNewAccount/load_new_account: +183%
  • ↑ loadNewAccount/total: +183%
  • ↓ loadNewAccount/inp: -25%
  • ↑ loadNewAccount/fcp: +23%
  • ↑ loadNewAccount/lcp: +1284%
  • ↓ confirmTx/longTaskCount: -100%
  • ↓ confirmTx/longTaskTotalDuration: -100%
  • ↓ confirmTx/longTaskMaxDuration: -100%
  • ↓ confirmTx/tbt: -100%
  • ↓ confirmTx/inp: -13%
  • ↓ confirmTx/fcp: -32%
  • ↑ confirmTx/lcp: +1324%
  • ↑ bridgeUserActions/bridge_load_page: +241%
  • ↑ bridgeUserActions/bridge_load_asset_picker: +122%
  • ↓ bridgeUserActions/longTaskCount: -100%
  • ↓ bridgeUserActions/longTaskTotalDuration: -100%
  • ↓ bridgeUserActions/longTaskMaxDuration: -100%
  • ↓ bridgeUserActions/tbt: -100%
  • ↑ bridgeUserActions/total: +65%
  • ↑ bridgeUserActions/inp: +54%
  • ↑ bridgeUserActions/fcp: +21%
  • ↑ bridgeUserActions/lcp: +1299%

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

  • 🟡 loadNewAccount/FCP: p75 2.1s
  • 🟡 bridgeUserActions/FCP: p75 2.1s
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: -15%
  • ↓ startupStandardHome/load: -15%
  • ↓ startupStandardHome/domContentLoaded: -15%
  • ↓ startupStandardHome/firstPaint: -12%
  • ↓ startupStandardHome/backgroundConnect: -19%
  • ↓ startupStandardHome/firstReactRender: -98%
  • ↓ startupStandardHome/initialActions: -29%
  • ↓ startupStandardHome/loadScripts: -16%
  • ↑ startupStandardHome/setupStore: +49%
  • ↓ startupStandardHome/longTaskCount: -29%
  • ↓ startupStandardHome/longTaskTotalDuration: -22%
  • ↓ startupStandardHome/longTaskMaxDuration: -18%
  • ↓ startupStandardHome/tbt: -20%
  • ↓ startupStandardHome/inp: -18%
  • ↓ startupStandardHome/fcp: -16%
  • ↓ startupStandardHome/lcp: -11%
  • ↑ startupStandardHome/cls: +400%
  • ↑ startupStandardHome/domInteractive: +45%
  • ↓ startupStandardHome/firstReactRender: -98%
  • ↓ startupStandardHome/initialActions: -50%
  • ↑ startupStandardHome/setupStore: +138%
  • ↑ startupStandardHome/fcp: +48%
User Journey Benchmarks · Samples: 5 · mock API
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/metricsToWalletReadyScreen: -12%
  • ↓ onboardingImportWallet/doneButtonToHomeScreen: -92%
  • ↓ onboardingImportWallet/openAccountMenuToAccountListLoaded: -74%
  • ↓ onboardingImportWallet/longTaskCount: -100%
  • ↓ onboardingImportWallet/longTaskTotalDuration: -100%
  • ↓ onboardingImportWallet/longTaskMaxDuration: -100%
  • ↓ onboardingImportWallet/tbt: -100%
  • ↓ onboardingImportWallet/total: -85%
  • ↓ onboardingNewWallet/srpButtonToPwForm: -21%
  • ↓ onboardingNewWallet/createPwToRecoveryScreen: -22%
  • ↓ onboardingNewWallet/agreeButtonToOnboardingSuccess: -33%
  • ↓ onboardingNewWallet/doneButtonToAssetList: -77%
  • ↓ onboardingNewWallet/longTaskCount: -100%
  • ↓ onboardingNewWallet/longTaskTotalDuration: -100%
  • ↓ onboardingNewWallet/longTaskMaxDuration: -100%
  • ↓ onboardingNewWallet/tbt: -100%
  • ↓ onboardingNewWallet/total: -73%
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 [🚨 Warning! Bundle size has increased!]
Status Bundle Total Diff Change
✅ background 15.26 MiB +100 Bytes 0.00%
🚨 ui 19.33 MiB +2.4 KiB +0.01%
✅ common 0 Bytes 0 Bytes 0.00%
✅ other 4.44 MiB +7 Bytes 0.00%
✅ content scripts 3.23 MiB +14 Bytes 0.00%
🚨 unzipped 79.9 MiB +5.62 KiB +0.01%
🚨 zip 24.07 MiB +2.24 KiB +0.01%

@cursor cursor Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: First paint uses fallback font size
    • Moved measurement into useLayoutEffect so the container width is read before paint, avoiding a flash of the popup fallback font size.

Create PR

Or push these changes by commenting:

@cursor push 87db80b92b
Preview (87db80b92b)
diff --git a/ui/hooks/useAmountInputFontSize.test.tsx b/ui/hooks/useAmountInputFontSize.test.tsx
--- a/ui/hooks/useAmountInputFontSize.test.tsx
+++ b/ui/hooks/useAmountInputFontSize.test.tsx
@@ -54,6 +54,36 @@
     expect(getFontSize()).toBe(40);
   });
 
+  it('uses the laid-out width before the first resize notification', () => {
+    const clientWidthDescriptor = Object.getOwnPropertyDescriptor(
+      HTMLElement.prototype,
+      'clientWidth',
+    );
+    Object.defineProperty(HTMLElement.prototype, 'clientWidth', {
+      configurable: true,
+      get() {
+        return 626;
+      },
+    });
+
+    try {
+      render(<Harness text={LONG_AMOUNT} fallbackWidth={219} />);
+
+      expect(getFontSize()).toBe(40);
+      expect(resizeObserver.constructorSpy).toHaveBeenCalledTimes(1);
+    } finally {
+      if (clientWidthDescriptor) {
+        Object.defineProperty(
+          HTMLElement.prototype,
+          'clientWidth',
+          clientWidthDescriptor,
+        );
+      } else {
+        delete (HTMLElement.prototype as { clientWidth?: number }).clientWidth;
+      }
+    }
+  });
+
   it('keeps the start size when the measured container is wide', () => {
     render(<Harness text={LONG_AMOUNT} fallbackWidth={219} />);
 

diff --git a/ui/hooks/useAmountInputFontSize.ts b/ui/hooks/useAmountInputFontSize.ts
--- a/ui/hooks/useAmountInputFontSize.ts
+++ b/ui/hooks/useAmountInputFontSize.ts
@@ -1,4 +1,4 @@
-import { useCallback, useEffect, useMemo, useState } from 'react';
+import { useCallback, useLayoutEffect, useMemo, useState } from 'react';
 import {
   AMOUNT_INPUT_MAX_FONT_SIZE,
   AMOUNT_INPUT_POPUP_WIDTH,
@@ -27,10 +27,11 @@
  * wide layouts such as the expanded view keep larger sizes while the popup
  * and side panel still step down.
  *
- * One ResizeObserver per container supplies the width; nothing reads layout
- * while typing. The width is stored rounded to a whole px and only when it
- * changes, so resize notifications that do not move it cause no re-render.
- * The font size itself is derived during render.
+ * The width is read once before paint when the container mounts and then only
+ * when a ResizeObserver reports a change, so typing never triggers a layout
+ * read. The width is stored rounded to a whole px and only when it changes,
+ * so resize notifications that do not move it cause no re-render. The font
+ * size itself is derived during render.
  *
  * @param text - The amount as rendered, including any currency symbol.
  * @param options - Layout constraints of the input.
@@ -54,24 +55,35 @@
     setContainer(element);
   }, []);
 
-  useEffect(() => {
-    if (!container || typeof ResizeObserver === 'undefined') {
+  useLayoutEffect(() => {
+    if (!container) {
       return undefined;
     }
     // React 18 can still run the component once for an update that bails
     // out, so repeats of the last reported width skip setState entirely.
     let lastReportedWidth: number | undefined;
-    // The first notification arrives after layout and before paint.
+    const reportWidth = (width: number) => {
+      const rounded = Math.round(width);
+      if (rounded === lastReportedWidth) {
+        return;
+      }
+      lastReportedWidth = rounded;
+      setMeasuredWidth((previous) =>
+        previous === rounded ? previous : rounded,
+      );
+    };
+    // Measure before paint so the first frame uses the real width. A
+    // ResizeObserver created in useEffect would only fire after paint.
+    reportWidth(container.clientWidth);
+
+    if (typeof ResizeObserver === 'undefined') {
+      return undefined;
+    }
     const observer = new ResizeObserver(([entry]) => {
       if (!entry) {
         return;
       }
-      const width = Math.round(entry.contentRect.width);
-      if (width === lastReportedWidth) {
-        return;
-      }
-      lastReportedWidth = width;
-      setMeasuredWidth((previous) => (previous === width ? previous : width));
+      reportWidth(entry.contentRect.width);
     });
     observer.observe(container);
     return () => observer.disconnect();

You can send follow-ups to the cloud agent here.

Reviewed by Cursor Bugbot for commit d9f2104. Configure here.

Comment thread ui/hooks/useAmountInputFontSize.ts Resolved
@metamask-ci

metamask-ci Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor
Builds ready [d9f2104]
⚡ Performance Benchmarks (Total: 🟢 6 pass · 🟡 3 warn · 🔴 4 fail)

Baseline (latest main): f693520 | Date: 11/3/2026 | Pipeline: 41728022348 | 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/fcp: -15%
  • ↓ loadNewAccount/lcp: -15%
  • ↑ loadNewAccount/cls: +278%
  • ↑ confirmTx/longTaskTotalDuration: +28%
  • ↑ confirmTx/longTaskMaxDuration: +38%
  • ↑ confirmTx/tbt: +48%
  • ↓ confirmTx/inp: -29%
  • ↓ confirmTx/fcp: -14%
  • ↑ bridgeUserActions/bridge_load_page: +13%
  • ↑ bridgeUserActions/bridge_load_asset_picker: +58%
  • ↑ bridgeUserActions/longTaskCount: +36%
  • ↑ bridgeUserActions/longTaskTotalDuration: +25%
  • ↓ bridgeUserActions/longTaskMaxDuration: -16%
  • ↓ bridgeUserActions/fcp: -15%
  • ↑ bridgeUserActions/cls: +281%
  • ↑ loadNewAccount/load_new_account: +183%
  • ↑ loadNewAccount/total: +183%
  • ↓ loadNewAccount/fcp: -35%
  • ↑ loadNewAccount/lcp: +1254%
  • ↓ confirmTx/longTaskCount: -100%
  • ↓ confirmTx/longTaskTotalDuration: -100%
  • ↓ confirmTx/longTaskMaxDuration: -100%
  • ↓ confirmTx/tbt: -100%
  • ↓ confirmTx/inp: -13%
  • ↑ confirmTx/fcp: +18%
  • ↑ confirmTx/lcp: +1269%
  • ↑ bridgeUserActions/bridge_load_page: +193%
  • ↑ bridgeUserActions/bridge_load_asset_picker: +232%
  • ↑ bridgeUserActions/bridge_search_token: +17%
  • ↓ bridgeUserActions/longTaskCount: -100%
  • ↓ bridgeUserActions/longTaskTotalDuration: -100%
  • ↓ bridgeUserActions/longTaskMaxDuration: -100%
  • ↓ bridgeUserActions/tbt: -100%
  • ↑ bridgeUserActions/total: +62%
  • ↑ bridgeUserActions/inp: +62%
  • ↑ bridgeUserActions/fcp: +22%
  • ↑ bridgeUserActions/lcp: +1213%

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

  • 🟡 confirmTx/FCP: p75 2.0s
  • 🟡 bridgeUserActions/FCP: p75 2.1s
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: +10%
  • ↑ startupStandardHome/domInteractive: +14%
  • ↓ startupStandardHome/firstReactRender: -98%
  • ↓ startupStandardHome/initialActions: -29%
  • ↑ startupStandardHome/setupStore: +69%
  • ↓ startupStandardHome/longTaskCount: -29%
  • ↑ startupStandardHome/lcp: +13%
  • ↑ startupStandardHome/cls: +400%
  • ↑ startupStandardHome/domInteractive: +33%
  • ↓ startupStandardHome/firstReactRender: -99%
  • ↓ startupStandardHome/initialActions: -50%
  • ↑ startupStandardHome/setupStore: +132%
  • ↑ startupStandardHome/fcp: +34%
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: -18%
  • ↓ onboardingImportWallet/confirmSrpToPwForm: -18%
  • ↓ onboardingImportWallet/pwFormToMetricsScreen: -12%
  • ↓ onboardingImportWallet/metricsToWalletReadyScreen: -32%
  • ↓ onboardingImportWallet/doneButtonToHomeScreen: -92%
  • ↓ onboardingImportWallet/openAccountMenuToAccountListLoaded: -74%
  • ↓ onboardingImportWallet/longTaskCount: -100%
  • ↓ onboardingImportWallet/longTaskTotalDuration: -100%
  • ↓ onboardingImportWallet/longTaskMaxDuration: -100%
  • ↓ onboardingImportWallet/tbt: -100%
  • ↓ onboardingImportWallet/total: -86%
  • ↑ onboardingNewWallet/srpButtonToPwForm: +35%
  • ↑ onboardingNewWallet/createPwToRecoveryScreen: +24%
  • ↑ onboardingNewWallet/skipBackupToMetricsScreen: +20%
  • ↓ onboardingNewWallet/doneButtonToAssetList: -71%
  • ↓ onboardingNewWallet/longTaskCount: -62%
  • ↓ onboardingNewWallet/longTaskTotalDuration: -74%
  • ↓ onboardingNewWallet/longTaskMaxDuration: -37%
  • ↓ onboardingNewWallet/tbt: -100%
  • ↓ onboardingNewWallet/total: -67%
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: -49%
  • ↓ dappPageLoad/firstPaint: -28%
  • ↓ dappPageLoad/firstContentfulPaint: -28%
Bundle Size Diffs [🚨 Warning! Bundle size has increased!]
Status Bundle Total Diff Change
✅ background 15.26 MiB +24 Bytes 0.00%
🚨 ui 19.33 MiB +2.3 KiB +0.01%
✅ common 0 Bytes 0 Bytes 0.00%
✅ other 4.44 MiB +7 Bytes 0.00%
✅ content scripts 3.23 MiB +14 Bytes 0.00%
🚨 unzipped 79.9 MiB +5.45 KiB +0.01%
🚨 zip 24.07 MiB +2.18 KiB +0.01%

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

</>
) : null}
{/*
* An <input> does not size to its value, so a hidden copy of the amount

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

field-sizing: content would replace the hidden copy, but Firefox only shipped it in 152 and our strict_min_version is 128. The copy uses the same variant and inline size as the input, so the wrapper is exactly as wide as the typed amount and the $ sits right beside it in every browser. Once the Firefox minimum reaches 152 this can become a single <input>.

*
* @returns Spies and a `resize` helper. Call `restore` after each test.
*/
export function mockResizeObserver(): ResizeObserverMock {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jsdom has no ResizeObserver and every element measures 0px, so this mock lets tests report a width for a specific observed element through resize(width, target). Consumer tests use it to check the step at a given row width, and to assert that typing creates no new observers, without mocking HeroAmountInput itself.

@amandaye0h amandaye0h left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Font sizing, letter spacing, decimals and variants lgtm.

Strongly suggest implementing the per glyph motion as per this comment.

@amandaye0h amandaye0h left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving - hopefully we get the animations in for the following release

value,
onChange,
maxDecimals,
autoFocus = false,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

booleans default to false, so we can drop these

textColor = TextColor.TextMuted;
}

const { className: prefixClassName, ...restPrefixProps } = prefixProps ?? {};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this grows, maybe need start considering CVA

@georgewrmarshall
georgewrmarshall added this pull request to the merge queue Nov 5, 2026
Merged via the queue into main with commit 08c65c6 Nov 5, 2026
261 of 264 checks passed
@georgewrmarshall
georgewrmarshall deleted the cursor/grotzec-amount-input-scale-f3b4 branch November 5, 2026 16:56
runway-github Bot pushed a commit that referenced this pull request Nov 5, 2026
…3.57.0 (#47560)

<!-- CURSOR_AGENT_PR_BODY_BEGIN -->
Stacked on #47564 (shared font-size helper) — merge that first.

## **Description**

This is the @MetaMask/perps slice of the Grotzec large number amount
inputs. It was split from the UAT build in #47557, which has the full
plan, the input inventory and the risks.

- Ticket:
[TMCU-1744](https://consensyssoftware.atlassian.net/browse/TMCU-1744)
- Epic: [TMCU-1741 [Extension] Update large number amount inputs with
Grotzec](https://consensyssoftware.atlassian.net/browse/TMCU-1741)

**Depends on #47564** (the shared amount scale and
`useAmountInputFontSize` hook). This PR is stacked on #47564's branch
(`cursor/grotzec-amount-input-scale-f3b4`) and does not carry its own
copy of the helper, so its diff shows only this slice. Merge #47564
first, then retarget this PR to `main`.

**What is the reason for the change?** The Perps withdraw amount was
Inter at weight 500 and 64/40/30/20px. Perps balances and prices moved
to Grotzec in #47465. This input is the twin of the MM Pay
`CustomAmount`, which Mobile moves to Grotzec at 88px in
[#38135](MetaMask/metamask-mobile#38135).

**What is the improvement?**
- **MMDS `Input`.** The `<input>` is now the MMDS `Input`
(`textVariant={AmountDisplayLg}`, `font-hero`). The hidden-text
measuring pattern stays. The symbol and measuring element are MMDS
`Text` (`AmountDisplayLg` + `FontFamily.Hero`), so all three share the
same family, weight and size. The explicit `fontWeight: 500` is dropped,
as on Mobile.
- **Sizing: shared scale.** The withdraw amount uses the scale in #47564
(`ui/helpers/utils/amount-input-font-size.ts`), the same one used by
Swap/Bridge, Ramps Buy and the MM Pay amount. It has steps of 88, 72,
60, 48, 40, 32, 24 and 20px, takes the largest step at which `$` and the
amount fit the input's measured width (`useAmountInputFontSize`, one
`ResizeObserver` per input; 328px is only the fallback before the first
measurement), and sets line height equal to font size. In the expanded
view long amounts stay large instead of shrinking early. At the 328px
popup width, `$25` is 88px, `$1234567.89` is 72px and `$123456789012.34`
is 48px.
- **Mobile reference.** The 88px start, 88px row, 88px `rounded-lg`
skeleton and 20px floor match Mobile #38135. Mobile's MM Pay drops
straight from 88px to 40px; Extension steps down gradually so mid-length
amounts stay larger.
- **Twin stays in sync.** The local length-based `getFontSize` is
removed. Its twin, the confirmations `CustomAmount`, moves to the same
scale in #47565, so the two can no longer drift.

**Risks**
- The weight changes from 500 Inter to the Bold Grotzec cut. Perps is
USD only, and Grotzec has `$`, so there is no glyph fallback.

## **Changelog**

CHANGELOG entry: Updated the Perps withdraw amount input to the Grotzec
typeface

## **Related issues**

Fixes:
[TMCU-1744](https://consensyssoftware.atlassian.net/browse/TMCU-1744)

Epic:
[TMCU-1741](https://consensyssoftware.atlassian.net/browse/TMCU-1741)
Depends on: #47564
Related: #47565 (MM Pay custom amount twin)
Split from: #47557

## **Manual testing steps**

1. Load this branch in the extension, open Perps and choose Withdraw.
2. Confirm the loading skeleton is 88px tall with rounded corners.
3. Enter `25` and confirm it renders in Grotzec at 88px.
4. Type `123456789012.34` one key at a time and confirm the amount steps
down 88 → 72 → 60 → 48px and stays centred.
5. Enter more than the available balance and confirm the amount turns
red.
6. Repeat in the expanded view, where long amounts stay larger instead
of shrinking early, and in the side panel, where they step down smoothly
as the width narrows.

## **Screenshots/Recordings**

### Before / After by code owner

Before is `main` @adeaf9ad59 and After is the UAT head (#47557)
@28a7077e43, both recorded with the same typing script (type 5, then
500000000000000000, then clear).

#### Perps withdraw

| Before | After |
| --- | --- |
| <img width="360"
src="https://github.com/user-attachments/assets/bde0cc8d-a0a6-493e-81cd-6754ac6a0a82"
alt="Perps withdraw before, side panel"> | <img width="360"
src="https://github.com/user-attachments/assets/87e17271-f2a9-4b2e-824f-92456a58a3eb"
alt="Perps withdraw after, side panel"> |
| <img width="360"
src="https://github.com/user-attachments/assets/2c539038-48c1-4f5b-9ef4-85b21391df3b"
alt="Perps withdraw before, expanded view"> | <img width="360"
src="https://github.com/user-attachments/assets/cc7c54af-42e1-4bf9-bffc-92bd98312ead"
alt="Perps withdraw after, expanded view"> |

Full MP4s: [Side panel
before](https://github.com/user-attachments/assets/49c2722c-88e1-41fb-8ff3-1fda48319b85)
· [Side panel
after](https://github.com/user-attachments/assets/573cd199-f321-4b96-aab8-790349a292a6)
· [Expanded
before](https://github.com/user-attachments/assets/0595640d-d948-4c3f-9ec8-fb505f8f01f7)
· [Expanded
after](https://github.com/user-attachments/assets/85f918b1-09ec-4359-927d-705da4ed3405)

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.

<!-- CURSOR_AGENT_PR_BODY_END -->

<div><a
href="https://cursor.com/agents/bc-b3180cce-a244-5330-95e3-35b5951ff3b4?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a
href="https://cursor.com/background-agent?bcId=bc-b3180cce-a244-5330-95e3-35b5951ff3b4&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img
alt="Open in Cursor" width="131" height="28"
src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</div>



[TMCU-1744]:
https://consensyssoftware.atlassian.net/browse/TMCU-1744?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[TMCU-1744]:
https://consensyssoftware.atlassian.net/browse/TMCU-1744?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Scoped UI swap on the Perps withdraw amount field with no changes to
withdrawal submission, balance guards, or backend calls.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
52d1e02. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
runway-github Bot added a commit that referenced this pull request Nov 5, 2026
…3.57.0 (#47560)

<!-- CURSOR_AGENT_PR_BODY_BEGIN -->
Stacked on #47564 (shared font-size helper) — merge that first.

## **Description**

This is the @MetaMask/perps slice of the Grotzec large number amount
inputs. It was split from the UAT build in #47557, which has the full
plan, the input inventory and the risks.

- Ticket:
[TMCU-1744](https://consensyssoftware.atlassian.net/browse/TMCU-1744)
- Epic: [TMCU-1741 [Extension] Update large number amount inputs with
Grotzec](https://consensyssoftware.atlassian.net/browse/TMCU-1741)

**Depends on #47564** (the shared amount scale and
`useAmountInputFontSize` hook). This PR is stacked on #47564's branch
(`cursor/grotzec-amount-input-scale-f3b4`) and does not carry its own
copy of the helper, so its diff shows only this slice. Merge #47564
first, then retarget this PR to `main`.

**What is the reason for the change?** The Perps withdraw amount was
Inter at weight 500 and 64/40/30/20px. Perps balances and prices moved
to Grotzec in #47465. This input is the twin of the MM Pay
`CustomAmount`, which Mobile moves to Grotzec at 88px in
[#38135](MetaMask/metamask-mobile#38135).

**What is the improvement?**
- **MMDS `Input`.** The `<input>` is now the MMDS `Input`
(`textVariant={AmountDisplayLg}`, `font-hero`). The hidden-text
measuring pattern stays. The symbol and measuring element are MMDS
`Text` (`AmountDisplayLg` + `FontFamily.Hero`), so all three share the
same family, weight and size. The explicit `fontWeight: 500` is dropped,
as on Mobile.
- **Sizing: shared scale.** The withdraw amount uses the scale in #47564
(`ui/helpers/utils/amount-input-font-size.ts`), the same one used by
Swap/Bridge, Ramps Buy and the MM Pay amount. It has steps of 88, 72,
60, 48, 40, 32, 24 and 20px, takes the largest step at which `$` and the
amount fit the input's measured width (`useAmountInputFontSize`, one
`ResizeObserver` per input; 328px is only the fallback before the first
measurement), and sets line height equal to font size. In the expanded
view long amounts stay large instead of shrinking early. At the 328px
popup width, `$25` is 88px, `$1234567.89` is 72px and `$123456789012.34`
is 48px.
- **Mobile reference.** The 88px start, 88px row, 88px `rounded-lg`
skeleton and 20px floor match Mobile #38135. Mobile's MM Pay drops
straight from 88px to 40px; Extension steps down gradually so mid-length
amounts stay larger.
- **Twin stays in sync.** The local length-based `getFontSize` is
removed. Its twin, the confirmations `CustomAmount`, moves to the same
scale in #47565, so the two can no longer drift.

**Risks**
- The weight changes from 500 Inter to the Bold Grotzec cut. Perps is
USD only, and Grotzec has `$`, so there is no glyph fallback.

## **Changelog**

CHANGELOG entry: Updated the Perps withdraw amount input to the Grotzec
typeface

## **Related issues**

Fixes:
[TMCU-1744](https://consensyssoftware.atlassian.net/browse/TMCU-1744)

Epic:
[TMCU-1741](https://consensyssoftware.atlassian.net/browse/TMCU-1741)
Depends on: #47564
Related: #47565 (MM Pay custom amount twin)
Split from: #47557

## **Manual testing steps**

1. Load this branch in the extension, open Perps and choose Withdraw.
2. Confirm the loading skeleton is 88px tall with rounded corners.
3. Enter `25` and confirm it renders in Grotzec at 88px.
4. Type `123456789012.34` one key at a time and confirm the amount steps
down 88 → 72 → 60 → 48px and stays centred.
5. Enter more than the available balance and confirm the amount turns
red.
6. Repeat in the expanded view, where long amounts stay larger instead
of shrinking early, and in the side panel, where they step down smoothly
as the width narrows.

## **Screenshots/Recordings**

### Before / After by code owner

Before is `main` @adeaf9ad59 and After is the UAT head (#47557)
@28a7077e43, both recorded with the same typing script (type 5, then
500000000000000000, then clear).

#### Perps withdraw

| Before | After |
| --- | --- |
| <img width="360"
src="https://github.com/user-attachments/assets/bde0cc8d-a0a6-493e-81cd-6754ac6a0a82"
alt="Perps withdraw before, side panel"> | <img width="360"
src="https://github.com/user-attachments/assets/87e17271-f2a9-4b2e-824f-92456a58a3eb"
alt="Perps withdraw after, side panel"> |
| <img width="360"
src="https://github.com/user-attachments/assets/2c539038-48c1-4f5b-9ef4-85b21391df3b"
alt="Perps withdraw before, expanded view"> | <img width="360"
src="https://github.com/user-attachments/assets/cc7c54af-42e1-4bf9-bffc-92bd98312ead"
alt="Perps withdraw after, expanded view"> |

Full MP4s: [Side panel
before](https://github.com/user-attachments/assets/49c2722c-88e1-41fb-8ff3-1fda48319b85)
· [Side panel
after](https://github.com/user-attachments/assets/573cd199-f321-4b96-aab8-790349a292a6)
· [Expanded
before](https://github.com/user-attachments/assets/0595640d-d948-4c3f-9ec8-fb505f8f01f7)
· [Expanded
after](https://github.com/user-attachments/assets/85f918b1-09ec-4359-927d-705da4ed3405)

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.

<!-- CURSOR_AGENT_PR_BODY_END -->

<div><a
href="https://cursor.com/agents/bc-b3180cce-a244-5330-95e3-35b5951ff3b4?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a
href="https://cursor.com/background-agent?bcId=bc-b3180cce-a244-5330-95e3-35b5951ff3b4&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img
alt="Open in Cursor" width="131" height="28"
src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</div>

[TMCU-1744]:
https://consensyssoftware.atlassian.net/browse/TMCU-1744?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[TMCU-1744]:
https://consensyssoftware.atlassian.net/browse/TMCU-1744?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Scoped UI swap on the Perps withdraw amount field with no changes to
withdrawal submission, balance guards, or backend calls.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
52d1e02. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
runway-github Bot pushed a commit that referenced this pull request Nov 5, 2026
…put in Grotzec Hero cp-13.57.0 (#47560)

<!-- CURSOR_AGENT_PR_BODY_BEGIN -->
Stacked on #47564 (shared font-size helper) — merge that first.

## **Description**

This is the @MetaMask/perps slice of the Grotzec large number amount
inputs. It was split from the UAT build in #47557, which has the full
plan, the input inventory and the risks.

- Ticket:
[TMCU-1744](https://consensyssoftware.atlassian.net/browse/TMCU-1744)
- Epic: [TMCU-1741 [Extension] Update large number amount inputs with
Grotzec](https://consensyssoftware.atlassian.net/browse/TMCU-1741)

**Depends on #47564** (the shared amount scale and
`useAmountInputFontSize` hook). This PR is stacked on #47564's branch
(`cursor/grotzec-amount-input-scale-f3b4`) and does not carry its own
copy of the helper, so its diff shows only this slice. Merge #47564
first, then retarget this PR to `main`.

**What is the reason for the change?** The Perps withdraw amount was
Inter at weight 500 and 64/40/30/20px. Perps balances and prices moved
to Grotzec in #47465. This input is the twin of the MM Pay
`CustomAmount`, which Mobile moves to Grotzec at 88px in
[#38135](MetaMask/metamask-mobile#38135).

**What is the improvement?**
- **MMDS `Input`.** The `<input>` is now the MMDS `Input`
(`textVariant={AmountDisplayLg}`, `font-hero`). The hidden-text
measuring pattern stays. The symbol and measuring element are MMDS
`Text` (`AmountDisplayLg` + `FontFamily.Hero`), so all three share the
same family, weight and size. The explicit `fontWeight: 500` is dropped,
as on Mobile.
- **Sizing: shared scale.** The withdraw amount uses the scale in #47564
(`ui/helpers/utils/amount-input-font-size.ts`), the same one used by
Swap/Bridge, Ramps Buy and the MM Pay amount. It has steps of 88, 72,
60, 48, 40, 32, 24 and 20px, takes the largest step at which `$` and the
amount fit the input's measured width (`useAmountInputFontSize`, one
`ResizeObserver` per input; 328px is only the fallback before the first
measurement), and sets line height equal to font size. In the expanded
view long amounts stay large instead of shrinking early. At the 328px
popup width, `$25` is 88px, `$1234567.89` is 72px and `$123456789012.34`
is 48px.
- **Mobile reference.** The 88px start, 88px row, 88px `rounded-lg`
skeleton and 20px floor match Mobile #38135. Mobile's MM Pay drops
straight from 88px to 40px; Extension steps down gradually so mid-length
amounts stay larger.
- **Twin stays in sync.** The local length-based `getFontSize` is
removed. Its twin, the confirmations `CustomAmount`, moves to the same
scale in #47565, so the two can no longer drift.

**Risks**
- The weight changes from 500 Inter to the Bold Grotzec cut. Perps is
USD only, and Grotzec has `$`, so there is no glyph fallback.

## **Changelog**

CHANGELOG entry: Updated the Perps withdraw amount input to the Grotzec
typeface

## **Related issues**

Fixes:
[TMCU-1744](https://consensyssoftware.atlassian.net/browse/TMCU-1744)

Epic:
[TMCU-1741](https://consensyssoftware.atlassian.net/browse/TMCU-1741)
Depends on: #47564
Related: #47565 (MM Pay custom amount twin)
Split from: #47557

## **Manual testing steps**

1. Load this branch in the extension, open Perps and choose Withdraw.
2. Confirm the loading skeleton is 88px tall with rounded corners.
3. Enter `25` and confirm it renders in Grotzec at 88px.
4. Type `123456789012.34` one key at a time and confirm the amount steps
down 88 → 72 → 60 → 48px and stays centred.
5. Enter more than the available balance and confirm the amount turns
red.
6. Repeat in the expanded view, where long amounts stay larger instead
of shrinking early, and in the side panel, where they step down smoothly
as the width narrows.

## **Screenshots/Recordings**

### Before / After by code owner

Before is `main` @adeaf9ad59 and After is the UAT head (#47557)
@28a7077e43, both recorded with the same typing script (type 5, then
500000000000000000, then clear).

#### Perps withdraw

| Before | After |
| --- | --- |
| <img width="360"
src="https://github.com/user-attachments/assets/bde0cc8d-a0a6-493e-81cd-6754ac6a0a82"
alt="Perps withdraw before, side panel"> | <img width="360"
src="https://github.com/user-attachments/assets/87e17271-f2a9-4b2e-824f-92456a58a3eb"
alt="Perps withdraw after, side panel"> |
| <img width="360"
src="https://github.com/user-attachments/assets/2c539038-48c1-4f5b-9ef4-85b21391df3b"
alt="Perps withdraw before, expanded view"> | <img width="360"
src="https://github.com/user-attachments/assets/cc7c54af-42e1-4bf9-bffc-92bd98312ead"
alt="Perps withdraw after, expanded view"> |

Full MP4s: [Side panel
before](https://github.com/user-attachments/assets/49c2722c-88e1-41fb-8ff3-1fda48319b85)
· [Side panel
after](https://github.com/user-attachments/assets/573cd199-f321-4b96-aab8-790349a292a6)
· [Expanded
before](https://github.com/user-attachments/assets/0595640d-d948-4c3f-9ec8-fb505f8f01f7)
· [Expanded
after](https://github.com/user-attachments/assets/85f918b1-09ec-4359-927d-705da4ed3405)

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.

<!-- CURSOR_AGENT_PR_BODY_END -->

<div><a
href="https://cursor.com/agents/bc-b3180cce-a244-5330-95e3-35b5951ff3b4?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a
href="https://cursor.com/background-agent?bcId=bc-b3180cce-a244-5330-95e3-35b5951ff3b4&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img
alt="Open in Cursor" width="131" height="28"
src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</div>



[TMCU-1744]:
https://consensyssoftware.atlassian.net/browse/TMCU-1744?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[TMCU-1744]:
https://consensyssoftware.atlassian.net/browse/TMCU-1744?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Scoped UI swap on the Perps withdraw amount field with no changes to
withdrawal submission, balance guards, or backend calls.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
52d1e02. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
runway-github Bot pushed a commit that referenced this pull request Nov 5, 2026
…zec Hero cp-13.57.0 (#47565)

<!-- CURSOR_AGENT_PR_BODY_BEGIN -->
Stacked on #47564 (shared font-size helper) — merge that first.

## **Description**

This is the @MetaMask/confirmations slice of the Grotzec large number
amount inputs. It was split from the UAT build in #47557.

- Epic: [TMCU-1741 [Extension] Update large number amount inputs with
Grotzec](https://consensyssoftware.atlassian.net/browse/TMCU-1741)
- Ticket: a child ticket of
[TMCU-1741](https://consensyssoftware.atlassian.net/browse/TMCU-1741) is
still to be created for the MM Pay custom amount.

**Depends on #47564** (the shared amount scale and
`useAmountInputFontSize` hook). This PR is stacked on #47564's branch
(`cursor/grotzec-amount-input-scale-f3b4`) and does not carry its own
copy of the helper, so its diff shows only this slice. Merge #47564
first, then retarget this PR to `main`.

**What is the reason for the change?** `CustomAmount`
(`ui/pages/confirmations/components/transactions/custom-amount/custom-amount.tsx`)
is the MM Pay hero amount. It is used by Perps deposit, the Perps
withdraw confirmation, mUSD conversion and Money account deposit and
withdraw. It was still Inter at weight 500, sized 64/40/30/20px with
line heights 70/44/33/22px, using legacy component-library `Text` and a
raw `<input>` sized in `ch`. Mobile moves the same component to Grotzec
in [#38135](MetaMask/metamask-mobile#38135).

**What is the improvement?**
- **MMDS `Input`.** The `<input>` is now the MMDS `Input`
(`textVariant={AmountDisplayLg}`, `font-hero`, `isStateStylesDisabled`).
The symbol is MMDS `Text` `AmountDisplayLg` + `FontFamily.Hero`.
- **Width.** The `ch` estimate is replaced with the hidden measuring
`Text` that its Perps twin (`PerpsFiatHeroAmountInput`) uses. The
measuring `Text` is set in the same font, so the input width is exact
for Grotzec and for fallback symbols.
- **Sizing.** Sizes come from the shared scale in #47564: 88, 72, 60,
48, 40, 32, 24, 20px, taking the largest step at which the symbol and
amount fit the input's measured width (`useAmountInputFontSize`, one
`ResizeObserver` per input; 328px is only the fallback before the first
measurement). Line height equals font size. In the expanded view long
amounts stay large instead of shrinking early. At the 328px popup width,
`$25` is 88px, `$1234567.89` is 72px and a 20-digit amount is 32px. The
row and the `rounded-lg` skeleton are both 88px, as in Mobile #38135.
- **Unchanged.** Test IDs (`custom-amount-input`,
`custom-amount-symbol`, `custom-amount-skeleton`), cents-only display,
the 2-decimal input pattern, `autoFocus` and the alert and disabled
colours are unchanged. The E2E page objects use the same test IDs.

**Risks**
- This changes the hero on five confirmation flows at once: Perps
deposit, Perps withdraw, mUSD conversion, and Money deposit and
withdraw.
- Symbols Grotzec lacks (₹ ₩ ₿ …) render in the fallback family. The
shared scale budgets for their extra width.
- The weight changes from 500 Inter to the Bold Grotzec cut.

## **Changelog**

CHANGELOG entry: Updated the MetaMask Pay amount input to the Grotzec
typeface

## **Related issues**

Epic:
[TMCU-1741](https://consensyssoftware.atlassian.net/browse/TMCU-1741). A
child ticket is still to be created.
Depends on: #47564
Split from: #47557

## **Manual testing steps**

1. Load this branch in the extension.
2. Start a Perps deposit. Confirm the amount is Grotzec at 88px for
`25`. Then type `123456789012.34` one key at a time and confirm it steps
down 88 → 72 → 60 → 48px and stays centred.
3. Click Max or a percentage and confirm the amount shows at most 2
decimals.
4. Enter more than the balance and confirm the amount turns red.
5. Repeat the short and long amount check in mUSD conversion and in
Money account deposit and withdraw.
6. Repeat in the expanded view, where long amounts stay larger instead
of shrinking early, and in the side panel, where they step down smoothly
as the width narrows.

## **Screenshots/Recordings**

### Before / After by code owner

Before is `main` @adeaf9ad59 and After is the UAT head (#47557)
@28a7077e43, both recorded with the same typing script (type 5, then
500000000000000000, then clear).

#### MM Pay custom amount

| Before | After |
| --- | --- |
| <img width="360"
src="https://github.com/user-attachments/assets/ce28237e-b7de-4816-9a62-4dfab0d2577d"
alt="MM Pay custom amount before, side panel"> | <img width="360"
src="https://github.com/user-attachments/assets/10617750-5f69-4a1a-8700-a1e1ebef52be"
alt="MM Pay custom amount after, side panel"> |
| <img width="360"
src="https://github.com/user-attachments/assets/a30507a6-420a-4c2a-b240-0176ec1c8f3c"
alt="MM Pay custom amount before, expanded view"> | <img width="360"
src="https://github.com/user-attachments/assets/7d9fbaf6-c0d0-4590-bac4-4d724808e4da"
alt="MM Pay custom amount after, expanded view"> |

Full MP4s: [Side panel
before](https://github.com/user-attachments/assets/940444b2-140e-47f1-ae07-ad0e2a79fb68)
· [Side panel
after](https://github.com/user-attachments/assets/b754992c-b785-4fe0-a25c-50da625a0453)
· [Expanded
before](https://github.com/user-attachments/assets/377356c2-15f9-4d26-9572-af2ee51624e0)
· [Expanded
after](https://github.com/user-attachments/assets/96562d58-8e05-4ebb-99bf-0285eaf55c1b)

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.

<!-- CURSOR_AGENT_PR_BODY_END -->

<div><a
href="https://cursor.com/agents/bc-b3180cce-a244-5330-95e3-35b5951ff3b4?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a
href="https://cursor.com/background-agent?bcId=bc-b3180cce-a244-5330-95e3-35b5951ff3b4&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img
alt="Open in Cursor" width="131" height="28"
src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</div>



[TMCU-1741]:
https://consensyssoftware.atlassian.net/browse/TMCU-1741?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[TMCU-1741]:
https://consensyssoftware.atlassian.net/browse/TMCU-1741?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> The same hero control drives several MM Pay confirmation flows; visual
and sizing behavior change via the shared component, though fiat display
rules and input constraints stay equivalent.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
30842bf. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
runway-github Bot added a commit that referenced this pull request Nov 5, 2026
…zec Hero cp-13.57.0 (#47565)

<!-- CURSOR_AGENT_PR_BODY_BEGIN -->
Stacked on #47564 (shared font-size helper) — merge that first.

## **Description**

This is the @MetaMask/confirmations slice of the Grotzec large number
amount inputs. It was split from the UAT build in #47557.

- Epic: [TMCU-1741 [Extension] Update large number amount inputs with
Grotzec](https://consensyssoftware.atlassian.net/browse/TMCU-1741)
- Ticket: a child ticket of
[TMCU-1741](https://consensyssoftware.atlassian.net/browse/TMCU-1741) is
still to be created for the MM Pay custom amount.

**Depends on #47564** (the shared amount scale and
`useAmountInputFontSize` hook). This PR is stacked on #47564's branch
(`cursor/grotzec-amount-input-scale-f3b4`) and does not carry its own
copy of the helper, so its diff shows only this slice. Merge #47564
first, then retarget this PR to `main`.

**What is the reason for the change?** `CustomAmount`
(`ui/pages/confirmations/components/transactions/custom-amount/custom-amount.tsx`)
is the MM Pay hero amount. It is used by Perps deposit, the Perps
withdraw confirmation, mUSD conversion and Money account deposit and
withdraw. It was still Inter at weight 500, sized 64/40/30/20px with
line heights 70/44/33/22px, using legacy component-library `Text` and a
raw `<input>` sized in `ch`. Mobile moves the same component to Grotzec
in [#38135](MetaMask/metamask-mobile#38135).

**What is the improvement?**
- **MMDS `Input`.** The `<input>` is now the MMDS `Input`
(`textVariant={AmountDisplayLg}`, `font-hero`, `isStateStylesDisabled`).
The symbol is MMDS `Text` `AmountDisplayLg` + `FontFamily.Hero`.
- **Width.** The `ch` estimate is replaced with the hidden measuring
`Text` that its Perps twin (`PerpsFiatHeroAmountInput`) uses. The
measuring `Text` is set in the same font, so the input width is exact
for Grotzec and for fallback symbols.
- **Sizing.** Sizes come from the shared scale in #47564: 88, 72, 60,
48, 40, 32, 24, 20px, taking the largest step at which the symbol and
amount fit the input's measured width (`useAmountInputFontSize`, one
`ResizeObserver` per input; 328px is only the fallback before the first
measurement). Line height equals font size. In the expanded view long
amounts stay large instead of shrinking early. At the 328px popup width,
`$25` is 88px, `$1234567.89` is 72px and a 20-digit amount is 32px. The
row and the `rounded-lg` skeleton are both 88px, as in Mobile #38135.
- **Unchanged.** Test IDs (`custom-amount-input`,
`custom-amount-symbol`, `custom-amount-skeleton`), cents-only display,
the 2-decimal input pattern, `autoFocus` and the alert and disabled
colours are unchanged. The E2E page objects use the same test IDs.

**Risks**
- This changes the hero on five confirmation flows at once: Perps
deposit, Perps withdraw, mUSD conversion, and Money deposit and
withdraw.
- Symbols Grotzec lacks (₹ ₩ ₿ …) render in the fallback family. The
shared scale budgets for their extra width.
- The weight changes from 500 Inter to the Bold Grotzec cut.

## **Changelog**

CHANGELOG entry: Updated the MetaMask Pay amount input to the Grotzec
typeface

## **Related issues**

Epic:
[TMCU-1741](https://consensyssoftware.atlassian.net/browse/TMCU-1741). A
child ticket is still to be created.
Depends on: #47564
Split from: #47557

## **Manual testing steps**

1. Load this branch in the extension.
2. Start a Perps deposit. Confirm the amount is Grotzec at 88px for
`25`. Then type `123456789012.34` one key at a time and confirm it steps
down 88 → 72 → 60 → 48px and stays centred.
3. Click Max or a percentage and confirm the amount shows at most 2
decimals.
4. Enter more than the balance and confirm the amount turns red.
5. Repeat the short and long amount check in mUSD conversion and in
Money account deposit and withdraw.
6. Repeat in the expanded view, where long amounts stay larger instead
of shrinking early, and in the side panel, where they step down smoothly
as the width narrows.

## **Screenshots/Recordings**

### Before / After by code owner

Before is `main` @adeaf9ad59 and After is the UAT head (#47557)
@28a7077e43, both recorded with the same typing script (type 5, then
500000000000000000, then clear).

#### MM Pay custom amount

| Before | After |
| --- | --- |
| <img width="360"
src="https://github.com/user-attachments/assets/ce28237e-b7de-4816-9a62-4dfab0d2577d"
alt="MM Pay custom amount before, side panel"> | <img width="360"
src="https://github.com/user-attachments/assets/10617750-5f69-4a1a-8700-a1e1ebef52be"
alt="MM Pay custom amount after, side panel"> |
| <img width="360"
src="https://github.com/user-attachments/assets/a30507a6-420a-4c2a-b240-0176ec1c8f3c"
alt="MM Pay custom amount before, expanded view"> | <img width="360"
src="https://github.com/user-attachments/assets/7d9fbaf6-c0d0-4590-bac4-4d724808e4da"
alt="MM Pay custom amount after, expanded view"> |

Full MP4s: [Side panel
before](https://github.com/user-attachments/assets/940444b2-140e-47f1-ae07-ad0e2a79fb68)
· [Side panel
after](https://github.com/user-attachments/assets/b754992c-b785-4fe0-a25c-50da625a0453)
· [Expanded
before](https://github.com/user-attachments/assets/377356c2-15f9-4d26-9572-af2ee51624e0)
· [Expanded
after](https://github.com/user-attachments/assets/96562d58-8e05-4ebb-99bf-0285eaf55c1b)

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.

<!-- CURSOR_AGENT_PR_BODY_END -->

<div><a
href="https://cursor.com/agents/bc-b3180cce-a244-5330-95e3-35b5951ff3b4?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a
href="https://cursor.com/background-agent?bcId=bc-b3180cce-a244-5330-95e3-35b5951ff3b4&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img
alt="Open in Cursor" width="131" height="28"
src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</div>

[TMCU-1741]:
https://consensyssoftware.atlassian.net/browse/TMCU-1741?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[TMCU-1741]:
https://consensyssoftware.atlassian.net/browse/TMCU-1741?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> The same hero control drives several MM Pay confirmation flows; visual
and sizing behavior change via the shared component, though fiat display
rules and input constraints stay equivalent.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
30842bf. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
runway-github Bot pushed a commit that referenced this pull request Nov 5, 2026
…tom amount input in Grotzec Hero cp-13.57.0 (#47565)

<!-- CURSOR_AGENT_PR_BODY_BEGIN -->
Stacked on #47564 (shared font-size helper) — merge that first.

## **Description**

This is the @MetaMask/confirmations slice of the Grotzec large number
amount inputs. It was split from the UAT build in #47557.

- Epic: [TMCU-1741 [Extension] Update large number amount inputs with
Grotzec](https://consensyssoftware.atlassian.net/browse/TMCU-1741)
- Ticket: a child ticket of
[TMCU-1741](https://consensyssoftware.atlassian.net/browse/TMCU-1741) is
still to be created for the MM Pay custom amount.

**Depends on #47564** (the shared amount scale and
`useAmountInputFontSize` hook). This PR is stacked on #47564's branch
(`cursor/grotzec-amount-input-scale-f3b4`) and does not carry its own
copy of the helper, so its diff shows only this slice. Merge #47564
first, then retarget this PR to `main`.

**What is the reason for the change?** `CustomAmount`
(`ui/pages/confirmations/components/transactions/custom-amount/custom-amount.tsx`)
is the MM Pay hero amount. It is used by Perps deposit, the Perps
withdraw confirmation, mUSD conversion and Money account deposit and
withdraw. It was still Inter at weight 500, sized 64/40/30/20px with
line heights 70/44/33/22px, using legacy component-library `Text` and a
raw `<input>` sized in `ch`. Mobile moves the same component to Grotzec
in [#38135](MetaMask/metamask-mobile#38135).

**What is the improvement?**
- **MMDS `Input`.** The `<input>` is now the MMDS `Input`
(`textVariant={AmountDisplayLg}`, `font-hero`, `isStateStylesDisabled`).
The symbol is MMDS `Text` `AmountDisplayLg` + `FontFamily.Hero`.
- **Width.** The `ch` estimate is replaced with the hidden measuring
`Text` that its Perps twin (`PerpsFiatHeroAmountInput`) uses. The
measuring `Text` is set in the same font, so the input width is exact
for Grotzec and for fallback symbols.
- **Sizing.** Sizes come from the shared scale in #47564: 88, 72, 60,
48, 40, 32, 24, 20px, taking the largest step at which the symbol and
amount fit the input's measured width (`useAmountInputFontSize`, one
`ResizeObserver` per input; 328px is only the fallback before the first
measurement). Line height equals font size. In the expanded view long
amounts stay large instead of shrinking early. At the 328px popup width,
`$25` is 88px, `$1234567.89` is 72px and a 20-digit amount is 32px. The
row and the `rounded-lg` skeleton are both 88px, as in Mobile #38135.
- **Unchanged.** Test IDs (`custom-amount-input`,
`custom-amount-symbol`, `custom-amount-skeleton`), cents-only display,
the 2-decimal input pattern, `autoFocus` and the alert and disabled
colours are unchanged. The E2E page objects use the same test IDs.

**Risks**
- This changes the hero on five confirmation flows at once: Perps
deposit, Perps withdraw, mUSD conversion, and Money deposit and
withdraw.
- Symbols Grotzec lacks (₹ ₩ ₿ …) render in the fallback family. The
shared scale budgets for their extra width.
- The weight changes from 500 Inter to the Bold Grotzec cut.

## **Changelog**

CHANGELOG entry: Updated the MetaMask Pay amount input to the Grotzec
typeface

## **Related issues**

Epic:
[TMCU-1741](https://consensyssoftware.atlassian.net/browse/TMCU-1741). A
child ticket is still to be created.
Depends on: #47564
Split from: #47557

## **Manual testing steps**

1. Load this branch in the extension.
2. Start a Perps deposit. Confirm the amount is Grotzec at 88px for
`25`. Then type `123456789012.34` one key at a time and confirm it steps
down 88 → 72 → 60 → 48px and stays centred.
3. Click Max or a percentage and confirm the amount shows at most 2
decimals.
4. Enter more than the balance and confirm the amount turns red.
5. Repeat the short and long amount check in mUSD conversion and in
Money account deposit and withdraw.
6. Repeat in the expanded view, where long amounts stay larger instead
of shrinking early, and in the side panel, where they step down smoothly
as the width narrows.

## **Screenshots/Recordings**

### Before / After by code owner

Before is `main` @adeaf9ad59 and After is the UAT head (#47557)
@28a7077e43, both recorded with the same typing script (type 5, then
500000000000000000, then clear).

#### MM Pay custom amount

| Before | After |
| --- | --- |
| <img width="360"
src="https://github.com/user-attachments/assets/ce28237e-b7de-4816-9a62-4dfab0d2577d"
alt="MM Pay custom amount before, side panel"> | <img width="360"
src="https://github.com/user-attachments/assets/10617750-5f69-4a1a-8700-a1e1ebef52be"
alt="MM Pay custom amount after, side panel"> |
| <img width="360"
src="https://github.com/user-attachments/assets/a30507a6-420a-4c2a-b240-0176ec1c8f3c"
alt="MM Pay custom amount before, expanded view"> | <img width="360"
src="https://github.com/user-attachments/assets/7d9fbaf6-c0d0-4590-bac4-4d724808e4da"
alt="MM Pay custom amount after, expanded view"> |

Full MP4s: [Side panel
before](https://github.com/user-attachments/assets/940444b2-140e-47f1-ae07-ad0e2a79fb68)
· [Side panel
after](https://github.com/user-attachments/assets/b754992c-b785-4fe0-a25c-50da625a0453)
· [Expanded
before](https://github.com/user-attachments/assets/377356c2-15f9-4d26-9572-af2ee51624e0)
· [Expanded
after](https://github.com/user-attachments/assets/96562d58-8e05-4ebb-99bf-0285eaf55c1b)

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.

<!-- CURSOR_AGENT_PR_BODY_END -->

<div><a
href="https://cursor.com/agents/bc-b3180cce-a244-5330-95e3-35b5951ff3b4?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a
href="https://cursor.com/background-agent?bcId=bc-b3180cce-a244-5330-95e3-35b5951ff3b4&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img
alt="Open in Cursor" width="131" height="28"
src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</div>



[TMCU-1741]:
https://consensyssoftware.atlassian.net/browse/TMCU-1741?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[TMCU-1741]:
https://consensyssoftware.atlassian.net/browse/TMCU-1741?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> The same hero control drives several MM Pay confirmation flows; visual
and sizing behavior change via the shared component, though fiat display
rules and input constraints stay equivalent.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
30842bf. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
LabinatorSolutions pushed a commit to LabinatorSolutions/metamask-extension that referenced this pull request Nov 6, 2026
…taMask#47559)

<!-- CURSOR_AGENT_PR_BODY_BEGIN -->
Stacked on MetaMask#47564 (shared font-size helper) — merge that first.

## **Description**

This is the @MetaMask/money-movement slice of the Grotzec large number
amount inputs. It was split from the UAT build in MetaMask#47557, which has the
full plan, the input inventory and the risks.

- Ticket:
[TMCU-1743](https://consensyssoftware.atlassian.net/browse/TMCU-1743)
- Epic: [TMCU-1741 [Extension] Update large number amount inputs with
Grotzec](https://consensyssoftware.atlassian.net/browse/TMCU-1741)

**Depends on MetaMask#47564** (the shared amount scale and
`useAmountInputFontSize` hook). This PR is stacked on MetaMask#47564's branch
(`cursor/grotzec-amount-input-scale-f3b4`) and does not carry its own
copy of the helper, so its diff shows only this slice. Merge MetaMask#47564
first, then retarget this PR to `main`.

**What is the reason for the change?** The Buy amount was a fixed 56px
Inter (`text-[56px] font-normal leading-none`) with no shrink by length.
Mobile's Ramp quote screen
([MetaMask#38406](MetaMask/metamask-mobile#38406)) moves
the same amount to Grotzec, starting at 88px.

**What is the improvement?**
- **MMDS `Input`.** The `<input>` is now the MMDS `Input`
(`textVariant={AmountDisplayLg}`, `font-hero`). The hidden-text
measuring pattern stays. The symbol and measuring element are MMDS
`Text` (`AmountDisplayLg` + `FontFamily.Hero`), so all three share the
same family, weight, tracking and size.
- **Sizing: shared scale.** The Buy amount uses the scale in MetaMask#47564
(`ui/helpers/utils/amount-input-font-size.ts`), the same one used by
Swap/Bridge, Perps withdraw and the MM Pay amount. It has steps of 88,
72, 60, 48, 40, 32, 24 and 20px, takes the largest step at which the
symbol and amount fit the row's measured width
(`useAmountInputFontSize`, one `ResizeObserver` per input; 328px is only
the fallback before the first measurement), and sets line height equal
to font size. At the 328px popup width, `$100` is 88px and `$1234567.89`
is 72px. In the expanded view long amounts stay large instead of
shrinking early. The 88px start matches Mobile MetaMask#38406. The fixed steps
follow the gradual shape of Mobile's per-character curve, and the floor
is MM Pay's 20px.
- **KRW fix.** The scale estimates width per character from measured
Grotzec widths, and counts fallback symbols such as ₩ (0.94em) at 1em. A
10-digit KRW amount (`₩1234567890`) now drops to 60px in the popup and
fits the row. Before, the character count kept it at 64px and it spilled
about 7px over.
- **Stable layout.** The amount row is pinned at 88px, the largest step,
so the payment pill doesn't move as the amount shrinks, as on Mobile.
- **View model.** `amountTextClassName` (which carried the fixed
`text-[56px]`) is replaced by `hasAmountError`. The view picks the size
with `useAmountInputFontSize` on the amount row.

**Risks**
- Grotzec has `$` `€` `£` `¥` but no ₹ ₩ ₽ ₺ ₦ ₱ ₫ ฿ ₪. Those symbols
fall back per character to `'Helvetica Neue', Helvetica, Arial`, as on
Mobile. The measuring element uses the same stack, so the input width
stays exact.
- The weight changes from 400 Inter to the Bold Grotzec cut.
- Snapshot updated:
`ramps/build-quote/__snapshots__/build-quote.test.tsx.snap`.

## **Changelog**

CHANGELOG entry: Updated the Buy amount input to the Grotzec typeface

## **Related issues**

Fixes:
[TMCU-1743](https://consensyssoftware.atlassian.net/browse/TMCU-1743)

Epic:
[TMCU-1741](https://consensyssoftware.atlassian.net/browse/TMCU-1741)
Depends on: MetaMask#47564
Split from: MetaMask#47557

## **Manual testing steps**

1. Load this branch in the extension and open Buy for any token.
2. Confirm `$100` renders in Grotzec at 88px.
3. Type `1234567.89` one key at a time and confirm the amount steps down
to 72px without the payment pill moving.
4. Trigger a quote error and confirm the symbol and amount turn red.
5. Switch the region or currency to KRW and type `1234567890`. Confirm
the amount fits the row at 60px. Check INR and EUR symbols too.
6. Repeat in the expanded view, where long amounts stay larger instead
of shrinking early, and in the side panel, where they step down smoothly
as the width narrows.

## **Screenshots/Recordings**

### Before / After by code owner

Before is `main` @adeaf9ad59 and After is the UAT head (MetaMask#47557)
@28a7077e43, both recorded with the same typing script (type 5, then
500000000000000000, then clear).

#### Ramps Buy

| Before | After |
| --- | --- |
| <img width="360"
src="https://github.com/user-attachments/assets/d91dbfbb-2b31-4277-b39b-c877d1caf777"
alt="Ramps Buy before, side panel"> | <img width="360"
src="https://github.com/user-attachments/assets/c81cb5f7-21db-46b5-86b6-20c6702b2249"
alt="Ramps Buy after, side panel"> |
| <img width="360"
src="https://github.com/user-attachments/assets/90eb701f-3d2b-4af5-8a9d-313a51ecd614"
alt="Ramps Buy before, expanded view"> | <img width="360"
src="https://github.com/user-attachments/assets/4c243f97-3db9-47ab-8583-88a2a27826de"
alt="Ramps Buy after, expanded view"> |

Full MP4s: [Side panel
before](https://github.com/user-attachments/assets/f12c8d69-ebfb-4eaa-8bbd-5d86dd2caf85)
· [Side panel
after](https://github.com/user-attachments/assets/02ba6962-aec8-41d6-b473-9f61fa3b6409)
· [Expanded
before](https://github.com/user-attachments/assets/1a559b4d-706c-4dae-8865-37c49801ce4d)
· [Expanded
after](https://github.com/user-attachments/assets/d9c5cde4-4a96-4064-a188-821b49ac8c34)

> **Note:** On main, the side panel field overflows at 18 digits and the
page scrolls sideways (the Continue button slides off).

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.

<!-- CURSOR_AGENT_PR_BODY_END -->

<div><a
href="https://cursor.com/agents/bc-b3180cce-a244-5330-95e3-35b5951ff3b4?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a
href="https://cursor.com/background-agent?bcId=bc-b3180cce-a244-5330-95e3-35b5951ff3b4&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img
alt="Open in Cursor" width="131" height="28"
src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</div>



[TMCU-1743]:
https://consensyssoftware.atlassian.net/browse/TMCU-1743?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[TMCU-1743]:
https://consensyssoftware.atlassian.net/browse/TMCU-1743?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ


<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Changes the primary Buy amount entry UI and moves decimal validation
out of the amount hook into a shared component, which affects quote
debouncing and error display on a money-movement path.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
5f625dd. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
LabinatorSolutions pushed a commit to LabinatorSolutions/metamask-extension that referenced this pull request Nov 6, 2026
…Mask#47558)

<!-- CURSOR_AGENT_PR_BODY_BEGIN -->
Stacked on MetaMask#47564 (shared font-size helper) — merge that first.

## **Description**

This is the @MetaMask/swaps-engineers slice of the Grotzec large number
amount inputs. It was split from the UAT build in MetaMask#47557, which has the
full plan, the input inventory and the risks.

- Ticket:
[TMCU-1742](https://consensyssoftware.atlassian.net/browse/TMCU-1742)
- Epic: [TMCU-1741 [Extension] Update large number amount inputs with
Grotzec](https://consensyssoftware.atlassian.net/browse/TMCU-1741)

**Depends on MetaMask#47564** (the shared amount scale and
`useAmountInputFontSize` hook). This PR is stacked on MetaMask#47564's branch
(`cursor/grotzec-amount-input-scale-f3b4`) and does not carry its own
copy of the helper, so its diff shows only this slice. Merge MetaMask#47564
first, then retarget this PR to `main`.

**What is the reason for the change?** Read-only large amounts moved to
`AmountDisplayLg` + Hero in MetaMask#47464–MetaMask#47468. The Swap/Bridge source and
destination inputs were still Inter at weight 400. They also overflowed
early: a 14-character value was cut off in the 219px popup field.

**What is the improvement?**
- **MMDS `Input`.** The legacy `TextField` is replaced with an MMDS
`Box` row containing an MMDS `Text` prefix and an MMDS `Input`
(`textVariant={AmountDisplayLg}`, `font-hero`). `data-testid`, `value`,
`disabled`, `readOnly`, `autoFocus`, `autocomplete="off"`, the key
filter, paste sanitising and click-to-focus are kept. The read-only
destination field stays at 50% opacity until it has a value.
- **Sizing: shared scale.** Every large amount input now uses the scale
in MetaMask#47564 (`ui/helpers/utils/amount-input-font-size.ts`). It has steps
of 88, 72, 60, 48, 40, 32, 24 and 20px, takes the largest step at which
the text fits the field's measured width (`useAmountInputFontSize`, one
`ResizeObserver` per field), and sets line height equal to font size.
- **Bridge exception: starts at 48px.** Swap/Bridge is the one layout
that starts lower: `maxFontSize: 48`. Its fallback width is 219px
(`AMOUNT_FIELD_FALLBACK_WIDTH`, the popup field width), used only until
the field has been measured. It has two stacked amount fields beside the
asset pickers, so the 88px start would roughly double the height of each
field. Bridge stays on the same steps (48, 40, 32, 24, 20px). 48px
matches the Home and Money balance size.
- **Widths.** The text estimate counts the fiat prefix and uses measured
Grotzec glyph widths, and the budget is the field's measured width. In
the 219px popup field, `1234567.123456` is 32px; 12 digits fit at 40px,
15 at 32px and 21 at 24px. In the wider expanded-view field, long
amounts stay at 48px instead of shrinking early. Longer values scroll
inside the field at 20px.
- **Cleanup.** The `.mm-text-field` and `.defined` rules in
`prepare/index.scss` only targeted the old markup, so they are removed
along with the `defined` class toggle in `prepare-bridge-page.tsx`.

**Risks**
- Grotzec has no ₹ ₩ ₿ ₽ ₺ ₦ ₱ ₫ ฿ ₪, so a fiat prefix in those
currencies falls back to `'Helvetica Neue', Helvetica, Arial`, as on
Mobile. The shared scale budgets 1em for those glyphs.
- The 48px start is an exception to the shared 88px start and needs
design sign-off. Mobile's Bridge input is not on Grotzec yet.
- Snapshots updated: `bridge/__snapshots__/index.test.tsx.snap`,
`bridge/prepare/__snapshots__/prepare-bridge-page.test.tsx.snap`.

## **Changelog**

CHANGELOG entry: Updated the Swap and Bridge amount inputs to the
Grotzec typeface

## **Related issues**

Fixes:
[TMCU-1742](https://consensyssoftware.atlassian.net/browse/TMCU-1742)

Epic:
[TMCU-1741](https://consensyssoftware.atlassian.net/browse/TMCU-1741)
Depends on: MetaMask#47564
Split from: MetaMask#47557

## **Manual testing steps**

1. Load this branch in the extension and open Swap in the popup.
2. Enter `1`, then type `1234567.123456789` one key at a time. Confirm
the amount is Grotzec and steps 48 → 40 → 32 → 24px in the popup without
being cut off.
3. Type a letter and a second `.`; confirm both are rejected. Paste
`1,234.5` and confirm it becomes `1234.5`.
4. Click beside the number in the source field and confirm the input is
focused.
5. Toggle to fiat and confirm the currency prefix matches the amount
size.
6. Before a quote arrives, confirm the destination shows a dimmed `0`
and the loading skeleton; once a quote arrives, confirm it shows at full
opacity.
7. Repeat in the expanded view, where the same value stays at 48px, and
in the side panel, where it steps down smoothly as the field narrows.

## **Screenshots/Recordings**

### Before / After by code owner

Before is `main` @adeaf9ad59 and After is the UAT head (MetaMask#47557)
@28a7077e43, both recorded with the same typing script (type 5, then
500000000000000000, then clear).

#### Swap/Bridge

| Before | After |
| --- | --- |
| <img width="360"
src="https://github.com/user-attachments/assets/aa53a2c2-2691-426c-90e8-1c497fbfb5b6"
alt="Swap/Bridge before, side panel"> | <img width="360"
src="https://github.com/user-attachments/assets/804e50aa-0be4-46a4-87a4-10c5d5988849"
alt="Swap/Bridge after, side panel"> |
| <img width="360"
src="https://github.com/user-attachments/assets/37b2c2b5-9881-45e7-88f4-21772fe48dd3"
alt="Swap/Bridge before, expanded view"> | <img width="360"
src="https://github.com/user-attachments/assets/6b91925e-ee22-4900-b57d-e09239c032a2"
alt="Swap/Bridge after, expanded view"> |

Full MP4s: [Side panel
before](https://github.com/user-attachments/assets/41cbd326-5a90-462e-8c53-6acfe6dd725f)
· [Side panel
after](https://github.com/user-attachments/assets/150496d1-0b7d-4595-addb-61542bff16a1)
· [Expanded
before](https://github.com/user-attachments/assets/031b69fc-e40c-4c9d-a287-ae3bc0fdeacd)
· [Expanded
after](https://github.com/user-attachments/assets/21f4812b-e75d-465d-a42b-ceccf4826f75)

> **Note:** With the same mocks, main shows "This trade route isn't
available right now" for the long amount; this is unrelated to the
input.

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.

<!-- CURSOR_AGENT_PR_BODY_END -->

<div><a
href="https://cursor.com/agents/bc-b3180cce-a244-5330-95e3-35b5951ff3b4?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a
href="https://cursor.com/background-agent?bcId=bc-b3180cce-a244-5330-95e3-35b5951ff3b4&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img
alt="Open in Cursor" width="131" height="28"
src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</div>



[TMCU-1742]:
https://consensyssoftware.atlassian.net/browse/TMCU-1742?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[TMCU-1742]:
https://consensyssoftware.atlassian.net/browse/TMCU-1742?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Changes core swap/bridge amount entry UX and validation paths (input
component, dynamic font sizing, destination placeholder styling) on a
high-traffic flow; depends on stacked MetaMask#47564 behavior.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
dd25b98. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
LabinatorSolutions pushed a commit to LabinatorSolutions/metamask-extension that referenced this pull request Nov 6, 2026
MetaMask#47560)

<!-- CURSOR_AGENT_PR_BODY_BEGIN -->
Stacked on MetaMask#47564 (shared font-size helper) — merge that first.

## **Description**

This is the @MetaMask/perps slice of the Grotzec large number amount
inputs. It was split from the UAT build in MetaMask#47557, which has the full
plan, the input inventory and the risks.

- Ticket:
[TMCU-1744](https://consensyssoftware.atlassian.net/browse/TMCU-1744)
- Epic: [TMCU-1741 [Extension] Update large number amount inputs with
Grotzec](https://consensyssoftware.atlassian.net/browse/TMCU-1741)

**Depends on MetaMask#47564** (the shared amount scale and
`useAmountInputFontSize` hook). This PR is stacked on MetaMask#47564's branch
(`cursor/grotzec-amount-input-scale-f3b4`) and does not carry its own
copy of the helper, so its diff shows only this slice. Merge MetaMask#47564
first, then retarget this PR to `main`.

**What is the reason for the change?** The Perps withdraw amount was
Inter at weight 500 and 64/40/30/20px. Perps balances and prices moved
to Grotzec in MetaMask#47465. This input is the twin of the MM Pay
`CustomAmount`, which Mobile moves to Grotzec at 88px in
[MetaMask#38135](MetaMask/metamask-mobile#38135).

**What is the improvement?**
- **MMDS `Input`.** The `<input>` is now the MMDS `Input`
(`textVariant={AmountDisplayLg}`, `font-hero`). The hidden-text
measuring pattern stays. The symbol and measuring element are MMDS
`Text` (`AmountDisplayLg` + `FontFamily.Hero`), so all three share the
same family, weight and size. The explicit `fontWeight: 500` is dropped,
as on Mobile.
- **Sizing: shared scale.** The withdraw amount uses the scale in MetaMask#47564
(`ui/helpers/utils/amount-input-font-size.ts`), the same one used by
Swap/Bridge, Ramps Buy and the MM Pay amount. It has steps of 88, 72,
60, 48, 40, 32, 24 and 20px, takes the largest step at which `$` and the
amount fit the input's measured width (`useAmountInputFontSize`, one
`ResizeObserver` per input; 328px is only the fallback before the first
measurement), and sets line height equal to font size. In the expanded
view long amounts stay large instead of shrinking early. At the 328px
popup width, `$25` is 88px, `$1234567.89` is 72px and `$123456789012.34`
is 48px.
- **Mobile reference.** The 88px start, 88px row, 88px `rounded-lg`
skeleton and 20px floor match Mobile MetaMask#38135. Mobile's MM Pay drops
straight from 88px to 40px; Extension steps down gradually so mid-length
amounts stay larger.
- **Twin stays in sync.** The local length-based `getFontSize` is
removed. Its twin, the confirmations `CustomAmount`, moves to the same
scale in MetaMask#47565, so the two can no longer drift.

**Risks**
- The weight changes from 500 Inter to the Bold Grotzec cut. Perps is
USD only, and Grotzec has `$`, so there is no glyph fallback.

## **Changelog**

CHANGELOG entry: Updated the Perps withdraw amount input to the Grotzec
typeface

## **Related issues**

Fixes:
[TMCU-1744](https://consensyssoftware.atlassian.net/browse/TMCU-1744)

Epic:
[TMCU-1741](https://consensyssoftware.atlassian.net/browse/TMCU-1741)
Depends on: MetaMask#47564
Related: MetaMask#47565 (MM Pay custom amount twin)
Split from: MetaMask#47557

## **Manual testing steps**

1. Load this branch in the extension, open Perps and choose Withdraw.
2. Confirm the loading skeleton is 88px tall with rounded corners.
3. Enter `25` and confirm it renders in Grotzec at 88px.
4. Type `123456789012.34` one key at a time and confirm the amount steps
down 88 → 72 → 60 → 48px and stays centred.
5. Enter more than the available balance and confirm the amount turns
red.
6. Repeat in the expanded view, where long amounts stay larger instead
of shrinking early, and in the side panel, where they step down smoothly
as the width narrows.

## **Screenshots/Recordings**

### Before / After by code owner

Before is `main` @adeaf9ad59 and After is the UAT head (MetaMask#47557)
@28a7077e43, both recorded with the same typing script (type 5, then
500000000000000000, then clear).

#### Perps withdraw

| Before | After |
| --- | --- |
| <img width="360"
src="https://github.com/user-attachments/assets/bde0cc8d-a0a6-493e-81cd-6754ac6a0a82"
alt="Perps withdraw before, side panel"> | <img width="360"
src="https://github.com/user-attachments/assets/87e17271-f2a9-4b2e-824f-92456a58a3eb"
alt="Perps withdraw after, side panel"> |
| <img width="360"
src="https://github.com/user-attachments/assets/2c539038-48c1-4f5b-9ef4-85b21391df3b"
alt="Perps withdraw before, expanded view"> | <img width="360"
src="https://github.com/user-attachments/assets/cc7c54af-42e1-4bf9-bffc-92bd98312ead"
alt="Perps withdraw after, expanded view"> |

Full MP4s: [Side panel
before](https://github.com/user-attachments/assets/49c2722c-88e1-41fb-8ff3-1fda48319b85)
· [Side panel
after](https://github.com/user-attachments/assets/573cd199-f321-4b96-aab8-790349a292a6)
· [Expanded
before](https://github.com/user-attachments/assets/0595640d-d948-4c3f-9ec8-fb505f8f01f7)
· [Expanded
after](https://github.com/user-attachments/assets/85f918b1-09ec-4359-927d-705da4ed3405)

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.

<!-- CURSOR_AGENT_PR_BODY_END -->

<div><a
href="https://cursor.com/agents/bc-b3180cce-a244-5330-95e3-35b5951ff3b4?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a
href="https://cursor.com/background-agent?bcId=bc-b3180cce-a244-5330-95e3-35b5951ff3b4&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img
alt="Open in Cursor" width="131" height="28"
src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</div>



[TMCU-1744]:
https://consensyssoftware.atlassian.net/browse/TMCU-1744?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[TMCU-1744]:
https://consensyssoftware.atlassian.net/browse/TMCU-1744?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Scoped UI swap on the Perps withdraw amount field with no changes to
withdrawal submission, balance guards, or backend calls.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
52d1e02. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
LabinatorSolutions pushed a commit to LabinatorSolutions/metamask-extension that referenced this pull request Nov 6, 2026
…ero cp-13.57.0 (MetaMask#47565)

<!-- CURSOR_AGENT_PR_BODY_BEGIN -->
Stacked on MetaMask#47564 (shared font-size helper) — merge that first.

## **Description**

This is the @MetaMask/confirmations slice of the Grotzec large number
amount inputs. It was split from the UAT build in MetaMask#47557.

- Epic: [TMCU-1741 [Extension] Update large number amount inputs with
Grotzec](https://consensyssoftware.atlassian.net/browse/TMCU-1741)
- Ticket: a child ticket of
[TMCU-1741](https://consensyssoftware.atlassian.net/browse/TMCU-1741) is
still to be created for the MM Pay custom amount.

**Depends on MetaMask#47564** (the shared amount scale and
`useAmountInputFontSize` hook). This PR is stacked on MetaMask#47564's branch
(`cursor/grotzec-amount-input-scale-f3b4`) and does not carry its own
copy of the helper, so its diff shows only this slice. Merge MetaMask#47564
first, then retarget this PR to `main`.

**What is the reason for the change?** `CustomAmount`
(`ui/pages/confirmations/components/transactions/custom-amount/custom-amount.tsx`)
is the MM Pay hero amount. It is used by Perps deposit, the Perps
withdraw confirmation, mUSD conversion and Money account deposit and
withdraw. It was still Inter at weight 500, sized 64/40/30/20px with
line heights 70/44/33/22px, using legacy component-library `Text` and a
raw `<input>` sized in `ch`. Mobile moves the same component to Grotzec
in [MetaMask#38135](MetaMask/metamask-mobile#38135).

**What is the improvement?**
- **MMDS `Input`.** The `<input>` is now the MMDS `Input`
(`textVariant={AmountDisplayLg}`, `font-hero`, `isStateStylesDisabled`).
The symbol is MMDS `Text` `AmountDisplayLg` + `FontFamily.Hero`.
- **Width.** The `ch` estimate is replaced with the hidden measuring
`Text` that its Perps twin (`PerpsFiatHeroAmountInput`) uses. The
measuring `Text` is set in the same font, so the input width is exact
for Grotzec and for fallback symbols.
- **Sizing.** Sizes come from the shared scale in MetaMask#47564: 88, 72, 60,
48, 40, 32, 24, 20px, taking the largest step at which the symbol and
amount fit the input's measured width (`useAmountInputFontSize`, one
`ResizeObserver` per input; 328px is only the fallback before the first
measurement). Line height equals font size. In the expanded view long
amounts stay large instead of shrinking early. At the 328px popup width,
`$25` is 88px, `$1234567.89` is 72px and a 20-digit amount is 32px. The
row and the `rounded-lg` skeleton are both 88px, as in Mobile MetaMask#38135.
- **Unchanged.** Test IDs (`custom-amount-input`,
`custom-amount-symbol`, `custom-amount-skeleton`), cents-only display,
the 2-decimal input pattern, `autoFocus` and the alert and disabled
colours are unchanged. The E2E page objects use the same test IDs.

**Risks**
- This changes the hero on five confirmation flows at once: Perps
deposit, Perps withdraw, mUSD conversion, and Money deposit and
withdraw.
- Symbols Grotzec lacks (₹ ₩ ₿ …) render in the fallback family. The
shared scale budgets for their extra width.
- The weight changes from 500 Inter to the Bold Grotzec cut.

## **Changelog**

CHANGELOG entry: Updated the MetaMask Pay amount input to the Grotzec
typeface

## **Related issues**

Epic:
[TMCU-1741](https://consensyssoftware.atlassian.net/browse/TMCU-1741). A
child ticket is still to be created.
Depends on: MetaMask#47564
Split from: MetaMask#47557

## **Manual testing steps**

1. Load this branch in the extension.
2. Start a Perps deposit. Confirm the amount is Grotzec at 88px for
`25`. Then type `123456789012.34` one key at a time and confirm it steps
down 88 → 72 → 60 → 48px and stays centred.
3. Click Max or a percentage and confirm the amount shows at most 2
decimals.
4. Enter more than the balance and confirm the amount turns red.
5. Repeat the short and long amount check in mUSD conversion and in
Money account deposit and withdraw.
6. Repeat in the expanded view, where long amounts stay larger instead
of shrinking early, and in the side panel, where they step down smoothly
as the width narrows.

## **Screenshots/Recordings**

### Before / After by code owner

Before is `main` @adeaf9ad59 and After is the UAT head (MetaMask#47557)
@28a7077e43, both recorded with the same typing script (type 5, then
500000000000000000, then clear).

#### MM Pay custom amount

| Before | After |
| --- | --- |
| <img width="360"
src="https://github.com/user-attachments/assets/ce28237e-b7de-4816-9a62-4dfab0d2577d"
alt="MM Pay custom amount before, side panel"> | <img width="360"
src="https://github.com/user-attachments/assets/10617750-5f69-4a1a-8700-a1e1ebef52be"
alt="MM Pay custom amount after, side panel"> |
| <img width="360"
src="https://github.com/user-attachments/assets/a30507a6-420a-4c2a-b240-0176ec1c8f3c"
alt="MM Pay custom amount before, expanded view"> | <img width="360"
src="https://github.com/user-attachments/assets/7d9fbaf6-c0d0-4590-bac4-4d724808e4da"
alt="MM Pay custom amount after, expanded view"> |

Full MP4s: [Side panel
before](https://github.com/user-attachments/assets/940444b2-140e-47f1-ae07-ad0e2a79fb68)
· [Side panel
after](https://github.com/user-attachments/assets/b754992c-b785-4fe0-a25c-50da625a0453)
· [Expanded
before](https://github.com/user-attachments/assets/377356c2-15f9-4d26-9572-af2ee51624e0)
· [Expanded
after](https://github.com/user-attachments/assets/96562d58-8e05-4ebb-99bf-0285eaf55c1b)

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.

<!-- CURSOR_AGENT_PR_BODY_END -->

<div><a
href="https://cursor.com/agents/bc-b3180cce-a244-5330-95e3-35b5951ff3b4?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a
href="https://cursor.com/background-agent?bcId=bc-b3180cce-a244-5330-95e3-35b5951ff3b4&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img
alt="Open in Cursor" width="131" height="28"
src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</div>



[TMCU-1741]:
https://consensyssoftware.atlassian.net/browse/TMCU-1741?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[TMCU-1741]:
https://consensyssoftware.atlassian.net/browse/TMCU-1741?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> The same hero control drives several MM Pay confirmation flows; visual
and sizing behavior change via the shared component, though fiat display
rules and input constraints stay equivalent.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
30842bf. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
sleepytanya pushed a commit that referenced this pull request Nov 6, 2026
…tom amount input in Grotzec Hero (#47679)

- chore(confirmations): set the MM Pay custom amount input in Grotzec
Hero cp-13.57.0 (#47565)

<!-- CURSOR_AGENT_PR_BODY_BEGIN -->
Stacked on #47564 (shared font-size helper) — merge that first.

## **Description**

This is the @MetaMask/confirmations slice of the Grotzec large number
amount inputs. It was split from the UAT build in #47557.

- Epic: [TMCU-1741 [Extension] Update large number amount inputs with
Grotzec](https://consensyssoftware.atlassian.net/browse/TMCU-1741)
- Ticket: a child ticket of
[TMCU-1741](https://consensyssoftware.atlassian.net/browse/TMCU-1741) is
still to be created for the MM Pay custom amount.

**Depends on #47564** (the shared amount scale and
`useAmountInputFontSize` hook). This PR is stacked on #47564's branch
(`cursor/grotzec-amount-input-scale-f3b4`) and does not carry its own
copy of the helper, so its diff shows only this slice. Merge #47564
first, then retarget this PR to `main`.

**What is the reason for the change?** `CustomAmount`

(`ui/pages/confirmations/components/transactions/custom-amount/custom-amount.tsx`)
is the MM Pay hero amount. It is used by Perps deposit, the Perps
withdraw confirmation, mUSD conversion and Money account deposit and
withdraw. It was still Inter at weight 500, sized 64/40/30/20px with
line heights 70/44/33/22px, using legacy component-library `Text` and a
raw `<input>` sized in `ch`. Mobile moves the same component to Grotzec
in [#38135](MetaMask/metamask-mobile#38135).

**What is the improvement?**
- **MMDS `Input`.** The `<input>` is now the MMDS `Input`
(`textVariant={AmountDisplayLg}`, `font-hero`, `isStateStylesDisabled`).
The symbol is MMDS `Text` `AmountDisplayLg` + `FontFamily.Hero`.
- **Width.** The `ch` estimate is replaced with the hidden measuring
`Text` that its Perps twin (`PerpsFiatHeroAmountInput`) uses. The
measuring `Text` is set in the same font, so the input width is exact
for Grotzec and for fallback symbols.
- **Sizing.** Sizes come from the shared scale in #47564: 88, 72, 60,
48, 40, 32, 24, 20px, taking the largest step at which the symbol and
amount fit the input's measured width (`useAmountInputFontSize`, one
`ResizeObserver` per input; 328px is only the fallback before the first
measurement). Line height equals font size. In the expanded view long
amounts stay large instead of shrinking early. At the 328px popup width,
`$25` is 88px, `$1234567.89` is 72px and a 20-digit amount is 32px. The
row and the `rounded-lg` skeleton are both 88px, as in Mobile #38135.
- **Unchanged.** Test IDs (`custom-amount-input`,
`custom-amount-symbol`, `custom-amount-skeleton`), cents-only display,
the 2-decimal input pattern, `autoFocus` and the alert and disabled
colours are unchanged. The E2E page objects use the same test IDs.

**Risks**
- This changes the hero on five confirmation flows at once: Perps
deposit, Perps withdraw, mUSD conversion, and Money deposit and
withdraw.
- Symbols Grotzec lacks (₹ ₩ ₿ …) render in the fallback family. The
shared scale budgets for their extra width.
- The weight changes from 500 Inter to the Bold Grotzec cut.

## **Changelog**

CHANGELOG entry: Updated the MetaMask Pay amount input to the Grotzec
typeface

## **Related issues**

Epic:
[TMCU-1741](https://consensyssoftware.atlassian.net/browse/TMCU-1741). A
child ticket is still to be created.
Depends on: #47564
Split from: #47557

## **Manual testing steps**

1. Load this branch in the extension.
2. Start a Perps deposit. Confirm the amount is Grotzec at 88px for
`25`. Then type `123456789012.34` one key at a time and confirm it steps
down 88 → 72 → 60 → 48px and stays centred.
3. Click Max or a percentage and confirm the amount shows at most 2
decimals.
4. Enter more than the balance and confirm the amount turns red.
5. Repeat the short and long amount check in mUSD conversion and in
Money account deposit and withdraw.
6. Repeat in the expanded view, where long amounts stay larger instead
of shrinking early, and in the side panel, where they step down smoothly
as the width narrows.

## **Screenshots/Recordings**

### Before / After by code owner

Before is `main` @adeaf9ad59 and After is the UAT head (#47557)
@28a7077e43, both recorded with the same typing script (type 5, then
500000000000000000, then clear).

#### MM Pay custom amount

| Before | After |
| --- | --- |
| <img width="360"

src="https://github.com/user-attachments/assets/ce28237e-b7de-4816-9a62-4dfab0d2577d"
alt="MM Pay custom amount before, side panel"> | <img width="360"

src="https://github.com/user-attachments/assets/10617750-5f69-4a1a-8700-a1e1ebef52be"
alt="MM Pay custom amount after, side panel"> |
| <img width="360"

src="https://github.com/user-attachments/assets/a30507a6-420a-4c2a-b240-0176ec1c8f3c"
alt="MM Pay custom amount before, expanded view"> | <img width="360"

src="https://github.com/user-attachments/assets/7d9fbaf6-c0d0-4590-bac4-4d724808e4da"
alt="MM Pay custom amount after, expanded view"> |

Full MP4s: [Side panel

before](https://github.com/user-attachments/assets/940444b2-140e-47f1-ae07-ad0e2a79fb68)
· [Side panel

after](https://github.com/user-attachments/assets/b754992c-b785-4fe0-a25c-50da625a0453)
· [Expanded

before](https://github.com/user-attachments/assets/377356c2-15f9-4d26-9572-af2ee51624e0)
· [Expanded

after](https://github.com/user-attachments/assets/96562d58-8e05-4ebb-99bf-0285eaf55c1b)

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding

Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling

guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.

<!-- CURSOR_AGENT_PR_BODY_END -->

<div><a

href="https://cursor.com/agents/bc-b3180cce-a244-5330-95e3-35b5951ff3b4?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"

src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a

href="https://cursor.com/background-agent?bcId=bc-b3180cce-a244-5330-95e3-35b5951ff3b4&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source
media="(prefers-color-scheme: dark)"

srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img
alt="Open in Cursor" width="131" height="28"

src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</div>



[TMCU-1741]:

https://consensyssoftware.atlassian.net/browse/TMCU-1741?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[TMCU-1741]:

https://consensyssoftware.atlassian.net/browse/TMCU-1741?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> The same hero control drives several MM Pay confirmation flows; visual
and sizing behavior change via the shared component, though fiat display
rules and input constraints stay equivalent.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
30842bf. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: George Marshall
<georgewrmarshall@users.noreply.github.com>
[d8e24a8](d8e24a8)

[TMCU-1741]:
https://consensyssoftware.atlassian.net/browse/TMCU-1741?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[TMCU-1741]:
https://consensyssoftware.atlassian.net/browse/TMCU-1741?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

---------

Co-authored-by: George Marshall <george.marshall@consensys.net>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
Co-authored-by: metamask-ci[bot] <271559518+metamask-ci[bot]@users.noreply.github.com>
@metamask-ci metamask-ci Bot mentioned this pull request Nov 6, 2026
13 tasks done
sleepytanya added a commit that referenced this pull request Nov 7, 2026
…put in Grotzec Hero (#47672)

- chore(perps): set the withdraw amount input in Grotzec Hero cp-13.57.0
(#47560)

<!-- CURSOR_AGENT_PR_BODY_BEGIN -->
Stacked on #47564 (shared font-size helper) — merge that first.

## **Description**

This is the @MetaMask/perps slice of the Grotzec large number amount
inputs. It was split from the UAT build in #47557, which has the full
plan, the input inventory and the risks.

- Ticket:
[TMCU-1744](https://consensyssoftware.atlassian.net/browse/TMCU-1744)
- Epic: [TMCU-1741 [Extension] Update large number amount inputs with
Grotzec](https://consensyssoftware.atlassian.net/browse/TMCU-1741)

**Depends on #47564** (the shared amount scale and
`useAmountInputFontSize` hook). This PR is stacked on #47564's branch
(`cursor/grotzec-amount-input-scale-f3b4`) and does not carry its own
copy of the helper, so its diff shows only this slice. Merge #47564
first, then retarget this PR to `main`.

**What is the reason for the change?** The Perps withdraw amount was
Inter at weight 500 and 64/40/30/20px. Perps balances and prices moved
to Grotzec in #47465. This input is the twin of the MM Pay
`CustomAmount`, which Mobile moves to Grotzec at 88px in
[#38135](MetaMask/metamask-mobile#38135).

**What is the improvement?**
- **MMDS `Input`.** The `<input>` is now the MMDS `Input`
(`textVariant={AmountDisplayLg}`, `font-hero`). The hidden-text
measuring pattern stays. The symbol and measuring element are MMDS
`Text` (`AmountDisplayLg` + `FontFamily.Hero`), so all three share the
same family, weight and size. The explicit `fontWeight: 500` is dropped,
as on Mobile.
- **Sizing: shared scale.** The withdraw amount uses the scale in #47564
(`ui/helpers/utils/amount-input-font-size.ts`), the same one used by
Swap/Bridge, Ramps Buy and the MM Pay amount. It has steps of 88, 72,
60, 48, 40, 32, 24 and 20px, takes the largest step at which `$` and the
amount fit the input's measured width (`useAmountInputFontSize`, one
`ResizeObserver` per input; 328px is only the fallback before the first
measurement), and sets line height equal to font size. In the expanded
view long amounts stay large instead of shrinking early. At the 328px
popup width, `$25` is 88px, `$1234567.89` is 72px and `$123456789012.34`
is 48px.
- **Mobile reference.** The 88px start, 88px row, 88px `rounded-lg`
skeleton and 20px floor match Mobile #38135. Mobile's MM Pay drops
straight from 88px to 40px; Extension steps down gradually so mid-length
amounts stay larger.
- **Twin stays in sync.** The local length-based `getFontSize` is
removed. Its twin, the confirmations `CustomAmount`, moves to the same
scale in #47565, so the two can no longer drift.

**Risks**
- The weight changes from 500 Inter to the Bold Grotzec cut. Perps is
USD only, and Grotzec has `$`, so there is no glyph fallback.

## **Changelog**

CHANGELOG entry: Updated the Perps withdraw amount input to the Grotzec
typeface

## **Related issues**

Fixes:
[TMCU-1744](https://consensyssoftware.atlassian.net/browse/TMCU-1744)

Epic:
[TMCU-1741](https://consensyssoftware.atlassian.net/browse/TMCU-1741)
Depends on: #47564
Related: #47565 (MM Pay custom amount twin)
Split from: #47557

## **Manual testing steps**

1. Load this branch in the extension, open Perps and choose Withdraw.
2. Confirm the loading skeleton is 88px tall with rounded corners.
3. Enter `25` and confirm it renders in Grotzec at 88px.
4. Type `123456789012.34` one key at a time and confirm the amount steps
down 88 → 72 → 60 → 48px and stays centred.
5. Enter more than the available balance and confirm the amount turns
red.
6. Repeat in the expanded view, where long amounts stay larger instead
of shrinking early, and in the side panel, where they step down smoothly
as the width narrows.

## **Screenshots/Recordings**

### Before / After by code owner

Before is `main` @adeaf9ad59 and After is the UAT head (#47557)
@28a7077e43, both recorded with the same typing script (type 5, then
500000000000000000, then clear).

#### Perps withdraw

| Before | After |
| --- | --- |
| <img width="360"

src="https://github.com/user-attachments/assets/bde0cc8d-a0a6-493e-81cd-6754ac6a0a82"
alt="Perps withdraw before, side panel"> | <img width="360"

src="https://github.com/user-attachments/assets/87e17271-f2a9-4b2e-824f-92456a58a3eb"
alt="Perps withdraw after, side panel"> |
| <img width="360"

src="https://github.com/user-attachments/assets/2c539038-48c1-4f5b-9ef4-85b21391df3b"
alt="Perps withdraw before, expanded view"> | <img width="360"

src="https://github.com/user-attachments/assets/cc7c54af-42e1-4bf9-bffc-92bd98312ead"
alt="Perps withdraw after, expanded view"> |

Full MP4s: [Side panel

before](https://github.com/user-attachments/assets/49c2722c-88e1-41fb-8ff3-1fda48319b85)
· [Side panel

after](https://github.com/user-attachments/assets/573cd199-f321-4b96-aab8-790349a292a6)
· [Expanded

before](https://github.com/user-attachments/assets/0595640d-d948-4c3f-9ec8-fb505f8f01f7)
· [Expanded

after](https://github.com/user-attachments/assets/85f918b1-09ec-4359-927d-705da4ed3405)

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding

Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling

guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.

<!-- CURSOR_AGENT_PR_BODY_END -->

<div><a

href="https://cursor.com/agents/bc-b3180cce-a244-5330-95e3-35b5951ff3b4?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"

src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a

href="https://cursor.com/background-agent?bcId=bc-b3180cce-a244-5330-95e3-35b5951ff3b4&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source
media="(prefers-color-scheme: dark)"

srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img
alt="Open in Cursor" width="131" height="28"

src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</div>



[TMCU-1744]:

https://consensyssoftware.atlassian.net/browse/TMCU-1744?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[TMCU-1744]:

https://consensyssoftware.atlassian.net/browse/TMCU-1744?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Scoped UI swap on the Perps withdraw amount field with no changes to
withdrawal submission, balance guards, or backend calls.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
52d1e02. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: George Marshall
<georgewrmarshall@users.noreply.github.com>
[b0f7657](b0f7657)

[TMCU-1744]:
https://consensyssoftware.atlassian.net/browse/TMCU-1744?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[TMCU-1744]:
https://consensyssoftware.atlassian.net/browse/TMCU-1744?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

---------

Co-authored-by: George Marshall <george.marshall@consensys.net>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
Co-authored-by: metamask-ci[bot] <271559518+metamask-ci[bot]@users.noreply.github.com>
Co-authored-by: sleepytanya <104780023+sleepytanya@users.noreply.github.com>
@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
@gauthierpetetin

Copy link
Copy Markdown
Contributor

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

@metamask-ci metamask-ci Bot mentioned this pull request Nov 13, 2026
10 of 18 tasks

This branch had an error being deployed

1 failed (outdated) and 1 inactive deployments
segment-schema — d9f21041 Deployed Nov 3, 2026 by cursor[bot] via propose #2863
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-13.57.0 Issue or pull request that will be included in release 13.57.0 size-XL 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