Skip to content

fix(leaderboard): render empty search state with clear filter button - #251

Merged
O2sa merged 1 commit into
O2sa:mainfrom
Sanjaykris20:fix/leaderboard-empty-search
Oct 17, 2026
Merged

O2sa merged 1 commit into
O2sa:mainfrom
Sanjaykris20:fix/leaderboard-empty-search

Conversation

@Sanjaykris20

@Sanjaykris20 Sanjaykris20 commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Problem

When a user searches for a developer name that doesn't match anyone in the leaderboard, the table body renders completely blank. The table headers remain visible but there is no feedback — the UI looks broken.

Solution

When filtered.length === 0 && search.trim() is truthy, render a full-width empty state row inside <tbody> that:

  • Displays a helpful, i18n-aware message using leaderboard.noDevelopersSearch (interpolated with {query})
  • Shows a small Clear search secondary button that calls setSearch("") to reset the filter instantly

Files changed

File Change
src/features/leaderboard/components/leaderboard-table.tsx Added empty state row in <tbody>
src/locales/en.json Added leaderboard.noDevelopersSearch and leaderboard.clearSearch
src/locales/ar.json Added the same keys in Arabic

Checklist

  • Empty state row spans all 6 columns (colSpan={6})
  • Message uses t("leaderboard.noDevelopersSearch", { query }) for i18n
  • Clear search button calls setSearch("")
  • Both en.json and ar.json translation files updated
  • No new dependencies introduced
  • Existing sort and filter logic untouched

Fixes #250

@vercel

vercel Bot commented Oct 17, 2026

Copy link
Copy Markdown

@Sanjaykris20 is attempting to deploy a commit to the osama's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

Copy link
Copy Markdown

Thank you for the pull request! ✅

A maintainer will review this soon. Please be patient while we take a look. 🙌

@vercel

vercel Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
dev-impact Ready Ready Preview Oct 17, 2026 7:49pm UTC

@O2sa
O2sa merged commit 3df7d50 into O2sa:main Oct 17, 2026
4 checks passed
@O2sa

O2sa commented Oct 17, 2026

Copy link
Copy Markdown
Owner

🎊 Welcome, @Sanjaykris20! Your first contribution has been merged! 🚀

Thank you for helping improve the project! If you find this tool useful, please consider giving us a ⭐ star on GitHub—it helps more developers find our work and motivates us to keep improving!

@O2sa

O2sa commented Oct 17, 2026 •

Copy link
Copy Markdown
Owner

Fixes #250

@Sanjaykris20
Sanjaykris20 deleted the fix/leaderboard-empty-search branch October 18, 2026 07:40

This branch was successfully deployed

1 active deployment
Preview — 70b03a9d Deployed Oct 17, 2026 by vercel[bot]
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: Missing empty search state in LeaderboardTable when developer filter yields no results

2 participants