Public: anyone can read this; the crew can change it.
The spend tab's Server-Timing names its phases: session, each read, render #3431
Check · Review · Land · Live done — Landed and live in production.
The spend tab (`/settings/spend`) now answers with Server-Timing phases `session`, `spend` and `render`, after `app`.
shipped production is serving it deploy dc8790b
The spend tab (/settings/spend) now answers with Server-Timing phases session, spend and render, after app.
The new test passes. I couldn't run the type check: bun x tsc --noEmit and bun install both failed in this sandbox with "unable to write files to tempdir". The forge's check will run it on this push.
- What changed:
spendPageinsrc/web/pages/spend-tab.tsusesnotePhaseandtimePhaseasboards-view.tsdoes. The session time comes fromtakeSessionTime, the singlereadSpendcall is wrapped inspend, and building the HTML is timed asrender. The read keeps its order and errors, and the body, status codes and caching are unchanged. - Test:
test/spend-timing.test.tssigns in as the admin, requests the page, and asserts thatapp,session,spendandrendereach appear with adur. It fails without the change. - Left out: I didn't split
spendinto one phase per query.readSpendis one function that runs many queries, and splitting it would mean changingsrc/actions/spend.ts, which is outside this issue's files. The early sign-in and not-found returns carry no phases.
To try it, sign in as an admin, open /settings/spend, and read the Server-Timing response header.
🤖 Generated with Claude Code
Follows the boards-view pattern exactly (notePhase session, timePhase for the read, render measured from before the body is built). Admin gate and sign-in/404 returns are untouched, so no new exposure. The test signs in and asserts all four phases with a dur, and fails without the change. No markup or style changed, so DESIGN.md is unaffected. I could not reach the preview from my sandbox (network allowlist), so I judged from source only. Next: 1) split spend per query in src/actions/spend.ts so the slow read is named; 2) add the phases to the early-return paths only if they ever matter.
The spend tab (
/settings/spend) now answers with Server-Timing phasessession,spendandrender, afterapp.The new test passes. I couldn't run the type check:
bun x tsc --noEmitandbun installboth failed in this sandbox with "unable to write files to tempdir". The forge's check will run it on this push.spendPageinsrc/web/pages/spend-tab.tsusesnotePhaseandtimePhaseasboards-view.tsdoes. The session time comes fromtakeSessionTime, the singlereadSpendcall is wrapped inspend, and building the HTML is timed asrender. The read keeps its order and errors, and the body, status codes and caching are unchanged.test/spend-timing.test.tssigns in as the admin, requests the page, and asserts thatapp,session,spendandrendereach appear with adur. It fails without the change.spendinto one phase per query.readSpendis one function that runs many queries, and splitting it would mean changingsrc/actions/spend.ts, which is outside this issue's files. The early sign-in and not-found returns carry no phases.To try it, sign in as an admin, open
/settings/spend, and read theServer-Timingresponse header.🤖 Generated with Claude Code
Closes #3280