-
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
Global Styles: Show notice in privacy settings #69242
Global Styles: Show notice in privacy settings #69242
Conversation
…obal styles in use and does not have a paid plan
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: App Entrypoints (~3644 bytes added 📈 [gzipped])
Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used. Sections (~9473 bytes added 📈 [gzipped])
Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to. Async-loaded Components (~63 bytes removed 📉 [gzipped])
React components that are loaded lazily, when a certain part of UI is displayed for the first time. 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. |
…the state of Global Styles Info
@@ -260,6 +261,12 @@ export class SiteSettingsFormGeneral extends Component { | |||
} ); | |||
}; | |||
|
|||
trackAdvancedCustomizationUpgradeClick = () => { | |||
this.props.recordTracksEvent( 'calypso_global_styles_gating_settings_notice_upgrade_click', { |
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.
We'll need to add this event to Tracks.
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 |
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.
Nice work! Overall this tests very well, but I think we should address a few things before shipping.
- You need to consider that the copy of the notice might be longer in other languages and wrapped in two lines. The layout is a bit off in such cases right now:
-
I think we should add the endpoint in a separate PR so we can deploy a new ETK version before deploying the Calypso changes that start fetching data from it
-
Looks like we make a recurrent request to the endpoint. That's not usually our approach when fetching data from an endpoint due to performance reasons (the only exception is when the fetched data is very critical and needs to be reflected in real time, but this not the case). The data should be loaded only once when the component first renders. I realize this can cause issues like the notice not showing up if you have the settings page open and are editing the Global Styles in a separate tab, but that's edge-case scenario and it's fine to don't cover it.
...toolkit/editing-toolkit-plugin/wpcom-global-styles/api/class-global-styles-info-rest-api.php
Outdated
Show resolved
Hide resolved
...toolkit/editing-toolkit-plugin/wpcom-global-styles/api/class-global-styles-info-rest-api.php
Outdated
Show resolved
Hide resolved
...toolkit/editing-toolkit-plugin/wpcom-global-styles/api/class-global-styles-info-rest-api.php
Outdated
Show resolved
Hide resolved
...toolkit/editing-toolkit-plugin/wpcom-global-styles/api/class-global-styles-info-rest-api.php
Outdated
Show resolved
Hide resolved
Co-authored-by: Miguel Torres <miguel.torres@automattic.com>
No need to do this. |
Co-authored-by: Miguel Torres <miguel.torres@automattic.com>
Exactly how are you making it make more than one request? I'm unable to reproduce it. Maybe what you're experiencing is related to how requests.mp4 |
I got a WSOD if the endpoint is not live:
Oh sorry, I thought it was a recurring request, but apparently there is a new request every time I come back to the tab after switching to a different tab: Screen.Recording.2022-10-21.at.15.21.08.movIt's not a big deal, but I don't think that's the normal behavior we have in other components. |
Do you happen to know how to avoid that? It has to be related to |
…cted when the translation is long
This should be working now for longer translated texts. |
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.
Thanks for addressing all the feedback!
Looks like there is a regression in the notices showed during onboarding.
For example, /setup/designSetup?siteSlug=<SITE_SLUG>
used to display a premium badge on non-default variations but it's missing:
Also, when going to /setup/newsletterSetup?flow=newsletter
there is a request to the API endpoint despite the site not being created. Where is that siteId coming from?
I just created a new site, added the blog sticker and started the design step during the site setup process. However, I cannot reproduce it now, so maybe I was half-sandboxed, or maybe it was a caching issue. I guess it's fine to ignore for now.
No idea how the newsletter flow starts, but I think it's something that can happen in a real-time scenario since we cannot guarantee that the user didn't visit Calypso previously (even if the flows starts outside of Calypso). I think the problem is that all these onboarding flows use a different way of storing site data and completely ignores what's in the traditional state. I wonder if there is any selector that tells us whether the user is onboarding so we can discard whatever |
Maybe |
…eId. I also added some protection agains a malformed API valid response
Thanks for the insight! It kinda worked, we also need to check for some other conditions like not having site query args. It should be working now. |
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.
Pretty close!!
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.
Works great!
{ translate( 'View site' ) } | ||
</Button> | ||
<Button | ||
className="is-primary" |
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.
Nitpick (non-blocking): The same can be accomplished by setting a primary
prop.
className="is-primary" | |
primary |
This Pull Request is now available for translation here: https://translate.wordpress.com/deliverables/7594428 Thank you @rcrdortiz for including a screenshot in the description! This is really helpful for our translators. |
Translation for this Pull Request has now been finished. |
This PR implements the UI changes necessary for displaying a notice in the privacy settings when our users are using Global Styles and are required to upgrade their plan in order to make the customization changes they've made available publicly.
I've decided not to show the notice when the site is not launched because of two main reasons. This isn't specified in the design and I think this wasn't taken into consideration, the second reason is to reduce friction when launching a site, I experimented a bit with the UI and it becomes cluttered with buttons and we aren't providing a clear path that our users should follow, which could lead to a decrease in the number of sites that get launched.
Also, when a user launches a free site, he will already get prompted to purchase a domain and a plan.
Proposed Changes
Testing Instructions
Happy Case
FREE
and that you have some GS customizations applied.Mobile devices
Test un-launched site
Test tracking event when clicking on the upgrade button.
calypso_global_styles_gating_%
calypso_global_styles_gating_settings_notice_upgrade_click
Test network error when fetching global styles info
useQuery
.Test for regressions
Test evidence
Pre-merge Checklist
Related to #