Handle loading delays in loading snippet thumbnails |
|||||
Issue descriptionDownloading the thumbnail to display can take some time, especially on bad connections. What to do in the meantime? a. Leave the space blank b. Have a placeholder c. Let text occupy the space, the layout of the card will be updated when the thumbnail arrives. d. ? Attached a video of what happens with option c)
,
Apr 8 2016
No, there's no way to get that info. We could do some similar calculations to what we do with the ML scrabble tiles though, where we try to get the favicon dominant color and fall back to gray if we don't have it. If we do A, the card will re-layout the contents if we are unable to download the image just like in the attached video.
,
Apr 8 2016
The current implementation is A), where space is blank until we get a thumbnail, which replaces it, or fail to get one, in which case we relayout the contents, as May said. About the favicon color option: how is that different from the thumbnail color? We would have to get the favicon, which is most likely smaller, but still... Also I think it's better to have a full width text when we have no thumbnail. Another option that was mentioned during the standup is to display the card only when we have the thumbnail. That means that we would download the thumbnails in advance, as we initialize the NTP, instead of when the card becomes visible. That raises data usage and snippet display latency concerns though.
,
Apr 8 2016
Re: favicon, we will have the favicon already cached if the user has visited the site previously so no need to hit the network.
,
Apr 11 2016
I've attached an image of what Google Now does - it probably makes sense to stay consistent with this. They use a grey background with an image icon overlaid. I've also attached an example of what inbox does - they use the image from go/icons overlaid (search "photo"). The icon in this case seems simpler, so I'd go with that one.
,
Apr 11 2016
Thanks, sounds good. I'll to this then: - If there is no thumbnail URL, we let the text take the whole space - While we are fetching the thumbnail from a URL, we use the placeholder icon - If we got the thumbnail, we use it - If thumbnail fetching failed, we leave the placeholder icon in place
,
Apr 11 2016
FYI, there should always be a thumbnail after since https://codereview.chromium.org/1868523002/ was landed. If we don't have a thumbnail, that's a bug.
,
Apr 11 2016
One more strategy would be to simply wait for the thumbnail before showing the snippet at all. Also note that this almost certainly has overlap with bug 584429 .
,
Apr 11 2016
,
Apr 11 2016
Doing that would mean that we would download thumbnails snippets while we don't know if they are going to be shown. I'm planning to implement the placeholder first, add thumbnail fetching when we start pulling up snippets second, and then when we address issue 602259 , we could load them from a persistent storage.
,
Apr 14 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/204cf9c4eb767c7f8cfbd85267c4b9e87b62067d commit 204cf9c4eb767c7f8cfbd85267c4b9e87b62067d Author: dgn <dgn@chromium.org> Date: Thu Apr 14 08:41:43 2016 [NTP Snippets] Add placeholders and start caching thumbnails Adds placeholders that are displayed while the thumbnail is being fetched from the network, and keeps the downloaded thumbnail while we stay on the NTP. BUG= 601456 Review URL: https://codereview.chromium.org/1871343006 Cr-Commit-Position: refs/heads/master@{#387262} [add] https://crrev.com/204cf9c4eb767c7f8cfbd85267c4b9e87b62067d/chrome/android/java/res/drawable/ic_snippet_thumbnail_placeholder.xml [modify] https://crrev.com/204cf9c4eb767c7f8cfbd85267c4b9e87b62067d/chrome/android/java/res/layout/new_tab_page_snippets_card.xml [modify] https://crrev.com/204cf9c4eb767c7f8cfbd85267c4b9e87b62067d/chrome/android/java/res/values/colors.xml [modify] https://crrev.com/204cf9c4eb767c7f8cfbd85267c4b9e87b62067d/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticle.java [modify] https://crrev.com/204cf9c4eb767c7f8cfbd85267c4b9e87b62067d/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticleViewHolder.java
,
Apr 15 2016
Preview with GIN-2g + Animations-duration x5: https://photos.google.com/share/AF1QipPsMdfHEn65WGkIPp7TJ_AK3c3PRZf8tiLNNQANsUZEMekyXR5apxMr36xs-GW4JA/photo/AF1QipNnzvlfzBGUwT-F5-3Xj_O4l8HBSxIclwbO4U0t?key=clhjUVVsWEh5eHBKWlFSOFc4SzhEbDdLZ3pFMlBR |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by rachelis@chromium.org
, Apr 8 2016