Skip to content

Add leaderboard to initial welcome screen#57

Open
akshayravikumar wants to merge 1 commit intomasterfrom
add-leaderboard
Open

Add leaderboard to initial welcome screen#57
akshayravikumar wants to merge 1 commit intomasterfrom
add-leaderboard

Conversation

@akshayravikumar
Copy link
Copy Markdown
Owner

@akshayravikumar akshayravikumar commented Jan 23, 2025

Add Monthly Top Scores Leaderboard to Welcome Screen

This PR adds a new feature to display the top 5 scores from the current month on the welcome screen.

Changes

  • Added loadTopScoresThisMonth() function that queries the leaderboard collection for scores from the current month
  • Modified showIntro() to call the new function when the welcome screen is displayed
  • The leaderboard displays player name, rank, and score in descending order
  • Added appropriate error handling and empty state messaging

Implementation Details

  • Query filters scores starting from the first day of the current month
  • Results are limited to the top 5 scores and ordered by score (highest first)
  • Each entry shows rank (some styling and lots more problems #1, Added three problems #2, etc.), player name, and score
  • Error states are properly handled with user-friendly messages

Copy link
Copy Markdown

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

❌ Changes requested. Reviewed everything up to 0b872c4 in 1 minute and 44 seconds

More details
  • Looked at 60 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. public/assets/js/index.js:89
  • Draft comment:
    loadTopScoresThisMonth is defined twice. Remove the duplicate definition to avoid redundancy.
  • Reason this comment was not posted:
    Marked as duplicate.
2. public/assets/js/index.js:349
  • Draft comment:
    loadTopScoresThisMonth is defined twice. Remove the duplicate definition to avoid redundancy.
  • Reason this comment was not posted:
    Marked as duplicate.

Workflow ID: wflow_w8HHW9CGC9eciLio


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

}
}

async function loadTopScoresThisMonth() {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is a duplicate of the existing loadLeaderboard function which already supports monthly filtering via timeRange='month'. Consider extending the existing function with parameters for limit and target element instead of creating a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant