Incorrect initial order when user sorts topic list

Priority/Severity:

Medium

Platform

Operating System

  • Windows 11
  • macOS Sonoma

Browser

  • Google Chrome 119.0.6045.124
  • Safari 17.1 (19616.2.9.11.7)

Discourse

38e53b5e8eab64225879a1b855bc50242f2791e5

Description:

The user can choose to sort lists of topics by:

  • Number of replies
  • Number of views
  • Timestamp of latest activity

The criterion by which to sort is selected by clicking the associated column heading.

The sort order is toggled between ascending and descending by subsequent clicks on the column. A ˄ symbol suffix on the heading indicates ascending sort order and a ˅ symbol indicates descending sort order.

:bug: On the first click on the column, the ascending symbol appears even though the list is sorted in descending order.

:bug: On the second click on the column, the sort order does not toggle.

Reproducible steps:

  1. Open any topic list:
    https://try.discourse.org/
  2. Click the “Views” column heading.
    :bug: The ˄ ascending symbol appears next to the column heading even though the list is sorted in descending order.
  3. Click the “Views” column heading.
    :bug: The sort order of the column remains descending instead of switching to ascending as expected.
    :slightly_smiling_face: The sort order symbol changes to ˅, matching the current sort order.
  4. Click the “Views” column heading.
    :slightly_smiling_face: The sort order toggles from descending to ascending.
    :slightly_smiling_face: The sort order symbol changes to ˄, matching the new sort order.
  5. Click the “Views” column heading.
    :slightly_smiling_face: The sort order toggles from ascending to descending.
    :slightly_smiling_face: The sort order symbol changes to ˅, matching the new sort order.

Additional context

I notice that the ˅ symbol is shown momentarily after the column is selected, before changing to ˄:

sort


I am able to reproduce the fault on try.discourse.org in “safe mode”.


Originally reported at Issue with sorting new posts by number of replies - Website and Forum - Arduino Forum

3 Likes

Yup, I can repro here on Meta also.

1 Like

Thanks for the report @per1234 - we have a fix in the pipeline for this

EDIT merged and deployed.

3 Likes