Repository navigation
feat(web): show each game's cover on the Games page - #193
Merged
Merged
Conversation
The games service has sent each game's IGDB cover since #186 (decision 306). The Games page now shows it in a column between the day and the title, as the background of a framed blank, so a game without a cover, a cover still loading and one that fails to load all leave the same blank, and screen readers skip it (decision 308).
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.
Brief
Goal: the Games page shows each game's cover from IGDB, which the games service has sent since #186 (decision 306). The last of
games-exophase's eleven steps (decision 308).Scope
Gamegainscover, the address of the game's cover on IGDB, left out when it has none, as the service sends it.--ruleborder and fills its box, cropped rather than letterboxed. It's the background of a blank, which screen readers skip, since the title beside it names the game.--fillin the same border.demo.ts, which is at Biome's 200 lines, toe2e/games.ts, with made-up covers (SVG shapes, since no game's real art can be in the repo) that the tests answer at IGDB's address. A new spec checks the covers' size and place on both screens, the blank, and that the covers load under the gateway's Content Security Policy.Out of scope
srcset), and lazy loading.games-exophasedone: that waits for homelab#44 and feat(gateway): forward /api/games to the games service #188.Acceptance criteria
--fillin a--ruleborder, so the titles stay in line.mise run checkpasses.What changed
src/games/games.ts:Game.cover, andcoverImage(), which turns the address into a CSSurl("…"), with its quotes and backslashes escaped.src/games/GamesPage.svelte: each row gets a.coverblank with the cover as its background. A scoped grid gives the cover its column on a desktop and the start of the second line on a phone.e2e/games.tsholds the demo games, moved fromdemo.ts, which was at 199 of its 200 lines, now with made-up SVG covers, andanswerGamesandanswerCovers.games-covers.spec.tschecks that the covers load, the frame, the blank, and the size and place on both screens.ink.tsgainscolour(page, token), whichinkMutednow calls.QA
fixtures.tsfails a test on any console error or CSP violation. AC 6:games.spec.ts's 320 px test, plus a probe with a cover beside a long title. AC 7: below.<img alt="">whose load fails shows a broken-image icon, in Chromium and in WebKit alike. The engineer made the cover the blank's background, and a failed load now leaves the plain blank in both. The lead updated the scope and ACs 1 and 4.contain, no phone layout, the cover before the day,coverImagewithout escaping, a row without itsgameclass.mise run checkis green: Go lint 0 issues; govulncheck clean; Go coverage 96.7%; Vitest 1274 passed, web coverage 99.79% of statements; e2e 416 passed, 8 skipped; Biome, svelte-check, tsc and knip clean.Review
Blocking: none. Non-blocking:
colour()sits inink.tsbesideinkMuted, which calls it, so the specs that useinkMuteddon't change.Screenshots
The demo games, as a made-up user in Tokyo, with made-up covers; Sky Rally has none.
A cover that fails to load leaves the blank: