Skip to content

Sort metric breakdown rows by current value - #320

Merged
gkhngyk merged 1 commit into
ansvisor:mainfrom
Peter7896:peter7896/issue-316-breakdown-cur-sort
Jun 29, 2026
Merged

gkhngyk merged 1 commit into
ansvisor:mainfrom
Peter7896:peter7896/issue-316-breakdown-cur-sort

Conversation

@Peter7896

Copy link
Copy Markdown
Contributor

This fixes #316 by sorting the metric breakdown drawer rows by current value for display without changing the underlying breakdown order used by the top-driver summary.

What changed:

  • Added a small display helper that returns a sorted copy of breakdown rows by cur descending, with deterministic tie-breakers.
  • Updated the breakdown table to render that display order for prompts, platforms, and topics.
  • Added focused coverage proving the helper sorts by current value and does not mutate the source row order.

Validation:

  • npm test -- breakdown-display.test.ts
  • npm run typecheck
  • npm run format:check
  • git diff --check

@gkhngyk gkhngyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again, @Peter7896 — another clean one! 🙌 I like that you kept it a display-only sort on a copy ([...rows].sort), so the underlying delta order the top-driver summary depends on stays intact, and the deterministic tie-breakers + non-mutation test are exactly the right touches. Verified locally: typecheck, lint, and the new test all green. Merging now.

@gkhngyk
gkhngyk merged commit 6ef25c0 into ansvisor:main Jun 29, 2026
3 checks passed
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(insights): sort the metric breakdown drawer's prompts list by current value (Cur) descending

2 participants