Page MenuHomePhabricator

Collection items should be sorted by modified time not alphabetically.
Closed, InvalidPublic

Description

  • I add Barack Obama to the 'President' list
  • I add Theodore Roosevelt to the same list.

When I visit the 'President' list Theodore Roosevelt appears before Barack Obama as he was added afterwards.

Event Timeline

Jdlrobson raised the priority of this task from to Needs Triage.
Jdlrobson updated the task description. (Show Details)
Jdlrobson added a project: Gather.
Jdlrobson moved this task to Needs triage on the Gather board.
Jdlrobson subscribed.
Jdlrobson edited a custom field.
Jdlrobson renamed this task from Collections should be sorted by modified time not alphabetically. to Collection items should be sorted by modified time not alphabetically..Apr 30 2015, 6:54 PM
Jdlrobson added a subscriber: Tgr.

@Tgr we'd need to add a new column to the gather_list_items table...

What's the point of having gli_order˙if we are going to sort chronologically?

In future we want to provide an interface was sorting arbitrarily. Right now the sorting seems random/nonexistent - not sure if gli_order or api is to blame for that. Alphabetical would at least be a logical interim.

Gli_order should reflect when added but currently it doesn't seem to unless I'm mistaken?

The code seems sane - new items get the last position. (It is vulnerable to race conditions, but a user racing with themselves to add items seems unlikely. Then again, if adding multiple items is implemented via parallel API calls, fired simultaneously...)

Tgr claimed this task.

Did a bit of debugging. This is caused by a combination of T91017 (which seems to order results by title, not pageid as I stated elsewhere) and T98389. The result is that when viewing a list (API result gets rendered on the server), items are sorted alphabetically in the HTML code. (They are displayed in two columns, first top-to-bottom then left-to-right, and as a reader I try to parse them first left-to-right then top-to-bottom, so they look garbled but that's a CSS issue.) When editing a list (API result gets rendered on the client), sorting might be alphabetical or by pageid, depending on your browser.

Closing this bug; the listpages API already sorts chronologically, respecting the ordering used in the generator module is handled by the above mentioned bugs.