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

Merged
LE
6mo ago
+30-25

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, '').