Skip to content
New issue

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

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

Already on GitHub? # to your account

Leaderboard #855

Merged
merged 25 commits into from
Apr 22, 2023
Merged

Leaderboard #855

merged 25 commits into from
Apr 22, 2023

Conversation

sgfost
Copy link
Contributor

@sgfost sgfost commented Mar 28, 2023

Adds global high scores and personal game history pages

resolves #852
resolves #851

sgfost and others added 9 commits February 28, 2023 16:02
Co-authored-by: Allen Lee <alee@users.noreply.github.com>
Co-authored-by: saachibm <saachibm@users.noreply.github.com>
created leaderboard.ts  in server/src/routes section for issue virtualcommons#851 and added b-table in Leaderboard.vue for virtualcommons#852
Issue virtualcommons#852 created table and added table components + ordered rank in ascending order
Issue virtualcommons#851 tried to do AJAX handling requests and see bot/non-bot data
Issue virtualcommons#852 Added bot/non-bot buttons (tried to link button to a function that retrieves data) and reconfigured containers for vertical view
Co-authored-by: saachibm <saachibm@users.noreply.github.com>

ref virtualcommons#851

feat: improve leaderboard view styling/functionality

- added fetch on create
- reworked styling to be more consistent
- added filter switch

ref virtualcommons#852

Co-authored-by: saachibm <saachibm@users.noreply.github.com>

feat: add leaderboard service highscore queries

ref virtualcommons#851
Issue virtualcommons#852 Started connecting button to client data (and went over code in Leaderboard.ts)
issue virtualcommons#852  and virtualcommons#851
setup TODO and FIXME for requirements
LiveShare VSC with Scott, Saachi, and I
Issue virtualcommons#852
- Added the rest of leaderboard item fields
- Added sortable to leaderboard fields (rank & username)
- Squashed 2 commits and reconfigured Tiffany's local repository

Co-Authored-By: Tiffany Kawamura <86638759+Tkawamura02@users.noreply.github.com>
@sgfost
Copy link
Contributor Author

sgfost commented Mar 28, 2023

Looking this over again, it seems like commit history got a bit mangled (probably by github desktop) with a merge creating duplicate commits, easily fixable but ought to be done before merging this

Also: get in the habit of using semantic commit messages, helps out with consistency so our future selves can figure out what happened

sgfost and others added 2 commits March 31, 2023 15:02
- added fetch on create
- reworked styling to be more consistent
- added filter switch

ref virtualcommons#852

Co-authored-by: saachibm <saachibm@users.noreply.github.com>
Co-authored-by: Tkawamura02 <Tkawamura02@users.noreply.github.com>
uses the old service and component that was used for the player
dashboard

TODO:
- rework/restyle the PlayerStatItem component and the parent page

Co-authored-by: Tiffany Kawamura <Tkawamura02@users.noreply.github.com>
Co-authored-by: saachibm <saachibm@users.noreply.github.com>
@Tkawamura02
Copy link
Contributor

Tkawamura02 commented Apr 6, 2023

UPDATED TASKS FOR THIS ISSUE

  • 1. fix any corner cases / bugs in the query logic that are causing the current leaderboard issues with the null points
  • 2. Ensure that the only games ending in success count in the points total for a given player
  • 3. Embed a short summary leaderboard view in the landing page as a contrasting section (after Gameplay?). This would only include the top 10 players and could be parameterizable Prop for the component
  • 4. Minor styling improvements as needed

@saachibm
Copy link
Contributor

saachibm commented Apr 6, 2023

UPDATED TASKS FOR THIS ISSUE

  • 1. fix any corner cases / bugs in the query logic that are causing the current leaderboard issues with the null points
  • 2. Ensure that the only games ending in success count in the points total for a given player
  • 3. Embed a short summary leaderboard view in the landing page as a contrasting section (after Gameplay?). This would only include the top 10 players and could be parameterizable Prop for the component
  • 4. Minor styling improvements as needed

Tiffany and I worked on task 2 and are continuing to figure out how to fix null points/corner cases (4/5/23)

sgfost and others added 3 commits April 7, 2023 16:36
- fixed issue with returning records with null points
- only sum points from games with status=victory
- added limit param to request

Co-authored-by: saachibm <saachibm@users.noreply.github.com>

Co-authored-by: Tiffany Kawamura <Tkawamura02@users.noreply.github.com>
- extract leaderboard table into component, used by page/anywhere else
- rework some of the displayed data for (hopefully) better clarity
- restyling

Co-authored-by: saachibm <saachibm@users.noreply.github.com>
Co-authored-by: Tiffany Kawamura <Tkawamura02@users.noreply.github.com>
@sgfost
Copy link
Contributor Author

sgfost commented Apr 8, 2023

Just need to clean up the player stats/past games page for this to be ready to merge

saachibm and others added 2 commits April 12, 2023 19:34
Co-authored-by: Tiffany Kawamura <Tkawamura02@users.noreply.github.com>
Sabrina Nelson
<sabrinanel3@users.noreply.github.com>
brought more in line with current styling and some refactoring on
client/server

Co-authored-by: Tiffany Kawamura <Tkawamura02@users.noreply.github.com>
Co-authored-by: saachibm <saachibm@users.noreply.github.com>
@sgfost sgfost marked this pull request as ready for review April 17, 2023 18:13
alee added 4 commits April 20, 2023 13:18
- add visually cliched table striping for contrast
- use _rowVariant to highlight highest point players
TODO: should consider renaming leaderboard route to stats with
/leaderboard /player endpoints instead
add clarification tooltip to victory %

TODO: we should also add actual victories, the number of games where all
players survived and the player had the most victory points.
- mount .prettierrc into client and server containers so yarn style:fix
  should now work
- merge staging.base.yml into staging.yml, the docker ports added in
  staging.yml are also used in prod
Copy link
Member

@alee alee left a comment

Choose a reason for hiding this comment

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

Overall everything looks great but see the comments inline. Also I think there may be a bug in the player stats code (see screenshot) - the code in LeaderboardService looks OK though so I'm not exactly sure where it may be arising from.

image


export const leaderboardRouter = Router();

leaderboardRouter.get("/", async (req, res, next) => {
Copy link
Member

Choose a reason for hiding this comment

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

feels like leaderboard is a part of /stats, not the other way around. how about routes like:

/stats/leaderboard
/stats/player

No need to address in this PR, but we might want to create an issue for this to be resolved later

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ended up resolving this alongside the other renaming, stats is now the base url/service name/category for directory naming purposes

alee and others added 3 commits April 20, 2023 23:47
Co-authored-by: Tiffany Kawamura <Tkawamura02@users.noreply.github.com>
- leaderboard (as a categorization) is now stats
- player stats is now game history

Co-authored-by: Tiffany Kawamura <Tkawamura02@users.noreply.github.com>
@sgfost
Copy link
Contributor Author

sgfost commented Apr 21, 2023

Should be good to go @alee, anything not addressed in the last couple of commits are in new issues

extract seems unnecessarily long
Copy link
Member

@alee alee left a comment

Choose a reason for hiding this comment

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

LGTM thanks all!

@alee alee merged commit c666a68 into virtualcommons:main Apr 22, 2023
@alee
Copy link
Member

alee commented May 3, 2023

@all-contributors
please add @sgfost for mentoring, code, doc, and design.
please add @Tkawamura02 for code, doc, and design.
please add @saachibm for code, doc, and design.

@allcontributors
Copy link
Contributor

@alee

I've put up a pull request to add @sgfost! 🎉

I've put up a pull request to add @Tkawamura02! 🎉

I've put up a pull request to add @saachibm! 🎉

@alee alee deleted the leaderboard-feat branch December 7, 2023 21:31
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

create leaderboard page view create leaderboard service
4 participants