cornfield 0.62.0 → 0.63.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.
Files changed (42) hide show
  1. package/core/release-notes.js +2 -2
  2. package/explorer/css/changes.css +3 -7
  3. package/explorer/css/header.css +15 -0
  4. package/explorer/css/layers.css +11 -2
  5. package/explorer/css/map.css +0 -1
  6. package/explorer/css/node-panel.css +45 -0
  7. package/explorer/css/page.css +2 -7
  8. package/explorer/css/proposal.css +2 -3
  9. package/explorer/css/work.css +7 -7
  10. package/explorer/engine/hint.js +7 -7
  11. package/explorer/engine/keyboard.js +5 -4
  12. package/explorer/engine/map-rect.js +2 -2
  13. package/explorer/engine/render.js +2 -1
  14. package/explorer/forge-panel-model.js +24 -0
  15. package/explorer/history-model.js +21 -11
  16. package/explorer/history-replay.js +13 -5
  17. package/explorer/history.js +16 -7
  18. package/explorer/index.html +6 -3
  19. package/explorer/page.js +1 -2
  20. package/explorer/panel-model.js +103 -0
  21. package/explorer/panel-sections.js +140 -0
  22. package/explorer/pieces/layers.js +27 -6
  23. package/explorer/pieces/node-panel.js +78 -1
  24. package/explorer/pieces/search.js +22 -9
  25. package/explorer/pieces/work-deploys.js +13 -13
  26. package/explorer/pieces/work-issues.js +10 -5
  27. package/explorer/pieces/work-list.js +72 -9
  28. package/explorer/pieces/work-paint.js +45 -10
  29. package/explorer/pieces/work-prs.js +46 -34
  30. package/explorer/pieces/work-runs.js +17 -5
  31. package/explorer/pieces/work-specs.js +24 -4
  32. package/explorer/pieces/work-threads.js +59 -15
  33. package/explorer/pieces/work.js +6 -3
  34. package/explorer/proposal-model.js +3 -6
  35. package/explorer/runs-view.js +42 -8
  36. package/explorer/scene.js +5 -1
  37. package/explorer/work-model.js +266 -55
  38. package/explorer/work-view.css +9 -16
  39. package/explorer/work-view.js +107 -34
  40. package/package.json +1 -1
  41. package/server/server.js +1 -1
  42. package/server/work-graph.js +5 -5
@@ -13,6 +13,8 @@ import { cornStateAttr } from '../corn-state.js';
13
13
  import { relativeTime } from '../review-model.js';
14
14
  import { escapeHtml as escHtml } from '../../core/text.js';
15
15
  import { plural, safeUrl, threadOf, MENTIONABLE } from './work-common.js';
16
+ import { sectionHtml } from '../panel-model.js';
17
+ import { oldItem, workNode } from '../work-model.js';
16
18
 
17
19
  export function install(ctx) {
18
20
  const { inst, ui, m, fn, state, root, $ } = ctx;
@@ -110,7 +112,14 @@ export function install(ctx) {
110
112
 
111
113
  /** Puts the focus back on what opened the form: the node panel's button while it is still there, else the New idea button */
112
114
  function focusIdeaOpener() {
113
- const from = ui.idea.opener ? [...root.querySelectorAll('[data-thread-start]')].find((b) => b.dataset.threadStart === ui.idea.opener) : null;
115
+ let from = ui.idea.opener ? [...root.querySelectorAll('[data-thread-start]')].find((b) => b.dataset.threadStart === ui.idea.opener) : null;
116
+ // On a desktop the list took the node panel's place to show the form (spec 0015 D3): the node's panel comes back in its place, and its button has the focus again
117
+ const node = state.selectedNode;
118
+ if (from && from.closest('[inert]') && ui.open && !m.behind && node && node.id === ui.idea.opener) {
119
+ fn.goBehind();
120
+ if (m.behind) inst.emit('node:show', { node, frame: false }); // (on a phone the sheets take turns on their own: nothing goes behind)
121
+ from = [...root.querySelectorAll('[data-thread-start]')].find((b) => b.dataset.threadStart === ui.idea.opener) || null;
122
+ }
114
123
  (from && !from.closest('[inert]') ? from : $('idea-open')).focus();
115
124
  }
116
125
 
@@ -252,12 +261,13 @@ export function install(ctx) {
252
261
  }
253
262
 
254
263
  /** The thread in the node panel: read-only, its messages as written, a way to reply on the forge, and the nodes its text names */
255
- function threadDetailHtml() {
256
- if (ui.threadError) return `<p class="hx-forge-notice" data-corn="notice">${escHtml(ui.threadError)}</p>`;
257
- if (!ui.threadDetail) return '<p class="hx-faint">Loading its messages …</p>';
264
+ function threadParts() {
265
+ if (ui.threadError) return { notes: `<p class="hx-forge-notice" data-corn="notice">${escHtml(ui.threadError)}</p>` };
266
+ if (!ui.threadDetail) return { notes: '<p class="hx-faint">Loading its messages …</p>' };
258
267
  const { thread: t, stale } = ui.threadDetail;
259
268
  const lit = ui.litThread;
260
269
  const url = safeUrl(t.url);
270
+ // Reply is the thread's one action (spec 0015 D4): a thread is a conversation on the forge, so it is a link there
261
271
  const reply = url ? `<a data-corn="open-link" data-corn-kind="primary" class="hx-btn hx-btn--primary hx-forge-open" href="${escHtml(url)}" target="_blank" rel="noreferrer">Reply on ${escHtml(fn.forgeName())} ↗</a>` : '';
262
272
  const named = [
263
273
  ...(t.proposals || []).map((p) => `Proposal <code class="hx-code">${escHtml(p.slug)}</code> in pull request #${p.pull}`),
@@ -272,18 +282,52 @@ export function install(ctx) {
272
282
  : '';
273
283
  return `<li class="hx-thread-msg" data-corn="thread-message"><p class="hx-forge-meta"><strong class="hx-strong">${escHtml(msg.author ? msg.author.login : 'someone')}</strong>${msg.opening ? ' opened this' : ''} · ${escHtml(relativeTime(msg.createdAt, m.now()))}${link}</p><p class="hx-thread-body">${escHtml(msg.body.trim() === '' ? '(no text)' : msg.body)}${msg.cut ? '\n… (cut here; the rest is on the forge)' : ''}</p>${chips}</li>`;
274
284
  }).join('');
275
- return `<p class="hx-forge-meta">${escHtml(threadKindWords(t))} · ${escHtml(threadMeta({ ...t, comments: t.messages.length - (t.kind === 'idea' ? 1 : 0) + (t.hidden || 0) }, m.now()))}</p>
276
- <p class="hx-forge-why hx-faint">Read-only here: a thread is a conversation on ${escHtml(fn.forgeName())}, so you reply there.</p>
277
- ${reply ? `<div class="hx-forge-cta">${reply}</div>` : ''}
285
+ const notes = `<p class="hx-forge-meta">${escHtml(threadKindWords(t))} · ${escHtml(threadMeta({ ...t, comments: t.messages.length - (t.kind === 'idea' ? 1 : 0) + (t.hidden || 0) }, m.now()))}</p>
278
286
  ${named.length ? `<p class="hx-forge-meta">${named.join(' · ')}</p>` : ''}
279
- ${stale ? `<p class="hx-forge-notice" data-corn="notice">${escHtml(`This is an older answer. ${stale}`)}</p>` : ''}
280
- <h3 class="hx-forge-sub">${escHtml(`Mentions: ${plural(lit.nodes.length, 'node')} on the map`)}</h3>
281
- ${lit.nodes.length ? `<span class="hx-forge-nodes hx-thread-nodes">${lit.nodes.map(fn.nodeButton).join('')}</span>` : '<p class="hx-faint">No message mentions a node. Write [[node-id]] or [[repo/path]] in a message to point at the map.</p>'}
282
- ${lit.unresolved.length ? `<p class="hx-forge-notice" data-corn="notice">${escHtml(lit.unresolved.join(', '))} ${lit.unresolved.length === 1 ? 'is' : 'are'} mentioned but not on the map, so ${lit.unresolved.length === 1 ? 'it stays' : 'they stay'} text.</p>` : ''}
283
- <h3 class="hx-forge-sub">${escHtml(plural(t.messages.length, 'message'))}</h3>
284
- ${t.hidden ? `<p class="hx-forge-why hx-faint">${escHtml(plural(t.hidden, 'earlier message'))} not shown; they are on ${escHtml(fn.forgeName())}.</p>` : ''}
285
- <ol class="hx-thread-msgs" aria-label="Messages">${msgs}</ol>`;
287
+ ${stale ? `<p class="hx-forge-notice" data-corn="notice">${escHtml(`This is an older answer. ${stale}`)}</p>` : ''}`;
288
+ const mentions = sectionHtml({
289
+ key: 'mentions', title: 'Mentions', count: lit.nodes.length,
290
+ body: `${lit.nodes.length ? `<span class="hx-forge-nodes hx-thread-nodes">${lit.nodes.map(fn.nodeButton).join('')}</span>` : '<p class="hx-faint">No message mentions a node. Write [[node-id]] or [[repo/path]] in a message to point at the map.</p>'}
291
+ ${lit.unresolved.length ? `<p class="hx-forge-notice" data-corn="notice">${escHtml(lit.unresolved.join(', '))} ${lit.unresolved.length === 1 ? 'is' : 'are'} mentioned but not on the map, so ${lit.unresolved.length === 1 ? 'it stays' : 'they stay'} text.</p>` : ''}`,
292
+ });
293
+ // The messages are what a thread is: open until it is closed by hand
294
+ const messages = sectionHtml({
295
+ key: 'messages', title: 'Messages', count: t.messages.length, open: true,
296
+ body: `${t.hidden ? `<p class="hx-forge-why hx-faint">${escHtml(plural(t.hidden, 'earlier message'))} not shown; they are on ${escHtml(fn.forgeName())}.</p>` : ''}<ol class="hx-thread-msgs" aria-label="Messages">${msgs}</ol>`,
297
+ });
298
+ return { primary: reply, notes, sections: [mentions, messages] };
299
+ }
300
+
301
+ /**
302
+ * A thread folded into its proposal (spec 0015 D2): its row in the proposal's Connected shows it in the node panel, Reply and Open on the forge with it, while the proposal stays
303
+ * selected on the map (the panel's Back goes to it). The thread is read from the threads list when it is there, else from its own route (`m.preload`: the panel's read is this one).
304
+ */
305
+ async function showFolded(n, id) {
306
+ const into = inst.state.selectedNode;
307
+ const listed = Object.entries(ui.lists).filter(([k]) => k.startsWith('threads|')).flatMap(([, l]) => l.items).find((x) => x.number === n);
308
+ let item = listed ? oldItem('thread', listed) : null;
309
+ if (!item) {
310
+ const res = await fn.request(threadUrl(n), false);
311
+ const thread = res.ok && res.body.thread;
312
+ if (!thread || ctx.dead) { if (!ctx.dead) announce(res.ok ? `Thread ${n} could not be read.` : fn.failWords(res, `thread ${n}`)); return; }
313
+ m.preload = { kind: 'thread', n, res };
314
+ item = oldItem('thread', thread);
315
+ }
316
+ if (!item || ctx.dead) return;
317
+ const node = { ...workNode({ ...item, id: id || item.id }), foldedInto: into && into.id ? into.id : null };
318
+ inst.emit('node:show', { node, frame: false });
319
+ }
320
+
321
+ /** The comments of the threads folded into a proposal, once the threads list has them: "Discussed in Thread #21 · 4 comments" */
322
+ function paintFoldedCounts(box) {
323
+ const items = Object.entries(ui.lists).filter(([k]) => k.startsWith('threads|')).flatMap(([, l]) => l.items);
324
+ for (const el of box.querySelectorAll('[data-folded-count]')) {
325
+ if (el.textContent) continue;
326
+ const hit = items.find((x) => String(x.number) === el.dataset.foldedCount);
327
+ const c = hit && Number(hit.comments);
328
+ if (Number.isInteger(c)) el.textContent = ` · ${c} ${c === 1 ? 'comment' : 'comments'}`;
329
+ }
286
330
  }
287
331
 
288
- Object.assign(fn, { dropThread, selectThread, clearThread, threadSelectionWords, openThread, ensureThreadsList, threadsFor, toggleIdea, focusIdeaOpener, startThread, sendIdea, afterIdea, paintIdea, threadHtml: (...a) => withParts(threadHtml(...a)), threadDetailHtml: (...a) => withParts(threadDetailHtml(...a)) });
332
+ Object.assign(fn, { dropThread, selectThread, clearThread, threadSelectionWords, openThread, ensureThreadsList, threadsFor, toggleIdea, focusIdeaOpener, startThread, sendIdea, afterIdea, paintIdea, threadHtml: (...a) => withParts(threadHtml(...a)), threadParts, showFolded, paintFoldedCounts });
289
333
  }
@@ -84,7 +84,7 @@ export function mount(root, inst, options = {}) {
84
84
  const m = {
85
85
  runsTimer: 0, threadToken: 0, indexToken: 0, indexLoading: false, indexCache: null, listToken: 0, pullToken: 0, notesToken: 0,
86
86
  searchTimer: null, now: options.clock || (() => Date.now()), pageAway: false, specsTimer: 0, specsReading: false, primed: new Set(),
87
- shownKey: '', shownKind: '', returnTo: null, openerEl: null, merged: { entries: null, items: [] }, redrawRuns: new Set(), agentTrap: null, confirmTrap: null,
87
+ shownKey: '', shownKind: '', returnTo: null, openerEl: null, merged: { entries: null, items: [] }, redrawRuns: new Set(), agentTrap: null, confirmTrap: null, behind: false, markRow: false,
88
88
  };
89
89
  const timers = new Set();
90
90
  /** Timers that end with the piece, and do nothing once it has */
@@ -187,9 +187,12 @@ export function mount(root, inst, options = {}) {
187
187
  scope.on('threads:ensure', () => { if (ui.config && ui.threadsOn) fn.ensureThreadsList(); });
188
188
  scope.on('thread:open', ({ number }) => { if (ui.threadsOn) fn.openThread(number).catch(() => {}); });
189
189
  // The node panel shows a piece of work (the Work view's node, or one the lists read): its actions are drawn into it; anything else, or closed, lets go of it
190
- scope.on('node:painted', ({ node }) => { m.shown = node && node.work && node.item ? fn.showDetail(node) : (fn.dropDetail(), Promise.resolve()); });
191
- scope.on('node:close', () => fn.dropDetail());
190
+ // On a desktop the list and the node panel take one place in turns (spec 0015 D3): a node shown while the list is open puts the list behind it, the panel's Back
191
+ // (`panel:back`) brings the list again, and the panel closing closes both
192
+ scope.on('node:painted', ({ node }) => { m.shown = node && node.work && node.item ? fn.showDetail(node) : (fn.dropDetail(), Promise.resolve()); if (node) fn.goBehind(); });
193
+ scope.on('node:close', () => { fn.dropDetail(); if (m.behind) fn.closeForge({ restoreFocus: false }); });
192
194
  scope.on('node:back', () => fn.rowBack()); // the node panel closing gives the focus back to the row that chose it
195
+ scope.on('panel:back', () => fn.panelBack());
193
196
  scope.on('thread:start', ({ node }) => { if (ui.threadsOn && node) fn.startThread(node); });
194
197
  // The map or the proposal changed the nodes: the lights follow them. The header's Proposals menu reads the same list: the Specs tab and its count follow
195
198
  scope.on('scene', fn.onNodesChange);
@@ -225,23 +225,20 @@ export function specRowHtml(entry, { shown = null, nowMs = Date.now() } = {}) {
225
225
  const { state } = specStateOf(entry);
226
226
  const corn = SPEC_STATE_CORN[state];
227
227
  const pill = `<span class="hx-forge-state hx-forge-state--${corn}" data-corn="review-state" data-corn-state="${corn}">${stateIconHtml(corn)}${escHtml(SPEC_STATE_WORDS[state])}</span>`;
228
- const c = entry.counts || {};
228
+ // The card keeps its title, its state and who must act (its group, and the words of its review); the summary, what it adds, changes and removes, and its
229
+ // scenarios are the node panel's (spec 0015 D3)
229
230
  const said = specStateWords(entry, nowMs);
230
231
  const meta = [
231
232
  entry.spec ? `<span>spec ${escHtml(entry.spec)}</span>` : '',
232
233
  `<span>${escHtml(specWhere(entry))}</span>`,
233
234
  said ? `<span class="hx-forge-reviewed">${escHtml(said)}</span>` : '',
234
- c.added ? `<span class="hx-forge-add" title="${c.added} added">+${c.added}</span>` : '',
235
- c.changed ? `<span class="hx-forge-chg" title="${c.changed} changed">~${c.changed}</span>` : '',
236
- c.removed ? `<span class="hx-forge-del" title="${c.removed} removed">\u2212${c.removed}</span>` : '',
237
- c.scenarios ? `<span>${c.scenarios} ${c.scenarios === 1 ? 'scenario' : 'scenarios'}</span>` : '',
238
235
  entry.errors ? `<span class="hx-warn">${entry.errors} ${entry.errors === 1 ? 'problem' : 'problems'}</span>` : '',
239
236
  ].filter(Boolean).join('');
240
237
  const mine = shown === `proposal:${entry.slug}`;
241
238
  const unread = state === 'unknown' ? `<p class="hx-forge-meta hx-forge-unread" data-corn="message" data-corn-state="failure">${escHtml(entry.review && entry.review.error ? entry.review.error : 'The forge could not be asked.')} <button type="button" class="hx-btn hx-forge-act" data-corn-kind="quiet" data-action="retry-forge" aria-label="Try again: ${escHtml(entry.title || entry.slug)}">Try again</button></p>` : '';
242
239
  return `<li class="hx-forge-item"><button type="button" class="hx-forge-row hx-forge-spec" data-work-ref="proposal:${escHtml(entry.slug)}" aria-pressed="${mine}" data-corn="row">`
243
240
  + `<span class="hx-forge-line">${head}${pill}</span>`
244
- + `${entry.summary ? `<span class="hx-forge-sum">${escHtml(entry.summary)}</span>` : ''}<span class="hx-forge-meta hx-forge-facts">${meta}</span></button>${unread}</li>`;
241
+ + `<span class="hx-forge-meta hx-forge-facts">${meta}</span></button>${unread}</li>`;
245
242
  }
246
243
 
247
244
  // ---------------------------------------------------------------------------
@@ -89,6 +89,42 @@ function resultHtml(ctx, run) {
89
89
  return `<p class="hx-forge-result" data-run-result="${ctx.esc(run.runId)}" data-corn="result"${r ? ` data-corn-state="${r.ok ? 'success' : 'failure'}"` : ' hidden'}>${r ? ctx.esc(r.text) : ''}</p>`;
90
90
  }
91
91
 
92
+ /** A waiting run's Continue (the node panel's primary action: `kind` "approve"; in a card of its own, "secondary") */
93
+ function continueHtml(ctx, run, kind) {
94
+ const say = ctx.t || t;
95
+ const off = ctx.busy ? ' aria-disabled="true"' : '';
96
+ return `<button data-corn-kind="${kind}" type="button" class="hx-btn${kind === 'approve' ? ' hx-btn--approve' : ''} hx-forge-act" data-run-answer="continue" data-run-id="${ctx.esc(run.runId)}" aria-label="${ctx.esc(say('continueRun'))}: ${ctx.esc(runName(run, ctx.now))}"${off}>${ctx.esc(say('continueRun'))}</button>`;
97
+ }
98
+
99
+ /** A waiting run's Stop, an answer */
100
+ function answerStopHtml(ctx, run) {
101
+ const say = ctx.t || t;
102
+ const off = ctx.busy ? ' aria-disabled="true"' : '';
103
+ return `<button type="button" class="hx-btn hx-forge-act" data-run-answer="stop" data-run-id="${ctx.esc(run.runId)}" aria-label="${ctx.esc(say('stop'))}: ${ctx.esc(runName(run, ctx.now))}"${off} data-corn-kind="danger">${ctx.esc(say('stop'))}</button>`;
104
+ }
105
+
106
+ /** Start again and Stop (a run that does not wait on an answer), as the card has them */
107
+ function againHtml(ctx, run, kind = 'secondary') {
108
+ const say = ctx.t || t;
109
+ const off = ctx.busy ? ' aria-disabled="true"' : '';
110
+ return canRetry(run) ? `<button data-corn-kind="${kind}" type="button" class="hx-btn${kind === 'approve' ? ' hx-btn--approve' : ''} hx-forge-act" data-forge-retry="${ctx.esc(run.runId)}" aria-label="${ctx.esc(say('startAgain'))}: ${ctx.esc(runName(run, ctx.now))}"${off}>${ctx.esc(say('startAgain'))}</button>` : '';
111
+ }
112
+ function stopHtml(ctx, run) {
113
+ const say = ctx.t || t;
114
+ const off = ctx.busy ? ' aria-disabled="true"' : '';
115
+ return canStop(run) && !canAnswer(run) ? `<button type="button" class="hx-btn hx-forge-act" data-forge-stop="${ctx.esc(run.runId)}" aria-label="${ctx.esc(say('stop'))}: ${ctx.esc(runName(run, ctx.now))}"${off} data-corn-kind="danger">${ctx.esc(say('stop'))}</button>` : '';
116
+ }
117
+
118
+ /**
119
+ * A run's actions as the node panel's bar puts them (spec 0015 D4): Continue is the primary action of a run that waits on an answer, Stop beside it; a run that can start again
120
+ * has Start again; one at work has Stop. The card drawn with `bar: true` in its context leaves these out (its reply field and its Reply stay in it).
121
+ */
122
+ export function runBarParts(ctx, run) {
123
+ if (canAnswer(run)) return { primary: continueHtml(ctx, run, 'approve'), others: [answerStopHtml(ctx, run)] };
124
+ const again = againHtml(ctx, run, 'approve');
125
+ return { primary: again, others: [stopHtml(ctx, run)] };
126
+ }
127
+
92
128
  /** A waiting run: what was asked (the note and link are shown above) and the three answers, plain buttons and a reply field */
93
129
  function answerHtml(ctx, run) {
94
130
  const say = ctx.t || t; // the words of the instance that draws it (the Work piece hands its own), else the page's
@@ -96,9 +132,10 @@ function answerHtml(ctx, run) {
96
132
  const name = ctx.esc(runName(run, ctx.now));
97
133
  const off = ctx.busy ? ' aria-disabled="true"' : ''; // not `disabled`: the pressed button keeps the focus (a click on it is dropped: pieces/work-list.js `onDetailClick`)
98
134
  const reply = ctx.replies && ctx.replies.get(run.runId) || '';
99
- return `${run.answer ? answeredHtml(ctx, run) : ''}<div class="hx-run-actions" data-corn="run-actions" role="group" aria-label="Answer: ${name}">
100
- <button data-corn-kind="secondary" type="button" class="hx-btn hx-forge-act" data-run-answer="continue" data-run-id="${id}" aria-label="${ctx.esc(say('continueRun'))}: ${name}"${off}>${ctx.esc(say('continueRun'))}</button>
101
- <button type="button" class="hx-btn hx-forge-act" data-run-answer="stop" data-run-id="${id}" aria-label="${ctx.esc(say('stop'))}: ${name}"${off} data-corn-kind="danger">${ctx.esc(say('stop'))}</button></div>
135
+ // In the node panel Continue and Stop are its action bar's (`runBarParts`): the card keeps the reply field and its Reply
136
+ return `${run.answer ? answeredHtml(ctx, run) : ''}${ctx.bar ? '' : `<div class="hx-run-actions" data-corn="run-actions" role="group" aria-label="Answer: ${name}">
137
+ ${continueHtml(ctx, run, 'secondary')}
138
+ ${answerStopHtml(ctx, run)}</div>`}
102
139
  <label class="hx-forge-field" data-corn="field">Reply to ${ctx.esc(`${run.kind} on ${aboutWords(run.refs)}`)}<input data-corn="control" type="text" class="hx-forge-input" data-run-reply="${id}" value="${ctx.esc(reply)}" maxlength="4000" autocomplete="off" /></label>
103
140
  <div class="hx-run-actions" data-corn="run-actions"><button data-corn-kind="secondary" type="button" class="hx-btn hx-forge-act" data-run-answer="reply" data-run-id="${id}" aria-label="${ctx.esc(say('reply'))}: ${name}"${off}>${ctx.esc(say('reply'))}</button></div>`;
104
141
  }
@@ -141,15 +178,12 @@ export function loadingLinesHtml(n = 1) {
141
178
 
142
179
  /** One run */
143
180
  export function runHtml(ctx, run, all) {
144
- const say = ctx.t || t;
145
181
  const open = ctx.timelines.has(run.runId);
146
182
  const why = statusWhy(run);
147
- const name = ctx.esc(runName(run, ctx.now));
148
183
  const note = run.report && run.report.note ? `<p class="hx-forge-meta">Runner: ${ctx.esc(run.report.note)}</p>` : '';
149
184
  const answering = canAnswer(run);
150
- const off = ctx.busy ? ' aria-disabled="true"' : ''; // not `disabled`: the pressed button keeps the focus (a click on it is dropped: pieces/work-list.js `onDetailClick`)
151
- const retry = canRetry(run) ? `<button data-corn-kind="secondary" type="button" class="hx-btn hx-forge-act" data-forge-retry="${ctx.esc(run.runId)}" aria-label="${ctx.esc(say('startAgain'))}: ${name}"${off}>${ctx.esc(say('startAgain'))}</button>` : '';
152
- const stop = canStop(run) && !answering ? `<button type="button" class="hx-btn hx-forge-act" data-forge-stop="${ctx.esc(run.runId)}" aria-label="${ctx.esc(say('stop'))}: ${name}"${off} data-corn-kind="danger">${ctx.esc(say('stop'))}</button>` : '';
185
+ const retry = ctx.bar ? '' : againHtml(ctx, run); // in the node panel, Start again and Stop are its action bar's (`runBarParts`)
186
+ const stop = ctx.bar ? '' : stopHtml(ctx, run);
153
187
  const names = nodeLabels(run.nodes, ctx.nodes);
154
188
  const collision = collisionWords(run, all, ctx.nodes);
155
189
  const limits = limitRows(run);
package/explorer/scene.js CHANGED
@@ -500,7 +500,11 @@ function buildEdges(state, subgraph, reduceMotion) {
500
500
  const target = byId.get(edge.to);
501
501
  if (!source || !target || !isNodeVisible(state, source) || !isNodeVisible(state, target)) return;
502
502
 
503
- if (state.view === 'work') { out.push(state.workEdge(edge, source, target, subgraph ? subgraph.connectedEdgeKeys.has(focusKey(edge)) : true, !!subgraph, edgeKeyOf(edge), { PROPOSED_DASH, USAGE_DASH }, state.workEdgeColors)); return; } // the Work view's lines are work-model.js's (the page installs `workEdge`)
503
+ if (state.view === 'work') { // the Work view's lines are work-model.js's (the page installs `workEdge`): a line to code only for the selection and the node under the pointer (spec 0015 D1)
504
+ const line = state.workEdge(edge, source, target, subgraph ? subgraph.connectedEdgeKeys.has(focusKey(edge)) : true, !!subgraph, edgeKeyOf(edge), { PROPOSED_DASH, USAGE_DASH }, state.workEdgeColors, { selected: state.selectedNode ? state.selectedNode.id : null, hover: state.hoverNodeId || null });
505
+ if (line) out.push(line);
506
+ return;
507
+ }
504
508
  if (preset) return flow(edge, source, target);
505
509
  if (state.view === 'house') { const how = houseEdgeStyle(edge, source, target); if (how === 'flow') flow(edge, source, target); else if (how === 'link') out.push(linkEdge(edge, source, target, subgraph)); return; }
506
510