amphtml: amp-live-list sort order is not configurable

Our live blogs have a configurable sort order. However, amp-live-list only supports new messages at the top. Ideally amp-live-list should have an attribute like data-sort-order="(asc|desc)" to configure this behaviour.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 23 (20 by maintainers)

Most upvoted comments

@westonruter i was told next week. There was some confusion if the code was reverted because master was a red a few weeks ago and this was one of those pr’s that wasnt pulled in into the validator. apologize for the delay

The UX fix and unflagging is currently in canary. everything should be fully live by tuesday next week. I’ll check up on the validator changes too and report here when i know its in

Update:

@erwinmombay is planning to work on a fix that will support the static case of oldest-first order

Requirements:

API

  • Add new attribute for sort order

  • TODO: determine naming for attribute, options: – ‘data-sort-order=“oldest-first | newest-first”’ (this one has my vote, since it seems faster to understand the behavior) – boolean: ‘ascending-sort-order’ – ‘data-sort-order=“(asc|desc)”’

UX

  • Scroll down when update button tapped

  • TODO: determine where to stop – Option 1: Until bottom bottom of viewport intersects with bottom of new entry (this one has my vote, but would be curious what the folks on the Bulletin team would want) – Option 2: until top of viewport intersects with top of new entry (or reaches end of document)

  • New items are automatically inserted at bottom of list (instead of top)

Not needed:

  • Because the order of items on page is already determined by the developer, there’s no need to adjust this

Note: With this update, amp-live-list would work for items in chronological order, but users would not yet be able to switch the ordering dynamically, as per @westonruter 's request—though @erwinmombay , would that be possible to do?