Skip to content
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

[UI/UX] Filters dropdown in Library. Show only installed #3266

Merged
merged 6 commits into from
Nov 29, 2023
Merged

Conversation

arielj
Copy link
Collaborator

@arielj arielj commented Nov 25, 2023

This PR fixes #1881 and adds a filter requested in discord (show only installed games).

Now all filtering options are grouped in a dropdown that shows up when clicking/hovering the Filters button.

filters-dropdown.mp4

This makes the UI more consistent anda easier to maintain:

  • it's easier to add more filters without dealing with sizes and positioning
  • it's easier to translate elements without dealing with sizes
  • we can use more text and less icons with hover tooltips (it's more accessible)
  • all filters are in the same place

I also included 2 more fixes closely related:

  • I added a Show Installed Only filter that was requested many times
  • The Show Favourites Only filter was not composable (turning it on was ignoring all other filters)

It should honor the older filtering configurations (so if a user was filtering only GOG, only GOG will be enabled in the new filters)

Note two changes:

  • because the store filter is now composable instead of exclusive, there was some code in the library header to say Epic/GOG/etc in the library title instead of All Games but that can't be done now cause we can toggle more than 1 store at a time
  • the library refresh icon was triggering a background refresh ONLY for when the GOG filter was selected, that doesn't make much sense now so I made it refresh in the background for all store (we could make it refresh in the foreground for all stores if desired instead)

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)

@arielj arielj added the pr:ready-for-review Feature-complete, ready for the grind! :P label Nov 25, 2023
@arielj arielj requested review from a team, flavioislima, CommandMC, Etaash-mathamsetty, Nocccer and imLinguin and removed request for a team November 25, 2023 15:40
"hide_non_available_games": "Hide non-available games",
"ignore_hidden": "Ignore Hidden",
"platform": "Platform",
"show_all_games": "Show all games",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

these are not needed anymore


const showNonAvailableTitle = showNonAvailable
? t('header.hide_non_available_games', 'Hide non-available games')
: t('header.show_available_games', 'Show non-Available games')
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

moving all the filters from here to LibraryFilters

grid-template-columns: 1fr min-content;
grid-template-areas:
'search search'
'filters filters';
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we don't need to drop into a second row now that the filters element is smaller

@@ -17,7 +15,7 @@ export default React.memo(function LibraryHeader({
handleAddGameButtonClick
}: Props) {
const { t } = useTranslation()
const { category, showFavourites } = useContext(LibraryContext)
const { showFavourites } = useContext(LibraryContext)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we don't have a single category anymore (I didn't like the word category anyway haha), so the code that depended on this was removed

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we can't change the library title based on the category cause now they are composable, so removing this

@flavioislima
Copy link
Member

That is looking pretty great. I will do some testing during the week :D

@flavioislima
Copy link
Member

flavioislima commented Nov 28, 2023

Testing here. Overall looks good.
Some good additions would be to:

  • Have a ALL Button that will select everything
  • Do not allow to unselect all stores and all platforms if possible (I imagine some people might come to us asking why their library is gone).
  • Also, I am not sure if that is expected but selecting all stores by deselecting all platforms makes it show native linux games + Browser games.

image

If those are too much we can improve it in another PR since most of the feature is working fine :)

@arielj
Copy link
Collaborator Author

arielj commented Nov 28, 2023

I implemented that if you don't select any platform it behaves like if all platforms are selected. Same with the stores, selecting none is like selecting all. To avoid that problem of users deselecting everything and then complaining haha.
I didn't add an All cause that felt different to the rest of the options (each check is composable, we would have to handle the All in a different way, I wanted to avoid the extra code, and as a button makes the UI kinda inconsistent.

the third element seems to be a bug, I'll check that later today

@arielj
Copy link
Collaborator Author

arielj commented Nov 28, 2023

Just pushed a fix with the missing windows games with nothing selected.

For the other two:

  • we can allow users to unselect everything, it will just show all games so I think it's safe, if somebody expect that to not show any game I can jump in and ask "but why?"
  • for the All button, I'd wait to see if it's something needed, it will make the UI inconsistent with a button or a check box that works different than the rest (and we would need 2 of those one for platforms and one for stores)

@flavioislima
Copy link
Member

Just pushed a fix with the missing windows games with nothing selected.

For the other two:

* we can allow users to unselect everything, it will just show all games so I think it's safe, if somebody expect that to not show any game I can jump in and ask "but why?"

* for the `All` button, I'd wait to see if it's something needed, it will make the UI inconsistent with a button or a check box that works different than the rest (and we would need 2 of those one for platforms and one for stores)

Sounds good, lets gather some feedback.

i believe this one is ready to be merged since it is not breaking anything, so it can be on the next release.

Copy link
Member

@flavioislima flavioislima left a comment

Choose a reason for hiding this comment

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

LGTM

@arielj arielj merged commit 3cf6091 into main Nov 29, 2023
13 checks passed
@arielj arielj deleted the filters-dropdown branch November 29, 2023 22:43
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.

Proposal: Change behavior of All / Epic / GOG and All / Window / Linux filtering
2 participants