create-pmos 0.827.0 → 0.829.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 (103) hide show
  1. package/package.json +217 -45
  2. package/payload/KIT-VERSION +1 -1
  3. package/payload/planning/evals/eval-calibration.md +1 -1
  4. package/payload/planning/okrs/health-budgets.md +1 -1
  5. package/payload/state/discoveries.md +1 -1
  6. package/workspace/bin/pmos.js +19 -9
  7. package/workspace/board-deliveries-test.js +2 -2
  8. package/workspace/changelog.json +216 -12
  9. package/workspace/guide/cli.md +62 -0
  10. package/workspace/guide/home.md +1 -0
  11. package/workspace/guide/settings-and-switches.md +1 -0
  12. package/workspace/lib/board-cli.js +5 -1
  13. package/workspace/lib/board-premium.js +1 -0
  14. package/workspace/lib/critical-needs.js +162 -0
  15. package/workspace/lib/deps-cli.js +102 -0
  16. package/workspace/lib/engine/boards.js +13 -2
  17. package/workspace/lib/features.json +5 -0
  18. package/workspace/lib/five-action-cap.js +84 -0
  19. package/workspace/lib/needs-providers.js +1 -0
  20. package/workspace/lib/page-one-answer.js +86 -0
  21. package/workspace/lib/pages-cli.js +6 -2
  22. package/workspace/lib/people-cli.js +43 -2
  23. package/workspace/lib/pmos-verbs.js +15 -1
  24. package/workspace/lib/portfolio-cli.js +64 -0
  25. package/workspace/lib/portfolio.js +168 -0
  26. package/workspace/lib/prototype-cli.js +86 -0
  27. package/workspace/lib/report-cli.js +12 -2
  28. package/workspace/lib/report-readers.js +5 -3
  29. package/workspace/lib/review-pack.js +348 -0
  30. package/workspace/lib/review-reasons.js +357 -0
  31. package/workspace/lib/route-modules.js +6 -0
  32. package/workspace/lib/routes-boards.js +25 -2
  33. package/workspace/lib/routes-portfolio.js +50 -0
  34. package/workspace/lib/routes-review-pack.js +42 -0
  35. package/workspace/lib/routes-roadmap-ops.js +53 -1
  36. package/workspace/lib/routes-sim-users.js +66 -0
  37. package/workspace/lib/routes-stakeholders.js +42 -0
  38. package/workspace/lib/routes-strategy-card.js +29 -1
  39. package/workspace/lib/routes-team-waits.js +24 -0
  40. package/workspace/lib/routes-use-log.js +6 -1
  41. package/workspace/lib/sim-users.js +329 -0
  42. package/workspace/lib/stakeholder-map.js +232 -0
  43. package/workspace/lib/task-store.js +1 -1
  44. package/workspace/lib/team-waits.js +167 -0
  45. package/workspace/lib/tradeoff-cards.js +258 -0
  46. package/workspace/lib/tradeoff-cli.js +83 -0
  47. package/workspace/lib/voice-cli.js +7 -0
  48. package/workspace/package-lock.json +2 -2
  49. package/workspace/package.json +1 -1
  50. package/workspace/premium-vw-jira-test.js +6 -2
  51. package/workspace/public/pm/bd-backlog.js +44 -6
  52. package/workspace/public/pm/bd-principles.js +12 -1
  53. package/workspace/public/pm/cozy-library.css +5 -0
  54. package/workspace/public/pm/cozy-pick.css +1 -0
  55. package/workspace/public/pm/cozy-pop-work.js +8 -2
  56. package/workspace/public/pm/cozy-proto.css +5 -0
  57. package/workspace/public/pm/cozy-proto.js +11 -3
  58. package/workspace/public/pm/cozy-today-app.js +53 -3
  59. package/workspace/public/pm/cozy-today-view.js +12 -4
  60. package/workspace/public/pm/day-time.js +8 -0
  61. package/workspace/public/pm/five-action-cap.js +104 -0
  62. package/workspace/public/pm/home-ini.js +3 -2
  63. package/workspace/public/pm/ini-links.js +2 -1
  64. package/workspace/public/pm/ini-tasks.js +5 -2
  65. package/workspace/public/pm/ini-view-model.js +14 -6
  66. package/workspace/public/pm/ini-view.js +12 -2
  67. package/workspace/public/pm/library-model.js +1 -1
  68. package/workspace/public/pm/page-one-answer.css +18 -0
  69. package/workspace/public/pm/page-one-answer.js +134 -0
  70. package/workspace/public/pm/pop-work-model.js +8 -6
  71. package/workspace/public/pm/portfolio.js +67 -0
  72. package/workspace/public/pm/premium-board.js +19 -6
  73. package/workspace/public/pm/premium-library.js +27 -3
  74. package/workspace/public/pm/product-switcher.js +7 -1
  75. package/workspace/public/pm/range-pick.css +12 -0
  76. package/workspace/public/pm/range-pick.js +30 -6
  77. package/workspace/public/pm/review-pack.js +47 -0
  78. package/workspace/public/pm/review-reasons.js +75 -0
  79. package/workspace/public/pm/sim-users.js +34 -0
  80. package/workspace/public/pm/sort-order.js +3 -0
  81. package/workspace/public/pm/stakeholder-map.js +125 -0
  82. package/workspace/public/pm/task-card.js +10 -7
  83. package/workspace/public/pm/team-waits.js +56 -0
  84. package/workspace/public/pm/tradeoff-cards.css +27 -0
  85. package/workspace/public/pm/tradeoff-cards.js +183 -0
  86. package/workspace/public/premium-board.html +1 -0
  87. package/workspace/public/premium-portfolio.html +48 -0
  88. package/workspace/public/today.html +1 -0
  89. package/workspace/run-tests.js +9 -1
  90. package/workspace/server.js +1 -1
  91. package/workspace/stage-card-tasks-test.js +11 -5
  92. package/workspace/test-lists/critical-needs.json +9 -0
  93. package/workspace/test-lists/five-action-cap.json +9 -0
  94. package/workspace/test-lists/page-one-answer.json +9 -0
  95. package/workspace/test-lists/portfolio.json +9 -0
  96. package/workspace/test-lists/review-pack.json +9 -0
  97. package/workspace/test-lists/review-reasons.json +9 -0
  98. package/workspace/test-lists/sim-users.json +9 -0
  99. package/workspace/test-lists/stakeholder-map.json +9 -0
  100. package/workspace/test-lists/task-time-optional.json +9 -0
  101. package/workspace/test-lists/team-waits.json +9 -0
  102. package/workspace/test-lists/tradeoff-cards.json +9 -0
  103. package/workspace/test-timings.json +25 -0
@@ -16,6 +16,7 @@
16
16
  * on the prototype, a branch plays its scenario); the page copy, in its side panel (copy.json, edited in place: the prototype changes as the PM types and
17
17
  * the edit is kept with the version, POST /api/lab/edit); who does what (lanes.json as a swimlane with arrows: a step shows its screen).
18
18
  * A card the version changed says Updated (compare.updated).
19
+ * Findings (initiative sim-users): above the design, where the simulated users got stuck (pm/sim-users.js); a finding shows its screen.
19
20
  * Three ways (a round with several versions): a tray; a press previews one; ✓ keeps it, ✕ closes the round.
20
21
  * Play: the prototype full size through a scenario of flow.json; a tap where the user would tap moves on, a miss shows the hotspots.
21
22
  * The chat (pm/home-chat.js) hears 'pmos:point', 'pmos:from' and 'pmos:say' (window events, detail.ini names the initiative); it says
@@ -27,6 +28,7 @@
27
28
  * openVersion({ ws, board?, ini, n }) shows version n of the initiative's newest round (the chat's Version n tag)
28
29
  * flowLayout(flow) · lanesLayout(lanes) PURE: where the SVG puts each node and arrow (exported for the source check) */
29
30
  import { pmGet, pmPost, pmHeaders } from './http.js';
31
+ import { findingsHtml, notePress, loadFindings } from './sim-users.js'; // Findings: simulated users walked it first (initiative sim-users)
30
32
 
31
33
  const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
32
34
  const SVG = (d, w = 16, sw = 2) => `<svg aria-hidden="true" width="${w}" height="${w}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="${sw}" stroke-linecap="round" stroke-linejoin="round"><path d="${d}"/></svg>`;
@@ -163,7 +165,7 @@ export function lanesLayout(lanes) {
163
165
  * presses, closed by default; one shows at a time, in the inspector's place. The device switch is only for Play. */
164
166
  const V = { body: null, box: null, c: null, at: null, H: null, last: null, mode: 'point', pdev: store.get('pmos.pc.pdev') || 'own', zoom: Number(store.get('pmos.pc.zoom')) || 0,
165
167
  sel: null, looks: null, screen: '', frameUrl: '', ready: null, edits: { copy: {}, vars: {}, styles: {} }, pend: null, saveT: null, draft: null, drawing: false, strokes: 0,
166
- play: null, sig: '', side: null, wide: store.get('pmos.pc.wide') === '1', left: store.get('pmos.pc.left') !== '0', insp: store.get('pmos.pc.insp') !== '0', noteT: null };
168
+ play: null, sig: '', finds: {}, side: null, wide: store.get('pmos.pc.wide') === '1', left: store.get('pmos.pc.left') !== '0', insp: store.get('pmos.pc.insp') !== '0', noteT: null };
167
169
  const ARROW = '<marker id="pcArr" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0 0L10 5L0 10z" fill="currentColor"/></marker>';
168
170
  const frameUrl = (c) => (c && c.url ? c.url + '&rt=1' : '');
169
171
  const toFrame = (m, f) => { const fr = f || (V.body && V.body.querySelector('.pc-frame iframe')); if (fr && fr.contentWindow) fr.contentWindow.postMessage({ pmos: 1, ...m }, '*'); };
@@ -238,7 +240,7 @@ function protoCard(c, v, making) {
238
240
  const sug = suggestion(c);
239
241
  const draw = V.mode === 'draw' ? `<canvas class="pc-ink" aria-label="Sketch over the prototype"></canvas><span class="pc-inkacts">${ib('data-pc-ink="attach"', 'Attach the sketch to your next message', I.attach, 'blue')}${ib('data-pc-ink="clear"', 'Clear the sketch', I.x)}</span>` : '';
240
242
  const lost = c.notMade ? `<p class="pc-making pc-lost">Version ${c.round} was not made: ${esc(c.notMade)}.${c.fallbackN ? ` This is version ${c.fallbackN}.` : ''} Ask in the chat for it in smaller steps, one screen or format at a time.</p>` : '';
241
- return { pre: lost + (making ? progressHtml(c) : checksHtml(c)), dev: `<div class="pc-frame" data-pc-frame>${v.url ? '' : '<p class="pc-none">PMOS is making it.</p>'}</div>${draw}`, post: sel + draft + list + sug };
243
+ return { pre: lost + (making ? progressHtml(c) : checksHtml(c) + findingsHtml(V.finds[v.file])), dev: `<div class="pc-frame" data-pc-frame>${v.url ? '' : '<p class="pc-none">PMOS is making it.</p>'}</div>${draw}`, post: sel + draft + list + sug };
242
244
  }
243
245
  /** The notes beside the design (notes.json): what the run wants the PM to know, kept off the screens (Wawan 2026-11-18). Only the notes for
244
246
  * the screen shown and the ones for the whole prototype; none at all is silence. A note on a layer flashes it on the design. */
@@ -376,11 +378,16 @@ export function draw(body, c, o = {}) {
376
378
  // a new version: its own edits, nothing pointed at
377
379
  if (prevFile !== v.file) { const e = (v.data && v.data.edits) || {}; V.edits = { copy: { ...(e.copy || {}) }, vars: { ...(e.vars || {}) }, styles: { ...(e.styles || {}) } }; V.sel = null; V.looks = null; V.ready = null; }
378
380
  V.c = c; V.v = v;
381
+ // Findings (initiative sim-users): read once per version, then drawn above the design; the canvas never waits on it
382
+ if (v.file && !(v.file in V.finds)) {
383
+ V.finds[v.file] = null;
384
+ loadFindings({ ws: (V.at || {}).ws, ini: c.ini, file: v.file }).then((f) => { if (!f) return; V.finds[v.file] = f; if (V.v && V.v.file === v.file && V.body) { V.sig = ''; draw(V.body, V.c); } });
385
+ }
379
386
  let root = body.querySelector(':scope > .pc');
380
387
  if (!root) { body.innerHTML = '<div class="pc"></div>'; root = body.querySelector('.pc'); wire(root); }
381
388
  V.body = body;
382
389
  // keep the frame (and what the PM typed) while the canvas reads again every 2 seconds
383
- const sig = JSON.stringify([c.id, c.key, c.round, c.file, v.file, c.working, c.progress, c.notMade, c.updated, c.parts, (c.comments || []).length, V.mode, V.sel && V.sel.el, V.looks, !!V.ready, V.screen, V.left, V.insp, V.side, V.wide, !!V.draft, (c.history || []).length, c.state]);
390
+ const sig = JSON.stringify([c.id, c.key, c.round, c.file, v.file, c.working, c.progress, c.notMade, c.updated, c.parts, !!V.finds[v.file], (c.comments || []).length, V.mode, V.sel && V.sel.el, V.looks, !!V.ready, V.screen, V.left, V.insp, V.side, V.wide, !!V.draft, (c.history || []).length, c.state]);
384
391
  const focus = document.activeElement && root.contains(document.activeElement) && document.activeElement.matches('[data-pc-copy],textarea,input,select');
385
392
  if (sig === V.sig && root.firstChild) return;
386
393
  if (focus && prevFile === v.file) return; // the PM is typing in this version: draw on a later read
@@ -492,6 +499,7 @@ function wire(root) {
492
499
  if ('pcPlay' in d) { const sc = ((V.v.data || {}).flow || {}).scenarios || []; startPlay(sc.length ? sc[0].id : '', 0, true); return; }
493
500
  if (d.pcFrom) { fire('pmos:from', { ini: V.c.ini, n: Number(d.pcFrom) }); say('The next change you send continues from version ' + d.pcFrom + '.'); return; }
494
501
  if (d.pcNote) { toFrame({ t: 'hint', els: [d.pcNote] }); return; }
502
+ if ('pcFind' in d) notePress();
495
503
  if (d.pcScreen) { V.screen = d.pcScreen; toFrame({ t: 'screen', id: d.pcScreen }); V.sig = ''; draw(V.body, V.c); return; }
496
504
  if (d.pcScen) { startPlay(d.pcScen, 0, true); return; }
497
505
  if ('pcStop' in d) { pmPost('/api/lab/stop', { ws: (V.at || {}).ws, run: d.pcStop }).then((r) => { if (!r || !r.ok) say((r && r.error) || 'It did not stop.'); }).catch(() => say('It did not stop.')); return; }
@@ -22,6 +22,8 @@ import { wireSwipe } from './cozy-phone-swipe.js';
22
22
  let DG = null; // quiet-rows-digest: pm/digest-view.js, loaded on a Monday only (on other days Today loads nothing of the digest)
23
23
  import { noteUse } from './use-log.js'; // your-move (A468): each press on a Your move row is one ym-act line in the local use log (its health number)
24
24
  import * as QB from './quiet-batch.js'; // quiet-rows: Today's batch, the popup (Approve, Skip, Change it first; nothing sent without a press)
25
+ import * as PA from './page-one-answer.js'; // page-one-answer (A308): the one sentence that opens Today; Your move is its list
26
+ import * as CAP from './five-action-cap.js'; // five-action-cap (A529): a row shows two actions and ⋯; which two comes from the use log, once a week
25
27
  import * as TO from './today-order.js'; // today-order (A310, board BatchMoreBDS panel 30): the same blocks in the day's order, and the pin
26
28
  import * as NL from './cozy-name-links.js'; // name-links (A536): names in a line you typed link to the person, meeting or document, with a small card
27
29
  import * as CC from './change-cues.js'; // idea A313: a short cue on the row that is done, moved or dropped, before the log draws again // the phone: rows and the proposal swipe (phone design, Ph2_today)
@@ -49,6 +51,50 @@ export function mountToday(ctx) {
49
51
  readDigest();
50
52
  readSync();
51
53
  readPin();
54
+ readCap();
55
+ }
56
+ /* five-action-cap: the two a row shows, worked out at most once a week from 30 days of use (GET /api/use-log/cap), kept in this browser */
57
+ const CAP_KEY = 'pmos.cap.today-row';
58
+ async function readCap() {
59
+ let saved = null;
60
+ try { saved = JSON.parse(localStorage.getItem(CAP_KEY) || 'null'); } catch { /* no storage: the defaults */ }
61
+ if (!CAP.due(saved, 'today-row')) { TP.setCapShown(saved.ids); return; }
62
+ const r = await ctx.pmGet('/api/use-log/cap?place=today-row').catch(() => null);
63
+ if (!r || !r.ok) return;
64
+ const ids = CAP.pick('today-row', r.counts, r.span);
65
+ try { localStorage.setItem(CAP_KEY, JSON.stringify({ ids, at: new Date().toISOString() })); } catch { /* kept for this visit only */ }
66
+ if (!saved || JSON.stringify(saved.ids) !== JSON.stringify(ids)) console.info('[five-action-cap] Today row shows ' + ids.join(', '));
67
+ TP.setCapShown(ids); draw();
68
+ }
69
+ /** A row's ⋯: the menu of what the row does not show, Change first. A press runs the row's own act; each is one today-row-more-<act> line. */
70
+ function capMenu(r, btn) {
71
+ document.querySelectorAll('.td-dp').forEach((x) => x.remove());
72
+ const j = r.job && ['Reply', 'Decide', 'Send'].includes(r.job);
73
+ const cap = CAP.todayRow([j ? 'open' : '', 'done', 'tomorrow', 'date'], [...btn.closest('.acts').querySelectorAll('[data-td]')].map((x) => x.dataset.td));
74
+ const box = document.createElement('div');
75
+ box.className = 'td-dp td-fp'; box.setAttribute('role', 'dialog'); box.setAttribute('aria-label', 'More: ' + r.title);
76
+ box.innerHTML = CAP.menuHtml(r.key, cap.more, { ...CAP.WORDS, open: r.job || 'Open' });
77
+ document.body.appendChild(box);
78
+ btn.setAttribute('aria-expanded', 'true');
79
+ const b = btn.getBoundingClientRect();
80
+ box.style.top = Math.min(innerHeight - box.offsetHeight - 12, b.bottom + 6) + 'px'; box.style.left = Math.max(12, b.right - box.offsetWidth) + 'px';
81
+ const close = (back) => { box.remove(); removeEventListener('pointerdown', out, true); if (btn.isConnected) { btn.setAttribute('aria-expanded', 'false'); if (back) btn.focus(); } };
82
+ const out = (e) => { if (!box.contains(e.target)) close(false); };
83
+ addEventListener('pointerdown', out, true);
84
+ const items = () => [...box.querySelectorAll('[role="menuitem"]')];
85
+ box.addEventListener('keydown', (e) => {
86
+ if (e.key === 'Escape') { e.stopPropagation(); close(true); return; }
87
+ if (e.key !== 'ArrowDown' && e.key !== 'ArrowUp') return;
88
+ const L = items(), i = L.indexOf(document.activeElement); e.preventDefault();
89
+ L[(i + (e.key === 'ArrowDown' ? 1 : L.length - 1)) % L.length].focus();
90
+ });
91
+ box.addEventListener('click', (e) => {
92
+ const c = e.target.closest('[data-td]'); if (!c) return;
93
+ close(false);
94
+ noteUse('today-row-more-' + c.dataset.td);
95
+ run(c.dataset.td, r.key, btn, true);
96
+ });
97
+ const f = items()[0]; if (f) f.focus();
52
98
  }
53
99
  /* today-order (A310): the pinned order (GET /api/today-order, lib/today-order.js), the one store `pmos today order` writes too */
54
100
  async function readPin() {
@@ -302,7 +348,7 @@ export function mountToday(ctx) {
302
348
  if (phone()) {
303
349
  // PhoneTodayDS (job #1540): Where it stands, the log with All ⌄, the capture box at the foot, the ✦ proposal's sheet
304
350
  if (X.sheet && !(O.suggest || []).some((x) => x.key === X.sheet)) X.sheet = '';
305
- const html = TP.phonePageHtml(L, A, O, { ...ord, head: TM.headModel(ctx.now()), job: X.job, open: X.open, ymOpen: X.ymOpen, sopen: [...X.sopen], filed: filedLine(), now: ctx.now(), draft, mic: !!SPEECH(), sheet: X.sheet });
351
+ const html = PA.answerHtml(PA.todayAnswer(L), { list: false, page: 'today' }) + TP.phonePageHtml(L, A, O, { ...ord, head: TM.headModel(ctx.now()), job: X.job, open: X.open, ymOpen: X.ymOpen, sopen: [...X.sopen], filed: filedLine(), now: ctx.now(), draft, mic: !!SPEECH(), sheet: X.sheet });
306
352
  if (html === X.html && el.firstChild) return;
307
353
  X.html = html; el.classList.add('tdp');
308
354
  document.body.classList.toggle('tdp-sheeton', !!X.sheet);
@@ -316,7 +362,9 @@ export function mountToday(ctx) {
316
362
  if (html === X.html && el.firstChild) return;
317
363
  X.html = html;
318
364
  const st = el.parentNode ? el.parentNode.scrollTop : 0;
319
- el.innerHTML = TP.headHtml(TM.headModel(ctx.now())) + html;
365
+ // page-one-answer (A308): the head, then the one sentence; Your move under it is what needs you, the rest folds below it
366
+ el.innerHTML = TP.headHtml(TM.headModel(ctx.now())) + PA.answerHtml(PA.todayAnswer(L), { list: false, page: 'today' }) + html;
367
+ if (X.read) PA.reportCalls('today', ctx.pmPost, el);
320
368
  if (el.parentNode) el.parentNode.scrollTop = st;
321
369
  const c2 = document.getElementById('tdCap'); if (c2 && focus) { c2.focus(); c2.setSelectionRange(c2.value.length, c2.value.length); }
322
370
  }
@@ -633,7 +681,7 @@ export function mountToday(ctx) {
633
681
  // a phone: a row or the proposal swiped; the act is the one its button had on a desk, said in the toast with Undo
634
682
  wireSwipe(el, { on: phone, act: (row, way) => { const act = row.dataset[way === 'right' ? 'swRight' : 'swLeft']; if (act) run(act, row.dataset.key || '', { dataset: {}, disabled: false, isConnected: false }); } });
635
683
  }
636
- async function run(act, key, b) {
684
+ async function run(act, key, b, viaMore) {
637
685
  if (act === 'line') { console.info('[quiet-rows-line] dashed line opened'); return; } // the link opens Work › Line, which counts the open (qr-line)
638
686
  if (act === 'cal') { ctx.openCalendar(); return; }
639
687
  if (act === 'ord-pin') { pinPress(b); return; } // today-order: pin or unpin the order
@@ -721,6 +769,8 @@ export function mountToday(ctx) {
721
769
  if (act === 'q-remind') { remindQuestion(r.ref); return; }
722
770
  if (act === 'open') { open(r); return; }
723
771
  if (act === 'so-open') { signoffOpen(r); return; }
772
+ if (!viaMore && (act === 'done' || act === 'tomorrow' || act === 'date')) noteUse('today-row-' + act); // five-action-cap: a press on a shown button
773
+ if (act === 'cap-more') { capMenu(r, b); return; }
724
774
  if (act === 'date') { chooseDate(r, b); return; }
725
775
  if (act === 'file') { chooseFile(r, b); return; } // capture-to-initiative: the filed chip's change
726
776
  if (X.busy.has(key)) return;
@@ -9,7 +9,8 @@
9
9
  * (pm-tabs: All, Reply, Do, Decide, Send with counts, a zero tab left out), the capture Input (pm-input), then the groups: Your move
10
10
  * (the Now group, pm-group now: ranked rows with a ✦ why, five and a fold; its first row lit), Today (pm-group), and Later folded (pm-fold "N can wait"), PMOS handled folded last.
11
11
  * Row a ListRow (pm-li): the kind icon, the title, a why line ("for <work> · due <date>", or who waits), a late Badge (pm-badge alert),
12
- * and on hover or focus icon Buttons: first by job (Done, Reply, Decide, Send), then Move to tomorrow and Set a date. A ✦ Suggestion
12
+ * and on hover or focus icon Buttons: first by job (Done, Reply, Decide, Send), then Put off a day; three at most, the rest
13
+ * under ⋯ with Set a date in its Change group (five-action-cap, pm/five-action-cap.js). A ✦ Suggestion
13
14
  * under the row when PMOS proposes something on it (drop it, looks answered, draft them).
14
15
  * Side a Timeline block (pm-block flat) with the day's events only: past ones dashed (pm-ev over), the rest raised, the now line in the
15
16
  * alert colour, a link to Events; a meeting with a call has the play Button (join and record in one press, meeting-buddy). Below it,
@@ -18,7 +19,11 @@
18
19
 
19
20
  import { dashModel as lineDash, dashHtml as lineDashHtml } from './line-view.js'; // quiet-rows-line: Your move ends with the line's dashed line
20
21
  import { groupsHtml as questionGroups, phoneGroupsHtml as phoneQuestionGroups } from './open-questions-view.js'; // open-questions-today (A420)
21
- import { linkedHtml } from './cozy-name-links.js'; // name-links (A536): names in a line you typed link to the person, meeting or document
22
+ import { linkedHtml } from './cozy-name-links.js';
23
+ import * as CAP from './five-action-cap.js'; // five-action-cap (A529): a row shows three at most on hover, two actions and ⋯
24
+ /** The two a Today row shows (pm/five-action-cap.js pick, from the use log; the app sets it once a week). */
25
+ let CAP_SHOWN = [...CAP.PLACES['today-row'].def];
26
+ export function setCapShown(ids) { if (Array.isArray(ids) && ids.length) CAP_SHOWN = ids.slice(0, CAP.PLACES['today-row'].slots); } // name-links (A536): names in a line you typed link to the person, meeting or document
22
27
 
23
28
  /** What a right-click on a Today row names (initiative ask-anywhere): its initiative when it has one, else the row itself. */
24
29
  function askOf(r) {
@@ -94,8 +99,11 @@ export function rowHtml(r, o = {}) {
94
99
  else if (r.src === 'lab') acts = ib('lab-keep', 'Keep it: start an initiative from ' + t, I.yes, r.key) + ib('lab-drop', 'Drop it: ' + t, I.no, r.key);
95
100
  else {
96
101
  const j = JOB_ACT[r.job];
97
- acts = (j ? ib(j[0], j[1] + ': ' + t, j[2], r.key) : '') + ib('done', 'Done: ' + t, I.done, r.key)
98
- + ib('tomorrow', 'Move to tomorrow: ' + t, I.tomorrow, r.key) + ib('date', 'Set a date: ' + t, I.date, r.key, ' aria-haspopup="dialog"');
102
+ // five-action-cap: two show (a job keeps its place first) and ⋯ holds the rest, its Change group first; nothing is lost
103
+ const B = { open: j ? ib(j[0], j[1] + ': ' + t, j[2], r.key) : '', done: ib('done', 'Done: ' + t, I.done, r.key),
104
+ tomorrow: ib('tomorrow', 'Put off a day: ' + t, I.tomorrow, r.key), date: ib('date', 'Set a date: ' + t, I.date, r.key, ' aria-haspopup="dialog"') };
105
+ const cap = CAP.todayRow([j ? 'open' : '', 'done', 'tomorrow', 'date'], CAP_SHOWN);
106
+ acts = cap.shown.map((k) => B[k]).join('') + (cap.more.length ? CAP.moreButton(r.key, t) : '');
99
107
  }
100
108
  }
101
109
  const cls = ['td-li', 'pm-li', o.lit && !r.done ? 'now' : '', r.done ? 'done' : '', r.bullet === 'note' || r.src === 'note' ? 'note' : '', r.src === 'lab' ? 'lab' : '', r.member ? 'mem nest' : ''].filter(Boolean).join(' ');
@@ -0,0 +1,8 @@
1
+ /* pm/day-time.js — a task's optional time of day on its start and due (Wawan 2026-11-25: "Optionally can add time"). A time is "HH:MM",
2
+ * 24-hour, kept beside the day (start_time, due_time on the item; a task-time line on the ledger), never inside it: a day stays YYYY-MM-DD,
3
+ * so every page that reads a day reads it as before, and a task with no time looks exactly as it did.
4
+ *
5
+ * isTime(v) true for "00:00" to "23:59"
6
+ * withTime(text, t) a day's words with the time after them ("26 Nov 2026 09:30"), or the words alone with no time or no day */
7
+ export const isTime = (v) => /^([01]\d|2[0-3]):[0-5]\d$/.test(String(v || ''));
8
+ export const withTime = (text, t) => (text && isTime(t) ? text + ' ' + t : text || '');
@@ -0,0 +1,104 @@
1
+ /* pm/five-action-cap.js — Work and Today get the work popup's five-action limit (five-action-cap, idea A529; board BoardHomeCapDS, agreed
2
+ * 2026-11-25). PURE: lists and strings, no DOM and no reads. The popup's own cap is pm/pop-cap.js; this module carries the same rule to
3
+ * the other places that change most.
4
+ *
5
+ * ONE RULE a page header shows five actions at most (HEAD_MAX); a card or row shows three at most on hover (ROW_MAX): two actions and ⋯.
6
+ * The rest go under ⋯, whose first group, Change, holds every change action not shown. Set the date and Stage are never
7
+ * dropped from both places (the A498 lesson, #1821). A new action replaces one or goes under ⋯.
8
+ * WHICH ONES the ones used most in the last 30 days (the local use log, `<place>-<action>` presses), worked out at most once a week;
9
+ * before 30 days of use, the place's defaults (Today row: Done, Put off a day).
10
+ *
11
+ * PLACES { 'today-row': { max, slots, acts, def, change, keep, label }, 'work-head': … }
12
+ * pick(place, counts, span) → the ids shown: the most used in 30 days, else the defaults
13
+ * due(saved, place, now) → true when the shown ids are worked out again (none saved, unknown ids, or a week old)
14
+ * todayRow(avail, shown) → { shown: [ids], more: [{ group, items: [ids] }] } for one Today row. avail: the actions this row has,
15
+ * job first ('open' for Reply, Decide or Send). A job keeps its place first; the slots left take the shown ids.
16
+ * lost(full, shown, more) → the ids of full that are neither shown nor under ⋯ (the guard: always [])
17
+ * countRowButtons(html) → the buttons of a row's hover set (<span class="acts …">)
18
+ * countHeadActions(html) → the actions of a page header: its buttons and chips, not the path, not ⋯
19
+ * moreButton(key, label) → the row's ⋯ (icon only, aria-label)
20
+ * menuHtml(key, groups, words) → the ⋯ menu (pm-menu): its groups and items, each a button with its words
21
+ * The UI says PMOS, never Claude. Every icon button carries aria-label. */
22
+ export const HEAD_MAX = 5;
23
+ export const ROW_MAX = 3; // two actions and ⋯
24
+ export const SPAN_DAYS = 30;
25
+ // The use log keeps 30 days and prunes once a day (lib/use-log.js), so a full log's oldest line is 29 to 30 whole days old: 29 counts as full.
26
+ export const FULL_DAYS = SPAN_DAYS - 1;
27
+ export const WEEK = 7 * 864e5;
28
+
29
+ /** The places. acts: every action the place can show; def: the shown ones before 30 days of use; change: the change actions (they go in the
30
+ * Change group of ⋯ when not shown); keep: never dropped from both shown and ⋯. */
31
+ export const PLACES = Object.freeze({
32
+ 'today-row': Object.freeze({ max: ROW_MAX, slots: 2, acts: ['done', 'tomorrow', 'date'], def: ['done', 'tomorrow'], change: ['date', 'tomorrow', 'done'], keep: ['date'], label: 'Today row' }),
33
+ 'work-head': Object.freeze({ max: HEAD_MAX, slots: 5, acts: ['view', 'ask', 'find', 'filter', 'new'], def: ['view', 'ask', 'find', 'filter', 'new'], change: [], keep: [], label: 'Work header' }),
34
+ });
35
+ /** The words of each Today row action, as the row says them. */
36
+ export const WORDS = Object.freeze({ done: 'Done', tomorrow: 'Put off a day', date: 'Set a date', open: 'Open' });
37
+
38
+ const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
39
+
40
+ /** The shown ids of a place. counts: { 'today-row-done': 3, … } or { done: 3 }; span: the whole days the use log covers. */
41
+ export function pick(place, counts, span) {
42
+ const P = PLACES[place]; if (!P) return [];
43
+ if (!(Number(span) >= FULL_DAYS) || !counts) return [...P.def];
44
+ const n = (k) => Number(counts[place + '-' + k] != null ? counts[place + '-' + k] : counts[k]) || 0;
45
+ const used = P.acts.filter((k) => n(k) > 0).sort((a, b) => n(b) - n(a) || P.acts.indexOf(a) - P.acts.indexOf(b));
46
+ const out = used.slice(0, P.slots);
47
+ for (const k of P.def) if (out.length < P.slots && !out.includes(k)) out.push(k);
48
+ for (const k of P.acts) if (out.length < P.slots && !out.includes(k)) out.push(k);
49
+ return out;
50
+ }
51
+ /** Work the shown ids out again? None saved, a list that is not the place's size of known ids, or saved a week or more ago. */
52
+ export function due(saved, place, now = Date.now()) {
53
+ const P = PLACES[place];
54
+ if (!P || !saved || !Array.isArray(saved.ids) || saved.ids.length !== P.slots || !saved.ids.every((k) => P.acts.includes(k))) return true;
55
+ const at = Date.parse(saved.at || '');
56
+ return !(at > 0) || now - at >= WEEK;
57
+ }
58
+
59
+ /** One Today row. avail: the actions it has, in its own order (a job act 'open' first when it has one). shown: pick('today-row', …).
60
+ * Up to three actions: all show, as before, unless the row has more than ROW_MAX; then two show and ⋯ holds the rest. With the default
61
+ * pick a plain row (Done, Put off a day, Set a date) shows Done, Put off a day and ⋯, as the board draws it. */
62
+ export function todayRow(avail, shown = PLACES['today-row'].def) {
63
+ const P = PLACES['today-row'], A = (avail || []).filter(Boolean);
64
+ const job = A[0] && !P.acts.includes(A[0]) ? A[0] : null;
65
+ const rest = A.filter((k) => k !== job);
66
+ if (A.length <= 2) return { shown: A, more: [] }; // nothing to fold: zero is silence
67
+ const out = job ? [job] : [];
68
+ for (const k of shown || []) if (out.length < P.slots && rest.includes(k) && !out.includes(k)) out.push(k);
69
+ for (const k of rest) if (out.length < P.slots && !out.includes(k)) out.push(k);
70
+ const left = rest.filter((k) => !out.includes(k));
71
+ const change = P.change.filter((k) => left.includes(k));
72
+ const other = left.filter((k) => !change.includes(k));
73
+ return { shown: out, more: [{ group: 'Change', items: change }, { group: 'More', items: other }].filter((g) => g.items.length) };
74
+ }
75
+ /** The guard: the ids of full that are neither shown nor under ⋯. */
76
+ export function lost(full, shown, more) {
77
+ const both = new Set([...(shown || []), ...(more || []).flatMap((g) => g.items)]);
78
+ return (full || []).filter((k) => !both.has(k));
79
+ }
80
+
81
+ /** The buttons of a row's hover set: the <span class="acts …"> of a ListRow. */
82
+ export function countRowButtons(html) {
83
+ const m = /<span class="acts[^"]*">([\s\S]*?)<\/span>(?=<\/div>|$)/.exec(String(html || ''));
84
+ return m ? (m[1].match(/<button\b/g) || []).length : 0;
85
+ }
86
+ /** The actions of a page header: its buttons (an icon button or a chip), not the path (the product picker moves you), not ⋯ (moreBtn, More)
87
+ * and not a button inside a menu the header opens. */
88
+ export function countHeadActions(html) {
89
+ let s = String(html || '').replace(/<nav\b[\s\S]*?<\/nav>/g, '');
90
+ s = s.replace(/<span[^>]*role="group"[^>]*>[\s\S]*?<\/span>/g, '');
91
+ return (s.match(/<button\b(?![^>]*\b(id="moreBtn"|aria-label="More")\b)[^>]*>/g) || []).length;
92
+ }
93
+
94
+ const svg = (d) => `<svg class="pm-ic" aria-hidden="true" width="16" height="16" viewBox="0 0 24 24"><path d="${d}"/></svg>`;
95
+ export const MORE_ICON = 'M6 12h.01M12 12h.01M18 12h.01';
96
+ /** The row's ⋯: icon only, with its words for a screen reader. */
97
+ export function moreButton(key, label) {
98
+ return `<button type="button" class="td-ib pm-btn" data-td="cap-more" data-key="${esc(key)}" aria-haspopup="menu" aria-expanded="false" aria-label="${esc('More: ' + label)}" title="More">${svg(MORE_ICON)}</button>`;
99
+ }
100
+ /** The ⋯ menu (pm-menu): a label per group, then each action as a menu item that runs the row's own act (data-td). */
101
+ export function menuHtml(key, groups, words = WORDS) {
102
+ return `<div class="pm-menu td-capm" role="menu" aria-label="More actions">${(groups || []).map((g) => `<p class="pm-meta td-capg">${esc(g.group)}</p>`
103
+ + g.items.map((k) => `<button type="button" role="menuitem" class="pm-btn ghost" data-td="${esc(k)}" data-key="${esc(key)}"${k === 'date' ? ' aria-haspopup="dialog"' : ''}>${esc(words[k] || k)}</button>`).join('')).join('')}</div>`;
104
+ }
@@ -394,9 +394,10 @@ async function setDates(id, uid, patch) {
394
394
  const r = await C.pmPost('/api/boards/tasks/edit', { ...body, ...patch });
395
395
  if (!r || r.ok === false) { undoToast(LE.notSaved(r), () => setDates(id, uid, patch), 12000, 'Try again'); return; }
396
396
  await C.load(); redrawView();
397
- const back = {}; for (const f of Object.keys(patch)) back[f] = f === 'milestone' ? (r.from && 'milestone' in r.from ? !!r.from.milestone : !patch.milestone) : k ? (f === 'due' ? k.end : k[f]) || '' : r.from && f in r.from ? r.from[f] || '' : ''; // a Jira ticket's days come back in from (batch 11 item 23)
397
+ const back = {}; for (const f of Object.keys(patch)) back[f] = /_time$/.test(f) ? (r.from && r.from[f]) || '' : f === 'milestone' ? (r.from && 'milestone' in r.from ? !!r.from.milestone : !patch.milestone) : k ? (f === 'due' ? k.end : k[f]) || '' : r.from && f in r.from ? r.from[f] || '' : ''; // a Jira ticket's days come back in from (batch 11 item 23)
398
398
  if ('milestone' in patch) { undoToast((patch.milestone ? 'Milestone: ' : 'Not a milestone: ') + (k ? k.title : uid) + '.', async () => { const u = await C.pmPost('/api/boards/tasks/edit', { ...body, ...back }); if (!u || u.ok === false) C.toast((u && u.error) || 'The undo did not land.'); await C.load(); redrawView(); }); return; }
399
- if (k || (r.from && ('start' in r.from || 'due' in r.from))) undoToast('Dates saved: ' + (k ? k.title : uid + ', kept in PMOS') + '.', async () => { const u = await C.pmPost('/api/boards/tasks/edit', { ...body, ...back }); if (!u || u.ok === false) C.toast((u && u.error) || 'The undo did not land.'); await C.load(); redrawView(); });
399
+ const tOnly = Object.keys(patch).every((f) => /_time$/.test(f)); // a time alone (task-time-optional) says so
400
+ if (k || (r.from && ('start' in r.from || 'due' in r.from))) undoToast((tOnly ? 'Time saved: ' : 'Dates saved: ') + (k ? k.title : uid + ', kept in PMOS') + '.', async () => { const u = await C.pmPost('/api/boards/tasks/edit', { ...body, ...back }); if (!u || u.ok === false) C.toast((u && u.error) || 'The undo did not land.'); await C.load(); redrawView(); });
400
401
  else C.toast('Dates saved.');
401
402
  }
402
403
  /** ⋯ of the page: the ONE initiative menu (pm/ini-more.js; batch 16 item 5c: seven entries), the same words and order as the Board's panel.
@@ -504,7 +504,8 @@ export function wrap(H, idOf) {
504
504
  const W = { ...H };
505
505
  W.dates = (uid, patch) => {
506
506
  const id = idOf(), lk = id && VIEWS.get(id);
507
- if (lk && !/^dt:/.test(String(uid)) && lk.links.some((l) => l.from === uid || l.to === uid) && !('milestone' in patch)) return ownMove(W, id, uid, patch);
507
+ // a time alone (task-time-optional) moves no day, so it is no linked move
508
+ if (lk && !/^dt:/.test(String(uid)) && lk.links.some((l) => l.from === uid || l.to === uid) && !('milestone' in patch) && ('start' in patch || 'due' in patch)) return ownMove(W, id, uid, patch);
508
509
  return H.dates && H.dates(uid, patch);
509
510
  };
510
511
  return W;
@@ -212,7 +212,9 @@ const ttitle = (k) => `<button type="button" class="iv-tt" data-iv-ticket="${esc
212
212
  export function dateBtn(x, o) {
213
213
  if (!o.quick || !x.uid) return x.days ? `<span class="${x.late ? 'w' : ''}">${daysHtml(x)}</span>` : '';
214
214
  const one = x.ms && !x.jira ? ' data-one="1"' : '';
215
- const a = `data-iv-date="${esc(x.uid)}" data-s="${esc(x.start)}" data-e="${esc(x.end)}" data-t="${esc(x.title)}"${one} title="${one ? 'The milestone\'s date' : x.jira || x.jkey ? 'Start and due, kept in PMOS. Jira is not changed' : 'Start and due'}"`;
215
+ // the optional time (task-time-optional): a PMOS task's own, not a Jira ticket's or a draft's
216
+ const tm = !x.jira && !x.jkey && !x.dr ? ` data-tm="1" data-st="${esc(x.start_time || '')}" data-dt="${esc(x.due_time || '')}"` : '';
217
+ const a = `data-iv-date="${esc(x.uid)}" data-s="${esc(x.start)}" data-e="${esc(x.end)}" data-t="${esc(x.title)}"${one}${tm} title="${one ? 'The milestone\'s date' : x.jira || x.jkey ? 'Start and due, kept in PMOS. Jira is not changed' : 'Start and due'}"`;
216
218
  // a milestone with no due date: a dashed chip asks for it, shown always (canvas XmlA6Suggest)
217
219
  if (msNoDate(x)) return `<button type="button" class="iv-dc ms" ${a} aria-label="${esc('Set the due date: ' + x.title)}">${SVG(P.cal, 13)}Set the due date</button>`;
218
220
  return x.days ? `<button type="button" class="iv-dc${x.late ? ' w' : ''}" ${a} aria-label="${esc((one ? 'Milestone date: ' : 'Dates: ') + x.days + '. Change')}">${daysHtml(x)}</button>`
@@ -671,7 +673,8 @@ export function datePop(anchor, uid, H) {
671
673
  if (sheet) st.head = `<div class="ivd-h">${one ? SVG(P.dia, 15, 2.2) : SVG(P.cal, 15, 2)}<b>${one ? 'Date' : 'Dates'}</b><button type="button" class="iv-ib" data-ivd-x aria-label="Close" title="Close">${SVG('M6 6l12 12M18 6L6 18', 16, 2)}</button></div>`
672
674
  + (nm ? `<p class="ivd-s">${esc(nm + (one ? ' · one date: the milestone' : ''))}</p>` : '');
673
675
  const el = openPop(anchor, datePickerHtml(t, st), (b) => { if ('ivdX' in b.dataset) closePop(); }, sheet ? { sheet: true } : {});
674
- mountRange(el.querySelector('.tkc-dp'), { ...t, one, field: st.field, head: st.head, onPick: (p, done) => { Object.assign(t, p); if (done) closePop(); if (H.dates) H.dates(uid, p); } });
676
+ mountRange(el.querySelector('.tkc-dp'), { ...t, one, field: st.field, head: st.head,
677
+ time: anchor.dataset.tm === '1', start_time: anchor.dataset.st || '', due_time: anchor.dataset.dt || '', onPick: (p, done) => { Object.assign(t, p); if (done) closePop(); if (H.dates) H.dates(uid, p); } });
675
678
  el.querySelector('.rp-g [tabindex="0"]')?.focus({ preventScroll: true });
676
679
  }
677
680
  function menuPop(anchor, label, items, go) {
@@ -34,11 +34,13 @@
34
34
  * 12 over the plan: the dates line turns amber with the days over; a skipped stage keeps its place, with its reason.
35
35
  * 18 each section carries its dates: done stages when they ran, now from when to the plan end, later ones "Plan <date>", amber when missed.
36
36
  * 19 a big section shows the 3 most urgent first, then folds the rest by the next WBS level, each with its count; done folds last. */
37
- import { ticketGroups } from './tk-model.js'; // the drafted Jira tickets by epic (kit 2, T1): By epic's groups
37
+ import { ticketGroups } from './tk-model.js';
38
+ import { isTime, withTime } from './day-time.js'; // a task's optional time on its start and due (task-time-optional) // the drafted Jira tickets by epic (kit 2, T1): By epic's groups
38
39
 
39
40
  import { stageSource } from './stage-chip.js'; // W1: what set the one stage, and when it was read
40
41
  const endWord = (r) => (r && r.oneStage && ['shipped', 'on-hold', 'cancelled'].includes(r.oneStage.stage) ? r.oneStage.label : '');
41
- import { lineOf } from './stage-line.js'; // the stage card's one line (batch 11 item 21)
42
+ import { lineOf } from './stage-line.js';
43
+ import { iniAnswer } from './page-one-answer.js'; // page-one-answer (A308): the initiative opens with one sentence, what needs you, the rest folded // the stage card's one line (batch 11 item 21)
42
44
  import { provenStatus, fromLine, NO_SIGNAL } from './status-proof.js'; // T3: a status renders only with its source and read time
43
45
 
44
46
  const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
@@ -126,11 +128,15 @@ const jDays = (k, today) => { const e = k.due || k.sprintEnd || ''; return k.sta
126
128
  const jiraBucket = (st) => (/^(done|closed|resolved|released)$/i.test(String(st || '')) ? 'Done' : /progress|review|test|\bqa\b|doing|started|block/i.test(String(st || '')) ? 'In progress' : 'To do');
127
129
  /** k: the task as stored; J: the Jira ticket its title names, when PMOS read that ticket (0.442.0 hotfix, Wawan 13:02 and 13:03). A linked task's
128
130
  * status is the ticket's; its start and due stay the PM's, kept in PMOS: Jira's start and due show only while the task has none of its own. */
129
- function rowOf(k0, today, J = null) {
131
+ export function rowOf(k0, today, J = null) {
130
132
  const k = J ? { ...k0, status: jiraBucket(J.status), start: k0.start || J.start || '', end: k0.end || J.due || '' } : k0; // never the sprint's end: a task with no date shows none, and is not late (Wawan, 2026-11-19)
131
133
  const closed = CLOSED.has(k.status), d = dayOf(k.end), late = !closed && !!d && d < today;
132
134
  // start and end both (batch 7 item 6): "Oct 15 – Oct 28", one day once, "from Oct 15" with no end
133
- const days = k.start && k.end ? span(k.start, k.end, today) : k.start ? 'from ' + dateY(k.start, today) : d ? dateY(k.end, today) : '';
135
+ // a time shows after its day only when one is set (task-time-optional); a PMOS task's own, never a Jira ticket's
136
+ const st = !J && isTime(k0.start_time) ? k0.start_time : '', dt = !J && isTime(k0.due_time) ? k0.due_time : '';
137
+ const sDay = withTime(dateY(k.start, today), st), dDay = withTime(dateY(k.end, today), dt);
138
+ const days = !st && !dt ? (k.start && k.end ? span(k.start, k.end, today) : k.start ? 'from ' + dateY(k.start, today) : d ? dateY(k.end, today) : '')
139
+ : k.start && k.end ? (k.start === k.end && !st ? dDay : sDay + ' – ' + dDay) : k.start ? 'from ' + sDay : d ? dDay : '';
134
140
  const due = days ? days + (late ? ', ' + plural(between(d, today), 'day', 'days') + ' late' : '') : '';
135
141
  const who = ownerName(k.owner);
136
142
  // the List's meta draws the dates as their own press (batch 9 item 5b): days is the dates alone, lateText what follows them
@@ -138,7 +144,7 @@ function rowOf(k0, today, J = null) {
138
144
  days, lateText: late ? plural(between(d, today), 'day', 'days') + ' late' : '', item: !!k.item, ms: !!k.milestone, // ms: the ◇ flag (batch 11 item 3)
139
145
  start: k.start || '', end: k.end || '', since: k.since || '', owner: who, av: initials(k.owner),
140
146
  // the open row's date chips (batch 18 item 16): each day alone; rank: the PM's order inside its stage (a task-order line)
141
- startText: k.start ? dateY(k.start, today) : '', dueText: d ? dateY(k.end, today) : '', rank: Number.isFinite(k.rank) ? k.rank : null,
147
+ startText: k.start ? sDay : '', dueText: d ? dDay : '', ...(st && k.start ? { start_time: st } : {}), ...(dt && d ? { due_time: dt } : {}), rank: Number.isFinite(k.rank) ? k.rank : null,
142
148
  sub: [k.status === 'In progress' ? 'In progress' : '', due, who && who !== 'You' ? who : ''].filter(Boolean).join(' · '), wbs: wbsOf(k.title), canCheck: !!k.uid && !k.draft && !J, order: k.order,
143
149
  // planned versus actual (batch 11 item 8, pm/ini-versions.js): the compared version's days where they differ, ⊕ added after it, a draft's task
144
150
  cmp: k.cmp || null, added: !!k.added, dr: !!k.draft,
@@ -362,7 +368,9 @@ export function iniView(r, ctx = {}) {
362
368
  // split or merge (batch 11 item 14): Claude's suggestion for it, and where its work went when it was merged
363
369
  suggest: r.suggest || null, merged: mergedOf(r),
364
370
  // what Claude proposes under the one blue ✦, and what a ✓ kept from elsewhere (batch 12 items 2, 3 and 4; pm/ini-props.js)
365
- props: r.props || null, found: r.found || null };
371
+ props: r.props || null, found: r.found || null,
372
+ // page-one-answer (A308): what waits on you here, then your own open tasks that are late or due today; others' late tasks wait on others
373
+ answer: iniAnswer(rows, { wait: wait ? { title: wait.primary && wait.primary.label ? String(wait.primary.label).replace(/^✦\s*/, '') : 'Waits on you', sub: wait.text || '' } : null, today }) };
366
374
  }
367
375
  /** A merged initiative's closing line (XsmA7Closed): the one that stays and the day. null for every other row. */
368
376
  export function mergedOf(r) {
@@ -47,6 +47,8 @@ import * as AB from './ini-about.js'; // About: the description and the succes
47
47
  import { headerFlags } from './grill-words.js'; // the grill findings on the header (workspace grill W3)
48
48
  import * as ED from './ini-edit.js'; // a task changed where it sits in the List: open in place, ⋯, + per stage, drag (batch 18 item 16)
49
49
  import { ticks } from './ini-view-model.js'; // W1: a task group ticks only when every task in it is done
50
+ import * as PA from './page-one-answer.js';
51
+ import { pmPost } from './http.js'; // page-one-answer (A308): the answer block that opens the initiative
50
52
  import * as IA from './ini-agent.js'; // agent-run (board AwB): the Experiment, Claude's work with Undo, Coming up; the D107 gate
51
53
 
52
54
  const CSS = new URL('./ini-view.css', import.meta.url).href;
@@ -426,7 +428,9 @@ export function viewHtml(v, o = {}) {
426
428
  // a merged initiative leads with where its work went, and draws no stage or tasks (they moved; its folds stay); an open one shows Claude's split or merge card under the summary (batch 11 item 14)
427
429
  if (v.merged) return `<div class="iv" data-iv="${esc(v.id || v.key || '')}"><div class="iv-cols"><div class="iv-cl">${smMerged(v.merged)}</div><div class="iv-cr">${foldsHtml(v, o)}${o.tail || ''}</div></div></div>`;
428
430
  // One reading column: summary, milestones and proposals, then content-sized Tasks and document folds.
429
- return `<div class="iv" data-iv="${esc(v.id || v.key || '')}"><div class="iv-cols"><div class="iv-cl">${ctrlHtml(v, o)}${o.sm !== false ? smCard(v.suggest, v.title) : ''}</div>`
431
+ // page-one-answer (A308): one sentence first, then only what needs you, the rest in one fold (closed until you open it)
432
+ const pk = (v.id || v.key || '') + '|', poa = v.answer && !(typeof window !== 'undefined' && window.PMOS_READONLY) ? PA.answerHtml(v.answer, { open: FOLD.get(pk + 'poa') === true, more: FOLD.get(pk + 'poamore') === true, page: 'initiative' }) : '';
433
+ return `<div class="iv" data-iv="${esc(v.id || v.key || '')}">${poa}<div class="iv-cols"><div class="iv-cl">${ctrlHtml(v, o)}${o.sm !== false ? smCard(v.suggest, v.title) : ''}</div>`
430
434
  + `<div class="iv-cr">${v.id ? IA.sectionsHtml(AM, v, v.id, { all: IA.allOpen(v.id), cuAll: IA.cuOpen(v.id) }) : ''}<section class="iv-tasks" aria-label="Tasks">${tasksHtml(v, o)}</section>${foldsHtml(v, o)}${o.tail || ''}</div></div></div>`;
431
435
  }
432
436
 
@@ -447,7 +451,7 @@ export function wireView(body, h) {
447
451
  window.addEventListener('pmos:lab-version', onLab);
448
452
  }
449
453
  // the one blue ✦ after the title (pm/ini-props.js), drawn again with each draw of the initiative
450
- const chip = () => { const id = idOf(); if (id && VIEWED.has(id)) PP.sync(VIEWED.get(id), body.__iv || {}); drafts(id); about(id); agent(id); fitMission(body); };
454
+ const chip = () => { const id = idOf(); if (id && VIEWED.has(id)) PP.sync(VIEWED.get(id), body.__iv || {}); drafts(id); about(id); agent(id); fitMission(body); if (id) PA.reportCalls('initiative', pmPost, body); };
451
455
  // agent-run (AwB): the experiment and Claude's work, read every 30 s at most; they draw alone (and the gate with them) when they change
452
456
  const wsOf = () => { const H = body.__iv || {}; return ((H.where && H.where()) || {}).ws || ''; };
453
457
  const agent = (id) => { if (id && VIEWED.has(id)) IA.want(wsOf(), id, () => paintAgent(id), (VIEWED.get(id) || {}).title); };
@@ -501,6 +505,12 @@ export function wireView(body, h) {
501
505
  const root = b.closest('[data-iv]'); if (!root) return;
502
506
  const id = root.dataset.iv;
503
507
  const d = b.dataset;
508
+ // page-one-answer: a Needs you row opens its task (or brings the summary's ask into sight); the fold and "N more" open in place
509
+ if (d.poa) {
510
+ e.preventDefault();
511
+ if (d.poa === 'open') { if (d.poaAct === 'task' && d.poaKey && H.openTask) H.openTask(d.poaKey, b); else { const c = root.querySelector('.iv-cl'); if (c) c.scrollIntoView({ block: 'start' }); } return; }
512
+ FOLD.set(id + '|' + (d.poa === 'fold' ? 'poa' : 'poamore'), d.poa === 'fold' ? b.getAttribute('aria-expanded') !== 'true' : true); if (H.redraw) H.redraw(); return;
513
+ }
504
514
  // agent-run (AwB): edit a line of the experiment, Undo a change of Claude's, the rest of Claude's work
505
515
  if (d.iaEdit) { e.preventDefault(); IA.edit(b); return; }
506
516
  // the Specimens line opens the newest round's compare view, kept or not (2026-11-17: a round kept too early had no way back)
@@ -23,7 +23,7 @@
23
23
  */
24
24
 
25
25
  export const COLUMNS = ['Name', 'Kind', 'Product', 'About', 'By', 'State', 'Updated'];
26
- export const FAMILIES = [['plans', 'Plans and specs'], ['briefs', 'Briefs'], ['meetings', 'Meeting notes'], ['protos', 'Prototypes and designs'], ['checks', 'Checks'], ['links', 'Links']];
26
+ export const FAMILIES = [['plans', 'Plans and specs'], ['briefs', 'Briefs'], ['meetings', 'Meeting notes'], ['protos', 'Prototypes and designs'], ['checks', 'Checks'], ['links', 'Links'], ['reports', 'Reports']];
27
27
  export const GROUPS = [['new', 'New'], ['work', 'Work'], ['kind', 'Kind'], ['product', 'Product']];
28
28
  export const STATES = ['Draft', 'Final', 'Issued'];
29
29
  const MONTHS = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
@@ -0,0 +1,18 @@
1
+ /* page-one-answer.css — every page opens with one answer (pm/page-one-answer.js, idea A308; board BatchPagesDS panel 1). Komorebi tokens only.
2
+ * The sentence, then only what needs you (pm-li rows with a blue dot), then one dashed fold line with the rest. No primary button. */
3
+ .poa { display: flex; flex-direction: column; gap: var(--space-8); margin: 0 0 var(--space-16); }
4
+ .poa-said { display: flex; flex-direction: column; gap: var(--space-4); }
5
+ .poa-line { margin: 0; font-size: var(--fs-panel); color: var(--ink); }
6
+ .poa-needs h2 { margin: 0 0 var(--space-4); font-size: var(--fs-label); }
7
+ .poa .pm-li.poa-r { display: flex; align-items: flex-start; gap: var(--space-12); }
8
+ .poa-dot { flex: none; width: var(--space-8); height: var(--space-8); margin-top: var(--space-8); border-radius: var(--radius-pill); background: var(--blue); }
9
+ .poa-rest .poa-dot { background: var(--line); }
10
+ .poa .txt { display: flex; flex-direction: column; min-width: 0; }
11
+ .poa-t { all: unset; cursor: pointer; font-size: var(--fs-row); color: var(--ink); }
12
+ @media (hover: hover) {
13
+ .poa-t:hover { text-decoration: underline; }
14
+ }
15
+ .poa-t:focus-visible, .poa-fold:focus-visible, .poa-more:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
16
+ .poa .w { font-size: var(--fs-meta); color: var(--muted); }
17
+ .poa-fold { display: flex; align-items: center; gap: var(--space-8); border-top: 1px dashed var(--line); padding-top: var(--space-8); color: var(--muted); font-size: var(--fs-meta); }
18
+ .poa-fold[aria-expanded="true"] svg { transform: rotate(180deg); }