-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
amp-live-list sort order is not configurable #5396
Comments
Agreed that this would be nice to have. I'm assuming you need a sort order configurable by the user, right? Feel free to include a link to a non-AMP implementation so we can get a good idea of the UX. This might be reasonably straightforward with single-page For instance, way a live blog were broken up across multiple pages. In newest-first order, this isn't an issue (new updates come in, and get slotted at the top of the a) flip the order of the list to newest-first order and take the user to the top of the page Or updates could be disabled in oldest-first order There's also a question of how to toggle the sort order in a paginated situation. There would need to be a server call of some kind to fetch the data living on another page. A good v1 for this might be to enable it for single-page implementations, and to explore options for paginated implementations as an enhancement. cc/ @erwinmombay |
We don't need configurable by the user; our use case is we have "Live Blogs" that load new posts at the top and "Live Q&A" which load new posts at the bottom. |
Got it—that simplifies things :) Do you have an example of a "Live Q&A" page? |
Not on AMP, and probably not unpaywalled, sorry 😕 |
Just to capture notes on this request, after doing a little exploration, there are at least two changes necessary to make this work:
Also, my sense for the live Q&A use-case is that a toggle to automatically pull in all new updates (#4524) could be as appropriate as a button |
Our liveblogs allow insertions to occur anywhere in the liveblog, not just at the top or bottom. Ideally, amp-live-list would look at the |
@devongovett Agreed — it would be good to have flexibility for inserting new items, rather than the current behavior, which inserts new items at the top, and allow changes to existing items in place. cc/ @erwinmombay |
Update: @erwinmombay is planning to work on a fix that will support the static case of oldest-first order Requirements: API
UX
Not needed:
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? |
@ericlindley-g I should clarify that users do not need to dynamically change the ordering when viewing the list. The switching of the sort order is a setting in the admin. In other words, WordPress just needs to be able to change the ordering of the comments when first rendering the page. They don't need to change while the page has loaded. Dynamically changing the order after could be nice feature, but it would not be a core requirement. |
Thanks for clarifying, @westonruter — glad this will already work for WP! |
@ericlindley-g It doesn't seem that |
@westonruter thanks for testing. Did you happen to also turn on dev-channel? (canary) i see the version is ending in "230" which probably doesn't have the latest code yet. It should be in prod this upcoming tuesday. |
@erwinmombay Thanks. That seems to have done the trick. It seems to test I have to both enable |
@westonruter just need to have both experiments on (dev-channel and amp-live-list-sorting) either through the web page or the toggling it on the console. |
I should unflag the feature soon, i just need to fix the UX bug. working on it this week |
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 |
@erwinmombay It looks like this is live everywhere now except in the validator, is that right? |
@westonruter i believe that is correct. it should get picked up on the next validator rollup |
@erwinmombay when will the next validator rollup happen? |
@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 |
I see the validator updates are now live. |
Closing this, but please reopen if this is not fixed yt |
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.The text was updated successfully, but these errors were encountered: