robert-damoc / game-stats

0 stars 0 forks source link

Sort games table in the UI #21

Closed robert-damoc closed 1 year ago

robert-damoc commented 1 year ago

If I click the state column header, the games should be sorted by state. Default sorting is by id: :asc Maybe we should consider the default as created_at: :desc? 🤔

For the UI, we don't want text decoration (i.e. the column name should be as we had it before) The column that is sorted now, will have an indicator (up arrow ^ or down arrow v, based on direction). The others won't have it

Use-cases:

  1. Open the page, they are sorted from the newest to the latest
  2. I click on the state column, they are sorted by state: :asc
  3. I click on the state column, they are sorted by state: :desc
  4. I click on the state column, they are sorted by state: :asc
  5. I click on the id column, they are sorted by id: :asc
  6. I click on the state column, they are sorted by state: :asc
  7. I click on the id, sort by id: :asc