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

[UX] Add messages when there are no games to display in the library #3536

Merged
merged 1 commit into from
Feb 11, 2024

Conversation

arielj
Copy link
Collaborator

@arielj arielj commented Feb 8, 2024

This PR adds 2 messages when we have no games to show:

  • If the user has no games at all in the library, we show a message so they can either log in or sideload games
  • If the user has at least one game in the library but nothing is displayed, we show a message to let the user know the filters are filtering all games

image
image

I'm using this Trans element that supports rendering components and HTML inside it, so the log in and add game elements are interactive in the message. At the same time it provides safety against translations including unwanted HTML since it can only show the HTML we allow (check the translation strings have <1> and <3>, i18next handle that internally, so translators have to use them for elements to render. Then i18next replaces those tags with the ones from the children.


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 Feb 8, 2024
@arielj arielj requested review from a team, flavioislima, CommandMC, Etaash-mathamsetty, Nocccer and imLinguin and removed request for a team February 8, 2024 02:40
>
{t('add_game', 'Add Game')}
</button>
<AddGameButton />
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

extracted this into a component to use it in the empty library message

font-size: 2rem;
max-width: 500px;
margin: auto;
padding-bottom: 20%;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this message looks odd vertically centered, this padding moves it a bit up

@@ -222,6 +222,10 @@
},
"title": "Downloads"
},
"emptyLibrary": {
"noGames": "Your library is empty. You can <1>log in</1> using a store or click <3></3> to add one manually.",
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 <1> and <3> are intentional, the Trans component replaces them with the tags from the children

@flavioislima flavioislima added this to the 2.13.0 milestone Feb 11, 2024
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.

This is a pretty good UX improvement that we have been missing for a long time. Should be on the next release and will help a lot of new users.

@flavioislima flavioislima merged commit 8efcd7e into main Feb 11, 2024
9 checks passed
@flavioislima flavioislima deleted the empty-library-message branch February 11, 2024 11:32
@Heroic-Games-Launcher Heroic-Games-Launcher locked and limited conversation to collaborators Feb 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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