Skip to content

feat(leaderboard): add peer comparison mode and side-by-side performa…#106

Closed
Vachhani-Tapan wants to merge 1 commit into
codepvg:mainfrom
Vachhani-Tapan:main
Closed

feat(leaderboard): add peer comparison mode and side-by-side performa…#106
Vachhani-Tapan wants to merge 1 commit into
codepvg:mainfrom
Vachhani-Tapan:main

Conversation

@Vachhani-Tapan
Copy link
Copy Markdown

Description

This PR introduces a peer comparison feature to the LeetCode leaderboard, allowing students to select up to 3 peers and compare their current stats and daily grinding histories side-by-side.

Linked Issue

Fixes #103

Changes Made

  • Comparison Mode Toggle: Added a static terminal-themed COMPARE_MODE button to explicitly enable/disable peer selection.
  • Checkboxes & State Syncing: Implemented custom terminal-styled checkboxes prepended to both desktop rows (.leaderboard-row) and mobile cards (.mobile-card) with cross-view checking state synchronization.
  • Floating Action Panel: Added a fixed bottom action bar to track selected users (supporting 2 to 3 selections) with an launch button.
  • Performance Breakdown Modal: Integrated Chart.js to render a visual bar chart comparing easy/medium/hard solves and a multi-line graph plotting cumulative solves over time fetched from the user history endpoint.
  • Retro Theme Accentuation: Handcrafted UI elements to conform to the existing cyberpunk CRT scanline aesthetics.

Type of Change

  • Bug fix
  • New feature
  • UI/Visual update
  • Documentation update
  • Refactor

Testing

  • Tested locally
  • Tested on mobile viewport (if applicable)
  • No console errors introduced

Checklist

  • My code follows the project's coding style
  • I have formatted my code locally using Prettier
  • I have performed a self-review of my code
  • My changes generate no new warnings or errors
  • I have updated documentation if required
  • I have linked the relevant issue

Screenshots / Screen Recording

image image

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2026

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.

A maintainer will review your submission shortly.

@Vachhani-Tapan
Copy link
Copy Markdown
Author

Hey @jagdish-15 Sir I have created the comparison mode please review it and I have also added the screenshots refer them also . Thank You

Copy link
Copy Markdown
Collaborator

@jagdish-15 jagdish-15 left a comment

Choose a reason for hiding this comment

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

There are a few merge conflicts with the latest main branch changes, mainly around the leaderboard rendering logic and the recent XSS/security fixes.

Please resolve the conflicts carefully while preserving:

  • the safe DOM-based rendering from main (instead of reintroducing innerHTML),
  • the newer leaderboard additions like totalSolved and rank-change indicators,
  • along with the compare-mode functionality from this PR.

Once the conflicts are resolved and everything works together correctly, I’ll review it again.

@jagdish-15
Copy link
Copy Markdown
Collaborator

Since the leaderboard logic has now been modularised further, please move the comparison-related logic into a separate js/leaderboard/compare.js file instead of keeping it inside leaderboard.html.

While resolving the current conflicts, please adapt the compare feature to the newer structure as well, rather than merging everything back into the main leaderboard script.

@Vachhani-Tapan
Copy link
Copy Markdown
Author

Okk Sir @jagdish-15 I will do the given changes in the code . For now i am closing this PR and will open new PR after doing the work done .

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.

feat: Implement a side-by-side user comparison tool for the leaderboard

2 participants