feat: add @vercel/og social cards for room links#4
Merged
Conversation
Generate per-room Open Graph / Twitter images for the lobby route via next/og (@vercel/og), showing the anime title saved at room creation, plus full textual metadata (title, description, og:*, twitter card, noindex). Falls back to a generic stylish card when the title is empty (older extension versions / older rooms). - RoomOgImage: Satori-compatible card component, also previewable in Storybook (RoomOgImage.stories.tsx) - opengraph-image / twitter-image routes share renderRoomImage; Japanese glyphs supported via a subsetted Noto Sans JP loaded at request time - generateMetadata on the lobby segment; metadataBase via SITE_URL - openapi: add title to LobbyRedirect + regenerated client Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Convert the OG card palette from the rose/pink placeholder to the actual theme tokens (primary red #fb2c36, neutral dark background, red glow), and replace the play-mark with the d-party logo rendered as the brand app icon (red logo on a black tile). Co-Authored-By: Claude Opus 4.8 <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
Generate per-room Open Graph / Twitter cards for the lobby route (
/anime-store/lobby/[roomId]) usingnext/og(@vercel/og), featuring the anime title saved at room creation, plus complete textual metadata.Depends on backend (d-party/backend#169) returning
titlefrom the lobby API and the extension (d-party/chrome-extension#11) sending it.Changes
RoomOgImage— a Satori-compatible card component (inline styles), rasterized byopengraph-image.tsx/twitter-image.tsx(sharedrenderRoomImage). Japanese glyphs via a subsetted Noto Sans JP loaded at request time (Satori has no built-in CJK).generateMetadataon the lobby segment — title, description,og:*,twitter:card=summary_large_image,noindex.metadataBasevia newSITE_URLenv.RoomOgImage.stories.tsxpreviews the card (with title / work-only / long / empty-fallback).titleadded toLobbyRedirectinopenapi.json+ regenerated orval client.Backward compatibility
Empty/missing title (older rooms or older extension versions) → a generic stylish fallback card and generic meta copy.
Verification
typecheck/lint/build/build-storybookpass. Verified the OG route renders a 1200×630 PNG (HTTP 200) and thatog:/twitter:meta tags are emitted.🤖 Generated with Claude Code