feat: shareable result card + age-group split percentile pills#182
Merged
Conversation
Brainstormed design for two UX features: an OG image / downloadable share card on result pages, and inline age-group percentile pills on each discipline card. Layout and integration decisions locked via visual review. Implementation plan to follow. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
8 tasks covering: percentile formatting helper (TDD), PercentilePill component, integration into result page discipline cards, ShareDialog client component, header integration, opengraph-image route via next/og, and Playwright e2e coverage. Plan references the design spec in docs/superpowers/specs/. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Summary
Two coupled UX upgrades to the result page (the most-shared surface on the site):
opengraph-image.tsxroute; Next.js wires<meta property="og:image">and<meta name="twitter:image">automatically.—renders when histogram data is unavailable.Spec:
docs/superpowers/specs/2026-05-10-share-card-and-split-percentiles-design.mdPlan:
docs/superpowers/plans/2026-05-10-share-card-and-split-percentiles.mdFiles
New
app/src/lib/percentile.ts—formatPercentile(handles0/NaN/Infinityas no-data →—)app/src/components/PercentilePill.tsx— small server componentapp/src/components/ShareDialog.tsx— client component (clipboard, Escape, outside-click, focus return)app/src/app/race/[slug]/result/[id]/opengraph-image.tsx— Node-runtimenext/ogimage route, 24h revalidate, fallback for missing race/athleteapp/src/lib/__tests__/percentile.test.ts— vitestapp/e2e/result-share-and-pills.spec.ts— PlaywrightModified
app/src/app/race/[slug]/result/[id]/page.tsx— header is now flex (name left, Share right), pills added to each of the four discipline cardsTest plan
npm test) — 13/13 pass (3 new, 10 existing)npx playwright test) — 10/10 pass (5 new: pills render, share dialog opens, clipboard copy, Escape close, OG returns PNG, og:image meta present)npm run lint) — cleannpm run build) — succeeds;opengraph-imageroute registered as dynamicnpm run start— OG route returns 200 +image/png; result page HTML contains<meta property="og:image" ...>Out of scope (deferred)
🤖 Generated with Claude Code