Skip to content

Room panel and website 1.0: new website, Legacy on demand, simpler recovery - #6

Draft
diyanko wants to merge 140 commits into
mainfrom
release/1.0
Draft

diyanko wants to merge 140 commits into
mainfrom
release/1.0

Conversation

@diyanko

@diyanko diyanko commented Nov 10, 2026

Copy link
Copy Markdown
Member

What changes for room users

  • New room website (phone, tablet, desktop): Home · Lights · Guide · Settings, styled like the touch panel (flat grey buttons, current page shown dark), a status chip that always says what the room connection is doing, plain sentences for what the lights are now, the ceiling map one sensor family at a time, and Settings with System checks, maintenance steps and a guarded panel restart. Follows the visitor's own light/dark setting. Taps are never lost while the page refreshes; a command whose reply is lost releases after 20 s instead of locking the page.
  • Legacy opens only when asked. It no longer runs hidden behind Beta (where it once took taps meant for Beta). Back to Home closes it, stops Sun/Circ and confirms the lights.
  • One way out of "uncertain": Check connection stops programmes and confirms stable settings, then returns to Ready. No staff socket needed.
  • Experiment mode, instruction profiles, annotations and the experiment lighting reservation are removed (unused; recorder never connected).
  • Pi power wording now says plainly when under-voltage happened.
  • One design system: colours, type sizes and spacing live in app/design_tokens.py, which also generates browser/tokens.css for the website.

Still to come on this branch: the Tk panel redesign (left rail, same look as the website) and the audit's reliability fixes (programme stop after a helper restart, Check connection adopting its readback, duplicate-write suppression, log rotation, gateway receipts/threading, shutdown panel-only, deleting the old website files). Both are in progress.

Supersedes #1, #3, #4 and #5.

Evidence

  • Deployed to the room panel and tested live: Lights on/off, Sat/Fid scenes, white-light steps and Check connection each confirmed in 0.8–2 s from the website; Legacy open 1.6 s, return to Ready 5 s with the Legacy process gone; a panel-initiated Pi restart came back Ready with lights unchanged.
  • Every deploy checked the panel was idle, read all ten fixtures before and after (unchanged), sent no light commands and kept a rollback.
  • Local suite: 467 passed, 5 skipped (POSIX-only), 2 known Windows long-path errors; one gateway timing test is flaky under the single-threaded server (fixed by the pending gateway change).
  • The Pi still reports under-voltage (throttled=0x50005 right after boot): replace the supply/cable.

🤖 Generated with Claude Code

diyanko and others added 25 commits October 30, 2026 20:30
Explain how to mark an event instead of retaining a reset message under resumed instructions. Keep the recorder warning in its main banner and preserve actual progress and error messages.
Room users: taps on Beta can no longer press the hidden original app's
buttons (Sun, Fid, Off...), and a lighting change that cannot be confirmed
no longer locks the panel for staff. Beta re-reads the lights and controls
come back. Lights changed outside the panel are accepted as they are.

- Legacy stays withdrawn while Beta covers the screen and shows itself
  again if Beta stops sending its cover signal for 5 s.
- Manual changes stop Sun/Circ only when a programme may be running, so a
  slow Status service cannot fail an ordinary Lights off.
- Everyday command state is kept in memory, so presses no longer wait for
  an SD card save. Experiment and Legacy handoffs stay durable and guarded.
- Status requests get 5 s instead of 3 s. Version 0.2.20.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Guides, README, WORKFLOWS and the interface notes no longer tell room users
to stop and ask staff after an ordinary unconfirmed change; they explain that
the panel reads the lights again. Handoff wording is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Room users no longer see Experiment mode, instruction profiles or annotation
buttons on the panel or website; nothing in the room used them and the recorder
was never connected. The private reserve/heartbeat/finish/recover lighting
handoff is gone too. Everything else behaves as before.

- Deletes app/lighting_handoff.py, the profile validator, instruction timer,
  annotation journal path, profile upload, and every guard that only existed
  for running instructions or a reservation.
- An older saved "reserved"/"releasing" lighting state now loads as uncertain
  instead of a storage error.

Tests: 498 passed, 6 skipped (POSIX-only), 2 known Windows long-path errors.
Known gap, fixed with the next Legacy change: an interrupted Legacy return
restarts as uncertain with no on-panel way to clear it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Visitors and staff get the redesigned website: the same four places on phone
(bottom bar) and laptop (left rail), a status chip that always says what the
room connection is doing, plain sentences for what the lights are now, the
ceiling map one sensor family at a time (turned to portrait on phones), and
Settings with System checks, maintenance steps and a guarded panel restart.
The website follows the visitor's own light/dark setting.

- browser/js: api.js (only code that talks to the panel; one command at a time,
  never resent; an unconfirmed command releases after 20 s instead of locking
  the page), ui.js, pages.js, main.js. browser/app.css replaces room.css.
- Pi power wording now says "Under-voltage happened since the last restart"
  instead of the ambiguous "No current undervoltage / past warning since boot",
  plus a power_warning flag.
- The exporter publishes every Lucide icon by name.

The old room.js stays on disk until the Legacy change lands, then goes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The page now updates in place instead of being rebuilt every poll, and it
waits while a finger is down, so a button can't vanish between press and
release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Legacy (the original app) no longer runs hidden behind Beta, so it can't take
taps meant for Beta. Opening Legacy starts it; Back to Home closes it, stops
Sun/Circ and confirms the lights before everyday controls return. If anything
is left uncertain (a lost reply, a crash mid-return), Check connection now does
that same stop-and-confirm and returns to Ready; no staff socket is needed.

- Deletes the cover signals, Tk probe, log checks and app/original_idle.py.
- The launcher no longer starts Legacy at boot; Beta passes the classic
  interpreter and directory and tracks its child by PID file.
- Recovery states shrink to normal / uncertain / legacy.

Tests: 467 passed, 5 skipped; one gateway timing test flaked in the full run
and passes alone; 2 known Windows long-path errors.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The website now uses the sharp look the researcher chose: crisp 1 px borders,
6/8 px corners, main actions filled dark, the current page inverted. Colours,
type sizes, spacing and corners come from app/design_tokens.py, which also
generates browser/tokens.css, so the touch panel can use the same values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Flat grey square buttons with clear labels (as on the panel), the current
page shown dark, plain sections, a proper weather block with daylight, scene
tiles you tap to apply, a live channel mix with 5% steps, and phone layouts
that stack instead of squeezing. No grey tap flash, no jump to the top when
switching tabs, and dark phones never flash light while loading.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Every manual light change stops Sun/Circ first when the programme service
  is configured, so a programme that survived a helper or Pi restart can't
  turn the lights back on.
- Check connection adopts its own stable readback as the confirmed state.
- An identical change already pending or just confirmed isn't sent again.
- Launcher keeps the last 10 run folders and rotates its logs at ~5 MB;
  helper receipts are capped.
- Gateway: every accepted command ends with a stored receipt (also when it
  expires or fails), "not sent" is reported as such, and the server handles
  several phones at once.
- The website can restart the Pi but not shut it down; shutdown stays on the panel.
- Deletes the old website (room.js, room.css, status/diagnostics pages) and
  its tests; adds a small Node test for the new website's command handling.

Not yet deployed. Tests: 474 passed, 4 skipped, 2 known Windows long-path
errors; node --test passes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant