RAWeb icon indicating copy to clipboard operation
RAWeb copied to clipboard

Null values should be beneath non-null values when sorting by a column

Open hb-robo opened this issue 1 year ago • 1 comments

Describe the bug Not sure if this is a bug or just a feature request, but when sorting by columns in Games List tables, null values appear as the top result when sorting in descending order in that column. For example, I want to see the achievement set for the game released most recently. I sort by release date descending, but null values are above recent dates, obstructing the search.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'All Games' page or any other page with a games list table
  2. Click on 'Release date' column header and then click 'Latest'
  3. See error/behavior

Expected behavior I expected the most recent non-null date to be the top of the list, essentially the behavior of a "NULLS LAST" clause in SQL.

Desktop:

  • OS: Windows 10
  • Browser: Firefox
  • Version 133.0.3 64-bit (most recent build)

Additional context Arguably, this behavior could be said to apply for some 0 values in numeric columns. For example, all sets without achievements have 0 points to earn, which is sensible. However, in a view where I am looking through games both with and without achievements, I see games without sets before I see the singular achievement set with 0 points. I am not sure what preferred behavior is in this scenario, but to me it seems related.

hb-robo avatar Dec 19 '24 14:12 hb-robo

This is now fixed for release date via https://github.com/RetroAchievements/RAWeb/pull/3127, but still needs to be checked/fixed for other columns.

wescopeland avatar Jan 26 '25 16:01 wescopeland

It appears this is fully resolved. The Last Updated column doesn't seem to include null values in the response.

wescopeland avatar Mar 18 '25 20:03 wescopeland