Skip to content

feat(scout-for-lol): layered rich tooltips for entities and players - #5264

Merged
shepherdjerred merged 5 commits into
mainfrom
scout-redesign-a5-tooltips
Dec 3, 2026
Merged

shepherdjerred merged 5 commits into
mainfrom
scout-redesign-a5-tooltips

Conversation

@shepherdjerred

@shepherdjerred shepherdjerred commented Nov 26, 2026 •

Copy link
Copy Markdown
Owner

Why

The redesigned pages keep depth one hover away: a champion portrait, an ability, an item or a friend opens a structured, layered tooltip (header, labelled facts, the game's description, parts with tooltips of their own, Scout's block, one link). Explore's explore-inline-entity.tsx is single-layer and tied to Explore. This is W0-A5 of the Scout redesign; it only adds the design-system building blocks and does not change any page.

What

  • overlays/rich-tooltip: a Radix popover layer stack. Open delay 350 ms on hover, immediate on keyboard focus; a layer stays open while the pointer or focus is in it or a descendant (150 ms grace). A RichTooltip inside another's content is a part: its layer opens beside the parent, level with the part that opened it. Escape closes the top layer only. Enter, Space (buttons) or ArrowRight on a focused trigger moves focus into its layer; Escape returns it. Under 640 px a tap opens the bottom sheet, and a tapped part replaces the sheet's content behind a back control. The shell never fetches. Timing rules live in hover-layer-controller.ts (fake-timer tests).
  • domain/tooltips: bodies for champion, ability, item, rune, summoner spell and keyword (GameFact shape) and player (own props), each with an optional scout node and href; EntityTooltip, GameFactTooltip, and Scout block helpers. Keyword mentions in a description open their own layer.
  • useGameFact(kind, key) and GameFactProvider(loader): in-memory cache, shared in-flight requests, abort when the layer closes, prefetch on hover intent (useGameFactIntent); skeleton while loading, one plain line on failure.
  • Story facts are the generated game-fact JSON itself, imported from the data package and validated by its schema (entity-tooltip.facts.ts); nothing is retyped. The schema, the 15 generated files the stories use and the game-facts layer entry are byte-identical copies from feat(scout-for-lol): emit per-entity game-fact JSON for rich tooltips #5237 (open), so the two merge without conflict. The recipe shows "+650 gold" as plain text after the components.
  • styles/tooltips.css: 344 px soft panel, floating shadow, no arrow.
  • Stories (Domain/EntityTooltip): every kind, ability with rank table, three layers (Ahri, Charm, keyword), phone sheet, loading, load failed, and a closed Interactive story the e2e drives.

Demo

New UI, key states in modern dark and light at 1440 and 390 (Playwright captures of the Storybook stories).

Three layers: Ahri, then Charm, then the keyword inside it.

three-layers-1440-dark.png
three-layers-1440-light.png

Item and player.

item-1440-dark.png
item-1440-light.png
player-1440-dark.png
rune-1440-light.png

Phone (390 wide) bottom sheet.

phone-sheet-390-dark.png
phone-sheet-390-light.png

Loading and failed.

loading-1440-dark.png
load-failed-1440-light.png

Verification

  • bun run typecheck, bun run lint, bun run test in @scout-for-lol/design-system: green (70 tests, 20 of them new: hover controller, game-fact store, keyword and passive splitting). bun run build (Storybook): green.
  • Catalog e2e against a static build of this head, own port, modern dark, modern light and classic light: 744 passed and 3 failed (axe landmark-is-unique on the three-layer story, from <header> inside each dialog); fixed by using div, then the tooltip stories, rich-tooltip.spec.ts and the bottom-sheet spec re-run on the rebuilt head: 48 passed. The full 747-case catalog was not re-run after that one-element change.
  • e2e/rich-tooltip.spec.ts: hover opens after the delay and not before (fake clock); leaving early never opens; moving into a child keeps the parent open and both close after the grace period; Escape closes one layer at a time; keyboard path (focus opens, ArrowRight enters, Tab to an ability opens its layer, Enter enters it, Escape steps back, no reopen on focus return); tap at 390 opens the sheet, a tapped part replaces content with a back control, back and close restore focus.
  • Fixture drift: entity-tooltip.facts.test.ts fails if a part a story can open has no fixture, if Charm differs from the generated file other than its added keyword part, or if a generated fact renders a name or fact value the file does not hold. Data package typecheck, lint and test (architecture layers) green.
  • bunx lefthook run pre-commit: green.
  • No extended-tier steps in the touched workspace.
  • Not run: live site, the app wiring of loadGameFact (the data package client from feat(scout-for-lol): emit per-entity game-fact JSON for rich tooltips #5237 is not on main). Captures were taken with Playwright, not PinchTab. The keyword and its Cleanse part are the only hand-written facts (the tips glossary has not landed).
  • Stacked on feat(scout-for-lol): add Panel, Chip, Fold and BottomSheet primitives #5209 as pushed (4777c3357b); the local scout-redesign-a2-primitives has since been rebased on newer main but not pushed, so this branch needs a restack once it is.

🤖 Generated with Claude Code

https://claude.ai/code/session_011u9pQk6p4o3DxofkiZXg8y

@shepherdjerred

Copy link
Copy Markdown
Owner Author

@greptile-apps

greptile-apps Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

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

@coderabbitai

coderabbitai Bot commented Nov 26, 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

@shepherdjerred
shepherdjerred removed this pull request from stack #5265 November 26, 2026 19:30
@shepherdjerred
shepherdjerred force-pushed the scout-redesign-a5-tooltips branch from db0b934 to 16dc90d Compare November 26, 2026 21:07
@shepherdjerred
shepherdjerred removed this pull request from stack #5270 November 26, 2026 23:10
shepherdjerred added a commit that referenced this pull request Nov 27, 2026
…eferences and the full-run pipeline

Why
The design system's rich tooltips (#5264) and the game facts (#5237) open layers
by game-fact reference, so every entity a tip or combo mentions has to resolve
to one. The app and the public site also fetch one champion at a time.

What
- Output format (champion-tips.ts, refs.ts, champion-output.ts): one JSON file
  per champion under src/tips/generated/champions/ with an index. A tip's
  references are game-fact keys (ability Ahri-E, item and summoner spell by id,
  champion by Data Dragon key, keyword by glossary slug) with the character span
  each covers; combo steps use the same keys. A unit whose reference resolves to
  no game fact fails whole.
- Keyword facts: the tips glossary is emitted as keyword game facts
  (game-facts build and sources, facts/keyword/, regenerated).
- Reader (champion-reader.ts) and CI tests (champion-generated.test.ts): schema,
  references against the facts, index against the files, a size budget (512 KiB
  a file, 24 MiB in all); hidden tips are not returned, and a set left under the
  minimum is hidden.
- scripts/pipeline/full-run.ts: pass 1 with Sonnet over the plan's whole unit
  list, most-played first, combos for general sets, Decisions triage of every
  tip (hide only p(wrong) >= 0.85 that also assert an interaction), checkpointed
  per chunk, held to --max-cost-usd, stopping rather than trimming quality when
  the projection does not fit.

Verification
- bunx turbo run typecheck lint test --filter=@scout-for-lol/data: pass (2,111
  tests; new: references and spans, per-champion files, reader, keyword facts).
- Live: a 12-unit trial of the full run, $0.43. The bulk output is a separate
  stacked PR. Not run: extended tier, ArgoCD or runtime acceptance.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011u9pQk6p4o3DxofkiZXg8y
Base automatically changed from scout-redesign-a2-primitives to main November 27, 2026 03:14
shepherdjerred added a commit that referenced this pull request Nov 28, 2026
…r to a rich tooltip hover

Why
The redesign's rich tooltips (RichTooltip/EntityTooltip, #5264) take an
optional Scout block. The page supplies it for items, runes, spells and
abilities, but a champion's or a player's block needs data the page does not
hold: the viewer's record and friends' record on the champion, and a player's
rank, latest game and games with the viewer.

What
- consumerTooltip.facts: a discriminated input, { kind: "champion", championId,
  queues? } or { kind: "player", playerId }, behind protectedProcedure and the
  usual per-request consumer scope (FORBIDDEN vs SERVICE_UNAVAILABLE).
- Champion: the champion index narrowed to one champion and the last 90 days,
  through the existing buildChampionIndex, so the numbers match the Champions
  page: you, friends (players, games, wins) and the best friend.
- Player: freshest Solo/Duo (else Flex) rank from latestRanksByPuuid, the
  latest game, and the games the viewer and the player won or lost on the same
  team, newest ten as a tally. A player outside the viewer's scope is NOT_FOUND.
- One lake slot per call: readChampionIndex gains championId/sinceMs and runs
  on a page; the shared-games read and the latest-game read share one page.
- Design-audit seed: a separate block of recent Ahri games for the friends who
  play her.

Verification
- consumer-tooltip.router.test.ts (16 tests): forbidden vs unavailable,
  out-of-scope player, multi-account and multi-server person counted once,
  90-day bound, queue filter, empty states, ordering, exactly one lake slot.
- bunx turbo run build typecheck test lint --filter='@scout-for-lol/backend...'
- bun run jscpd, bun run check-directory-file-counts
- Not run: live deployment checks; extended tier (no extended step touched).

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 Nov 28, 2026
…r to a rich tooltip hover

Why
The redesign's rich tooltips (RichTooltip/EntityTooltip, #5264) take an
optional Scout block. The page supplies it for items, runes, spells and
abilities, but a champion's or a player's block needs data the page does not
hold: the viewer's record and friends' record on the champion, and a player's
rank, latest game and games with the viewer.

What
- consumerTooltip.facts: a discriminated input, { kind: "champion", championId,
  queues? } or { kind: "player", playerId }, behind protectedProcedure and the
  usual per-request consumer scope (FORBIDDEN vs SERVICE_UNAVAILABLE).
- Champion: the champion index narrowed to one champion and the last 90 days,
  through the existing buildChampionIndex, so the numbers match the Champions
  page: you, friends (players, games, wins) and the best friend.
- Player: freshest Solo/Duo (else Flex) rank from latestRanksByPuuid, the
  latest game, and the games the viewer and the player won or lost on the same
  team, newest ten as a tally. A player outside the viewer's scope is NOT_FOUND.
- One lake slot per call: readChampionIndex gains championId/sinceMs and runs
  on a page; the shared-games read and the latest-game read share one page.
- Design-audit seed: a separate block of recent Ahri games for the friends who
  play her.

Verification
- consumer-tooltip.router.test.ts (16 tests): forbidden vs unavailable,
  out-of-scope player, multi-account and multi-server person counted once,
  90-day bound, queue filter, empty states, ordering, exactly one lake slot.
- bunx turbo run build typecheck test lint --filter='@scout-for-lol/backend...'
- bun run jscpd, bun run check-directory-file-counts
- Not run: live deployment checks; extended tier (no extended step touched).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011u9pQk6p4o3DxofkiZXg8y
shepherdjerred and others added 3 commits December 2, 2026 19:18
…items, runes, spells, keywords and players

Why
The redesigned pages keep depth one hover away: a champion portrait, an
ability, an item or a friend should open a structured, layered tooltip
(header, facts, description, parts with their own tooltips, Scout's block, one
link). Explore's inline entity popover is single-layer and bound to Explore.

What
- overlays/rich-tooltip: a Radix popover layer stack. Hover opens after 350 ms,
  focus at once; a layer stays open while pointer or focus is in it or a
  descendant (150 ms grace, timing rules in a fake-timer-tested controller);
  Escape closes the top layer only; Enter, Space or ArrowRight on a focused
  trigger moves focus into its layer and Escape returns it. A child layer
  sits beside its parent, level with the part that opened it. Under 640 px a
  tap opens the bottom sheet, and a tapped part replaces the sheet's content
  behind a back control. The shell never fetches.
- domain/entity-tooltip and player-tooltip: bodies for champion, ability,
  item, rune, summoner spell, keyword (GameFact shape) and player, each with a
  page-supplied scout node and an optional link. Keyword mentions in a
  description open their own layer.
- domain/game-fact: GameFactProvider(loader), useGameFact with an in-memory
  cache, shared in-flight requests and abort on close, and a prefetch on
  hover intent; skeleton while loading, one plain line on failure.
- styles/tooltips.css, stories for every kind, the three-layer example, the
  phone sheet, loading and error; rich-tooltip e2e spec.
- game-fact-types.ts mirrors the schema of #5237 until that lands.

Verification
- bunx turbo run build typecheck test lint --filter=@scout-for-lol/design-system
- Catalog e2e (modern dark, modern light, classic light) and
  e2e/rich-tooltip.spec.ts: hover delay, parent kept open from a child, Escape
  one layer at a time, keyboard path, tap at 390 opens the sheet.
- bunx lefthook run pre-commit
- No extended-tier steps in the touched workspace. Not run: live site, the app
  wiring of loadGameFact (data package export not on main yet).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011u9pQk6p4o3DxofkiZXg8y
…and tidy the recipe and Scout copy

Why
The stories carried hand-copied facts that could drift from the generated
game-fact JSON, the recipe showed an empty grey circle for the remaining gold,
and two Scout lines ran facts together or named a bracket the app does not
serve.

What
- The stories load the generated fact files themselves, imported from the data
  package and validated by the game-fact schema; the types come from the same
  schema. The schema, those 15 generated files and the game-facts layer entry are
  byte-identical to #5237 (open) so the two merge without conflict, and nothing
  is retyped. Charm is the generated ability with one stand-in keyword part
  and the keyword is hand-written until the glossary lands.
- A test fails if a part a story can open has no fixture, if Charm differs from
  the generated file other than its parts, or if a generated fact renders a name
  or fact the file does not hold.
- The recipe shows "+650 gold" as plain text after the components.
- Scout copy: "Maxed last by most Ahri players" and "Q, then W, then E: wins
  52.3% of 8,700 games" as two lines; the context line says "Emerald to
  Diamond".
- The keyboard e2e waits for the layer to load before moving focus into it.

Verification
- bun run typecheck, lint, test in @scout-for-lol/design-system (87 tests) and
  typecheck, lint, test in @scout-for-lol/data; storybook build.
- Tooltip stories in three themes, rich-tooltip and bottom-sheet e2e on a
  static build of this head: green.
- bunx lefthook run pre-commit.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011u9pQk6p4o3DxofkiZXg8y
Why: jscpd flagged the two tooltip bodies as a new clone.
What: extract DescribedBody in entity-tooltip-bodies.tsx.
Verification: bun run jscpd passes (930 clones, baseline); turbo typecheck lint on changed packages passes.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011u9pQk6p4o3DxofkiZXg8y
@shepherdjerred
shepherdjerred force-pushed the scout-redesign-a5-tooltips branch from 16dc90d to 6861753 Compare December 3, 2026 03:36
@shepherdjerred
shepherdjerred marked this pull request as ready for review December 3, 2026 03:36
@shepherdjerred

Copy link
Copy Markdown
Owner Author

@codex review

Automated re-review request for 6861753 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-03T03:39:51.254087Z 6861753 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: 6861753347

ℹ️ 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".

shepherdjerred and others added 2 commits December 2, 2026 20:09
Why: the docs site imports the design-system styles, and its built-CSS test forbids [aria-expanded="true"] selectors, so the tooltip hover/open rules failed the docs-site test in CI.
What: rich tooltip and sheet triggers also set data-open while open; tooltips.css selects on [data-open].
Verification: bunx turbo run test:ci --filter=@scout-for-lol/docs-site passes locally.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011u9pQk6p4o3DxofkiZXg8y
Why: a tap on a wide touch screen opened the layer with nothing engaging it, so the 150ms close timer removed it before it could be read (review P2 on #5264).
What: the layer controller gains pin(), which opens the layer and counts as engaged until close(); the touch tap on a trigger calls it. Escape and an outside tap still close it through onOpenChange.
Verification: design-system typecheck, lint and test:ci pass; a controller test covers pin and its reset on close.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011u9pQk6p4o3DxofkiZXg8y
@shepherdjerred
shepherdjerred merged commit 3dd646b into main Dec 3, 2026
7 checks passed
@shepherdjerred
shepherdjerred deleted the scout-redesign-a5-tooltips branch December 3, 2026 05:04
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