Skip to content

feat(ledger): clickable column headers to sort leaderboard - #770

Merged
Flotapponnier merged 1 commit into
devfrom
feat/ledger-sortable-columns
Jun 28, 2026
Merged

Flotapponnier merged 1 commit into
devfrom
feat/ledger-sortable-columns

Conversation

@Flotapponnier

Copy link
Copy Markdown
Collaborator

Summary

  • Numeric column headers in LedgerTable are now clickable to re-sort the leaderboard.
  • First click on a header sorts descending on that column. Re-clicking the active header toggles asc/desc. Active header shows a chevron next to the label.
  • Sortable: Name (A-Z), every customCols entry, Value (when a panel tab is active), p50/p90/p99/Mean, Delta field, Success, and Slot delta p50 (when hasSlots). Trend and the rank Number column stay static.
  • Default sort (sortKey === null) preserves the EXACT prior comparator (pickValue + higherIsBetter) so OG renders, share cards, and existing snapshots keep matching. A non-null key routes through a new pickSortValue helper.

Notes

  • aria-sort lives on the <th> (ARIA spec compliance; eslint warned when it was on the button).
  • Missing values resolve to +/-Infinity so empty cells consistently land at the bottom regardless of direction.
  • Hover lifts label from ink-muted to ink to telegraph clickability; the chevron itself stays ink-muted so it reads as a direction marker, not as emphasis.
  • Component Props signature unchanged — every existing caller still works.

Test plan

  • Verify default render order on /benchmarks/hyperliquid-frontends matches main.
  • Click Volume header on /benchmarks/hyperliquid-frontends -> rows re-sort desc on volume + chevron down appears.
  • Click Volume again -> rows re-sort asc + chevron up.
  • Click Name -> alphabetic Z->A then A->Z.
  • On a latency bench, sort by Success and confirm ranks recompute (top row stays rank 01).
  • On a Solana bench with Slot delta, confirm sort by p50 / p99 works and rows without slot data sink to the bottom.
  • pnpm typecheck clean (confirmed).
  • pnpm lint src/components/ledger-table.tsx clean (confirmed).

Numeric column headers in LedgerTable now toggle the table's sort
on click. First click on a header descends on its value, second
click toggles to ascending. An up/down chevron next to the active
header's label marks the direction; hover lifts ink-muted to ink
so the headers read as interactive.

Sortable columns: Name (A-Z), every customCols entry (per-index
key), Value (when a panel tab is active), p50/p90/p99/Mean,
Delta field, Success, and Slot delta p50 (when hasSlots). Trend
and Number columns stay static.

The default sort (sortKey null) preserves the exact prior
comparator so OG renders, share cards, and snapshot tests keep
matching. A non-null sortKey routes through a new pickSortValue
helper instead. Missing values land at +/-Infinity so empty cells
consistently sort to the bottom regardless of direction.
@Flotapponnier
Flotapponnier merged commit f9a5dff into dev Jun 28, 2026
1 check passed
@Flotapponnier
Flotapponnier deleted the feat/ledger-sortable-columns branch June 28, 2026 10:31
bakabhai993 pushed a commit to bakabhai993/OpenChainBench that referenced this pull request Sep 12, 2026
…e-columns

feat(ledger): clickable column headers to sort leaderboard
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