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

web: leaderboard #104

Merged
merged 13 commits into from
Mar 14, 2024
Merged

web: leaderboard #104

merged 13 commits into from
Mar 14, 2024

Conversation

SveaGaenzle
Copy link
Collaborator

@SveaGaenzle SveaGaenzle commented Mar 9, 2024

I have tried to create a basic leaderboard for the web.

Issue:

Description:

  • I added getAllUsers and getRankedUsers to the sqlite.data file.
  • getAllUsers returns all users from the database.
  • getRankedUsers ranks all users according to the highest (mu-sigma) value.
  • I have added the file _dashboard.leaderboard.tsx to display the leaderboard.
  • I have added to the _dashboard.leaderboard.tsx in the loader that the array with the ranked users and the logged-in user is loaded. The ranked users and the username of the logged-in user are returned.
  • The Leaderboard in _dashboard.leaderboard.tsx dislays a table (the leaderboad). The table has the columns Ranking and Username and is filled with the array users. The row corresponding to the logged-in user is colored blue. I used this layout from MUI for the leaderboard.
  • The leaderboard can display either 5, 10, 25, 50 or all users (default is 10). This can be changed using buttons at the bottom of the table. You can also switch between the individual pages using the buttons at the bottom of the table.

TODO:

  • Show the ranking of the logged-in user on Home.

@SveaGaenzle SveaGaenzle self-assigned this Mar 9, 2024
@SveaGaenzle SveaGaenzle added the web use when something changes the web in any kind label Mar 11, 2024
@PacoSchatz
Copy link
Collaborator

Thanks for your work. And good, that you changed it to sort the users now by the lower confidence bound. In my browser it looks great.

When testing it in Firefox emulating a mobile phone the table is still quite wide. This is no dealbreaker for me but neither it's perfect.
grafik
grafik

@SveaGaenzle
Copy link
Collaborator Author

I have tried to implement your suggestion.
You can now see the ranking and the usernames at the same time.
However, I did not get the navigation bar smaller, which is why you still have to scroll, wehn you whant to switch pages.
grafik
grafik

@PacoSchatz
Copy link
Collaborator

nice change. I definitely like this layout much more 👍

Copy link
Collaborator

@Cari1111 Cari1111 left a comment

Choose a reason for hiding this comment

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

Thanks for the implementation of the leaderboard. I tested all the new features and everything works correctly.

@SveaGaenzle SveaGaenzle merged commit 1967cc5 into main Mar 14, 2024
4 checks passed
@SveaGaenzle SveaGaenzle deleted the svea/web-leaderboard branch March 14, 2024 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
web use when something changes the web in any kind
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generate simple HTML page with game statistics/leaderboard
3 participants