Skip to content

feat(auctions)!: consume cursor-paginated list endpoints (BV-029) - #6

Merged
subhanlone merged 1 commit into
masterfrom
fix/bv-029-pagination
Aug 31, 2026
Merged

feat(auctions)!: consume cursor-paginated list endpoints (BV-029)#6
subhanlone merged 1 commit into
masterfrom
fix/bv-029-pagination

Conversation

@subhanlone

Copy link
Copy Markdown
Owner

Summary

  • Adapts every frontend consumer of the six backend endpoints that BV-029 (bidvault-backend#7) converted to cursor pagination — GET /auctions, /watchlist, /auctions/mine/bids, /auctions/{id}/bids, /listings/mine, /listings/pending — to the new {items, nextCursor} response shape.
  • Browse Auctions gets genuine lazy loading: useInfiniteQuery + an IntersectionObserver sentinel (useInfiniteScrollTrigger), with category/search moved server-side into the query key so pagination never silently hides a match on an unloaded page.
  • Every other paginated screen (My Bids, Watchlist, My Listings, the admin Listing Review queue, dashboard/sidebar stat badges) shows an exact count or aggregate, so those drain every page up front — a new useDrainedPages hook for the TanStack Query consumers, an inline cursor walk for the three plain-useState ones (usePendingListings, SellerMyListings, SellerProfile/SellerDashboard) — rather than exposing pagination UI where correctness of a total depends on having loaded everything.
  • Regenerated src/types/openapi.d.ts from the backend's BV-029 contract (api:contract && api:types).

Test plan

  • npm run build — clean
  • npm run lint — 0 errors
  • Backend tests/pagination.test.ts (7 tests) + full suite verify the underlying cursor contract this PR consumes
  • Verified via curl against a local dev backend that /auctions?status=ACTIVE&limit=24 returns exactly 24 items + a nextCursor when more exist, and nextCursor is null once exhausted
  • Manual browser check of the infinite-scroll UX on Browse Auctions — not done this session, the Claude-in-Chrome extension was disconnected; please click through before merging (scroll to the bottom of Browse Auctions with 25+ active auctions seeded and confirm the next page loads)

Merge order

Depends on bidvault-backend PR #7 (fix/bv-029-pagination) being on master first — this branch's openapi.d.ts was generated from that PR's contract.

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01WBf5EWVmeLL4uXWVTFmgwG

Adapts every consumer of the six now-paginated backend endpoints
(GET /auctions, /watchlist, /auctions/mine/bids, /auctions/{id}/bids,
/listings/mine, /listings/pending) to the new {items, nextCursor}
response shape.

Browse Auctions is genuinely lazy — useInfiniteQuery plus an
IntersectionObserver sentinel, with category/search moved server-side
into the query key so a match on an unloaded page is never missed.
Every other screen (My Bids, Watchlist, My Listings, the admin review
queue, dashboard/sidebar stats) shows an exact count or aggregate, so
those drain every page up front via a new useDrainedPages hook or an
inline cursor walk instead of exposing pagination UI.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WBf5EWVmeLL4uXWVTFmgwG
@vercel

vercel Bot commented Aug 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
bidvault Ready Ready Preview Aug 31, 2026 7:36am

@subhanlone
subhanlone merged commit 33ede93 into master Aug 31, 2026
3 of 4 checks passed
@subhanlone
subhanlone deleted the fix/bv-029-pagination branch September 5, 2026 05:35
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.

1 participant