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

Board panels patch when a matching event arrives, not on a data-live-every timer #2875

Merged opened this

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

Merged

A board's grid, which holds all its panels, now refreshes when a matching event arrives instead of on a `data-live-every` timer. `bun test test/board` passes (157 tests, including the credentials test that failed on #2722). I could not run the type check: `bun x tsc --noEmit` failed here with "bun is unable to write files to tempdir: ReadOnlyFileSystem". The forge's check on this push will run it.

shipped production is serving it deploy 1f3280d

opened this

A board's grid, which holds all its panels, now refreshes when a matching event arrives instead of on a data-live-every timer. bun test test/board passes (157 tests, including the credentials test that failed on #2722). I could not run the type check: bun x tsc --noEmit failed here with "bun is unable to write files to tempdir: ReadOnlyFileSystem". The forge's check on this push will run it.

  • Change: src/web/pages/boards-view.ts drops the EVERY timer map and data-live="board.none". The grid now carries data-live="run.,pull.,check.,issue.,usage.*" and keeps data-live-src. A board with refresh set to off still has no live region.
  • Debounce and etag: I did not touch client.ts or /boards/:slug/live. The existing burst debounce and the etag's 304 on an unchanged grid still apply.
  • Test: test/boards-store.test.ts now checks that the grid tag has no data-live-every and a non-empty data-live. I scoped the check to the grid tag because the page's inline script text mentions data-live-every.
  • Left out: the live region is the grid, not each panel, so there is one data-live rather than one per panel. Panels have no data-live-repo scoping, because board queries are not tied to one repository. The patterns are a fixed superset of the events the panels read, not derived per panel.

The refresh setting (10s/1m) now only turns live updates on or off. Its interval no longer has any effect.

Closes #2872

commented

A board's grid, which holds all its panels, now refreshes when a matching event arrives instead of on a data-live-every timer. bun test test/board passes (157 tests, including the credentials test that failed on #2722). I could not run the type check: bun x tsc --noEmit failed here with "bun is unable to write files to tempdir: ReadOnlyFileSystem". The forge's check on this push will run it.

  • Change: src/web/pages/boards-view.ts drops the EVERY timer map and data-live="board.none". The grid now carries data-live="run.,pull.,check.,issue.,usage.*" and keeps data-live-src. A board with refresh set to off still has no live region.
  • Debounce and etag: I did not touch client.ts or /boards/:slug/live. The existing burst debounce and the etag's 304 on an unchanged grid still apply.
  • Test: test/boards-store.test.ts now checks that the grid tag has no data-live-every and a non-empty data-live. I scoped the check to the grid tag because the page's inline script text mentions data-live-every.
  • Left out: the live region is the grid, not each panel, so there is one data-live rather than one per panel. Panels have no data-live-repo scoping, because board queries are not tied to one repository. The patterns are a fixed superset of the events the panels read, not derived per panel.

The refresh setting (10s/1m) now only turns live updates on or off. Its interval no longer has any effect.

Changes requested — before the latest push

The wiring is right: client.ts matches run.*-style prefixes, the live address and etag are untouched, and off still means no live region. I could not open the preview (my sandbox denied the host), so this is a read of the source and diff only.

One thing to fix first: the board still offers a refresh of 10s / 1m, and the README (line 1505) still says the grid redraws "on that beat". After this change the interval does nothing, so the setting promises something it no longer does and the README is now false. Either collapse the setting to live on/off (keeping 10s/1m accepted in stored boards and the API so nothing breaks) and update the settings form wording and the README, or keep the interval working. Add a test that fails without it.

Also: the file header comment now has an over-long line and still reads as if there were a beat. Reflow it.

commented

A board's grid, which holds all its panels, now redraws when a run, pull, check, issue or usage event arrives. It no longer redraws on a data-live-every timer. The board and store tests pass; I did not run the type check or the full suite, so the forge's check on this push will be the first to run them.

  • Settings form: the old "Refresh: off / 10s / 1m" select is now "Live", with two choices: off and "on: redraw when events arrive". A stored 10s or 1m shows as on, and the API, MCP and stored boards still accept all three values, so nothing existing breaks. The form posts 10s for on.
  • README: the line about the grid redrawing "on that beat" now says a live board redraws on those events, with one fetch per burst. It also says 10s and 1m are still accepted and mean the same thing.
  • Header comment: src/web/pages/boards-view.ts is reflowed and no longer mentions a beat.
  • Test: test/boards-store.test.ts now checks that the Live select has 10s selected as "on: redraw when events arrive" and that 1m is no longer offered.

Each panel has no data-live of its own; the single data-live is on the grid, as before.

Approved

Does what the issue asks: a live board redraws on run/pull/check/issue/usage events through the existing debounced swap and etag, with no timer. Off boards still carry no live region, the form still posts values the store accepts, the README is updated, and the test fails without the change. The first paint and keyboard path are unchanged: the select keeps its label, and the page still renders the grid server-side with JS off.

Two things I would do next:

  1. Collapse the refresh vocabulary. 10s and 1m now mean the same thing, and the form saves 10s over a stored 1m. Make the store accept off|on and map the old values on read, so the API and MCP stop advertising a distinction that does nothing.
  2. Cut the open-coded <option> pair in boards-view.ts:149 down to the option helper with a label argument, so the form line is readable.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs