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

3.19 - Preload Fonts - User Interface part #7239

Open
piotrbak opened this issue Jan 26, 2025 · 11 comments
Open

3.19 - Preload Fonts - User Interface part #7239

piotrbak opened this issue Jan 26, 2025 · 11 comments
Labels
effort: [S] 1-2 days of estimated development time
Milestone

Comments

@piotrbak
Copy link
Contributor

User Story
As an admin, I want to see the new UI of preload fonts so that I can enable the feature

Acceptance Criteria

@piotrbak piotrbak added this to the 3.19-prealpha milestone Jan 26, 2025
@piotrbak piotrbak changed the title 3.19 - User Interface part 3.19 - Preload Fonts - User Interface part Jan 26, 2025
@Miraeld Miraeld self-assigned this Jan 27, 2025
@Miraeld
Copy link
Contributor

Miraeld commented Jan 27, 2025

Scope a solution

About the setting page layout,
We need to move this to this block so the section description will be moved under the self-host checkbox.

Then to create a new checkbox:
add the following:

'auto_preload_fonts'       => [
	'type'              => 'checkbox',
	'label'             => __( 'Preload Fonts', 'rocket' ),
	'section'           => 'font_optimization_section',
	'page'              => 'media',
	'default'           => 0,
	'sanitize_callback' => 'sanitize_checkbox',
],

before this.

In case we need to hide the preload_fonts field:
Add preload_fonts to this

$hidden_fields = [
list.

Then, on WP Rocket upgrade, if preload_fonts was enable, we would like to have the new option enabled. For this,
In this class https://github.com/wp-media/wp-rocket/blob/3a73b77cf8ba024601cf07c4341497975d459847/inc/Engine/Admin/Settings/Subscriber.php we need to add a callback on wp_rocket_upgrade , it could be maybe_enable_auto_preload_fonts and it would check the current value of preload_fonts to enable or not auto_preload_fonts.


However, @piotrbak I don't see in the notion any mention of the description of this new checkbox. I can see there is one on this screenshot: https://www.notion.so/wpmedia/Preload-fonts-126ed22a22f0808ba45ad3673c2c176b?pvs=4#17ced22a22f08080a661d0c15b0c75d6
but where does the more info point + where does the need help should point ?

@piotrbak
Copy link
Contributor Author

@Miraeld Pinged Cami about the docs, we should get the answer very soon. If not, we can create a subtask in order not to block the issue and not to forget about it

@jeawhanlee
Copy link
Contributor

@piotrbak if preload fonts fields was not empty after update this would be checked automatically right?

@piotrbak
Copy link
Contributor Author

Yes, that's a part of the different story. But can be included here if that's a very quick one

@jeawhanlee
Copy link
Contributor

jeawhanlee commented Jan 29, 2025

I don't think we will be using the same id as the preload_fonts because we already using this and it returns an array at the moment, I think we can use something different maybe auto_preload_fonts then when we get to the story that considers the old option during upgrade we can change this.

cc @wordpressfan

@wordpressfan
Copy link
Contributor

Totally agree with @jeawhanlee we need to name it differently, auto_preload_fonts is a good name.
Also plz note that if we removed preload_fonts from the list of settings, I think once we update, this option will be removed, so we need to validate this and if needed we may add it to hidden settings, to have it in exported settings file, this will be helpful if the user wanted to rollback and need to export settings before that.

@jeawhanlee
Copy link
Contributor

@Miraeld can you update the grooming to reflect this? Thanks

@Miraeld
Copy link
Contributor

Miraeld commented Jan 29, 2025

@jeawhanlee @wordpressfan I've updated the grooming

@jeawhanlee
Copy link
Contributor

Then, on WP Rocket upgrade, if preload_fonts was enable, we would like to have the new option enabled. For this,
In this class https://github.com/wp-media/wp-rocket/blob/3a73b77cf8ba024601cf07c4341497975d459847/inc/Engine/Admin/Settings/Subscriber.php we need to add a callback on wp_rocket_upgrade , it could be maybe_enable_auto_preload_fonts and it would check the current value of preload_fonts to enable or not auto_preload_fonts.

@Miraeld We will not handle that in this task as we have it in another according to @piotrbak here so we can take it out of the grooming.

Other than that LGTM, once grooming is updated, you can move it to ToDo. Thanks

@Miraeld
Copy link
Contributor

Miraeld commented Jan 31, 2025

@jeawhanlee as Piotr said

But can be included here if that's a very quick one

It is a quick one in a way, it could be included here. Don't you think ?

@jeawhanlee
Copy link
Contributor

Ok, Then

@Miraeld Miraeld removed their assignment Jan 31, 2025
@Miraeld Miraeld added the effort: [S] 1-2 days of estimated development time label Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort: [S] 1-2 days of estimated development time
Projects
None yet
Development

No branches or pull requests

4 participants