cornfield 0.55.0 → 0.56.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 (39) hide show
  1. package/core/contrast.js +12 -1
  2. package/core/schema.js +6 -0
  3. package/core/strings.js +0 -1
  4. package/explorer/css/page.css +0 -8
  5. package/explorer/css/work.css +3 -26
  6. package/explorer/deep-link.js +11 -24
  7. package/explorer/engine/map-style.js +4 -1
  8. package/explorer/forge-panel-model.js +2 -36
  9. package/explorer/forge-panel.js +3 -8
  10. package/explorer/index.html +1 -10
  11. package/explorer/instance-state.js +0 -6
  12. package/explorer/instance.js +9 -5
  13. package/explorer/page.js +5 -4
  14. package/explorer/pieces/node-panel.js +9 -5
  15. package/explorer/pieces/work-agent.js +3 -2
  16. package/explorer/pieces/work-common.js +14 -15
  17. package/explorer/pieces/work-confirm.js +11 -10
  18. package/explorer/pieces/work-data.js +24 -31
  19. package/explorer/pieces/work-deploys.js +42 -41
  20. package/explorer/pieces/work-issues.js +32 -29
  21. package/explorer/pieces/work-list.js +406 -0
  22. package/explorer/pieces/work-markup.js +9 -14
  23. package/explorer/pieces/work-notes.js +0 -1
  24. package/explorer/pieces/work-paint.js +57 -62
  25. package/explorer/pieces/work-prs.js +25 -66
  26. package/explorer/pieces/work-runs.js +47 -57
  27. package/explorer/pieces/work-specs.js +19 -2
  28. package/explorer/pieces/work-threads.js +28 -48
  29. package/explorer/pieces/work.js +28 -40
  30. package/explorer/proposal-model.js +5 -5
  31. package/explorer/runs-view.js +10 -18
  32. package/explorer/scene.js +1 -3
  33. package/explorer/tokens.css +4 -0
  34. package/explorer/waiting-view.js +3 -3
  35. package/explorer/work-model.js +79 -38
  36. package/explorer/work-view.css +3 -4
  37. package/explorer/work-view.js +77 -49
  38. package/package.json +1 -1
  39. package/explorer/pieces/work-events.js +0 -285
@@ -1,13 +1,14 @@
1
1
  /**
2
2
  * @module explorer/pieces/work-specs
3
3
  *
4
- * The Specs tab: the proposals the server finds, merged into one row each, and the number of those that wait on a decision. Part of the Work piece (pieces/work.js): `install(ctx)` makes this part's functions for one mount, and hands the ones other parts call
4
+ * The Specs tab: the proposals the server finds, merged into one row each, the number of those that wait on a decision, and a proposal's actions in the node panel. Part of the Work piece (pieces/work.js): `install(ctx)` makes this part's functions for one mount, and hands the ones other parts call
5
5
  * to `ctx.fn`; nothing is shared between two mounts.
6
6
  */
7
7
 
8
8
  import { mergeSpecs } from '../proposal-model.js';
9
9
  import { waiting, specGroups } from '../waiting-model.js';
10
10
  import { plural, SPECS_POLL_MS } from './work-common.js';
11
+ import { escapeHtml as escHtml } from '../../core/text.js';
11
12
 
12
13
  export function install(ctx) {
13
14
  const { inst, ui, m, fn, $ } = ctx;
@@ -67,5 +68,21 @@ export function install(ctx) {
67
68
  }, SPECS_POLL_MS);
68
69
  }
69
70
 
70
- Object.assign(fn, { specsList, waitingNow, loadSpecs, specsShownWords, readSpecsQuiet, syncSpecsPoll });
71
+ /** The entry of the proposals list a node of the graph is: the open spec PR when it has a number, else the copy that is only a file in a checkout (where Review opens it from) */
72
+ function specEntry(item) {
73
+ const list = specsList();
74
+ const items = list ? list.items : [];
75
+ return items.find((e) => e.slug === item.slug && (item.number ? e.pull && e.pull.number === item.number : !e.pull)) || items.find((e) => e.slug === item.slug) || null;
76
+ }
77
+
78
+ /** A proposal's actions in the node panel: Review (opens it over the map; Approve and Send back are the review's), and Start an agent on it when the config lets a run start */
79
+ function proposalActionsHtml(item) {
80
+ const entry = specEntry(item);
81
+ const source = (entry && entry.source) || item.source || '';
82
+ const review = `<button type="button" class="hx-btn hx-btn--approve hx-forge-act" data-corn-kind="approve" data-work-action="review" data-slug="${escHtml(item.slug)}" data-source="${escHtml(source)}">Review …</button>`;
83
+ const agent = fn.canStartAgent() ? `<button data-corn-kind="secondary" type="button" class="hx-btn hx-forge-act" data-forge-agent="proposal:${escHtml(item.slug)}" aria-label="${escHtml(t('startAgent'))} on proposal ${escHtml(item.slug)}">${escHtml(t('startAgent'))} …</button>` : '';
84
+ return `<div class="hx-forge-cta">${review}${agent}</div>`;
85
+ }
86
+
87
+ Object.assign(fn, { specsList, waitingNow, loadSpecs, specsShownWords, readSpecsQuiet, syncSpecsPoll, specEntry, proposalActionsHtml });
71
88
  }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @module explorer/pieces/work-threads
3
3
  *
4
- * The Threads tab: the list, a thread's messages, and the New idea form. Part of the Work piece (pieces/work.js): `install(ctx)` makes this part's functions for one mount, and hands the ones other parts call
4
+ * The Threads tab: the list, a thread's messages in the node panel, and the New idea form. Part of the Work piece (pieces/work.js): `install(ctx)` makes this part's functions for one mount, and hands the ones other parts call
5
5
  * to `ctx.fn`; nothing is shared between two mounts.
6
6
  */
7
7
 
@@ -12,15 +12,15 @@ import { defaultFilters, threadsUrl, threadUrl, IDEAS_URL, threadKindWords, thre
12
12
  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
- import { plural, safeUrl, backHtml, threadOf, MENTIONABLE } from './work-common.js';
15
+ import { plural, safeUrl, threadOf, MENTIONABLE } from './work-common.js';
16
16
 
17
17
  export function install(ctx) {
18
18
  const { inst, ui, m, fn, state, root, $ } = ctx;
19
- const { announce, t, render, touchScene, repaintThreads } = ctx.h;
19
+ const { announce, repaintThreads } = ctx.h;
20
20
 
21
21
  /** Forgets the selected thread without painting: another thing is being selected */
22
22
  function dropThread() {
23
- ui.runSel = null;
23
+ ui.runShown = null;
24
24
  m.threadToken++;
25
25
  ui.thread = null;
26
26
  ui.threadDetail = null;
@@ -31,7 +31,7 @@ export function install(ctx) {
31
31
  async function selectThread(n) {
32
32
  const token = ++m.threadToken;
33
33
  m.pullToken++;
34
- ui.runSel = null;
34
+ ui.runShown = null;
35
35
  ui.selected = null;
36
36
  ui.detail = null;
37
37
  ui.detailError = '';
@@ -44,11 +44,8 @@ export function install(ctx) {
44
44
  ui.threadDetail = null;
45
45
  ui.threadError = '';
46
46
  ui.litThread = null;
47
- state.forgeLit = null;
48
- touchScene();
49
- render();
50
47
  fn.paint();
51
- const res = await fn.request(threadUrl(n), false);
48
+ const res = fn.preloaded('thread', n) || await fn.request(threadUrl(n), false);
52
49
  if (token !== m.threadToken) return;
53
50
  // An answer without a thread in it is a failure too: nothing to show or light
54
51
  const thread = threadOf(res);
@@ -59,40 +56,26 @@ export function install(ctx) {
59
56
  return;
60
57
  }
61
58
  ui.threadDetail = { thread, at: res.body.at, rate: res.body.rate || '', stale: res.body.stale || '' };
62
- fn.relight();
63
- $('forge-panel').querySelector('.hx-forge-body').scrollTop = 0; // the thread's messages are what was asked for, not the row that was tapped
64
- announce(threadSelectionWords());
59
+ fn.figure();
60
+ fn.sayDetail(threadSelectionWords());
65
61
  }
66
62
 
67
- /** Lets go of the selected thread: nothing is lit any more */
63
+ /** Lets go of the thread in the node panel (another node was chosen, or the panel closed) */
68
64
  function clearThread() {
69
- const had = ui.thread;
70
65
  dropThread();
71
- state.forgeLit = null;
72
- touchScene();
73
- render();
74
- fn.paint();
75
- if (had !== null) announce(`Thread ${had} cleared`);
76
66
  }
77
67
 
78
68
  /** What a screen reader hears when a thread is selected */
79
69
  function threadSelectionWords() {
80
70
  const { thread } = ui.threadDetail;
81
- const lit = ui.litThread ? ui.litThread.nodes.length : 0;
71
+ const on = ui.litThread ? ui.litThread.nodes.length : 0;
82
72
  const off = ui.litThread ? ui.litThread.unresolved.length : 0;
83
- return `Thread ${thread.number}, ${thread.title}: ${plural(thread.messages.length, 'message')}, ${lit ? `${plural(lit, 'node')} lit` : 'no node mentioned'}${off ? `, ${off} named that ${off === 1 ? 'is' : 'are'} not on the map` : ''}. Read-only: reply on ${fn.forgeName()}.`;
73
+ return `Thread ${thread.number}, ${thread.title}: ${plural(thread.messages.length, 'message')}, ${on ? `${plural(on, 'node')} on the map` : 'no node mentioned'}${off ? `, ${off} named that ${off === 1 ? 'is' : 'are'} not on the map` : ''}. Read-only: reply on ${fn.forgeName()}.`;
84
74
  }
85
75
 
86
- /** Shows a thread from the map (a node's "Mentioned in"): the panel opens on the Threads tab with that thread selected */
76
+ /** Shows a thread from the map (a node's "Mentioned in"): the thread's node is selected, or, for one the Work view does not draw, the node panel shows it by the same path as a row of the list */
87
77
  function openThread(n) {
88
- if (ui.kind !== 'threads') {
89
- ui.kind = 'threads';
90
- ui.actNote = null;
91
- ui.filters = defaultFilters('threads');
92
- }
93
- fn.openForge({ tab: 'threads' }); // named, so a closed panel does not open on the tab with the oldest thing waiting instead
94
- fn.paintFilters();
95
- selectThread(n);
78
+ return fn.showRef('thread', String(n));
96
79
  }
97
80
 
98
81
  /** The threads list for the node panel's "Mentioned in", read once (quietly) when a node is first selected, and when the Threads tab loads it */
@@ -192,7 +175,7 @@ export function install(ctx) {
192
175
  }
193
176
 
194
177
  /**
195
- * After an idea is opened: the list read again, the new thread selected (so what it mentions lights), the focus back on what opened
178
+ * After an idea is opened: the list read again, the new thread shown in the node panel (from the list's form), the focus back on what opened
196
179
  * the form, and all of it said once. The idea is on the forge whatever happens here, so a failure is said, never thrown.
197
180
  */
198
181
  async function afterIdea(res) {
@@ -208,8 +191,8 @@ export function install(ctx) {
208
191
  await fn.loadList(true, true);
209
192
  if (ui.open) fn.primeCounts();
210
193
  ensureThreadsList();
211
- // The new thread is selected in the list, so what it mentions lights on the map once its messages are in
212
- if (Number.isInteger(n)) await selectThread(n);
194
+ // An idea opened from the form of the list is shown in the node panel, with what it mentions; one opened from a node's panel leaves that panel as it is: its "Mentioned in" lists the new thread
195
+ if (Number.isInteger(n) && !about) await fn.showRef('thread', String(n));
213
196
  } catch (err) {
214
197
  trouble = ` The list could not be read again (${err instanceof Error ? err.message : err}); Refresh asks for it.`;
215
198
  }
@@ -217,7 +200,7 @@ export function install(ctx) {
217
200
  try { focusIdeaOpener(); } catch { /* the page moved on */ }
218
201
  ui.idea.opener = '';
219
202
  ui.idea.node = null;
220
- const shown = ui.thread === n && ui.threadDetail && ui.threadDetail.thread ? ` ${threadSelectionWords()}` : ui.thread === n && ui.threadError ? ` ${ui.threadError}` : '';
203
+ const shown = ui.thread === n && ui.threadDetail && ui.threadDetail.thread ? ` ${threadSelectionWords()}` : ui.thread === n && ui.threadError ? ` ${ui.threadError}` : !about && ui.actNote && !ui.actNote.ok ? ` ${ui.actNote.text}` : '';
221
204
  // Opened from a node: say that its "Mentioned in" lists the new thread
222
205
  const listed = about && (threadsFor(about.id) || []).some((t) => t.number === n);
223
206
  announce(`${ui.idea.message}${shown}${listed ? ` It is listed under Threads for ${about.label}.` : ''}${trouble}`);
@@ -228,7 +211,7 @@ export function install(ctx) {
228
211
  const bar = $('forge-idea');
229
212
  if (!bar) return;
230
213
  // An idea is a thread: with threads off (`threads: false`) there is no New idea, on Specs either
231
- bar.hidden = (ui.kind !== 'threads' && ui.kind !== 'specs') || !!fn.detailKey() || !ui.config || ui.config.threads === false;
214
+ bar.hidden = (ui.kind !== 'threads' && ui.kind !== 'specs') || !ui.config || ui.config.threads === false;
232
215
  $('idea-open').setAttribute('aria-expanded', String(ui.idea.open));
233
216
  $('idea-form').hidden = !ui.idea.open;
234
217
  $('idea-send').textContent = ui.idea.busy ? 'Opening …' : 'Open the idea';
@@ -263,20 +246,19 @@ export function install(ctx) {
263
246
  const runs = ui.runs && ui.runs.data ? ui.runs.data.runs : null;
264
247
  const run = runOnThread(runs, t.number);
265
248
  const runWord = run ? `${runPillHtml({ esc: escHtml }, run, threadRunWords(runs, t.number), ` data-thread-run="${escHtml(run.runId)}"`)} ` : '';
266
- 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">
249
+ return `<li class="hx-forge-item"><button type="button" class="hx-forge-row" data-work-ref="thread:${t.number}" aria-pressed="${fn.isShown(`thread:${t.number}`)}" data-corn="row">
267
250
  <span class="hx-forge-title">${escHtml(t.title)}</span>
268
251
  <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, m.now()))}</span>${note ? `<span class="hx-forge-meta">${escHtml(note)}</span>` : ''}</button>${out}</li>`;
269
252
  }
270
253
 
271
- /** The selected thread: read-only, its messages as written, a way to reply on the forge, and the nodes its text lights */
254
+ /** 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 */
272
255
  function threadDetailHtml() {
273
- const head = (title) => `${backHtml('clear-forge-thread', 'All threads')}<h3 class="hx-forge-detail-title" data-corn="detail-title">${title}</h3>`;
274
- if (ui.threadError) return `${head(`Thread ${ui.thread}`)}<p class="hx-forge-notice" data-corn="notice">${escHtml(ui.threadError)}</p>`;
275
- if (!ui.threadDetail) return `${head(`Thread ${ui.thread}`)}<p class="hx-faint">Loading its messages …</p>`;
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>';
276
258
  const { thread: t, stale } = ui.threadDetail;
277
259
  const lit = ui.litThread;
278
260
  const url = safeUrl(t.url);
279
- const reply = url ? `<a data-corn="text-link" class="hx-link" href="${escHtml(url)}" target="_blank" rel="noreferrer">Reply on ${escHtml(fn.forgeName())} (new tab)</a>` : '';
261
+ 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>` : '';
280
262
  const named = [
281
263
  ...(t.proposals || []).map((p) => `Proposal <code class="hx-code">${escHtml(p.slug)}</code> in pull request #${p.pull}`),
282
264
  ...(t.kind === 'proposal' ? [`Spec pull request for <code class="hx-code">${escHtml((t.slugs || []).join(', '))}</code>`] : []),
@@ -290,17 +272,15 @@ export function install(ctx) {
290
272
  : '';
291
273
  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>`;
292
274
  }).join('');
293
- 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>` : '';
294
- return `${head(`#${t.number} ${escHtml(t.title)}`)}
295
- <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) }, m.now()))}</p>
296
- <p class="hx-forge-why hx-faint">Read-only here: a thread is a conversation on ${escHtml(fn.forgeName())}, so you reply there. ${reply}</p>
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>` : ''}
297
278
  ${named.length ? `<p class="hx-forge-meta">${named.join(' · ')}</p>` : ''}
298
279
  ${stale ? `<p class="hx-forge-notice" data-corn="notice">${escHtml(`This is an older answer. ${stale}`)}</p>` : ''}
299
- <h4 class="hx-forge-sub">${escHtml(`Mentions: ${plural(lit.nodes.length, 'node')} on the map`)}</h4>
300
- ${key}
280
+ <h3 class="hx-forge-sub">${escHtml(`Mentions: ${plural(lit.nodes.length, 'node')} on the map`)}</h3>
301
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>'}
302
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>` : ''}
303
- <h4 class="hx-forge-sub">${escHtml(plural(t.messages.length, 'message'))}</h4>
283
+ <h3 class="hx-forge-sub">${escHtml(plural(t.messages.length, 'message'))}</h3>
304
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>` : ''}
305
285
  <ol class="hx-thread-msgs" aria-label="Messages">${msgs}</ol>`;
306
286
  }
@@ -1,10 +1,11 @@
1
1
  /**
2
2
  * @module explorer/pieces/work
3
3
  *
4
- * The Work panel as a piece on the instance (spec 0011 D2 and D3; CF-07, CF-42, spec 0001 section 4, spec 0010): the Work button with its badge, the
5
- * panel with its tabs (Specs, PRs, Issues, Threads, Runs, Deploys, and Release notes one level down on PRs), the two dialogs it opens (the confirm
6
- * step and Start an agent) and the layer over the map that marks the nodes an open run is changing. What the panel shows, asks and does is the
7
- * parts' (work-*.js, one module each); this file makes them for one mount, wires them to the instance, and ends them.
4
+ * The Work piece on the instance (spec 0011 D2 and D3; CF-07, CF-42, spec 0001 section 4, spec 0010, spec 0012 D5 and D6): the Work list with its tabs (Specs, PRs, Issues,
5
+ * Threads, Runs, Deploys, and Release notes one level down on PRs; the List toggle of the Work view opens it), the actions of a piece of work in the node panel (Land it,
6
+ * Re-run, Start an agent, a run's answer field ...), the two dialogs those open (the confirm step and Start an agent) and the layer over the map that marks the nodes an open
7
+ * run is changing. What the list shows, asks and does is the parts' (work-*.js, one module each; the list's own is work-list.js); this file makes them for one mount, wires
8
+ * them to the instance, and ends them.
8
9
  *
9
10
  * mount(root, inst, { slots, config, clock }) -> { update, destroy, elements, ... }
10
11
  * slots where cornfield's page leaves the places (`<!--corn-piece:work/button-->`, `work/panel`, `work/overlay`, `work/dialogs`); a host
@@ -26,9 +27,10 @@
26
27
  * POST /api/agent-runs/<id>/stop {} POST /api/agent-runs/<id>/answer {action: 'continue'|'stop'|'reply', text?}
27
28
  * (and GET /proposals, which the engine reads for the Specs tab: engine/proposal.js)
28
29
  *
29
- * Events and asks (instance.js lists them): hears `work:open-specs` (ask, answers true), `forge:can-start` (ask) and `forge:start`, `thread:open`,
30
- * `thread:start`, `threads:ensure`, `threads:index` (ask), `proposal:bar`, `decision`, `work:answer`, `work:on` (ask), `scene`; says `work:waiting {total}`,
31
- * `work:available {on}`, `proposal:waiting`, `proposal:waiting-reset`, `runs:map {active}`, `threads:changed`, `announce`.
30
+ * Events and asks (instance.js lists them): hears `forge:can-start` (ask) and `forge:start`, `thread:open`, `thread:start`, `threads:ensure`, `threads:index` (ask),
31
+ * `proposal:bar`, `decision`, `work:answer`, `work:open-specs` (ask, answers true), `work:on` (ask), `node:painted` and `node:close` (the node panel shows a piece of work, or lets it go), `scene`; asks
32
+ * `work:pick {kind, key}` (the Work view selects that node: true); says `work:waiting {total}`, `work:available {on}`,
33
+ * `work:list {open}`, `proposal:waiting`, `proposal:waiting-reset`, `runs:map {active}`, `threads:changed`, `announce`.
32
34
  */
33
35
 
34
36
  import { place, scopeOf } from '../engine/piece.js';
@@ -39,7 +41,6 @@ import { t } from '../engine/strings.js';
39
41
  import { isPhone, registerSheet, unregisterSheet, expandSheet, collapseSheet, showSheet, refreshStubs } from '../engine/sheets.js';
40
42
  import { sayResult, clearResult, resultOf, showResultIn } from '../engine/feedback.js';
41
43
  import { selectNode } from '../engine/selection.js';
42
- import { toggleLayer } from '../engine/layers.js';
43
44
  import { notSentWords } from '../engine/connection.js';
44
45
  import * as P from '../engine/proposal.js';
45
46
  import { isNodeVisible } from '../scene.js';
@@ -57,7 +58,7 @@ import { install as installNotes } from './work-notes.js';
57
58
  import { install as installConfirm } from './work-confirm.js';
58
59
  import { install as installAgent } from './work-agent.js';
59
60
  import { install as installPaint } from './work-paint.js';
60
- import { install as installEvents } from './work-events.js';
61
+ import { install as installList } from './work-list.js';
61
62
 
62
63
  export { markup, RUNS_POLL_MS, SPECS_POLL_MS };
63
64
 
@@ -71,7 +72,6 @@ export function mount(root, inst, options = {}) {
71
72
  const mk = markup();
72
73
  const slots = options.slots || {};
73
74
  const made = [
74
- ...place(inst, root, mk.button, slots, 'button'),
75
75
  ...place(inst, root, mk.panel, slots, 'panel'),
76
76
  ...place(inst, root, mk.overlay, slots, 'overlay'),
77
77
  ...place(inst, root, mk.dialogs, slots, 'dialogs'),
@@ -103,13 +103,10 @@ export function mount(root, inst, options = {}) {
103
103
  collapseSheet: (id) => collapseSheet(inst, id),
104
104
  showSheet: (id) => showSheet(inst, id),
105
105
  refreshStubs: () => refreshStubs(inst),
106
- render: () => { if (inst.map) inst.map.render(); },
107
- touchScene: () => inst.touchScene(),
108
106
  nodeById: (id) => inst.state.nodes.find((n) => n.id === id),
109
107
  isNodeVisible: (node) => (inst.map ? inst.map.isNodeVisible(node) : isNodeVisible(inst.state, node)),
110
108
  selectNode: (node, opts) => selectNode(inst, node, opts),
111
109
  repaintThreads: () => inst.emit('threads:changed'),
112
- toggleLayer: (key) => toggleLayer(inst, key),
113
110
  sayResult: (key, text, ok) => sayResult(inst, key, text, ok),
114
111
  clearResult: (key) => clearResult(inst, key),
115
112
  resultOf: (key) => resultOf(inst, key),
@@ -138,7 +135,7 @@ export function mount(root, inst, options = {}) {
138
135
  };
139
136
  const ctx = { inst, ui: freshUi(), m, fn: {}, state: inst.state, root: inst.root || root, $: (id) => inst.el(id), scope, h, dead: false };
140
137
  const { ui, fn } = ctx;
141
- for (const install of [installData, installSpecs, installPrs, installIssues, installThreads, installRuns, installDeploys, installNotes, installConfirm, installAgent, installPaint, installEvents]) install(ctx);
138
+ for (const install of [installData, installSpecs, installPrs, installIssues, installThreads, installRuns, installDeploys, installNotes, installConfirm, installAgent, installPaint, installList]) install(ctx);
142
139
 
143
140
  // -- the panel starts once the config says there is a forge and somebody is signed in ---------------------------------------------------
144
141
  let on = false;
@@ -152,7 +149,7 @@ export function mount(root, inst, options = {}) {
152
149
  ui.config = config;
153
150
  const first = !on;
154
151
  on = true;
155
- for (const toggle of ctx.root.querySelectorAll('[data-action="toggle-forge"]')) toggle.hidden = false;
152
+ for (const toggle of ctx.root.querySelectorAll('[data-action="toggle-forge"]')) toggle.hidden = false; // the Work view's List toggle, if it is there already (it asks `work:on` when it is made)
156
153
  panel.hidden = false;
157
154
  inst.emit('work:available', { on: true });
158
155
  // `threads: false` in the config turns the tab off; a server that does not say has threads
@@ -160,9 +157,9 @@ export function mount(root, inst, options = {}) {
160
157
  const tab = panel.querySelector('[data-forge-kind="threads"]');
161
158
  if (tab) tab.hidden = !threadsOn;
162
159
  ui.threadsOn = threadsOn;
163
- // On a phone Work is a sheet: it opens as a peek and displaces the node panel; folded to a stub it says its title and what waits on you (spec 0010 D7)
160
+ // On a phone the list is a sheet: it opens as a peek and displaces the node panel (and the reverse); folded to a stub it says its title and what waits on you (spec 0010 D7)
164
161
  registerSheet(inst, 'forge', panel, {
165
- stub: () => { const n = fn.waitingNow().total; return { title: h.t('issuesAndPrs'), badge: n ? String(n) : '', label: workButtonName(h.t('issuesAndPrs'), n, h.t) }; },
162
+ stub: () => { const n = fn.waitingNow().total; return { title: 'Work list', badge: n ? String(n) : '', label: workButtonName('Work list', n, h.t) }; },
166
163
  away: () => fn.closeForge({ restoreFocus: false }),
167
164
  });
168
165
  fn.paintFilters();
@@ -181,14 +178,18 @@ export function mount(root, inst, options = {}) {
181
178
  scope.on('decision', ({ open }) => { if (open !== false) fn.readSpecsQuiet(); });
182
179
  scope.on('proposal:bar', ({ open }) => fn.paintBarLine(open));
183
180
  scope.on('work:answer', ({ run }) => { fn.answerFromBar(run); });
184
- // A bad link's way on, and the node panel's "Start a run"
181
+ // A bad link's way on (the proposal bar asks), and the node panel's "Start a run"
185
182
  scope.on('work:open-specs', () => { fn.openForge({ tab: 'specs' }); return true; });
186
183
  scope.on('forge:can-start', () => fn.canStartAgent());
187
184
  scope.on('forge:start', ({ slug, returnTo }) => { fn.openProposalStart(slug, returnTo); });
188
185
  // A node's panel lists the threads that mention it; a click there shows one in this panel
189
186
  scope.on('threads:index', (nodeId) => (ui.config && ui.threadsOn ? { threads: fn.threadsFor(nodeId), forge: fn.forgeName(), start: true } : undefined));
190
187
  scope.on('threads:ensure', () => { if (ui.config && ui.threadsOn) fn.ensureThreadsList(); });
191
- scope.on('thread:open', ({ number }) => { if (ui.threadsOn) fn.openThread(number); });
188
+ scope.on('thread:open', ({ number }) => { if (ui.threadsOn) fn.openThread(number).catch(() => {}); });
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());
192
+ scope.on('node:back', () => fn.rowBack()); // the node panel closing gives the focus back to the row that chose it
192
193
  scope.on('thread:start', ({ node }) => { if (ui.threadsOn && node) fn.startThread(node); });
193
194
  // 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
194
195
  scope.on('scene', fn.onNodesChange);
@@ -196,13 +197,18 @@ export function mount(root, inst, options = {}) {
196
197
  scope.own(inst.onNetwork((offline) => { if (!offline) fn.readOnline(); })); // ends with the piece, not only with the instance
197
198
  scope.own(inst.onPageHide(() => fn.onPageHide()));
198
199
  scope.own(inst.onPageShow(() => fn.onPageShow()));
199
- // Any `data-action="toggle-forge"` opens and closes the panel
200
+ // Any `data-action="toggle-forge"` (the Work view's List toggle) opens and closes the list
200
201
  scope.listen(ctx.root, 'click', (e) => {
201
202
  const el = e.target.closest && e.target.closest('[data-action="toggle-forge"]');
202
203
  if (!el) return;
203
204
  m.openerEl = el;
204
205
  fn.toggleForge();
205
206
  });
207
+ // What is in the node panel's actions is the page's, not the list's: its clicks, a reply being typed and Enter in it are heard on the root
208
+ const inDetail = (e) => e.target.closest && e.target.closest('[data-corn="work-detail"]');
209
+ scope.listen(ctx.root, 'click', (e) => { if (inDetail(e)) fn.onDetailClick(e); });
210
+ scope.listen(ctx.root, 'input', (e) => { if (inDetail(e)) fn.onDetailInput(e); });
211
+ scope.listen(ctx.root, 'keydown', (e) => { if (inDetail(e)) fn.onDetailKey(e); });
206
212
  // A control tabbed to inside the strip of tabs is brought fully into view, ring and all (focus-room.js)
207
213
  scope.listen(ctx.root, 'focusin', (e) => { revealInStrip(e.target); });
208
214
  const tabs = panel.querySelector('.hx-forge-tabs');
@@ -248,8 +254,6 @@ export function mount(root, inst, options = {}) {
248
254
  ctx.dead = true;
249
255
  if (ui.confirm) fn.closeConfirm({ restoreFocus: false });
250
256
  if (ui.agent) fn.closeAgent({ restoreFocus: false });
251
- // What this panel lit and said goes with it
252
- if (inst.state.forgeLit) inst.state.forgeLit = null;
253
257
  runsMap.destroy();
254
258
  inst.emit('proposal:waiting-reset');
255
259
  inst.emit('work:waiting', { total: 0 });
@@ -271,25 +275,9 @@ export function mount(root, inst, options = {}) {
271
275
  closeForge: (opts) => fn.closeForge(opts),
272
276
  toggleForge: () => fn.toggleForge(),
273
277
  refreshForge: (opts) => fn.refreshForge(opts),
274
- clearPull: () => fn.clearPull(),
275
- clearDeploy: () => fn.clearDeploy(),
276
- clearThread: () => fn.clearThread(),
277
- selectDeploy: (id) => fn.selectDeploy(id),
278
- openRunLink: (id) => fn.openRunLink(id),
279
- openIssueLink: (n) => fn.openIssueLink(n),
280
278
  openProposalStart: (slug, opener) => fn.openProposalStart(slug, opener),
281
- /** The panel at a piece of work from the Work view (spec 0012, step 2): its tab, and the item open in it. `item` is a node of the work graph */
282
- openWorkAt: async (item) => {
283
- if (item.kind === 'run') return fn.openRunLink(item.runId);
284
- if (item.kind === 'issue') return fn.openIssueLink(item.number);
285
- if (item.kind === 'thread') { fn.openThread(item.number); return true; }
286
- const tab = { pull: 'pulls', proposal: 'specs', deploy: 'deploys' }[item.kind]; // the panel's own tab names (work-common.js TABS)
287
- if (!tab) return false;
288
- await fn.openTab(tab); // the list is in before a row of it is selected (a deploy is found in it)
289
- if (item.kind === 'pull') fn.selectPull(item.number);
290
- else if (item.kind === 'deploy') fn.selectDeploy(item.deployId);
291
- return true;
292
- },
279
+ /** A piece of work, by what a row of the list names (`pull`, `issue`, `thread`, `run`, `deploy`, `proposal` and its number, id or slug): selected in the Work view, or shown in the node panel alone when the graph does not hold it */
280
+ showRef: (kind, key) => fn.showRef(kind, key),
293
281
  canStartAgent: () => fn.canStartAgent(),
294
282
  /** For tests: force reduced motion on or off for the runs' marks (null: follow the viewer's setting) */
295
283
  setReducedMotion: (v) => runsMap.setReducedMotion(v),
@@ -212,12 +212,12 @@ export function mergeSpecs(entries) {
212
212
  * One row: title, a pill that says its review state (To decide, Changed since approved, Sent back, Approved, Draft PR, Local, spec 0010 D4),
213
213
  * who and when beside it ("Approved by maintainer-one \u00b7 2 hours ago", "Waiting 2 days"), a line of what it is for, and the meta (spec number,
214
214
  * where it is, +added ~changed \u2212removed, scenarios). A review that could not be read says so, with a way to try again, and never looks
215
- * unreviewed. A proposal that could not be read is a row that says why and opens nothing. Same `open-proposal` action as the Proposals menu's row.
215
+ * unreviewed. A proposal that could not be read is a row that says why and opens nothing. A row selects the proposal's node (`data-work-ref`: work-list.js); the review is opened from the node panel.
216
216
  * What the forge said (a login, a date) is escaped; the pill's state is one of a fixed list.
217
217
  * @param {{ slug: string, source: string, title?: string, summary?: string, spec?: string, pull?: {number: number, draft?: boolean}, review?: object | null, counts?: {added?: number, changed?: number, removed?: number, scenarios?: number}, errors?: number, error?: string }} entry
218
- * @param {{ current?: {slug: string, source: string} | null, nowMs?: number }} [opts] the proposal that is open now; the clock
218
+ * @param {{ shown?: string | null, nowMs?: number }} [opts] the row the node panel shows now (`proposal:<slug>`); the clock
219
219
  */
220
- export function specRowHtml(entry, { current = null, nowMs = Date.now() } = {}) {
220
+ export function specRowHtml(entry, { shown = null, nowMs = Date.now() } = {}) {
221
221
  const head = `<span class="hx-forge-title">${escHtml(entry.title || entry.slug)}</span>`;
222
222
  if (entry.error) {
223
223
  return `<li class="hx-forge-item"><div class="hx-forge-row hx-forge-spec" data-corn="row">${head}<span class="hx-forge-sum hx-error-text">${escHtml(entry.error)}</span><span class="hx-forge-meta">${escHtml(specWhere(entry))}</span></div></li>`;
@@ -237,9 +237,9 @@ export function specRowHtml(entry, { current = null, nowMs = Date.now() } = {})
237
237
  c.scenarios ? `<span>${c.scenarios} ${c.scenarios === 1 ? 'scenario' : 'scenarios'}</span>` : '',
238
238
  entry.errors ? `<span class="hx-warn">${entry.errors} ${entry.errors === 1 ? 'problem' : 'problems'}</span>` : '',
239
239
  ].filter(Boolean).join('');
240
- const mine = !!current && current.slug === entry.slug && (current.source === entry.source || (Array.isArray(entry.also) && entry.also.includes(current.source)));
240
+ const mine = shown === `proposal:${entry.slug}`;
241
241
  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
- return `<li class="hx-forge-item"><button type="button" class="hx-forge-row hx-forge-spec" data-action="open-proposal" data-slug="${escHtml(entry.slug)}" data-source="${escHtml(entry.source)}" aria-pressed="${mine}" data-corn="row">`
242
+ 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
243
  + `<span class="hx-forge-line">${head}${pill}</span>`
244
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>`;
245
245
  }
@@ -9,7 +9,7 @@
9
9
  */
10
10
 
11
11
  import { relativeTime } from './review-model.js';
12
- import { runTone, canRetry, aboutWords, runName, statusWords, statusWhy, runMeta, canStop, canAnswer, compareTitle, limitRows, checksWords, timelineWords, nodeLabels, collisionWords, answerWords } from './runs-model.js';
12
+ import { runTone, canRetry, aboutWords, runName, statusWords, statusWhy, runMeta, canStop, canAnswer, limitRows, checksWords, timelineWords, nodeLabels, collisionWords, answerWords } from './runs-model.js';
13
13
  import { cornState, cornStateAttr, stateIconHtml } from './corn-state.js';
14
14
  import { t } from './strings.js';
15
15
  import { runGroups } from './waiting-model.js';
@@ -25,7 +25,6 @@ import { runGroupHeadingHtml } from './waiting-view.js';
25
25
  * @property {string} forgeType 'github' | 'forgejo'
26
26
  * @property {number} now
27
27
  * @property {{ id: string, label?: string }[]} nodes the map's nodes, for names
28
- * @property {string | null} selected the run lit on the map
29
28
  * @property {Set<string>} timelines the runs whose timeline is open
30
29
  * @property {boolean} busy an action is in flight
31
30
  * @property {Map<string, string>} [replies] the reply typed so far for each waiting run, so a repaint keeps it
@@ -143,7 +142,6 @@ export function loadingLinesHtml(n = 1) {
143
142
  /** One run */
144
143
  export function runHtml(ctx, run, all) {
145
144
  const say = ctx.t || t;
146
- const lit = ctx.selected === run.runId;
147
145
  const open = ctx.timelines.has(run.runId);
148
146
  const why = statusWhy(run);
149
147
  const name = ctx.esc(runName(run, ctx.now));
@@ -157,8 +155,6 @@ export function runHtml(ctx, run, all) {
157
155
  const limits = limitRows(run);
158
156
  const count = (run.timeline || []).length;
159
157
  const links = linksHtml(ctx, run);
160
- const noNodes = !(run.nodes || []).length;
161
- const lightWords = lit ? 'Lit on the map' : 'Light on the map';
162
158
  const result = resultHtml(ctx, run);
163
159
  return `<li class="hx-run hx-forge-file" data-run="${ctx.esc(run.runId)}" tabindex="-1" data-corn="run"${cornStateAttr(run.status)}>
164
160
  <div class="hx-run-head">${runPillHtml(ctx, run, statusWords(run))} <span class="hx-name">${ctx.esc(run.kind)} on ${ctx.esc(aboutWords(run.refs))}</span>${run.profile ? ` <span class="hx-faint">profile ${ctx.esc(run.profile)}</span>` : ''}</div>
@@ -171,25 +167,21 @@ export function runHtml(ctx, run, all) {
171
167
  ${links ? `<p class="hx-forge-meta">${links}</p>` : ''}
172
168
  ${answering ? `${answerHtml(ctx, run)}${result}` : unsentHtml(ctx, run)}${run.answer && !answering ? answeredHtml(ctx, run) : ''}
173
169
  <div class="hx-run-actions" data-corn="run-actions">${stop}${retry}
174
- <button data-corn-kind="secondary" type="button" class="hx-btn hx-forge-act" data-run-select="${ctx.esc(run.runId)}" aria-pressed="${lit}" aria-label="${lightWords}: ${name}"${noNodes ? ` disabled title="No node on the map yet, so there is nothing to light" aria-describedby="run-nodes-${ctx.esc(run.runId)}"` : ''}>${lightWords}</button>
175
170
  <button data-corn-kind="secondary" type="button" class="hx-btn hx-forge-act" data-run-timeline="${ctx.esc(run.runId)}" aria-expanded="${open}" aria-controls="run-tl-${ctx.esc(run.runId)}">Timeline (${count})</button></div>
176
171
  ${answering ? '' : result}
177
172
  ${open ? timelineHtml(ctx, run, all) : ''}</li>`;
178
173
  }
179
174
 
180
175
  /**
181
- * The list, in groups (spec 0010 D6): Needs you (oldest question first), In motion, Finished (each newest first), each starting with a heading that
182
- * says how many; runs on their own and compares are the items. The headings are items of the one flat list, so a run's card is never moved into a section.
183
- * @param {ViewContext} ctx
176
+ * The Runs list of the Work list, in groups (spec 0010 D6): Needs you (oldest question first), In motion, Finished (each newest first), each starting with a heading that
177
+ * says how many. A row is a button that selects the run's node (work-list.js); the card, with its answer field, is the node panel's (`runHtml`).
178
+ * @param {ViewContext & { shown?: string | null }} ctx `shown`: the run the node panel has now
184
179
  * @param {object[]} runs
185
180
  */
186
- export function runsHtml(ctx, runs) {
187
- return runGroups(runs).map((group) => runGroupHeadingHtml(group, ctx.t) + group.items.map((g) => {
188
- if (g.kind === 'run') return runHtml(ctx, g.run, runs);
189
- const id = `cmp-${g.runs[0].runId}`;
190
- return `<li class="hx-run-group" data-key="${ctx.esc(id)}"><section class="hx-run-compare" aria-labelledby="${ctx.esc(id)}">
191
- <h4 class="hx-run-compare-title" id="${ctx.esc(id)}">${ctx.esc(compareTitle(g.runs))}</h4>
192
- <p class="hx-forge-meta hx-faint">The same request under each profile, side by side.</p>
193
- <ul class="hx-run-columns" aria-label="${ctx.esc(g.runs.length)} profiles compared">${g.runs.map((r) => runHtml(ctx, r, runs)).join('')}</ul></section></li>`;
194
- }).join('')).join('');
181
+ export function runRowsHtml(ctx, runs) {
182
+ const say = ctx.t || t;
183
+ const row = (run) => `<li class="hx-forge-item" data-key="${ctx.esc(run.runId)}"><button type="button" class="hx-forge-row" data-work-ref="run:${ctx.esc(run.runId)}" aria-pressed="${ctx.shown === run.runId}" data-corn="row"${cornStateAttr(run.status)}>
184
+ <span class="hx-forge-title">${ctx.esc(run.kind)} on ${ctx.esc(aboutWords(run.refs))}</span>
185
+ <span class="hx-forge-meta">${runPillHtml(ctx, run, statusWords(run))} ${ctx.esc(runMeta(run, ctx.now))}</span></button></li>`;
186
+ return runGroups(runs).map((group) => runGroupHeadingHtml(group, say) + group.items.flatMap((g) => (g.kind === 'run' ? [g.run] : g.runs)).map(row).join('')).join('');
195
187
  }
package/explorer/scene.js CHANGED
@@ -177,7 +177,6 @@ import { NODE_THEMES, shapeOf } from '../core/schema.js';
177
177
  import { WORK_KINDS } from '../core/schema.js';
178
178
  import { hasGlyph } from './glyphs.js';
179
179
  import { outageFor, paintOutage } from './outage-model.js';
180
- import { paintForge } from './forge-panel-model.js';
181
180
  import { lightColor, lightenScene, parseColor } from './theme-model.js';
182
181
  import { matchIds } from './search-match.js';
183
182
  import { nodeColor } from './css-color.js';
@@ -500,7 +499,7 @@ function buildEdges(state, subgraph, reduceMotion) {
500
499
  const target = byId.get(edge.to);
501
500
  if (!source || !target || !isNodeVisible(state, source) || !isNodeVisible(state, target)) return;
502
501
 
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 })); return; } // the Work view's lines are work-model.js's (the page installs `workEdge`)
502
+ 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`)
504
503
  if (preset) return flow(edge, source, target);
505
504
  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
505
 
@@ -758,7 +757,6 @@ export function buildScene(state, opts = {}) {
758
757
  const colours = { nodes: scene.nodes.map((n) => n.color), edges: scene.edges.map((e) => e.color) };
759
758
  if (state.scenario) paintOutage(scene, outageFor(state.scenario, state.nodes, state.edges)); // CLOUD-07: red, amber, violet by when the outage bites
760
759
  if (state.scenario) paintVerdict(scene, state.scenario); // PHY-10: red, green or amber by the step's permission check
761
- if (state.forgeLit) paintForge(scene, state.forgeLit); // CF-07: the selected pull request's nodes, the rest faded
762
760
  // The nodes and edges a painter above gave a colour: the map's own styling (map-style.js) leaves them to it
763
761
  scene.nodes.forEach((n, i) => { if (colours.nodes.length === scene.nodes.length && n.color !== colours.nodes[i]) scene.painted.nodes.add(n.id); });
764
762
  scene.edges.forEach((e, i) => { if (colours.edges.length === scene.edges.length && e.color !== colours.edges[i]) scene.painted.edges.add(e.key); });
@@ -199,6 +199,10 @@
199
199
  --corn-work-run: auto;
200
200
  --corn-work-pull: auto;
201
201
  --corn-work-deploy: auto;
202
+ /* …and its lines: a link between work, a link to code, and what a proposal adds (core/schema.js WORK_EDGE_THEMES) */
203
+ --corn-work-edge-work: auto;
204
+ --corn-work-edge-code: auto;
205
+ --corn-work-edge-adds: auto;
202
206
  /* Node fill by group */
203
207
  --corn-map-group-app: auto;
204
208
  --corn-map-group-pkg: auto;
@@ -13,9 +13,9 @@ import { specGroupTitle, runGroupTitle, groupCountWords } from './waiting-model.
13
13
  * The Specs tab's groups, each a heading with its count and its rows. Drafts past ten rows are folded behind a button on the header
14
14
  * (`draftsOpen` says whether the person opened it). With a search, a group's count reads "2 of 6".
15
15
  * @param {ReturnType<import('./waiting-model.js').specGroups>} groups
16
- * @param {{ current?: { slug: string, source: string } | null, nowMs?: number, draftsOpen?: boolean | null, say?: (key: string) => string }} [opts]
16
+ * @param {{ shown?: string | null, nowMs?: number, draftsOpen?: boolean | null, say?: (key: string) => string }} [opts]
17
17
  */
18
- export function specGroupsHtml(groups, { current = null, nowMs = Date.now(), draftsOpen = null, say } = {}) {
18
+ export function specGroupsHtml(groups, { shown = null, nowMs = Date.now(), draftsOpen = null, say } = {}) {
19
19
  return groups.map((g) => {
20
20
  const id = `spec-group-${g.key}`;
21
21
  const words = `${specGroupTitle(g.key, say)} · ${groupCountWords(g)}`;
@@ -24,7 +24,7 @@ export function specGroupsHtml(groups, { current = null, nowMs = Date.now(), dra
24
24
  const title = foldable
25
25
  ? `<button type="button" class="hx-forge-gtoggle" data-spec-group-toggle="${escHtml(g.key)}" aria-expanded="${!folded}" aria-controls="${id}-list" data-corn-kind="quiet">${escHtml(words)}</button>`
26
26
  : escHtml(words);
27
- const rows = g.rows.map((r) => specRowHtml(r.entry, { current, nowMs })).join('');
27
+ const rows = g.rows.map((r) => specRowHtml(r.entry, { shown, nowMs })).join('');
28
28
  return `<li class="hx-forge-group hx-spec-group" data-key="${id}" data-corn="spec-group" data-group="${escHtml(g.key)}"><h3 class="hx-forge-gtitle" id="${id}">${title}</h3>`
29
29
  + `<ul class="hx-forge-list" id="${id}-list" aria-labelledby="${id}"${folded ? ' hidden' : ''}>${rows}</ul></li>`;
30
30
  }).join('');