Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add New Fonts #12656

Merged
merged 37 commits into from
Dec 1, 2022
Merged

Add New Fonts #12656

merged 37 commits into from
Dec 1, 2022

Conversation

Luke9389
Copy link
Contributor

@Luke9389 Luke9389 commented Nov 10, 2022

Details

This PR changes the fonts we use in App.
The new font and old font are pretty similar. The best sigil I've found to tell them apart is @.

Old New
Screen Shot 2022-11-17 at 2 34 09 PM Screen Shot 2022-11-17 at 2 34 15 PM

Fixed Issues

$ #12443

Tests

  • Verify that no errors appear in the JS console

Run all the environments and check that the font looks right.

QA Steps

  • Verify that no errors appear in the JS console

Verify that the fonts look the same as the screenshots.

PR Author Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified tests pass on all platforms & I tested again on:
    • iOS / native
    • Android / native
    • iOS / Safari
    • Android / Chrome
    • MacOS / Chrome
    • MacOS / Desktop
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product was added in all src/languages/* files
    • I verified any copy / text that was added to the app is correct English and approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

PR Reviewer Checklist

The reviewer will copy/paste it into a new comment and complete it after the author checklist is completed

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified tests pass on all platforms & I tested again on:
    • iOS / native
    • Android / native
    • iOS / Safari
    • Android / Chrome
    • MacOS / Chrome
    • MacOS / Desktop
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product was added in all src/languages/* files
    • I verified any copy / text that was added to the app is correct English and approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots

Web

Before After
Screen Shot 2022-11-17 at 12 27 25 PM Screen Shot 2022-11-17 at 12 25 54 PM

Mobile Web - Chrome

Mobile Web - Safari

Desktop

iOS

Screen Shot 2022-11-17 at 2 09 49 PM

Android

Screen Shot 2022-11-21 at 2 42 30 PM

@Luke9389 Luke9389 requested a review from a team as a code owner November 10, 2022 22:29
@Luke9389 Luke9389 self-assigned this Nov 10, 2022
@melvin-bot melvin-bot bot requested review from Gonals and sobitneupane and removed request for a team November 10, 2022 22:30
@melvin-bot
Copy link

melvin-bot bot commented Nov 10, 2022

@sobitneupane @Gonals One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@Luke9389 Luke9389 changed the title [HOLD] Add New Fonts Add New Fonts Nov 15, 2022
@Luke9389
Copy link
Contributor Author

This PR is no longer on HOLD but will likely take longer bc we're testing a different strategy for loading fonts on web.

@shawnborton shawnborton mentioned this pull request Nov 15, 2022
95 tasks
@Luke9389
Copy link
Contributor Author

Got the webpack fonts working 🎉

@Luke9389 Luke9389 changed the title Add New Fonts [No QA] Add New Fonts Nov 17, 2022
@Luke9389
Copy link
Contributor Author

@roryabraham all those webpack recommendations have been implemented. 👍

@Luke9389 Luke9389 requested a review from roryabraham November 30, 2022 00:37
@shawnborton
Copy link
Contributor

Why does this one have No QA in the title? I think we should have thorough screenshots for this one.

@sobitneupane
Copy link
Contributor

Screenshots/Videos

Web
Screen.Recording.2022-11-30.at.14.48.42.mov
Mobile Web - Chrome
Screen.Recording.2022-11-30.at.14.54.03.mov
Mobile Web - Safari
Screen.Recording.2022-11-30.at.15.01.07.mov
Desktop
Screen.Recording.2022-11-30.at.14.51.11.mov
iOS
Screen.Recording.2022-11-30.at.14.58.25.mov
Android
Screen.Recording.2022-11-30.at.15.05.18.mov

@sobitneupane
Copy link
Contributor

@Luke9389 Looks like the issue here resurfaced.

Some of the texts do not appear highlighted in android which is not the case in mWeb and other platforms.

Android mWeb Chrome mWeb IOS
Screenshot_1669800208 Screenshot_1669801185 image

@shawnborton
Copy link
Contributor

For Web in general (including mWeb), can we also be sure to have font smoothing on like so:

-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;

@roryabraham
Copy link
Contributor

For Web in general (including mWeb), can we also be sure to have font smoothing on like so:

@shawnborton can you explain why? Asking earnestly because font-smoothing is non-standard and not on a standards track: https://developer.mozilla.org/en-US/docs/Web/CSS/font-smooth

Do not use it on production sites facing the Web

@shawnborton
Copy link
Contributor

Oh really? We've been using it on all of our sites for years. It makes the font appear as the font is intended to appear as opposed to looking a bit rough.

@Luke9389
Copy link
Contributor Author

Luke9389 commented Dec 1, 2022

We've had

* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

at the bottom of our font file since the get-go, so I'm just going to leave it in place.

@shawnborton
Copy link
Contributor

Okay awesome, thanks for confirming.

@Luke9389
Copy link
Contributor Author

Luke9389 commented Dec 1, 2022

Hmm, I'm getting the correct bold font on my emulator :/
Screen Shot 2022-11-30 at 4 23 17 PM

@Luke9389
Copy link
Contributor Author

Luke9389 commented Dec 1, 2022

@sobitneupane would you be willing to retest? What device are you emulating?

@Luke9389
Copy link
Contributor Author

Luke9389 commented Dec 1, 2022

@sobitneupane is it possible you weren't on the latest commit?

@Luke9389 Luke9389 changed the title [No QA] Add New Fonts Add New Fonts Dec 1, 2022
@sobitneupane
Copy link
Contributor

@sobitneupane would you be willing to retest?

Retested it on real device (Android Version 8.1.0, Samsung Galaxy 7J Max). Got the same result.

What device are you emulating?

Pixel 5 API 29

@sobitneupane is it possible you weren't on the latest commit?

I am on latest commit (config stuff)

@shawnborton
Copy link
Contributor

Can we get an update on this one? Will this be merged today?

@Luke9389
Copy link
Contributor Author

Luke9389 commented Dec 1, 2022

Hey, I think we should merge this.
I'm not able to reproduce the no-bold-on-android problem that @sobitneupane is seeing, though I definitely think we should fix it.
Perhaps it's best to do that as a separate issue so we can get this pushed out now.

Copy link
Contributor

@roryabraham roryabraham left a comment

Choose a reason for hiding this comment

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

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified tests pass on all platforms & I tested again on:
    • iOS / native
    • Android / native
    • iOS / Safari
    • Android / Chrome
    • MacOS / Chrome
    • MacOS / Desktop
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product was added in all src/languages/* files
    • I verified any copy / text that was added to the app is correct English and approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Web image image image
Mobile Web - Chrome https://user-images.githubusercontent.com/47436092/205180311-f40bc73f-e712-45be-9179-5f11cc66de09.jpeg" alt="" width="360px />
<img src="https://user-images.githubusercontent.com/47436092/205180321-ab3d3c70-710a-4088-9f42-67224b0eb45d.jpeg" alt="" width="360px />

Desktop image
iOS

<img src="https://user-images.githubusercontent.com/47436092/205182049-65d1d0cc-1d0c-4345-97c6-934a9e0318d9.jpeg" alt="" width="360px />
<img src="https://user-images.githubusercontent.com/47436092/205182065-0ebfb58c-931c-40e1-bd25-feab00a594c1.jpeg" alt="" width="360px />
<img src="https://user-images.githubusercontent.com/47436092/205182072-40579328-5306-4e82-9f01-92e780be16b0.jpeg" alt="" width="360px />

Android

<img src="https://user-images.githubusercontent.com/47436092/205182922-1072d4b6-34c9-4aec-9e9d-78c1b4ea3f8c.png" alt="" width="360px />
<img src="https://user-images.githubusercontent.com/47436092/205182903-e09ed63a-1880-4a26-812d-e5d0c0026b2b.png" alt="" width="360px />

@roryabraham
Copy link
Contributor

roryabraham commented Dec 1, 2022

BUG: (iOS) lowercase letters that extend down, like g an j, are cut off in the What's it for TextInput

Edit: This actually is happening on every TextInput:

IMG_5AC0067EFD12-1

@roryabraham
Copy link
Contributor

check is being broken by an earlier checklist. My reviewer checklist is complete so I'm going to ignore this failure and move on for now

@roryabraham roryabraham merged commit c27b78b into main Dec 1, 2022
@roryabraham roryabraham deleted the luke-add-new-fonts branch December 1, 2022 23:58
@OSBotify
Copy link
Contributor

OSBotify commented Dec 2, 2022

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@luacmartins
Copy link
Contributor

App deploy for web is throwing an error and fonts seem borked on staging - https://expensify.slack.com/archives/C07J32337/p1670008137700449

@OSBotify
Copy link
Contributor

OSBotify commented Dec 2, 2022

🚀 Deployed to staging by @roryabraham in version: 1.2.36-0 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@OSBotify
Copy link
Contributor

OSBotify commented Dec 8, 2022

🚀 Deployed to production by @francoisl in version: 1.2.36-4 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@marcaaron marcaaron mentioned this pull request Dec 31, 2022
54 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants