Skip to content

Conversation

@georgewrmarshall
Copy link
Contributor

@georgewrmarshall georgewrmarshall commented Nov 7, 2025

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

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

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


Note

Reverts/rewrites font preloader to load only TextVariant fonts and updates input styles to set fontWeight from theme while removing hardcoded lineHeight/fontFamily; updates tests and snapshots accordingly.

  • Fonts:
    • Preloader (app/core/FontPreloader/FontPreloader.ts): revert to variant-based font loading using TextVariant and getFontFamily; preload 400/500/700 weights on web; streamline native preload and logging.
    • Tests (app/core/FontPreloader/__tests__/FontPreloader.test.ts): simplify and align with new preloader behavior (singleton, RN preload, concurrency, reset, errors, promise access).
  • UI Styles:
    • Inputs (app/component-library/.../Input.styles.ts): apply fontWeight from theme.typography[textVariant]; keep baseline alignment; minor comment/format tweak.
    • Remove hardcoded fontFamily in custom inputs (Views/EnterPasswordSimple/index.js, Views/RevealPrivateCredential/styles.ts, Views/MultichainAccounts/PrivateKeyList/styles.ts).
  • Snapshots: update across UI to reflect fontWeight: "400" and removal of explicit lineHeight/fontFamily where applicable.

Written by Cursor Bugbot for commit 09ccad9. This will update automatically on new commits. Configure here.

@georgewrmarshall georgewrmarshall requested review from a team as code owners November 7, 2025 18:24
@github-actions
Copy link
Contributor

github-actions bot commented Nov 7, 2025

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.

@metamaskbot metamaskbot added the team-design-system All issues relating to design system in Mobile label Nov 7, 2025
@github-actions github-actions bot added the size-L label Nov 7, 2025
@georgewrmarshall georgewrmarshall changed the title Revert font preloader changes from #21199 chore: Revert font preloader changes from #21199 cp-7.59.0 Nov 7, 2025
paddingVertical: Platform.OS === 'ios' ? 2 : 1,
// Ensure consistent line height for custom font baseline alignment
lineHeight: Platform.OS === 'ios' ? 20 : 22,
// Ensure consistent line height for custom font baseline alignment lineHeight: Platform.OS === 'ios' ? 20 : 22,
Copy link
Contributor Author

@georgewrmarshall georgewrmarshall Nov 7, 2025

Choose a reason for hiding this comment

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

This seems like a mistake that we want to keep I'll create a follow up PR to fix the inputs specifically

@georgewrmarshall georgewrmarshall self-assigned this Nov 7, 2025
@georgewrmarshall georgewrmarshall changed the title chore: Revert font preloader changes from #21199 cp-7.59.0 chore: revert font preloader changes from #21199 cp-7.59.0 Nov 7, 2025
@georgewrmarshall georgewrmarshall added the skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. label Nov 7, 2025
AndyMBridges
AndyMBridges previously approved these changes Nov 10, 2025
paddingVertical: Platform.OS === 'ios' ? 2 : 1,
// Ensure consistent line height for custom font baseline alignment
lineHeight: Platform.OS === 'ios' ? 20 : 22,
// Ensure consistent line height for custom font baseline alignment lineHeight: Platform.OS === 'ios' ? 20 : 22,
Copy link

Choose a reason for hiding this comment

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

Bug: Merged Comments Break Code

The comment and code are merged on the same line without proper line break. The comment // Ensure consistent line height for custom font baseline alignment is concatenated directly with the code lineHeight: Platform.OS === 'ios' ? 20 : 22, on line 48, which will cause a syntax error. The newline character between the comment and the code statement was accidentally removed during the revert.

Fix in Cursor Fix in Web

AndyMBridges
AndyMBridges previously approved these changes Nov 10, 2025
@georgewrmarshall georgewrmarshall changed the title chore: revert font preloader changes from #21199 cp-7.59.0 chore: revert font preloader changes from #21199 cp-7.999.0 Nov 10, 2025
@georgewrmarshall georgewrmarshall changed the title chore: revert font preloader changes from #21199 cp-7.999.0 chore: revert font preloader changes from #21199 cp-7.59.99 Nov 10, 2025
@georgewrmarshall georgewrmarshall force-pushed the revert-font-preloader-changes branch from 3678185 to a5a0bb4 Compare November 10, 2025 20:21
@georgewrmarshall georgewrmarshall changed the title chore: revert font preloader changes from #21199 cp-7.59.99 chore: revert font preloader changes from #21199 cp-7.59.0 Nov 10, 2025
@georgewrmarshall georgewrmarshall force-pushed the revert-font-preloader-changes branch from a6b0611 to 8378ad8 Compare November 10, 2025 20:47
@georgewrmarshall georgewrmarshall removed the request for review from a team November 10, 2025 21:07
@georgewrmarshall
Copy link
Contributor Author

Quality Gate Failed Quality Gate failed

Failed conditions 40.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

In the PR that we are reverting was the testing coverage for the font preloader. Ignoring Sonar Qube coverage check because of this

vinnyhoward
vinnyhoward previously approved these changes Nov 11, 2025
owencraston
owencraston previously approved these changes Nov 11, 2025
@georgewrmarshall georgewrmarshall added this pull request to the merge queue Nov 11, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 11, 2025
@georgewrmarshall georgewrmarshall added this pull request to the merge queue Nov 11, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 11, 2025
@georgewrmarshall georgewrmarshall force-pushed the revert-font-preloader-changes branch from 8378ad8 to 09ccad9 Compare November 11, 2025 18:47
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
40.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@georgewrmarshall georgewrmarshall added this pull request to the merge queue Nov 11, 2025
Merged via the queue into main with commit 84bd50b Nov 11, 2025
149 of 152 checks passed
@georgewrmarshall georgewrmarshall deleted the revert-font-preloader-changes branch November 11, 2025 21:17
@github-actions github-actions bot locked and limited conversation to collaborators Nov 11, 2025
@metamaskbot metamaskbot added the release-7.60.0 Issue or pull request that will be included in release 7.60.0 label Nov 11, 2025
@vinnyhoward vinnyhoward changed the title chore: revert font preloader changes from #21199 cp-7.59.0 chore: cp-7.59.0 revert font preloader changes from #21199 Nov 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.60.0 Issue or pull request that will be included in release 7.60.0 size-L skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. team-design-system All issues relating to design system in Mobile

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Font changes from bold to regular

6 participants