Repository navigation
chore(confirmations): set the MM Pay custom amount input in Grotzec Hero cp-13.57.0 - #47565
Conversation
✨ Files requiring CODEOWNER review ✨✅ @MetaMask/confirmations (2 files, +105 -161)
|
Builds ready [7a15149]
⚡ Performance Benchmarks (Total: 🟢 6 pass · 🟡 3 warn · 🔴 4 fail)
Bundle Size Diffs [🚨 Warning! Bundle size has increased!]
|
6eee458 to
5e6c93a
Compare
Builds ready [5e6c93a] [reused from 6eee458]
⚡ Performance Benchmarks (Total: 🟢 7 pass · 🟡 1 warn · 🔴 4 fail)
Bundle Size Diffs [🚨 Warning! Bundle size has increased!]
|
39f41ac to
4b1fe3c
Compare
Builds ready [4b1fe3c]
⚡ Performance Benchmarks (Total: 🟢 8 pass · 🟡 1 warn · 🔴 4 fail)
Bundle Size Diffs [🚨 Warning! Bundle size has increased!]
|
4b1fe3c to
0ee9e24
Compare
|
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. |
Builds ready [0ee9e24]
⚡ Performance Benchmarks (Total: 🟢 8 pass · 🟡 4 warn · 🔴 1 fail)
Bundle Size Diffs [🚨 Warning! Bundle size has increased!]
|
0ee9e24 to
e071461
Compare
Builds ready [e071461]
⚡ Performance Benchmarks (Total: 🟢 11 pass · 🟡 0 warn · 🔴 1 fail)
Bundle Size Diffs [🚨 Warning! Bundle size has increased!]
|
37e9091 to
1eeca2c
Compare
The base branch was changed.
Builds ready [30842bf]
⚡ Performance Benchmarks (Total: 🟢 6 pass · 🟡 5 warn · 🔴 2 fail)
Bundle Size Diffs [🚨 Warning! Bundle size has increased!]
|
|
…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> <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> </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>
…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> <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> </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>
…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> <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> </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>



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.
Depends on #47564 (the shared amount scale and
useAmountInputFontSizehook). 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 tomain.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-libraryTextand a raw<input>sized inch. Mobile moves the same component to Grotzec in #38135.What is the improvement?
Input. The<input>is now the MMDSInput(textVariant={AmountDisplayLg},font-hero,isStateStylesDisabled). The symbol is MMDSTextAmountDisplayLg+FontFamily.Hero.chestimate is replaced with the hidden measuringTextthat its Perps twin (PerpsFiatHeroAmountInput) uses. The measuringTextis set in the same font, so the input width is exact for Grotzec and for fallback symbols.useAmountInputFontSize, oneResizeObserverper 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,$25is 88px,$1234567.89is 72px and a 20-digit amount is 32px. The row and therounded-lgskeleton are both 88px, as in Mobile [Bug]: Balances are not updating on extension after signup #38135.custom-amount-input,custom-amount-symbol,custom-amount-skeleton), cents-only display, the 2-decimal input pattern,autoFocusand the alert and disabled colours are unchanged. The E2E page objects use the same test IDs.Risks
Changelog
CHANGELOG entry: Updated the MetaMask Pay amount input to the Grotzec typeface
Related issues
Epic: TMCU-1741. A child ticket is still to be created.
Depends on: #47564
Split from: #47557
Manual testing steps
25. Then type123456789012.34one key at a time and confirm it steps down 88 → 72 → 60 → 48px and stays centred.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
Full MP4s: Side panel before · Side panel after · Expanded before · Expanded after
Pre-merge author checklist
Pre-merge reviewer checklist
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.
Reviewed by Cursor Bugbot for commit 30842bf. Bugbot is set up for automated code reviews on this repo. Configure here.