[#207] Add pagination to home page story grid#216
Conversation
- PAGE_SIZE = 24, uses supabase .range() for offset pagination - Prev/Next buttons with page number, preserves tab + writer params - Works with all sort options and writer filter - Trending/rising use PAGE_SIZE instead of hardcoded 20 Fixes #207 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: REQUEST CHANGES
Summary
The pagination wiring works for the direct Supabase queries, but it is incomplete for the trending and rising sorts. Those paths still ignore the requested page offset, so navigating to later pages repeats the first-page results instead of advancing the grid.
Findings
- [high]
trendingandrisingpagination repeat page 1 because the page offset is never applied.- File:
src/app/page.tsx:171 - Suggestion: Thread the page offset through the ranking helpers or slice the ranked results after fetching enough items, so
?tab=trending&page=2and?tab=rising&page=2do not return the same first 24 stories as page 1.
- File:
Decision
Requesting changes because pagination must work consistently across all sort modes, and the current implementation only paginates new and completed.
Add offset param to getTrendingStorylines and getRisingStorylines. Page 2+ now correctly advances results for all sort options. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Summary
The follow-up commit fixes the pagination bug I flagged by threading an explicit offset through getTrendingStorylines and getRisingStorylines, and the home page now passes the correct offset based on the requested page. That makes page 2+ advance correctly across all sort modes instead of repeating page 1 for ranked tabs.
Findings
- [info] Previous blocking finding resolved.
- File:
src/app/page.tsx:171 - Suggestion: None.
- File:
Decision
Approving because pagination now behaves consistently for new, completed, trending, and rising, GitHub lint-and-typecheck is passing, and local typecheck is clean.
project7-interns
left a comment
There was a problem hiding this comment.
T2b APPROVE
Well-implemented pagination:
- Server-side — Supabase
.range(from, to)for new/completed tabs,offsetparam added to ranking helpers for trending/rising. All 4 tabs paginate correctly. - Client-side — Prev/Next links preserve tab + writer params via
buildPageHref. Page number parsed withMath.max(1, ...)guard. "Next" only shows when results === PAGE_SIZE. - PAGE_SIZE = 24 — Good for 3-col grid (divisible by 3).
No issues.
Fixes #207 — Prev/Next pagination, 24 per page, preserves filters.