Repository navigation
feat(games): fill out the game page below the hero - #60
Merged
Merged
Conversation
Export CrewLines, FactsPanel, textFact and MoreLikeThisFrame so the game page can reuse them, and let SectionErrorLine name IGDB as its source (spec 0031, AC-5, AC-8, AC-9). TMDB callers are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
getGame asks for storyline, artworks, screenshots, videos, similar games, involved companies, modes, perspectives, franchises, collections, engines and release dates, still in one cached call. Each nested entry is checked on its own, IGDB_DATE_FORMAT pins the date precision ids, and formatGameReleaseDate shows a date at the precision IGDB states (spec 0031, AC-2, AC-4, AC-10, AC-14). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The hero gets an art backdrop and the Trailer button. Under it come Overview, a Screenshots row with its dialog, More like this through the G8 cards in its own boundary, and Facts with per platform release dates. Each section is left out when IGDB has nothing for it (spec 0031). 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>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…mats 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>
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
The game page (
/games/{id}) now has the same sections a movie page has. The hero gets an art backdrop and a Trailer button. Under it come Overview, Screenshots (with a dialog to see them larger), More like this, and Facts. A section is left out when IGDB has nothing for it.Why
This builds scope feature G9 and follows spec 0031. Until now a game page showed only the hero. This change also adds the art backdrop that spec 0025 put off, so that item comes off the deferred list in
docs/scope/games.md.Changes
IGDB data (one call per game, as before)
IGDB_GAME_FIELDSasks for 21 more fields: storyline, artworks, screenshots, videos, similar games, companies, modes, perspectives, franchises, collections, engines and release dates.getGameis still the only IGDB request. Nothing is written to Postgres.normalize.tschecks each nested entry on its own, so one odd entry gets dropped andgetGamekeeps working. NewGamefields:artUrl,screenshotUrls(deduplicated, sorted byimage_id, capped at 12),trailer,similarGameIds,developers,publishers,storyline,gameModes,playerPerspectives,franchises,series,gameEngines,platformReleases.IGDB_DATE_FORMATpins IGDB'sdate_formatids. A release date with a missing or unknown format is skipped, never read as a full day.formatGameReleaseDateinlib/format.tsshows a date at the precision IGDB gives: day, month, quarter, year or TBA.GameVideo,PlatformRelease,GameReleaseDate.Page and components
GameHerogets a backdrop fromartUrland puts the existingTrailerButton(theyoutube-nocookiedialog) in itsactionsslot.GameOverview: the summary, then an optionalStory, thenDeveloped byandPublished by, using the movie page'sCrewLines.ScreenshotGallery: a row of thumbnails that opens a controlled dialog with{n} of {total}, Previous and Next (no wraparound), arrow keys, and Escape. When the dialog closes, focus goes back to the thumbnail of the image that was showing.GameMoreLikeThisSection: one cachedgetGamesByIdsbatch inside its own Suspense boundary. It keeps IGDB's order, drops hidden and missing games before the cap of 12, and renders G8 cards throughCatalogListCards. AnIgdbErrorshows a "Couldn't load similar games from IGDB." line with Retry. Any other error is thrown again.GameFactsuses the sharedFactsPanel. A label becomes plural (Franchises,Game engines) only when there is more than one value. Release dates are listed one per platform, earliest first, with TBA last.GameDetailSkeletonnow shows the backdrop hero and an overview skeleton.Shared catalog pieces (TMDB callers are unchanged)
CrewLines,FactsPanel,Fact,textFact(title-details.tsx) andMoreLikeThisFrame(title-extras.tsx).SectionErrorLinegets an optionalsourceprop that defaults to"TMDB".Docs and showcase
/showcasegets a "Game page sections" block.docs/scope/games.md.rationale.mdandverify.md.How to test / verify
pnpm typecheck,pnpm lint:ci,pnpm test: green on this branch (215 files, 3765 tests). Each commit typechecks on its own.pnpm build:/games/[id]still shows as◐(partially prerendered), and the build makes no IGDB call.pnpm igdb:live: checks the new fields, thedate_formatsids, and that a quarter date really falls in its quarter./games/1942(The Witcher 3). You should see the hero with a backdrop, then Overview, Screenshots, More like this, and Facts, in that order. Press Trailer: the dialog opens on5nLipy-Z4yo, and no iframe exists before you press it.3 of 12. ArrowRight takes you to4 of 12. Escape closes it and focus lands onOpen screenshot 4 of 12./games/94975(Wubble Bubbles). You should see only the hero: no backdrop, no Trailer button, and noh2.Risk & rollout
Low to medium risk. No migrations, no new environment variables, no new image hosts. Images still go through
lib/images/loader.ts, never/_next/image. Game pages staynoindexuntil G10, and the GAMES tab is still behindNEXT_PUBLIC_GAMES_LIBRARY.Tradeoffs the spec accepts:
getGameresponse is several times bigger now. Thehourscache softens this.getGamefails, every section fails with it. Only More like this can fail on its own.Notes for reviewers
verify.mdwere not done by hand and are covered only by unit tests: the More like this error line (game-more-like-this.test.tsx), the backdrop source order (normalize.test.ts), similar ids leaving out the game's own id and hidden games, and the plural labels (game-facts.test.tsx).screenshot-gallery.tsxdeserves a close look. It uses one controlled dialog for up to 12 thumbnails, withfinalFocuspointing at the ref of whichever thumbnail is current.lib/igdb/__fixtures__/game-1942.jsonis a fresh full capture, so most of its 371 added lines are IGDB data.🤖 Generated with Claude Code