Repository navigation
Draw the probe field and scan band with WebGPU - #57
Conversation
A small renderer of our own (one WGSL fragment shader, ~2 KB gzipped) draws the home page's dot field, with a lens of signal dots following the cursor, and the running scan's dot strip, with a signal band sweeping across. Each effect renders its CSS version first and loads the renderer lazily, only with WebGPU, no reduced motion, no data saving, and for the lens a mouse. If the GPU can't start or goes away, the CSS version stays. Colours come from the theme tokens and follow light/dark. Finished reports don't load it. We tried the shaders package first; it bundles all ~200 of its effects (~720 KB gzipped) and reports visitors' user agents by default, so the ui-shaders skill now describes our renderer instead. Closes #54 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Product review: Probe field on home and scan band on running scans, drawn with WebGPU✅ Delivers ticket #54 — 5 of 5 outcomes What was promised
Proof Tests worked out by Drippa from ticket #54, the pull request description and the code change — none written by hand. Test it yourself (7 steps)Page change — click through it on this pull request's preview. Before you start
DetailsThe home headline gets a dot grid whose dots light up green near the cursor. The running-scan page gets a strip of dots with a green band sweeping back and forth. Both always show the still dot pattern first. The live version fades in only on browsers with WebGPU, no reduced-motion setting and no data-saver, and the home effect also needs a mouse. If the graphics card fails, the page falls back to the still pattern. The renderer is loaded only when it can run, and it follows light and dark mode. Test coverage: 🔍 Checked: 🎫 Linked to drippa-ai/stackprobe#54 — compared diff against ticket Updated by Drippa • 2026-10-07 18:39 UTC Comment |
Closes #54
Covers all five "Done when" lines of #54 (issue updated with the agreed scope change: our own renderer instead of the
shaderspackage; the static version on touch devices).What changes
effects/dot-field.ts: our WebGPU renderer. One full-screen WGSL fragment shader draws the dot grid and turns dots signal-coloured inside a soft lens (follows the cursor with lag) or band (eases from one end to the other and back, 2.4 s each way). Opaque canvas in the colour behind it, buffer capped at 2× DPR, stops off screen, the lens only draws while moving. 2.3 KB gzipped.effects/gate.ts:useShaderAllowed(WebGPU adapter, no reduced motion, no save-data, a mouse for the lens; listens for changes) anduseTokenColors(oklch tokens → hex, follows light/dark).effects/probe-field.tsx,effects/scan-band.tsx: render the CSS version on the server, loaddot-canvas.tsxwithnext/dynamiconce allowed, fade the canvas in after its first frame, and drop it if the GPU fails or is lost.ui-shadersskill rewritten for our renderer (where it lives, the rules, how to check), including why we don't use the package.@webgpu/types(dev only): TypeScript 7's DOM library doesn't include the WebGPU types.Why not the
shaderspackageTried first, working and verified, then dropped (agreed in the session): its engine imports all ~200 effects, so the chunk was 2.5 MB (~720 KB gzipped). It also reports the visitor's user agent and our hostname to shaders.com unless
disableTelemetryis set.UI review
Production build (
next start) against a throwaway PGlite database seeded with replayed fixture scans; headless Chromium with WebGPU on Metal.onUnavailablefires and the static version stays./s/drippa.ai) doesn't fetch the renderer; home and the running page do. No requests to other hosts.ui-reviewscreenshots for home and the running page at 390 px and 1280 px, light and dark and reduced motion: no sideways scroll.pnpm lint,pnpm typecheck,pnpm test(347 passing),pnpm buildpass.🤖 Generated with Claude Code