added non-activity section#178
Conversation
|
Thank you for submitting a pull request. Please ensure your changes comply with the project's contribution guidelines and that all workflow checks pass successfully. Formatting and Branching
|
jagdish-15
left a comment
There was a problem hiding this comment.
I've tested the changes locally and the implementation looks good overall, especially the separate non-activity section in the Overall leaderboard.
There are just a couple of behavior adjustments I'd still like before merging:
-
The separate "No activity yet" section shouldn't exist only in the Overall tab. Since the same never-active users are present across all leaderboard datasets, this section should appear consistently across Daily/Weekly/Monthly as well.
-
The
--non-competitive rank placeholder behavior was mainly intended for users who temporarily have a 0 score in a specific timeframe leaderboard, but still have activity/score in the Overall leaderboard. In other words:- users with no activity at all → move to the separate non-activity section,
- users active overall but currently 0 in Daily/Weekly/Monthly → keep in the normal leaderboard flow with
--instead of a rank.
-
In the stats section:
Total Users: 90 | Showing: 26-50 | Page: 2/4I'd still prefer
Total Usersto represent the complete registered leaderboard size rather than only active users.For example, if there are 107 total users and 17 are never-active users, I think the count should still display 107 instead of 90 since those users are still searchable and still rendered later in the page under the non-activity section.
|
/format |
|
I have successfully run Prettier and pushed the formatting fixes to this PR. Note for Contributors: Because this commit was pushed by a bot, GitHub will not automatically re-run the CI checks. To trigger them to pass, you must either:
|
jagdish-15
left a comment
There was a problem hiding this comment.
I've added a few changes to improve the mobile view of the leaderboard after adding this feature, and everything looks good now.
My only concern at this point is the sync script changes, since I don't think those are really required here, the frontend is already handling this behaviour correctly on its own
| if (sortedData[i].score === 0) { | ||
| sortedData[i].originalRank = "--"; | ||
| } else { | ||
| if (i > 0 && sortedData[i].score < sortedData[i - 1].score) { | ||
| currentRank = i + 1; | ||
| } | ||
| sortedData[i].originalRank = currentRank; |
There was a problem hiding this comment.
Since the frontend is already handling this, I don't think adding the same logic again inside the sync script is really necessary
Description
This PR improves the leaderboard experience by resolving arbitrary ranking assignments for users with 0 scores. It handles zero-score behavior differently across tabs to match the terminal-style UI theme and prevent empty layouts:
--delimiter.Linked Issue
Fixes #93
Changes Made
--.Type of Change
Testing
Checklist
npx prettier --write .before submittingfeature/*branch, not themainbranchScreenshots / Screen Recording
Overall Tab Example: