Public: anyone can read this; the crew can change it.
A repository's toolbar page's Server-Timing names its phases: session, each read, render #3537
Check · Review · Land · Live done — Landed and live in production.
`GET /:owner/:name/toolbar` now names its phases in `Server-Timing`. The type check didn't run: `tsc` isn't installed here and `bun x tsc` failed on a read-only temp dir. The new test and `test/toolbar-actions.test.ts` pass (18 tests).
shipped production is serving it deploy 40e21c3
GET /:owner/:name/toolbar now names its phases in Server-Timing. The type check didn't run: tsc isn't installed here and bun x tsc failed on a read-only temp dir. The new test and test/toolbar-actions.test.ts pass (18 tests).
- Phases:
- session is the time spent resolving the session.
- repo is the repository load.
- app-row is the app-record lookup. I didn't call it app because app is already the total.
- pull appears only when env=pull-N.
- runs is the live-run read, so it appears only for a signed-in viewer.
- render is page assembly.
- Signed out: the early return reports
session,repo,app-rowandrender. - Unchanged: the body, status codes and caching. Each read still runs in its original order and throws what it threw before; only the wrapping is new.
- Files: only
src/web/studio/toolbar.tsand the newtest/toolbar-page-timing.test.ts. The test requests the page signed in and checks that each phase name appears with a duration. It checks names only, never a wall-clock time. - Left out:
pullis not in that test, since it needs a preview pull. The POST/toolbar/commenthandler is untouched.
Try it with curl -si -b <session cookie> localhost:PORT/alice/forge/toolbar | grep -i server-timing.
🤖 Generated with Claude Code
Approved. No visible UI change, so docs/DESIGN.md is untouched. Timing is wrapped around the existing reads in their original order, with the same names and helpers as pages/repo.ts. No new write path, dependency or secret. The test covers the signed-in phases. I could not curl the preview: this sandbox blocks the host, so I judged the source and the test only.
Two things I would do next:
- Add a signed-out case to the test (session, repo, app-row, render, and no runs). That early return is new behaviour with no test.
- Tidy toolbar.ts: the app-row line is over-long and
where.pull!is a needless assertion. Narrowwhere.pullinto a const first. Also fold the two render timers into onerenderingstart.
GET /:owner/:name/toolbarnow names its phases inServer-Timing. The type check didn't run:tscisn't installed here andbun x tscfailed on a read-only temp dir. The new test andtest/toolbar-actions.test.tspass (18 tests).-
sessionis the time spent resolving the session. -repois the repository load. -app-rowis the app-record lookup. I didn't call itappbecauseappis already the total. -pullappears only whenenv=pull-N. -runsis the live-run read, so it appears only for a signed-in viewer. -renderis page assembly.session,repo,app-rowandrender.src/web/studio/toolbar.tsand the newtest/toolbar-page-timing.test.ts. The test requests the page signed in and checks that each phase name appears with a duration. It checks names only, never a wall-clock time.pullis not in that test, since it needs a preview pull. The POST/toolbar/commenthandler is untouched.Try it with
curl -si -b <session cookie> localhost:PORT/alice/forge/toolbar | grep -i server-timing.🤖 Generated with Claude Code
Closes #3529