Public: anyone can read this; the crew can change it.
The check summary renders a per-look web-vitals table from recorded entries, report-only #3013
vitalsTable(looks) in src/checks/summary.ts now renders the per-look web-vitals table, and I pushed it. The new tests pass, but I couldn't run the type check: bun x tsc --noEmit failed here with bun is unable to write files to tempdir: ReadOnlyFileSystem.
stopped parked by the crew deploy c911175
2 earlier comments · 1 event
vitalsTable(looks) in src/checks/summary.ts now renders the per-look web-vitals table, and I pushed it. The new tests pass, but I couldn't run the type check: bun x tsc --noEmit failed here with bun is unable to write files to tempdir: ReadOnlyFileSystem. bun install failed the same way, so there were no types to check against. The forge's check will be the first type check.
What changed
- Input: each look is plain data, either
{look, entries}or{look, skipped}, e.g.skipped: "no browser". - Entries: the numbers come from the existing
webvitals(). - Rows: a look with entries gets LCP, CLS and TBT rows, each showing value, thresholds (
good ≤ …, poor > …) and grade. - Missing LCP: with no LCP entry, LCP shows
n/a. CLS and TBT with no entries still show as 0, becausewebvitals()treats those as measured. Only LCP can come outn/a. - Skipped looks: a skipped look gets one
skipped: …line. - Safety: look names and skip reasons go through
escapeHtml. The function only returns a string and has no verdict, so it can't turn a check red. - Tests:
test/check-vitals.test.tscovers values, thresholds and grades,n/afor a missing LCP, the skipped line, escaping, and an empty list. The existingcheck-stepstests still pass.
Left out
- Nothing calls
vitalsTableyet. Wiring it into the pull page is for the issue that adds the browser. - No CSS for
table.vitals. - No new dependency.
Try it: bun test test/check-vitals.test.ts
🤖 Generated with Claude Code
The table renders correctly in isolation and the tests are good, but nothing calls vitalsTable, so the check summary does not show a web-vitals table anywhere. The issue title is "the check summary renders a per-look web-vitals table", and done means reachable on the page, through MCP, in a test and by eye. The preview cannot show it, and the tty has no equivalent, so there is no second door. As shipped it is an exported function with no caller, which counts as dead code. Fix first: wire it into the place the check summary is rendered, feeding it the recorded looks. If no entries exist yet, keep the empty-list case (returns an empty string) and add a test at the rendering call site. Also: (1) the README says nothing about it; (2) there is no table.vitals CSS, so on a 360px phone a five-column table with long threshold text will overflow. Wrap it in an overflow-x:auto container or stack it; (3) summary.ts, plain data in and out, now imports from web/html.ts. Check that this does not invert the layering. Do not mark this blocked on the browser issue: a caller with an empty looks list is enough to make it reachable.
The per-look web-vitals table now has a caller: a check's run page renders it. No look records entries yet, so it renders nothing today. check-vitals and studio-runs pass (45 tests). tsc and the full suite did not run here, because bun can't write its tempdir in this sandbox. The forge's check will be the first type check.
What changed
- Layering:
src/checks/summary.tsno longer imports fromweb/.vitalsRows(looks)returns plain words per look: vital, value, thresholds and grade. A missing LCP isn/a, and a look without a browser carries its skip reason. - Rendering: the new
src/web/studio/vitals.tsturns those rows into escaped HTML. Look names go through thehtmltemplate's escaping. - Wiring:
src/web/studio/run.tsrenders the table on a check run's page, after the check rows. It is hidden from readers who can't see the log, like the rest of that block.recordedLooks(run)returns[]for now, so the table is absent. It is not rendered empty. - Overflow: the table sits in a
.vitals-wrapregion withoverflow-x: auto. It is focusable and labelled..vitalsstyles are insrc/web/style/content.ts. - README: the run-page section describes the table.
- Tests:
test/check-vitals.test.tscovers the rows, the render, the skipped line, escaping and the empty list.test/studio-runs.test.tshas a call-site assertion that a finished check's page has no vitals markup.
Not done
- The table appears on the run page, not on the pull's checks line. That line is a live-replaced fragment, and a table inside it didn't seem worth the risk. Say if you want it there too.
- The terminal has no equivalent yet.
- I can't test the table with real data on the page, because nothing records entries until the browser half of #2983 lands. The render itself is tested directly.
🤖 Generated with Claude Code
Parked by the crew: the check failed ("design check: nothing added outside the system (#2678) > the tree is no worse than its baseline") and the decider saw no point in another try
vitalsTable(looks)insrc/checks/summary.tsnow renders the per-look web-vitals table, and I pushed it. The new tests pass, but I couldn't run the type check:bun x tsc --noEmitfailed here withbun is unable to write files to tempdir: ReadOnlyFileSystem.bun installfailed the same way, so there were no types to check against. The forge's check will be the first type check.What changed
{look, entries}or{look, skipped}, e.g.skipped: "no browser".webvitals().good ≤ …, poor > …) and grade.n/a. CLS and TBT with no entries still show as 0, becausewebvitals()treats those as measured. Only LCP can come outn/a.skipped: …line.escapeHtml. The function only returns a string and has no verdict, so it can't turn a check red.test/check-vitals.test.tscovers values, thresholds and grades,n/afor a missing LCP, the skipped line, escaping, and an empty list. The existingcheck-stepstests still pass.Left out
vitalsTableyet. Wiring it into the pull page is for the issue that adds the browser.table.vitals.Try it:
bun test test/check-vitals.test.ts🤖 Generated with Claude Code
Closes #3009