feat(site): shareable result card + one-tap share to X - #1
Open
NagaYu wants to merge 5 commits into
Open
Conversation
Renders a ProbeResult as a branded 1200×630 / 1080×1080 card entirely on <canvas> — system fonts, no deps, offline. Shows only ProbeResult fields (same privacy stance as src/report.ts) and builds the short X-intent share text. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Adds Download card / Copy card image (ClipboardItem with download fallback) / Share on X buttons to the existing actions row, a live card preview panel, and OG/Twitter meta pointing at the static og.png. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Generic 1200×630 'probe your browser' hero (not a specific result), referenced by the og:image meta so every shared demo link unfurls. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Asserts the card canvas renders (non-blank, correct dimensions), all three share buttons exist alongside the old actions, the size toggle re-renders at 1080×1080, and the X intent URL carries short text plus the demo URL. CI browser job now generates the site bundle first, same as the Pages deploy. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
roundRect only exists in ~2023+ engines, and this demo is exactly the page people open in old browsers to check WebGPU support. Two guards: an arcTo fallback path (verified pixel-identical output), and a try/catch around card rendering so a drawing failure can never take the probe results display down with it. Co-Authored-By: Claude Fable 5 <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.
What & why
Makes a probe result something people want to post, to drive organic spread. Adds a branded, canvas-rendered result card and a one-tap Share on X, plus a static OG image so every shared demo link unfurls a rich preview. Site-only — no
src/, public API,report.ts,dist/, or quirks-DB changes; no new runtime deps; no telemetry or network calls.Changes
site/share-card.js(new) — renders aProbeResultto<canvas>at 1200×630 (social) and 1080×1080 (square). System fonts only, offline, dark theme matching--bg/--panel/--accent. Shows onlyProbeResultfields (tier badge, hero matmul GFLOPS → shader-compile ms fallback, GPU vendor/arch, browser+OS, wordmark + demo URL). Same privacy stance assrc/report.ts— no UA/screen/locale/fingerprinting. Includes anarcTofallback for engines withoutctx.roundRect(pre-2023).site/index.html/site/main.js— card preview panel, 1200×630 / 1080×1080 size toggle, and three new buttons in the existing.actionsrow (reusing current styles): Download card (1200×630 PNG), Copy card image (ClipboardItem, download fallback + hint where unsupported), Share on X (intent/tweetwith ≤200-char text + demo URL).renderCard()is wrapped in try/catch so a card failure can never take the probe results down with it. Existing Copy report (Markdown) and Download JSON untouched.site/og.png(new) — generic 1200×630 "probe your browser's real WebGPU capability" hero (not a specific result); wired viaog:image/og:title/og:description/twitter:card=summary_large_image. Absolute URL matches the live Pages path.test/browser/share-card.spec.ts(new) +.github/workflows/ci.yml— Playwright smoke tests (card canvas renders non-blank at correct dims, all 3 buttons present alongside the old actions, size toggle re-renders at 1080×1080, X intent URL carries short text + demo URL). CI browser job now runsprepare-site.mjsfirst (same step as the Pages deploy) so/site/has its bundle.Testing
pnpm lint,pnpm typecheck,pnpm build,pnpm sizeall green — core bundle unchanged (4727 B gzip, budget 5120 B);site/isn't in the library bundle.webgpu-full, 40.7 GFLOPS card. TheroundRectfallback path was exercised by deletingctx.roundRectat runtime — output is byte-identical to the native path.Deploy / follow-up (not in this PR)
maintriggers the Pages deploy (pages.yml) that puts the card +og.pnglive.🤖 Generated with Claude Code