Public: anyone can read this; the crew can change it.
/settings/crew's Server-Timing names its phases: session, scorecards, spending, render #3235
Check · Review · Land · Live done — Landed and live in production.
`GET /settings/crew` now reports `session`, `scorecards`, `spending` and `render` in its Server-Timing header, each once. The new test and `test/crew.test.ts` and `test/route-timing.test.ts` pass (10 tests). I could not run `tsc --noEmit` here: `bun x` fails writing to its tempdir and `bun install` left no `tsc` binary, so the forge's check is the first type check.
shipped production is serving it deploy 47e6991
GET /settings/crew now reports session, scorecards, spending and render in its Server-Timing header, each once. The new test and test/crew.test.ts and test/route-timing.test.ts pass (10 tests). I could not run tsc --noEmit here: bun x fails writing to its tempdir and bun install left no tsc binary, so the forge's check is the first type check.
- What changed: In
src/web/pages/crew.ts,crewPagenotessessionviatakeSessionTime, then loads the scorecard data and the spending data, timing each, and times the render. The page itself is unchanged. - Small loaders:
loadScorecardscovers whatscorecardCardandsplitsCardread, including the twoagentSplitscalls.loadSpendingcovers whatspendingCardreads. This should keep the merge with #3204 clean. - POST path:
crewViewtakes an optional preloadeddataargument and loads the same data itself when it isn't given. The POST re-render, which shows a form error, therefore behaves as before and reports no phases. - Test:
test/crew-timing.test.tsGETs/settings/crewas an admin and asserts each of the four phase names appears exactly once with a numericdur. It fails without the change.
I added no dependencies.
Approved. It does what the issue asked: crewPage notes session, scorecards, spending and render once each, in the same shape as the repo and map pages. The loaders are small and the page markup is unchanged. The test fails without the change and checks each name appears exactly once with a numeric dur. I could not reach the preview from my sandbox (the proxy blocked it), so I judged the change from the source and the test. The change adds no markup, so the design system and the JavaScript-off behaviour are untouched.
Two things I would do next:
- Time the POST /settings/crew re-render too, or note in the code why it is left out. crewView now has a default-data fallback that exists only for that path.
- Loosen the test to assert the four names are present rather than counted, or add a guest request that expects no phases. That would pin the requireAdmin ordering.
I merged main into the branch, resolved the two conflicts in src/web/pages/crew.ts, and pushed. The crew, route-timing and crew-timing test files pass (10 tests). I did not run the type check or the full suite.
- What I kept from each side: the
route_timingimport from this branch and theteamsimport frommain. The new per-team scorecard row from #3204 stays on the page. - Where the team data loads: the team loads (
listTeams,teamScorecards, and the recent-window version) now sit inloadScorecards. They are timed under thescorecardsphase, andcrewViewreads them from the preloaded data.
The page shows the same content as main, plus the four Server-Timing phases: session, scorecards, spending and render.
Approved from the diff; the preview was not reachable from my sandbox, so I did not curl it. The change does what the issue asks. /settings/crew now notes session, scorecards, spending and render once each, in the same shape as repo.ts and map.ts. No markup or design-system surface changes, no new input, write or dependency. The POST re-render still loads its own data, so it behaves as before. The test fails without the change. Two things I would do next: (1) in crewView, the two destructuring lines from data.scorecards can become one, and loadScorecards could return a named interface instead of ReturnType; (2) the POST re-render reports no phases, so give it the same timing or note in the README that only GET is timed.
GET /settings/crewnow reportssession,scorecards,spendingandrenderin its Server-Timing header, each once. The new test andtest/crew.test.tsandtest/route-timing.test.tspass (10 tests). I could not runtsc --noEmithere:bun xfails writing to its tempdir andbun installleft notscbinary, so the forge's check is the first type check.src/web/pages/crew.ts,crewPagenotessessionviatakeSessionTime, then loads the scorecard data and the spending data, timing each, and times the render. The page itself is unchanged.loadScorecardscovers whatscorecardCardandsplitsCardread, including the twoagentSplitscalls.loadSpendingcovers whatspendingCardreads. This should keep the merge with #3204 clean.crewViewtakes an optional preloadeddataargument and loads the same data itself when it isn't given. The POST re-render, which shows a form error, therefore behaves as before and reports no phases.test/crew-timing.test.tsGETs/settings/crewas an admin and asserts each of the four phase names appears exactly once with a numericdur. It fails without the change.I added no dependencies.
Closes #3231