-
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
Live Preview: Add the upgrade notice for Premium and Woo themes #83630
Conversation
This PR modifies the release build for the following Calypso Apps: For info about this notification, see here: PCYsg-OT6-p2
To test WordPress.com changes, run |
This PR does not affect the size of JS and CSS bundles shipped to the user's browser. Generated by performance advisor bot at iscalypsofastyet.com. |
b52f20a
to
5cbf249
Compare
5cbf249
to
87eb5ee
Compare
This Pull Request is now available for translation here: https://translate.wordpress.com/deliverables/9580705 Thank you @okmttdhr for including a screenshot in the description! This is really helpful for our translators. |
This comment was marked as resolved.
This comment was marked as resolved.
apps/wpcom-block-editor/src/wpcom/features/live-preview/upgrade-notice.tsx
Outdated
Show resolved
Hide resolved
ec67d77
to
0453764
Compare
@@ -0,0 +1,101 @@ | |||
import { useDispatch, useSelect } from '@wordpress/data'; |
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.
The contents of this file were originally implemented in live-preview.tsx
, which was renamed to index.tsx
.
@@ -0,0 +1,48 @@ | |||
import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis'; |
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.
I just extracted some util functions.
This banner is now conveying two pieces of information
Let's start with messaging about the upgrade. And could we put it on two lines? Like this: You are previewing {themename}, a premium theme. To unlock this theme upgrade to the Premium plan. Also mentioned in slack: p1699255475276019/1698902224.244089-slack-C048CUFRGFQ |
This copy sounds more gentle and concise! And it makes sense to start with messaging about the upgrade. Thanks for your feedback, @autumnfjeld. I'll address it. |
We'll need to consider copy variation for WooCommerce, which is a WooCommerce theme and requires upgrading to the Business plan. |
For this, I was going to do the similar way as it is currently doing; const requiredPlan = previewingTheme.type === WOOCOMMERCE_THEME ? 'Business' : 'Premium';
createWarningNotice(
sprintf(
// translators: %1$s: The previewing theme name, %2$s: The required plan name ('Business' or 'Premium')
__(
'You are previewing the %1$s theme. You can try out your own style customizations, which will only be saved if you activate this theme. This theme can be activated after upgrading to the %2$s plan or higher.',
'wpcom-live-preview'
),
previewingTheme.name,
requiredPlan
), |
0453764
to
51accd9
Compare
I updated the copy 📝 @autumnfjeld @taipeicoder @Automattic/lego |
GENERAL FEEDBACK The banner UI feels off, maybe it's the equal spacing between the copy and the buttons? cc: @lucasmendes-design WooCommerce should be one word. TEST CASES
What I experienced: Screen.Capture.on.2023-11-07.at.15-15-47.mov
What I experienced: Screen.Capture.on.2023-11-07.at.15-12-09.mp4
I'm not sure how to test this. In an Atomic site I should be able to install both Premium and WooCommerce themes. When installing a WooCommerce theme, some blocks will be unavailable: |
apps/wpcom-block-editor/src/wpcom/features/live-preview/upgrade-notice.tsx
Outdated
Show resolved
Hide resolved
apps/wpcom-block-editor/src/wpcom/features/live-preview/upgrade-notice.tsx
Outdated
Show resolved
Hide resolved
apps/wpcom-block-editor/src/wpcom/features/live-preview/hooks/use-previewing-theme.ts
Outdated
Show resolved
Hide resolved
I think that is an understatement @taipeicoder 😉 . I asked Ian if we could put effort into a visual redesign. The whole banner is well.....no bueno. Everywhere it appears (e.g. GS too), not just here. But for this PR, are there any easy fixes that don't required Lucas input? Could the button & link be move the right side, where there is space? Or should we get rid of the line break after the first sentence? (I suggested the line break but open to other opinions.) |
apps/wpcom-block-editor/src/wpcom/features/live-preview/upgrade-notice.tsx
Outdated
Show resolved
Hide resolved
48ab0a2
to
2f9b04b
Compare
Translation for this Pull Request has now been finished. |
Yep, that's what we do in the showcase and onboarding when looking at the theme details; supress the premium styles notice because it's superfluous with the theme notice. |
Yes, I was going to address this (mentioned in #84799) 🙂 |
Related to #79223, #82629
Proposed Changes
This PR adds the upgrade-needed notice on the Site Editor canvas when live-previewing Premium and WooCommerce themes.
The latest copy:
The flow:
Screen.Recording.2023-11-06.at.14.55.06.mov
I'll create a follow-up PR for the following (See #79223 for more details).
Testing Instructions
install-plugin.sh wpcom-block-editor add/live-preview-upgrade-notice
on your sandbox.https://<your-site>/wp-admin/site-editor.php?wp_theme_preview=<premium-theme>
to preview a premium theme (e.g.,premium/outland
).Upgrade now
.https://<your-site>/wp-admin/site-editor.php?wp_theme_preview=<woo-theme>
to preview a woo commerce theme (e.g.premium/tsubaki
).Upgrade now
.https://<your-site>/wp-admin/site-editor.php?wp_theme_preview=<premium-theme>
to preview a premium theme (e.g.,premium/outland
).Pre-merge Checklist