Skip to content

feat: weekly tech-news quiz (arcade leaderboard game) - #6388

Open
tomeredlich wants to merge 84 commits into
mainfrom
claude/weekly-quiz-game-3483e1
Open

feat: weekly tech-news quiz (arcade leaderboard game)#6388
tomeredlich wants to merge 84 commits into
mainfrom
claude/weekly-quiz-game-3483e1

Conversation

@tomeredlich

@tomeredlich tomeredlich commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Weekly Tech News Quiz

A flag-gated (weekly_quiz, default off), web-only arcade trivia game about the week's tech news, skinned in the daily.dev purple. Responsive: a centered card on desktop, full-bleed edge-to-edge on mobile.

Flow: feed banner → modal → intro (logo, week context + top sources, Start, Share / Weekly reminder) → 3-2-1 countdown → 10 questions (4 options, instant green/red feedback, auto-advance) → results (developer "level" persona, score, share row, challenge link, leaderboard).

Intro

  • daily.dev logo + week date range, a hook line, and how much news it distils (N stories from M sources → K questions) with the week's top source logos.
  • Start button (falling-papers animation that speeds up on hover), Share + Weekly reminder.
  • One-shot per week: leaving/refreshing mid-quiz prompts a confirmation; the intro locks with "Try again next week".

Results

  • A BuzzFeed-style developer level keyed to score (6 tiers, e.g. 10x AI EngineerAsked AI, Still Wrong), a score ring, a "better than X%" line, a matching GIF, and confetti.
  • Share row: Download (renders a branded PNG), plus the standard socials.
  • Challenge a friend copy-link, Set weekly reminder, and the leaderboard with period tabs (Weekly / Monthly / All time), reputation badges, a "Fastest" chip, and the viewer's own row highlighted in gold.
  • Anonymous players get a "log in to save your score" CTA; a logged-in result is submitted once on arrival (and again if they sign in from here).

Mobile

  • Full-bleed surface (no card frame); mute + close move inside the top bar; the week pill sits under the title.
  • Results fill the screen the same way (panels flatten, edge-to-edge) with the header matching the intro's top bar.
  • Leaderboard shows first names only to keep rows compact.
  • Paper animation covers the whole screen.

Sharing

  • Custom invite message: "I just scored X/10 on the daily.dev Weekly Tech News Quiz. Think you know this week's tech news better than me? Take the quiz: ".
  • Mobile: the Share button and the social buttons route through the native share sheet with the premade result card attached as a file (navigator.share({ files })) — so it lands as a real image in WhatsApp/etc.
  • Desktop / no file-share: the social buttons fall back to web intents (text + link).
  • ⚠️ The link-preview image (what appears when you paste only the link) is the URL's Open Graph image, scraped server-side — a client can't set it per-share. Getting the per-score cards to show there needs backend OG hosting (see follow-ups). The premade cards are already built (generateResultImage.ts; Storybook "Share image" + "Social cards").

🔗 Live preview (standalone, no feed)

https://claude-weekly-quiz-game-3483e1.preview.app.daily.dev/weekly-quiz-preview

Runs the quiz over demo mode (temporary scaffolding) so it's testable without the backend or the flag. Press X to reset and replay. Storybook: Features/WeeklyQuiz/Game (intro, question, results, tiers/GIFs, share images, social cards, mobile screens).

⚠️ Temporary demo scaffolding — remove before merge

The backend GraphQL resolvers don't exist yet, so these fake the data and must be removed once the API + flag are live:

  • demoMode.ts (URL param ?weekly-quiz-demo=1, sticky per session)
  • /weekly-quiz-preview page (packages/webapp/pages/weekly-quiz-preview.tsx, noindex)
  • the demo short-circuits in the data hooks and WeeklyQuizBanner
  • the demo leaderboard hardcodes real public daily.dev members (name/avatar/reputation) with synthetic quiz scores/times, only so the preview looks populated

Backend contract needed

Client-side definitions in packages/shared/src/features/weeklyQuiz/graphql.ts + types.ts:

  • weeklyQuizStatus — availability window, activeQuizId, per-week completion
  • weeklyQuiz(quizId) — questions (4 options, correctOptionId for instant local feedback; recompute score server-side on submit)
  • weeklyQuizLeaderboard(period) — ranked entries + the viewer's own rank
  • submitWeeklyQuizResult({ quizId, answers, timeMs }) — logged-in only

Follow-ups (post-backend)

  • Host per-score OG cards and point the share link at a real quiz URL (e.g. .../quiz?score=X) so the link preview shows the custom image.
  • Remove all demo scaffolding above; swap quizUrl (currently https://daily.dev) for the live quiz page.
  • Wire the "Weekly reminder" toggle to a real subscription.

Reviewer heads-up

getShareLink/getWhatsappShareLink now include the share text in WhatsApp shares (previously WhatsApp got the bare link). This is a small, backward-compatible change to a shared util, but it affects all WhatsApp shares app-wide, not just the quiz.

Verification

  • pnpm --filter shared exec jest src/features/weeklyQuiz src/lib/share.spec.ts → 26 passing
  • node ./scripts/typecheck-strict-changed.js → clean
  • ESLint clean across the feature

🤖 Generated with Claude Code

Preview domain

https://claude-weekly-quiz-game-3483e1.preview.app.daily.dev

Adds the flag-gated Weekly Quiz feature (web-only): feed banner → modal
with an arcade intro, 3-2-1 countdown, stepped questions with instant
feedback and a standalone stopwatch, and a results screen. Includes the
leaderboard (period tabs, reputation, "Fastest"/"Superstar" chips, pinned
viewer rank), share popover, sounds, the "Play" font, and Storybook stories
with mocked data. Backend GraphQL resolvers are still pending; the client
contract is defined in graphql.ts.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 29, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
daily-webapp Ready Ready Preview Aug 5, 2026 7:45am
storybook Building Building Preview Aug 5, 2026 7:45am

Request Review

Lets the flag-gated, backend-less quiz be tested on a webapp preview:
appending ?weekly-quiz-demo=1 force-enables the banner and makes the
status/quiz/leaderboard hooks return sample/mock data instead of GraphQL
(sticky per session). Temporary — remove once the flag + backend are live.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
A feed-less preview route that opens the quiz modal over a blank page on
sample/mock data (demo mode). Closing (X) resets the run and reopens, so it
can be replayed freely. noindex/nofollow; temporary preview route.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The inner flex row lacked w-full; under the Modal's items-center wrapper it
collapsed to content width (~334px) inside the 74rem modal, squeezing both
panels and overlapping the leaderboard columns.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
74rem rendered too wide on the webapp; 52rem matches the Storybook layout
that was signed off.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…med in a black box

The surface provides its own gradient and rounding; the Modal's default
bg/border/shadow showed as a dark frame around it and behind the side controls.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…o board

The intro gated the pinned viewer row on alreadyPlayed, so a logged-in player
who hadn't played this week never saw their standing. viewerEntry is already
null for anon and for anyone without a standing, so the gate was redundant and
wrongly hid valid ranks. Dropped the showViewerRank prop entirely.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
tomeredlich and others added 5 commits July 29, 2026 15:16
Shift the arcade surface, side controls, and banner from the warm-orange
gradient to the brand onion->cabbage purple so the quiz reads as part of the
app, not a standalone game. Keeps the green Start and warm reward accents for
contrast.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Adds startDate/endDate/storyCount/sourceCount to the quiz contract (+ sample,
query) and renders a date chip and a 'N stories from M sources, distilled into
K questions' line on the intro, so it's clear which week the quiz recaps and
how much news it condenses.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Lift faint text to higher-contrast whites (rank, time, inactive tabs), enlarge
the time column and award badges, and bold every player name so the dense
leaderboard is legible over the vivid surface.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Adds topSources to the quiz contract (+ sample, query) and renders a row of
source chips (logo + name) with a '+N more' count on the intro, so players see
which sources the week's questions are drawn from before they start.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… link

- Rework the shareable result PNG to the daily.dev purple brand: glow, stat
  cards for score/time, a gold rank pill, and a self-explanatory tagline.
- Make the share-link popover reusable (title/description) and add a
  'Challenge your team' action on results that shares the quiz link.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…tart

- Swap in the new daily.dev dog-mascot quiz logo (transparent PNG) and move the
  pulsing lightbulb glow to the bulb's new right/mid position.
- Show top sources as logos only (no names) with a '+N' count.
- Restyle the Start button from green to a purple->orange candy gradient to
  match the new surface.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
tomeredlich and others added 3 commits July 29, 2026 16:12
Swap the placeholder source images for real production daily.dev source logos
and show 5 before the inline '+N', so the count sits on the same row.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Lead the results with the player's own placement ('You placed #N!' + avatar and
a medal rank badge), shorten the leaderboard to a top-5 (full board lives on the
intro), and add a 'Back to main' button that returns to the intro via a new
game.backToIntro action.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Swap the fictional demo/mock names for real daily.dev members from the public
reputation leaderboard (real name/avatar/reputation; quiz scores stay
synthetic) so the preview looks like production during testing. TEMPORARY demo
scaffolding — removed with the rest when the real backend ships.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…k variants

Rebuild the result image: header, level, score, username + avatar, the tier GIF
frame (Giphy exports fine cross-origin), and leaderboard rank. Split into a
createWeeklyQuizResultImage(params, variant) that returns a PNG data URL (1-4
layouts: GIF poster, centered card, split, ticket) with a download wrapper. Add
a 'Share image (4 variants)' story to compare them. Drop the time chip from the
results verdict.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…hare images

Rasterise the daily.dev icon+wordmark SVG to white and draw it in the share
image header (and centered layout) beside the game name; drop the dog mascot.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…r icon

Wire the results Download button to share-image variant 2 (centered card) and
remove the brand icon before 'Play at daily.dev' (now plain centered text;
drops the now-unused brand asset).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…the share image

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
tomeredlich and others added 2 commits August 4, 2026 16:33
…moves into the panel

Add a bare (frameless) surface mode used by the results screen, and render the
daily.dev logo as a header inside the first result panel instead of the shared
top bar. Update the social share copy to 'I got X/Y ... what would you get?'.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Make the two result panels solid (bg-background-subtle) so they read on any
backdrop, and remove the dark block that hugged the results in Storybook — the
result now floats as self-contained cards (over the modal scrim in the app).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
tomeredlich and others added 16 commits August 4, 2026 16:41
Add createWeeklyQuizOgImage — a generic 1200x630 per-score card (daily.dev
header, level, score, percentile, GIF, 'What would you get?') to serve as the
shared link's og:image. Add a 'Social cards (per score)' story rendering all 11
outcomes (0..10). Share copy already updated to 'I got X/Y ... what would you
get?'.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ne-liner, brand header top-left

Redesign createWeeklyQuizOgImage to the simple tier card (per the mockup): a
daily.dev + quiz-title header top-left, the GIF, then the level with its
score-range pill and the one-liner. Drop the percentile, big score number and
the 'what would you get' line (that lives in the share text). Render one card
per level; the 'Social cards (per score)' story now shows the 6 levels.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add a 'Mobile welcome (3 layouts)' story with phone-framed concepts: stacked
(mascot-led), CTA-first (Start above the fold), and immersive (hero + sticky
Start). Exploration mockups.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…creens

Add a 'Mobile screens' story with phone-framed countdown (purple count-in),
question (timer + progress + four tiles) and final (verdict, GIF, share,
leaderboard) mockups in the chosen Layout A style. Exploration mockups.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ong answer/verdict text

Add the daily.dev top bar to the mobile question mock and let long answer tiles
and the results verdict wrap (min-w-0 flex-1) instead of clipping.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… mock

Swap the placeholder text tiles for the actual SocialShareButton icons
(Download, X, WhatsApp, Facebook, Reddit, LinkedIn) so the mobile final mock
matches the web share row.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Mirror the web results screen on the mobile final mock: the two floating
panels, the verdict one-liner, the 'Had fun? Share it!' sticker, the
challenge-a-friend link + copy, the weekly-reminder button, and the gold
highlight on the player's own leaderboard row.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…surface

On mobile the quiz now fills the screen edge-to-edge with no card frame, and
the mute + close controls move inside the top bar (above the mascot) instead
of floating outside the card. Tablet+ keeps the centered card and the external
side column. The modal drops the bottom-drawer treatment for a full-screen
mobile surface.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
On mobile the date chip leaves the top bar (which now holds just the logo +
mute + close) and sits centered above the intro title. Tablet+ keeps it on the
top bar as before.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Paper rain covers the whole mobile screen: sheets spread edge to edge (not
  biased behind the mascot) and fall a full viewport height.
- Countdown gets horizontal padding so its subtitle no longer touches the edges.
- Results screen goes full-bleed on mobile like the intro — same layout, but
  the two panels drop their card chrome and outer padding and fill the screen;
  tablet+ keeps the floating cards.
- Fix results horizontal overflow: min-w-0 on the surface (so the non-wrapping
  share row can't force it wider than the viewport) plus overflow-x-clip to
  contain the confetti drift.
- Tighten the mascot-to-title gap on the mobile intro.
- Storybook Results story now mirrors the full-bleed mobile wrapper + controls.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Multi-word names collapse to their first word on mobile so the rows stay
compact; tablet+ keeps the full name. Single-word names render a single node.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The results brand header now uses the same markup as the intro's top bar —
logo left, mute + close right in one justify-between row with matching padding
and divider — instead of a logo-only header with the controls floating in an
absolute overlay that didn't line up. Controls move into the header row
(mobile) via a headerControls prop; desktop keeps the external side column.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The WhatsApp share previously sent only the bare link (getWhatsappShareLink
dropped the text), so it surfaced the link's generic OG with no invite. Thread
the optional text through so WhatsApp carries a real 'beat my score' invite
before the link; direct callers that pass no text are unchanged.

Also point the quiz share link at https://daily.dev for now — a resolvable URL
with proper link-preview metadata — instead of the not-yet-live quiz path that
returned a 'Page not found' preview. Reword the share text as a game invite.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Pre-render the same premade result card the Download button produces to a File
on mount, and attach it via the Web Share API (navigator.share files) when the
player uses the native Share button — so on mobile it lands as an actual photo
in WhatsApp/etc. instead of a generic link-preview image. Falls back to the
text + link share when file sharing is unsupported.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
SocialShareList gains an opt-in nativeShareFile prop: when set and the device
can share files (mobile), the social buttons open the native share sheet with
the image attached instead of the platform web intent (which can only carry
text + link). Desktop and consumers that don't pass the prop are unchanged.
The quiz results pass the premade result card so tapping WhatsApp/etc. on
mobile sends the image as a photo.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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