Open rtibbles opened 3 years ago
@rtibbles Is this issue available for contributors to work on?
Yes, although I think the completely general case would need to be done in the KImg component in the Kolibri Design System - resolving this issue would mostly be managed by handling it for folder and resource thumbnails in the learn plugin.
I have assigned you.
Note that this is targeted for a 0.16 patch, so you should branch from the release-v0.16.x and target any PR there to avoid issues. We may take a little time to merge as we are freezing most merges on that branch at the moment in preparation for the 0.16.0 release.
Thanks @rtibbles!
Removing assignment, as it has been over 8 months.
Hello @rtibbles , I want to work on this. This is my first time contributing to a real open-source project. I have set up the development environment locally. Would you please guide me through this? I know MERN and Django and have Made some projects, but every open-source project seems overwhelming to me. I am willing to contribute and learn from you.
Hi @m3tal10 - the main first step for this issue would be to identify places in the Kolibri code base where we use <img>
tags. I would start with that, and you can post a list in a comment here.
See the MDN page for the <img>
tag for more details on how to set the "lazy"
loading attribute on <img>
tags as well.
Let me know if that seems like a good path forward, and I can assign you.
Good morning @rtibbles, we are using img tags in the following places in the kolibri codebase:
I know about the lazy loading attribute on image tag. <img loading='lazy' src='path'>
This syntax lazily loads the images that are outside the viewport. As phone screens have a small viewport, the images outside the viewport should be should not be loaded until they are inside the viewport to reduce the stress on the device. Does this look good?
Hello @rtibbles , I have created a pull request, this is my very first time. Can you check it and tell me if I am doing it right or not, and what are some best practices that I can implement while contributing to open-source projects?
Hi @m3tal10 - thanks! I'll take a look at your PR this week and give feedback.
Observed behavior
On small screens, we may attempt to load many more thumbnail images than might be immediately needed. This can cause slowness and use excessive bandwidth.
Expected behavior
Use lazy load for images to reduce load on mobile devices that support it.
User-facing consequences
Slower loading, higher bandwidth.