Skip to content

feat: social cards that show the resume they link to - #85

Open
andrewjiang wants to merge 1 commit into
mainfrom
claude/cv-viewport-scaling-k8hfzz
Open

andrewjiang wants to merge 1 commit into
mainfrom
claude/cv-viewport-scaling-k8hfzz

Conversation

@andrewjiang

Copy link
Copy Markdown
Owner

Every published resume shared the same generic Tiny CV card, so sharing a link to someone's CV previewed as marketing art rather than their resume.

How it works

The card is rendered with the browser renderer that already backs PDF export, not a second renderer:

  • internal/social-card/[slug] is a 1200×630 surface that lays out the real ResumeDesktopSheet on the app's paper background. Because it is the same sheet the published page and the PDF use, a card can never drift from the resume it links to.
  • [slug]/social-card screenshots that surface through withBrowserPage at 2x and returns the PNG.
  • The page is scaled to 1.2 and anchored to the top, so the card shows the head of the resume — name, headline, contact, summary, first role — at a readable size instead of a shrunken full page. It reuses the --cv-stage-scale mechanism added for viewport scaling, so no new scaling machinery.

Caching and failure behavior

  • The card URL carries a version derived from the resume's publish time, so republishing produces a fresh card while unchanged resumes stay cached (s-maxage=604800, stale-while-revalidate=604800).
  • Rate limited under a new social:card action (120/min), consistent with the other browser-backed routes.
  • Anything that stops us rendering the resume itself — no Chromium, no store, rate limited, unknown slug — redirects to the existing generic card with a short TTL, so a preview never looks broken.

Verification

  • End to end against a published resume: GET /<slug>/social-card returns a 2400×1260 PNG with the expected cache headers; an unknown slug returns a 307 to /og-image.png.
  • Metadata on the published page now emits og:image, og:image:width/height/type/alt and the matching twitter:image tags pointing at the versioned card URL.
  • Checked against two style presets (left-aligned serif at fitScale: 1, centered sans at fitScale: 0.9) to confirm the framing holds across templates.
  • pnpm test (112 tests, 4 new), pnpm lint, the design-readiness check, and pnpm build all pass.

Note for deploys: cards need the same Chromium access as PDF jobs (TINYCV_BROWSER_WS_ENDPOINT or TINYCV_CHROME_EXECUTABLE_PATH). Without it published pages keep the generic card. README and the launch checklist are updated to say so.

🤖 Generated with Claude Code

https://claude.ai/code/session_01M7fKRZGJ2XH6E4AXktKRzN


Generated by Claude Code

Every published resume shared the same generic Tiny CV card, so a link to
someone's CV previewed as marketing art rather than their resume.

Render a per-resume card instead, using the browser renderer that already
backs PDF export: an internal 1200x630 surface lays out the real sheet on the
app's paper background, and the card route screenshots it at 2x. Because the
card is the same ResumeDesktopSheet the published page and the PDF use, a card
can never drift from the resume it links to. The page is scaled to 1.2 and
anchored to the top, so the card shows the head of the resume — name, headline,
contact, summary, and the first role — at a readable size instead of a
shrunken full page.

The card URL carries a version derived from the resume's publish time, so a
republished resume gets a fresh card while unchanged ones stay cached at the
edge. Anything that stops us rendering the resume itself — no browser, no
store, rate limited, unknown slug — falls back to the generic card rather than
breaking the preview.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M7fKRZGJ2XH6E4AXktKRzN
@cursor

cursor Bot commented Jul 27, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@vercel

vercel Bot commented Jul 27, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
cvstudio Ready Ready Preview, Comment Jul 27, 2026 8:42pm

Request Review

This branch was successfully deployed

1 active deployment
Preview — ffc0b85e Deployed Jul 27, 2026 by vercel[bot]
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.

2 participants