Frontend: gradient day swatches and a real month backdrop bar (#48) #96
No reviewers
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 milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
rbrooks/Iris-WLED!96
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/gradient-swatches-and-backdrop"
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?
Batch C items 3 and 4 — both visual fidelity against spec §10.1.
Gradient swatches
Each segment strip rendered
seg.colors[0]and threw away slots 1 and 2, so a three-colour scheme looked identical to a one-colour scheme. The spec asks for "one horizontal gradient strip per themed segment, blending that segment's colour slots (matches WLED's own preset thumbnails)".The non-obvious part is black. WLED pads unused colour slots with pure black, and 7 of the 98 colour blocks in
schemes/builtin.yamlend that way — e.g.[[180,0,0],[0,120,45],[255,215,0],[0,0,0]]. Blending naively would drag those swatches to black at the right edge and read as a rendering bug.So trailing pure-black slots are dropped. Interior blacks are kept — a black between two colours may be deliberate — and
[20,20,20]is a real dark rather than padding, so only exact[0,0,0]counts.I checked that against the actual library rather than assuming; the dev database has zero
scheme_segmentsrows (that instance was never configured past scheme generation), sobuiltin.yamlwas the honest source.The logic lives in
segmentGradient()inutils.tsrather than inline in the component, so it's directly testable.Month backdrop
The backdrop rendered as a tint on the month header plus a left border. The spec asks for "a full-width coloured bar behind each month's row".
It now sits behind the day grid, which is where it belongs: day cells carry no background of their own, so the colour shows through and around them — and that's the point, since the backdrop is what those days fall back to. The header keeps a small colour chip so the event stays identifiable beside its name.
Verification
In a
node:22container matching CI:9 new tests — 7 on
segmentGradient(blending, single slot, trailing padding, several trailing blacks, interior black, near-black, empty fallback) and 2 assertingDayCellactually renders a gradient for multi-slot segments and a solid for single-slot.One test caught me out honestly: my first assertion expected
rgb(0, 255, 0)with spaces, but jsdom preserves the exact emitted string, which has none. The implementation was right; the expectation was wrong. Worth mentioning because it's the sort of thing that gets "fixed" in the wrong direction.Note
This branch was cut before #95 merged, so I rebased it onto the updated
mainbefore pushing —DayCell.tsxnow carries both the icon work and the gradient change, and they merged cleanly (different regions of the file).Batch C after this: items 7 (browsable import panel) and 8 (quick-push arbitrary colour) remain.
4f9ec63b6f7875b10f86