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.

Details

Related Gerrit Patches:
mediawiki/extensions/Newsletter : masterAdd filters to customize the search of newsletters
mediawiki/extensions/Newsletter : masterCorrect sorting of newsletters in Special: Newsletters

Event Timeline

Qgil created this task.Jul 31 2015, 8:48 AM
Qgil raised the priority of this task from to Needs Triage.
Qgil updated the task description. (Show Details)
Qgil added a subscriber: Qgil.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 31 2015, 8:48 AM
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

Qgil added a comment.Oct 1 2015, 10:58 AM

@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
Qgil assigned this task to Tinaj1234.Oct 1 2015, 11:14 AM

<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.

Qgil added a comment.Oct 11 2015, 8:27 PM

Yes, indeed.

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 closed this task as Resolved.Nov 16 2015, 4:49 PM
Glaisher added a subscriber: Glaisher.