New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 601757 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Not on Chrome anymore
Closed: Apr 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 1
Type: Bug

Blocking:
issue 584266



Sign in to add a comment

Make snippet fetching less intrusive

Project Member Reported by dgn@chromium.org, Apr 8 2016

Issue description

We 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?
 

Comment 1 by dgn@chromium.org, Apr 8 2016

Cc: maybelle@chromium.org

Comment 2 by treib@chromium.org, 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).

Comment 3 by dgn@chromium.org, Apr 13 2016

Cc: nepper@chromium.org
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?

Comment 4 by treib@chromium.org, 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.
#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.
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.

Comment 7 by bauerb@chromium.org, Apr 13 2016

Yes, I think that is what Nicolas meant :)

Comment 8 by dgn@chromium.org, 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.

Comment 9 by dgn@chromium.org, Apr 15 2016

Labels: zine-mr-iter-11
Labels: -Pri-2 Pri-1
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.

Comment 11 by treib@chromium.org, 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 :)
Project Member

Comment 12 by bugdroid1@chromium.org, 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

Project Member

Comment 13 by bugdroid1@chromium.org, 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

Project Member

Comment 14 by bugdroid1@chromium.org, 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

Comment 15 by dgn@chromium.org, Apr 21 2016

Status: Started (was: Assigned)
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?


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?
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.

Comment 19 by dgn@chromium.org, Apr 22 2016

Status: Fixed (was: Started)

Comment 20 by fi...@chromium.org, Apr 22 2016

Blocking: 584266
Labels: zine-mr-MVP
Labels: -zine-mr-mvp
Labels: zine-mr-MVP

Sign in to add a comment