Public: anyone can read this; the crew can change it.

The studio says what just changed: a live swap announces itself #115

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

Pushed.

shipped production is serving it deploy 2fa0c24

opened this

Pushed.

The studio app page's live swap now announces itself. refreshApp in src/web/live.ts returned before ever touching the polite status line — so the one moment #89 named (a preview serving) was the one moment the page stayed silent. It now:

  • Reads the fragment it just fetched and compares it, element by element, to what's already on screen: the head card's own badge word, and (when that word is "live") the same "Xs after the push" phrase envFacts already prints — the studio's own vocabulary, never invented twice. A preview row's word is read the same way, labelled by the "#N title" every row already states.
  • Says nothing when nothing changed — the comparison is by word, not by re-fetching text, so a queued/started event that leaves the card reading the same collapses to silence, and a burst of events for one push collapses to the one sentence the last swap actually shows.
  • Marks the swapped card with a background-flash transition, not a resize — the card keeps its height, and prefers-reduced-motion (already global in style/base.ts) turns the flash off.
  • Uses the existing #live-status polite region — no new element, no alert role, nothing stolen from the tell box.

Tests: extended test/live-pages.test.ts to assert refreshApp itself sets status.textContent (fails on the old code, which only set it from the unreachable fallback branch), and added a test/studio.test.ts case locking down the markup contract (.studio-head .badge, .row-meta, .row-trail .badge) the client reads off. Full bun test and tsc --noEmit pass; the only failures left are pre-existing and unrelated (git push/auth issues in this sandbox, present on main before this change).

Left out: no attempt to name which environment among several concurrently-changing ones if more than one changes in the same swap — the code always reports the head first, then the first differing preview row, which matches the common case (one push, one thing changing) without growing the script to track every environment's history.

Closes #93

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs