diff --git a/docs/design/v5/live/after/demo/step-1-1440-light.png b/docs/design/v5/live/after/demo/step-1-1440-light.png new file mode 100644 index 0000000..e04915a Binary files /dev/null and b/docs/design/v5/live/after/demo/step-1-1440-light.png differ diff --git a/docs/design/v5/live/after/demo/step-1-375-dark.png b/docs/design/v5/live/after/demo/step-1-375-dark.png new file mode 100644 index 0000000..6643eef Binary files /dev/null and b/docs/design/v5/live/after/demo/step-1-375-dark.png differ diff --git a/docs/design/v5/live/after/demo/step-2-1440-light.png b/docs/design/v5/live/after/demo/step-2-1440-light.png new file mode 100644 index 0000000..8e46e2c Binary files /dev/null and b/docs/design/v5/live/after/demo/step-2-1440-light.png differ diff --git a/docs/design/v5/live/after/demo/step-3-1440-light.png b/docs/design/v5/live/after/demo/step-3-1440-light.png new file mode 100644 index 0000000..b1d7d56 Binary files /dev/null and b/docs/design/v5/live/after/demo/step-3-1440-light.png differ diff --git a/docs/design/v5/live/after/demo/step-4-1440-light.png b/docs/design/v5/live/after/demo/step-4-1440-light.png new file mode 100644 index 0000000..c72affd Binary files /dev/null and b/docs/design/v5/live/after/demo/step-4-1440-light.png differ diff --git a/docs/design/v5/live/after/demo/step-4-375-dark.png b/docs/design/v5/live/after/demo/step-4-375-dark.png new file mode 100644 index 0000000..55b8b1c Binary files /dev/null and b/docs/design/v5/live/after/demo/step-4-375-dark.png differ diff --git a/docs/design/v5/live/after/demo/step-5-1440-light.png b/docs/design/v5/live/after/demo/step-5-1440-light.png new file mode 100644 index 0000000..27f62d4 Binary files /dev/null and b/docs/design/v5/live/after/demo/step-5-1440-light.png differ diff --git a/docs/design/v5/live/after/demo/step-6-1440-light.png b/docs/design/v5/live/after/demo/step-6-1440-light.png new file mode 100644 index 0000000..11a76d9 Binary files /dev/null and b/docs/design/v5/live/after/demo/step-6-1440-light.png differ diff --git a/docs/design/v5/live/after/demo/step-6-2560-dark.png b/docs/design/v5/live/after/demo/step-6-2560-dark.png new file mode 100644 index 0000000..0af3868 Binary files /dev/null and b/docs/design/v5/live/after/demo/step-6-2560-dark.png differ diff --git a/docs/design/v5/live/after/demo/step-6-375-dark.png b/docs/design/v5/live/after/demo/step-6-375-dark.png new file mode 100644 index 0000000..14e8e75 Binary files /dev/null and b/docs/design/v5/live/after/demo/step-6-375-dark.png differ diff --git a/docs/design/v5/live/after/demo/step-7-1440-light.png b/docs/design/v5/live/after/demo/step-7-1440-light.png new file mode 100644 index 0000000..2fb5303 Binary files /dev/null and b/docs/design/v5/live/after/demo/step-7-1440-light.png differ diff --git a/docs/design/v5/live/after/demo/step-7-375-dark.png b/docs/design/v5/live/after/demo/step-7-375-dark.png new file mode 100644 index 0000000..11c5a7d Binary files /dev/null and b/docs/design/v5/live/after/demo/step-7-375-dark.png differ diff --git a/docs/design/v5/live/after/live-1440-dark.png b/docs/design/v5/live/after/live-1440-dark.png new file mode 100644 index 0000000..b563371 Binary files /dev/null and b/docs/design/v5/live/after/live-1440-dark.png differ diff --git a/docs/design/v5/live/after/live-1440-light.png b/docs/design/v5/live/after/live-1440-light.png new file mode 100644 index 0000000..c316bae Binary files /dev/null and b/docs/design/v5/live/after/live-1440-light.png differ diff --git a/docs/design/v5/live/after/live-2560-dark.png b/docs/design/v5/live/after/live-2560-dark.png new file mode 100644 index 0000000..e1ce2c8 Binary files /dev/null and b/docs/design/v5/live/after/live-2560-dark.png differ diff --git a/docs/design/v5/live/after/live-2560-light.png b/docs/design/v5/live/after/live-2560-light.png new file mode 100644 index 0000000..2f4d8b5 Binary files /dev/null and b/docs/design/v5/live/after/live-2560-light.png differ diff --git a/docs/design/v5/live/after/live-375-dark.png b/docs/design/v5/live/after/live-375-dark.png new file mode 100644 index 0000000..c7610ab Binary files /dev/null and b/docs/design/v5/live/after/live-375-dark.png differ diff --git a/docs/design/v5/live/after/live-375-light.png b/docs/design/v5/live/after/live-375-light.png new file mode 100644 index 0000000..de59819 Binary files /dev/null and b/docs/design/v5/live/after/live-375-light.png differ diff --git a/docs/design/v5/live/after/states/down-1440-dark.png b/docs/design/v5/live/after/states/down-1440-dark.png new file mode 100644 index 0000000..bc4c814 Binary files /dev/null and b/docs/design/v5/live/after/states/down-1440-dark.png differ diff --git a/docs/design/v5/live/after/states/down-1440-light.png b/docs/design/v5/live/after/states/down-1440-light.png new file mode 100644 index 0000000..a579bcb Binary files /dev/null and b/docs/design/v5/live/after/states/down-1440-light.png differ diff --git a/docs/design/v5/live/after/states/down-2560-dark.png b/docs/design/v5/live/after/states/down-2560-dark.png new file mode 100644 index 0000000..438c95f Binary files /dev/null and b/docs/design/v5/live/after/states/down-2560-dark.png differ diff --git a/docs/design/v5/live/after/states/down-2560-light.png b/docs/design/v5/live/after/states/down-2560-light.png new file mode 100644 index 0000000..fd5dfaf Binary files /dev/null and b/docs/design/v5/live/after/states/down-2560-light.png differ diff --git a/docs/design/v5/live/after/states/down-375-dark.png b/docs/design/v5/live/after/states/down-375-dark.png new file mode 100644 index 0000000..4685805 Binary files /dev/null and b/docs/design/v5/live/after/states/down-375-dark.png differ diff --git a/docs/design/v5/live/after/states/down-375-light.png b/docs/design/v5/live/after/states/down-375-light.png new file mode 100644 index 0000000..53ccb98 Binary files /dev/null and b/docs/design/v5/live/after/states/down-375-light.png differ diff --git a/docs/design/v5/live/after/states/offline-1440-dark.png b/docs/design/v5/live/after/states/offline-1440-dark.png new file mode 100644 index 0000000..0f45c36 Binary files /dev/null and b/docs/design/v5/live/after/states/offline-1440-dark.png differ diff --git a/docs/design/v5/live/after/states/offline-1440-light.png b/docs/design/v5/live/after/states/offline-1440-light.png new file mode 100644 index 0000000..9250a96 Binary files /dev/null and b/docs/design/v5/live/after/states/offline-1440-light.png differ diff --git a/docs/design/v5/live/after/states/offline-2560-dark.png b/docs/design/v5/live/after/states/offline-2560-dark.png new file mode 100644 index 0000000..4ed8209 Binary files /dev/null and b/docs/design/v5/live/after/states/offline-2560-dark.png differ diff --git a/docs/design/v5/live/after/states/offline-2560-light.png b/docs/design/v5/live/after/states/offline-2560-light.png new file mode 100644 index 0000000..d5a3569 Binary files /dev/null and b/docs/design/v5/live/after/states/offline-2560-light.png differ diff --git a/docs/design/v5/live/after/states/offline-375-dark.png b/docs/design/v5/live/after/states/offline-375-dark.png new file mode 100644 index 0000000..9d6ac93 Binary files /dev/null and b/docs/design/v5/live/after/states/offline-375-dark.png differ diff --git a/docs/design/v5/live/after/states/offline-375-light.png b/docs/design/v5/live/after/states/offline-375-light.png new file mode 100644 index 0000000..79fd792 Binary files /dev/null and b/docs/design/v5/live/after/states/offline-375-light.png differ diff --git a/docs/design/v5/live/after/states/quiet-1440-dark.png b/docs/design/v5/live/after/states/quiet-1440-dark.png new file mode 100644 index 0000000..bb91e50 Binary files /dev/null and b/docs/design/v5/live/after/states/quiet-1440-dark.png differ diff --git a/docs/design/v5/live/after/states/quiet-1440-light.png b/docs/design/v5/live/after/states/quiet-1440-light.png new file mode 100644 index 0000000..46273eb Binary files /dev/null and b/docs/design/v5/live/after/states/quiet-1440-light.png differ diff --git a/docs/design/v5/live/after/states/quiet-2560-dark.png b/docs/design/v5/live/after/states/quiet-2560-dark.png new file mode 100644 index 0000000..e1eb500 Binary files /dev/null and b/docs/design/v5/live/after/states/quiet-2560-dark.png differ diff --git a/docs/design/v5/live/after/states/quiet-2560-light.png b/docs/design/v5/live/after/states/quiet-2560-light.png new file mode 100644 index 0000000..8cdc6aa Binary files /dev/null and b/docs/design/v5/live/after/states/quiet-2560-light.png differ diff --git a/docs/design/v5/live/after/states/quiet-375-dark.png b/docs/design/v5/live/after/states/quiet-375-dark.png new file mode 100644 index 0000000..ceca43b Binary files /dev/null and b/docs/design/v5/live/after/states/quiet-375-dark.png differ diff --git a/docs/design/v5/live/after/states/quiet-375-light.png b/docs/design/v5/live/after/states/quiet-375-light.png new file mode 100644 index 0000000..4ebdb61 Binary files /dev/null and b/docs/design/v5/live/after/states/quiet-375-light.png differ diff --git a/docs/design/v5/live/after/states/waiting-1440-dark.png b/docs/design/v5/live/after/states/waiting-1440-dark.png new file mode 100644 index 0000000..bab4802 Binary files /dev/null and b/docs/design/v5/live/after/states/waiting-1440-dark.png differ diff --git a/docs/design/v5/live/after/states/waiting-1440-light.png b/docs/design/v5/live/after/states/waiting-1440-light.png new file mode 100644 index 0000000..8a83d2e Binary files /dev/null and b/docs/design/v5/live/after/states/waiting-1440-light.png differ diff --git a/docs/design/v5/live/after/states/waiting-2560-dark.png b/docs/design/v5/live/after/states/waiting-2560-dark.png new file mode 100644 index 0000000..95b609c Binary files /dev/null and b/docs/design/v5/live/after/states/waiting-2560-dark.png differ diff --git a/docs/design/v5/live/after/states/waiting-2560-light.png b/docs/design/v5/live/after/states/waiting-2560-light.png new file mode 100644 index 0000000..a5540e3 Binary files /dev/null and b/docs/design/v5/live/after/states/waiting-2560-light.png differ diff --git a/docs/design/v5/live/after/states/waiting-375-dark.png b/docs/design/v5/live/after/states/waiting-375-dark.png new file mode 100644 index 0000000..c2c6001 Binary files /dev/null and b/docs/design/v5/live/after/states/waiting-375-dark.png differ diff --git a/docs/design/v5/live/after/states/waiting-375-light.png b/docs/design/v5/live/after/states/waiting-375-light.png new file mode 100644 index 0000000..2317e64 Binary files /dev/null and b/docs/design/v5/live/after/states/waiting-375-light.png differ diff --git a/docs/design/v5/live/after/wall-1440.png b/docs/design/v5/live/after/wall-1440.png new file mode 100644 index 0000000..e71bd7f Binary files /dev/null and b/docs/design/v5/live/after/wall-1440.png differ diff --git a/docs/design/v5/live/after/wall-2560.png b/docs/design/v5/live/after/wall-2560.png new file mode 100644 index 0000000..2e7dca2 Binary files /dev/null and b/docs/design/v5/live/after/wall-2560.png differ diff --git a/docs/design/v5/live/before/live-1440-dark.png b/docs/design/v5/live/before/live-1440-dark.png new file mode 100644 index 0000000..e8f7539 Binary files /dev/null and b/docs/design/v5/live/before/live-1440-dark.png differ diff --git a/docs/design/v5/live/before/live-1440-light.png b/docs/design/v5/live/before/live-1440-light.png new file mode 100644 index 0000000..e8f7539 Binary files /dev/null and b/docs/design/v5/live/before/live-1440-light.png differ diff --git a/docs/design/v5/live/before/live-2560-dark.png b/docs/design/v5/live/before/live-2560-dark.png new file mode 100644 index 0000000..114fdc0 Binary files /dev/null and b/docs/design/v5/live/before/live-2560-dark.png differ diff --git a/docs/design/v5/live/before/live-2560-light.png b/docs/design/v5/live/before/live-2560-light.png new file mode 100644 index 0000000..114fdc0 Binary files /dev/null and b/docs/design/v5/live/before/live-2560-light.png differ diff --git a/docs/design/v5/live/before/live-375-dark.png b/docs/design/v5/live/before/live-375-dark.png new file mode 100644 index 0000000..7331e54 Binary files /dev/null and b/docs/design/v5/live/before/live-375-dark.png differ diff --git a/docs/design/v5/live/before/live-375-light.png b/docs/design/v5/live/before/live-375-light.png new file mode 100644 index 0000000..7331e54 Binary files /dev/null and b/docs/design/v5/live/before/live-375-light.png differ diff --git a/public/app.js b/public/app.js index 68b52ac..ec51513 100644 --- a/public/app.js +++ b/public/app.js @@ -1,15 +1,18 @@ -// live.setkernel.com, v3 "Day" (setkernel-live#48; the design is docs/design/v3/day). One sentence on -// top says who is doing what; under it, the last 24 hours, one lane per engineer, with the Now -// column at the right edge. Live data comes from /api/state and /api/replay, then the WebSocket -// (/ws); ?demo runs a sample day through the same reducers as the Durable Object. Everything shown -// is built with textContent and attributes, never innerHTML, so nothing in a batch can inject markup. +// live.setkernel.com, v5 (setkernel-live#94): Showcase's page around v3's "Day" (setkernel-live#48; +// docs/design/v3/day). One sentence says who is doing what; under it, the last 24 hours, a lane for +// each engineer the feed sends, with the Now column at the right edge. Live data comes from /api/state +// and /api/replay, then the WebSocket (/ws); ?demo runs a sample day through the same reducers as the +// Durable Object. Demo mode (the dialog) walks one real public change in seven steps (lib/walk.js). +// Everything shown is built with textContent and attributes, never innerHTML, so nothing in a batch +// can inject markup. import { ENGINEERS, applyBatch, emptyReplay, homeDay, recordReplay, view } from "/lib/state.js"; -import { OFFLINE_AFTER_MS, createAnnouncer, fitHeadline, freshness, headline, plain, todaySince, zoneName } from "/lib/words.js"; +import { OFFLINE_AFTER_MS, clock, createAnnouncer, fitHeadline, freshness, headline, isSilent, plain, todaySince, zoneName } from "/lib/words.js"; import { reviewers } from "/lib/line.js"; -import { BIN, BINS, keyItems, prep, readout, scrubKey, tableRows } from "/lib/day.js"; +import { BIN, BINS, keyItems, lanesOf, prep, readout, scrubKey, tableRows } from "/lib/day.js"; import { fitWall, pageMode } from "/lib/layout.js"; -import { drawNowList, drawTall, drawWide, fillLegend, fillTable } from "/lib/chart.js"; +import { drawNowList, drawTall, drawWide, fillLegend, fillTable, unit } from "/lib/chart.js"; import { busyDay, downDay, quietDay, runDay } from "/lib/demo.js"; +import { mountStepper, steps } from "/lib/walk.js"; const $ = (id) => document.getElementById(id); const root = document.documentElement; @@ -28,8 +31,11 @@ let D = null, plot = null, scrub = null, mode = null, drawing = false, tableKey const offline = () => Boolean(current.lastIngest) && serverNow() - current.lastIngest > OFFLINE_AFTER_MS; function fillWords() { - const targets = Object.fromEntries(Object.entries(reviewers(current.agents, current.line, ENGINEERS)).map(([author, reviewer]) => [reviewer, author])); - const hl = headline({ ...current, now: serverNow(), timeZone: TZ, names: ENGINEERS, targets }); + // only the engineers the feed sends: no other lane, and no other name in the words + const lanes = lanesOf(current); + const targets = Object.fromEntries(Object.entries(reviewers(current.agents, current.line, lanes)).map(([author, reviewer]) => [reviewer, author])); + const feed = (current.feed ?? []).filter((e) => lanes.includes(e?.agent)); + const hl = headline({ ...current, feed, now: serverNow(), timeZone: TZ, names: lanes, targets }); root.classList.remove("mood-live", "mood-quiet", "mood-offline", "mood-waiting"); root.classList.add(`mood-${hl.mood}`); const h1 = $("headline"); @@ -52,19 +58,55 @@ function fillWords() { // the Halifax day (hq#177, question 5), on the visitor's clock const now = serverNow(); $("chart-sub").textContent = `Times in ${zoneName(now, TZ)}. Today's counts ${todaySince(now, TZ)}.`; + showBanner(hl.mood); showFresh(hl.mood); } +const glyph = (id, g) => $(id).setAttribute("href", `#${g}`); + +// The page's own state, above the headline: nothing when the office is at work. +const BANNERS = { + offline: () => ["g-off", false, `Updates stopped at ${clock(current.lastIngest, TZ)}`, "Everything below is the last picture the page had, kept as it was."], + waiting: () => ["g-wait", true, "Waiting for the first update", "Nothing has arrived yet. Numbers show a dash until they are real, not a zero."], + quiet: () => ["g-info", true, "A quiet spell: nobody is working right now", "The lanes show the day so far. New work appears here by itself."], +}; +function showBanner(mood) { + const b = $("banner"); + b.hidden = !BANNERS[mood]; + if (b.hidden) return; + const [g, calm, head, text] = BANNERS[mood](); + glyph("banner-g", g); + b.classList.toggle("calm", calm); + $("banner-h").textContent = head; + $("banner-t").textContent = text; +} + // "About a minute behind" in place of LIVE (hq#177, question 4): events leave the office 60 s late. // Offline says only how long ago; waiting, and the demo, say nothing of the office. -function showFresh(mood = root.classList.contains("mood-offline") ? "offline" : "live") { +function showFresh(mood = root.classList.contains("mood-offline") ? "offline" : root.classList.contains("mood-waiting") ? "waiting" : "live") { const fresh = DEMO ? "" : freshness(current.lastIngest, serverNow()); $("fresh").textContent = !fresh ? "" : mood === "offline" ? fresh : `About a minute behind · ${fresh}`; + glyph("fresh-g", DEMO ? "g-info" : mood === "offline" ? "g-off" : mood === "waiting" ? "g-wait" : "g-live"); + $("fresh-g").parentNode.toggleAttribute("hidden", !DEMO && !fresh); + showConn(mood, fresh); +} + +// The chip in the top bar: the page's connection in a few words, a glyph beside them, never colour alone. +function showConn(mood, fresh) { + const down = lanesOf(current).filter((n) => isSilent(current.agents?.[n])).length; + const [g, bad, words] = DEMO ? ["g-info", false, "Demo: sample data"] + : mood === "waiting" ? ["g-wait", false, "Waiting for the first update"] + : mood === "offline" ? ["g-off", true, `Offline · last update ${clock(current.lastIngest, TZ)}`] + : down ? ["g-silent", true, `Live · ${down === 1 ? "one engineer" : `${down} engineers`} not reporting`] + : ["g-live", false, `Live · ${fresh}`]; + glyph("conn-g", g); + $("conn").classList.toggle("bad", bad); + $("conn-t").textContent = words; } function render() { if (!$("plot").clientWidth) return; // not laid out (yet): nothing to measure the chart by - mode = pageMode(innerWidth, WALL); + mode = pageMode(innerWidth / unit(), WALL); // in the chart's units: the root font grows with the screen root.dataset.mode = mode; const nowS = Math.floor(serverNow() / 1000); const oldT0 = D?.t0; @@ -156,7 +198,8 @@ function apply(msg) { if (msg.t === "batch" && Array.isArray(msg.events)) { // the page keeps its own copy of the replay buffer up to date, with the same reducer replay = recordReplay(replay, { events: msg.events }, serverNow()); - announcer.add(msg.events); + const lanes = lanesOf(current); + announcer.add(msg.events.filter((e) => lanes.includes(e?.agent))); } render(); } @@ -232,6 +275,18 @@ function startDemo() { }, 2000); } +// ---- Demo mode: a full-screen dialog, drawn the first time it opens; focus goes back to its opener +let stepper = null, opener = null; +function openDemo(ev) { + stepper ??= mountStepper($("steps"), steps(TZ)); + opener = ev.currentTarget; + $("demo").showModal(); +} +$("demo-open").addEventListener("click", openDemo); +$("how-open").addEventListener("click", openDemo); +$("demo-close").addEventListener("click", () => $("demo").close()); +$("demo").addEventListener("close", () => (opener ?? $("demo-open")).focus()); + // keep "updated N s ago" ticking, and the mood, the window and "Today since" moving when nothing arrives setInterval(() => { if (!document.hidden) showFresh(); }, 1000); setInterval(() => { if (!document.hidden) render(); }, 15_000); diff --git a/public/early.js b/public/early.js index a6f8577..4214d4e 100644 --- a/public/early.js +++ b/public/early.js @@ -1,6 +1,6 @@ // Runs before the first paint (a classic script in , since the CSP allows no inline // script): ?wall picks the wall, a fixed 16:9 canvas in one dark theme (hq#177, question 7), so -// nothing shifts or flashes afterwards. The page itself has one theme and stores nothing. +// nothing shifts or flashes afterwards. The page follows the system's light or dark and stores nothing. (() => { if (/[?&]wall(=|&|$)/.test(location.search)) document.documentElement.classList.add("wall"); })(); diff --git a/public/fonts/ibm-plex-mono-latin-500-normal.woff2 b/public/fonts/ibm-plex-mono-latin-500-normal.woff2 new file mode 100644 index 0000000..090f82f Binary files /dev/null and b/public/fonts/ibm-plex-mono-latin-500-normal.woff2 differ diff --git a/public/fonts/manrope-latin-800-normal.woff2 b/public/fonts/manrope-latin-800-normal.woff2 new file mode 100644 index 0000000..b5cd400 Binary files /dev/null and b/public/fonts/manrope-latin-800-normal.woff2 differ diff --git a/public/index.html b/public/index.html index 231ddec..3051381 100644 --- a/public/index.html +++ b/public/index.html @@ -3,23 +3,24 @@ - setkernel live: four AI engineers at work - + setkernel live: a software team you can watch at work + - + + - - + + - - + + @@ -29,39 +30,141 @@ -
-
-

setkernel live

-

-
-
-

Connecting to the office…

-

+ +
+

setkernel live

+

Connecting

+ + Book a live demo +
+ +
+
+
+

A software team you can watch at work.

+

setkernel’s engineers are AI agents. They take an idea to production with tests, screenshots and an independent review at every step, and a person signs off every merge. Below is the team right now, about a minute behind.

+
Book a live demo
+
+ +
-
-
-

The last 24 hours

-

-

Left arrow Right arrow scrub · Shift an hour · [ ] previous or next action · Esc now

+ +
+
+

Right now

+

The team, right now

Our engineers, one lane each, over the last 24 hours. The right edge is now. This is the same view that runs on our office wall.

- -
-

-
+
+
+

+

+
+ +

Connecting to the office…

+

+
+

The last 24 hours

+

One lane each. The right edge is now.

+

Left arrow Right arrow scrub · Shift an hour · [ ] previous or next action · Esc now

+
+ +
+

    +
    + The day as a table +
    +
    +
    +
    + +
    +
    +

    Your daily brief

    +

    What a client reads every morning

    One email, before the working day: what shipped, what is in progress, what needs you. An example, redacted.

    +
    +
    +
    +
    From
    setkernel
    To
    Sent
    Wednesday 4 November, 07:00
    +

    Your daily brief

    +

    Good morning. Three changes shipped yesterday, one is in review, and one question waits for you.

    +

    Shipped

    +
      +
    • The page loads in half the time. Checked in production at 21:19.
    • +
    • Search remembers the last filter. 14 new tests; screenshots in the pull request.
    • +
    • The map loads its tiles once, not twice. Every check passed.
    • +
    +

    In progress

    +

    The new sign-up form: built, in review since 14:11.

    +

    Needs you

    +

    Which wording for the button? Reply A or B; the screenshots are attached.

    +

    Yesterday in numbers

    +

    3 merged · lead time 3.4 h · one check failed and was fixed in 26 min · nothing reverted

    +
    +
    +

    Written from the evidence Every line comes from the pull request, its checks and its screenshots.

    +

    One question at a time Decisions come to you with the options and pictures, and the team keeps working on everything else.

    +

    Nothing to log in to It arrives by email. The live view and demo mode are there when you want more.

    +
    +
    +
    + +
    +
    +
    +

    See it live, on a call

    +

    Thirty minutes. We open demo mode, follow one of our recent changes from idea to production, then talk about yours.

    + Book a live demo +
    +
      +
    1. The team, live, on the view above.
    2. +
    3. One change, step by step: the charter, the evidence, the review, the merge.
    4. +
    5. Your project: what we’d build first, and what the daily brief would say.
    6. +
    -
    - The day as a table -
    -
    -

    +
    +
    +

    What this page never shows

    +

    A private project’s name or link, issue or pull request text, code, a client’s name, or anyone’s usage. People appear by their star names. The page shows only what a rule lets through.

    +
    + +
    + + + +
    + Demo mode +

    Each step shows counts and times only: no titles, numbers or text.

    + +
    +
    +

    One change to this page, in setkernel-live, followed from start to finish. Times are on your clock.

    +
    +
    +
    +

    +

    The last 24 hours

    + + + + + + + + + + diff --git a/public/lib/chart.js b/public/lib/chart.js index 57f1d81..dea9a0a 100644 --- a/public/lib/chart.js +++ b/public/lib/chart.js @@ -2,8 +2,8 @@ // across the page with the Now column (wide, and the wall), across without it (medium), or down // the page (the phone); the Now list, the key and the table. Every string goes in with // textContent, and every colour comes from a class in style.css, so the CSP needs no inline style. -import { STAR_NOTE, ciSummary, clock, stateWords, tally, whenDay, zoneName } from "./words.js"; -import { BIN, BINS, ROWS, band, binTime, ciLabel, label, levels, moment, momentTitle, poleMerges, poleTally, silentLanes } from "./day.js"; +import { ciSummary, clock, stateWords, tally, whenDay, zoneName } from "./words.js"; +import { BIN, BINS, binTime, ciLabel, levels, moment, momentTitle, rowsOf, silentLanes } from "./day.js"; import { GRID, hourRules, labelFits } from "./layout.js"; const SVG_NS = "http://www.w3.org/2000/svg"; @@ -39,25 +39,29 @@ const markCls = (action) => (action === "requested_changes" ? "mark sig" : "mark const STAGE_STYLE = { started: { w: 2.5, cls: "st-building" }, building: { w: 2.5, cls: "st-building" }, review: { w: 5, cls: "st-review" }, fixing: { w: 2.5, cls: "st-fixing", dash: "6 4" } }; const STAGE_STYLE_TALL = { started: { w: 1, cls: "st-started" }, building: { w: 2, cls: "st-building" }, review: { w: 4, cls: "st-review" }, fixing: { w: 2, cls: "st-fixing", dash: "4 4" } }; +// The chart is drawn in the page's own units: 1 at 16 px, larger where the root type grows (2560 +// px), so its words keep the page's size. The SVG is the box's width; its viewBox is that over u. +export const unit = () => parseFloat(getComputedStyle(document.documentElement).fontSize) / 16 || 1; + const sliderAttrs = (label) => ({ tabindex: 0, role: "slider", "aria-label": label, "aria-valuemin": 0, "aria-valuemax": BINS - 1, "aria-valuenow": BINS - 1 }); -// The lanes across: Polaris, the four engineers and CI, time running left to right to now. With +// The lanes across: the engineers the feed sends and CI, time running left to right to now. With // `now` the Now column sits on the right on its own ground (the wide page and the wall). // Returns { svg, drawMoment(i), drawCursor(i), pick(ev) }. export function drawWide(box, D, { tz, offline, now = true }) { const S = GRID; box.textContent = ""; - const W = box.clientWidth; + const u = unit(), W = box.clientWidth / u; const gutR = now ? S.gutR : 0; const px0 = S.gutL + S.gap, px1 = W - gutR - (now ? S.gap : 8), pw = px1 - px0; const x = (ts) => px0 + ((ts - D.t0) / (D.end - D.t0)) * pw; - const rows = ROWS.map((r) => ({ ...r })); + const rows = rowsOf(D); let y = S.axis; for (const r of rows) { r.y = y; r.h = S[r.kind]; y += r.h; } const H = y + 8; const top = S.axis - 8; // where the rules start, above the first row const lab = S.axis - 12; // the axis labels' baseline - const svg = node("svg", { width: W, height: H, viewBox: `0 0 ${W} ${H}`, ...sliderAttrs("The last 24 hours. Use the arrow keys to move through the day.") }, box); + const svg = node("svg", { width: W * u, height: H * u, viewBox: `0 0 ${W} ${H}`, ...sliderAttrs("The last 24 hours. Use the arrow keys to move through the day.") }, box); const bg = node("g", {}, svg), fg = node("g", {}, svg), cur = node("g", {}, svg); const nowX = x(D.nowS); const ys = (r, k) => r.y + k; // a baseline k px down the row @@ -89,10 +93,6 @@ export function drawWide(box, D, { tz, offline, now = true }) { if (r.kind === "eng") { fit(text(g, 0, ys(r, 48), r.id, "t-name"), S.gutL); fit(text(g, 0, ys(r, 72), live ? tally(D.s.byAgent?.[r.id]) : "", "t-meta"), S.gutL); - } else if (r.kind === "pole") { - const n = text(g, 0, ys(r, 28), "Polaris", "t-name"); - text(g, n.getComputedTextLength() + 8, ys(r, 28), STAR_NOTE.Polaris, "t-meta"); - fit(text(g, 0, ys(r, 52), live ? poleTally(D.s.byAgent?.Polaris) : "", "t-meta"), S.gutL); } else if (r.kind === "ci") { text(g, 0, ys(r, 20), "CI", "t-name"); fit(text(g, 0, ys(r, 36), live ? ciSummary(D.s.counts) : "", "t-label"), S.gutL); @@ -112,33 +112,16 @@ export function drawWide(box, D, { tz, offline, now = true }) { if (offline && D.lastS) hatch(D.lastS, D.nowS, rows[0].y, ciRow.y + ciRow.h, `No word since ${clock(D.lastS, tz)}`); if (!D.s.lastIngest) hatch(D.t0, D.nowS, rows[0].y, ciRow.y + ciRow.h, "Nothing has arrived yet"); if (D.ciFrom) hatch(D.t0, D.ciFrom, ciRow.y + 4, ciRow.y + ciRow.h - 4, "Older runs aren't kept"); - if (D.workFrom) for (const r of rows.filter((r) => r.kind === "eng" || r.kind === "pole")) hatch(D.t0, D.workFrom, r.y + 4, r.y + r.h - 4, "Older actions aren't kept"); + if (D.workFrom) for (const r of rows.filter((r) => r.kind === "eng")) hatch(D.t0, D.workFrom, r.y + 4, r.y + r.h - 4, "Older actions aren't kept"); // a VM that stopped reporting (setkernel-live#54): its lane hatched red from the last run const silent = Object.fromEntries(silentLanes(D).map((l) => [l.name, l])); for (const r of rows.filter((r) => silent[r.id])) hatch(silent[r.id].from, silent[r.id].to, r.y + 4, r.y + r.h - 4, null, "f-hatch-sig"); - // engineer lanes: one quiet activity band, and the stage line through the lane + // engineer lanes: the stage line through the lane, and its marks (no activity band: how much + // Claude or chat a lane used is usage, which the page never shows) for (const r of rows.filter((r) => r.kind === "eng")) { - const base = ys(r, 48), bandH = 32, track = ys(r, 68); + const track = ys(r, 56); const down = silent[r.id]; - const sm = band(D, r.id); - if (sm.some((n) => n > 0)) { - let pts = sm.map((n, i) => [x(binTime(D, i) + BIN / 2), base - (bandH * n) / D.maxAct]); - if (down?.lastRun != null) { - // the band stops at the last run, where the hatch begins, so it never runs into it - const xs = x(down.from), k = pts.findIndex(([px]) => px > xs); - if (k >= 0) { - const [[ax, ay], [bx, by]] = [pts[k - 1] ?? [xs, base], pts[k]]; - pts = [...pts.slice(0, k), [xs, ay + ((by - ay) * (xs - ax)) / (bx - ax || 1)]]; - sm.length = pts.length; - } - } - const line = pts.map(([px, py], i) => `${i ? "L" : "M"}${px.toFixed(1)} ${py.toFixed(1)}`).join(""); - node("path", { d: `${line}L${pts.at(-1)[0].toFixed(1)} ${base}L${pts[0][0].toFixed(1)} ${base}Z`, class: "f-band" }, fg); - // the edge only where there is activity: an empty stretch draws nothing, not a second rule - const edge = pts.map(([px, py], i) => (sm[i] > 0 || sm[i - 1] > 0 ? `${i && (sm[i - 1] > 0 || sm[i - 2] > 0) ? "L" : "M"}${px.toFixed(1)} ${py.toFixed(1)}` : "")).join(""); - node("path", { d: edge, class: "s-bar", "stroke-width": 1, "stroke-linejoin": "round" }, fg); - } // the faint track; a VM that stopped reporting: it stops at the last run, with a red end cap const trackTo = down ? x(down.from) : nowX; if (trackTo > px0) node("line", { x1: px0, x2: trackTo, y1: track, y2: track, class: "s-rule-2", "stroke-width": 1 }, fg); @@ -164,12 +147,6 @@ export function drawWide(box, D, { tz, offline, now = true }) { t.setAttribute("text-anchor", "end"); } else t.remove(); } - // Polaris: one quiet tick per merge, on a light rule - for (const r of rows.filter((r) => r.kind === "pole")) { - const yy = ys(r, 40); - node("line", { x1: px0, x2: nowX, y1: yy, y2: yy, class: "s-rule", "stroke-width": 1 }, bg); - for (const w of poleMerges(D)) mark(fg, "tick", x(w.ts), yy, 2 * S.r, label(w, tz), "tick"); - } // CI: one shared row with no owner; a pass is a quiet tick, a failure the red bar const ciY = ciRow.y + 16; for (const c of D.ci) { @@ -209,9 +186,6 @@ export function drawWide(box, D, { tz, offline, now = true }) { text(mom, mx, ys(r, 24), lines[0] ? r.id : "", "t-now-who"); big(ys(r, 48), lines[0] ?? "", lines.idle, lines.state, lines.silent); fit(text(mom, mx, ys(r, 72), lines[1] ?? "", "t-now-detail"), room); - } else if (r.kind === "pole") { - fit(text(mom, mx, ys(r, 28), lines[0] ?? "", "t-now-pole"), room); - fit(text(mom, mx, ys(r, 52), lines[1] ?? "", "t-label"), room); } else { fit(text(mom, mx, ys(r, 20), lines[0] ?? "", "t-now-pole"), room); if (lines[1]) fit(text(mom, mx, ys(r, 36), lines[1], "t-label"), room); @@ -241,25 +215,21 @@ export function drawWide(box, D, { tz, offline, now = true }) { // The phone: time runs down the page, newest at the top, one column per row. export function drawTall(box, D, { tz, offline }) { box.textContent = ""; - const W = box.clientWidth; - const ax = 40, colW = { pole: 24, eng: Math.floor((W - ax - 24 - 24 - 12) / 4), ci: 24 }; + const u = unit(), W = box.clientWidth / u; + const ax = 40, colW = { eng: Math.floor((W - ax - 24 - 6) / D.lanes.length), ci: 24 }; const cols = []; let cx = ax; - for (const r of ROWS) { + for (const r of rowsOf(D)) { if (r.kind === "sep") { cx += 6; continue; } cols.push({ ...r, x: cx, w: colW[r.kind] }); cx += colW[r.kind]; } const top = 70, binH = 5, H = top + BINS * binH + 12; const y = (ts) => top + ((D.end - ts) / (D.end - D.t0)) * BINS * binH; - const svg = node("svg", { width: W, height: H, viewBox: `0 0 ${W} ${H}`, ...sliderAttrs("The last 24 hours, newest first. Use the arrow keys to move through the day.") }, box); + const svg = node("svg", { width: W * u, height: H * u, viewBox: `0 0 ${W} ${H}`, ...sliderAttrs("The last 24 hours, newest first. Use the arrow keys to move through the day.") }, box); const bg = node("g", {}, svg), fg = node("g", {}, svg), cur = node("g", {}, svg); - // headers: the engineers across the top, Polaris set vertically over its narrow column - for (const c of cols) { - if (c.kind === "eng") { text(bg, c.x + c.w / 2, top - 10, c.id, "t-sub t-ink", "middle"); continue; } - if (c.kind === "ci") { text(bg, c.x + c.w / 2, top - 10, "CI", "t-sub", "middle"); continue; } - text(bg, 0, 0, c.id, "t-sub t-ink").setAttribute("transform", `translate(${c.x + c.w / 2 + 4} ${top - 8}) rotate(-90)`); - } + // headers: the engineers across the top, then CI + for (const c of cols) text(bg, c.x + c.w / 2, top - 10, c.kind === "ci" ? "CI" : c.id, c.kind === "ci" ? "t-sub" : "t-sub t-ink", "middle"); node("line", { x1: 0, x2: W, y1: top - 4, y2: top - 4, class: "s-rule" }, bg); for (const { ts, mid } of hourRules(D.t0, D.nowS, D.mid)) { node("line", { x1: mid ? 0 : ax - 4, x2: W, y1: y(ts), y2: y(ts), class: mid ? "s-rule-2" : "s-rule" }, bg); @@ -286,27 +256,20 @@ export function drawTall(box, D, { tz, offline }) { for (const c of cols.filter((c) => silent[c.id])) hatch(silent[c.id].from, silent[c.id].to, c.x + 2, c.x + c.w - 2, null, "f-hatch-sig"); for (const c of cols) { if (c.kind === "eng") { - const left = c.x + 4, barW = c.w * 0.5, track = c.x + c.w * 0.68; + const track = c.x + c.w / 2; const down = silent[c.id]; if (down?.lastRun != null && down.lastRun >= D.t0) node("line", { x1: track - 8, x2: track + 8, y1: y(down.from), y2: y(down.from), class: "st-fixing", "stroke-width": 2 }, fg); - const total = D.total[c.id]; - for (let i = 0; i < BINS; i++) { - if (total[i]) node("rect", { x: left, y: y(binTime(D, i) + BIN), width: Math.max(1.5, (barW * total[i]) / D.maxAct), height: binH, class: "f-band" }, fg); - } for (const sp of D.spans[c.id]) { const st = STAGE_STYLE_TALL[sp.stage]; node("line", { x1: track, x2: track, y1: y(sp.to), y2: Math.max(y(sp.from), y(sp.to) + 1), class: st.cls, "stroke-width": st.w, ...(st.dash ? { "stroke-dasharray": st.dash } : {}) }, fg); } for (const w of D.marks[c.id]) mark(fg, w.action, track, y(w.ts), 4.5, w.title, markCls(w.action)); node("line", { x1: c.x + c.w, x2: c.x + c.w, y1: top, y2: H - 12, class: "s-rule" }, bg); - } else if (c.kind === "ci") { + } else { for (const r of D.ci) { const pass = r.result === "pass"; mark(fg, pass ? "tick" : "ci-fail", c.x + c.w / 2, y(r.ts), pass ? 6 : 5, ciLabel(r, tz), pass ? "tick" : "mark sig").setAttribute("transform", `rotate(90 ${c.x + c.w / 2} ${y(r.ts)})`); } - } else { - node("line", { x1: c.x + c.w / 2, x2: c.x + c.w / 2, y1: top, y2: H - 12, class: "s-rule" }, bg); - for (const w of poleMerges(D)) mark(fg, "tick", c.x + c.w / 2, y(w.ts), 8, label(w, tz), "tick").setAttribute("transform", `rotate(90 ${c.x + c.w / 2} ${y(w.ts)})`); } } node("rect", { class: "plotframe", x: ax - 4, y: top - 2, width: W - ax + 4, height: H - top - 8 }, bg); @@ -344,11 +307,11 @@ export function drawNowList(ul, D, i, { tz, offline }) { ul.textContent = ""; if (!D.s.lastIngest) return; ul.appendChild(el("li", "when", momentTitle(D, i, offline, tz))); - for (const r of ROWS) { + for (const r of rowsOf(D)) { if (r.kind === "sep") continue; const lines = moment(D, r, i, tz); const li = el("li"); - const a = el("span", r.kind === "eng" ? `l1${lines.idle ? " idle" : ""}${lines.silent ? " silent" : ""}` : "l2", lines[0] || (r.kind === "pole" ? poleTally(D.s.byAgent?.Polaris) : "")); + const a = el("span", r.kind === "eng" ? `l1${lines.idle ? " idle" : ""}${lines.silent ? " silent" : ""}` : "l2", lines[0] || ""); if (lines.state && lines[0]) a.prepend(stateShape(lines.state)); const extra = r.kind === "ci" ? [lines[1], ciSummary(D.s.counts)].filter(Boolean).join(" · ") : lines[1] ?? ""; li.append(el("span", "who", r.id), a, el("span", "l2", extra)); @@ -362,12 +325,7 @@ export function fillLegend(ul, items) { for (const it of items) { const li = el("li"); const s = node("svg", { "aria-hidden": "true" }); - if (it.kind === "band") { - s.setAttribute("class", "sw band"); - s.setAttribute("viewBox", "0 0 24 16"); - node("path", { d: "M0 14L6 9L12 11L18 4L24 8V14Z", class: "f-band" }, s); - node("path", { d: "M0 14L6 9L12 11L18 4L24 8", class: "s-bar" }, s); - } else if (it.kind === "stages") { + if (it.kind === "stages") { // the stages as one entry: a short swatch each, the words beside them s.setAttribute("class", `sw sw-${it.stages.length}`); s.setAttribute("viewBox", `0 0 ${it.stages.length * 28 - 4} 16`); @@ -390,7 +348,7 @@ export function fillTable(box, rows, tz) { box.textContent = ""; const t = el("table"); t.appendChild(el("caption", "", rows.length - ? `${rows.length} ${rows.length === 1 ? "action" : "actions"} in the last 24 hours, newest first. Claude requests and chat posts are counted per ten minutes in the chart, not listed.` + ? `${rows.length} ${rows.length === 1 ? "action" : "actions"} in the last 24 hours, newest first.` : "Nothing in the last 24 hours.")); const head = t.createTHead().insertRow(); for (const h of ["Time", "Who", "What"]) { diff --git a/public/lib/day.js b/public/lib/day.js index bdc229b..e4c8b7c 100644 --- a/public/lib/day.js +++ b/public/lib/day.js @@ -1,24 +1,29 @@ -// What the Day page (setkernel-live#48, the design in docs/design/v3/day) shows, worked out from the -// public view and the replay buffer: the 24-hour lanes and their stages, the marks, the Now column's -// words, the key, the table and the scrub readout. Pure: no DOM, so it runs under `node --test`; -// public/lib/chart.js draws what this returns. -import { CI_RECENT, ENGINEERS, POLE, REPLAY_WORK, columnOf, homeMidnight, isRequest } from "./state.js"; +// What the Day page (setkernel-live#48, the design in docs/design/v3/day; v5's "The team, right now", +// setkernel-live#94) shows, worked out from the public view and the replay buffer: the 24-hour lanes +// and their stages, the marks, the Now column's words, the key, the table and the scrub readout. +// Pure: no DOM, so it runs under `node --test`; public/lib/chart.js draws what this returns. +// One lane per engineer the feed sends, then CI: no director's lane, and no one's usage (no Claude +// or chat counts), only what they did. +import { CI_RECENT, ENGINEERS, REPLAY_WORK, columnOf, homeMidnight, isRequest } from "./state.js"; import { STAGE_NAME, STARTED_FOR_S, column, seedLanes, stepLines } from "./line.js"; -import { ACTION_TEXT, OFFLINE_AFTER_MS, age, ciWhere, ciWord, clock, dayOf as dayFrom, deed, doing, isActive, isSilent, sentence } from "./words.js"; +import { ACTION_TEXT, OFFLINE_AFTER_MS, age, ciWhere, ciWord, clock, dayOf as dayFrom, deed, doing, isActive, isSilent } from "./words.js"; export const SPAN = 86_400; // the chart is the last 24 hours export const BIN = 600; // in ten-minute columns export const BINS = SPAN / BIN; -// Polaris's guardians (its three Claude sessions) have no rows: they are a count in Polaris's line. -export const GUARDIANS = POLE.filter((n) => n !== "Polaris"); // Only three marks carry the story; every other action is words (Now column, readout, table). export const KEY_MARKS = ["merged", "requested_changes"]; const PULSES = ["claude", "chat", "helper"]; -// The rows, top to bottom, with a light gap ("sep") between the groups. -export const ROWS = [{ id: "Polaris", kind: "pole" }, { kind: "sep" }, ...ENGINEERS.map((id) => ({ id, kind: "eng" })), { kind: "sep" }, { id: "CI", kind: "ci" }]; +// The lanes: the engineers the feed sends (a state, a lane or a count), in ENGINEERS' order; all +// four before anything has arrived, so the first load has the chart's shape. +export function lanesOf(s) { + const sent = ENGINEERS.filter((n) => s?.agents?.[n] || s?.line?.[n] || s?.byAgent?.[n] || s?.seen?.[n]); + return sent.length ? sent : [...ENGINEERS]; +} +// The rows, top to bottom: a lane each, a light gap ("sep"), then CI. +export const rowsOf = (D) => [...D.lanes.map((id) => ({ id, kind: "eng" })), { kind: "sep" }, { id: "CI", kind: "ci" }]; -const plural = (n, one, many) => `${n} ${n === 1 ? one : many}`; const capital = (s) => s.charAt(0).toUpperCase() + s.slice(1); // The stage a lane's job is in, from its lane alone (no agent state in the replay). @@ -44,6 +49,7 @@ export function prep(s, replay, nowS) { if (i < 0 || i >= BINS) continue; for (const n of ENGINEERS) for (const k of PULSES) bins[n][k][i] += r[1 + columnOf(n, k)] || 0; } + const lanes = lanesOf(s); const work = (replay?.work ?? []).filter((w) => w.ts >= t0 && w.ts <= nowS); const ci = (s?.ci ?? []).filter((c) => c.ts >= t0 && c.ts <= nowS).slice().reverse(); // oldest first @@ -88,17 +94,16 @@ export function prep(s, replay, nowS) { close(n, idle && open[n] && open[n].stage !== "review" && last > open[n].from ? Math.min(last + 60, stop) : stop); } - // Claude requests and chat posts together, per ten minutes: the activity band - const total = Object.fromEntries(ENGINEERS.map((n) => [n, bins[n].claude.map((c, i) => c + bins[n].chat[i])])); + // what the page shows: the lanes' own actions (the director's reviews still move a lane's stage, above) const D = { - s: s ?? {}, nowS, end, t0, lastS, bins, total, work, ci, spans, - maxAct: Math.max(1, ...ENGINEERS.flatMap((n) => total[n])), + s: s ?? {}, nowS, end, t0, lastS, bins, lanes, ci, spans, + work: work.filter((w) => lanes.includes(w.agent)), // where the data stops: older actions or CI runs were dropped by the caps workFrom: (replay?.work ?? []).length >= REPLAY_WORK ? work[0]?.ts ?? null : null, ciFrom: (s?.ci ?? []).length >= CI_RECENT && ci.length ? ci[0].ts : null, mid: homeMidnight(nowS), }; - D.marks = Object.fromEntries(ENGINEERS.map((n) => [n, laneMarks(D, n)])); + D.marks = Object.fromEntries(lanes.map((n) => [n, laneMarks(D, n)])); return D; } @@ -123,9 +128,6 @@ export function laneMarks(D, n, tz) { return [...merges, ...asks].sort((a, b) => a.ts - b.ts); } -// Polaris's row is one idea: a quiet tick per merge. -export const poleMerges = (D) => D.work.filter((w) => w.agent === "Polaris" && w.action === "merged_by"); - // Marks that would sit on top of each other go on separate levels (offsets from the line), so // a burst reads as a stack, not a blot. Time stays exact: only the height moves. export function levels(list, x, gap, offsets) { @@ -138,18 +140,6 @@ export function levels(list, x, gap, offsets) { }); } -// The band for a lane: ten-minute totals smoothed over three. -export function band(D, n) { - const t = D.total[n]; - return t.map((_, i) => ((t[i - 1] ?? t[i]) + 2 * t[i] + (t[i + 1] ?? t[i])) / 4); -} - -// Polaris's numbers today, in tally()'s form -> "3 requests · 20 merges · 3 reviews". -export function poleTally(c) { - const parts = [[c?.requests, "request", "requests"], [c?.merges, "merge", "merges"], [c?.reviews, "review", "reviews"]].filter(([k]) => k > 0).map(([k, a, b]) => plural(k, a, b)); - return parts.length ? parts.join(" · ") : "nothing yet today"; -} - // The lanes of the engineers whose VM stopped reporting (setkernel-live#54): [{ name, lastRun, from, // to }], lastRun null when the time isn't known. The hatch runs from the last run (or the window's // start) to now; when the office has gone quiet, to its last word, where the office's own hatch @@ -157,7 +147,7 @@ export function poleTally(c) { export function silentLanes(D) { if (!D.s.lastIngest) return []; const to = (D.nowS - D.lastS) * 1000 > OFFLINE_AFTER_MS ? D.lastS : D.nowS; - return ENGINEERS.filter((n) => isSilent(D.s.agents?.[n])) + return D.lanes.filter((n) => isSilent(D.s.agents?.[n])) .map((name) => { const lastRun = D.s.agents[name].lastRun ?? null; return { name, lastRun, from: Math.max(D.t0, lastRun ?? D.t0), to }; }) .filter((l) => l.to > l.from); } @@ -182,24 +172,6 @@ export function moment(D, row, i, tz) { return list.length ? list.map((c) => `${capital(ciWord(c))} in ${ciWhere(c)}`).slice(0, 2) : ["No runs"]; } const mine = D.work.filter((w) => w.agent === row.id); - if (row.kind === "pole") { - // Polaris's last action; the guardians as one count (who did what is in the table, the hover - // and the scrub readout) - const guard = D.work.filter((w) => GUARDIANS.includes(w.agent)); - if (i != null) { - const here = inBin(D, mine, i), g = inBin(D, guard, i); - return [ - here.length ? `${capital(ACTION_TEXT[here[0].action])}${here.length > 1 ? `, and ${here.length - 1} more` : ""}` : "", - g.length ? `Guardians: ${g.map((w) => `${w.agent} ${ACTION_TEXT[w.action]}`).join(", ")}` : "", - ]; - } - const last = mine.at(-1); - const per = GUARDIANS.map((n) => [n, guard.filter((w) => w.agent === n).length]).filter(([, k]) => k); - return [ - last ? `${when(last.ts)} ${ACTION_TEXT[last.action]}` : "", - per.length ? `Guardians: ${plural(guard.length, "action", "actions")} · ${per.map(([n, k]) => `${n} ${k}`).join(" · ")}` : "Guardians: nothing in 24 hours", - ]; - } const info = s.agents?.[row.id]; const lastRun = isSilent(info) ? info.lastRun ?? null : null; if (i == null && isSilent(info)) { @@ -231,10 +203,11 @@ export function moment(D, row, i, tz) { const st = stageAt(D, row.id, binTime(D, i) + BIN - 1); const b = D.bins[row.id]; const here = inBin(D, mine, i); - const pulse = [b.claude[i] && plural(b.claude[i], "Claude request", "Claude requests"), b.chat[i] && plural(b.chat[i], "chat post", "chat posts")].filter(Boolean).join(", "); + // Claude requests and chat posts only say the lane was active then, never how many (usage) + const active = b.claude[i] > 0 || b.chat[i] > 0; // the ten minutes after the last run of a VM that is still down if (lastRun && binTime(D, i) >= lastRun) return Object.assign(["Not reporting", st ? STAGE_NAME[st] : ""], { silent: true }); - return [here.length ? `${capital(ACTION_TEXT[here.at(-1).action])}${here.length > 1 ? `, and ${here.length - 1} more` : ""}` : pulse ? capital(pulse) : "No activity", st ? STAGE_NAME[st] : ""]; + return [here.length ? `${capital(ACTION_TEXT[here.at(-1).action])}${here.length > 1 ? `, and ${here.length - 1} more` : ""}` : active ? "Active" : "No activity", st ? STAGE_NAME[st] : ""]; } // The Now column's heading: "Now", "Last word, 15:53" when the office has gone quiet, or the @@ -247,18 +220,17 @@ export function momentTitle(D, i, offline, tz) { // The stages drawn on this day, Started folded into Building (they share a style). export function stagesDrawn(D) { - const on = new Set(ENGINEERS.flatMap((n) => D.spans[n].map((sp) => (sp.stage === "started" ? "building" : sp.stage)))); + const on = new Set(D.lanes.flatMap((n) => D.spans[n].map((sp) => (sp.stage === "started" ? "building" : sp.stage)))); return ["building", "review", "fixing"].filter((st) => on.has(st)); } // The key lists only what this day draws, so it never explains a mark that isn't there: -// [{ kind: "band" | "stages" | "merged" | "requested_changes" | "ci-fail", words, stages? }]. +// [{ kind: "stages" | "merged" | "requested_changes" | "ci-fail" | "silent", words, stages? }]. export function keyItems(D) { const out = []; - if (ENGINEERS.some((n) => D.total[n].some((k) => k > 0))) out.push({ kind: "band", words: "Claude and chat" }); const stages = stagesDrawn(D); if (stages.length) out.push({ kind: "stages", stages, words: stages.map((st) => STAGE_NAME[st]).join(", ") }); - const marks = new Set(ENGINEERS.flatMap((n) => D.marks[n].map((m) => m.action))); + const marks = new Set(D.lanes.flatMap((n) => D.marks[n].map((m) => m.action))); if (marks.has("merged")) out.push({ kind: "merged", words: "Merged" }); if (marks.has("requested_changes")) out.push({ kind: "requested_changes", words: "Changes asked for" }); if (D.ci.some((c) => c.result === "fail")) out.push({ kind: "ci-fail", words: "CI failed" }); @@ -266,7 +238,7 @@ export function keyItems(D) { return out; } -// "The day as a table": every action and CI run, newest first, in deed()'s words; the three key +// "The day as a table": every action on the lanes and CI run, newest first, in deed()'s words; the three key // marks keep their glyph (`mark`). export function tableRows(D) { return [ @@ -281,11 +253,10 @@ export function readout(D, i, tz) { if (i == null) return "Back to now."; const parts = [`${clock(binTime(D, i), tz)} to ${clock(binTime(D, i) + BIN, tz)}.`]; if (!D.s.lastIngest) return `${parts[0]} Nothing has arrived yet.`; - for (const n of ENGINEERS) { + for (const n of D.lanes) { const [what, st] = moment(D, { id: n, kind: "eng" }, i, tz); if (what !== "No activity" || st) parts.push(`${n}: ${[st, what.charAt(0).toLowerCase() + what.slice(1)].filter(Boolean).join(", ")}.`); } - for (const w of inBin(D, D.work, i).filter((w) => !ENGINEERS.includes(w.agent))) parts.push(sentence(w)); for (const c of inBin(D, D.ci, i)) parts.push(`CI ${ciWord(c)} in ${ciWhere(c)}.`); if (parts.length === 1) parts.push("Nothing happened."); return parts.join(" "); diff --git a/public/lib/layout.js b/public/lib/layout.js index 5041683..a85f48d 100644 --- a/public/lib/layout.js +++ b/public/lib/layout.js @@ -2,9 +2,9 @@ // labels and the wall's scale. Pure, so it is tested; public/lib/chart.js and app.js use it. // One grid for every layout: widths, gaps and row heights in multiples of 8 (4 for the half step). -// gutL is the name gutter, gutR the Now column; the rows are Polaris, a lane, CI and the gap -// between groups. The wall uses the same numbers: fitWall scales the whole canvas. -export const GRID = { gutL: 232, gutR: 376, gap: 24, r: 5, axis: 32, pole: 64, eng: 88, ci: 40, sep: 16 }; +// gutL is the name gutter, gutR the Now column; the rows are a lane per engineer, CI and the gap +// between them. The wall uses the same numbers: fitWall scales the whole canvas. +export const GRID = { gutL: 232, gutR: 376, gap: 24, r: 5, axis: 32, eng: 88, ci: 40, sep: 16 }; // The wall is the page drawn once on a fixed 16:9 canvas and scaled whole to the screen. export const WALL = { w: 1440, h: 810 }; diff --git a/public/lib/walk.js b/public/lib/walk.js new file mode 100644 index 0000000..98ff14b --- /dev/null +++ b/public/lib/walk.js @@ -0,0 +1,166 @@ +// Demo mode (setkernel-live#94): one change to this page, followed in seven steps from the idea to +// production. The counts and times are one real public change's evidence, as src/evidence.js keeps +// it (docs/design/v4/showcase/evidence.json, the Day page's build): counts, times and star names, +// never a title, a number, a link or a word of its text. steps() is pure; mountStepper draws it. +import { clock } from "./words.js"; + +const CHANGE = { + repo: "setkernel-live", + idea: { at: "2026-10-15T06:21:15Z", words: 670, criteria: 11 }, + build: { by: "Lyra", commits: 6, files: 45, added: 1934, removed: 2757, opened: "2026-10-15T07:26:00Z", first: "2026-10-15T07:24:15Z", last: "2026-10-15T12:24:09Z" }, + proof: { checks: [["validate", 30]], at: "2026-10-15T12:25:35Z", screenshots: 26, tests: 5 }, + review: { automated: [["2026-10-15T07:30:50Z", 1], ["2026-10-15T08:05:52Z", 0]], peer: { by: "Rigel", at: "2026-10-15T08:19:30Z" } }, + merge: { at: "2026-10-15T14:11:12Z" }, + production: { checks: [["deploy", 344], ["validate", 31]], minutes: 6 }, +}; + +const MIN = 60_000; +const ms = (iso) => Date.parse(iso); +const count = (n) => n.toLocaleString("en-GB"); +// 299.9 min -> "5 h", 405 -> "6 h 45 min", 44 -> "44 min" +export function span(from, to) { + const m = Math.round((ms(to) - ms(from)) / MIN), h = Math.floor(m / 60); + return h < 1 ? `${m} min` : m % 60 ? `${h} h ${m % 60} min` : `${h} h`; +} +const secs = (s) => (s < 60 ? `${s} s` : `${Math.floor(s / 60)} min ${s % 60} s`); +const day = (iso, timeZone) => new Intl.DateTimeFormat("en-GB", { day: "numeric", month: "long", timeZone }).format(new Date(ms(iso))); + +// The seven steps, in the visitor's time zone. Each art is a list of parts mountStepper draws: +// ["bars", n] text left out, ["crit", n] unticked boxes, ["sub", words], ["row", icon, words, time], +// ["tiles", [[value, label]...]], ["shots", n] screenshots, ["bar", [[label, span, cls]...], [length...]] two stretches to scale. +export function steps(timeZone) { + const c = CHANGE, at = (iso) => clock(ms(iso), timeZone); + const checks = (list) => list.map(([name, s]) => ["row", "i-check", name, secs(s)]); + const building = span(c.build.opened, c.build.last), waiting = span(c.build.last, c.merge.at); + return [ + { tab: "Idea", title: "An idea is described", + big: "Someone describes what they want, in plain words, in an issue. No template and no meeting.", + small: `Here the idea was a change to this page, in ${c.repo}.`, + facts: [["By", "a person"], ["Length", `${count(c.idea.words)} words`], ["Written", `${day(c.idea.at, timeZone)}, ${at(c.idea.at)}`]], + art: { title: `Issue · ${c.repo}`, meta: `${count(c.idea.words)} words`, parts: [["bars", 6], ["sub", "The words stay in the issue"]] } }, + { tab: "Charter", title: "A charter: what done means", + big: "Before any code, the work gets its acceptance criteria: plain sentences that say when it is done.", + small: "The review holds the pull request to every one of them, and an unmet one blocks the merge.", + facts: [["Acceptance criteria", String(c.idea.criteria)]], + art: { title: "Acceptance criteria", meta: `${c.idea.criteria} criteria`, parts: [["crit", c.idea.criteria]] } }, + { tab: "Build", title: "The team builds", + big: "An engineer picks it up and works in a pull request, in small commits that each say why.", + small: "The size of the change is a count here, never its code.", + facts: [["Engineer", c.build.by], ["Commits", String(c.build.commits)], ["Files changed", String(c.build.files)], + ["Lines", `+${count(c.build.added)} and −${count(c.build.removed)}`], ["First to last commit", span(c.build.first, c.build.last)]], + art: { title: `Pull request · ${c.repo}`, meta: `${c.build.commits} commits`, parts: [ + ["tiles", [[String(c.build.commits), "Commits"], [String(c.build.files), "Files"], [`+${count(c.build.added)}`, "Lines"]]], + ["row", "g-live", "First commit", at(c.build.first)], ["row", "g-live", "Last commit", at(c.build.last)], ["bars", 3, "thin"]] } }, + { tab: "Evidence", title: "Evidence: tests, screenshots, checks", + big: "Done means proven: tests run, screenshots are attached, and every check passes on the exact commit.", + small: "The screenshots are taken by a script at fixed sizes and kept with the pull request.", + facts: [["Checks", `${c.proof.checks.length} of ${c.proof.checks.length} passed`], ["Screenshots", String(c.proof.screenshots)], ["Test files changed", String(c.proof.tests)]], + art: { title: "Checks", meta: `passed at ${at(c.proof.at)}`, parts: [...checks(c.proof.checks), ["sub", `${c.proof.screenshots} screenshots`], ["shots", c.proof.screenshots]] } }, + { tab: "Review", title: "An independent review", + big: "A second model reviews the change and looks only for what would block it. Every blocker is fixed before the merge.", + small: "The automated review found one blocker, fixed before its second pass found none. Then a second engineer approved.", + facts: [["Automated reviews", String(c.review.automated.length)], ["Blockers found", "1, fixed"], ["Peer review", `approved by ${c.review.peer.by}`]], + art: { title: "Review log", meta: `${c.review.automated.length + 1} entries`, parts: [ + ...c.review.automated.map(([t, n]) => ["row", n ? "g-info" : "i-check", n ? `Automated review: ${n} blocker found` : "Automated review: no blockers", at(t)]), + ["row", "i-check", `${c.review.peer.by}, a second engineer, approved`, at(c.review.peer.at)]] } }, + { tab: "Merge", title: "The merge", + big: "A person reads the evidence and merges. Nothing reaches production without a human sign-off.", + small: "From the pull request opened to merged. The times are this one change's, not an average.", + facts: [["Opened to merged", span(c.build.opened, c.merge.at)], ["Merged by", "a person"], ["Merged at", at(c.merge.at)]], + art: { title: "Opened to merged", meta: span(c.build.opened, c.merge.at), parts: [ + ["bar", [["Opened to last commit", building, "b1"], ["Last commit to merged", waiting, "b2"]], [ms(c.build.last) - ms(c.build.opened), ms(c.merge.at) - ms(c.build.last)]], + ["row", "i-check", "Merged by a person", at(c.merge.at)]] } }, + { tab: "Production", title: "Checked in production", + big: "After the deploy, a smoke check confirms the new version is the one running. If it fails, the deploy rolls back by itself.", + small: "The deploy waited until the page reported the merged version, then checked every route.", + facts: [["Merged to checked", `${c.production.minutes} min`], ["Checks", `${c.production.checks.length} of ${c.production.checks.length} passed`], ["Rolled back", "no"]], + art: { title: "Checks in production", meta: `${c.production.checks.length} of ${c.production.checks.length} passed`, parts: [ + ...checks(c.production.checks), ["row", "i-check", "The running version is the merged version", ""]] } }, + ]; +} + +// ---- drawing: built with textContent and attributes, like the rest of the page +const SVG = "http://www.w3.org/2000/svg"; +function h(tag, attrs = {}, ...kids) { + const e = document.createElement(tag); + for (const [k, v] of Object.entries(attrs)) if (v != null) e.setAttribute(k, String(v)); + for (const k of kids.flat(Infinity)) if (k != null) e.append(k); + return e; +} +function s(tag, attrs = {}, ...kids) { + const e = document.createElementNS(SVG, tag); + for (const [k, v] of Object.entries(attrs)) e.setAttribute(k, String(v)); + e.append(...kids); + return e; +} +export const ico = (id) => s("svg", { class: "ico", viewBox: "0 0 16 16", "aria-hidden": "true", focusable: "false" }, s("use", { href: `#${id}` })); + +// Bars stand in for text the page leaves out; their widths repeat so nothing about them is data. +const WIDTHS = ["w6", "w4", "w5", "w2", "w5", "w1", "w3"]; +const bar = (i, cls = "") => h("i", { class: `rb ${WIDTHS[i % WIDTHS.length]} ${cls}`.trim() }); +const bars = (n, cls) => Array.from({ length: n }, (_, i) => bar(i, cls)); +function part([kind, ...a]) { + if (kind === "bars") return bars(a[0], a[1]); + if (kind === "sub") return h("div", { class: "sub" }, a[0]); + if (kind === "crit") return h("div", { class: "crits", role: "img", "aria-label": `${a[0]} acceptance criteria, their words left out` }, + Array.from({ length: a[0] }, (_, i) => h("div", { class: "crit" }, ico("i-box"), bar(i * 3)))); + if (kind === "row") return h("div", { class: a[0] === "i-check" ? "row ok" : "row" }, ico(a[0]), h("span", {}, a[1]), h("span", { class: "t" }, a[2])); + if (kind === "tiles") return h("div", { class: "tiles" }, a[0].map(([v, k]) => h("div", { class: "tile" }, h("b", {}, v), h("span", {}, k)))); + if (kind === "shots") return h("div", { class: "shots", role: "img", "aria-label": `${a[0]} screenshots` }, Array.from({ length: a[0] }, () => h("i"))); + if (kind === "bar") { + // the two stretches drawn to scale: an SVG, since the CSP allows no style attribute for a width + const [segs, lens] = a, total = lens.reduce((x, y) => x + y, 0); + let x = 0; + const svg = s("svg", { viewBox: `0 0 ${total} 10`, preserveAspectRatio: "none", "aria-hidden": "true", focusable: "false" }, + ...segs.map(([, , cls], i) => { const r = s("rect", { x, y: 0, width: lens[i], height: 10, class: cls }); x += lens[i]; return r; })); + return [h("div", { class: "seg", role: "img", "aria-label": segs.map(([k, v]) => `${k} ${v}`).join(", ") }, svg), + h("div", { class: "seg-l" }, segs.map(([k, v, cls]) => h("span", {}, s("svg", { class: "sw", viewBox: "0 0 14 9", "aria-hidden": "true", focusable: "false" }, s("rect", { width: 14, height: 9, class: cls })), `${k}, ${v}`)))]; + } + return null; +} + +// The stepper: a tab list of the seven steps and one panel; the arrow keys, Home and End move. +export function mountStepper(host, list) { + const id = host.id || "steps"; + let at = 0; + const tabs = h("div", { class: "tabs", role: "tablist", "aria-label": "Seven steps from an idea to production" }); + const panel = h("div", { class: "panel", role: "tabpanel", id: `${id}-p`, tabindex: "-1" }); + const prev = h("button", { type: "button", class: "btn ghost sm" }, ico("i-left"), "Previous"); + const next = h("button", { type: "button", class: "btn sm" }, "Next", ico("i-right")); + const btns = list.map((t, i) => h("button", { type: "button", role: "tab", class: "tab", id: `${id}-t${i}`, "aria-controls": `${id}-p` }, h("span", { class: "n", "aria-hidden": "true" }, String(i + 1)), t.tab)); + btns.forEach((b, i) => b.addEventListener("click", () => go(i))); + prev.addEventListener("click", () => go(at - 1)); + next.addEventListener("click", () => go(at + 1)); + tabs.append(...btns); + tabs.addEventListener("keydown", (e) => { + const k = { ArrowRight: at + 1, ArrowLeft: at - 1, Home: 0, End: list.length - 1 }[e.key]; + if (k === undefined) return; + e.preventDefault(); + go(k, true); + }); + const kb = (...c) => h("span", { class: "kbd", "aria-hidden": "true" }, ...c); + const hint = h("span", { class: "hint" }, kb(ico("i-left")), kb(ico("i-right")), kb("Home"), kb("End"), "to move", + h("span", { class: "sr" }, "Left and right arrow keys, Home and End, move between the steps.")); + function go(i, focus) { + const held = [prev, next].find((b) => b === document.activeElement); // redrawing the panel would drop it + at = Math.max(0, Math.min(list.length - 1, i)); + const t = list[at]; + btns.forEach((b, j) => { b.setAttribute("aria-selected", String(j === at)); b.tabIndex = j === at ? 0 : -1; b.classList.toggle("done", j < at); }); + panel.setAttribute("aria-labelledby", `${id}-t${at}`); + panel.textContent = ""; + panel.append( + h("div", {}, h("p", { class: "kick" }, `Step ${at + 1} of ${list.length}`), h("h3", {}, t.title), h("p", { class: "big" }, t.big), h("p", { class: "small" }, t.small), + h("dl", { class: "facts" }, t.facts.map(([k, v]) => [h("dt", {}, k), h("dd", {}, v)])), h("div", { class: "stepnav" }, prev, next, hint)), + h("div", { class: "art" }, h("header", {}, h("b", {}, t.art.title), h("span", {}, t.art.meta)), h("div", { class: "body" }, t.art.parts.map(part)))); + prev.disabled = at === 0; + next.disabled = at === list.length - 1; + const r = btns[at].getBoundingClientRect(), box = tabs.getBoundingClientRect(); // on a phone the tabs scroll: keep this one in view + tabs.scrollLeft += r.left - box.left - (box.width - r.width) / 2; + if (focus) btns[at].focus(); + else if (held) (held.disabled ? (held === prev ? next : prev) : held).focus(); + } + host.textContent = ""; + host.append(tabs, panel); + go(0); + return { go }; +} diff --git a/public/lib/words.js b/public/lib/words.js index 7d0866b..695f5f7 100644 --- a/public/lib/words.js +++ b/public/lib/words.js @@ -104,9 +104,10 @@ export function doing(info) { return info.repo ? `${what} in ${info.repo}` : what; } -// Today's numbers for one agent -> "2 PRs · 4 reviews · 130 Claude", leaving out zeros. +// Today's numbers for one agent -> "2 PRs · 4 reviews", leaving out zeros. Only what they did: +// never their Claude requests or chat posts, which are usage (setkernel-live#94). export function tally(c) { - const parts = [[c?.prs, "PR", "PRs"], [c?.reviews, "review", "reviews"], [c?.claude, "Claude", "Claude"]].filter(([n]) => n > 0).map(([n, one, many]) => `${n} ${n === 1 ? one : many}`); + const parts = [[c?.prs, "PR", "PRs"], [c?.reviews, "review", "reviews"]].filter(([n]) => n > 0).map(([n, one, many]) => `${n} ${n === 1 ? one : many}`); return parts.length ? parts.join(" · ") : "nothing yet today"; } diff --git a/public/style.css b/public/style.css index 08847c2..1130871 100644 --- a/public/style.css +++ b/public/style.css @@ -1,87 +1,160 @@ -/* live.setkernel.com, v3 "Day" (setkernel-live#48; the design is docs/design/v3/day). - Manrope and IBM Plex Mono, self-hosted (SIL OFL, licences in /fonts). The mono is for clock - times only, so the axis digits share one width. Each face's unicode-range is what its file has - (its cmap, read by test/glyphs.test.mjs), so a character none of them has, such as an arrow, - is an SVG and never falls back to a system font (setkernel-live#80). */ +/* live.setkernel.com, v5 (setkernel-live#94): the Showcase design (setkernel/hq live/showcase) with + the record's place kept (live/record), around v3's Day chart (docs/design/v3/day). + Manrope and IBM Plex Mono, self-hosted (SIL OFL, licences in /fonts). Each face's unicode-range is + what its file has (its cmap, read by test/glyphs.test.mjs), so a character none of them has, such + as an arrow, is an SVG and never falls back to a system font (setkernel-live#80). */ @font-face { font-family: "Manrope"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/manrope-latin-400-normal.woff2") format("woff2"); unicode-range: U+0020-007E, U+00A0-00FF, U+0102, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2013-2014, U+2018-201A, U+201C-201E, U+2022, U+2026, U+2039-203A, U+2044, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; } @font-face { font-family: "Manrope"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/manrope-latin-600-normal.woff2") format("woff2"); unicode-range: U+0020-007E, U+00A0-00FF, U+0102, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2013-2014, U+2018-201A, U+201C-201E, U+2022, U+2026, U+2039-203A, U+2044, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; } +@font-face { font-family: "Manrope"; font-style: normal; font-weight: 800; font-display: swap; src: url("/fonts/manrope-latin-800-normal.woff2") format("woff2"); + unicode-range: U+0020-007E, U+00A0-00FF, U+0102, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2013-2014, U+2018-201A, U+201C-201E, U+2022, U+2026, U+2039-203A, U+2044, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; } @font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); unicode-range: U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+2013-2014, U+2018-201A, U+201C-201E, U+2022, U+2026, U+2032-2033, U+2039-203A, U+2044, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; } +@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); + unicode-range: U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+2013-2014, U+2018-201A, U+201C-201E, U+2022, U+2026, U+2032-2033, U+2039-203A, U+2044, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; } -/* One type scale, one spacing scale. Every font size and every gap below is a step of these two, - the SVG text classes too. The wall is not a second scale: it is the page drawn once on a fixed - 1440 x 810 canvas and scaled whole to the screen (fitWall in public/lib/layout.js). - Every text colour here is checked for contrast in test/page.test.mjs, on the page and on the wall. */ +/* Light, or dark when the system asks; the wall has one fixed dark theme (hq#177, question 7). + The root font grows with the screen, 16 px up to about 1450 px wide and 22 px from 2545, and the + page is set in rem and em. The chart grows with it: chart.js draws it in sixteenths of the root + font, so the SVG's own type scale (--f1 to --f6) stays in its units. The wall is not a second + scale: it is the Day frame drawn once on a fixed 1440 x 810 canvas at 16 px and scaled whole to + the screen (fitWall in public/lib/layout.js). Every text colour here is checked for contrast in + test/page.test.mjs, in light, in dark and on the wall. */ :root { - --bg: #f6f5f1; --surface: #ecebe4; --ink: #18181a; --ink-2: #4a4945; --ink-3: #66645e; - --rule: #e6e3db; --rule-2: #cdc9be; --band: #e1ded4; --bar: #918d82; - --signal: #b42318; --focus: #1d4ed8; + --bg: #f6f5f1; --panel: #fdfcf9; --surface: #ecebe4; --ink: #18181a; --ink-2: #4a4945; --ink-3: #5f5d57; + --rule: #dcd9cf; --rule-2: #8a867c; --bar: #918d82; --signal: #b42318; --ok: #1e6b33; --focus: #1d4ed8; --sans: "Manrope", sans-serif; --mono: "IBM Plex Mono", monospace; --f1: 12px; --f2: 14px; --f3: 16px; --f4: 20px; --f5: 24px; --f6: 32px; - --l1: 16px; --l2: 20px; --l3: 24px; --l5: 32px; --l6: 40px; - --s1: 4px; --s2: 8px; --s3: 16px; --s4: 24px; --s5: 32px; --s6: 48px; + /* the side margin: 3.75vw keeps the 24 hours at least 480 px wide where the Now column first fits + (WIDE_FROM, test/day.test.mjs) */ + --pad: clamp(1rem, 3.75vw, 6rem); color-scheme: light; } -/* The wall has one theme, fixed (hq#177, question 7): dark, for a screen that is on all day. */ +@media (prefers-color-scheme: dark) { + :root:not(.wall) { + --bg: #111214; --panel: #18191c; --surface: #222327; --ink: #eeede9; --ink-2: #c4c2bc; --ink-3: #a3a19b; + --rule: #2c2d31; --rule-2: #6b6a66; --bar: #77756f; --signal: #f2735f; --ok: #5fc77a; --focus: #8fb0ff; + color-scheme: dark; + } +} html.wall { - --bg: #111214; --surface: #1b1c20; --ink: #eeede9; --ink-2: #bdbbb5; --ink-3: #9a9892; - --rule: #232427; --rule-2: #3d3e42; --band: #25262a; --bar: #77756f; - --signal: #f2735f; --focus: #8fb0ff; + --bg: #111214; --panel: #111214; --surface: #1b1c20; --ink: #eeede9; --ink-2: #bdbbb5; --ink-3: #9a9892; + --rule: #232427; --rule-2: #3d3e42; --bar: #77756f; --signal: #f2735f; --ok: #5fc77a; --focus: #8fb0ff; color-scheme: dark; } * { box-sizing: border-box; } -html, body { margin: 0; background: var(--bg); color: var(--ink); } -body { font: 400 var(--f3)/var(--l3) var(--sans); -webkit-font-smoothing: antialiased; font-feature-settings: "tnum"; } +[hidden] { display: none !important; } +html { font-size: clamp(16px, 0.55vw + 8px, 22px); background: var(--bg); color: var(--ink); } +body { margin: 0; font: 400 1rem/1.55 var(--sans); -webkit-font-smoothing: antialiased; font-feature-settings: "tnum"; } +h1, h2, h3, h4, p, ul, ol, dl, dd { margin: 0; } +ul, ol { padding: 0; list-style: none; } b { font-weight: 600; } a { color: inherit; text-underline-offset: 3px; } +button { font: inherit; color: inherit; } a:focus-visible, summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; } +button:focus-visible, .panel:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; } .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; } .defs { position: absolute; width: 0; height: 0; overflow: hidden; } +.mono { font-family: var(--mono); } +/* the page's own glyphs (index.html's defs): stroked in the colour of the text beside them */ +.ico { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.14em; } +.skip { position: absolute; left: .5rem; top: -4rem; z-index: 5; padding: .5rem 1rem; background: var(--ink); color: var(--bg); } +.skip:focus { top: .5rem; } -.day { max-width: 1440px; margin: 0 auto; padding: 0 var(--s6) var(--s6); } -.mast { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--rule); } -.brand { margin: 0; font-size: var(--f3); line-height: var(--l3); font-weight: 600; white-space: nowrap; } +/* buttons */ +.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 2.75rem; padding: 0 1.25rem; border: 1px solid var(--ink); border-radius: 6px; + background: var(--ink); color: var(--bg); font: 600 1rem/1 var(--sans); text-decoration: none; white-space: nowrap; cursor: pointer; } +.btn.ghost { background: transparent; color: var(--ink); border-color: var(--rule-2); } +.btn.sm { min-height: 2.25rem; padding: 0 1rem; font-size: .9375rem; } +.btn:hover { text-decoration: underline; } +.kbd { display: inline-grid; place-items: center; min-width: 1.8em; height: 1.8em; padding: 0 .35em; border: 1px solid var(--rule-2); border-radius: 4px; background: var(--panel); color: var(--ink-2); font: 400 .8125rem var(--mono); } + +/* the bar on top */ +.top { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem 1.75rem; padding: .875rem var(--pad); border-bottom: 1px solid var(--rule); } +.brand { font-weight: 600; font-size: 1.0625rem; white-space: nowrap; } .brand a { text-decoration: none; } .brand a:hover { text-decoration: underline; } .brand span { font-weight: 400; color: var(--ink-2); } -.fresh { margin: 0; font-size: var(--f2); line-height: var(--l2); color: var(--ink-2); text-align: right; } -.lead { padding: var(--s4) 0; max-width: 1080px; } -.lead h1 { margin: 0; font-size: var(--f6); line-height: var(--l6); font-weight: 400; letter-spacing: -0.01em; } -.lead p { margin: var(--s2) 0 0; font-size: var(--f3); line-height: var(--l3); color: var(--ink-2); min-height: var(--l3); } -.mood-offline .lead h1, .mood-waiting .lead h1 { color: var(--ink-2); } -.chart-head { display: flex; align-items: baseline; gap: var(--s3); padding-bottom: var(--s2); } -.chart-head h2 { margin: 0; font-size: var(--f3); line-height: var(--l3); font-weight: 600; white-space: nowrap; } -.chart-head p { margin: 0; font-size: var(--f2); line-height: var(--l2); color: var(--ink-3); } -.plot svg { display: block; overflow: visible; } -.plot svg:focus { outline: none; } -.plot svg:focus-visible .plotframe { stroke: var(--focus); stroke-width: 1; } -.foot { padding-top: var(--s3); margin-top: var(--s2); } -.legend { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); margin: 0; padding: 0; list-style: none; font-size: var(--f1); line-height: var(--l1); color: var(--ink-2); } -.legend li { display: inline-flex; align-items: center; gap: var(--s2); white-space: nowrap; } -.legend svg { width: var(--s3); height: var(--s3); color: var(--ink); flex: none; } -.legend .sw { width: var(--s4); height: var(--s3); } -.legend .sw-2 { width: 52px; } -.legend .sw-3 { width: 80px; } -.keys { margin: 0 0 0 auto; font-size: var(--f1); line-height: var(--l1); color: var(--ink-3); white-space: nowrap; } -.keys kbd { font: var(--f1) var(--mono); border: 1px solid var(--rule-2); border-radius: 3px; padding: 0 var(--s1); color: var(--ink-2); } +.nav { display: flex; flex-wrap: wrap; gap: 0 1.5rem; margin-left: auto; } +.nav a { display: inline-flex; align-items: center; min-height: 2rem; font-size: .9375rem; color: var(--ink-2); text-decoration: none; } +.nav a:hover { color: var(--ink); text-decoration: underline; } +.conn { display: inline-flex; align-items: center; gap: .4rem; padding: .2rem .65rem; border: 1px solid var(--rule-2); border-radius: 99px; font-size: .8125rem; color: var(--ink-2); white-space: nowrap; } +.conn .ico { width: .875rem; height: .875rem; } +.conn.bad { color: var(--ink); border-style: dashed; border-color: var(--signal); } +.conn.bad .ico { color: var(--signal); } + +/* sections */ +.sec { padding: 4.5rem var(--pad); border-top: 1px solid var(--rule); } +.sec-head { display: grid; grid-template-columns: 13rem minmax(0, 1fr); gap: 1rem 2rem; margin-bottom: 2.25rem; } +.lab { font: 500 .8125rem/1.6 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); } +.sec-head .lab { padding-top: .75rem; } +.sec-head h2, .book h2 { font-weight: 400; font-size: clamp(1.75rem, 1.1rem + 1.5vw, 3rem); line-height: 1.15; letter-spacing: -.015em; } +.sec-head p:not(.lab) { margin-top: .75rem; max-width: 46rem; font-size: 1.0625rem; color: var(--ink-2); } + +/* the promise, and the record's place beside it */ +.hero { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 2.5rem clamp(2rem, 6vw, 10rem); align-items: end; padding: clamp(3rem, 6vw, 7rem) var(--pad) clamp(3rem, 5vw, 5rem); } +.hero h1 { max-width: 16em; font-weight: 400; font-size: clamp(2.25rem, 1rem + 3.4vw, 6rem); line-height: 1.05; letter-spacing: -.025em; } +.hero .lede { margin-top: 1.5rem; max-width: 40rem; font-size: 1.1875rem; line-height: 1.55; color: var(--ink-2); } +.hero .btns { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; } +.record { border-top: 1px solid var(--ink); padding-top: 1rem; } +.record .sentence { margin-top: .75rem; font-weight: 600; font-size: 1.5rem; line-height: 1.25; text-wrap: balance; } +.record .sentence b { font-weight: 800; } +.figs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.25rem; margin-top: 1.5rem; } +.fig { border-top: 2px solid var(--ink); padding: .75rem 0 1.2rem; } +.fig h3 { font-size: .875rem; font-weight: 600; color: var(--ink-2); } +.fig .v { margin: .3rem 0 .15rem; font-weight: 800; font-size: clamp(2.25rem, 1.5rem + 1.5vw, 3.75rem); line-height: 1.05; letter-spacing: -.03em; } +.fig .v small { font-weight: 600; font-size: 1rem; letter-spacing: 0; color: var(--ink-2); } +.fig .n { font-size: .875rem; line-height: 1.4; color: var(--ink-2); } + +/* the team, right now: the Day frame, edge to edge */ +.sec.day { padding: 4.5rem 0 0; } +.sec.day .sec-head { padding: 0 var(--pad); } +.frame { padding: 1.5rem var(--pad) 1.75rem; border-top: 1px solid var(--rule); background: var(--panel); } +.dstat { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem; font-size: .875rem; color: var(--ink-2); } +.dstat .fresh { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .1rem .45rem; font-weight: 600; color: var(--ink); } +.dstat .fresh .ico { width: .875rem; height: .875rem; } +#demo-note { font-weight: 400; color: var(--ink-2); } +.mood-offline .dstat .fresh .ico { color: var(--signal); } +.banner { display: flex; gap: .75rem; align-items: flex-start; margin-top: 1rem; padding: .875rem 1.1rem; border: 1px dashed var(--signal); border-radius: 6px; background: var(--surface); } +.banner .ico { width: 1.4rem; height: 1.4rem; margin-top: .1rem; color: var(--signal); } +.banner b { display: block; font-size: 1.0625rem; } +.banner span { color: var(--ink-2); } +.banner.calm { border-style: solid; border-color: var(--rule-2); } +.banner.calm .ico { color: var(--ink-2); } +.headline { max-width: 52em; margin-top: 1.25rem; font-weight: 400; font-size: clamp(1.5rem, 1rem + 1.35vw, 3rem); line-height: 1.22; letter-spacing: -.01em; text-wrap: balance; } +.mood-offline .headline, .mood-waiting .headline { color: var(--ink-2); } +.latest { min-height: 1.55em; margin-top: .6rem; color: var(--ink-2); } +.chart-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem 1rem; margin: 1.75rem 0 .75rem; } +.chart-head h3 { font-size: 1.0625rem; font-weight: 600; white-space: nowrap; } +.chart-head p { font-size: .875rem; color: var(--ink-3); } +.chart-head .keys { margin-left: auto; font-size: .75rem; white-space: nowrap; } +.keys kbd { padding: 0 .25rem; border: 1px solid var(--rule-2); border-radius: 3px; font: .75rem var(--mono); color: var(--ink-2); } /* an arrow drawn, not typed: the fonts' Latin subsets have no left or right arrow. Sized by the text around it, in its colour; the words for it are beside it (#keys) or it is decoration (/usage). */ .arrow { width: 1em; height: 1em; vertical-align: -0.15em; fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; } -.mood-waiting .foot, .mood-waiting .keys { display: none; } -.table { margin-top: var(--s5); font-size: var(--f2); line-height: var(--l2); } -.table summary { cursor: pointer; font-weight: 600; color: var(--ink-2); } +.plot svg { display: block; overflow: visible; } +.plot svg:focus { outline: none; } +.plot svg:focus-visible .plotframe { stroke: var(--focus); stroke-width: 1; } +.legend { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin: 1.1rem 0 0; font-size: .8125rem; line-height: 1.25; color: var(--ink-2); } +.legend li { display: inline-flex; align-items: center; gap: .5rem; white-space: nowrap; } +.legend svg { width: 1rem; height: 1rem; flex: none; color: var(--ink); } +.legend .sw { width: 1.5rem; } +.legend .sw-2 { width: 3.25rem; } +.legend .sw-3 { width: 5rem; } +.mood-waiting .legend, .mood-waiting .keys { display: none; } +.table { margin-top: 1.5rem; font-size: .875rem; line-height: 1.45; } +.table summary { min-height: 1.5rem; font-weight: 600; color: var(--ink-2); cursor: pointer; } .table-scroll { overflow-x: auto; } -.table table { border-collapse: collapse; margin-top: var(--s3); min-width: 560px; } -.table caption { text-align: left; color: var(--ink-3); padding-bottom: var(--s2); } -.table th, .table td { text-align: left; padding: var(--s1) var(--s3) var(--s1) 0; border-bottom: 1px solid var(--rule); vertical-align: top; } +.table table { min-width: 35rem; margin-top: 1rem; border-collapse: collapse; } +.table caption { padding-bottom: .5rem; text-align: left; color: var(--ink-3); } +.table th, .table td { padding: .25rem 1rem .25rem 0; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; } .table th { font-weight: 600; color: var(--ink-2); } -.table td:first-child { font: var(--f1) var(--mono); color: var(--ink-2); white-space: nowrap; } -.table svg { width: var(--s3); height: var(--s3); vertical-align: -3px; margin-right: var(--s2); color: var(--ink); } +.table td:first-child { font: .8125rem var(--mono); color: var(--ink-2); white-space: nowrap; } +.table svg { width: 1rem; height: 1rem; margin-right: .5rem; vertical-align: -3px; color: var(--ink); } -/* svg text: six sizes, two weights (400, 600), mono for clock times only */ +/* svg text: six sizes, two weights (400, 600), mono for clock times only, in the chart's units */ .t-name { font: 600 var(--f3) var(--sans); fill: var(--ink); } .t-sub { font: 600 var(--f2) var(--sans); fill: var(--ink-2); } .t-ink { fill: var(--ink); } @@ -89,7 +162,7 @@ a:focus-visible, summary:focus-visible { outline: 2px solid var(--focus); outlin .t-label { font: 400 var(--f1) var(--sans); fill: var(--ink-3); } .t-axis { font: 400 var(--f1) var(--mono); fill: var(--ink-3); } .t-axis-strong { font: 400 var(--f1) var(--mono); fill: var(--ink); } -.t-cur { font: 400 var(--f1) var(--mono); fill: var(--bg); } +.t-cur { font: 400 var(--f1) var(--mono); fill: var(--panel); } .t-now-h { font: 600 var(--f2) var(--sans); fill: var(--ink); } .t-now-who { font: 600 var(--f1) var(--sans); fill: var(--ink-3); } .t-now-do { font: 600 var(--f4) var(--sans); fill: var(--ink); } @@ -99,23 +172,21 @@ a:focus-visible, summary:focus-visible { outline: 2px solid var(--focus); outlin .t-now-detail { font: 400 var(--f2) var(--sans); fill: var(--ink-2); } .t-now-pole { font: 400 var(--f3) var(--sans); fill: var(--ink); } -/* svg colours, by class, so no style attribute is needed */ +/* svg colours, by class, so no style attribute is needed; the chart's ground is the frame's */ .f-surface { fill: var(--surface); } -.f-bg { fill: var(--bg); } -.f-band { fill: var(--band); } +.f-bg { fill: var(--panel); } .f-hatch { fill: url(#hatch); } .f-focus { fill: var(--focus); } .s-rule { stroke: var(--rule); fill: none; } .s-rule-2 { stroke: var(--rule-2); fill: none; } .s-ink { stroke: var(--ink); } -.s-bar { stroke: var(--bar); fill: none; } .s-focus { stroke: var(--focus); } .st-started { stroke: var(--ink-3); } .st-building { stroke: var(--ink-2); } .st-review { stroke: var(--ink); } .st-fixing { stroke: var(--signal); } -.hatch-ground { fill: var(--bg); } -.hatch-line { stroke: var(--rule-2); } +.hatch-ground { fill: var(--panel); } +.hatch-line { stroke: var(--rule); } .f-hatch-sig { fill: url(#hatch-sig); } /* a VM that stopped reporting (setkernel-live#54) */ .hatch-sig-line { stroke: var(--signal); stroke-opacity: 0.5; } .s-hatch-edge { stroke: var(--rule-2); } @@ -130,39 +201,149 @@ a:focus-visible, summary:focus-visible { outline: 2px solid var(--focus); outlin .mark.st.silent { color: var(--signal); } /* the Now list: above the chart on a phone, and at medium widths where the Now column won't fit */ -.now { margin: 0 0 var(--s4); padding: var(--s2) var(--s3); list-style: none; background: var(--surface); border-radius: var(--s1); } -.now li { display: grid; grid-template-columns: 72px 1fr; gap: 0 var(--s3); padding: var(--s2) 0; border-bottom: 1px solid var(--rule); font-size: var(--f2); line-height: var(--l2); } +.now { margin: 0 0 1.5rem; padding: .5rem 1rem; background: var(--surface); border-radius: 6px; } +.now li { display: grid; grid-template-columns: 4.5rem 1fr; gap: 0 1rem; padding: .5rem 0; border-bottom: 1px solid var(--rule); font-size: .875rem; line-height: 1.45; } .now li:last-child { border-bottom: 0; } -.now .who { font-weight: 600; font-size: var(--f2); color: var(--ink-3); } -.now .l1 { font-weight: 600; font-size: var(--f4); line-height: var(--l3); } +.now .who { font-weight: 600; font-size: .875rem; color: var(--ink-3); } +.now .l1 { font-weight: 600; font-size: 1.25rem; line-height: 1.5rem; } .now .l1 .st { width: 0.84em; height: 0.84em; margin-right: 0.3em; vertical-align: -0.04em; color: var(--ink); } .now .l1.idle { font-weight: 400; color: var(--ink-3); } .now .l1.silent, .now .l1.silent .st { color: var(--signal); } -.now .l2 { color: var(--ink-2); grid-column: 2; } -.now .when { font: var(--f1) var(--mono); color: var(--ink-3); border: 0; padding: 0 0 var(--s1); display: block; } +.now .l2 { grid-column: 2; color: var(--ink-2); } +.now .when { display: block; padding: 0 0 .25rem; border: 0; font: .75rem var(--mono); color: var(--ink-3); } + +/* the daily brief */ +.brief { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 2.5rem clamp(2rem, 6vw, 9rem); align-items: start; } +.mail { padding: 1.75rem 2rem 2rem; border: 1px solid var(--rule-2); border-radius: 8px; background: var(--panel); } +.mail .hd { display: grid; grid-template-columns: 4rem 1fr; gap: .1rem 1rem; margin-bottom: 1.25rem; padding-bottom: 1rem; border-bottom: 1px solid var(--rule); font-size: .875rem; color: var(--ink-2); } +.mail .hd dt { color: var(--ink-3); } +.mail h3 { font-size: 1.6rem; font-weight: 600; line-height: 1.2; } +.mail h3 + p { margin-top: .75rem; } +.mail h4 { margin: 1.4rem 0 .4rem; font: 500 .75rem var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); } +.mail p, .mail li { max-width: 40rem; } +.mail ul { display: grid; gap: .4rem; padding-left: 1.2rem; list-style: disc; } +.red { display: inline-block; width: 4.5em; height: .8em; border-radius: 2px; background: var(--rule-2); vertical-align: -.05em; } +.notes { border-top: 1px solid var(--ink); } +.notes p { padding: 1.1rem 0; border-bottom: 1px solid var(--rule); } +.notes b { display: block; font-size: 1.125rem; } +.notes span { display: block; max-width: 34rem; margin-top: .2rem; color: var(--ink-2); } + +/* see it live, on a call */ +.book { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem clamp(2rem, 6vw, 9rem); align-items: start; } +.book p { max-width: 34rem; margin-top: .75rem; font-size: 1.0625rem; color: var(--ink-2); } +.book .btn { margin-top: 1.5rem; } +.book ol { display: grid; gap: .9rem; padding-left: 1.4rem; list-style: decimal; font-size: 1.0625rem; } +/* what the page never shows */ +.foot { display: flex; flex-wrap: wrap; gap: 1.5rem 3rem; justify-content: space-between; align-items: flex-start; padding: 2rem var(--pad) 5rem; border-top: 1px solid var(--rule); font-size: .875rem; color: var(--ink-2); } +.foot h2 { margin-bottom: .35rem; font-size: .9375rem; font-weight: 600; color: var(--ink); } +.foot p { max-width: 52rem; } + +/* Demo mode: a full-screen dialog, the steps one size larger */ +dialog.demo { width: 100vw; height: 100vh; max-width: none; max-height: none; padding: 0; border: 0; background: var(--bg); color: var(--ink); overflow: auto; } +dialog.demo::backdrop { background: var(--bg); } +.dbar { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.5rem; padding: .875rem var(--pad); border-bottom: 1px solid var(--rule); background: var(--surface); } +.dbar b { font-size: 1.125rem; } +.dbar p { flex: 1 1 24rem; max-width: 52rem; font-size: .875rem; color: var(--ink-2); } +.dbar .btn { margin-left: auto; } +.dbody { max-width: 120rem; margin: 0 auto; padding: 2rem var(--pad) 3rem; } +.ex { margin-bottom: 1.25rem; font-size: .9375rem; color: var(--ink-2); } +.stepper { font-size: 1.3rem; } +.tabs { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .6rem; } +.tab { display: flex; align-items: center; gap: .6rem; min-height: 3rem; padding: .5rem .25rem 0; border: 0; border-top: 3px solid var(--rule); background: transparent; text-align: left; font-weight: 600; color: var(--ink-3); cursor: pointer; } +.tab .n { display: inline-grid; place-items: center; width: 1.7em; height: 1.7em; flex: none; border: 1px solid var(--rule-2); border-radius: 50%; font: 500 .8125em var(--mono); color: var(--ink-2); } +.tab[aria-selected="true"] { border-top-color: var(--ink); color: var(--ink); } +.tab[aria-selected="true"] .n { border-color: var(--ink); background: var(--ink); color: var(--bg); } +.tab.done { border-top-color: var(--ink-3); color: var(--ink-2); } +.panel { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 2rem clamp(2rem, 5vw, 7rem); min-height: 25rem; padding: 2.25rem 0 1.5rem; } +.panel .kick { font: 400 .8125em/1.4 var(--mono); color: var(--ink-3); } +.panel h3 { margin-top: .5rem; font-size: 1.75em; font-weight: 600; line-height: 1.2; letter-spacing: -.01em; } +.panel .big { margin-top: 1rem; font-size: 1.3em; line-height: 1.4; } +.panel .small { max-width: 38em; margin-top: 1rem; color: var(--ink-2); } +.facts { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1.5rem; margin-top: 1.5rem; } +.facts dt { color: var(--ink-3); } +.facts dd { font-weight: 600; } +.stepnav { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-top: 1.5rem; } +.stepnav .hint { display: inline-flex; align-items: center; gap: .4rem; margin-left: auto; font-size: .8125rem; color: var(--ink-3); } +.stepnav .btn[disabled] { background: transparent; border-color: var(--rule); color: var(--ink-3); cursor: default; text-decoration: none; } +.art { align-self: start; border: 1px solid var(--rule-2); border-radius: 8px; background: var(--panel); } +.art > header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .25rem 1rem; padding: 1rem 1.4rem; border-bottom: 1px solid var(--rule); } +.art > header span { font-size: .875em; color: var(--ink-2); } +.art .body { display: grid; gap: .75rem; padding: 1.25rem 1.4rem 1.4rem; } +/* bars stand in for words the page leaves out */ +.rb { display: block; height: .62em; border-radius: 2px; background: var(--rule-2); } +.rb.thin { height: .38em; } +.w1 { width: 42%; } .w2 { width: 58%; } .w3 { width: 66%; } .w4 { width: 80%; } .w5 { width: 88%; } .w6 { width: 96%; } +.sub { margin-top: .5rem; font: 500 .75em var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); } +.crits { display: grid; gap: .55rem; } +.crit { display: flex; align-items: center; gap: .8rem; } +.crit .ico { width: 1.2em; height: 1.2em; color: var(--ink-2); } +.row { display: grid; grid-template-columns: 1.4em minmax(0, 1fr) auto; align-items: center; gap: .8rem; padding: .5rem 0; border-bottom: 1px solid var(--rule); } +.row:last-child { border-bottom: 0; } +.row .ico { width: 1.2em; height: 1.2em; color: var(--ink-2); } +.row.ok .ico { color: var(--ok); } /* a check that passed; the words beside it say so */ +.row .t { font: 400 .8125em var(--mono); color: var(--ink-2); } +.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; } +.tile { padding: .7rem .9rem; border: 1px solid var(--rule); border-radius: 6px; } +.tile b { display: block; font-size: 1.6em; line-height: 1.1; } +.tile span { font-size: .8125em; color: var(--ink-2); } +.shots { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .5rem; } +.shots i { display: block; aspect-ratio: 16 / 10; border: 1px solid var(--rule-2); border-radius: 3px; + background: linear-gradient(var(--rule-2) 0 0) 8% 22% / 54% 12% no-repeat, linear-gradient(var(--rule-2) 0 0) 8% 48% / 78% 9% no-repeat, linear-gradient(var(--rule-2) 0 0) 8% 70% / 38% 9% no-repeat; } +.seg svg { display: block; width: 100%; height: 2.2rem; } +.seg-l { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; font-size: .8125em; color: var(--ink-2); } +.seg-l span { display: inline-flex; align-items: center; gap: .4rem; } +.seg-l .sw { width: 1.4em; height: .9em; } +.b1 { fill: var(--ink); } +.b2 { fill: var(--bar); } + +/* narrower: one column where two would crowd */ +@media (max-width: 1099px) { + .hero { grid-template-columns: 1fr; align-items: start; } + .brief { grid-template-columns: 1fr; } + .mail { padding: 1.25rem 1.1rem 1.5rem; } + .panel { grid-template-columns: 1fr; min-height: 0; } +} +@media (max-width: 899px) { + .sec { padding: 3rem var(--pad); } + .sec.day { padding: 3rem 0 0; } + .sec-head { grid-template-columns: 1fr; gap: 0; } + .sec-head .lab { padding: 0 0 .5rem; } + .book { grid-template-columns: 1fr; } +} /* the phone: the lanes run down the page under the Now list */ @media (max-width: 719px) { - html:not(.wall) .day { padding: 0 var(--s3) var(--s5); } - html:not(.wall) .lead h1 { font-size: var(--f5); line-height: var(--l5); } - html:not(.wall) .lead p { font-size: var(--f2); line-height: var(--l2); } - html:not(.wall) .fresh { font-size: var(--f1); line-height: var(--l1); } - html:not(.wall) .chart-head { flex-direction: column; gap: 0; } + html:not(.wall) .nav { order: 5; width: 100%; margin-left: 0; gap: 0 1.25rem; } + html:not(.wall) .top .btn { margin-left: auto; } + html:not(.wall) .conn { order: 4; } + html:not(.wall) .frame { padding-left: 1rem; padding-right: 1rem; } + html:not(.wall) .headline { font-size: 1.5rem; } + html:not(.wall) .dstat { font-size: .8125rem; } html:not(.wall) .keys { display: none; } html:not(.wall) .table table { min-width: 0; width: 100%; } html:not(.wall) .wide-only { display: none; } + html:not(.wall) .foot { padding-bottom: 3rem; } + .stepper { font-size: 1.1rem; } + .tabs { display: flex; gap: .5rem; padding-bottom: .5rem; overflow-x: auto; scrollbar-width: thin; } + .tab { flex: none; padding-right: .75rem; } + .stepnav .hint { display: none; } + .shots { grid-template-columns: repeat(4, minmax(0, 1fr)); } } /* no keyboard hint where there is likely no keyboard */ -@media (hover: none) and (pointer: coarse) { .keys { display: none; } } +@media (hover: none) and (pointer: coarse) { .keys, .stepnav .hint { display: none; } } -/* the wall: the 1440 x 810 canvas (16:9), scaled whole to the screen by fitWall. On a 2560 x 1440 - wall that is 1.78 times, so the type runs from 21 px (the axis) to 57 px (the headline). */ +/* the wall: only the Day frame, on the 1440 x 810 canvas (16:9) at 16 px, scaled whole to the screen + by fitWall. On a 2560 x 1440 wall that is 1.78 times, so the type runs from 21 px (the axis) to + 57 px (the headline). Nothing here may depend on the window's size (vw). */ +html.wall { font-size: 16px; } html.wall, html.wall body { height: 100%; overflow: hidden; } -html.wall .day { position: absolute; left: 0; top: 0; width: 1440px; height: 810px; max-width: none; margin: 0; padding: 0 var(--s6) var(--s3); overflow: hidden; transform-origin: 0 0; } -html.wall .lead { padding: var(--s3) 0; max-width: none; } -html.wall .foot { padding-top: var(--s2); margin-top: 0; } +html.wall .skip, html.wall .top, html.wall .hero, html.wall .sec-head, html.wall .sec:not(.day), html.wall .foot { display: none; } +html.wall .sec.day { padding: 0; border: 0; } +html.wall .frame { position: absolute; left: 0; top: 0; width: 1440px; height: 810px; margin: 0; padding: 1rem 3rem; border: 0; overflow: hidden; transform-origin: 0 0; } +html.wall .headline { max-width: none; margin-top: .75rem; font-size: 2rem; line-height: 1.25; } +html.wall .chart-head { margin: 1rem 0 .5rem; } +html.wall .legend { margin-top: .5rem; } html.wall .keys, html.wall .table { display: none; } -html.wall .legend .band { width: var(--s3); } /* nothing on the page moves, but in case a browser animates anything: not under reduced motion */ @media (prefers-reduced-motion: reduce) { diff --git a/test/day.test.mjs b/test/day.test.mjs index 12c6667..0d9a1b9 100644 --- a/test/day.test.mjs +++ b/test/day.test.mjs @@ -4,7 +4,7 @@ import test from "node:test"; import assert from "node:assert/strict"; import { ENGINEERS, cleanEvent } from "../src/logic.js"; -import { BIN, BINS, activeBins, chartWindow, keyItems, moment, momentTitle, poleTally, prep, readout, scrubKey, silentLanes, tableRows } from "../public/lib/day.js"; +import { BIN, BINS, activeBins, chartWindow, keyItems, lanesOf, moment, momentTitle, prep, readout, rowsOf, scrubKey, silentLanes, tableRows } from "../public/lib/day.js"; import { GRID, WALL, fitWall, hourRules, labelFits, pageMode } from "../public/lib/layout.js"; import { busyDay, downDay, quietDay, runDay } from "../public/lib/demo.js"; @@ -119,18 +119,21 @@ test("the Now column: a stage from before yesterday names its day, not \"yesterd assert.deepEqual(say("Rigel"), ["Idle", "Waiting for review since Mon 12 Oct 10:00"]); }); -test("the Now column: Polaris's last action and the guardians as one count; CI's last run", () => { +test("the rows are the engineers the feed sends, then CI: no director's or guardians' lane (setkernel-live#94)", () => { const D = day([ gh("Kochab", "opened_pr", adt(9, 0)), gh("Kochab", "merged", adt(9, 30)), gh("Pherkad", "opened_pr", adt(10, 0)), gh("Polaris", "merged_by", adt(9, 30)), gh("Polaris", "approved", adt(15, 58), "setkernel-live"), { t: "msg", kind: "ci", result: "fail", repo: "setkernel-live", ts: adt(16, 30) }, ]); - assert.deepEqual(moment(D, { id: "Polaris", kind: "pole" }, null, TZ), ["15:58 approved a teammate's pull request", "Guardians: 3 actions · Kochab 2 · Pherkad 1"]); + assert.deepEqual(rowsOf(D).map((r) => r.id ?? r.kind), [...ENGINEERS, "sep", "CI"]); assert.deepEqual(moment(D, { id: "CI", kind: "ci" }, null, TZ), ["Failed, 16:30", "in setkernel-live"]); - const i = Math.floor((adt(9, 30) - D.t0) / BIN); - assert.deepEqual(moment(D, { id: "Polaris", kind: "pole" }, i, TZ), ["Merged a pull request", "Guardians: Kochab had a pull request merged"]); - assert.equal(poleTally(D.s.byAgent.Polaris), "1 merge · 1 review"); - assert.equal(poleTally(undefined), "nothing yet today"); + // their actions are on no lane, in no key and in no row of the table + assert.deepEqual(Object.keys(D.marks), ENGINEERS); + assert.deepEqual(tableRows(D).map((r) => r.who), ["CI"]); + assert.equal(readout(D, Math.floor((adt(9, 30) - D.t0) / BIN), TZ), "09:30 to 09:40. Nothing happened."); + // only the engineers the feed sends get a lane; before anything arrives, all four, empty + assert.deepEqual(lanesOf({ agents: { Lyra: { state: "IDLE" }, Polaris: { state: "WORKING" } }, seen: { Vega: 1 } }), ["Vega", "Lyra"]); + assert.deepEqual(lanesOf({}), ENGINEERS); // nothing has arrived: the column is empty assert.deepEqual(moment(prep({}, {}, NOW), { id: "Vega", kind: "eng" }, null, TZ), []); }); @@ -153,13 +156,13 @@ test("the key lists only what the day draws", () => { // the quiet day: no change was asked for, so no ✕ in the key const q = runDay(quietDay(NOW).batches); const Q = prep(q.state, q.replay, NOW); - assert.deepEqual(kinds(Q), ["band", "stages", "merged", "ci-fail"]); - assert.deepEqual(keyItems(Q)[1], { kind: "stages", stages: ["building", "review"], words: "Building, In review" }); - // the busy day draws all five + assert.deepEqual(kinds(Q), ["stages", "merged", "ci-fail"]); + assert.deepEqual(keyItems(Q)[0], { kind: "stages", stages: ["building", "review"], words: "Building, In review" }); + // the busy day draws all four const b = runDay(busyDay(NOW).batches); const B = prep(b.state, b.replay, NOW); - assert.deepEqual(kinds(B), ["band", "stages", "merged", "requested_changes", "ci-fail"]); - assert.equal(keyItems(B)[1].words, "Building, In review, Fixing"); + assert.deepEqual(kinds(B), ["stages", "merged", "requested_changes", "ci-fail"]); + assert.equal(keyItems(B)[0].words, "Building, In review, Fixing"); // a pass alone draws a quiet tick, which has no key entry const P = day([{ t: "msg", kind: "ci", result: "pass", ts: adt(12, 0) }]); assert.deepEqual(kinds(P), []); @@ -261,7 +264,7 @@ test("not reporting, scrubbed: the ten-minute columns after the last run say so, assert.equal(at(14, 10).silent, true); assert.deepEqual([...at(16, 30)], ["Not reporting", "In review"]); assert.deepEqual([...at(14, 0)], ["No activity", "In review"], "the column holding the last run is as it was"); - assert.deepEqual([...at(13, 50)], ["1 Claude request", "In review"]); + assert.deepEqual([...at(13, 50)], ["Active", "In review"], "active, never how many requests (setkernel-live#94)"); assert.equal(readout(D, col(15, 0), TZ), "15:00 to 15:10. Lyra: Building, started on an issue. Orion: In review, not reporting."); // no time: the columns are as they were assert.deepEqual([...moment(silentDay(null), { id: "Orion", kind: "eng" }, col(15, 0), TZ)], ["No activity", "In review"]); diff --git a/test/glyphs.test.mjs b/test/glyphs.test.mjs index 658b17d..68c8a45 100644 --- a/test/glyphs.test.mjs +++ b/test/glyphs.test.mjs @@ -79,7 +79,7 @@ const faces = [...read("style.css").matchAll(/@font-face\s*{([^}]*)}/g)].map(([, }); test("each @font-face declares the unicode-range its file has", () => { - assert.equal(faces.length, 3, "Manrope 400 and 600, IBM Plex Mono 400"); + assert.equal(faces.length, 5, "Manrope 400, 600 and 800, IBM Plex Mono 400 and 500"); for (const { name, url, declared, has } of faces) { assert.ok(declared, `${name} (${url}) declares no unicode-range, so it claims every character`); const printable = (set) => [...set].filter((cp) => cp >= 0x20).sort((a, b) => a - b).map(hex); diff --git a/test/page-logic.test.mjs b/test/page-logic.test.mjs index b0547ee..fedc355 100644 --- a/test/page-logic.test.mjs +++ b/test/page-logic.test.mjs @@ -129,7 +129,7 @@ test("labels, tallies and feed sentences", () => { assert.deepEqual(stateWords({ state: "PAUSED" }), { state: "Paused", words: "paused", repo: "" }); assert.deepEqual(stateWords(undefined), { state: "Idle", words: "idle", repo: "" }); assert.equal(deed({ agent: "Vega", action: "opened_pr", repo: "hq" }), "opened a pull request in hq"); - assert.equal(tally({ prs: 2, reviews: 4, claude: 130, started: 3, helpers: 1 }), "2 PRs · 4 reviews · 130 Claude"); + assert.equal(tally({ prs: 2, reviews: 4, claude: 130, started: 3, helpers: 1 }), "2 PRs · 4 reviews", "never a person's Claude use (setkernel-live#94)"); assert.equal(tally({ prs: 1, reviews: 1, started: 1 }), "1 PR · 1 review"); assert.equal(tally(undefined), "nothing yet today"); assert.equal(sentence({ agent: "Orion", action: "decision_pr" }), "Orion wrote up a decision in a private project."); diff --git a/test/page.test.mjs b/test/page.test.mjs index 99b5e05..5610241 100644 --- a/test/page.test.mjs +++ b/test/page.test.mjs @@ -42,7 +42,7 @@ test("index.html and style.css fetch nothing from another host", () => { for (const f of scripts()) assert.doesNotMatch(read(f), /fetch\(\s*["'`]https?:/, `${f} fetches only from this origin`); }); -test("fonts: Manrope 400 and 600 and IBM Plex Mono 400, self-hosted woff2 with their licences, nothing unused", () => { +test("fonts: Manrope 400, 600 and 800 and IBM Plex Mono 400 and 500, self-hosted woff2 with their licences, nothing unused", () => { const css = read("style.css"); const faces = [...css.matchAll(/@font-face\s*{([^}]*)}/g)].map((m) => m[1]); const used = new Set(); @@ -55,7 +55,10 @@ test("fonts: Manrope 400 and 600 and IBM Plex Mono 400, self-hosted woff2 with t assert.equal(readFileSync(file).subarray(0, 4).toString("latin1"), "wOF2", url); used.add(url.slice("/fonts/".length)); } - assert.deepEqual([...used].sort(), ["ibm-plex-mono-latin-400-normal.woff2", "manrope-latin-400-normal.woff2", "manrope-latin-600-normal.woff2"]); + assert.deepEqual([...used].sort(), [ + "ibm-plex-mono-latin-400-normal.woff2", "ibm-plex-mono-latin-500-normal.woff2", + "manrope-latin-400-normal.woff2", "manrope-latin-600-normal.woff2", "manrope-latin-800-normal.woff2", + ]); const files = readdirSync(new URL("fonts/", pub)); assert.deepEqual(files.filter((f) => f.endsWith(".woff2")).sort(), [...used].sort(), "no unused font files"); for (const licence of ["OFL-Manrope.txt", "OFL-IBM-Plex-Mono.txt"]) { @@ -64,7 +67,7 @@ test("fonts: Manrope 400 and 600 and IBM Plex Mono 400, self-hosted woff2 with t // the preloads are the faces the page uses for (const m of read("index.html").matchAll(/ { const at = css.indexOf(`\n${selector} {`); @@ -115,6 +118,8 @@ const block = (selector) => { }; const hexes = (text) => Object.fromEntries([...text.matchAll(/--([\w-]+):\s*(#[0-9a-f]{6})/gi)].map((m) => [m[1], m[2]])); const page = hexes(block(":root")); +const darkAt = css.indexOf("@media (prefers-color-scheme: dark)"); +const dark = { ...page, ...hexes(css.slice(darkAt, css.indexOf("\n}\n", darkAt))) }; const wall = { ...page, ...hexes(block("html.wall")) }; const luminance = (hex) => { const [r, g, b] = [1, 3, 5].map((i) => parseInt(hex.slice(i, i + 2), 16) / 255) @@ -126,40 +131,45 @@ const contrast = (vars, a, b) => { return (hi + 0.05) / (lo + 0.05); }; -// Text sits on the page ground (--bg) and on the Now column's and Now list's (--surface). +// Text sits on the page ground (--bg), on the Day frame's and the cards' (--panel) and on the Now +// column's, the Now list's and the banners' (--surface). // Every new text colour goes in TEXT; marks and lines that carry data go in MARKS. // --signal is text too: "Not reporting" in the Now column and the Now list (setkernel-live#54). const TEXT = ["ink", "ink-2", "ink-3", "signal"]; -const MARKS = ["ink", "ink-2", "ink-3", "signal", "bar"]; -for (const [name, vars] of [["Page", page], ["Wall", wall]]) { +const MARKS = ["ink", "ink-2", "ink-3", "signal", "bar", "ok"]; +for (const [name, vars] of [["Page", page], ["Dark", dark], ["Wall", wall]]) { test(`${name}: every text colour meets WCAG AA on both grounds, AAA for names and body text`, () => { const check = (fg, bg, min) => { const ratio = contrast(vars, fg, bg); assert.ok(ratio >= min, `${name}: --${fg} on --${bg} is ${ratio.toFixed(2)}:1, under ${min}:1`); }; - for (const bg of ["bg", "surface"]) { + for (const bg of ["bg", "surface", "panel"]) { for (const fg of ["ink", "ink-2"]) check(fg, bg, 7); for (const fg of TEXT) check(fg, bg, 4.5); } - // the scrub cursor's time: the ground's colour on the focus colour - check("bg", "focus", 4.5); - // the stage lines, the marks, the ticks and the band's edge: at least 3:1 (WCAG 1.4.11) on the chart's ground - for (const fg of MARKS) check(fg, "bg", 3); - check("focus", "bg", 3); + // the scrub cursor's time: the chart's ground colour on the focus colour + check("panel", "focus", 4.5); + // the stage lines, the marks and the ticks: at least 3:1 (WCAG 1.4.11) on the chart's ground and the page's + for (const bg of ["bg", "panel"]) { + for (const fg of MARKS) check(fg, bg, 3); + check("focus", bg, 3); + } }); } test("every text colour in style.css is one the contrast test checks", () => { const colours = new Set(); for (const m of css.matchAll(/(?:^|[\s;{])(?:color|fill):\s*var\(--([\w-]+)\)/g)) colours.add(m[1]); - const fills = new Set(["surface", "bg", "band", "focus"]); // grounds and shapes, not text: checked above as grounds or marks + const fills = new Set(["surface", "bg", "panel", "focus"]); // grounds and shapes, not text: checked above as grounds or marks for (const c of colours) assert.ok(TEXT.includes(c) || MARKS.includes(c) || fills.has(c), `--${c} is used as a colour but not checked`); }); -test("the wall has one fixed dark theme; the page has one theme and no toggle", () => { +test("the page follows the system's light or dark, the wall has one fixed dark theme, and there is no toggle", () => { assert.ok(luminance(wall.bg) < 0.02, "the wall is dark"); assert.ok(luminance(page.bg) > 0.85, "the page is light"); - assert.doesNotMatch(css, /prefers-color-scheme/, "neither follows the system's light or dark"); + assert.ok(luminance(dark.bg) < 0.02, "and dark when the system is"); + assert.equal(css.match(/prefers-color-scheme/g).length, 1, "one dark palette"); + assert.match(css, /@media \(prefers-color-scheme: dark\) \{\s*:root:not\(\.wall\) \{/, "which the wall never takes"); assert.doesNotMatch(read("index.html"), /data-pick|aria-label="Theme"/, "no Day/Night toggle"); for (const f of scripts()) assert.doesNotMatch(read(f), /localStorage|sessionStorage/, `${f} stores nothing`); }); @@ -181,8 +191,12 @@ test("no tiny type: nothing in style.css is set under 12px", () => { let checked = 0; const vars = Object.fromEntries([...css.matchAll(/--(f\d):\s*(\d+)px/g)].map((m) => [m[1], Number(m[2])])); assert.deepEqual(vars, { f1: 12, f2: 14, f3: 16, f4: 20, f5: 24, f6: 32 }, "the type scale"); + // the root is never under 16 px, so a rem (and an em inside it) is at least 16 px + assert.match(css, /\nhtml \{ font-size: clamp\(16px,/); + assert.match(css, /\nhtml\.wall \{ font-size: 16px; \}/); for (const [decl] of css.matchAll(/\bfont(?:-size)?:[^;}]*/g)) { - const px = decl.match(/(\d*\.?\d+)px\b/)?.[1] ?? vars[decl.match(/var\(--(f\d)\)/)?.[1]]; + const rem = decl.match(/(\d*\.?\d+)r?em\b/)?.[1]; + const px = decl.match(/(\d*\.?\d+)px\b/)?.[1] ?? vars[decl.match(/var\(--(f\d)\)/)?.[1]] ?? (rem && Number(rem) * 16); if (px === undefined) continue; assert.ok(Number(px) >= 12, `${decl} is ${px}px`); checked++;