Commit 5cc3ed4
- chore: revert font preloader changes from #21199 cp-7.59.0 (#22342)
## **Description**
This PR reverts commit 74b8745 from PR
#21199.
**What is the reason for the change?**
The font preloader changes introduced in #21199 are causing rendering
bugs in the application:
- Text is being cut off in various components
- Font weights are not loading correctly
- The comprehensive font preloading approach is causing unexpected
layout issues
**What is the improvement/solution?**
This revert restores the previous variant-based font preloading
approach, which:
- Preloads only the specific TextVariant fonts that are actively used
- Maintains stable font rendering without text cutoff issues
- Ensures font weights load properly across all components
- Restores the working implementation until the font loading issues can
be properly addressed
## **Changelog**
CHANGELOG entry: null
## **Related issues**
Fixes: #22301
Reverts: #21199
Original commit: 74b8745
## **Manual testing steps**
```gherkin
Feature: Font rendering after revert
Scenario: user views text content across the app
Given the user has the app running with the reverted font preloader
And the user navigates through different screens with various text components
When the user views text content in input fields, headings, and body text
Then all text should be fully visible without cutoff
And font weights should render correctly (regular, medium, bold)
And there should be no layout shifting or text overflow issues
```
## **Screenshots/Recordings**
### **Before**
N/A - This is a revert PR
### **After**
N/A - This is a revert PR
## **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
- [x] 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.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Refactors font preloading to variant-based loading and updates text
inputs to use theme fontWeight while removing hardcoded fontFamily, with
snapshots adjusted accordingly.
>
> - **Fonts**:
> - **FontPreloader**: Replace family-name list with variant-based
preloading using `getFontFamily(TextVariant)`; on web load
Regular/Medium/Bold; simplify native/web flows and logging.
> - **Tests**: Rewrite `FontPreloader` tests to simpler, deterministic
cases aligned with new preloader behavior.
> - **Typography in inputs**:
> - Add `fontWeight` from `theme.typography[textVariant]` in
`Input.styles.ts`.
> - Remove hardcoded `fontFamily` from styles in
`Views/EnterPasswordSimple`, `Views/RevealPrivateCredential`, and
`MultichainAccounts/PrivateKeyList` to rely on shared typography.
> - **Snapshots**:
> - Update across inputs to include `fontWeight: "400"` and drop
`lineHeight` where applicable; reflect removed `fontFamily` in affected
views.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
833bb0c. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
[84bd50b](84bd50b)
Co-authored-by: George Marshall <george.marshall@consensys.net>
1 parent 19951ea commit 5cc3ed4
32 files changed
Lines changed: 275 additions & 612 deletions
File tree
- app
- component-library/components/Form/TextField/foundation/Input
- __snapshots__
- components
- Snaps
- SnapUIAddressInput/__snapshots__
- SnapUIRenderer
- __snapshots__
- components/__snapshots__
- UI
- Bridge
- Views/BridgeView/__snapshots__
- components
- BridgeDestTokenSelector/__snapshots__
- BridgeSourceTokenSelector/__snapshots__
- Card/Views/CardAuthentication/__snapshots__
- Ramp
- Aggregator
- Views/Settings/__snapshots__
- components
- FiatSelectorModal/__snapshots__
- RegionSelectorModal/__snapshots__
- TokenSelectModal/__snapshots__
- Deposit
- Views
- BasicInfo/__snapshots__
- EnterAddress/__snapshots__
- EnterEmail/__snapshots__
- Modals
- RegionSelectorModal/__snapshots__
- StateSelectorModal/__snapshots__
- TokenSelectorModal/__snapshots__
- components/DepositPhoneField/__snapshots__
- Views
- ChoosePassword/__snapshots__
- EditAccountName/__snapshots__
- EnterPasswordSimple
- __snapshots__
- Login/__snapshots__
- MultichainAccounts/PrivateKeyList
- ResetPassword/__snapshots__
- RevealPrivateCredential
- __snapshots__
- core/FontPreloader
- __tests__
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
49 | | - | |
| 48 | + | |
50 | 49 | | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| |||
app/component-library/components/Form/TextField/foundation/Input/__snapshots__/Input.test.tsx.snap
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | | - | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
| 218 | + | |
218 | 219 | | |
219 | 220 | | |
220 | | - | |
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
| |||
Lines changed: 7 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
290 | 290 | | |
291 | 291 | | |
292 | 292 | | |
| 293 | + | |
293 | 294 | | |
294 | 295 | | |
295 | | - | |
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
| |||
448 | 448 | | |
449 | 449 | | |
450 | 450 | | |
| 451 | + | |
451 | 452 | | |
452 | 453 | | |
453 | | - | |
454 | 454 | | |
455 | 455 | | |
456 | 456 | | |
| |||
542 | 542 | | |
543 | 543 | | |
544 | 544 | | |
| 545 | + | |
545 | 546 | | |
546 | 547 | | |
547 | | - | |
548 | 548 | | |
549 | 549 | | |
550 | 550 | | |
| |||
699 | 699 | | |
700 | 700 | | |
701 | 701 | | |
| 702 | + | |
702 | 703 | | |
703 | 704 | | |
704 | | - | |
705 | 705 | | |
706 | 706 | | |
707 | 707 | | |
| |||
792 | 792 | | |
793 | 793 | | |
794 | 794 | | |
| 795 | + | |
795 | 796 | | |
796 | 797 | | |
797 | | - | |
798 | 798 | | |
799 | 799 | | |
800 | 800 | | |
| |||
1941 | 1941 | | |
1942 | 1942 | | |
1943 | 1943 | | |
| 1944 | + | |
1944 | 1945 | | |
1945 | 1946 | | |
1946 | | - | |
1947 | 1947 | | |
1948 | 1948 | | |
1949 | 1949 | | |
| |||
2136 | 2136 | | |
2137 | 2137 | | |
2138 | 2138 | | |
| 2139 | + | |
2139 | 2140 | | |
2140 | 2141 | | |
2141 | | - | |
2142 | 2142 | | |
2143 | 2143 | | |
2144 | 2144 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| 147 | + | |
147 | 148 | | |
148 | 149 | | |
149 | | - | |
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| |||
362 | 362 | | |
363 | 363 | | |
364 | 364 | | |
| 365 | + | |
365 | 366 | | |
366 | 367 | | |
367 | | - | |
368 | 368 | | |
369 | 369 | | |
370 | 370 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
| 134 | + | |
134 | 135 | | |
135 | 136 | | |
136 | | - | |
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| |||
288 | 288 | | |
289 | 289 | | |
290 | 290 | | |
| 291 | + | |
291 | 292 | | |
292 | 293 | | |
293 | | - | |
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
419 | 419 | | |
420 | 420 | | |
421 | 421 | | |
| 422 | + | |
422 | 423 | | |
423 | 424 | | |
424 | 425 | | |
| |||
802 | 803 | | |
803 | 804 | | |
804 | 805 | | |
| 806 | + | |
805 | 807 | | |
806 | 808 | | |
807 | 809 | | |
| |||
2078 | 2080 | | |
2079 | 2081 | | |
2080 | 2082 | | |
| 2083 | + | |
2081 | 2084 | | |
2082 | 2085 | | |
2083 | 2086 | | |
| |||
2461 | 2464 | | |
2462 | 2465 | | |
2463 | 2466 | | |
| 2467 | + | |
2464 | 2468 | | |
2465 | 2469 | | |
2466 | 2470 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
867 | 867 | | |
868 | 868 | | |
869 | 869 | | |
| 870 | + | |
870 | 871 | | |
871 | 872 | | |
872 | | - | |
873 | 873 | | |
874 | 874 | | |
875 | 875 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
872 | 872 | | |
873 | 873 | | |
874 | 874 | | |
| 875 | + | |
875 | 876 | | |
876 | 877 | | |
877 | | - | |
878 | 878 | | |
879 | 879 | | |
880 | 880 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
658 | 658 | | |
659 | 659 | | |
660 | 660 | | |
| 661 | + | |
661 | 662 | | |
662 | 663 | | |
663 | | - | |
664 | 664 | | |
665 | 665 | | |
666 | 666 | | |
| |||
771 | 771 | | |
772 | 772 | | |
773 | 773 | | |
| 774 | + | |
774 | 775 | | |
775 | 776 | | |
776 | | - | |
777 | 777 | | |
778 | 778 | | |
779 | 779 | | |
| |||
0 commit comments