create-pmos 0.440.0 → 0.442.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 (95) 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/adler-seasons-art-test.js +106 -0
  7. package/workspace/adler-seasons-test.js +111 -0
  8. package/workspace/briefing-premium-adddoc-test.js +16 -13
  9. package/workspace/briefing-premium-board-test.js +19 -17
  10. package/workspace/briefing-premium-initiative-test.js +7 -4
  11. package/workspace/briefing-premium-products-test.js +4 -4
  12. package/workspace/briefing-premium-sources-test.js +2 -2
  13. package/workspace/briefing-premium-test.js +29 -23
  14. package/workspace/changelog.json +24 -0
  15. package/workspace/guide/adler.md +10 -0
  16. package/workspace/guide/core-documents.md +2 -2
  17. package/workspace/guide/data-freshness.md +7 -5
  18. package/workspace/guide/home.md +3 -1
  19. package/workspace/guide/horizon-scan.md +1 -1
  20. package/workspace/ini-workflow-test.js +6 -2
  21. package/workspace/lib/agent-inbox.js +20 -2
  22. package/workspace/lib/briefing-premium-sources.js +3 -0
  23. package/workspace/lib/briefing-premium.js +37 -7
  24. package/workspace/lib/driver-cli.js +1 -1
  25. package/workspace/lib/driver-run.js +15 -1
  26. package/workspace/lib/driver.js +31 -2
  27. package/workspace/lib/news-for-you.js +24 -9
  28. package/workspace/lib/pm-idle.js +12 -0
  29. package/workspace/lib/refresh.js +17 -8
  30. package/workspace/lib/routes-core-docs.js +1 -1
  31. package/workspace/lib/routes-news.js +15 -1
  32. package/workspace/lib/routes-phone-day.js +6 -4
  33. package/workspace/lib/settings-store.js +38 -0
  34. package/workspace/metric-drafts-ui-test.js +2 -2
  35. package/workspace/need-shot.js +57 -0
  36. package/workspace/news-viewers-test.js +183 -0
  37. package/workspace/package-lock.json +2 -2
  38. package/workspace/package.json +1 -1
  39. package/workspace/premium-board-actions-test.js +2 -1
  40. package/workspace/premium-chat-attach-test.js +2 -0
  41. package/workspace/premium-core-doc-issue-test.js +9 -8
  42. package/workspace/program-panel-test.js +1 -1
  43. package/workspace/public/pm/bd-ini-panel.js +6 -13
  44. package/workspace/public/pm/c3-ini-ui.js +1 -1
  45. package/workspace/public/pm/cozy-adler.css +21 -0
  46. package/workspace/public/pm/cozy-adler.js +415 -8
  47. package/workspace/public/pm/cozy-ev.css +44 -0
  48. package/workspace/public/pm/cozy-home.css +8 -0
  49. package/workspace/public/pm/cozy-news.js +186 -22
  50. package/workspace/public/pm/cozy-seasons.js +318 -0
  51. package/workspace/public/pm/cozy-settings.js +88 -5
  52. package/workspace/public/pm/cozy-today.css +5 -0
  53. package/workspace/public/pm/cozy-viewer.js +12 -7
  54. package/workspace/public/pm/cozy-vw-shell.css +49 -0
  55. package/workspace/public/pm/cozy.css +65 -0
  56. package/workspace/public/pm/dash-view.js +4 -2
  57. package/workspace/public/pm/home-adddoc.js +46 -26
  58. package/workspace/public/pm/home-app.js +142 -114
  59. package/workspace/public/pm/home-chat.js +1 -1
  60. package/workspace/public/pm/home-day.js +17 -9
  61. package/workspace/public/pm/home-draft.js +35 -23
  62. package/workspace/public/pm/home-ini.js +4 -4
  63. package/workspace/public/pm/home-mentions.js +1 -1
  64. package/workspace/public/pm/home-need.js +336 -0
  65. package/workspace/public/pm/home-today.js +2 -2
  66. package/workspace/public/pm/home-work.js +51 -4
  67. package/workspace/public/pm/impact.js +1 -1
  68. package/workspace/public/pm/ini-groups.js +15 -10
  69. package/workspace/public/pm/ini-links.js +1 -1
  70. package/workspace/public/pm/ini-tasks.js +208 -44
  71. package/workspace/public/pm/ini-view-model.js +8 -2
  72. package/workspace/public/pm/ini-view.css +305 -1
  73. package/workspace/public/pm/ini-view.js +190 -80
  74. package/workspace/public/pm/mission.js +234 -0
  75. package/workspace/public/pm/premium-board.js +1 -1
  76. package/workspace/public/pm/premium-welcome.js +2 -2
  77. package/workspace/public/pm/small-vw.js +128 -0
  78. package/workspace/public/pm/split-merge.js +1 -1
  79. package/workspace/public/pm/stage-line.js +2 -2
  80. package/workspace/server.js +10 -6
  81. package/workspace/skills/initiative-drive.skill +4 -1
  82. package/workspace/split-merge-ui-test.js +1 -1
  83. package/workspace/stage-card-test.js +48 -11
  84. package/workspace/task-links-test.js +2 -0
  85. package/workspace/task-milestones-test.js +5 -1
  86. package/workspace/task-plans-test.js +3 -3
  87. package/workspace/task-views-test.js +90 -37
  88. package/workspace/test-lists/adler-seasons-art.json +13 -0
  89. package/workspace/test-lists/batch18-adler-seasons.json +13 -0
  90. package/workspace/test-lists/batch18-asks.json +5 -0
  91. package/workspace/test-lists/mission.json +5 -0
  92. package/workspace/test-lists/news-viewers.json +13 -0
  93. package/workspace/test-lists/small-viewers.json +5 -0
  94. package/workspace/test-lists/viewer-tasks.json +5 -0
  95. package/workspace/tk-tasks-test.js +25 -30
@@ -5,11 +5,18 @@
5
5
  *
6
6
  * viewMode() / setViewMode(m) 'list' | 'timeline' | 'kanban': the last view, remembered for the PM across initiatives; first time List
7
7
  * switchHtml(m) the icon-only segment List / Timeline / Kanban (Kanban is the Board's "By stage" icon)
8
- * headExtraHtml(v, m) what the view adds to the header: Timeline's Weeks/Months/Quarter/Year/2 years/5 years picker, Kanban's stage picker
9
- * timelineHtml(v, o, isOpen) the stage groups of the List (the same folds), bars by start → due, a circle for a due day only, a dashed
10
- * date press at today for a task with no dates, the Today line and the legend under it
8
+ * viewBtnHtml(m) the Tasks header's one view button (batch 18 item 1, XvpA4Sheet); its press opens the view sheet
9
+ * sheetHtml(m, g, z) the sheet: View, Group by (Stage, Owner, Status, ⋯ for Epic and Your groups) and the Timeline's Zoom
10
+ * (Weeks, Months, All); a bottom sheet on a phone, a popover under the button on a desktop
11
+ * kanbanPickHtml(v) Kanban's stage picker, at the top of the Kanban
12
+ * zoomMode() 'week' | 'month' | 'all'; a zoom stored before the three steps (quarter, year, y2, y5) reads as All
13
+ * timelineHtml(v, o, isOpen) Weeks and Months: the stage groups of the List (the same folds), bars by start → due, a circle for a due
14
+ * day only, the tasks with no dates in one "N without dates · Set" row at the foot, the Today line and the
15
+ * legend under it. On a phone each title sits above its bar, from the bar's start (XvpA3bMonths).
16
+ * allHtml(v, o, isOpen) All (XvpA3Timeline): one row per stage in the width it has; a press unfolds its tasks and milestones
11
17
  * kanbanHtml(v, o, isOpen) one stage at a time; columns To do, In progress, Done; Won't do a folded strip; phone: one column a screen
12
- * press(b, d, root, H) a press this file owns → true: the view switch, the pickers, the status caret, a date, a bar, a tab
18
+ * press(b, d, root, H) a press this file owns → true: the view button and its sheet, the pickers, the status caret, a date, a bar, a tab
19
+ * (H.__g: the sheet's Group by, pm/ini-groups.js api)
13
20
  * wireDrag(body) once per body: drag a bar (move, or an end), drag a card between columns, long-press a box on a phone
14
21
  *
15
22
  * The host's handlers (wireView's h): h.check(uid) the box's one-press Done (Undo in the host's toast), h.status(uid, state) and
@@ -22,7 +29,7 @@ const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&':
22
29
  const SVG = (d, w = 16, sw = 1.8) => `<svg aria-hidden="true" width="${w}" height="${w}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="${sw}" stroke-linecap="round" stroke-linejoin="round"><path d="${d}"/></svg>`;
23
30
  export const P = {
24
31
  list: 'M9 6h11M9 12h11M9 18h11M4.5 6h.01M4.5 12h.01M4.5 18h.01', time: 'M4 6h9M8 12h11M6 18h7', kanban: 'M4 4h4v16H4zM10 4h4v10h-4zM16 4h4v13h-4z',
25
- down: 'M7 10l5 5 5-5', right: 'M10 7l5 5-5 5', cal: 'M4 5h16v15H4zM8 3v4M16 3v4M4 10h16', jira: 'M12 3l9 9-9 9-9-9z', check: 'M5 12l5 5 9-10',
32
+ down: 'M7 10l5 5 5-5', right: 'M10 7l5 5-5 5', cal: 'M4 5h16v15H4zM8 3v4M16 3v4M4 10h16', jira: 'M4 7h16v3a2 2 0 0 0 0 4v3H4v-3a2 2 0 0 0 0-4z', check: 'M5 12l5 5 9-10',
26
33
  dia: 'M12 4l8 8-8 8-8-8z', skip: 'M6 7l5 5-5 5M13 7l5 5-5 5', bin: 'M5 7h14M10 7V4h4v3M7 7l1 13h8l1-13',
27
34
  full: 'M4 9V4h5M20 9V4h-5M4 15v5h5M20 15v5h-5', unfull: 'M9 4v5H4M15 4v5h5M9 20v-5H4M15 20v-5h5',
28
35
  };
@@ -33,8 +40,10 @@ export const msGlyph = (x) => (x && x.ms ? `<span class="iv-ms${x.done ? ' dn' :
33
40
  export const msNoDate = (x) => !!(x && x.ms && !x.end && !x.closed);
34
41
  const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
35
42
  const VIEWS = [['list', 'List', P.list], ['timeline', 'Timeline', P.time], ['kanban', 'Kanban', P.kanban]];
36
- // [key, label, px a day, the days the axis shows ahead at least]: Year, 2 years and 5 years (batch 17 item 3) read like the Board's spans
37
- const ZOOMS = [['week', 'Weeks', 14, 42], ['month', 'Months', 4, 42], ['quarter', 'Quarter', 1.6, 92], ['year', 'Year', 0.8, 365], ['y2', '2 years', 0.4, 730], ['y5', '5 years', 0.16, 1826]];
43
+ // [key, label, px a day, the days the axis shows ahead at least]. Three steps (batch 18 item 1, XvpA4Sheet): Weeks and Months scroll, All
44
+ // fits the whole initiative in the width it has, however long. The six steps before it (Quarter, Year, 2 years, 5 years) read as All.
45
+ const ZOOMS = [['week', 'Weeks', 14, 42], ['month', 'Months', 4, 42], ['all', 'All', 0, 0]];
46
+ const OLD_ZOOM = { quarter: 'all', year: 'all', y2: 'all', y5: 'all' };
38
47
  const COLS = [['To do', 'To do'], ['In progress', 'In progress'], ['Done', 'Done']];
39
48
 
40
49
  /* ── what the PM picked: the view and the zoom for the PM (this browser), the Kanban stage per initiative for the session ── */
@@ -67,7 +76,9 @@ function setFull(on) {
67
76
  }, true);
68
77
  }
69
78
  }
70
- const zoomOf = () => { if (!ZOOM) { const z = store.get('pmos.tasks.zoom'); ZOOM = ZOOMS.some((x) => x[0] === z) ? z : 'week'; } return ZOOM; };
79
+ const zoomOf = () => { if (!ZOOM) { const z0 = store.get('pmos.tasks.zoom'), z = OLD_ZOOM[z0] || z0; ZOOM = ZOOMS.some((x) => x[0] === z) ? z : 'week'; } return ZOOM; };
80
+ /** The Timeline's zoom: 'week' | 'month' | 'all'. A stored zoom from before the three steps reads as All. */
81
+ export const zoomMode = () => zoomOf();
71
82
  /** For the tests: forget the PM's picks. */
72
83
  export const resetViews = () => { VIEW = null; ZOOM = null; STAGE.clear(); SCROLL.clear(); };
73
84
  /** The stage card's press on a stage (batch 11 item 21): the Kanban turns to that stage. */
@@ -105,21 +116,53 @@ export function stagesOf(v) {
105
116
  return now ? [{ key: now.key, label: now.name, count: now.count }, all, ...rest] : [all, ...rest];
106
117
  }
107
118
  const stageKeyOf = (v) => { const L = stagesOf(v), k = STAGE.get(v.id || v.key); return L.some((x) => x.key === k) ? k : L[0].key; };
108
- export function headExtraHtml(v, m) {
109
- if (m === 'timeline') {
110
- const z = ZOOMS.find((x) => x[0] === zoomOf());
111
- const f = fullOn(), fl = f ? 'Back to the panel' : 'Full width';
112
- return `<button type="button" class="ivx-pick" data-iv-zoom aria-haspopup="menu" aria-label="Zoom: ${esc(z[1].toLowerCase())}. Change">${esc(z[1])}${SVG(P.down, 14, 2)}</button>`
113
- + (PHONE() ? '' : `<button type="button" class="iv-ib" data-iv-full aria-pressed="${f}" aria-label="${fl}" title="${fl}">${SVG(f ? P.unfull : P.full, 18)}</button>`);
119
+ /* ── the one view button (batch 18 item 1, XvpA4Sheet): the Tasks header holds this and + only. It shows the view in use; a press opens the
120
+ * view sheet (a bottom sheet on a phone, a popover under it on a desktop): View, Group by and Zoom, three rows of the same shape. ── */
121
+ export function viewBtnHtml(m) {
122
+ const x = VIEWS.find((y) => y[0] === m) || VIEWS[0];
123
+ return `<button type="button" class="ivx-vb" data-iv-vbtn aria-haspopup="dialog" aria-expanded="false" aria-label="${esc('Tasks view: ' + x[1] + '. Change the view, grouping or zoom')}" title="View, group and zoom">${SVG(x[2], 18)}${SVG(P.down, 13, 2.2)}</button>`;
124
+ }
125
+ /** The Kanban's stage picker (or group picker): at the top of the Kanban, not in the header. */
126
+ export function kanbanPickHtml(v) {
127
+ const L = stagesOf(v), k = stageKeyOf(v), x = L.find((y) => y.key === k);
128
+ const what = v.tasks.by && v.tasks.by !== 'stage' ? 'Group' : 'Stage';
129
+ return `<button type="button" class="ivx-pick on" data-iv-kstage aria-haspopup="menu" aria-label="${what}: ${esc(x.label)}. Change">${esc(x.label)}${SVG(P.down, 14, 2)}</button>`;
130
+ }
131
+ /** Full width: a desktop's Weeks and Months only (All fits the panel), at the foot of the Timeline. */
132
+ function fullHtml() {
133
+ if (PHONE() || zoomOf() === 'all') return '';
134
+ const f = fullOn(), fl = f ? 'Back to the panel' : 'Full width';
135
+ return `<button type="button" class="iv-ib ivt-fl" data-iv-full aria-pressed="${f}" aria-label="${fl}" title="${fl}">${SVG(f ? P.unfull : P.full, 16)}</button>`;
136
+ }
137
+ const MORE = 'M5 12h.01M12 12h.01M19 12h.01';
138
+ /** The sheet's rows. g: the grouping as the host knows it ({ by, label } or null where Tasks cannot be grouped). */
139
+ export function sheetHtml(m, g, z = zoomOf()) {
140
+ const seg = (label, items) => `<div class="ivs-seg" role="group" aria-label="${esc(label)}">${items.map((x) => `<button type="button" class="${[x.cls, x.on ? 'on' : ''].filter(Boolean).join(' ')}" aria-pressed="${!!x.on}" ${x.attr}${x.aria ? ` aria-label="${esc(x.aria)}"` : ''} title="${esc(x.tip || x.aria || x.text)}">${x.html || esc(x.text)}</button>`).join('')}</div>`;
141
+ let h = '<p class="ivs-h">View</p>' + seg('View', VIEWS.map(([k, l, d]) => ({ attr: `data-ivs-view="${k}"`, on: k === m, aria: l, html: SVG(d, 18) })));
142
+ if (g) {
143
+ const other = !['stage', 'owner', 'status'].includes(g.by);
144
+ // Epic and Your groups (batch 11 item 20) stay one press away: the ⋯ opens them, named while one is on
145
+ h += '<p class="ivs-h">Group by</p>' + seg('Group by', [['stage', 'Stage'], ['owner', 'Owner'], ['status', 'Status']].map(([k, l]) => ({ attr: `data-ivs-by="${k}"`, on: g.by === k, text: l }))
146
+ .concat({ attr: 'data-ivs-more', cls: 'mo', on: other, aria: other ? 'Grouped by ' + g.label + '. Other groupings' : 'Other groupings: Epic, Your groups', html: other ? esc(g.label) : SVG(MORE, 18, 3) }));
114
147
  }
115
- if (m === 'kanban') {
116
- const L = stagesOf(v), k = stageKeyOf(v), x = L.find((y) => y.key === k);
117
- const what = v.tasks.by && v.tasks.by !== 'stage' ? 'Group' : 'Stage';
118
- return `<button type="button" class="ivx-pick on" data-iv-kstage aria-haspopup="menu" aria-label="${what}: ${esc(x.label)}. Change">${esc(x.label)}${SVG(P.down, 14, 2)}</button>`;
148
+ if (m === 'timeline') {
149
+ h += '<p class="ivs-h">Zoom</p>' + seg('Zoom', ZOOMS.map(([k, l]) => ({ attr: `data-ivs-zoom="${k}"`, on: k === z, text: l, aria: k === 'all' ? 'All: the whole initiative fits the screen' : l })));
150
+ if (z === 'all') h += '<p class="ivs-note">All fits the whole initiative, however long. Tap a stage to see its tasks.</p>';
119
151
  }
120
- return '';
152
+ return `<div class="tkc-pop ivs" role="dialog" aria-label="Tasks view"><span class="ivs-grab" aria-hidden="true"></span>${h}</div>`;
153
+ }
154
+ function openSheet(anchor, H) {
155
+ const g = () => (H.__g && H.__g.ok ? { by: H.__g.by(), label: H.__g.label() } : null);
156
+ const draw = () => { if (POP && POP.anchor === anchor) POP.el.innerHTML = sheetHtml(viewMode(), g()); };
157
+ const el = openPop(anchor, sheetHtml(viewMode(), g()), (b) => {
158
+ const d = b.dataset;
159
+ if (d.ivsView) { setViewMode(d.ivsView); if (H.redraw) H.redraw(); draw(); return; }
160
+ if (d.ivsZoom) { ZOOM = d.ivsZoom; store.set('pmos.tasks.zoom', ZOOM); if (H.redraw) H.redraw(); draw(); return; }
161
+ if (d.ivsBy && H.__g) { const r = H.__g.set(d.ivsBy); if (r && r.then) r.then(draw); else draw(); return; }
162
+ if ('ivsMore' in d && H.__g) { const a = POP && POP.anchor; closePop(); if (a && a.isConnected) H.__g.more(a); }
163
+ }, { sheet: PHONE(), right: true });
164
+ return el;
121
165
  }
122
-
123
166
  /* ── the rows a group holds, flat: the List folds by work package; Timeline and Kanban do not ── */
124
167
  const flat = (sec) => (sec.stages ? sec.stages.flatMap((s) => flat(s)) : [...sec.top, ...sec.groups.flatMap((g) => g.rows)]);
125
168
  const flatDone = (sec) => (sec.stages ? sec.stages.flatMap((s) => flatDone(s)) : sec.done);
@@ -174,8 +217,12 @@ function fitPx(z, days) {
174
217
  }
175
218
  const tone = (x) => (x.closed ? 'dn' : x.late ? 'lt' : x.prog ? 'pr' : '');
176
219
  export function timelineHtml(v, o, isOpen) {
220
+ if (zoomOf() === 'all') return allHtml(v, o, isOpen);
177
221
  const today = dn(v.today) || Math.round(Date.now() / 864e5), z = ZOOMS.find((x) => x[0] === zoomOf());
178
222
  const S = v.tasks.sections;
223
+ // the tasks with no dates share one row at the foot, "N without dates · Set" (XvpA3bMonths), in place of a dashed press on each row
224
+ const undated = (x) => !x.closed && dn(x.start) == null && dn(x.end) == null;
225
+ const ND = o.quick ? S.flatMap(flat).filter(undated) : [];
179
226
  // the range: the open tasks around today, a little air each side; never more than a few years
180
227
  const ns = [];
181
228
  for (const s of S) { for (const x of flat(s).concat(flatDone(s))) { const a = dn(x.start), b = dn(x.end); if (a != null) ns.push(a); if (b != null) ns.push(b); if (x.cmp) { const c = dn(x.cmp.start), d = dn(x.cmp.due); if (c != null) ns.push(c); if (d != null) ns.push(d); } } for (const k of jiraOf(s)) { const b = dn(k.due); if (b != null) ns.push(b); } }
@@ -226,7 +273,11 @@ export function timelineHtml(v, o, isOpen) {
226
273
  // a Jira ticket's bar drags and its ends change the dates kept in PMOS, as a task's do (batch 11 item 23); read-only views draw the due dot
227
274
  const jbar = (k) => { if (o.quick) return barOf0(jiraRow(k)).replace(/class="ivt-(b|d|g) /, 'class="ivt-$1 jr ').replace('class="ivt-g"', 'class="ivt-g jr"');
228
275
  const b = dn(k.due); return b == null ? '' : `<span class="ivt-d jr" role="img" data-ivt-jr="${esc(k.key)}" data-tlx="${X(b) + Math.round(px / 2)}" aria-label="${esc('Due ' + md(b) + ' in Jira')}" title="${esc('Jira · ' + md(b))}"></span>`; };
229
- const row = (n, c, cls = '') => `<div class="ivt-r${cls}"><div class="ivt-n">${n}</div><div class="ivt-c">${c}</div></div>`;
276
+ // on a phone the title sits above its bar, from the bar's start (data-tln; it sticks to the left edge once the start scrolls away)
277
+ const nx = (a, b) => { const n = a != null ? a : b; return n == null ? null : Math.max(0, Math.min(X(n), W - 220)); };
278
+ const row = (n, c, cls = '', at = null) => `<div class="ivt-r${cls}"><div class="ivt-n"${at != null ? ` data-tln="${at}"` : ''}>${n}</div><div class="ivt-c">${c}</div></div>`;
279
+ const when = (x) => (x.days ? `<span class="ivt-wn">· ${esc(x.days)}${x.lateText ? `<b>, ${esc(x.lateText)}</b>` : ''}</span>` : '');
280
+ const trow = (x, cls = '') => row(`${box(x, o)}${title(x, o)}${when(x)}`, barOf(x), ' k' + cls, nx(dn(x.start), dn(x.end)));
230
281
  const band = (rs) => { const ds = rs.flatMap((x) => [dn(x.start), dn(x.end)]).filter((n) => n != null); if (!ds.length) return ''; const a = Math.min(...ds), b = Math.max(...ds); return `<span class="ivt-band" data-tlx="${X(a)}" data-tlw="${Math.max(8, X(b + 1) - X(a))}"></span>`; };
231
282
  // a skipped stage keeps its group row: a hairline from the band before it to the band after it, with » on it (batch 11 item 13, XgapA2Tasks);
232
283
  // a skip before the first dated stage or after the last draws nothing
@@ -247,21 +298,21 @@ export function timelineHtml(v, o, isOpen) {
247
298
  };
248
299
  let h = '';
249
300
  for (const [si, sec] of S.entries()) {
250
- const key = 'sec:' + (sec.key || 'none'), op = isOpen(key, sec.open), rs = flat(sec), dn_ = flatDone(sec), jr = jiraOf(sec), tk = tkOf(sec);
301
+ const key = 'sec:' + (sec.key || 'none'), op = isOpen(key, sec.open), rs = flat(sec).filter((x) => !ND.includes(x)), dn_ = flatDone(sec), jr = jiraOf(sec), tk = tkOf(sec);
251
302
  const has = rs.length || dn_.length || jr.length || tk.length;
252
303
  const head = `<button type="button" class="ivt-gh${sec.kind === 'past' || sec.kind === 'later' || sec.status === 'skip' ? ' mut' : ''}" ${has ? `data-iv-fold="${esc(key)}" aria-expanded="${op}"` : 'disabled'}>${o.mark(sec)}<b>${esc(sec.label || sec.name)}</b>${sec.count ? `<span class="n${sec.warn ? ' w' : ''}">${esc(sec.count)}</span>` : ''}${has ? `<span class="iv-cv" aria-hidden="true">${SVG(op ? P.down : P.right, 15, 2)}</span>` : ''}</button>`;
253
304
  h += row(head, sec.status === 'skip' && !has ? skipLine(si) : band(rs.concat(dn_)), ' g');
254
305
  if (!op || !has) continue;
255
306
  for (const t of tk) h += row(`${tkMark(t)}${tkTitle(t)}`, '', ' k');
256
- for (const k of jr) h += row(`${jmark(k)}${ttitle(k)}`, jbar(k), ' k');
257
- for (const x of rs) h += row(`${box(x, o)}${title(x, o)}`, barOf(x), ' k');
307
+ for (const k of jr) h += row(`${jmark(k)}${ttitle(k)}${k.days ? `<span class="ivt-wn">· ${esc(k.days)}</span>` : ''}`, jbar(k), ' k', nx(dn(k.start), dn(k.due)));
308
+ for (const x of rs) h += trow(x);
258
309
  // a stage with nothing open lists its done tasks straight away, as the List does: no "Done" fold inside the stage's own fold
259
310
  // (PM, 2026-10-27: "Grouping 'Done' items is confusing")
260
- if (dn_.length && !rs.length && !jr.length && !tk.length) for (const x of dn_) h += row(`${box(x, o)}${title(x, o)}`, barOf(x), ' k x' + (x.wont ? ' wo' : ''));
311
+ if (dn_.length && !rs.length && !jr.length && !tk.length) for (const x of dn_) h += trow(x, ' x' + (x.wont ? ' wo' : ''));
261
312
  else if (dn_.length) {
262
313
  const dk = (sec.key || 'none') + ':done', dop = isOpen(dk, false);
263
314
  h += row(`<button type="button" class="ivt-df" data-iv-fold="${esc(dk)}" aria-expanded="${dop}">Done<span class="n">${dn_.length}</span><span class="iv-cv" aria-hidden="true">${SVG(dop ? P.down : P.right, 14, 2)}</span></button>`, dop ? '' : dn_.map(barOf).join(''), ' k');
264
- if (dop) for (const x of dn_) h += row(`${box(x, o)}${title(x, o)}`, barOf(x), ' k x' + (x.wont ? ' wo' : ''));
315
+ if (dop) for (const x of dn_) h += trow(x, ' x' + (x.wont ? ' wo' : ''));
265
316
  }
266
317
  }
267
318
  const grid = ticks.map((t) => `<i data-tlx="${t.x}"></i>`).join('') + guides;
@@ -270,23 +321,126 @@ export function timelineHtml(v, o, isOpen) {
270
321
  const vk = v.vs ? (v.vs.lines && v.vs.cmp ? `<span><i class="pl"></i>${esc((v.vs.cmp.kind === 'plan' ? 'Plan · ' : 'Draft · ') + v.vs.cmp.name)}</span>` : '') + (v.vs.draft ? '<span><i class="dr"></i>Draft</span>' : '') : '';
271
322
  const legend = `<div class="ivt-lg">${v.vs && v.vs.draft ? '' : '<span><i class="to"></i>To do</span><span><i class="pr"></i>In progress</span><span><i class="lt"></i>Late</span>'}<span><i class="dd"></i>Due only</span>${vk}`
272
323
  + (/class="ivt-ng"/.test(h) ? '<span><i class="ng"></i>No activity</span>' : '') + (/class="ivt-sk"/.test(h) ? `<span>${SVG(P.skip, 12, 2)}Skipped</span>` : '')
273
- + `${guides ? `<span>${SVG(P.dia, 11, 2.4)}Milestone</span>` : ''}<span>${SVG(P.jira, 12, 2)}Jira</span>${LK.legendHtml(o.lk)}${o.quick ? `<span class="h">${o.lk && o.lk.links.length ? 'Drag a bar to move it, an end to change dates, a dot to link it' : 'Drag a bar to move it; drag an end to change start or due'}</span>` : ''}</div>`;
324
+ + `${guides ? `<span>${SVG(P.dia, 11, 2.4)}Milestone</span>` : ''}<span>${SVG(P.jira, 12, 2)}Jira</span>${LK.legendHtml(o.lk)}${o.quick ? `<span class="h">${o.lk && o.lk.links.length ? 'Drag a bar to move it, an end to change dates, a dot to link it' : 'Drag a bar to move it; drag an end to change start or due'}</span>` : ''}${fullHtml()}</div>`;
274
325
  // it opens on today, moved left as far as the earliest open task's start, so a late bar is in view
275
326
  const firstOpen = S.flatMap(flat).flatMap((x) => [dn(x.start), dn(x.end)]).filter((n) => n != null);
276
327
  const first = firstOpen.length ? X(Math.min(...firstOpen)) : X(today);
277
328
  return `<div class="ivt"${LK.dataOf(o.lk)} data-ivt="${esc((v.id || v.key) + '|' + z[0])}" data-px="${px}" data-today="${X(today)}" data-first="${first}"><div class="ivt-sc"><div class="ivt-in" data-tlw="${W}">`
278
- + `<div class="ivt-grid" aria-hidden="true">${grid}</div>${axis}${h}<span class="ivt-today" data-tlx="${X(today) + Math.round(px / 2)}" aria-hidden="true"><i>Today</i></span></div></div></div>${legend}`;
329
+ + `<div class="ivt-grid" aria-hidden="true">${grid}</div>${axis}${h}<span class="ivt-today" data-tlx="${X(today) + Math.round(px / 2)}" aria-hidden="true"><i>Today</i></span></div></div>`
330
+ + `<i class="ivt-fade" aria-hidden="true"></i>${noDatesHtml(ND, o, isOpen)}</div>${legend}`;
331
+ }
332
+
333
+ /** The one row for the tasks with no dates (Weeks and Months): "N without dates", and Set. One task: Set opens its date picker. More: Set
334
+ * unfolds them, each with its own date press. */
335
+ function noDatesHtml(ND, o, isOpen) {
336
+ if (!ND.length) return '';
337
+ const n = ND.length, words = n + ' without dates';
338
+ if (n === 1) {
339
+ const x = ND[0];
340
+ return `<div class="ivt-nd"><span class="w">${SVG(P.cal, 16)}${esc(words)}</span><button type="button" class="ivt-set" data-iv-date="${esc(x.uid)}" data-s="" data-e="" aria-label="${esc('Set the dates: ' + x.title)}">Set</button></div>`;
341
+ }
342
+ const op = isOpen('nodates', false);
343
+ const rows = op ? ND.map((x) => `<div class="iv-tr">${box(x, o)}<span class="w">${title(x, o)}<span class="iv-rm">${dateBtn(x, o)}</span></span></div>`).join('') : '';
344
+ return `<div class="ivt-nd"><span class="w">${SVG(P.cal, 16)}${esc(words)}</span><button type="button" class="ivt-set" data-iv-fold="nodates" aria-expanded="${op}" aria-label="${esc(words + '. ' + (op ? 'Hide them' : 'Set their dates'))}">${op ? 'Hide' : 'Set'}</button></div>`
345
+ + (op ? `<div class="ivt-ndl">${rows}</div>` : '');
346
+ }
347
+
348
+ /* ── Timeline at All (batch 18 item 1; phone XvpA3Timeline, desktop XvpD3Timeline): the whole initiative in the width it has, however long.
349
+ * One row per stage, Today across all of them with its chip at the foot. A press on a stage unfolds its tasks and milestones under it.
350
+ * One markup, two layouts (the css container query on .iv-tk): a desktop has a name column (the stage's number, name and dates; under an
351
+ * open stage its tasks with their box and a late or "you" note, ◇ for a milestone) and the bars on the right; a phone keeps a narrow number
352
+ * column and puts each task's title, with its dates, above its bar. Positions are in % of the track, so a narrower panel only scales it.
353
+ * No drag here: a bar's press opens its date picker. ── */
354
+ const short = (n) => "\u2019" + String(new Date(n * 864e5).getUTCFullYear()).slice(2);
355
+ /** "Oct 9 – Nov 27", "Dec 14 – 18", "Mar 1": a stage's days in the name column. */
356
+ const rng = (a, b) => { if (a === b) return md(a); const x = new Date(a * 864e5), y = new Date(b * 864e5); return md(a) + ' \u2013 ' + (x.getUTCMonth() === y.getUTCMonth() && x.getUTCFullYear() === y.getUTCFullYear() ? y.getUTCDate() : md(b)); };
357
+ export function allHtml(v, o, isOpen) {
358
+ const S = v.tasks.sections, today = dn(v.today) || Math.round(Date.now() / 864e5);
359
+ const rowsOf = (sec) => flat(sec).concat(flatDone(sec));
360
+ const spanOf = (sec) => {
361
+ const ds = rowsOf(sec).filter((x) => !x.wont).flatMap((x) => [dn(x.start), dn(x.end)]).concat(jiraOf(sec).flatMap((k) => [dn(k.start), dn(k.due)])).filter((n) => n != null);
362
+ return ds.length ? [Math.min(...ds), Math.max(...ds)] : null;
363
+ };
364
+ const SP = S.map(spanOf), all = SP.filter(Boolean).flat();
365
+ let lo = Math.min(today, ...all), hi = Math.max(today, ...all);
366
+ if (!all.length) { lo = today - 30; hi = today + 60; }
367
+ const pad = Math.max(3, Math.round((hi - lo) * 0.04)); lo -= pad; hi += pad;
368
+ const D = hi - lo + 1, fr = (n) => Math.max(0, Math.min(1, (n - lo) / D));
369
+ const pc = (n) => +(fr(n) * 100).toFixed(2) + '%', pw = (a, b) => +(Math.max(0.8, ((b - a + 1) / D) * 100)).toFixed(2) + '%';
370
+ // the axis: months up to about 14 months (a phone names only the quarters past 5 months), quarters up to 3 years, else years
371
+ const ticks = [];
372
+ for (let n = lo; n <= hi; n++) {
373
+ const d = new Date(n * 864e5), m = d.getUTCMonth(); if (d.getUTCDate() !== 1) continue;
374
+ const yr = m === 0 ? ' ' + short(n) : '';
375
+ if (D <= 150) ticks.push({ n, t: MON[m] + yr, b: m === 0 });
376
+ else if (D <= 430) ticks.push({ n, t: MON[m] + yr, b: m === 0, mo: m % 3 !== 0, q: m % 3 === 0 ? 'Q' + (m / 3 + 1) + yr : '' });
377
+ else if (D <= 1100) { if (m % 3 === 0) ticks.push({ n, t: 'Q' + (m / 3 + 1) + yr, b: m === 0 }); }
378
+ else if (m === 0) ticks.push({ n, t: String(d.getUTCFullYear()), b: true });
379
+ }
380
+ const stageTone = (sec) => (sec.status === 'done' || sec.kind === 'past' ? 'dn' : sec.status === 'now' ? 'now' : '');
381
+ const msMark = (x) => { const b = dn(x.end); if (b == null) return '';
382
+ return `<i class="iva-md${x.done ? ' dn' : x.late ? ' lt' : ''}" data-tlx="${pc(b)}" role="img" aria-label="${esc('Milestone ' + x.title + ', ' + md(b))}" title="${esc(x.title + ' · ' + md(b))}"></i>`; };
383
+ const name = (sec) => sec.label || sec.name || 'Not in a stage';
384
+ const dia = `<span class="iva-mg" aria-hidden="true">${SVG(P.dia, 13, 2.4)}</span>`;
385
+ let h = '';
386
+ for (const [i, sec] of S.entries()) {
387
+ const key = 'sec:' + (sec.key || 'none'), op = isOpen(key, sec.open), rs = flat(sec), dn_ = flatDone(sec), jr = jiraOf(sec), tk = tkOf(sec), sp = SP[i];
388
+ const has = rs.length || dn_.length || jr.length || tk.length;
389
+ const mk = o.mark(sec);
390
+ let mark = '';
391
+ if (sp && sec.ms) mark = `<i class="iva-md st${sec.status === 'done' ? ' dn' : ''}" data-tlx="${pc(sp[1])}"></i>`;
392
+ else if (sp) mark = `<i class="iva-b ${stageTone(sec)}" data-tlx="${pc(sp[0])}" data-tlw="${pw(sp[0], sp[1])}"></i>` + rowsOf(sec).filter((x) => x.ms && !x.wont).map(msMark).join('');
393
+ const when = sp ? (sec.ms ? md(sp[1]) : rng(sp[0], sp[1])) : '';
394
+ const say = name(sec) + (sec.count ? ', ' + sec.count : '') + (sp ? ', ' + rng(sp[0], sp[1]) : ', no dates yet') + (has ? '. ' + (op ? 'Hide' : 'Show') + ' its tasks' : '');
395
+ // the name column (a desktop): the name and the dates, the fold's chevron; a phone shows only the number, or a group's name above its bar
396
+ const lab = `<span class="iva-l" data-tlp="${sp ? fr(sp[0]).toFixed(4) : 0}"><b>${esc(name(sec))}</b>${when ? `<small>${esc(when)}</small>` : ''}${has ? `<span class="iva-ch" aria-hidden="true">${SVG(op ? P.down : P.right, 14, 2.2)}</span>` : ''}</span>`;
397
+ h += `<button type="button" class="iva-r g${op && has ? ' op' : ''}${mk ? '' : ' nm'}${sec.kind === 'past' || sec.kind === 'later' || sec.status === 'skip' ? ' mut' : ''}" ${has ? `data-iv-fold="${esc(key)}" aria-expanded="${op}"` : 'disabled'} aria-label="${esc(say)}" title="${esc(name(sec))}">`
398
+ + `<span class="iva-n">${mk}</span>${lab}<span class="iva-c">${mark}${op && has ? `<span class="iva-cv" aria-hidden="true">${SVG(P.down, 14, 2.4)}</span>` : ''}</span></button>`;
399
+ if (!op || !has) continue;
400
+ // its tasks: tickets drafted, Jira, the open tasks, then the done ones (quieter)
401
+ const trow = (lc, ttl, bar, p0, cls = '') => `<div class="iva-r k${cls}"><span class="iva-n">${lc}</span><span class="iva-l" data-tlp="${p0}">${ttl}</span><span class="iva-c">${bar}</span></div>`;
402
+ // the words after a title: a phone says the dates and the late days; a desktop the late days or "you" only (XvpD3Timeline)
403
+ const tline = (x) => title(x, o)
404
+ + (x.days ? `<span class="ivt-wn">· ${esc(x.days)}${x.lateText ? `<b>, ${esc(x.lateText)}</b>` : ''}</span>` : '')
405
+ + (x.lateText && !x.closed ? `<span class="iva-nt lt">${esc(x.lateText)}</span>` : x.owner === 'You' && !x.closed ? '<span class="iva-nt you">you</span>' : '')
406
+ + (!x.days && o.quick && x.uid && !x.closed ? ' ' + dateBtn(x, o) : '');
407
+ const tbar = (x) => {
408
+ const a = dn(x.start), b = dn(x.end), cls = tone(x) + (x.dr ? ' dr' : '');
409
+ if (a == null && b == null) return '';
410
+ const lb = esc((x.days || '') + (o.quick && x.uid && !x.closed ? '. Change the dates' : ''));
411
+ const at = o.quick && x.uid && !x.closed ? `data-ivt-bar="${esc(x.uid)}" data-s="${esc(x.start)}" data-e="${esc(x.end)}"` : '';
412
+ const tag = at ? 'button' : 'span', open0 = at ? 'button type="button"' : 'span';
413
+ if (x.ms && b != null) return `<${open0} class="iva-md${x.done ? ' dn' : x.late ? ' lt' : ''}" ${at} data-tlx="${pc(b)}" aria-label="${lb}"></${tag}>`;
414
+ const s0 = a == null ? b : a, e0 = b == null ? a : Math.max(a, b);
415
+ return `<${open0} class="iva-tb ${cls}" ${at} data-tlx="${pc(s0)}" data-tlw="${pw(s0, e0)}" aria-label="${lb}"></${tag}>`;
416
+ };
417
+ const p0 = (x) => { const n = dn(x.start) != null ? dn(x.start) : dn(x.end); return n == null ? 0 : fr(n).toFixed(4); };
418
+ for (const t of tk) h += trow(tkMark(t), tkTitle(t), '', 0);
419
+ for (const k of jr) { const r = jiraRow(k); h += trow(jmark(k), ttitle(k) + (k.days ? `<span class="ivt-wn">· ${esc(k.days)}</span>` : ''), tbar({ ...r, title: k.title }), p0(r)); }
420
+ for (const x of rs) h += trow(x.ms ? dia : box(x, o), tline(x), tbar(x), p0(x));
421
+ for (const x of dn_) h += trow(x.ms ? dia : box(x, o), tline(x), tbar(x), p0(x), ' x' + (x.wont ? ' wo' : ''));
422
+ }
423
+ const tick = (t) => `<span class="${[t.b ? 'b' : '', t.mo ? 'mo' : '', t.q ? 'qm' : ''].filter(Boolean).join(' ')}" data-tlx="${pc(t.n)}"${t.q ? ` data-q="${esc(t.q)}"` : ''}>${esc(t.t)}</span>`;
424
+ const axis = `<div class="iva-ax"><span class="iva-n"></span><span class="iva-l"></span><span class="iva-c">${ticks.map(tick).join('')}</span></div>`;
425
+ const grid = `<div class="iva-ly" aria-hidden="true">${ticks.map((t) => `<i class="${t.mo ? 'mo' : ''}" data-tlx="${pc(t.n)}"></i>`).join('')}<i class="iva-tl" data-tlx="${pc(today)}"></i></div>`;
426
+ // Today's chip sits at the foot, under its line
427
+ const foot = `<div class="iva-ft"><span class="iva-n"></span><span class="iva-l"></span><span class="iva-c"><i class="iva-tc" data-tlx="${pc(today)}">Today</i></span></div>`;
428
+ return `<div class="ivt iva" data-iva="${esc(v.id || v.key || '')}" role="region" aria-label="Tasks timeline, the whole initiative">${axis}<div class="iva-bd">${grid}${h}</div>${foot}</div>`;
279
429
  }
280
430
 
281
431
  /** The Timeline's geometry, set at run time as the layout's own custom properties (--tl-x, --tl-w; the stylesheet places them): every
282
432
  * [data-tlx] / [data-tlw] under root. Called on each draw, before the paint. */
283
433
  export function place(root) {
284
434
  if (!root || !root.querySelectorAll) return;
285
- for (const e of root.querySelectorAll('[data-tlx], [data-tlw]')) {
435
+ for (const e of root.querySelectorAll('[data-tlx], [data-tlw], [data-tln], [data-tlp]')) {
286
436
  if (e.__tl) continue; // placed once: a drag moves it from there
287
437
  e.__tl = true;
288
- if (e.dataset.tlx != null) e.style.setProperty('--tl-x', e.dataset.tlx + 'px');
289
- if (e.dataset.tlw != null) e.style.setProperty('--tl-w', e.dataset.tlw + 'px');
438
+ // Timeline at All places in % of its track; Weeks and Months in px
439
+ const u = (x) => (/%$/.test(x) ? x : x + 'px');
440
+ if (e.dataset.tlx != null) e.style.setProperty('--tl-x', u(e.dataset.tlx));
441
+ if (e.dataset.tlw != null) e.style.setProperty('--tl-w', u(e.dataset.tlw));
442
+ if (e.dataset.tln != null) e.style.setProperty('--tl-n', u(e.dataset.tln));
443
+ if (e.dataset.tlp != null) e.style.setProperty('--tl-p', e.dataset.tlp); // a fraction of the track (All on a phone)
290
444
  }
291
445
  }
292
446
 
@@ -321,22 +475,28 @@ export function kanbanHtml(v, o, isOpen) {
321
475
 
322
476
  /* ── the popovers: the task card's own status segment and date picker, opened right under the press ── */
323
477
  let POP = null;
324
- function closePop() { if (!POP) return; const { el, anchor } = POP; POP = null; el.remove(); if (anchor && anchor.isConnected) anchor.setAttribute('aria-expanded', 'false'); }
325
- function openPop(anchor, html, onPress) {
478
+ function closePop() { if (!POP) return; const { el, anchor, scrim } = POP; POP = null; el.remove(); if (scrim) scrim.remove(); if (anchor && anchor.isConnected) anchor.setAttribute('aria-expanded', 'false'); }
479
+ /** o.sheet: a bottom sheet over a scrim (a phone); o.right: the popover's right edge under the press's right edge. */
480
+ function openPop(anchor, html, onPress, o = {}) {
326
481
  closePop(); cardStyle();
327
482
  const el = document.createElement('div');
328
- el.className = 'tkc ivq'; el.dataset.escLayer = ''; el.innerHTML = html; document.body.appendChild(el); // data-esc-layer: Escape closes this first, not the Viewer
329
- const r = anchor.getBoundingClientRect(), w = el.offsetWidth, h = el.offsetHeight;
330
- const left = Math.max(8, Math.min(r.left, innerWidth - w - 8)), below = r.bottom + 6 + h <= innerHeight - 8;
331
- el.style.setProperty('--tl-x', left + 'px'); el.style.setProperty('--tl-y', (below ? r.bottom + 6 : Math.max(8, r.top - 6 - h)) + 'px');
483
+ el.className = 'tkc ivq' + (o.sheet != null ? ' vs-pop' : '') + (o.sheet ? ' sheet' : ''); el.dataset.escLayer = ''; el.innerHTML = html; // data-esc-layer: Escape closes this first, not the Viewer
484
+ let scrim = null;
485
+ if (o.sheet) { scrim = document.createElement('div'); scrim.className = 'vs-scrim'; document.body.appendChild(scrim); }
486
+ document.body.appendChild(el);
487
+ if (!o.sheet) {
488
+ const r = anchor.getBoundingClientRect(), w = el.offsetWidth, h = el.offsetHeight;
489
+ const left = Math.max(8, Math.min(o.right ? r.right - w : r.left, innerWidth - w - 8)), below = r.bottom + 6 + h <= innerHeight - 8;
490
+ el.style.setProperty('--tl-x', left + 'px'); el.style.setProperty('--tl-y', (below ? r.bottom + 6 : Math.max(8, r.top - 6 - h)) + 'px');
491
+ }
332
492
  anchor.setAttribute('aria-expanded', 'true');
333
- POP = { el, anchor, onPress };
334
- const f = el.querySelector('[aria-checked="true"], button'); if (f) f.focus({ preventScroll: true });
493
+ POP = { el, anchor, onPress, scrim };
494
+ const f = el.querySelector('[aria-checked="true"], [aria-pressed="true"], button'); if (f) f.focus({ preventScroll: true });
335
495
  return el;
336
496
  }
337
497
  if (typeof document !== 'undefined' && document.head) {
338
498
  cardStyle(); // the task card's look, before the first press, so a picker opens at its own size
339
- document.addEventListener('pointerdown', (e) => { if (POP && !POP.el.contains(e.target) && e.target !== POP.anchor) closePop(); }, true);
499
+ document.addEventListener('pointerdown', (e) => { if (POP && !POP.el.contains(e.target) && e.target !== POP.anchor && !(POP.scrim == null && POP.el.querySelector('.ivs') && e.target.closest && e.target.closest('[data-iv-vbtn]'))) closePop(); }, true);
340
500
  // a press inside the open picker (one listener on the document: the picker's own buttons are real buttons)
341
501
  document.addEventListener('click', (e) => { if (!POP) return; const b = e.target.closest && e.target.closest('button'); if (b && POP.el.contains(b)) POP.onPress(b, e); });
342
502
  // the drags and the long press, read on the document for every Tasks section (each section's body holds its handlers in __iv)
@@ -345,8 +505,9 @@ if (typeof document !== 'undefined' && document.head) {
345
505
  document.addEventListener('pointercancel', () => { dragEnd(); longOff(); });
346
506
  document.addEventListener('pointermove', (e) => dragMove(e));
347
507
  document.addEventListener('keydown', (e) => { if (POP && e.key === 'Escape') { e.stopPropagation(); const a = POP.anchor; closePop(); if (a && a.isConnected) a.focus(); } }, true);
348
- addEventListener('resize', () => closePop());
349
- document.addEventListener('scroll', (e) => { if (POP && !POP.el.contains(e.target)) closePop(); }, true);
508
+ addEventListener('resize', () => { if (POP && !POP.scrim) closePop(); });
509
+ // the view sheet stays through a scroll: its own presses redraw Tasks, and a Timeline settles its scroll as it draws
510
+ document.addEventListener('scroll', (e) => { if (POP && !POP.el.contains(e.target) && !POP.el.querySelector('.ivs')) closePop(); }, true);
350
511
  }
351
512
  /** The five icons (To do, In progress, Done, Won't do | Archive), only the current one named: the task card's segment. */
352
513
  /** ms: the task's ◇ flag, or null where the flag cannot change here: after a second divider, the ◇ toggle (batch 11 item 3).
@@ -400,6 +561,7 @@ let LONG = 0; // a long press opened the status picker: the click that follows
400
561
  /** A press inside the Tasks section that this file owns. → true when handled. */
401
562
  export function press(b, d, root, H, e) {
402
563
  const id = root.dataset.iv;
564
+ if ('ivVbtn' in d) { if (POP && POP.el.querySelector('.ivs')) closePop(); else openSheet(b, H); return true; }
403
565
  if (d.ivView) {
404
566
  // a narrow header shows only the view in use (batch 11 item 20, XtaA5Phone: the group icon, the view, + and Make live fit at 390 px);
405
567
  // its press opens the three as a menu
@@ -408,7 +570,6 @@ export function press(b, d, root, H, e) {
408
570
  setViewMode(d.ivView); closePop(); if (H.redraw) H.redraw(); return true;
409
571
  }
410
572
  if ('ivFull' in d) { REDRAW = H && H.redraw; setFull(!fullOn()); return true; }
411
- if ('ivZoom' in d) { menuPop(b, 'Zoom', ZOOMS.map(([k, l]) => ({ k, label: l, on: k === zoomOf() })), (x) => { ZOOM = x.k; store.set('pmos.tasks.zoom', x.k); if (H.redraw) H.redraw(); }); return true; }
412
573
  if ('ivKstage' in d) {
413
574
  const v = H.__v; if (!v) return true;
414
575
  const cur = stageKeyOf(v);
@@ -449,7 +610,10 @@ export function wireDrag(body, after) {
449
610
  sc.__settled = true;
450
611
  const k = T.dataset.ivt, nw = T.querySelector('.ivt-n') ? T.querySelector('.ivt-n').offsetWidth : 0;
451
612
  sc.scrollLeft = SCROLL.has(k) ? SCROLL.get(k) : Math.max(0, Math.min((+T.dataset.today || 0) - Math.max(0, sc.clientWidth - nw) * 0.25, (+T.dataset.first || 0) - 16));
452
- sc.addEventListener('scroll', () => SCROLL.set(k, sc.scrollLeft), { passive: true });
613
+ // an earlier start fades in at the left edge once the Timeline is scrolled from its start (XvpA3bMonths)
614
+ const fade = () => T.classList.toggle('scl', sc.scrollLeft > 2);
615
+ fade();
616
+ sc.addEventListener('scroll', () => { SCROLL.set(k, sc.scrollLeft); fade(); }, { passive: true });
453
617
  }
454
618
  if (after) after();
455
619
  };
@@ -7,7 +7,8 @@
7
7
  * iniView(r, ctx) → { summary, stage, tasks, vs } the whole view, as data (vs: what pm/ini-versions.js rowFor put on the row, or null)
8
8
  * ctx: { steps (Product feature's eight, the model's), today (YYYY-MM-DD, the model's day), usual ({ days } | null, the usual days in the
9
9
  * current stage), grill ({ open, later } | null), program ({ id, title } | null), jiraAt ('Jira · 2h ago' | ''), ask ({ title } | null: a
10
- * session that waits on the PM, Home's), docs (count | null), linked (count | null) }
10
+ * session that waits on the PM, Home's; n: how many wait on this initiative), docs (count | null), linked (count | null), claude (Claude's
11
+ * line while a session works on it, Home's), people ([{ name }]: the stakeholders) }
11
12
  * stagesOf(r, steps) → { list: [{ key, name, ms, status: done | now | next | skip, why }], cur } the initiative's OWN workflow (D99)
12
13
  * sectionOf(task, list) → the stage key the task sits under in the breakdown, or '' (a WBS section is a task's place, never its state)
13
14
  * wbsOf(title) → { code, top } | null "10.5 TC to review" → { code: '10.5', top: '10' }; "WP-03 Token exchange" → { code: 'WP-03', top: 'WP' }
@@ -254,7 +255,7 @@ export function iniView(r, ctx = {}) {
254
255
  // what waits on the PM: the track's, else the trail's (the Board merges the trail into the track; Home reads the row as sent)
255
256
  const you = t.you || (it.you && it.you.text) || null, youKind = t.youKind || (it.you && it.you.kind) || null, youWhy = t.youWhy || (it.you && it.you.why) || '';
256
257
  let wait = null;
257
- if (ctx.ask && ctx.ask.title) wait = { text: '“' + ctx.ask.title + '” needs your answer.', primary: { act: 'ask', label: 'Answer: ' + ctx.ask.title } };
258
+ if (ctx.ask && ctx.ask.title) wait = { text: '“' + ctx.ask.title + '” needs your answer.', say: 'Can you answer “' + ctx.ask.title + '”? I’ll carry on once you do.', primary: { act: 'ask', label: 'Answer: ' + ctx.ask.title } };
258
259
  else if (you && youKind) wait = { text: youWhy, primary: youKind === 'drift' && it.links && it.links.prd ? { act: 'doc:' + it.links.prd, label: 'Open the PRD' } : youKind === 'commit' ? { act: 'commit', label: 'Send to Jira' } : { act: 'page', label: you } };
259
260
  else if (you) { const opn = tk.filter((k) => k.status !== 'Done').length; wait = { text: opn ? plural(opn, 'ticket is', 'tickets are') + ' still open, so the sign-off can wait until they close.' : 'Every release ticket is done.', primary: { act: 'page', label: you } }; }
260
261
  else if (ctx.grill && ctx.grill.open && !ctx.grill.later) wait = { text: 'PMOS asks what the BRD needs that the Why does not say yet.', primary: { act: 'grill', label: 'Answer the questions' } };
@@ -264,6 +265,11 @@ export function iniView(r, ctx = {}) {
264
265
  : { line: s.tone === 'late' && /^The plan ended /.test(why) ? 'Late' : s.text, tone: s.tone === 'late' || s.tone === 'risk' ? 'warn' : s.tone === 'ok' ? 'ok' : '', right: progress,
265
266
  text: [why, lateSay].filter(Boolean).join(' '), primary: null, status: null };
266
267
  summary.owner = r.owner ? { name: r.owner, av: initials(r.owner) } : null;
268
+ // the card in Adler's voice (batch 18 item 1, XvpA1): what he asks, how many asks wait here, Claude's line while it works, the stakeholders
269
+ summary.say = wait ? wait.say || summary.text : '';
270
+ summary.n = wait ? Math.max(1, (ctx.ask && ctx.ask.n) || 1) : 0;
271
+ summary.claude = !wait && ctx.claude ? String(ctx.claude) : '';
272
+ summary.stake = (ctx.people || []).filter((x) => x && x.name).map((x) => ({ name: x.name, av: initials(x.name) }));
267
273
  summary.wf = r.wf || { id: PF_ID, name: 'Product feature', icon: 'feature' };
268
274
  summary.program = ctx.program || null;
269
275
  const today2 = (n) => String(n).padStart(2, '0');