Skip to content

feat: add @vercel/og social cards for room links#4

Merged
Uno-Takashi merged 2 commits into
mainfrom
feature/room-ogp
Jun 21, 2026
Merged

feat: add @vercel/og social cards for room links#4
Uno-Takashi merged 2 commits into
mainfrom
feature/room-ogp

Conversation

@Uno-Takashi

Copy link
Copy Markdown
Member

What

Generate per-room Open Graph / Twitter cards for the lobby route (/anime-store/lobby/[roomId]) using next/og (@vercel/og), featuring the anime title saved at room creation, plus complete textual metadata.

Depends on backend (d-party/backend#169) returning title from the lobby API and the extension (d-party/chrome-extension#11) sending it.

Changes

  • OG image: RoomOgImage — a Satori-compatible card component (inline styles), rasterized by opengraph-image.tsx / twitter-image.tsx (shared renderRoomImage). Japanese glyphs via a subsetted Noto Sans JP loaded at request time (Satori has no built-in CJK).
  • Metadata: generateMetadata on the lobby segment — title, description, og:*, twitter:card=summary_large_image, noindex. metadataBase via new SITE_URL env.
  • Storybook: RoomOgImage.stories.tsx previews the card (with title / work-only / long / empty-fallback).
  • API: title added to LobbyRedirect in openapi.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-storybook pass. Verified the OG route renders a 1200×630 PNG (HTTP 200) and that og:/twitter: meta tags are emitted.

🤖 Generated with Claude Code

Uno-Takashi and others added 2 commits June 21, 2026 10:07
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>
@Uno-Takashi Uno-Takashi merged commit d8c3629 into main Jun 21, 2026
1 check passed
@Uno-Takashi Uno-Takashi deleted the feature/room-ogp branch June 21, 2026 10:39
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