create-pmos 0.401.0 → 0.403.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 (127) hide show
  1. package/package.json +25 -30
  2. package/payload/KIT-VERSION +2 -2
  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/payload/state/log.md +1 -1
  7. package/workspace/board-programs-test.js +227 -0
  8. package/workspace/board-shot.js +54 -0
  9. package/workspace/briefing-premium-adddoc-test.js +28 -22
  10. package/workspace/briefing-premium-board-test.js +107 -82
  11. package/workspace/briefing-premium-calendar-2-test.js +23 -10
  12. package/workspace/briefing-premium-calendar-3-test.js +23 -19
  13. package/workspace/briefing-premium-calendar-test.js +20 -15
  14. package/workspace/briefing-premium-initiative-test.js +25 -12
  15. package/workspace/briefing-premium-insights-test.js +31 -18
  16. package/workspace/briefing-premium-metrics-test.js +8 -8
  17. package/workspace/briefing-premium-sources-test.js +15 -10
  18. package/workspace/briefing-premium-test.js +39 -16
  19. package/workspace/changelog.json +24 -0
  20. package/workspace/fixtures/board-premium-facts.js +20 -3
  21. package/workspace/fixtures/briefing-premium-facts.js +18 -2
  22. package/workspace/fixtures/premium-viewer-fixtures.js +24 -2
  23. package/workspace/fixtures/program-ascent.js +101 -0
  24. package/workspace/guide/home.md +11 -7
  25. package/workspace/guide/index.md +1 -0
  26. package/workspace/guide/jira.md +38 -6
  27. package/workspace/guide/programs.md +37 -0
  28. package/workspace/home-rows-test.js +184 -0
  29. package/workspace/lib/briefing-premium-products.js +4 -4
  30. package/workspace/lib/briefing-premium.js +2 -2
  31. package/workspace/lib/calendar-layers.js +8 -4
  32. package/workspace/lib/initiative-layout.js +4 -3
  33. package/workspace/lib/jira-cli.js +17 -12
  34. package/workspace/lib/jira-status.js +1 -1
  35. package/workspace/lib/jira-tickets.js +126 -24
  36. package/workspace/lib/meeting-files.js +58 -0
  37. package/workspace/lib/meeting-learn.js +139 -0
  38. package/workspace/lib/meeting-material.js +12 -5
  39. package/workspace/lib/notes.js +3 -0
  40. package/workspace/lib/programs.js +129 -0
  41. package/workspace/lib/route-modules.js +1 -0
  42. package/workspace/lib/routes-brief-page.js +8 -1
  43. package/workspace/lib/routes-briefing-premium.js +1 -1
  44. package/workspace/lib/routes-calendar-views.js +24 -3
  45. package/workspace/lib/routes-meeting-material.js +38 -0
  46. package/workspace/lib/routes-meeting-points.js +23 -3
  47. package/workspace/lib/routes-programs.js +122 -0
  48. package/workspace/package-lock.json +2 -2
  49. package/workspace/package.json +1 -1
  50. package/workspace/premium-board-actions-test.js +31 -25
  51. package/workspace/premium-chat-context-test.js +1 -1
  52. package/workspace/premium-chat-goal-view-test.js +1 -1
  53. package/workspace/premium-chat-viewer-test.js +1 -1
  54. package/workspace/premium-core-doc-issue-test.js +13 -7
  55. package/workspace/premium-discuss-landing-test.js +83 -0
  56. package/workspace/premium-link-suggest-test.js +103 -0
  57. package/workspace/premium-report-read-test.js +86 -82
  58. package/workspace/premium-vw-backlog-test.js +6 -5
  59. package/workspace/premium-vw-cal-test.js +45 -19
  60. package/workspace/premium-vw-item-test.js +8 -6
  61. package/workspace/premium-vw-jira-test.js +3 -2
  62. package/workspace/premium-vw-meet-test.js +122 -66
  63. package/workspace/premium-vw-notes-test.js +7 -6
  64. package/workspace/premium-vw-rec-test.js +14 -13
  65. package/workspace/premium-vw-slides-test.js +11 -5
  66. package/workspace/program-panel-test.js +152 -0
  67. package/workspace/public/pm/bd-acts.js +24 -15
  68. package/workspace/public/pm/bd-asks.js +111 -30
  69. package/workspace/public/pm/bd-ini-panel.js +229 -0
  70. package/workspace/public/pm/bd-pop.js +2 -2
  71. package/workspace/public/pm/bd-prog-panel.js +436 -0
  72. package/workspace/public/pm/bd-prog.js +191 -0
  73. package/workspace/public/pm/bd-span.js +98 -15
  74. package/workspace/public/pm/bd-views.js +93 -29
  75. package/workspace/public/pm/cozy-board.css +214 -20
  76. package/workspace/public/pm/cozy-evui.js +4 -2
  77. package/workspace/public/pm/cozy-home-rows.css +54 -0
  78. package/workspace/public/pm/cozy-home.css +35 -0
  79. package/workspace/public/pm/cozy-insights.css +1 -2
  80. package/workspace/public/pm/cozy-mtg-present.css +160 -0
  81. package/workspace/public/pm/cozy-panel.css +155 -0
  82. package/workspace/public/pm/cozy-rec-pill.css +12 -0
  83. package/workspace/public/pm/cozy-rec-pill.js +46 -0
  84. package/workspace/public/pm/cozy-today.css +189 -0
  85. package/workspace/public/pm/cozy-viewer.js +307 -43
  86. package/workspace/public/pm/cozy-vw-mtg.css +96 -94
  87. package/workspace/public/pm/cozy-vw-rp.css +40 -25
  88. package/workspace/public/pm/cozy-vw-shell.css +127 -0
  89. package/workspace/public/pm/cozy-xv.css +51 -0
  90. package/workspace/public/pm/cozy-xv.js +34 -0
  91. package/workspace/public/pm/home-app.js +192 -72
  92. package/workspace/public/pm/home-chat.js +17 -4
  93. package/workspace/public/pm/home-data.js +1 -1
  94. package/workspace/public/pm/home-day.js +64 -0
  95. package/workspace/public/pm/home-ini-model.js +1 -1
  96. package/workspace/public/pm/home-ini.js +197 -54
  97. package/workspace/public/pm/home-list.js +100 -27
  98. package/workspace/public/pm/home-mentions.js +187 -0
  99. package/workspace/public/pm/home-rec-row.js +67 -0
  100. package/workspace/public/pm/home-review.js +20 -10
  101. package/workspace/public/pm/home-task.js +19 -18
  102. package/workspace/public/pm/home-today.js +137 -59
  103. package/workspace/public/pm/premium-board.js +294 -288
  104. package/workspace/public/pm/premium-insights.js +118 -82
  105. package/workspace/public/pm/premium-mtg-present.js +408 -100
  106. package/workspace/public/pm/premium-mtg-replay.js +70 -10
  107. package/workspace/public/pm/premium-report-read.js +118 -63
  108. package/workspace/public/pm/premium-vw-cal.js +62 -34
  109. package/workspace/public/pm/premium-vw-mtg.js +348 -192
  110. package/workspace/public/pm/program-model.js +192 -0
  111. package/workspace/public/pm/rec-state.js +63 -0
  112. package/workspace/public/pm/rp-parts.js +33 -8
  113. package/workspace/public/pm/tk-draft.js +107 -0
  114. package/workspace/public/pm/tk-model.js +134 -0
  115. package/workspace/public/pm/tk-send.js +124 -0
  116. package/workspace/public/pm/tk-tasks.css +120 -0
  117. package/workspace/public/premium-board.html +4 -2
  118. package/workspace/server.js +4 -2
  119. package/workspace/skills/jira-push.skill +3 -3
  120. package/workspace/test-lists/board-programs.json +9 -0
  121. package/workspace/test-lists/prd-to-jira.json +6 -0
  122. package/workspace/test-lists/program-hierarchy.json +11 -0
  123. package/workspace/test-lists/program-panel.json +9 -0
  124. package/workspace/test-lists/viewer-home-rows.json +9 -0
  125. package/workspace/test-lists/viewer-meetings.json +9 -0
  126. package/workspace/test-lists/viewer-shell-a.json +15 -0
  127. package/workspace/tk-tasks-test.js +199 -0
@@ -20,7 +20,10 @@ export function dueText(iso, now = Date.now()) {
20
20
  const m = /^(\d{4})-(\d{2})-(\d{2})/.exec(iso); return 'Due ' + +m[3] + ' ' + MON[+m[2] - 1];
21
21
  }
22
22
 
23
- /** h: { VW, pmPost, toast, now, ws, board, iniTitle(id), docs(id) → [{ title, path }], openIni(id), openDoc(doc), askInChat(task), openRecord(task), onChange() } */
23
+ /** h: { VW, pmPost, toast, now, ws, board, iniTitle(id), docs(id) → [{ title, path }], openIni(id), openDoc(doc), askInChat(task), openRecord(task), onChange() }
24
+ * Shell A (canvas XvATask): the summary card says when it is due, quotes the task's words, says where it sits, and holds the one primary
25
+ * (Talk it through in chat) with Done as a quiet check beside it. "Needs" folds below: the initiative, its documents and the Jira item.
26
+ * The status moves and the task's record are under ⋯ (the xvMore note: change it, then look back). */
24
27
  export function openTask(task, h) {
25
28
  const st = { msg: '', busy: false };
26
29
  const t = task;
@@ -28,21 +31,21 @@ export function openTask(task, h) {
28
31
  const now = h.now ? h.now() : Date.now();
29
32
  const done = t.status === 'Done';
30
33
  const due = dueText(t.end, now);
31
- const where = [h.iniTitle(t.ini), 'task', due === 'No date' ? '' : due.replace(/^Due /, '').toLowerCase(), t.owner && !/^(pm|you)(:|$)/i.test(t.owner) ? 'with ' + t.owner : ''].filter(Boolean).join(' · ');
34
+ const late = /late/.test(due), today = due === 'Due today';
35
+ const where = [h.iniTitle(t.ini), t.status && t.status !== 'To do' ? t.status.toLowerCase() : '', t.owner && !/^(pm|you)(:|$)/i.test(t.owner) ? 'with ' + t.owner : ''].filter(Boolean).join(' · ');
32
36
  const docs = (h.docs ? h.docs(t.ini) : []) || [];
33
- const need = [`<div class="ut-trow">${svg(P.flag, 16)}<span>${esc(h.iniTitle(t.ini))} <span class="ut-mut">· the initiative</span></span><button type="button" class="ut-btn sm soft" data-tk="ini">Open</button></div>`]
34
- .concat(docs.slice(0, 4).map((d, i) => `<div class="ut-trow">${svg(P.doc, 16)}<span>${esc(d.title)}</span><button type="button" class="ut-btn sm soft" data-tk-doc="${i}">Open</button></div>`))
35
- .concat(t.ref && t.src !== 'pmos' ? [`<div class="ut-trow">${svg(P.ticket, 16)}<span>${esc(t.ref)}</span></div>`] : []);
36
- b.innerHTML = `<div class="ut-vc">`
37
- + `<div class="ut-vh"><button type="button" class="hm-ck" data-tk="done" aria-label="${done ? 'Done' : 'Mark ' + esc(t.title) + ' done'}"${done ? ' disabled' : ''}><span class="ut-chk${done ? ' on' : ''}">${done ? svg(P.check, 12) : ''}</span></button>`
38
- + `<div><h2 class="ut-h2">${esc(t.title)}</h2><p class="ut-sub">${esc(where)}</p></div>`
39
- + `<button type="button" class="ut-ib" data-tk="record" aria-label="Open the task's record" title="The task's record">${svg(P.dots, 16, 'dots')}</button></div>`
40
- + `<div class="ut-chips"><span class="cz-chip${/late/.test(due) ? ' on' : ''}">${esc(due)}</span>${STATES.filter((x) => x !== 'Done').map((x) => `<button type="button" class="cz-chip${t.status === x ? ' on' : ' gh'}" data-tk-state="${esc(x)}" aria-pressed="${t.status === x}">${esc(x)}</button>`).join('')}</div>`
41
- + `<p class="ut-lbl">What you need for it</p><div>${need.join('')}</div>`
42
- + `<div class="ut-foot"><button type="button" class="ut-btn pri" data-tk="chat">Talk it through in chat</button><button type="button" class="ut-btn" data-tk="done"${done ? ' disabled' : ''}>Done</button></div>`
43
- + `<p class="ut-small ut-mut" role="status" id="tkMsg">${esc(st.msg)}</p></div>`;
37
+ const row = (icon, title, sub, attr) => `<button type="button" class="czs-it" ${attr}><span class="ut-tki" aria-hidden="true">${icon}</span><span class="w">${esc(title)}${sub ? `<span>${esc(sub)}</span>` : ''}</span></button>`;
38
+ const need = [row(svg(P.flag, 15), h.iniTitle(t.ini), 'the initiative', 'data-tk="ini"')]
39
+ .concat(docs.slice(0, 4).map((d, i) => row(svg(P.doc, 15), d.title, '', `data-tk-doc="${i}"`)))
40
+ .concat(t.ref && t.src !== 'pmos' ? [`<div class="czs-it"><span class="ut-tki j" aria-hidden="true">J</span><span class="w">${esc(t.ref)}</span></div>`] : []);
41
+ b.innerHTML = h.VW.czSummary({ line: done ? 'Done' : due === 'No date' ? '' : due, tone: done ? 'ok' : late || today ? 'warn' : '', text: t.note || t.text || '', meta: where,
42
+ primary: { label: 'Talk it through in chat', act: 'chat' }, also: [{ act: 'done', label: done ? 'Done' : 'Mark ' + t.title + ' done', icon: 'M5 12l4.5 4.5L19 7', disabled: done }] })
43
+ + h.VW.czSections([{ id: 'need', title: 'Needs', count: need.length, open: true, html: need.join('') }], { key: 'task' })
44
+ + `<p class="ut-small ut-mut" role="status" id="tkMsg">${esc(st.msg)}</p>`;
44
45
  };
45
- const body = h.VW.open({ id: 'task:' + t.uid, kind: 'Task', title: t.title, icon: 'M5 12l5 5 9-10', render: draw });
46
+ const more = () => STATES.filter((x) => x !== 'Done' && x !== t.status).map((x) => ({ label: 'Mark ' + x.toLowerCase(), on: () => setState(x) }))
47
+ .concat(h.openRecord ? [{ sep: true }, { label: "Open the task's record", on: () => h.openRecord(t) }] : []);
48
+ const body = h.VW.open({ id: 'task:' + t.uid, kind: 'Task', title: t.title, icon: 'task', more: more(), render: draw });
46
49
  const setState = async (state) => {
47
50
  if (st.busy) return; st.busy = true;
48
51
  const r = await h.pmPost('/api/boards/tasks/state', { ws: h.ws, board: t.board || h.board, task: t.uid, state }).catch(() => null);
@@ -50,18 +53,16 @@ export function openTask(task, h) {
50
53
  if (!r || r.ok !== true) { st.msg = (r && r.error) || 'The status did not change.'; draw(body); return; }
51
54
  t.status = state; st.msg = '';
52
55
  h.toast(state === 'Done' ? 'Done. It leaves your list.' : 'Now ' + state.toLowerCase() + '.');
53
- if (state === 'Done') h.VW.close(); else draw(body);
56
+ if (state === 'Done') h.VW.close(); else openTask(t, h);
54
57
  if (h.onChange) h.onChange();
55
58
  };
56
59
  body.onclick = (e) => {
57
60
  const b = e.target.closest('button'); if (!b || b.disabled) return;
58
- const k = b.dataset.tk;
59
- if (b.dataset.tkState) { if (b.dataset.tkState !== t.status) setState(b.dataset.tkState); return; }
61
+ const k = b.dataset.tk || b.dataset.czsAct;
60
62
  if (b.dataset.tkDoc != null && b.dataset.tkDoc !== '') { const d = (h.docs ? h.docs(t.ini) : [])[+b.dataset.tkDoc]; if (d && h.openDoc) h.openDoc(d); return; }
61
63
  if (k === 'done') setState('Done');
62
64
  else if (k === 'ini') h.openIni(t.ini);
63
65
  else if (k === 'chat') h.askInChat(t);
64
- else if (k === 'record' && h.openRecord) h.openRecord(t);
65
66
  };
66
67
  return body;
67
68
  }
@@ -1,71 +1,101 @@
1
- /* pm/home-today.js — draws Home's one list (initiative premium-uncovered-features, H1 and H2; canvas HmMyWork, HmReview, HmProducts,
2
- * HmDay, HmMic, HmPhone, HmPhone2).
1
+ /* pm/home-today.js — draws Home's one list in the Home A + C design with programs (initiative program-hierarchy, H1 to H4; canvas HvAC,
2
+ * HvAOpen, HvACDesk, PgHomePhone, PgHomeDesk), over the one list of premium-uncovered-features (HmMyWork, HmDay, HmMic, HmReview).
3
3
  *
4
- * The list column, top to bottom: the head (Today, the products picker when Home reads more than one product, New), the Today card through
5
- * the day, the filters (Today, Waiting, Kept, Done), one group per product ("PMOS · 2 of 4 goals on track") with its own next steps and its
6
- * initiatives (the ones where it is your turn first, each with its tasks, next steps, sessions and meetings nested under it), "Not in an
7
- * initiative", the capture box ("Add a task. PMOS files it under its initiative") and "Untouched 14+ days". Another product's group can be
8
- * closed: "Partner portal · 2 initiatives · 1 your turn".
4
+ * The list column, top to bottom: one header line ("Good morning" with a chevron that opens Your day, the product picker when Home reads
5
+ * more than one product, on a desktop the filter icon for Kept and Done, New), the "N are yours" line, the Today card only while the day has
6
+ * a moment (a recording, a meeting soon or on now, the end of the day, the weekly review open), each program's group, then each product's
7
+ * group (an initials tile, the name, the goal dots, a chevron; one-line rows with the stage track on the right; sessions, next steps and
8
+ * tasks indented under their initiative), and "Not in an initiative" as a folded line. Your day (dayHtml) is a sheet over the list: the date
9
+ * and the day's meetings, Your move with its count, and This week with the Weekly review. Every group folds; home-app.js keeps the folds.
9
10
  * The model is home-list.js (pure). This file only turns it into HTML: every control is a <button> (or the capture form) with a data-hm-*
10
11
  * press that home-app.js handles. Text from the records goes through esc(). */
11
12
 
13
+ import { STEPS } from './premium-initiative-head.js';
14
+ import { whenOf } from './home-list.js';
15
+
12
16
  export const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
13
17
  export const P = {
14
- chevR: 'M10 7l5 5-5 5', chevD: 'M7 10l5 5 5-5', plus: 'M12 5v14M5 12h14', x: 'M6 6l12 12M18 6L6 18', check: 'M5 12l5 5 9-10',
18
+ chevR: 'M10 7l5 5-5 5', chevD: 'M7 10l5 5 5-5', chevU: 'M7 14l5-5 5 5', layers: 'M12 3l9 5-9 5-9-5zM3 13l9 5 9-5M3 17.5l9 5 9-5', filter: 'M4 6h16M7 12h10M10 18h4',
19
+ calendar: 'M4 5h16v15H4zM8 3v4M16 3v4M4 10h16', plus: 'M12 5v14M5 12h14', x: 'M6 6l12 12M18 6L6 18', check: 'M5 12l5 5 9-10',
15
20
  mic: 'M12 3a3 3 0 0 0-3 3v6a3 3 0 0 0 6 0V6a3 3 0 0 0-3-3M5 11a7 7 0 0 0 14 0M12 18v3', clock: 'M12 4a8 8 0 1 0 0 16a8 8 0 1 0 0-16M12 8v4l3 2',
16
21
  pause: 'M8 5v14M16 5v14', stop: 'M7 7h10v10H7z', list: 'M9 6h11M9 12h11M9 18h11', doc: 'M7 3h7l5 5v13H7zM14 3v5h5',
17
22
  gate: 'M12 3l7 3v6c0 4-3 7-7 9-4-2-7-5-7-9V6z', flag: 'M5 21V4h11l-2 4 2 4H5', cal: 'M4 6h16v14H4zM4 10h16', pin: 'M9 4h6l-1 6 3 3H7l3-3zM12 13v7',
18
23
  decide: 'M12 3v18M5 8l7-5 7 5', ret: 'M9 14L4 9l5-5M4 9h10a6 6 0 0 1 0 12h-3', back: 'M19 12H5M11 6l-6 6 6 6', warn: 'M12 4l9 16H3zM12 10v4M12 17v.5',
19
- chat: 'M4 5h16v11H9l-5 4z', dots: 'M5 12h.01M12 12h.01M19 12h.01', send: 'M5 12h14M13 6l6 6-6 6', ticket: 'M3 5h18v4H3zM3 11h18v4H3z',
24
+ chat: 'M4 5h16v11H9l-5 4z', prog: 'M4 5h7v5H4zM13 5h7v5h-7zM8.5 14h7v5h-7zM7.5 10v2h9v-2M12 12v2', dots: 'M5 12h.01M12 12h.01M19 12h.01', send: 'M5 12h14M13 6l6 6-6 6', ticket: 'M3 5h18v4H3zM3 11h18v4H3z',
20
25
  };
21
26
  export const svg = (d, w = 16, cls = '') => `<svg aria-hidden="true"${cls ? ` class="${cls}"` : ''} width="${w}" height="${w}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="${d}"/></svg>`;
22
27
  const ROW_ICON = { decision: P.decide, blocked: P.warn, waited: P.clock, src: P.doc, source: P.doc, ev: P.gate, run: P.ret, update: P.doc, meeting: P.cal };
23
28
  const dotOf = (st) => ({ needs: 'you', blocked: 'late', working: 'ok', wait: 'none' }[st] || 'none');
24
29
  const iconOfNeed = (r) => (r.kind === 'update' ? P.doc : r.row && r.row.dialog && r.row.dialog.write && r.row.dialog.write.kind === 'return' ? P.ret : ROW_ICON[(r.row && r.row.kind) || ''] || P.gate);
25
30
 
26
- /* ── one row ── */
27
- function tileHtml(r, o) {
28
- if (r.kind === 'session') return o.avHtml(r.role || { initial: r.initial || 'C' }, 32, 'hm-tile');
29
- if (r.kind === 'meeting') return `<span class="hm-tile">${svg(P.cal, 16)}</span>`;
30
- return `<span class="hm-tile">${svg(r.kind === 'need' || r.kind === 'update' ? iconOfNeed(r) : P.chat, 16)}</span>`;
31
+ /* ── one row (HvAC .row, .kid) ── */
32
+ /* The mark says what a row is, by shape (Wawan on the canvas, 2026-10-23): a check box is a task (amber when late), a dot is a session or a
33
+ * next step (blue: it waits on you; amber: it is blocked; a ring: it runs), a clock is a meeting. A row is one line: the words are in the
34
+ * mark's and the row's accessible names, and the detail opens on a press (summary first). */
35
+ const RING = { needs: 'Waits on you', blocked: 'Blocked, waits on you', working: 'Running' };
36
+ function markHtml(r) {
37
+ if (r.kind === 'meeting') return `<span class="hv-mk" role="img" aria-label="Meeting">${svg(P.clock, 15)}</span>`;
38
+ const st = r.state === 'needs' || r.state === 'blocked' || r.state === 'working' ? r.state : '';
39
+ return st ? `<span class="hv-mk"><span class="hv-d${st === 'blocked' ? ' am' : st === 'working' ? ' run' : ''}" role="img" aria-label="${RING[st]}"></span></span>` : '<span class="hv-mk"></span>';
40
+ }
41
+ function checkHtml(r) {
42
+ const what = (r.mine === false ? 'Task, waits on someone else' : 'Your task') + (r.late ? ', late' : r.hint ? ', ' + r.hint : '');
43
+ if (r.done) return `<span class="hv-mk"><span class="hv-ck on" role="img" aria-label="Done">${svg(P.check, 11)}</span></span>`;
44
+ if (r.mine === false && r.kind === 'task') return `<span class="hv-mk"><span class="hv-ck wait" role="img" aria-label="${esc(what)}"></span></span>`;
45
+ return `<button type="button" class="hv-mk hm-ck" data-hm-check="${esc(r.id)}" aria-label="${esc(what)}. Mark ${esc(r.name)} done" title="Mark done"><span class="hv-ck${r.late ? ' late' : ''}"></span></button>`;
31
46
  }
32
- /** A row of the list: a next step, a task, a note, a mention, a session or a meeting. o: { sel, kid, flat, avHtml, pinned } */
47
+ const isCheck = (r) => r.check || r.kind === 'task' || r.done;
48
+ const track = (at, label) => (at < 0 ? '' : `<span class="hv-mt" role="img" aria-label="${esc(label)}">${STEPS.map((x, i) => `<i class="${[i < at ? 'on' : i === at ? 'now' : '', x.ms ? 'ms' : ''].filter(Boolean).join(' ')}"></i>`).join('')}</span>`);
49
+ const clock = (when) => (when ? `<span class="hv-st">${svg(P.clock, 13)}${esc(String(when).split(' ')[0])}</span>` : '');
50
+ /** A row of the list: a next step, a task, a note, a mention, a session or a meeting. o: { sel, kid } */
33
51
  export function rowHtml(r, o) {
34
52
  const sel = o.sel === r.id;
35
- const cls = ['hm-r', 'lr', o.kid ? 'kid' : '', sel ? 'sel' : '', 'st-' + (r.state || 'quiet'), r.kind === 'task' ? 'task' : '', r.kind === 'item' ? 'item' : '', r.done ? 'done' : ''].filter(Boolean).join(' ');
36
- const hint = r.hint || '';
37
- const quiet = r.kind === 'task' || r.kind === 'item' || r.kind === 'meeting' || r.kind === 'finished' || r.state === 'quiet' || r.state === 'wait';
38
- let lead = '';
39
- if (r.check || (r.kind === 'task' && r.mine)) lead = `<button type="button" class="hm-ck" data-hm-check="${esc(r.id)}" aria-label="Mark ${esc(r.name)} done" title="Done"><span class="ut-chk${r.done ? ' on' : ''}">${r.done ? svg(P.check, 12) : ''}</span></button>`;
40
- else if (r.kind === 'task') lead = '<span class="hm-ck wait" aria-hidden="true"><i></i></span>';
41
- else if (r.done) lead = `<span class="hm-ck wait" aria-hidden="true"><span class="ut-chk on">${svg(P.check, 12)}</span></span>`;
42
- const dot = lead ? '' : `<i class="hm-dot ${dotOf(r.state)}" aria-hidden="true"></i>`;
43
- const tile = lead || o.kid ? '' : tileHtml(r, o);
44
- const end = r.kind === 'session' && r.sid ? `<button type="button" class="hm-x" data-hm-end="${esc(r.id)}" aria-label="End ${esc(r.name)}" title="End this session">${svg(P.x, 14)}</button>`
45
- : r.kind === 'need' && r.row && r.row.kind !== 'source' ? `<button type="button" class="hm-x" data-hm-end="${esc(r.id)}" aria-label="Put off ${esc(r.name)} until tomorrow" title="Put off until tomorrow">${svg(P.x, 14)}</button>` : '';
46
- const right = r.link && r.kind === 'loose-rec' ? '<span class="hm-rr">Link it</span>' : '';
47
- return `<div class="${cls}" data-id="${esc(r.id)}">${lead}<button type="button" class="hm-rm" data-hm-sel="${esc(r.id)}"${sel ? ' aria-current="true"' : ''}>${dot}${tile}`
48
- + `<span class="hm-rt"><b>${esc(r.name)}</b>${hint ? `<em${quiet ? ' class="q"' : ''}>${esc(hint)}</em>` : ''}</span>${right}</button>${end}</div>`;
53
+ const cls = ['hm-r', 'hv-r', o.kid ? 'kid' : '', sel ? 'sel' : '', 'st-' + (r.state || 'quiet'), r.kind === 'task' ? 'task' : '', r.kind === 'item' ? 'item' : '', r.done ? 'done' : ''].filter(Boolean).join(' ');
54
+ const lead = isCheck(r) ? checkHtml(r) : '';
55
+ // ending a session and putting a next step off stay on the row, shown on the row that is open (the frame draws neither)
56
+ const end = !sel ? '' : r.kind === 'session' && r.sid ? `<button type="button" class="ut-ib hm-x" data-hm-end="${esc(r.id)}" aria-label="End ${esc(r.name)}" title="End this session">${svg(P.x, 14)}</button>`
57
+ : r.kind === 'need' && r.row && r.row.kind !== 'source' ? `<button type="button" class="ut-ib hm-x" data-hm-end="${esc(r.id)}" aria-label="Put off ${esc(r.name)} until tomorrow" title="Put off until tomorrow">${svg(P.x, 14)}</button>` : '';
58
+ const link = r.link && r.kind === 'loose-rec' ? '<span class="hv-st">Link it</span>' : '';
59
+ return `<div class="${cls}" data-id="${esc(r.id)}">${lead}<button type="button" class="hm-rm" data-hm-sel="${esc(r.id)}"${sel ? ' aria-current="true"' : ''}${r.hint ? ` title="${esc(r.hint)}"` : ''}>${lead ? '' : markHtml(r)}`
60
+ + `<span class="hm-rt"><b>${esc(r.name)}</b></span>${clock(r.when || whenOf(r))}${link}</button>${end}</div>`;
61
+ }
62
+ /** The chat's header line on a desktop (HvACDesk .ch): the open row's mark, its title and the chip of where it sits (the initiative's stage
63
+ * track and name, or the program's tile and name). h: { row, title, scope, at, stage, prog }. A chip that repeats the title is left out, and
64
+ * the initiative's own chat shows its track after the title instead (say it once). */
65
+ export function chatHeadHtml(h) {
66
+ if (!h || !h.title) return '';
67
+ const r = h.row;
68
+ const mk = !r ? '' : isCheck(r) ? `<span class="hv-mk"><span class="hv-ck${r.late ? ' late' : ''}" role="img" aria-label="${r.late ? 'Task, late' : 'Task'}"></span></span>` : markHtml(r.kind === 'ini' && r.yours && r.state !== 'blocked' ? { state: 'needs' } : r);
69
+ const lead = h.prog ? `<span class="hv-tl tp sm" aria-hidden="true">${svg(P.layers, 13)}</span>` : '';
70
+ const same = !h.scope || h.scope === h.title;
71
+ const chip = same ? '' : `<span class="hm-chs" title="In ${esc(h.scope)}">${h.prog ? svg(P.layers, 13) : track(h.at == null ? -1 : h.at, h.stage || '')}<span>${esc(h.scope)}</span></span>`;
72
+ return `${mk}${same ? lead : ''}<b class="hm-chb">${esc(h.title)}</b>${same && !h.prog ? track(h.at == null ? -1 : h.at, h.stage || '') : ''}${chip}`;
49
73
  }
50
- /** An initiative row: the chevron opens what sits under it, the title opens the initiative. */
74
+ /** An initiative row: its mark, its title, the count of what is yours while it is folded, the stage track, and a chevron when something
75
+ * sits under it. The title opens the initiative; the chevron shows or hides its sessions, next steps, tasks and meetings. */
51
76
  function iniHtml(r, o) {
52
77
  const open = o.isOpen(r.id);
53
78
  const all = o.tasksOpen ? o.tasksOpen(r.id) : false, hid = r.kids.filter((k) => k.extra).length;
54
79
  const kids = all ? r.kids : r.kids.filter((k) => !k.extra);
55
- const more = hid ? `<button type="button" class="hm-more2" data-hm-tasks="${esc(r.id)}" aria-expanded="${all}">${all ? 'Show fewer tasks' : `Show ${hid} more ${hid === 1 ? 'task' : 'tasks'}`}</button>` : '';
56
- const nest = open ? `<div class="hm-nest" role="group" aria-label="In ${esc(r.name)}">${kids.map((k) => rowHtml(k, { ...o, kid: true })).join('') || '<p class="hm-none">Nothing today.</p>'}${more}</div>` : '';
57
- return `<div class="hm-r lr ini st-${esc(r.state)}${o.sel === r.id ? ' sel' : ''}" data-id="${esc(r.id)}"><button type="button" class="hm-tg" data-hm-kids="${esc(r.id)}" aria-expanded="${open}" aria-label="${open ? 'Hide' : 'Show'} what is in ${esc(r.name)}">${svg(open ? P.chevD : P.chevR, 14)}</button>`
58
- + `<button type="button" class="hm-rm" data-hm-sel="${esc(r.id)}"><span class="hm-rt"><b>${esc(r.name)}</b><em class="q">${esc(r.hint)}</em></span><span class="hm-rr${r.turn ? '' : ' q'}">${esc(r.right)}</span></button></div>${nest}`;
80
+ const more = hid ? `<button type="button" class="hv-fold kid" data-hm-tasks="${esc(r.id)}" aria-expanded="${all}"><span class="hv-mk"></span>${all ? 'Fewer' : hid + ' more'}${svg(all ? P.chevU : P.chevD, 15)}</button>` : '';
81
+ const nest = open ? `<div class="hm-nest" role="group" aria-label="In ${esc(r.name)}">${kids.map((k) => rowHtml(k, { ...o, kid: true })).join('')}${more}</div>` : '';
82
+ const badge = !open && r.yours ? `<span class="hv-c" role="img" aria-label="${r.yours === 1 ? '1 is yours' : r.yours + ' are yours'}">${r.yours}</span>` : '';
83
+ const chev = r.kids.length ? `<button type="button" class="hv-xc" data-hm-kids="${esc(r.id)}" aria-expanded="${open}" aria-label="${open ? 'Hide' : 'Show'} what is in ${esc(r.name)}">${svg(open ? P.chevD : P.chevR, 15)}</button>` : '<span class="hv-xc" aria-hidden="true"></span>';
84
+ return `<div class="hm-r hv-r ini st-${esc(r.state)}${o.sel === r.id ? ' sel' : ''}" data-id="${esc(r.id)}"><button type="button" class="hm-rm" data-hm-sel="${esc(r.id)}" title="${esc(r.hint)}">${markHtml(r.yours && r.state !== 'blocked' ? { state: 'needs' } : r)}`
85
+ + `<span class="hm-rt"><b>${esc(r.name)}</b></span>${badge}${track(r.at, r.stage)}</button>${chev}</div>${nest}`;
59
86
  }
60
87
 
61
- /* ── a group ── */
88
+ /* ── a group (HvAC .pg, .card; PgHomePhone .psub) ── */
89
+ const dots = (g) => (g.goals && g.goals.n ? `<span class="hv-gd" role="img" aria-label="${esc(g.goals.text)}">${g.goals.dots.map((ok) => `<i${ok ? '' : ' class="off"'}></i>`).join('')}</span>` : '');
90
+ const nd = (g) => (g.yours ? '<span class="hv-nd"></span>' : g.late ? '<span class="hv-nd am"></span>' : '');
91
+ const yoursWords = (g) => (g.yours ? (g.yours === 1 ? '1 is yours' : g.yours + ' are yours') : '');
62
92
  function productHtml(g, o) {
63
93
  const open = o.pOpen(g);
64
- const head = open
65
- ? `<div class="hm-ghr2"><button type="button" class="hm-ghd" data-hm-pg="${esc(g.key)}" aria-expanded="true" aria-label="${esc(g.name)}: ${esc(g.goals ? g.goals.text : g.closedLine)}. Close the group">${esc(g.name)}</button>`
66
- + (g.goals ? (g.primary ? `<button type="button" class="hm-gn" data-hm-prod aria-label="${esc(g.goals.text)}. Open the product">${esc(g.goals.text)}</button>` : `<span class="hm-gn">${esc(g.goals.text)}</span>`) : `<span class="hm-gn">${esc(g.closedLine)}</span>`) + '</div>'
67
- : `<button type="button" class="hm-ghd" data-hm-pg="${esc(g.key)}" aria-expanded="false">${svg(P.chevR, 14)}${esc(g.name)}<span class="n">${esc(g.closedLine)}</span></button>`;
68
- if (!open) return `<section class="hm-pg" aria-label="${esc(g.name)}">${head}</section>`;
94
+ // open: the goal dots; folded: the tile's dot says something in it is yours (blue) or late (amber). No counts in words (HvAC)
95
+ const say = [g.name, open ? (g.goals && g.goals.n ? g.goals.text : '') : [plural(g.count, 'initiative', 'initiatives'), yoursWords(g)].filter(Boolean).join(', ')].filter(Boolean).join(', ');
96
+ const head = `<button type="button" class="hv-gh${open ? '' : ' closed'}" data-hm-pg="${esc(g.key)}" aria-expanded="${open}" aria-label="${esc(say)}. ${open ? 'Close' : 'Open'} the group">`
97
+ + `<span class="hv-tl t${g.tone}" aria-hidden="true" data-cz-rail-tile="${esc(g.key)}" data-cz-rail-name="${esc(g.name)}">${esc(g.initials)}${open ? '' : nd(g)}</span><b>${esc(g.name)}</b>${open ? dots(g) : ''}<span class="hv-cv">${svg(open ? P.chevD : P.chevR, 16)}</span></button>`;
98
+ if (!open) return `<section class="hm-pg hv-g" aria-label="${esc(g.name)}">${head}</section>`;
69
99
  const pinned = (x) => (o.pin.has(x.key) ? 0 : 1);
70
100
  const flat = g.flat.slice().sort((a, b) => pinned(a) - pinned(b)).map((r) => rowHtml(r, o)).join('');
71
101
  const QUIET = 3;
@@ -73,14 +103,38 @@ function productHtml(g, o) {
73
103
  const rest = restAll ? g.rest : g.rest.slice(0, Math.max(0, QUIET - g.inis.length));
74
104
  const more = g.rest.length - rest.length;
75
105
  const body = flat + g.inis.concat(rest).map((r) => iniHtml(r, o)).join('')
76
- + (more > 0 ? `<button type="button" class="hm-more2" data-hm-rest="${esc(g.key)}">${more} more ${more === 1 ? 'initiative' : 'initiatives'} with nothing today · Show</button>`
77
- : restAll && g.rest.length > QUIET ? `<button type="button" class="hm-more2" data-hm-rest="${esc(g.key)}">Show fewer</button>` : '');
78
- return `<section class="hm-pg" aria-label="${esc(g.name)}">${head}${body || `<p class="hm-none">${g.primary ? 'No initiative is open on this board.' : 'Nothing is open here.'}</p>`}</section>`;
106
+ + (more > 0 ? `<button type="button" class="hv-fold" data-hm-rest="${esc(g.key)}" aria-expanded="false" aria-label="${more} more ${more === 1 ? 'initiative' : 'initiatives'} with nothing today. Show"><span class="hv-mk"></span>${more} more${svg(P.chevD, 16)}</button>`
107
+ : restAll && g.rest.length > QUIET ? `<button type="button" class="hv-fold" data-hm-rest="${esc(g.key)}" aria-expanded="true"><span class="hv-mk"></span>Fewer${svg(P.chevU, 16)}</button>` : '');
108
+ return `<section class="hm-pg hv-g" aria-label="${esc(g.name)}">${head}<div class="hv-card">${body || `<p class="hm-none">${g.primary ? 'No initiative is open on this board.' : 'Nothing is open here.'}</p>`}</div></section>`;
79
109
  }
110
+ /** A program's group (canvas PgHomePhone, PgHomeDesk): above the products. Its header: the program tile, the name, the next milestone's
111
+ * diamond with its date and one small diamond per initiative it waits on (filled when that initiative is past the Deliver milestone), a chevron.
112
+ * The title opens the program panel on the Board; the chevron folds the group. Inside: the program's own tasks first, then a sub-heading
113
+ * per product with that product's initiatives. */
114
+ function programHtml(g, o) {
115
+ const open = o.pOpen(g);
116
+ const nx = g.st && g.st.next;
117
+ const ms = nx ? `<span class="hv-msd${nx.late ? ' late' : ''}"><span class="hv-dm"></span>${esc(nx.day || nx.name)}${nx.n ? `<span class="hv-rd">${Array.from({ length: nx.n }, (_, i) => `<i${i < nx.ready ? ' class="on"' : ''}></i>`).join('')}</span>` : ''}</span>` : '';
118
+ const line = nx ? 'Next milestone ' + nx.name + (nx.day ? ', ' + nx.day : '') + (nx.late ? ', late' : '') + (nx.n ? ', ' + nx.ready + ' of ' + nx.n + (nx.n === 1 ? ' initiative' : ' initiatives') + ' ready' : '') : 'No open milestone';
119
+ const head = `<div class="hv-gh hv-prg${open ? '' : ' closed'}"><button type="button" class="hv-pt" data-hm-prog="${esc(g.program.id)}" aria-label="Open ${esc(g.name)}, a program">`
120
+ + `<span class="hv-tl tp" aria-hidden="true" data-cz-rail-tile="${esc(g.key)}" data-cz-rail-name="${esc(g.name)}">${svg(P.layers, 16)}${open ? '' : nd(g)}</span><b>${esc(g.name)}</b></button>`
121
+ + `<button type="button" class="hv-pf" data-hm-pg="${esc(g.key)}" aria-expanded="${open}" aria-label="${esc(g.name)}. ${esc(line)}${g.yours ? '. ' + yoursWords(g) : ''}. ${open ? 'Close' : 'Open'} the group">${ms}<span class="hv-cv">${svg(open ? P.chevD : P.chevR, 16)}</span></button></div>`;
122
+ if (!open) return `<section class="hm-pg hv-g prg" aria-label="${esc(g.name)}">${head}</section>`;
123
+ const body = g.tasks.map((t) => rowHtml(t, o)).join('')
124
+ + g.subs.map((x) => `<div class="hv-psub" role="heading" aria-level="3"><span class="hv-st2 t${x.tone}" aria-hidden="true">${esc(x.initials)}</span>${esc(x.name)}</div>${x.inis.map((r) => iniHtml(r, o)).join('')}`).join('');
125
+ return `<section class="hm-pg hv-g prg" aria-label="${esc(g.name)}">${head}<div class="hv-card">${body}</div></section>`;
126
+ }
127
+ /** "Not in an initiative" (HvAC .lh): a line under the groups. Folded it shows a blue dot when a row waits on you, an amber square when one
128
+ * of your own is late, and the count; open, the rows in a card. */
80
129
  function looseHtml(g, o) {
81
130
  if (!g.rows.length) return '';
82
- return `<section class="hm-pg" aria-label="${esc(g.name)}"><div class="hm-ghd">${esc(g.name)}<span class="n">${g.n}</span></div>${g.rows.map((r) => rowHtml(r, o)).join('')}</section>`;
131
+ const open = o.pOpen(g), S2 = g.sig || {};
132
+ const say = [S2.sessions ? plural(S2.sessions, 'session', 'sessions') + (S2.needs ? ', ' + S2.needs + ' waits on you' : '') : S2.needs ? S2.needs + ' waits on you' : '', S2.tasks ? plural(S2.tasks, 'task', 'tasks') + (S2.late ? ', ' + S2.late + ' late' : '') : ''].filter(Boolean).join('; ') || String(g.n);
133
+ const sig = open ? '' : (S2.needs ? '<span class="hv-d sm" aria-hidden="true"></span>' : '') + (S2.late ? '<span class="hv-lt" aria-hidden="true"></span>' : '') + g.n;
134
+ return `<section class="hm-pg hv-g loose" aria-label="${esc(g.name)}"><button type="button" class="hv-lh" data-hm-pg="${esc(g.key)}" aria-expanded="${open}" aria-label="${esc(g.name)}: ${esc(say)}. ${open ? 'Close' : 'Open'}">${esc(g.name)}<span class="n">${sig}${svg(open ? P.chevD : P.chevR, 15)}</span></button>`
135
+ + (open ? `<div class="hv-card">${g.rows.map((r) => rowHtml(r, o)).join('')}</div>` : '') + '</section>';
83
136
  }
137
+ const plural = (n, one, many) => n + ' ' + (n === 1 ? one : many);
84
138
 
85
139
  /* ── the Today card ── */
86
140
  /** The card's HTML. T is todayCard(); greet the greeting; sub the line under it when the day has no meeting. */
@@ -115,33 +169,57 @@ export function todayHtml(T, o) {
115
169
  }
116
170
 
117
171
  /* ── the whole column ── */
118
- /** M is homeList(); T todayCard(); o: { sel, isOpen, pOpen, restOpen, pin, avHtml, ready, err, product (the picked key), review, sub, phone } */
172
+ const MONTH = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
173
+ const WEEKDAY = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
174
+ const MOMENT = new Set(['rec', 'soon', 'live', 'eod', 'review']);
175
+ /** M is homeList(); T todayCard(); o: { sel, isOpen, pOpen, restOpen, pin, avHtml, ready, err, product (the picked key), review, phone, day (Your day is open) } */
119
176
  export function listHtml(M, T, o) {
120
177
  const many = M.products.length > 1;
121
178
  const picked = o.product ? M.products.find((p) => p.key === o.product) : null;
122
- const head = `<div class="hm-hd"><h1>Today</h1>`
123
- + (many ? `<button type="button" class="cz-pick hm-pk" data-hm-pick aria-haspopup="menu" aria-expanded="false">${esc(picked ? picked.name : 'All products')} ${svg(P.chevD, 14)}</button><button type="button" class="ut-ib" data-hm-new aria-haspopup="menu" aria-label="New" title="New">${svg(P.plus, 16)}</button>`
124
- : `<button type="button" class="hm-new" data-hm-new aria-haspopup="menu">${svg(P.plus, 14)}New</button>`) + '</div>';
125
- const card = todayHtml(T, { greet: M.greet, sub: o.sub, phone: o.phone });
126
- // Kept and Done, on a desktop only: a phone shows the list itself (testing fixes)
127
- const flt = `<div class="hm-flt dk" role="group" aria-label="Show">${M.filters.map((f) => `<button type="button" class="cz-chip${f.key === M.filter ? ' on' : ' gh'}" data-hm-filter="${f.key}" aria-pressed="${f.key === M.filter}">${esc(f.label)}${f.n ? ' ' + f.n : ''}</button>`).join('')}</div>`;
179
+ const flt = M.filter !== 'today' ? M.filters.find((f) => f.key === M.filter) : null;
180
+ const head = `<div class="hm-hd hv-bar"><button type="button" class="hv-hi" data-hm-day aria-expanded="${!!o.day}" aria-label="${esc(M.word || 'Today')}. Open your day"><b>${esc(M.word || 'Today')}</b>${svg(P.chevD, 18)}</button>`
181
+ + (many ? `<button type="button" class="hv-pk" data-hm-pick aria-haspopup="menu" aria-expanded="false" aria-label="Switch product">${esc(picked ? picked.name : 'All')}${svg(P.chevD, 14)}</button>` : '')
182
+ + (o.phone ? '' : `<button type="button" class="ut-ib hv-ib${flt ? ' on' : ''}" data-hm-flt aria-haspopup="menu" aria-label="Show: Today, Kept or Done${flt ? '. Now ' + esc(flt.label) : ''}" title="Show: Today, Kept or Done">${svg(P.filter, 18)}</button>`)
183
+ + `<button type="button" class="ut-ib hv-ib" data-hm-new aria-haspopup="menu" aria-label="New" title="New">${svg(P.plus, 20)}</button></div>`
184
+ + (M.yours ? `<p class="hv-sub">${M.yours} ${M.yours === 1 ? 'is' : 'are'} yours</p>` : '');
185
+ // the Today card only while the day has a moment; the plain day (its meetings and load) is in Your day
186
+ const card = MOMENT.has(T.mode) ? todayHtml(T, { greet: M.greet, sub: '', phone: o.phone }) : '';
128
187
  if (!o.ready) return head + card + '<p class="hm-none" role="status">Reading your work.</p>';
129
188
  const errLine = `<p class="hm-none" role="status">Home could not read the repository: ${esc(o.err)}.</p>`;
130
189
  if (o.err && !M.groups.some((g) => (g.kind === 'product' && g.count) || (g.rows && g.rows.length))) return head + card + errLine;
131
190
  // the repository's read failed but sessions or notes still answered: say so above what did come back, never an empty product as if calm
132
191
  let body = o.err && !M.groups.some((g) => g.kind === 'product' && (g.count || g.flat.length)) ? errLine : '';
133
192
  if (M.list) {
134
- body = `<section class="hm-pg" aria-label="${esc(M.list.title)}"><div class="hm-ghd">${esc(M.list.title)}<span class="n">${M.list.rows.length || ''}</span></div>`
135
- + (M.list.rows.map((r) => rowHtml(r, o)).join('') || `<p class="hm-none">${esc(M.list.empty)}</p>`) + '</section>';
193
+ body = `<section class="hm-pg hv-g" aria-label="${esc(M.list.title)}"><div class="hv-lh">${esc(M.list.title)}<span class="n">${M.list.rows.length || ''}</span></div>`
194
+ + `<div class="hv-card">${M.list.rows.map((r) => rowHtml(r, o)).join('') || `<p class="hm-none">${esc(M.list.empty)}</p>`}</div></section>`;
136
195
  } else {
137
- const R = o.review;
138
- if (R && R.open) body += `<section class="hm-pg" aria-label="This week"><div class="hm-ghd">This week<span class="n">Fri</span></div><div class="hm-r lr${o.sel === 'review' ? ' sel' : ''}" data-id="review"><button type="button" class="hm-rm" data-hm-review><span class="hm-tile wk">${svg(P.check, 16)}</span><span class="hm-rt"><b>Weekly review</b><em>${R.started ? 'Step ' + (R.at + 1) + ' of 4' : 'Four short steps'}</em></span></button></div></section>`;
139
- body += M.groups.map((g) => (g.kind === 'product' ? productHtml(g, o) : looseHtml(g, o))).join('');
140
- if (!M.groups.some((g) => (g.kind === 'product' && (g.count || g.flat.length)) || (g.rows && g.rows.length))) body += '<p class="hm-none">Nothing is open. A new initiative or a task you add shows here.</p>';
196
+ body += M.groups.map((g) => (g.kind === 'product' ? productHtml(g, o) : g.kind === 'program' ? programHtml(g, o) : looseHtml(g, o))).join('');
197
+ if (!M.groups.some((g) => (g.kind === 'product' && (g.count || g.flat.length)) || g.kind === 'program' || (g.rows && g.rows.length))) body += '<p class="hm-none">Nothing is open. A new initiative or a task you add shows here.</p>';
141
198
  // the capture box shows only after New → A task → Not in an initiative (o.cap); an initiative's task is added in its Tasks view
142
199
  if (o.cap) body += `<form class="hm-cap" id="hmCapF"><label class="vh" for="hmCap">Add a task to your own list</label><input id="hmCap" autocomplete="off" maxlength="250" placeholder="A task for your own list. Esc to cancel">`
143
200
  + (o.mic ? `<button type="button" class="ut-ib" data-hm-capmic aria-label="Say it instead" title="Say it instead">${svg(P.mic, 16)}</button>` : '') + '</form>';
144
- if (M.untouched.n) body += `<button type="button" class="hm-un" data-hm-review><b>Untouched 14+ days · ${M.untouched.n}</b><span>Weekly review ${esc(M.untouched.day)}</span></button>`;
145
201
  }
146
- return head + card + flt + body;
202
+ return head + card + `<div class="hv-body">${o.top || ''}${body}</div>`; // o.top: the pinned recording row and Mentions (home-rec-row.js, home-mentions.js)
203
+ }
204
+ /** Your day (HvAOpen): a sheet over the list from "Good morning". The date, the day's meetings and their load (a press opens the calendar,
205
+ * or the day's moment card on a phone), Your move with its count, This week with the Weekly review (and the untouched work it looks at).
206
+ * M is homeList(); T todayCard(); R reviewModel(); o: { sel, now } */
207
+ export function dayHtml(M, T, R, o) {
208
+ const d = new Date(o.now || Date.now());
209
+ const date = WEEKDAY[d.getDay()] + ' ' + d.getDate() + ' ' + MONTH[d.getMonth()];
210
+ const Ld = T.load || null;
211
+ const load = Ld && Ld.n ? `<button type="button" class="hv-day" data-hm-tc="cal" aria-label="${esc(Ld.sub)}. ${o.phone ? 'Open your day' : 'Open the calendar'}"><span class="sub">${esc(Ld.sub)}</span>`
212
+ + `<span class="hm-load" aria-hidden="true">${Ld.segs.map((x) => `<i class="${x.m ? 'm' : ''}${x.now ? ' n' : ''}" data-f="${Math.max(1, x.flex)}"></i>`).join('')}</span><span class="hm-lx" aria-hidden="true"><span>09</span><span>12</span><span>15</span><span>18</span></span></button>` : '';
213
+ const clear = T.mode === 'clear' ? `<p class="hv-clear" role="status">${esc(T.line)}</p>` : '';
214
+ const row = (r) => `<div class="hm-r hv-r two${o.sel === r.id ? ' sel' : ''}" data-id="${esc(r.id)}"><button type="button" class="hm-rm" data-hm-sel="${esc(r.id)}">`
215
+ + `<span class="hv-mk">${r.check ? `<span class="hv-ck${r.late ? ' late' : ''}" role="img" aria-label="Your task${r.late ? ', late' : ''}"></span>` : `<span class="hv-d${r.state === 'blocked' ? ' am' : ''}" role="img" aria-label="${r.state === 'blocked' ? 'Blocked, waits on you' : 'Waits on you'}"></span>`}</span>`
216
+ + `<span class="hm-rt"><b>${esc(r.name)}</b>${r.when ? `<em>${svg(P.clock, 13)} ${esc(r.when)}</em>` : r.sub ? `<em>${esc(r.sub)}</em>` : ''}</span></button></div>`;
217
+ const move = M.move.length ? `<div class="hv-sh">Your move<span class="r">${M.move.length}</span></div><div class="hv-card">${M.move.map(row).join('')}</div>` : '';
218
+ const un = M.untouched && M.untouched.n;
219
+ const rsub = R && R.started && !R.done ? 'Step ' + (R.at + 1) + ' of 4' : [un ? 'Untouched 14+ days' : '', M.untouched ? M.untouched.day : 'Fri'].filter(Boolean).join(' · ');
220
+ const week = `<div class="hv-sh">This week</div><div class="hv-card"><div class="hm-r hv-r two${o.sel === 'review' ? ' sel' : ''}" data-id="review"><button type="button" class="hm-rm" data-hm-review aria-label="Weekly review: ${esc(rsub)}. Open">`
221
+ + `<span class="hv-mk">${svg(P.calendar, 16)}</span><span class="hm-rt"><b>Weekly review</b><em>${esc(rsub)}</em></span><span class="hv-cv">${svg(P.chevR, 16)}</span></button></div></div>`;
222
+ return `<button type="button" class="hv-scrim" data-hm-dayx tabindex="-1" aria-label="Close your day"></button><section class="hv-sheet" role="dialog" aria-label="Your day" tabindex="-1"><div class="hv-grab" aria-hidden="true"></div>`
223
+ + `<div class="hv-sbar"><b>Your day</b><button type="button" class="ut-ib hv-ib" data-hm-dayx aria-label="Close" title="Close">${svg(P.x, 20)}</button></div>`
224
+ + `<div class="hv-sc"><div class="hv-sh">${esc(date)}</div>${load}${clear}${move}${week}</div></section>`;
147
225
  }