Season preview: play the next 60 days on the virtual strip in a minute #151

Closed
opened 2026-09-26 05:01:08 +00:00 by claude-bot · 2 comments
Collaborator

Problem

Reviewing a season means opening schemes one at a time. Nothing answers "what will the house look like over the next two months?" at a glance. That is the question someone asks in November when deciding whether the schedule is right, and the one a household member asks when they didn't set it up.

What exists to build on

Verified against main:

  • A pure preview renderer: colorAt(segment, scheme, led, time) in frontend/src/components/panel/effectSim.ts. It covers twelve effect families (#14) and has tests. SchemeAnimationPreview draws it on a canvas.
  • Day resolution: GET /api/v1/events/resolved?year= returns primary, secondaries, conflicts and pins for every day, but not schemes.
  • Scheme resolution: GET /api/v1/schemes/for-date/{date} resolves the scheme for one day through the same path as the scheduler (get_events_for_date → resolve_scheme_for_date), including interpolated days (#74).

Design

Backend: GET /api/v1/schemes/for-range?start=&end= returns the resolved scheme for each day in one call, capped at around 120 days. Sixty calls to for-date would work but would be slow and chatty.

  • It reuses the for-date resolver per day; it must not re-implement it.
  • Each day carries what the scheduler will actually do: {date, event, phase, scheme, approved, will_push: "scheme"|"off"|"no_event_default"}. So an unapproved night that will go dark appears dark in the preview, which is the truth, not the colours it would have had.

Frontend: a "Season preview" view.

  • A full-width virtual strip per segment, driven by colorAt.
  • Play: about 1 second per day by default, with a speed control, scrubbing, and ← / → to step.
  • A date and event caption, and a thin timeline under the strip coloured by each day's dominant colour, so the whole season reads as one band.
  • Each "day" can optionally compress the nightly envelope: fade in, full, the late-night dim, off. That makes ramps (#21), dim and the morning window (#52) visible too.
  • Unapproved nights that will go dark are marked, and link to the scheme. This pairs with #149.

Export: "Save as video" (WebM via MediaRecorder on the canvas), so the season can be shared with the household. It's cheap once the canvas exists.

Acceptance

  • for-range agrees with for-date for every day in the range. Test it against interpolated, pinned, conflicting, unapproved and no-event days.
  • Unapproved nights preview as what the scheduler will really push.
  • Play, scrub and step work. Keyboard accessible.
  • Respects prefers-reduced-motion (static per-day swatches instead of animation), and the photosensitivity guard's (#150) effective values once that lands.
  • Works in demo mode, so it is a good first thing to show someone trying Iris (#63).
  • CHANGELOG entry.
## Problem Reviewing a season means opening schemes one at a time. Nothing answers "what will the house look like over the next two months?" at a glance. That is the question someone asks in November when deciding whether the schedule is right, and the one a household member asks when they didn't set it up. ## What exists to build on Verified against `main`: - **A pure preview renderer:** `colorAt(segment, scheme, led, time)` in `frontend/src/components/panel/effectSim.ts`. It covers twelve effect families (#14) and has tests. `SchemeAnimationPreview` draws it on a canvas. - **Day resolution:** `GET /api/v1/events/resolved?year=` returns primary, secondaries, conflicts and pins for every day, but not schemes. - **Scheme resolution:** `GET /api/v1/schemes/for-date/{date}` resolves the scheme for one day through the **same** path as the scheduler (`get_events_for_date` → `resolve_scheme_for_date`), including interpolated days (#74). ## Design **Backend:** `GET /api/v1/schemes/for-range?start=&end=` returns the resolved scheme for each day in one call, capped at around 120 days. Sixty calls to `for-date` would work but would be slow and chatty. - It reuses the `for-date` resolver per day; it must not re-implement it. - Each day carries what the scheduler will actually do: `{date, event, phase, scheme, approved, will_push: "scheme"|"off"|"no_event_default"}`. So an unapproved night that will go dark appears **dark in the preview**, which is the truth, not the colours it would have had. **Frontend:** a "Season preview" view. - A full-width virtual strip per segment, driven by `colorAt`. - **Play**: about 1 second per day by default, with a speed control, scrubbing, and ← / → to step. - A date and event caption, and a thin timeline under the strip coloured by each day's dominant colour, so the whole season reads as one band. - Each "day" can optionally compress the nightly envelope: fade in, full, the late-night dim, off. That makes ramps (#21), dim and the morning window (#52) visible too. - Unapproved nights that will go dark are marked, and link to the scheme. This pairs with #149. **Export:** "Save as video" (WebM via `MediaRecorder` on the canvas), so the season can be shared with the household. It's cheap once the canvas exists. ## Acceptance - [ ] `for-range` agrees with `for-date` for every day in the range. Test it against interpolated, pinned, conflicting, unapproved and no-event days. - [ ] Unapproved nights preview as what the scheduler will really push. - [ ] Play, scrub and step work. Keyboard accessible. - [ ] Respects `prefers-reduced-motion` (static per-day swatches instead of animation), and the photosensitivity guard's (#150) effective values once that lands. - [ ] Works in demo mode, so it is a good first thing to show someone trying Iris (#63). - [ ] CHANGELOG entry.
claude-bot added this to the v1.2.0 milestone 2026-09-26 05:02:37 +00:00
Author
Collaborator

Picking this up. for-range is built on #149's day_plan.plan_for_range, so the preview shows exactly what the on job will push, including dark nights, not a second reading of the calendar. When #150 lands, the preview also shows the guarded effect and speed. It's an additive endpoint plus a new frontend view.

Picking this up. `for-range` is built on #149's `day_plan.plan_for_range`, so the preview shows exactly what the on job will push, including dark nights, not a second reading of the calendar. When #150 lands, the preview also shows the guarded effect and speed. It's an additive endpoint plus a new frontend view.
Author
Collaborator

Done in #172 (squash-merged, CI green).

Delivered:

  • GET /schemes/for-range, built on plan_for_range, so the preview shows exactly what the on job pushes: dark nights, no-event defaults, and #150's slowed or replaced effects, with a caption note.
  • The /season page: play, scrub and step controls, a day-coloured timeline with #149's markers linking to the review queue, an optional "show the night" sketch, WebM export, and a reduced-motion mode.
  • Shared drawing: the canvas drawing is now shared with the side-panel preview.

Verification: every night is checked against plan_for_date across 5 settings combinations, and every serialised scheme against /schemes/for-date. The E2E suite passed 13/13.

Found: #171. The demo seed approves the showcase schemes before they have segments, so those nights preview unlit. The preview is reporting that accurately.

Done in #172 (squash-merged, CI green). **Delivered:** - **`GET /schemes/for-range`,** built on `plan_for_range`, so the preview shows exactly what the on job pushes: dark nights, no-event defaults, and #150's slowed or replaced effects, with a caption note. - **The `/season` page:** play, scrub and step controls, a day-coloured timeline with #149's markers linking to the review queue, an optional "show the night" sketch, WebM export, and a reduced-motion mode. - **Shared drawing:** the canvas drawing is now shared with the side-panel preview. **Verification:** every night is checked against `plan_for_date` across 5 settings combinations, and every serialised scheme against `/schemes/for-date`. The E2E suite passed 13/13. **Found:** #171. The demo seed approves the showcase schemes before they have segments, so those nights preview unlit. The preview is reporting that accurately.
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#151
No description provided.