In-browser virtual-strip preview simulator #14
Labels
No labels
area/ai
area/backend
area/frontend
area/infra
area/scheduler
area/wled
good-first-issue
priority/high
priority/low
priority/medium
type/bug
type/chore
type/ci-cd
type/docs
type/feature
type/qa
v1.0.0
v1.1.0
v1.2.0
v2.0.0
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
rbrooks/Iris-WLED#14
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
Sketch
/json/info).Acceptance criteria
WLED_HOSTconfiguredProposed enhancement (not in the original spec).
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:
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/eslintclean, 107 frontend tests, build succeeds, 761 backend tests, CI green.