Repository navigation
Social preview: generator and current slogan - #371
Open
agorischek wants to merge 7 commits into
Open
agorischek wants to merge 7 commits into
agorischek wants to merge 7 commits into
Conversation
agorischek
force-pushed
the
brand/social-preview-generator
branch
from
December 4, 2026 19:51
bdc4710 to
b44382f
Compare
There was a problem hiding this comment.
🟢 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
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
force-pushed
the
brand/social-preview-generator
branch
from
December 5, 2026 01:50
b2a2815 to
cd3f7e7
Compare
…rmat Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This branch has not been deployed
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 changed
tools/scripts/social-preview.mjsnow draws the repository social preview without a browser, and the images carry the current slogan, "Review code changes / without reviewing code".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.packages/renderers/sdk/vendor/fonts/projector-sans.woff2), instances it atwght400 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.npm run social-previewwrites both images.npm run check:social-preview(--check) fails when either is out of date. It's incheck:no-test(so CI runs it), and it's registered as atoolsgate 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.brand/README.mdsays the images are generated and that someone must upload the dark one in Settings → Social preview after a change.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-previewfollowed bynpm run check:social-preview: exit 0. Two renders produced identical bytes.npm run tools -- check --fast: passed after the follow-up fixes (formatting, and ano-shadowlint error).consideredpasses 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>.mddescribes whatusers will notice, or the PR has the
no changeloglabel (seechangelog.d/README.md).
No credentials, private source or machine-specific paths are included.