Repository navigation
feat(catalog): page every title grid 24 at a time so rows stay full - #47
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e edge Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…the window's two pages Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…trust its capped count Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ast the end Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…8 and 0009 verify steps Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch was successfully deployed
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.
What
Every paged title grid now shows 24 titles a page instead of 20, and the
cataloggrid steps 2, 3, 4 and 6 columns (the 5 column step is gone). A full page now fills every row at every width.Why
With 20 titles a page and a 6 column grid, a page at 1280px and wider ended 4 cards short, and pages at 3 and 5 columns had ragged last rows too. 24 divides evenly by 2, 3, 4 and 6. This amends spec 0022 (AC-1, AC-2, AC-4, AC-6, plus new AC-21 and AC-22), decided in the 2026-10-13 grilling session. The plan is in
prompts/full-grid-rows.md, and the reasoning is indocs/specs/0022-card-size-title-pages/rationale.md.Changes
lib/catalog/grid-page.ts, pure, noserver-only). Page p shows TMDB results(p - 1) × 24 + 1top × 24. These always sit on two TMDB pages, which are read in parallel through the existing cached reads, so neighbouring pages share cache entries. A TMDB page past 500 is never requested. The last page isceil(min(total_results, min(total_pages, 500) × 20) / 24), so a 10,000 result list ends at page 417 with 16 titles. If either read fails, the whole page fails and shows the usual error panel with Retry.readCatalogGridPageandreadTaggedCatalogGridPage(lib/catalog-list-read.ts).generateMetadatauses the same read, so canonicals andnoindexfollow the new page count at no extra TMDB cost. The home rows still read TMDB page 1 throughreadCatalogList, unchanged./searchbrowse, search and discover modes read throughreadGridPage. Filtered search (a query plus genre or rating) is unchanged and stays cursor based, with its 20 match scan target.LIBRARY_PAGE_SIZE = GRID_PAGE_SIZE.catalogcolumns becomegrid-cols-2 sm:grid-cols-3 md:grid-cols-4 xl:grid-cols-6, with newsizesworked out by the AC-4 rule. Both page skeletons showGRID_PAGE_SIZEcards, and theLibrarySkeletonrow visibility follows the new steps. The season grid (wide) is unchanged.totalPages, which is already capped, solastReachablePageis no longer applied on top of it in the list page and search results.components/AGENTS.mddescribes the new column steps.How to test / verify
pnpm typecheck,pnpm lint,pnpm test,pnpm build. The newlib/catalog/grid-page.test.tscovers the window at several pages, dropping TMDB page 501, consecutive pages with no gap or repeat, the repeated title case, a short TMDB page, and the last page maths.poster-grid.test.tsxnow checks that 24 divides every column step.pnpm dev:dockerand open/movies/popularat 1440px: you should see 4 full rows of 6. At 1100px you should see 6 rows of 4, at 700px 8 rows of 3, and at 375px 12 rows of 2, with no gaps./movies/popular?page=417should show up to 16 cards, and?page=418should show "That page doesn't exist"./search?type=tvand/search?type=movie&q=starshould show 24 cards in full rows, and pages 2 and 3 should work./search?type=movie&q=star&rating=7should behave as before: a variable card count and the "More results" cursor./watchlist?type=movieshould show 24 cards on page 1 and the rest on page 2./showsand/movieslanding rows and a show's season grid should look unchanged.Risk & rollout
Low risk: no migrations, no flags, no schema or RLS change. Only public catalog data passes through the new window, and each TMDB read keeps its existing cache key. Two things change on purpose. A catalog or search page now costs two TMDB reads instead of one, and an old
?page=Nlink now points at different titles. Old links are not redirected; a link past the new last page shows the existing "That page doesn't exist" panel.Notes for reviewers
combineGridPageis where an off by one would hide, since a skipped or repeated title looks fine on screen. The tests check result positions rather than counts for that reason.TMDB_PAGE_SIZEmoved tolib/catalog/grid-page.ts.lib/search/constants.tsre-exports it, so the filtered search scan is untouched.🤖 Generated with Claude Code