Repository navigation
feat(scout-for-lol): add the public matchup page - #5428
Conversation
|
This change is part of the following stack: Change managed by git-spice. |
|
Automatic reviews are disabled for this repository. Configure in Code Review Settings. |
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
…/<role>/vs/<opponent>/ Why The redesign's public site had champion pages but no page for one matchup, so the matchup rows on a champion page went nowhere and the snapshot v2 matchup files had no reader. What - Static page per matchup the snapshot lists, on the friendly design system: duel hero (two splashes, verdict, game count, patch/queue/bracket/window line), two plain "I'm playing X" links (no JavaScript), an "In lane" panel with its own game count (left out when the matchup has no lane figures), a spell-pair comparison only when the two pairs' intervals separate, and five other matchups of the same champion and role. - The snapshot loader reads one matchup file and validates it against the champion that lists it; the champion page's matchup rows link to the page for every opponent that has one. - ChampionCard gets a `note` for "Wins lane, loses the game". - The fixture snapshot gets matchup spell pairs; /champions/ahri/middle/vs/syndra/ is a new golden design-audit route (16 baselines, counts and docs updated). - Tips are not in the snapshot yet, so the tips block and the reverse-direction <details> are not rendered; MatchupPage marks where they mount. Verification - bunx turbo run build typecheck test lint over design-system, frontend, design-audit and their dependents; bun run jscpd; check-directory-file-counts. - Built the site from the fixture snapshot, fetched every internal link on the champion and matchup pages (167 links, all 200 except /app/login and /docs/, which other surfaces serve). - Design audit: public/matchup passes in 16 Chromium theme/viewport cases (axe, same-origin errors, baselines written). - Not run: extended tier (no affected extended steps), live deployment. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011u9pQk6p4o3DxofkiZXg8y
5d7a63c to
e1df34d
Compare
|
@codex review Automated re-review request for |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e1df34dd9d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…n file Why: a matchup that meets the sample floor can belong to an opponent whose own champion slice does not, so the index lists no file for it. The matchup page loaded that file unconditionally and aborted the whole static build. What: the page loads the opponent's champion file only when the index lists it, and the model treats a missing file as having no other-side page. Verification: model.test.ts covers a null opponent champion; frontend typecheck and lint pass. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011u9pQk6p4o3DxofkiZXg8y
…out the dev toolbar Why The matchup baselines committed with #5428 include Astro's dev toolbar (a floating bar over the "In lane" panel), so they were wrong baselines; CI runs the audit with the toolbar off. What Regenerated all 16 matchup Chromium baselines (four themes by four viewports) in the pinned ci-playwright image (linux/amd64) with CI=true from a clone of the branch, built site, fixture snapshot. This corrects #5428's baselines. The champion baselines regenerated byte-identical to the ones in the previous commit. Verification Design audit for public/champion and public/matchup in that image. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011u9pQk6p4o3DxofkiZXg8y
…nt changes and tooltips (#5548) * feat(scout-for-lol): fill the public champion and matchup pages' recent changes and tooltips Why The public champion page and matchup page shipped with two empty slots: the champion page's "Recent changes" block (the patch-change reader and the RecentChanges component are on main) and the rich tooltips (the layered RichTooltip and the per-entity game-fact files are on main). Nothing on those pages opened a tooltip, and a nerfed core item was invisible. What - The champion page mounts RecentChanges, fed by getRecentChampionChanges over the newest 8 patches with the item ids of the slice's builds (every build path, what follows the core, the boots), so an item nerf shows beside the champion's own lines. Ages are measured from the snapshot's last day so a rebuild writes the same page. No win-rate line (no pipeline yet) and no "See all changes" link (no page lists them). The matchup page has no such block in the mockups and none is added. - One delegated tooltips island (client:idle) on both pages. Elements carry data-game-fact="<kind>/<key>" plus a name (gameFactAttributes in the data package); DelegatedGameFactTooltips listens on the document for the pointer or focus reaching one and mounts a RichTooltip on it. RichTooltip gains a triggerElement for an element the page rendered itself; the trigger rules are shared with the rendered-trigger path. Facts load from the static /assets/scout/game/<patch>/facts files through loadGameFact. No Scout block, since public pages have no viewer. - Marked: champion cards and matchup rows (champions), setup rows (runes, spells, items, skill-order abilities), later-game items and boots, the spell pair on the matchup page, and the item and ability names in Recent changes. Verification - bunx turbo run build typecheck test lint over design-system, data and every dependent (65 tasks); new unit tests for the trigger helpers, the recent changes model (every row in the committed notes names an existing fact file) and the markup; Playwright e2e for the delegated story (hover, hand-over, keyboard focus). - Built the site from the fixture snapshot and fetched all 161 distinct fact files the 175 champion and matchup pages name: all 200. - Not run: live deployment. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011u9pQk6p4o3DxofkiZXg8y * fix(scout-for-lol): leave a link trigger without dialog ARIA Why: the design audit clicks every aria-haspopup=dialog trigger and expects a dialog; a champion card is a link, so the click followed it. A link does not open a dialog, so it should not say it does. What: a page-rendered trigger that is an anchor gets only data-open; other triggers keep aria-haspopup, aria-expanded and aria-controls. The Delegated story and its e2e cover a link. Verification: rich-tooltip e2e (8 passed), design-system build, lint, typecheck. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011u9pQk6p4o3DxofkiZXg8y * fix(scout-for-lol): give page-rendered tooltip triggers only data-open Why: the delegated tooltip moves between elements, so aria-haspopup came and went on whichever element held it, and the design audit's dialog-trigger sweep (which counts them once and then revisits them by index) lost its place. The elements are also links, list items and icons, which do not take those states. What: a triggerElement gets data-open while its layer is open and no popup ARIA; rendered triggers are unchanged. The Delegated e2e asserts it. Verification: rich-tooltip e2e (8 passed), design-system build, lint, typecheck. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011u9pQk6p4o3DxofkiZXg8y * fix(scout-for-lol): dismiss a delegated tooltip as soon as focus leaves its element Why: a tooltip opened by keyboard focus stayed for the 150 ms pointer grace period after Tab moved on, so a page-wide focus sweep (the design audit's keyboard check) left the last tooltip open, and its own ability buttons joined the audit's dialog-trigger sweep. What: focus leaving the active element unmounts its tooltip unless focus moves into the layer or the pointer is still on the element. New e2e: tabbing hands the tooltip over at once. Verification: rich-tooltip e2e (9 passed), design-system build, lint, typecheck. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011u9pQk6p4o3DxofkiZXg8y * fix(scout-for-lol): keep the colon after the second spell inside its element Why: moving the matchup page's spell icons into a component left the colon after the second spell as its own text node, which the flex element spaced away ("Teleport :") and which wrapped the sentence, changing the page's height. What: MatchupSpells takes a suffix that goes into the last spell's own text. The built matchup HTML is otherwise identical to main apart from the data-game-fact attributes and the island. Verification: compared the normalised HTML of every matchup page between main and this branch (after removing the attributes and the island): identical for the pages checked; frontend typecheck and lint. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011u9pQk6p4o3DxofkiZXg8y * test(scout-for-lol): refresh the champion page design-audit goldens for Recent changes Why: the champion page gained its Recent changes block, so the 16 champion goldens no longer match. What: regenerated the champion route's 16 Chromium baselines (four themes by four viewports) in the pinned ci-playwright image (linux/amd64) from a clone of the branch head, with the fixture snapshot. The matchup and champions-index goldens are untouched: the built matchup HTML of all 124 pages is identical to main apart from the data-game-fact attributes and the island, and the index only gains inert attributes. Verification: design audit for public/champions, public/champion and public/matchup in that image: 54 passed (axe, same-origin errors, keyboard focus, dialog triggers, baselines). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011u9pQk6p4o3DxofkiZXg8y * fix(scout-for-lol): keep popup ARIA on page-rendered tooltip triggers and make the audit follow the tooltip Why Dropping aria-haspopup to satisfy the design audit was backwards. The audit's dialog-trigger sweep counted triggers once and revisited them by index, which cannot hold for one tooltip that moves between elements. Auditing the tooltip properly also showed that the first tap on a phone opened nothing, because the click lands before the tooltip has mounted. What - Page-rendered triggers carry aria-haspopup, aria-expanded and aria-controls again (a link too, as a rendered trigger does). - The audit's index sweep skips data-game-fact elements. A new check (tooltip-triggers.ts) takes one trigger per kind, finds each again by its own data-game-fact value, reaches it by hover on desktop or tap on a phone, and expects a dialog with its name, aria-haspopup, and Escape to close it. - The island holds back a click that arrives before its tooltip is listening, mounts the tooltip, and replays the click, so the first tap opens it (a link follows on the second tap). Verification - rich-tooltip e2e (10 passed, including the first-tap case); design-system and design-audit build, lint, typecheck and unit tests. - The audit's public champion and matchup routes pass locally on Chromium desktop and mobile. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011u9pQk6p4o3DxofkiZXg8y * fix(scout-for-lol): mark champion cards as tooltip triggers only where the island mounts Why ChampionCard marked every card with data-game-fact, including on the champions index, which mounts no tooltip island. The audit's new tooltip check (rightly) found cards there that open nothing. What ChampionCard takes `tooltip`, off by default; the champion page's "More champions" and the matchup page's "against someone else" cards set it. Verification design-system, frontend and app build, typecheck, test and lint; the ChampionCard test covers both states. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011u9pQk6p4o3DxofkiZXg8y * test(scout-for-lol): regenerate the matchup design-audit goldens without the dev toolbar Why The matchup baselines committed with #5428 include Astro's dev toolbar (a floating bar over the "In lane" panel), so they were wrong baselines; CI runs the audit with the toolbar off. What Regenerated all 16 matchup Chromium baselines (four themes by four viewports) in the pinned ci-playwright image (linux/amd64) with CI=true from a clone of the branch, built site, fixture snapshot. This corrects #5428's baselines. The champion baselines regenerated byte-identical to the ones in the previous commit. Verification Design audit for public/champion and public/matchup in that image. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011u9pQk6p4o3DxofkiZXg8y --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Stacked on #5421.
Why
The public site had champion pages but no page for a single matchup. The matchup rows on a champion page went nowhere, and the snapshot v2 per-matchup files had no reader.
What
/champions/<slug>/<role>/vs/<opponent>/, generated for exactly the opponents a champion file lists (each has one matchup file). Built on the friendly design system:DuelHerowith both splashes, an "In lane" panel, a spell-pair comparison, and five other matchups for the same champion and role.pageOpponentshelper that generates the static paths.OpenSnapshot.matchup(slug, role, opponent)loads one matchup file and validates it against the champion that lists it.ChampionCardgets anote("Wins lane, loses the game"), with story and test.write-champion-meta-fixture.ts)./champions/ahri/middle/vs/syndra/is a new golden design-audit route (16 baselines; matrix counts and docs updated to 702 cases, 19 golden routes).Left out because the snapshot does not hold them (no snapshot or backend changes):
<details>("Playing Syndra into Ahri"). Tips are not in the snapshot yet;MatchupPage.astromarks where they mount, andTipListwithreverseis the component to use.Demo
Built from the fixture snapshot (
astro build, served statically),/champions/ahri/middle/vs/syndra/.Approved mockup (D11-Matchup), for comparison: the tips and "What the numbers say" win-when-ahead line are absent here by design (see What).
Verification
bunx turbo run build typecheck test lint --filter='...@scout-for-lol/design-system' --filter='...@scout-for-lol/frontend' --filter=@scout-for-lol/design-audit: 61 tasks passed.bun run jscpd(ratchet passed),bun run check-directory-file-counts(no new warnings),bunx lefthook run pre-commit: passed.CHAMPION_META_SNAPSHOT_FILE=<fixture> bun run build): 183 pages. Fetched every internal link on the 176 built champion and matchup pages: 167 links, all HTTP 200 except/app/loginand/docs/, which the other surfaces serve and which are not part of this static build (they come from the shared navbar).public/matchup, chromium desktop/laptop/tablet/mobile x 4 themes: 16 passed (axe, same-origin errors, screenshots) against a stubbed signed-out/trpc/auth.sessionState. Baselines were written on macOS; the audit is not a PR gate.champion/championstablet and mobile baselines from feat(scout-for-lol): rebuild the public champions index and champion page on the friendly design system #5421 do not reproduce on macOS even for the untouched index page (height differs by 1 to 50 px), so they were not regenerated here.design-systemonly in the graph; nothing they read changed.🤖 Generated with Claude Code
https://claude.ai/code/session_011u9pQk6p4o3DxofkiZXg8y