create-pmos 0.412.0 → 0.414.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 (91) hide show
  1. package/package.json +25 -25
  2. package/payload/AGENTS.md +2 -2
  3. package/payload/KIT-VERSION +1 -1
  4. package/payload/mods/pmos-cockpit/README.md +1 -1
  5. package/payload/mods/pmos-cockpit/hooks/lib/guard.mjs +11 -5
  6. package/payload/planning/evals/eval-calibration.md +1 -1
  7. package/payload/planning/okrs/health-budgets.md +1 -1
  8. package/payload/scripts/pmos-log.sh +18 -4
  9. package/payload/state/discoveries.md +1 -1
  10. package/workspace/board-programs-test.js +2 -2
  11. package/workspace/briefing-premium-board-test.js +45 -9
  12. package/workspace/briefing-premium-test.js +3 -2
  13. package/workspace/changelog.json +24 -0
  14. package/workspace/core-docs-workflow-test.js +144 -0
  15. package/workspace/guide/programs.md +13 -0
  16. package/workspace/guide/workflows.md +15 -1
  17. package/workspace/home-other-product-test.js +18 -0
  18. package/workspace/lib/board-premium.js +8 -2
  19. package/workspace/lib/briefing-premium-agent.js +16 -4
  20. package/workspace/lib/core-docs.js +79 -14
  21. package/workspace/lib/engine/boards.js +20 -12
  22. package/workspace/lib/headless.js +10 -1
  23. package/workspace/lib/initiative-chat.js +50 -0
  24. package/workspace/lib/initiative-premium.js +17 -7
  25. package/workspace/lib/item-cli.js +7 -2
  26. package/workspace/lib/milestone-review.js +120 -0
  27. package/workspace/lib/milestone-suggest.js +176 -0
  28. package/workspace/lib/plan-items.js +1 -1
  29. package/workspace/lib/pmos-verbs.js +7 -1
  30. package/workspace/lib/program-chat.js +1 -1
  31. package/workspace/lib/program-cli.js +56 -0
  32. package/workspace/lib/programs.js +25 -6
  33. package/workspace/lib/routes-boards.js +77 -13
  34. package/workspace/lib/routes-briefing-premium.js +17 -1
  35. package/workspace/lib/routes-core-docs.js +3 -1
  36. package/workspace/lib/routes-programs.js +84 -7
  37. package/workspace/lib/task-cli.js +120 -0
  38. package/workspace/lib/workflow-chat.js +1 -0
  39. package/workspace/lib/workflow-cli.js +91 -6
  40. package/workspace/milestone-suggest-test.js +175 -0
  41. package/workspace/package-lock.json +2 -2
  42. package/workspace/package.json +1 -1
  43. package/workspace/premium-chat-line-test.js +12 -1
  44. package/workspace/premium-vw-item-test.js +3 -3
  45. package/workspace/premium-vw-jira-test.js +2 -1
  46. package/workspace/program-order-test.js +180 -0
  47. package/workspace/public/pm/bd-ini-model.js +81 -0
  48. package/workspace/public/pm/bd-ini-panel.js +123 -58
  49. package/workspace/public/pm/bd-prog-panel.js +54 -14
  50. package/workspace/public/pm/bd-prog.js +3 -3
  51. package/workspace/public/pm/cozy-home.css +5 -0
  52. package/workspace/public/pm/cozy-panel.css +2 -0
  53. package/workspace/public/pm/cozy-viewer.js +10 -3
  54. package/workspace/public/pm/cozy-xv.css +51 -16
  55. package/workspace/public/pm/cozy-xv.js +6 -5
  56. package/workspace/public/pm/goal-chat.js +1 -1
  57. package/workspace/public/pm/home-app.js +35 -19
  58. package/workspace/public/pm/home-ask.js +9 -3
  59. package/workspace/public/pm/home-chat.js +16 -2
  60. package/workspace/public/pm/home-ini-model.js +42 -29
  61. package/workspace/public/pm/home-ini.css +1 -0
  62. package/workspace/public/pm/home-ini.js +26 -34
  63. package/workspace/public/pm/home-list.js +14 -8
  64. package/workspace/public/pm/home-stage-card.js +3 -1
  65. package/workspace/public/pm/home-task.js +41 -65
  66. package/workspace/public/pm/home-today.js +11 -12
  67. package/workspace/public/pm/ms-suggest.css +50 -0
  68. package/workspace/public/pm/ms-suggest.js +98 -0
  69. package/workspace/public/pm/premium-board.js +13 -7
  70. package/workspace/public/pm/premium-initiative-head.js +32 -13
  71. package/workspace/public/pm/premium-viewer.js +1 -0
  72. package/workspace/public/pm/premium-vw-item-model.js +13 -7
  73. package/workspace/public/pm/premium-vw-item.js +49 -5
  74. package/workspace/public/pm/prog-order.css +47 -0
  75. package/workspace/public/pm/prog-order.js +188 -0
  76. package/workspace/public/pm/program-charter.js +47 -7
  77. package/workspace/public/pm/program-model.js +79 -1
  78. package/workspace/public/pm/task-card.css +108 -0
  79. package/workspace/public/pm/task-card.js +271 -0
  80. package/workspace/public/pm/wf-page.js +3 -0
  81. package/workspace/server.js +23 -1
  82. package/workspace/skills/milestone-review.skill +53 -0
  83. package/workspace/skills/workflow-setup.skill +14 -5
  84. package/workspace/stage-card-test.js +11 -0
  85. package/workspace/task-card-test.js +248 -0
  86. package/workspace/test-lists/bd-ini-panel.json +5 -0
  87. package/workspace/test-lists/core-documents-backend.json +15 -3
  88. package/workspace/test-lists/milestone-suggest.json +6 -0
  89. package/workspace/test-lists/program-order.json +6 -0
  90. package/workspace/test-lists/task-card.json +6 -0
  91. package/workspace/test-lists/workflow-stage.json +5 -0
@@ -50,10 +50,10 @@ async function readL(id, M, force) {
50
50
  X.reading.add(id);
51
51
  const r = await X.ctx.pmGet('/api/initiative-layout?initiative=' + encodeURIComponent(id) + (wsOf(M) ? '&ws=' + encodeURIComponent(wsOf(M)) : ''));
52
52
  X.reading.delete(id);
53
- X.L.set(id, r && r.ok ? { ...r, read: true } : { auto: true, held: [], by: 'stage', names: [], of: {}, stage: {}, sets: [], read: false });
53
+ X.L.set(id, r && r.ok ? { ...r, read: true } : { auto: true, held: [], by: 'mine', names: [], of: {}, stage: {}, sets: [], read: false });
54
54
  X.ctx.drawList(); redrawView();
55
55
  }
56
- const Lof = (id) => X.L.get(id) || { auto: true, held: [], by: 'stage', names: [], of: {}, stage: {}, sets: [], read: false };
56
+ const Lof = (id) => X.L.get(id) || { auto: true, held: [], by: 'mine', names: [], of: {}, stage: {}, sets: [], read: false };
57
57
  /* ── the drafted Jira tickets (T1) ── */
58
58
  async function readT(id, M, force) {
59
59
  if (!force && (X.T.has(id) || X.tReading.has(id))) return;
@@ -65,7 +65,7 @@ async function readT(id, M, force) {
65
65
  }
66
66
  const Tof = (id) => X.T.get(id) || null;
67
67
  /** The grouping: the PM's choice; until the PM chooses, Epic once tickets are drafted. */
68
- const byOf = (L, T) => (L.picked ? L.by : T && T.ok && T.drafted ? 'epic' : L.by) || 'stage';
68
+ const byOf = (L, T) => { const b = (L.picked ? L.by : T && T.ok && T.drafted ? 'epic' : L.by) || 'mine'; return MD.BY_LABEL[b] ? b : 'mine'; }; // an old 'stage' reads as Your groups
69
69
  async function press(id, M, body) {
70
70
  const r = await X.ctx.pmPost('/api/initiative-layout', { ws: wsOf(M), initiative: id, ...body });
71
71
  if (r && r.ok) { X.L.set(id, { ...r, read: true }); X.ctx.drawList(); redrawView(); return true; }
@@ -321,12 +321,12 @@ const KIND = { tasks: 'Tasks', docs: 'Documents', stage: 'Stage' };
321
321
  const ICON = { tasks: 'list', docs: 'doc', stage: 'goal' };
322
322
  let BODY = null;
323
323
  function segHtml(v) { return `<div class="cz-seg hi-seg" role="group" aria-label="Show">${Object.entries(KIND).map(([k, l]) => `<button type="button" data-hi-view="${k}" aria-pressed="${k === v}">${l}</button>`).join('')}</div>`; }
324
- function taskRowHtml(t, mine, stages) {
325
- const pill = t.stage ? `<button type="button" class="hi-pill" data-hi-tstage="${esc(t.key)}" aria-label="Stage: ${esc(t.stage)}. Change">${esc(t.stage)}</button>` : `<button type="button" class="hi-pill dash" data-hi-tstage="${esc(t.key)}">Set stage</button>`;
326
- return `<div class="hi-trow${t.done ? ' done' : ''}" data-ov-tkrow="${esc(t.key)}"${mine ? ` draggable="true" data-hi-drag="${esc(t.key)}"` : ''}>`
324
+ function taskRowHtml(t, mine) {
325
+ // a task's only stage is its state (Wawan, 2026-10-25): the checkbox, and the five states under ⋯; Won't do sits struck with the done ones
326
+ return `<div class="hi-trow${t.closed ? ' done' : ''}${t.wontdo ? ' wontdo' : ''}" data-ov-tkrow="${esc(t.key)}"${mine ? ` draggable="true" data-hi-drag="${esc(t.key)}"` : ''}>`
327
327
  + (t.canCheck ? `<button type="button" class="hi-chk${t.done ? ' on' : ''}" data-hi-chk="${esc(t.key)}" aria-pressed="${t.done}" aria-label="${t.done ? 'Reopen' : 'Mark done'}: ${esc(t.title)}">${t.done ? SVG(I.check, 12, 3) : ''}</button>` : `<span class="hi-chk off${t.done ? ' on' : ''}" aria-hidden="true" title="${t.jira ? 'Jira keeps its state' : 'A PRD requirement has no state'}">${t.done ? SVG(I.check, 12, 3) : ''}</span>`)
328
328
  + `<button type="button" class="hi-tt" data-ov-tk="${esc(t.key)}" aria-label="Open ${esc(t.title)}">${esc(t.title)}${t.jira && t.ref ? ` <em>${esc(t.ref)}</em>` : ''}</button>`
329
- + pill + (t.av ? `<span class="hi-av" title="${esc(t.owner)}">${esc(t.av)}</span>` : '') + `<span class="hi-due${t.late ? ' late' : ''}">${esc(t.due || (t.req ? 'PRD' : t.state === 'In progress' ? 'running' : ''))}</span>`
329
+ + (t.av ? `<span class="hi-av" title="${esc(t.owner)}">${esc(t.av)}</span>` : '') + `<span class="hi-due${t.late ? ' late' : ''}">${esc(t.due || (t.req ? 'PRD' : t.state === 'In progress' ? 'running' : ''))}</span>`
330
330
  + `<button type="button" class="hi-ib sm" data-hi-tmore="${esc(t.key)}" aria-haspopup="menu" aria-label="More for ${esc(t.title)}">${SVG(I.more, 14, 3)}</button></div>`;
331
331
  }
332
332
  /* ── the epic groups (T1) and shell A's summary card (XvATasks) ── */
@@ -361,49 +361,49 @@ function epicGroupsHtml(id, M, T) {
361
361
  function summaryHtml(id, M, rows, T, by) {
362
362
  const VW = X.ctx.VW;
363
363
  if (isPhone() || !VW.czSummary) return '';
364
- const open = rows.filter((r) => !r.done && !r.req).length;
364
+ const open = rows.filter((r) => !r.closed && !r.req).length;
365
365
  const meta = [open ? open + ' open' : '', 'grouped by ' + MD.BY_LABEL[by].toLowerCase()].filter(Boolean).join(' · ');
366
366
  const G = T && T.ok ? TKM.ticketGroups(T) : [];
367
367
  const send = G.reduce((a, g) => a + g.send, 0);
368
368
  if (T && T.ok && T.pushing) return VW.czSummary({ line: 'Sending to Jira', tone: 'live', text: 'Claude is creating the tickets with your Atlassian connection. Each task shows its Jira key when it is done.', meta });
369
369
  if (send) return VW.czSummary({ line: plural(send, 'ticket is', 'tickets are') + ' drafted, not in Jira', tone: 'you', text: 'Each PRD story is a task with its Jira ticket drafted. Nothing reaches Jira until you send it.', meta, primary: { label: 'Send to Jira', act: 'tk-sendall' } });
370
370
  const week = Date.now() + 7 * 864e5;
371
- const due = rows.filter((r) => !r.done && !r.req && r.end && Date.parse(r.end) <= week).sort((a, b) => a.end.localeCompare(b.end));
371
+ const due = rows.filter((r) => !r.closed && !r.req && r.end && Date.parse(r.end) <= week).sort((a, b) => a.end.localeCompare(b.end));
372
372
  if (!due.length) return VW.czSummary({ meta });
373
373
  const words = due.slice(0, 2).map((r) => r.title + (r.due ? ' ' + (/^(today|tomorrow|yesterday)$/.test(r.due) ? r.due : 'by ' + r.due) : ''));
374
374
  return VW.czSummary({ line: plural(due.length, 'is', 'are') + ' due this week', tone: due.some((r) => r.late) ? 'warn' : 'you', text: words.join(', and ') + '.', meta,
375
375
  primary: { label: 'Open ' + (due[0].title.length > 36 ? due[0].title.slice(0, 35) + '…' : due[0].title), act: 'tk-openfirst' } });
376
376
  }
377
377
  function tasksView(id, M) {
378
- const L = Lof(id), T = Tof(id), by = byOf(L, T), rows = MD.taskRows(M, L), stages = (M.acts && M.acts.stages) || [];
378
+ const L = Lof(id), T = Tof(id), by = byOf(L, T), rows = MD.taskRows(M, L);
379
379
  if (!T) readT(id, M);
380
380
  const mine = by === 'mine';
381
- const target = mine ? (L.names.includes(X.addTo) ? X.addTo : L.names[0] || '') : by === 'stage' ? M.acts.stage || '' : '';
381
+ const target = mine ? (L.names.includes(X.addTo) ? X.addTo : L.names[0] || '') : '';
382
382
  let groups;
383
383
  if (by === 'epic') {
384
384
  // the PM's own tasks: the PRD stories are tasks of their epics once drafted, and a Jira row of a pushed ticket is that task
385
385
  const keys = new Set(((T && T.ok && T.tickets) || []).map((t) => t.key).filter(Boolean));
386
386
  const own = rows.filter((r) => !(T && T.ok && T.drafted && r.req) && !(r.jira && keys.has(r.ref)));
387
- const k2 = 'ep:' + id + ':mine', open2 = foldOpen(k2, false), n2 = own.filter((r) => !r.done).length;
387
+ const k2 = 'ep:' + id + ':mine', open2 = foldOpen(k2, false), n2 = own.filter((r) => !r.closed).length;
388
388
  groups = epicGroupsHtml(id, M, T)
389
- + `<section class="tk-g hi-tg" aria-label="Your tasks">${headHtml(k2, 'Your tasks', n2 || own.length, open2)}${open2 ? own.map((t) => taskRowHtml(t, false, stages)).join('') || '<p class="hi-empty">No task of yours yet. Add one below.</p>' : ''}</section>`;
389
+ + `<section class="tk-g hi-tg" aria-label="Your tasks">${headHtml(k2, 'Your tasks', n2 || own.length, open2)}${open2 ? own.map((t) => taskRowHtml(t, false)).join('') || '<p class="hi-empty">No task of yours yet. Add one below.</p>' : ''}</section>`;
390
390
  } else {
391
- const G = MD.taskGroups(rows, L, by, stages);
391
+ const G = MD.taskGroups(rows, L, by);
392
392
  groups = rows.length ? G.map((g) => {
393
393
  const shut = X.shut.has('vt:' + g.key);
394
394
  const head = g.title == null ? '' : `<div class="hi-gh"><button type="button" class="hi-ghb" data-hi-vfold="${esc(g.key)}" aria-expanded="${!shut}">${SVG(shut ? I.right : I.down, 14, 2)}<b>${esc(g.title)}</b><span>${g.open} open</span></button>`
395
395
  + (g.mine ? `<button type="button" class="hi-ib sm" data-hi-gmore="${esc(g.title)}" aria-haspopup="menu" aria-label="More for ${esc(g.title)}">${SVG(I.more, 14, 3)}</button>` : '') + '</div>';
396
- return `<section class="hi-tg" data-hi-drop="${esc(g.mine ? g.title : g.loose ? '' : '')}"${mine ? ' data-hi-dz' : ''} aria-label="${esc(g.title || 'Tasks')}">${head}${shut ? '' : g.rows.map((t) => taskRowHtml(t, mine, stages)).join('') || '<p class="hi-empty">Drag a task here.</p>'}</section>`;
396
+ return `<section class="hi-tg" data-hi-drop="${esc(g.mine ? g.title : g.loose ? '' : '')}"${mine ? ' data-hi-dz' : ''} aria-label="${esc(g.title || 'Tasks')}">${head}${shut ? '' : g.rows.map((t) => taskRowHtml(t, mine)).join('') || '<p class="hi-empty">Drag a task here.</p>'}</section>`;
397
397
  }).join('') : `<p class="hi-empty">${esc((M.tasks && M.tasks.note) || 'No task yet.')} Add one below.</p>`;
398
398
  }
399
399
  return summaryHtml(id, M, rows, T, by) + groups
400
400
  + (mine ? `<button type="button" class="hi-btn sm ghost hi-self" data-hi-newgroup>${SVG(I.plus, 14)}New group</button>` : '')
401
401
  + `<div class="hi-add"><label for="ovTask" class="hi-vh">Add a task</label><input id="ovTask" maxlength="200" autocomplete="off" placeholder="Add a task${target ? ' to ' + esc(target) : ''}" data-hi-target="${esc(target)}"><button type="button" class="hi-ib sm" data-ov-add aria-label="Add the task">${SVG(I.next, 14)}</button></div>`;
402
402
  }
403
- function docRowHtml(d, cur, later) {
403
+ function docRowHtml(d, cur, later, phases) {
404
404
  const draft = d.act && d.act.kind === 'draft' && !d.running && !d.path && d.st !== 'stale';
405
405
  if (later) return `<div class="czs-it hi-drow later" data-ov-doc="${esc(d.key)}"><span class="ut-tki dash" aria-hidden="true">${SVG(I.doc, 15)}</span><span class="w">${esc(d.title)}<span>comes in ${esc(d.phase)}</span></span>${draft ? `<button type="button" class="hi-btn sm ghost" data-ov-draft="${esc(d.key)}">Draft it now</button>` : ''}</div>`;
406
- const [pt] = MD.docPill(d, cur);
406
+ const [pt] = MD.docPill(d, cur, phases);
407
407
  // a document with no file yet is never a dead press: it says what happens to it (data-ov-none), and offers the draft when PMOS can write it
408
408
  const open = d.path && d.st === 'draft' && d.slot ? `data-ov-dread="${esc(d.key)}"` : d.path ? `data-ov-open="${esc(d.path)}" data-ov-name="${esc(d.title)}"` : `data-ov-none="${esc(d.key)}"`;
409
409
  const meta = [d.when, d.by, d.link ? d.link.kind : '', d.look || !d.path ? pt : ''].filter(Boolean).join(' · ') || d.what;
@@ -414,17 +414,17 @@ function docRowHtml(d, cur, later) {
414
414
  /** Documents in shell A (canvas XvADocs): the summary says what needs a look and holds the one primary (draft the first missing document,
415
415
  * else open the first that needs a look); the groups fold below it. Group by, Show and Add a document are under ⋯. */
416
416
  function docsView(id, M) {
417
- const rows = MD.docRows(M), cur = MD.phaseOf(M.acts && M.acts.stage);
417
+ const rows = MD.docRows(M), { phases, cur } = MD.docPhases(M);
418
418
  if (!rows.length) return '<div class="hi-v hi-v2" data-hi-v="docs">' + VW().czSummary({ text: M.docs && M.docs.missing ? 'The core documents could not be read.' : 'This initiative has no core document yet.', primary: { label: 'Add a document', act: 'adddoc' } }) + '</div>';
419
- const G = MD.docGroups(rows, M.acts && M.acts.stage, X.doc);
419
+ const G = MD.docGroups(rows, M.acts && M.acts.stage, { ...X.doc, phases, cur });
420
420
  const look = rows.filter((d) => d.look), miss = rows.filter((d) => !d.path && d.act && d.act.kind === 'draft' && !d.running);
421
- const said = look.slice(0, 2).map((d) => d.title + ' ' + String(MD.docPill(d, cur)[0] || '').toLowerCase()).concat(miss.filter((d) => !d.look).slice(0, 1).map((d) => 'The ' + d.title + ' is not written yet'));
421
+ const said = look.slice(0, 2).map((d) => d.title + ' ' + String(MD.docPill(d, cur, phases)[0] || '').toLowerCase()).concat(miss.filter((d) => !d.look).slice(0, 1).map((d) => 'The ' + d.title + ' is not written yet'));
422
422
  const first = miss[0] || null, open = !first && look.find((d) => d.path);
423
423
  const pri = first ? { label: 'Draft the ' + first.title, act: 'draft:' + first.key } : open ? { label: 'Open ' + open.title, act: 'open:' + open.key } : null;
424
424
  const sum = VW().czSummary({ line: look.length ? look.length + (look.length === 1 ? ' needs a look' : ' need a look') : '', tone: look.length ? 'warn' : '',
425
425
  text: said.length ? said.map((x) => x.replace(/^./, (c) => c.toUpperCase())).join('. ') + '.' : 'Every document is in place for ' + (cur || 'this stage') + '.',
426
426
  meta: rows.length + (rows.length === 1 ? ' document' : ' documents') + ' · filter and sort are under More', extra: M.docs && M.docs.cap ? `<p class="czs-meta" data-ov-dsum>${esc(M.docs.cap)}</p>` : '', primary: pri });
427
- const secs = VW().czSections(G.map((g, i) => ({ id: 'd:' + (g.key || i), title: g.title || 'Documents', count: g.rows.length, open: i === 0, html: g.rows.map((d) => docRowHtml(d, cur, g.later)).join('') })), { key: 'docs' });
427
+ const secs = VW().czSections(G.map((g, i) => ({ id: 'd:' + (g.key || i), title: g.title || 'Documents', count: g.rows.length, open: i === 0, html: g.rows.map((d) => docRowHtml(d, cur, g.later, phases)).join('') })), { key: 'docs' });
428
428
  return '<div class="hi-v hi-v2" data-hi-v="docs">' + sum + (secs || '<p class="hi-empty">No document matches.</p>') + '</div>';
429
429
  }
430
430
  function stageView(id, M, ask) {
@@ -474,10 +474,9 @@ function moreOf(id, view) {
474
474
  function groupMenu(t, id, M) {
475
475
  const L = Lof(id), T = Tof(id), by = byOf(L, T);
476
476
  const same = (n) => n.join('|').toLowerCase() === L.names.join('|').toLowerCase();
477
- const st = (M.acts && M.acts.stages) || [], at = Math.max(0, st.indexOf(M.acts.stage));
478
477
  const G = T && T.ok ? TKM.ticketGroups(T) : [];
479
- menu(t, [{ head: 'Group by' }, ...['epic', 'stage', 'mine', 'owner', 'status', 'none'].map((k) => ({ label: MD.BY_LABEL[k],
480
- sub: k === 'stage' ? st.slice(at, at + 3).join(', ') : k === 'mine' && L.names.length ? L.names.join(', ') : k === 'epic' && G.length ? G.map((g) => g.name).slice(0, 2).join(', ') : '',
478
+ menu(t, [{ head: 'Group by' }, ...['epic', 'mine', 'owner', 'status', 'none'].map((k) => ({ label: MD.BY_LABEL[k],
479
+ sub: k === 'mine' && L.names.length ? L.names.join(', ') : k === 'epic' && G.length ? G.map((g) => g.name).slice(0, 2).join(', ') : '',
481
480
  radio: true, on: by === k, go: () => press(id, M, { kind: 'by', by: k }) })),
482
481
  { hr: true }, { head: 'Saved group sets' },
483
482
  ...(L.sets || []).map((s) => ({ label: s.names.join(' · '), sub: same(s.names) ? 'this one' : s.name !== s.names.join(' · ') ? s.name : '', go: async () => { if (await press(id, M, { kind: 'groups', names: s.names })) press(id, M, { kind: 'by', by: 'mine' }); } })),
@@ -549,8 +548,6 @@ function wire(body, id) {
549
548
  const key = r.item ? 'task:' + (r.item.uid || r.item.key) : '';
550
549
  if (key && /^task:[A-Za-z0-9]/.test(key)) {
551
550
  if (L.by === 'mine' && target) await press(id, M, { kind: 'place', task: key, group: target });
552
- const stg = L.by === 'stage' || !L.by ? (M.acts.stage || '') : M.acts.stage || '';
553
- if (stg) await press(id, M, { kind: 'stage', task: key, stage: stg });
554
551
  }
555
552
  inp.value = '';
556
553
  await after(r, 'Task added.');
@@ -567,7 +564,7 @@ function wire(body, id) {
567
564
  // PRD to Jira (T1 to T3)
568
565
  if (d.czsAct === 'tk-sendall') { sendSheet(id, M); return; }
569
566
  if (d.czsAct === 'tk-openfirst') {
570
- const wk = Date.now() + 7 * 864e5, r = MD.taskRows(M, Lof(id)).filter((x) => !x.done && !x.req && x.end && Date.parse(x.end) <= wk).sort((a, b) => a.end.localeCompare(b.end))[0];
567
+ const wk = Date.now() + 7 * 864e5, r = MD.taskRows(M, Lof(id)).filter((x) => !x.closed && !x.req && x.end && Date.parse(x.end) <= wk).sort((a, b) => a.end.localeCompare(b.end))[0];
571
568
  if (r) openTask(id, M, r.key); return;
572
569
  }
573
570
  if (d.tkGfold) { X.fold.set(d.tkGfold, t.getAttribute('aria-expanded') !== 'true'); redrawView(); return; }
@@ -592,16 +589,11 @@ function wire(body, id) {
592
589
  if ('hiFocusadd' in d) { const n = body.querySelector('#ovTask'); if (n) n.focus(); return; }
593
590
  if ('ovAdd' in d) { addTask(); return; }
594
591
  if (d.hiChk) { const row = MD.taskRows(M, Lof(id)).find((x) => x.key === d.hiChk); if (row && row.canCheck) after(await X.ctx.pmPost('/api/boards/tasks/state', { ...bw(M), task: row.uid, state: row.done ? 'To do' : 'Done' }), row.done ? 'Reopened.' : 'Done.'); return; }
595
- if (d.hiTstage) {
596
- const key = d.hiTstage, stages = (M.acts && M.acts.stages) || [];
597
- menu(t, [{ head: 'Stage of this task' }, ...stages.map((s) => ({ label: s, radio: true, on: (Lof(id).stage || {})[key] === s, go: () => press(id, M, { kind: 'stage', task: key, stage: s }) })), { label: 'No stage', go: () => press(id, M, { kind: 'stage', task: key, stage: '' }) }], 'Stage of this task');
598
- return;
599
- }
600
592
  if (d.hiTmore) {
601
593
  const key = d.hiTmore, row = MD.taskRows(M, Lof(id)).find((x) => x.key === key); if (!row) return;
602
594
  const L = Lof(id);
603
595
  const items = [{ label: 'Open', go: () => openTask(id, M, key) }];
604
- if (row.canCheck) { items.push({ head: 'Status' }); for (const s of ['To do', 'In progress', 'In review', 'Done']) items.push({ label: s, radio: true, on: row.state === s, go: async () => after(await X.ctx.pmPost('/api/boards/tasks/state', { ...bw(M), task: row.uid, state: s }), 'Status changed.') }); }
596
+ if (row.canCheck) { items.push({ head: 'Status' }); for (const s of MD.TASK_STATES) items.push({ label: s, radio: true, on: row.state === s, go: async () => after(await X.ctx.pmPost('/api/boards/tasks/state', { ...bw(M), task: row.uid, state: s }), 'Status changed.') }); }
605
597
  if (L.names.length) { items.push({ head: 'Group' }); for (const g of L.names) items.push({ label: g, radio: true, on: row.group === g, go: () => press(id, M, { kind: 'place', task: key, group: g }) }); items.push({ label: 'Not in a group', go: () => press(id, M, { kind: 'place', task: key, group: '' }) }); }
606
598
  menu(t, items, 'More for ' + row.title);
607
599
  return;
@@ -658,7 +650,7 @@ function wire(body, id) {
658
650
  async function openTask(id, M, key) {
659
651
  const row = (M.tasks.rows || []).find((x) => x.key === key); if (!row) return;
660
652
  const o = bw(M);
661
- if (!row.pmos && row.ref && /^Jira/.test(row.src || '')) { (await import('./premium-vw-jira.js')).openTicket({ ...o, initiative: id, ref: row.ref }); return; }
653
+ // a Jira ticket opens in the one task editor too (canvas XetX1Jira): Jira's fields read-only, the PM's notes editable; its key opens the full ticket
662
654
  const rename = row.pmos && row.uid && X.ctx.renameTask ? X.ctx.renameTask({ uid: row.uid, title: row.title, ws: o.ws, board: o.board }) : null;
663
655
  (X.ctx.VW.drill(), await import('./premium-vw-item.js')).openWorkItem({ kind: 'task', ini: id, key: row.key, title: row.title, ...o, rename });
664
656
  }
@@ -17,6 +17,7 @@
17
17
  * the other products), phoneDay (GET /api/phone-day), review (GET /api/home-review) }. A part that did not answer is left out, never guessed. */
18
18
  import { needsOf, boardRows, productCard, productName, sessionRow, nameOf, iniOfSession, todayOf, live, OPEN, hm } from './home-data.js';
19
19
  import { programState, groupRows } from './program-model.js';
20
+ import { homeSub } from './ms-suggest.js';
20
21
  import { STEPS, stageKey } from './premium-initiative-head.js';
21
22
 
22
23
  const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
@@ -68,7 +69,6 @@ export function productsOf(D) {
68
69
  }
69
70
 
70
71
  /* ── rows ── */
71
- export const TASKS_SHOWN = 3;
72
72
  function taskHint(t, now, mine) {
73
73
  const d = t.end ? dayDiff(t.end, now) : null;
74
74
  const when = d == null ? '' : d === 0 ? 'due today' : d === 1 ? 'due tomorrow' : d < 0 ? plural(-d, 'day', 'days') + ' late' : 'due ' + shortDay(t.end);
@@ -117,10 +117,11 @@ function iniRowOf(D, r, needs, now) {
117
117
  const mine = tasks.filter((t) => t.mine).length;
118
118
  const run = ses.filter((s) => s.state === 'working').length;
119
119
  const right = turn ? 'your turn' + (mine ? ' · ' + plural(mine, 'task', 'tasks') : '') : mine ? plural(mine, 'task', 'tasks') : run ? run + ' running' : 'Nothing today';
120
- // next steps, sessions and today's meetings always show; tasks show the TASKS_SHOWN most urgent, the rest behind "Show N more tasks"
121
- const kids = [...steps, ...ses.sort((a, b) => (RANK[b.state] || 0) - (RANK[a.state] || 0)), ...tasks.map((t, i) => (i < TASKS_SHOWN ? t : { ...t, extra: true })), ...meet];
120
+ // next steps, sessions and today's meetings sit under the initiative; its tasks do not (Wawan, 2026-10-25: Home lists no tasks, the
121
+ // initiative's page in the Viewer holds them). The row keeps them for Your move, where the PM's own late ones still lead
122
+ const kids = [...steps, ...ses.sort((a, b) => (RANK[b.state] || 0) - (RANK[a.state] || 0)), ...meet];
122
123
  const hint = [(r.wf && r.wf.name) || 'Product feature', r.stage].filter(Boolean).join(' · '); // D99: Kind becomes Workflow
123
- return { id: 'i:' + r.id, kind: 'ini', ini: r.id, name: r.title, hint, right, turn, busy: kids.length > 0, state: turn ? 'needs' : run ? 'working' : 'quiet', kids, board: r, updated: r.updated || '',
124
+ return { id: 'i:' + r.id, kind: 'ini', ini: r.id, name: r.title, hint, right, turn, busy: kids.length > 0, state: turn ? 'needs' : run ? 'working' : 'quiet', kids, tasks, board: r, updated: r.updated || '',
124
125
  stage: r.stage || '', at: rowAt(r), steps: ownSteps(r), yours: kids.filter(isMove).length, late: kids.some((k) => k.kind === 'task' && k.mine && k.late) };
125
126
  }
126
127
 
@@ -129,7 +130,8 @@ const closedOf = (n, turnN) => [n ? plural(n, 'initiative', 'initiatives') : '',
129
130
  const isMe = (D, who) => { const me = String((D.today && D.today.me) || '').toLowerCase(), w = String(who || '').toLowerCase(); return !w || /^(pm|you)(:|$)/.test(w) || (!!me && (w === me || w.startsWith(me + ' '))); };
130
131
  /** One group per program, placed above the products: with one product picked, only a program that has an initiative or an open task in it, or whose home it is. The grouping is
131
132
  * groupRows (program-model.js), the one Board and Kanban use: a program's initiatives leave their product's group, so each initiative shows
132
- * once, and sit under one sub-heading per product, in the order the products first appear. The program's own open tasks come first.
133
+ * once, and sit under one sub-heading per product, in the program's order (option A, agreed 2026-10-25: groupRows sorts them by p.order, A to
134
+ * Z when the PM never ordered it; a row that is your turn keeps its dot and no longer jumps up). The program's own open tasks come first.
133
135
  * With one product picked, only that product's initiatives and tasks show. D.programs is GET /api/programs' programs. */
134
136
  export function programGroups(D, groups, products, o, now) {
135
137
  const rowsOf = (ws) => { const p = products.find((x) => x.ws === ws); return p ? { name: p.name, rows: (p.model && p.model.initiatives && p.model.initiatives.list && p.model.initiatives.list.rows) || (p.primary ? boardRows(D) : []) } : null; };
@@ -161,8 +163,11 @@ export function programGroups(D, groups, products, o, now) {
161
163
  if (!inis.length && !tasks.length && !fresh) continue;
162
164
  const st = programState(pr, rowsOf, now);
163
165
  const turnN = inis.filter((x) => x.turn).length;
164
- out.push({ key: 'g:' + pr.id, kind: 'program', program: pr, st, name: pr.title, subs, inis, rest: [], tasks, count: inis.length, turnN,
165
- yours: inis.reduce((n, x) => n + x.yours, 0) + tasks.filter((t) => t.mine && t.late).length, late: inis.some((x) => x.late) || tasks.some((t) => t.late),
166
+ // Claude's milestone changes wait on the PM: one Your move line per program, never one per change (canvas XmsgB, Home frame)
167
+ const msSub = homeSub(pr);
168
+ const msRow = msSub ? { id: 'ms:' + pr.id, kind: 'msreview', program: pr.id, name: pr.title, hint: msSub, state: 'needs' } : null;
169
+ out.push({ key: 'g:' + pr.id, kind: 'program', program: pr, st, name: pr.title, subs, inis, rest: [], tasks, count: inis.length, turnN, msRow,
170
+ yours: inis.reduce((n, x) => n + x.yours, 0) + tasks.filter((t) => t.mine && t.late).length + (msRow ? 1 : 0), late: inis.some((x) => x.late) || tasks.some((t) => t.late),
166
171
  products: st.products, closedLine: closedOf(inis.length, turnN) });
167
172
  }
168
173
  return out;
@@ -247,8 +252,9 @@ function moveOf(groups, needs) {
247
252
  for (const g of groups) {
248
253
  if (g.kind === 'loose') { for (const r of g.rows) if (r.check && r.late) put(late, r); else if (r.state === 'needs' || r.state === 'blocked') put(rest, r, r.kind === 'session' ? '' : bareHint(r)); continue; }
249
254
  for (const t of g.tasks || []) if (t.mine && t.late) put(late, t, g.name);
255
+ if (g.msRow) put(rest, g.msRow, g.msRow.hint);
250
256
  for (const r of g.flat || []) put(rest, r, '');
251
- for (const i of (g.inis || []).concat(g.rest || [])) for (const k of i.kids) if (isMove(k)) put(k.kind === 'task' ? late : rest, k, i.name);
257
+ for (const i of (g.inis || []).concat(g.rest || [])) for (const k of i.kids.concat(i.tasks || [])) if (isMove(k)) put(k.kind === 'task' ? late : rest, k, i.name);
252
258
  }
253
259
  for (const r of needs) if (!seen.has(r.id) && !r.needSession) put(rest, r, r.kind === 'session' ? '' : bareHint(r));
254
260
  return late.concat(rest);
@@ -81,7 +81,9 @@ export function nextReason(h) {
81
81
  export function stageCardHtml(h, o = {}) {
82
82
  const R = o.rows || stepRows(h, o);
83
83
  const clock = clockText(h.clock);
84
- const bars = `<div class="hm-bars hm-scbars" aria-hidden="true">${(h.steps || []).map((s) => `<i class="${esc(s.cls)}"></i>`).join('')}</div>`;
84
+ // every bar names its stage on hover (Wawan, 2026-10-25); the list stays hidden from a screen reader, the header says the stage
85
+ const SAY = { done: ' · done', now: ' · now', skip: ' · skipped' };
86
+ const bars = `<div class="hm-bars hm-scbars" aria-hidden="true">${(h.steps || []).map((s) => `<i class="${esc(s.cls)}" title="${esc((s.label || '') + (SAY[s.cls] || ''))}"></i>`).join('')}</div>`;
85
87
  const fold = R.done.length ? { n: R.done.length, names: o.doneOpen ? '' : R.done.map((x) => x.label).join(', '), open: !!o.doneOpen, attr: 'data-hm-done' } : null;
86
88
  const steps = (o.doneOpen ? R.done : []).concat(R.shown);
87
89
  const list = stepsHtml(steps, { label: h.checkTitle, cls: 'hm-scl', fold, more: R.more > 0 ? { n: R.more, attr: 'data-hm-more' } : null, tail: o.tail || '' });
@@ -1,71 +1,47 @@
1
- /* pm/home-task.js — one task in the Viewer (initiative premium-uncovered-features, H1; canvas HmMyWork, the Viewer).
1
+ /* pm/home-task.js — one task in the Viewer from Home's list (initiative premium-uncovered-features, H1; third feedback batch item 7, canvas
2
+ * XetX1Rest … XetX1Phone).
2
3
  *
3
- * A PMOS task of an initiative (GET /api/boards/items, src "pmos") opens here from the list: its check, its title and where it sits
4
- * ("Session list v2 · task · due today"), its due chip, its status, what the PM needs for it (the initiative, its core documents and its
5
- * Jira item), and the two presses of the canvas: talk it through in the chat, and Done. Every write is the board's own route
6
- * (POST /api/boards/tasks/state) and is the PM's press; a refusal shows the route's reason and changes nothing.
7
- * The PM's own items (a note, a mention made into a task) open in My work's item view (home-work.js), drawn in the same shape. */
8
- import { esc, svg, P } from './home-today.js';
4
+ * A PMOS task of an initiative (GET /api/boards/items, src "pmos") opens here from the list and edits in place: the check box in the header
5
+ * is the quick Done, the title is the rename press, and the card under it (task-card.js, the one editor every page uses) changes the status,
6
+ * the dates, the owner, the group, the notes and the initiative. Every write is the board's own route and is the PM's press; each says so
7
+ * in a toast with Undo, and a refusal shows the route's reason and changes nothing. Talk it through in chat is under ⋯ (the chat is beside
8
+ * the Viewer on Home). The PM's own items (a note, a mention made into a task) open in My work's item view (home-work.js). */
9
+ import { taskOf, checkOf, mountCard, boardSaver, cardStyle } from './task-card.js';
9
10
 
10
- const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
11
- const STATES = ['To do', 'In progress', 'In review', 'Done'];
12
- const dayDiff = (iso, now) => { const m = /^(\d{4})-(\d{2})-(\d{2})/.exec(String(iso || '')); if (!m) return null; const a = new Date(+m[1], +m[2] - 1, +m[3]); const t = new Date(now); t.setHours(0, 0, 0, 0); return Math.round((a - t) / 86400000); };
13
- /** The due chip's words: "Due today", "Due tomorrow", "2 days late", "Due 30 Oct", or "No date". Pure. */
14
- export function dueText(iso, now = Date.now()) {
15
- const d = dayDiff(iso, now);
16
- if (d == null) return 'No date';
17
- if (d === 0) return 'Due today';
18
- if (d === 1) return 'Due tomorrow';
19
- if (d < 0) return -d + (d === -1 ? ' day late' : ' days late');
20
- const m = /^(\d{4})-(\d{2})-(\d{2})/.exec(iso); return 'Due ' + +m[3] + ' ' + MON[+m[2] - 1];
21
- }
22
-
23
- /** h: { VW, pmPost, toast, now, ws, board, iniTitle(id), docs(id) → [{ title, path }], openIni(id), openDoc(doc), askInChat(task), openRecord(task), onChange() }
24
- * Shell A (canvas XvATask): the summary card says when it is due, quotes the task's words, says where it sits, and holds the one primary
25
- * (Talk it through in chat) with Done as a quiet check beside it. "Needs" folds below: the initiative, its documents and the Jira item.
26
- * The status moves and the task's record are under ⋯ (the xvMore note: change it, then look back). h.rename(task), when given, is the
27
- * Viewer's rename option for the task (rename-press.js taskRename). */
11
+ /** h: { VW, pmPost, toast, toastUndo?, now, ws, board, iniTitle(id), openIni(id), askInChat(task), onChange(), rename?(task),
12
+ * owners?() → [names], inis?() → [{ id, title }] } */
28
13
  export function openTask(task, h) {
29
- const st = { msg: '', busy: false };
30
- const t = task;
31
- const draw = (b) => {
32
- const now = h.now ? h.now() : Date.now();
33
- const done = t.status === 'Done';
34
- const due = dueText(t.end, now);
35
- const late = /late/.test(due), today = due === 'Due today';
36
- const where = [h.iniTitle(t.ini), t.status && t.status !== 'To do' ? t.status.toLowerCase() : '', t.owner && !/^(pm|you)(:|$)/i.test(t.owner) ? 'with ' + t.owner : ''].filter(Boolean).join(' · ');
37
- const docs = (h.docs ? h.docs(t.ini) : []) || [];
38
- const row = (icon, title, sub, attr) => `<button type="button" class="czs-it" ${attr}><span class="ut-tki" aria-hidden="true">${icon}</span><span class="w">${esc(title)}${sub ? `<span>${esc(sub)}</span>` : ''}</span></button>`;
39
- const need = [row(svg(P.flag, 15), h.iniTitle(t.ini), 'the initiative', 'data-tk="ini"')]
40
- .concat(docs.slice(0, 4).map((d, i) => row(svg(P.doc, 15), d.title, '', `data-tk-doc="${i}"`)))
41
- .concat(t.ref && t.src !== 'pmos' ? [`<div class="czs-it"><span class="ut-tki j" aria-hidden="true">J</span><span class="w">${esc(t.ref)}</span></div>`] : []);
42
- b.innerHTML = h.VW.czSummary({ line: done ? 'Done' : due === 'No date' ? '' : due, tone: done ? 'ok' : late || today ? 'warn' : '', text: t.note || t.text || '', meta: where,
43
- primary: { label: 'Talk it through in chat', act: 'chat' }, also: [{ act: 'done', label: done ? 'Done' : 'Mark ' + t.title + ' done', icon: 'M5 12l4.5 4.5L19 7', disabled: done }] })
44
- + h.VW.czSections([{ id: 'need', title: 'Needs', count: need.length, open: true, html: need.join('') }], { key: 'task' })
45
- + `<p class="ut-small ut-mut" role="status" id="tkMsg">${esc(st.msg)}</p>`;
46
- };
47
- const more = () => STATES.filter((x) => x !== 'Done' && x !== t.status).map((x) => ({ label: 'Mark ' + x.toLowerCase(), on: () => setState(x) }))
48
- .concat(h.openRecord ? [{ sep: true }, { label: "Open the task's record", on: () => h.openRecord(t) }] : []);
49
- // tap the title to rename (canvas RnATask): a PMOS task only; a Jira ticket's name is Jira's
50
- const rename = t.src === 'pmos' && h.rename ? h.rename(t) : null;
51
- const body = h.VW.open({ id: 'task:' + t.uid, kind: 'Task', title: t.title, icon: 'task', more: more(), render: draw, rename });
52
- const setState = async (state) => {
53
- if (st.busy) return; st.busy = true;
54
- const r = await h.pmPost('/api/boards/tasks/state', { ws: h.ws, board: t.board || h.board, task: t.uid, state }).catch(() => null);
55
- st.busy = false;
56
- if (!r || r.ok !== true) { st.msg = (r && r.error) || 'The status did not change.'; draw(body); return; }
57
- t.status = state; st.msg = '';
58
- h.toast(state === 'Done' ? 'Done. It leaves your list.' : 'Now ' + state.toLowerCase() + '.');
59
- if (state === 'Done') h.VW.close(); else openTask(t, h);
60
- if (h.onChange) h.onChange();
61
- };
62
- body.onclick = (e) => {
63
- const b = e.target.closest('button'); if (!b || b.disabled) return;
64
- const k = b.dataset.tk || b.dataset.czsAct;
65
- if (b.dataset.tkDoc != null && b.dataset.tkDoc !== '') { const d = (h.docs ? h.docs(t.ini) : [])[+b.dataset.tkDoc]; if (d && h.openDoc) h.openDoc(d); return; }
66
- if (k === 'done') setState('Done');
67
- else if (k === 'ini') h.openIni(t.ini);
68
- else if (k === 'chat') h.askInChat(t);
14
+ cardStyle();
15
+ const raw = task;
16
+ const ws = h.ws, board = raw.board || h.board;
17
+ const t = taskOf(raw, { iniTitle: h.iniTitle(raw.ini), board });
18
+ const id = 'task:' + raw.uid;
19
+ const save = boardSaver({ ws, board, t, post: (p, b) => h.pmPost(p, b) });
20
+ let card = null, layout = null;
21
+ const changed = () => {
22
+ raw.status = t.status; raw.end = t.due; raw.start = t.start; raw.owner = t.owner; raw.notes = t.notes; raw.ini = t.ini; // the list reads the same row
23
+ if (h.VW.setCheck) h.VW.setCheck(id, checkOf(t));
24
+ clearTimeout(changed.t); changed.t = setTimeout(() => { if (h.onChange) h.onChange(); }, 400);
69
25
  };
26
+ const toast = (msg, undo) => (h.toastUndo && undo ? h.toastUndo(msg, undo) : h.toast(msg));
27
+ const body = h.VW.open({
28
+ id, kind: 'Task', title: t.title, icon: 'task', check: checkOf(t),
29
+ rename: t.jira ? null : h.rename ? h.rename(raw) : null,
30
+ more: () => [{ label: 'Talk it through in chat', on: () => h.askInChat(raw) }],
31
+ onPress: (act) => { if (act === 'check' && card) card.setStatus(t.status === 'Done' ? 'To do' : 'Done'); },
32
+ render: (el) => {
33
+ card = mountCard(el, t, {
34
+ save, toast, changed, now: h.now,
35
+ openIni: (ini) => h.openIni(ini),
36
+ iniTitleOf: (ini) => h.iniTitle(ini),
37
+ owners: () => (h.owners ? h.owners() : []),
38
+ inis: () => (h.inis ? h.inis() : []),
39
+ groups: () => (layout ? layout.names || [] : null),
40
+ });
41
+ },
42
+ });
43
+ // the PM's groups of the initiative, and which one holds this task (initiative-layout); the group chip shows once they are read
44
+ if (t.ini) fetch('/api/initiative-layout?initiative=' + encodeURIComponent(t.ini) + (ws ? '&ws=' + encodeURIComponent(ws) : ''), { credentials: 'same-origin' })
45
+ .then((r) => r.json()).then((L) => { if (!L || !L.ok || !card || !body || !body.isConnected) return; layout = L; t.group = (L.of || {})[t.key] || ''; card.draw(); }).catch(() => {});
70
46
  return body;
71
47
  }
@@ -5,7 +5,7 @@
5
5
  * more than one product, on a desktop the filter icon for Kept and Done, New), the "N are yours" line, the Today card only while the day has
6
6
  * a moment (a recording, a meeting soon or on now, the end of the day, the weekly review open), each program's group, then each product's
7
7
  * group (an initials tile, the name, the goal dots, a chevron; one-line rows with the stage track on the right; sessions, next steps and
8
- * tasks indented under their initiative), and "Not in an initiative" as a folded line. Your day (dayHtml) is a sheet over the list: the date
8
+ * meetings indented under their initiative; its tasks are on its page in the Viewer, not here), and "Not in an initiative" as a folded line. Your day (dayHtml) is a sheet over the list: the date
9
9
  * and the day's meetings, Your move with its count, and This week with the Weekly review. Every group folds; home-app.js keeps the folds.
10
10
  * The model is home-list.js (pure). This file only turns it into HTML: every control is a <button> (or the capture form) with a data-hm-*
11
11
  * press that home-app.js handles. Text from the records goes through esc(). */
@@ -13,6 +13,7 @@
13
13
  import { STEPS } from './premium-initiative-head.js';
14
14
  import { whenOf } from './home-list.js';
15
15
  import { ringHtml } from './home-line.js';
16
+ import { gripHtml, sugHtml } from './prog-order.js'; // a program's order: the grip and ✦ (canvas RoADrag, RoAPhone)
16
17
 
17
18
  export const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
18
19
  export const P = {
@@ -77,16 +78,13 @@ export function chatHeadHtml(h) {
77
78
  return `${mk}${same ? lead : ''}${name}${same && !h.prog ? track(h.at == null ? -1 : h.at, h.stage || '', h.steps) : ''}${chip}`;
78
79
  }
79
80
  /** An initiative row: its mark, its title, the count of what is yours while it is folded, the stage track, and a chevron when something
80
- * sits under it. The title opens the initiative; the chevron shows or hides its sessions, next steps, tasks and meetings. */
81
- function iniHtml(r, o) {
81
+ * sits under it. The title opens the initiative; the chevron shows or hides its sessions, next steps and meetings. */
82
+ function iniHtml(r, o, po) {
82
83
  const open = o.isOpen(r.id);
83
- const all = o.tasksOpen ? o.tasksOpen(r.id) : false, hid = r.kids.filter((k) => k.extra).length;
84
- const kids = all ? r.kids : r.kids.filter((k) => !k.extra);
85
- const more = hid ? `<button type="button" class="hv-fold kid" data-hm-tasks="${esc(r.id)}" aria-expanded="${all}"><span class="hv-mk"></span>${all ? 'Fewer' : hid + ' more'}${svg(all ? P.chevU : P.chevD, 15)}</button>` : '';
86
- const nest = open ? `<div class="hm-nest" role="group" aria-label="In ${esc(r.name)}">${kids.map((k) => rowHtml(k, { ...o, kid: true })).join('')}${more}</div>` : '';
84
+ const nest = open ? `<div class="hm-nest" role="group" aria-label="In ${esc(r.name)}">${r.kids.map((k) => rowHtml(k, { ...o, kid: true })).join('')}</div>` : '';
87
85
  const badge = !open && r.yours ? `<span class="hv-c" role="img" aria-label="${r.yours === 1 ? '1 is yours' : r.yours + ' are yours'}">${r.yours}</span>` : '';
88
86
  const chev = r.kids.length ? `<button type="button" class="hv-xc" data-hm-kids="${esc(r.id)}" aria-expanded="${open}" aria-label="${open ? 'Hide' : 'Show'} what is in ${esc(r.name)}">${svg(open ? P.chevD : P.chevR, 15)}</button>` : '<span class="hv-xc" aria-hidden="true"></span>';
89
- return `<div class="hm-r hv-r ini st-${esc(r.state)}${o.sel === r.id ? ' sel' : ''}" data-id="${esc(r.id)}"><button type="button" class="hm-rm" data-hm-sel="${esc(r.id)}"${o.sel === r.id ? ' aria-current="true"' : ''} title="${esc(r.hint)}">${markHtml(r.yours && r.state !== 'blocked' ? { state: 'needs' } : r)}`
87
+ return `<div class="hm-r hv-r ini st-${esc(r.state)}${o.sel === r.id ? ' sel' : ''}" data-id="${esc(r.id)}"${po ? ` data-po-id="${esc(r.ini || r.id)}"` : ''}>${po ? gripHtml(r.name) : ''}<button type="button" class="hm-rm" data-hm-sel="${esc(r.id)}"${o.sel === r.id ? ' aria-current="true"' : ''} title="${esc(r.hint)}">${markHtml(r.yours && r.state !== 'blocked' ? { state: 'needs' } : r)}`
90
88
  + `<span class="hm-rt"><b>${esc(r.name)}</b></span>${badge}${track(r.at, r.stage, r.steps)}</button>${chev}</div>${nest}`;
91
89
  }
92
90
 
@@ -117,18 +115,19 @@ function productHtml(g, o) {
117
115
  /** A program's group (canvas PgHomePhone, PgHomeDesk): above the products. Its header: the program tile, the name, the next milestone's
118
116
  * diamond with its date and one small diamond per initiative it waits on (filled when that initiative is past the Deliver milestone), a chevron.
119
117
  * The title opens the program in Home's Viewer with its own chat (canvas HbCProg); the chevron folds the group. Inside: the program's own tasks first, then a sub-heading
120
- * per product with that product's initiatives. */
118
+ * per product with that product's initiatives, in the program's order (option A): the grip moves a row, a phone holds it then drags, and ✦
119
+ * in the open header offers Claude's order from the dates (prog-order.js). The blue dot still marks your turn; the row no longer jumps up. */
121
120
  function programHtml(g, o) {
122
121
  const open = o.pOpen(g);
123
122
  const nx = g.st && g.st.next;
124
123
  const ms = nx ? `<span class="hv-msd${nx.late ? ' late' : ''}"><span class="hv-dm"></span>${esc(nx.day || nx.name)}${nx.n ? `<span class="hv-rd">${Array.from({ length: nx.n }, (_, i) => `<i${i < nx.ready ? ' class="on"' : ''}></i>`).join('')}</span>` : ''}</span>` : '';
125
124
  const line = nx ? 'Next milestone ' + nx.name + (nx.day ? ', ' + nx.day : '') + (nx.late ? ', late' : '') + (nx.n ? ', ' + nx.ready + ' of ' + nx.n + (nx.n === 1 ? ' initiative' : ' initiatives') + ' ready' : '') : 'No open milestone';
126
125
  const head = `<div class="hv-gh hv-prg${open ? '' : ' closed'}${o.selHead === g.key ? ' sel' : ''}"><button type="button" class="hv-pt" data-hm-prog="${esc(g.program.id)}" aria-label="Open ${esc(g.name)}, a program"${o.selHead === g.key ? ' aria-current="true"' : ''}>`
127
- + `<span class="hv-tl tp" aria-hidden="true" data-cz-rail-tile="${esc(g.key)}" data-cz-rail-name="${esc(g.name)}">${svg(P.layers, 16)}${open ? '' : nd(g)}</span><b>${esc(g.name)}</b></button>`
126
+ + `<span class="hv-tl tp" aria-hidden="true" data-cz-rail-tile="${esc(g.key)}" data-cz-rail-name="${esc(g.name)}">${svg(P.layers, 16)}${open ? '' : nd(g)}</span><b>${esc(g.name)}</b></button>${open && g.st ? sugHtml(g.program, g.st) : ''}`
128
127
  + `<button type="button" class="hv-pf" data-hm-pg="${esc(g.key)}" aria-expanded="${open}" aria-label="${esc(g.name)}. ${esc(line)}${g.yours ? '. ' + yoursWords(g) : ''}. ${open ? 'Close' : 'Open'} the group">${ms}<span class="hv-cv">${svg(open ? P.chevD : P.chevR, 16)}</span></button></div>`;
129
128
  if (!open) return `<section class="hm-pg hv-g prg" aria-label="${esc(g.name)}">${head}</section>`;
130
- const body = g.tasks.map((t) => rowHtml(t, o)).join('')
131
- + g.subs.map((x) => `<div class="hv-psub" role="heading" aria-level="3"><span class="hv-st2 t${x.tone}" aria-hidden="true">${esc(x.initials)}</span>${esc(x.name)}</div>${x.inis.map((r) => iniHtml(r, o)).join('')}`).join('');
129
+ // the program's tasks are on its panel (On the program), not on Home: Home lists no tasks (Wawan, 2026-10-25)
130
+ const body = g.subs.map((x) => `<div class="hv-psub" role="heading" aria-level="3"><span class="hv-st2 t${x.tone}" aria-hidden="true">${esc(x.initials)}</span>${esc(x.name)}</div><div class="po-list" data-po-list="${esc(g.program.id)}">${x.inis.map((r) => iniHtml(r, o, true)).join('')}</div>`).join('');
132
131
  return `<section class="hm-pg hv-g prg" aria-label="${esc(g.name)}">${head}<div class="hv-card">${body || `<p class="hm-none">${(g.program.members || []).length ? 'No open initiatives' : 'No initiatives yet'}. Open the program to move some in.</p>`}</div></section>`;
133
132
  }
134
133
  /** "Not in an initiative" (HvAC .lh): a line under the groups. Folded it shows a blue dot when a row waits on you, an amber square when one
@@ -0,0 +1,50 @@
1
+ /* pm/ms-suggest.css — Claude's milestone suggestions (pm/ms-suggest.js; canvas XmsgB). ms-suggest.js loads it once, so it works wherever the
2
+ * program panel opens (Board, Home). Token vars only, over pm/cozy.css; the program's purple falls back to the frames' when the page sets none.
3
+ * Quiet: no motion. Every class starts with msg-. */
4
+ .msg-box, .msg-list { --msg-prog: var(--pp-prog, var(--cz-c-6b4fa3)); --msg-progbg: var(--pp-progbg, rgba(107,79,163,.10)); }
5
+ .msg-box { border: 1px dashed color-mix(in srgb, var(--msg-prog) 45%, transparent); border-radius: 16px; overflow: hidden; }
6
+ .msg-hd { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; background: var(--msg-progbg); font-size: 12.5px; color: var(--cz-ink2); }
7
+ .msg-ht { flex: 1; min-width: 0; }
8
+ .msg-ht b { color: var(--msg-prog); font-weight: 700; }
9
+ .msg-list { display: flex; flex-direction: column; }
10
+ .msg-r { display: flex; align-items: flex-start; gap: 10px; padding: 10px 8px 10px 12px; }
11
+ .msg-box .msg-r + .msg-r, .msg-box .msg-hd + div .msg-r:first-child { border-top: 1px dashed color-mix(in srgb, var(--msg-prog) 25%, transparent); }
12
+ .msg-list .msg-r + .msg-r { border-top: 1px solid color-mix(in srgb, var(--cz-ink) 8%, transparent); }
13
+ .msg-mk { color: var(--msg-prog); display: inline-flex; flex: none; padding-top: 2px; }
14
+ .msg-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
15
+ .msg-h { display: flex; gap: 8px; align-items: baseline; width: 100%; }
16
+ .msg-h b { font-size: 13px; font-weight: 700; color: var(--cz-ink); flex: 1; min-width: 0; }
17
+ .msg-d { font-size: 12px; font-weight: 700; color: var(--cz-ink2); white-space: nowrap; }
18
+ .msg-w { font-size: 12px; color: var(--cz-ink3); line-height: 1.4; }
19
+ .msg-src { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; color: var(--cz-ink2); background: var(--cz-well); border-radius: 999px; padding: 2px 8px; }
20
+ .msg-src svg { color: var(--cz-ink3); }
21
+ .msg-gd { width: 7px; height: 7px; transform: rotate(45deg); border-radius: 2px; background: var(--msg-prog); display: inline-block; }
22
+ .msg-ends { display: inline-flex; align-items: center; gap: 2px; flex: none; }
23
+ .msg-ok, .msg-ib { all: unset; box-sizing: border-box; cursor: pointer; width: 32px; height: 32px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; }
24
+ .msg-ok { background: var(--msg-prog); color: var(--cz-card); }
25
+ .msg-ib { color: var(--cz-ink3); }
26
+ @media (hover: hover) { .msg-ib:hover { background: var(--cz-well); color: var(--cz-ink); } .msg-ok:hover { filter: brightness(1.08); } }
27
+ .msg-ok:focus-visible, .msg-ib:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; }
28
+ .msg-ok[disabled], .msg-ib[disabled] { opacity: .45; cursor: default; }
29
+ /* a phone: the touch target grows to 44 px; the row wraps its presses under the text when it is narrow */
30
+ @media (max-width: 760px) { .msg-ok, .msg-ib { width: 40px; height: 40px; } .msg-r { flex-wrap: wrap; } }
31
+ /* in Waits on you (blue well): the rows sit on the card */
32
+ .pp-needs .msg-list { background: var(--cz-card); border-radius: 12px; margin-bottom: 4px; }
33
+
34
+ /* the charter: last checked and Check now (XmsgB, last frame), and the change filled in from the pencil */
35
+ .msg-chk { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--cz-ink3); }
36
+ .msg-chk span { flex: 1; min-width: 0; }
37
+ .msg-chk .msg-ib { width: 28px; height: 28px; }
38
+ .msg-chk .msg-ib.on svg { animation: msg-spin 1.2s linear infinite; }
39
+ @keyframes msg-spin { to { transform: rotate(360deg); } }
40
+ @media (prefers-reduced-motion: reduce) { .msg-chk .msg-ib.on svg { animation: none; } }
41
+ .msg-risk { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--cz-risk); }
42
+ .msg-risk span { flex: 1; min-width: 0; }
43
+ .msg-risk { margin: 4px 0 0 30px; }
44
+ .msg-risk i { width: 7px; height: 7px; border-radius: 50%; background: var(--pc-amberdot, var(--cz-risk)); flex: none; }
45
+ .msg-risk .pc-ib { width: 28px; height: 28px; }
46
+ .msg-chg { display: flex; align-items: flex-start; gap: 6px; margin: 4px 0 0 30px; font-size: 12px; color: var(--cz-ink2); }
47
+ .msg-chg svg { color: var(--pp-prog, var(--cz-c-6b4fa3)); flex: none; margin-top: 1px; }
48
+ .pc-lnw.msg-on > .pc-ln { border: 1px dashed color-mix(in srgb, var(--pp-prog, var(--cz-c-6b4fa3)) 45%, transparent); border-radius: 14px; }
49
+ .pc-ms > .msg-chg { margin: 0 0 8px; }
50
+ .pc-ms > .msg-chk { margin: 0 0 8px; }