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

Enable the "Preview & Customize" button for Premium and WooCommerce themes (on horizon) #85182

Merged
merged 2 commits into from
Dec 13, 2023

Conversation

okmttdhr
Copy link
Member

@okmttdhr okmttdhr commented Dec 13, 2023

Related to #79223
#84483

Proposed Changes

This PR enables the "Preview & Customize" button for Premium and WooCommerce themes on the Horizon environment.

Note that the whole "Live Preview in Premium and Woo themes" feature is under development. See #79223.

before after
Screenshot 2023-12-13 at 10 59 59 Screenshot 2023-12-13 at 10 55 45
Screenshot 2023-12-13 at 10 59 52 Screenshot 2023-12-13 at 10 56 47

Testing Instructions

  • Go to the Theme Showcase page.
  • Click the three-dot menu on a Premium (e.g., Hevor) or WooCommerce (e.g., Amulet) theme.
    • Click the Preview & Customize button.
      Screenshot 2023-12-13 at 10 55 45
    • Verify it redirects to the Site Editor and you're live-previewing the theme.

Regression testing for Simple sites;

  • Click the three-dots menu on a Free (e.g., Epi) theme.
    • Click the Preview & Customize button.
    • Verify it redirects to the Site Editor and you're live-previewing the theme.
  • Click the three-dots menu on a Partner (e.g., Eben) / wporg (e.g., Classified Listings) theme.
    • Verify you don't see the Preview & Customize button.

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • https://wpcalypso.wordpress.com/devdocs/docs/testing/index.md for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-ajp-p2)?

Copy link

github-actions bot commented Dec 13, 2023

@matticbot
Copy link
Contributor

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • blaze-dashboard
  • odyssey-stats

To test WordPress.com changes, run install-plugin.sh $pluginSlug add/live-preview-in-premium-woo-themes on your sandbox.

@okmttdhr okmttdhr marked this pull request as ready for review December 13, 2023 01:55
@okmttdhr okmttdhr requested a review from a team December 13, 2023 02:01
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Dec 13, 2023
@okmttdhr okmttdhr self-assigned this Dec 13, 2023
Copy link
Contributor

@taipeicoder taipeicoder left a comment

Choose a reason for hiding this comment

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

Tested:

  • Go to the Theme Showcase page.
  • Click the three-dot menu on a Premium (e.g., Hevor) or WooCommerce (e.g., Amulet) theme.
  • Click the Preview & Customize button.
  • ✅ Verify it redirects to the Site Editor and you're live-previewing the theme.

Regression testing for Simple sites;

  • Click the three-dots menu on a Free (e.g., Epi) theme.
  • Click the Preview & Customize button.
  • ✅ Verify it redirects to the Site Editor and you're live-previewing the theme.
  • Click the three-dots menu on a Partner (e.g., Eben) / wporg (e.g., Classified Listings) theme.
  • ✅ Verify you don't see the Preview & Customize button.

@okmttdhr okmttdhr merged commit 1b5eb5a into trunk Dec 13, 2023
21 of 22 checks passed
@okmttdhr okmttdhr deleted the add/live-preview-in-premium-woo-themes branch December 13, 2023 03:58
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Dec 13, 2023
chriskmnds pushed a commit that referenced this pull request Dec 13, 2023
@matticbot
Copy link
Contributor

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

Sections (~67 bytes added 📈 [gzipped])

name    parsed_size           gzip_size
themes       +206 B  (+0.0%)      +67 B  (+0.0%)
theme        +206 B  (+0.0%)      +67 B  (+0.0%)

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.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

*/
if (
config.isEnabled( 'themes/block-theme-previews-premium-and-woo' ) &&
( isThemePremium( state, themeId ) || isThemeWooCommerce( state, themeId ) )
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @okmttdhr!

Me again. While working on the Sensei bundle themes, I'm comparing it with WooCommerce themes. So I just noticed this difference and I'd like to ask you if it should really be specific for WooCommerce, or for any bundle.

If for any bundle, I could change it as part of #84886. Probably using doesThemeBundleSoftwareSet instead of isThemeWooCommerce. Or if it's really only for WooCommerce, I'll leave it as it is.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for reaching out, @renatho!

This feature should be compatible with all Bundle themes in the future (CC: @Automattic/lego). However, several changes are needed to transition it from being Woo themes-specific to being applicable to Bundle themes. For example;

I would greatly appreciate it if you could implement all the changes simultaneously. But, if this isn't feasible, please leave it as it is, and I will file an issue to address it later. 🙂

For functionality testing: pekYwv-3xz-p2

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @okmttdhr! 👋

please leave it as it is, and I will file an issue to address it later

After checking this a little, I think it would be the best approach. And if you want to reference me in the issue, I can help with what is needed regarding the bundle feature.

I think the conclusion (not concluded yet) of the thread #84886 (comment) will be a good reference for the needs here.

Copy link
Member Author

@okmttdhr okmttdhr Jan 11, 2024

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants