Skip to content
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

Signup: DSS: Only show previews when images are loaded #1195

Merged
merged 1 commit into from
Dec 3, 2015

Conversation

sirbrillig
Copy link
Member

Right now DSS 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.

Part of fixing #1163

Here we use a hidden ImagePreloader to load the image onto the page and track when it is complete. Once the image has been loaded by the browser, then we update the images in the previews.

Testing

Load http://calypso.localhost:3000/start/dss/ and try searching for words. Make sure that the images load correctly and with very little or no flicker of unstyled previews (the amount of DOM changes still may cause a short flicker).

@sirbrillig sirbrillig self-assigned this Dec 2, 2015
@sirbrillig sirbrillig changed the title Update/dss with image preloader Signup: DSS: Only show previews when images are loaded Dec 2, 2015
@sirbrillig sirbrillig force-pushed the update/dss-with-image-preloader branch from fac300c to 774b924 Compare December 2, 2015 19:08
@sirbrillig sirbrillig force-pushed the update/dss-with-image-preloader branch 3 times, most recently from 25505ab to a1e43a5 Compare December 3, 2015 18:05
@sirbrillig sirbrillig added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. and removed [Status] In Progress labels Dec 3, 2015
@sirbrillig
Copy link
Member Author

ping @kwight for review

@kwight
Copy link
Contributor

kwight commented Dec 3, 2015

This works and feels much more consistent and solid now; I'm still seeing the images load in pieces during the repaint, but it always seems consistent. After discussion with @sirbrillig , he'll do a separate PR for adding a delay to the removal of the white overlay, and we should hopefully have the experience we've been going for.

LGTM 👍

@kwight kwight added [Status] Ready to Merge and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Dec 3, 2015
sirbrillig added a commit that referenced this pull request Dec 3, 2015
Signup: DSS: Only show previews when images are loaded
@sirbrillig sirbrillig merged commit eec5860 into master Dec 3, 2015
@sirbrillig sirbrillig deleted the update/dss-with-image-preloader branch December 3, 2015 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants