feat: add skeletonDuringImageLoad prop to CardImageCap - #3992
Conversation
✅ Deploy Preview for paragon-openedx-v23 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release-23.x #3992 +/- ##
=============================================
Coverage 94.37% 94.37%
=============================================
Files 242 242
Lines 4282 4287 +5
Branches 1017 979 -38
=============================================
+ Hits 4041 4046 +5
- Misses 233 237 +4
+ Partials 8 4 -4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
LGTM!
Your solution seems connected to a few earlier activities. I previously opened an issue about the "card flickering" problem in the Date view component (#2480). At the time, we attempted to address it by creating a custom useImageLoader hook (#2846), but I wasn’t really happy with that approach, it felt overly complex and heavy-handed.
Now, I can see that the skeletonDuringImageLoad prop is a much cleaner and simpler way to handle the card flickering issue. Besides the course catalog page in the Catalog MFE, we’ll definitely need skeletonDuringImageLoad for the Paragon documentation site as well, specifically for the MiyazakiCard. I’ve already tried adding it there, and it looks great.
Screen.Recording.2025-11-16.at.15.15.49.mov
Updated issue mentioning flickering problem: openedx/frontend-app-catalog#41
|
🎉 This PR is included in version 23.17.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Description
The current behavior of
CardImageCapis to show the loading skeleton when the Card context'sisLoadingis true, but not when the image itself is loading. This leads to resizing on load. This PR adds a newskeletonDuringImageLoadprop so consumers can choose to instead continue to display the skeleton loader until the images load.skeletonDuringImageLoad={false}Slow network simulated
Screencast.From.2025-11-14.04-45-03.mp4
skeletonDuringImageLoad={true}Slow network simulated
Screencast.From.2025-11-14.04-49-06.mp4
Deploy Preview
Include a direct link to your changes in this PR's deploy preview here (e.g., a specific component page).
Merge Checklist
exampleapp?Post-merge Checklist