Skip to content

feat(www): social cards in the site's light theme - #7820

Merged
kodiakhq[bot] merged 2 commits into
mainfrom
cursor/www-og-light-cards-55df
Nov 2, 2026
Merged

kodiakhq[bot] merged 2 commits into
mainfrom
cursor/www-og-light-cards-55df

Conversation

@KATT

@KATT KATT commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Why

  • The social cards (og:image) are dark with a diagonal pattern. The site's default look is light: white, the home page's dot grid, and the brand blue.
  • This brings the light card design from #7799 to main on its own. It keeps today's logo and brand colours: nothing from #7778 and no theme token changes.

What

Only www/src/og/ changes.

  • Look:
    • A white background with the home page's dot grid and a soft glow in the brand blue.
    • A bar along the bottom, from --brand-dark to --brand-light.
  • Header:
    • The current wordmark (public/img/logo-text-black.svg) at the top left.
    • The section in a pill at the top right: Docs, Docs Β· v10, API reference, Blog, Sponsor, Media or Search.
  • Colours: all are the light theme's current tokens. A test reads @shared/ui/theme.css and fails if the card colours drift from it.
    • Text is --foreground and --muted-foreground.
    • The home subtitle is --brand (#398ccb, large text).
    • Dates, pill labels and URLs are --brand-dark (#2e77af, 4.8:1 on white).
  • Home card: a large wordmark, the tagline, and the live GitHub stars and npm weekly downloads, with labels.
  • Docs and other pages: the title, the description and the URL.
    • Long titles get smaller, and long words wrap.
    • Long API reference titles drop their type parameters: Interface: TRPCProcedureBuilder<…>.
    • A page with no description, or one that only repeats the title, shows the site's subtitle.
  • Posts: the date and reading time, the title, the description, and each author's round avatar with their name and title.
    • SVG avatars now load, so the tRPC team's posts show the logo instead of a "T".
    • An SVG that satori can't size shows initials instead of failing the card. That's one with no viewBox and no width and height in pixels, such as <svg/>. It was CodeRabbit's finding on feat(www): light social cards, and the site's blue with AA shadesΒ #7799.
    • An avatar that fails to load still shows initials on the brand blue.
  • Removed: pattern.svg, the old diagonal pattern.
  • Unchanged: the URLs (/og/<page path>.png), og:image on the preview's own host, the live data and its timeouts, caching, and the 404 for an unknown card.
  • Dark mode: none. A card is one PNG per page, and sites that show it don't ask for a light or dark version.

Before and after

Before is main. After is this PR. Rendered locally from the dev server, with live stars, downloads and avatars.

Home

Home card before Home card after

Docs: Quickstart

Docs card before Docs card after

Post with two authors' avatars

Post card before Post card after

Post by the tRPC team (SVG avatar)

Team post card before Team post card after

API reference, with a long title (after only)

API reference card after

Links

Alternatives considered

Testing

  • www tests pass (247). New tests cover:
    • the section label, shortened API titles, the description fallback and title sizes;
    • the card colours matching theme.css;
    • SVG avatars, including a fetch-to-render test where <svg/> falls back to initials and an SVG with a viewBox is drawn;
    • rendering the longest API reference title.
  • Before the fix, I reproduced the bug: a post card with a <svg/> avatar made satori throw missing "viewBox".
  • pnpm lint, typecheck and oxfmt --check pass in www.
  • pnpm build in www passes. The build's old-URL check: "All 698 of trpc.io's URLs work".
  • In the built _ssr function:
    • the home, v10 doc, two post and sponsor cards return 200 PNGs with the same cache headers as main;
    • an unknown card returns 404.
Open in WebΒ Open in CursorΒ 

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

Summary by CodeRabbit

  • New Features
    • Refreshed social preview cards with a light theme, dot-grid background, blue accents, and an updated wordmark.
    • Revised home, documentation, and post card layouts to display titles, descriptions, labels, dates, reading times, authors, and statistics.
    • Social previews can display SVG avatars when the images have valid dimensions.
  • Improvements
    • Documentation card descriptions use a fallback when empty or identical to the title, and titles are sized to fit.

…ogo and blues, and SVG author avatars that fall back to initials when satori can't size them

Co-authored-by: alexander <[email protected]>
@KATT
KATT requested a review from a team as a code owner November 2, 2026 15:05
@vercel

vercel Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
www Ready Ready Preview Nov 2, 2026 3:17pm UTC
6 Skipped Deployments
Project Deployment Actions Updated
examples-next-minimal-starter Skipped Skipped Nov 2, 2026 3:17pm UTC
examples-todomvc Skipped Skipped Nov 2, 2026 3:17pm UTC
next-prisma-starter Skipped Skipped Nov 2, 2026 3:17pm UTC
next-prisma-websockets-starter Skipped Skipped Nov 2, 2026 3:17pm UTC
tanstack-start-sse-chat Skipped Skipped Nov 2, 2026 3:17pm UTC
trpc-next-app-dir Skipped Skipped Nov 2, 2026 3:17pm UTC

Request Review

@cursor

cursor Bot commented Nov 2, 2026

Copy link
Copy Markdown

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack β†’

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 47c12b4 and 1eac0ee.

Files selected for processing: 2
  • www/src/og/live.test.ts
  • www/src/og/live.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.

Walkthrough

OG cards now use a light design with page-specific content and a wordmark. Avatar fetching accepts SVG images when they contain valid dimensions; otherwise, it omits them.

Changes: OG Cards

Layer / File(s) Summary
Shared card design and assets
www/src/og/card.ts, www/src/og/render.ts, www/src/og/card.test.ts
The shared frame uses light-theme colors, a dot grid, and a wordmark. The renderer supplies the wordmark and dot-grid assets, and tests compare exported colors with theme tokens.
Page-specific card content
www/src/og/card.ts, www/src/og/card.test.ts, www/src/og/render.test.ts
Home, documentation, and post cards use updated layouts and content formatting. New helper tests and card fixtures cover labels, titles, descriptions, sizing, and card rendering.
SVG avatar validation
www/src/og/live.ts, www/src/og/live.test.ts, www/src/og/render.test.ts
Avatar fetching accepts SVG responses with valid dimensions and omits SVGs without them. Tests cover dimension validation and rendered PNG output.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Possibly related PRs

  • trpc/trpc#7799: Implements the same light social-card redesign and SVG avatar handling in the OG card code.
  • trpc/trpc#7778: Adds the website wordmark asset imported by the OG renderer.

Suggested reviewers: nick-lucas

Merge Risk: Minimal Β· up to 1eac0

The light card redesign has no identified merge-blocking issue.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: updating the site's social cards to use the light theme.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 6 files.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix Β· Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@coderabbitai coderabbitai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Fix comments: Fix CodeRabbit comments on this PR

Comment thread www/src/og/live.ts Resolved
…ize or its viewBox's ratio, falls back to initials too

Co-authored-by: alexander <[email protected]>
@vercel
vercel Bot temporarily deployed to Preview – examples-next-minimal-starter November 2, 2026 15:16 Inactive
@vercel
vercel Bot temporarily deployed to Preview – trpc-next-app-dir November 2, 2026 15:16 Inactive
@vercel
vercel Bot temporarily deployed to Preview – examples-todomvc November 2, 2026 15:16 Inactive
@vercel
vercel Bot temporarily deployed to Preview – next-prisma-starter November 2, 2026 15:16 Inactive
@pkg-pr-new

pkg-pr-new Bot commented Nov 2, 2026

Copy link
Copy Markdown

Open in StackBlitz

@trpc/client

npm i https://pkg.pr.new/@trpc/client@7820

@trpc/next

npm i https://pkg.pr.new/@trpc/next@7820

@trpc/openapi

npm i https://pkg.pr.new/@trpc/openapi@7820

@trpc/react-query

npm i https://pkg.pr.new/@trpc/react-query@7820

@trpc/server

npm i https://pkg.pr.new/@trpc/server@7820

@trpc/tanstack-react-query

npm i https://pkg.pr.new/@trpc/tanstack-react-query@7820

@trpc/upgrade

npm i https://pkg.pr.new/@trpc/upgrade@7820

commit: 1eac0ee

@trpc-bot trpc-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All 33 required checks pass at 1eac0ee, and CodeRabbit's one finding (an SVG avatar sized to zero) is fixed and resolved. Approving.

@KATT KATT added the πŸš€ merge label Nov 2, 2026 — with Cursor
@kodiakhq
kodiakhq Bot added this pull request to the merge queue Nov 2, 2026
Merged via the queue into main with commit 2d44bde Nov 2, 2026
53 checks passed
@kodiakhq
kodiakhq Bot deleted the cursor/www-og-light-cards-55df branch November 2, 2026 15:46
meefs pushed a commit to meefs/trpc that referenced this pull request Nov 2, 2026
<!-- CURSOR_AGENT_PR_BODY_BEGIN -->
Builds on [trpc#7820](trpc#7820) (light social
cards), now merged. This diff is only the sponsor card.

## Why

- `/sponsor`'s social card is a plain doc card: the headline and a line
of text. It doesn't show who sponsors tRPC, or ask anyone to.
- A shared sponsor link should show the people and companies behind
tRPC, and say how to join them.

## What

- **A `sponsor` card** (`www/src/og/card.ts`), in trpc#7820's light style
with `main`'s logo and blues:
- The wordmark, and a filled **β™₯ Sponsor tRPC** button where other cards
have their section pill. It's `--brand` like the site's buttons: white
on it is 3.63:1, AA for 28px bold.
- The page's headline, and "MIT licensed, and kept going by 20
sponsors."
- **Partners** (Silver and up), by rank: each one's avatar, name and
tier, such as "Silver partner". Up to 4 fit.
- **The other sponsors**, most given first: a row of 12 overlapping
avatars, then a count of the rest (`+5`).
  - `github.com/sponsors/trpc` in the link blue.
- **The data** comes from `sponsors.json`, through `sponsorCard` in
`www/src/sponsors.ts`, so the card follows the next sponsor sync.
Partners past the fourth join the avatar row.
- **Avatars** use the same fetching as post authors'
(`www/src/og/live.ts`): GitHub avatars at 128px, a 4s timeout, and SVGs
only if Satori can size them. One that doesn't load shows initials on
the brand blue, and the card is cached for 10 minutes instead of as a
page, so the next request tries again.
- **Wired to `/sponsor`:** `vite.config.ts` registers the card in place
of the doc card. `og:image` and `twitter:image` stay `/og/sponsor.png`.
The alt text now ends with "Sponsor at github.com/sponsors/trpc."

### Before and after

Before is trpc#7820. After is this PR, with live avatars.

![Sponsor card
before](https://cursor.com/artifacts/c/art-ee4dd367-6317-44eb-b6bf-a6f62b120073)
![Sponsor card
after](https://cursor.com/artifacts/c/art-117ea4e9-4fcd-481e-bee6-43872967dee1)

With no avatar loaded, everyone shows initials:

![Sponsor card with initials for every
avatar](https://cursor.com/artifacts/c/art-89d8c67b-8e85-4227-8159-7de3d08b020c)

## Links

-
[Sponsor](https://www-git-cursor-www-og-sponsor-card-55df-trpc.vercel.app/sponsor):
the
[card](https://www-git-cursor-www-og-sponsor-card-55df-trpc.vercel.app/og/sponsor.png),
with partners, sponsors' avatars and the Sponsor tRPC button.

## Alternatives considered

- **Partner logos instead of avatars:** the site draws partners'
wordmarks as React components (`partner-logos.tsx`). Each would need
porting to Satori, and a new partner's logo would be missing until
someone draws it. Avatars come with every sponsor.
- **The whole sponsor cloud:** 20 bubbles sized by giving don't read at
the size a card is shown. Two rows, with the partners named, do.
- **The page's pink heart and glow:** this PR keeps to the brand blues,
like the other cards.

## Testing

- `www` tests pass (258). New tests cover:
- `sponsorCard`: partners first by rank, with their tier; the others by
what they've given; and the count adding up to every sponsor, with none
twice;
  - the alt text;
  - rendering the sponsor card;
- a fetch-to-render test where every avatar is an unsizable `<svg/>`,
which falls back to initials;
- `fetchLive` fetching each sponsor's avatar, and the 10-minute cache
when one fails.
- `pnpm lint`, typecheck and `oxfmt --check` pass in `www`.
- `pnpm build` passes ("All 698 of trpc.io's URLs work").
- In the built `_ssr` function, `/og/sponsor.png` returns a 200 PNG. The
other cards are unchanged.
- The built `/sponsor` page has `og:image` and `twitter:image` at
`/og/sponsor.png`, and the new alt text.
- Rebased onto `main` after trpc#7820 merged: tests, lint and typecheck pass
again.
<!-- CURSOR_AGENT_PR_BODY_END -->

<div><a
href="https://cursor.com/agents/bc-6f5c802a-e6b6-56e6-9da7-69eddc4455df?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a
href="https://cursor.com/background-agent?bcId=bc-6f5c802a-e6b6-56e6-9da7-69eddc4455df&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img
alt="Open in Cursor" width="131" height="28"
src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</div>

<!-- codesmith:footer -->
---
<a
href="https://app.blacksmith.sh/trpc/codesmith/trpc/pr/7821?autoLogin=true&ref=codesmith_pr_footer"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v3.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-light-v3.svg"><img
alt="View with [code]smith"
src="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v3-3x.png"
width="162" height="28"></picture></a> <a
href="https://backend.blacksmith.sh/track/enable-autofix?expires=1796224722&installation_model_id=443568&pr_number=7821&ref=codesmith_pr_footer&repository=trpc%2Ftrpc&return_to=https%3A%2F%2Fgithub.com%2Ftrpc%2Ftrpc%2Fpull%2F7821&signature=56c0816fa09ca7ecebe96809f3718ee913230a9dae07e55d366f5ca2d78c75fa"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-light.svg"><img
alt="Autofix with [code]smith"
src="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png"
width="190" height="28"></picture></a>
<sup>Need help on this PR? Tag <code>@codesmith-bot</code> with what you
need.</sup>

<!-- codesmith:autofix:disabled -->
<!-- /codesmith:footer -->

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **New Features**
* Sponsor pages now have a dedicated social-sharing card featuring
partner tiers, backer avatars, and a count of additional sponsors.
* The card highlights up to four partners and twelve backers, with
remaining sponsors prioritized by ranking. It includes a link to the
sponsor page and displays names or initials when profile images are
unavailable.
* **Bug Fixes**
* Social-sharing images continue to render at the expected size when
sponsor or author avatars lack image dimensions.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Cursor Agent <[email protected]>
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

This pull request has been locked because we are very unlikely to see comments on closed issues. If you think, this PR is still necessary, create a new one with the same branch. Thank you.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Nov 3, 2026

This branch was successfully deployed

1 active and 4 inactive deployments
Preview – www β€” 1eac0ee4 Deployed Nov 2, 2026 by vercel[bot]
Preview – examples-next-minimal-starter β€” 1eac0ee4 Deployed Nov 2, 2026 by vercel[bot]
Preview – trpc-next-app-dir β€” 1eac0ee4 Deployed Nov 2, 2026 by vercel[bot]
Preview – next-prisma-starter β€” 1eac0ee4 Deployed Nov 2, 2026 by vercel[bot]
Preview – examples-todomvc β€” 1eac0ee4 Deployed Nov 2, 2026 by vercel[bot]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants