Repository navigation
feat(scout-for-lol): redesign the in-app Champions index and Champion pages - #5381
shepherdjerred wants to merge 6 commits into
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
|
c6f2531 to
6ecffab
Compare
6ecffab to
fdcac12
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: fdcac125d4
ℹ️ 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".
| : `from ${viewer.games.toString()} games`; | ||
| return { | ||
| lead: `You have the ${rank} win rate${of} in your servers.`, | ||
| sub: `${percent(viewer.winRate)} against a group average of ${percent(pooledWinRate(input.qualified))}, ${games}.`, |
There was a problem hiding this comment.
Avoid group-wide statistics from a truncated leaderboard
When more than 25 registrations qualify and the viewer appears on the first page, these hero statistics describe only the highest-win-rate page as the whole group. consumerChampion.compare in consumer-champion.router.ts returns at most 25 rows sorted by win rate, so pooledWinRate(input.qualified) produces a biased group average, and the adjacent every check can incorrectly claim that the viewer has the most games when an omitted player has more. The truncated flag currently suppresses only the player count. Fetch complete-cohort aggregates, or suppress/explicitly scope these claims when the response is truncated.
Useful? React with 👍 / 👎.
68fa4f9 to
8bb1150
Compare
…stem Why The Match page was an admin-style review screen. The redesign (D11 Match) leads with the result, the lane at 15 minutes, how the game went and both teams, on the shared domain components. What - Replaces the consumer match route body with a page built from HeroPanel, GameSentenceRow, SetupRow, ChampionFace, WinRateBar, Fold, PageState and GoldLeadChart. The result header states the LP change only when a rank snapshot exists. The lane figure is read from `roleMatchups` from the viewer's side. The gold lead and moments come from `consumerMatch.story`. - `consumerMatch.detail` loads first and paints the page; `story` starts once detail resolves and fills "How it went", build order and skill order. A game with no timeline shows only what exists, with no chart or placeholder. - Adds `consumerMatchLoader` (preload-only) and shared protected query options. - Adds the match route to the design-audit matrix and seeds the story match (ranked win, two tracked friends, LP snapshot) with a pinned audit player id. Verification - app: typecheck, lint, test (723 passed); backend typecheck, lint, consumer router tests; design-audit test (656-case matrix). - Rendered at 1440 and 390, modern dark and light, against the design-audit seed; no-timeline and short games rendered too. - Not run: live beta behaviour, the Playwright design-audit browser run. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011u9pQk6p4o3DxofkiZXg8y
…in order
Why
The Match page could not tell whether the player it showed was the signed-in
viewer, so the hero named the player and the viewer's row had no chip. The
ordered build also wrapped its separators onto their own lines in the narrow
column.
What
- `consumerMatch.detail` marks each participant `isViewer`, resolved from the
players the signed-in Discord account is linked to in the scoped servers
(as `consumerPlayer.home` finds "your" profiles). Three backend tests cover
the viewer being the subject, someone else, and a teammate of the subject.
- The hero reads "You won as Ahri", the lane names "You", and the viewer's row
carries the "You" chip; a teammate viewer reads "with ... and you".
- The build is a vertical list ("Malignance first", "then ...") with no
separators to strand; runes and spells flow as rows.
Verification
- app tests (727) and backend consumer router tests (86) pass; detail
snapshots gain `isViewer`.
- Full-page captures now neutralise the sticky header and sidebar; a real
scrolled viewport shot confirms the chrome stays where it belongs.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011u9pQk6p4o3DxofkiZXg8y
Why: the lane_results change (#5305) added a required checkpoint to RoleMatchup, so the Match page fixture no longer typechecked against main. What: the fixture's role matchup is a complete checkpoint. Verification: app and design-audit typecheck, lint and test:ci pass; bun run jscpd passes. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011u9pQk6p4o3DxofkiZXg8y
…g on current main Why: after restacking onto main the isViewer tests seeded no linked account (the shared seed helper call dropped the Discord id), and the design-audit seed grew past the function and file line limits. What: trackedPlayer passes discordId to seedConsumerPlayer; the story rank, story game and timeline concatenation live in design-audit-story-fixture.ts, and the subscription and competition seed moves to design-audit-competition-fixture.ts. Verification: backend typecheck, lint and test:ci pass (one prune-players hook timeout under load, unrelated and not in this diff); bun run jscpd passes. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011u9pQk6p4o3DxofkiZXg8y
… pages
Why
The Champions index and Champion pages were admin-style tables (a comparison
leaderboard with KDA columns, and no index at all). The Warm Friends design
puts a friend group first: who plays what, who is best on it, and how you do
in lane.
What
- /champions: hero with the favourite champion, the viewer's champions, and
what friends play with the best friend on each; server chips and a champion
search are real controls.
- /champions/:championId: hero with splash art, a FriendRow ranking with games,
last-10 form and win rate bars, "Still warming up", most mastery, and the
viewer's matchups per lane. Ahead at 15 minutes is labelled with its own
lane-game count ("Ahead at 15 minutes in 5 of 6 lane games").
- Preload-only loaders, Loaded.strict reads, analytics events, nav entry; the
consumer profiles flag still gates every read on the server.
- FriendRow gains a `record` (games, form, win rate) and `onClick`.
- Both routes join the design-audit matrix as golden routes.
Verification
- app, design-system, design-audit: typecheck, lint, tests; check-architecture.
- Rendered in PinchTab through dev:design-audit at 1440 and 390, dark and light.
- design-audit Playwright (axe, contrast, keyboard, goldens) for both routes
in the pinned Playwright image: 32 goldens written, 96 comparison runs pass.
The image ran as linux/arm64 on a Mac, not the CI amd64 host.
- Not run: live beta check.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011u9pQk6p4o3DxofkiZXg8y
…hampion leaderboard Why: the compare read returns one page of at most 25 rows by win rate, so the group average and "the most games" described only that page as the whole group (review P2 on #5381). What: when the leaderboard is truncated the hero says the viewer's own record only. Verification: app typecheck, lint and test:ci pass; the truncated hero test now pins the shorter line. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011u9pQk6p4o3DxofkiZXg8y
8bb1150 to
937e622
Compare
Why
The in-app champion page was a comparison table with KDA columns and there was no Champions index. The Warm Friends design (D10 index, D11 champion) puts the friend group first: who plays what, who is best on it, and how you do in lane. Workstream B, wave 1.
What
/champions(new): hero with the favourite champion's splash, "Yours" (the viewer's champions, small samples noted), and "Popular with your friends" with the best friend on each. Server chips and a champion search are real controls. ReadsconsumerChampion.index./champions/:championId(replaces the old comparison page):HeroPanelwith splash art and a statement about where the viewer stands; "Who's best on X" asFriendRowranking with games, "Won 7 of the last 10" (fromlast10) andWinRateBar; "Still warming up"; "Most mastery"; "Your matchups" per lane fromconsumerChampion.matchups, labelled "Ahead at 15 minutes in 5 of 6 lane games" per COPY.md. No tips, builds or public-stats sections.Loaded.strict; analytics eventschampions_index_openedandchampions_filter_changed; nav gets a Champions entry;/championsis added to the analytics route allowlist. The server still gates every read through the consumer profiles flag: with it off the nav entry is absent and the reads refuse, and the pages show their unavailable state.FriendRowgainsrecord(games, form, win rate) andonClick(so rows route in-app and keep a realhref), with a story, test and CSS.championsandchampion(Ahri, 103) join the matrix as golden routes (matrix 648 to 684 cases; README counts corrected, they were stale). 32 goldens added.Stack note: the redesign component stack (#5245, #5255, #5263) is not yet restacked on current
main, and the champion endpoints (#5304) are onmain. This branch ismainplus those five component commits (cherry-picked, content identical), so the diff shows them until that stack lands; restack drops them.Demo
Champion page, before (old comparison page) then after, 1440 and 390, dark and light. The index has no before: the route did not exist.
Champions index, after:
Captured with PinchTab against
dev:design-audit(the audit seed's Ahri fixture), modern skin.Verification
bunx turbo run build typecheck test lint --filter='...[origin/main...HEAD]'on the pre-rebase head: 61 tasks pass (backend 6080 tests included). After the rebase and the last edits:typecheck test lintfor app, design-system and design-audit: 34 tasks pass. App 726 tests, design-system 126, design-audit 15.check-architectureclean.bunx lefthook run pre-commitpasses.bun run jscpdpasses on a base that includese2695d6d43(baseline 923 clones, 675 allowed pairs).bun run check-directory-file-counts: no failures, no new warnings.width: auto, win rate bar 8rem), so the name uses the rest of the row and shows in full at 1440 ("Scout Classic" plus "You"). It truncates only when the row is genuinely too narrow. A long-name story (OnAChampionLongName) covers that case.mcr.microsoft.com/playwright:v1.64.0-nobleimage againstdev:design-audit: 32 goldens rewritten after the row change; 64 comparison runs pass (2 repeats). The image ran aslinux/arm64on a Mac, not the CI amd64 host; the 2% tolerance should absorb it, but CI is the judge.🤖 Generated with Claude Code
https://claude.ai/code/session_011u9pQk6p4o3DxofkiZXg8y