Skip to content

docs: Generate README marketing screenshots from the docs harness - #252

Merged
Ziinc merged 1 commit into
mainfrom
cursor/readme-marketing-screenshots-66e8
Aug 11, 2026
Merged

docs: Generate README marketing screenshots from the docs harness#252
Ziinc merged 1 commit into
mainfrom
cursor/readme-marketing-screenshots-66e8

Conversation

@Ziinc

@Ziinc Ziinc commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

README marketing images under assets/screenshots/{code,review,commits}.png are now produced by the same Vitest + Chromium screenshot harness used for docs captures (docs-*.spec.tsx).

  • Added scripts/screenshot/specs/readme-{code,review,commits}.spec.tsx plus a shared readme-fixture.ts seed
  • Extended captureDocument with publishTo, deviceScaleFactor, clipSelector, and Chromium path fallbacks so regenerating the specs updates the committed assets
  • Added npm run screenshot:readme and short regenerate notes in the README / contributing docs

Test plan

  • npx vitest run --config vitest.screenshot.config.ts scripts/screenshot/specs/readme-*.spec.tsx
  • Confirmed published PNGs under assets/screenshots/ match capture expectations (Code / Review / Commits, dark mode)
  • Readability check on web/docs/reference/contributing.md
Open in Web Open in Cursor 

Add readme-* Vitest specs (same createTestRepo + Dashboard + captureDocument
path as docs-*) that publish Code/Review/Commits PNGs to assets/screenshots/
via captureDocument publishTo. Extend capture with retina scale, optional
element clips, and Chromium path fallbacks. Wire npm run screenshot:readme.

Co-authored-by: Ziinc <Ziinc@users.noreply.github.com>
await captureDocument(document, {
name: "readme-code",
deviceScaleFactor: 2,
publishTo: path.join(README_SCREENSHOTS_DIR, "code.png"),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Same shape as docs-create-pr-dropdown.spec.tsx: real repo + Dashboard + captureDocument, with publishTo aiming at the README asset path instead of a docs crop.

  • Three specs (code / review / commits) so each marketing image can be regenerated alone
  • Dark mode forced before capture to match the existing README look

Comment thread package.json
"test": "DEBUG_PRINT_LIMIT=50 vitest run",
"screenshot:css": "node scripts/screenshot/build-css.mjs",
"screenshot": "npm run build:napi --silent && npm run screenshot:css && vitest run --config vitest.screenshot.config.ts",
"screenshot:readme": "npm run build:napi --silent && npm run screenshot:css && vitest run --config vitest.screenshot.config.ts scripts/screenshot/specs/readme-*.spec.tsx",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

screenshot:readme is a thin filter over the existing screenshot pipeline (napi + CSS + vitest) so regenerating marketing assets does not require running every QA spec.

expectations,
scrollIntoView,
} = options;
const {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

publishTo / deviceScaleFactor / clipSelector close the docs → committed-asset gap: specs already wrote .generated/, but README/docs PNGs needed a second manual copy.

  • publishTo makes npm run screenshot:readme update assets/screenshots/ in one step
  • Retina deviceScaleFactor: 2 matches the prior marketing asset resolution
  • Chromium path fallback covers cloud agents without /opt/pw-browsers/...

);
});
});
`;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Shared seed intentionally skips home-repo commits before workspace creation.

  • Committing on the default branch first left the target bookmark conflicted (Name … is conflicted), so Review could not resolve the revset
  • Sidebar workspaces are created first on a clean tip, then only the marketing workspace commits

@github-actions

Copy link
Copy Markdown
Contributor

@Ziinc Ziinc changed the title Generate README marketing screenshots from the docs harness docs: Generate README marketing screenshots from the docs harness Aug 11, 2026
@Ziinc
Ziinc marked this pull request as ready for review August 11, 2026 07:30
@Ziinc
Ziinc merged commit 7021952 into main Aug 11, 2026
14 of 15 checks passed
@Ziinc
Ziinc deleted the cursor/readme-marketing-screenshots-66e8 branch August 11, 2026 07:30
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.

2 participants