You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now images load slowly. We try to handle this by waiting ~250ms before showing the preview, but depending on the browser and the connection speed, that may not be enough. It would be nice to avoid this guessing game, though.
This is tricky, but it may be possible. My idea is to try loading the image outside of the viewport, tracking its onload event, then updating the images in the previews.
Tracking the onload event of the images in the previews themselves seemed at first like it may make more sense, but there are a few problems:
From what I can tell, the onload event can only be tracked when injecting the image via javascript (doubly tricky in React, see this module). That would be a lot of extra work for each preview.
Some previews use CSS backgrounds instead of img elements, and AFAIK that can't be tracked.
My hope is that if the image is loaded elsewhere on the page, the browser will be intelligent enough to cache it locally and just use the cached copy inside the previews.
The text was updated successfully, but these errors were encountered:
With #1195 we have a pretty good start to this. The next step will be to keep the white overlay hiding the preview after searching completes but also until the image is preloaded. We'll do that in a separate PR.
Right now images load slowly. We try to handle this by waiting ~250ms before showing the preview, but depending on the browser and the connection speed, that may not be enough. It would be nice to avoid this guessing game, though.
This is tricky, but it may be possible. My idea is to try loading the image outside of the viewport, tracking its
onload
event, then updating the images in the previews.Tracking the
onload
event of the images in the previews themselves seemed at first like it may make more sense, but there are a few problems:onload
event can only be tracked when injecting the image via javascript (doubly tricky in React, see this module). That would be a lot of extra work for each preview.img
elements, and AFAIK that can't be tracked.My hope is that if the image is loaded elsewhere on the page, the browser will be intelligent enough to cache it locally and just use the cached copy inside the previews.
The text was updated successfully, but these errors were encountered: