cornfield 0.50.0 → 0.50.1

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 (36) hide show
  1. package/explorer/focus-room.js +1 -7
  2. package/explorer/focusables.js +1 -1
  3. package/explorer/forge-panel.js +36 -2630
  4. package/explorer/index.html +15 -147
  5. package/explorer/instance-state.js +0 -7
  6. package/explorer/instance.js +16 -1
  7. package/explorer/page-pieces.js +21 -2
  8. package/explorer/page.js +3 -3
  9. package/explorer/panels.js +1 -5
  10. package/explorer/pieces/layers.js +1 -0
  11. package/explorer/pieces/node-panel.js +15 -5
  12. package/explorer/pieces/proposal.js +9 -0
  13. package/explorer/pieces/work-agent.js +211 -0
  14. package/explorer/pieces/work-common.js +88 -0
  15. package/explorer/pieces/work-confirm.js +169 -0
  16. package/explorer/pieces/work-data.js +178 -0
  17. package/explorer/pieces/work-deploys.js +104 -0
  18. package/explorer/pieces/work-events.js +285 -0
  19. package/explorer/pieces/work-issues.js +43 -0
  20. package/explorer/pieces/work-markup.js +155 -0
  21. package/explorer/pieces/work-notes.js +177 -0
  22. package/explorer/pieces/work-paint.js +312 -0
  23. package/explorer/pieces/work-prs.js +253 -0
  24. package/explorer/pieces/work-runs.js +387 -0
  25. package/explorer/pieces/work-specs.js +71 -0
  26. package/explorer/pieces/work-threads.js +309 -0
  27. package/explorer/pieces/work.js +285 -0
  28. package/explorer/proposal.js +1 -2
  29. package/explorer/runs-map.js +108 -103
  30. package/explorer/runs-view.js +8 -6
  31. package/explorer/strings.js +1 -1
  32. package/explorer/waiting-model.js +12 -12
  33. package/explorer/waiting-view.js +6 -6
  34. package/package.json +1 -1
  35. package/explorer/feedback.js +0 -15
  36. package/explorer/waiting-line.js +0 -14
@@ -36,26 +36,26 @@ export const RUN_GROUPS = Object.freeze([
36
36
  ]);
37
37
 
38
38
  /** The words of a Specs group's header (a repo may say them in its own voice: `strings`) */
39
- export function specGroupTitle(key) {
39
+ export function specGroupTitle(key, say = t) {
40
40
  switch (key) {
41
- case 'decide': return t('toDecide');
42
- case 'agent': return t('withAgent');
43
- case 'approved': return t('approvedGroup');
44
- default: return t('drafts');
41
+ case 'decide': return say('toDecide');
42
+ case 'agent': return say('withAgent');
43
+ case 'approved': return say('approvedGroup');
44
+ default: return say('drafts');
45
45
  }
46
46
  }
47
47
 
48
48
  /** The words of a Runs group's header */
49
- export function runGroupTitle(key) {
49
+ export function runGroupTitle(key, say = t) {
50
50
  switch (key) {
51
- case 'needs': return t('needsYou');
52
- case 'motion': return t('inMotion');
53
- default: return t('finished');
51
+ case 'needs': return say('needsYou');
52
+ case 'motion': return say('inMotion');
53
+ default: return say('finished');
54
54
  }
55
55
  }
56
56
 
57
57
  /** The words of the proposal bar's button that goes to the run waiting on the proposal */
58
- export const answerWord = () => t('answer');
58
+ export const answerWord = (say = t) => say('answer');
59
59
 
60
60
  /** Drafts past this many rows are collapsed behind their header (D3) */
61
61
  export const DRAFTS_OPEN_MAX = 10;
@@ -230,10 +230,10 @@ export function waiting({ specs, runs } = {}) {
230
230
  }
231
231
 
232
232
  /** "3 waiting on you" (the Work button's name, spoken: "Work, 3 waiting on you"), or '' when nothing waits */
233
- export const waitingWords = (n) => (n > 0 ? `${n} ${t('waitingOnYou')}` : '');
233
+ export const waitingWords = (n, say = t) => (n > 0 ? `${n} ${say('waitingOnYou')}` : '');
234
234
 
235
235
  /** The Work button's accessible name: its label, then what waits ("Work, 3 waiting on you") */
236
- export const workButtonName = (label, n) => (n > 0 ? `${label}, ${waitingWords(n)}` : label);
236
+ export const workButtonName = (label, n, say = t) => (n > 0 ? `${label}, ${waitingWords(n, say)}` : label);
237
237
 
238
238
  /** What a group's header says: "To decide · 2", or "To decide · 2 of 6" while a search narrows it */
239
239
  export const groupCountWords = (g) => (g.shown === g.total ? String(g.total) : `${g.shown} of ${g.total}`);
@@ -5,7 +5,7 @@
5
5
  * headings. Pure: no DOM, no clock of its own. Every word from the forge is escaped (a row's own markup is proposal-model.js `specRowHtml`).
6
6
  */
7
7
 
8
- import { escHtml } from './state.js';
8
+ import { escapeHtml as escHtml } from '../core/text.js';
9
9
  import { specRowHtml } from './proposal-model.js';
10
10
  import { specGroupTitle, runGroupTitle, groupCountWords } from './waiting-model.js';
11
11
 
@@ -13,12 +13,12 @@ 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 }} [opts]
16
+ * @param {{ current?: { slug: string, source: 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 } = {}) {
18
+ export function specGroupsHtml(groups, { current = null, nowMs = Date.now(), draftsOpen = null, say } = {}) {
19
19
  return groups.map((g) => {
20
20
  const id = `spec-group-${g.key}`;
21
- const words = `${specGroupTitle(g.key)} · ${groupCountWords(g)}`;
21
+ const words = `${specGroupTitle(g.key, say)} · ${groupCountWords(g)}`;
22
22
  const foldable = g.key === 'drafts' && g.total > 10 && g.shown === g.total; // not while a search narrows it: then it is open
23
23
  const folded = foldable && (draftsOpen === null ? g.collapsed : !draftsOpen);
24
24
  const title = foldable
@@ -31,7 +31,7 @@ export function specGroupsHtml(groups, { current = null, nowMs = Date.now(), dra
31
31
  }
32
32
 
33
33
  /** The heading that starts a group of the Runs list: "Needs you · 1". It is an item of the flat list (a run's card is never moved into a section) */
34
- export function runGroupHeadingHtml(g) {
34
+ export function runGroupHeadingHtml(g, say) {
35
35
  const id = `run-group-${g.key}`;
36
- return `<li class="hx-run-heading" data-key="${id}" data-corn="run-group" data-group="${escHtml(g.key)}"><h4 class="hx-forge-gtitle" id="${id}">${escHtml(`${runGroupTitle(g.key)} · ${g.count}`)}</h4></li>`;
36
+ return `<li class="hx-run-heading" data-key="${id}" data-corn="run-group" data-group="${escHtml(g.key)}"><h4 class="hx-forge-gtitle" id="${id}">${escHtml(`${runGroupTitle(g.key, say)} · ${g.count}`)}</h4></li>`;
37
37
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cornfield",
3
- "version": "0.50.0",
3
+ "version": "0.50.1",
4
4
  "description": "A self-hostable dev dashboard with the topology map at its centre: proposals on the map, scenarios, outages and what-if edits, for any repo.",
5
5
  "license": "MIT",
6
6
  "author": "popcorn245 (https://github.com/popcorn245)",
@@ -1,15 +0,0 @@
1
- /**
2
- * @module explorer/feedback
3
- *
4
- * A bridge (spec 0011 D2, step 4): the results of actions now live on the instance (engine/feedback.js). This file keeps the old names for the
5
- * modules that are not yet on an instance (forge-panel.js), bound to the page's instance. It goes when forge-panel.js is converted.
6
- */
7
- import { pageInstance } from './state.js';
8
- import * as F from './engine/feedback.js';
9
-
10
- export { RESULT_MS } from './engine/feedback.js';
11
- export const sayResult = (key, text, ok = true) => F.sayResult(pageInstance(), key, text, ok);
12
- export const resultOf = (key) => F.resultOf(pageInstance(), key);
13
- export const clearResult = (key) => F.clearResult(pageInstance(), key);
14
- export const showResultIn = (el, key) => F.showResultIn(pageInstance(), el, key);
15
- export const resetFeedbackForTests = () => F.resetFeedback(pageInstance());
@@ -1,14 +0,0 @@
1
- /**
2
- * @module explorer/waiting-line
3
- *
4
- * A bridge (spec 0011 D3, step 5): the one line under the proposal bar's buttons when a run is waiting on the open proposal (spec 0010 D2) is part of the
5
- * proposal's bar (pieces/proposal.js). This file keeps the old names for the Work panel, bound to the page's instance.
6
- */
7
-
8
- import { pageInstance } from './state.js';
9
- import { ensurePagePieces } from './page-pieces.js';
10
-
11
- /** Shows the line for `run` (the run waiting on the open proposal), or hides it for null; `key` is what the line is about (the proposal), so a run is said once for it */
12
- export function paintWaitingLine(run, key) { ensurePagePieces(); pageInstance().emit('proposal:waiting', { run, key }); }
13
- /** For tests: forget the line */
14
- export function resetWaitingLineForTests() { pageInstance().emit('proposal:waiting-reset'); }