Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ reference](/reference/scout-design-audit/).

## 1. Run the complete local audit

From the repository root, run the same 684-case matrix as the scheduled check:
From the repository root, run the same 738-case matrix as the scheduled check:

```bash
ASTRO_DEV_BACKGROUND=0 CI=true TZ=UTC \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,22 @@ The browser configuration lives at
The marketing site is started with `CHAMPION_META_SNAPSHOT_FILE` set to the
fixture snapshot's `index.json`
(`packages/scout-for-lol/packages/frontend/src/lib/champion-meta/__fixtures__/snapshot-v2/champion-meta/`),
so the `/champions/` and `/champions/ahri/middle/` routes render made-up data
so the `/champions/`, `/champions/ahri/middle/` and
`/champions/ahri/middle/vs/syndra/` routes render made-up data
instead of whatever the committed snapshot holds. An external marketing origin
must be built the same way for those two routes to exist.
must be built the same way for those three routes to exist.

## Browser matrix

| Coverage boundary | Cases |
| ------------------------------------------------- | ------: |
| All routes, four themes, Chromium desktop | 252 |
| All routes, classic-light, Chromium tablet/mobile | 126 |
| Additional golden-route Chromium combinations | 180 |
| All routes, modern-light, WebKit desktop/mobile | 126 |
| **Total** | **684** |
| All routes, four themes, Chromium desktop | 264 |
| All routes, classic-light, Chromium tablet/mobile | 132 |
| Additional golden-route Chromium combinations | 210 |
| All routes, modern-light, WebKit desktop/mobile | 132 |
| **Total** | **738** |

The 18 golden routes cover all four themes and all four Chromium viewports.
The 21 golden routes cover all four themes and all four Chromium viewports.
Firefox is not part of the supported browser boundary. The scheduled CI
step remains advisory through `soft_fail` while consecutive main runs establish
stability.
Expand Down
9 changes: 6 additions & 3 deletions packages/scout-for-lol/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,12 @@ are one-shot and each command starts a new saved conversation.
detection, marketing showcase refresh, image GC, champion-meta snapshot
refresh)
- The public champion pages (`/champions/`, `/champions/<slug>/`,
`/champions/<slug>/<role>/`) are static, built from the committed snapshot v2
(below) on the friendly design system: the index reads `index.json` and the
champion files for its lane figures, a champion page its one champion file.
`/champions/<slug>/<role>/`, `/champions/<slug>/<role>/vs/<opponent>/`) are
static, built from the committed snapshot v2 (below) on the friendly design
system: the index reads `index.json` and the champion files for its lane
figures, a champion page its one champion file, a matchup page its one
matchup file. A matchup page exists for exactly the opponents a champion file
lists, and the champion page links only those.
Every page states the patch, queue, rank bracket and the days its games were
played; an API with nothing published yields an empty snapshot, which renders
"No champion data yet" and hides the Champions navigation link.
Expand Down
14 changes: 7 additions & 7 deletions packages/scout-for-lol/packages/design-audit/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Scout design audit

The design audit exercises all 63 shipped Scout public, documentation, and app
routes through a deliberate 684-case matrix. Every route gets all four themes
The design audit exercises all 66 shipped Scout public, documentation, and app
routes through a deliberate 738-case matrix. Every route gets all four themes
on Chromium desktop, classic-light responsive coverage on Chromium tablet and
mobile, and modern-light coverage on WebKit desktop and mobile. The 18 visual
mobile, and modern-light coverage on WebKit desktop and mobile. The 21 visual
golden routes retain the complete four-theme, four-viewport Chromium matrix.
It is read-only: app forms are rendered and keyboard-tested, but no mutation is
submitted.

The deduplicated total is 252 all-route Chromium desktop cases, 126 all-route
classic-light Chromium tablet/mobile cases, 180 additional golden-route
Chromium theme/viewport cases, and 126 all-route modern-light WebKit
The deduplicated total is 264 all-route Chromium desktop cases, 132 all-route
classic-light Chromium tablet/mobile cases, 210 additional golden-route
Chromium theme/viewport cases, and 132 all-route modern-light WebKit
desktop/mobile cases.

Run the deterministic checks locally with:
Expand Down Expand Up @@ -50,7 +50,7 @@ Chromium and WebKit are the supported browser engines; Firefox is deliberately
omitted.
`SCOUT_DESIGN_AUDIT_MODE=nightly` selects the scheduled validation boundary but
does not expand the browser matrix. When local servers are enabled, as they are
in CI, nightly runs the 684 cases exactly once across 16 sequential shards so
in CI, nightly runs the 738 cases exactly once across 16 sequential shards so
each Playwright process stays inside the 16 GiB pod limit and the complete run
fits the cluster's 30-minute pod-readiness budget. It uses the same deterministic
fixture and needs no external origins or Discord credentials. An explicitly
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,20 @@ describe("Scout design audit matrix", () => {
expect(new Set(routes.map((route) => route.name)).size).toBe(routes.length);
expect(new Set(routes.map((route) => route.path)).size).toBe(routes.length);
expect(routes.filter((route) => route.surface === "public")).toHaveLength(
8,
9,
);
expect(routes.filter((route) => route.surface === "docs")).toHaveLength(29);
expect(routes.filter((route) => route.surface === "app")).toHaveLength(28);
expect(routes.filter((route) => route.golden)).toHaveLength(20);
expect(routes.filter((route) => route.golden)).toHaveLength(21);
});

test("runs exactly the intentional 720 browser cases", () => {
test("runs exactly the intentional 738 browser cases", () => {
const cases = auditCases();
const keys = cases.map(
({ project, route, theme }) =>
`${project.name}/${route.name}/${theme.name}`,
);
expect(cases).toHaveLength(720);
expect(cases).toHaveLength(738);
expect(new Set(keys).size).toBe(cases.length);

for (const project of auditProjects) {
Expand Down
7 changes: 7 additions & 0 deletions packages/scout-for-lol/packages/design-audit/src/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ const publicRoutes: AuditRoute[] = [
authenticated: false,
golden: true,
},
{
name: "matchup",
surface: "public",
path: "/champions/ahri/middle/vs/syndra/",
authenticated: false,
golden: true,
},
{
name: "privacy",
surface: "public",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,17 @@ export const SmallSample: Story = {
},
};

/** Under a matchup: the figures, then one short fact. */
export const WithNote: Story = {
render: oneColumn,
args: {
champion: "Garen",
winRate: 48.9,
games: 410,
note: "Wins lane, loses the game",
},
};

const cards: ChampionCardProps[] = [
{
champion: "Jinx",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ export type ChampionCardProps = {
laneGames?: number;
/** "S tier". */
tier?: string;
/** A short fact under the figures: "Wins lane, loses the game". */
note?: string;
className?: string;
};

Expand All @@ -41,6 +43,7 @@ export function ChampionCard({
laneWinRate,
laneGames,
tier,
note,
className,
}: ChampionCardProps) {
return (
Expand Down Expand Up @@ -73,9 +76,16 @@ export function ChampionCard({
)}
</span>
)}
{tier === undefined ? null : (
{tier === undefined && note === undefined ? null : (
<span className="scout-champion-card__tier-slot">
<span className="scout-champion-card__tier">{tier}</span>
{tier === undefined ? null : (
<span className="scout-champion-card__tier">{tier}</span>
)}
{note === undefined ? null : (
<span className="scout-champion-card__tier scout-champion-card__note">
{note}
</span>
)}
</span>
)}
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,21 @@ describe("ChampionCard", () => {
expect(html).not.toContain("scout-champion-card__tier");
});

test("shows a note under the figures, without a tier", () => {
const html = renderToStaticMarkup(
<ChampionCard
champion="Garen"
href="#garen"
winRate={48.9}
games={410}
note="Wins lane, loses the game"
/>,
);
expect(html).toContain("scout-champion-card__note");
expect(html).toContain("Wins lane, loses the game");
expect(html).toContain("from 410 games");
});

test("leaves out the win rate and games when they are not given", () => {
const html = renderToStaticMarkup(
<ChampionCard
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,14 @@ a.scout-sticker:hover .scout-face {
white-space: nowrap;
}

/* A short fact under the figures, such as "Wins lane, loses the game". */
.scout-champion-card__note {
white-space: normal;
text-wrap: balance;
line-height: 1.3;
padding-block: 4px;
}

/* ---------- narrower ---------- */

@media (max-width: 720px) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ import {
matchupsModel,
type MatchupRow,
} from "#src/components/champions/matchups.ts";
import {
matchupHref,
pageOpponents,
} from "#src/components/champions/matchup/pages.ts";
import type { SnapshotChampion } from "#src/lib/champion-meta/snapshot-v2-schema.ts";

interface Props {
Expand All @@ -15,6 +19,7 @@ interface Props {
const { champion, role } = Astro.props;
const opponents =
champion.matchups.find((group) => group.role === role)?.opponents ?? [];
const pages = pageOpponents(champion, role);
const { wellAgainst, hardAgainst } = matchupsModel(opponents);
const sides: { heading: string; rows: MatchupRow[] }[] = [
{ heading: "Does well against", rows: wellAgainst },
Expand All @@ -41,35 +46,43 @@ const sides: { heading: string; rows: MatchupRow[] }[] = [
</span>
</div>
<ul class="champions-vs-list">
{side.rows.map((row) => (
<li class="champions-vs">
<ChampionFace champion={row.id} size={46} alt="" />
<span class="champions-vs-text">
<b>{row.name}</b>
{row.note !== null && (
<span class="champions-note">{row.note}</span>
)}
</span>
<span class="champions-vs-fig">
<span class="scout-sr-only">Wins the game </span>
<b>{formatPercent(row.winRate)}</b>
<span class="champions-quiet">
{row.games.toLocaleString("en-US")} games
</span>
</span>
{row.lane === null ? (
<span class="champions-vs-fig" />
) : (
<span class="champions-vs-fig">
<span class="scout-sr-only">Ahead at 15 minutes </span>
<b>{formatPercent(row.lane.aheadRate)}</b>
<span class="champions-quiet">
{row.lane.games.toLocaleString("en-US")} games
{side.rows.map((row) => {
const href = pages.has(row.slug)
? matchupHref(champion.slug, role, row.slug)
: undefined;
const Row = href === undefined ? "div" : "a";
return (
<li>
<Row class="champions-vs" href={href}>
<ChampionFace champion={row.id} size={46} alt="" />
<span class="champions-vs-text">
<b>{row.name}</b>
{row.note !== null && (
<span class="champions-note">{row.note}</span>
)}
</span>
<span class="champions-vs-fig">
<span class="scout-sr-only">Wins the game </span>
<b>{formatPercent(row.winRate)}</b>
<span class="champions-quiet">
{row.games.toLocaleString("en-US")} games
</span>
</span>
</span>
)}
</li>
))}
{row.lane === null ? (
<span class="champions-vs-fig" />
) : (
<span class="champions-vs-fig">
<span class="scout-sr-only">Ahead at 15 minutes </span>
<b>{formatPercent(row.lane.aheadRate)}</b>
<span class="champions-quiet">
{row.lane.games.toLocaleString("en-US")} games
</span>
</span>
)}
</Row>
</li>
);
})}
</ul>
</div>
))}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
import { AssetIcon } from "@scout-for-lol/design-system/domain/rows/asset-icon";
import { formatPercent } from "@scout-for-lol/design-system/domain/profile/win-rate-bar";
import {
gamesLabel,
type SpellFact,
} from "#src/components/champions/matchup/model.ts";

interface Props {
championName: string;
spellFact: SpellFact | null;
}

const { championName, spellFact } = Astro.props;
---

{spellFact !== null && (
<section
class="scout-soft-panel scout-soft-panel--open"
aria-labelledby="says-h"
>
<h2 id="says-h">What the numbers say</h2>
<ul class="champions-facts">
<li>
{championName} players who take{" "}
<span class="champions-in">
{spellFact.better.assets.map((asset) => (
<AssetIcon asset={asset} label="" />
))}
{spellFact.better.label}
</span>{" "}
win this more often than those who take{" "}
<span class="champions-in">
{spellFact.worse.assets.map((asset) => (
<AssetIcon asset={asset} label="" />
))}
{spellFact.worse.label}:
</span>{" "}
<b>{formatPercent(spellFact.better.winRate)}</b> from{" "}
{gamesLabel(spellFact.better.games)} against{" "}
<b>{formatPercent(spellFact.worse.winRate)}</b> from{" "}
{gamesLabel(spellFact.worse.games)}.
</li>
</ul>
</section>
)}
Loading