-
Notifications
You must be signed in to change notification settings - Fork 31
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
Better loading container for Most Viewed component at end of articles #13123
Conversation
Size Change: -111 B (-0.01%) Total Size: 871 kB
ℹ️ View Unchanged
|
bea1d7b
to
c5bf211
Compare
c5bf211
to
71fec64
Compare
Hello 👋! When you're ready to run Chromatic, please apply the You will need to reapply the label each time you want to run Chromatic. |
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 is great, certainly makes a difference 👌
71fec64
to
31c82b8
Compare
Seen on PROD (merged by @domlander 8 minutes and 45 seconds ago) Please check your changes! |
Closes #13050
What does this change?
Introduces a new loading container for the Most Viewed component that appears at the end of article pages.
Adds a Chromatic story for this component at three breakpoints.
Why?
Better UX. A large loading container does not indicate to the user anything about the content that is loading. This could lead the user to thinking the page is "broken" when on weaker network connections, when this loading container may be displayed for several seconds. This is especially true in this case as the two onwards content carousels above this component can also have this loading placeholder.
Reduced CLS. The height of the current placeholder is set to 360px for this component, regardless of screen size. The component when loaded does not have a fixed height (it depends on the text in the links), but there is a strong correlation between the screen size and component height. For example, the component is a lot taller on mobile than on tablet, as the content is divided into two columns from the tablet breakpoint. If the height of the loading component more closely matches the height of the component when loaded, CLS will be reduced.
Screenshots
Screen.Recording.2025-01-13.at.14.43.59.mov
Data
I took the height of the Most Viewed component (excluding section header) for rendered content, the old placeholder and the new placeholder, at each of our breakpoints. Note that the rendered content does not have a fixed height, i.e. it is not always 762px tall on MobileMedium, but it was at 10:30am 14/01/2025. This shows that CLS will be reduced at all breakpoints.