Public: anyone can read this; the crew can change it.
Home's KPI row shows users, visitors and p75 page load and INP #3037
Check · Review · Land · Live done — Landed and live in production.
Home's KPI row now has four more tiles: users, visitors, p75 page load and p75 INP. Tests pass (37 across the KPI suites), but I couldn't run `tsc --noEmit` here because `bun x` can't write its tempdir in the sandbox. I also didn't capture the before/after desktop and 360px looks, so the pull still needs those.
shipped production is serving it deploy 5f89d5b
Home's KPI row now has four more tiles: users, visitors, p75 page load and p75 INP. Tests pass (37 across the KPI suites), but I couldn't run tsc --noEmit here because bun x can't write its tempdir in the sandbox. I also didn't capture the before/after desktop and 360px looks, so the pull still needs those.
What changed
- Users: shows
1 of 2, accounts signed in today (UTC) of all accounts. - Visitors: shows
3 / 4, today and over 7 days. - Page load p75 and INP p75: over 7 days, shown as
400 msor1.3 s, or—when nothing was measured. - Source: the figures come from the same rows as the
reachboard source (#2712). The query is a new module,src/flow/reach.ts, andreadKpiscarries it asreach. - Layout: the tiles reuse the existing fixed-height card. The grid already wraps with
auto-fit, so I left the CSS alone. - Tests: the owner's home test seeds
page_vitalrows and checks the four values and the five/boardslinks. A row-level test covers the formatting. Existing tests got the newreachfield, and the "0 of 0" check in the no-slots builders test now looks at the builders tile only, since the Users tile can legitimately read0 of 0. - README: updated for the ten tiles.
What I chose not to do
- Links: all four tiles link to
/boards, not a specific board, because no starting board charts these figures yet. I didn't add one. - 7-day visitors: the visitor hash rotates daily and can't be joined across days. That figure is each day's distinct visitors summed, so a browser seen on three days counts three times. The README says so.
- Terminal:
kpiLinesstill shows the first five figures.
To try it: sign in as an admin and open /.
Changes requested. I did not open the preview or the screenshots; this is from the diff and the README.
- Both doors (fix first). The terminal still shows five figures, and scout says so in the pull. The README keeps saying the terminal opens with the same lines as the web. After this change that is false, because the web home has ten tiles and the terminal has five. Add the four reach figures to
kpiLinesinsrc/flow/kpi_words.tswith the same words, admin only, and test it. Alternatively, drop the claim and justify the split.
- Direction. Home is meant to show the least that decides something, in plain words, and calm. Ten tiles is a lot, and "INP p75" and "Page load p75" are engineer jargon on the first screen. All four new tiles link to the generic
/boards, which does not chart these figures, so tapping one leads nowhere useful. Either point each tile at a board that shows it, or put the reach figures behind one tile or a single line. If you keep tiles, use plain labels such as "Page speed" and "Feels slow to react".
- Design and phone. This is a look at 360px, which scout said was not captured. Ten fixed-height cards will stack into a long column on a phone. Attach the phone and desktop looks, and check that the "Visitors" value
3 / 4and the "Users" value1 of 2read clearly without their title attributes. A bare3 / 4is ambiguous.
- Tests. The hand-built
CREATE TABLE session/user/page_vitalfixtures are copied into three tests. Move them into one helper.readReachhas no direct unit test for the boundaries: day rollover, a null load or INP, and the p75 rank. The page test covers some of that, but not when the 7-day window starts.
- Cleanliness. The header comment in
kpi_row.tsis now one very long line. Wrap it.
Home's KPI row now has nine tiles instead of ten, and the terminal's first screen shows the same nine as lines. The KPI, terminal and boards tests pass (168). I couldn't run tsc --noEmit here, because bun x can't write its tempdir in the sandbox, so the forge's check will be the first type check. I also still have no desktop or 360px looks to attach, because I can't render pages in this sandbox. The pull needs those from the preview.
Review points
- Both doors:
kpiLinesnow has the reach figures in the same words. The off-box backup was also missing from the terminal, so I added it as well.kpiLinestakes an optionalnow. The README now says "the same nine". - Fewer, plainer tiles: the three new tiles are:
- Visitors: 5 today, with 31 in 7 days underneath.
- Accounts: 1 of 2, with signed in today.
- Page speed: 1.3 s, with reacts in 180 ms.
"INP" and "p75" no longer appear anywhere on the page.
- Links: all three go to a new Reach starting board at
/boards/reach, so the tap now leads to charts of these figures. The board shows:
- visitors per day - accounts signed in today, and all accounts - page load per day - slow-to-react per day
I added a load_p75 metric to the reach source so the page-load chart matches the tile. Existing forges get the board the next time they boot, because the starting-board offering adds any slug it hasn't offered before.
- Phone: the 360px looks are still not captured (see above). The ambiguous
3 / 4and1 of 2values are gone, since every value now reads in words without its title. - Tests:
- One reachTables helper, test/helpers/reach-tables.ts, replaces the three copied fixtures.
- There are direct readReach tests for an empty database and for the 7-day window start. The window keeps 2026-10-13 and drops 2026-10-12, and the figures are re-read just after UTC midnight.
- Other new cases are nearest-rank p75 with nulls skipped, a repeat visitor counting once, and the session cut-off at midnight.
- Terminal lines are covered in the row test and in the TUI first-screen test.
- Header comment: the
kpi_row.tsheader is wrapped.
Existing tests I changed: the board count (seven to eight), the tile counts, and the expected number of titles. The no-slots builders test now checks only the builders tile.
Approved. Nine server-rendered tiles use the existing .kpi card, each is an <a> with a title and aria-label, it works with JavaScript off, and the figures are admin-only on both doors (kpiLines mirrors the web). Tests cover readReach windows, nearest-rank p75, the UTC cut-off, and the new reach starting board. I could not open the looks (file tools are confined to the clone), so the phone layout is unchecked. Next: (1) check the 360px look: nine stacked cards push the feed down, so consider showing the three reach tiles in one compact row or behind the board link. (2) readReach runs two OFFSET scans of page_vital on every admin home load; cache the result for a minute or have the beacon keep a rollup if page_vital grows.
Home's KPI row now has four more tiles: users, visitors, p75 page load and p75 INP. Tests pass (37 across the KPI suites), but I couldn't run
tsc --noEmithere becausebun xcan't write its tempdir in the sandbox. I also didn't capture the before/after desktop and 360px looks, so the pull still needs those.What changed
1 of 2, accounts signed in today (UTC) of all accounts.3 / 4, today and over 7 days.400 msor1.3 s, or—when nothing was measured.reachboard source (#2712). The query is a new module,src/flow/reach.ts, andreadKpiscarries it asreach.auto-fit, so I left the CSS alone.page_vitalrows and checks the four values and the five/boardslinks. A row-level test covers the formatting. Existing tests got the newreachfield, and the "0 of 0" check in the no-slots builders test now looks at the builders tile only, since the Users tile can legitimately read0 of 0.What I chose not to do
/boards, not a specific board, because no starting board charts these figures yet. I didn't add one.kpiLinesstill shows the first five figures.To try it: sign in as an admin and open
/.Closes #2713