@intentius/behold 0.29.53 → 0.29.55
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/dist/cli.js +57 -2
- package/example-three-cloud/README.md +1 -1
- package/example-three-cloud/gcp/chant.config.ts +2 -1
- package/example-three-cloud/gcp/src/site.ts +8 -12
- package/example-three-cloud/package-lock.json +19 -19
- package/example-three-cloud/package.json +4 -4
- package/example-three-cloud/scripts/front-door.ts +2 -1
- package/package.json +2 -2
- package/web/app.js +14 -3
- package/web/index.html +10 -1
- package/web/kiosk.html +1 -1
- package/web/theme.js +7 -2
- package/web/theme.test.js +13 -1
package/dist/cli.js
CHANGED
|
@@ -18908,6 +18908,51 @@ function projectLogical(ir) {
|
|
|
18908
18908
|
return { ir: { nodes: headline, edges, groups: {} }, byContainer };
|
|
18909
18909
|
}
|
|
18910
18910
|
|
|
18911
|
+
// src/logical-simplify.ts
|
|
18912
|
+
var BOUNDARY_RE = /^(AWS account|Azure subscription|GCP project)\b/;
|
|
18913
|
+
function simplifyNesting(byContainer, members, keep = /* @__PURE__ */ new Set()) {
|
|
18914
|
+
const out = {};
|
|
18915
|
+
for (const [k, v] of Object.entries(byContainer)) out[k] = [...v];
|
|
18916
|
+
const isBox = (id) => Object.prototype.hasOwnProperty.call(out, id);
|
|
18917
|
+
const parentOf = (id) => Object.keys(out).find((k) => out[k].includes(id));
|
|
18918
|
+
const fixed = (k) => BOUNDARY_RE.test(k) || keep.has(k);
|
|
18919
|
+
for (const key3 of Object.keys(out)) {
|
|
18920
|
+
if (fixed(key3)) continue;
|
|
18921
|
+
const member = key3.split(" \xB7 ")[0];
|
|
18922
|
+
if (!members.has(member) || !out[key3].every((c) => !isBox(c))) continue;
|
|
18923
|
+
const parent = parentOf(key3);
|
|
18924
|
+
if (!parent) continue;
|
|
18925
|
+
const at2 = out[parent].indexOf(key3);
|
|
18926
|
+
out[parent].splice(at2, 1, ...out[key3].filter((c) => !out[parent].includes(c)));
|
|
18927
|
+
delete out[key3];
|
|
18928
|
+
}
|
|
18929
|
+
for (let changed = true; changed; ) {
|
|
18930
|
+
changed = false;
|
|
18931
|
+
for (const key3 of Object.keys(out)) {
|
|
18932
|
+
const kids = out[key3];
|
|
18933
|
+
if (!kids || kids.length !== 1 || !isBox(kids[0]) || fixed(key3) || fixed(kids[0])) continue;
|
|
18934
|
+
const inner = kids[0];
|
|
18935
|
+
const merged = `${key3} \u203A ${inner}`;
|
|
18936
|
+
out[merged] = out[inner];
|
|
18937
|
+
delete out[inner];
|
|
18938
|
+
delete out[key3];
|
|
18939
|
+
const parent = parentOf(key3);
|
|
18940
|
+
if (parent) out[parent] = out[parent].map((c) => c === key3 ? merged : c);
|
|
18941
|
+
changed = true;
|
|
18942
|
+
break;
|
|
18943
|
+
}
|
|
18944
|
+
}
|
|
18945
|
+
return out;
|
|
18946
|
+
}
|
|
18947
|
+
function memberPrefixes(nodes) {
|
|
18948
|
+
const out = /* @__PURE__ */ new Set();
|
|
18949
|
+
for (const n of nodes) {
|
|
18950
|
+
const slash = n.id.indexOf("/");
|
|
18951
|
+
if (slash > 0) out.add(n.id.slice(0, slash));
|
|
18952
|
+
}
|
|
18953
|
+
return out;
|
|
18954
|
+
}
|
|
18955
|
+
|
|
18911
18956
|
// src/composite-deps.ts
|
|
18912
18957
|
function kebabKind(kind) {
|
|
18913
18958
|
return kind.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
@@ -34589,6 +34634,8 @@ function validEntry(e) {
|
|
|
34589
34634
|
if (d.serve.dirs !== void 0 && (!Array.isArray(d.serve.dirs) || d.serve.dirs.some((x) => typeof x !== "string") || !d.serve.dirs.length)) return false;
|
|
34590
34635
|
if (d.serve.spawnEnv !== void 0 && (typeof d.serve.spawnEnv !== "object" || d.serve.spawnEnv === null || Array.isArray(d.serve.spawnEnv) || Object.values(d.serve.spawnEnv).some((v) => typeof v !== "string")))
|
|
34591
34636
|
return false;
|
|
34637
|
+
if (d.serve.processEnv !== void 0 && (typeof d.serve.processEnv !== "object" || d.serve.processEnv === null || Array.isArray(d.serve.processEnv) || Object.values(d.serve.processEnv).some((v) => typeof v !== "string")))
|
|
34638
|
+
return false;
|
|
34592
34639
|
if (d.serve.terralith !== void 0 && typeof d.serve.terralith !== "boolean") return false;
|
|
34593
34640
|
if (d.serve.carve !== void 0) {
|
|
34594
34641
|
const c = d.serve.carve;
|
|
@@ -36109,7 +36156,8 @@ function createApp(cfg, broadcaster = new Broadcaster(), frames = new FrameBuffe
|
|
|
36109
36156
|
estateRun = applyMemberPasses(ir, { detail: opts.detail });
|
|
36110
36157
|
if (logical) {
|
|
36111
36158
|
const logicalBefore = ir.nodes.length;
|
|
36112
|
-
const { ir: projected, byContainer, namespaceBoxes } = projectTopology(ir, metaEnv ?? void 0, estateContext, await estateSourceRoots(opts));
|
|
36159
|
+
const { ir: projected, byContainer: joined, namespaceBoxes } = projectTopology(ir, metaEnv ?? void 0, estateContext, await estateSourceRoots(opts));
|
|
36160
|
+
const byContainer = simplifiedEstateNesting(joined, ir, namespaceBoxes);
|
|
36113
36161
|
const { svg: svg2 } = renderArchitecture(projected, byContainer, { groupMarks: operatorHomeBoxMarks(ir, namespaceBoxes ?? {}), groupBadges: operatorHomeBoxBadges(ir, namespaceBoxes ?? {}), ...cardPrefixesOf(ir) ? { cardPrefixes: cardPrefixesOf(ir) } : {} });
|
|
36114
36162
|
const tf2 = passNote(estateRun);
|
|
36115
36163
|
const lensNote = notesFor("logical", projected, void 0, logicalBefore);
|
|
@@ -36462,7 +36510,8 @@ function createApp(cfg, broadcaster = new Broadcaster(), frames = new FrameBuffe
|
|
|
36462
36510
|
].join("; ") : void 0;
|
|
36463
36511
|
if (logical) {
|
|
36464
36512
|
const logicalBefore = ir2.nodes.length;
|
|
36465
|
-
const { ir: projected, byContainer, namespaceBoxes } = projectTopology(ir2, env, boundContext2, await estateSourceRoots(query));
|
|
36513
|
+
const { ir: projected, byContainer: joined, namespaceBoxes } = projectTopology(ir2, env, boundContext2, await estateSourceRoots(query));
|
|
36514
|
+
const byContainer = simplifiedEstateNesting(joined, ir2, namespaceBoxes);
|
|
36466
36515
|
const { svg: svg3 } = renderArchitecture(projected, byContainer, { groupMarks: operatorHomeBoxMarks(ir2, namespaceBoxes ?? {}), groupBadges: operatorHomeBoxBadges(ir2, namespaceBoxes ?? {}), ...cardPrefixesOf(ir2) ? { cardPrefixes: cardPrefixesOf(ir2) } : {} });
|
|
36467
36516
|
const note3 = [
|
|
36468
36517
|
notesFor("logical", projected, void 0, logicalBefore),
|
|
@@ -37060,6 +37109,11 @@ async function startServer(cfg) {
|
|
|
37060
37109
|
process.exit(1);
|
|
37061
37110
|
});
|
|
37062
37111
|
}
|
|
37112
|
+
function simplifiedEstateNesting(byContainer, ir, namespaceBoxes) {
|
|
37113
|
+
const members = memberPrefixes(ir.nodes);
|
|
37114
|
+
if (members.size < 2) return byContainer;
|
|
37115
|
+
return simplifyNesting(byContainer, members, new Set(Object.values(namespaceBoxes ?? {})));
|
|
37116
|
+
}
|
|
37063
37117
|
|
|
37064
37118
|
// src/cli.ts
|
|
37065
37119
|
init_chant();
|
|
@@ -38478,6 +38532,7 @@ async function runDemo(rest) {
|
|
|
38478
38532
|
if (entry.serve.local) serveArgs.push("--local");
|
|
38479
38533
|
if (entry.serve.env) serveArgs.push("--env", entry.serve.env);
|
|
38480
38534
|
setChoudoufuSpawnEnv(entry.serve.spawnEnv);
|
|
38535
|
+
for (const [k, v] of Object.entries(entry.serve.processEnv ?? {})) process.env[k] ??= v;
|
|
38481
38536
|
await run3(serveArgs);
|
|
38482
38537
|
}
|
|
38483
38538
|
function spawnStep(cmd, args, cwd) {
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
// The project every gcp resource builds, applies and is read in.
|
|
2
|
+
export default { lexicons: ["gcp"], sourceDir: "src", environments: ["local"], gcp: { project: "three-cloud" } };
|
|
@@ -17,10 +17,6 @@ import {
|
|
|
17
17
|
// Balancer as production sets it up: a
|
|
18
18
|
// static address and a forwarding rule, an HTTP proxy, a URL map, a backend
|
|
19
19
|
// service, and a serverless network endpoint group that names the service.
|
|
20
|
-
//
|
|
21
|
-
// Each reference is Config Connector's `{ name }`, spelled out: chant 0.124.36
|
|
22
|
-
// writes a `.name` reference correctly but its live read can't resolve one
|
|
23
|
-
// (reported to chant), and behold joins these by name.
|
|
24
20
|
const region = "asia-northeast1";
|
|
25
21
|
|
|
26
22
|
export const runtime = new GCPServiceAccount({
|
|
@@ -36,7 +32,7 @@ export const subnet = new Subnetwork({
|
|
|
36
32
|
metadata: { name: "three-cloud-apps" },
|
|
37
33
|
region,
|
|
38
34
|
ipCidrRange: "10.30.0.0/24",
|
|
39
|
-
networkRef: { name:
|
|
35
|
+
networkRef: { name: vpc.name },
|
|
40
36
|
});
|
|
41
37
|
|
|
42
38
|
export const web = CloudRunServiceComposite({
|
|
@@ -54,7 +50,7 @@ export const web = CloudRunServiceComposite({
|
|
|
54
50
|
template: {
|
|
55
51
|
vpcAccess: {
|
|
56
52
|
egress: "PRIVATE_RANGES_ONLY",
|
|
57
|
-
networkInterfaces: [{ networkRef: { name:
|
|
53
|
+
networkInterfaces: [{ networkRef: { name: vpc.name }, subnetworkRef: { name: subnet.name } }],
|
|
58
54
|
},
|
|
59
55
|
},
|
|
60
56
|
},
|
|
@@ -65,7 +61,7 @@ export const neg = new RegionNetworkEndpointGroup({
|
|
|
65
61
|
metadata: { name: "three-cloud-neg" },
|
|
66
62
|
region,
|
|
67
63
|
networkEndpointType: "SERVERLESS",
|
|
68
|
-
cloudRun: { serviceRef: { name:
|
|
64
|
+
cloudRun: { serviceRef: { name: web.service.name } },
|
|
69
65
|
});
|
|
70
66
|
|
|
71
67
|
// A backend service over a serverless NEG takes no health check: Cloud Run
|
|
@@ -75,19 +71,19 @@ export const backend = new BackendService({
|
|
|
75
71
|
location: "global",
|
|
76
72
|
loadBalancingScheme: "EXTERNAL_MANAGED",
|
|
77
73
|
protocol: "HTTP",
|
|
78
|
-
backend: [{ group: { networkEndpointGroupRef: { name:
|
|
74
|
+
backend: [{ group: { networkEndpointGroupRef: { name: neg.name } } }],
|
|
79
75
|
});
|
|
80
76
|
|
|
81
77
|
export const urlMap = new URLMap({
|
|
82
78
|
metadata: { name: "three-cloud-map" },
|
|
83
79
|
location: "global",
|
|
84
|
-
defaultService: { backendServiceRef: { name:
|
|
80
|
+
defaultService: { backendServiceRef: { name: backend.name } },
|
|
85
81
|
});
|
|
86
82
|
|
|
87
83
|
export const proxy = new TargetHTTPProxy({
|
|
88
84
|
metadata: { name: "three-cloud-proxy" },
|
|
89
85
|
location: "global",
|
|
90
|
-
urlMapRef: { name:
|
|
86
|
+
urlMapRef: { name: urlMap.name },
|
|
91
87
|
});
|
|
92
88
|
|
|
93
89
|
export const address = new ComputeAddress({ metadata: { name: "three-cloud-ip" }, location: "global" });
|
|
@@ -97,8 +93,8 @@ export const rule = new ForwardingRule({
|
|
|
97
93
|
location: "global",
|
|
98
94
|
loadBalancingScheme: "EXTERNAL_MANAGED",
|
|
99
95
|
portRange: "80",
|
|
100
|
-
ipAddress: { addressRef: { name:
|
|
101
|
-
target: { targetHTTPProxyRef: { name:
|
|
96
|
+
ipAddress: { addressRef: { name: address.name } },
|
|
97
|
+
target: { targetHTTPProxyRef: { name: proxy.name } },
|
|
102
98
|
});
|
|
103
99
|
|
|
104
100
|
// The dns member reads this as its `gcpEndpoint` parameter: the load
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
"": {
|
|
7
7
|
"name": "behold-example-three-cloud",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@intentius/chant": "^0.124.
|
|
10
|
-
"@intentius/chant-lexicon-aws": "^0.124.
|
|
11
|
-
"@intentius/chant-lexicon-azure": "^0.124.
|
|
12
|
-
"@intentius/chant-lexicon-gcp": "^0.124.
|
|
9
|
+
"@intentius/chant": "^0.124.38",
|
|
10
|
+
"@intentius/chant-lexicon-aws": "^0.124.38",
|
|
11
|
+
"@intentius/chant-lexicon-azure": "^0.124.38",
|
|
12
|
+
"@intentius/chant-lexicon-gcp": "^0.124.38"
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"node_modules/@dagrejs/dagre": {
|
|
@@ -444,9 +444,9 @@
|
|
|
444
444
|
}
|
|
445
445
|
},
|
|
446
446
|
"node_modules/@intentius/chant": {
|
|
447
|
-
"version": "0.124.
|
|
448
|
-
"resolved": "https://registry.npmjs.org/@intentius/chant/-/chant-0.124.
|
|
449
|
-
"integrity": "sha512-
|
|
447
|
+
"version": "0.124.38",
|
|
448
|
+
"resolved": "https://registry.npmjs.org/@intentius/chant/-/chant-0.124.38.tgz",
|
|
449
|
+
"integrity": "sha512-BCLGgZTOHkwHCDaUNh3kLZJsgJbpJ6iTcrjYAIGLjt7JlZiUAZKB4vVmOxKqfGc/u0K7+pbTYeiIYQOTgjA7Pg==",
|
|
450
450
|
"license": "Apache-2.0",
|
|
451
451
|
"dependencies": {
|
|
452
452
|
"@dagrejs/dagre": "^3.0.0",
|
|
@@ -473,34 +473,34 @@
|
|
|
473
473
|
}
|
|
474
474
|
},
|
|
475
475
|
"node_modules/@intentius/chant-lexicon-aws": {
|
|
476
|
-
"version": "0.124.
|
|
477
|
-
"resolved": "https://registry.npmjs.org/@intentius/chant-lexicon-aws/-/chant-lexicon-aws-0.124.
|
|
478
|
-
"integrity": "sha512-
|
|
476
|
+
"version": "0.124.38",
|
|
477
|
+
"resolved": "https://registry.npmjs.org/@intentius/chant-lexicon-aws/-/chant-lexicon-aws-0.124.38.tgz",
|
|
478
|
+
"integrity": "sha512-S9IRHJxWeaswwezVCYbYflaXPhs3y98Xun8pLZSYTL8vLKY9+LI7cfvZI6WkyPGWyu+/ViVtlSAwgxSeUTAzGA==",
|
|
479
479
|
"license": "Apache-2.0",
|
|
480
480
|
"dependencies": {
|
|
481
481
|
"fflate": "^0.8.2",
|
|
482
482
|
"js-yaml": "^4.3.1"
|
|
483
483
|
},
|
|
484
484
|
"peerDependencies": {
|
|
485
|
-
"@intentius/chant": "^0.124.
|
|
485
|
+
"@intentius/chant": "^0.124.38"
|
|
486
486
|
}
|
|
487
487
|
},
|
|
488
488
|
"node_modules/@intentius/chant-lexicon-azure": {
|
|
489
|
-
"version": "0.124.
|
|
490
|
-
"resolved": "https://registry.npmjs.org/@intentius/chant-lexicon-azure/-/chant-lexicon-azure-0.124.
|
|
491
|
-
"integrity": "sha512-
|
|
489
|
+
"version": "0.124.38",
|
|
490
|
+
"resolved": "https://registry.npmjs.org/@intentius/chant-lexicon-azure/-/chant-lexicon-azure-0.124.38.tgz",
|
|
491
|
+
"integrity": "sha512-dXTxFRg6uxgdWiN/cz5jhkZM885wxcX3CLrskyP9xgcqFP9kWvPCqv1eE1Cr3MoRqIBVT5wj6K+RtoBm0pojug==",
|
|
492
492
|
"license": "Apache-2.0",
|
|
493
493
|
"dependencies": {
|
|
494
494
|
"fflate": "^0.8.2"
|
|
495
495
|
},
|
|
496
496
|
"peerDependencies": {
|
|
497
|
-
"@intentius/chant": "^0.124.
|
|
497
|
+
"@intentius/chant": "^0.124.38"
|
|
498
498
|
}
|
|
499
499
|
},
|
|
500
500
|
"node_modules/@intentius/chant-lexicon-gcp": {
|
|
501
|
-
"version": "0.124.
|
|
502
|
-
"resolved": "https://registry.npmjs.org/@intentius/chant-lexicon-gcp/-/chant-lexicon-gcp-0.124.
|
|
503
|
-
"integrity": "sha512-
|
|
501
|
+
"version": "0.124.38",
|
|
502
|
+
"resolved": "https://registry.npmjs.org/@intentius/chant-lexicon-gcp/-/chant-lexicon-gcp-0.124.38.tgz",
|
|
503
|
+
"integrity": "sha512-4DQlfww4TAq3pVGOOV7Eys+lvcRT4Azp4t+DIcKYZhGH0BRZPSr5eUhboAWOgTLyqjQOqFIdy1ueNgWNtVUUTg==",
|
|
504
504
|
"license": "Apache-2.0",
|
|
505
505
|
"dependencies": {
|
|
506
506
|
"@types/js-yaml": "^4.0.9",
|
|
@@ -508,7 +508,7 @@
|
|
|
508
508
|
"js-yaml": "^4.3.1"
|
|
509
509
|
},
|
|
510
510
|
"peerDependencies": {
|
|
511
|
-
"@intentius/chant": "^0.124.
|
|
511
|
+
"@intentius/chant": "^0.124.38"
|
|
512
512
|
}
|
|
513
513
|
},
|
|
514
514
|
"node_modules/@types/js-yaml": {
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
"front-door": "tsx scripts/front-door.ts all --out export"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@intentius/chant": "^0.124.
|
|
12
|
-
"@intentius/chant-lexicon-aws": "^0.124.
|
|
13
|
-
"@intentius/chant-lexicon-azure": "^0.124.
|
|
14
|
-
"@intentius/chant-lexicon-gcp": "^0.124.
|
|
11
|
+
"@intentius/chant": "^0.124.38",
|
|
12
|
+
"@intentius/chant-lexicon-aws": "^0.124.38",
|
|
13
|
+
"@intentius/chant-lexicon-azure": "^0.124.38",
|
|
14
|
+
"@intentius/chant-lexicon-gcp": "^0.124.38"
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -302,7 +302,8 @@ export async function waitFor(want: "healthy" | "unhealthy", timeoutMs = 180_000
|
|
|
302
302
|
// ---------------------------------------------------------------------------
|
|
303
303
|
// Export
|
|
304
304
|
|
|
305
|
-
export const NOTE =
|
|
305
|
+
export const NOTE =
|
|
306
|
+
"Azure was switched off: its app answers 503, Route 53's check on it fails, and AWS and GCP take the traffic. Run this yourself: `npx @intentius/behold demo three-cloud`";
|
|
306
307
|
|
|
307
308
|
export function exportPage(out: string): void {
|
|
308
309
|
// BEHOLD names the behold to run (a checkout's `tsx src/cli.ts`, say);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intentius/behold",
|
|
3
|
-
"version": "0.29.
|
|
3
|
+
"version": "0.29.55",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "behold — a live control plane on chant. See your whole estate (every substrate in one graph), coloured by drift; act through delegated, gated Ops.",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@hono/node-server": "^2.0.5",
|
|
50
|
-
"@intentius/chant": "^0.124.
|
|
50
|
+
"@intentius/chant": "^0.124.38",
|
|
51
51
|
"@intentius/chant-k8s-client": "^0.124.24",
|
|
52
52
|
"@intentius/pinhole": "^0.5.0",
|
|
53
53
|
"ajv": "^8.20.0",
|
package/web/app.js
CHANGED
|
@@ -372,6 +372,10 @@ const staticMode = !!window.__BEHOLD_STATIC__;
|
|
|
372
372
|
const publicMode = !!window.__BEHOLD_PUBLIC__;
|
|
373
373
|
let manifest = null;
|
|
374
374
|
if (staticMode) {
|
|
375
|
+
// A snapshot has no live host behind it: the controls that only make sense
|
|
376
|
+
// against one (the lanes view, substrate readiness, the target endpoint,
|
|
377
|
+
// the deploy dial) are hidden by the `static` class (index.html).
|
|
378
|
+
document.documentElement.classList.add("static");
|
|
375
379
|
try {
|
|
376
380
|
manifest = await fetch("./manifest.json").then((r) => r.json());
|
|
377
381
|
} catch {
|
|
@@ -1965,6 +1969,7 @@ function renderPanelView() {
|
|
|
1965
1969
|
}),
|
|
1966
1970
|
);
|
|
1967
1971
|
const lanes = document.createElement("a");
|
|
1972
|
+
lanes.className = "lanes-link";
|
|
1968
1973
|
lanes.href = "/lanes";
|
|
1969
1974
|
lanes.textContent = "lanes →";
|
|
1970
1975
|
lanes.title = "The time-lanes view — captured frames of this graph over time";
|
|
@@ -2461,7 +2466,7 @@ function renderPanelScope() {
|
|
|
2461
2466
|
);
|
|
2462
2467
|
}
|
|
2463
2468
|
}
|
|
2464
|
-
if (targets.length) {
|
|
2469
|
+
if (targets.length && !staticMode) {
|
|
2465
2470
|
host.appendChild(panelHeading("target"));
|
|
2466
2471
|
const sel = document.createElement("select");
|
|
2467
2472
|
for (const t of targets) sel.add(new Option(t.endpoint, t.endpoint, false, view.target === t.endpoint));
|
|
@@ -8476,7 +8481,9 @@ function render(ir, svg, m) {
|
|
|
8476
8481
|
// from /api/project when a route doesn't echo them, e.g. /api/overlay).
|
|
8477
8482
|
if (m.tier !== undefined) axes.tier = m.tier;
|
|
8478
8483
|
if (m.target !== undefined) axes.target = m.target;
|
|
8479
|
-
|
|
8484
|
+
// A snapshot's target is the host it was captured from (a localhost
|
|
8485
|
+
// emulator, usually), which means nothing to whoever reads the page.
|
|
8486
|
+
const axesTail = `${axes.tier ? " · tier " + axes.tier : ""}${axes.target && !staticMode ? " · target " + axes.target : ""}`;
|
|
8480
8487
|
const metaEl = document.getElementById("meta");
|
|
8481
8488
|
metaEl.title = m.projectDir || "";
|
|
8482
8489
|
// #195: the browser tab names the loaded project — with the header gone
|
|
@@ -10492,7 +10499,11 @@ async function initActions() {
|
|
|
10492
10499
|
pill.title = "An exported, read-only snapshot — no live observe or deploy.";
|
|
10493
10500
|
pill.style.cssText = "align-self:center;font:var(--t-caption)/1.4 var(--font-mono);color:var(--muted);border:1px solid var(--line);border-radius:var(--r-ctl);padding:2px 8px";
|
|
10494
10501
|
bar.appendChild(pill);
|
|
10495
|
-
|
|
10502
|
+
// #510: other commits' views, when ../history.json sits beside this one.
|
|
10503
|
+
// The deploy tab stays hidden unless there is history to pick from.
|
|
10504
|
+
mountHistoryPicker(bar).then((picker) => {
|
|
10505
|
+
if (picker) document.documentElement.classList.add("static-history");
|
|
10506
|
+
});
|
|
10496
10507
|
previewMode = true;
|
|
10497
10508
|
return; // nothing else in the bar is a read
|
|
10498
10509
|
}
|
package/web/index.html
CHANGED
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
and fails if the two drift apart. */
|
|
41
41
|
:root {
|
|
42
42
|
--bg: #1e1e2e; --panel: #2e2f40; --line: #3b3c4a; --fg: #cdd6f4; --muted: #9598aa; --ink2: #c4cbe4;
|
|
43
|
-
--edge: #
|
|
43
|
+
--edge: #7e839b; --managed: #a6e3a1; --foreign: #f9e2af; --pending: #89b4fa;
|
|
44
44
|
--degraded: #f38ba8; --neutral: #6d7187; --runtime: #94e2d5;
|
|
45
45
|
--rule: #4e4f64; --focus: #a3b4d0; --active: #3d4660; --well: #11101f; --shadow: #050507;
|
|
46
46
|
--bar-managed: #a6e3a1; --bar-foreign: #f9e2af; --bar-pending: #89b4fa; --bar-degraded: #f38ba8; --bar-runtime: #94e2d5; --bar-neutral: #9b9fb7;
|
|
@@ -137,6 +137,11 @@
|
|
|
137
137
|
visible line. The hovered edge is also raised to the top in JS so it isn't
|
|
138
138
|
buried under the bundle. */
|
|
139
139
|
#graph g[data-edge-from] .pin-edge-line { transition: stroke .08s ease, stroke-width .08s ease; }
|
|
140
|
+
/* behold#824: an edge's label is read text, not a hint, so it takes the
|
|
141
|
+
full text colour, and its pill is outlined in the edge's own colour so
|
|
142
|
+
the label reads as part of its line. */
|
|
143
|
+
#graph g[data-edge-via] > text { fill: var(--pin-text); }
|
|
144
|
+
#graph g[data-edge-via] > rect { stroke: var(--pin-edge); }
|
|
140
145
|
/* ---- Motion (#229) ---------------------------------------------------
|
|
141
146
|
behold spends motion exactly twice, and never for decoration:
|
|
142
147
|
1. the graph fades through on every re-render, so a refresh reads as a
|
|
@@ -557,6 +562,10 @@
|
|
|
557
562
|
/* Folded in a frame, the panel is a small pill (⌘K and the expand
|
|
558
563
|
chevron) in the corner, so the graph has the pane to itself. */
|
|
559
564
|
.embed #panel.collapsed #panel-tabs button[data-tab] { display: none; }
|
|
565
|
+
/* A static export (behold export) has no live host behind it. */
|
|
566
|
+
.static #panel-tabs button[data-tab="substrates"], .static #panel-body section[data-tab="substrates"],
|
|
567
|
+
.static:not(.static-history) #panel-tabs button[data-tab="deploy"], .static:not(.static-history) #panel-body section[data-tab="deploy"],
|
|
568
|
+
.static .lanes-link { display: none !important; }
|
|
560
569
|
.embed #panel.collapsed { width: auto; }
|
|
561
570
|
.embed #panel.collapsed #panel-tabs { gap: var(--s1); padding: 2px var(--s1); }
|
|
562
571
|
/* #569: ?embed=1&bare=1, the kiosk's frame: the graph alone. Nothing to
|
package/web/kiosk.html
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
tokens (KIOSK_THEME in theme.js), which initTheme() replaces with the viewer's theme. */
|
|
31
31
|
:root {
|
|
32
32
|
--bg: #141d2b; --panel: #213027; --line: #2e3d2a; --fg: #9fef00; --muted: #7d9e5a; --ink2: #97d742;
|
|
33
|
-
--edge: #
|
|
33
|
+
--edge: #609113; --managed: #19cb00; --foreign: #cecb00; --pending: #0d73cc;
|
|
34
34
|
--degraded: #cc0403; --neutral: #537c18; --runtime: #0dcdcd;
|
|
35
35
|
--rule: #515e48; --focus: #577597; --active: #223f47; --well: #070f1c; --shadow: #030406;
|
|
36
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. */
|
package/web/theme.js
CHANGED
|
@@ -150,6 +150,8 @@ function pushForContrast(hex, against, floor, dark) {
|
|
|
150
150
|
// all 552 palettes have to come out of here legible.
|
|
151
151
|
/** behold#725: the least contrast --muted and --muted-ink keep on the grounds they sit on (WCAG AA). */
|
|
152
152
|
export const MUTED_FLOOR = 4.5;
|
|
153
|
+
/** behold#824: the contrast an edge line keeps on the graph's background. */
|
|
154
|
+
export const EDGE_FLOOR = 3;
|
|
153
155
|
/** behold#725: the least contrast --ink2, the secondary prose ink, keeps on every ground (WCAG AAA). */
|
|
154
156
|
export const INK2_FLOOR = 7;
|
|
155
157
|
/** behold#725: how far --ink2 starts from --fg toward --bg before the floor holds it. */
|
|
@@ -189,7 +191,10 @@ export function tokensFor(th) {
|
|
|
189
191
|
// Push its OKLCH L away from --panel's until it clears MUTED_FLOOR
|
|
190
192
|
// (behold#725: 4.5:1, WCAG AA for body text; it was 3:1).
|
|
191
193
|
muted: pushForContrast(desaturate(fgMix(0.5), 0.75), panel, MUTED_FLOOR, th.dark),
|
|
192
|
-
|
|
194
|
+
// behold#824: an edge is how two cards read as connected, and at a 0.32 mix
|
|
195
|
+
// it all but vanished on most themes. 0.55, held to 3:1 on the background
|
|
196
|
+
// (WCAG's floor for a graphic), the floor the card outlines already keep.
|
|
197
|
+
edge: pushForContrast(fgMix(0.55), th.bg, EDGE_FLOOR, th.dark),
|
|
193
198
|
// The structural border — the panel shell, the pane edge, the footer rule.
|
|
194
199
|
// Tinted by the palette's OWN bright-black slot instead of being one more
|
|
195
200
|
// fg/bg mix, but anchored to a guaranteed-visible mix so a theme whose
|
|
@@ -406,7 +411,7 @@ export function pinTokensFor(th) {
|
|
|
406
411
|
const stroke = (c) => line(mix(th.bg, c, 0.62));
|
|
407
412
|
return {
|
|
408
413
|
bg0: th.bg, bg1: fgMix(0.045), dots: fgMix(0.12),
|
|
409
|
-
text: th.fg, textMuted: fgMix(0.5), textFaint: fgMix(0.38), edge: fgMix(0.
|
|
414
|
+
text: th.fg, textMuted: fgMix(0.5), textFaint: fgMix(0.38), edge: lightnessFor(fgMix(0.55), [th.bg, fgMix(0.045)], EDGE_FLOOR, up),
|
|
410
415
|
neutralFill: panel, neutralStroke: fgMix(0.3), neutralBar: fgMix(0.5),
|
|
411
416
|
accentFill: fill(accent), accentStroke: stroke(accent), accentBar: accent,
|
|
412
417
|
goodFill: fill(good), goodStroke: stroke(good), goodBar: good,
|
package/web/theme.test.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
// sweeps all 552 palettes for the same assertion; this pins the exact
|
|
7
7
|
// palette the issue was filed against, with no browser involved.
|
|
8
8
|
import { describe, it, expect } from "vitest";
|
|
9
|
-
import { BAR_FLOOR, BAR_STATES, FRAME_STATES, INK2_FLOOR, KIOSK_THEME, MIN_STEP, MUTED_FLOOR, SURFACE_CHROMA, barGrounds, barInks, barVars, SOFT_CEILING, ZEBRA, contrast, desaturate, frameGrounds, frameInks, hexToOklch, ink2Grounds, mix, PAINT_KEY, paintFor, pinTokensFor, themeStep, tokensFor } from "./theme.js";
|
|
9
|
+
import { BAR_FLOOR, BAR_STATES, EDGE_FLOOR, FRAME_STATES, INK2_FLOOR, KIOSK_THEME, MIN_STEP, MUTED_FLOOR, SURFACE_CHROMA, barGrounds, barInks, barVars, SOFT_CEILING, ZEBRA, contrast, desaturate, frameGrounds, frameInks, hexToOklch, ink2Grounds, mix, PAINT_KEY, paintFor, pinTokensFor, themeStep, tokensFor } from "./theme.js";
|
|
10
10
|
import { THEMES } from "./themes.js";
|
|
11
11
|
|
|
12
12
|
describe("themeStep — the kiosk's < and > (behold#755)", () => {
|
|
@@ -277,3 +277,15 @@ describe("paintFor — the theme before first paint (behold#725)", () => {
|
|
|
277
277
|
expect(JSON.parse(JSON.stringify(p))).toEqual(p);
|
|
278
278
|
});
|
|
279
279
|
});
|
|
280
|
+
|
|
281
|
+
describe("edges (behold#824)", () => {
|
|
282
|
+
it("draws an edge at 3:1 or better on the background, on every theme", () => {
|
|
283
|
+
const weak = [];
|
|
284
|
+
for (const th of Object.values(THEMES)) {
|
|
285
|
+
const pin = pinTokensFor(th);
|
|
286
|
+
const css = tokensFor(th);
|
|
287
|
+
if (contrast(pin.edge, th.bg) < EDGE_FLOOR || contrast(css.edge, th.bg) < EDGE_FLOOR) weak.push(th.name);
|
|
288
|
+
}
|
|
289
|
+
expect(weak).toEqual([]);
|
|
290
|
+
});
|
|
291
|
+
});
|