create-pmos 0.828.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 (75) hide show
  1. package/package.json +140 -22
  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/board-deliveries-test.js +2 -2
  7. package/workspace/changelog.json +139 -8
  8. package/workspace/guide/cli.md +34 -1
  9. package/workspace/guide/home.md +1 -0
  10. package/workspace/guide/settings-and-switches.md +1 -0
  11. package/workspace/lib/board-premium.js +1 -0
  12. package/workspace/lib/critical-needs.js +162 -0
  13. package/workspace/lib/deps-cli.js +102 -0
  14. package/workspace/lib/engine/boards.js +13 -2
  15. package/workspace/lib/features.json +3 -0
  16. package/workspace/lib/needs-providers.js +1 -0
  17. package/workspace/lib/page-one-answer.js +86 -0
  18. package/workspace/lib/pages-cli.js +6 -2
  19. package/workspace/lib/pmos-verbs.js +8 -0
  20. package/workspace/lib/prototype-cli.js +86 -0
  21. package/workspace/lib/report-cli.js +12 -2
  22. package/workspace/lib/report-readers.js +5 -3
  23. package/workspace/lib/review-pack.js +348 -0
  24. package/workspace/lib/route-modules.js +4 -0
  25. package/workspace/lib/routes-boards.js +25 -2
  26. package/workspace/lib/routes-review-pack.js +42 -0
  27. package/workspace/lib/routes-roadmap-ops.js +53 -1
  28. package/workspace/lib/routes-sim-users.js +66 -0
  29. package/workspace/lib/routes-team-waits.js +24 -0
  30. package/workspace/lib/sim-users.js +329 -0
  31. package/workspace/lib/task-store.js +1 -1
  32. package/workspace/lib/team-waits.js +167 -0
  33. package/workspace/lib/tradeoff-cards.js +258 -0
  34. package/workspace/lib/tradeoff-cli.js +83 -0
  35. package/workspace/package-lock.json +2 -2
  36. package/workspace/package.json +1 -1
  37. package/workspace/public/pm/bd-backlog.js +44 -6
  38. package/workspace/public/pm/cozy-library.css +5 -0
  39. package/workspace/public/pm/cozy-pop-work.js +2 -1
  40. package/workspace/public/pm/cozy-proto.css +5 -0
  41. package/workspace/public/pm/cozy-proto.js +11 -3
  42. package/workspace/public/pm/cozy-today-app.js +5 -2
  43. package/workspace/public/pm/day-time.js +8 -0
  44. package/workspace/public/pm/home-ini.js +3 -2
  45. package/workspace/public/pm/ini-links.js +2 -1
  46. package/workspace/public/pm/ini-tasks.js +5 -2
  47. package/workspace/public/pm/ini-view-model.js +14 -6
  48. package/workspace/public/pm/ini-view.js +12 -2
  49. package/workspace/public/pm/library-model.js +1 -1
  50. package/workspace/public/pm/page-one-answer.css +18 -0
  51. package/workspace/public/pm/page-one-answer.js +134 -0
  52. package/workspace/public/pm/pop-work-model.js +8 -6
  53. package/workspace/public/pm/portfolio.js +1 -1
  54. package/workspace/public/pm/premium-board.js +19 -6
  55. package/workspace/public/pm/premium-library.js +27 -3
  56. package/workspace/public/pm/range-pick.css +12 -0
  57. package/workspace/public/pm/range-pick.js +30 -6
  58. package/workspace/public/pm/review-pack.js +47 -0
  59. package/workspace/public/pm/sim-users.js +34 -0
  60. package/workspace/public/pm/sort-order.js +3 -0
  61. package/workspace/public/pm/task-card.js +10 -7
  62. package/workspace/public/pm/team-waits.js +56 -0
  63. package/workspace/public/pm/tradeoff-cards.css +27 -0
  64. package/workspace/public/pm/tradeoff-cards.js +183 -0
  65. package/workspace/public/premium-board.html +1 -0
  66. package/workspace/public/today.html +1 -0
  67. package/workspace/run-tests.js +9 -1
  68. package/workspace/test-lists/critical-needs.json +9 -0
  69. package/workspace/test-lists/page-one-answer.json +9 -0
  70. package/workspace/test-lists/review-pack.json +9 -0
  71. package/workspace/test-lists/sim-users.json +9 -0
  72. package/workspace/test-lists/task-time-optional.json +9 -0
  73. package/workspace/test-lists/team-waits.json +9 -0
  74. package/workspace/test-lists/tradeoff-cards.json +9 -0
  75. package/workspace/test-timings.json +25 -0
@@ -65,6 +65,7 @@ import * as CM from './changed-mark.js'; // bet A456: the ✦ and Undo on a ro
65
65
  import { setSay } from './cozy-xv.js';
66
66
  import { narrowForm } from './pn-narrow.js';
67
67
  import * as BP2 from './bd-pane.js';
68
+ import * as PA from './page-one-answer.js'; // page-one-answer (A308): Work and Board open with one sentence, what needs you, the rest folded
68
69
  import * as WV from './bd-work.js'; // Work, one view on a desk (slice 4 of the six-place navigation, initiative work-one-view)
69
70
  import * as BK from './bd-backlog.js';
70
71
  import * as PL from './bd-phone-line.js'; // a phone offers List and By stage, no Gantt (board PhIniB)
@@ -92,6 +93,7 @@ let readTimer = null;
92
93
  const SKEL = $('#ibBody').innerHTML; // the grey rows the page opens with (premium-board.html), put back if a failure line replaced them
93
94
  LS.slowLine($('#ibBody'), () => M);
94
95
  let readTries = 0; // reads that answered "reading" in a row: the next ask waits longer each time
96
+ const POA = { open: false, more: false }; // page-one-answer: the answer's fold (closed by default) and its "N more"
95
97
  let foldOpen = false; // the Monitor and Evaluate rows under the table
96
98
  let sprintSet = false; // "This sprint" starts on, once, when the board has a sprint
97
99
  const F = { chips: new Set(), q: '', owners: new Set(), cats: new Set(), sprints: new Set() }; // the chip filters, Find and Filter (the workflow is pm/bd-wf.js picked())
@@ -968,7 +970,9 @@ function drawInit() {
968
970
  if (v === 'time') TL.hold(); else TL.forget();
969
971
  // a row with the focus keeps it when the rows are drawn again (the page panel changes form as a Viewer opens or closes beside it)
970
972
  const fe = document.activeElement, fk = fe && body.contains(fe) && fe.matches('[data-key]') ? fe.dataset.key : null;
971
- body.innerHTML = html + phx;
973
+ // page-one-answer (A308): one sentence first, then only what needs you, the rest in one fold (a published copy shows none: it is the PM's own)
974
+ const ans = window.PMOS_READONLY ? '' : PA.answerHtml(PA.boardAnswer(L, { stateOf: (r) => WV.rowState(r), grill: (id) => GR[id], day: PA.dayWord() }), { open: POA.open, more: POA.more, page: v === 'work' ? 'work' : 'board' });
975
+ body.innerHTML = ans + html + phx;
972
976
  LB.sizeBars(body);
973
977
  if (fk) { const n = $$('#ibBody [data-key]').find((x) => x.dataset.key === fk); if (n) n.focus({ preventScroll: true }); }
974
978
  if (v === 'time') TL.mount(body);
@@ -980,6 +984,7 @@ function drawInit() {
980
984
  document.body.dataset.bdView = v;
981
985
  $('#stage').dataset.bdDesk = view; // what fit() measures: the desktop's view, so the narrow form never flips it back and forth
982
986
  markOpen();
987
+ if (M && !window.PMOS_READONLY) PA.reportCalls(v === 'work' ? 'work' : 'board', pmPost, $('#stage'));
983
988
  }
984
989
  PHONE.addEventListener('change', () => { if (M) { drawChips(); drawInit(); } });
985
990
  /** The grouping (PgBoard, PgBoardProduct): programs first (the default) or By product, in the tune sheet (#bdFilter) since UI grill U2.
@@ -1000,6 +1005,13 @@ $('#bdShowing').addEventListener('click', (e) => {
1000
1005
  });
1001
1006
  function setSpan(s) { span = s; store.set(SPAN_KEY, span); drawChips(); drawInit(); }
1002
1007
  $('#ibBody').addEventListener('click', (e) => {
1008
+ // page-one-answer: a Needs you row opens its initiative; the fold and "N more" open in place
1009
+ const pa = e.target.closest('[data-poa]');
1010
+ if (pa) {
1011
+ if (pa.dataset.poa === 'open') { const r = rowOf(pa.dataset.poaKey); if (r) openIni(r, pa); return; }
1012
+ if (pa.dataset.poa === 'fold') POA.open = !POA.open; else if (pa.dataset.poa === 'more') POA.more = true;
1013
+ drawInit(); const n = $('#ibBody [data-poa="fold"]'); if (n && pa.dataset.poa === 'fold') n.focus(); return;
1014
+ }
1003
1015
  if (curView() === 'work') {
1004
1016
  const op = e.target.closest('[data-wkopen]'); if (op) { e.preventDefault(); openIni(rowOf(op.dataset.wkopen), op); return; }
1005
1017
  const sg = e.target.closest('[data-wksug]'); if (sg) { sugPress(sg); return; }
@@ -1201,7 +1213,7 @@ function msPop(anchor, r, ids, sheet) {
1201
1213
  el.className = 'tg-msp' + (sheet ? ' sh' : ''); el.setAttribute('role', 'menu'); el.setAttribute('aria-label', (sheet ? '' : 'Milestones of ') + r.title); el.dataset.escLayer = '';
1202
1214
  el.innerHTML = (sheet ? `<i class="gr" aria-hidden="true"></i><b class="h">${esc(r.title)}</b>` : '') + items.map((x) => x.html).join('');
1203
1215
  document.body.appendChild(el); el.__a = anchor; msEl = el; anchor.setAttribute('aria-expanded', 'true');
1204
- if (!sheet) { const b = anchor.getBoundingClientRect(), w = el.offsetWidth; el.style.left = Math.max(8, Math.min(b.left + b.width / 2 - w / 2, innerWidth - w - 8)) + 'px'; el.style.top = b.bottom + 8 + 'px'; }
1216
+ if (!sheet) { const b = anchor.getBoundingClientRect(), w = el.offsetWidth; el.style.left = Math.max(8, Math.min(b.left + b.width / 2 - w / 2, innerWidth - w - 8)) + 'px'; const h = el.offsetHeight; el.style.top = Math.max(8, b.bottom + 8 + h > innerHeight - 8 ? b.top - h - 8 : b.bottom + 8) + 'px'; }
1205
1217
  el.onclick = (e) => {
1206
1218
  const o = e.target.closest('[data-ms-open]'); if (!o) return;
1207
1219
  const id = o.dataset.msOpen, m = L.find((x) => x.id === id); msClose();
@@ -1225,7 +1237,7 @@ function lanePop(anchor, data, title) {
1225
1237
  el.innerHTML = (title ? `<i class="gr" aria-hidden="true"></i><b class="h">${esc(title)}</b>` : '')
1226
1238
  + L.map((m) => `<button type="button" role="menuitem" class="o" data-ms-ini="${esc(m.k)}"><i class="tg-tm-i${m.s ? ' ' + m.s : ''}" aria-hidden="true"></i><span>${esc(m.n)}<small>${esc(m.t)}</small></span><span class="k${m.s === 'late' ? ' late' : ''}">${esc(md(m.d))}</span></button>`).join('');
1227
1239
  document.body.appendChild(el); el.__a = anchor; msEl = el; anchor.setAttribute('aria-expanded', 'true');
1228
- if (!title) { const b = anchor.getBoundingClientRect(), w = el.offsetWidth; el.style.left = Math.max(8, Math.min(b.left + b.width / 2 - w / 2, innerWidth - w - 8)) + 'px'; el.style.top = b.bottom + 8 + 'px'; }
1240
+ if (!title) { const b = anchor.getBoundingClientRect(), w = el.offsetWidth; el.style.left = Math.max(8, Math.min(b.left + b.width / 2 - w / 2, innerWidth - w - 8)) + 'px'; const h = el.offsetHeight; el.style.top = Math.max(8, b.bottom + 8 + h > innerHeight - 8 ? b.top - h - 8 : b.bottom + 8) + 'px'; }
1229
1241
  el.onclick = (e) => { const o = e.target.closest('[data-ms-ini]'); if (!o) return; msClose(); openIni(rowOf(o.dataset.msIni), anchor); };
1230
1242
  const f = el.querySelector('button'); if (f) f.focus({ preventScroll: true });
1231
1243
  }
@@ -1244,7 +1256,8 @@ function gapPop(anchor, r) {
1244
1256
  el.innerHTML = `<div class="w">${lines.map((t, i) => `<p class="${i ? 's' : ''}">${esc(t)}</p>`).join('')}${sk.map((k) => `<p class="s">${esc(skipWords(k.items))}</p>`).join('')}</div>`
1245
1257
  + (anchor.dataset.ahead ? `<button type="button" class="gp-add" aria-label="${esc('New task, ' + md(d(start)) + ' to ' + md(d(due)))}" title="New task">${'<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 5v14M5 12h14"/></svg>'}</button>` : '');
1246
1258
  document.body.appendChild(el); el.__a = anchor; msEl = el; anchor.setAttribute('aria-expanded', 'true');
1247
- const bx = anchor.getBoundingClientRect(), w = el.offsetWidth; el.style.left = Math.max(8, Math.min(bx.left + bx.width / 2 - w / 2, innerWidth - w - 8)) + 'px'; el.style.top = bx.bottom + 6 + 'px';
1259
+ const bx = anchor.getBoundingClientRect(), w = el.offsetWidth; el.style.left = Math.max(8, Math.min(bx.left + bx.width / 2 - w / 2, innerWidth - w - 8)) + 'px';
1260
+ const h = el.offsetHeight; el.style.top = Math.max(8, bx.bottom + 6 + h > innerHeight - 8 ? bx.top - h - 6 : bx.bottom + 6) + 'px'; // flips above a row low on the screen
1248
1261
  const add = el.querySelector('.gp-add');
1249
1262
  if (add) { add.onclick = () => { msClose(); BI.openIni(r, anchor, { addTo: '', addDates: { start, due } }); }; add.focus({ preventScroll: true }); }
1250
1263
  }
@@ -1552,8 +1565,8 @@ async function setDates(r, uid, patch) {
1552
1565
  const res = await pmPost('/api/boards/tasks/edit', { ...body, ...patch }).catch(() => null);
1553
1566
  if (!res || res.ok === false) { say(LE.notSaved(res), () => setDates(r, uid, patch), 'Try again'); return; }
1554
1567
  const ms = 'milestone' in patch;
1555
- const back = {}; for (const f of Object.keys(patch)) back[f] = f === 'milestone' ? (res.from && 'milestone' in res.from ? !!res.from.milestone : !patch.milestone) : k ? (f === 'due' ? k.end : k[f]) || '' : res.from && f in res.from ? res.from[f] || '' : ''; // a Jira ticket's days come back in from (batch 11 item 23)
1556
- const words = ms ? (patch.milestone ? 'Milestone' : 'Not a milestone') : 'Dates saved';
1568
+ const back = {}; for (const f of Object.keys(patch)) back[f] = /_time$/.test(f) ? (res.from && res.from[f]) || '' : f === 'milestone' ? (res.from && 'milestone' in res.from ? !!res.from.milestone : !patch.milestone) : k ? (f === 'due' ? k.end : k[f]) || '' : res.from && f in res.from ? res.from[f] || '' : ''; // a Jira ticket's days come back in from (batch 11 item 23)
1569
+ const words = ms ? (patch.milestone ? 'Milestone' : 'Not a milestone') : Object.keys(patch).every((f) => /_time$/.test(f)) ? 'Time saved' : 'Dates saved'; // a time alone (task-time-optional)
1557
1570
  const jd = !k && !ms && res.from && ('start' in res.from || 'due' in res.from); // a Jira ticket's days, kept in PMOS (batch 11 item 23)
1558
1571
  say(words + (k ? ': ' + k.title : jd ? ': ' + uid + ', kept in PMOS' : '') + '.', k || ms || jd ? async () => { const u = await pmPost('/api/boards/tasks/edit', { ...body, ...back }).catch(() => null); say(u && u.ok !== false ? (ms ? 'Put back.' : 'Dates put back.') : (u && u.error) || 'The undo did not land.'); load(); } : undefined);
1559
1572
  load();
@@ -29,6 +29,8 @@ import { FAMILIES, GROUPS, STATES, view, counts, passes, matches, aboutText, sta
29
29
  import { openItem } from './library-open.js';
30
30
  import { bindSlash, bindEnterOpen, pressStep } from './library-keys.js'; // D1 and D6: the keys and presses, tested by pressing them (A437)
31
31
  import { STEP, nextShown, moreHtml, totalOf, logMore } from './list-cap.js'; // lists stay short (A455): one step for every long list
32
+ import * as RP from './review-pack.js'; // the monthly review pack (review-pack, job #1910): its parts in the preview, and the share (Issue) press
33
+ import { noteUse } from './use-log.js';
32
34
 
33
35
  const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[c]);
34
36
  const svg = (d, cls = '') => `<svg class="pm-ic${cls ? ' ' + cls : ''}" viewBox="0 0 24 24" aria-hidden="true"><path d="${d}"/></svg>`;
@@ -315,18 +317,23 @@ async function drawPreview() {
315
317
  if (!x || !wide()) { pv.hidden = true; pv.innerHTML = ''; document.body.classList.remove('lb-pv-on'); return; }
316
318
  pv.hidden = false; document.body.classList.add('lb-pv-on');
317
319
  const older = (S.items || []).filter((o) => o.ed && o.ed === x.ed && o.id !== x.id).sort((a, b) => (b.v || 0) - (a.v || 0) || String(when(b)).localeCompare(String(when(a))));
318
- const p = x.open && x.open.doc ? S.peek.get(x.id) : null;
320
+ const p = x.open && x.open.doc && !x.pack ? S.peek.get(x.id) : null;
319
321
  const lines = x.kind === 'meeting' ? x.gist || [] : p && p.head ? p.head : [];
322
+ const pack = x.pack ? RP.packHtml(x) : '';
323
+ if (pack && S.packSeen !== x.id) { S.packSeen = x.id; noteUse('rpOpen'); console.info('[review-pack] preview ' + x.id); }
320
324
  pv.innerHTML = `<div class="head"><span class="lb-mi">${svg(ICON[x.kind] || ICON.doc)}</span><h2 class="pm-h">${esc(x.name)}</h2>`
321
325
  + `<button type="button" class="pm-btn" data-lb-pv-open aria-label="Open ${esc(x.name)}, with the chat about it" title="Open, with the chat about it">${svg(OPEN)}</button>`
326
+ + (x.pack ? RP.shareHtml(x) : '')
322
327
  + `<button type="button" class="pm-btn" data-lb-pv-close aria-label="Close the record" title="Close">${svg(X)}</button></div>`
323
328
  + `<p class="pm-meta lb-pvh">Press again or Enter to open it as the full popup</p>`
324
329
  + `<dl class="pm-field">${field('Kind', x.kindText)}${field('Product', x.product)}${field('About', aboutText(x) || (x.about && x.about.title))}${field('By', x.by)}${stateText({ x, older }) ? `<dt>State</dt><dd><span class="pm-badge${x.state === 'Issued' ? ' blue' : ''}">${esc(stateText({ x, older }))}</span></dd>` : ''}`
325
330
  + `${field(x.kind === 'meeting' ? 'Held' : 'Updated', dayText(when(x)))}${field('Came out of it', x.came)}${field('Title', x.sub)}${field('File', x.path)}</dl>`
326
- + (lines.length ? `<h3 class="pm-meta lb-pvk">First lines</h3><div class="lb-pvl">${lines.map((l) => `<p>${esc(l)}</p>`).join('')}</div>` : x.open && x.open.doc && !p ? '<p class="pm-meta">Reading the first lines…</p>' : '')
331
+ + pack
332
+ + (S.shareMsg && S.shareMsg.id === x.id ? `<p class="pm-meta" role="status">${esc(S.shareMsg.text)}</p>` : '')
333
+ + (pack ? '' : lines.length ? `<h3 class="pm-meta lb-pvk">First lines</h3><div class="lb-pvl">${lines.map((l) => `<p>${esc(l)}</p>`).join('')}</div>` : x.open && x.open.doc && !p ? '<p class="pm-meta">Reading the first lines…</p>' : '')
327
334
  + (p && p.from && p.from.length ? `<h3 class="pm-meta lb-pvk">Linked from</h3><ul>${p.from.map((f) => `<li>${esc(f.title)}</li>`).join('')}</ul>` : '')
328
335
  + (older.length ? `<h3 class="pm-meta lb-pvk">Editions</h3><ul>${older.map((o) => `<li><button type="button" class="lb-nb" data-lb-pv-ed="${esc(o.id)}">${esc(o.name)}${o.v ? ' · v' + o.v : ''}</button> <span class="pm-meta">${esc(dayText(when(o)))}</span></li>`).join('')}</ul>` : '');
329
- if (x.open && x.open.doc && !p) {
336
+ if (x.open && x.open.doc && !p && !x.pack) {
330
337
  const r = await pmGet('/api/library-items/peek?ws=' + encodeURIComponent(x.open.doc.ws) + '&path=' + encodeURIComponent(x.open.doc.path)).catch(() => null);
331
338
  S.peek.set(x.id, r && r.ok ? r : { head: [], from: [] });
332
339
  if (S.pick === x.id) drawPreview();
@@ -381,6 +388,13 @@ async function load() {
381
388
  S.at = Date.now(); S.P = P || S.P;
382
389
  if (r && r.ok) { S.items = r.items || []; nameProducts(S.items); S.programs = r.programs || []; S.error = ''; } else { S.items = S.items || []; S.error = (r && r.error) || 'the server did not answer'; }
383
390
  draw();
391
+ // the monthly review packs (Library › Reports): PMOS drafts a product's pack in the month's last week when it has none, then they join the list
392
+ pmPost('/api/review-packs/due', {}).catch(() => pmGet('/api/review-packs').catch(() => null)).then((k) => {
393
+ if (!k || !k.ok || !Array.isArray(k.items) || !k.items.length) return;
394
+ const have = new Set((S.items || []).map((x) => x.id));
395
+ S.items = [...k.items.filter((x) => !have.has(x.id)), ...(S.items || [])];
396
+ nameProducts(S.items); draw();
397
+ });
384
398
  whenNames().then(() => { nameProducts(S.items); drawFilters(); draw(); }).catch(() => {});
385
399
  }
386
400
 
@@ -459,6 +473,16 @@ pv.onclick = (e) => {
459
473
  let b;
460
474
  if (e.target.closest('[data-lb-pv-close]')) { S.pick = null; draw(); drawPreview(); return; }
461
475
  if (e.target.closest('[data-lb-pv-open]') && x) { openItem(x, { from: 'Library' }); return; }
476
+ if (e.target.closest('[data-rp-share]') && x && x.pack) {
477
+ // Share is the PM's Issue press (POST /api/report/issue): the pack is frozen as it is now. PMOS never shares a pack by itself.
478
+ noteUse('rpShare');
479
+ RP.share(x, pmPost).then((r) => {
480
+ S.shareMsg = { id: x.id, text: r && r.ok ? 'Shared. The pack is issued and frozen as it is now.' : 'Not shared: ' + ((r && r.error) || 'the server did not answer') };
481
+ if (r && r.ok) { x.pack.issued = true; x.state = 'Issued'; }
482
+ drawPreview();
483
+ });
484
+ return;
485
+ }
462
486
  if ((b = e.target.closest('[data-lb-pv-ed]'))) { const o = (S.items || []).find((i) => i.id === b.dataset.lbPvEd); if (o) openItem(o, { from: 'Library' }); }
463
487
  };
464
488
  qBox.addEventListener('input', () => { S.q = qBox.value.trim(); draw(); findByMeaning(); });
@@ -49,3 +49,15 @@
49
49
  .rp .rp-nav { width: 44px; height: 44px; }
50
50
  .rp .rp-clear { min-height: 44px; }
51
51
  }
52
+ /* the optional time (task-time-optional): a clock press at the foot's end, and a row of time fields above the foot */
53
+ .rp .rp-clock { margin-left: auto; display: inline-grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: var(--radius-pill); background: none; color: var(--cz-ink2); cursor: pointer; }
54
+ .rp .rp-clock[aria-expanded="true"] { background: var(--cz-bluebg); color: var(--cz-blue); }
55
+ .rp-tm { display: flex; gap: var(--space-8); }
56
+ .rp .rp-tf { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 1px; height: 52px; padding: 6px 10px; border-radius: var(--radius-md); background: var(--cz-well); box-sizing: border-box; }
57
+ .rp .rp-tf small { font-size: var(--fs-badge); font-weight: var(--fw-strong); color: var(--cz-ink3); line-height: var(--lh-badge); }
58
+ .rp .rp-ti { width: 100%; min-width: 0; border: 0; padding: 0; background: none; font: inherit; font-size: var(--fs-body); font-weight: var(--fw-strong); color: var(--cz-ink); line-height: var(--lh-body); outline: 0; font-variant-numeric: tabular-nums; }
59
+ .rp .rp-ti:disabled { color: var(--cz-ink3); }
60
+ .rp .rp-tf:focus-within { box-shadow: inset 0 0 0 2px var(--cz-blue); }
61
+ @media (hover: hover) { .rp .rp-clock:hover { background: var(--cz-well); color: var(--cz-ink); } }
62
+ @media (pointer: coarse), (max-width: 640px) { .rp .rp-clock { width: 44px; height: 44px; } .rp .rp-tf { height: 60px; } }
63
+ .rp .rp-ti::-webkit-calendar-picker-indicator { display: none; } /* the clock press is the one clock; the field takes typed digits */
@@ -9,15 +9,21 @@
9
9
  * Words work as well (bet A488): "friday", "+2w", "in 3 days", "end of month", "end of sprint" (o.sprintEnd). While the PM types, the
10
10
  * message line says the day it read ("Reads as Friday 27 Nov 2026 · Enter saves") before anything is saved; a word form taken logs dateWords.
11
11
  * Keyboard: arrows move a day or a week, Page Up/Down a month, Home/End the week's ends, Enter or Space picks.
12
+ * A time is optional (Wawan 2026-11-25, initiative task-time-optional): where the host offers it (o.time), a clock press beside No date
13
+ * opens a time row, Start time and Due time (a milestone one Time), each saved on its own change as { start_time | due_time: 'HH:MM' or
14
+ * '' }. A set time opens the row by itself. The days never carry the time, so a task with no time picks, saves and reads as before.
12
15
  *
13
- * rangeHtml(s, o) → markup pure, for node tests. s: { start, due, field: 'start'|'due', month: 'YYYY-MM', one, focus }
16
+ * rangeHtml(s, o) → markup pure, for node tests. s: { start, due, field: 'start'|'due', month: 'YYYY-MM', one, focus,
17
+ * time (the host offers a time), timeOpen, start_time, due_time }
14
18
  * o: { today, head (html drawn first), coarse (a phone: the fields do not open the keyboard) }
15
19
  * rangeTap(s, iso) → { patch, field, done } pure: what one tap (or a typed day, or '' for "No date") writes, and what comes next
16
20
  * mountRange(el, o) → { state } draws into el and wires it. o: { start, due, one, field, today, head, sprintEnd (an ISO day, or a function that gives one),
21
+ * time (true: offer the optional time), start_time, due_time,
17
22
  * onPick(patch, done, state) — after each tap; done: the range is complete, the host closes;
18
23
  * onState(state) — after each draw, so a host that redraws can open it where it was }
19
24
  * Its own presses stop at el, so a popup's click handler around it sees only the host's own buttons (a sheet's ✕). */
20
25
  import { dayText, dayLong, parseDay, wordsOnly, localToday } from './cozy-day-pick.js';
26
+ import { isTime } from './day-time.js';
21
27
 
22
28
  const CSS = new URL('./range-pick.css', import.meta.url).href;
23
29
  if (typeof document !== 'undefined' && document.head && !document.querySelector(`link[href="${CSS}"]`)) { const l = document.createElement('link'); l.rel = 'stylesheet'; l.href = CSS; document.head.appendChild(l); }
@@ -30,7 +36,7 @@ const iso = (n) => new Date(n).toISOString().slice(0, 10);
30
36
  const addDays = (v, n) => iso(ms(v) + n * 864e5);
31
37
  const addMonths = (ym, n) => { const [y, m] = ym.split('-').map(Number); return iso(Date.UTC(y, m - 1 + n, 1)).slice(0, 7); };
32
38
  const svg = (d, s = 16) => `<svg aria-hidden="true" width="${s}" height="${s}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="${d}"/></svg>`;
33
- const ARR = { prev: 'M15 6l-6 6 6 6', next: 'M9 6l6 6-6 6' }, DIA = 'M12 4l8 8-8 8-8-8z';
39
+ const ARR = { prev: 'M15 6l-6 6 6 6', next: 'M9 6l6 6-6 6' }, DIA = 'M12 4l8 8-8 8-8-8z', CLOCK = 'M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0zM12 7v5l3 2';
34
40
 
35
41
  /** The month shown: the one asked for, else the end being picked, else the start, else today's. */
36
42
  const monthOf = (s, today) => (s.month && /^\d{4}-\d{2}$/.test(s.month) ? s.month : String((isDay(s[fieldOf(s)]) && s[fieldOf(s)]) || (isDay(s.start) && s.start) || (isDay(s.due) && s.due) || today).slice(0, 7));
@@ -72,18 +78,24 @@ export function rangeHtml(s, o = {}) {
72
78
  const ends = s.one ? `<div class="rp-ends one">${inp('due', 'Date', svg(DIA, 12))}</div>` : `<div class="rp-ends">${inp('start', 'Start')}${svg(ARR.next, 14)}${inp('due', 'Due')}</div>`;
73
79
  const tom = addDays(today, 1), dow = new Date(ms(today)).getUTCDay(), fri = addDays(today, ((5 - dow + 7) % 7) || 7);
74
80
  const quick = `<div class="rp-qk"><button type="button" data-rp-day="${today}">Today</button><button type="button" data-rp-day="${tom}">Tomorrow</button><button type="button" data-rp-day="${fri}">Fri</button></div>`;
81
+ // the optional time (task-time-optional): a clock press beside No date; the row shows when pressed or when a time is set
82
+ const tOpen = !!s.time && (!!s.timeOpen || isTime(s.start_time) || isTime(s.due_time));
83
+ const tin = (k, label, day) => `<label class="rp-tf"><small>${label}</small><input class="rp-ti" data-rp-tm="${k}" type="time" value="${isTime(s[k]) ? s[k] : ''}" aria-label="${esc(label + (day ? '' : ', pick a day first'))}"${day ? '' : ' disabled'}></label>`;
84
+ const times = tOpen ? `<div class="rp-tm">${s.one ? tin('due_time', 'Time', b) : tin('start_time', 'Start time', a) + tin('due_time', 'Due time', b)}</div>` : '';
85
+ const clock = s.time ? `<button type="button" class="rp-clock" data-rp-time aria-expanded="${tOpen}" aria-label="${tOpen ? 'Time' : 'Add a time'}" title="${tOpen ? 'Time' : 'Add a time'}">${svg(CLOCK, 16)}</button>` : '';
75
86
  return `<div class="rp${s.one ? ' one' : ''}" data-rp>${o.head || ''}${ends}${quick}`
76
87
  + `<div class="rp-mh"><button type="button" class="rp-nav" data-rp-month="${addMonths(ym, -1)}" aria-label="Previous month">${svg(ARR.prev)}</button><b aria-live="polite">${FULL[m - 1]} ${y}</b><button type="button" class="rp-nav" data-rp-month="${addMonths(ym, 1)}" aria-label="Next month">${svg(ARR.next)}</button></div>`
77
88
  + `<div class="rp-g" role="grid" aria-label="${esc(FULL[m - 1] + ' ' + y)}"><div class="rp-row rp-wk" aria-hidden="true"><i>M</i><i>T</i><i>W</i><i>T</i><i>F</i><i>S</i><i>S</i></div>${weeks.join('')}</div>`
78
89
  + `<p class="rp-msg" role="status"${o.msg ? '' : ' hidden'}>${esc(o.msg || '')}</p>`
79
- + `<div class="rp-ft"><button type="button" class="rp-clear" data-rp-clear>No date</button></div></div>`;
90
+ + times + `<div class="rp-ft"><button type="button" class="rp-clear" data-rp-clear>No date</button>${clock}</div></div>`;
80
91
  }
81
92
 
82
93
  const coarse = () => typeof matchMedia === 'function' && matchMedia('(pointer: coarse)').matches;
83
94
 
84
95
  export function mountRange(el, o = {}) {
85
96
  const today = o.today || localToday();
86
- const s = { start: isDay(o.start) && !o.one ? o.start : '', due: isDay(o.due) ? o.due : '', one: !!o.one, field: o.one ? 'due' : o.field === 'due' ? 'due' : 'start', month: o.month || '', focus: '' };
97
+ const s = { start: isDay(o.start) && !o.one ? o.start : '', due: isDay(o.due) ? o.due : '', one: !!o.one, field: o.one ? 'due' : o.field === 'due' ? 'due' : 'start', month: o.month || '', focus: '',
98
+ time: !!o.time, timeOpen: !!o.timeOpen, start_time: isTime(o.start_time) && !o.one ? o.start_time : '', due_time: isTime(o.due_time) ? o.due_time : '' };
87
99
  let msg = '', drawing = false;
88
100
  const draw = (focusDay) => {
89
101
  if (focusDay) { s.focus = focusDay; s.month = focusDay.slice(0, 7); }
@@ -95,6 +107,8 @@ export function mountRange(el, o = {}) {
95
107
  const tap = (v, from) => {
96
108
  const r = rangeTap(s, v);
97
109
  Object.assign(s, r.patch); s.field = r.field; msg = '';
110
+ if (r.patch.start === '') s.start_time = ''; // a day taken out takes its time with it (the server does the same)
111
+ if (r.patch.due === '') s.due_time = '';
98
112
  draw(from === 'grid' && v ? v : null);
99
113
  if (from === 'type' && !r.done) el.querySelector(`[data-rp-end="${s.field}"] .rp-in`)?.focus({ preventScroll: true });
100
114
  if (o.onPick) o.onPick(r.patch, r.done, { ...s });
@@ -109,8 +123,9 @@ export function mountRange(el, o = {}) {
109
123
  el.onclick = (e) => {
110
124
  const b = e.target.closest('button'); if (!b || !el.contains(b) || !b.closest('[data-rp]')) return;
111
125
  const d = b.dataset;
112
- if (d.rpDay == null && d.rpMonth == null && !('rpClear' in d)) return; // the host's own button (a sheet's ✕)
126
+ if (d.rpDay == null && d.rpMonth == null && !('rpClear' in d) && !('rpTime' in d)) return; // the host's own button (a sheet's ✕)
113
127
  e.stopPropagation();
128
+ if ('rpTime' in d) { s.timeOpen = !s.timeOpen; draw(); (el.querySelector('.rp-ti:not([disabled])') || el.querySelector('[data-rp-time]'))?.focus({ preventScroll: true }); return; }
114
129
  if (d.rpMonth) { const next = b.getAttribute('aria-label') === 'Next month'; s.month = d.rpMonth; s.focus = ''; draw(); el.querySelector(next ? '.rp-mh .rp-nav:last-child' : '.rp-mh .rp-nav')?.focus({ preventScroll: true }); return; }
115
130
  if ('rpClear' in d) { tap('', 'clear'); return; }
116
131
  tap(d.rpDay, b.closest('.rp-g') ? 'grid' : 'quick');
@@ -166,7 +181,16 @@ export function mountRange(el, o = {}) {
166
181
  if (btn) { el.querySelectorAll('.rp-g [tabindex="0"]').forEach((x) => x.setAttribute('tabindex', '-1')); btn.setAttribute('tabindex', '0'); btn.focus({ preventScroll: true }); }
167
182
  else draw(to);
168
183
  });
169
- el.addEventListener('change', (e) => { const inp = e.target.closest && e.target.closest('.rp-in'); if (inp) take(inp); });
184
+ el.addEventListener('change', (e) => {
185
+ const inp = e.target.closest && e.target.closest('.rp-in'); if (inp) { take(inp); return; }
186
+ // a time field: saved on its own change, "HH:MM" or '' when it is cleared; the picker stays open
187
+ const ti = e.target.closest && e.target.closest('.rp-ti'); if (!ti || drawing || !ti.isConnected) return;
188
+ const k = ti.dataset.rpTm, v = ti.value ? String(ti.value).slice(0, 5) : '';
189
+ if ((v && !isTime(v)) || v === s[k]) return;
190
+ s[k] = v; s.timeOpen = true;
191
+ if (o.onState) o.onState({ ...s });
192
+ if (o.onPick) o.onPick({ [k]: v }, false, { ...s });
193
+ });
170
194
  draw();
171
195
  return { state: s, focus() { (el.querySelector('.rp-g [tabindex="0"]') || el.querySelector('.rp-in'))?.focus({ preventScroll: true }); } };
172
196
  }
@@ -0,0 +1,47 @@
1
+ /* pm/review-pack.js — the monthly review pack as Library shows it (initiative review-pack, job #1910; board BatchMoreADS panel 25).
2
+ *
3
+ * packHtml(item) PURE → the preview: one pm-block with the pack's parts (Goals, Bets that failed, Next big decision, Asks), each line with the
4
+ * record it came from, then the ✦ line. The parts are read back from the file (lib/review-pack.js readPack), so the PM's
5
+ * edits show. A part with no line is not drawn (zero is silence).
6
+ * shareHtml(item) PURE → the icon-only share button (the Issue press), or '' once the pack is issued
7
+ * share(item, post) → POST /api/report/issue { ws, cadence, slot, sha }: the PM's own press. PMOS never shares a pack by itself.
8
+ * The copy names PMOS only. */
9
+ const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[c]);
10
+ const STAR = 'M12 3l1.8 5.4L19 10.2l-5.2 1.8L12 17.4l-1.8-5.4L5 10.2l5.2-1.8z';
11
+ const SEND = 'M4 12l16-8-6 16-2.5-6.5z';
12
+ export const SAID = 'Drafted by PMOS from goals, experiments and decisions. Edit, then share.';
13
+
14
+ const src = (l) => (l.source ? ` <span class="pm-meta rp-src" title="Where this line comes from">${esc(l.source)}</span>` : '');
15
+ /** The lines of one part: a failed bet's name leads the line under it ("Saved cards: No lift…"); a name with no line under it stands alone. */
16
+ function linesHtml(lines) {
17
+ const out = [];
18
+ for (let i = 0; i < lines.length; i++) {
19
+ const l = lines[i], next = lines[i + 1];
20
+ if (l.head && next && !next.head) { out.push(`<li><b>${esc(l.text)}</b>: ${esc(next.text)}${src(next)}</li>`); i++; }
21
+ else if (l.head) out.push(`<li><b>${esc(l.text)}</b></li>`);
22
+ else out.push(`<li>${esc(l.text)}${src(l)}</li>`);
23
+ }
24
+ return out.join('');
25
+ }
26
+
27
+ export function packHtml(x) {
28
+ const P = (x && x.pack) || {};
29
+ const parts = (P.sections || []).filter((s) => s && Array.isArray(s.lines) && s.lines.length);
30
+ if (!parts.length) return '';
31
+ return `<section class="pm-block rp-pack" aria-label="Review pack"><b>${esc(x.name)}</b>`
32
+ + parts.map((s) => `<div class="rp-part"><span class="pm-meta rp-head">${esc(s.head)}</span><ul class="rp-lines">${linesHtml(s.lines)}</ul></div>`).join('')
33
+ + `</section><p class="pm-said"><svg class="pm-ic pm-star" width="16" height="16" viewBox="0 0 24 24" aria-hidden="true"><path d="${STAR}"/></svg><span>${esc(SAID)}</span></p>`;
34
+ }
35
+
36
+ export function shareHtml(x) {
37
+ const P = (x && x.pack) || {};
38
+ if (!P.cadence || !P.slot || !P.sha || P.issued) return '';
39
+ return `<button type="button" class="pm-btn" data-rp-share aria-label="Share ${esc(x.name)}: issue it as it is now" title="Share (issue it as it is now)"><svg class="pm-ic" viewBox="0 0 24 24" aria-hidden="true"><path d="${SEND}"/></svg></button>`;
40
+ }
41
+
42
+ export async function share(x, post) {
43
+ const P = (x && x.pack) || {};
44
+ const ws = (x && x.open && x.open.doc && x.open.doc.ws) || undefined;
45
+ if (!P.cadence || !P.slot || !P.sha) return { ok: false, error: 'The pack could not be read, so it was not shared.' };
46
+ return post('/api/report/issue', { ws, cadence: P.cadence, slot: P.slot, sha: P.sha });
47
+ }
@@ -0,0 +1,34 @@
1
+ /* pm/sim-users.js — Findings: what simulated users found on the prototype before it reached you (initiative sim-users, idea A20, board
2
+ * BatchReleaseDS panel 24, agreed 2026-11-25). The server walks each key task once per persona (lib/sim-users.js) and the compare view
3
+ * carries the result (GET /api/lab/compare: compare.findings). This draws it above the design with the system parts: a pm-block list, one
4
+ * pm-li per finding, the state glyph (At risk where they got stuck, On track where all finished). Findings, not clicks, and never a score.
5
+ * Each finding is a press that shows the screen it came from (data-pc-screen: pm/cozy-proto.js shows it). No findings: nothing (zero is
6
+ * silence). `pmos prototype findings <initiative>` reads the same store.
7
+ *
8
+ * findingsHtml(findings) PURE → '' | the block's HTML · notePress() counts a press on this computer only (use-log control sim-finding)
9
+ * loadFindings({ ws, ini, file }) → Promise<findings | null> (null: none, or the read failed; the Viewer never waits on it) */
10
+ import { stateGlyph } from './state-glyph.js';
11
+ import { noteUse } from './use-log.js';
12
+ import { pmGet } from './http.js';
13
+
14
+ const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
15
+
16
+ export function findingsHtml(f) {
17
+ const rows = f && Array.isArray(f.rows) ? f.rows : [];
18
+ if (!rows.length) return '';
19
+ const n = Number(f.personas) || 0;
20
+ const li = (r) => {
21
+ const inner = `${stateGlyph(r.state === 'on' ? 'on' : 'risk', { progress: r.state === 'on' ? 1 : 0 })}<span class="txt"><span class="t">${esc(r.text)}</span>${r.who ? `<span class="w">${esc(r.who)}</span>` : ''}</span>`;
22
+ return r.screen
23
+ ? `<button type="button" class="pm-li pc-find" data-pc-screen="${esc(r.screen)}" data-pc-find aria-label="${esc('Show the screen: ' + r.text)}" title="${esc(r.text + (r.who ? ' · ' + r.who : ''))}">${inner}</button>`
24
+ : `<div class="pm-li pc-find">${inner}</div>`;
25
+ };
26
+ return `<section class="pm-block list pc-finds" aria-label="Findings"><div class="head"><h3 class="pm-h-sm">Findings</h3><span class="sp"></span>`
27
+ + `<span class="pm-meta" title="A hint for your grilling, never a score">${n} persona${n === 1 ? '' : 's'}</span></div><div class="rows">${rows.map(li).join('')}</div></section>`;
28
+ }
29
+ export function notePress() { return noteUse('sim-finding'); }
30
+ export async function loadFindings({ ws, ini, file }) {
31
+ if (!ini || !file) return null;
32
+ const r = await pmGet('/api/sim-users/findings?ws=' + encodeURIComponent(ws || '') + '&initiative=' + encodeURIComponent(ini) + '&file=' + encodeURIComponent(file)).catch(() => null);
33
+ return r && r.ok ? r.findings || null : null;
34
+ }
@@ -13,6 +13,7 @@
13
13
  * initiatives of a product sit in [data-po-list="@<product key>"], each [data-po-id="<initiative id>"]. Only the PM changes the order. */
14
14
  import { pmGet, pmPost } from './http.js';
15
15
  import { MODES, DEFAULT, labelOf, arranged } from './order-model.js';
16
+ import './tradeoff-cards.js'; // trade-off cards on Work (job #1918, A325): it starts itself only where #ibBody is, and reads the moves below
16
17
 
17
18
  const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
18
19
  const SV = (d, w = 1.8) => `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="${w}" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="${d}"/></svg>`;
@@ -55,6 +56,8 @@ function seen() {
55
56
 
56
57
  export async function moveIn(list, ids) {
57
58
  const was = L, k = list.dataset.poList.slice(1);
59
+ // trade-off cards (pm/tradeoff-cards.js): a row put directly above another shows the line for that pair, from the redraw save() makes
60
+ if (typeof window !== 'undefined') window.dispatchEvent(new CustomEvent('pmos:order-moved', { detail: { list: list.dataset.poList, ids } }));
58
61
  const ok = await save(arranged(L, k, ids, seen()));
59
62
  if (ok && O) O.say(was.sort === 'mine' ? 'Moved · Today and Work use this order' : 'Moved · now My order on Today and Work', () => save(was));
60
63
  return ok;
@@ -27,7 +27,8 @@
27
27
  * section and the initiative → tasks/edit, the group → /api/initiative-layout place,
28
28
  * a Jira ticket's notes → tickets/note. Each answers { ok, from } so Undo is save(from). */
29
29
 
30
- import { rangeHtml, mountRange } from './range-pick.js'; // start and due on one calendar (the same picker everywhere a task's dates are set)
30
+ import { rangeHtml, mountRange } from './range-pick.js';
31
+ import { isTime, withTime } from './day-time.js'; // a task's optional time on its start and due (task-time-optional) // start and due on one calendar (the same picker everywhere a task's dates are set)
31
32
 
32
33
  export const STATES = ['To do', 'In progress', 'Done', "Won't do", 'Archived']; // a task's only stage is its state (scripts/boards.js TASK_STATES)
33
34
  const SKEY = { 'To do': 'todo', 'In progress': 'prog', Done: 'done', "Won't do": 'wont', Archived: 'arch' };
@@ -64,7 +65,7 @@ export function taskOf(row, extra = {}) {
64
65
  const r = row || {}, jira = r.src === 'jira' || (r.pmos === false && /^Jira/.test(r.src || ''));
65
66
  return {
66
67
  uid: r.uid || '', key: r.key && /^task:/.test(r.key) ? r.key : 'task:' + (r.uid || r.key || ''), title: r.title || '', status: r.status || r.state || 'To do',
67
- start: r.start || '', due: r.end || r.due || '', owner: r.owner || (jira ? r.assignee || '' : ''), notes: r.notes || '', ini: r.ini || extra.ini || '',
68
+ start: r.start || '', due: r.end || r.due || '', start_time: isTime(r.start_time) ? r.start_time : '', due_time: isTime(r.due_time) ? r.due_time : '', owner: r.owner || (jira ? r.assignee || '' : ''), notes: r.notes || '', ini: r.ini || extra.ini || '',
68
69
  iniTitle: extra.iniTitle || '', group: extra.group != null ? extra.group : '', board: r.board || extra.board || '',
69
70
  section: typeof r.section === 'string' ? r.section : '', milestone: !!r.milestone, wbs: r.wbs && (r.wbs.title || r.wbs.id) ? { id: r.wbs.id || '', title: r.wbs.title || r.wbs.id } : null,
70
71
  // a Jira ticket (task-detail-every-task): its link and Jira's own status name, as the board's items carry them (Jira owns both)
@@ -107,9 +108,10 @@ export async function placeOf(row, stages = [], rows = [], map = null) {
107
108
  * label says Due, so the words do not (say it once). */
108
109
  export function dueLine(t, now = Date.now()) {
109
110
  const d = dayOf(t.due), s = dayOf(t.start);
110
- if (!d) return { text: s ? 'Starts ' + short(t.start) : '', late: false, lateText: '', none: !s };
111
- const same = s && s.getMonth() === d.getMonth() && s.getFullYear() === d.getFullYear();
112
- const text = s && +s !== +d ? (same ? short(t.start) + ' → ' + d.getDate() : short(t.start) + ' → ' + short(t.due)) : short(t.due);
111
+ if (!d) return { text: s ? 'Starts ' + withTime(short(t.start), t.start_time) : '', late: false, lateText: '', none: !s };
112
+ const same = s && s.getMonth() === d.getMonth() && s.getFullYear() === d.getFullYear(), tm = isTime(t.start_time) || isTime(t.due_time);
113
+ const text = tm ? (s && (+s !== +d || isTime(t.start_time)) ? withTime(short(t.start), t.start_time) + ' → ' + withTime(short(t.due), t.due_time) : withTime(short(t.due), t.due_time))
114
+ : s && +s !== +d ? (same ? short(t.start) + ' → ' + d.getDate() : short(t.start) + ' → ' + short(t.due)) : short(t.due);
113
115
  const diff = Math.round((d - todayOf(now)) / 86400000);
114
116
  const late = diff < 0 && !closed(t.status);
115
117
  return { text, late, lateText: late ? -diff + (diff === -1 ? ' day late' : ' days late') : !closed(t.status) && diff === 0 ? 'Today' : '', none: false };
@@ -346,7 +348,8 @@ export function mountCard(el, t, h) {
346
348
  // the dates picker wires itself; each tap saves with Undo, and the second tap (the due day) closes it
347
349
  const dp = el.querySelector('.tkc-dp');
348
350
  if (dp) mountRange(dp, { start: t.start, due: t.due, one: !!t.milestone, field: st.field, month: st.month, today: isoOf(todayOf(h.now ? h.now() : Date.now())),
349
- onState: (s) => { st.field = s.field; st.month = s.month; },
351
+ time: !t.jira, start_time: t.start_time, due_time: t.due_time, timeOpen: st.timeOpen, // the optional time (task-time-optional): a PMOS task's only
352
+ onState: (s) => { st.field = s.field; st.month = s.month; st.timeOpen = s.timeOpen; },
350
353
  onPick: (patch, done) => { if (done) st.open = null; change('dates', patch); } });
351
354
  if (dp && inDp) dp.querySelector('.rp-g [tabindex="0"]')?.focus({ preventScroll: true });
352
355
  };
@@ -471,7 +474,7 @@ export function boardSaver(o) {
471
474
  if (patch.status != null) return post('/api/boards/tasks/state', { ws, board, task: t.uid, state: patch.status });
472
475
  if (patch.group != null) return post('/api/initiative-layout', { ws, kind: 'place', initiative: t.ini, task: t.key, group: patch.group });
473
476
  const body = {};
474
- for (const k of ['owner', 'notes', 'start', 'due', 'section', 'initiative', 'milestone', 'priority']) if (patch[k] != null) body[k] = patch[k];
477
+ for (const k of ['owner', 'notes', 'start', 'due', 'start_time', 'due_time', 'section', 'initiative', 'milestone', 'priority']) if (patch[k] != null) body[k] = patch[k];
475
478
  return post('/api/boards/tasks/edit', { ws, board, task: t.uid, ...body });
476
479
  };
477
480
  }
@@ -0,0 +1,56 @@
1
+ /* pm/team-waits.js — "Waiting on other teams" on Work › Dependencies (initiative team-waits, bet A364; board BatchCodeDS panel 14, In development).
2
+ * Pure: Node imports it (team-waits.test.js). Rows come from GET /api/team-waits (lib/team-waits.js waitsOf), one per wait, oldest first.
3
+ *
4
+ * LATE_DAYS a wait this many days old or more is late: the late glyph and its day count (spec question Q1)
5
+ * rowsOf(waits, { today }) → [{ id, ws, name, since, sub, state, chase }] the rows as the board draws them
6
+ * waitsHtml(rows) → the block: pm-block "Waiting on other teams" with its count, a pm-li per row, an icon-only Chase button;
7
+ * '' with no row (zero is silence)
8
+ * chaseDraft(w, { by }) → { to, subject, body, mailto } a draft for the PM's own mail app. PMOS sends nothing.
9
+ *
10
+ * A row: "<initiative> → <team or what>", then "waiting since 4 Nov" (" · 21 days" once it is late), then, while its sprint runs,
11
+ * "Sprint 14 at risk" once. Text from records goes through esc(). The UI says PMOS. */
12
+ import { stateGlyph } from './state-glyph.js';
13
+
14
+ export const LATE_DAYS = 14;
15
+ export const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
16
+ const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
17
+ /** "2026-11-04" → "4 Nov" */
18
+ export const dayWords = (d) => { const m = /^(\d{4})-(\d{2})-(\d{2})/.exec(String(d || '')); return m ? `${Number(m[3])} ${MON[Number(m[2]) - 1]}` : ''; };
19
+ const ICON_CHASE = 'M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM4 21a8 8 0 0 1 16 0';
20
+ const SV = (d) => `<svg class="pm-ic" width="16" height="16" viewBox="0 0 24 24" aria-hidden="true"><path d="${d}"/></svg>`;
21
+
22
+ /** What the wait is on, in the fewest words: the team, else what it waits for. */
23
+ const onOf = (w) => w.team || w.what || 'another team';
24
+
25
+ export function rowsOf(waits, { today } = {}) {
26
+ return (Array.isArray(waits) ? waits : []).map((w) => {
27
+ const days = Number.isFinite(w.days) ? w.days : 0;
28
+ const late = days >= LATE_DAYS;
29
+ const atRisk = !!(w.sprint && w.sprint_end && (!today || w.sprint_end >= today));
30
+ const sub = ['waiting since ' + dayWords(w.since) + (late ? ` · ${days} ${days === 1 ? 'day' : 'days'}` : ''), atRisk ? `${/^sprint\b/i.test(w.sprint) ? w.sprint : 'Sprint ' + w.sprint} at risk` : '']
31
+ .filter(Boolean).join(' · ');
32
+ return { id: w.id, ws: w.ws || '', name: `${w.title || w.ini || 'Untitled'} → ${onOf(w)}`, what: w.team && w.what ? w.what : '', since: w.since, sub, state: late ? 'late' : 'wait', chase: w };
33
+ });
34
+ }
35
+
36
+ export function waitsHtml(rows) {
37
+ if (!rows || !rows.length) return '';
38
+ const row = (r, i) => `<div class="pm-li" role="listitem" data-tw="${esc(r.id)}">${stateGlyph(r.state, { size: 14 })}`
39
+ + `<span class="txt"><span class="t">${esc(r.name)}</span><span class="w">${esc(r.sub)}${r.what ? ' · ' + esc(r.what) : ''}</span></span>`
40
+ + `<span class="acts"><button type="button" class="pm-btn" data-tw-chase="${i}" aria-label="Chase${r.chase && r.chase.who ? ' ' + esc(r.chase.who) : ''}" title="Chase: a draft in your mail app">${SV(ICON_CHASE)}</button></span></div>`;
41
+ return `<section class="pm-block list tw-block" aria-label="Waiting on other teams"><div class="head"><h3 class="pm-h-sm">Waiting on other teams</h3><span class="sp"></span>`
42
+ + `<span class="pm-meta">${rows.length}</span></div><div class="rows" role="list">${rows.map(row).join('')}</div></section>`;
43
+ }
44
+
45
+ /** The Chase draft: to the wait's person when PMOS knows an address, else to nobody yet (the PM picks in the mail app). PMOS sends nothing. */
46
+ export function chaseDraft(w, { by = '' } = {}) {
47
+ const ini = w.title || w.ini || 'our work';
48
+ const on = w.what || w.team || 'this';
49
+ const to = /^[^\s@]+@[^\s@]+$/.test(w.email || '') ? w.email : '';
50
+ const hi = w.who ? `Hi ${String(w.who).split(/\s+/)[0]},` : 'Hi,';
51
+ const subject = `${ini}: waiting on ${on}`;
52
+ const body = [hi, '', `${ini} has been waiting on ${on}${w.key ? ' (' + w.key + ')' : ''} since ${dayWords(w.since)}.`
53
+ + (w.sprint && w.sprint_end ? ` It holds up ${/^sprint\b/i.test(w.sprint) ? w.sprint : 'Sprint ' + w.sprint}, which ends ${dayWords(w.sprint_end)}.` : ''),
54
+ 'Is there a date we can plan on, or anything you need from us?', '', 'Thanks', by].join('\n').trimEnd();
55
+ return { to, subject, body, mailto: 'mailto:' + encodeURIComponent(to).replace(/%40/g, '@') + '?subject=' + encodeURIComponent(subject) + '&body=' + encodeURIComponent(body) };
56
+ }
@@ -0,0 +1,27 @@
1
+ /* pm/tradeoff-cards.css — the trade-off line, the kept reason and the card (board TradeoffDS; pm/tradeoff-cards.js). Tokens only. */
2
+ .tc-line{padding:2px 0 2px 14px;border-top:1px dashed var(--line)}
3
+ .tc-open{display:inline-flex;align-items:center;gap:8px;border:0;background:none;color:var(--muted);font:inherit;font-size:var(--fs-meta);line-height:20px;padding:6px 8px;border-radius:var(--radius-sm);cursor:pointer}
4
+ @media (hover: hover){.tc-open:hover{background:var(--well);color:var(--ink)}}
5
+ .tc-open:focus-visible{outline:none;box-shadow:var(--glow)}
6
+ .tc-kept{display:flex;align-items:flex-start;gap:6px;margin:0;padding:0 8px 6px 14px;font-size:var(--fs-meta);line-height:20px;color:var(--muted)}
7
+ .tc-kept span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
8
+ .tc-kept svg,.tc-past svg{flex-shrink:0;margin-top:3px}
9
+ .tc-scrim{position:fixed;inset:0;z-index:60;display:flex;align-items:center;justify-content:center;padding:16px;background:color-mix(in srgb, var(--cz-ink) 28%, transparent)}
10
+ .tc-card{width:min(520px,100%);max-height:calc(100vh - 32px);overflow:auto;background:var(--card);color:var(--ink);border-radius:var(--radius-card);box-shadow:var(--lift);padding:var(--space-16) var(--space-24) var(--space-24);display:flex;flex-direction:column;gap:var(--space-12)}
11
+ .tc-h{display:flex;align-items:center;gap:4px}
12
+ .tc-t{flex:1;margin:0;display:flex;align-items:center;gap:8px;font-size:var(--fs-panel);line-height:24px;font-weight:var(--fw-panel)}
13
+ .tc-past{display:flex;gap:6px;margin:0;font-size:var(--fs-meta);line-height:20px;color:var(--muted)}
14
+ .tc-grid{background:var(--well);border-radius:var(--radius-md);padding:var(--space-4) 0}
15
+ .tc-r{display:grid;grid-template-columns:minmax(96px,.8fr) 1fr 1fr}
16
+ .tc-l{padding:6px 12px;font-size:var(--fs-meta);line-height:20px;color:var(--muted)}
17
+ .tc-v{padding:6px 12px;font-size:var(--fs-body);line-height:22px;background:var(--card)}
18
+ .tc-r:nth-child(2) .tc-v{border-top-left-radius:0}
19
+ .tc-col-h{padding:8px 12px;font-weight:var(--fw-row);background:var(--card)}
20
+ .tc-nk{color:var(--muted)}
21
+ .tc-sug{display:flex;gap:8px;margin:0;font-size:var(--fs-body);line-height:22px}
22
+ .tc-star{color:var(--blue)}
23
+ .tc-why{font-size:var(--fs-meta);line-height:20px;color:var(--muted)}
24
+ .tc-foot{display:flex;justify-content:flex-end;gap:8px}
25
+ .tc-foot .pm-btn{width:40px;height:40px}
26
+ .tc-err{margin:0;font-size:var(--fs-meta);color:var(--alert)}
27
+ @media (max-width:600px){.tc-r{grid-template-columns:1fr 1fr}.tc-l{grid-column:1 / -1;padding-bottom:0}.tc-r:first-child .tc-l{display:none}}