Skip to content

feat(dashboard): add interactive column sorting to analytics tables#17394

Closed
AllardQuek wants to merge 1 commit into
NousResearch:mainfrom
AllardQuek:feat/analytics-table-sorting
Closed

feat(dashboard): add interactive column sorting to analytics tables#17394
AllardQuek wants to merge 1 commit into
NousResearch:mainfrom
AllardQuek:feat/analytics-table-sorting

Conversation

@AllardQuek

@AllardQuek AllardQuek commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds interactive column sorting to the three analytics tables (Daily Breakdown, Per-Model Breakdown, Top Skills). Previously the tables had fixed, hardcoded ordering. Now any column header can be clicked to sort by that column, with a second click toggling asc ↔ desc.

Related Issue

Fixes #17381

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

  • web/src/pages/AnalyticsPage.tsx — added useTableSort<T> generic hook and SortHeader component; applied sorting to DailyTable, ModelTable, and SkillTable

Note on the Per-Model default sort: The previous hardcoded sort ordered by input_tokens + output_tokens combined. This PR defaults to input_tokens descending instead — a real column rather than a derived value. In practice the ranking is identical since input tokens dominate output by 3–10×, and using a real field keeps the sort hook generic without needing computed fields.

How to Test

  1. Run cd web && npm run dev and open the Analytics page
  2. Click any column header in the Daily Breakdown, Per-Model Breakdown, or Top Skills table — the table should sort by that column descending
  3. Click the same header again — order should flip to ascending; the arrow icon updates accordingly
  4. Click a different header — sort resets to descending on the new column; the inactive column headers show a dim ↕ indicator

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: macOS 15

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

Screenshots / Logs

  1. default column for sorting shown (descending icons)
  2. sorting functionality for columns (default neutral icons)
image

@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have labels Apr 29, 2026
@teknium1

teknium1 commented May 1, 2026

Copy link
Copy Markdown
Contributor

Merged via #18192. Your commit was cherry-picked onto current main (your branch was ~330 commits behind, so a direct merge would've pulled in a stale tree), with your authorship preserved in git log — commit 226fd79 on main. Thanks for the contribution, @AllardQuek!

#18192

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low — cosmetic, nice to have type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Add interactive column sorting to dashboard analytics tables

3 participants