@popcorn245/cornfield 0.36.0 → 0.37.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/explorer/capped.js +1 -1
- package/explorer/check.js +3 -2
- package/explorer/cloud-model.js +1 -1
- package/explorer/corn-state.js +20 -2
- package/explorer/explorer.css +6 -1
- package/explorer/flows.js +5 -5
- package/explorer/forge-panel.js +43 -37
- package/explorer/house.js +6 -6
- package/explorer/index.html +100 -100
- package/explorer/layers.js +4 -4
- package/explorer/live-model.js +1 -1
- package/explorer/live.js +8 -5
- package/explorer/mockups-model.js +1 -1
- package/explorer/mockups.js +2 -0
- package/explorer/panels.js +7 -3
- package/explorer/plugins.js +1 -1
- package/explorer/proposal-model.js +4 -3
- package/explorer/proposal.js +8 -7
- package/explorer/review.js +2 -2
- package/explorer/runs-view.js +21 -13
- package/explorer/scenario-ui.js +5 -4
- package/explorer/sheets.js +1 -1
- package/explorer/whatif.js +42 -41
- package/package.json +1 -1
package/explorer/capped.js
CHANGED
|
@@ -17,7 +17,7 @@ export function capped(items) {
|
|
|
17
17
|
if (items.length <= CAP + 1) return items.join(''); // "and 1 more" saves nothing
|
|
18
18
|
const id = `hx-more-${++counter}`;
|
|
19
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>`;
|
|
20
|
+
return `${items.slice(0, CAP).join('')}<div class="hx-more" id="${id}" hidden>${items.slice(CAP).join('')}</div><button data-corn="more" data-corn-kind="quiet" 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
21
|
}
|
|
22
22
|
|
|
23
23
|
/** Opens or folds the list a "more" button belongs to; true when the click was one */
|
package/explorer/check.js
CHANGED
|
@@ -135,6 +135,7 @@ function mountControls(bar) {
|
|
|
135
135
|
|
|
136
136
|
const line = document.createElement('p');
|
|
137
137
|
line.className = 'hx-player-check';
|
|
138
|
+
line.dataset.corn = 'scenario-check';
|
|
138
139
|
line.setAttribute('aria-live', 'polite');
|
|
139
140
|
line.hidden = true;
|
|
140
141
|
const text = bar.querySelector('.hx-player-text');
|
|
@@ -143,8 +144,8 @@ function mountControls(bar) {
|
|
|
143
144
|
const row = document.createElement('div');
|
|
144
145
|
row.className = 'hx-player-as';
|
|
145
146
|
row.innerHTML = `
|
|
146
|
-
<label class="hx-player-as-label">As <select class="hx-player-speed hx-player-as-menu" data-check="as" aria-label="Act every step as"></select></label>
|
|
147
|
-
<button type="button" class="hx-btn" data-check="recheck">Check again</button>
|
|
147
|
+
<label class="hx-player-as-label">As <select data-corn="control" class="hx-player-speed hx-player-as-menu" data-check="as" aria-label="Act every step as"></select></label>
|
|
148
|
+
<button data-corn-kind="secondary" type="button" class="hx-btn" data-check="recheck">Check again</button>
|
|
148
149
|
<span class="hx-player-as-sum hx-faint"></span>`;
|
|
149
150
|
const controls = bar.querySelector('.hx-player-controls');
|
|
150
151
|
if (controls) controls.after(row); else bar.appendChild(row);
|
package/explorer/cloud-model.js
CHANGED
|
@@ -102,7 +102,7 @@ function userRow(item, mixed) {
|
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
/** The Play button (spec 0031 section 8, CLOUD-07): main.js plays outage-model.js `outageScenario` for the node. A quiet button under the facts. */
|
|
105
|
-
const playButton = (node) => `<button type="button" class="hx-btn hx-btn--quiet hx-cloud-play" data-action="play-outage" data-id="${esc(node.id)}">Play: ${esc(String(node.label || node.id))} is down</button>`;
|
|
105
|
+
const playButton = (node) => `<button data-corn-kind="quiet" type="button" class="hx-btn hx-btn--quiet hx-cloud-play" data-action="play-outage" data-id="${esc(node.id)}">Play: ${esc(String(node.label || node.id))} is down</button>`;
|
|
106
106
|
|
|
107
107
|
/**
|
|
108
108
|
* The node panel's facts for a cloud node (kind `cloud`) or the public web (kind `web`), in the node panel's key/value
|
package/explorer/corn-state.js
CHANGED
|
@@ -5,7 +5,10 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
/** Every value `data-corn-state` can take */
|
|
8
|
-
export const CORN_STATES = Object.freeze(['open', 'merged', 'closed', 'draft', 'queued', 'running', 'requested', 'claimed', 'working', 'waiting', 'done', 'failed', 'stopped', 'success', 'failure']);
|
|
8
|
+
export const CORN_STATES = Object.freeze(['open', 'merged', 'closed', 'draft', 'queued', 'running', 'requested', 'claimed', 'working', 'waiting', 'done', 'failed', 'stopped', 'success', 'failure', 'added', 'changed', 'removed', 'edit']);
|
|
9
|
+
|
|
10
|
+
/** The four marks of a proposal's diff (the map's rings, the panel's pill and dots): a mark is not a status, so `changed` here is a change a proposal makes, never a mockup that changed */
|
|
11
|
+
export const MARK_STATES = Object.freeze(['added', 'changed', 'removed', 'edit']);
|
|
9
12
|
|
|
10
13
|
/** The seven states of an agent run, in the order of its life: each has its own `data-corn-state`, colour token (`--corn-run-<state>`) and icon */
|
|
11
14
|
export const RUN_STATES = Object.freeze(['requested', 'claimed', 'working', 'waiting', 'done', 'failed', 'stopped']);
|
|
@@ -23,12 +26,27 @@ const WORDS = Object.freeze({
|
|
|
23
26
|
allowed: 'success', refused: 'failure', mismatch: 'failure', pending: 'running',
|
|
24
27
|
// A notice that went well, a message about a problem
|
|
25
28
|
ok: 'success', bad: 'failure',
|
|
29
|
+
// The live layer's chip: fresh, as of a while ago, off, unavailable, loading
|
|
30
|
+
stale: 'waiting', off: 'stopped', error: 'failure', idle: 'running',
|
|
26
31
|
});
|
|
27
32
|
|
|
28
33
|
/** The public state for an internal word, or '' when it has none */
|
|
29
34
|
export function cornState(word) {
|
|
30
35
|
const w = String(word || '');
|
|
31
|
-
|
|
36
|
+
// The table first: `changed` is a mockup that changed since it was reviewed (waiting) here, and only a proposal's mark in markState()
|
|
37
|
+
return WORDS[w] || (CORN_STATES.includes(w) && !MARK_STATES.includes(w) ? w : '');
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** The public state of a proposal mark (`added`, `changed`, `removed` or `edit`), or '' for anything else, `none` included */
|
|
41
|
+
export function markState(mark) {
|
|
42
|
+
const m = String(mark || '');
|
|
43
|
+
return MARK_STATES.includes(m) ? m : '';
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** The `data-corn-state` attribute of a proposal mark for markup (with its leading space), or nothing when it has none */
|
|
47
|
+
export function markStateAttr(mark) {
|
|
48
|
+
const s = markState(mark);
|
|
49
|
+
return s ? ` data-corn-state="${s}"` : '';
|
|
32
50
|
}
|
|
33
51
|
|
|
34
52
|
/** The `data-corn-state` attribute for markup (with its leading space), or nothing when the word has no public state */
|
package/explorer/explorer.css
CHANGED
|
@@ -621,7 +621,9 @@ button.hx-proposal-item:focus-visible { outline: var(--corn-focus-width) solid v
|
|
|
621
621
|
.hx-sheet-handle span { width: 40px; height: 5px; border-radius: var(--corn-radius-pill); background: var(--corn-surface-3); }
|
|
622
622
|
.hx-sheet-handle:focus-visible { outline: var(--corn-focus-width) solid var(--corn-focus); outline-offset: calc(var(--corn-focus-width) * -1); border-radius: var(--corn-radius); }
|
|
623
623
|
.hx-backdrop { display: none; }
|
|
624
|
-
|
|
624
|
+
/* With the node panel expanded the backdrop stays as the tap that closes it, but draws nothing: the map above the sheet is the free band the
|
|
625
|
+
selected node was panned into (camera.js panIntoView), and a scrim or blur over it hides that node (issue #180) */
|
|
626
|
+
.hx-stage[data-sheet-open="drawer"] .hx-backdrop:not([hidden]) { display: block; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
|
|
625
627
|
|
|
626
628
|
/* The proposal bar */
|
|
627
629
|
.hx-proposal-bar { max-height: 50dvh; overflow-y: auto; padding: 0 var(--corn-space-4) var(--corn-space-3); }
|
|
@@ -757,6 +759,8 @@ button.hx-proposal-item:focus-visible { outline: var(--corn-focus-width) solid v
|
|
|
757
759
|
.hx-forge-tab:focus-visible, .hx-forge-chip:focus-visible, .hx-forge-back:focus-visible { outline: var(--corn-focus-width) solid var(--corn-focus); outline-offset: calc(var(--corn-focus-width) * -1); }
|
|
758
760
|
.hx-forge-count { color: var(--corn-text-3); font-size: var(--corn-text-xs); font-weight: 500; }
|
|
759
761
|
.hx-forge-count[hidden] { display: none; }
|
|
762
|
+
/* A tab's count holds its width before it is read, so the tabs do not move when the counts arrive (issue #192): it is empty, not hidden; Deploys has none and keeps `hidden` */
|
|
763
|
+
.hx-forge-tab .hx-forge-count { display: inline-block; min-width: 2ch; }
|
|
760
764
|
/* The status line and the Filter chip; the focus is put on the title (a heading, tabindex -1) when the panel opens, so it shows no ring */
|
|
761
765
|
.hx-forge-body > * { flex-shrink: 0; } /* a tall detail scrolls the body; it must not squash the tabs */
|
|
762
766
|
.hx-forge .hx-drawer-title:focus-visible, .hx-forge-notes-title:focus-visible { outline: none; }
|
|
@@ -1134,6 +1138,7 @@ a.hx-proposal-source:focus-visible { outline: var(--corn-focus-width) solid var(
|
|
|
1134
1138
|
.hx-forge-skeleton { display: flex; flex-direction: column; gap: var(--corn-space-2); min-height: 64px; padding: var(--corn-space-3); border: var(--corn-border) solid var(--corn-line-soft); border-radius: var(--corn-radius); list-style: none; }
|
|
1135
1139
|
.hx-forge-skeleton > span { display: block; height: 10px; border-radius: var(--corn-radius-sm); background: var(--corn-surface-3); }
|
|
1136
1140
|
.hx-forge-skeleton > span:last-child { width: 55%; }
|
|
1141
|
+
.hx-forge-skeleton-line > span { display: inline-block; width: 55%; height: 10px; vertical-align: middle; border-radius: var(--corn-radius-sm); background: var(--corn-surface-3); } /* one line of the runner line or the totals, while they load */
|
|
1137
1142
|
.hx-forge-empty { line-height: 1.5; }
|
|
1138
1143
|
|
|
1139
1144
|
/* The panel's title row and tabs stay in place while a list scrolls; the body's padding is taken up by the top so nothing shows above it */
|
package/explorer/flows.js
CHANGED
|
@@ -137,13 +137,13 @@ export function renderFlowLegend() {
|
|
|
137
137
|
el.hidden = false;
|
|
138
138
|
const row = (swatch, text) => `<div class="hx-legend-row"><span class="hx-legend-swatch">${swatch}</span><span>${text}</span></div>`;
|
|
139
139
|
el.innerHTML = `
|
|
140
|
-
<div class="hx-menu-section">
|
|
141
|
-
<div class="hx-menu-title">
|
|
140
|
+
<div class="hx-menu-section" data-corn="menu-section">
|
|
141
|
+
<div class="hx-menu-title" data-corn="menu-title">
|
|
142
142
|
<span>Data Flow</span>
|
|
143
143
|
</div>
|
|
144
|
-
${Object.values(FLOW_STYLES).map((s) => row(`<span class="hx-swatch-line" style="background:${themed(s.color, state.theme)}"></span>`, s.label)).join('')}
|
|
145
|
-
${row('<span class="hx-swatch-line hx-swatch-solid"></span>', '<span class="hx-faint">Solid: live today</span>')}
|
|
146
|
-
${row('<span class="hx-swatch-line hx-swatch-dashed"></span>', '<span class="hx-faint">Dashed: proposed</span>')}
|
|
144
|
+
${Object.values(FLOW_STYLES).map((s) => row(`<span data-corn="swatch" class="hx-swatch-line" style="background:${themed(s.color, state.theme)}"></span>`, s.label)).join('')}
|
|
145
|
+
${row('<span data-corn="swatch" class="hx-swatch-line hx-swatch-solid"></span>', '<span class="hx-faint">Solid: live today</span>')}
|
|
146
|
+
${row('<span data-corn="swatch" class="hx-swatch-line hx-swatch-dashed"></span>', '<span class="hx-faint">Dashed: proposed</span>')}
|
|
147
147
|
</div>`;
|
|
148
148
|
}
|
|
149
149
|
|
package/explorer/forge-panel.js
CHANGED
|
@@ -78,7 +78,7 @@ import { WORK_URL, groupWork, filterGroups, groupWords, workStatus, markWords }
|
|
|
78
78
|
import {
|
|
79
79
|
RUNS_URL, runsUrl, stopUrl, runOnThread, threadRunWords, runOnPull, pullRunWords, canRetry, retryRefs, retryWords, limitsFromFields, defaultLimits, LIMIT_KEYS, briefUrl, answerUrl, answerBody, answerWordsFor, KINDS, aboutWords, statusWords, statusWhy, runMeta, canStop, runsStatus, runnerState, runnerWords, triggerNotice, totalsLines, handLines, startBody, startWords, stopWords, confirmStartWords, litOfRun, changeWords,
|
|
80
80
|
} from './runs-model.js';
|
|
81
|
-
import { runsHtml, totalsHtml, loadingRowsHtml, runPillHtml } from './runs-view.js';
|
|
81
|
+
import { runsHtml, totalsHtml, loadingRowsHtml, loadingLinesHtml, runPillHtml } from './runs-view.js';
|
|
82
82
|
import { setRunsOnMap, clearRunsOnMap } from './runs-map.js';
|
|
83
83
|
import {
|
|
84
84
|
STATES, defaultFilters, listUrl, pullUrl, serverState, filterItems, facetsOf, stateWords, metaWords, checkWords, checksWords, litFor, errorWords,
|
|
@@ -88,7 +88,7 @@ import {
|
|
|
88
88
|
DRAFTS_URL, notesUrl, sinceChoices, notesSummary, validTag, confirmWords, postedWords, draftRequest,
|
|
89
89
|
threadsUrl, threadUrl, issueUrl, IDEAS_URL, threadKindWords, threadMeta, litForThread, mentionsIndex, ideaRequest, ideaWords,
|
|
90
90
|
} from './forge-panel-model.js';
|
|
91
|
-
import { cornStateAttr, stateIconHtml } from './corn-state.js';
|
|
91
|
+
import { cornStateAttr, markStateAttr, stateIconHtml } from './corn-state.js';
|
|
92
92
|
import { sayResult, clearResult, resultOf, showResultIn, resetFeedbackForTests } from './feedback.js';
|
|
93
93
|
import { isOffline, initConnection, notSentWords, resetConnectionForTests } from './connection.js';
|
|
94
94
|
import { proposalListing, onProposalListing, loadProposalList, hooks as proposalHooks } from './proposal.js';
|
|
@@ -713,6 +713,7 @@ function paintIdea() {
|
|
|
713
713
|
if (ui.idea.message && ui.idea.link && safeUrl(ui.idea.link)) {
|
|
714
714
|
const link = document.createElement('a');
|
|
715
715
|
link.className = 'hx-link';
|
|
716
|
+
link.dataset.corn = 'text-link';
|
|
716
717
|
link.href = ui.idea.link;
|
|
717
718
|
link.target = '_blank';
|
|
718
719
|
link.rel = 'noreferrer';
|
|
@@ -865,6 +866,7 @@ function paintNotes() {
|
|
|
865
866
|
if (n.message && n.link && safeUrl(n.link)) {
|
|
866
867
|
const link = document.createElement('a');
|
|
867
868
|
link.className = 'hx-link';
|
|
869
|
+
link.dataset.corn = 'text-link';
|
|
868
870
|
link.href = n.link;
|
|
869
871
|
link.target = '_blank';
|
|
870
872
|
link.rel = 'noreferrer';
|
|
@@ -936,17 +938,17 @@ function lightsWords(deploy) {
|
|
|
936
938
|
|
|
937
939
|
function deployHtml(d) {
|
|
938
940
|
const link = safeUrl(d.url);
|
|
939
|
-
const out = link ? `<a class="hx-forge-out" href="${escHtml(link)}" target="_blank" rel="noreferrer" aria-label="Open deploy ${escHtml(d.name)} on ${escHtml(forgeName())} (new tab)">↗</a>` : '';
|
|
941
|
+
const out = link ? `<a data-corn="out-link" class="hx-forge-out" href="${escHtml(link)}" target="_blank" rel="noreferrer" aria-label="Open deploy ${escHtml(d.name)} on ${escHtml(forgeName())} (new tab)">↗</a>` : '';
|
|
940
942
|
return `<li class="hx-forge-item"><button type="button" class="hx-forge-row" data-forge-deploy="${escHtml(d.id)}" aria-pressed="${ui.deploy === d.id}" data-corn="row">
|
|
941
943
|
<span class="hx-forge-title">${escHtml(d.name)}${d.title && d.title !== d.name ? `<span class="hx-faint"> · ${escHtml(d.title)}</span>` : ''}</span>
|
|
942
944
|
<span class="hx-forge-meta"><span class="hx-forge-state hx-forge-state--${escHtml(d.state)}" data-corn="state-pill"${cornStateAttr(d.state)}>${stateIconHtml(d.state)}${escHtml(deployWords(d))}</span> ${escHtml(deployMeta(d, now()))}</span>
|
|
943
|
-
<span class="hx-forge-labels"><span class="hx-forge-label">${escHtml(lightsWords(d))}</span></span></button>${out}</li>`;
|
|
945
|
+
<span class="hx-forge-labels"><span class="hx-forge-label" data-corn="tag">${escHtml(lightsWords(d))}</span></span></button>${out}</li>`;
|
|
944
946
|
}
|
|
945
947
|
|
|
946
948
|
/** One thread in the list: a row that opens it, and a link out to the forge */
|
|
947
949
|
function threadHtml(t) {
|
|
948
950
|
const link = safeUrl(t.url);
|
|
949
|
-
const out = link ? `<a class="hx-forge-out" href="${escHtml(link)}" target="_blank" rel="noreferrer" aria-label="Open thread ${t.number} on ${escHtml(forgeName())} (new tab)">↗</a>` : '';
|
|
951
|
+
const out = link ? `<a data-corn="out-link" class="hx-forge-out" href="${escHtml(link)}" target="_blank" rel="noreferrer" aria-label="Open thread ${t.number} on ${escHtml(forgeName())} (new tab)">↗</a>` : '';
|
|
950
952
|
const note = [t.proposals && t.proposals.length ? `Proposal ${t.proposals.map((p) => p.slug).join(', ')}` : '', t.idea ? `Idea #${t.idea}` : ''].filter(Boolean).join(' · ');
|
|
951
953
|
// The run that is about this thread, as a word (issue #104): the Agents tab's list, read for every tab, says it; the row only names its state
|
|
952
954
|
const runs = ui.runs && ui.runs.data ? ui.runs.data.runs : null;
|
|
@@ -954,26 +956,26 @@ function threadHtml(t) {
|
|
|
954
956
|
const runWord = run ? `${runPillHtml({ esc: escHtml }, run, threadRunWords(runs, t.number), ` data-thread-run="${escHtml(run.runId)}"`)} ` : '';
|
|
955
957
|
return `<li class="hx-forge-item"><button type="button" class="hx-forge-row" data-forge-thread="${t.number}" aria-pressed="${ui.thread === t.number}" data-corn="row">
|
|
956
958
|
<span class="hx-forge-title">${escHtml(t.title)}</span>
|
|
957
|
-
<span class="hx-forge-meta"><span class="hx-forge-state hx-forge-state--${escHtml(t.state)}" data-corn="state-pill"${cornStateAttr(t.state)}>${escHtml(t.state === 'open' ? 'Open' : 'Closed')}</span> ${runWord}<span class="hx-forge-label">${escHtml(threadKindWords(t))}</span> ${escHtml(threadMeta(t, now()))}</span>${note ? `<span class="hx-forge-meta">${escHtml(note)}</span>` : ''}</button>${out}</li>`;
|
|
959
|
+
<span class="hx-forge-meta"><span class="hx-forge-state hx-forge-state--${escHtml(t.state)}" data-corn="state-pill"${cornStateAttr(t.state)}>${escHtml(t.state === 'open' ? 'Open' : 'Closed')}</span> ${runWord}<span class="hx-forge-label" data-corn="tag">${escHtml(threadKindWords(t))}</span> ${escHtml(threadMeta(t, now()))}</span>${note ? `<span class="hx-forge-meta">${escHtml(note)}</span>` : ''}</button>${out}</li>`;
|
|
958
960
|
}
|
|
959
961
|
|
|
960
962
|
function itemHtml(item, before = '', after = '') {
|
|
961
963
|
if (ui.kind === 'deploys') return deployHtml(item);
|
|
962
964
|
if (ui.kind === 'threads') return threadHtml(item);
|
|
963
965
|
const link = safeUrl(item.url);
|
|
964
|
-
const labels = item.labels.length ? `<span class="hx-forge-labels">${item.labels.map((l) => `<span class="hx-forge-label">${escHtml(l)}</span>`).join('')}</span>` : '';
|
|
966
|
+
const labels = item.labels.length ? `<span class="hx-forge-labels">${item.labels.map((l) => `<span class="hx-forge-label" data-corn="tag">${escHtml(l)}</span>`).join('')}</span>` : '';
|
|
965
967
|
const inner = `<span class="hx-forge-title">${escHtml(item.title)}</span>
|
|
966
968
|
<span class="hx-forge-meta"><span class="hx-forge-state hx-forge-state--${escHtml(item.draft ? 'draft' : item.state)}" data-corn="state-pill"${cornStateAttr(item.draft ? 'draft' : item.state)}>${escHtml(stateWords(item))}</span> ${escHtml(metaWords(item, now()))}</span>${before}${after}${labels}`;
|
|
967
|
-
const out = link ? `<a class="hx-forge-out" href="${escHtml(link)}" target="_blank" rel="noreferrer" aria-label="Open ${escHtml(item.head ? 'pull request' : 'issue')} ${item.number} on ${escHtml(forgeName())} (new tab)">↗</a>` : '';
|
|
969
|
+
const out = link ? `<a data-corn="out-link" class="hx-forge-out" href="${escHtml(link)}" target="_blank" rel="noreferrer" aria-label="Open ${escHtml(item.head ? 'pull request' : 'issue')} ${item.number} on ${escHtml(forgeName())} (new tab)">↗</a>` : '';
|
|
968
970
|
if (ui.kind !== 'issues') {
|
|
969
971
|
return `<li class="hx-forge-item"><button type="button" class="hx-forge-row" data-forge-pr="${item.number}" aria-pressed="${ui.selected === item.number}" data-corn="row">${inner}</button>${out}</li>`;
|
|
970
972
|
}
|
|
971
973
|
// An issue has no more to show here: its row is the link out; an open one also starts its spec (step 1 of the pipeline)
|
|
972
974
|
const spec = specBlock(item) === null
|
|
973
|
-
? `<button type="button" class="hx-btn hx-forge-act hx-forge-startspec" data-forge-spec="${item.number}" aria-label="Start a spec for issue ${item.number}"${ui.busy ? ' disabled' : ''}>Start a spec …</button>`
|
|
975
|
+
? `<button data-corn-kind="secondary" type="button" class="hx-btn hx-forge-act hx-forge-startspec" data-forge-spec="${item.number}" aria-label="Start a spec for issue ${item.number}"${ui.busy ? ' disabled' : ''}>Start a spec …</button>`
|
|
974
976
|
: '';
|
|
975
977
|
const agent = item.state === 'open'
|
|
976
|
-
? `<button type="button" class="hx-btn hx-forge-act hx-forge-startspec" data-forge-agent="issue:${item.number}" aria-label="${escHtml(t('startAgent'))} on issue ${item.number}">${escHtml(t('startAgent'))} …</button>`
|
|
978
|
+
? `<button data-corn-kind="secondary" type="button" class="hx-btn hx-forge-act hx-forge-startspec" data-forge-agent="issue:${item.number}" aria-label="${escHtml(t('startAgent'))} on issue ${item.number}">${escHtml(t('startAgent'))} …</button>`
|
|
977
979
|
: '';
|
|
978
980
|
return link
|
|
979
981
|
? `<li class="hx-forge-item"><a class="hx-forge-row" href="${escHtml(link)}" target="_blank" rel="noreferrer" data-corn="row">${inner}<span class="hx-sr-only"> (opens ${escHtml(forgeName())} in a new tab)</span></a>${spec}${agent}</li>`
|
|
@@ -994,9 +996,9 @@ function workHtml(e) {
|
|
|
994
996
|
/** The Agents tab's groups, each a heading and its work */
|
|
995
997
|
function groupsHtml(groups) {
|
|
996
998
|
return groups.map((g, i) => {
|
|
997
|
-
const link = g.issue && safeUrl(g.issue.url) ? ` <a class="hx-link hx-forge-gout" href="${escHtml(g.issue.url)}" target="_blank" rel="noreferrer" aria-label="Open issue ${g.number} on ${escHtml(forgeName())} (new tab)">↗</a>` : '';
|
|
999
|
+
const link = g.issue && safeUrl(g.issue.url) ? ` <a data-corn="text-link" class="hx-link hx-forge-gout" href="${escHtml(g.issue.url)}" target="_blank" rel="noreferrer" aria-label="Open issue ${g.number} on ${escHtml(forgeName())} (new tab)">↗</a>` : '';
|
|
998
1000
|
const startRef = g.kind === 'issue' && g.issue && g.issue.state === 'open' ? `issue:${g.number}` : g.kind === 'proposal' ? `proposal:${g.slug}` : null;
|
|
999
|
-
const start = startRef ? ` <button type="button" class="hx-btn hx-forge-act" data-forge-agent="${escHtml(startRef)}" aria-label="${escHtml(t('startAgent'))} on ${escHtml(g.kind === 'issue' ? `issue ${g.number}` : `proposal ${g.slug}`)}">${escHtml(t('startAgent'))} …</button>` : '';
|
|
1001
|
+
const start = startRef ? ` <button data-corn-kind="secondary" type="button" class="hx-btn hx-forge-act" data-forge-agent="${escHtml(startRef)}" aria-label="${escHtml(t('startAgent'))} on ${escHtml(g.kind === 'issue' ? `issue ${g.number}` : `proposal ${g.slug}`)}">${escHtml(t('startAgent'))} …</button>` : '';
|
|
1000
1002
|
return `<li class="hx-forge-group"><h3 class="hx-forge-gtitle" id="forge-group-${i}">${escHtml(g.title)}${link}</h3>${start}<p class="hx-forge-meta">${escHtml(groupWords(g))}</p><ul class="hx-forge-list" aria-labelledby="forge-group-${i}">${g.entries.map(workHtml).join('')}</ul></li>`;
|
|
1001
1003
|
}).join('');
|
|
1002
1004
|
}
|
|
@@ -1010,40 +1012,40 @@ function detailKey() {
|
|
|
1010
1012
|
}
|
|
1011
1013
|
|
|
1012
1014
|
/** The back control of a detail: an arrow and the name of the list it returns to ("All pull requests") */
|
|
1013
|
-
const backHtml = (action, words) => `<button type="button" class="hx-forge-back" data-action="${action}"><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.6" aria-hidden="true"><path d="M10 3L5 8l5 5"/></svg><span class="hx-forge-back-text">${escHtml(words)}</span></button>`;
|
|
1015
|
+
const backHtml = (action, words) => `<button data-corn="back" type="button" class="hx-forge-back" data-action="${action}"><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.6" aria-hidden="true"><path d="M10 3L5 8l5 5"/></svg><span class="hx-forge-back-text">${escHtml(words)}</span></button>`;
|
|
1014
1016
|
|
|
1015
1017
|
/** The selected deploy: what it was, and the nodes it restarted (each a button that selects it on the map) */
|
|
1016
1018
|
function deployDetailHtml() {
|
|
1017
1019
|
const d = ui.deployItem;
|
|
1018
1020
|
const lit = ui.litDeploy;
|
|
1019
1021
|
const url = safeUrl(d.url);
|
|
1020
|
-
const head = `${backHtml('clear-forge-deploy', 'All deploys')}<h3 class="hx-forge-detail-title">${escHtml(d.name)}</h3>
|
|
1021
|
-
<p class="hx-forge-meta"><span class="hx-forge-state hx-forge-state--${escHtml(d.state)}" data-corn="state-pill"${cornStateAttr(d.state)}>${stateIconHtml(d.state)}${escHtml(deployWords(d))}</span> ${escHtml(deployMeta(d, now()))}${url ? ` · <a class="hx-link" href="${escHtml(url)}" target="_blank" rel="noreferrer">Open on ${escHtml(forgeName())} ↗</a>` : ''}</p>`;
|
|
1022
|
+
const head = `${backHtml('clear-forge-deploy', 'All deploys')}<h3 class="hx-forge-detail-title" data-corn="detail-title">${escHtml(d.name)}</h3>
|
|
1023
|
+
<p class="hx-forge-meta"><span class="hx-forge-state hx-forge-state--${escHtml(d.state)}" data-corn="state-pill"${cornStateAttr(d.state)}>${stateIconHtml(d.state)}${escHtml(deployWords(d))}</span> ${escHtml(deployMeta(d, now()))}${url ? ` · <a data-corn="text-link" class="hx-link" href="${escHtml(url)}" target="_blank" rel="noreferrer">Open on ${escHtml(forgeName())} ↗</a>` : ''}</p>`;
|
|
1022
1024
|
const stale = ui.lists.deploys && ui.lists.deploys.stale;
|
|
1023
1025
|
let body;
|
|
1024
1026
|
if (!d.restarts.length) {
|
|
1025
1027
|
body = '<p class="hx-forge-notice" data-corn="notice">No node is mapped to this deploy, so nothing is lit. Say what it restarts under <code class="hx-code">deploys.restarts</code> in cornfield.config.js (docs/deploys.md).</p>';
|
|
1026
1028
|
} else {
|
|
1027
|
-
const rows = lit.nodes.map((n) => `<li class="hx-forge-file"><button type="button" class="hx-forge-node" data-forge-node="${escHtml(n.id)}" aria-label="Show ${escHtml(n.label)} on the map${isNodeVisible(n) ? '' : ' (its layer is off)'}">${escHtml(n.label)}${isNodeVisible(n) ? '' : ' · layer off'}</button> <span class="hx-faint">${escHtml(n.type)}</span></li>`).join('');
|
|
1029
|
+
const rows = lit.nodes.map((n) => `<li class="hx-forge-file" data-corn="file"><button data-corn="node-chip" type="button" class="hx-forge-node" data-forge-node="${escHtml(n.id)}" aria-label="Show ${escHtml(n.label)} on the map${isNodeVisible(n) ? '' : ' (its layer is off)'}">${escHtml(n.label)}${isNodeVisible(n) ? '' : ' · layer off'}</button> <span class="hx-faint">${escHtml(n.type)}</span></li>`).join('');
|
|
1028
1030
|
const missing = lit.missing.length ? `<p class="hx-forge-notice" data-corn="notice">${escHtml(lit.missing.join(', '))} ${lit.missing.length === 1 ? 'is' : 'are'} named in the config but not on the map.</p>` : '';
|
|
1029
|
-
const key = lit.nodes.length ? `<p class="hx-forge-key hx-faint"><span class="hx-mark-dot hx-mark-dot--${d.state === 'failure' ? 'removed' : 'changed'}" aria-hidden="true"></span>${d.state === 'failure' ? 'restarted by a deploy that failed' : 'restarted by this deploy'}</p>` : '';
|
|
1031
|
+
const key = lit.nodes.length ? `<p class="hx-forge-key hx-faint"><span class="hx-mark-dot hx-mark-dot--${d.state === 'failure' ? 'removed' : 'changed'}" data-corn="mark-dot"${markStateAttr(d.state === 'failure' ? 'removed' : 'changed')} aria-hidden="true"></span>${d.state === 'failure' ? 'restarted by a deploy that failed' : 'restarted by this deploy'}</p>` : '';
|
|
1030
1032
|
body = `<h4 class="hx-forge-sub">${escHtml(`Restarted: ${plural(lit.nodes.length, 'node')} on the map`)}</h4>${key}${rows ? `<ul class="hx-forge-files">${rows}</ul>` : ''}${missing}`;
|
|
1031
1033
|
}
|
|
1032
1034
|
return `${head}${stale ? `<p class="hx-forge-notice" data-corn="notice">${escHtml(`This is an older answer. ${stale}`)}</p>` : ''}${body}`;
|
|
1033
1035
|
}
|
|
1034
1036
|
|
|
1035
1037
|
/** A node button, as in a pull request's files: it selects the node on the map */
|
|
1036
|
-
const nodeButton = (n) => `<button type="button" class="hx-forge-node" data-forge-node="${escHtml(n.id)}" aria-label="Show ${escHtml(n.label)} on the map${isNodeVisible(n) ? '' : ' (its layer is off)'}">${escHtml(n.label)}${isNodeVisible(n) ? '' : ' · layer off'}</button>`;
|
|
1038
|
+
const nodeButton = (n) => `<button data-corn="node-chip" type="button" class="hx-forge-node" data-forge-node="${escHtml(n.id)}" aria-label="Show ${escHtml(n.label)} on the map${isNodeVisible(n) ? '' : ' (its layer is off)'}">${escHtml(n.label)}${isNodeVisible(n) ? '' : ' · layer off'}</button>`;
|
|
1037
1039
|
|
|
1038
1040
|
/** The selected thread: read-only, its messages as written, a way to reply on the forge, and the nodes its text lights */
|
|
1039
1041
|
function threadDetailHtml() {
|
|
1040
|
-
const head = (title) => `${backHtml('clear-forge-thread', 'All threads')}<h3 class="hx-forge-detail-title">${title}</h3>`;
|
|
1042
|
+
const head = (title) => `${backHtml('clear-forge-thread', 'All threads')}<h3 class="hx-forge-detail-title" data-corn="detail-title">${title}</h3>`;
|
|
1041
1043
|
if (ui.threadError) return `${head(`Thread ${ui.thread}`)}<p class="hx-forge-notice" data-corn="notice">${escHtml(ui.threadError)}</p>`;
|
|
1042
1044
|
if (!ui.threadDetail) return `${head(`Thread ${ui.thread}`)}<p class="hx-faint">Loading its messages …</p>`;
|
|
1043
1045
|
const { thread: t, stale } = ui.threadDetail;
|
|
1044
1046
|
const lit = ui.litThread;
|
|
1045
1047
|
const url = safeUrl(t.url);
|
|
1046
|
-
const reply = url ? `<a class="hx-link" href="${escHtml(url)}" target="_blank" rel="noreferrer">Reply on ${escHtml(forgeName())} (new tab)</a>` : '';
|
|
1048
|
+
const reply = url ? `<a data-corn="text-link" class="hx-link" href="${escHtml(url)}" target="_blank" rel="noreferrer">Reply on ${escHtml(forgeName())} (new tab)</a>` : '';
|
|
1047
1049
|
const named = [
|
|
1048
1050
|
...(t.proposals || []).map((p) => `Proposal <code class="hx-code">${escHtml(p.slug)}</code> in pull request #${p.pull}`),
|
|
1049
1051
|
...(t.kind === 'proposal' ? [`Spec pull request for <code class="hx-code">${escHtml((t.slugs || []).join(', '))}</code>`] : []),
|
|
@@ -1051,13 +1053,13 @@ function threadDetailHtml() {
|
|
|
1051
1053
|
];
|
|
1052
1054
|
const msgs = t.messages.map((m) => {
|
|
1053
1055
|
const own = lit.perMessage.get(m.id) || { nodes: [], unresolved: [] };
|
|
1054
|
-
const link = safeUrl(m.url) ? ` <a class="hx-link" href="${escHtml(m.url)}" target="_blank" rel="noreferrer" aria-label="Open this message on ${escHtml(forgeName())} (new tab)">↗</a>` : '';
|
|
1056
|
+
const link = safeUrl(m.url) ? ` <a data-corn="out-link" class="hx-link" href="${escHtml(m.url)}" target="_blank" rel="noreferrer" aria-label="Open this message on ${escHtml(forgeName())} (new tab)">↗</a>` : '';
|
|
1055
1057
|
const chips = own.nodes.length || own.unresolved.length
|
|
1056
1058
|
? `<span class="hx-forge-nodes hx-thread-nodes">${own.nodes.map(nodeButton).join('')}${own.unresolved.length ? `<span class="hx-faint">not on the map: ${own.unresolved.map((r) => `<code class="hx-code">${escHtml(r)}</code>`).join(' ')}</span>` : ''}</span>`
|
|
1057
1059
|
: '';
|
|
1058
|
-
return `<li class="hx-thread-msg"><p class="hx-forge-meta"><strong class="hx-strong">${escHtml(m.author ? m.author.login : 'someone')}</strong>${m.opening ? ' opened this' : ''} · ${escHtml(relativeTime(m.createdAt, now()))}${link}</p><p class="hx-thread-body">${escHtml(m.body.trim() === '' ? '(no text)' : m.body)}${m.cut ? '\n… (cut here; the rest is on the forge)' : ''}</p>${chips}</li>`;
|
|
1060
|
+
return `<li class="hx-thread-msg" data-corn="thread-message"><p class="hx-forge-meta"><strong class="hx-strong">${escHtml(m.author ? m.author.login : 'someone')}</strong>${m.opening ? ' opened this' : ''} · ${escHtml(relativeTime(m.createdAt, now()))}${link}</p><p class="hx-thread-body">${escHtml(m.body.trim() === '' ? '(no text)' : m.body)}${m.cut ? '\n… (cut here; the rest is on the forge)' : ''}</p>${chips}</li>`;
|
|
1059
1061
|
}).join('');
|
|
1060
|
-
const key = lit.nodes.length ? `<p class="hx-forge-key hx-faint"><span class="hx-mark-dot hx-mark-dot--changed" aria-hidden="true"></span>a node this thread mentions</p>` : '';
|
|
1062
|
+
const key = lit.nodes.length ? `<p class="hx-forge-key hx-faint"><span class="hx-mark-dot hx-mark-dot--changed" data-corn="mark-dot" data-corn-state="changed" aria-hidden="true"></span>a node this thread mentions</p>` : '';
|
|
1061
1063
|
return `${head(`#${t.number} ${escHtml(t.title)}`)}
|
|
1062
1064
|
<p class="hx-forge-meta"><span class="hx-forge-state hx-forge-state--${escHtml(t.state)}" data-corn="state-pill"${cornStateAttr(t.state)}>${t.state === 'open' ? 'Open' : 'Closed'}</span> ${escHtml(threadKindWords(t))} · ${escHtml(threadMeta({ ...t, comments: t.messages.length - (t.kind === 'idea' ? 1 : 0) + (t.hidden || 0) }, now()))}</p>
|
|
1063
1065
|
<p class="hx-forge-why hx-faint">Read-only here: a thread is a conversation on ${escHtml(forgeName())}, so you reply there. ${reply}</p>
|
|
@@ -1077,7 +1079,7 @@ function detailHtml() {
|
|
|
1077
1079
|
if (shown.startsWith('thread:')) return threadDetailHtml();
|
|
1078
1080
|
if (shown.startsWith('deploy:')) return deployDetailHtml();
|
|
1079
1081
|
if (!shown) return '';
|
|
1080
|
-
const head = (title, meta) => `${backHtml('clear-forge-pr', ui.kind === 'work' ? 'All work' : 'All pull requests')}${meta || ''}<h3 class="hx-forge-detail-title">${title}</h3>`;
|
|
1082
|
+
const head = (title, meta) => `${backHtml('clear-forge-pr', ui.kind === 'work' ? 'All work' : 'All pull requests')}${meta || ''}<h3 class="hx-forge-detail-title" data-corn="detail-title">${title}</h3>`;
|
|
1081
1083
|
if (ui.detailError) return `${head(`Pull request ${ui.selected}`)}<p class="hx-forge-notice" data-corn="notice">${escHtml(ui.detailError)}</p>`;
|
|
1082
1084
|
if (!ui.detail) return `${head(`Pull request ${ui.selected}`)}<p class="hx-faint">Loading its files and checks …</p><ul class="hx-forge-list" aria-hidden="true">${loadingRowsHtml(4)}</ul>`;
|
|
1083
1085
|
const { pull, checks, stale } = ui.detail;
|
|
@@ -1093,10 +1095,10 @@ function detailHtml() {
|
|
|
1093
1095
|
? `Lights ${failed.tests.map((t) => `<code class="hx-code">${escHtml(t.path)}</code>${t.nodes.length ? '' : ' (not on the map)'}`).join(', ')}`
|
|
1094
1096
|
: 'Names no test file, so lights nothing'}</span>`
|
|
1095
1097
|
: '';
|
|
1096
|
-
const name = safeUrl(c.url) ? `<a class="hx-link" href="${escHtml(c.url)}" target="_blank" rel="noreferrer">${escHtml(c.name)}</a>` : `<span class="hx-name">${escHtml(c.name)}</span>`;
|
|
1098
|
+
const name = safeUrl(c.url) ? `<a data-corn="text-link" class="hx-link" href="${escHtml(c.url)}" target="_blank" rel="noreferrer">${escHtml(c.name)}</a>` : `<span class="hx-name">${escHtml(c.name)}</span>`;
|
|
1097
1099
|
const why = rerunWhy(c, forgeName());
|
|
1098
1100
|
const again = c.state === 'failure' && c.canRerun
|
|
1099
|
-
? `<button type="button" class="hx-btn hx-forge-act" data-forge-rerun="${escHtml(c.id)}" aria-label="Re-run ${escHtml(c.name)}"${ui.busy ? ' disabled' : ''}>Re-run</button>`
|
|
1101
|
+
? `<button data-corn-kind="secondary" type="button" class="hx-btn hx-forge-act" data-forge-rerun="${escHtml(c.id)}" aria-label="Re-run ${escHtml(c.name)}"${ui.busy ? ' disabled' : ''}>Re-run</button>`
|
|
1100
1102
|
: '';
|
|
1101
1103
|
const whyNot = why ? `<span class="hx-faint hx-forge-lights">${escHtml(why)}</span>` : '';
|
|
1102
1104
|
return `<li class="hx-forge-check"><span class="hx-forge-state hx-forge-state--${escHtml(c.state)}" data-corn="state-pill"${cornStateAttr(c.state)}>${stateIconHtml(c.state)}${escHtml(checkWords(c))}</span> ${name}${again}${lights}${whyNot}</li>`;
|
|
@@ -1104,10 +1106,10 @@ function detailHtml() {
|
|
|
1104
1106
|
|
|
1105
1107
|
const fileRows = lit.files.map((f) => {
|
|
1106
1108
|
const nodes = f.nodes.length
|
|
1107
|
-
? f.nodes.map((n) => `<button type="button" class="hx-forge-node" data-forge-node="${escHtml(n.id)}" aria-label="Show ${escHtml(n.label)} on the map${isNodeVisible(n) ? '' : ' (its layer is off)'}">${escHtml(n.label)}${isNodeVisible(n) ? '' : ' · layer off'}</button>`).join('')
|
|
1109
|
+
? f.nodes.map((n) => `<button data-corn="node-chip" type="button" class="hx-forge-node" data-forge-node="${escHtml(n.id)}" aria-label="Show ${escHtml(n.label)} on the map${isNodeVisible(n) ? '' : ' (its layer is off)'}">${escHtml(n.label)}${isNodeVisible(n) ? '' : ' · layer off'}</button>`).join('')
|
|
1108
1110
|
: '<span class="hx-faint">not on the map</span>';
|
|
1109
1111
|
const renamed = f.status === 'renamed' && f.previousPath ? `<span class="hx-faint"> from ${escHtml(f.previousPath)}</span>` : '';
|
|
1110
|
-
return `<li class="hx-forge-file"><span class="hx-forge-fstatus">${escHtml(f.status)}</span> <code class="hx-code">${escHtml(f.path)}</code>${renamed} <span class="hx-good">+${f.additions}</span> <span class="hx-forge-del">−${f.deletions}</span><span class="hx-forge-nodes">${nodes}</span></li>`;
|
|
1112
|
+
return `<li class="hx-forge-file" data-corn="file"><span class="hx-forge-fstatus">${escHtml(f.status)}</span> <code class="hx-code">${escHtml(f.path)}</code>${renamed} <span class="hx-good">+${f.additions}</span> <span class="hx-forge-del">−${f.deletions}</span><span class="hx-forge-nodes">${nodes}</span></li>`;
|
|
1111
1113
|
}).join('');
|
|
1112
1114
|
|
|
1113
1115
|
// Land it is the one primary action, with Open on the forge beside it; a pull request that cannot land says why in one line
|
|
@@ -1115,10 +1117,10 @@ function detailHtml() {
|
|
|
1115
1117
|
const land = block
|
|
1116
1118
|
? `<button type="button" class="hx-btn hx-btn--approve" disabled data-corn-kind="approve">${escHtml(t('landIt'))}</button>`
|
|
1117
1119
|
: `<button type="button" class="hx-btn hx-btn--approve hx-forge-act" data-forge-merge="${escHtml(String(pull.number))}"${ui.busy ? ' disabled' : ''} data-corn-kind="approve">${escHtml(t('landIt'))} …</button>`;
|
|
1118
|
-
const act = `<div class="hx-forge-cta">${land}${url ? `<a class="hx-btn hx-forge-open" href="${escHtml(url)}" target="_blank" rel="noreferrer">Open on ${escHtml(forgeName())} ↗</a>` : ''}</div>${block ? `<p class="hx-forge-why hx-faint">${escHtml(block)}</p>` : ''}${approvalWarning(ui.detail) ? `<p class="hx-forge-why hx-faint" data-corn="notice" data-corn-state="waiting">${escHtml(approvalWarning(ui.detail))}</p>` : ''}`;
|
|
1120
|
+
const act = `<div class="hx-forge-cta">${land}${url ? `<a data-corn="open-link" data-corn-kind="secondary" class="hx-btn hx-forge-open" href="${escHtml(url)}" target="_blank" rel="noreferrer">Open on ${escHtml(forgeName())} ↗</a>` : ''}</div>${block ? `<p class="hx-forge-why hx-faint">${escHtml(block)}</p>` : ''}${approvalWarning(ui.detail) ? `<p class="hx-forge-why hx-faint" data-corn="notice" data-corn-state="waiting">${escHtml(approvalWarning(ui.detail))}</p>` : ''}`;
|
|
1119
1121
|
// A spec approved with `proposals.approveLands` waits for its checks: said here, with a way to stop it
|
|
1120
1122
|
const waiting = ui.landing && pull.state === 'open'
|
|
1121
|
-
? `<div class="hx-forge-step"><p class="hx-forge-notice hx-forge-notice--ok" role="status" data-corn="notice" data-corn-state="success">${escHtml(landingWords(ui.landing, now()))}</p><button type="button" class="hx-btn hx-forge-act" data-forge-landing-cancel="${pull.number}"${ui.busy ? ' disabled' : ''}>Cancel</button></div>`
|
|
1123
|
+
? `<div class="hx-forge-step"><p class="hx-forge-notice hx-forge-notice--ok" role="status" data-corn="notice" data-corn-state="success">${escHtml(landingWords(ui.landing, now()))}</p><button data-corn-kind="secondary" type="button" class="hx-btn hx-forge-act" data-forge-landing-cancel="${pull.number}"${ui.busy ? ' disabled' : ''}>Cancel</button></div>`
|
|
1122
1124
|
: '';
|
|
1123
1125
|
const note = ui.note ? `<p class="hx-forge-notice${ui.note.ok ? ' hx-forge-notice--ok' : ''}" data-corn="notice"${ui.note.ok ? ' data-corn-state="success"' : ''}>${escHtml(ui.note.text)}</p>` : '';
|
|
1124
1126
|
// Step 2 of the pipeline: a spec pull request with an approved proposal opens its build issue
|
|
@@ -1130,7 +1132,7 @@ function detailHtml() {
|
|
|
1130
1132
|
: '';
|
|
1131
1133
|
|
|
1132
1134
|
const key = lit.changed.size || lit.failing.size
|
|
1133
|
-
? `<p class="hx-forge-key hx-faint">${lit.changed.size ? '<span class="hx-mark-dot hx-mark-dot--changed" aria-hidden="true"></span>a file this pull request changes ' : ''}${lit.failing.size ? '<span class="hx-mark-dot hx-mark-dot--removed" aria-hidden="true"></span>a test a failing check names' : ''}</p>`
|
|
1135
|
+
? `<p class="hx-forge-key hx-faint">${lit.changed.size ? '<span class="hx-mark-dot hx-mark-dot--changed" data-corn="mark-dot" data-corn-state="changed" aria-hidden="true"></span>a file this pull request changes ' : ''}${lit.failing.size ? '<span class="hx-mark-dot hx-mark-dot--removed" data-corn="mark-dot" data-corn-state="removed" aria-hidden="true"></span>a test a failing check names' : ''}</p>`
|
|
1134
1136
|
: '';
|
|
1135
1137
|
// Its run: who is running it, their state, the time and the cost (the runs are read for the Runs tab, and once for the first PR selected)
|
|
1136
1138
|
const runs = ui.runs && ui.runs.data ? ui.runs.data.runs : null;
|
|
@@ -1231,7 +1233,7 @@ function paintCounts() {
|
|
|
1231
1233
|
const n = counts[btn.dataset.forgeKind];
|
|
1232
1234
|
const el = btn.querySelector('.hx-forge-count');
|
|
1233
1235
|
if (!el) continue;
|
|
1234
|
-
el.hidden = !
|
|
1236
|
+
el.hidden = !(btn.dataset.forgeKind in counts); // a tab with no count at all (Deploys) shows none; the others hold their width while empty
|
|
1235
1237
|
el.textContent = n ? String(n) : '';
|
|
1236
1238
|
}
|
|
1237
1239
|
}
|
|
@@ -1305,14 +1307,16 @@ function draw(panel) {
|
|
|
1305
1307
|
const link = ui.actNote && safeUrl(ui.actNote.url);
|
|
1306
1308
|
act.className = `hx-forge-notice${ui.actNote && ui.actNote.ok ? ' hx-forge-notice--ok' : ''}`;
|
|
1307
1309
|
if (ui.actNote && ui.actNote.ok) act.dataset.cornState = 'success'; else delete act.dataset.cornState;
|
|
1308
|
-
act.innerHTML = ui.actNote ? `${escHtml(ui.actNote.text)}${link ? ` <a class="hx-link" href="${escHtml(link)}" target="_blank" rel="noreferrer">Open on ${escHtml(forgeName())} ↗</a>` : ''}` : '';
|
|
1310
|
+
act.innerHTML = ui.actNote ? `${escHtml(ui.actNote.text)}${link ? ` <a data-corn="text-link" class="hx-link" href="${escHtml(link)}" target="_blank" rel="noreferrer">Open on ${escHtml(forgeName())} ↗</a>` : ''}` : '';
|
|
1309
1311
|
}
|
|
1310
1312
|
|
|
1311
1313
|
const rows = $('forge-list');
|
|
1312
1314
|
const empty = (words) => `<li class="hx-forge-empty hx-faint" data-corn="empty">${escHtml(words)}</li>`;
|
|
1313
1315
|
rows.setAttribute('aria-busy', String(!!ui.loading && !list));
|
|
1314
1316
|
// A list that is being read holds its height with rows of the right size, so nothing jumps when the data comes
|
|
1315
|
-
|
|
1317
|
+
// (On Runs the list sits under the runs, whose height is not known yet: rows held there would jump when the runs arrive, so they wait. They
|
|
1318
|
+
// are drawn with the work's answer all the same, which loadWork paints only once the runs are read too, failed or not.)
|
|
1319
|
+
if (!list) rows.innerHTML = ui.loading && !(work && !(ui.runs && ui.runs.data)) ? loadingRowsHtml(4) : '';
|
|
1316
1320
|
else if (specs) {
|
|
1317
1321
|
const open = state.proposal ? { slug: state.proposalSlug, source: state.proposalSource } : null;
|
|
1318
1322
|
rows.innerHTML = list.items.length ? list.items.map((e) => specRowHtml(e, { current: open })).join('') : empty(emptyWords('specs', forgeName()));
|
|
@@ -1349,6 +1353,8 @@ function paintRuns() {
|
|
|
1349
1353
|
if (!failed && ui.runNote && ui.runNote.ok) note.dataset.cornState = 'success'; else delete note.dataset.cornState;
|
|
1350
1354
|
setNotice(note, words, !!failed);
|
|
1351
1355
|
paintRunner('forge-runs-runner', data);
|
|
1356
|
+
const waiting = !data && !failed && !!ui.loading; // the runner line and the totals hold their place while the runs load (not beside a failure)
|
|
1357
|
+
if (waiting) { const r = $('forge-runs-runner'); r.hidden = false; r.innerHTML = loadingLinesHtml(1); }
|
|
1352
1358
|
const trig = $('forge-runs-trigger');
|
|
1353
1359
|
if (trig) {
|
|
1354
1360
|
const skipped = data ? triggerNotice(data) : '';
|
|
@@ -1358,8 +1364,8 @@ function paintRuns() {
|
|
|
1358
1364
|
const totals = $('forge-runs-totals');
|
|
1359
1365
|
if (totals) {
|
|
1360
1366
|
const lines = data ? totalsLines(data.totals) : [];
|
|
1361
|
-
totals.hidden = !lines.length;
|
|
1362
|
-
totals.innerHTML = totalsHtml(viewContext(), lines);
|
|
1367
|
+
totals.hidden = !lines.length && !waiting;
|
|
1368
|
+
totals.innerHTML = waiting ? loadingLinesHtml(3) : totalsHtml(viewContext(), lines);
|
|
1363
1369
|
}
|
|
1364
1370
|
const hand = $('forge-runs-hand');
|
|
1365
1371
|
if (hand) {
|
|
@@ -1583,7 +1589,7 @@ function showConfirm(what, goLabel, state) {
|
|
|
1583
1589
|
$('forge-confirm-title').textContent = what.title;
|
|
1584
1590
|
$('forge-confirm-body').innerHTML = `<dl class="hx-confirm-facts">${what.lines.map(([k, v]) => `<dt>${escHtml(k)}</dt><dd>${asCode.includes(k) ? `<code class="hx-code">${escHtml(v)}</code>` : escHtml(v)}</dd>`).join('')}</dl>
|
|
1585
1591
|
${(what.checks || []).length ? `<ul class="hx-confirm-checks">${what.checks.map((c) => `<li><span class="hx-forge-state hx-forge-state--success" data-corn="state-pill" data-corn-state="success">${escHtml(c.words)}</span> ${escHtml(c.name)}</li>`).join('')}</ul>` : ''}
|
|
1586
|
-
${(what.previews || []).map((pv) => `<p class="hx-confirm-label">${escHtml(pv.label)}</p><pre class="hx-confirm-pre" tabindex="0" role="region" aria-label="${escHtml(pv.label)}">${escHtml(pv.text)}</pre>`).join('')}
|
|
1592
|
+
${(what.previews || []).map((pv) => `<p class="hx-confirm-label">${escHtml(pv.label)}</p><pre class="hx-confirm-pre" data-corn="confirm-preview" tabindex="0" role="region" aria-label="${escHtml(pv.label)}">${escHtml(pv.text)}</pre>`).join('')}
|
|
1587
1593
|
<p class="hx-confirm-note">${escHtml(what.note)}</p>`;
|
|
1588
1594
|
const go = el.querySelector('[data-action="forge-confirm-go"]');
|
|
1589
1595
|
go.disabled = false;
|
package/explorer/house.js
CHANGED
|
@@ -245,10 +245,10 @@ function paintBar() {
|
|
|
245
245
|
const fKey = floors.map((f) => `${f.id}:${f.name}`).join('|') + `#${c.floor}#${c.planSource}#${edit || ''}`;
|
|
246
246
|
if (els.floors.dataset.key !== fKey) {
|
|
247
247
|
els.floors.dataset.key = fKey;
|
|
248
|
-
els.floors.innerHTML = floors.map((f) => `<button type="button" class="hx-house-chip" data-house="floor" data-floor="${escAttr(f.id)}" aria-pressed="${f.id === c.floor}">${escAttr(f.name)}</button>`).join('')
|
|
248
|
+
els.floors.innerHTML = floors.map((f) => `<button data-corn="house-chip" type="button" class="hx-house-chip" data-house="floor" data-floor="${escAttr(f.id)}" aria-pressed="${f.id === c.floor}">${escAttr(f.name)}</button>`).join('')
|
|
249
249
|
+ (c.planSource === 'default' ? '<span class="hx-house-tag" title="The live layer is unavailable: this is the default plan">Default plan</span>' : '')
|
|
250
250
|
+ (c.planSource === 'none' ? '<span class="hx-house-tag">No plan</span>' : '')
|
|
251
|
-
+ (edit ? `<a class="hx-house-chip hx-house-edit" href="${escAttr(edit)}" target="_blank" rel="noopener" title="Move and resize the rooms where the plan is kept (opens in a new tab)">Edit layout</a>` : '');
|
|
251
|
+
+ (edit ? `<a data-corn="house-chip" class="hx-house-chip hx-house-edit" href="${escAttr(edit)}" target="_blank" rel="noopener" title="Move and resize the rooms where the plan is kept (opens in a new tab)">Edit layout</a>` : '');
|
|
252
252
|
}
|
|
253
253
|
const chips = c.phone ? personaChips(state.nodes) : [];
|
|
254
254
|
const pKey = c.phone ? chips.map((p) => `${p.id}:${p.text}`).join('|') + `#${c.software}#${c.cloud}` : '';
|
|
@@ -256,9 +256,9 @@ function paintBar() {
|
|
|
256
256
|
els.people.dataset.key = pKey;
|
|
257
257
|
els.people.hidden = !c.phone;
|
|
258
258
|
els.people.innerHTML = c.phone
|
|
259
|
-
? chips.map((p) => `<button type="button" class="hx-house-chip hx-house-chip--person" data-house="person" data-id="${escAttr(p.id)}">${escAttr(p.text)}</button>`).join('')
|
|
260
|
-
+ `<button type="button" class="hx-house-chip hx-house-chip--software" data-house="software" aria-pressed="${!!c.software}">Software</button>`
|
|
261
|
-
+ `<button type="button" class="hx-house-chip hx-house-chip--cloud" data-house="cloud" aria-pressed="${!!c.cloud}">Cloud</button>`
|
|
259
|
+
? chips.map((p) => `<button data-corn="house-chip" type="button" class="hx-house-chip hx-house-chip--person" data-house="person" data-id="${escAttr(p.id)}">${escAttr(p.text)}</button>`).join('')
|
|
260
|
+
+ `<button data-corn="house-chip" type="button" class="hx-house-chip hx-house-chip--software" data-house="software" aria-pressed="${!!c.software}">Software</button>`
|
|
261
|
+
+ `<button data-corn="house-chip" type="button" class="hx-house-chip hx-house-chip--cloud" data-house="cloud" aria-pressed="${!!c.cloud}">Cloud</button>`
|
|
262
262
|
: '';
|
|
263
263
|
}
|
|
264
264
|
}
|
|
@@ -272,7 +272,7 @@ function paintMore() {
|
|
|
272
272
|
els.over.innerHTML = more.map((m) => {
|
|
273
273
|
const room = nodeById(m.room);
|
|
274
274
|
const name = room ? room.label : m.room;
|
|
275
|
-
return `<button type="button" class="hx-house-more" data-house="more" data-room="${escAttr(m.room)}" aria-label="${escAttr(`${m.count} more in the ${name}: open the room`)}">+${m.count}</button>`;
|
|
275
|
+
return `<button data-corn="house-more" type="button" class="hx-house-more" data-house="more" data-room="${escAttr(m.room)}" aria-label="${escAttr(`${m.count} more in the ${name}: open the room`)}">+${m.count}</button>`;
|
|
276
276
|
}).join('');
|
|
277
277
|
}
|
|
278
278
|
}
|