create-pmos 0.426.0 → 0.428.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 (78) hide show
  1. package/package.json +25 -25
  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-programs-test.js +16 -2
  7. package/workspace/briefing-premium-board-test.js +25 -20
  8. package/workspace/briefing-premium-test.js +2 -1
  9. package/workspace/changelog.json +24 -0
  10. package/workspace/guide/briefing-premium.md +4 -2
  11. package/workspace/guide/claude-proposes.md +3 -1
  12. package/workspace/guide/home.md +32 -7
  13. package/workspace/guide/programs.md +1 -0
  14. package/workspace/home-other-product-test.js +12 -2
  15. package/workspace/lib/context-use.js +54 -0
  16. package/workspace/lib/routes-live.js +3 -1
  17. package/workspace/lib/routes-meeting-material.js +22 -1
  18. package/workspace/lib/settings-store.js +14 -0
  19. package/workspace/lib/transcript-read.js +9 -2
  20. package/workspace/milestone-pins-test.js +13 -0
  21. package/workspace/milestone-suggest-test.js +10 -4
  22. package/workspace/package-lock.json +2 -2
  23. package/workspace/package.json +1 -1
  24. package/workspace/premium-board-actions-test.js +40 -13
  25. package/workspace/premium-rec-tab-test.js +8 -0
  26. package/workspace/premium-vw-item-test.js +7 -3
  27. package/workspace/premium-vw-jira-test.js +2 -1
  28. package/workspace/program-charter-test.js +1 -1
  29. package/workspace/program-leave-test.js +2 -2
  30. package/workspace/program-order-test.js +3 -2
  31. package/workspace/program-panel-test.js +2 -1
  32. package/workspace/public/pm/bd-acts.js +20 -26
  33. package/workspace/public/pm/bd-ini-panel.js +90 -32
  34. package/workspace/public/pm/bd-pin-card.js +4 -1
  35. package/workspace/public/pm/bd-span.js +22 -12
  36. package/workspace/public/pm/cozy-home.css +7 -0
  37. package/workspace/public/pm/cozy-live-pill.css +1 -0
  38. package/workspace/public/pm/cozy-live-pill.js +2 -1
  39. package/workspace/public/pm/cozy-rec-tab.js +12 -3
  40. package/workspace/public/pm/cozy-today.css +3 -0
  41. package/workspace/public/pm/cozy-viewer.js +157 -23
  42. package/workspace/public/pm/cozy-vw-shell.css +13 -0
  43. package/workspace/public/pm/cozy.css +6 -0
  44. package/workspace/public/pm/ctx-wedge.js +45 -0
  45. package/workspace/public/pm/hi-pop.css +82 -0
  46. package/workspace/public/pm/hi-pop.js +65 -0
  47. package/workspace/public/pm/home-app.js +70 -28
  48. package/workspace/public/pm/home-chat.js +7 -2
  49. package/workspace/public/pm/home-data.js +2 -1
  50. package/workspace/public/pm/home-ini.css +6 -76
  51. package/workspace/public/pm/home-ini.js +50 -68
  52. package/workspace/public/pm/home-list.js +29 -3
  53. package/workspace/public/pm/home-today.js +26 -9
  54. package/workspace/public/pm/ini-more.js +67 -0
  55. package/workspace/public/pm/ini-view-model.js +3 -2
  56. package/workspace/public/pm/ini-view.css +3 -1
  57. package/workspace/public/pm/ini-view.js +7 -5
  58. package/workspace/public/pm/live-model.js +1 -1
  59. package/workspace/public/pm/order-model.js +85 -0
  60. package/workspace/public/pm/premium-board.js +57 -11
  61. package/workspace/public/pm/premium-insights.js +11 -1
  62. package/workspace/public/pm/premium-vw-item.js +3 -1
  63. package/workspace/public/pm/premium-vw-jira.js +2 -0
  64. package/workspace/public/pm/prog-order.js +15 -2
  65. package/workspace/public/pm/sort-order.css +17 -0
  66. package/workspace/public/pm/sort-order.js +108 -0
  67. package/workspace/public/pm/tk-view.js +3 -2
  68. package/workspace/public/pm/wf-page.js +1 -1
  69. package/workspace/public/premium-board.html +1 -0
  70. package/workspace/server.js +28 -0
  71. package/workspace/sort-order-test.js +201 -0
  72. package/workspace/stage-card-test.js +1 -0
  73. package/workspace/task-card-test.js +1 -1
  74. package/workspace/test-lists/batch13-context-use.json +5 -0
  75. package/workspace/test-lists/sort-order.json +6 -0
  76. package/workspace/test-lists/viewer-trail.json +5 -0
  77. package/workspace/tk-tasks-test.js +5 -3
  78. package/workspace/viewer-trail-test.js +145 -0
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * mount(o) once, from premium-board.js. o: { M() the model, statusOf(r), fmt(iso), md(date), ago(iso), grill(id) the open first
5
5
  * questions, usual(track) the usual days in the step, rowOf(key), pageHref(r), askHref(r, q), refreshJira(), send(r) the
6
- * Send to Jira sheet, acts(r, btn) the row actions popover, grillOpen(r, btn), onShow(key, from) / onHide() so the page
6
+ * Send to Jira sheet, moreAct(r, k, btn) a stage press of ⋯ (bd-acts.js), grillOpen(r, btn), onShow(key, from) / onHide() so the page
7
7
  * marks the row the item came from, programOf(r) the program it is in or null, openProgram(id, btn), turnProgram(r)
8
8
  * "Turn into a program", moveItems(r) Move out of its program and Move to another (pm/prog-move.js), smItems(r) and
9
9
  * smPress(r, act, btn) Split into a new initiative and Merge into (pm/split-merge.js), openIniId(id) a row by its record id, setTask(r, uid, state) a task's state, setDates(r, uid, { start?, due? }) its days (the Tasks
@@ -16,8 +16,9 @@
16
16
  * openTicket(r, k) the ticket as a drill-in, in the one ticket Viewer (tk-view.js): ← goes back to the initiative; the summary says what blocks it and what that delays
17
17
  * refresh() draws the shown item again after a new read, in place · close() · shown() → the key of the initiative shown, or null
18
18
  *
19
- * What has no place on the view is under ⋯ in the shell's order: change it (move, hold, cancel or archive; the plan dates), look back (read
20
- * Jira again), then link and copy. "Open in full" (the initiative page) is the shell's own ⋯ item. Discuss in chat takes the question to Home. */
19
+ * What has no place on the view is under ⋯: the ONE initiative menu (pm/ini-more.js, feedback batch 14 item 5), the same words and order as
20
+ * Home's initiative page. Its stage presses (Move back a stage, Move to a stage, Put on hold, Cancel) are the row menu's own (moreAct(r, k, btn),
21
+ * bd-acts.js); Change workflow, Won't do and Archive are Home's (ini-wf.js). Discuss in chat takes the question to Home. */
21
22
  import * as VW from './cozy-viewer.js';
22
23
  import { esc } from './premium-shell.js';
23
24
  import { lr, copyText } from './cozy-xv.js';
@@ -25,6 +26,11 @@ import { iniView } from './ini-view-model.js';
25
26
  import { rowFor } from './ini-versions.js'; // planned versus actual (batch 11 item 8): Live or the draft the PM shows, with the plan line
26
27
  import { viewHtml, wireView } from './ini-view.js';
27
28
  import * as TV from './tk-view.js';
29
+ import { pmGet, pmPost } from './http.js';
30
+ import * as MD from './home-ini-model.js'; // the stage move's rules, as Home reads them (Moves on by itself, Move back a stage)
31
+ import * as WF from './ini-wf.js'; // D99: Change workflow, Won't do, Back to Triage, Archive, the same popovers as Home's
32
+ import { openPop, closePop, undoToast, ensureCss as ensurePopCss } from './hi-pop.js';
33
+ import { iniMore as iniMoreOf, iniText } from './ini-more.js'; // the one initiative ⋯ menu (batch 14 item 5)
28
34
 
29
35
  let O = null;
30
36
  let cur = null; // { key, tk } the initiative shown, and its ticket while the drill-in is shown
@@ -32,7 +38,6 @@ let adding = null; // the key of the initiative whose inline Add a task is open
32
38
  let addTo = ''; // the stage a task added there finishes (the Board's Next cell: "Add what finishes <stage>")
33
39
  let addDates = null; // the start and due a task added there takes (a gap's + on the timeline, batch 11 item 13)
34
40
  const TI = (r) => (r && r.trail) || null;
35
- const tkState = (k) => (k.blocked ? 'Blocked' + (k.reason ? ' by ' + k.reason.replace(/^Waiting on /i, '') : '') : k.status || 'To do');
36
41
  const jiraAt = () => { const J = (O.M() && O.M().jira) || {}; return J.readAt ? 'Jira · ' + O.ago(J.readAt) : ''; };
37
42
 
38
43
  /* ── the initiative: the one view ── */
@@ -58,32 +63,83 @@ function boardSections(r) {
58
63
  if (dr.length) S.push({ id: 'drift', title: 'Jira differs from the PRD', count: dr.length, render: () => driftHtml(dr) });
59
64
  return S;
60
65
  }
61
- /** ⋯ in the shell's order: change it, look back, then link and copy. Archive and cancel stay in the row actions, with their Undo. */
62
- function iniMore(r) {
63
- const more = [];
64
- if (r.acts) more.push({ label: 'Move, hold, cancel or archive', on: (b) => O.acts(r, b) });
65
- if (r.id) more.push({ label: 'Change the plan dates', on: () => location.assign(O.askHref(r, 'Propose new start and end dates for ' + r.title)) });
66
- // P7 (program-hierarchy PRD): an initiative in no program can become one; the chat cannot, because every program write is a page press
67
- if (r.id && O.turnProgram && !(O.programOf && O.programOf(r))) more.push({ label: 'Turn into a program', on: () => O.turnProgram(r) });
68
- // an initiative in a program can move out of it, or to another one (feedback batch 11 item 2, canvas LpA1More, LpA2Other; pm/prog-move.js)
69
- const mv = r.id && O.moveItems ? O.moveItems(r) : [];
70
- // split it into a new initiative, or merge it into another, above the program moves (batch 11 item 14, canvas XsmA1Menu; pm/split-merge.js)
71
- const sm = r.id && O.smItems ? O.smItems(r) : [];
72
- if (sm.length || mv.length) more.push({ sep: true }, ...sm, ...mv);
73
- if ((O.M() || {}).jira) more.push({ sep: true }, { label: 'Read Jira again', on: () => O.refreshJira() });
74
- more.push({ sep: true });
75
- if (r.id) more.push({ label: 'Copy link', on: () => copyText(new URL(O.pageHref(r), location.href).href, 'Link copied.') });
76
- more.push({ label: 'Copy as text', on: () => copyText(iniText(r), 'Copied as text.') });
77
- return more;
66
+ /* ── ⋯: the ONE initiative menu (pm/ini-more.js, feedback batch 14 item 5), the same words and order as Home's initiative page ── */
67
+ const LAY = new Map(); // the initiative's layout record (GET /api/initiative-layout): its own Moves on by itself, read when the panel opens
68
+ const ownWf = (r) => !!(r.wf && r.wf.id && r.wf.id !== 'product-feature' && Array.isArray(r.wfStages) && r.wfStage);
69
+ const where = (r) => { const B = (O.M() || {}).board || {}; return { ws: r.ws || B.ws, board: r.boardId || B.id }; };
70
+ async function readLay(r) {
71
+ if (!r.id || ownWf(r) || LAY.has(r.id)) return;
72
+ LAY.set(r.id, null);
73
+ const ws = where(r).ws, x = await pmGet('/api/initiative-layout?initiative=' + encodeURIComponent(r.id) + (ws ? '&ws=' + encodeURIComponent(ws) : '')).catch(() => null);
74
+ LAY.set(r.id, x && x.ok ? x : { auto: true, held: [] });
75
+ }
76
+ /** Where the row's stage can move, as Home reads it (home-ini-model.js moveModel): a workflow of the library moves between ITS stages. */
77
+ function moveOf(r) {
78
+ const a = r.acts || {}, acts = { stages: a.stages || [], stage: a.stage || '', self: !!((O.M() || {}).board || {}).self, life: a.life || null };
79
+ let L = LAY.get(r.id) || { auto: true, held: [] };
80
+ if (ownWf(r)) {
81
+ const st = r.wfStages.filter((s) => s.status !== 'skipped' || s.key === r.wfStage.key), cur = r.wfStages.find((s) => s.key === r.wfStage.key) || {};
82
+ Object.assign(acts, { stages: st.map((s) => s.name), stage: r.wfStage.name, msNames: st.filter((s) => s.milestone).map((s) => s.name), self: false });
83
+ L = { auto: !!cur.auto, held: [] };
84
+ }
85
+ if (r.ended) acts.life = 'ended';
86
+ return MD.moveModel(null, { acts }, L);
87
+ }
88
+ /** Moves on by itself for this one initiative: a library workflow's stage (POST /api/boards/ini-auto), else the layout record. */
89
+ async function setAuto(r, on) {
90
+ const res = ownWf(r) ? await pmPost('/api/boards/ini-auto', { ...where(r), id: r.id, stage: r.wfStage.key, auto: on }).catch(() => null)
91
+ : await pmPost('/api/initiative-layout', { ws: where(r).ws, initiative: r.id, kind: 'auto', on }).catch(() => null);
92
+ if (!res || res.ok === false) { O.toast((res && res.error) || 'Nothing was changed.'); return; }
93
+ if (!ownWf(r)) LAY.set(r.id, res);
94
+ O.toast('Moves on by itself: ' + (on ? 'on' : 'off') + ' · ' + r.title + '.');
95
+ if (O.reload) O.reload();
96
+ }
97
+ /** What ini-wf.js needs from the page (Change workflow, Won't do, Back to Triage, Archive): the popovers of pm/hi-pop.js, the Board's toast. */
98
+ function wfUi() {
99
+ const byId = (id) => ((O.M() || {}).rows || []).find((x) => x.id === id) || {};
100
+ return { openPop, closePop, undoToast: (t, undo) => O.toast(t, undo), toast: (t) => O.toast(t), pmGet, pmPost, load: async () => { if (O.reload) await O.reload(); },
101
+ row: byId, title: (id) => byId(id).title || id, bw: (id) => where(byId(id)) };
78
102
  }
79
- /** The initiative as plain text, for Copy as text: the summary, the stage and the open tasks. */
80
- function iniText(r) {
81
- const v = viewOf(r), s = v.summary, lines = [r.title, s.line + (s.right ? ' · ' + s.right : '')];
82
- if (s.text) lines.push(s.text);
83
- lines.push('', v.stage.name + (v.stage.n ? ' · ' + v.stage.n + ' of ' + v.stage.of : '') + (v.stage.doneOf ? ' · ' + v.stage.doneOf : ''));
84
- for (const sec of v.tasks.sections) for (const x of sec.top || []) lines.push('- ' + x.title + (x.sub ? ' · ' + x.sub : ''));
85
- for (const k of ((r.track && r.track.tickets) || []).filter((x) => x.status !== 'Done')) lines.push('- ' + k.key + ' ' + k.title + ' · ' + tkState(k) + (k.assignee ? ' · ' + k.assignee : ''));
86
- return lines.join('\n');
103
+ /** The stakeholder form, as Home's (POST /api/home-desk/stakeholder), a drill-in of the initiative: ← comes back to it. */
104
+ function addPerson(r) {
105
+ VW.drill();
106
+ const body = VW.open({ id: 'person:new', kind: 'Stakeholder', title: 'Add a stakeholder to ' + r.title, icon: 'info', back: true,
107
+ html: '<div class="hi-form"><label class="hi-field"><span>Name</span><input id="hpN" autocomplete="off"></label><label class="hi-field"><span>Role</span><input id="hpR" placeholder="e.g. Head of Sales"></label><label class="hi-field"><span>Note</span><input id="hpT" placeholder="What they care about"></label><div class="hi-acts"><button type="button" class="hi-btn dark" data-hp-add>Add</button></div></div>' });
108
+ setTimeout(() => { const i = body.querySelector('#hpN'); if (i) i.focus(); }, 0);
109
+ body.onclick = async (e) => {
110
+ if (!e.target.closest('[data-hp-add]')) return;
111
+ const name = body.querySelector('#hpN').value.trim(); if (!name) return;
112
+ const res = await pmPost('/api/home-desk/stakeholder', { ws: where(r).ws, initiative: r.id, name, role: body.querySelector('#hpR').value.trim(), note: body.querySelector('#hpT').value.trim() }).catch(() => null);
113
+ if (res && res.ok) { O.toast('Added ' + name + '.'); openIni(O.rowOf(r.key) || r); } else O.toast((res && res.error) || 'Not added.');
114
+ };
115
+ }
116
+ function iniMore(r) {
117
+ const M = O.M() || {}, a = r.acts || null, self = !!(M.board || {}).self, mv = moveOf(r), id = r.id;
118
+ const live = a && !a.life && !r.ended && !a.archived;
119
+ return iniMoreOf({
120
+ wf: id && !self && !r.ended ? { name: (r.wf || {}).name, on: (b) => WF.openPicker(b, wfUi(), id) } : null,
121
+ rename: O.rename && id ? () => { const t = document.querySelector('#czViewer [data-cz-vw-rn]'); if (t) t.click(); } : null,
122
+ auto: id && !mv.why ? { on: mv.auto, press: () => setAuto(r, !mv.auto) } : null,
123
+ back: id && a && mv.canBack ? { prev: mv.prev, on: (b) => O.moreAct(r, 'back:' + mv.prev, b) } : null,
124
+ toStage: id && live && !self && (a.stages || []).length > 1 ? (b) => O.moreAct(r, 'stage', b) : null,
125
+ dates: id ? () => location.assign(O.askHref(r, 'Propose new start and end dates for ' + r.title)) : null,
126
+ person: id ? () => addPerson(r) : null,
127
+ // split or merge, then the program moves (batch 11 items 2 and 14; pm/split-merge.js, pm/prog-move.js)
128
+ sm: id && O.smItems && !r.ended ? O.smItems(r) : [],
129
+ pm: id && O.moveItems ? O.moveItems(r) : [],
130
+ turnProgram: id && O.turnProgram && !(O.programOf && O.programOf(r)) ? () => O.turnProgram(r) : null,
131
+ jira: M.jira ? () => O.refreshJira() : null,
132
+ record: id ? async () => { VW.drill(); (await import('./premium-vw-item.js')).openWorkItem({ kind: 'initiative', id, title: r.title, ...where(r) }); } : null,
133
+ link: id ? () => copyText(new URL(O.pageHref(r), location.href).href, 'Link copied.') : null,
134
+ text: () => copyText(iniText(r.title, viewOf(r), (r.track && r.track.tickets) || []), 'Copied as text.'),
135
+ ended: !!r.ended,
136
+ wontDo: id && !self ? (b) => WF.openWontDo(b, wfUi(), id) : null,
137
+ backToTriage: id && !self ? () => WF.backToTriage(wfUi(), id) : null,
138
+ archive: id && !self && !(a && a.archived) ? () => WF.archive(wfUi(), id) : null,
139
+ hold: id && live && O.moreAct ? (b) => O.moreAct(r, 'hold', b) : null,
140
+ resume: id && a && a.life === 'hold' && !r.ended && O.moreAct ? (b) => O.moreAct(r, 'resume', b) : null,
141
+ cancel: id && live && O.moreAct ? (b) => O.moreAct(r, 'cancel', b) : null,
142
+ });
87
143
  }
88
144
  function iniBody(r) {
89
145
  const md = (v) => ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'][+v.slice(5, 7) - 1] + ' ' + +v.slice(8, 10);
@@ -142,8 +198,10 @@ export function openIni(r, from, o = {}) {
142
198
  if (!O || !r || !r.track) return;
143
199
  adding = o.addTo != null ? r.key : null; addTo = o.addTo || ''; addDates = o.addDates || null;
144
200
  // a row with no record id has no chat of its own: its question goes to the board's chat
145
- VW.open({ kind: 'Initiative', title: r.title, icon: 'flag', id: vidOf(r), url: r.id ? O.pageHref(r) : '', full: true,
146
- discuss: r.id ? true : () => location.assign(O.askHref(r, '')), more: iniMore(r), rename: O.rename ? O.rename(r) : null,
201
+ readLay(r); // Moves on by itself shows once the layout record is read
202
+ // the same tile as Home's initiative page; no "Open in full": the header's expand already opens it wide (batch 14 item 5)
203
+ VW.open({ kind: 'Initiative', title: r.title, icon: 'goal', id: vidOf(r),
204
+ discuss: r.id ? true : () => location.assign(O.askHref(r, '')), more: () => iniMore(O.rowOf(r.key) || r), rename: O.rename ? O.rename(r) : null,
147
205
  render: (body) => { const x = O.rowOf(r.key) || r; cur = { key: x.key, tk: null }; O.onShow(x.key, from); body.innerHTML = iniBody(x); wire(body, x.key); if (adding === x.key) { const f = body.querySelector('#ivAddTask'); if (f && document.activeElement !== f) f.focus(); } },
148
206
  onClose: () => { if (cur && cur.key === r.key && !cur.tk) { cur = null; O.onHide(); } } });
149
207
  }
@@ -182,4 +240,4 @@ export function refresh() {
182
240
  }
183
241
  export function close() { if (cur) { cur = null; VW.close(); } }
184
242
  export const shown = () => (cur ? cur.key : null);
185
- export function mount(o) { O = o; }
243
+ export function mount(o) { O = o; ensurePopCss(); }
@@ -27,7 +27,10 @@ function cardHtml(r, msId) {
27
27
  if (!L.length) return `<p class="bd-pc-h">${esc(r.title)}</p><p class="bd-amut bd-pc-sub">No milestone yet. Flag a task as a milestone ◇ in the initiative's Tasks.</p>`;
28
28
  const m0 = L.find((m) => m.id === msId) || null, on = shownMs(r).length;
29
29
  const head = m0 ? `<p class="bd-pc-h">${esc(m0.name)}</p><p class="bd-amut bd-pc-sub">${esc(when(m0.date))} · ${on} of ${L.length} ${L.length === 1 ? 'milestone' : 'milestones'} on the timeline</p>`
30
- : `<p class="bd-pc-h">${esc(r.title)}</p><p class="bd-amut bd-pc-sub">${on} of ${L.length} ${L.length === 1 ? 'milestone' : 'milestones'} on the timeline</p>`;
30
+ : r.end && /^\d{4}-\d{2}-\d{2}/.test(String(r.end))
31
+ // the row's plain end ◇ (no milestone task stands for it): the card says what the row's label says, "Deliver Jun 9 ’27" (batch 14 item 1)
32
+ ? `<p class="bd-pc-h">${esc(r.track && r.track.k >= 6 ? 'Evaluate' : 'Deliver')} ${esc(when(String(r.end).slice(0, 10)))}</p><p class="bd-amut bd-pc-sub">The end of ${esc(r.title)} · ${on} of ${L.length} ${L.length === 1 ? 'milestone' : 'milestones'} on the timeline</p>`
33
+ : `<p class="bd-pc-h">${esc(r.title)}</p><p class="bd-amut bd-pc-sub">${on} of ${L.length} ${L.length === 1 ? 'milestone' : 'milestones'} on the timeline</p>`;
31
34
  const row = (m) => {
32
35
  const p = isPinned(r, m), late = !m.done && m.date < today;
33
36
  const say = (p ? 'Shown on the timeline: ' : 'Show on the timeline: ') + m.name;
@@ -209,9 +209,11 @@ function qBar(r, X, now, phone, fmt, pxPct, ms = {}) {
209
209
  const sw = slipWords(r, e); if (sw) hover.push(sw);
210
210
  // the committed end is the ◇ (PgTimeline); a milestone task in the stage it stands for IS that ◇ (say it once, batch 11 item 3): its name and its done
211
211
  const isLate = !!(over || clash || r.late || (et && msLate(et, now)));
212
- const name = landsOf(r, et), eTitle = name + ' · ' + md(e) + (et && et.stage ? ' · ◆ ' + et.stage : '') + (et && et.done ? ' · done' : isLate ? ' · late' : '');
213
- out += `<button type="button" class="tg-end${et && et.done ? ' dn' : ''}${isLate ? ' late' : ''}" data-ms-pick="${esc(r.key)}" data-ms-id="${esc(et ? et.id : '')}" style="left:${P(X(e))}" aria-haspopup="dialog" aria-label="${esc(eTitle + '. Milestones of ' + r.title)}" title="${esc(eTitle + (clash ? '. ' + clash : ''))}"></button>`;
214
- out += endLabel(Math.max(X(e), over ? X(now) : 0, late ? X(fc) : 0), name, e, isLate ? 'late' : risk, now, pxPct, hover, slipHtml(r));
212
+ // the ◇ and its label carry the milestone's own date; the initiative's end, when it differs, is the hover (batch 14 item 1)
213
+ const ed = et ? day(et.date) : e; if (+ed !== +e) hover.push('Initiative ends ' + dy(e, now));
214
+ const name = landsOf(r, et), eTitle = name + ' · ' + md(ed) + (et && et.stage ? ' · ◆ ' + et.stage : '') + (et && et.done ? ' · done' : isLate ? ' · late' : '');
215
+ out += `<button type="button" class="tg-end${et && et.done ? ' dn' : ''}${isLate ? ' late' : ''}" data-ms-pick="${esc(r.key)}" data-ms-id="${esc(et ? et.id : '')}" style="left:${P(X(ed))}" aria-haspopup="dialog" aria-label="${esc(eTitle + '. Milestones of ' + r.title)}" title="${esc(eTitle + (clash ? '. ' + clash : ''))}"></button>`;
216
+ out += endLabel(Math.max(X(e), X(ed), over ? X(now) : 0, late ? X(fc) : 0), name, ed, isLate ? 'late' : risk, now, pxPct, hover, slipHtml(r));
215
217
  } else if (fc) {
216
218
  out += `<span class="tg-fc solo" style="left:${P(X(fc))};width:12px;margin-left:-12px" title="Jira forecast ${esc(md(fc))}"></span>` + endLabel(X(fc), 'Jira forecast', fc, '', now, pxPct, [], '');
217
219
  } else if (r.draft && day(r.draft.start)) {
@@ -326,12 +328,15 @@ const lastMs = (r) => { const S = (r.wfStages || []).filter((x) => x && x.milest
326
328
  /** The ◆ stage a milestone task sits in, by name, or ''. */
327
329
  const msStage = (r, m) => { if (!m.sec) return ''; const st = (r.wfStages || []).find((x) => x.key === m.sec); return st ? (st.milestone ? st.name : '') : /^(deliver|evaluate)$/i.test(m.sec) ? m.sec.replace(/^./, (c) => c.toUpperCase()) : ''; };
328
330
  /** The milestone task the bar's end ◇ stands for, or null. The end ◇ is the workflow's last ◆ stage (Evaluate on Product feature): the latest
329
- * milestone task in that stage IS it, else one on the end's own day; it takes that task's name and done, and is not drawn twice. A task in an
330
- * earlier ◆ stage keeps its own ◇. M: the row's dated milestones. */
331
+ * milestone task in that stage IS it, else one on the end's own day, else the latest task in any ◆ stage (Deliver: batch 14 item 1, so a
332
+ * "rolled out" task in Deliver names the row's end). It takes that task's name, date and done, and is not drawn twice. A task outside the ◆
333
+ * stages keeps its own ◇. M: the row's dated milestones. */
331
334
  function endTask(r, M) {
332
- const e = day(r.end); if (!e) return null;
333
- const last = lastMs(r), inLast = M.filter((m) => m.sec && m.sec.toLowerCase() === last);
334
- const end = inLast.length ? inLast[inLast.length - 1] : M.find((m) => +day(m.date) === +e) || null;
335
+ const e = day(r.end); if (!e || !M.length) return null;
336
+ const S = M.slice().sort((a, b) => day(a.date) - day(b.date));
337
+ const last = lastMs(r), inLast = S.filter((m) => m.sec && m.sec.toLowerCase() === last);
338
+ const inMs = S.filter((m) => msStage(r, m));
339
+ const end = inLast.length ? inLast[inLast.length - 1] : S.find((m) => +day(m.date) === +e) || inMs[inMs.length - 1];
335
340
  return end ? { ...end, stage: msStage(r, end) } : null;
336
341
  }
337
342
  /** One ◇ per milestone task the Filter shows (batch 13 item 4, XcalmA5Milestones; pm/bd-pins.js shownMs: the pinned ones, by default the last),
@@ -368,7 +373,7 @@ export function laneMilestones(rows, now) {
368
373
  for (const m of M) if (!et || m.id !== et.id) out.push({ id: m.id, name: m.name, date: m.date, done: !!m.done, late: msLate(m, now), row: r });
369
374
  if (!s || !e) continue;
370
375
  const ob = openBack(r, now), late = (r.over && now > e) || (ob && ob > e) || (et && msLate(et, now));
371
- out.push({ id: et ? et.id : '', name: et ? et.name : r.track && r.track.k >= 6 ? 'Evaluate' : 'Deliver', date: iso(e), done: !!(et && et.done), late: !!late, row: r });
376
+ out.push({ id: et ? et.id : '', name: et ? et.name : r.track && r.track.k >= 6 ? 'Evaluate' : 'Deliver', date: et ? String(et.date).slice(0, 10) : iso(e), done: !!(et && et.done), late: !!late, row: r });
372
377
  }
373
378
  return out.sort((a, b) => day(a.date) - day(b.date));
374
379
  }
@@ -492,11 +497,16 @@ function scaled(rows, M, o) {
492
497
  // program's initiatives were missing from their product on the timeline)
493
498
  // By product, a program's undated initiative keeps its "No dates" row under its product too (batch 11 item 19: they disappeared once grouped by product)
494
499
  const onList = new Set(list.map((r) => r.key));
500
+ // a product with no dated initiative keeps its head and its initiatives as "No dates" rows, so the product is not missing from the Board
501
+ // (batch 14 item 2: pmos-microsites, all undated outside its program, had no group at all); those rows leave the foot's names
502
+ const keepOf = (R) => { const k = R.filter((r) => onList.has(r.key) || r.inProgram); return k.length ? k : R.slice(); };
503
+ const shownNd = new Set(o.groups ? o.groups.filter((g) => g.kind !== 'program' && !g.rows.some((r) => onList.has(r.key) || r.inProgram)).flatMap((g) => g.rows.map((r) => r.key)) : []);
504
+ const footNone = none.filter((r) => !shownNd.has(r.key));
495
505
  // a timeline reads in time (batch 11 item 22): each group's rows by start, then end; undated ones last. The health dot still says late or at risk
496
506
  const at = (r) => { const x = extentOf(r, now); return x ? [+x.a, +x.b] : [Infinity, Infinity]; };
497
507
  const byTime = (L) => L.map((r) => [at(r), r]).sort((p, q) => p[0][0] - q[0][0] || p[0][1] - q[0][1]).map((x) => x[1]);
498
508
  list.splice(0, list.length, ...byTime(list));
499
- const G = o.groups ? o.groups.map((g) => (g.kind === 'program' ? { ...g, products: g.products.filter((x) => x.rows.length).map((x) => ({ ...x, rows: byTime(x.rows) })) } : { ...g, rows: byTime(g.rows.filter((r) => onList.has(r.key) || r.inProgram)) })).filter((g) => g.rows.length || g.kind === 'program') : null;
509
+ const G = o.groups ? o.groups.map((g) => (g.kind === 'program' ? { ...g, products: g.products.filter((x) => x.rows.length).map((x) => ({ ...x, rows: byTime(x.rows) })) } : { ...g, rows: byTime(keepOf(g.rows)) })).filter((g) => g.rows.length || g.kind === 'program') : null;
500
510
  const empty = '<p class="tg-empty">No initiative on screen has a date on record.</p>';
501
511
  const ext = (r) => { const x = extentOf(r, now); return x ? ` data-a="${X(x.a).toFixed(3)}" data-b="${X(x.b).toFixed(3)}"` : ''; };
502
512
  // a product's head carries its lane from Quarter on (batch 11 item 17); Sprint on a phone, and a page that gives no head cell, keep the plain head
@@ -510,7 +520,7 @@ function scaled(rows, M, o) {
510
520
  return `<div class="tgq-r tg-pg${shut ? ' closed' : ''}" data-prow="${esc(g.program.id)}"><div class="tgq-n tg-pgn">${progName(g, st, o, shut ? offDots(g.rows, now) : '')}</div><div class="tg-p">${ov}${tr}</div></div>` + (shut ? '' : g.products.map((x) => x.rows.map(one).join('')).join(''));
511
521
  }).join('') : list.map(one).join('');
512
522
  const top = `<div class="tgq-h"><div class="tg-p">${ticks}${pill}</div></div>`;
513
- const below = none.length ? `<div class="tg-none"><span>${none.length} ${none.length === 1 ? 'has' : 'have'} no dates</span>${askBtn}</div>` : '';
523
+ const below = none.length ? `<div class="tg-none">${footNone.length ? `<span>${footNone.length} ${footNone.length === 1 ? 'has' : 'have'} no dates</span>` : ''}${askBtn}</div>` : '';
514
524
  // the Deliveries lane (batch 13 item 4, XcalmA6Phone): a phone shows the next deliveries above the rows (o.lane draws it; none: nothing)
515
525
  const lanePh = o.lane ? o.lane({ W, X, rows: list, groups: G, now, phone: true, pxPct }) || '' : '';
516
526
  return { html: lanePh + `<div class="tg tg-s tgq" ${attrs}><div class="tg-scw"><div class="tg-sc" tabindex="0" role="group" aria-label="Timeline" style="${style}"><div class="tg-in">${top}<div class="tg-body">${body || empty}</div></div></div>${back}<i class="tg-fade l" aria-hidden="true"></i><i class="tg-fade r" aria-hidden="true"></i></div></div>${below}`, none };
@@ -529,7 +539,7 @@ function scaled(rows, M, o) {
529
539
  // the sprint band and the release keep their labels under the axis on Quarter, where a week is wide enough to read them
530
540
  const axl = sp === 'quarter' ? `${sa && sb && sb > W.from && sa < W.to ? `<span class="tg-axl sb" style="left:${P(X(sa))}">Jira ${esc(sprint.name.toLowerCase())} · ${esc(md(sa))} – ${esc(md(sb))}</span>` : ''}${ra && ra > W.from && ra < W.to ? `<span class="tg-axl rl" style="left:${P(X(ra))}">${SV(FLAG)}${esc(rel.name)} · ${esc(md(ra))}</span>` : ''}` : '';
531
541
  const axis = axl ? `<div class="tg-ax"><span class="tg-n"></span><div class="tg-p">${axl}</div></div>` : '';
532
- const foot = none.length ? `<div class="tg-ft">${none.length ? `<span class="tg-none"><b>${none.length} ${none.length === 1 ? 'has' : 'have'} no dates:</b> <span>${esc(none.slice(0, 4).map((r) => r.title).join(', '))}${none.length > 4 ? ' and ' + (none.length - 4) + ' more' : ''}</span>${askBtn}</span>` : '<span></span>'}</div>` : '';
542
+ const foot = none.length ? `<div class="tg-ft">${footNone.length ? `<span class="tg-none"><b>${footNone.length} ${footNone.length === 1 ? 'has' : 'have'} no dates:</b> <span>${esc(footNone.slice(0, 4).map((r) => r.title).join(', '))}${footNone.length > 4 ? ' and ' + (footNone.length - 4) + ' more' : ''}</span>${askBtn}</span>` : `<span class="tg-none">${askBtn}</span>`}</div>` : '';
533
543
  // the Deliveries lane (batch 13 item 4, XcalmA6Lane): one row under the axis, a list per column (o.lane draws it; none: nothing)
534
544
  const laneH = o.lane ? o.lane({ W, X, rows: list, groups: G, now, phone: false, pxPct }) || '' : '';
535
545
  return { html: `<div class="tg tg-q tg-s" ${attrs}><div class="tg-scw"><div class="tg-sc" tabindex="0" role="group" aria-label="Timeline" style="${style}"><div class="tg-in">${head}${laneH}<div class="tg-body">${body || empty}</div>${axis}</div></div><i class="tg-fade l" aria-hidden="true"></i><i class="tg-fade r" aria-hidden="true"></i></div>${foot}</div>`, none };
@@ -756,3 +756,10 @@ form.hm-box textarea { min-height: 48px; border: 0; background: none; resize: no
756
756
  /* a milestone task's small grey ◇ after its name (feedback batch 11 item 3) */
757
757
  .hm-rt.ms { flex-direction: row; align-items: center; gap: 6px; }
758
758
  .hv-ms { flex: none; display: inline-flex; color: var(--cz-ink3); }
759
+ /* the chat header's context pie and Claude's ✦ Compact in the offer chip (batch 13 item 8) */
760
+ .hm-ch .cz-ctx { margin-left: auto; margin-right: 6px; }
761
+ .hm-sugc.cpt { white-space: normal; }
762
+ .hm-sugs { font-style: normal; color: var(--cz-blueink); }
763
+ .hm-sugw { color: var(--cz-ink2); font-weight: 700; min-width: 0; }
764
+ .hm-sugx.ok { color: var(--cz-blueink); }
765
+ #hmTopTitle .cz-ctx { margin-left: 8px; vertical-align: -2px; }
@@ -34,6 +34,7 @@
34
34
  .lv-t small { display: block; font-size: 12.5px; font-weight: 600; color: var(--cz-ink3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
35
35
  .lv-tm { font-size: 12.5px; font-weight: 700; color: var(--cz-ink3); white-space: nowrap; font-variant-numeric: tabular-nums; flex: none; }
36
36
  .cz-live .lv-tm { font-size: 13px; }
37
+ .lv-row .cz-ctx { margin: 0 8px 0 4px; } /* the context pie before the time (batch 13 item 8; drawn by ctx-wedge.js, styled in cozy.css) */
37
38
  .lv-tm.rec { color: var(--cz-red); }
38
39
  .lv-tm.stop { color: var(--cz-late); }
39
40
 
@@ -17,6 +17,7 @@
17
17
  import { onRecording } from './rec-state.js';
18
18
  import { ownTab, bring } from './rec-tab-core.js';
19
19
  import { liveItems, keepOrder, pillLabel, rowLabel, clock, elapsed } from './live-model.js';
20
+ import { wedgeHtml } from './ctx-wedge.js'; // the same context pie as Home's rows, before the time (batch 13 item 8)
20
21
 
21
22
  const esc = (v) => String(v == null ? '' : v).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[c]);
22
23
  const SHEET = new URL('./cozy-live-pill.css', import.meta.url).href;
@@ -60,7 +61,7 @@ export function mountLivePill(doc = document, opts = {}) {
60
61
  const was = L.marks.get(x.id), once = L.open && was && was !== x.mark;
61
62
  return `<a class="lv-row${x.open ? ' cur' : ''}" href="${esc(x.href)}" data-lv="${esc(x.id)}" aria-label="${esc(rowLabel(x))}" aria-keyshortcuts="${i + 1}">`
62
63
  + `<span class="lv-mk">${x.kind === 'rec' ? `<i class="lv-m rec${x.paused ? ' paused' : ''}"></i>` : markHtml(x.mark, once)}</span>`
63
- + `<span class="lv-t">${esc(x.name)}<small>${esc(x.sub)}</small></span>`
64
+ + `<span class="lv-t">${esc(x.name)}<small>${esc(x.sub)}</small></span>${wedgeHtml(x.ctx)}`
64
65
  + `<span class="lv-tm${x.kind === 'rec' && !x.paused ? ' rec' : x.mark === 'stop' ? ' stop' : ''}">${esc(x.time)}</span></a>`;
65
66
  }).join('');
66
67
  }
@@ -41,6 +41,8 @@ const P = { star: '<path d="M12 3.8l2.5 5.2 5.7.8-4.1 4 1 5.7L12 16.8l-5.1 2.7 1
41
41
  const svg = (k, w = 18) => `<svg aria-hidden="true" width="${w}" height="${w}" viewBox="0 0 24 24">${P[k]}</svg>`;
42
42
  const btn = (a, label, icon, cls = '') => `<button type="button" class="rt-b${cls ? ' ' + cls : ''}" data-a="${a}" aria-label="${esc(label)}" title="${esc(label)}">${svg(icon, a === 'stop' ? 20 : 18)}</button>`;
43
43
 
44
+ const BUSY_MS = 30000; // the longest a press waits for its answer
45
+ let READING = false; // one read at a time
44
46
  const S = { row: null, one: null, focus: null, readAt: Date.now(), mode: 'idle', ask: null, msg: '', busy: false, video: null, on: { note: new Set(), mode: new Set(), tick: new Set() } };
45
47
  const fire = (k, v) => { for (const fn of S.on[k]) { try { fn(v); } catch { /* the slot's own */ } } };
46
48
  const note = () => (S.one && S.one.note) || null;
@@ -164,7 +166,13 @@ async function readFocus() {
164
166
  /* ── the presses ───────────────────────────────────────────────────────────────────────────────────────── */
165
167
  async function act(a, t) {
166
168
  if (S.busy && a !== 'askno') return;
167
- const run = async (fn) => { S.busy = true; if (t) t.disabled = true; try { await fn(); } finally { S.busy = false; await read(); } };
169
+ // a press that gets no answer gives up after BUSY_MS, so the buttons come back (Wawan, 2026-10-27: a stuck press froze the tab)
170
+ const run = async (fn) => {
171
+ S.busy = true; if (t) t.disabled = true;
172
+ let late = null;
173
+ try { await Promise.race([fn(), new Promise((ok) => { late = setTimeout(() => { S.msg = 'That took too long. Try again.'; ok(); }, window.__rtBusyMs || BUSY_MS); })]); }
174
+ finally { clearTimeout(late); S.busy = false; if (t) t.disabled = false; await read(); }
175
+ };
168
176
  switch (a) {
169
177
  case 'hl': { const r = await C.highlight(); S.msg = r.ok ? 'Keeping the last 30 seconds and the next ones as a highlight.' : r.error; return draw(); }
170
178
  case 'pause': return run(async () => { const r = await C.pause(); S.msg = r.ok ? '' : r.error; });
@@ -213,7 +221,8 @@ else {
213
221
  if (S.row && S.row.state !== 'recording' && S.row.state !== 'ended') act('start');
214
222
  }
215
223
  });
216
- setInterval(() => { if (!S.busy) { tick(); drawAlert(); drawLine(); beat(); } }, 1000); // beat(): a change (Not hearing the meeting) reaches the snippets within a second
217
- setInterval(() => { if (!S.busy) read(); beat(true); }, 5000);
224
+ // the clock, the line and the transcript never wait on a press: a press that hangs must not freeze the meeting (Wawan, 2026-10-27)
225
+ setInterval(() => { tick(); drawAlert(); drawLine(); beat(); }, 1000); // beat(): a change (Not hearing the meeting) reaches the snippets within a second
226
+ setInterval(() => { if (!READING) { READING = true; read().catch(() => {}).finally(() => { READING = false; }); } beat(true); }, 5000);
218
227
  setInterval(readFocus, 15000);
219
228
  }
@@ -443,3 +443,6 @@ body.cz-home .hv-r.sp-on + .hv-r::before { display: none; }
443
443
  .hv-card .hv-r.two .hm-rm { min-height: 58px; }
444
444
  }
445
445
  body.cz-home .hm-hd.hv-bar { padding: 0; }
446
+
447
+ /* A session's context (batch 13 item 8, XctxA1Desk): the pie sits at the row's end. Claude's ✦ Compact uses item 7's ✦ and ✓ (.hm-sv, .hm-cls) */
448
+ .hm-rm .cz-ctx { margin: 0 6px 0 8px; }