Progressive HSV phase interpolation for multi-day events (spec §4.2) #74
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#74
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?
Target milestone: v1.1.0 (deferred from v1.0.0 #9).
Implement optional per-event HSV color interpolation across
eve → opening → mid → closingat generation time, per spec §4.2. The current generator emits one independent scheme per phase (scheme_generator.generate_schemes_for_event), which is a different model from the interpolated per-day presets §4.2 describes.Requires:
phase_config(e.g.interpolate: true).The gap is documented inline in
backend/app/services/scheme_generator.py(deferred note from #9). Split out of #9 during the v1.0.0 push so v1 scope stayed honest (implemented-or-explicitly-deferred).Landed in #128 (squash-merged to
main).The design question turned out not to be the colour maths — it was what a human approves. Interpolation wants a scheme per day; the review queue wants a scheme per phase, and twenty-six approvable rows for one holiday would make it unusable. So the four phase schemes stay the anchors (listed, edited, approved) and the per-day rows are derived: rebuilt whenever an anchor changes, carrying
schemes.derived_from, filtered out of the review list, preset sync and config export.A derived day is approved only when every anchor it blends is approved. Falling back to the plain anchor colours on a half-approved event would light the tree in something the user never signed off on because a different scheme was approved.
On the issue's four requirements:
phase_config.interpolate, off by default.colorsysreports white as hue 0, which reads as red).GET /schemes/for-date/{date}returns what will actually light on a day, and the side panel previews that instead of the anchor. It resolves through the same helper the scheduler uses, so the preview and the push cannot disagree — the drift #93 fixed once already.One thing deliberately not done:
effect_idandpalettedon't interpolate. Effect 26 is not halfway between 12 and 40, it's an unrelated animation. They step to the nearer anchor at the midpoint.Writing the tests found a real bug.
sync_derived_schemesoriginally read anchor colours offscheme.segments, butgenerate_schemes_for_eventrebuilds those rows withdb.add(SchemeSegment(...))rather than through the relationship — so the loaded collection can still hold the previous generation's values. It would have blended between colours no longer anchored anywhere, and looked entirely plausible. It now queries the rows directly. Three of my own tests were passing because of that staleness and were corrected too.Verified:
ruff/mypyclean, 654 backend tests,alembic upgrade/check/downgradeon a fresh DB, frontendtsc/eslint/81 vitest/build innode:22, CI green.