Current state: /api/reviews returns a fixed 6 latest; /api/judges/{id}/reviews and /api/court-houses/{id}/reviews return everything; /admin/reviews and /admin/users paginate locally via in-memory slicing.
At 100+ reviews per popular judge, these become a real UX cliff (long lists, slow renders, big payloads).
Scope
- Once the upstream pagination umbrella (
stacksjs/stacks#1910) is fully wired in our vendored framework, migrate the read endpoints toModel.paginate()so they return the canonical{ data, current_page, per_page, total, last_page, prev_page_url, next_page_url, ... }shape with the auto-generatedLinkheader. - Until then: hand-roll a minimal
paginate()shim on bench-review's side (sibling task) and migrate progressively. - Frontend:
<Pagination>component from@stacksjs/componentsonce upstream releases it, or a local equivalent. /my-reviewsalready filters client-side from a single fetch — once it grows past ~50 rows per user, this needs paginating too.
Acceptance
/api/reviews?page=2&per_page=20returns canonical paginator shape.- Same for
/api/judges/{id}/reviews,/api/court-houses/{id}/reviews,/api/admin/reviews,/api/admin/users,/api/me/reviews. - UI shows page controls + page count, query params survive across nav.
Related
- Tracks upstream pagination umbrella
stacksjs/stacks#1910(closed, but our vendored framework needs a resync).