Skip to content

Pages: an index of every demo, each at its own path - #56

Merged
mparrett merged 1 commit into
mainfrom
pages/index-mosaic
Oct 11, 2026
Merged

mparrett merged 1 commit into
mainfrom
pages/index-mosaic

Conversation

@mparrett

Copy link
Copy Markdown
Owner

The site root was the mandelbrot demo, microgpt sat at /microgpt/, and pathtrace and ptcanvas weren't deployed. This adds an index page with a screenshot tile per demo and deploys every browser demo at its own path.

Site layout

  • / is a static index (site/index.html): a large mandelbrot tile, then pathtrace, ptcanvas, microgpt, mandelbrot-aot (native, links to its source), and a short "run it locally / source" tile. It's a dark grid that collapses to one column on phones.
  • /mandelbrot/, /pathtrace/, /ptcanvas/ and /microgpt/ each hold the single-file demo and their own coi-serviceworker.js.
  • Old root links with a query (?x=…&zoom=…) redirect to mandelbrot/, so existing start-view links keep working. A bare root link now opens the index.
  • The root keeps a copy of coi-serviceworker.js, so browsers that registered it when mandelbrot lived there keep a valid script.

Screenshots (site/img/, about 480 KB in total) were captured from these builds with let-go v1.13.0 in headless Chromium:

  • mandelbrot at ?x=-0.743643&y=0.131825&zoom=250&maxiter=384;
  • pathtrace and ptcanvas after about 8 minutes of refinement (16 and 21 samples/pixel, so still slightly grainy);
  • the microgpt page;
  • a frame from the existing mandelbrot-aot-zoom.gif.

Checks

  • New test/pages_site_test.py serves _site header-free under /let-go-lab/. It checks that the index's images load, its local links resolve, it doesn't overflow at 1280 or 390px, and the redirect works. It also checks that every demo becomes cross-origin isolated through its own service worker and boots without page errors.
  • pages.yml runs that test before deploying, and now also runs the build and the test on pull requests, without deploying them.
  • Locally (v1.13.0 build): all 7 checks pass. bash -n passes on build-pages.sh; shellcheck isn't installed here.

Adding a browser demo now means adding it to DEMOS in build-pages.sh and test/pages_site_test.py, plus a tile in site/index.html (noted in CLAUDE.md).

🤖 Generated with Claude Code

The site root was the mandelbrot demo, microgpt sat at /microgpt/, and
pathtrace and ptcanvas weren't deployed at all.

- build-pages.sh builds mandelbrot, pathtrace and ptcanvas into
  /<demo>/, each with its own COI service worker, next to /microgpt/.
- site/index.html is a static index: a screenshot tile per demo
  (site/img/, captured from these builds), plus mandelbrot-aot as a
  native tile linking to its source. Old root links with a query
  (?x=…&zoom=…) redirect to mandelbrot/. The root keeps a copy of
  coi-serviceworker.js for browsers that registered it there.
- test/pages_site_test.py serves the site header-free under a project
  subpath and checks the index (images, links, layout, redirect) and
  that every demo isolates through its own service worker and boots
  without page errors. The Pages workflow runs it before deploying and
  now also builds and tests on pull requests, without deploying them.
- README, CLAUDE.md and the microgpt README point at the new paths.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mparrett
mparrett merged commit c829c09 into main Oct 11, 2026
6 checks passed
@mparrett
mparrett deleted the pages/index-mosaic branch October 12, 2026 04:54
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