@intentius/behold 0.30.1 → 0.30.2
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 +31 -1
- package/README.md +11 -6
- package/dist/cli.js +1516 -840
- package/example-choudoufu-estate/chant.workspace.json +1 -1
- package/example-terraform-estate/README.md +1 -1
- package/example-terraform-estate/chant.workspace.json +1 -1
- package/example-terralith/README.md +1 -1
- package/example-three-cloud/package-lock.json +19 -19
- package/example-three-cloud/package.json +4 -4
- package/package.json +5 -5
- package/web/app.js +263 -16
- package/web/embed.js +2 -2
- package/web/event-help-modal.js +18 -12
- package/web/event-help-modal.test.js +28 -1
- package/web/index.html +18 -0
- package/web/kiosk-ask-layout.js +85 -0
- package/web/kiosk-ask-layout.test.js +83 -0
- package/web/kiosk-ask-tips.js +467 -0
- package/web/kiosk-ask-tips.test.js +359 -0
- package/web/kiosk-ask.js +774 -0
- package/web/kiosk-ask.test.js +593 -0
- package/web/kiosk-banner.js +108 -0
- package/web/kiosk-banner.test.js +72 -0
- package/web/kiosk-center-cards.test.js +110 -0
- package/web/kiosk-estate-scene.js +203 -0
- package/web/kiosk-estate-scene.test.js +21 -0
- package/web/kiosk-event-help.js +4 -1
- package/web/kiosk-graph-pane.js +63 -0
- package/web/kiosk-graph-pane.test.js +105 -0
- package/web/kiosk-light-frame.js +196 -0
- package/web/kiosk-light.js +509 -0
- package/web/kiosk-light.test.js +297 -0
- package/web/kiosk-metrics.js +7 -4
- package/web/kiosk-modal-sticky.test.js +2 -1
- package/web/kiosk-refit.test.js +81 -0
- package/web/kiosk-reset.js +49 -0
- package/web/kiosk-reset.test.js +11 -0
- package/web/kiosk-shot.js +40 -2
- package/web/kiosk-shot.test.js +23 -1
- package/web/kiosk-vendor.js +85 -7
- package/web/kiosk-vendor.test.js +9 -9
- package/web/kiosk-watch.js +8 -4
- package/web/kiosk.html +107 -1
- package/web/kiosk.js +149 -23
- package/web/kiosk.test.js +25 -1
- package/web/small-stage.test.js +4 -0
- package/web/terragucci-change.js +30 -13
- package/web/tool-mark.js +4 -4
- package/web/tool-mark.test.js +1 -1
- package/web/vendors/atmos.svg +1 -0
- package/web/vendors/chant.svg +1 -0
- package/web/vendors/choudoufu.svg +1 -0
- package/web/vendors/terragrunt.svg +9 -0
- package/web/vendors/terragucci.svg +1 -0
- package/web/vendors/choudoufu-128.png +0 -0
- package/web/vendors/choudoufu-64.png +0 -0
package/web/kiosk-vendor.js
CHANGED
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
* - CDK Terrain: the Open Construct Foundation's continuation of CDKTF; its
|
|
29
29
|
* site, cdktn.io, publishes no rules for its logo, so the name is text.
|
|
30
30
|
* - choudoufu: ours, logo and all.
|
|
31
|
-
* - chant: ours too.
|
|
31
|
+
* - chant: ours too. The older chant entry below keeps the name as text; the chant-compose demo shows chant's mark. Its scenario
|
|
32
32
|
* runs chant's own pull-request pipeline, which installs OpenTofu.
|
|
33
33
|
*/
|
|
34
34
|
export const VENDORS = {
|
|
@@ -67,8 +67,8 @@ export const VENDORS = {
|
|
|
67
67
|
name: "choudoufu",
|
|
68
68
|
owner: "Intentius",
|
|
69
69
|
url: "https://intentius.io/choudoufu/",
|
|
70
|
-
logo: { src: "/vendors/choudoufu
|
|
71
|
-
credit: "choudoufu is made by Intentius, who also make this demo. It supports AWS and Kubernetes.",
|
|
70
|
+
logo: { src: "/vendors/choudoufu.svg" },
|
|
71
|
+
credit: "choudoufu is made by Intentius, who also make this demo. It supports AWS, GCP, Azure and Kubernetes.",
|
|
72
72
|
kind: "engine",
|
|
73
73
|
terms: ["choudoufu"],
|
|
74
74
|
runsWith: [],
|
|
@@ -126,12 +126,76 @@ export const VENDORS = {
|
|
|
126
126
|
name: "choudoufu",
|
|
127
127
|
owner: "Intentius",
|
|
128
128
|
url: "https://intentius.io/choudoufu/",
|
|
129
|
-
logo: { src: "/vendors/choudoufu
|
|
130
|
-
credit: "choudoufu is made by Intentius, who also make this demo. It supports AWS and Kubernetes.",
|
|
129
|
+
logo: { src: "/vendors/choudoufu.svg" },
|
|
130
|
+
credit: "choudoufu is made by Intentius, who also make this demo. It supports AWS, GCP, Azure and Kubernetes.",
|
|
131
131
|
kind: "fanout",
|
|
132
132
|
terms: ["choudoufu"],
|
|
133
133
|
runsWith: [],
|
|
134
134
|
},
|
|
135
|
+
// The multi-state demos (the only ones listed): one plan and one apply across three estates, on choudoufu and OpenTofu.
|
|
136
|
+
// choudoufu's logo is ours. OpenTofu, Terragrunt and Atmos show as text: their owners' published rules, where we found
|
|
137
|
+
// any, don't give a third party's page a logo (see web/kiosk-banner.js). `title` is the example's name for the banner,
|
|
138
|
+
// `code` the full URL of its public example in its product's repo, `products` the banner's logos or names, in order.
|
|
139
|
+
"choudoufu-compose": {
|
|
140
|
+
name: "terragucci and choudoufu",
|
|
141
|
+
title: "One plan, one apply, across estates",
|
|
142
|
+
code: "https://github.com/INTENTIUS/terragucci/tree/main/example-demo-choudoufu-compose",
|
|
143
|
+
products: ["terragucci", "choudoufu"],
|
|
144
|
+
owner: "Intentius",
|
|
145
|
+
url: "https://intentius.io/choudoufu/",
|
|
146
|
+
logo: { src: "/vendors/choudoufu.svg" },
|
|
147
|
+
credit: "choudoufu is made by Intentius, who also make this demo. It supports AWS, GCP, Azure and Kubernetes.",
|
|
148
|
+
kind: "demo",
|
|
149
|
+
terms: [],
|
|
150
|
+
runsWith: [],
|
|
151
|
+
},
|
|
152
|
+
"terragrunt-choudoufu": {
|
|
153
|
+
name: "choudoufu with Terragrunt",
|
|
154
|
+
title: "One plan, one apply, across estates, with Terragrunt",
|
|
155
|
+
code: "https://github.com/INTENTIUS/choudoufu/tree/main/examples/demo-terragrunt",
|
|
156
|
+
products: ["terragrunt", "choudoufu"],
|
|
157
|
+
owner: "Intentius",
|
|
158
|
+
url: "https://intentius.io/choudoufu/",
|
|
159
|
+
logo: { src: "/vendors/choudoufu.svg" },
|
|
160
|
+
credit: "choudoufu is made by Intentius, who also make this demo.",
|
|
161
|
+
kind: "demo",
|
|
162
|
+
terms: [],
|
|
163
|
+
runsWith: ["terragrunt"],
|
|
164
|
+
hides: ["terragucci", "atmos", "cloud posse"],
|
|
165
|
+
},
|
|
166
|
+
"atmos-choudoufu": {
|
|
167
|
+
name: "choudoufu with Atmos",
|
|
168
|
+
title: "One plan across estates, with Atmos",
|
|
169
|
+
// Atmos applies each component in turn: the banner claims one plan, not one apply.
|
|
170
|
+
heading: "One plan across estates",
|
|
171
|
+
code: "https://github.com/INTENTIUS/choudoufu/tree/main/examples/demo-atmos",
|
|
172
|
+
products: ["atmos", "choudoufu"],
|
|
173
|
+
owner: "Intentius",
|
|
174
|
+
url: "https://intentius.io/choudoufu/",
|
|
175
|
+
logo: { src: "/vendors/choudoufu.svg" },
|
|
176
|
+
credit: "choudoufu is made by Intentius, who also make this demo.",
|
|
177
|
+
kind: "demo",
|
|
178
|
+
terms: [],
|
|
179
|
+
runsWith: ["atmos"],
|
|
180
|
+
hides: ["terragucci", "terragrunt", "gruntwork"],
|
|
181
|
+
},
|
|
182
|
+
// chant's own pull-request pipeline across three CloudFormation stacks. The logo is chant's mark (web/vendors/chant.svg,
|
|
183
|
+
// from the chant repo's docs/public/brand/logo.svg, its face). `heading` is the banner's title where it differs from the others'.
|
|
184
|
+
"chant-compose": {
|
|
185
|
+
name: "chant",
|
|
186
|
+
title: "One plan, one apply, across stacks",
|
|
187
|
+
heading: "One plan, one apply, across stacks",
|
|
188
|
+
code: "https://github.com/INTENTIUS/chant/tree/main/examples/demo-composed-stacks",
|
|
189
|
+
products: ["chant"],
|
|
190
|
+
owner: "Intentius",
|
|
191
|
+
url: "https://intentius.io/chant/",
|
|
192
|
+
logo: { src: "/vendors/chant.svg" },
|
|
193
|
+
credit: "chant is made by Intentius, who also make this demo.",
|
|
194
|
+
kind: "demo",
|
|
195
|
+
terms: [],
|
|
196
|
+
runsWith: [],
|
|
197
|
+
hides: ["terragucci", "choudoufu", "terragrunt", "gruntwork", "atmos", "cloud posse"],
|
|
198
|
+
},
|
|
135
199
|
};
|
|
136
200
|
|
|
137
201
|
/** What a tool's scenarios run on, said on its page as the owner's rules allow ("works with OpenTofu"). */
|
|
@@ -143,6 +207,20 @@ export const RUNS_WITH = {
|
|
|
143
207
|
kind: "engine",
|
|
144
208
|
terms: ["OpenTofu"],
|
|
145
209
|
},
|
|
210
|
+
terragrunt: {
|
|
211
|
+
name: "Terragrunt",
|
|
212
|
+
url: "https://terragrunt.com/",
|
|
213
|
+
words: "This version works with Terragrunt, which Gruntwork, Inc. makes and who don't endorse this demo.",
|
|
214
|
+
kind: "orchestrator",
|
|
215
|
+
terms: ["Terragrunt", "Gruntwork"],
|
|
216
|
+
},
|
|
217
|
+
atmos: {
|
|
218
|
+
name: "Atmos",
|
|
219
|
+
url: "https://atmos.tools/",
|
|
220
|
+
words: "This version works with Atmos, which Cloud Posse makes and who don't endorse this demo.",
|
|
221
|
+
kind: "orchestrator",
|
|
222
|
+
terms: ["Atmos", "Cloud Posse"],
|
|
223
|
+
},
|
|
146
224
|
};
|
|
147
225
|
|
|
148
226
|
/**
|
|
@@ -165,7 +243,7 @@ export const COMPETITORS = {
|
|
|
165
243
|
* behold#746: the fan-out pages compete with each other alone, whatever
|
|
166
244
|
* engine or pipeline each runs: three takes on one scenario.
|
|
167
245
|
*/
|
|
168
|
-
export const COMPETES = { engine: "engine", orchestrator: "orchestrator", pipeline: "pipeline", fanout: "fanout" };
|
|
246
|
+
export const COMPETES = { engine: "engine", orchestrator: "orchestrator", pipeline: "pipeline", fanout: "fanout", demo: "demo" };
|
|
169
247
|
|
|
170
248
|
const own = (o, k) => Object.prototype.hasOwnProperty.call(o, k);
|
|
171
249
|
|
|
@@ -206,7 +284,7 @@ export function otherTerms(tool) {
|
|
|
206
284
|
if (id === tool || x.kind !== rivals || v.runsWith.includes(id)) continue;
|
|
207
285
|
out.push(...x.terms);
|
|
208
286
|
}
|
|
209
|
-
return [...out, ...(v.hides || [])];
|
|
287
|
+
return [...new Set([...out, ...(v.hides || [])])];
|
|
210
288
|
}
|
|
211
289
|
|
|
212
290
|
const escapeRe = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
package/web/kiosk-vendor.test.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// behold#571: the per-tool pages' pure parts: live or replay, the replay's pace, the runs kept, and the branding.
|
|
2
2
|
import { describe, expect, it } from "vitest";
|
|
3
|
-
import { VENDOR_TOOLS } from "../src/terragucci-demo.ts";
|
|
3
|
+
import { LEGACY_TOOLS, VENDOR_TOOLS } from "../src/terragucci-demo.ts";
|
|
4
4
|
import { logRows } from "./kiosk-runs.js";
|
|
5
5
|
import { NO_GRAPH_WORDS, SCENARIOS, WHAT_TITLE, readingRows, scenarioHead, whatParts, whatTitle } from "./kiosk.js";
|
|
6
6
|
import {
|
|
@@ -134,24 +134,24 @@ describe("the replay's banner (behold#571)", () => {
|
|
|
134
134
|
});
|
|
135
135
|
|
|
136
136
|
describe("the branding table (behold#571)", () => {
|
|
137
|
-
it("
|
|
138
|
-
expect(Object.keys(VENDORS)).toEqual([...VENDOR_TOOLS]);
|
|
137
|
+
it("brands every listed demo and the older tools (kept for the chant demo and the scenario heads), and nothing else", () => {
|
|
138
|
+
expect(Object.keys(VENDORS)).toEqual([...LEGACY_TOOLS, ...VENDOR_TOOLS]);
|
|
139
139
|
});
|
|
140
140
|
it("links every name to an official https site, and shows a logo for choudoufu alone", () => {
|
|
141
141
|
for (const v of Object.values(VENDORS)) expect(v.url).toMatch(/^https:\/\//);
|
|
142
|
-
expect(Object.entries(VENDORS).filter(([, v]) => v.logo).map(([id]) => id)).toEqual(["choudoufu", "choudoufu-fanout"]);
|
|
142
|
+
expect(Object.entries(VENDORS).filter(([, v]) => v.logo).map(([id]) => id)).toEqual(["choudoufu", "choudoufu-fanout", ...VENDOR_TOOLS]);
|
|
143
143
|
expect(VENDORS["cdk-terrain"].url).toBe("https://cdktn.io/");
|
|
144
144
|
expect(VENDORS.terraform.credit).toContain("Terraform is a trademark of HashiCorp.");
|
|
145
145
|
});
|
|
146
146
|
it("says on each page who makes the tool and that they don't endorse the demo, naming no other tool or maker", () => {
|
|
147
|
-
for (const tool of VENDOR_TOOLS) {
|
|
147
|
+
for (const tool of [...LEGACY_TOOLS, ...VENDOR_TOOLS]) {
|
|
148
148
|
const v = VENDORS[tool];
|
|
149
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)];
|
|
150
150
|
for (const w of words) expect(namesOther(w, tool), `${tool}: ${w}`).toBe(false);
|
|
151
151
|
// choudoufu and chant are ours: their credits say so instead.
|
|
152
152
|
if (v.owner !== "Intentius") expect(v.credit).toMatch(/(does not|don't) endorse this demo\./);
|
|
153
153
|
}
|
|
154
|
-
expect(VENDORS.choudoufu.credit).toMatch(/AWS and Kubernetes/);
|
|
154
|
+
expect(VENDORS.choudoufu.credit).toMatch(/AWS, GCP, Azure and Kubernetes/);
|
|
155
155
|
expect(VENDORS.choudoufu.credit).not.toMatch(/experimental/i);
|
|
156
156
|
});
|
|
157
157
|
it("links each name in the credit, the tool's to its site and OpenTofu's where its scenarios run on it", () => {
|
|
@@ -164,7 +164,7 @@ describe("the branding table (behold#571)", () => {
|
|
|
164
164
|
expect(linkSegments("a b a", [{ name: "a", url: "u" }])).toEqual([{ text: "a", url: "u" }, { text: " b a" }]);
|
|
165
165
|
});
|
|
166
166
|
it("counts as a competitor each other tool of the same kind: engines with engines, orchestrators with orchestrators", () => {
|
|
167
|
-
const matrix = Object.fromEntries(
|
|
167
|
+
const matrix = Object.fromEntries(LEGACY_TOOLS.map((t) => [t, otherTerms(t)]));
|
|
168
168
|
expect(matrix).toEqual({
|
|
169
169
|
// OpenTofu is an engine too, but Terraform's scenarios really run on it.
|
|
170
170
|
terraform: ["choudoufu"],
|
|
@@ -181,7 +181,7 @@ describe("the branding table (behold#571)", () => {
|
|
|
181
181
|
expect(otherTerms(null)).toEqual([]);
|
|
182
182
|
});
|
|
183
183
|
it("keeps the chant approve lines on every page, since chant is a pipeline and competes with no engine or orchestrator", () => {
|
|
184
|
-
for (const tool of VENDOR_TOOLS) expect(namesOther("chant approve tf-apply wave-2 --actor demo-reviewer --sign", tool), tool).toBe(false);
|
|
184
|
+
for (const tool of [...LEGACY_TOOLS, ...VENDOR_TOOLS]) expect(namesOther("chant approve tf-apply wave-2 --actor demo-reviewer --sign", tool), tool).toBe(false);
|
|
185
185
|
expect(VENDORS.chant.url).toBe("https://intentius.io/chant/");
|
|
186
186
|
expect(VENDORS.chant.owner).toBe("Intentius");
|
|
187
187
|
expect(creditLines("chant").flat().filter((s) => s.url).map((s) => s.text)).toEqual(["chant", "OpenTofu"]);
|
|
@@ -310,7 +310,7 @@ describe("a page per fan-out tool (behold#746)", () => {
|
|
|
310
310
|
const BANNED = /terragucci|opentofu|tofu/i;
|
|
311
311
|
|
|
312
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(
|
|
313
|
+
for (const t of FANOUTS) expect(LEGACY_TOOLS).toContain(t);
|
|
314
314
|
expect([VENDORS["chant-fanout"].name, VENDORS["tofu-fanout"].name, VENDORS["choudoufu-fanout"].name]).toEqual(["chant", "OpenTofu", "choudoufu"]);
|
|
315
315
|
expect(FANOUTS.map(toolCheckout)).toEqual(["demo-chant-fanout", "demo-fanout", "demo-choudoufu-fanout"]);
|
|
316
316
|
});
|
package/web/kiosk-watch.js
CHANGED
|
@@ -15,6 +15,7 @@ import { STEP_WORDS, focusRoots, matchingPull, matchingRun, scenarioHead, introT
|
|
|
15
15
|
import { defaultJob, defaultStep, logLineWords, setupLine } from "./kiosk-runs.js";
|
|
16
16
|
import { backendLine, coneLine, coneOf } from "./cone.js";
|
|
17
17
|
import { placeFloat } from "./float-place.js";
|
|
18
|
+
import { COMPOSED_WORDS, composedRun } from "./kiosk-light.js";
|
|
18
19
|
|
|
19
20
|
/** The two modes, Watch first: it is the default. */
|
|
20
21
|
export const MODES = [
|
|
@@ -164,7 +165,9 @@ export function coneCaption(demo, answer) {
|
|
|
164
165
|
* the drawer while the run is on a wave (`kind` "active"). Inspect keeps its
|
|
165
166
|
* cards either way.
|
|
166
167
|
*/
|
|
167
|
-
export function watchOverlays({ kind = null, opened = false, held = false } = {}) {
|
|
168
|
+
export function watchOverlays({ kind = null, opened = false, held = false, ask = false } = {}) {
|
|
169
|
+
// behold#939: a prompt-driven step shows the graph and the pane alone (web/kiosk-ask.js askMode).
|
|
170
|
+
if (ask) return { result: false, callout: false, badges: false, drawer: !!opened };
|
|
168
171
|
if (held) return { result: false, callout: false, badges: false, drawer: !!opened };
|
|
169
172
|
return { result: true, callout: true, badges: true, drawer: kind === "active" || !!opened };
|
|
170
173
|
}
|
|
@@ -269,7 +272,8 @@ export function resultModel(demo, metrics, progress = null) {
|
|
|
269
272
|
const m = metrics && metrics.run && metrics.run.current ? metrics.run.waves : [];
|
|
270
273
|
const n = all.length || m.length;
|
|
271
274
|
if (!n) return null;
|
|
272
|
-
const
|
|
275
|
+
const composed = composedRun(progress);
|
|
276
|
+
const counts = [composed ? COMPOSED_WORDS : `${n} ${n === 1 ? "wave" : "waves"} applied`];
|
|
273
277
|
const changed = states.length ? mergeChanges(states.map((w) => w.totals)) : mergeChanges(m.map((w) => w.changesRaw));
|
|
274
278
|
counts.push(changed || "nothing to change");
|
|
275
279
|
// The metrics cover the run when they have a number for each wave that applied.
|
|
@@ -282,8 +286,8 @@ export function resultModel(demo, metrics, progress = null) {
|
|
|
282
286
|
// A row for every wave, its numbers when they have landed; never fewer rows than the count says.
|
|
283
287
|
const numbers = new Map(m.map((w) => [w.wave, badgeWords(w)]));
|
|
284
288
|
const numbered = [...new Set([...all.map((w) => w.number), ...m.map((w) => w.wave)])].sort((a, b) => a - b);
|
|
285
|
-
const waves = numbered.map((w) => ({ wave: w, words: numbers.get(w) || null }));
|
|
286
|
-
return { head: "Applied", line: typeof demo.label === "string" ? demo.label : "", counts, waves };
|
|
289
|
+
const waves = composed ? [] : numbered.map((w) => ({ wave: w, words: numbers.get(w) || null }));
|
|
290
|
+
return { head: "Applied", line: typeof demo.label === "string" ? demo.label : "", counts, waves, ...(composed ? { composed: true } : {}) };
|
|
287
291
|
}
|
|
288
292
|
|
|
289
293
|
/**
|
package/web/kiosk.html
CHANGED
|
@@ -322,6 +322,9 @@
|
|
|
322
322
|
.k-view-note { color: var(--muted); font-size: 0.8em; }
|
|
323
323
|
/* behold#571: "How to read this", the graph pane's static frame: the legend of the view shown, folded to its header on request. */
|
|
324
324
|
#view-pane { position: relative; }
|
|
325
|
+
/* No frame has drawn yet on this page (a reload, a load in place): the pane is dark and says so, never an empty box. */
|
|
326
|
+
#view-pane::after { content: "Drawing the graph..."; position: absolute; inset: 0; display: none; align-items: center; justify-content: center; color: var(--muted); font: 600 1.1em var(--font-ui); pointer-events: none; }
|
|
327
|
+
body.k-framewait #view-pane::after { display: flex; }
|
|
325
328
|
#views { padding-right: 11em; }
|
|
326
329
|
/* Folded, its header sits in the toggle's row; open, its rows lie over the top of the graph, two to a line. */
|
|
327
330
|
#k-read { font-size: 0.82em; }
|
|
@@ -506,6 +509,73 @@
|
|
|
506
509
|
body.k-watch #k-change.k-open .k-change-label::after, body.k-watch #k-waves.k-open .k-wl-title::after { content: " · hide"; }
|
|
507
510
|
body.k-watch #k-waves:not(.k-open) .k-wl-hint { display: none; }
|
|
508
511
|
}
|
|
512
|
+
/* behold#936: the prompt pane. Sized to its entries (the last three faded, and the current one), at most 30% of the screen (behold#939); the script keeps it from shrinking within a scenario, so the room the graph keeps does not breathe as it types. The entries sit at its foot. */
|
|
513
|
+
#k-ask { position: absolute; left: 5px; right: 5px; bottom: 5px; height: auto; max-height: 30vh; box-sizing: border-box; display: flex; flex-direction: column; justify-content: flex-end; gap: 0.35em; overflow: hidden;
|
|
514
|
+
padding: var(--s3) 1.4em var(--s4); font: 600 clamp(1.1rem, 1.6vw, 1.6rem)/1.2 var(--font-mono); letter-spacing: -0.01em; color: var(--fg);
|
|
515
|
+
background: var(--surface-pane-b); border-top: 1px solid var(--rule); border-radius: 0 0 8px 8px; box-shadow: 0 -10px 30px color-mix(in srgb, var(--bg) 70%, transparent); }
|
|
516
|
+
#k-ask[hidden] { display: none; }
|
|
517
|
+
#k-ask:has(.ask-diff) { max-height: 30vh; } /* the diff block keeps the same cap: older entries scroll out above it, so the graph keeps 70% of the screen */
|
|
518
|
+
#k-ask .ask-entry { display: flex; flex-direction: column; gap: 0.15em; min-width: 0; }
|
|
519
|
+
#k-ask .ask-line { display: flex; gap: 0.6em; }
|
|
520
|
+
#k-ask .ask-mark { color: var(--pending, var(--fg)); flex: none; min-width: 1ch; }
|
|
521
|
+
#k-ask .ask-text, #k-ask .ask-reply { overflow-wrap: anywhere; }
|
|
522
|
+
#k-ask .ask-reply { padding-left: 1.6em; color: var(--ink2, var(--fg)); font-weight: 500; }
|
|
523
|
+
#k-ask .ask-old { opacity: 0.55; }
|
|
524
|
+
#k-ask .ask-old-2 { opacity: 0.4; }
|
|
525
|
+
#k-ask .ask-old-3, #k-ask .ask-old-4 { opacity: 0.28; }
|
|
526
|
+
#k-ask .ask-typing .ask-text::after { content: "\2588"; margin-left: 0.1em; }
|
|
527
|
+
body.k-ask #bar, body.k-ask #k-caption, body.k-ask #views { display: none; }
|
|
528
|
+
/* behold#939: ask mode leaves the graph and the pane alone: no approval card, result card, badges, log drawer, tip or modal, and no chip strip. */
|
|
529
|
+
body.k-ask #k-callout, body.k-ask #k-result, body.k-ask #k-badges, body.k-ask #k-drawer, body.k-ask #eh-tips, body.k-ask #eh-modals, body.k-ask #eh-trail, body.k-ask #k-track, body.k-ask #eh-strip { display: none !important; }
|
|
530
|
+
@media (max-width: 600px) {
|
|
531
|
+
body.k-watch #k-ask { position: static; order: 1; height: auto; max-height: 50vh; border-radius: 0; box-shadow: none; }
|
|
532
|
+
}
|
|
533
|
+
/* ==== layout: ask mode (behold#942) ==== Owned by the layout work; the prompt pane's own look is the block above. */
|
|
534
|
+
/* Everywhere: ask mode shows the graph and the pane, so what talks over them is off. */
|
|
535
|
+
body.k-ask #k-change, body.k-ask #k-waves, body.k-ask .k-w-dora-foot, body.k-ask #k-what-pop, body.k-ask #k-read, body.k-ask #k-traces { display: none !important; }
|
|
536
|
+
/* A phone: the graph on top (70% of the dynamic viewport), the pane under it (30%), and nothing else, with no page scroll. */
|
|
537
|
+
@media (max-width: 700px) {
|
|
538
|
+
html:has(body.k-ask), body.k-ask.k-watch { height: 100vh; height: 100dvh; overflow: hidden !important; overscroll-behavior: none; }
|
|
539
|
+
body.k-ask.k-watch { position: fixed; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 70dvh minmax(0, 1fr); font-size: 14px; }
|
|
540
|
+
body.k-ask.k-watch #k-head, body.k-ask.k-watch #bar, body.k-ask.k-watch #k-tools, body.k-ask.k-watch #eh-trail, body.k-ask.k-watch .k-link, body.k-ask.k-watch #k-caption, body.k-ask.k-watch #views, body.k-ask.k-watch #k-held-over,
|
|
541
|
+
body.k-ask.k-watch #k-callout, body.k-ask.k-watch #k-result, body.k-ask.k-watch #k-badges, body.k-ask.k-watch #k-drawer, body.k-ask.k-watch #k-track, body.k-ask.k-watch #eh-strip,
|
|
542
|
+
body.k-ask.k-watch #eh-tips, body.k-ask.k-watch #eh-modals, body.k-ask.k-watch #k-metrics, body.k-ask.k-watch #runs-side, body.k-ask.k-watch #runs-main, body.k-ask.k-watch #k-runs-toggle { display: none !important; }
|
|
543
|
+
/* The stage and the watch layer dissolve, so the graph and the pane are the body's two rows. */
|
|
544
|
+
body.k-ask.k-watch #stage, body.k-ask.k-watch #k-watch { display: contents !important; }
|
|
545
|
+
body.k-ask.k-watch #view-pane { grid-row: 1; position: relative !important; inset: auto !important; order: 0; height: 100% !important; min-height: 0; border-radius: 0; overflow: hidden; }
|
|
546
|
+
body.k-ask.k-watch #view { height: 100%; }
|
|
547
|
+
body.k-ask.k-watch #k-ask { grid-row: 2; position: static !important; order: 0; height: auto !important; min-height: 0 !important; max-height: none !important; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
|
|
548
|
+
border-radius: 0; box-shadow: none; padding-bottom: calc(var(--s3) + env(safe-area-inset-bottom, 0px)); padding-left: 16px; padding-right: 16px; }
|
|
549
|
+
}
|
|
550
|
+
/* ==== end layout: ask mode ==== */
|
|
551
|
+
/* ==== the demo banner (web/kiosk-banner.js): the example's name, its products, the code link ==== */
|
|
552
|
+
#k-banner { display: flex; align-items: center; gap: var(--s2) var(--s5); min-width: 0; height: 34px; box-sizing: border-box; padding: 0 var(--s4); border-bottom: 1px solid var(--rule); background: var(--surface-pane-a, var(--bg)); overflow: hidden; white-space: nowrap; }
|
|
553
|
+
#k-banner[hidden] { display: none; }
|
|
554
|
+
body.k-bannered { grid-template-rows: auto auto minmax(0, 1fr); }
|
|
555
|
+
.kb-name { font-weight: 700; color: var(--fg); min-width: 0; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; }
|
|
556
|
+
.kb-products { display: inline-flex; align-items: center; gap: var(--s4); flex: 0 0 auto; }
|
|
557
|
+
.kb-product { display: inline-flex; align-items: center; gap: var(--s1); color: var(--muted); text-decoration: none; font-weight: 600; }
|
|
558
|
+
.kb-product:hover { color: var(--fg); text-decoration: underline; }
|
|
559
|
+
.kb-logo { width: 1.4em; height: 1.4em; }
|
|
560
|
+
.kb-code { flex: 0 0 auto; margin-left: auto; color: var(--fg); font-weight: 600; }
|
|
561
|
+
.kb-code-short { display: none; }
|
|
562
|
+
/* The prompt demo's tip cards sit under the banner, not over it. */
|
|
563
|
+
body.k-bannered #k-ask-tips .eh-modal-wrap { padding-top: 42px; }
|
|
564
|
+
@media (max-width: 700px) {
|
|
565
|
+
#k-banner { gap: var(--s3); padding: 0 12px; font-size: 13px; }
|
|
566
|
+
.kb-name { flex: 1 1 0; }
|
|
567
|
+
.kb-product .kb-pname { display: none; }
|
|
568
|
+
.kb-product:not(:has(.kb-logo)) { display: none; }
|
|
569
|
+
.kb-code { margin-left: 0; }
|
|
570
|
+
.kb-code-long { display: none; }
|
|
571
|
+
.kb-code-short { display: inline; font-size: 0.92em; }
|
|
572
|
+
/* Ask mode: the banner takes 34px of the graph's 60dvh, and the pane keeps the rest. */
|
|
573
|
+
body.k-ask.k-watch.k-bannered { grid-template-rows: 34px calc(60dvh - 34px) minmax(0, 1fr); }
|
|
574
|
+
body.k-ask.k-watch.k-bannered #k-banner { grid-row: 1; }
|
|
575
|
+
body.k-ask.k-watch.k-bannered #view-pane { grid-row: 2; }
|
|
576
|
+
body.k-ask.k-watch.k-bannered #k-ask { grid-row: 3; }
|
|
577
|
+
}
|
|
578
|
+
/* ==== end banner ==== */
|
|
509
579
|
/* The caption: the title, what changes, the step. One of the two beats leads. */
|
|
510
580
|
#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);
|
|
511
581
|
background: var(--surface-pane-b); border-top: 1px solid var(--rule); border-radius: 0 0 8px 8px; box-shadow: 0 -10px 30px color-mix(in srgb, var(--bg) 70%, transparent); }
|
|
@@ -732,6 +802,7 @@
|
|
|
732
802
|
</style>
|
|
733
803
|
</head>
|
|
734
804
|
<body>
|
|
805
|
+
<header id="k-banner" aria-label="This demo" hidden></header>
|
|
735
806
|
<div id="k-head">
|
|
736
807
|
<div id="k-tools">
|
|
737
808
|
<div id="k-mode" class="k-modes" role="group" aria-label="Layout"></div>
|
|
@@ -772,6 +843,8 @@
|
|
|
772
843
|
<div id="k-traces" data-k-mount="traces"></div>
|
|
773
844
|
</section>
|
|
774
845
|
<aside id="k-result" class="k-over" aria-label="The result" hidden></aside>
|
|
846
|
+
<!-- behold#936: the prompt pane, in the header's and the caption's place while a step has a prompt (web/kiosk-ask.js). -->
|
|
847
|
+
<section id="k-ask" aria-live="polite" aria-label="The prompt" hidden></section>
|
|
775
848
|
<footer id="k-caption" aria-live="polite"></footer>
|
|
776
849
|
<!-- behold#781, behold#776: a phone's Watch only: the change's facts by the story, and the graph's marks as a list. -->
|
|
777
850
|
<section id="k-change" aria-label="The change" hidden></section>
|
|
@@ -790,6 +863,7 @@
|
|
|
790
863
|
});
|
|
791
864
|
import { startKiosk } from "/kiosk.js";
|
|
792
865
|
import { pageTool } from "/kiosk-vendor.js";
|
|
866
|
+
import { actOf, bannerModel, drawBanner, liveTool } from "/kiosk-banner.js";
|
|
793
867
|
import { pageRuns, pageSource, readsFor } from "/kiosk-source.js";
|
|
794
868
|
import { installMotion } from "/motion.js";
|
|
795
869
|
initTheme(KIOSK_THEME);
|
|
@@ -809,10 +883,42 @@
|
|
|
809
883
|
bar: document.getElementById("bar"), frame: document.getElementById("view"), read: document.getElementById("k-read"), side: document.getElementById("runs-side"), main: document.getElementById("runs-main"), views: document.getElementById("views"),
|
|
810
884
|
tools: { what: document.querySelector(".k-what"), pop: document.getElementById("k-what-pop"), theme: document.getElementById("k-theme"), runsToggle: document.getElementById("k-runs-toggle"), mode: document.getElementById("k-mode") },
|
|
811
885
|
eh: { switchHost: document.getElementById("k-tools"), trailHost: document.getElementById("eh-trail"), tipsHost: document.getElementById("eh-tips"), modalHost: document.getElementById("eh-modals") },
|
|
812
|
-
watch: { layer: document.getElementById("k-watch"), caption: document.getElementById("k-caption"), change: document.getElementById("k-change"), waves: document.getElementById("k-waves"), callout: document.getElementById("k-callout"), drawer: document.getElementById("k-drawer"), badges: document.getElementById("k-badges"), result: document.getElementById("k-result") },
|
|
886
|
+
watch: { layer: document.getElementById("k-watch"), caption: document.getElementById("k-caption"), change: document.getElementById("k-change"), waves: document.getElementById("k-waves"), callout: document.getElementById("k-callout"), ask: document.getElementById("k-ask"), drawer: document.getElementById("k-drawer"), badges: document.getElementById("k-badges"), result: document.getElementById("k-result") },
|
|
813
887
|
},
|
|
814
888
|
{ tool: pageTool(document), source: pageSource(document), runs: pageRuns(document) },
|
|
815
889
|
);
|
|
890
|
+
// The banner: the title and act, the live demo's products and its code. One poll of demo.json (every 3 s) moves it
|
|
891
|
+
// when the loop goes from one demo to the next; no tabs, no replay.
|
|
892
|
+
{
|
|
893
|
+
const host = document.getElementById("k-banner");
|
|
894
|
+
let tool = pageTool(document);
|
|
895
|
+
const served = tool;
|
|
896
|
+
let act = null;
|
|
897
|
+
const draw = () => drawBanner(host, bannerModel(tool, act));
|
|
898
|
+
draw();
|
|
899
|
+
const shouldReload = () => {
|
|
900
|
+
try {
|
|
901
|
+
const last = Number(sessionStorage.getItem("k-demo-reload") || 0);
|
|
902
|
+
if (Date.now() - last < 30000) return false;
|
|
903
|
+
sessionStorage.setItem("k-demo-reload", String(Date.now()));
|
|
904
|
+
} catch { /* no storage: reload anyway */ }
|
|
905
|
+
return true;
|
|
906
|
+
};
|
|
907
|
+
const read = () =>
|
|
908
|
+
fetch("/api/terragucci/demo", { cache: "no-store" })
|
|
909
|
+
.then((r) => (r.ok ? r.json() : null))
|
|
910
|
+
.then((d) => {
|
|
911
|
+
const t = liveTool(d) || tool;
|
|
912
|
+
const a = actOf(t, d);
|
|
913
|
+
if (t !== tool || a !== act) { tool = t; act = a; draw(); }
|
|
914
|
+
// The loop moved to another demo: the graph, pane and runs belong to the demo the page was served for, so
|
|
915
|
+
// load `/`, which serves the live one (once per 30 s at most, so a flapping read can't loop).
|
|
916
|
+
if (served && t !== served && shouldReload()) location.reload();
|
|
917
|
+
})
|
|
918
|
+
.catch(() => {});
|
|
919
|
+
read();
|
|
920
|
+
setInterval(read, 3000);
|
|
921
|
+
}
|
|
816
922
|
// 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.
|
|
817
923
|
import("/kiosk-metrics.js").then((m) => m.startMetrics(document.getElementById("k-metrics"), { tool: pageTool(document), reads: readsFor(pageSource(document)), onModel: (model) => kiosk.setMetrics(model) }));
|
|
818
924
|
</script>
|