Skip to content

feat(leaderboard): show search on all periods and match displayName - #582

Merged
junhoyeo merged 1 commit into
junhoyeo:mainfrom
leecoder:feat/leaderboard-search-all-periods
May 24, 2026
Merged

feat(leaderboard): show search on all periods and match displayName#582
junhoyeo merged 1 commit into
junhoyeo:mainfrom
leecoder:feat/leaderboard-search-all-periods

Conversation

@leecoder

@leecoder leecoder commented May 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Show the leaderboard search field on all time periods (not just All Time) and extend search to match both username and displayName.

Changes

  • UI: Remove period === "all" conditional that hid the search input — search is now visible on All Time, This Month, This Week, and Custom periods
  • UI: Remove search state reset when switching away from All Time tab (search query persists across tab switches)
  • Backend (period leaderboards): Update matchesLeaderboardSearch to match both username and displayName fields
  • Backend (All Time SQL): Update WHERE clause to include LOWER(COALESCE(displayName, '')) LIKE ... alongside username matching

Testing

  • All 10 existing leaderboard tests pass (getLeaderboard.test.ts + getLeaderboardAllTime.test.ts)
  • No TypeScript errors
  • Verified locally on dev server

Summary by cubic

Enable leaderboard search on all periods and expand matching to both username and displayName. Search now persists when switching tabs.

  • New Features
    • Show search input on All Time, This Month, This Week, and Custom.
    • Keep the search query when changing tabs.
    • Match both username and displayName in filtering, including All Time SQL via COALESCE(displayName, '').

Written for commit 9b5f47f. Summary will update on new commits. Review in cubic

…playName

- Remove period === 'all' conditional that hid the search input
- Remove search state reset when switching away from All Time tab
- Update matchesLeaderboardSearch to match both username and displayName
- Update All Time SQL WHERE clause to include displayName with COALESCE
@vercel

vercel Bot commented May 21, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
tokscale Error Error May 21, 2026 11:50pm

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 2 files

Re-trigger cubic

@junhoyeo junhoyeo left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

LGTM — SQL is parameterized, UI sound. Follow-up: add a displayName-match unit test.

@junhoyeo
junhoyeo merged commit c4d6094 into junhoyeo:main May 24, 2026
4 of 5 checks passed
@junhoyeo

Copy link
Copy Markdown
Owner

@leecoder this has been merged to v3.0.0: https://github.com/junhoyeo/tokscale/releases/tag/v3.0.0 thanks for the contribution!

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.

2 participants