fix: Paginate PO history #105

Merged
shad0w merged 1 commit from claude/issue-104 into master 2026-06-23 22:10:54 +00:00
Owner

Automated fix by Claude Code for #104.

Closes #104

Review, merge, then create a release tag (vX.Y.Z) to deploy.

Automated fix by Claude Code for #104. Closes #104 Review, merge, then create a release tag (vX.Y.Z) to deploy.
shad0w added 1 commit 2026-06-23 21:56:59 +00:00
feat(history): paginate PO history with items-per-page control
All checks were successful
PR checks / checks (pull_request) Successful in 44s
PR checks / integration (pull_request) Successful in 32s
5cefe8f7ed
The /history page fetched a fixed first 200 POs in one flat table with no
way to page further and no control over page size. Replace that with real
pagination:

- page.tsx: read page/perPage from searchParams; clamp perPage to 25/50/100
  (default 25) and page to [1, totalPages] via a new shared resolvePagination
  helper. Swap the fixed take:200 for skip/take + a count() for totals.
  Replace the "first 200 results" notice with a footer ("Showing X-Y of N",
  Prev/Next, page indicator) that preserves all filters. Export PDF/CSV links
  stay on the full filtered set.
- history-filters.tsx: add a Per-page dropdown; changing it or any filter
  resets to page 1 while preserving perPage in the URL.
- lib/pagination.ts: dependency-free clamp/skip/take helper, unit-tested.

Verified: type-check clean, 272 unit tests pass (9 new), skip/take windows
and clamping checked against the test DB.

Fixes #104
shad0w merged commit 6e8d05e34e into master 2026-06-23 22:10:54 +00:00
Sign in to join this conversation.
No description provided.