Skip to content

feat(scout-for-lol): add the public matchup page - #5428

Merged
shepherdjerred merged 2 commits into
mainfrom
feat/scout-public-matchup-page
Dec 3, 2026
Merged

shepherdjerred merged 2 commits into
mainfrom
feat/scout-public-matchup-page

Conversation

@shepherdjerred

@shepherdjerred shepherdjerred commented Nov 28, 2026 •

Copy link
Copy Markdown
Owner

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

  • New static page /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: DuelHero with both splashes, an "In lane" panel, a spell-pair comparison, and five other matchups for the same champion and role.
  • Every figure carries its game count. The context line states the matchup's own games, patch, queue, rank bracket and play window, plus the lane window when the matchup has lane figures.
  • "I'm playing X" are two plain links, one per champion's perspective. They render only when the other side has a page. No JavaScript.
  • A matchup without lane figures omits the lane block (and the lane window in the context line).
  • The edge is named only when the matchup's win-rate interval is wholly on one side of 50%, otherwise "Neither side has the edge." The same rule drives the lane lead. The spell comparison appears only when the two most played pairs' intervals do not overlap.
  • Champion page: matchup rows now link to the matchup page, using the same pageOpponents helper that generates the static paths.
  • OpenSnapshot.matchup(slug, role, opponent) loads one matchup file and validates it against the champion that lists it.
  • ChampionCard gets a note ("Wins lane, loses the game"), with story and test.
  • Fixture snapshot: matchup spell pairs added to the generator (all 129 matchup files rewritten with 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):

  • Scout's tips and the reverse-direction <details> ("Playing Syndra into Ahri"). Tips are not in the snapshot yet; MatchupPage.astro marks where they mount, and TipList with reverse is the component to use.
  • "When Ahri is ahead at 15 she wins 71%, behind 30%": the lane figure holds only games ahead and the rate, not the win rate in each state.
  • Mockup copy changes: "against her" becomes "against Syndra" (no pronoun data); "See all matchups" becomes "See Ahri in Mid" because the champion page lists six, not all.
  • The mockup names a side on a point estimate (47.8% of 1,050 "Syndra has the edge"); this page requires the interval to exclude 50%, so the fixture's Ahri vs Syndra reads "Neither side has the edge."

Demo

Built from the fixture snapshot (astro build, served statically), /champions/ahri/middle/vs/syndra/.

1440 dark 1440 light
matchup-1440-dark.png matchup-1440-light.png
390 dark 390 light
matchup-390-dark.png matchup-390-light.png

Approved mockup (D11-Matchup), for comparison: the tips and "What the numbers say" win-when-ahead line are absent here by design (see What).

1440 dark 1440 light 390 dark
mockup-1440-dark.png mockup-1440-light.png mockup-390-dark.png

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.
  • Fixture build (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/login and /docs/, which the other surfaces serve and which are not part of this static build (they come from the shared navbar).
  • Design audit 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.
  • Note: the existing champion/champions tablet 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.
  • Extended tier: not run. The workspaces with extended steps (backend, temporal) are downstream of design-system only in the graph; nothing they read changed.
  • Not run: live deployment and any real-snapshot render (the committed snapshot is empty until the first refresh).

🤖 Generated with Claude Code

https://claude.ai/code/session_011u9pQk6p4o3DxofkiZXg8y

@shepherdjerred

Copy link
Copy Markdown
Owner Author

@greptile-apps

greptile-apps Bot commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Automatic reviews are disabled for this repository. Configure in Code Review Settings.

@coderabbitai

coderabbitai Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Base automatically changed from feat/scout-public-champion-pages to main December 3, 2026 04:22
…/<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
@shepherdjerred
shepherdjerred force-pushed the feat/scout-public-matchup-page branch from 5d7a63c to e1df34d Compare December 3, 2026 04:26
@shepherdjerred
shepherdjerred marked this pull request as ready for review December 3, 2026 04:26
@shepherdjerred

Copy link
Copy Markdown
Owner Author

@codex review

Automated re-review request for e1df34d from the CI review gate.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-03T04:29:40.082312Z e1df34d Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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
@shepherdjerred
shepherdjerred merged commit c0b0b5d into main Dec 3, 2026
7 checks passed
@shepherdjerred
shepherdjerred deleted the feat/scout-public-matchup-page branch December 3, 2026 05:21
shepherdjerred added a commit that referenced this pull request Dec 3, 2026
…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
shepherdjerred added a commit that referenced this pull request Dec 3, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant