T398416 Provide way to sort a table column in descending order on first click (original) (raw)

Provide way to sort a table column in descending order on first click

Closed, ResolvedPublicFeature

Feature summary

Make an option for a sortable table column to use descending order on the first click, e.g. with class="sortreverse" in the column header or something like data-sort-type="number; descending".

Use case(s)

You often have to click twice to get the sort order nearly everybody probably wants, especially for numbers where larger often means better or more interesting like medals or population.
Some users may not even realize they can click again to reverse the order.

Benefits
Most users would get their wanted sort order with a single click.

Related Changes in Gerrit:

Event Timeline

neriah changed the task status from Open to In Progress.Fri, May 29, 8:48 AM

neriah claimed this task.

neriah triaged this task as Medium priority.

Comment Actions

Hello @neriah,
For tech news, is this wording okay?

"Wikimedia projects have improved sortable table columns: now, clicking a column header once sorts it in descending order. Previously, users had to click twice to achieve this, which was not widely known. This change makes sorting tables faster and more intuitive."

Comment Actions

"Wikimedia projects have improved sortable table columns: now, clicking a column header once sorts it in descending order. Previously, users had to click twice to achieve this, which was not widely known. This change makes sorting tables faster and more intuitive."

That's not accurate. A column is only sorted in descending order on first click if it has data-sort-order="desc" specified. See https://www.mediawiki.org/wiki/Help:Sortable_tables#Forcing_the_initial_sort_direction.

Thanks for the clarification.

I now the information as:

Wikitables can now be sorted in descending order on the first click by adding data-sort-order="desc" to the header cell. Previously, by default, clicking a column header for the first time sorts it in ascending order. This addition to a Wikitable gives it more control and flexibility, while the default behavior for subsequent clicks remains unchanged.

Content licensed under Creative Commons Attribution-ShareAlike (CC BY-SA) 4.0 unless otherwise noted; code licensed under GNU General Public License (GPL) 2.0 or later and other open source licenses. By using this site, you agree to the Terms of Use, Privacy Policy, and Code of Conduct. · Wikimedia Foundation · Privacy Policy · Code of Conduct · Terms of Use · Disclaimer · CC-BY-SA · GPL · Credits