Repository navigation
feat(games): add the games tab to the library pages - #56
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ead failure 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>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d game grids Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s and the games tabs 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>
…opy by LibraryList Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… spec 0027 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
Adds a GAMES tab to
/watchlist,/upcomingand/watched. With?type=game, those pages list your Want to play, Playing and Finished games. Each card has a cover, a rating badge, a date line, and a remove button with Undo. The tab sits behind a newNEXT_PUBLIC_GAMES_LIBRARYflag, which is off in production.Why
Implements spec 0027 (scope feature G5). A game's status is stored, not worked out, so each tab is one plain Postgres page (24 rows, exact count) plus one IGDB read for those games. Until G6 or G7 gives people a way to find games, nothing in production leads to one. The flag keeps production from showing half a feature.
Changes
Flag and types
getGamesLibrary()andgamesLibraryEnabled()inlib/env.ts. The first one throws on an invalid value and onlyLibrarySectioncalls it. The second treats an invalid value as off, so the navbar never breaks.LibraryType = MediaType | "game",LibraryPath,parseLibraryTypeParam,libraryTypeForLocationandgameHrefinlib/catalog/media-type.ts.MediaTypestaystv | movie. NewtypedHrefoverloads maketypedHref("/search", "game")a compile error, and a@ts-expect-errortest proves it..env.exampleanddocs/deploy.mddescribe the flag: unset in Production,onin Preview.Navbar
WithLibraryTypedPageandPageMediaType.libraryType. The fallback shown before?typeloads draws all three tabs with none lit.type=game. The navbar search is hidden (no game search until G7), and the logo never remembersgame.Reading the games
lib/tracking/game-library.ts:getGameLibraryPagemakes one counted query onuser_game_state, filtered on the sessionuser_idas well as RLS. Each tab has its own order (added_at,started_at,finished_at, thengame_id). A page past the end redirects, andPGRST103is handled.getLibraryGamesmakes onegetGamesByIdscall per page. Only anIgdbErrorcounts asfailed.LibrarySectionsendsgameto the newgameLibraryTab. With the flag off,?type=gameshows the existing "That page doesn't exist" panel.Cards and grid
GameLibraryCard: Want to play shows the IGDB community rating, plus a release pill (date or Date TBA) before release. Playing and Finished show your score if there is one, otherwise the community rating, with aStartedorFinished {Mon YYYY}line in UTC (newformatMonthYear). A hidden game keeps its card but has no link. A missing id shows "No longer on IGDB".GameLibraryGrid: a removal hides the card at once throughuseOptimisticand offers Undo. Focus moves the way it does on the movie grid. The Undo toast is now a plainshowGameUndofunction, taken out ofuseGameUndoso one grid can show a toast per card. It keeps the toast idgame-undo-{id}.States
CatalogFailed({ source })replaces the body ofTmdbFailedand adds a "Couldn't reach IGDB" panel with Retry.LibraryErrorBoundary(catchError) wraps each page's streamed section, so an invalid flag or an unexpected error shows a panel under the heading.LIBRARY_COPY: text only empty states (no browse page until G6) and grid labels./showcasegains a Game library card section covering every card state.Docs
docs/deploy.md, and/syncupdates toAGENTS.mdandcomponents/AGENTS.md. G5 isdonein the games scope; specs 0023 to 0027 move toAccepted.How to test / verify
NEXT_PUBLIC_GAMES_LIBRARY=on pnpm dev:dockerand sign in asuser-a@example.test./watchlist?type=game,/upcoming?type=gameand/watched?type=game. GAMES should be lit, the search gone, and each game listed once in its tab's order with the right badge and date line.maybe). GAMES should vanish everywhere.?type=gameshould show "That page doesn't exist" (withmaybe, the library error panel instead).docs/specs/0027-games-library-pages/verify.md.pnpm typecheckandpnpm lint:ci, andpnpm testpasses at the tip (197 files, 3384 tests).Risk & rollout
No migration and no
database.types.tschange, so there's nosupabase db push. The feature is off in production becauseNEXT_PUBLIC_GAMES_LIBRARYis unset there. It needs to beonin Vercel Preview. Because the flag is inlined at build time, changing it takes a redeploy. Rolling back means unsetting the flag, or reverting.Residual risks accepted in review (
docs/reviews/2026-10-25-feat-games-library-pages.md):IgdbErrorgoes to the generic boundary without alogTrackingEventline.?typeloads.Notes for reviewers
MediaType/LibraryTypesplit.gamemust never reach/search,/shows,/movies, the proxy orCATALOG_PATHS. The compiler enforces this through thetypedHrefoverloads.GameLibraryGridcopies the movie grid'suseOptimisticand settle order on purpose and shares only its helpers. A future fix to one may need making in both.🤖 Generated with Claude Code