Skip to content

firmware: console tabs from the cache, one header, hotspot setup that reports back - #453

Merged
engmung merged 1 commit into
mainfrom
dev
Sep 24, 2026
Merged

engmung merged 1 commit into
mainfrom
dev

Conversation

@engmung

@engmung engmung commented Sep 24, 2026

Copy link
Copy Markdown
Owner

Console UX upgrade: switching tabs no longer downloads the page again, one stable header on every page, and first-time setup from the panel's own hotspot that reports what happened.

What changed

  • Versioned page URLs. Pages live at /path?v=<build> (build = the image's ELF hash, src/core_build.h) and are immutable under the running build; bare URLs revalidate (ETag from the gzip trailer, 304); a stale v gets a 302. The header script is /pf-console.js?h=<crc>, stamped into every page by console_pages.py build. Only panel-only Hosts (IP, bare name, .local) get a cache lifetime — the hotspot answers every DNS name.
  • /api/status gains build, viaHotspot, busy; SSID, pattern and error strings are escaped (a quote in an SSID broke the JSON).
  • Header in a shadow root (page CSS can no longer move it), fixed height, one scrolling tab strip, Knobs tab, connection state. window.PF for pages: one background lane, chained polls that back off, pause when hidden and stop on a tab tap; PF.hold guards uploads. A small fallback is stamped into every page.
  • /wifi on the hotspot: Add first, tappable scanned networks, inline did-you-mean, join outcome on the page and the LEDs; network added on the hotspot is tried at once.
  • Bench fixes: one slow reply no longer flips the console to offline (12 s floor, two failures in a row); always gives the station an attempt as soon as the hotspot is up (was: off the network for 5 minutes after every boot).
  • console_serve.py --slow emulates the hotspot link; check_send covers the 304/302/Host table; check_sources syntax-checks the header script.

Verified

  • build.sh all: five compositions build, marker scan ok, static RAM within pins; check_send, check_network, check_sources, check_boundaries, console_pages check pass.
  • On a panel (.246): /patterns 15.5 KB / 335 ms first visit → 0 bytes / 16 ms second; OTA → open tab moved to the new ?v= by itself; raw 304 carries the 200's Content-Length and no body, no header leaks into the next response.
  • Phone on the hotspot, first-run image (no saved networks): pages, tap network, save → joined in 1.5 s, LED banner. always reboot rejoined the LAN in 8.3 s.

Not verified: iOS Safari; the first visit to each tab on the hotspot still takes 1–14 s (link-bound).

🤖 Generated with Claude Code

… and hotspot setup that reports back

Page URLs carry the firmware's build (?v=), so a tab visited once is served
from the browser's cache with no request; a new build is a new address, and
an open console moves itself to it. Bare URLs revalidate (weak ETag from the
gzip trailer, 304), a stale v gets a 302, the header script is addressed by
its own checksum (?h=, stamped by console_pages.py), and only panel-only
Hosts ever get a cache lifetime. /api/status gains build, viaHotspot and
busy, and escapes free-form names.

The shared header lives in a shadow root with a fixed height and a single
scrolling tab strip (Knobs is a tab), shows the connection state, and gives
pages window.PF: one background lane, polls that wait, back off, pause when
hidden and stop on a tab tap. A small fallback is stamped into every page.

/wifi on the hotspot: Add first, the scanned networks to tap, an inline
did-you-mean, and the join outcome on the page and the LEDs. Pages gone over
for phones. console_serve.py can emulate the hotspot link (--slow).

Bench fixes: one slow reply no longer reads as offline (12 s floor, two
failures in a row), and `always` gives the station one attempt the moment
the hotspot is up instead of five minutes later.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Sep 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
pattern-flow_origin Ignored Ignored Sep 24, 2026 4:02am UTC

@engmung
engmung merged commit 6b9228e into main Sep 24, 2026
9 checks passed
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