Skip to content

[UI] Add options to sort games by title and status #1249

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
May 1, 2022
Merged

Conversation

flavioislima
Copy link
Member

@flavioislima flavioislima commented Apr 28, 2022

simplescreenrecorder-2022-04-28_18.58.05.mp4

Use the following Checklist if you have changed something on the Backend or Frontend:

  • Tested the feature and it's working on a current and clean install.
  • Tested the main App features and they are still working on a current and clean install. (Login, Install, Play, Uninstall, Move games, etc.)
  • Created / Updated Tests (If necessary)
  • Created / Updated documentation (If necessary)

Copy link
Collaborator

@arielj arielj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is happening to me:
image

The sort order applies to the first installed order, so I see A-Z in installed then Z-A in not-installed. If I toggle the installed state sort, I get A-Z not-installed and then Z-A installed.

I imagine there's a bug in my original sort by state code (the one that only seem to apply in the build (?)).

A question on this is if we should store the sorting in the config, now the change is not persisted so if you change to another screen or restart heroic it falls back to the default A-Z installed first

<ActionIcons />
<ActionIcons
sortAscending={sortAscending}
setSortAscending={() => setSortAscending(!sortAscending)}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe name these props toggleSort... instead of setSort...?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, sounds good.

@flavioislima
Copy link
Member Author

Yes, I will experiment a bit more with this logic tomorrow and add the persistence on the store. Makes sense to get back to same filter after restarting heroic and changing screens. 👍

@flavioislima
Copy link
Member Author

@arielj can you try again? I believe I could fix the logic now.

@flavioislima flavioislima requested a review from arielj April 30, 2022 12:16
@flavioislima flavioislima added the pr:ready-for-review Feature-complete, ready for the grind! :P label Apr 30, 2022
Copy link
Collaborator

@arielj arielj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the sort shows A->Z, the games are sorted Z->A. The order is consistent for installed/not installed now.

image

Maybe this is intentional though, like if the icon means click here to sort from A->Z instead of the current order is from A->Z, click here to toggle it.

If this was intentional I vote to change it to mean the current order is ..., I think it's more clear, and the yellow color gives the idea that that is the current state of that action (like the layout icons and the installed sort icon)

@flavioislima
Copy link
Member Author

Yes, I thought would he ideal to show what's next after clicking but that might he confusing as well.

@flavioislima flavioislima requested a review from arielj April 30, 2022 17:37
Copy link
Collaborator

@arielj arielj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@flavioislima flavioislima merged commit 72b5039 into main May 1, 2022
@flavioislima flavioislima deleted the add_sort_options branch May 1, 2022 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:ready-for-review Feature-complete, ready for the grind! :P
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants