-
Notifications
You must be signed in to change notification settings - Fork 2k
Style selection: Update style variation UI #69363
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 selection: Update style variation UI #69363
Conversation
|
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: Async-loaded Components (~348 bytes added 📈 [gzipped]) DetailsReact 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. |
I think it's still case by case. If issues are introduced from any of As a result, I'd prefer to use the same workaround of #69318 again when we encounter a similar issue next time. What do you think? |
Agreed! Which is why I wrote - "This approach can also potentially prevent us from having to update @wordpress/edit-site each time the style preview UI changes." It's definitely not a cure-all solution, but it gives us more leeway. This approach mainly addresses these feedbacks pdtkmj-Ad-p2#comment-1007 and p1666215740390499-slack-CRWCHQGUB which updates the style preview hover presentation.
Unfortunately, we couldn't achieve this UI update with #69318 🥲 |
Oh yes, that's a fair point 🙃 Let's go with this way first and see whether there is a better solution later. For example, make |
arthur791004
left a comment
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.
Work nicely 👍
Minor feedback is to make a new package for it and we could keep @automattic/design-preview simpler. But it's optional 🙂
fushar
left a comment
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 nicely 😄
As now we have a local copy of the component, we might be able the fix bug in this local copy as described here: pbxlJb-2ow-p2 (in the future).
That's a good point! I'm up for looking into that, and make it a new package as @arthur791004 suggested, if bandwidth allows 🙂 |


Proposed Changes
This PR updates the style preview UI in the design preview component. Previously, we couldn't update the style preview UI without updating the package
@wordpress/edit-site, which is a complicated ordeal (see p1666235331775949-slack-C03DY3RJ5 and pbxlJb-2gk-p2#comment-1952). Also, see the abandoned PR that attempts to do so: #69272.As an alternative solution, instead of updating
@wordpress/edit-site, we make a local copy of the component<StylesPreview />instead of directly importing it from@wordpress/edit-site. The downside of this approach is that we no longer benefit from the abstraction provided by the package, by the upside is that we can now update the style preview UI without needing to bump@wordpress/edit-siteand its dependencies across Calypso. This approach can also potentially prevent us from having to update@wordpress/edit-siteeach time the style preview UI changes.Testing Instructions
setup/designSetup?siteSlug=${site_slug}Pre-merge Checklist