Skip to content

Make the leaderboard's HS and TK columns sortable - #25

Open
jbob06 wants to merge 1 commit into
warcon-app:mainfrom
jbob06:sort-hs-tk-leaderboard-columns
Open

jbob06 wants to merge 1 commit into
warcon-app:mainfrom
jbob06:sort-hs-tk-leaderboard-columns

Conversation

@jbob06

@jbob06 jbob06 commented Sep 21, 2026

Copy link
Copy Markdown

Summary

  • Headshots and team kills are already computed from the kill feed in the same query as every other stat (base CTE in src/lib/server/leaderboards.ts) and already ride along on every BoardRow, but BoardMetric, metricValue and METRIC_SQL had no cases for them.
  • As a result LeaderboardTable.svelte rendered the HS and TK headers as plain <th> instead of SortHeader, while every other numeric column (K, D, K/D, K/h, Matches, W-L-D, Win %, Cash) is sortable.
  • Adds 'headshots' and 'teamKills' as board metrics end to end: type, label, metricValue, SQL ORDER BY expression, and wraps the two headers in SortHeader.

Test plan

  • bun test src/lib/leaderboard.test.ts — 15 pass
  • bun run check (svelte-check) — 0 errors; verified the checker actually catches a broken case by injecting one deliberately, then reverted

Headshots and team kills already flow through the same query as every
other stat (base CTE in leaderboards.ts computes both from the kill
feed), but BoardMetric, metricValue and METRIC_SQL never had cases for
them, so the two columns rendered as plain <th> instead of SortHeader.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BWZwm5xPaSTDmhB8qnddaM
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.

1 participant