feat(scoreboard): contextual top-10 chart — labels + detail tooltip - #53
Merged
Conversation
The top-10 bars said nothing without scanning the table below (#52). Each column now carries its context three ways: at a glance (points above the bar, rank stacked over a truncated name below it — stacked rather than inline, owner call, a tenth-width column is too cramped for both), on hover/focus (a detail tooltip with medal rank, full name, points, last solve, division, and the you/your-team marker), and to a screen reader (an aria-label on the column carrying the same facts, so parity doesn't depend on the visual layer). The tooltip reveal is React state driven off focus/hover — not a CSS :hover/:focus trick — so keyboard Tab and mobile tap (tap = focus on a button) open it identically and tests assert the reveal rather than trusting a pseudo-class. One open at a time; edge columns anchor their tooltip to the nearest edge so the first/last can't clip outside the card; bars keep 14% headroom so the tallest bar's points label fits. Chart extracted from the page into components/scoreboard/top-chart.tsx (§14), RankBadge into rank-badge.tsx so the table and the tooltip share the medal rendering. Hand-rolled, tokens only — no tooltip library. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #52
What
The top-10 bars carried only a rank number — no context without scanning the table below. Each column now explains itself three ways:
RankBadge, full name, points, last solve, division when brackets are in play, and the "you"/"your team" marker.aria-labelper column carrying the same facts, so parity doesn't depend on the visual layer.Design notes
:hover/:focustrick. Keyboard Tab and mobile tap (tap = focus on a button) open the tooltip through the sameonFocus/onMouseEnterpath, one at a time, and the tests assert the reveal itself rather than trusting a pseudo-class. (I built the CSS-only version first and found it unverifiable — neither RTL nor the preview browser can prove a:focusreveal — so I switched to state on purpose.)components/scoreboard/top-chart.tsx,RankBadge→rank-badge.tsx(now shared by the table and the tooltip). Hand-rolled, §9 tokens only, no tooltip library.Tests & verification
npm run buildexit 0.Frontend-only — no backend, no migration.
🤖 Generated with Claude Code