-
Notifications
You must be signed in to change notification settings - Fork 69
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
Skeleton loader on Cart PMME is absent #9107
Comments
@pierorocca Just tested out the cart on the
The skeleton is only present on the shortcode cart since the PMME isn't removed from the page in the cart block. |
Thanks @mdmoore. Shortcode: https://pieroatomic3.wpcomstaging.com |
Screen.Capture.on.2024-07-16.at.16-03-00.mp4Screen.Capture.on.2024-07-16.at.16-04-40.mp4 |
Thanks @pierorocca! Was the skeleton loader implemented on PDPs? I think it was only present on shortcode carts. @brettshumaker might know better, but I don't remember ever seeing it on PDPs. I do see the layout shifts on page load though, so maybe this issue can serve as a task to implement skeleton loading on PDPs. |
Am I looking for it but can't find it and any PDP related demos are static images. Maybe I missed it but it's a lot more noticeable on the PDP than the Cart no? |
Or maybe when computed styles got applied, it slowed down the paint enough that it's now a noticeable issue? |
True for updates, but on page load? There's a lot of screen shifting happening. |
Please add your planning poker estimate with Zenhub @gpressutto5 |
@pierorocca I'm adding the skeleton loader to the blocks cart when it's updated. Does it resolve this issue? |
Needs to be there on page load as well to prevent screen shifting. It's a better UX to not have things moving around. |
@pierorocca Like in the shortcode cart implementation in #8606, we can't have the skeleton in the initial load because we don't know how large it will be, so we wait for it to be rendered once and save its size. It might not even be displayed. This is out of our control because it is an iframe rendered by Stripe. We could analyze the available data and settings and try to predict whether it is going to be displayed and try to calculate an approximate height, but inevitably, we will have things moving around when we don't get the estimated height correct. It would look like this (the proceed button is moving, but it doesn't look like that because of the flicker): |
Good point. Any other option to get the offer before the page is painted or to make the fetch faster? |
Unfortunately, no. The PMME is out of our control and can only be loaded in the front end. Samir added an initial loader in #9166. It is similar to the one above, but it doesn't flicker. He also had the same problem of not knowing the correct height and had to estimate it until the component loaded for the first time. Do you think it is better to have this loader with an approximate height or not have the initial loader? |
Correct me if I'm wrong, the PMME will either return nothing because the shopper doesn't qualify (country, currency, total amount) or it will return the logos on the first row and copy on the 2nd row. The copy is wrapped if the container is too narrow. There are also differences between mobile and desktop widths. So there's predictability here of what could be provided in the response. One approach used by American Eagle is to reserve the max space needed, and if there's an offer it populates otherwise it's left blank. The other approach I've seen is to shift down once the offer is available with the offer populating a bit more quickly than what I'm seeing from the PMME (are we preconnecting?) and there's only a single, acceptable screen shift down. @FangedParakeet indicated he's trying to minimize shift but that all of the elements we're introducing on the screen are added to the DOM independently so each is causing shift independently. Could you take a look at that work and see if it can be further improved upon? |
@pierorocca I updated it to use the same logic as Samir used: |
That's great! @nikkivias for QA. Nikki we're trying to limit screen shifting and buttons and bnpl messaging from jumping around independently of each other. Does the skeleton help or hinder here? It was originally implemented but suffered regression so we've brought it back with tweaks. |
@gpressutto5 could you enabled Google and WooPay please? |
@pierorocca Sorry, WooPay is not set up in my environment. I recorded this video with Apple Pay! Let me know if you need me to set up WooPay to record a new video. |
@FangedParakeet what do you think? |
Here's the current 8.0 experience for comparison: v7f8Lg.mp4 |
@gpressutto5 I think your changes looks better in comparison? Is the slow Apple Pay rendering due to your location or local dev? |
Here's what @gpressutto5's changes look like on my local with WooPay & GPay enabled as well. Screen.Recording.2024-07-30.at.8.30.10.PM.movThere's a bit of extra spacing around the PMME, but the loading of that specific element looks smooth enough. The express checkout buttons are still making the page leap around quite erratically, but possibly there's potential to implement a similar preloader in a separate issue to improve that. |
Thanks for the video! I slowed it down to .25 speed to get a better idea of what's going on. There's still too much happening even with these improvements.
|
@nikkivias question to you if we should have a skeleton loader for the PMME and prevent screen shift or ditch the loader and have the PMME smoothly shift the screen down? |
@pierorocca @gpressutto5 Better to use a skeleton loader, engagement is enhanced when users see that content is about to load. However, the skeleton should closely resemble the layout of the fully loaded element to manage expectations correctly. So something like this, and make sure the height doesn't shift |
That looks sweet. Ty! |
@pierorocca @nikkivias We don't know if the body text will have 1 or 2 lines after loading, so I made the bottom loader skeleton slightly bigger. What do you think? |
True, can you show what it would look like with one line only? |
@pierorocca The second gif has only one line of text in its body. The first gif has two lines. |
So net we could have 1 to 3 lines and we don't know in advance, is that an accurate summary? @nikkivias fyi. |
Yes, that's correct. To be fair, we can potentially have more than 3 lines if the site uses a wide font with a large font size, but that's extremely unlikely as many other components would look broken. |
@gpressutto5 Can you tell me what is the minimum and maximum height of the widget once its loaded? I want to create a loader design that will account for both scenarios and anything in between. |
@gpressutto5 you shared a gif of how it works on Slack: The shifting doesn't look problematic to me because it is alleviated by the smooth motion. Unlike if it were to suddenly just appear, which would be jarring. Since there will be some cases where nothing will be loaded at all (in cases where the cart totals doesn't qualify) I am inclined to propose that we don't use a loader at all. Just need to make sure the appearance of the widget is smooth. Thoughts? @pierorocca |
@nikkivias I agree with this. After seeing the loader and not being able to predict the right sizing, it made me rethink if it's needed at all. The smoothness is key so that it feels intentional. |
|
If it's smooth we can follow the same approach. On refresh, similarly if we can keep it super smooth and prevent screen shifting, then I'm ok removing the loader. |
Looks pretty seamless to me and updates in the same way as tax, totals, etc. do. so it's all consistent. |
In #8606 a skeleton was applied to the PMME in order to prevent screen shift and to provide a loading state to the BNPL offer which loads after the page in painted. I'm observing that the skeleton is missing from shortcode and Blocks sites.
The text was updated successfully, but these errors were encountered: