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

Style Variations: Filter out the colors and fonts #97795

Merged
merged 2 commits into from
Dec 27, 2024

Conversation

arthur791004
Copy link
Contributor

@arthur791004 arthur791004 commented Dec 26, 2024

Related to #97134

Proposed Changes

  • Don't show palette variations and typography variations on the Theme page to align with the Core. In addition,
    • The slug between style variations and color variations might be the same, and it made the selection weird
    • The preview of the font variations look too similar
Before After Core
image image image

Why are these changes being made?

Testing Instructions

  • Go to /theme/twentytwentyfive
  • Ensure there are only 8 style variations

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 UI changes, have we tested the change in various languages (for example, ES, PT, FR, or DE)? The length of text and words vary significantly between languages.
  • 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-aUh-p2)?

@matticbot
Copy link
Contributor

matticbot commented Dec 26, 2024

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

App Entrypoints (~26 bytes added 📈 [gzipped])

name                   parsed_size           gzip_size
entry-subscriptions          +98 B  (+0.0%)      +26 B  (+0.0%)
entry-stepper                +98 B  (+0.0%)      +26 B  (+0.0%)
entry-main                   +98 B  (+0.0%)      +26 B  (+0.0%)
entry-login                  +98 B  (+0.0%)      +26 B  (+0.0%)
entry-domains-landing        +98 B  (+0.0%)      +26 B  (+0.0%)
entry-browsehappy            +98 B  (+0.0%)      +26 B  (+0.0%)

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

Sections (~183 bytes added 📈 [gzipped])

name      parsed_size           gzip_size
patterns       +346 B  (+0.0%)     +162 B  (+0.0%)
theme           +80 B  (+0.0%)      +21 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 (~1939 bytes removed 📉 [gzipped])

name                                                                         parsed_size           gzip_size
async-load-automattic-global-styles-src-components-global-styles-variations       +529 B  (+0.0%)     +549 B  (+0.1%)
async-load-automattic-design-preview                                              +503 B  (+0.0%)    +1165 B  (+0.2%)

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.

@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

  • notifications
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug feat/style-variations-filter-out-colors-and-fonts on your sandbox.

@arthur791004 arthur791004 self-assigned this Dec 26, 2024
@arthur791004 arthur791004 requested a review from a team December 26, 2024 08:24
@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 26, 2024
@arthur791004 arthur791004 force-pushed the feat/style-variations-filter-out-colors-and-fonts branch from f0c6588 to c5b3ed2 Compare December 26, 2024 08:35
@arthur791004 arthur791004 requested a review from a team December 26, 2024 09:30
isVariationWithProperties( variation, [ 'color' ] );

const isFontVariation = ( variation: GlobalStylesObject ) =>
isVariationWithProperties( variation, [ 'typography' ] );
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Align with TypographyVariations in the Gutenberg.

};

const isColorVariation = ( variation: GlobalStylesObject ) =>
isVariationWithProperties( variation, [ 'color' ] );
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Align with ColorVariations in the Gutenberg.

Copy link
Contributor

@fushar fushar left a comment

Choose a reason for hiding this comment

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

The theme card still shows 20+ variations, should we also fix that 🤔

image

Copy link
Contributor

@fushar fushar left a comment

Choose a reason for hiding this comment

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

Tested TT5 and other themes.

I think my comment above is not a blocker.

@arthur791004
Copy link
Contributor Author

arthur791004 commented Dec 26, 2024

The theme card still shows 20+ variations, should we also fix that 🤔

Looks like we have to remove badges there. See #93931

If not, we may not be able to filter out colors & fonts there since style variations from themes endpoint are just colors variations (we just return the required data for rendering badges...)

@arthur791004 arthur791004 merged commit 7b4af68 into trunk Dec 27, 2024
12 checks passed
@arthur791004 arthur791004 deleted the feat/style-variations-filter-out-colors-and-fonts branch December 27, 2024 05:33
@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 27, 2024
arthur791004 added a commit that referenced this pull request Dec 27, 2024
@arthur791004 arthur791004 restored the feat/style-variations-filter-out-colors-and-fonts branch December 27, 2024 06:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants