Page MenuHomePhabricator

Sorting of newsletters
Closed, ResolvedPublic

Description

Special:Newsletters provides a list of newsletters -- see http://newsletter-test.wmflabs.org/wiki/Special:Newsletters

Currently the sorting is... unclear. This is not very important when we have only four newsletters for testing purposes, but in a real scenario sorting matters, and a lot. Maybe one day we will have categories of newsletters, different ways of sorting them and what not. But let's just aim to have a logical first step good enough for a first release.

Proposal:

  1. Newsletters the user has subscribed to go to the top, followed by the rest.
  2. Within subscribed / non-subscribed newsletters, those with more subscribers go to the top.

This sorting doesn't need live refresh when the user changes their subscriptions. Whenever the user reloads or visits the page again, the table wll be updated. Live refresh would create jumps that might confuse the user. Imagine that you are subscribed to a newsletter with 5 subscribers, click unsubscribe kind of for testing purposes, and then the entry "disappears", being dumped down the list.

Event Timeline

Qgil raised the priority of this task from to Needs Triage.
Qgil updated the task description. (Show Details)
Qgil subscribed.
Qgil triaged this task as Medium priority.Aug 28 2015, 11:27 AM

Change 235420 had a related patch set uploaded (by Tinaj1234):
Correct sorting of newsletters in Special: Newsletters

https://gerrit.wikimedia.org/r/235420

  1. Newsletters the user has subscribed to go to the top, followed by the rest.

The current patch accomplishes this.

  1. Within subscribed / non-subscribed newsletters, those with more subscribers go to the top.

@Addshore I didn't find a way to incorporate two ways of sorting in one table using TablePager. As far as I understood, getDefaultSort() is called once in the constructor and that's it, you can choose one field name to set the sort-order. Any ideas ?

Change 235420 merged by jenkins-bot:
Correct sorting of newsletters in Special: Newsletters

https://gerrit.wikimedia.org/r/235420

@Addshore I didn't find a way to incorporate two ways of sorting in one table using TablePager. As far as I understood, getDefaultSort() is called once in the constructor and that's it, you can choose one field name to set the sort-order. Any ideas ?

What about this:

  • a first list/table at the top with the newsletters you are subscribed to, followed by
  • another table/list with all the rest of newsletters

<Glaisher> two tables..? Why two tables?
<Glaisher> Can't we just simply add a filter?
<Glaisher> two tables would look ugly on one page, I think
<Glaisher> especially, with pagination

We did not think about the pagination. A filter sounds more sensible.

Change 247843 had a related patch set uploaded (by Tinaj1234):
Add filters to customize the search of newsletters

https://gerrit.wikimedia.org/r/247843

Change 247843 merged by jenkins-bot:
Add filters to customize the search of newsletters

https://gerrit.wikimedia.org/r/247843

Glaisher subscribed.