Skip to content

[#888] Add leaderboard component#907

Merged
realproject7 merged 2 commits intomainfrom
task/888-leaderboard
Apr 21, 2026
Merged

[#888] Add leaderboard component#907
realproject7 merged 2 commits intomainfrom
task/888-leaderboard

Conversation

@realproject7
Copy link
Copy Markdown
Owner

Fixes #888

Summary

  • Leaderboard component: table showing top 50 users by PL points with rank, address/Farcaster username, total PL, and share %
  • Current user's row highlighted with accent background and "(you)" label
  • If user is outside top 50, their rank shown below the table ("Your rank: #N")
  • Empty state when no participants yet
  • Added to /airdrop page between UserPoints and MilestoneTrack
  • 60s stale/refetch, shares query key pattern with other airdrop components

Test plan

  • Verify top 50 entries display with rank, user, PL, share %
  • Verify Farcaster usernames shown where available, truncated addresses otherwise
  • Verify connected user's row is highlighted
  • Verify "Your rank: #N" shown when user is outside top 50
  • Verify empty state when no data
  • Verify responsive table layout on mobile

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 21, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
plotlink Ignored Ignored Apr 21, 2026 5:52am

Request Review

Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

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

Verdict: REQUEST CHANGES

Summary

The leaderboard UI is close, but the current-user matching logic depends on exact address-string equality and can fail if the API returns checksummed addresses.

Findings

  • [medium] The component lowercases the connected wallet address but compares it directly against entry.address without normalizing the entry values. If /api/airdrop/leaderboard returns checksum-cased addresses, the current user's row will not highlight and Your rank may render incorrectly even when that user is already in the top 50.
    • File: src/components/airdrop/Leaderboard.tsx:49
    • Suggestion: Normalize both sides before comparison, for example compare entry.address.toLowerCase() against the lowercased connected address in both inTop50 and isUser.

Decision

Requesting changes because the current-user highlighting and own-rank behavior can be incorrect depending on the API's address casing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

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

Verdict: APPROVE

Summary

The follow-up update resolves the address-normalization issue from my prior review. Current-user highlighting and own-rank logic now compare addresses case-insensitively, which matches the leaderboard requirement.

Findings

  • No remaining code-level blockers in the changed files.

Decision

Approving because the leaderboard behavior I reviewed now matches issue #888.

@realproject7 realproject7 merged commit 534278b into main Apr 21, 2026
2 of 4 checks passed
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.

[Airdrop P3] Leaderboard component

2 participants