Skip to content

Conversation

@andrewginns
Copy link
Owner

@andrewginns andrewginns commented Jul 6, 2025

Interactive sorting functionality to the Merbench leaderboard, improves the UI for cost and success rate display, and refines filter and event handling for a better user experience.

Problem:

Previously, the Merbench leaderboard table was static: users could not sort models by cost, success rate, or other columns. Additionally, filter events did not trigger updates as expected, and the cost and success rate indicators lacked visual clarity.

Solution:

  • Introduced interactive, client-side sorting for all columns in the leaderboard table, allowing users to sort by any metric.
  • Refactored filtering logic to ensure all relevant events trigger UI updates.
  • Enhanced visual representation of success rate and cost via progress bars.
  • Updated the Content Security Policy to allow for required inline scripts.

Unlocks:

  • Enables users to quickly analyse and compare leaderboard entries using custom sort order.
  • Improves usability and accessibility of the Merbench page.
  • Lays the groundwork for future data-driven improvements and richer interactivity.

Detailed breakdown of changes:

  • Added src/scripts/merbench-sorting.ts: Implements the sorting logic and DOM manipulation for the leaderboard.
  • Refactored src/components/merbench/LeaderboardTable.astro: Added sortable headers, progress bars for cost, and improved accessibility.
  • Updated src/lib/merbench.ts: Added sorting utilities and refactored the leaderboard update logic.
  • Modified src/scripts/merbench-filters.ts and src/scripts/merbench-init-csp.ts: Integrated the new sorting and leaderboard update logic.
  • Improved filter event handling in src/components/merbench/CombinedFilters.astro: Now dispatches change events on all checkboxes, ensuring accurate UI updates.
  • Adjusted the Content Security Policy in public/_headers to support the new functionality.
  • General code clean-up and improved modularity in relevant scripts and components.

- Implement clickable column headers with sort indicators, sorting utilities, and state management.
- Headers now support ascending/descending sort by model name, success rate, cost, duration, tokens, runs, and provider with visual feedback.
@github-actions
Copy link

github-actions bot commented Jul 6, 2025

Preview deployment ready!

📋 PR #28 has been deployed to: https://andrewginns.github.io/

Built from commit: 4fd8dd0


This preview will be updated automatically when you push new commits to this PR.

@github-actions
Copy link

github-actions bot commented Jul 6, 2025

Preview deployment ready!

📋 PR #28 has been deployed to: https://andrewginns.github.io/

Built from commit: 3b2c106


This preview will be updated automatically when you push new commits to this PR.

@andrewginns andrewginns merged commit c440c9d into main Jul 6, 2025
2 checks passed
@github-actions
Copy link

github-actions bot commented Jul 6, 2025

🚀 Production deployment ready!

📋 PR #28 has been deployed to production: https://148a543a.andrewginns.pages.dev

Built from commit: c440c9d


Your changes are now live on the production site!

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.

2 participants