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

[CYS on Core] Ensure the size of fonts is not affected by the font family changes #44424

Merged
merged 4 commits into from Feb 8, 2024

Conversation

albarin
Copy link
Contributor

@albarin albarin commented Feb 7, 2024

Submission Review Guidelines:

Changes proposed in this Pull Request:

This PR resets the typography settings from the user styles before applying the new ones to avoid influencing one another.

Closes #44259

How to test the changes in this Pull Request:

Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:

  1. Ensure the WooCommerce Beta Tester plugin is installed and activated (available on this monorepo).
  2. Head over to /wp-admin/tools.php?page=woocommerce-admin-test-helper and enable customize-store feature flag.
  3. Visit the wp-admin/admin.php?page=wc-admin&path=/customize-store
  4. Follow the process.
  5. Click on Change fonts.
  6. Click on Montserrat + Arvo.
  7. Click on Albert Sans + Lora, the size is the same.
  8. Click on Rubik + Inter and you'll see the font is bigger.
  9. Click back on Albert Sans + Lora and check the font is the same size compared to the initial Albert Sans + Lora pairing (clicking on Montserrat + Arvo should not influence the size of Albert Sans + Lora).
  10. Go to Change the color palette and select a new one.
  11. Go back to Change fonts and select a new one.
  12. Make sure the color palette is kept after selecting the font.
Before After
https://github.com/woocommerce/woocommerce/assets/15730971/62553860-ca65-4476-b6e3-d615a4308ae7 https://github.com/woocommerce/woocommerce/assets/186112/f62c33c1-66f9-41ef-ab93-6de41e35aee2

Changelog entry

  • Automatically create a changelog entry from the details below.

Significance

  • Patch
  • Minor
  • Major

Type

  • Fix - Fixes an existing bug
  • Add - Adds functionality
  • Update - Update existing functionality
  • Dev - Development related task
  • Tweak - A minor adjustment to the codebase
  • Performance - Address performance issues
  • Enhancement - Improvement to existing functionality

Message

CYS - Ensure the size of fonts is not affected by a font family change.

Comment

Copy link
Contributor

github-actions bot commented Feb 7, 2024

Test Results Summary

Commit SHA: 15a1b4e

Test 🧪Passed ✅Failed 🚨Broken 🚧Skipped ⏭️Unknown ❔Total 📊Duration ⏱️
API Tests25900202610m 37s
E2E Tests304001003146m 47s

To view the full API test report, click here.
To view the full E2E test report, click here.
To view all test reports, visit the WooCommerce Test Reports Dashboard.

@albarin albarin changed the title Fix fonts affecting the size of each other [CYS on Core] Ensure the size of fonts is not affected by the font family changes Feb 7, 2024
@github-actions github-actions bot added the plugin: woocommerce Issues related to the WooCommerce Core plugin. label Feb 7, 2024
@albarin albarin marked this pull request as ready for review February 7, 2024 13:39
@woocommercebot woocommercebot requested a review from a team February 7, 2024 13:42
Copy link
Contributor

github-actions bot commented Feb 7, 2024

Hi @chihsuan, @gigitux, @nefeline, @woocommerce/woo-fse

Apart from reviewing the code changes, please make sure to review the testing instructions as well.

You can follow this guide to find out what good testing instructions should look like:
https://github.com/woocommerce/woocommerce/wiki/Writing-high-quality-testing-instructions

user.styles,
variation.styles
),
styles: variation.styles,
Copy link
Member

Choose a reason for hiding this comment

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

Hey @albarin Thanks for working on this! 👍

Unlike the GB site editor, I use mergeBaseAndUserConfigs here because we've split style variations into font and color parts. We need to preserve the color changes when updating the font and vice versa.

I tested this PR on JN, and you can see when I change the color and then update the font, the color gets reset. I think this is a bit tricky. Perhaps a way to fix it is to create a custom merge function. 🤔

Screen.Recording.2024-02-08.at.11.27.15.mov

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @chihsuan, great feedback!
I've addressed it 15a1b4e let me know what you think.
What I'm doing it remove all the typhography settings from the styles before applying new ones.

@albarin albarin marked this pull request as draft February 8, 2024 10:27
@albarin albarin requested a review from chihsuan February 8, 2024 10:45
@albarin albarin marked this pull request as ready for review February 8, 2024 10:46
Copy link
Member

@nefeline nefeline left a comment

Choose a reason for hiding this comment

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

I'm pre-approving as everything is working as described (great job!), but I'll defer to @chihsuan for the code review, as he's way more versed than I at this area of the codebase :)

Copy link
Member

@chihsuan chihsuan left a comment

Choose a reason for hiding this comment

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

Code looks good. Thanks! 💯

@albarin albarin merged commit 5af5f9b into trunk Feb 8, 2024
36 checks passed
@albarin albarin deleted the 44259-fix-font-size branch February 8, 2024 12:38
@github-actions github-actions bot added this to the 8.7.0 milestone Feb 8, 2024
@github-actions github-actions bot added the needs: analysis Indicates if the PR requires a PR testing scrub session. label Feb 8, 2024
@veljkho veljkho added needs: external testing Indicates if the PR requires further testing conducted by testers external to the development team. status: analysis complete Indicates if a PR has been analysed by Solaris and removed needs: analysis Indicates if the PR requires a PR testing scrub session. labels Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: external testing Indicates if the PR requires further testing conducted by testers external to the development team. plugin: woocommerce Issues related to the WooCommerce Core plugin. status: analysis complete Indicates if a PR has been analysed by Solaris
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CYS on Core] Ensure the size of fonts is not affected by the font family changes
4 participants