@intentius/behold 0.30.1 → 0.31.0
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 +475 -16
- package/README.md +25 -19
- package/demos.json +14 -9
- package/dist/cli.js +54900 -26771
- package/example-carve/README.md +19 -23
- package/example-carve/app/package.json +1 -1
- package/example-carve/app/src/carved.ts +3 -3
- package/example-carve/carve-report.json +1 -1
- package/example-carve/{legacy-tf → tf-root}/terraform.tfstate +1 -1
- package/example-choudoufu-estate/README.md +7 -0
- package/example-choudoufu-estate/chant.workspace.json +1 -1
- package/example-choudoufu-estate/scripts/choudoufu-down.sh +2 -1
- package/example-choudoufu-estate/scripts/choudoufu-up.sh +10 -3
- package/example-terraform-estate/README.md +32 -5
- package/example-terraform-estate/chant.workspace.json +1 -1
- package/example-terraform-estate/recorded/adoption/platform.json +72 -0
- package/example-terraform-estate/recorded/adoption/prod.json +224 -0
- package/example-terralith/README.md +1 -1
- package/example-three-cloud/README.md +111 -18
- package/example-three-cloud/aws/Pulumi.yaml +15 -0
- package/example-three-cloud/aws/index.ts +174 -0
- package/example-three-cloud/aws/package-lock.json +2725 -0
- package/example-three-cloud/aws/package.json +14 -0
- package/example-three-cloud/aws/tsconfig.json +17 -0
- package/example-three-cloud/azure/main.tf +48 -0
- package/example-three-cloud/azure/site.tf +104 -0
- package/example-three-cloud/chant.config.json +9 -0
- package/example-three-cloud/chant.workspace.json +30 -4
- package/example-three-cloud/dns/chant.config.ts +26 -1
- package/example-three-cloud/dns/src/records.component.ts +32 -6
- package/example-three-cloud/package-lock.json +48 -27
- package/example-three-cloud/package.json +8 -6
- package/example-three-cloud/scripts/emulators-up.sh +28 -1
- package/example-three-cloud/scripts/front-door.ts +679 -86
- package/package.json +13 -6
- package/web/adopt-pulumi.js +114 -0
- package/web/adopt-pulumi.test.js +28 -0
- package/web/adopt.js +203 -0
- package/web/adopt.test.js +27 -0
- package/web/app.js +614 -19
- package/web/carve-steps.js +1 -1
- package/web/carve-steps.test.js +2 -2
- package/web/change-set-overlay.js +12 -5
- package/web/change-set-overlay.test.js +22 -0
- package/web/drift-stream.js +241 -0
- package/web/drift-stream.test.js +146 -0
- package/web/edge-weight.d.ts +1 -1
- package/web/edge-weight.js +5 -1
- package/web/edge-weight.test.js +19 -0
- 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/graph-query.js +180 -0
- package/web/graph-query.test.js +49 -0
- package/web/graph.html +107 -0
- package/web/index-diff.js +109 -0
- package/web/index-diff.test.js +39 -0
- package/web/index.html +55 -0
- package/web/kiosk-ask-layout.js +85 -0
- package/web/kiosk-ask-layout.test.js +83 -0
- package/web/kiosk-ask-tips.js +477 -0
- package/web/kiosk-ask-tips.test.js +372 -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 +267 -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 +197 -0
- package/web/kiosk-light.js +547 -0
- package/web/kiosk-light.test.js +297 -0
- package/web/kiosk-member-kind.test.js +140 -0
- package/web/kiosk-metrics.js +7 -4
- package/web/kiosk-modal-sticky.test.js +2 -1
- package/web/kiosk-popover.js +4 -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-side.js +296 -0
- package/web/kiosk-side.test.js +249 -0
- package/web/kiosk-vendor.js +85 -7
- package/web/kiosk-vendor.test.js +9 -9
- package/web/kiosk-watch.js +20 -4
- package/web/kiosk-watch.test.js +15 -1
- package/web/kiosk.html +153 -1
- package/web/kiosk.js +252 -27
- package/web/kiosk.test.js +25 -1
- package/web/member-kind.js +31 -0
- package/web/small-stage.test.js +4 -0
- package/web/template-apps.js +245 -0
- package/web/template-apps.test.js +252 -0
- package/web/templates.js +285 -0
- package/web/templates.test.js +155 -0
- package/web/terragucci-change.js +30 -13
- package/web/terragucci-lifecycle.js +112 -62
- package/web/terragucci-lifecycle.test.js +29 -1
- package/web/terragucci-timeline.js +39 -2
- package/web/terragucci-timeline.test.js +42 -1
- 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/example-three-cloud/aws/chant.config.ts +0 -8
- package/example-three-cloud/aws/site.component.ts +0 -13
- package/example-three-cloud/aws/src/site.ts +0 -27
- package/example-three-cloud/azure/chant.config.ts +0 -1
- package/example-three-cloud/azure/src/site.component.ts +0 -13
- package/example-three-cloud/azure/src/site.ts +0 -18
- package/web/vendors/choudoufu-128.png +0 -0
- package/web/vendors/choudoufu-64.png +0 -0
- /package/example-carve/{legacy-tf → tf-root}/cdn.tf +0 -0
- /package/example-carve/{legacy-tf → tf-root}/compute.tf +0 -0
- /package/example-carve/{legacy-tf → tf-root}/floci-override.tf.disabled +0 -0
- /package/example-carve/{legacy-tf → tf-root}/modules/cdn/main.tf +0 -0
- /package/example-carve/{legacy-tf → tf-root}/naming.tf +0 -0
- /package/example-carve/{legacy-tf → tf-root}/network.tf +0 -0
- /package/example-carve/{legacy-tf → tf-root}/observability.tf +0 -0
- /package/example-carve/{legacy-tf → tf-root}/outputs.tf +0 -0
- /package/example-carve/{legacy-tf → tf-root}/storage.tf +0 -0
- /package/example-carve/{legacy-tf → tf-root}/versions.tf +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 = [
|
|
@@ -153,6 +154,18 @@ export function coneCaption(demo, answer) {
|
|
|
153
154
|
return line ? { line, backend: backendLine(cone) } : null;
|
|
154
155
|
}
|
|
155
156
|
|
|
157
|
+
/**
|
|
158
|
+
* Whether a viewer's hold on Watch's shot (a click, a pan or a zoom on the graph holds it for PICK_HOLD_MS) ends with
|
|
159
|
+
* this step: at the act's reset, and when another act (cycle) starts. Each puts a different graph in the pane (the
|
|
160
|
+
* base checkout's, then the next act's), where the place the viewer moved to in the last one means nothing, so the
|
|
161
|
+
* shot frames it afresh. `prev` and `next` are the steps (demo.json's `demo`), either null.
|
|
162
|
+
*/
|
|
163
|
+
export function holdEnds(prev, next) {
|
|
164
|
+
if (!prev || !next) return false;
|
|
165
|
+
if (prev.cycle !== next.cycle) return true;
|
|
166
|
+
return next.step === "reset" && prev.step !== "reset";
|
|
167
|
+
}
|
|
168
|
+
|
|
156
169
|
/**
|
|
157
170
|
* What may sit over the graph in Watch. On a held small stage (`held`: one
|
|
158
171
|
* framing holds it, web/kiosk-shot.js heldFrame), nothing the step puts
|
|
@@ -164,7 +177,9 @@ export function coneCaption(demo, answer) {
|
|
|
164
177
|
* the drawer while the run is on a wave (`kind` "active"). Inspect keeps its
|
|
165
178
|
* cards either way.
|
|
166
179
|
*/
|
|
167
|
-
export function watchOverlays({ kind = null, opened = false, held = false } = {}) {
|
|
180
|
+
export function watchOverlays({ kind = null, opened = false, held = false, ask = false } = {}) {
|
|
181
|
+
// behold#939: a prompt-driven step shows the graph and the pane alone (web/kiosk-ask.js askMode).
|
|
182
|
+
if (ask) return { result: false, callout: false, badges: false, drawer: !!opened };
|
|
168
183
|
if (held) return { result: false, callout: false, badges: false, drawer: !!opened };
|
|
169
184
|
return { result: true, callout: true, badges: true, drawer: kind === "active" || !!opened };
|
|
170
185
|
}
|
|
@@ -269,7 +284,8 @@ export function resultModel(demo, metrics, progress = null) {
|
|
|
269
284
|
const m = metrics && metrics.run && metrics.run.current ? metrics.run.waves : [];
|
|
270
285
|
const n = all.length || m.length;
|
|
271
286
|
if (!n) return null;
|
|
272
|
-
const
|
|
287
|
+
const composed = composedRun(progress);
|
|
288
|
+
const counts = [composed ? COMPOSED_WORDS : `${n} ${n === 1 ? "wave" : "waves"} applied`];
|
|
273
289
|
const changed = states.length ? mergeChanges(states.map((w) => w.totals)) : mergeChanges(m.map((w) => w.changesRaw));
|
|
274
290
|
counts.push(changed || "nothing to change");
|
|
275
291
|
// The metrics cover the run when they have a number for each wave that applied.
|
|
@@ -282,8 +298,8 @@ export function resultModel(demo, metrics, progress = null) {
|
|
|
282
298
|
// A row for every wave, its numbers when they have landed; never fewer rows than the count says.
|
|
283
299
|
const numbers = new Map(m.map((w) => [w.wave, badgeWords(w)]));
|
|
284
300
|
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 };
|
|
301
|
+
const waves = composed ? [] : numbered.map((w) => ({ wave: w, words: numbers.get(w) || null }));
|
|
302
|
+
return { head: "Applied", line: typeof demo.label === "string" ? demo.label : "", counts, waves, ...(composed ? { composed: true } : {}) };
|
|
287
303
|
}
|
|
288
304
|
|
|
289
305
|
/**
|
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, 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";
|
|
5
|
+
import { MODE_STORE, QUIET_MS, activeWave, badgeTitle, badgeWords, badges, behindStep, firstSentence, holdEnds, 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";
|
|
@@ -263,3 +263,17 @@ describe("the quiet line", () => {
|
|
|
263
263
|
expect(firstSentence("main moved to 1234abcd: port 8080 -> 9090. Wave 1 plans again")).toBe("main moved to 1234abcd: port 8080 -> 9090");
|
|
264
264
|
});
|
|
265
265
|
});
|
|
266
|
+
|
|
267
|
+
describe("a viewer's hold on the shot ends at the reset and at a new act", () => {
|
|
268
|
+
it("ends when the reset step comes, and when another cycle starts", () => {
|
|
269
|
+
expect(holdEnds({ cycle: 4, step: "applied" }, { cycle: 4, step: "reset" })).toBe(true);
|
|
270
|
+
expect(holdEnds({ cycle: 4, step: "applied" }, { cycle: 5, step: "pull-request" })).toBe(true);
|
|
271
|
+
expect(holdEnds({ cycle: 4, step: "reset" }, { cycle: 5, step: "pull-request" })).toBe(true);
|
|
272
|
+
});
|
|
273
|
+
it("holds through the act's own steps, and through the reset's repeated reads", () => {
|
|
274
|
+
expect(holdEnds({ cycle: 4, step: "planned" }, { cycle: 4, step: "applying" })).toBe(false);
|
|
275
|
+
expect(holdEnds({ cycle: 4, step: "reset" }, { cycle: 4, step: "reset" })).toBe(false);
|
|
276
|
+
expect(holdEnds(null, { cycle: 4, step: "reset" })).toBe(false);
|
|
277
|
+
expect(holdEnds({ cycle: 4, step: "applied" }, null)).toBe(false);
|
|
278
|
+
});
|
|
279
|
+
});
|
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; }
|
|
@@ -338,6 +341,8 @@
|
|
|
338
341
|
.k-read-box { width: 1.9em; height: 1.05em; border-radius: 4px; border: 1.5px solid var(--muted); }
|
|
339
342
|
.k-read-solid, .k-read-dashed { width: 2em; height: 0; border-top: 2px solid var(--fg); }
|
|
340
343
|
.k-read-dashed { border-top-style: dashed; }
|
|
344
|
+
.k-read-hole { width: 1.9em; height: 1.05em; border-radius: 4px; border: 2px dashed var(--degraded); }
|
|
345
|
+
.k-read-previewed { width: 1.9em; height: 0.8em; border-radius: 0.4em; border: 1.5px solid var(--pending); }
|
|
341
346
|
.k-read-order { width: 1.9em; height: 1em; background: linear-gradient(var(--muted), var(--muted)) 0 0 / 0.5em 100% no-repeat, linear-gradient(var(--muted), var(--muted)) 0.7em 25% / 0.5em 75% no-repeat, linear-gradient(var(--muted), var(--muted)) 1.4em 50% / 0.5em 50% no-repeat; opacity: 0.8; }
|
|
342
347
|
.k-read-marks { width: 1.5em; height: 0.75em; background: radial-gradient(circle at 25% 50%, var(--foreign) 0 0.3em, transparent 0.32em), radial-gradient(circle at 75% 50%, var(--runtime) 0 0.3em, transparent 0.32em); }
|
|
343
348
|
/* behold#571: a tool's page. Its name (and logo where allowed) before the scenario, the replay's banner, the credit. */
|
|
@@ -506,6 +511,114 @@
|
|
|
506
511
|
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
512
|
body.k-watch #k-waves:not(.k-open) .k-wl-hint { display: none; }
|
|
508
513
|
}
|
|
514
|
+
/* 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. */
|
|
515
|
+
#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;
|
|
516
|
+
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);
|
|
517
|
+
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); }
|
|
518
|
+
#k-ask[hidden] { display: none; }
|
|
519
|
+
#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 */
|
|
520
|
+
#k-ask .ask-entry { display: flex; flex-direction: column; gap: 0.15em; min-width: 0; }
|
|
521
|
+
#k-ask .ask-line { display: flex; gap: 0.6em; }
|
|
522
|
+
#k-ask .ask-mark { color: var(--pending, var(--fg)); flex: none; min-width: 1ch; }
|
|
523
|
+
#k-ask .ask-text, #k-ask .ask-reply { overflow-wrap: anywhere; }
|
|
524
|
+
#k-ask .ask-reply { padding-left: 1.6em; color: var(--ink2, var(--fg)); font-weight: 500; }
|
|
525
|
+
#k-ask .ask-old { opacity: 0.55; }
|
|
526
|
+
#k-ask .ask-old-2 { opacity: 0.4; }
|
|
527
|
+
#k-ask .ask-old-3, #k-ask .ask-old-4 { opacity: 0.28; }
|
|
528
|
+
#k-ask .ask-typing .ask-text::after { content: "\2588"; margin-left: 0.1em; }
|
|
529
|
+
body.k-ask #bar, body.k-ask #k-caption, body.k-ask #views { display: none; }
|
|
530
|
+
/* 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. */
|
|
531
|
+
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; }
|
|
532
|
+
@media (max-width: 600px) {
|
|
533
|
+
body.k-watch #k-ask { position: static; order: 1; height: auto; max-height: 50vh; border-radius: 0; box-shadow: none; }
|
|
534
|
+
}
|
|
535
|
+
/* ==== layout: ask mode (behold#942) ==== Owned by the layout work; the prompt pane's own look is the block above. */
|
|
536
|
+
/* Everywhere: ask mode shows the graph and the pane, so what talks over them is off. */
|
|
537
|
+
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; }
|
|
538
|
+
/* A phone: the graph on top (70% of the dynamic viewport), the pane under it (30%), and nothing else, with no page scroll. */
|
|
539
|
+
@media (max-width: 700px) {
|
|
540
|
+
html:has(body.k-ask), body.k-ask.k-watch { height: 100vh; height: 100dvh; overflow: hidden !important; overscroll-behavior: none; }
|
|
541
|
+
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; }
|
|
542
|
+
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,
|
|
543
|
+
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,
|
|
544
|
+
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; }
|
|
545
|
+
/* The stage and the watch layer dissolve, so the graph and the pane are the body's two rows. */
|
|
546
|
+
body.k-ask.k-watch #stage, body.k-ask.k-watch #k-watch { display: contents !important; }
|
|
547
|
+
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; }
|
|
548
|
+
body.k-ask.k-watch #view { height: 100%; }
|
|
549
|
+
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;
|
|
550
|
+
border-radius: 0; box-shadow: none; padding-bottom: calc(var(--s3) + env(safe-area-inset-bottom, 0px)); padding-left: 16px; padding-right: 16px; }
|
|
551
|
+
}
|
|
552
|
+
/* ==== end layout: ask mode ==== */
|
|
553
|
+
/* ==== the side pane (web/kiosk-side.js): the act's run and the current line's details, right of the graph, above the prompt ==== */
|
|
554
|
+
#k-side, #k-side-tab { display: none; }
|
|
555
|
+
body { --k-side-w: clamp(280px, 25vw, 520px); --k-side-tab-w: 30px; }
|
|
556
|
+
body.k-ask.k-watch.k-side-open #view-pane { right: calc(var(--k-side-w) + 10px); }
|
|
557
|
+
body.k-ask.k-watch.k-side-folded #view-pane { right: calc(var(--k-side-tab-w) + 10px); }
|
|
558
|
+
body.k-ask.k-watch.k-side-open #k-side { display: flex; flex-direction: column; gap: var(--s4); position: absolute; top: 0; right: 5px; width: var(--k-side-w); max-height: calc(100% - var(--k-ask-h, 30vh) - 15px); box-sizing: border-box; overflow-y: auto; overscroll-behavior: contain;
|
|
559
|
+
padding: var(--s3) var(--s4) var(--s4); border: 1px solid var(--rule); border-radius: 8px; background: var(--surface-pane-a, var(--bg)); color: var(--fg); font: clamp(0.9rem, 0.85vw, 1.1rem)/1.4 var(--font-ui); }
|
|
560
|
+
body.k-ask.k-watch.k-side-folded #k-side-tab { display: block; position: absolute; top: 0; right: 5px; width: var(--k-side-tab-w); bottom: calc(var(--k-ask-h, 30vh) + 10px); box-sizing: border-box; padding: var(--s3) 0; border: 1px solid var(--rule); border-radius: 8px;
|
|
561
|
+
background: var(--surface-pane-a, var(--bg)); color: var(--muted); font: 600 0.82rem var(--font-ui); writing-mode: vertical-rl; cursor: pointer; }
|
|
562
|
+
body.k-ask.k-watch.k-side-folded #k-side-tab:hover, body.k-ask.k-watch.k-side-folded #k-side-tab:focus-visible { color: var(--fg); border-color: var(--pending); }
|
|
563
|
+
#k-side .k-side-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); }
|
|
564
|
+
#k-side .k-side-title { margin: 0; font: 600 0.9em var(--font-ui); color: var(--muted); }
|
|
565
|
+
#k-side .k-side-fold { font: 600 0.8em var(--font-ui); color: var(--muted); background: transparent; border: 1px solid var(--rule); border-radius: 999px; padding: 0.1em var(--s3); cursor: pointer; }
|
|
566
|
+
#k-side .k-side-fold:hover, #k-side .k-side-fold:focus-visible { color: var(--fg); border-color: var(--pending); }
|
|
567
|
+
#k-side .k-side-fold::after { content: " \203A"; }
|
|
568
|
+
#k-side .k-wf { margin-top: var(--s1); }
|
|
569
|
+
#k-side .k-wf-row.k-wf-plain { grid-template-columns: 5.6em minmax(0, 1fr) 3.6em; }
|
|
570
|
+
#k-side .k-wf-words { text-align: right; }
|
|
571
|
+
#k-side .k-side-part .k-wf-wave { padding-left: 0.9em; font-weight: 500; }
|
|
572
|
+
#k-side .k-side-part .k-wf-track { background: transparent; height: auto; }
|
|
573
|
+
#k-side .k-side-words { font-size: 0.86em; color: var(--ink2, var(--fg)); }
|
|
574
|
+
#k-side .k-side-seg.k-tone-done { background: color-mix(in srgb, var(--managed) 75%, transparent); }
|
|
575
|
+
#k-side .k-side-seg.k-tone-running { background: var(--runtime); }
|
|
576
|
+
#k-side .k-side-seg.k-tone-waiting { background: repeating-linear-gradient(135deg, var(--foreign) 0 4px, color-mix(in srgb, var(--foreign) 45%, transparent) 4px 8px); }
|
|
577
|
+
#k-side .k-side-seg.k-tone-failed { background: var(--degraded); }
|
|
578
|
+
#k-side .k-side-part.k-tone-done .k-side-words { color: var(--managed); }
|
|
579
|
+
#k-side .k-side-part.k-tone-failed .k-side-words { color: var(--degraded); }
|
|
580
|
+
#k-side .k-side-quiet { margin: 0; color: var(--muted); font-size: 0.86em; }
|
|
581
|
+
#k-side .k-side-traces .k-wf { margin-top: var(--s1); }
|
|
582
|
+
#k-side .k-side-card { padding-top: var(--s3); border-top: 1px solid var(--rule); display: grid; gap: var(--s2); }
|
|
583
|
+
#k-side .k-side-item p, #k-side .k-side-estate { margin: 0; overflow-wrap: anywhere; }
|
|
584
|
+
#k-side .k-side-name b, #k-side .k-side-estate b { font-weight: 700; margin-right: var(--s2); }
|
|
585
|
+
#k-side .k-side-type { color: var(--muted); font-size: 0.9em; }
|
|
586
|
+
#k-side .k-side-line { font: 0.92em var(--font-mono); padding-left: var(--s3); border-left: 2px solid var(--rule); }
|
|
587
|
+
#k-side .k-line-unknown { color: var(--foreign); border-left-style: dashed; border-left-color: var(--foreign); }
|
|
588
|
+
#k-side .k-line-applied { color: var(--managed); border-left-color: var(--managed); }
|
|
589
|
+
#k-side .k-side-written b { color: var(--managed); }
|
|
590
|
+
@media (max-width: 700px) {
|
|
591
|
+
body.k-ask.k-watch #k-side, body.k-ask.k-watch #k-side-tab { display: none !important; }
|
|
592
|
+
}
|
|
593
|
+
/* ==== end side pane ==== */
|
|
594
|
+
/* ==== the demo banner (web/kiosk-banner.js): the example's name, its products, the code link ==== */
|
|
595
|
+
#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; }
|
|
596
|
+
#k-banner[hidden] { display: none; }
|
|
597
|
+
body.k-bannered { grid-template-rows: auto auto minmax(0, 1fr); }
|
|
598
|
+
.kb-name { font-weight: 700; color: var(--fg); min-width: 0; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; }
|
|
599
|
+
.kb-products { display: inline-flex; align-items: center; gap: var(--s4); flex: 0 0 auto; }
|
|
600
|
+
.kb-product { display: inline-flex; align-items: center; gap: var(--s1); color: var(--muted); text-decoration: none; font-weight: 600; }
|
|
601
|
+
.kb-product:hover { color: var(--fg); text-decoration: underline; }
|
|
602
|
+
.kb-logo { width: 1.4em; height: 1.4em; }
|
|
603
|
+
.kb-code { flex: 0 0 auto; margin-left: auto; color: var(--fg); font-weight: 600; }
|
|
604
|
+
.kb-code-short { display: none; }
|
|
605
|
+
/* The prompt demo's tip cards sit under the banner, not over it. */
|
|
606
|
+
body.k-bannered #k-ask-tips .eh-modal-wrap { padding-top: 42px; }
|
|
607
|
+
@media (max-width: 700px) {
|
|
608
|
+
#k-banner { gap: var(--s3); padding: 0 12px; font-size: 13px; }
|
|
609
|
+
.kb-name { flex: 1 1 0; }
|
|
610
|
+
.kb-product .kb-pname { display: none; }
|
|
611
|
+
.kb-product:not(:has(.kb-logo)) { display: none; }
|
|
612
|
+
.kb-code { margin-left: 0; }
|
|
613
|
+
.kb-code-long { display: none; }
|
|
614
|
+
.kb-code-short { display: inline; font-size: 0.92em; }
|
|
615
|
+
/* Ask mode: the banner takes 34px of the graph's 60dvh, and the pane keeps the rest. */
|
|
616
|
+
body.k-ask.k-watch.k-bannered { grid-template-rows: 34px calc(60dvh - 34px) minmax(0, 1fr); }
|
|
617
|
+
body.k-ask.k-watch.k-bannered #k-banner { grid-row: 1; }
|
|
618
|
+
body.k-ask.k-watch.k-bannered #view-pane { grid-row: 2; }
|
|
619
|
+
body.k-ask.k-watch.k-bannered #k-ask { grid-row: 3; }
|
|
620
|
+
}
|
|
621
|
+
/* ==== end banner ==== */
|
|
509
622
|
/* The caption: the title, what changes, the step. One of the two beats leads. */
|
|
510
623
|
#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
624
|
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 +845,7 @@
|
|
|
732
845
|
</style>
|
|
733
846
|
</head>
|
|
734
847
|
<body>
|
|
848
|
+
<header id="k-banner" aria-label="This demo" hidden></header>
|
|
735
849
|
<div id="k-head">
|
|
736
850
|
<div id="k-tools">
|
|
737
851
|
<div id="k-mode" class="k-modes" role="group" aria-label="Layout"></div>
|
|
@@ -772,6 +886,11 @@
|
|
|
772
886
|
<div id="k-traces" data-k-mount="traces"></div>
|
|
773
887
|
</section>
|
|
774
888
|
<aside id="k-result" class="k-over" aria-label="The result" hidden></aside>
|
|
889
|
+
<!-- behold#936: the prompt pane, in the header's and the caption's place while a step has a prompt (web/kiosk-ask.js). -->
|
|
890
|
+
<section id="k-ask" aria-live="polite" aria-label="The prompt" hidden></section>
|
|
891
|
+
<!-- The prompt demo's side pane (web/kiosk-side.js): the act's run and what the current line names, right of the graph. -->
|
|
892
|
+
<aside id="k-side" aria-label="This act's run"></aside>
|
|
893
|
+
<button type="button" id="k-side-tab" aria-label="Show the run details">Run details</button>
|
|
775
894
|
<footer id="k-caption" aria-live="polite"></footer>
|
|
776
895
|
<!-- 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
896
|
<section id="k-change" aria-label="The change" hidden></section>
|
|
@@ -790,6 +909,7 @@
|
|
|
790
909
|
});
|
|
791
910
|
import { startKiosk } from "/kiosk.js";
|
|
792
911
|
import { pageTool } from "/kiosk-vendor.js";
|
|
912
|
+
import { actOf, bannerModel, drawBanner, liveTool } from "/kiosk-banner.js";
|
|
793
913
|
import { pageRuns, pageSource, readsFor } from "/kiosk-source.js";
|
|
794
914
|
import { installMotion } from "/motion.js";
|
|
795
915
|
initTheme(KIOSK_THEME);
|
|
@@ -809,10 +929,42 @@
|
|
|
809
929
|
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
930
|
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
931
|
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") },
|
|
932
|
+
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"), side: document.getElementById("k-side"), sideTab: document.getElementById("k-side-tab"), drawer: document.getElementById("k-drawer"), badges: document.getElementById("k-badges"), result: document.getElementById("k-result") },
|
|
813
933
|
},
|
|
814
934
|
{ tool: pageTool(document), source: pageSource(document), runs: pageRuns(document) },
|
|
815
935
|
);
|
|
936
|
+
// The banner: the title and act, the live demo's products and its code. One poll of demo.json (every 3 s) moves it
|
|
937
|
+
// when the loop goes from one demo to the next; no tabs, no replay.
|
|
938
|
+
{
|
|
939
|
+
const host = document.getElementById("k-banner");
|
|
940
|
+
let tool = pageTool(document);
|
|
941
|
+
const served = tool;
|
|
942
|
+
let act = null;
|
|
943
|
+
const draw = () => drawBanner(host, bannerModel(tool, act));
|
|
944
|
+
draw();
|
|
945
|
+
const shouldReload = () => {
|
|
946
|
+
try {
|
|
947
|
+
const last = Number(sessionStorage.getItem("k-demo-reload") || 0);
|
|
948
|
+
if (Date.now() - last < 30000) return false;
|
|
949
|
+
sessionStorage.setItem("k-demo-reload", String(Date.now()));
|
|
950
|
+
} catch { /* no storage: reload anyway */ }
|
|
951
|
+
return true;
|
|
952
|
+
};
|
|
953
|
+
const read = () =>
|
|
954
|
+
fetch("/api/terragucci/demo", { cache: "no-store" })
|
|
955
|
+
.then((r) => (r.ok ? r.json() : null))
|
|
956
|
+
.then((d) => {
|
|
957
|
+
const t = liveTool(d) || tool;
|
|
958
|
+
const a = actOf(t, d);
|
|
959
|
+
if (t !== tool || a !== act) { tool = t; act = a; draw(); }
|
|
960
|
+
// The loop moved to another demo: the graph, pane and runs belong to the demo the page was served for, so
|
|
961
|
+
// load `/`, which serves the live one (once per 30 s at most, so a flapping read can't loop).
|
|
962
|
+
if (served && t !== served && shouldReload()) location.reload();
|
|
963
|
+
})
|
|
964
|
+
.catch(() => {});
|
|
965
|
+
read();
|
|
966
|
+
setInterval(read, 3000);
|
|
967
|
+
}
|
|
816
968
|
// 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
969
|
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
970
|
</script>
|