Skip to content

Commit 9be12a6

Browse files
chore: cp-7.59.0 input fixes (MetaMask#22508)
## **Description** This PR isolates input-related fixes that were originally bundled in MetaMask#21199 (which was reverted in MetaMask#22342). These specific fixes did not cause any issues and should be preserved. The main changes include: 1. **Font weight fix for Input component** - Added explicit `fontWeight` property to ensure proper text rendering in TextField inputs 2. **ImportSRP modal overlay fix** - Fixed overlay style interpolation to prevent visual artifacts during the seed phrase import modal animation 3. **Card delegation improvements** - Enhanced delegation logic to properly handle zero-value delegations and checksum addresses for EVM networks These fixes improve the overall stability and user experience of input fields and related UI components across the app. ## **Changelog** CHANGELOG entry: null ## **Related issues** Related to MetaMask#21199 (original PR with font preloader changes) Related to MetaMask#22342 (revert of MetaMask#21199) ## **Manual testing steps** ```gherkin Feature: Input component rendering and functionality Scenario: user enters text in TextField components Given user is on any screen with text input fields When user types text into input fields Then text should render correctly with proper font weight and styling Scenario: user imports wallet via seed phrase Given user is on the import wallet flow When user opens the seed phrase modal Then modal should display without overlay artifacts Scenario: user manages card delegation Given user has external wallet details configured When user sets a delegation amount of zero Then system should not call updateTokenPriority And delegation should complete successfully ``` ## **Screenshots/Recordings** N/A - These are fixes for existing functionality ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/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-mobile/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_SUMMARY --> --- > [!NOTE] > Adds consistent input lineHeight and applies Geist font styles to password-related views, updating snapshots accordingly. > > - **Frontend**: > - **Input/TextField**: Set explicit `lineHeight` in `components/Form/TextField/foundation/Input/Input.styles.ts` for consistent baseline alignment across platforms. > - **Password Screens**: > - `Views/EnterPasswordSimple/index.js`: Apply `fontStyles.normal` to prompt text. > - `Views/RevealPrivateCredential/styles.ts`: Apply `fontStyles.normal` to `input` style. > - **Tests**: > - Update snapshots across multiple views to reflect added `lineHeight` and `fontFamily` styling on inputs. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 7bb6459. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent dd54be0 commit 9be12a6

29 files changed

Lines changed: 135 additions & 2 deletions

File tree

app/component-library/components/Form/TextField/foundation/Input/Input.styles.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ const styleSheet = (params: { theme: Theme; vars: InputStyleSheetVars }) => {
4545
// Fix for placeholder text shifting with custom Geist fonts
4646
// Use minimal padding that works cross-platform with preloaded fonts
4747
paddingVertical: Platform.OS === 'ios' ? 2 : 1,
48-
// Ensure consistent line height for custom font baseline alignment lineHeight: Platform.OS === 'ios' ? 20 : 22,
48+
// Ensure consistent line height for custom font baseline alignment
49+
lineHeight: Platform.OS === 'ios' ? 20 : 22,
4950
fontFamily: getFontFamily(textVariant),
5051
fontWeight: theme.typography[textVariant].fontWeight,
5152
fontSize: theme.typography[textVariant].fontSize,

app/component-library/components/Form/TextField/foundation/Input/__snapshots__/Input.test.tsx.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ exports[`Input should render correctly 1`] = `
1717
"fontWeight": "400",
1818
"height": 24,
1919
"letterSpacing": 0,
20+
"lineHeight": 20,
2021
"opacity": 1,
2122
"paddingVertical": 2,
2223
"textAlignVertical": "center",

app/components/Snaps/SnapUIAddressInput/__snapshots__/SnapUIAddressInput.test.tsx.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ exports[`SnapUIAddressInput renders with an invalid CAIP Account ID 1`] = `
218218
"fontWeight": "400",
219219
"height": 46,
220220
"letterSpacing": 0,
221+
"lineHeight": 20,
221222
"opacity": 1,
222223
"paddingVertical": 2,
223224
"textAlignVertical": "center",

app/components/Snaps/SnapUIRenderer/__snapshots__/SnapUIRenderer.test.ts.snap

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@ exports[`SnapUIRenderer prefills interactive inputs with existing state 1`] = `
293293
"fontWeight": "400",
294294
"height": 46,
295295
"letterSpacing": 0,
296+
"lineHeight": 20,
296297
"opacity": 1,
297298
"paddingVertical": 2,
298299
"textAlignVertical": "center",
@@ -451,6 +452,7 @@ exports[`SnapUIRenderer re-renders when the interface changes 1`] = `
451452
"fontWeight": "400",
452453
"height": 46,
453454
"letterSpacing": 0,
455+
"lineHeight": 20,
454456
"opacity": 1,
455457
"paddingVertical": 2,
456458
"textAlignVertical": "center",
@@ -545,6 +547,7 @@ exports[`SnapUIRenderer re-renders when the interface changes 1`] = `
545547
"fontWeight": "400",
546548
"height": 46,
547549
"letterSpacing": 0,
550+
"lineHeight": 20,
548551
"opacity": 1,
549552
"paddingVertical": 2,
550553
"textAlignVertical": "center",
@@ -702,6 +705,7 @@ exports[`SnapUIRenderer re-syncs state when the interface changes 1`] = `
702705
"fontWeight": "400",
703706
"height": 46,
704707
"letterSpacing": 0,
708+
"lineHeight": 20,
705709
"opacity": 1,
706710
"paddingVertical": 2,
707711
"textAlignVertical": "center",
@@ -795,6 +799,7 @@ exports[`SnapUIRenderer re-syncs state when the interface changes 1`] = `
795799
"fontWeight": "400",
796800
"height": 46,
797801
"letterSpacing": 0,
802+
"lineHeight": 20,
798803
"opacity": 1,
799804
"paddingVertical": 2,
800805
"textAlignVertical": "center",
@@ -1944,6 +1949,7 @@ exports[`SnapUIRenderer supports fields with multiple components 1`] = `
19441949
"fontWeight": "400",
19451950
"height": 46,
19461951
"letterSpacing": 0,
1952+
"lineHeight": 20,
19471953
"opacity": 1,
19481954
"paddingVertical": 2,
19491955
"textAlignVertical": "center",
@@ -2139,6 +2145,7 @@ exports[`SnapUIRenderer supports interactive inputs 1`] = `
21392145
"fontWeight": "400",
21402146
"height": 46,
21412147
"letterSpacing": 0,
2148+
"lineHeight": 20,
21422149
"opacity": 1,
21432150
"paddingVertical": 2,
21442151
"textAlignVertical": "center",

app/components/Snaps/SnapUIRenderer/components/__snapshots__/form.test.ts.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ exports[`SnapUIForm will render 1`] = `
147147
"fontWeight": "400",
148148
"height": 46,
149149
"letterSpacing": 0,
150+
"lineHeight": 20,
150151
"opacity": 1,
151152
"paddingVertical": 2,
152153
"textAlignVertical": "center",
@@ -365,6 +366,7 @@ exports[`SnapUIForm will render with fields 1`] = `
365366
"fontWeight": "400",
366367
"height": 46,
367368
"letterSpacing": 0,
369+
"lineHeight": 20,
368370
"opacity": 1,
369371
"paddingVertical": 2,
370372
"textAlignVertical": "center",

app/components/Snaps/SnapUIRenderer/components/__snapshots__/input.test.ts.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ exports[`SnapUIInput handles disabled input 1`] = `
134134
"fontWeight": "400",
135135
"height": 46,
136136
"letterSpacing": 0,
137+
"lineHeight": 20,
137138
"opacity": 1,
138139
"paddingVertical": 2,
139140
"textAlignVertical": "center",
@@ -291,6 +292,7 @@ exports[`SnapUIInput renders with initial value 1`] = `
291292
"fontWeight": "400",
292293
"height": 46,
293294
"letterSpacing": 0,
295+
"lineHeight": 20,
294296
"opacity": 1,
295297
"paddingVertical": 2,
296298
"textAlignVertical": "center",

app/components/UI/Bridge/components/BridgeDestTokenSelector/__snapshots__/BridgeDestTokenSelector.test.tsx.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -872,6 +872,7 @@ exports[`BridgeDestTokenSelector renders with initial state and displays tokens
872872
"fontWeight": "400",
873873
"height": 38,
874874
"letterSpacing": 0,
875+
"lineHeight": 20,
875876
"opacity": 1,
876877
"paddingVertical": 2,
877878
"textAlignVertical": "center",

app/components/UI/Bridge/components/BridgeSourceTokenSelector/__snapshots__/BridgeSourceTokenSelector.test.tsx.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -877,6 +877,7 @@ exports[`BridgeSourceTokenSelector renders with initial state and displays token
877877
"fontWeight": "400",
878878
"height": 38,
879879
"letterSpacing": 0,
880+
"lineHeight": 20,
880881
"opacity": 1,
881882
"paddingVertical": 2,
882883
"textAlignVertical": "center",

app/components/UI/Card/Views/CardAuthentication/__snapshots__/CardAuthentication.test.tsx.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -661,6 +661,7 @@ exports[`CardAuthentication Component Login Step - Component Rendering matches l
661661
"fontWeight": "400",
662662
"height": 46,
663663
"letterSpacing": 0,
664+
"lineHeight": 20,
664665
"opacity": 1,
665666
"paddingVertical": 2,
666667
"textAlignVertical": "center",
@@ -774,6 +775,7 @@ exports[`CardAuthentication Component Login Step - Component Rendering matches l
774775
"fontWeight": "400",
775776
"height": 46,
776777
"letterSpacing": 0,
778+
"lineHeight": 20,
777779
"opacity": 1,
778780
"paddingVertical": 2,
779781
"textAlignVertical": "center",

app/components/UI/Ramp/Aggregator/Views/Settings/__snapshots__/ActivationKeyForm.test.tsx.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,7 @@ exports[`AddActivationKey renders correctly 1`] = `
585585
"fontWeight": "400",
586586
"height": 38,
587587
"letterSpacing": 0,
588+
"lineHeight": 20,
588589
"opacity": 1,
589590
"paddingVertical": 2,
590591
"textAlignVertical": "center",
@@ -698,6 +699,7 @@ exports[`AddActivationKey renders correctly 1`] = `
698699
"fontWeight": "400",
699700
"height": 38,
700701
"letterSpacing": 0,
702+
"lineHeight": 20,
701703
"opacity": 1,
702704
"paddingVertical": 2,
703705
"textAlignVertical": "center",

0 commit comments

Comments
 (0)