Skip to content

feat: add sort-by options (messages, hours, cost) to leaderboard#128

Closed
yanis7774 wants to merge 1 commit intovakovalskii:mainfrom
yanis7774:feat/leaderboard-sort-options
Closed

feat: add sort-by options (messages, hours, cost) to leaderboard#128
yanis7774 wants to merge 1 commit intovakovalskii:mainfrom
yanis7774:feat/leaderboard-sort-options

Conversation

@yanis7774
Copy link
Copy Markdown

Summary

  • Adds sort-by buttons (Prompts / Hours / Cost) to the global leaderboard, displayed next to the existing time-period tabs (Today / Week / All Time)
  • Active sort metric is visually highlighted (purple underline) in each leaderboard row
  • Sort buttons use purple accent to visually distinguish them from blue period tabs

Changes

  • src/frontend/app.js — added _lbSortBy state, switchLbSort() function, updated renderGlobalBoard() sorting logic to use dynamic sort key, added sort buttons to leaderboard HTML, added .lb-sort-active class to active metric in stats
  • src/frontend/styles.css — added styles for .lb-tabs-row, .lb-sort-tabs, .lb-sort-label, .lb-sort, .lb-sort-active

How it works

The sort selector works in combination with time-period tabs:

  • Period tabs (Today/Week/All Time) control which time window to display
  • Sort buttons (Prompts/Hours/Cost) control which metric to rank by

Closes #123

Test plan

  • Open Leaderboard view
  • Verify "Sort by: Prompts | Hours | Cost" buttons appear to the right of period tabs
  • Click each sort button — leaderboard re-sorts by selected metric
  • Verify active sort metric is highlighted with purple underline in each row
  • Switch period tabs — sort selection persists across tab changes
  • Check dark, light, and monokai themes

🤖 Generated with Claude Code

The leaderboard now supports sorting by prompts, coding hours, or API cost
in addition to the existing time-period tabs. Active sort metric is visually
highlighted in each row.

Closes vakovalskii#123

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

Already implemented in v6.15.14 — sort by Messages/Hours/Cost added.

vakovalskii added a commit that referenced this pull request Apr 10, 2026
Merged: #156 (star sync), #155 (clipboard fallback), #159 (bind URL fix),
#157 (session name vs first prompt), #160 (MCP badges toggle), #100 (Warp launch API)
Closed: #128 (dup), #148 (banned), #161 (bad diff)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

feat: add sort-by options (messages, hours, cost) to leaderboard

2 participants