-
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
Update the shopping cart skeleton. #98867
base: trunk
Are you sure you want to change the base?
Conversation
Jetpack Cloud live (direct link)
Automattic for Agencies live (direct link)
|
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: Sections (~139 bytes added 📈 [gzipped])
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 (~139 bytes added 📈 [gzipped])
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. Generated by performance advisor bot at iscalypsofastyet.com. |
cc @fcoveram, as he was adjusting the checkout design 👀 |
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.
Outstanding. This feels a substantial improvement as far as preventing layout shifts. Works well:
I also tested zooming in on the page while the skeleton was blinking, just to see if anything would be off as part of that, but that doesn't seem the case.
Looking at the code, it also looks overall improved. And finally, this doesn't appear to affect negatively any future efforts in this same space.
Happy to give it a ✅, though I saw some other issues as I was testing this. I'm 95% sure it's unrelated, but just to be sure, let me know and I can re-test and open separate issues if need be. First is this:
The cart dropdown opens far removed from the button.
Secondly, I saw an overflow issue as things were loading:
To be fair, that's all sections, and only when loading fresh from cache, and mostly in small browser windows. It may be my curious browser choice (Vivaldi, Chromium based), or it may hint at an overflow issue.
Can you repo any of those?
Ugh. Thanks for noticing! I've created a bug report for this here. I'll try to track down what changed. |
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.
This looks good to me! Thank you for updating this. I'm not sure if it's changed much since the original checkout rebuild in 2020.
Fix: #98526
This PR attempts to align the shopping cart skeleton more closely with the final state to reduce visual shift on load. There isn't a perfect state for the skeleton since the number and type of products change the cart's layout.
I've focused on making the top section of the left side align on load. Specifically the title, the site name, the first product title, and the price. Having those align, in my opinion, significantly reduces shift.
Screenshots
Before
Screen.Capture.on.2025-01-24.at.10-16-22.mp4
After
Screen.Capture.on.2025-01-24.at.09-46-11.mp4
Screen.Capture.on.2025-01-24.at.09-43-25.mp4
Stills
RTL
Why are these changes being made?
It's not that the current skeleton is bad, it isn't, but I believe that reducing any extra cognitive load in shopping carts is a worthwhile pursuit. They communicate a lot about a product.
Pinging design for feedback:
@Automattic/dotcom-design
Testing Instructions
Test RTL
Repeat the same test with your account set to a RTL language like Arabic.
Pre-merge Checklist