Skip to content

feat: contextual OG share-card image generator#6243

Open
rebelchris wants to merge 4 commits into
mainfrom
feat/og-share-cards
Open

feat: contextual OG share-card image generator#6243
rebelchris wants to merge 4 commits into
mainfrom
feat/og-share-cards

Conversation

@rebelchris

@rebelchris rebelchris commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

What

Replaces the Satori (og.daily.dev) Open Graph images with contextual share cards rendered as real webapp pages and screenshotted by daily-api — the same proven pipeline as the DevCard v2 image. Rendering in a real browser (not Satori) means line-clamp, backdrop-blur, real fonts and the design-system tokens all work natively, with none of the Satori workarounds.

Covers every share surface: post (+ ?userid sharer), comment, source, squad (+ invite variant), profile, tag, invite, Plus.

Note: this branch also contains the designer's Storybook review commit (the design spec these cards implement).

How

  • components/image-generator/ShareCard.tsx — the "Layout A" card system (identity eyebrow, headline, and the meta/art slots: engagement bar, stat bar, community face pile, CTA, mascot, tiles).
  • pages/image-generator/share/[type]/[id].tsx — one dynamic page; a per-type loader fetches the entity. Queries only public fields (no @auth/user-scoped fields) so the logged-out scraper can render them.
  • next-seo.tsgetShareImageUrl(type, id, params) helper; repointed og:image for posts (main page), sources and tags at ${API_URL}/og/<type>/<id>.png.

Depends on

The daily-api /og screenshot route: dailydotdev/daily-api#3963.

Test plan

Load the pages directly (eyeball) and via the API (screenshot):

  • /<webapp>/image-generator/share/posts/<id> · ?userid=<userId> for the sharer variant
  • …/share/{comments,sources,squads,profile,tags,invite,plus}/<id>
  • profile renders alongside the existing DevCard-based profile OG so both can be compared.

Follow-ups

  • ⚠️ COMMUNITY_FACES in the page is a 3-avatar placeholder — replace with the final 20 AI-generated avatars hosted on media.daily.dev (per design).
  • og:image wiring for posts/[id]/share and posts/[id]/analytics is deferred: those pages carry pre-existing tsconfig.strict errors, so editing them tripped typecheck:strict:changed. Wiring them (and squad/comment/invite/Plus surfaces) is a small follow-up once that strict debt is addressed.

🤖 Generated with Claude Code

tsahimatsliah and others added 2 commits June 22, 2026 12:59
Adds an "Open Graph" Storybook section auditing daily.dev's outbound link
previews across every share surface (article, shared post, profile/DevCard,
squad, squad invite, source, tag, comment, referral, Plus, homepage) and
proposing a unified "Layout A" recommended template.

- The current column renders the real images daily.dev serves today; the
  recommended column renders the Layout A cover for the same real entity so
  the before/after is apples-to-apples.
- Single source of truth in cover.tsx (Layout A atoms + OgCover); RecommendedOg
  in dailyOgImages.tsx is the adapter every page consumes.
- Includes guidelines/research, an X (Twitter) deep dive, a Satori template
  spec, a benchmark of how the best platforms unfurl, and a link copy/metadata
  page.

Docs/review only — Storybook stories plus one preview.tsx sidebar entry; no
app/runtime code paths are touched.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Render share previews (post, comment, source, squad, profile, tag,
invite, Plus) as real webapp pages that daily-api screenshots — the same
pipeline as the DevCard v2 image — instead of the Satori og.daily.dev
service. Rendering in a real browser means line-clamp, backdrop-blur,
the real fonts and the design-system tokens all work natively.

- components/image-generator/ShareCard: the "Layout A" card system
  (identity eyebrow, headline, engagement/stat/community/CTA meta, art).
- pages/image-generator/share/[type]/[id]: one dynamic page with a
  per-type loader; queries only public fields so the logged-out scraper
  can render them.
- next-seo: getShareImageUrl() helper; repoint og:image for posts
  (incl. ?userid sharer), sources and tags at /api/og/<type>/<id>.png.

Requires the daily-api /og screenshot route (separate PR).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 26, 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 Jun 26, 2026 7:20pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
storybook Ignored Ignored Jun 26, 2026 7:20pm

Request Review

…dirty pages

- coalesce possibly-undefined names/ids to satisfy tsconfig.strict
  (ShareCard identity, sources getShareImageUrl)
- revert the og:image repoint on posts/[id]/analytics and posts/[id]/share:
  those files carry pre-existing strict-typing debt, so touching them tripped
  typecheck:strict:changed. That wiring moves to a follow-up; the new render
  pages + post/source/tag repoints remain.

Co-Authored-By: Claude Opus 4.8 (1M context) <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.

2 participants