In-browser virtual-strip preview simulator #14

Closed
opened 2026-07-07 16:52:17 +00:00 by claude-bot · 1 comment
Contributor

Goal

Let users review and compare schemes visually without a physical WLED device, by rendering an animated virtual LED strip/segment layout in the browser.

Why it's valuable

  • Reviewing/approving schemes today implies either imagination or a live device + preview push. A software simulation makes the year-review workflow usable offline and speeds up bulk approval.
  • Lowers the barrier for new users evaluating Iris before wiring hardware.

Sketch

  • Frontend canvas/WebGL rendering of the configured segments.
  • Approximate a subset of common WLED effects (solid, gradient, wipe, breathe, twinkle) driven by the scheme's effect id + speed/intensity.
  • Reuse the existing scheme JSON; no backend changes required beyond exposing the effect catalog (already cached from /json/info).

Acceptance criteria

  • Selecting a scheme animates a representative virtual strip
  • Segment colors + brightness reflect the scheme
  • Works with no WLED_HOST configured

Proposed enhancement (not in the original spec).

## Goal Let users review and compare schemes visually without a physical WLED device, by rendering an animated virtual LED strip/segment layout in the browser. ## Why it's valuable - Reviewing/approving schemes today implies either imagination or a live device + preview push. A software simulation makes the year-review workflow usable offline and speeds up bulk approval. - Lowers the barrier for new users evaluating Iris before wiring hardware. ## Sketch - Frontend canvas/WebGL rendering of the configured segments. - Approximate a subset of common WLED effects (solid, gradient, wipe, breathe, twinkle) driven by the scheme's effect id + speed/intensity. - Reuse the existing scheme JSON; no backend changes required beyond exposing the effect catalog (already cached from `/json/info`). ## Acceptance criteria - [ ] Selecting a scheme animates a representative virtual strip - [ ] Segment colors + brightness reflect the scheme - [ ] Works with no `WLED_HOST` configured Proposed enhancement (not in the original spec).
claude-bot added this to the v1.1.0 milestone 2026-07-15 15:33:00 +00:00
Author
Contributor

Landed in #134 (squash-merged to main).

Two of the three acceptance criteria already passed — the side panel animated a virtual strip and worked with no WLED_HOST, since nothing in it touches the controller. What was missing was any relationship between the animation and the effect.

The mapping keyed on effect IDs 57, 65, 66 and 9 believing them to be a comet, a wave, traffic lanes and a chase. They are Lightning, Palette, Fire 2012 and Rainbow. Nothing caught it because the only way to check a render loop is to look at it, and a shimmering strip tells you nothing about which effect it claims to be. (The same class of error in the backend became #132.)

Effects are now grouped into twelve families — solid, breathe, wipe, chase, twinkle, sparkle, fire, gradient, rainbow, comet, strobe, aurora — built from the names a real 16.0.0 controller reports and pinned against the captured catalogue.

It approximates; it does not emulate. WLED ships 220 effects, many 2D or audio-reactive. Reproducing them would be a second implementation of someone else's firmware that drifted the moment they changed anything. The narrower goal — a reviewer can tell schemes apart and see roughly what each will look like — is achievable and is what this does. Unmapped IDs animate as a generic shimmer, deliberately moving, since a still frame would read as "solid".

Extracting the maths into a pure function found two real bugs immediately — it had no tests at all before:

  • The wipe was invisible: it sampled the palette at 0.25 and 0.75, which on a two-colour scheme both land mid-blend and return the same purple. The wipe showed only as a brightness step, and the comment claiming it "leaves the new colour behind it" was false.
  • The twinkle was a breathe with holes: every live LED shared one fade, because the fade depended only on time.

One of my own test premises was also wrong. I asserted every non-solid family renders differently at t=0 and t=1.3. Strobe is periodic and happened to be lit at both, so an honest implementation failed. The test now samples six instants and asserts the frames aren't all identical.

Verified: 26 new vitest cases, tsc/eslint clean, 107 frontend tests, build succeeds, 761 backend tests, CI green.

Landed in #134 (squash-merged to `main`). **Two of the three acceptance criteria already passed** — the side panel animated a virtual strip and worked with no `WLED_HOST`, since nothing in it touches the controller. What was missing was any relationship between the animation and the effect. The mapping keyed on effect IDs 57, 65, 66 and 9 believing them to be a comet, a wave, traffic lanes and a chase. They are **Lightning, Palette, Fire 2012 and Rainbow**. Nothing caught it because the only way to check a render loop is to look at it, and a shimmering strip tells you nothing about which effect it claims to be. (The same class of error in the backend became #132.) Effects are now grouped into twelve families — solid, breathe, wipe, chase, twinkle, sparkle, fire, gradient, rainbow, comet, strobe, aurora — built from the names a real 16.0.0 controller reports and pinned against the captured catalogue. **It approximates; it does not emulate.** WLED ships 220 effects, many 2D or audio-reactive. Reproducing them would be a second implementation of someone else's firmware that drifted the moment they changed anything. The narrower goal — a reviewer can tell schemes apart and see roughly what each will look like — is achievable and is what this does. Unmapped IDs animate as a generic shimmer, deliberately *moving*, since a still frame would read as "solid". **Extracting the maths into a pure function found two real bugs immediately** — it had no tests at all before: - The **wipe was invisible**: it sampled the palette at 0.25 and 0.75, which on a two-colour scheme both land mid-blend and return the same purple. The wipe showed only as a brightness step, and the comment claiming it "leaves the new colour behind it" was false. - The **twinkle was a breathe with holes**: every live LED shared one fade, because the fade depended only on time. **One of my own test premises was also wrong.** I asserted every non-solid family renders differently at t=0 and t=1.3. Strobe is periodic and happened to be lit at both, so an honest implementation failed. The test now samples six instants and asserts the frames aren't all identical. Verified: 26 new vitest cases, `tsc`/`eslint` clean, 107 frontend tests, build succeeds, 761 backend tests, CI green.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rbrooks/Iris-WLED#14
No description provided.