Skip to content

Social preview: generator and current slogan - #371

Open
agorischek wants to merge 7 commits into
mainfrom
brand/social-preview-generator
Open

agorischek wants to merge 7 commits into
mainfrom
brand/social-preview-generator

Conversation

@agorischek

@agorischek agorischek commented Dec 4, 2026 •

Copy link
Copy Markdown
Collaborator

What changed

tools/scripts/social-preview.mjs now draws the repository social preview without a browser, and the images carry the current slogan, "Review code changes / without reviewing code".

  • Rendering: the whole scene is one SVG (backdrop, beam and core with feGaussianBlur, seeded dust, lens glow, the two-tone mark at 7×, wordmark and slogan), rasterized by resvg's WebAssembly build (@resvg/resvg-wasm). Playwright is gone from the generator.
  • Font: text is drawn as glyph paths. fontkit reads the vendored variable WOFF2 (packages/renderers/sdk/vendor/fonts/projector-sans.woff2), instances it at wght 400 and 700, shapes each line with its kerning and returns outlines. No extra font binaries, and the font has one source. Satori was dropped: it can't read WOFF2 or apply variable axes, and once the text is glyph paths there's nothing left for it to lay out. Like CSS, the tracked wordmark turns optional ligatures off, so "ti" isn't ligated.
  • Layout: the mark's housing sits on the wordmark's baseline, the lockup and each slogan line are centred on their ink, and the block is centred vertically with a small lift. Baselines and the mark land on whole pixels.
  • Commands: npm run social-preview writes both images. npm run check:social-preview (--check) fails when either is out of date. It's in check:no-test (so CI runs it), and it's registered as a tools gate and a generated output. Every step is JavaScript or WebAssembly, so the bytes don't depend on the machine's CPU, fonts or native libraries.
  • Docs: brand/README.md says the images are generated and that someone must upload the dark one in Settings → Social preview after a change.
  • Dependencies: fontkit (MIT) and @resvg/resvg-wasm (MPL-2.0) are root devDependencies. The lockfile gains only their 9 entries. npm 11.20 reorders this lockfile even with no changes, so I merged the entries into the committed file instead of keeping npm's rewrite.

Evidence

  • npm run social-preview followed by npm run check:social-preview: exit 0. Two renders produced identical bytes.

  • npm run tools -- check --fast: passed after the follow-up fixes (formatting, and a no-shadow lint error). considered passes on the whole tree, and eslint passes on the changed files.

  • npm run tools -- test @githubnext/projections-tools: passed, 167 tests.

  • I viewed both PNGs, including 2.5× crops: the text is crisp, the lockup and slogan are centred, and the beam is soft with no visible banding.

  • Documentation that this change affects is updated, and generated reference
    pages are regenerated (npm run docs:generate).

  • Fixes include a regression test.

  • A changelog fragment at changelog.d/<this PR's number>.md describes what
    users will notice, or the PR has the no changelog label (see
    changelog.d/README.md).

  • No credentials, private source or machine-specific paths are included.

@agorischek agorischek added the no changelog Users won't notice this change: no changelog.d/ fragment needed (changelog.d/README.md) label Dec 4, 2026 — with Copilot SWE Agent
@agorischek
agorischek requested a balanced review from Copilot December 4, 2026 19:50
@agorischek
agorischek force-pushed the brand/social-preview-generator branch from bdc4710 to b44382f Compare December 4, 2026 19:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues remain for the social-preview generator and its freshness-check integration.

No open issues 🎉

What changed in this PR

Adds a browser-free generator for Projections’ social previews using the current slogan and vendored font, with freshness checks integrated into repository tooling.

Changes:

  • Renders dark and light previews using SVG, fontkit glyph outlines, and resvg WebAssembly.
  • Registers generation and freshness-check commands.
  • Documents regeneration and manual upload to GitHub.
File Description
tools/​scripts/​social-preview.mjs Generates previews and checks for stale images.
tools/​cli/​src/​lib/​generated.ts Registers preview outputs and regeneration.
tools/​cli/​src/​lib/​gates.ts Adds the preview freshness gate.
package.json Adds commands, dependencies, and check integration.
package-lock.json Locks rendering dependencies.
brand/​README.md Documents preview generation and upload.

Review effort: Balanced

Base automatically changed from agorischek-ideal-parakeet to main December 5, 2026 01:49
agorischek and others added 6 commits December 4, 2026 17:50
tools/scripts/social-preview.mjs draws brand/social-preview.png (dark) and
brand/social-preview-light.png without a browser: the scene is one SVG,
rasterized by resvg's WebAssembly build, and the text is glyph paths that
fontkit reads from the vendored Projector Sans (a variable WOFF2), instanced
at weights 400 and 700 and shaped with its kerning. Everything is JavaScript
or WebAssembly, so the images are the same bytes on every machine, and
npm run check:social-preview, in check:no-test, fails when they're out of
date. The slogan is now "Review code changes without reviewing code".

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
…d ss05

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
…s a 400px link card

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
…e space between them

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
… rounded to two decimals

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
@agorischek
agorischek force-pushed the brand/social-preview-generator branch from b2a2815 to cd3f7e7 Compare December 5, 2026 01:50
@agorischek
agorischek requested a balanced review from Copilot December 5, 2026 01:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues block the social-preview generation changes.

No open issues 🎉

Review effort: Balanced

…rmat

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no changelog Users won't notice this change: no changelog.d/ fragment needed (changelog.d/README.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants