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] Conditionally change the default fonts available based on user consent #44532

Conversation

nefeline
Copy link
Member

@nefeline nefeline commented Feb 11, 2024

Submission Review Guidelines:

Changes proposed in this Pull Request:

Introduce the feature for conditionally changing the default font pairings available based on user consent and the WordPress version.

Closes #44187

How to test the changes in this Pull Request:

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

Initial Setup

  1. Enable the WooCommerce Beta Tester plugin if you don't have it enabled yet
  2. On your Dashboard, head over to Tools > WCA Test Helper > Features and enable the customize-store
  3. Ensure you have the Gutenberg plugin installed from the latest trunk (or install it from this zip file: gutenberg.zip

1. The store owner gave consent (woocommerce_allow_tracking is true) but has an outdated version of WordPress/Gutenberg or Gutenberg is not installed

  1. Access the database for your local install and make sure the 'woocommerce_allow_tracking' option is set to yes:
    select * from wp_options where option_name = 'woocommerce_allow_tracking';
Screenshot 2024-02-23 at 12 00 06
  1. Since WP 6.5 wasn't released yet, just make sure the Gutenberg plugin is disabled in your local install.
  2. Access your Dashboard and head over to WooCommerce > Home
  3. Click on the "Customize Your Store" button
  4. Click on "Start designing"
  5. Make sure you see the following:
Screenshot 2024-02-23 at 11 03 21
Screen.Recording.2024-02-23.at.10.50.58.mov

⚠️ At this point, WordPress 6.5 hasn't been released yet, so the store owner is led to the WordPress core update screen, but they can't really perform any actions just yet: this is expected. This feature is only shipping with WooCommerce 8.8, after the release of WordPress 6.5, so we should be all set here.

2. User did not give us consent (woocommerce_allow_tracking is false) and also has an outdated version of WordPress (earlier than 6.5).

  1. Access the database for your local install and make sure the 'woocommerce_allow_tracking' option is set to no:
    select * from wp_options where option_name = 'woocommerce_allow_tracking';
Screenshot 2024-02-23 at 11 50 18
  1. Ensure the Gutenberg plugin is DISABLED in your local install.
  2. Access your Dashboard and head over to WooCommerce > Home
  3. Click on the "Customize Your Store" button
  4. Click on "Start designing"
  5. Make sure you see the following:

Copy on the sidebar:

Screenshot 2024-02-23 at 11 02 13

Copy for the newly introduced Opt-in modal:

Screenshot 2024-02-23 at 11 09 00

The checkbox is unchecked, the Opt-in button is disabled:

Screenshot 2024-02-23 at 11 10 11
Screen.Recording.2024-02-23.at.10.57.26.mov

3. User did not give us consent (woocommerce_allow_tracking is false) and has the latest version of WP/GB installed.

  1. Access the database for your local install and make sure the 'woocommerce_allow_tracking' option is set to no:
    select * from wp_options where option_name = 'woocommerce_allow_tracking';
Screenshot 2024-02-23 at 11 50 18
  1. Make sure the Gutenberg plugin is ACTIVE on your local install.
  2. Access your Dashboard and head over to WooCommerce > Home
  3. Click on the "Customize Your Store" button
  4. Click on "Start designing"
  5. Make sure you see the following:

Copy on the sidebar and available font pairings:

Screenshot 2024-03-07 at 14 59 02

The two font pairings are being inherited from the TT4 theme:

  • Cardo (H), System sans-serif (B) — TT4 default
  • Inter (H), Cardo (B) — TT4 Fossil Style

⚠️ Known issue: the font pairings on the sidebar are not showing the correct styles & the body text in the editor either: a separate PR will be opened to address this.

4. User gave consent and has the latest version of WordPress and/or GB plugin installed

  1. Access the database for your local install and make sure the 'woocommerce_allow_tracking' option is set to yes:
    select * from wp_options where option_name = 'woocommerce_allow_tracking';
Screenshot 2024-02-23 at 12 00 06
  1. Ensure the Gutenberg plugin is ENABLED in your local install.
  2. Access your Dashboard and head over to WooCommerce > Home
  3. Click on the "Customize Your Store" button
  4. Click on "Start designing"
  5. Make sure you see the following:
Screenshot 2024-02-23 at 11 29 38

Question to @verofasulo: I believe the 2 font pairings from the TT4 theme should be preserved in the list of options in this case instead of replacing them with our default ones, WDYT?

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

Customize Your Store: Introduce the feature for conditionally changing the default font pairings available based on user consent and the WordPress version.

Comment

@nefeline nefeline self-assigned this Feb 11, 2024
@nefeline nefeline added plugin: woocommerce Issues related to the WooCommerce Core plugin. focus: customize-your-store Issues related to the Customize Your Store onboarding flow. type: enhancement The issue is a request for an enhancement. labels Feb 11, 2024
Copy link
Contributor

github-actions bot commented Feb 11, 2024

Test Results Summary

Commit SHA: d14a3fe

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

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.

@github-actions github-actions bot removed the plugin: woocommerce Issues related to the WooCommerce Core plugin. label Feb 11, 2024
…default-fonts-available-based-on-user-consent
…Update the link to download the latest version of the core of WordPress.
…default-fonts-available-based-on-user-consent
@nefeline nefeline marked this pull request as ready for review February 23, 2024 11:12
@woocommercebot woocommercebot requested review from a team and kmanijak and removed request for a team February 23, 2024 11:12
Copy link
Contributor

github-actions bot commented Feb 23, 2024

Hi @albarin, @gigitux, @kmanijak,

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

@nefeline nefeline added the plugin: woocommerce Issues related to the WooCommerce Core plugin. label Feb 23, 2024
…edirect is not triggered before the option is saved to the database.
…default-fonts-available-based-on-user-consent
@nefeline nefeline requested review from gigitux and removed request for kmanijak February 25, 2024 23:55
@nefeline nefeline added the status: blocker Blockers for other work. label Feb 25, 2024
Copy link
Contributor

@albarin albarin left a comment

Choose a reason for hiding this comment

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

Great job!

@gigitux gigitux merged commit fe0b918 into trunk Feb 26, 2024
30 checks passed
@gigitux gigitux deleted the 44187-cys-on-core-conditionally-change-the-default-fonts-available-based-on-user-consent branch February 26, 2024 15:01
@github-actions github-actions bot added this to the 8.8.0 milestone Feb 26, 2024
@github-actions github-actions bot added the needs: analysis Indicates if the PR requires a PR testing scrub session. label Feb 26, 2024
@alvarothomas alvarothomas added needs: internal testing Indicates if the PR requires further testing conducted by Solaris 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 26, 2024
@verofasulo
Copy link

Question to @verofasulo: I believe the 3 font pairings from the TT4 theme should be preserved in the list of options in this case instead of replacing them with our default ones, WDYT?

Good question, @nefeline. Right now, we are using TT4 as the default theme for patter assembler, but we could use Creatio, Assembler 2 or whatever other theme. The logic you proposed should be in place once we implement the pattern assembler experience for all the block themes IMO. Right now, it's detached from a specific theme and its style, so I would default to what we have already implemented. Thanks!

Konamiman pushed a commit that referenced this pull request Mar 13, 2024
…on user consent (#44532)

* Add upgrade notice for the fonts feature whenever WP is outdateed or the user did not grant us consent.

* Add styles for the woocommerce-customize-store_sidebar-typography-upgrade-notice class.

* Update the upgrade conditionals.

* Introduce the new modal for the user to opt in to usage tracking.

* Add the CSS for the woocommerce-customize-store__opt-in-usage-tracking-modal

* Implement the sendEvent to OptInDataSharing

* Fix typo.

* Make sure the opt in button is disabled if the opt in checkbox is unchecked.

* Update the styles for the woocommerce-customize-store__opt-in-usage-tracking-modal

* Update the styles to allow changes to the link

* Set Cardo + System Sans-serif as the default fonts if the usage tracking wasn't allowed.

* Set Cardo + System Sans-serif as the default fonts if the Font Library is unavailable.

* Add the Jost + Instrument Sans font pairing.

* Update copy for the upgrade notice to remove mentions to Gutenberg.

* Replace the Link component with the Button component.

* Ensure the woocommerce_allow_tracking option is properly updated whenever the user opts in.

* Add the new Inter + Cardo font pairing.

* Redirect user to the loading screen so all relevant fonts can be installed for them.

* Render the FontPairing component only if the isFontLibraryAvailable. Update the link to download the latest version of the core of WordPress.

* update the fontPairings constant.

* Update styles for buttons and links.

* Add changefile(s) from automation for the following project(s): woocommerce

* Make sure the dispatch for updating the option is async so the page redirect is not triggered before the option is saved to the database.

* Fix lint error

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Alba Rincón <alba.rincon@automattic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
focus: customize-your-store Issues related to the Customize Your Store onboarding flow. needs: internal testing Indicates if the PR requires further testing conducted by Solaris plugin: woocommerce Issues related to the WooCommerce Core plugin. status: analysis complete Indicates if a PR has been analysed by Solaris status: blocker Blockers for other work. type: enhancement The issue is a request for an enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CYS on Core] Conditionally change the default fonts available based on user consent.
5 participants