Skip to content

docs: add Playwright screenshot suite and quick user guide (#594)#713

Open
grzanka wants to merge 2 commits into
masterfrom
claude/issue-594-screenshots-guide-w3vsw
Open

docs: add Playwright screenshot suite and quick user guide (#594)#713
grzanka wants to merge 2 commits into
masterfrom
claude/issue-594-screenshots-guide-w3vsw

Conversation

@grzanka
Copy link
Copy Markdown
Contributor

@grzanka grzanka commented Jun 5, 2026

First increment toward #594 (automate documentation screenshots with Playwright). Adds the local screenshot tooling, two primary-tool pages captured at desktop + mobile, and a short end-user guide that embeds them.

What's in this PR

  • tests/docs-screenshots.spec.ts — a dedicated screenshot suite capturing the Calculator and Plot pages at desktop (1280×720) and mobile (375×667). Kept outside tests/e2e/ so it never runs in the normal E2E pipeline. Freezes all animations/transitions/caret and masks the dynamic build-info footer (neutral grey) for deterministic, churn-free PNGs.
  • playwright.docs.config.ts + pnpm docs:screenshots — a separate config so the suite is excluded from CI E2E but runnable on demand.
    • Why a separate config rather than the playwright test <file> form suggested in the issue: the default playwright.config.ts restricts discovery to tests/e2e/ (testDir), so an explicit path outside that dir finds no tests.
  • docs/assets/ — four generated screenshots (calculator/plot × desktop/mobile) showing live data (proton in liquid water at 100 MeV → 0.7286 keV/µm, CSDA range 7.721 cm; real stopping-power curve).
  • docs/user-guide.md — a concise two-minute Calculator + Plot tour embedding the screenshots, linked from docs/README.md.
  • Index/log updates: docs/README.md, CHANGELOG-AI.md, docs/ai-logs/.

Notes

  • The screenshots need the WASM engine to render real data. WASM is gitignored, so it is not committed here — the images are regenerated wherever the binaries exist (CI, or a local build via wasm/build.sh).
  • Verified locally: all 4 screenshot tests pass, pnpm format:check clean, ESLint clean on the new files.

Deferred to a follow-up

The GitHub Actions workflow_dispatch job that runs the script and auto-commits refreshed images, plus the "screenshots out of sync" PR check. This local tooling is the prerequisite for both.

https://claude.ai/code/session_01VfY2vhwkrs3vzBaDwzpx9x


Generated by Claude Code

Start automating documentation screenshots with Playwright per issue #594.

- tests/docs-screenshots.spec.ts: dedicated screenshot suite (Calculator +
  Plot at desktop 1280x720 and mobile 375x667), kept outside tests/e2e/ so it
  is excluded from the normal E2E run. Freezes animations and masks the
  dynamic build-info footer for deterministic output.
- playwright.docs.config.ts: separate config + pnpm docs:screenshots script.
- docs/assets/: generated calculator/plot desktop + mobile screenshots.
- docs/user-guide.md: short end-user Calculator + Plot tour embedding them.
- Index updates: docs/README.md, CHANGELOG-AI.md, docs/ai-logs/.

CI auto-commit workflow deferred to a follow-up.

https://claude.ai/code/session_01VfY2vhwkrs3vzBaDwzpx9x
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a dedicated Playwright-driven documentation screenshot suite (kept out of the normal E2E pipeline) plus a short end-user guide that embeds the generated images, along with the required doc indexes / AI logs.

Changes:

  • Introduces a standalone Playwright config + test suite to generate deterministic Calculator/Plot screenshots for docs (pnpm docs:screenshots).
  • Adds a quick user guide page and links it from the docs index.
  • Records the session in CHANGELOG-AI.md and docs/ai-logs/.

Reviewed changes

Copilot reviewed 8 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/docs-screenshots.spec.ts New Playwright spec that navigates to Calculator/Plot and writes deterministic PNGs to docs/assets/.
playwright.docs.config.ts New Playwright config to run only the docs screenshot suite via a dedicated invocation.
package.json Adds docs:screenshots script that runs Playwright with the new config.
docs/user-guide.md New end-user “quick tour” doc embedding the screenshots.
docs/README.md Adds the user guide to the docs index table.
docs/ai-logs/README.md Adds the new session log to the AI logs index.
docs/ai-logs/2026-06-05-issue-594-screenshots-guide.md New detailed AI session log for the work done toward issue #594.
CHANGELOG-AI.md Adds a changelog entry for the session (newest-first).

Comment thread tests/docs-screenshots.spec.ts
Comment thread tests/docs-screenshots.spec.ts
Comment thread playwright.docs.config.ts
- Wait for the real Calculator H1 ("Stopping Power Calculator", exact) and
  match the Plot heading exactly, removing reliance on substring matching.
- Mask only the build-info badge (the "Deployed:" span) instead of the whole
  footer, so the static footer text stays visible and the grey block shrinks.
- Use reuseExistingServer: false in the docs config to match the main
  Playwright config and guarantee screenshots run against a fresh build.
- Regenerate the four screenshots with the narrower mask.

https://claude.ai/code/session_01VfY2vhwkrs3vzBaDwzpx9x
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.

3 participants