Skip to content

[STAR-4171] feat: List ordering improvements

This MR improves the ordering of the default listing for checklists. The new listing prioritizes the most relevant lists to the current user, floating relevant lists to the top rather than relying purely on the due date as a sorting method.

Supporting information

Discussions

Link to any public discussions about this PR or the design/architecture. Otherwise omit this.

Dependencies

This depends on fixes in the sidebar MR here. It must be merged first.

Visual changes

Past due checklists float to the top:

image

...But only up to a point (a month overdue):

image

After which the standard ordering kicks back in, earliest due date to latest.

It also floats one-off checklists that the user has created (such as the vacation checklist) near the top by simulating a due date one week from the current day (as they otherwise do not have one.) It would be preferable to make these one-off lists have their own due date, but no design yet exists for this, and it was outside of the scope of the current task. cc @cassiez

This MR also makes it easier to modify the due dates of runs. Previously, the due dates of checklists and runs could drift out of sync, causing confusion and discrepancies on the dates on the rare occasions they had to be modified. It does this with significant improvements to the Admin views and the post-save signals. This also makes it easier to test due date behavior locally.

Testing instructions

Step by step procedure

  1. make to set up the whole shebang
  2. Turn on the included recurrence and come back in a little while to find several runs.
  3. Turn off the included recurrence and modify the created runs to have different due dates to see how they behave in the listing.
  4. Start on some, don't start others, see how they shift based on priority.
  5. Create a one-off checklist and verify it does show up near the top so you can keep track of it until it's done.

Author notes and concerns

This solution works but feels a little hacky. It suggests there probably should be a more design-oriented method of surfacing the most important lists. This solution is more of a stop-gap than anything.

This solution does overload the due date for sorting in a way that can be somewhat surprising. Once a checklist's due date is outside of the relevance window (one month), it goes from near the top to the very end. This was necessary since if we went from the oldest due date first, upcoming would float above to-do, which would cause people to fill out the wrong list. So, it must go youngest due date to oldest in the first segment. But once we've committed to sorting in a direction on a specific field, it's not easy to change direction on that same field later in the listing, meaning that the list leaps far down the list once it's out of its special state.

Edited by Fox Danger Piacenti

Merge request reports

Loading