Skip to content

fix(generate-screenshots): Capture nested example folders, emulate reduced motion, recover from failures - #113

Merged
techniq merged 1 commit into
nextfrom
techniq/nested-example-screenshots
Nov 17, 2026
Merged

techniq merged 1 commit into
nextfrom
techniq/nested-example-screenshots

Conversation

@techniq

@techniq techniq commented Nov 17, 2026

Copy link
Copy Markdown
Owner

generate-screenshots missed every @layerchart/webgl example in LayerChart's docs (see the bot PR techniq/layerchart#1002), and a single slow example failed the run for the rest.

Changes

  • Nested component folders. Examples were only read one folder down, so src/examples/components/webgl/<Component>/*.svelte was seen as an empty webgl component. Any folder holding .svelte files is now a component named by its path (ex. webgl/Points), matching the /screenshots/webgl/Points/… paths ExampleScreenshot already requests. Orphan cleanup walks into these folders too; before, it would have removed screenshots/webgl/ as an unknown component on every run.
  • Reduced motion. The browser context emulates prefers-reduced-motion: reduce. Screenshots are stills, and examples that animate on their own can stop redrawing. In headless Chromium, WebGL is software-rendered (SwiftShader, locally and on CI), so a continuously spinning 300k-point example ran at about 1 fps and its element screenshot never finished.
  • Recover after a failure. A failed example now gets its page replaced, so the next example starts on a fresh page. Before, the busy page made every later example time out or have its navigation interrupted: 1 real failure became 20.

Verified

Ran against the LayerChart docs dev server: 1080 examples, 0 errors, and all 44 webgl examples captured, checked by eye in light and dark mode. LayerChart's two auto-animating examples are updated to respect reduced motion in a separate change.

🤖 Generated with Claude Code

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Deploying layerstack with  Cloudflare Pages  Cloudflare Pages

Latest commit: f6537d6
Status:🚫  Build failed.

View logs

@changeset-bot

changeset-bot Bot commented Nov 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: f6537d6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@layerstack/docs Patch
@layerstack/docs-site Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Nov 17, 2026

Copy link
Copy Markdown

Open in StackBlitz

@layerstack/docs

npm i https://pkg.pr.new/@layerstack/docs@113

@layerstack/svelte-actions

npm i https://pkg.pr.new/@layerstack/svelte-actions@113

@layerstack/svelte-state

npm i https://pkg.pr.new/@layerstack/svelte-state@113

@layerstack/svelte-stores

npm i https://pkg.pr.new/@layerstack/svelte-stores@113

@layerstack/svelte-table

npm i https://pkg.pr.new/@layerstack/svelte-table@113

@layerstack/tailwind

npm i https://pkg.pr.new/@layerstack/tailwind@113

@layerstack/utils

npm i https://pkg.pr.new/@layerstack/utils@113

commit: f6537d6

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor
built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
layerstack ✅ Ready (View Log) Visit Preview f6537d6

@techniq
techniq merged commit fd3e39f into next Nov 17, 2026
5 of 6 checks passed
@techniq
techniq deleted the techniq/nested-example-screenshots branch November 17, 2026 06:18
@github-actions github-actions Bot mentioned this pull request Nov 17, 2026

This branch was successfully deployed

1 active deployment
Preview — f6537d6e Deployed Nov 17, 2026 by github-actions[bot]
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.

1 participant