cornfield 0.28.0 → 0.30.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/core/mentions.js +1 -1
- package/core/strings.js +4 -4
- package/explorer/capped.js +33 -0
- package/explorer/explorer.css +126 -34
- package/explorer/flows.js +5 -7
- package/explorer/forge-panel.js +7 -4
- package/explorer/index.html +28 -17
- package/explorer/main.js +2 -1
- package/explorer/mockups-model.js +1 -1
- package/explorer/panels.js +146 -87
- package/explorer/proposal-model.js +13 -0
- package/explorer/proposal.js +81 -16
- package/explorer/review.js +65 -19
- package/explorer/scenario-ui.js +26 -7
- package/explorer/sheets.js +1 -1
- package/explorer/state.js +1 -1
- package/explorer/tokens.css +1 -0
- package/explorer/whatif.js +21 -4
- package/package.json +1 -1
package/core/mentions.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @module core/mentions
|
|
3
3
|
*
|
|
4
4
|
* How a thread points at the map (spec 0005, D7). Pure: no I/O, no DOM, no Node built-ins, so the server (a hook's
|
|
5
|
-
* payload) and the explorer (the lights, a node's "
|
|
5
|
+
* payload) and the explorer (the lights, a node's "Threads") load the same file.
|
|
6
6
|
*
|
|
7
7
|
* - **Mentions.** People write `[[core-server-auth]]` (a node's id) or `[[server/auth.js]]` (a repo path) in prose.
|
|
8
8
|
* `parseMentions` reads them outside code: a fenced block and an inline code span are text about code, not links.
|
package/core/strings.js
CHANGED
|
@@ -28,8 +28,9 @@ export const STRINGS = Object.freeze({
|
|
|
28
28
|
closeProposal: 'Close',
|
|
29
29
|
approve: 'Approve',
|
|
30
30
|
sendBack: 'Send back',
|
|
31
|
+
sendBackWithNote: 'Send back with this note',
|
|
31
32
|
reviewNoteLabel: 'Note for the drafting agent',
|
|
32
|
-
reviewNotePlaceholder: 'What should change?
|
|
33
|
+
reviewNotePlaceholder: 'What should change?',
|
|
33
34
|
// The issues and pull requests panel
|
|
34
35
|
tabPulls: 'Pull requests',
|
|
35
36
|
tabIssues: 'Issues',
|
|
@@ -47,9 +48,8 @@ export const STRINGS = Object.freeze({
|
|
|
47
48
|
continueRun: 'Continue',
|
|
48
49
|
reply: 'Reply',
|
|
49
50
|
// The node panel
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
openRoute: 'Open Live Route',
|
|
51
|
+
openRoute: 'Open route',
|
|
52
|
+
startRun: 'Start a run',
|
|
53
53
|
copySpec: 'Copy Spec',
|
|
54
54
|
// The hint, loading and errors
|
|
55
55
|
hintInspect: 'Tap node to inspect live spec',
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module explorer/capped
|
|
3
|
+
*
|
|
4
|
+
* A long list in the node panel shows its first few items and a quiet "and 15 more" button that opens the rest in place
|
|
5
|
+
* (a disclosure: `aria-expanded`). `toggleCapped` is the click handler panels.js binds once on the panel.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/** Items shown before the rest folds away */
|
|
9
|
+
export const CAP = 5;
|
|
10
|
+
let counter = 0;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The items as HTML, folded after CAP when there are more.
|
|
14
|
+
* @param {string[]} items already-escaped HTML, one per item
|
|
15
|
+
*/
|
|
16
|
+
export function capped(items) {
|
|
17
|
+
if (items.length <= CAP + 1) return items.join(''); // "and 1 more" saves nothing
|
|
18
|
+
const id = `hx-more-${++counter}`;
|
|
19
|
+
const rest = items.length - CAP;
|
|
20
|
+
return `${items.slice(0, CAP).join('')}<div class="hx-more" id="${id}" hidden>${items.slice(CAP).join('')}</div><button type="button" class="hx-btn hx-btn--quiet hx-textact hx-more-btn" data-more="${id}" data-rest="${rest}" aria-expanded="false" aria-controls="${id}">and ${rest} more</button>`;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** Opens or folds the list a "more" button belongs to; true when the click was one */
|
|
24
|
+
export function toggleCapped(target) {
|
|
25
|
+
const button = target.closest && target.closest('[data-more]');
|
|
26
|
+
if (!button) return false;
|
|
27
|
+
const list = button.ownerDocument.getElementById(button.dataset.more);
|
|
28
|
+
const open = button.getAttribute('aria-expanded') !== 'true';
|
|
29
|
+
if (list) list.hidden = !open;
|
|
30
|
+
button.setAttribute('aria-expanded', String(open));
|
|
31
|
+
button.textContent = open ? 'Show fewer' : `and ${button.dataset.rest} more`;
|
|
32
|
+
return true;
|
|
33
|
+
}
|
package/explorer/explorer.css
CHANGED
|
@@ -128,7 +128,6 @@ h1, h2, h3, p { margin: 0; }
|
|
|
128
128
|
.hx-btn--preset.hx-btn--active { background: var(--corn-hue-orange); border-color: var(--corn-hue-orange); color: var(--corn-ground); }
|
|
129
129
|
.hx-btn--rom { width: 100%; justify-content: center; margin-top: var(--corn-space-1); padding: var(--corn-space-2); background: color-mix(in srgb, var(--corn-hue-fuchsia) 20%, transparent); border-color: color-mix(in srgb, var(--corn-hue-fuchsia) 40%, transparent); color: color-mix(in srgb, var(--corn-hue-fuchsia) 60%, var(--corn-text)); font-weight: 700; }
|
|
130
130
|
.hx-btn--rom:hover { background: color-mix(in srgb, var(--corn-hue-fuchsia) 30%, transparent); }
|
|
131
|
-
.hx-btn--copy { padding: var(--corn-space-3) var(--corn-space-4); border-radius: var(--corn-radius); border: 0; }
|
|
132
131
|
|
|
133
132
|
.hx-dots { display: inline-flex; }
|
|
134
133
|
.hx-dots span { width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 0 var(--corn-border) var(--corn-ground); margin-left: calc(var(--corn-space-1) * -1); }
|
|
@@ -267,22 +266,16 @@ h1, h2, h3, p { margin: 0; }
|
|
|
267
266
|
.hx-drawer-handle span { width: 48px; height: 6px; border-radius: var(--corn-radius-pill); background: var(--corn-surface-3); }
|
|
268
267
|
.hx-drawer-body { flex: 1; display: flex; flex-direction: column; gap: var(--corn-space-5); padding: calc(var(--corn-space-5) + var(--corn-space-1)); overflow-y: auto; user-select: text; }
|
|
269
268
|
@media (min-width: 640px) { .hx-drawer-body { padding: var(--corn-space-6); } }
|
|
270
|
-
.hx-drawer-head { display: flex; align-items:
|
|
271
|
-
.hx-drawer-title-wrap { display: flex; align-items: center; gap: var(--corn-space-3); min-width: 0; }
|
|
269
|
+
.hx-drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--corn-space-3); }
|
|
272
270
|
.hx-drawer-title { font-size: var(--corn-text-lg); font-weight: 700; color: var(--corn-text); overflow-wrap: anywhere; }
|
|
273
|
-
.hx-badge { flex: none; padding: calc(var(--corn-space-1) / 2) var(--corn-space-3); border-radius: var(--corn-radius-xs); border: var(--corn-border) solid color-mix(in srgb, var(--corn-accent-hover) 30%, transparent); background: var(--corn-accent-soft); color: var(--corn-accent-text); font-size: var(--corn-text-2xs); font-weight: 700; letter-spacing: 0.025em; }
|
|
274
271
|
.hx-close { width: 32px; height: 32px; flex: none; border: 0; border-radius: var(--corn-radius-sm); background: var(--corn-surface-2); color: var(--corn-text-3); font-weight: 700; font-size: var(--corn-text-base); }
|
|
275
272
|
.hx-close:hover { color: var(--corn-text); }
|
|
276
|
-
.hx-lead { font-size: var(--corn-text-
|
|
273
|
+
.hx-lead { font-size: var(--corn-text-base); line-height: 1.5; color: var(--corn-text-2); }
|
|
277
274
|
|
|
278
275
|
.hx-block { display: flex; flex-direction: column; gap: var(--corn-space-3); }
|
|
279
276
|
.hx-block-title { font-size: var(--corn-text-sm); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--corn-text-2); }
|
|
280
|
-
.hx-
|
|
281
|
-
.hx-
|
|
282
|
-
.hx-prop-head { display: flex; align-items: center; justify-content: space-between; gap: var(--corn-space-3); }
|
|
283
|
-
.hx-prop-head .hx-faint { font-size: var(--corn-text-2xs); }
|
|
284
|
-
.hx-prop > .hx-faint { font-size: var(--corn-text-2xs); margin-top: calc(var(--corn-space-1) / 2); }
|
|
285
|
-
.hx-meta { display: flex; flex-direction: column; gap: var(--corn-space-1); padding: var(--corn-space-4); border-radius: var(--corn-radius-sm); border: var(--corn-border) solid var(--corn-line); background: color-mix(in srgb, var(--corn-ground) 55%, transparent); font-family: var(--corn-mono); font-size: var(--corn-text-xs); color: var(--corn-text-3); overflow-wrap: anywhere; }
|
|
277
|
+
.hx-meta { display: flex; flex-direction: column; gap: var(--corn-space-5); font-size: var(--corn-text-md); color: var(--corn-text-2); overflow-wrap: anywhere; }
|
|
278
|
+
.hx-meta > :empty { display: none; } /* no live data, no threads: no gap where they would be */
|
|
286
279
|
|
|
287
280
|
.hx-sec { margin-top: var(--corn-space-2); padding-top: var(--corn-space-2); border-top: var(--corn-border) solid var(--corn-line); }
|
|
288
281
|
.hx-line { display: flex; align-items: flex-start; gap: var(--corn-space-2); padding: calc(var(--corn-space-1) / 2) 0; }
|
|
@@ -312,10 +305,9 @@ h1, h2, h3, p { margin: 0; }
|
|
|
312
305
|
.hx-chip--warning { background: var(--corn-warn); }
|
|
313
306
|
.hx-chip--danger, .hx-chip--success, .hx-chip--warning { color: var(--corn-ground); }
|
|
314
307
|
|
|
315
|
-
.hx-drawer-foot { display: flex; gap: var(--corn-space-3); flex: none; padding: var(--corn-space-
|
|
316
|
-
.hx-open { flex: 1; display: flex; align-items: center; justify-content: center; gap: var(--corn-space-2); padding:
|
|
308
|
+
.hx-drawer-foot { display: flex; align-items: stretch; gap: var(--corn-space-3); flex: none; padding: var(--corn-space-4) var(--corn-space-5) calc(var(--corn-space-4) + env(safe-area-inset-bottom, 0px)); border-top: var(--corn-border) solid var(--corn-surface-2); }
|
|
309
|
+
.hx-open { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; gap: var(--corn-space-2); min-height: 36px; padding: 0 var(--corn-space-4); border-radius: var(--corn-radius-sm); background: var(--corn-accent); color: var(--corn-text-on-accent); font-size: var(--corn-text-sm); font-weight: 600; text-align: center; text-decoration: none; transition: background 0.15s; }
|
|
317
310
|
.hx-open:hover { background: var(--corn-accent-hover); }
|
|
318
|
-
.hx-open:not([href]) { background: var(--corn-surface-2); color: var(--corn-text-3); }
|
|
319
311
|
|
|
320
312
|
/* ---- proposals (proposal.js): picker, bar, marks, panel rows ----------------------------------- */
|
|
321
313
|
.hx-btn--proposal { border-color: color-mix(in srgb, var(--corn-added) 35%, transparent); color: var(--corn-added-text); }
|
|
@@ -335,20 +327,16 @@ button.hx-proposal-item:focus-visible { outline: var(--corn-focus-width) solid v
|
|
|
335
327
|
.hx-proposal-meta { display: flex; flex-wrap: wrap; gap: calc(var(--corn-space-1) / 2) var(--corn-space-3); color: var(--corn-text-3); font-size: var(--corn-text-2xs); }
|
|
336
328
|
.hx-proposal-where { color: var(--corn-added-text); }
|
|
337
329
|
|
|
338
|
-
.hx-proposal-bar { position: absolute; top: 48px; left: 12px; width: min(
|
|
330
|
+
.hx-proposal-bar { position: absolute; top: 48px; left: 12px; width: min(960px, calc(100% - 24px)); padding: var(--corn-space-3) var(--corn-space-3); border-radius: var(--corn-radius-lg); font-size: var(--corn-text-sm); z-index: 15; user-select: text; }
|
|
339
331
|
.hx-proposal-bar.is-error { border-color: color-mix(in srgb, var(--corn-removed) 50%, transparent); }
|
|
340
332
|
.hx-proposal-message { color: var(--corn-text-2); }
|
|
341
333
|
.hx-proposal-bar.is-error .hx-proposal-message { color: var(--corn-bad); }
|
|
342
|
-
.hx-proposal-
|
|
343
|
-
.hx-proposal-name { flex: 1 1 140px; min-width: 0; font-size: var(--corn-text-md); color: var(--corn-text); overflow-wrap: anywhere; }
|
|
344
|
-
.hx-proposal-chip { padding: var(--corn-space-1) var(--corn-space-3); border-radius: var(--corn-radius-lg); border: var(--corn-border) solid var(--corn-line); background: color-mix(in srgb, var(--corn-ground) 55%, transparent); color: var(--corn-text-2); font-size: var(--corn-text-xs); font-variant-numeric: tabular-nums; }
|
|
345
|
-
.hx-proposal-chip:hover { background: var(--corn-surface-3); color: var(--corn-text); }
|
|
346
|
-
.hx-proposal-chip:focus-visible, .hx-seg-btn:focus-visible, .hx-change-row:focus-visible { outline: var(--corn-focus-width) solid var(--corn-focus); outline-offset: 2px; }
|
|
334
|
+
.hx-proposal-chip:focus-visible, .hx-proposal-mode:focus-visible, .hx-seg-btn:focus-visible, .hx-change-row:focus-visible { outline: var(--corn-focus-width) solid var(--corn-focus); outline-offset: 2px; }
|
|
347
335
|
.hx-proposal-summary { margin-top: var(--corn-space-2); color: var(--corn-text-2); line-height: 1.45; }
|
|
348
336
|
|
|
349
337
|
/* Before / Diff / After */
|
|
350
338
|
.hx-seg { display: inline-flex; padding: calc(var(--corn-space-1) / 2); border-radius: var(--corn-radius-sm); border: var(--corn-border) solid var(--corn-line); background: color-mix(in srgb, var(--corn-ground) 55%, transparent); }
|
|
351
|
-
.hx-seg-btn { padding:
|
|
339
|
+
.hx-seg-btn { height: 26px; padding: 0 var(--corn-space-4); border: 0; border-radius: var(--corn-radius-sm); background: none; color: var(--corn-text-3); font-size: var(--corn-text-sm); font-weight: 500; }
|
|
352
340
|
.hx-seg-btn:hover { color: var(--corn-text); }
|
|
353
341
|
.hx-seg-btn.is-on, .hx-seg-btn[aria-pressed="true"] { background: var(--corn-accent); color: var(--corn-text-on-accent); box-shadow: var(--corn-shadow-sm); }
|
|
354
342
|
|
|
@@ -385,11 +373,10 @@ button.hx-proposal-item:focus-visible { outline: var(--corn-focus-width) solid v
|
|
|
385
373
|
.hx-change em { color: var(--corn-text-3); text-decoration: none; }
|
|
386
374
|
|
|
387
375
|
/* The node panel is a 480px slide-over from 768px: the bar makes room for it */
|
|
388
|
-
@media (min-width: 768px) { .hx-stage:has(.drawer-open) .hx-proposal-bar { width: min(
|
|
376
|
+
@media (min-width: 768px) { .hx-stage:has(.drawer-open) .hx-proposal-bar { width: min(960px, calc(100% - 504px)); } }
|
|
389
377
|
|
|
390
378
|
@media (max-width: 639px) {
|
|
391
379
|
.hx-menu--proposals { position: fixed; top: 60px; left: 12px; right: 12px; width: auto; max-width: none; }
|
|
392
|
-
.hx-seg-btn { padding: var(--corn-space-1) var(--corn-space-4); }
|
|
393
380
|
}
|
|
394
381
|
|
|
395
382
|
/* ---- scenario player (scenario-ui.js): the bar while a scenario plays, and the scenario list --------- */
|
|
@@ -410,7 +397,6 @@ button.hx-proposal-item:focus-visible { outline: var(--corn-focus-width) solid v
|
|
|
410
397
|
.hx-player-fill { display: block; height: 100%; width: 0; background: var(--corn-accent-text); }
|
|
411
398
|
|
|
412
399
|
.hx-scenarios { position: absolute; top: 12px; left: 12px; max-width: min(320px, calc(100% - 24px)); padding: var(--corn-space-2) var(--corn-space-3); border-radius: var(--corn-radius); font-size: var(--corn-text-sm); color: var(--corn-text-2); z-index: 12; }
|
|
413
|
-
.hx-scenarios summary { cursor: pointer; font-weight: 600; }
|
|
414
400
|
.hx-scenarios-item { display: block; width: 100%; margin-top: var(--corn-space-2); padding: var(--corn-space-2) var(--corn-space-3); border: var(--corn-border) solid var(--corn-line-soft); border-radius: var(--corn-radius-sm); background: transparent; color: var(--corn-text); font-size: var(--corn-text-sm); text-align: left; cursor: pointer; }
|
|
415
401
|
.hx-scenarios-item:hover { background: color-mix(in srgb, var(--corn-accent-hover) 25%, transparent); }
|
|
416
402
|
/* With a proposal open the list is a row of its bar (scenario-ui.js mounts it there), so it opens in the bar's flow and the bar grows to hold it */
|
|
@@ -455,21 +441,75 @@ button.hx-proposal-item:focus-visible { outline: var(--corn-focus-width) solid v
|
|
|
455
441
|
.hx-rubber svg { display: block; overflow: visible; }
|
|
456
442
|
.hx-rubber-line { stroke: var(--corn-edit); stroke-width: 3; stroke-dasharray: 8 6; stroke-linecap: round; }
|
|
457
443
|
.hx-rubber-from, .hx-rubber-to { fill: color-mix(in srgb, var(--corn-edit) 15%, transparent); stroke: var(--corn-edit); stroke-width: 2; }
|
|
458
|
-
/*
|
|
459
|
-
|
|
460
|
-
.hx-review
|
|
444
|
+
/* The review (review.js, TOPO-12): the status line and the note that opens on Send back. It is in the toolbar, just before Send back and
|
|
445
|
+
Approve (the note's Tab goes on to them); from 768px it takes a row of its own under the toolbar, on a phone it sits under the counts */
|
|
446
|
+
.hx-review { flex: 1 0 100%; order: 1; display: flex; flex-direction: column; gap: var(--corn-space-2); }
|
|
447
|
+
.hx-review[hidden], .hx-review:not(:has(> :not([hidden]))) { display: none; }
|
|
448
|
+
.hx-review-form { display: flex; flex-direction: column; gap: var(--corn-space-2); }
|
|
449
|
+
.hx-review-form[hidden] { display: none; }
|
|
461
450
|
.hx-review-label { color: var(--corn-text-3); font-size: var(--corn-text-xs); }
|
|
462
451
|
.hx-review-note { width: 100%; min-height: 44px; resize: vertical; padding: var(--corn-space-2) var(--corn-space-3); border-radius: var(--corn-radius-sm); border: var(--corn-border) solid var(--corn-line); background: color-mix(in srgb, var(--corn-ground) 80%, transparent); color: var(--corn-text); font: inherit; font-size: var(--corn-text-sm); line-height: 1.4; user-select: text; }
|
|
463
452
|
.hx-review-note:focus { outline: var(--corn-focus-width) solid var(--corn-added-text); outline-offset: 1px; }
|
|
464
453
|
.hx-review-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--corn-space-2) var(--corn-space-3); }
|
|
465
|
-
.hx-review .hx-btn:disabled { opacity: 0.4; cursor: default; }
|
|
466
454
|
.hx-btn--approve { border-color: color-mix(in srgb, var(--corn-added) 50%, transparent); color: var(--corn-added-text); }
|
|
467
455
|
.hx-btn--approve:hover { background: color-mix(in srgb, var(--corn-added) 20%, transparent); color: var(--corn-added-text); }
|
|
468
|
-
.hx-review-status { color: var(--corn-added-text); font-variant-numeric: tabular-nums; }
|
|
456
|
+
.hx-review-status { margin: 0; color: var(--corn-added-text); font-variant-numeric: tabular-nums; }
|
|
469
457
|
.hx-review-status[hidden], .hx-review-msg[hidden], .hx-review-line[hidden] { display: none; }
|
|
470
458
|
.hx-review-msg { margin: 0; padding: var(--corn-space-1) var(--corn-space-3); border-radius: var(--corn-radius-sm); background: color-mix(in srgb, var(--corn-removed) 12%, transparent); border: var(--corn-border) solid color-mix(in srgb, var(--corn-removed) 35%, transparent); color: var(--corn-bad); line-height: 1.4; }
|
|
471
459
|
.hx-review-line { margin: 0; color: var(--corn-text-2); line-height: 1.4; }
|
|
472
460
|
.hx-proposal-reviewed { color: var(--corn-added-text); }
|
|
461
|
+
/* ---- The proposal toolbar (CF-43): proposal.js, review.js, whatif.js, scenario-ui.js ----------------
|
|
462
|
+
One row from 768px: title, counts (they open the change list), Before / Diff / After, Play, Edit, then Send back,
|
|
463
|
+
Approve (the primary) and a ⋯ menu with Close. The what-if controls sit behind Edit, the scenario list behind Play,
|
|
464
|
+
and the review note opens under the row on Send back. On a phone the row is a sheet: the title, the counts with
|
|
465
|
+
the current mode (a button that opens the switcher), the note when it is open, and Send back and Approve full
|
|
466
|
+
width, each 44px tall. */
|
|
467
|
+
.hx-proposal-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--corn-space-3) var(--corn-space-4); }
|
|
468
|
+
.hx-proposal-name { flex: 0 1 auto; min-width: 0; max-width: 28ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--corn-text-base); font-weight: 650; color: var(--corn-text); }
|
|
469
|
+
.hx-proposal-counts { display: contents; }
|
|
470
|
+
.hx-proposal-chip { display: inline-flex; align-items: center; padding: var(--corn-space-1) var(--corn-space-2); border: 0; border-radius: var(--corn-radius-sm); background: none; color: var(--corn-text-2); font-size: var(--corn-text-sm); font-variant-numeric: tabular-nums; white-space: nowrap; }
|
|
471
|
+
.hx-proposal-chip:hover { color: var(--corn-text); text-decoration: underline; }
|
|
472
|
+
.hx-proposal-chip .hx-mark-dot { margin: 0 var(--corn-space-2) 0 0; }
|
|
473
|
+
.hx-proposal-sep { margin: 0 var(--corn-space-2); color: var(--corn-text-3); }
|
|
474
|
+
.hx-proposal-mode { display: none; }
|
|
475
|
+
.hx-proposal-tools, .hx-proposal-actions { display: flex; align-items: center; gap: var(--corn-space-3); }
|
|
476
|
+
.hx-proposal-tools .hx-btn { height: 30px; font-size: var(--corn-text-sm); font-weight: 500; }
|
|
477
|
+
#proposal-play[aria-expanded="true"] { background: var(--corn-surface-3); color: var(--corn-text); }
|
|
478
|
+
#proposal-edit.hx-btn--active { background: var(--corn-edit-text); border-color: var(--corn-edit); color: var(--corn-ground); }
|
|
479
|
+
.hx-proposal-actions { margin-left: auto; }
|
|
480
|
+
.hx-proposal-actions .hx-btn { height: 32px; justify-content: center; padding: 0 var(--corn-space-5); font-size: var(--corn-text-sm); font-weight: 500; }
|
|
481
|
+
.hx-proposal-actions .hx-btn--approve, .hx-proposal-actions .hx-btn--approve:hover { background: var(--corn-accent); border-color: var(--corn-accent); color: var(--corn-text-on-accent); font-weight: 600; }
|
|
482
|
+
.hx-proposal-actions .hx-btn:disabled { opacity: 0.4; cursor: default; }
|
|
483
|
+
.hx-proposal-more { position: relative; }
|
|
484
|
+
.hx-proposal-more .hx-btn--icon { width: 32px; height: 32px; border-color: transparent; background: none; color: var(--corn-text-3); }
|
|
485
|
+
.hx-proposal-more .hx-btn--icon:hover, .hx-proposal-more .hx-btn--icon[aria-expanded="true"] { background: var(--corn-surface-3); color: var(--corn-text); }
|
|
486
|
+
.hx-proposal-more-menu { position: absolute; top: 100%; right: 0; z-index: 20; display: flex; flex-direction: column; min-width: 160px; margin-top: var(--corn-space-2); padding: var(--corn-space-2); border-radius: var(--corn-radius); border: var(--corn-border) solid var(--corn-line); box-shadow: var(--corn-shadow); }
|
|
487
|
+
.hx-proposal-more-menu[hidden] { display: none; }
|
|
488
|
+
.hx-proposal-more-menu .hx-btn { width: 100%; height: 32px; border-color: transparent; background: none; color: var(--corn-text-2); font-size: var(--corn-text-sm); }
|
|
489
|
+
.hx-proposal-more-menu .hx-btn:hover { background: var(--corn-surface-3); color: var(--corn-text); }
|
|
490
|
+
|
|
491
|
+
@media (max-width: 767px) {
|
|
492
|
+
.hx-proposal-head { display: grid; grid-template-columns: 1fr auto; gap: var(--corn-space-2) var(--corn-space-3); }
|
|
493
|
+
.hx-proposal-name { grid-column: 1 / -1; order: 1; max-width: none; }
|
|
494
|
+
.hx-proposal-counts { display: flex; grid-column: 1 / -1; order: 2; align-items: center; flex-wrap: wrap; column-gap: var(--corn-space-2); }
|
|
495
|
+
.hx-proposal-chip, .hx-proposal-mode { min-height: 44px; }
|
|
496
|
+
.hx-proposal-mode { display: inline-flex; align-items: center; gap: var(--corn-space-2); padding: 0 var(--corn-space-3); border: var(--corn-border) solid var(--corn-line); border-radius: var(--corn-radius-sm); background: var(--corn-surface-2); color: var(--corn-text); font-size: var(--corn-text-sm); font-weight: 600; }
|
|
497
|
+
.hx-proposal-mode::after { content: ""; width: 6px; height: 6px; border: solid currentColor; border-width: 0 var(--corn-border-strong) var(--corn-border-strong) 0; transform: translateY(-2px) rotate(45deg); }
|
|
498
|
+
.hx-proposal-mode[aria-expanded="true"]::after { transform: translateY(1px) rotate(-135deg); }
|
|
499
|
+
.hx-seg, .hx-review { grid-column: 1 / -1; order: 3; }
|
|
500
|
+
.hx-proposal-bar:not([data-mode-open="true"]) .hx-seg { display: none; }
|
|
501
|
+
.hx-seg-btn { flex: 1; height: 44px; font-size: var(--corn-text-md); }
|
|
502
|
+
.hx-proposal-actions { grid-column: 1 / -1; order: 4; display: grid; grid-template-columns: 1fr 1fr; margin-left: 0; gap: var(--corn-space-3); }
|
|
503
|
+
.hx-proposal-actions .hx-btn { height: auto; min-height: 44px; padding: var(--corn-space-2) var(--corn-space-3); white-space: normal; text-align: center; font-size: var(--corn-text-md); }
|
|
504
|
+
.hx-proposal-tools { order: 5; }
|
|
505
|
+
.hx-proposal-tools .hx-btn { height: auto; min-height: 44px; padding: 0 var(--corn-space-5); font-size: var(--corn-text-md); }
|
|
506
|
+
.hx-proposal-more { display: contents; }
|
|
507
|
+
.hx-proposal-more .hx-btn--icon { order: 6; width: 44px; height: 44px; }
|
|
508
|
+
.hx-proposal-more-menu { position: static; grid-column: 1 / -1; order: 7; box-shadow: none; }
|
|
509
|
+
.hx-proposal-more-menu .hx-btn { height: auto; min-height: 44px; font-size: var(--corn-text-md); }
|
|
510
|
+
.hx-scenarios-item, .hx-review .hx-btn, .hx-whatif .hx-btn { min-height: 44px; }
|
|
511
|
+
}
|
|
512
|
+
|
|
473
513
|
/* A proposal's mockups (mockups.js): the buttons in a node's panel and the window one opens in. A mockup is untrusted content, shown in an <img> or a sandboxed <iframe>. */
|
|
474
514
|
.hx-mockup-list { list-style: none; margin: var(--corn-space-1) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--corn-space-2); }
|
|
475
515
|
.hx-mockup-item { display: flex; flex-wrap: wrap; align-items: center; gap: var(--corn-space-1) var(--corn-space-3); }
|
|
@@ -516,8 +556,7 @@ button.hx-proposal-item:focus-visible { outline: var(--corn-focus-width) solid v
|
|
|
516
556
|
.hx-proposal-bar { max-height: 50dvh; overflow-y: auto; padding: 0 var(--corn-space-4) var(--corn-space-3); }
|
|
517
557
|
.hx-proposal-bar[data-sheet-state="peek"] > :not(.hx-sheet-handle):not(#proposal-message):not(#proposal-body),
|
|
518
558
|
.hx-proposal-bar[data-sheet-state="peek"] #proposal-body > :not(.hx-proposal-head),
|
|
519
|
-
.hx-proposal-bar[data-sheet-state="peek"] .hx-proposal-head > :
|
|
520
|
-
.hx-proposal-bar[data-sheet-state="peek"] .hx-proposal-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
559
|
+
.hx-proposal-bar[data-sheet-state="peek"] .hx-proposal-head > :is(.hx-proposal-tools, .hx-proposal-more, .hx-proposal-more-menu, .hx-review) { display: none; }
|
|
521
560
|
.hx-proposal-bar[data-sheet-state="expanded"] .hx-scenarios, .hx-proposal-bar[data-sheet-state="expanded"] .hx-proposal-changes, .hx-proposal-bar[data-sheet-state="expanded"] .hx-whatif-panel { max-height: none; overflow: visible; }
|
|
522
561
|
|
|
523
562
|
/* The scenario player: the title, then the step counter and its text on two lines */
|
|
@@ -530,9 +569,7 @@ button.hx-proposal-item:focus-visible { outline: var(--corn-focus-width) solid v
|
|
|
530
569
|
.hx-drawer { max-height: 60dvh; }
|
|
531
570
|
.hx-drawer[data-sheet-state="peek"] .hx-drawer-body { flex: none; padding: 0 var(--corn-space-5) var(--corn-space-3); gap: 0; overflow: hidden; }
|
|
532
571
|
.hx-drawer[data-sheet-state="peek"] .hx-drawer-body > :not(.hx-drawer-head), .hx-drawer[data-sheet-state="peek"] .hx-drawer-foot { display: none; }
|
|
533
|
-
.hx-drawer[data-sheet-state="peek"] .hx-drawer-head { padding-bottom: 0; border-bottom: 0; }
|
|
534
572
|
.hx-drawer[data-sheet-state="peek"] .hx-drawer-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
535
|
-
.hx-drawer[data-sheet-state="peek"] .hx-drawer-title-wrap { flex: 1; }
|
|
536
573
|
}
|
|
537
574
|
|
|
538
575
|
@media (prefers-reduced-motion: reduce) {
|
|
@@ -784,7 +821,7 @@ a.hx-forge-row:hover, button.hx-forge-row:hover { background: var(--corn-surface
|
|
|
784
821
|
.hx-forge-runs { display: flex; flex-direction: column; gap: var(--corn-space-2); margin: var(--corn-space-1) 0 var(--corn-space-3); }
|
|
785
822
|
.hx-forge-runs[hidden] { display: none; }
|
|
786
823
|
|
|
787
|
-
/* Threads (forge-panel.js, docs/threads.md): messages as written, read-only; a node's "
|
|
824
|
+
/* Threads (forge-panel.js, docs/threads.md): messages as written, read-only; a node's "Threads" opens one */
|
|
788
825
|
.hx-thread-msgs { display: flex; flex-direction: column; gap: var(--corn-space-3); margin: 0; padding: 0; list-style: none; }
|
|
789
826
|
.hx-thread-msg { display: flex; flex-direction: column; gap: var(--corn-space-1); padding: var(--corn-space-3) var(--corn-space-3); border: var(--corn-border) solid var(--corn-line); border-radius: var(--corn-radius); background: var(--corn-surface-2); }
|
|
790
827
|
.hx-thread-body { margin: 0; color: var(--corn-text); line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; }
|
|
@@ -838,3 +875,58 @@ a.hx-forge-row:hover, button.hx-forge-row:hover { background: var(--corn-surface
|
|
|
838
875
|
|
|
839
876
|
/* theme.pixelated (docs/config.md#theme): small pixel-art images are sampled without smoothing, in the page as on the map (map-style.js) */
|
|
840
877
|
:root[data-pixelated] img { image-rendering: pixelated; }
|
|
878
|
+
|
|
879
|
+
/* ---- the node panel (panels.js, #138): type · name · one line · facts · mockups · threads · the diff · the actions ------------ */
|
|
880
|
+
.hx-drawer-id { flex: 1; min-width: 0; }
|
|
881
|
+
.hx-kicker { display: flex; flex-wrap: wrap; align-items: center; margin: 0 0 var(--corn-space-2); font-size: var(--corn-text-sm); color: var(--corn-text-3); }
|
|
882
|
+
.hx-diffpill { margin-left: var(--corn-space-3); padding: 0 var(--corn-space-3); border-radius: var(--corn-radius-pill); border: var(--corn-border) dashed var(--corn-added); color: var(--corn-added-text); font-size: var(--corn-text-xs); }
|
|
883
|
+
.hx-drawer-id .hx-drawer-title { font-size: var(--corn-text-xl); font-weight: 650; letter-spacing: -0.01em; line-height: 1.25; }
|
|
884
|
+
.hx-drawer-id .hx-drawer-title.hx-mono { font-family: var(--corn-mono); }
|
|
885
|
+
.hx-facts { display: flex; flex-direction: column; gap: var(--corn-space-2); }
|
|
886
|
+
.hx-fact { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: var(--corn-space-4); }
|
|
887
|
+
.hx-fact-k { color: var(--corn-text-3); }
|
|
888
|
+
.hx-fact-v { min-width: 0; color: var(--corn-text); }
|
|
889
|
+
.hx-fact-v .hx-line { padding: 0; }
|
|
890
|
+
.hx-fact-v .hx-name { color: var(--corn-text); }
|
|
891
|
+
.hx-fact-v .hx-code { color: var(--corn-text-2); font-size: var(--corn-text-sm); }
|
|
892
|
+
.hx-fact-v .hx-chips { padding-top: 0; }
|
|
893
|
+
.hx-sec-block { display: flex; flex-direction: column; gap: var(--corn-space-3); }
|
|
894
|
+
.hx-sec-title { margin: 0; font-size: var(--corn-text-sm); font-weight: 600; color: var(--corn-text-3); }
|
|
895
|
+
.hx-drawer .hx-mockups { margin: 0; padding: 0; border: 0; }
|
|
896
|
+
.hx-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--corn-space-2); }
|
|
897
|
+
.hx-row { display: flex; align-items: center; gap: var(--corn-space-4); width: 100%; min-height: 36px; padding: var(--corn-space-3) var(--corn-space-4); border: var(--corn-border) solid var(--corn-line); border-radius: var(--corn-radius-sm); background: var(--corn-surface-2); color: var(--corn-text); font: inherit; text-align: left; }
|
|
898
|
+
.hx-row:hover { background: var(--corn-accent-soft); }
|
|
899
|
+
.hx-row:focus-visible { outline: var(--corn-focus-width) solid var(--corn-focus); outline-offset: 2px; }
|
|
900
|
+
.hx-row-title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
|
|
901
|
+
.hx-row-meta { flex: none; font-size: var(--corn-text-sm); color: var(--corn-text-3); font-variant-numeric: tabular-nums; }
|
|
902
|
+
.hx-drawer .hx-mockup-list { margin: var(--corn-space-3) 0 0; }
|
|
903
|
+
.hx-drawer .hx-mockup-item { flex-wrap: nowrap; gap: var(--corn-space-4); padding: var(--corn-space-1) var(--corn-space-1) var(--corn-space-1) 0; border: var(--corn-border) solid var(--corn-line); border-radius: var(--corn-radius-sm); background: var(--corn-surface-2); }
|
|
904
|
+
.hx-drawer .hx-mockup-open { flex: 1; min-width: 0; min-height: 36px; border: 0; background: none; color: var(--corn-text); font-weight: 400; }
|
|
905
|
+
.hx-drawer .hx-mockup-state { flex: none; padding-right: var(--corn-space-3); color: var(--corn-text-3); }
|
|
906
|
+
.hx-drawer .hx-mockup-state--approved { color: var(--corn-added-text); }
|
|
907
|
+
.hx-drawer .hx-mockup-state--changed { color: var(--corn-warn); }
|
|
908
|
+
.hx-drawer .hx-mockup-state--missing { color: var(--corn-bad); }
|
|
909
|
+
.hx-textact { align-self: flex-start; background: none; border: 0; padding-left: 0; }
|
|
910
|
+
.hx-diff { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: var(--corn-space-1) var(--corn-space-4); padding: var(--corn-space-1) 0 var(--corn-space-1) var(--corn-space-4); border-left: var(--corn-border-strong) solid var(--corn-changed); font-family: var(--corn-mono); font-size: var(--corn-text-sm); color: var(--corn-text-2); }
|
|
911
|
+
.hx-diff--added { border-left-color: var(--corn-added); }
|
|
912
|
+
.hx-diff--removed { border-left-color: var(--corn-removed); }
|
|
913
|
+
.hx-diff--edit { border-left-color: var(--corn-edit); }
|
|
914
|
+
.hx-diff-k { color: var(--corn-text-3); }
|
|
915
|
+
.hx-diff-v { min-width: 0; overflow-wrap: anywhere; }
|
|
916
|
+
.hx-drawer .hx-why { margin: 0; }
|
|
917
|
+
.hx-drawer-foot .hx-open[hidden], .hx-drawer-foot .hx-foot-btn[hidden] { display: none; }
|
|
918
|
+
.hx-foot-btn { min-height: 36px; padding: 0 var(--corn-space-4); justify-content: center; }
|
|
919
|
+
@media (max-width: 767px) {
|
|
920
|
+
/* a phone: the sheet's actions are full width at the foot, each a 44px target */
|
|
921
|
+
.hx-drawer-foot { flex-direction: column; }
|
|
922
|
+
.hx-drawer-foot .hx-open, .hx-foot-btn { min-height: 44px; }
|
|
923
|
+
.hx-drawer .hx-row, .hx-drawer .hx-mockup-open, .hx-textact { min-height: 44px; }
|
|
924
|
+
.hx-drawer .hx-close { width: 44px; height: 44px; }
|
|
925
|
+
}
|
|
926
|
+
.hx-drawer .hx-whatif-drawer { font-size: var(--corn-text-md); color: var(--corn-text-2); }
|
|
927
|
+
.hx-drawer .hx-whatif-drawer select { max-width: 100%; }
|
|
928
|
+
.hx-drawer-foot .hx-btn--quiet { border-color: transparent; background: none; }
|
|
929
|
+
.hx-more { display: contents; }
|
|
930
|
+
.hx-more[hidden] { display: none; }
|
|
931
|
+
.hx-more-btn { display: block; margin-top: var(--corn-space-1); min-height: 0; padding: 0; font-size: var(--corn-text-sm); }
|
|
932
|
+
@media (max-width: 767px) { .hx-more-btn { min-height: 44px; } }
|
package/explorer/flows.js
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
import { state, nameOf, escHtml } from './state.js';
|
|
16
16
|
import { themed } from './theme-model.js';
|
|
17
|
+
import { capped } from './capped.js';
|
|
17
18
|
|
|
18
19
|
export const FLOW_STYLES = {
|
|
19
20
|
outbox: { color: '#f59e0b', label: 'Outbox → API (writes)' },
|
|
@@ -148,11 +149,8 @@ export function renderFlowLegend() {
|
|
|
148
149
|
|
|
149
150
|
export function flowSummary(node) {
|
|
150
151
|
const flows = state.edges.filter((e) => e.kind === 'flow' && (e.from === node.id || e.to === node.id));
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
const s = FLOW_STYLES[e.flow] || FLOW_STYLES.sync;
|
|
156
|
-
return `<div class="hx-line"><span class="hx-glyph" style="--glyph:${s.color}">${out ? '→' : '←'}</span><span><span class="hx-name">${escHtml(nameOf(out ? e.to : e.from))}</span> · ${escHtml(e.label)}${e.status === 'live' ? '' : ' <span class="hx-warn">(proposed)</span>'}</span></div>`;
|
|
157
|
-
}).join('')}</div>`;
|
|
152
|
+
const fact = (key, list, out) => (list.length
|
|
153
|
+
? `<div class="hx-fact" data-corn="section"><div class="hx-fact-k">${key}</div><div class="hx-fact-v">${capped(list.map((e) => `<div class="hx-line"><span><span class="hx-name">${escHtml(nameOf(out ? e.to : e.from))}</span> · ${escHtml(e.label)}${e.status === 'live' ? '' : ' <span class="hx-warn">(proposed)</span>'}</span></div>`))}</div></div>`
|
|
154
|
+
: '');
|
|
155
|
+
return fact('Sends to', flows.filter((e) => e.from === node.id), true) + fact('Gets from', flows.filter((e) => e.to === node.id && e.from !== node.id), false);
|
|
158
156
|
}
|
package/explorer/forge-panel.js
CHANGED
|
@@ -627,7 +627,7 @@ async function afterIdea(res) {
|
|
|
627
627
|
const shown = ui.thread === n && ui.threadDetail && ui.threadDetail.thread ? ` ${threadSelectionWords()}` : ui.thread === n && ui.threadError ? ` ${ui.threadError}` : '';
|
|
628
628
|
// Opened from a node: say that its "Mentioned in" lists the new thread
|
|
629
629
|
const listed = about && (threadsFor(about.id) || []).some((t) => t.number === n);
|
|
630
|
-
announce(`${ui.idea.message}${shown}${listed ? ` It is listed under
|
|
630
|
+
announce(`${ui.idea.message}${shown}${listed ? ` It is listed under Threads for ${about.label}.` : ''}${trouble}`);
|
|
631
631
|
}
|
|
632
632
|
|
|
633
633
|
/** The New idea bar and form, from `ui.idea`; typed text and the focus are left alone */
|
|
@@ -1561,7 +1561,7 @@ function closeAgent({ restoreFocus = true } = {}) {
|
|
|
1561
1561
|
el.hidden = true;
|
|
1562
1562
|
document.removeEventListener('focusin', keepFocusInAgent);
|
|
1563
1563
|
if (!restoreFocus) return;
|
|
1564
|
-
const back =
|
|
1564
|
+
const back = document.querySelector(opener) || $('forge-title'); // the node panel's Start a run is an opener too
|
|
1565
1565
|
if (back && !back.disabled) back.focus();
|
|
1566
1566
|
}
|
|
1567
1567
|
|
|
@@ -1787,10 +1787,13 @@ async function issueNotListed(n) {
|
|
|
1787
1787
|
return linkMissing(res.status === 404 ? `There is no issue ${n}.` : errorWords(res.status, res.body));
|
|
1788
1788
|
}
|
|
1789
1789
|
|
|
1790
|
+
/** Whether the Start dialog can open now: the server runs agents and the page has the dialog (the node panel's "Start a run" asks) */
|
|
1791
|
+
export const canStartAgent = () => !!(ui.config && ui.config.agents && agentEl());
|
|
1792
|
+
|
|
1790
1793
|
/** `?proposal=<slug>&start=1`: the Start dialog on that proposal (the proposal itself is opened by proposal.js) */
|
|
1791
|
-
export async function openProposalStart(slug) {
|
|
1794
|
+
export async function openProposalStart(slug, opener = '#forge-title') {
|
|
1792
1795
|
if (!ui.config || !agentEl()) return false;
|
|
1793
|
-
await openAgent(`proposal:${slug}`,
|
|
1796
|
+
await openAgent(`proposal:${slug}`, opener);
|
|
1794
1797
|
return !!ui.agent;
|
|
1795
1798
|
}
|
|
1796
1799
|
|
package/explorer/index.html
CHANGED
|
@@ -193,19 +193,35 @@
|
|
|
193
193
|
|
|
194
194
|
<!-- Below 768px the proposal bar, the scenario player and the node panel stack here as bottom sheets (sheets.js); from 768px the dock is display: contents -->
|
|
195
195
|
<div id="sheet-dock" class="hx-dock" data-corn="dock">
|
|
196
|
-
<!-- The open proposal: counts, Before / Diff / After,
|
|
196
|
+
<!-- The open proposal, a toolbar: title, counts, Before / Diff / After, Play, Edit, Send back, Approve, ⋯ (proposal.js, review.js, whatif.js, scenario-ui.js) -->
|
|
197
197
|
<section id="proposal-bar" class="hx-proposal-bar glass" aria-label="Open proposal" hidden data-corn="proposal-bar">
|
|
198
198
|
<p id="proposal-message" class="hx-proposal-message" role="status" hidden></p>
|
|
199
199
|
<div id="proposal-body">
|
|
200
|
-
<div class="hx-proposal-head">
|
|
200
|
+
<div class="hx-proposal-head" role="group" aria-label="Proposal actions">
|
|
201
201
|
<strong id="proposal-title" class="hx-proposal-name"></strong>
|
|
202
|
-
<
|
|
203
|
-
|
|
202
|
+
<div class="hx-proposal-counts">
|
|
203
|
+
<button type="button" id="proposal-chip" class="hx-proposal-chip" data-action="toggle-proposal-changes" aria-expanded="false"></button>
|
|
204
|
+
<button type="button" id="proposal-mode" class="hx-proposal-mode" data-action="toggle-proposal-mode" data-peek-ok aria-expanded="false" aria-controls="proposal-seg" title="Before, Diff or After"></button>
|
|
205
|
+
</div>
|
|
206
|
+
<div id="proposal-seg" class="hx-seg" role="group" aria-label="Compare">
|
|
204
207
|
<button type="button" class="hx-seg-btn" data-action="proposal-view" data-view="before" aria-pressed="false" data-corn-string="before">Before</button>
|
|
205
208
|
<button type="button" class="hx-seg-btn" data-action="proposal-view" data-view="diff" aria-pressed="true" data-corn-string="diff">Diff</button>
|
|
206
209
|
<button type="button" class="hx-seg-btn" data-action="proposal-view" data-view="after" aria-pressed="false" data-corn-string="after">After</button>
|
|
207
210
|
</div>
|
|
208
|
-
<
|
|
211
|
+
<div class="hx-proposal-tools">
|
|
212
|
+
<button type="button" id="proposal-play" class="hx-btn" aria-expanded="false" aria-controls="proposal-scenarios" title="Play one of this proposal's scenarios on the map" hidden>Play</button>
|
|
213
|
+
<button type="button" id="proposal-edit" class="hx-btn" aria-expanded="false" aria-controls="whatif" title="Try a change: add a node or an edge, reword a scenario">Edit</button>
|
|
214
|
+
</div>
|
|
215
|
+
<div class="hx-proposal-actions">
|
|
216
|
+
<button type="button" class="hx-btn" data-review="notes" data-peek-ok title="Send it back to the drafting agent with a note and your edits" data-corn-string="sendBack">Send back</button>
|
|
217
|
+
<button type="button" class="hx-btn hx-btn--approve" data-review="approved" data-peek-ok title="Sign this proposal off" data-corn-kind="approve" data-corn-string="approve">Approve</button>
|
|
218
|
+
</div>
|
|
219
|
+
<div class="hx-proposal-more">
|
|
220
|
+
<button type="button" id="proposal-more" class="hx-btn hx-btn--icon" data-action="toggle-proposal-more" aria-haspopup="menu" aria-expanded="false" aria-controls="proposal-more-menu" aria-label="More" data-corn-kind="icon"><svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><circle cx="3" cy="8" r="1.5"/><circle cx="8" cy="8" r="1.5"/><circle cx="13" cy="8" r="1.5"/></svg></button>
|
|
221
|
+
<div id="proposal-more-menu" class="hx-proposal-more-menu glass" role="menu" aria-label="More" hidden>
|
|
222
|
+
<button type="button" role="menuitem" class="hx-btn hx-btn--quiet" data-action="close-proposal" title="Close the proposal and go back to the map" data-corn-kind="quiet" data-corn-string="closeProposal">Close</button>
|
|
223
|
+
</div>
|
|
224
|
+
</div>
|
|
209
225
|
</div>
|
|
210
226
|
<p id="proposal-summary" class="hx-proposal-summary" hidden></p>
|
|
211
227
|
<details id="proposal-errors" class="hx-proposal-errors" hidden>
|
|
@@ -305,29 +321,24 @@
|
|
|
305
321
|
<aside id="spec-drawer" class="hx-drawer glass" aria-label="Node details" inert data-corn="node-panel">
|
|
306
322
|
<div class="hx-drawer-body">
|
|
307
323
|
<div class="hx-drawer-head">
|
|
308
|
-
<
|
|
309
|
-
<
|
|
324
|
+
<div class="hx-drawer-id">
|
|
325
|
+
<p class="hx-kicker"><span id="drawer-badge" data-corn="badge">Atom</span><span id="drawer-host"></span><span id="drawer-diff" class="hx-diffpill" hidden></span></p>
|
|
310
326
|
<h2 id="drawer-title" class="hx-drawer-title"><pop-button></h2>
|
|
311
|
-
</
|
|
327
|
+
</div>
|
|
312
328
|
<button type="button" class="hx-close" data-action="close-drawer" aria-label="Close" data-corn-kind="icon">✕</button>
|
|
313
329
|
</div>
|
|
314
330
|
|
|
315
|
-
<p id="drawer-description" class="hx-
|
|
316
|
-
|
|
317
|
-
<div class="hx-block">
|
|
318
|
-
<h3 class="hx-block-title" data-corn-string="propsTitle">Properties & Attributes</h3>
|
|
319
|
-
<div id="drawer-props-list" class="hx-props"></div>
|
|
320
|
-
</div>
|
|
331
|
+
<p id="drawer-description" class="hx-lead" hidden></p>
|
|
321
332
|
|
|
322
333
|
<div class="hx-block">
|
|
323
|
-
<h3 class="hx-block-title" data-corn-string="detailsTitle">Details</h3>
|
|
324
334
|
<div id="drawer-meta-list" class="hx-meta"></div>
|
|
325
335
|
</div>
|
|
326
336
|
</div>
|
|
327
337
|
|
|
328
338
|
<div class="hx-drawer-foot">
|
|
329
|
-
<a id="drawer-open-btn" class="hx-open" href="#" target="_blank" rel="noreferrer">Open ↗</a>
|
|
330
|
-
<button type="button" class="hx-btn hx-btn
|
|
339
|
+
<a id="drawer-open-btn" class="hx-open" href="#" target="_blank" rel="noreferrer" hidden>Open route ↗</a>
|
|
340
|
+
<button type="button" id="drawer-run-btn" class="hx-btn hx-foot-btn" data-action="start-run" data-corn-string="startRun" hidden>Start a run</button>
|
|
341
|
+
<button type="button" class="hx-btn hx-btn--quiet hx-foot-btn" data-action="copy-spec" data-corn-string="copySpec">Copy Spec</button>
|
|
331
342
|
</div>
|
|
332
343
|
</aside>
|
|
333
344
|
</div>
|
package/explorer/main.js
CHANGED
|
@@ -28,7 +28,7 @@ import { render, resize, zoomBy, fitGraphToViewport, fitPadding, isNodeVisible,
|
|
|
28
28
|
import { createRenderer } from './renderer.js';
|
|
29
29
|
import { clearFreeformPositions, layoutOrbit, loadFreeformPositions } from './layout.js';
|
|
30
30
|
import { closeLegendMenu, toggleAllLayers, toggleLayer, toggleLegendMenu } from './layers.js';
|
|
31
|
-
import { closeDrawer, copySpec, selectNode } from './panels.js';
|
|
31
|
+
import { closeDrawer, copySpec, selectNode, startRun } from './panels.js';
|
|
32
32
|
import { initScenarioUi, maybeStartDemo, playOutage } from './scenario-ui.js';
|
|
33
33
|
import { initSheets } from './sheets.js';
|
|
34
34
|
import { loadTopology, setView, syncViewUi } from './view.js';
|
|
@@ -134,6 +134,7 @@ const ACTIONS = {
|
|
|
134
134
|
'clear-search': () => handleSearch(''),
|
|
135
135
|
'close-drawer': () => closeDrawer(),
|
|
136
136
|
'copy-spec': (el) => copySpec(el),
|
|
137
|
+
'start-run': () => startRun(),
|
|
137
138
|
'select-node': (el) => selectNode(nodeById(el.dataset.id)),
|
|
138
139
|
'play-outage': (el) => playOutage(el.dataset.id), // the cloud panel's Play button (spec 0031 section 8)
|
|
139
140
|
'retry': () => loadTopology(),
|
|
@@ -61,7 +61,7 @@ export function mockupsSectionHtml(items) {
|
|
|
61
61
|
<span class="hx-mockup-state hx-mockup-state--${escHtml(m.state)}" data-corn="state-pill"${cornStateAttr(m.state)}>${escHtml(stateWords(m.state))}</span>
|
|
62
62
|
</li>`).join('');
|
|
63
63
|
return `<div class="hx-sec hx-mockups" data-mockups data-corn="section">
|
|
64
|
-
<
|
|
64
|
+
<h3 class="hx-sec-title" id="hx-mockups-h">${items.length === 1 ? 'Mockup' : 'Mockups'}</h3>
|
|
65
65
|
<ul class="hx-mockup-list" aria-labelledby="hx-mockups-h">${rows}</ul>
|
|
66
66
|
</div>`;
|
|
67
67
|
}
|