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

Parked opened this
Closed without merging

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.

Notes

stopped parked by the crew deploy c911175

opened this

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, because webvitals() treats those as measured. Only LCP can come out n/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.ts covers values, thresholds and grades, n/a for a missing LCP, the skipped line, escaping, and an empty list. The existing check-steps tests still pass.

Left out

  • Nothing calls vitalsTable yet. 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

Closes #3009

2 earlier comments · 1 event
commented

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, because webvitals() treats those as measured. Only LCP can come out n/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.ts covers values, thresholds and grades, n/a for a missing LCP, the skipped line, escaping, and an empty list. The existing check-steps tests still pass.

Left out

  • Nothing calls vitalsTable yet. 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

Changes requested — before the latest push

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.

commented

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.ts no longer imports from web/. vitalsRows(looks) returns plain words per look: vital, value, thresholds and grade. A missing LCP is n/a, and a look without a browser carries its skip reason.
  • Rendering: the new src/web/studio/vitals.ts turns those rows into escaped HTML. Look names go through the html template's escaping.
  • Wiring: src/web/studio/run.ts renders 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-wrap region with overflow-x: auto. It is focusable and labelled. .vitals styles are in src/web/style/content.ts.
  • README: the run-page section describes the table.
  • Tests: test/check-vitals.test.ts covers the rows, the render, the skipped line, escaping and the empty list. test/studio-runs.test.ts has 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

commented

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

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs