-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Preview limited Global Styles by default #76661
Conversation
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: Sections (~71 bytes removed 📉 [gzipped])
Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to. Legend What is parsed and gzip size?Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory. Generated by performance advisor bot at iscalypsofastyet.com. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Should we wait shipping this until we clarify the nudges in the Post Editor? 🤔
@BogdanUngureanu I think we should yeah. I started adding the notices locally but it's not quite ready yet. |
This PR modifies the release build for editing-toolkit To test your changes on WordPress.com, run To deploy your changes after merging, see the documentation: PCYsg-mMA-p2 |
I'm unsure about 'Remove custom styles' it looks like a link, just like it does in other places. In those other places though it is a link, here it performs a destructive (but undoable) action |
I know we want to encourage people more to Upgrading than resetting. But Upgrade now looks like a button and acts like a link, and Remove custom styles looks like a link and acts like a button. Maybe they should both be buttons but with Upgrade now being a primary button and Remove custom styles being less emphasised. |
apps/editing-toolkit/editing-toolkit-plugin/wpcom-global-styles/index.php
Outdated
Show resolved
Hide resolved
apps/editing-toolkit/editing-toolkit-plugin/wpcom-global-styles/notice.js
Outdated
Show resolved
Hide resolved
Even more, what if we move that button directly in the preview section? Is it possible to add another item to that menu? This way, both modes (preview with styles and preview without styles) are in the same place. |
Looks like this now needs a very quick rebase |
apps/editing-toolkit/editing-toolkit-plugin/wpcom-global-styles/notices.js
Outdated
Show resolved
Hide resolved
apps/editing-toolkit/editing-toolkit-plugin/wpcom-global-styles/notices.js
Outdated
Show resolved
Hide resolved
apps/editing-toolkit/editing-toolkit-plugin/wpcom-global-styles/notices.js
Outdated
Show resolved
Hide resolved
apps/editing-toolkit/editing-toolkit-plugin/wpcom-global-styles/notices.js
Show resolved
Hide resolved
apps/editing-toolkit/editing-toolkit-plugin/wpcom-global-styles/notices.js
Show resolved
Hide resolved
Gutenberg edge now offers support for customizing Pages in Site Editor. Should we remove the |
Wouldn't that be also the case when using the "Reset to defaults" button from the Styles sidebar (which is also available when editing pages in the site editor)? Since they have a option to edit styles globally across the whole site, I think it's ok to have an action in the notice that affects the global styles. |
I think it's debatable. We are adding this option for users that aren't familiar with Global Styles. Otherwise, they'll just use the "Reset" from the Global Styles panel, so some confusion might be possible since they aren't familiar with how GS work. Also, the notice is part of the editor UI whereas the reset is part of the Global Styles panel. Some users might consider that since the notice is in the editor, it might only affect that specific page. And, who knows, maybe that GS panel shouldn't be displayed for pages, in core. It's a pretty new addition (the pages) and most likely will be refined in the future. |
That's helpful - the venn diagram of users familiar with GS gating and users that know how to reset GS is probably a circle. It's not the sole reason - it's also much more convenient for everyone else.
I can't see hiding GS panel on the GS roadmap, GB phase 2 roadmap or the plan for reintroducing content editing to the site editor. In the absence of it being mentioned I wouldn't place any weight on the GS panel maybe disappearing, I think that would also make a pretty weird and confusing UI. It wouldn't be possible to work on some GS for a combination of blocks that only appears on one page at present, but you know you're going to add more pages in future. If it does happen, we'll react to it then. Lets not block something on hypothetical unknown futures especially if we can quickly and easily react to it if it materialises. I think it's ok to have an action in the notice that affects the whole site. If it turns out to be a problem we can remove it. We could also consider rewording the button to be clear that it applies globally, but I'm not sure that is necessary myself. |
Is not that also true when editing the homepage? How would you differentiate users who think that are editing only one page from those who are editing a site? Or putting it in a different way, check these two videos: Screen.Recording.2023-05-17.at.11.30.13.movScreen.Recording.2023-05-17.at.11.30.49.movDo you think we should hide the action in the second scenario despite editing exactly the same content? |
…l-styles-default # Conflicts: # apps/editing-toolkit/editing-toolkit-plugin/wpcom-global-styles/index.php
Just did another testing session and everything looks nice! Let's ship it! 🐑 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non-blocking query: When removing styles I get a snack notice saying 'Site updated', should/could that message be something more relevant like 'Site customized styles updated'?
Great work! This is great to see almost shipped. The only reservation I have at this point is that perhaps it should have a close button that temporarily dismisses the notice. Now that it's big and in the forefront, this could be a problem. People might just want it out of the way because they are working on something not styles related and accidentally click "Remove all styles" just to dismiss the notice. Not sure if this is still relevant but we do have a doc on removing custom styles https://wordpress.com/support/using-styles/#reset-all-styles |
We don't have control over that notice, it's generated by Core: https://github.com/WordPress/gutenberg/blob/a0a1fd51e542b5c97f166f7be1679c2858dbb96e/packages/editor/src/components/entities-saved-states/index.js#L211
I think that's a good idea! I'll add it before shipping this.
Nice! I'll add a link to that in a follow-up PR. |
This Pull Request is now available for translation here: https://translate.wordpress.com/deliverables/7995550 Thank you @mmtr for including a screenshot in the description! This is really helpful for our translators. |
- Custom styles are previewed by default, so there is less confusion around the site-editor and the front-end not matching up. - Both the site editor and the post editor display now a global notice when Global Styles are limited. Previous sidebar notices in the site editor have been removed. This notice has the following actions: - Upgrade now (primary): Visible in both editors – It opens the Plans page in a new tab. - Remove custom styles (link): Visible in the site editor only – It resets the styles to defaults (it’s easy and safe to do so in the editor). Once we have a support page explaining how to remove custom styles, we can show it in the post editor too. - Add a new notice to the view canvas. - Updates the E2E test to use the view canvas mode since that's the only place where we have a fragile CSS selector.
Translation for this Pull Request has now been finished. |
Fixes https://github.com/Automattic/dotcom-forge/issues/2267
Proposed Changes
Frontend
Site editor (view canvas)
Site editor (edit canvas)
Post editor
Testing Instructions
/setup/newsletter
.simpleSiteFreePlanUser
user.yarn workspace wp-e2e-tests test -- specs/fse/fse__limited-global-styles.ts
yarn workspace wp-e2e-tests test:mobile -- specs/fse/fse__limited-global-styles.ts