Make snippet fetching less intrusive |
||||||||||
Issue descriptionWe currently clear the whole snippet list and replace it with the new one. That causes a visible flash in the UI. We should instead just add the new entries. Also, related to issue 601736 : where do we insert the new ones then? always below the currently displayed cards? In the place where they are supposed to go overall, which could shift the visible cards?
,
Apr 8 2016
To be precise: The *UI* replaces the whole snippets list; the SnippetsService does not, it adds the new snippets at the end (for now).
,
Apr 13 2016
Another way to make fetching less intrusive is to fetch only when opening or going back to the NTP. Pros: + Content does not change while the user is looking at it (that's super annoying, try Google Newstand to experience that for example) + The order is always right Cons: - UI and service list are not in sync, we have to make sure we don't introduce bugs because of that. (while dismissing for example) - The user can end up with stale content. That should not be an issue though, the NTP should not stay open that long, and it would have fresh content after switching apps or if it's a new NTP. nepper@: WDYT?
,
Apr 13 2016
That sounds very reasonable to me! I think this should actually have fewer edge cases than dynamically updating the UI. One thing to keep in mind: Right now (at least in some cases) the NTP tiles do change dynamically. When that happens, the snippets would get out of sync with the tiles, which is a bit ugly. The fix is probably to not update the NTP tiles, which IMO is a non-feature anyway.
,
Apr 13 2016
#3, what do you mean by fetching when going back to NTP? As a user, I tap on an article to read it, when I press back, I expect the list of articles to be the same. IMO, we should update the UI (and maybe not fetch since network latency could bite us there) when the user opens a new tab explicitly, but otherwise only remove snippets that are expired.
,
Apr 13 2016
My English failed me in #5, what I mean is that IMO we should fetch as scheduled, and update the UI only on explicit new tab opens.
,
Apr 13 2016
Yes, I think that is what Nicolas meant :)
,
Apr 13 2016
#3 going back to the NTP: I was thinking about the case where you would have Chrome in the background, or a NTP deep in your tabs, and you went back to it. I think it makes sense to have a fresh list of snippets. In the NTP > Snippet > back sequence, I understand why you expect the list to be the same... but at that point you navigated away, if you had stale snippets, I think it's fair to have fresh one when you come back. If they were recent enough, they should not change.
,
Apr 15 2016
,
Apr 15 2016
I agree with May (and I think most of the other contributors here :): let's: - only update the UI when a new tab is opened (i.e. no dynamic updates while you are on the NTP, and no updates just because you return to an open NTP) - we should add new content at *the top* of the visible UI list (most recently retrieved first) BTW: Issue 603884 seems to be related.
,
Apr 15 2016
For snippet ordering, there's bug 601736 (I see you commented there - thanks!), let's keep this one focused on the UI :)
,
Apr 19 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/104124354787e845e02db283185d499232518dd6 commit 104124354787e845e02db283185d499232518dd6 Author: dgn <dgn@chromium.org> Date: Tue Apr 19 13:00:06 2016 [NTP Snippets] Refresh the displayed snippets less frequently The fetch frequence of the snippet service does not change, but the snippets are now refreshed less frequently on the UI. They are pulled when the NTP is opened, or when the user switches back to it from another tab or another app. Additionally, we also change the way the list is updated, adding only new entries instead of clearing the old list and replacing it with the new one. BUG= 601757 Review URL: https://codereview.chromium.org/1888913002 Cr-Commit-Position: refs/heads/master@{#388195} [modify] https://crrev.com/104124354787e845e02db283185d499232518dd6/chrome/android/BUILD.gn [modify] https://crrev.com/104124354787e845e02db283185d499232518dd6/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java [modify] https://crrev.com/104124354787e845e02db283185d499232518dd6/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageView.java [modify] https://crrev.com/104124354787e845e02db283185d499232518dd6/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapter.java [modify] https://crrev.com/104124354787e845e02db283185d499232518dd6/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticle.java [modify] https://crrev.com/104124354787e845e02db283185d499232518dd6/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsBridge.java [add] https://crrev.com/104124354787e845e02db283185d499232518dd6/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapterTest.java [modify] https://crrev.com/104124354787e845e02db283185d499232518dd6/chrome/browser/android/ntp/ntp_snippets_bridge.cc [modify] https://crrev.com/104124354787e845e02db283185d499232518dd6/components/ntp_snippets/ntp_snippets_service.cc
,
Apr 19 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/71a6f5091c48bb552b63613b8666a4b4ac6dcc7d commit 71a6f5091c48bb552b63613b8666a4b4ac6dcc7d Author: cmumford <cmumford@chromium.org> Date: Tue Apr 19 16:23:34 2016 Revert of [NTP Snippets] Refresh the displayed snippets less frequently (patchset #7 id:120001 of https://codereview.chromium.org/1888913002/ ) Reason for revert: testSnippetLoading is failing. Opened new bug: crbug.com/604763 Original issue's description: > [NTP Snippets] Refresh the displayed snippets less frequently > > The fetch frequence of the snippet service does not change, but the > snippets are now refreshed less frequently on the UI. They are pulled > when the NTP is opened, or when the user switches back to it from > another tab or another app. > > Additionally, we also change the way the list is updated, adding only > new entries instead of clearing the old list and replacing it with > the new one. > > BUG= 601757 > > Committed: https://crrev.com/104124354787e845e02db283185d499232518dd6 > Cr-Commit-Position: refs/heads/master@{#388195} TBR=treib@chromium.org,bauerb@chromium.org,dgn@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG= 601757 Review URL: https://codereview.chromium.org/1897313002 Cr-Commit-Position: refs/heads/master@{#388218} [modify] https://crrev.com/71a6f5091c48bb552b63613b8666a4b4ac6dcc7d/chrome/android/BUILD.gn [modify] https://crrev.com/71a6f5091c48bb552b63613b8666a4b4ac6dcc7d/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java [modify] https://crrev.com/71a6f5091c48bb552b63613b8666a4b4ac6dcc7d/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageView.java [modify] https://crrev.com/71a6f5091c48bb552b63613b8666a4b4ac6dcc7d/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapter.java [modify] https://crrev.com/71a6f5091c48bb552b63613b8666a4b4ac6dcc7d/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticle.java [modify] https://crrev.com/71a6f5091c48bb552b63613b8666a4b4ac6dcc7d/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsBridge.java [delete] https://crrev.com/4998fbe285b9c857b454b70a2bfeda562a92c3ae/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapterTest.java [modify] https://crrev.com/71a6f5091c48bb552b63613b8666a4b4ac6dcc7d/chrome/browser/android/ntp/ntp_snippets_bridge.cc [modify] https://crrev.com/71a6f5091c48bb552b63613b8666a4b4ac6dcc7d/components/ntp_snippets/ntp_snippets_service.cc
,
Apr 19 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/cb0b829783d26fe083f951a58c2395bef0f06840 commit cb0b829783d26fe083f951a58c2395bef0f06840 Author: dgn <dgn@chromium.org> Date: Tue Apr 19 17:35:04 2016 [NTP Snippets] Refresh the displayed snippets less frequently Relanding the change that was reverted in https://codereview.chromium.org/1897313002 Original issue's description: > The fetch frequence of the snippet service does not change, but the > snippets are now refreshed less frequently on the UI. They are pulled > when the NTP is opened, or when the user switches back to it from > another tab or another app. > > Additionally, we also change the way the list is updated, adding only > new entries instead of clearing the old list and replacing it with > the new one. BUG= 601757 , 604763 TBR=bauerb@chromium.org Review URL: https://codereview.chromium.org/1898213002 Cr-Commit-Position: refs/heads/master@{#388235} [modify] https://crrev.com/cb0b829783d26fe083f951a58c2395bef0f06840/chrome/android/BUILD.gn [modify] https://crrev.com/cb0b829783d26fe083f951a58c2395bef0f06840/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java [modify] https://crrev.com/cb0b829783d26fe083f951a58c2395bef0f06840/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageView.java [modify] https://crrev.com/cb0b829783d26fe083f951a58c2395bef0f06840/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapter.java [modify] https://crrev.com/cb0b829783d26fe083f951a58c2395bef0f06840/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticle.java [modify] https://crrev.com/cb0b829783d26fe083f951a58c2395bef0f06840/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsBridge.java [add] https://crrev.com/cb0b829783d26fe083f951a58c2395bef0f06840/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapterTest.java [modify] https://crrev.com/cb0b829783d26fe083f951a58c2395bef0f06840/chrome/browser/android/ntp/ntp_snippets_bridge.cc [modify] https://crrev.com/cb0b829783d26fe083f951a58c2395bef0f06840/components/ntp_snippets/ntp_snippets_service.cc
,
Apr 21 2016
Reading back the full thread, I realize that the current implementation is different from what discussed here, especially #10. We update when you return to a previously opened NTP. nepper@: When you mean "no updates just because you return to an open NTP", do you mean in the case were you A) were reading an article finished and went back, or also in the case where B) you opened a new tab an hour ago, switched to something else and now come back to that tab?
,
Apr 22 2016
I wouldn't update in either of those cases. Unless we go for extreme fancy treatments (think: updated Facebook stream), it's either going to be a janky experience (because the user visually sees the update flashing snippets turning from old to new) or a confusing experience (because the new snippets are already there and the user is surprised about some old ones not being visible anymore. If the user (or Chrome) reloads the New Tab for whatever reason, then of course it's fine to update the snippets. Makes sense?
,
Apr 22 2016
Note though that the NTP activity might get destroyed while the user is on a different page, so if that happens, we would also update the snippets on reconstruction.
,
Apr 22 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/68ab5d959f461256078f83f975c9521395aeeb08 commit 68ab5d959f461256078f83f975c9521395aeeb08 Author: dgn <dgn@chromium.org> Date: Fri Apr 22 12:26:48 2016 [NTP Snippets] Stop refreshing the snippets on tab switch BUG= 601757 Review URL: https://codereview.chromium.org/1912063003 Cr-Commit-Position: refs/heads/master@{#389084} [modify] https://crrev.com/68ab5d959f461256078f83f975c9521395aeeb08/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java [modify] https://crrev.com/68ab5d959f461256078f83f975c9521395aeeb08/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageView.java [modify] https://crrev.com/68ab5d959f461256078f83f975c9521395aeeb08/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapter.java [modify] https://crrev.com/68ab5d959f461256078f83f975c9521395aeeb08/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapterTest.java
,
Apr 22 2016
,
Apr 22 2016
,
Jul 1 2016
,
Jul 1 2016
,
Jul 1 2016
|
||||||||||
►
Sign in to add a comment |
||||||||||
Comment 1 by dgn@chromium.org
, Apr 8 2016