@intentius/behold 0.29.54 → 0.29.56

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/demos.json CHANGED
@@ -141,10 +141,7 @@
141
141
  "setup": "bash scripts/emulators-up.sh",
142
142
  "serve": {
143
143
  "local": true,
144
- "env": "local",
145
- "processEnv": {
146
- "GCP_PROJECT_ID": "three-cloud"
147
- }
144
+ "env": "local"
148
145
  }
149
146
  },
150
147
  {
@@ -35,4 +35,4 @@ npx serve export
35
35
 
36
36
  `cd dns && npx chant run front-door` runs the same steps as an Op.
37
37
 
38
- Needs chant 0.124.37 or newer.
38
+ Needs chant 0.124.38 or newer.
@@ -6,10 +6,10 @@
6
6
  "": {
7
7
  "name": "behold-example-three-cloud",
8
8
  "dependencies": {
9
- "@intentius/chant": "^0.124.37",
10
- "@intentius/chant-lexicon-aws": "^0.124.37",
11
- "@intentius/chant-lexicon-azure": "^0.124.37",
12
- "@intentius/chant-lexicon-gcp": "^0.124.37"
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.37",
448
- "resolved": "https://registry.npmjs.org/@intentius/chant/-/chant-0.124.37.tgz",
449
- "integrity": "sha512-yfnf2Bb66kA6UHqBI76T2HM1JczhIY35k4lDsxA5GDuvz33xHRFV+BhpLJD5+uKqLRVYHIp/UqlccY5Q3yjjCw==",
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.37",
477
- "resolved": "https://registry.npmjs.org/@intentius/chant-lexicon-aws/-/chant-lexicon-aws-0.124.37.tgz",
478
- "integrity": "sha512-H79t+Aea1P051sVOfJOBQ1ZlpMmjG7We3p71RG8H99gtFXMyV44MWlBl0eikOyHLBlZu+YU449deWLtcEiFe0Q==",
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.37"
485
+ "@intentius/chant": "^0.124.38"
486
486
  }
487
487
  },
488
488
  "node_modules/@intentius/chant-lexicon-azure": {
489
- "version": "0.124.37",
490
- "resolved": "https://registry.npmjs.org/@intentius/chant-lexicon-azure/-/chant-lexicon-azure-0.124.37.tgz",
491
- "integrity": "sha512-hU/q497o+4VTw4E3t6ij5Pu5YSrc9yp5O1jdCYH7p6IHe9EpGmytyVTWhsmsd8B+1i8hU5HkV41+iM4qcA8HiQ==",
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.37"
497
+ "@intentius/chant": "^0.124.38"
498
498
  }
499
499
  },
500
500
  "node_modules/@intentius/chant-lexicon-gcp": {
501
- "version": "0.124.37",
502
- "resolved": "https://registry.npmjs.org/@intentius/chant-lexicon-gcp/-/chant-lexicon-gcp-0.124.37.tgz",
503
- "integrity": "sha512-hUojSIF0MCsohc2bgrTFy2nZ/Eoyt0PbtVtlDnAvc4HZKrE2SVamaKQUKslhAGySjGOR8BpQWcMSCT92Bl0JpQ==",
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.37"
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.37",
12
- "@intentius/chant-lexicon-aws": "^0.124.37",
13
- "@intentius/chant-lexicon-azure": "^0.124.37",
14
- "@intentius/chant-lexicon-gcp": "^0.124.37"
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 = "Run this yourself: `npx @intentius/behold demo three-cloud`";
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.54",
3
+ "version": "0.29.56",
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.37",
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
@@ -325,8 +325,120 @@ function recolorNodesByCategory(ir) {
325
325
  const bar = g.querySelector('rect[width="4"]');
326
326
  if (bar) bar.setAttribute("fill", "var(--runtime)");
327
327
  }
328
+ renderGraphLegend();
328
329
  }
329
330
  onThemeChange(() => (recolorNodesByCategory(), drawTgReads())); // behold#571: drawTgReads redraws the marks in the theme's colours
331
+ // behold#824: the legend on the graph itself. In drift mode a card's fill is
332
+ // its resource kind (one hue per kind, nothing more) and its state is the bar
333
+ // down its left side and its outline, but the only legend was in the Model
334
+ // tab, so the biggest colours on the canvas read as a code with no key. This
335
+ // corner says what each one is, with the counts the Model tab keeps, and the
336
+ // health marks when there are any. Closed once, it stays closed for this
337
+ // viewer (a "legend" button brings it back).
338
+ const LEGEND_KEY = "behold.graph.legend.hidden";
339
+ function legendHidden() {
340
+ try {
341
+ return localStorage.getItem(LEGEND_KEY) === "1";
342
+ } catch {
343
+ return false;
344
+ }
345
+ }
346
+ function renderGraphLegend() {
347
+ const host = document.getElementById("graph");
348
+ if (!host) return;
349
+ let el = document.getElementById("graph-legend");
350
+ const ir = lastGraphIr;
351
+ const onOverlay = !!(lastMeta && lastMeta.env);
352
+ if (!ir || !onOverlay || activeColourMode() !== "drift" || embedOpts.bare) {
353
+ if (el) el.remove();
354
+ return;
355
+ }
356
+ if (!el) {
357
+ el = document.createElement("div");
358
+ el.id = "graph-legend";
359
+ host.appendChild(el);
360
+ }
361
+ el.innerHTML = "";
362
+ if (legendHidden()) {
363
+ el.className = "closed";
364
+ el.appendChild(button("legend", "act", () => {
365
+ try {
366
+ localStorage.removeItem(LEGEND_KEY);
367
+ } catch {}
368
+ renderGraphLegend();
369
+ }));
370
+ return;
371
+ }
372
+ el.className = "";
373
+ const head = document.createElement("div");
374
+ head.className = "gl-head";
375
+ head.textContent = "legend";
376
+ const close = button("×", "gl-close", () => {
377
+ try {
378
+ localStorage.setItem(LEGEND_KEY, "1");
379
+ } catch {}
380
+ renderGraphLegend();
381
+ });
382
+ close.title = "Hide the legend (the Model tab keeps it)";
383
+ head.appendChild(close);
384
+ el.appendChild(head);
385
+ const line = (swatch, text, count, cls) => {
386
+ const row = document.createElement("div");
387
+ row.className = "gl-row" + (cls ? " " + cls : "");
388
+ row.appendChild(swatch);
389
+ const t = document.createElement("span");
390
+ t.className = "grow";
391
+ t.textContent = text;
392
+ row.appendChild(t);
393
+ if (count) {
394
+ const c = document.createElement("span");
395
+ c.className = "gl-count";
396
+ c.textContent = count;
397
+ row.appendChild(c);
398
+ }
399
+ el.appendChild(row);
400
+ };
401
+ const kinds = [...new Set(ir.nodes.map((n) => n.kind || n.lexicon || "node"))].slice(0, 3);
402
+ const fills = document.createElement("span");
403
+ fills.className = "gl-fills";
404
+ for (const k of kinds) {
405
+ const f = document.createElement("i");
406
+ f.style.background = colorForCategory(k);
407
+ fills.appendChild(f);
408
+ }
409
+ line(fills, "card colour: resource kind");
410
+ const sub = document.createElement("div");
411
+ sub.className = "gl-sub";
412
+ sub.textContent = "bar and outline: state";
413
+ el.appendChild(sub);
414
+ const words = statusLabels();
415
+ const counts = {};
416
+ for (const n of ir.nodes) {
417
+ const st = n.attrs && n.attrs._status;
418
+ if (st in words) counts[st] = (counts[st] || 0) + 1;
419
+ }
420
+ for (const [k, label] of Object.entries(words)) {
421
+ if (!counts[k]) continue;
422
+ const bar = document.createElement("span");
423
+ bar.className = "gl-bar";
424
+ bar.style.background = DRIFT_STATUS_VAR[k];
425
+ line(bar, label, String(counts[k]));
426
+ }
427
+ const health = hmLegendRows(hmAnswer);
428
+ if (health.length) {
429
+ const hs = document.createElement("div");
430
+ hs.className = "gl-sub";
431
+ hs.textContent = "health";
432
+ el.appendChild(hs);
433
+ for (const r of health) {
434
+ const dot = document.createElement("span");
435
+ dot.className = "gl-dot" + (r.dashed ? " dashed" : "");
436
+ dot.style.background = r.color;
437
+ line(dot, r.text, r.count);
438
+ }
439
+ }
440
+ }
441
+
330
442
 
331
443
  // #229, the one motion signature behold spends on data: a node whose drift
332
444
  // `_status` CHANGED between two renders pulses once in the colour it just
@@ -1947,12 +2059,22 @@ function renderPanelView() {
1947
2059
  // phase boxes).
1948
2060
  if (!view.components && !view.logical && !view.ops) {
1949
2061
  zoom.appendChild(panelHeading("layout"));
1950
- zoom.appendChild(
1951
- panelOpt("radial", view.radial, () => {
2062
+ // behold#824: an estate of several projects is laid out one box per
2063
+ // project, and the radial layout has no boxes, so the server draws the
2064
+ // same picture either way. Greyed out with the reason, like a colour mode
2065
+ // that can't apply.
2066
+ const estate = !!(lastMeta && lastMeta.estate > 1);
2067
+ const radial = panelOpt(
2068
+ "radial",
2069
+ view.radial && !estate,
2070
+ () => {
1952
2071
  view.radial = !view.radial;
1953
2072
  load();
1954
- }, "Curl the wide DAG onto concentric rings"),
2073
+ },
2074
+ estate ? "Radial lays out one project; this is an estate of several, drawn one box per project" : "Curl the wide DAG onto concentric rings",
1955
2075
  );
2076
+ if (estate) radial.disabled = true;
2077
+ zoom.appendChild(radial);
1956
2078
  }
1957
2079
  const tools = document.getElementById("panel-viewtools");
1958
2080
  tools.innerHTML = "";
@@ -6531,6 +6653,7 @@ async function loadHealth(env, fresh) {
6531
6653
  if (view.env === env) {
6532
6654
  markHealthCards(hmAnswer);
6533
6655
  renderPanel();
6656
+ renderGraphLegend();
6534
6657
  }
6535
6658
  }
6536
6659
  function markHealthCards(a) {
@@ -8655,6 +8778,7 @@ function applyVB() {
8655
8778
  const s = currentSvg();
8656
8779
  if (s && vb) s.setAttribute("viewBox", vb.join(" "));
8657
8780
  scaleBoxLabels(); // #396 item 7b: box titles/badges keep a legible size at every zoom
8781
+ scaleEdgeLabels(); // behold#824: an edge's label keeps a legible size too
8658
8782
  dotsCamera(); // #712: a no-op unless the dots preview is mounted
8659
8783
  kioskTellBoxes(); // behold#571: the kiosk's overlays ride the boxes they describe
8660
8784
  }
@@ -8849,6 +8973,37 @@ function scaleBoxLabels() {
8849
8973
  }
8850
8974
  }
8851
8975
 
8976
+ // behold#824: an edge's label (`import`, `HealthCheckId`) is drawn at 10.5
8977
+ // units, which on a graph fitted at a quarter scale is under 3px — present but
8978
+ // unreadable. Each label's pill and text are scaled about the pill's own centre
8979
+ // until the text renders at EDGE_LABEL_MIN_PX on screen, up to EDGE_LABEL_MAX_K
8980
+ // times its drawn size, so it stays on its line and never swamps the cards.
8981
+ // Zoomed in far enough, the label is left exactly as pinhole drew it.
8982
+ const EDGE_LABEL_MIN_PX = 9;
8983
+ const EDGE_LABEL_MAX_K = 3;
8984
+ let edgeLabelState = { svg: null, scale: null };
8985
+
8986
+ function scaleEdgeLabels() {
8987
+ const svg = currentSvg();
8988
+ if (!svg || !vb) return;
8989
+ const pane = svg.getBoundingClientRect();
8990
+ if (!(pane.width > 0 && pane.height > 0)) return;
8991
+ const scale = Math.min(pane.width / vb[2], pane.height / vb[3]);
8992
+ if (!(scale > 0) || (edgeLabelState.svg === svg && edgeLabelState.scale === scale)) return;
8993
+ edgeLabelState = { svg, scale };
8994
+ for (const g of svg.querySelectorAll("g[data-edge-via]")) {
8995
+ const text = g.querySelector(":scope > text");
8996
+ const rect = g.querySelector(":scope > rect");
8997
+ if (!text || !rect) continue;
8998
+ const size = parseFloat(text.getAttribute("font-size")) || 10.5;
8999
+ const k = Math.min(EDGE_LABEL_MAX_K, Math.max(1, EDGE_LABEL_MIN_PX / (size * scale)));
9000
+ const cx = Number(rect.getAttribute("x")) + Number(rect.getAttribute("width")) / 2;
9001
+ const cy = Number(rect.getAttribute("y")) + Number(rect.getAttribute("height")) / 2;
9002
+ const t = k === 1 ? null : `translate(${cx} ${cy}) scale(${Math.round(k * 100) / 100}) translate(${-cx} ${-cy})`;
9003
+ for (const el of [rect, text]) t ? el.setAttribute("transform", t) : el.removeAttribute("transform");
9004
+ }
9005
+ }
9006
+
8852
9007
  // How much of the viewBox one card should take when ⌘K lands on it (#393): the
8853
9008
  // window is this many card-widths across, so a 301-card estate arrives readable
8854
9009
  // rather than at whatever zoom the last gesture left. Never wider than the fit,
@@ -10844,7 +10999,7 @@ function paletteCommands() {
10844
10999
  // Radial toggle — entity zooms only, same gate the removed checkbox had
10845
11000
  // (components/logical/ops all lay themselves out: waves / nested arch boxes /
10846
11001
  // phase boxes).
10847
- if (!view.components && !view.logical && !view.ops) {
11002
+ if (!view.components && !view.logical && !view.ops && !(lastMeta && lastMeta.estate > 1)) {
10848
11003
  c.push([(view.radial ? "Disable" : "Enable") + " radial layout", () => { view.radial = !view.radial; load(); }]);
10849
11004
  }
10850
11005
  // #393: 301 cards in one box read as a strip at any zoom. This shuts every
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: #56596d; --managed: #a6e3a1; --foreign: #f9e2af; --pending: #89b4fa;
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,31 @@
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
+ /* An edge is drawn the same width on screen at every zoom: in viewBox
144
+ units a fitted estate scaled its 1.4 down to a third of a pixel. */
145
+ #graph .pin-edge-line { vector-effect: non-scaling-stroke; stroke-width: 1.6px; }
146
+ /* behold#824: the legend on the graph — what a card's colour and its bar mean. */
147
+ #graph-legend { position: absolute; right: 12px; bottom: 12px; z-index: 5; min-width: 190px; max-width: 260px;
148
+ background: var(--panel); color: var(--fg); border: 1px solid var(--line); border-radius: var(--r-ctl);
149
+ padding: 8px 10px; font: var(--t-caption)/1.5 var(--font-ui); box-shadow: 0 2px 10px var(--shadow); }
150
+ #graph-legend.closed { min-width: 0; padding: 0; border: 0; background: none; box-shadow: none; }
151
+ #graph-legend .gl-head { display: flex; justify-content: space-between; align-items: center; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
152
+ #graph-legend .gl-close { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 14px; padding: 0 2px; }
153
+ #graph-legend .gl-close:hover { color: var(--fg); }
154
+ #graph-legend .gl-row { display: flex; align-items: center; gap: 8px; }
155
+ #graph-legend .gl-row .grow { flex: 1; }
156
+ #graph-legend .gl-count { color: var(--muted); font-family: var(--font-mono); }
157
+ #graph-legend .gl-sub { color: var(--muted); margin-top: 6px; }
158
+ #graph-legend .gl-fills { display: inline-flex; gap: 2px; }
159
+ #graph-legend .gl-fills i { width: 8px; height: 12px; border-radius: 2px; display: inline-block; }
160
+ #graph-legend .gl-bar { width: 4px; height: 12px; border-radius: 1px; display: inline-block; margin: 0 9px 0 3px; }
161
+ #graph-legend .gl-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin: 0 6px 0 1px; }
162
+ #graph-legend .gl-dot.dashed { border-radius: 2px; }
163
+ #graph g[data-edge-via] > text { fill: var(--pin-text); }
164
+ #graph g[data-edge-via] > rect { stroke: var(--pin-edge); }
140
165
  /* ---- Motion (#229) ---------------------------------------------------
141
166
  behold spends motion exactly twice, and never for decoration:
142
167
  1. the graph fades through on every re-render, so a refresh reads as a
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: #40601d; --managed: #19cb00; --foreign: #cecb00; --pending: #0d73cc;
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
- edge: fgMix(0.32),
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.3),
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
+ });