Repository navigation
Page every report table by five and let each column order it - #168
Merged
Merged
Conversation
The report tables showed every row at once (by client, agent, model and channel), 25 replies or 50 conversations per page, and none could be ordered. Every table now pages with the shared pager (5 rows by default, 5/10/25/50 to choose) and orders by any column from its header. The per-group tables are ordered and paged in the browser. The reply list and the conversation list are paged by the API, so they are ordered there too: /reports/replies takes sort and order (REPLY_SORTS) and the conversation list orders by every column it shows except the ad referral ones. Unknown keys fall back to newest first, and the CSV export follows the order on screen. The "Estimated" tile counted the replies on the page being read; the cost report now returns estimated_replies for the whole period. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The report tables listed every row at once (by client, agent, model, channel), the reply log paged 25 at a time and the conversation list 50, and no table could be ordered. A busy period turned the reports into a long scroll.
What changes
TablePager: 5 rows by default, 5/10/25/50 to choose. The pager only appears once a table holds more than five rows.SortHeader, new incomponents/table-sort.tsx). The first click sorts the way the column reads best (times and amounts high to low, names A to Z); the next reverses it.aria-sortis set on the header.API
GET /reports/repliestakessort(a key ofREPLY_SORTS: date, contact, client, agent, channel, model, served by, duration, tokens, cost) andorder. Newest first remains the default; unknown keys fall back to it. The CSV export follows the same order.GET /reports/costsreturnstotals.estimated_repliesfor the period. The "Estimated" tile used to count only the replies on the page being read, which a five-row page would have made misleading.Cleanup: the old prev/next pager (
.report-pager,reports.prev,reports.next) is gone; nothing else used it.Tested
tests/test_cost_reports.py,tests/test_report_conversations.py,tests/test_reports.py,tests/test_report_operations.py: 13 passed, including new ordering tests and an injection-shaped sort key.tsc --noEmitand ESLint on the changed files: clean.🤖 Generated with Claude Code