Repository navigation
feat(leaderboard): add worldwide leaderboard with runtime display limit - #231
Conversation
|
@1-DARK is attempting to deploy a commit to the osama's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Thank you for the pull request! ✅ A maintainer will review this soon. Please be patient while we take a look. 🙌 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
O2sa
left a comment
There was a problem hiding this comment.
One thing I'd request before merging: please keep this PR focused on the worldwide leaderboard feature.
The PR currently includes commits related to the sortable leaderboard columns and the Testing Library/jsdom dependency changes, which appear to belong to a different feature.
If those changes are already merged into main, please rebase this branch and remove them from the PR. If this PR depends on them, please mention that dependency clearly and make sure the prerequisite changes are merged first.
Keeping the PR limited to the worldwide leaderboard changes will make it easier to review and avoid accidentally merging unrelated changes.
edb355e to
1305c8f
Compare
|
✨ Thank you, @1-DARK! Another great contribution merged! 🚀 You've been a fantastic contributor! We truly appreciate your continued support. |
Summary
Adds a worldwide leaderboard at
/leaderboard/worldwidethat ranks users from all countries together. The number of users shown is set at runtime throughWORLDWIDE_LEADERBOARD_DISPLAY_LIMIT.Closes #187
Changes
WORLDWIDE_LEADERBOARD_DISPLAY_LIMIT, falling back to100when missing or invalid. Country leaderboards still useLEADERBOARD_DISPLAY_LIMIT(default500).services/display-limit.ts, used byleaderboard-service.tsandcalculate-leaderboard.ts./leaderboard.worldwide.en.jsonandar.json..env.exampleandREADME.mdupdated.Screenshots
How to test
cp .env.example .envand setGITHUB_TOKENpnpm db:up && pnpm redis:up(runpnpm leaderboard:calculateif the DB is empty)pnpm run dev, open/leaderboard, and click the Worldwide cardWORLDWIDE_LEADERBOARD_DISPLAY_LIMIT=3, restart, and confirm only 3 users show