Skip to content

docs: generate the screenshots from a docs playground - #1145

Merged
atinux merged 2 commits into
docs/nuxt-comfrom
docs/screenshots
Oct 28, 2026
Merged

atinux merged 2 commits into
docs/nuxt-comfrom
docs/screenshots

Conversation

@atinux

@atinux atinux commented Oct 28, 2026

Copy link
Copy Markdown
Member

Opened by an AI agent (Amp) on behalf of @atinux, as a draft to iterate on. Stacked on #1144.

Generates the docs screenshots instead of taking them by hand.

  • playgrounds/docs: a small shop (pages, components, composables, middleware, server routes, a Nitro task, a shop storage mount, app and runtime config, UnoCSS and VueUse) so every tab has realistic content.
  • pnpm docs:screenshots runs tests/docs-screenshots/screenshots.spec.ts with the e2e fixtures (openDevTools, navigateTab, VITE_DEVTOOLS_DISABLE_CLIENT_AUTH). For each tab it sets up the state the docs show (expands the payload, sends a request in Server Routes, runs the task, records a timeline), captures the Vite DevTools panel and its dock bar at 2x in dark mode, and writes docs/images/<tab>.webp. Chromium encodes the WebP, so no image dependency is added.
  • docs-screenshots workflow (workflow_dispatch): runs the script and opens a PR with the updated images when they changed.
  • The features page gets 6 new screenshots (Payload, Runtime Configs, Timeline, Server Routes, Server Tasks, Storage), and the contribution guide explains how to regenerate them.

Notes

  • Load times, the Nuxt version and timeline offsets change between runs, so every run rewrites the images; the workflow is meant to run after UI changes, not on every push.
  • Tab icons come from the Iconify API. On a cold dev server a fetch can fail and show a warning icon, so the spec checks for it before each capture and retries once.
  • The workflow's gh pr create needs "Allow GitHub Actions to create and approve pull requests" in the repo settings.

Ran pnpm docs:screenshots locally (passes, about 25 s), pnpm lint, pnpm typecheck and pnpm knip (same output as main), and checked the new images render on the nuxt.com dev server.

pnpm docs:screenshots runs tests/docs-screenshots, a Playwright spec on
the e2e fixtures: it opens each DevTools tab of playgrounds/docs (a
small shop with pages, components, server routes, a task and a storage
mount), puts it in the state the docs show, captures the Vite DevTools
panel and writes docs/images/<tab>.webp.

The docs-screenshots workflow runs it from the Actions tab and opens a
pull request when the images changed. The features page gets the six
new screenshots (payload, runtime configs, timeline, server routes,
server tasks, storage).

Amp-Thread-ID: https://ampcode.com/threads/T-01a18296-d1f3-75e5-9fa1-f749b3e3f1fa
Co-authored-by: Sébastien Chopin <atinux@gmail.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Deploying nuxt-devtools with  Cloudflare Pages  Cloudflare Pages

Latest commit: 68f8597
Status:🚫  Build failed.

View logs

The product API now takes 600ms, so useFetch spans its route segment,
and the spec zooms the timeline in before capturing it. The segments
were at their 50px minimum, cutting off the function names.

Amp-Thread-ID: https://ampcode.com/threads/T-01a18296-d1f3-75e5-9fa1-f749b3e3f1fa
Co-authored-by: Sébastien Chopin <atinux@gmail.com>
@atinux
atinux marked this pull request as ready for review October 28, 2026 16:14
@atinux
atinux merged commit d92dd9e into docs/nuxt-com Oct 28, 2026
7 of 10 checks passed
@atinux
atinux deleted the docs/screenshots branch October 28, 2026 16:16
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