Skip to content

chore(ui): audit pass on Leaderboard ViewSelector + GroupsBrowser - #600

Merged
junhoyeo merged 1 commit into
mainfrom
refactor/leaderboard-view-selector-audit
May 25, 2026
Merged

chore(ui): audit pass on Leaderboard ViewSelector + GroupsBrowser#600
junhoyeo merged 1 commit into
mainfrom
refactor/leaderboard-view-selector-audit

Conversation

@junhoyeo

@junhoyeo junhoyeo commented May 25, 2026

Copy link
Copy Markdown
Owner

Audit pass on the new components from PR #599. Adds keyboard :focus-visible rings, makes the selector responsive, swaps misleading role=tablist for aria-current="page", harmonizes border-radius with the rest of the codebase, and replaces a plain loading string with a proper shimmering skeleton grid (respects prefers-reduced-motion).

Verification

  • tsc --noEmit -> 0 errors
  • Live HTTP smoke against bun run dev: /leaderboard 200, /leaderboard?view=groups 200
  • Markup grep confirms aria-current="page" and aria-live ship; CSS grep confirms multiple :focus-visible rules emit

Summary by cubic

Accessibility and responsiveness audit for the leaderboard ViewSelector and GroupsBrowser. Improves keyboard focus, small-screen layout, and loading UX.

  • New Features

    • Shimmer skeleton grid for group loading (6 cards); honors prefers-reduced-motion and uses aria-busy/aria-live.
  • Refactors

    • Add :focus-visible outlines to ViewSelector items, tab buttons, and group cards.
    • Make ViewSelector responsive (wrap bar; title scales at ≤480px).
    • Replace role="tablist"/aria-selected with aria-current="page" on links for correct semantics.
    • Align border-radius with the app (group 10→8, item 8→6).
    • Use role="alert" for error text and disabled styling for the “My groups” tab when signed out.

Written for commit d4c8ac7. Summary will update on new commits. Review in cubic

Top-5 improvements from the design-guidelines pass against the
ViewSelector + GroupsBrowser components added in the previous
refactor:

1. Add :focus-visible outline to ViewSelector items, GroupsBrowser
   TabButtons, and group Cards. Keyboard users had no visible focus
   indicator on these interactive surfaces.

2. Make ViewSelector responsive. Bar now flex-wraps and Title
   drops from 30px -> 24px below 480px so the segmented control
   doesn't get pushed off-screen on small phones.

3. Replace role="tablist" with aria-current="page" in ViewSelector.
   These are URL navigations, not in-page tab panels; the tab
   semantics were dishonest and would have broken expected
   ArrowLeft/Right focus behavior.

4. Match border-radius (10 -> 8) so the ViewSelector Group matches
   the existing Tabs/SortOptions visual language.

5. Replace the "Loading groups..." string with a proper shimmer
   skeleton grid (6 cards). Honors prefers-reduced-motion. Added
   aria-busy + aria-live + aria-label="Loading groups" so SRs get
   the right announcement. Also added aria-disabled visual styling
   to the My-groups TabButton when signed out, and role="alert" to
   the error message.

Constraint: keep visual language consistent with the existing SortOptions inside LeaderboardClient
Rejected: drop the color transition on hover entirely | the /ui skill's Tailwind guideline against transition-* on hover is opinionated; the styled-components version reads fine and matches the rest of the codebase
Confidence: high
Scope-risk: very narrow (only the two new components; no schema, no API, no test changes)
Directive: when adding link-based segmented controls, prefer aria-current over role=tablist — links navigate, tabs swap panels
Not-tested: arrow-key focus traversal across the Users/Groups items (browsers handle this natively for links via Tab; no custom keyboard handler needed)
@vercel

vercel Bot commented May 25, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
tokscale Ready Ready Preview, Comment May 25, 2026 5:21am

Request Review

@junhoyeo
junhoyeo merged commit 8e73312 into main May 25, 2026
3 of 4 checks passed
@junhoyeo
junhoyeo deleted the refactor/leaderboard-view-selector-audit branch May 25, 2026 05:21
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