@intentius/behold 0.29.43 → 0.29.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +77 -0
- package/dist/cli.js +3969 -1918
- package/package.json +1 -1
- package/web/app.js +1452 -73
- package/web/carve-narration.js +33 -1
- package/web/chant-live-pace.js +138 -0
- package/web/chant-live-pace.test.js +116 -0
- package/web/chant-pr-marks.js +417 -39
- package/web/chant-pr-marks.test.js +208 -4
- package/web/collision-marks.js +124 -0
- package/web/collision-marks.test.js +89 -0
- package/web/cone.js +269 -0
- package/web/cone.test.js +213 -0
- package/web/dots-live.test.js +151 -1
- package/web/dots-lod.js +20 -0
- package/web/dots-lod.test.js +19 -1
- package/web/dots-scene.js +110 -10
- package/web/dots.js +144 -31
- package/web/embed.js +1 -1
- package/web/event-help-modal.js +85 -3
- package/web/event-help-modal.test.js +85 -1
- package/web/feature-flags.js +143 -0
- package/web/feature-flags.test.js +96 -0
- package/web/index.html +33 -0
- package/web/kiosk-carve.js +59 -6
- package/web/kiosk-event-help-ui.js +150 -19
- package/web/kiosk-event-help.js +102 -15
- package/web/kiosk-event-help.test.js +58 -1
- package/web/kiosk-metrics.js +4 -3
- package/web/kiosk-runs.js +8 -5
- package/web/kiosk-shot.js +157 -3
- package/web/kiosk-shot.test.js +223 -1
- package/web/kiosk-source.js +43 -0
- package/web/kiosk-source.test.js +39 -0
- package/web/kiosk-story-gate.test.js +44 -0
- package/web/kiosk-track.js +312 -0
- package/web/kiosk-track.test.js +148 -0
- package/web/kiosk-unknown-step.test.js +58 -0
- package/web/kiosk-vendor.js +71 -4
- package/web/kiosk-vendor.test.js +103 -3
- package/web/kiosk-watch.js +154 -1
- package/web/kiosk-watch.test.js +53 -1
- package/web/kiosk.html +57 -22
- package/web/kiosk.js +566 -53
- package/web/kiosk.test.js +2 -1
- package/web/small-stage.test.js +150 -0
- package/web/terragucci-blocked.test.js +192 -0
- package/web/terragucci-change.js +197 -17
- package/web/terragucci-components-live.js +189 -13
- package/web/terragucci-live-pace.js +92 -0
- package/web/terragucci-wave-results.test.js +125 -0
- package/web/terralith.html +7 -7
- package/web/tg-outside.js +124 -0
- package/web/tg-outside.test.js +100 -0
- package/web/tg-read-pills.js +122 -0
- package/web/tg-read-pills.test.js +117 -0
- package/web/theme.js +13 -1
- package/web/theme.test.js +21 -1
- package/web/tooltip.js +19 -7
- package/web/tooltip.test.js +15 -0
- package/web/tours/terralith.json +4 -4
- package/web/trunk-lane.test.js +1 -1
- package/web/view-url.js +8 -2
- package/web/why.js +129 -1
- package/web/why.test.js +113 -1
package/web/kiosk-vendor.test.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { describe, expect, it } from "vitest";
|
|
3
3
|
import { VENDOR_TOOLS } from "../src/terragucci-demo.ts";
|
|
4
4
|
import { logRows } from "./kiosk-runs.js";
|
|
5
|
-
import { NO_GRAPH_WORDS, SCENARIOS, readingRows, scenarioHead } from "./kiosk.js";
|
|
5
|
+
import { NO_GRAPH_WORDS, SCENARIOS, WHAT_TITLE, readingRows, scenarioHead, whatParts, whatTitle } from "./kiosk.js";
|
|
6
6
|
import {
|
|
7
7
|
REPLAY_LAST_HOLD_MS,
|
|
8
8
|
RUNS_WITH,
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
demoTool,
|
|
12
12
|
filterIndex,
|
|
13
13
|
keepRun,
|
|
14
|
+
kioskVendorOf,
|
|
14
15
|
liveEstimate,
|
|
15
16
|
liveFor,
|
|
16
17
|
linkSegments,
|
|
@@ -138,7 +139,7 @@ describe("the branding table (behold#571)", () => {
|
|
|
138
139
|
});
|
|
139
140
|
it("links every name to an official https site, and shows a logo for choudoufu alone", () => {
|
|
140
141
|
for (const v of Object.values(VENDORS)) expect(v.url).toMatch(/^https:\/\//);
|
|
141
|
-
expect(Object.entries(VENDORS).filter(([, v]) => v.logo).map(([id]) => id)).toEqual(["choudoufu"]);
|
|
142
|
+
expect(Object.entries(VENDORS).filter(([, v]) => v.logo).map(([id]) => id)).toEqual(["choudoufu", "choudoufu-fanout"]);
|
|
142
143
|
expect(VENDORS["cdk-terrain"].url).toBe("https://cdktn.io/");
|
|
143
144
|
expect(VENDORS.terraform.credit).toContain("Terraform is a trademark of HashiCorp.");
|
|
144
145
|
});
|
|
@@ -148,7 +149,7 @@ describe("the branding table (behold#571)", () => {
|
|
|
148
149
|
const words = [v.name, ...creditLines(tool).map((l) => l.map((s) => s.text).join("")), ...Object.values(notRunWords(v)), ...readingRows("components", tool).map((r) => r.words), ...readingRows("resources", tool).map((r) => r.words)];
|
|
149
150
|
for (const w of words) expect(namesOther(w, tool), `${tool}: ${w}`).toBe(false);
|
|
150
151
|
// choudoufu and chant are ours: their credits say so instead.
|
|
151
|
-
if (
|
|
152
|
+
if (v.owner !== "Intentius") expect(v.credit).toMatch(/(does not|don't) endorse this demo\./);
|
|
152
153
|
}
|
|
153
154
|
expect(VENDORS.choudoufu.credit).toMatch(/AWS and Kubernetes/);
|
|
154
155
|
expect(VENDORS.choudoufu.credit).not.toMatch(/experimental/i);
|
|
@@ -172,6 +173,10 @@ describe("the branding table (behold#571)", () => {
|
|
|
172
173
|
choudoufu: ["Terraform", "HashiCorp", "OpenTofu"],
|
|
173
174
|
// A pipeline: no other tool with a page is one.
|
|
174
175
|
chant: [],
|
|
176
|
+
// behold#746: the fan-outs compete with each other; chant's page leaves out terragucci and its tofu image too.
|
|
177
|
+
"chant-fanout": ["OpenTofu", "choudoufu", "terragucci", "tofu"],
|
|
178
|
+
"tofu-fanout": ["choudoufu"],
|
|
179
|
+
"choudoufu-fanout": ["OpenTofu"],
|
|
175
180
|
});
|
|
176
181
|
expect(otherTerms(null)).toEqual([]);
|
|
177
182
|
});
|
|
@@ -297,3 +302,98 @@ describe("a tool's page, drawn (behold#571)", () => {
|
|
|
297
302
|
}
|
|
298
303
|
});
|
|
299
304
|
});
|
|
305
|
+
|
|
306
|
+
describe("a page per fan-out tool (behold#746)", () => {
|
|
307
|
+
const FANOUTS = ["chant-fanout", "tofu-fanout", "choudoufu-fanout"];
|
|
308
|
+
const fan = (tool, extra = {}) =>
|
|
309
|
+
demo({ scenario: { "chant-fanout": "fan-out", "tofu-fanout": "fan-out-tofu", "choudoufu-fanout": "fan-out-choudoufu" }[tool], tool, repo: `terragucci-admin/${toolCheckout(tool)}`, title: "A broken stack shouldn't stall the whole rollout", name: "fifteen stacks", intro: "Big Terraform setups split what they build across many states.", ...extra });
|
|
310
|
+
const BANNED = /terragucci|opentofu|tofu/i;
|
|
311
|
+
|
|
312
|
+
it("routes each fan-out tool to a page of its own, its product's name in the title", () => {
|
|
313
|
+
for (const t of FANOUTS) expect(VENDOR_TOOLS).toContain(t);
|
|
314
|
+
expect([VENDORS["chant-fanout"].name, VENDORS["tofu-fanout"].name, VENDORS["choudoufu-fanout"].name]).toEqual(["chant", "OpenTofu", "choudoufu"]);
|
|
315
|
+
expect(FANOUTS.map(toolCheckout)).toEqual(["demo-chant-fanout", "demo-fanout", "demo-choudoufu-fanout"]);
|
|
316
|
+
});
|
|
317
|
+
it("is live only while its own fan-out runs, and replays its latest cycle otherwise", () => {
|
|
318
|
+
for (const live of FANOUTS) for (const page of FANOUTS) expect(liveFor(fan(live), page, SCENARIOS), `${live} on ${page}`).toBe(live === page);
|
|
319
|
+
// The vendor pages are no fan-out's: chant's own page replays while chant's fan-out runs.
|
|
320
|
+
expect(liveFor(fan("chant-fanout"), "chant", SCENARIOS)).toBe(false);
|
|
321
|
+
expect(liveFor(fan("chant-fanout", { scenario: "base" }), "chant-fanout", SCENARIOS)).toBe(false);
|
|
322
|
+
});
|
|
323
|
+
it("keeps its own repo's runs alone", () => {
|
|
324
|
+
const index = { doc: { runs: [{ id: 3, repo: "terragucci-admin/demo-chant-fanout" }, { id: 2, repo: "terragucci-admin/demo-fanout" }, { id: 1, repo: "terragucci-admin/demo-choudoufu-fanout" }] } };
|
|
325
|
+
expect(filterIndex(index, { tool: "chant-fanout", repo: "terragucci-admin/demo-chant-fanout" }).doc.runs.map((r) => r.id)).toEqual([3]);
|
|
326
|
+
expect(filterIndex(index, { tool: "tofu-fanout", repo: "terragucci-admin/demo-fanout" }).doc.runs.map((r) => r.id)).toEqual([2]);
|
|
327
|
+
});
|
|
328
|
+
it("leaves terragucci and OpenTofu off chant's page, inside an identifier too, and keeps Terraform and chant", () => {
|
|
329
|
+
for (const t of ["terragucci · OpenTofu · on Forgejo", "image: terragucci-demo-tofu:local", "OpenTofu v1.9.0", "http://localhost:3300/terragucci-admin/demo-chant-fanout.git", "tofu init", "The demo stack and its driver are terragucci's.", "runs on choudoufu"]) {
|
|
330
|
+
expect(namesOther(t, "chant-fanout"), t).toBe(true);
|
|
331
|
+
}
|
|
332
|
+
for (const t of ["chant pr-plan: 15 member(s), planned", "chant approve pr-763 pr-apply --plan jcs1-sha256:8d30", "Big Terraform setups split", "cluster-a failed"]) expect(namesOther(t, "chant-fanout"), t).toBe(false);
|
|
333
|
+
// Each word chant's page leaves out today, and more.
|
|
334
|
+
for (const t of otherTerms("chant")) expect(otherTerms("chant-fanout")).toContain(t);
|
|
335
|
+
});
|
|
336
|
+
it("shows each fan-out page only its own product: the others' names go, terragucci stays where it is the pipeline", () => {
|
|
337
|
+
expect(namesOther("choudoufu live-import", "tofu-fanout")).toBe(true);
|
|
338
|
+
expect(namesOther("OpenTofu v1.9.0", "choudoufu-fanout")).toBe(true);
|
|
339
|
+
for (const t of ["tofu-fanout", "choudoufu-fanout"]) {
|
|
340
|
+
expect(namesOther("terragucci · on Forgejo · fan out", t), t).toBe(false);
|
|
341
|
+
expect(namesOther("chant approve tf-apply wave-2 --actor demo-reviewer --sign", t), t).toBe(false);
|
|
342
|
+
}
|
|
343
|
+
expect(namesOther("terragucci · OpenTofu", "tofu-fanout")).toBe(false);
|
|
344
|
+
});
|
|
345
|
+
it("leaves /kiosk's branding as it was: no fan-out brand there, the vendor pages' as before", () => {
|
|
346
|
+
for (const t of FANOUTS) expect(kioskVendorOf(t), t).toBe(null);
|
|
347
|
+
expect(kioskVendorOf("chant")).toBe(VENDORS.chant);
|
|
348
|
+
expect(kioskVendorOf("terraform")).toBe(VENDORS.terraform);
|
|
349
|
+
expect(kioskVendorOf(null)).toBe(null);
|
|
350
|
+
for (const view of ["components", "resources"]) expect(readingRows(view, "chant-fanout")).toEqual(readingRows(view, null));
|
|
351
|
+
});
|
|
352
|
+
it("says whose pipeline it is on chant's page, without the sentence that names terragucci", () => {
|
|
353
|
+
const hide = (t) => namesOther(t, "chant-fanout");
|
|
354
|
+
expect(whatTitle(null, hide)).toBe("The pipeline is chant's (chant components pr-plan / pr-apply on Forgejo).");
|
|
355
|
+
expect(whatTitle(null)).toBe(WHAT_TITLE);
|
|
356
|
+
expect(whatParts({ scenario: "fan-out" }, "forgejo", null, hide).map((p) => p.text)).toEqual(["chant's pull-request pipeline", "on Forgejo", "fan-out", "live demo"]);
|
|
357
|
+
// Were chant's page ever drawn on a terragucci repo, the line would drop terragucci and its engine.
|
|
358
|
+
expect(whatParts({ scenario: "fan-out" }, "forgejo", { tools: ["opentofu"] }, hide).map((p) => p.text)).toEqual(["on Forgejo", "fan-out", "live demo"]);
|
|
359
|
+
expect(whatParts({ scenario: "fan-out-tofu" }, "forgejo", { tools: ["opentofu"] }, (t) => namesOther(t, "tofu-fanout")).map((p) => p.text)).toEqual(["terragucci", "OpenTofu", "on Forgejo", "fan out tofu", "live demo"]);
|
|
360
|
+
});
|
|
361
|
+
it("draws chant's page, live and in replay, in Inspect and in Watch, with no terragucci or OpenTofu anywhere", async () => {
|
|
362
|
+
const { renderKiosk } = await import("./kiosk.js");
|
|
363
|
+
const was = globalThis.document;
|
|
364
|
+
const make = (tag) => {
|
|
365
|
+
const n = { tagName: tag, className: "", textContent: "", children: [], attrs: {} };
|
|
366
|
+
n.appendChild = (c) => (n.children.push(c), c);
|
|
367
|
+
n.append = (...cs) => cs.forEach((c) => n.children.push(typeof c === "string" ? { tagName: "#text", textContent: c, children: [], attrs: {} } : c));
|
|
368
|
+
n.replaceChildren = () => (n.children = []);
|
|
369
|
+
n.setAttribute = (k, v) => (n.attrs[k] = String(v));
|
|
370
|
+
n.querySelectorAll = () => [];
|
|
371
|
+
n.addEventListener = () => {};
|
|
372
|
+
return n;
|
|
373
|
+
};
|
|
374
|
+
globalThis.document = { createElement: make };
|
|
375
|
+
const words = (n) => [n.textContent || "", n.href || "", ...Object.values(n.attrs || {}), ...(n.children || []).flatMap(words)];
|
|
376
|
+
try {
|
|
377
|
+
const d = scrubDemo(fan("chant-fanout", { step: "planned", label: "The plan covers fifteen stacks. image: terragucci-demo-tofu:local", about: { changes: "A pull request edits the shared network.", watch: "OpenTofu plans the stacks", shows: "A failure blocks only what depends on it." } }), "chant-fanout");
|
|
378
|
+
for (const mode of ["live", "replay"]) {
|
|
379
|
+
for (const watchMode of [false, true]) {
|
|
380
|
+
const bar = make("header");
|
|
381
|
+
const s = { vendor: "chant-fanout", mode, replay: mode === "replay" ? { banner: "Replay of the run at 00:39 UTC · live again in about 2 min" } : null, demo: { demo: d }, answer: { error: "s3://demo-reports/demo/index.json lists 7 projects, and none is this checkout's (localhost:3300/terragucci-admin/demo-chant-fanout)." }, progress: null, watchMode, chantLoop: true, trackOn: true, chantForge: () => "forgejo" };
|
|
382
|
+
renderKiosk(bar, s, new Date("2026-10-20T10:01:00Z"));
|
|
383
|
+
const all = words(bar).join("\n");
|
|
384
|
+
expect(all, `${mode} ${watchMode ? "watch" : "inspect"}`).not.toMatch(BANNED);
|
|
385
|
+
expect(all).toContain("chant");
|
|
386
|
+
if (watchMode) expect(all).toContain("chant's pull-request pipeline");
|
|
387
|
+
if (mode === "replay") expect(all).toContain("Replay of the run at 00:39 UTC");
|
|
388
|
+
// Replaying, the line says so and drops its "live demo".
|
|
389
|
+
if (mode === "replay" && watchMode) expect(all).not.toContain("live demo");
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
// The credit, the not-run words and the legend say neither.
|
|
393
|
+
const fixed = [...creditLines("chant-fanout").map((l) => l.map((x) => x.text).join("")), ...Object.values(notRunWords(VENDORS["chant-fanout"])), ...readingRows("components", "chant-fanout").map((r) => r.words)];
|
|
394
|
+
for (const w of fixed) expect(w).not.toMatch(BANNED);
|
|
395
|
+
} finally {
|
|
396
|
+
globalThis.document = was;
|
|
397
|
+
}
|
|
398
|
+
});
|
|
399
|
+
});
|
package/web/kiosk-watch.js
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
import { STEP_WORDS, focusRoots, matchingPull, matchingRun, scenarioHead, introText, aboutRows, nextWords, demoStage } from "./kiosk.js";
|
|
15
15
|
import { defaultJob, defaultStep, logLineWords, setupLine } from "./kiosk-runs.js";
|
|
16
|
+
import { backendLine, coneLine, coneOf } from "./cone.js";
|
|
16
17
|
|
|
17
18
|
/** The two modes, Watch first: it is the default. */
|
|
18
19
|
export const MODES = [
|
|
@@ -118,7 +119,7 @@ export function shotFor(demo, { answer = null, progress = null, held = null, gat
|
|
|
118
119
|
* step. `lead` says which line leads: "changes" before the merge, when the
|
|
119
120
|
* change is what to read, else "step". Between scenarios, the intro.
|
|
120
121
|
*/
|
|
121
|
-
export function captionModel(demo, { vendor = null, now = new Date() } = {}) {
|
|
122
|
+
export function captionModel(demo, { vendor = null, now = new Date(), answer = null } = {}) {
|
|
122
123
|
if (!demo) return null;
|
|
123
124
|
const head = scenarioHead(demo, { vendor });
|
|
124
125
|
const rows = aboutRows(demo);
|
|
@@ -133,9 +134,78 @@ export function captionModel(demo, { vendor = null, now = new Date() } = {}) {
|
|
|
133
134
|
intro: intro ? { label: "What this demo is about", text: intro } : null,
|
|
134
135
|
step: { word: STEP_WORDS[demo.step] || demo.step, text: demo.label || "", tone: stepTone(demo.step), id: demo.step },
|
|
135
136
|
next: nx.action ? { action: nx.action, when: nx.when } : null,
|
|
137
|
+
cone: coneCaption(demo, answer),
|
|
136
138
|
};
|
|
137
139
|
}
|
|
138
140
|
|
|
141
|
+
/**
|
|
142
|
+
* Report minor 34: the plan line while the step shows this cycle's pull
|
|
143
|
+
* request plan and a root of it was planned with `-cone`: `{ line, backend }`,
|
|
144
|
+
* the line from the report's numbers (web/cone.js coneLine) and, when the
|
|
145
|
+
* reports say so, "3 estates · 1 backend · no state files". Null otherwise:
|
|
146
|
+
* every other plan's caption is as it was.
|
|
147
|
+
*/
|
|
148
|
+
export function coneCaption(demo, answer) {
|
|
149
|
+
if (!demo || demoStage(demo) !== "pull-request") return null;
|
|
150
|
+
const cone = coneOf(matchingPull(answer, demo));
|
|
151
|
+
const line = coneLine(cone);
|
|
152
|
+
return line ? { line, backend: backendLine(cone) } : null;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* What may sit over the graph in Watch. On a held small stage (`held`: one
|
|
157
|
+
* framing holds it, web/kiosk-shot.js heldFrame), nothing the step puts
|
|
158
|
+
* there: the result card, the approval callout, the waves' badges and the
|
|
159
|
+
* step's own log drawer stay off the stage (their words are the caption's:
|
|
160
|
+
* stepLine and the quiet line), and a drawer the viewer opened on a wave
|
|
161
|
+
* (`opened`) shows until they fold it. Any other stage is as it always was:
|
|
162
|
+
* the result card at applied, the callout at a held wave, the badges, and
|
|
163
|
+
* the drawer while the run is on a wave (`kind` "active"). Inspect keeps its
|
|
164
|
+
* cards either way.
|
|
165
|
+
*/
|
|
166
|
+
export function watchOverlays({ kind = null, opened = false, held = false } = {}) {
|
|
167
|
+
if (held) return { result: false, callout: false, badges: false, drawer: !!opened };
|
|
168
|
+
return { result: true, callout: true, badges: true, drawer: kind === "active" || !!opened };
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/** At most this many of the caption's one-line rows show at once (the cone line, the step line, the quiet line). */
|
|
172
|
+
export const CAPTION_EXTRA_ROWS = 2;
|
|
173
|
+
/** And at most this many lines of event-help's trail over it, as a cycle's beats come in. */
|
|
174
|
+
export const TRAIL_LINES = 2;
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* The tallest the caption gets in a cycle, as the bottom inset in px a held
|
|
178
|
+
* stage keeps (web/kiosk-shot.js heldInsets `room`): the caption as it is now
|
|
179
|
+
* less the one-line rows it shows now (`extras`, their heights), plus
|
|
180
|
+
* CAPTION_EXTRA_ROWS of them (`rowH` each), plus the trail over it at
|
|
181
|
+
* TRAIL_LINES lines (`trailLineH` each) or as it is now if taller, plus the
|
|
182
|
+
* frame's foot under the caption (`below`) and 16 px. Measured, so the frame
|
|
183
|
+
* keeps this room from the first step and no row that comes moves it.
|
|
184
|
+
*/
|
|
185
|
+
export function captionRoom({ capHeight = 0, extras = [], rowH = 0, trailH = 0, trailLineH = 0, below = 0 } = {}) {
|
|
186
|
+
const base = Math.max(0, capHeight - extras.reduce((a, h) => a + (h > 0 ? h : 0), 0));
|
|
187
|
+
const trail = Math.max(trailH, TRAIL_LINES * trailLineH);
|
|
188
|
+
return Math.round(Math.max(0, below) + base + CAPTION_EXTRA_ROWS * rowH + trail + 16);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* The caption's quiet line, on a held small stage only, for what a card on
|
|
193
|
+
* the stage says elsewhere: at applied the run's counts ("2 waves applied ·
|
|
194
|
+
* 1 updated · 3.2 s of job time", resultModel); at a held wave, the wave and
|
|
195
|
+
* how its hold ends ("Wave 2 · plan 1a2b3c4d: chant approve …"). Null
|
|
196
|
+
* otherwise, and on any other stage, whose cards say it.
|
|
197
|
+
*/
|
|
198
|
+
export function stepLine(demo, { result = null, hold = null, held = false } = {}) {
|
|
199
|
+
if (!demo || !held) return null;
|
|
200
|
+
if (demo.step === "applied" && result && result.counts && result.counts.length) return result.counts.join(" · ");
|
|
201
|
+
if ((demo.step === "waiting" || demo.step === "approved") && hold) {
|
|
202
|
+
const head = hold.head || "The plan";
|
|
203
|
+
if (hold.kind === "driver" && hold.appr) return `${head}: ${hold.appr.approve}`;
|
|
204
|
+
if (hold.kind === "approval") return `${head} waits for an approval`;
|
|
205
|
+
}
|
|
206
|
+
return null;
|
|
207
|
+
}
|
|
208
|
+
|
|
139
209
|
/** "1.6 s · held 25 s · 4 created": one wave's numbers from the metrics model's wave, or null when it has none. */
|
|
140
210
|
export function badgeWords(wave) {
|
|
141
211
|
if (!wave) return null;
|
|
@@ -301,3 +371,86 @@ export function placeBeside(box, size, view, gap = 18, avoid = []) {
|
|
|
301
371
|
const x = Math.max(view.x + 8, Math.min(box.x, view.x + view.w - size.w - 8));
|
|
302
372
|
return { x, y: Math.min(box.y + box.h + gap, view.y + view.h - size.h - 8), side: "below" };
|
|
303
373
|
}
|
|
374
|
+
|
|
375
|
+
// ---------------------------------------------------------------------------
|
|
376
|
+
// A quiet step: during a long step (a wave planning four roots, live-mv about
|
|
377
|
+
// to start) nothing new may arrive for a minute or more, and the stage holds
|
|
378
|
+
// still. After QUIET_MS with no new record, one quiet line in the caption
|
|
379
|
+
// says what is running and for how long, from demo.json's step and the run's
|
|
380
|
+
// running job. Never over a replay, and never while the kiosk can't
|
|
381
|
+
// read from behold: the stopped-updating cue (web/kiosk-link.js) says that.
|
|
382
|
+
|
|
383
|
+
/** How long with no new record before the quiet line shows. */
|
|
384
|
+
export const QUIET_MS = 10_000;
|
|
385
|
+
|
|
386
|
+
/** The driver's steps that have something running behind them. A held step (waiting, failed), the end and the reset have their own words. */
|
|
387
|
+
export const QUIET_STEPS = ["pull-request", "planned", "merged", "applying", "approved", "resumed"];
|
|
388
|
+
|
|
389
|
+
/** "8 s", "1 m 05 s", "1 h 02 m". */
|
|
390
|
+
export function quietDuration(secs) {
|
|
391
|
+
const s = Math.max(0, Math.floor(secs));
|
|
392
|
+
if (s < 60) return `${s} s`;
|
|
393
|
+
const m = Math.floor(s / 60);
|
|
394
|
+
if (m < 60) return `${m} m ${String(s % 60).padStart(2, "0")} s`;
|
|
395
|
+
return `${Math.floor(m / 60)} h ${String(m % 60).padStart(2, "0")} m`;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
/** The first sentence of the driver's label, without its full stop. */
|
|
399
|
+
export function firstSentence(text) {
|
|
400
|
+
if (typeof text !== "string") return null;
|
|
401
|
+
const t = text.trim();
|
|
402
|
+
if (!t) return null;
|
|
403
|
+
const m = /^(.+?[^.\s])\.(?:\s|$)/.exec(t);
|
|
404
|
+
return m ? m[1] : t;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
/** The job and step running in a run's view, `{ job, step, at }` (`at` the step's start, else the job's, in ms), or null when none runs. */
|
|
408
|
+
export function runningStep(runDoc) {
|
|
409
|
+
if (!runDoc || !Array.isArray(runDoc.jobs)) return null;
|
|
410
|
+
const job = runDoc.jobs.find((j) => j && j.status === "running");
|
|
411
|
+
if (!job) return null;
|
|
412
|
+
const step = (job.steps || []).find((x) => x && x.status === "running") || null;
|
|
413
|
+
const at = Date.parse((step && step.started_at) || job.started_at || "");
|
|
414
|
+
return { job: job.name, step: step ? step.name : null, at: Number.isFinite(at) ? at : null };
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
/**
|
|
418
|
+
* What restarts the quiet line's clock: a new driver step (its step or its
|
|
419
|
+
* label) or a new progress line. Nothing else does: a job or a step changing
|
|
420
|
+
* state in the run's view only changes the line's words, and a log line
|
|
421
|
+
* growing inside a step is not a record at all.
|
|
422
|
+
*/
|
|
423
|
+
export function recordKey(demo, lastWriteAt = null) {
|
|
424
|
+
const d = demo ? [demo.cycle, demo.beat || "", demo.step, demo.label].join("|") : "";
|
|
425
|
+
return `${d}#${lastWriteAt ?? ""}`;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
/**
|
|
429
|
+
* The quiet line, `{ said, tail, text, title, since }`, or null when it
|
|
430
|
+
* should not show. `said` is the driver label's first sentence (the part that
|
|
431
|
+
* may be cut short), `tail` the running job's name and the time, always shown
|
|
432
|
+
* whole. `lastRecordAt`: when the kiosk last saw a new record (ms), by
|
|
433
|
+
* {@link recordKey}; `run`: {@link runningStep}, of which only the job's name
|
|
434
|
+
* is said; `stepAt`: when the kiosk first saw this step, for a driver that
|
|
435
|
+
* writes no `next.from`. It shows after QUIET_MS with no new record, on a step
|
|
436
|
+
* with something running, with no countdown of the driver's own still to run,
|
|
437
|
+
* and never on a replay or while the link is stale. The time is how long the
|
|
438
|
+
* driver's step has run.
|
|
439
|
+
*/
|
|
440
|
+
export function quietWords(demo, { now = Date.now(), lastRecordAt = null, run = null, stepAt = null, replay = false, stale = false } = {}) {
|
|
441
|
+
if (replay || stale || !demo || !QUIET_STEPS.includes(demo.step)) return null;
|
|
442
|
+
if (typeof lastRecordAt !== "number" || now - lastRecordAt <= QUIET_MS) return null;
|
|
443
|
+
const next = demo.next || null;
|
|
444
|
+
// A timed hold (the driver merges in 20 s) has its own countdown on the next line.
|
|
445
|
+
const due = next && next.at ? Date.parse(next.at) : NaN;
|
|
446
|
+
if (Number.isFinite(due) && due > now) return null;
|
|
447
|
+
const said = firstSentence(demo.label) || (next && next.action ? `Waiting for ${next.action}` : null);
|
|
448
|
+
const job = run && run.job ? run.job : null;
|
|
449
|
+
if (!said && !job) return null;
|
|
450
|
+
const from = next && next.from ? Date.parse(next.from) : NaN;
|
|
451
|
+
const since = Number.isFinite(from) ? from : typeof stepAt === "number" ? stepAt : lastRecordAt;
|
|
452
|
+
const tail = [job, `${quietDuration((now - since) / 1000)} so far`].filter(Boolean).join(" · ");
|
|
453
|
+
const text = said ? `${said} · ${tail}` : tail;
|
|
454
|
+
const title = `Nothing new has come in for ${quietDuration((now - lastRecordAt) / 1000)}. ${demo.label || said || ""}${job ? ` Running: ${job}${run.step ? `, ${run.step}` : ""}.` : ""}`.trim();
|
|
455
|
+
return { said, tail, text, title, since };
|
|
456
|
+
}
|
package/web/kiosk-watch.test.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// takes, what the caption leads with, the badges, the delivery line, the
|
|
3
3
|
// result card, the drawer's folded lines, and where an overlay goes.
|
|
4
4
|
import { describe, expect, it } from "vitest";
|
|
5
|
-
import { MODE_STORE, activeWave, badgeTitle, badgeWords, badges, behindStep, steadyRun, captionModel, changeRoots, doraLine, modeStored, placeBeside, resultModel, shotFor, stepTone, tailLines } from "./kiosk-watch.js";
|
|
5
|
+
import { MODE_STORE, QUIET_MS, activeWave, badgeTitle, badgeWords, badges, behindStep, firstSentence, steadyRun, captionModel, changeRoots, doraLine, modeStored, placeBeside, quietDuration, quietWords, recordKey, resultModel, runningStep, shotFor, stepTone, tailLines } from "./kiosk-watch.js";
|
|
6
6
|
|
|
7
7
|
const C = "9f3c2a71d04e5b8c6a1f2e3d4c5b6a7980716253";
|
|
8
8
|
const P = "1111111111111111111111111111111111111111";
|
|
@@ -209,3 +209,55 @@ describe("kiosk watch: where an overlay goes", () => {
|
|
|
209
209
|
expect(placeBeside({ x: 400, y: 700, w: 300, h: 80 }, { w: 400, h: 300 }, view).y).toBe(492);
|
|
210
210
|
});
|
|
211
211
|
});
|
|
212
|
+
|
|
213
|
+
describe("the quiet line", () => {
|
|
214
|
+
const from = Date.parse("2026-10-16T10:00:00Z");
|
|
215
|
+
const step = (more = {}) => demo("applying", { label: "Wave 1 is planning the four roots. Then live-mv moves each team's resources.", next: { action: "follow the waves", from: "2026-10-16T10:00:00Z", at: null }, ...more });
|
|
216
|
+
it("says what runs and for how long once nothing new has come in for QUIET_MS", () => {
|
|
217
|
+
const q = quietWords(step(), { now: from + 48_000, lastRecordAt: from + 20_000 });
|
|
218
|
+
expect(q.text).toBe("Wave 1 is planning the four roots · 48 s so far");
|
|
219
|
+
expect(q.since).toBe(from);
|
|
220
|
+
expect(q.title).toContain("Nothing new has come in for 28 s.");
|
|
221
|
+
});
|
|
222
|
+
it("names the running job by its name alone, never its step or description, and keeps the job and the time apart from the words that may be cut", () => {
|
|
223
|
+
const run = runningStep({ id: 9, jobs: [{ name: "plan", status: "success", steps: [] }, { name: "apply-comment", status: "running", started_at: "2026-10-16T10:00:05Z", steps: [{ name: "setup", status: "success" }, { name: "Apply a merged pull request on request, from its merge commit", status: "running", started_at: "2026-10-16T10:00:09Z" }] }] });
|
|
224
|
+
expect(run).toEqual({ job: "apply-comment", step: "Apply a merged pull request on request, from its merge commit", at: from + 9_000 });
|
|
225
|
+
const q = quietWords(step({ label: "The driver comments /terragucci apply on pull request 242, and the pipeline runs the waves again." }), { now: from + 37_000, lastRecordAt: from + 9_000, run });
|
|
226
|
+
expect(q.text).toBe("The driver comments /terragucci apply on pull request 242, and the pipeline runs the waves again · apply-comment · 37 s so far");
|
|
227
|
+
expect(q.said).toBe("The driver comments /terragucci apply on pull request 242, and the pipeline runs the waves again");
|
|
228
|
+
expect(q.tail).toBe("apply-comment · 37 s so far");
|
|
229
|
+
});
|
|
230
|
+
it("counts from the driver's step, not from the job", () => {
|
|
231
|
+
const run = { job: "apply-wave-1", step: "plan", at: from + 30_000 };
|
|
232
|
+
expect(quietWords(step(), { now: from + 75_000, lastRecordAt: from + 2_000, run }).tail).toBe("apply-wave-1 · 1 m 15 s so far");
|
|
233
|
+
});
|
|
234
|
+
it("stays away while records come in, on a replay, while the link is stale, and on a held or ended step", () => {
|
|
235
|
+
expect(quietWords(step(), { now: from + QUIET_MS, lastRecordAt: from })).toBeNull();
|
|
236
|
+
expect(quietWords(step(), { now: from + 60_000, lastRecordAt: from, replay: true })).toBeNull();
|
|
237
|
+
expect(quietWords(step(), { now: from + 60_000, lastRecordAt: from, stale: true })).toBeNull();
|
|
238
|
+
for (const s of ["waiting", "failed", "applied", "reset", "stalled"]) expect(quietWords(step({ step: s }), { now: from + 60_000, lastRecordAt: from })).toBeNull();
|
|
239
|
+
expect(quietWords(step(), { now: from + 60_000, lastRecordAt: null })).toBeNull();
|
|
240
|
+
});
|
|
241
|
+
it("leaves a timed hold to its own countdown, and speaks once the hold is overdue", () => {
|
|
242
|
+
const hold = step({ step: "planned", next: { action: "merge pull request 7", from: "2026-10-16T10:00:00Z", at: "2026-10-16T10:01:00Z" } });
|
|
243
|
+
expect(quietWords(hold, { now: from + 30_000, lastRecordAt: from })).toBeNull();
|
|
244
|
+
expect(quietWords(hold, { now: from + 90_000, lastRecordAt: from }).text).toBe("Wave 1 is planning the four roots · 1 m 30 s so far");
|
|
245
|
+
});
|
|
246
|
+
it("falls back to the next action, then to when the kiosk first saw the step", () => {
|
|
247
|
+
const d = step({ label: "", next: { action: "follow the waves", at: null } });
|
|
248
|
+
expect(quietWords(d, { now: from + 40_000, lastRecordAt: from + 5_000, stepAt: from + 2_000 }).text).toBe("Waiting for follow the waves · 38 s so far");
|
|
249
|
+
});
|
|
250
|
+
it("restarts its clock only on a new driver step or a new progress line", () => {
|
|
251
|
+
expect(recordKey(step(), 1)).not.toBe(recordKey(step(), 2));
|
|
252
|
+
expect(recordKey(step(), 1)).not.toBe(recordKey(step({ step: "resumed" }), 1));
|
|
253
|
+
expect(recordKey(step(), 1)).not.toBe(recordKey(step({ label: "Live-mv starts." }), 1));
|
|
254
|
+
// The driver's next action or its time are not a new step.
|
|
255
|
+
expect(recordKey(step(), 1)).toBe(recordKey(step({ next: { action: "carve: 3 of 14 moved", from: "2026-10-16T10:00:00Z", at: null } }), 1));
|
|
256
|
+
});
|
|
257
|
+
it("words", () => {
|
|
258
|
+
expect(quietDuration(8.9)).toBe("8 s");
|
|
259
|
+
expect(quietDuration(3725)).toBe("1 h 02 m");
|
|
260
|
+
expect(firstSentence("Network is already done, and app's migration runs again.")).toBe("Network is already done, and app's migration runs again");
|
|
261
|
+
expect(firstSentence("main moved to 1234abcd: port 8080 -> 9090. Wave 1 plans again")).toBe("main moved to 1234abcd: port 8080 -> 9090");
|
|
262
|
+
});
|
|
263
|
+
});
|
package/web/kiosk.html
CHANGED
|
@@ -29,15 +29,15 @@
|
|
|
29
29
|
/* #569 step 2. The pre-paint fallback: the kiosk's default theme's
|
|
30
30
|
tokens (KIOSK_THEME in theme.js), which initTheme() replaces with the viewer's theme. */
|
|
31
31
|
:root {
|
|
32
|
-
--bg: #
|
|
33
|
-
--edge: #
|
|
34
|
-
--degraded: #
|
|
35
|
-
--rule: #
|
|
36
|
-
/* behold#571: the kiosk's surfaces and ink (theme.js kioskSurfaces), the kiosk's default theme's (KIOSK_THEME,
|
|
37
|
-
--surface-box: #
|
|
38
|
-
--managed-ink: #
|
|
39
|
-
/* behold#571: the left bars (theme.js barInks),
|
|
40
|
-
--bar-managed: #
|
|
32
|
+
--bg: #141d2b; --panel: #213027; --line: #2e3d2a; --fg: #9fef00; --muted: #7d9e5a; --ink2: #97d742;
|
|
33
|
+
--edge: #40601d; --managed: #19cb00; --foreign: #cecb00; --pending: #0d73cc;
|
|
34
|
+
--degraded: #cc0403; --neutral: #537c18; --runtime: #0dcdcd;
|
|
35
|
+
--rule: #515e48; --focus: #577597; --active: #223f47; --well: #070f1c; --shadow: #030406;
|
|
36
|
+
/* behold#571: the kiosk's surfaces and ink (theme.js kioskSurfaces), the kiosk's default theme's (KIOSK_THEME, Box since behold#758) until initTheme() runs. */
|
|
37
|
+
--surface-box: #20242a; --surface-pane-a: #262a30; --surface-pane-b: #2c3036; --zebra: #9fef00; --soft: #9fef00; --muted-ink: #8aaa67;
|
|
38
|
+
--managed-ink: #19cb00; --foreign-ink: #cecb00; --pending-ink: #2b83da; --degraded-ink: #e84234; --runtime-ink: #0dcdcd;
|
|
39
|
+
/* behold#571: the left bars (theme.js barInks), Box's until initTheme() runs. */
|
|
40
|
+
--bar-managed: #19cb00; --bar-foreign: #cecb00; --bar-pending: #3992ee; --bar-degraded: #ff5242; --bar-runtime: #0dcdcd; --bar-neutral: #719c3e;
|
|
41
41
|
--font-ui: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
|
|
42
42
|
--font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
43
43
|
}
|
|
@@ -362,6 +362,10 @@
|
|
|
362
362
|
.k-menu summary::after { content: " ▾"; }
|
|
363
363
|
.k-menu[open] summary { border-color: var(--focus); }
|
|
364
364
|
.k-menu-body { position: absolute; right: 0; top: 2.4em; padding: var(--s2); background: var(--surface-pane-b); border: 1px solid var(--rule); border-radius: 8px; }
|
|
365
|
+
/* behold#755: the picker between its < and > arrows. */
|
|
366
|
+
.k-theme-step { position: relative; display: inline-flex; align-items: center; gap: var(--s1); }
|
|
367
|
+
.k-theme-arrow { display: inline-flex; align-items: center; justify-content: center; width: 2em; height: 2em; padding: 0; border: 1px solid var(--rule); border-radius: 999px; background: var(--surface-pane-a); color: var(--fg); font: 600 0.92em var(--font-ui); cursor: pointer; }
|
|
368
|
+
.k-theme-arrow:hover, .k-theme-arrow:focus-visible { border-color: var(--focus); }
|
|
365
369
|
.k-credit { color: var(--muted); }
|
|
366
370
|
.k-credit-link { color: var(--fg); }
|
|
367
371
|
.k-nograph-note { margin: 0; color: var(--ink2); font-size: 0.88em; }
|
|
@@ -447,14 +451,24 @@
|
|
|
447
451
|
body.k-watch #view-pane { position: absolute; inset: 0 5px 5px; border-radius: 8px; overflow: hidden; background: var(--bg); }
|
|
448
452
|
body.k-watch #view { height: 100%; }
|
|
449
453
|
/* The header, one line: the scenario's place, the steps, the delivery numbers. */
|
|
450
|
-
|
|
451
|
-
.k-
|
|
452
|
-
|
|
454
|
+
/* The header and the controls share one row: the header takes what the controls leave and wraps inside it, so nothing runs under them at any width. */
|
|
455
|
+
body.k-watch #bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s5); min-width: 0; min-height: 2.6em; padding: var(--s1) var(--s4); }
|
|
456
|
+
@media (min-width: 901px) {
|
|
457
|
+
body.k-watch #k-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
|
|
458
|
+
body.k-watch #k-head > .k-link { grid-row: 1; grid-column: 1 / -1; }
|
|
459
|
+
body.k-watch #bar { grid-row: 2; grid-column: 1; }
|
|
460
|
+
body.k-watch #k-tools { grid-row: 2; grid-column: 2; position: relative; top: auto; right: auto; padding: 0.35em 1em 0.35em 0; flex-wrap: wrap; justify-content: flex-end; row-gap: var(--s2); }
|
|
461
|
+
}
|
|
462
|
+
/* The place truncates and the steps wrap before either reaches the controls; with no room left on the line, the steps take a line of their own. */
|
|
463
|
+
.k-w-place { display: flex; align-items: baseline; gap: var(--s3); flex: 0 1 auto; min-width: 0; white-space: nowrap; }
|
|
464
|
+
.k-w-place .k-brand { flex: none; }
|
|
465
|
+
.k-w-place .k-cycle { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
|
|
466
|
+
body.k-watch #bar .k-strip { flex: 0 1 auto; flex-wrap: wrap; row-gap: var(--s1); min-width: 0; }
|
|
453
467
|
.k-w-place .k-brand { margin: 0; }
|
|
454
468
|
.k-w-kicker { font: 600 0.8em var(--font-ui); color: var(--muted); }
|
|
455
469
|
.k-w-dora { margin-left: auto; color: var(--muted); font-size: 0.88em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
|
|
456
470
|
.k-w-dora b { color: var(--fg); font-weight: 600; font-variant-numeric: tabular-nums; }
|
|
457
|
-
.k-w-held { color: var(--foreign); font-size: 0.85em;
|
|
471
|
+
.k-w-held { color: var(--foreign); font-size: 0.85em; min-width: 0; }
|
|
458
472
|
.k-w-held button { font: inherit; color: var(--pending); background: transparent; border: 0; padding: 0 0 0 var(--s2); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
|
|
459
473
|
/* The caption: the title, what changes, the step. One of the two beats leads. */
|
|
460
474
|
#k-caption { position: absolute; left: 5px; right: 5px; bottom: 5px; display: grid; grid-template-rows: auto calc(2 * 1.25em * 1.3) calc(2 * 1.25em * 1.3); gap: 0.25em; padding: var(--s3) 1.4em var(--s4);
|
|
@@ -480,6 +494,16 @@
|
|
|
480
494
|
/* The beat that leads is larger and full ink; the other steps back. Both keep their rows, so nothing moves. */
|
|
481
495
|
.k-cap-lead { font-size: 1.3em; color: var(--fg); font-weight: 600; }
|
|
482
496
|
.k-cap-lead .k-cap-label { padding-top: var(--s3); }
|
|
497
|
+
/* The quiet line (web/kiosk-watch.js quietWords): what runs while nothing new comes in, and for how long. One muted line under the fixed rows, no spinner. */
|
|
498
|
+
.k-cap-quiet { margin: 0; padding-left: var(--s3); color: var(--muted); font-size: 0.92em; line-height: 1.35; font-variant-numeric: tabular-nums; }
|
|
499
|
+
/* A cone plan's line (web/kiosk-watch.js coneCaption): what the plan planned, in the caption's ink; the estates' backend after it, muted. One line, no box. */
|
|
500
|
+
.k-cap-cone { margin: 0; padding-left: var(--s3); color: var(--ink2, var(--fg)); font-size: 0.92em; line-height: 1.35; font-variant-numeric: tabular-nums; display: flex; flex-wrap: wrap; gap: 0 var(--s4); }
|
|
501
|
+
.k-cone-backend { color: var(--muted); }
|
|
502
|
+
.k-note.k-cone-backend { color: var(--muted); }
|
|
503
|
+
/* Both captions' quiet line (here and web/kiosk-carve.js): one line; the driver's words take an ellipsis, the job and the time never do. */
|
|
504
|
+
.k-quiet { display: flex; min-width: 0; white-space: nowrap; }
|
|
505
|
+
.k-quiet-said { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
|
|
506
|
+
.k-quiet-sep, .k-quiet-tail { flex: none; white-space: pre; }
|
|
483
507
|
/* The approval, on the held wave's box. */
|
|
484
508
|
.k-over { position: absolute; left: 0; top: 0; visibility: hidden; }
|
|
485
509
|
.k-over.k-placed { visibility: visible; }
|
|
@@ -559,18 +583,23 @@
|
|
|
559
583
|
.k-result-waves dt { font: 600 0.9em var(--font-mono); color: var(--muted); }
|
|
560
584
|
.k-result-waves dd { margin: 0; font-variant-numeric: tabular-nums; }
|
|
561
585
|
.k-result-waves dd.k-result-soon { color: var(--muted); font-style: italic; }
|
|
562
|
-
@media (max-width: 900px) and (min-width: 601px) { body.k-watch #
|
|
586
|
+
@media (max-width: 900px) and (min-width: 601px) { body.k-watch #k-head { display: flex; flex-direction: column-reverse; } body.k-watch #k-tools { position: static; justify-content: flex-end; padding: var(--s2) var(--s4) 0; } }
|
|
563
587
|
.k-w-dora-foot { display: none; }
|
|
564
588
|
/* A phone: a short header, the graph, then the step and the approval under it; the rest stacks below, in the page's flow. */
|
|
565
589
|
@media (max-width: 600px) {
|
|
566
590
|
body.k-watch #bar { display: flex; flex-wrap: wrap; gap: 0.2em var(--s4); padding: var(--s1) 16px var(--s2); min-height: 0; }
|
|
567
591
|
body.k-watch #bar .k-strip, body.k-watch #bar .k-w-dora { display: none; }
|
|
592
|
+
.k-w-place, .k-w-place .k-cycle { flex-wrap: wrap; white-space: normal; overflow: visible; }
|
|
568
593
|
body.k-watch #stage { display: flex; flex-direction: column; padding: 0; }
|
|
569
594
|
body.k-watch #view-pane { position: relative; inset: auto; order: 1; height: 40vh; border-radius: 0; }
|
|
570
595
|
body.k-watch #k-watch { position: static; display: flex; flex-direction: column; order: 2; pointer-events: auto; gap: var(--s3); padding: 0 0 var(--s5); }
|
|
571
596
|
body.k-watch #k-caption { position: static; order: 1; display: flex; flex-direction: column; gap: var(--s1); border-radius: 0; box-shadow: none; padding: var(--s3) 16px var(--s3); }
|
|
572
597
|
.k-cap-top { order: 1; flex-wrap: wrap; }
|
|
573
|
-
.k-cap-step { order: 2; } .k-cap-changes { order: 3; }
|
|
598
|
+
.k-cap-step, .k-cap-quiet { order: 2; } .k-cap-changes { order: 3; }
|
|
599
|
+
/* Two lines at most: the driver's words on one, cut short; the job and the time on the next. */
|
|
600
|
+
.k-quiet { flex-wrap: wrap; }
|
|
601
|
+
.k-quiet-said { flex: 1 1 100%; }
|
|
602
|
+
.k-quiet-sep { display: none; }
|
|
574
603
|
.k-cap-title { white-space: normal; font-size: 1.12em; }
|
|
575
604
|
.k-cap-title .k-kicker { display: block; margin-bottom: 0.1em; }
|
|
576
605
|
.k-cap-next { margin-left: 0; flex: 1 1 100%; max-width: none; white-space: normal; }
|
|
@@ -607,7 +636,12 @@
|
|
|
607
636
|
<div id="k-tools">
|
|
608
637
|
<div id="k-mode" class="k-modes" role="group" aria-label="Layout"></div>
|
|
609
638
|
<button type="button" class="k-what" aria-expanded="false" aria-controls="k-what-pop">What is this?</button>
|
|
610
|
-
<
|
|
639
|
+
<!-- behold#755: < and > step through the themes beside the picker, in Watch and Inspect alike. -->
|
|
640
|
+
<div class="k-theme-step" role="group" aria-label="Theme">
|
|
641
|
+
<button type="button" class="k-theme-arrow" id="k-theme-prev" aria-label="Previous theme" title="Previous theme"><</button>
|
|
642
|
+
<details class="k-menu"><summary id="k-theme-name">Theme</summary><div class="k-menu-body" id="k-theme"></div></details>
|
|
643
|
+
<button type="button" class="k-theme-arrow" id="k-theme-next" aria-label="Next theme" title="Next theme">></button>
|
|
644
|
+
</div>
|
|
611
645
|
<div id="k-what-pop" role="dialog" aria-label="What is this?" hidden></div>
|
|
612
646
|
</div>
|
|
613
647
|
<header id="bar" aria-live="polite"></header>
|
|
@@ -643,9 +677,10 @@
|
|
|
643
677
|
<div id="eh-tips" aria-live="polite"></div>
|
|
644
678
|
<div id="eh-modals"></div>
|
|
645
679
|
<script type="module">
|
|
646
|
-
import { initTheme, KIOSK_THEME, getThemeName, onThemeChange } from "/theme.js";
|
|
680
|
+
import { initTheme, KIOSK_THEME, getThemeName, onThemeChange, stepTheme } from "/theme.js";
|
|
647
681
|
import { startKiosk } from "/kiosk.js";
|
|
648
682
|
import { pageTool } from "/kiosk-vendor.js";
|
|
683
|
+
import { pageSource, readsFor } from "/kiosk-source.js";
|
|
649
684
|
import { installMotion } from "/motion.js";
|
|
650
685
|
initTheme(KIOSK_THEME);
|
|
651
686
|
// behold#725: every looping animation holds while the tab is hidden.
|
|
@@ -655,9 +690,9 @@
|
|
|
655
690
|
const nameTheme = () => { if (!themeName) return; const n = document.createElement("span"); n.className = "k-theme-n"; n.textContent = `: ${getThemeName()}`; themeName.replaceChildren("Theme", n); };
|
|
656
691
|
nameTheme();
|
|
657
692
|
onThemeChange(nameTheme);
|
|
658
|
-
// behold#
|
|
659
|
-
|
|
660
|
-
|
|
693
|
+
// behold#755: < and > step to the previous and next theme.
|
|
694
|
+
document.getElementById("k-theme-prev")?.addEventListener("click", () => stepTheme(-1));
|
|
695
|
+
document.getElementById("k-theme-next")?.addEventListener("click", () => stepTheme(1));
|
|
661
696
|
// behold#571: /<tool> serves this page with its tool in a meta tag; /kiosk has none.
|
|
662
697
|
const kiosk = startKiosk(
|
|
663
698
|
{
|
|
@@ -666,10 +701,10 @@
|
|
|
666
701
|
eh: { switchHost: document.getElementById("k-tools"), trailHost: document.getElementById("eh-trail"), tipsHost: document.getElementById("eh-tips"), modalHost: document.getElementById("eh-modals") },
|
|
667
702
|
watch: { layer: document.getElementById("k-watch"), caption: document.getElementById("k-caption"), callout: document.getElementById("k-callout"), drawer: document.getElementById("k-drawer"), badges: document.getElementById("k-badges"), result: document.getElementById("k-result") },
|
|
668
703
|
},
|
|
669
|
-
{ tool: pageTool(document) },
|
|
704
|
+
{ tool: pageTool(document), source: pageSource(document) },
|
|
670
705
|
);
|
|
671
706
|
// behold#571: the repo's numbers from Prometheus, a pane of its own in Inspect (web/kiosk-metrics.js), and Watch's badges and delivery line.
|
|
672
|
-
import("/kiosk-metrics.js").then((m) => m.startMetrics(document.getElementById("k-metrics"), { tool: pageTool(document), onModel: (model) => kiosk.setMetrics(model) }));
|
|
707
|
+
import("/kiosk-metrics.js").then((m) => m.startMetrics(document.getElementById("k-metrics"), { tool: pageTool(document), reads: readsFor(pageSource(document)), onModel: (model) => kiosk.setMetrics(model) }));
|
|
673
708
|
</script>
|
|
674
709
|
</body>
|
|
675
710
|
</html>
|