Skip to content

Fix deterministic leaderboard sorting and tied ranks#95

Open
nikkkkj wants to merge 1 commit into
gbabaisaac:mainfrom
nikkkkj:codex/fix-leaderboard-sorting-ties
Open

Fix deterministic leaderboard sorting and tied ranks#95
nikkkkj wants to merge 1 commit into
gbabaisaac:mainfrom
nikkkkj:codex/fix-leaderboard-sorting-ties

Conversation

@nikkkkj

@nikkkkj nikkkkj commented May 14, 2026

Copy link
Copy Markdown

Fixes #8.

Summary

  • Extract leaderboard sorting/ranking into a reusable helper
  • Sort by earned amount descending, then name/id for deterministic ties
  • Assign equal ranks to users with the same earnings
  • Add node:test coverage for tie ordering and rank assignment
  • Fix an existing form validation TypeScript error that blocked production builds

Verification

  • npm test
  • npm run build

Note: npm run build still reports the existing Next.js <img> lint warning in src/components/leaderboard.tsx, but the build completes successfully.

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.

Bug Fix: Sorting Logic Bug

1 participant