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

Split the Global Styles variations in two: default and premium #77333

Merged
merged 19 commits into from Jun 2, 2023

Conversation

BogdanUngureanu
Copy link
Contributor

@BogdanUngureanu BogdanUngureanu commented May 24, 2023

Related to https://github.com/Automattic/dotcom-forge/issues/2261, https://github.com/Automattic/dotcom-forge/issues/2260

Proposed Changes

  • Split the default style variation from the Premium style variations in theme showcase and design picker

Testing Instructions

  • Use the live link from the comments
  • Go to site-setup/designSetup?siteSlug=your-site (where the your-site is free)
  • Click on a free theme and notice that style variations UI is split in two
  • Resize your browser resolution to mobile and make sure that the UI looks good.
  • Click on a Premium and Woo theme and notice that the UI is not split in two
  • Repeat the same step with a site with a premium subscription and notice that all free, premium and Woo themes have the style variations combined in a single list.
  • Go to /themes (logged in and logged out)
  • Make sure that for free sites, the UI is split in two for free themes
  • Make sure that for free sites, the Ui is combined in a single list for Premium and Woo themes
  • Make sure that for Premium sites the UI is combined for Free, Premium and Woo themes
  • Make sure that the UI looks good on both mobile and desktop resolutions

Screenshots

Theme showcase

Free site, free theme
Screenshot 2023-05-26 at 13 29 49
Premium site, free theme
Screenshot 2023-05-26 at 13 32 20

Free site, free theme (mobile)
Screenshot 2023-05-31 at 21 12 29

Design Picker

Free site, free theme
Screenshot 2023-05-26 at 13 35 55

Free site, free theme (mobile)

Screenshot 2023-05-31 at 21 17 18

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests 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)?

@matticbot
Copy link
Contributor

matticbot commented May 24, 2023

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

App Entrypoints (~1 bytes removed 📉 [gzipped])

name                   parsed_size           gzip_size
entry-subscriptions          -33 B  (-0.0%)       -1 B  (-0.0%)
entry-main                   -33 B  (-0.0%)       -1 B  (-0.0%)
entry-login                  -33 B  (-0.0%)       -1 B  (-0.0%)
entry-domains-landing        -33 B  (-0.0%)       -1 B  (-0.0%)
entry-browsehappy            -33 B  (-0.0%)       -1 B  (-0.0%)

Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used.

Sections (~110 bytes removed 📉 [gzipped])

name    parsed_size           gzip_size
theme       -1341 B  (-0.2%)     -394 B  (-0.2%)
themes        +13 B  (+0.0%)     -126 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.

Async-loaded Components (~69 bytes added 📈 [gzipped])

name                                                                         parsed_size             gzip_size
async-load-automattic-global-styles-src-components-global-styles-variations    +981960 B      (new)  +286584 B      (new)
async-load-automattic-design-preview-src-components-style-variation            -981489 B  (deleted)  -286516 B  (deleted)
async-load-automattic-design-preview                                              +356 B    (+0.0%)      +73 B    (+0.0%)

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.
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.

@BogdanUngureanu BogdanUngureanu requested a review from a team May 25, 2023 09:20
@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 May 25, 2023
@BogdanUngureanu BogdanUngureanu self-assigned this May 25, 2023
@BogdanUngureanu BogdanUngureanu changed the title WIP: Split the Global Styles variations in two: default and premium Split the Global Styles variations in two: default and premium May 26, 2023
@BogdanUngureanu BogdanUngureanu requested a review from a team May 26, 2023 12:53
Copy link
Member

@mmtr mmtr left a comment

Choose a reason for hiding this comment

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

Nice job, this is quite a big improvement! It works well, but I think there are a few things we need to address first.


I think this breaks the "Premium" badge we display on the thumbnails when selecting a custom variation:

Before After
Screenshot 2023-05-26 at 15 42 53 Screenshot 2023-05-26 at 15 42 39

This text feels too wordy, is it really necessary? The original mockup didn't include it:

Mockup This PR
Screenshot 2023-05-26 at 15 46 38 Screenshot 2023-05-26 at 15 45 21

Seems the tiles are a bit misaligned with the text?

Mockup This PR
Screenshot 2023-05-26 at 15 47 38 Screenshot 2023-05-26 at 15 47 50

The font size in the sidebar feels smaller when compared to production and I think I like it more how it was before. Can we keep using the same font size?

Before After
Screenshot 2023-05-26 at 15 53 16 Screenshot 2023-05-26 at 15 53 22

Nitpick, non-blocking: On mobile, when the site is on a paid plan, the "Styles" header seems unnecessary.

Before After
Screenshot 2023-05-26 at 15 56 26 Screenshot 2023-05-26 at 15 56 34

In the theme showcase, when the site is on a paid plan, there is a huge separation between the header and the styles grid. We can probably reduce it:

Before After
Screenshot 2023-05-26 at 16 04 31 Screenshot 2023-05-26 at 16 04 25

In the mobile view of the theme showcase, when the site is on a Free plan, I think the header takes a considerable amount of space. Can we maybe reuse the same layout that we use in the design picker, so all the styles are displayed in the same horizontal line?

Before After
Screenshot 2023-05-26 at 16 08 19 Screenshot 2023-05-26 at 16 07 31

@BogdanUngureanu
Copy link
Contributor Author

In the mobile view of the theme showcase, when the site is on a Free plan, I think the header takes a considerable amount of space. Can we maybe reuse the same layout that we use in the design picker, so all the styles are displayed in the same horizontal line?

I think it's better to keep the existing split mode because it's more clear and we describe better what style is free and what styles are paid.

In the design picker I used that approach because there's enough space to use the same design, so had to use that approach.

@BogdanUngureanu BogdanUngureanu requested a review from mmtr May 29, 2023 14:28
@mmtr
Copy link
Member

mmtr commented May 30, 2023

In the design picker I used that approach because there's enough space to use the same design, so had to use that approach.

It doesn't look like there's enough space to me 🤔. By default (without scrolling), the preview only takes about the 25% of the screen. Previously, it was closer to the 50%. That's why I think we can probably be consistent with the design picker and display all styles in the same row (see my suggested mockup below).

Before (production ) After (this PR) Design picker (This PR) My proposal
Screenshot 2023-05-30 at 13 56 23 Screenshot 2023-05-30 at 13 50 36 Screenshot 2023-05-30 at 13 44 46 Screenshot 2023-05-30 at 13 54 32

@mmtr
Copy link
Member

mmtr commented May 30, 2023

These two items remain unchanged, but didn't get your thoughts on them. Did you miss them?

  • This text feels too wordy, is it really necessary? The original mockup didn't include it:
Mockup This PR
Screenshot 2023-05-26 at 15 46 38 Screenshot 2023-05-26 at 15 45 21
  • Nitpick, non-blocking: On mobile, when the site is on a paid plan, the "Styles" header seems unnecessary.
Before After
Screenshot 2023-05-26 at 15 56 26 Screenshot 2023-05-26 at 15 56 34

@BogdanUngureanu
Copy link
Contributor Author

These two items remain unchanged, but didn't get your thoughts on them. Did you miss them?

Strange, they should have been fixed. 🤔

It doesn't look like there's enough space to me 🤔. By default (without scrolling), the preview only takes about the 25% of the screen. Previously, it was closer to the 50%. That's why I think we can probably be consistent with the design picker and display all styles in the same row (see my suggested mockup below).

Fair enough. Maybe I can add the text at the bottom of the UI. :)

@BogdanUngureanu
Copy link
Contributor Author

These two items remain unchanged, but didn't get your thoughts on them. Did you miss them?

I've just checked again and I don't get that subheader text in the Theme showcase and Design picker. 🤔

…wports in Theme showcase and set the item size on mobile view ports to 80px in the theme showcase.
Copy link
Member

@mmtr mmtr left a comment

Choose a reason for hiding this comment

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

Nice! It works well for me. I only left a few minor comments, but can be addressed in a follow-up.

I think we should also revisit the mobile layout, since there can a be a huge separation between the default style and the premium styles:

Screenshot 2023-05-31 at 18 09 16

premiumBadge={
showGlobalStylesPremiumBadge && (
<PremiumBadge
className="design-picker__premium-badge"
Copy link
Member

Choose a reason for hiding this comment

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

This class is no longer used, so I think we can remove a few styles from the SCSS file

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh that's right. I planned to remove it but I guess I forgot about it.

<div className="theme__sheet-style-variations-previews">
<AsyncLoad
require="@automattic/design-preview/src/components/style-variation"
Copy link
Member

Choose a reason for hiding this comment

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

I think this component is no longer used, can we remove it?

…/index.tsx

Co-authored-by: Miguel Torres <1233880+mmtr@users.noreply.github.com>
@BogdanUngureanu
Copy link
Contributor Author

I've updated the description with some up to date screenshots.

Hey @lucasmendes-design can you also have a look at the proposed changes, especially on the mobile viewports? The changes were implemented based on the desktop design and based on the existing UI on mobile viewports.

@lucasmendes-design
Copy link

Hi folks, some notes about the experience here:

  • I think the global style thumbnail doesn't support any tags for now. It's strange placing a free or premium tag on it. This is in my backlog to create a thumbnail like the premium features in Canvas (example).
image image
  • I'm not sure which one is the latest one but on mobile, the scroll is more natural than on desktop. So, I think it's fine having that. And mobile doesn't have hover, so we need to explain what this star is.
image

@BogdanUngureanu BogdanUngureanu merged commit 08ac29c into trunk Jun 2, 2023
17 of 20 checks passed
@BogdanUngureanu BogdanUngureanu deleted the update/global-styles-panel branch June 2, 2023 08:19
@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 Jun 2, 2023
@a8ci18n
Copy link

a8ci18n commented Jun 2, 2023

This Pull Request is now available for translation here: https://translate.wordpress.com/deliverables/8021142

Thank you @BogdanUngureanu for including a screenshot in the description! This is really helpful for our translators.

@a8ci18n
Copy link

a8ci18n commented Jun 15, 2023

Translation for this Pull Request has now been finished.

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.

None yet

5 participants