Tracking a request we've gotten to show the # of updates available in the [update] button for amp-live-list
Putting into "Next" milestone for now, but we'd love feedback from the community here on how important this is to you — thanks!
Is there a plan to eventually allow the live list to automatically update the page without user interaction, such as a click?
If there is not, then this feature would be very important to me. I'm thinking of that little notification symbol on Facebook -- seeing that number is a powerful trigger to get me to click on it.
Initially we didn't include this feature because we were concerned about the UX of updating the page without a user interaction, but I've heard this request from a couple different sources now. I've opened a bug here with a bare-bones description of the behavior. Please feel free to jump in with feedback there. Thanks @maddoxnelson !
this should be implementable now with bind, now just need to expose the value
Based on the conversation on #7557 (starting at https://github.com/ampproject/amphtml/issues/7557#issuecomment-290585911), I don't think bind will be able to accomplish this as we don't want to mutate state without explicit user interaction.
Makes sense — sounds like this will have to be built directly into amp-live-list, then. Maybe we can just expose a variable that gets updated when the updates come in? I imagine the risk is low for just updating a single number without user interaction (can't think of any abuse cases off the top of my head)
Still using bind, right? I'm still concerned about a setState that isn't triggered by user interaction since that will cause (re-)evaluation of all bind expressions.
Sorry, I said "amp-list" above but meant "amp-live-list" (now edited above). Because of the issue you point out, I was thinking of a document-level variable that doesn't necessarily use bind. Though I'm totally out of my depth with how the nuts and bolts of the implementation works, so that might not be a reasonable path.
In order to give developers control over the contents and styling of the button and the new item count, I think we would need to either allow templating of the update button (which seems like extreme overkill) or find some way to do this with bind. @choumx any thoughts on this?
What does "# of updates" mean wrt insertion/replace/tombstone? Just insertion count? Insertion + replace?
Templates seems like the best fit since the update reference point is not necessarily a button and we may have multiple values as mentioned above. To do this with amp-bind we'd need to introduce mutation scoping.
Also, is this a highly requested feature?
I think that we can probably ignore content replacement & tombstone for update count, as I don't think those trigger the update button at all.
Insertion also doesn't seem like it wants an update button, but I'm unsure exactly what the current behavior is in this case. @erwinmombay, do you know if insertion triggers the update button? (and do inserted items get popped to the top of the document if they come in after page load, or do they get inserted in place? I think the behavior we want is for them to get inserted in place without triggering the "update" button)
WDYT?
This feature was requested early on w/ amp-live-list, but I haven't heard requests in a while, so I wouldn't call it "highly requested" : )
@ericlindley-g yes currently we only show the update button/ui on insert. with the current fix of the sort-time issue, it should be in place now.
Gotcha — I think the ideal behavior would be the following (though I'll sync w/ @spacedino for her thoughts)
So to give three different examples:
triggers the update button with the count of 2 new items
2.
[new item]
[new item]
[old item]
[new item]
[old item]
..... etc
also triggers the update button with the count of 2 new items (even though there are technically 3 new items pulled in the latest update)
does not trigger the update button
cc'ing @spacedino for thoughts from UX perspective (though you probably don't have enough context on amp-live-list yet to give feedback, so feel free to ping me and I can walk through the moving parts here : )
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.
Most helpful comment
Initially we didn't include this feature because we were concerned about the UX of updating the page without a user interaction, but I've heard this request from a couple different sources now. I've opened a bug here with a bare-bones description of the behavior. Please feel free to jump in with feedback there. Thanks @maddoxnelson !