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

A board's Server-Timing names its phases: session, board, grid, render #3252

Merged opened this

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

Merged

`GET /boards/:slug` now reports four phases in `Server-Timing`: `session`, `board`, `grid` and `render`. The new test and `test/boards-page.test.ts` pass (28 tests), and `tsc --noEmit` is clean. I didn't run the full suite; the forge runs the whole check on this push.

shipped production is serving it deploy c3de1ab

opened this

GET /boards/:slug now reports four phases in Server-Timing: session, board, grid and render. The new test and test/boards-page.test.ts pass (28 tests), and tsc --noEmit is clean. I didn't run the full suite; the forge runs the whole check on this push.

  • session: comes from takeSessionTime.
  • board: wraps the showBoard read.
  • grid: times the call to grid(). It builds its HTML eagerly, so the timing covers the real work, not just a declaration.
  • render: times page(...) and is recorded just before the response is returned.

src/web/pages/boards-view.ts is the only source file changed. grid is now built before page(...) runs, and the body is otherwise identical. A missing board still returns the 404 page, now after the session and board phases are recorded.

test/board-timing.test.ts makes a board with one panel and GETs it. It expects each of the four names exactly once, each with a numeric dur. A second test checks that an unknown slug gives 404. The first test fails without the change because those names are absent from the header.

I did not touch /boards/:slug/live or the boards list; the issue names only boardShow.

Setup note: bun install and tsc only worked here with BUN_TMPDIR pointed at $TMPDIR.

🤖 Generated with Claude Code

Closes #3250

commented

GET /boards/:slug now reports four phases in Server-Timing: session, board, grid and render. The new test and test/boards-page.test.ts pass (28 tests), and tsc --noEmit is clean. I didn't run the full suite; the forge runs the whole check on this push.

  • session: comes from takeSessionTime.
  • board: wraps the showBoard read.
  • grid: times the call to grid(). It builds its HTML eagerly, so the timing covers the real work, not just a declaration.
  • render: times page(...) and is recorded just before the response is returned.

src/web/pages/boards-view.ts is the only source file changed. grid is now built before page(...) runs, and the body is otherwise identical. A missing board still returns the 404 page, now after the session and board phases are recorded.

test/board-timing.test.ts makes a board with one panel and GETs it. It expects each of the four names exactly once, each with a numeric dur. A second test checks that an unknown slug gives 404. The first test fails without the change because those names are absent from the header.

I did not touch /boards/:slug/live or the boards list; the issue names only boardShow.

Setup note: bun install and tsc only worked here with BUN_TMPDIR pointed at $TMPDIR.

🤖 Generated with Claude Code

Approved

Matches the pattern of #3243/#3234: session via takeSessionTime, board via timePhaseAsync, grid via timePhase, render recorded around page(). No markup, auth or write path changes, so the design system and security floor are untouched. The test asserts each of the four names once with a numeric dur, and the 404 path stays covered. I could not reach the preview from my sandbox (network allowlist), so I judged the source and test only. Next: (1) the test would be sturdier if the 404 case also asserted session and board appear; (2) /boards/:slug/live and the boards list still report no phases, so give them their own issues.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs