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

A running run page and app page drop the 5-second meta refresh and patch their status from /events #2877

Merged opened this

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

Merged

The run page and the app page no longer reload every 5 seconds while a run is going. The status updates in place from the page's one `/events` connection, and the log keeps streaming.

shipped production is serving it deploy 7cfd21c

opened this

The run page and the app page no longer reload every 5 seconds while a run is going. The status updates in place from the page's one /events connection, and the log keeps streaming.

Run page (src/web/studio/run.ts)

  • The head block (word, cost, turns, clock and summary) is now #run-head. While the run is unfinished it carries data-live="run." and data-live-repo="owner/name", so liveRegionsJs refetches the page on any run. event for that repository and swaps the head in place.
  • The id stays on a finished page, so the swap after run.finished still finds its match and shows the final word, cost and summary without a reload.
  • The head replaces the hidden <span data-live="run.finished">, which existed only to open the stream.
  • studioRunJs (src/web/client.ts) used to look up #run-word and #run-summary once at load. A swap replaces those elements, so it now looks them up each time it paints.

App page (src/web/studio/app.ts)

  • The Now card (#live-now) was already a run.* region scoped to its repository, and the head card already swaps on deploy events. So this page only loses its refresh.
  • With the refresh gone, nowCard's running and appPanels's tailing had no reader, so they are deleted from now.ts and previews.ts.

Tests

  • New in test/studio-runs.test.ts: a running run's page has no <meta http-equiv="refresh"> and has the scoped live region. Once finished, the same #run-head shows the final word, cost, "took …" and summary, and has no data-live.
  • Five existing assertions expected the refresh: four in test/studio-runs.test.ts and one in test/web-apps.test.ts. They were wrong once this issue's goal applies, so they now assert it is absent. The "/events only" test now looks for the head region instead of the removed span.
  • docs/DESIGN.md's run-log row no longer describes a stream URL or a <meta refresh>.

Not done: with JavaScript off, a running page no longer updates until you reload it; the issue accepts that. Cost and turns still change only on the run's queued, started and finished events, because no event fires for progress in between.

The type check passes, and the run, app, live, refresh-meta and offline suites pass (248 tests). To try it, open a running run's page and watch its word change to the final one when it finishes, with no reload.

🤖 Generated with Claude Code

Closes #2873

commented

The run page and the app page no longer reload every 5 seconds while a run is going. The status updates in place from the page's one /events connection, and the log keeps streaming.

Run page (src/web/studio/run.ts)

  • The head block (word, cost, turns, clock and summary) is now #run-head. While the run is unfinished it carries data-live="run." and data-live-repo="owner/name", so liveRegionsJs refetches the page on any run. event for that repository and swaps the head in place.
  • The id stays on a finished page, so the swap after run.finished still finds its match and shows the final word, cost and summary without a reload.
  • The head replaces the hidden <span data-live="run.finished">, which existed only to open the stream.
  • studioRunJs (src/web/client.ts) used to look up #run-word and #run-summary once at load. A swap replaces those elements, so it now looks them up each time it paints.

App page (src/web/studio/app.ts)

  • The Now card (#live-now) was already a run.* region scoped to its repository, and the head card already swaps on deploy events. So this page only loses its refresh.
  • With the refresh gone, nowCard's running and appPanels's tailing had no reader, so they are deleted from now.ts and previews.ts.

Tests

  • New in test/studio-runs.test.ts: a running run's page has no <meta http-equiv="refresh"> and has the scoped live region. Once finished, the same #run-head shows the final word, cost, "took …" and summary, and has no data-live.
  • Five existing assertions expected the refresh: four in test/studio-runs.test.ts and one in test/web-apps.test.ts. They were wrong once this issue's goal applies, so they now assert it is absent. The "/events only" test now looks for the head region instead of the removed span.
  • docs/DESIGN.md's run-log row no longer describes a stream URL or a <meta refresh>.

Not done: with JavaScript off, a running page no longer updates until you reload it; the issue accepts that. Cost and turns still change only on the run's queued, started and finished events, because no event fires for progress in between.

The type check passes, and the run, app, live, refresh-meta and offline suites pass (248 tests). To try it, open a running run's page and watch its word change to the final one when it finishes, with no reload.

🤖 Generated with Claude Code

Approved

Approved. The run page and app page no longer reload; the head (#run-head) is a run.* live region scoped to its repo, and log lines ride separate run.log frames, so the refetch only fires on queued/started/finished. The head keeps its id after finish, so the last swap lands. paint() now looks up #run-word and #run-summary at paint time, which is needed after a swap. Dead running/tailing returns are removed, and the new test would fail without the change.

Two things I would do next:

  1. With JavaScript off a running page is now frozen. Add a plain "Refresh" link in the head for that case, using a noscript fallback, so a phone reader without JS is not stranded.
  2. Cost and turns are stale between run events. Emit a throttled run.progress event from noteRunProgress, so the head stops lagging mid-run.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs