create-pmos 0.420.0 → 0.422.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 (88) 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/scripts/anchor-resolve.js +93 -15
  6. package/payload/state/discoveries.md +1 -1
  7. package/workspace/board-programs-test.js +59 -3
  8. package/workspace/briefing-premium-board-test.js +1 -1
  9. package/workspace/changelog.json +24 -0
  10. package/workspace/fixtures/report-api/draft.json +2 -1
  11. package/workspace/guide/briefing-premium.md +2 -1
  12. package/workspace/guide/home.md +6 -2
  13. package/workspace/guide/programs.md +4 -3
  14. package/workspace/home-other-product-test.js +55 -0
  15. package/workspace/lib/board-premium.js +18 -4
  16. package/workspace/lib/briefing-premium-agent.js +8 -0
  17. package/workspace/lib/doc-live-root.js +37 -0
  18. package/workspace/lib/engine/anchor-resolve.js +93 -15
  19. package/workspace/lib/engine/boards.js +7 -2
  20. package/workspace/lib/engine/intake.js +1 -1
  21. package/workspace/lib/first-input.js +13 -6
  22. package/workspace/lib/hold-spans.js +24 -10
  23. package/workspace/lib/kg.js +1 -1
  24. package/workspace/lib/report-draft.js +3 -0
  25. package/workspace/lib/route-modules.js +1 -0
  26. package/workspace/lib/routes-board-premium.js +6 -0
  27. package/workspace/lib/routes-boards.js +48 -9
  28. package/workspace/lib/routes-doc-sheet.js +29 -1
  29. package/workspace/lib/routes-programs.js +44 -5
  30. package/workspace/lib/routes-task-plans.js +333 -0
  31. package/workspace/lib/task-cli.js +16 -9
  32. package/workspace/lib/task-items.js +1 -1
  33. package/workspace/lib/task-plans.js +232 -0
  34. package/workspace/lib/transcript-read.js +29 -1
  35. package/workspace/lib/vendor/scripts/anchor-resolve.js +93 -15
  36. package/workspace/lib/vendor/scripts/intake.js +1 -1
  37. package/workspace/package-lock.json +2 -2
  38. package/workspace/package.json +1 -1
  39. package/workspace/premium-viewer-test.js +1 -1
  40. package/workspace/premium-vw-doc-test.js +26 -3
  41. package/workspace/program-leave-test.js +203 -0
  42. package/workspace/public/pm/bd-acts.js +5 -2
  43. package/workspace/public/pm/bd-ini-panel.js +20 -7
  44. package/workspace/public/pm/bd-prog-panel.js +22 -7
  45. package/workspace/public/pm/bd-span.js +177 -24
  46. package/workspace/public/pm/cozy-board.css +80 -0
  47. package/workspace/public/pm/cozy-home.css +3 -0
  48. package/workspace/public/pm/cozy-live-pill.js +1 -1
  49. package/workspace/public/pm/cozy-nav.js +1 -1
  50. package/workspace/public/pm/cozy-steps.js +1 -1
  51. package/workspace/public/pm/cozy-xv.js +1 -1
  52. package/workspace/public/pm/doc-follow.js +36 -0
  53. package/workspace/public/pm/home-app.js +38 -7
  54. package/workspace/public/pm/home-ask.js +7 -0
  55. package/workspace/public/pm/home-ini.js +13 -4
  56. package/workspace/public/pm/home-line.js +1 -1
  57. package/workspace/public/pm/home-list.js +2 -2
  58. package/workspace/public/pm/home-today.js +3 -1
  59. package/workspace/public/pm/ini-tasks.js +81 -16
  60. package/workspace/public/pm/ini-versions.js +343 -0
  61. package/workspace/public/pm/ini-view-model.js +27 -41
  62. package/workspace/public/pm/ini-view.css +82 -0
  63. package/workspace/public/pm/ini-view.js +18 -11
  64. package/workspace/public/pm/premium-board.js +109 -18
  65. package/workspace/public/pm/premium-insights.js +1 -1
  66. package/workspace/public/pm/premium-mtg-present.js +2 -2
  67. package/workspace/public/pm/premium-report-read.js +21 -2
  68. package/workspace/public/pm/premium-report-tab.js +1 -1
  69. package/workspace/public/pm/premium-shell.js +29 -4
  70. package/workspace/public/pm/premium-viewer.js +3 -3
  71. package/workspace/public/pm/premium-vw-doc.js +46 -11
  72. package/workspace/public/pm/premium-vw-mtg.js +1 -1
  73. package/workspace/public/pm/premium-vw-open.js +1 -1
  74. package/workspace/public/pm/premium-vw-slides.js +1 -1
  75. package/workspace/public/pm/prog-move.js +69 -0
  76. package/workspace/public/pm/prog-order.js +1 -1
  77. package/workspace/public/pm/task-card.css +3 -0
  78. package/workspace/public/pm/task-card.js +10 -3
  79. package/workspace/public/pm/tk-send.js +1 -1
  80. package/workspace/server.js +26 -2
  81. package/workspace/task-milestones-test.js +176 -0
  82. package/workspace/task-plans-test.js +175 -0
  83. package/workspace/task-views-test.js +2 -2
  84. package/workspace/test-lists/program-leave.json +6 -0
  85. package/workspace/test-lists/task-milestones.json +6 -0
  86. package/workspace/test-lists/task-plans.json +6 -0
  87. package/workspace/test-lists/viewer-live-file.json +9 -0
  88. package/workspace/timeline-holds-test.js +70 -5
@@ -19,9 +19,16 @@
19
19
  * ⏸ button where it stopped and the return date where it starts again (a phone keeps the ⏸ only); a stretch of 4 weeks or more with no dated work just
20
20
  * breaks it. The done part fills the pieces in order and skips the gaps. No return date: dotted to today, the rest faded. Return date passed: dotted to
21
21
  * today in the late colour. Return after Deliver: the ◇ turns amber and says so; no date is moved. A gap narrower than 8 px closes up. The program line
22
- * is dotted where every member is on hold. */
22
+ * is dotted where every member is on hold.
23
+ * No activity (feedback batch 11 item 13; XgapA1Board, XgapAHard, XgapA3Phone, XgapAGrill): a stretch of 2 weeks or more with no dated work draws a
24
+ * 2 px hairline in the To do grey at the bar's middle; a hold still wins for its dates. Its words: "No activity, Sep 19 to Oct 18 · 4 wk" before
25
+ * today, "Nothing planned, Oct 27 to Nov 29 · 5 wk" after it, both across it. One press per gap: a card with the words, and + (New task with the
26
+ * gap's dates) while part of it is ahead. A skipped stage between two dated stages is one » on the hairline, or on the bar at the joint when
27
+ * there is no gap; skips at either end are not drawn; a » with less than 24 px is dropped and its words go to the bar's title. A phone draws
28
+ * the hairline and » only; its row sheet lists them. A gap never changes the row's dot or risk. */
23
29
  import { esc } from './premium-shell.js';
24
30
  import { mergeClose } from './program-model.js';
31
+ import { stagesOfRow } from './bd-wf.js';
25
32
 
26
33
  const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
27
34
  const day = (v) => { const m = /^(\d{4})-(\d{2})-(\d{2})/.exec(String(v || '')); return m ? new Date(+m[1], +m[2] - 1, +m[3]) : null; };
@@ -36,7 +43,7 @@ export const DRAWN = new Set(SPANS.map(([k]) => k));
36
43
  const SV = (d) => `<svg viewBox="0 0 24 24" aria-hidden="true"><path d="${d}"/></svg>`;
37
44
  const FLAG = 'M5 21V4M5 4h11l-2 4 2 4H5';
38
45
  const LINK = 'M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1';
39
- const CHL = 'M15 6l-6 6 6 6', CHR = 'M9 6l6 6-6 6', PAUSE = 'M9 6v12M15 6v12';
46
+ const CHL = 'M15 6l-6 6 6 6', CHR = 'M9 6l6 6-6 6', PAUSE = 'M9 6v12M15 6v12', SKIP = 'M6 7l5 5-5 5M13 7l5 5-5 5';
40
47
 
41
48
  /** The scale of each span from Quarter on (TsAllSpans): its column, and how many columns one screen shows on a desktop and on a phone. */
42
49
  export const SCALE = { quarter: { unit: 'w', cols: 7, ph: 3 }, half: { unit: 'm', cols: 6, ph: 3 }, year: { unit: 'm', cols: 12, ph: 4 }, y2: { unit: 'q', cols: 8, ph: 4 }, y5: { unit: 'y', cols: 5, ph: 2 } };
@@ -78,8 +85,11 @@ export function windowOf(span, now, phone, sprint, dates) {
78
85
  const pctOf = (W) => (d) => Math.max(0, Math.min(100, ((d - W.from) / (W.to - W.from)) * 100));
79
86
  const P = (x) => x.toFixed(2) + '%';
80
87
  const doneOf = (r) => { const p = r.track && r.track.prog; return p ? Math.max(0, Math.min(100, (p.done / Math.max(1, p.total)) * 100)) : 0; };
81
- const toneOf = (r) => (r.late ? 'late' : r.status === 'at risk' ? 'risk' : r.track && r.track.you ? 'you' : r.status === 'on track' ? 'ok' : 'q');
82
- const dated = (r) => day(r.start) || day(r.end) || (r.track && day(r.track.forecast));
88
+ /** A milestone task past its due date and not done (feedback batch 11 item 3): its ◇ turns orange, and so does the row's dot. */
89
+ const msLate = (m, now) => !m.done && day(m.date) && day(m.date) < new Date(now.getFullYear(), now.getMonth(), now.getDate());
90
+ export const anyMsLate = (r, now) => !!(now && (r.milestones || []).some((m) => msLate(m, now)));
91
+ const toneOf = (r, now) => (r.late || anyMsLate(r, now) ? 'late' : r.status === 'at risk' ? 'risk' : r.track && r.track.you ? 'you' : r.status === 'on track' ? 'ok' : 'q');
92
+ const dated = (r) => day(r.start) || day(r.end) || (r.track && day(r.track.forecast)) || (r.draft && day(r.draft.start));
83
93
  /** Done work leaves no edge tab (TsCGrill 5): the initiative is past Deliver, or every part it counts is done. */
84
94
  const isDone = (r) => !!(r.track && (r.track.k >= 6 || (r.track.prog && r.track.prog.total > 0 && r.track.prog.done >= r.track.prog.total)));
85
95
  /** A row's holds as spans on the bar: [{ a, b, kind, h, i }]. kind: past (resumed), open (the return date ahead), over (the return date passed:
@@ -100,6 +110,52 @@ export function holdSpans(r, now) {
100
110
  const openBack = (r, now) => { const o = holdSpans(r, now).find((x) => x.kind === 'open'); return o ? o.b : null; };
101
111
  /** Whether any of `rows` draws a hold (the legend's "On hold" key shows only then: zero is silence). */
102
112
  export const hasHold = (rows, now = new Date()) => (rows || []).some((r) => day(r.start) && day(r.end) && holdSpans(r, now).length);
113
+ /** What planned versus actual draws on these rows, for the legend's Plan and Draft keys (zero is silence). */
114
+ export const planKeys = (rows) => ({ plan: (rows || []).some((r) => r.plan && day(r.plan.start) && !(r.plan.start === r.start && r.plan.end === r.end)), draft: (rows || []).some((r) => r.draft && !day(r.start) && !day(r.end)) });
115
+ /** What the no-activity marks draw on these rows, for the legend's No activity and Skipped keys (zero is silence). */
116
+ export const gapKeys = (rows) => ({ gap: (rows || []).some((r) => plainGaps(r).length), skip: (rows || []).some((r) => skipsOf(r).length) });
117
+ /** A row's plain gaps inside its plan, as [a, b] days, less the part a hold covers (a hold wins for its dates). */
118
+ export function plainGaps(r, now = new Date()) {
119
+ const s = day(r.start), e = day(r.end); if (!s || !e) return [];
120
+ const H = holdSpans(r, now), out = [];
121
+ for (const g of Array.isArray(r.gaps) ? r.gaps : []) {
122
+ let parts = [[day(g.from), day(g.to)]];
123
+ if (!parts[0][0] || !parts[0][1]) continue;
124
+ for (const x of H) parts = parts.flatMap(([a, b]) => (x.a < b && x.b > a ? [[a, x.a], [x.b, b]].filter(([p, q]) => q > p) : [[a, b]]));
125
+ for (const [a, b] of parts) if (b > s && a < e) out.push([a < s ? s : a, b > e ? e : b, g]);
126
+ }
127
+ return out.sort((p, q) => p[0] - q[0]);
128
+ }
129
+ /** The length of a stretch of days, counted both ends: "4 wk", or "5 days" under a week. */
130
+ const lenOf = (a, b) => { const n = Math.round((b - a) / 864e5) + 1; return n < 7 ? n + (n === 1 ? ' day' : ' days') : Math.round(n / 7) + ' wk'; };
131
+ /** A gap's words (XgapAGrill): its empty days, the day after the work before it to the day before the work after it. Before today "No activity",
132
+ * after it "Nothing planned", split at today when it runs across. → [line, line?] */
133
+ export function gapWords(a, b, now) {
134
+ const t = new Date(now.getFullYear(), now.getMonth(), now.getDate()), p = addDays(a, 1), q = addDays(b, -1);
135
+ const say = (w, u, v) => w + ', ' + md(u) + ' to ' + md(v) + ' · ' + lenOf(u, v);
136
+ if (q < t) return [say('No activity', p, q)];
137
+ if (p >= t) return [say('Nothing planned', p, q)];
138
+ return [say('No activity', p, addDays(t, -1)), say('Nothing planned', t, q)];
139
+ }
140
+ /** The skipped stages of a row that sit between two stages with dated work: [{ lo, hi, items: [{ name, why }] }]. lo is the end of the dated work
141
+ * before them, hi the start of the dated work after. Skips before the first dated stage or after the last are not drawn (XgapAGrill). */
142
+ export function skipsOf(r) {
143
+ const S = stagesOfRow(r), SP = Array.isArray(r.stageSpans) ? r.stageSpans : [];
144
+ if (!S.some((x) => x.skipped || x.status === 'skipped') || !SP.length) return [];
145
+ const norm = (v) => String(v || '').toLowerCase().replace(/[^a-z0-9]/g, '');
146
+ const spanOf = (st) => SP.find((x) => x.stage === st.key || norm(x.stage) === norm(st.key) || norm(x.stage) === norm(st.name));
147
+ const dated = S.map((st, i) => ({ i, sp: spanOf(st) })).filter((x) => x.sp && day(x.sp.start));
148
+ const out = [];
149
+ for (let n = 1; n < dated.length; n++) {
150
+ const p = dated[n - 1], q = dated[n];
151
+ const items = S.slice(p.i + 1, q.i).filter((x) => x.skipped || x.status === 'skipped').map((x) => ({ name: x.name, why: ((x.skipped || x.reading || {}).why) || '' }));
152
+ if (items.length) out.push({ lo: day(p.sp.due) || day(p.sp.start), hi: day(q.sp.start), items });
153
+ }
154
+ return out;
155
+ }
156
+ /** One » mark's words: "Plan skipped: the security review fixed the scope", one sentence for each stage. */
157
+ export const skipWords = (items) => items.map((x) => x.name + ' skipped' + (x.why ? ': ' + x.why.replace(/\.$/, '').replace(/^./, (c) => c.toLowerCase()) : '')).join('. ');
158
+
103
159
  /** The first and last mark of a row: the plan, the forecast, a return date ahead, and today while it is over. */
104
160
  function extentOf(r, now) {
105
161
  const s = day(r.start), e = day(r.end), fc = r.track && day(r.track.forecast), ds = [s, e, fc].filter(Boolean);
@@ -110,9 +166,10 @@ function extentOf(r, now) {
110
166
 
111
167
  /** One initiative's marks: the plan with its done part, the days over, the forecast past the plan, and one label after the furthest mark. A
112
168
  * date reads by the span's scale (o.fmt). */
113
- function qBar(r, X, now, phone, fmt, pxPct) {
169
+ function qBar(r, X, now, phone, fmt, pxPct, ms = {}) {
114
170
  const s = day(r.start), e = day(r.end), fc = r.track && day(r.track.forecast), tone = toneOf(r);
115
- let out = marks(r, X, now, phone), clash = null;
171
+ const tm = taskMarks(r, X, now, phone, pxPct, ms), et = tm.end;
172
+ let out = marks(r, X, now, phone) + tm.html, clash = null;
116
173
  if (s && e) {
117
174
  const g = gapsHtml(r, X, now, phone, fmt, pxPct || 0, s, e, tone);
118
175
  out += g.html; clash = g.clash;
@@ -120,16 +177,42 @@ function qBar(r, X, now, phone, fmt, pxPct) {
120
177
  if (over) { out += `<span class="tg-over" style="left:${P(X(e))};width:${P(Math.max(0.1, X(now) - X(e)))}"></span>`; words.push(r.overDays + ' ' + (r.overDays === 1 ? 'day' : 'days') + ' over'); }
121
178
  if (late) { out += `<span class="tg-fc" style="left:${P(X(e))};width:${P(X(fc) - X(e))}" title="Jira forecast ${esc(md(fc))}"></span>`; words.push('Jira forecast ' + fmt(fc)); }
122
179
  // the committed end is the Deliver or Evaluate ◇ (PgTimeline), with its date right of it; filled while the initiative is at that milestone
123
- out += `<i class="tg-end${r.track && r.track.ms ? ' ms' : ''}${over || clash ? ' late' : ''}" style="left:${P(X(e))}" title="${esc((r.track && r.track.k >= 6 ? 'Committed evaluation date ' : 'Committed delivery date ') + md(e) + (clash ? '. ' + clash : ''))}"></i>`;
124
- if (clash && !phone) out += `<span class="tg-lab late tg-clash" style="left:${P(X(e))}">${esc(fmt(e) + ' · ' + clash)}</span>`;
125
- else if (words.length && !phone) out += `<span class="tg-lab ${over ? 'late' : 'fc'}" style="left:${P(Math.max(over ? X(now) : 0, late ? X(fc) : 0))}">${esc((over ? '' : fmt(e) + ' · ') + words.join(' · '))}</span>`;
126
- else if (!phone) out += `<span class="tg-endl" style="left:${P(X(e))}">${esc(fmt(e))}</span>`;
180
+ // a milestone task in the stage the end ◇ stands for IS that ◇ (say it once, batch 11 item 3): the ◇ takes its name, and its done
181
+ const eTitle = et ? et.name + ' · ' + md(day(et.date)) + (et.stage ? ' · ◆ ' + et.stage : '') : (r.track && r.track.k >= 6 ? 'Committed evaluation date ' : 'Committed delivery date ') + md(e);
182
+ out += `<i class="tg-end${r.track && r.track.ms ? ' ms' : ''}${et && et.done ? ' dn' : ''}${over || clash || (et && msLate(et, now)) ? ' late' : ''}" style="left:${P(X(e))}" title="${esc(eTitle + (clash ? '. ' + clash : ''))}"></i>`;
183
+ if (clash && !phone) out += `<span class="tg-lab late tg-clash" style="left:${P(X(e))}">${esc(fmt(e) + ' · ' + clash)}${slipHtml(r)}</span>`;
184
+ else if (words.length && !phone) out += `<span class="tg-lab ${over ? 'late' : 'fc'}" style="left:${P(Math.max(over ? X(now) : 0, late ? X(fc) : 0))}">${esc((over ? '' : fmt(e) + ' · ') + words.join(' · '))}${slipHtml(r)}</span>`;
185
+ else if (!phone) out += `<span class="tg-endl" style="left:${P(X(e))}">${esc(fmt(e))}${slipHtml(r)}</span>`;
127
186
  } else if (fc) {
128
187
  out += `<span class="tg-fc solo" style="left:${P(X(fc))};width:12px;margin-left:-12px" title="Jira forecast ${esc(md(fc))}"></span>${phone ? '' : `<span class="tg-lab fc" style="left:${P(X(fc))}">Jira forecast ${esc(fmt(fc))}</span>`}`;
188
+ } else if (r.draft && day(r.draft.start)) {
189
+ out += draftBar(r, X, phone, fmt);
129
190
  } else {
130
191
  const d = s || e; out += `<i class="tg-dm" style="left:${P(X(d))}" title="${s ? 'Starts' : 'Ends'} ${esc(md(d))}"></i>`;
131
192
  }
132
- return out;
193
+ return out + planMarks(r, X, phone, fmt);
194
+ }
195
+
196
+ /* ── planned versus actual (batch 11 item 8; canvas PvaAC4Board): the Board draws Live only ──
197
+ * r.plan: the newest saved plan's span and the end slip (lib/task-plans.js decorate). A thin dark line with end caps under the bar, only where
198
+ * the dates differ; +14d orange after the end date when late, −15d grey when early. r.draft: an initiative with drafts only draws its newest
199
+ * draft dashed, and its title names the drafts. */
200
+ function planMarks(r, X, phone, fmt) {
201
+ const p = r.plan, a = p && day(p.start), b = p && day(p.end);
202
+ if (!a || !b || (p.start === r.start && p.end === r.end)) return '';
203
+ const words = 'Plan · ' + p.name + ' · ' + md(a) + ' to ' + md(b);
204
+ return `<span class="tg-pl" style="left:${P(X(a))};width:${P(Math.max(0.15, X(b) - X(a)))}" role="img" aria-label="${esc(words)}" title="${esc(words)}"></span>`;
205
+ }
206
+ /** The slip after an end date: " +14d" orange, " −15d" grey; nothing when the end did not move. */
207
+ export function slipHtml(r) {
208
+ const n = r && r.plan && r.plan.slip;
209
+ return n ? ` <b class="tg-slip${n > 0 ? ' late' : ''}">${n > 0 ? '+' + n : '\u2212' + -n}d</b>` : '';
210
+ }
211
+ function draftBar(r, X, phone, fmt) {
212
+ const D = r.draft, a = day(D.start), b = day(D.end) || a;
213
+ const tip = r.title + ' · draft. Newest: ' + D.name + (D.end ? ' · ends ' + md(b) : '') + (D.others && D.others.length ? '. Also: ' + D.others.map((x) => x.name + (x.end ? ' · ends ' + md(day(x.end)) : '')).join(', ') : '');
214
+ return `<span class="tg-bar tg-dr" data-key="${esc(r.key)}" style="left:${P(X(a))};width:${P(Math.max(0.15, X(b) - X(a)))}" title="${esc(tip)}" role="img" aria-label="${esc(tip)}"></span>`
215
+ + (phone ? '' : `<span class="tg-endl" style="left:${P(X(b))}">${esc(fmt(b))}</span>`);
133
216
  }
134
217
 
135
218
  const MIN_PX = 8; // a hold or a gap narrower than this closes up (XtiA4Long, XtiAGrill 12)
@@ -150,12 +233,23 @@ function gapsHtml(r, X, now, phone, fmt, pxPct, s, e, tone) {
150
233
  // a resumed hold narrower than 8 px closes up; a hold still running always shows, so its ⏸ is there to press
151
234
  const H = holdSpans(r, now), shown = H.filter((x) => x.kind !== 'past' || wide(x.a, x.b));
152
235
  const cut = shown.map((x) => [x.a, x.b, x]);
153
- for (const g of Array.isArray(r.gaps) ? r.gaps : []) {
154
- const a = day(g.from), b = day(g.to);
155
- if (!a || !b || b <= s || a >= e || !wide(a, b) || H.some((x) => x.a < b && x.b > a)) continue;
156
- cut.push([a < s ? s : a, b > e ? e : b, null]);
157
- }
236
+ // a plain gap that a hold covers in part keeps the part outside it: a hold with no return date runs to today, and the work dated after it
237
+ // starts where its tasks start, not today (feedback batch 10 item 3, Email OTP: the bar came back at today, months before its Build tasks)
238
+ const plain = plainGaps(r, now).filter(([a, b]) => wide(a, b));
239
+ for (const [a, b] of plain) cut.push([a, b, null]);
158
240
  cut.sort((p, q) => p[0] - q[0]);
241
+ // the » of each skipped stage between two dated ones (batch 11 item 13): on the gap that lies between them, else on the bar at the joint
242
+ const marks = [], dropped = [];
243
+ for (const k of skipsOf(r)) {
244
+ const lo = k.lo < k.hi ? k.lo : k.hi, hi = k.lo < k.hi ? k.hi : k.lo;
245
+ const gi = plain.findIndex(([a, b]) => a <= hi && b >= lo);
246
+ const words = skipWords(k.items);
247
+ if (gi >= 0) {
248
+ const [a, b] = plain[gi];
249
+ if (pxPct && (X(b) - X(a)) * pxPct < 24) dropped.push(words); else marks.push({ gi, words });
250
+ } else if (k.hi > s && k.hi < e) marks.push({ x: X(k.hi), words });
251
+ else dropped.push(words);
252
+ }
159
253
  // the pieces: the plan minus the cuts; after a hold with no return date the rest of the plan is faded (nobody knows when it starts)
160
254
  const pieces = []; let at = s, faded = false;
161
255
  for (const [a, b, x] of cut) {
@@ -166,12 +260,25 @@ function gapsHtml(r, X, now, phone, fmt, pxPct, s, e, tone) {
166
260
  if (at < e) pieces.push([at, e, faded]);
167
261
  const days = (p) => Math.max(0, (p[1] - p[0]) / 86400000), total = pieces.reduce((n, p) => n + days(p), 0);
168
262
  let left = (doneOf(r) / 100) * total;
169
- const hold = H.length ? '. ' + H.map((x) => holdWords(x, now)).join('. ') : '';
263
+ const hold = (H.length ? '. ' + H.map((x) => holdWords(x, now)).join('. ') : '') + (dropped.length ? '. ' + dropped.join('. ') : '');
170
264
  let html = pieces.map((p, i) => {
171
265
  const d = days(p), f = d ? Math.max(0, Math.min(1, left / d)) : 0; left -= d;
172
266
  const xl = i > 0 || p[0] > s ? ' xl' : '', xr = i < pieces.length - 1 || p[1] < e ? ' xr' : '';
173
267
  return `<span class="tg-bar t-${tone}${xl}${xr}${p[2] ? ' fd' : ''}" data-key="${esc(r.key)}" style="left:${P(X(p[0]))};width:${P(Math.max(0.15, X(p[1]) - X(p[0])))}" title="${esc('PMOS plan ' + md(s) + ' to ' + md(e) + hold)}"><b style="width:${(f * 100).toFixed(1)}%"></b></span>`;
174
268
  }).join('');
269
+ // each plain gap: the hairline, one press (a 24 px area) with its words; a phone draws the line alone and its row sheet says it
270
+ plain.forEach(([a, b], gi) => {
271
+ const sk = marks.filter((m) => m.gi === gi), lines = gapWords(a, b, now).concat(sk.map((m) => m.words));
272
+ const l = X(a), w = X(b) - l, ahead = addDays(b, -1) >= new Date(now.getFullYear(), now.getMonth(), now.getDate());
273
+ const chev = sk.length ? `<i class="tg-sk" aria-hidden="true">${SV(SKIP)}</i>` : '';
274
+ if (phone) { html += `<span class="tg-ng" style="left:${P(l)};width:${P(w)}" aria-hidden="true">${chev}</span>`; return; }
275
+ html += `<button type="button" class="tg-ng" data-gap="${esc(r.key)}" data-from="${iso(a)}" data-to="${iso(b)}"${ahead ? ' data-ahead="1"' : ''} style="left:${P(l)};width:${P(w)}" aria-label="${esc(lines.join('. '))}" title="${esc(lines.join('\n'))}" aria-haspopup="dialog">${chev}</button>`;
276
+ });
277
+ // a » at a joint (no gap between the two stages) sits on the bar
278
+ for (const m of marks.filter((x) => x.gi == null)) {
279
+ html += phone ? `<i class="tg-sk on" style="left:${P(m.x)}" aria-hidden="true">${SV(SKIP)}</i>`
280
+ : `<span class="tg-sk on" style="left:${P(m.x)}" role="img" aria-label="${esc(m.words)}" title="${esc(m.words)}">${SV(SKIP)}</span>`;
281
+ }
175
282
  for (const x of shown) {
176
283
  const late = x.kind === 'over' ? ' late' : '', l = X(x.a), w = X(x.b) - l, narrow = pxPct && w * pxPct < 34;
177
284
  html += `<span class="tg-gap${late}" style="left:${P(l)};width:${P(w)}" aria-hidden="true"></span>`;
@@ -185,6 +292,46 @@ function gapsHtml(r, X, now, phone, fmt, pxPct, s, e, tone) {
185
292
  const clash = ob ? (r.track && r.track.k >= 6 ? 'Evaluate' : 'Deliver') + ' is before the return, ' + md(ob.b) : null;
186
293
  return { html, clash };
187
294
  }
295
+ const iso = (d) => d.getFullYear() + '-' + String(d.getMonth() + 1).padStart(2, '0') + '-' + String(d.getDate()).padStart(2, '0');
296
+
297
+ /** The key of the workflow's last ◆ stage: its own list's, else Product feature's Evaluate. */
298
+ const lastMs = (r) => { const S = (r.wfStages || []).filter((x) => x && x.milestone); return S.length ? String(S[S.length - 1].key).toLowerCase() : 'evaluate'; };
299
+ /** The ◆ stage a milestone task sits in, by name, or ''. */
300
+ 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()) : ''; };
301
+ /** One ◇ per milestone task on the row (feedback batch 11 item 3; canvas XmlA1Board, XmlA4Hover, XmlA7Spans): at its due date, hollow while open,
302
+ * filled grey when done, an orange outline and an orange date when late. Quarter and Half put a short date under each ◇, Year and 2 yr cut the
303
+ * date to fit, 5 yr and a phone none. ◇s closer than about 40 px merge into one counted ◇ that lists them under it. The latest milestone task in
304
+ * a ◆ stage, or one on the end's own day, is the end ◇ and is not drawn again. Not draggable. → { html, end } */
305
+ function taskMarks(r, X, now, phone, pxPct, ms) {
306
+ const M = (r.milestones || []).filter((m) => day(m.date));
307
+ if (!M.length) return { html: '', end: null };
308
+ // the bar's end ◇ stands for the workflow's last ◆ stage (Evaluate on Product feature): the latest milestone task in that stage IS it, else
309
+ // one on the end's own day; it takes that task's name and done, and is not drawn twice. A task in an earlier ◆ stage keeps its own ◇
310
+ const e = day(r.end), last = lastMs(r);
311
+ let end = null;
312
+ if (e) {
313
+ const inLast = M.filter((m) => m.sec && m.sec.toLowerCase() === last);
314
+ end = inLast.length ? inLast[inLast.length - 1] : M.find((m) => +day(m.date) === +e) || null;
315
+ if (end) end = { ...end, stage: msStage(r, end) };
316
+ }
317
+ const L = M.filter((m) => !end || m.id !== end.id).map((m) => ({ ...m, late: msLate(m, now), stage: msStage(r, m) }))
318
+ .filter((m) => { const x = X(day(m.date)); return x > 0 && x < 100; });
319
+ const C = mergeClose(L, Math.max(1, ms.reach || 7));
320
+ const sp = ms.sp || 'quarter', dates = !phone && sp !== 'y5', cut = sp === 'year' || sp === 'y2';
321
+ const xs = C.map((c) => X(day(c.date))), room = (i) => (pxPct ? Math.min(i ? xs[i] - xs[i - 1] : 1e3, i < xs.length - 1 ? xs[i + 1] - xs[i] : 1e3) * pxPct - 6 : 0);
322
+ const fmtD = (d) => (sp === 'y2' ? my(d) : md(d));
323
+ const html = C.map((c, i) => {
324
+ const x = P(xs[i]), tone = c.late ? ' late' : c.done ? ' dn' : '';
325
+ const one = c.items[0], words = (m) => m.name + ' · ' + md(day(m.date)) + (m.stage ? ' · ◆ ' + m.stage : '') + (m.late ? ' · late' : m.done ? ' · done' : '');
326
+ const mark = c.n > 1
327
+ ? `<button type="button" class="tg-tmc${tone}" data-ms-row="${esc(r.key)}" data-ms-ids="${esc(c.items.map((m) => m.id).join(' '))}" style="left:${x}" aria-haspopup="menu" aria-label="${esc(c.n + ' milestones, ' + c.range + ': ' + c.items.map((m) => m.name).join(', '))}" title="${esc(c.items.map(words).join('\n'))}"><b aria-hidden="true">${c.n}</b></button>`
328
+ : `<span class="tg-tm${tone}" style="left:${x}" role="img" aria-label="${esc('Milestone ' + words(one))}" title="${esc(words(one))}"></span>`;
329
+ if (!dates) return mark;
330
+ const label = c.n > 1 ? c.range : fmtD(day(one.date)), w = cut && room(i) > 0 ? `;max-width:${Math.max(18, Math.round(room(i)))}px` : '';
331
+ return mark + `<span class="tg-tml${c.late ? ' late' : ''}" style="left:${x}${w}">${esc(label)}</span>`;
332
+ }).join('');
333
+ return { html, end };
334
+ }
188
335
 
189
336
  /** A row's milestones: its release's sign-off (◆ at the release date), "Push tickets" where drafted tickets wait on your Commit (today), and
190
337
  * "after <initiative>" at the plan start where a dependency is not done. Each one only from a record. */
@@ -223,13 +370,15 @@ function edgeTabs(r, X, now, phone) {
223
370
  return (isDone(r) ? '' : tab('l', lw, late ? ' late' : '')) + (isDone(r) ? '' : tab('r', rw, ''));
224
371
  }
225
372
 
226
- /** The legend (PgTimeline), in the chip row on every span from Quarter on: done, planned, on hold while a hold is drawn, the Jira forecast, a
227
- * program milestone where a program is drawn, Deliver or Evaluate, today. */
228
- export const legendHtml = (prog, hold) => `<span class="tg-lgd" role="group" aria-label="Legend"><span><i class="k dn"></i>Done in Jira</span><span><i class="k pl"></i>Planned</span>${hold ? '<span><i class="k ho"></i>On hold</span>' : ''}<span><i class="k fc"></i>Jira forecast</span>${prog ? '<span><i class="k pdm"></i>Program milestone</span>' : ''}<span><i class="k dlv"></i>Deliver or Evaluate</span><span><i class="k td"></i>Today</span></span>`;
373
+ /** The legend (PgTimeline), in the chip row on every span from Quarter on: done, to do, a saved plan's line and a draft while one is drawn,
374
+ * No activity and Skipped while one is drawn (extra: { gap, skip }; batch 11 item 13)
375
+ * (extra: { plan, draft }; batch 11 item 8), on hold while a hold is drawn, the Jira forecast, a program milestone where a program is
376
+ * drawn, Milestone (Deliver, Evaluate and every milestone task, batch 11 item 3), today. */
377
+ export const legendHtml = (prog, hold, extra = {}) => `<span class="tg-lgd" role="group" aria-label="Legend"><span><i class="k dn"></i>Done in Jira</span><span><i class="k pl"></i>To do</span>${extra.plan ? '<span><i class="k pln"></i>Plan</span>' : ''}${extra.draft ? '<span><i class="k drf"></i>Draft</span>' : ''}${hold ? '<span><i class="k ho"></i>On hold</span>' : ''}${extra.gap ? '<span><i class="k ng"></i>No activity</span>' : ''}${extra.skip ? `<span><i class="k sk">${SV(SKIP)}</i>Skipped</span>` : ''}<span><i class="k fc"></i>Jira forecast</span>${prog ? '<span><i class="k pdm"></i>Program milestone</span>' : ''}<span><i class="k dlv"></i>Milestone</span><span><i class="k td"></i>Today</span></span>`;
229
378
 
230
379
  /** The dates on record a window must hold: every shown row's plan and forecast, the programs' spans and milestones, the release. */
231
380
  function datesOf(list, M, o) {
232
- const ds = list.flatMap((r) => [day(r.start), day(r.end), r.track && day(r.track.forecast), day(r.start) ? openBack(r, o.now) : null]);
381
+ const ds = list.flatMap((r) => [day(r.start), day(r.end), r.track && day(r.track.forecast), day(r.start) ? openBack(r, o.now) : null, r.plan && day(r.plan.start), r.plan && day(r.plan.end), r.draft && day(r.draft.start), r.draft && day(r.draft.end)]);
233
382
  for (const { g, st } of progGroups(o)) { const sp = progSpan(g); if (sp) ds.push(sp.lo, sp.hi); for (const m of st.milestones || []) ds.push(day(m.date)); }
234
383
  const rel = M.jira && M.jira.release; if (rel) ds.push(day(rel.iso));
235
384
  return ds.filter(Boolean);
@@ -245,6 +394,7 @@ function scaled(rows, M, o) {
245
394
  const days = (W.to - W.from) / 86400000, viewDays = W.fixed ? days : W.cols * COL_DAYS[W.unit];
246
395
  const ratio = days / viewDays, tpx = Math.max(200, o.trackPx || (o.phone ? 340 : 1100)), pxDay = tpx / viewDays;
247
396
  const reach = Math.max(W.fixed ? 1 : 2, Math.round(120 / pxDay)); // program milestones closer than ~120 px merge (TsCGrill 9)
397
+ const msO = { sp, reach: Math.max(1, Math.round(40 / pxDay)) }; // a row's milestone ◇s closer than ~40 px merge (batch 11 item 3)
248
398
  const ov = overlay(W, X, now, sprint, rel), pxPct = (tpx * (W.fixed ? 1 : ratio)) / 100;
249
399
  const ra = rel && day(rel.iso), sa = sprint && day(sprint.start), sb = sprint && day(sprint.end);
250
400
  // an undated program member's track says so beside today, where the view opens
@@ -258,12 +408,15 @@ function scaled(rows, M, o) {
258
408
  const style = `--tw:${Math.round(tpx * (W.fixed ? 1 : ratio))}px`;
259
409
  // a program keeps its undated initiatives as rows that say "No dates" (feedback batch 8 item 4: initiatives just moved into a program
260
410
  // were missing under it); a product group keeps only the dated ones, and the foot names the rest
261
- const G = o.groups ? o.groups.map((g) => (g.kind === 'program' ? { ...g, products: g.products.filter((x) => x.rows.length) } : { ...g, rows: g.rows.filter((r) => list.includes(r)) })).filter((g) => g.rows.length || g.kind === 'program') : null;
411
+ // by key, not by identity: By product copies a program's row ({ ...r, inProgram }), and that copy is never in `list` (batch 11 item 12: a
412
+ // program's initiatives were missing from their product on the timeline)
413
+ const onList = new Set(list.map((r) => r.key));
414
+ const G = o.groups ? o.groups.map((g) => (g.kind === 'program' ? { ...g, products: g.products.filter((x) => x.rows.length) } : { ...g, rows: g.rows.filter((r) => onList.has(r.key)) })).filter((g) => g.rows.length || g.kind === 'program') : null;
262
415
  const empty = '<p class="tg-empty">No initiative on screen has a date on record.</p>';
263
416
  const ext = (r) => { const x = extentOf(r, now); return x ? ` data-a="${X(x.a).toFixed(3)}" data-b="${X(x.b).toFixed(3)}"` : ''; };
264
417
  if (o.phone) {
265
418
  // TsCPhone: each row carries its name above its bar; the name stays at the left while you swipe
266
- const one = (r) => `<div class="tgq-r${o.sel === r.key ? ' sel' : ''}" data-row="${esc(r.key)}"><button type="button" class="tgq-n ini2" data-key="${esc(r.key)}" aria-label="${esc(r.title + ', ' + o.status(r).text)}"><i class="cz-dot ${toneOf(r)}" aria-hidden="true"></i><b>${esc(r.title)}</b></button><div class="tg-p"${ext(r)}>${ov}${dated(r) ? qBar(r, X, now, true, fmt, pxPct) + edgeTabs(r, X, now, true) : ND}</div></div>`;
419
+ const one = (r) => `<div class="tgq-r${o.sel === r.key ? ' sel' : ''}" data-row="${esc(r.key)}"><button type="button" class="tgq-n ini2" data-key="${esc(r.key)}" aria-label="${esc(r.title + ', ' + o.status(r).text)}"><i class="cz-dot ${toneOf(r, now)}" aria-hidden="true"></i><b>${esc(r.title)}</b></button><div class="tg-p"${ext(r)}>${ov}${dated(r) ? qBar(r, X, now, true, fmt, pxPct, msO) + edgeTabs(r, X, now, true) : ND}</div></div>`;
267
420
  const body = G ? G.map((g) => {
268
421
  if (g.kind !== 'program') return o.prodHtml(g) + (o.folded(g.key) ? '' : g.rows.map(one).join(''));
269
422
  const st = o.progState(g.program), s2 = progSpan(g);
@@ -277,7 +430,7 @@ function scaled(rows, M, o) {
277
430
  const head = `<div class="tg-r tg-h"><div class="tg-n"><b>Initiative</b>${back}</div><div class="tg-p">${ticks}${pill}</div></div>`;
278
431
  // one line per initiative (PgTimeline): its status dot and its name; the owner and the step stay in the row's title for a pointer and a reader
279
432
  const one = (r, cls) => { const s = o.status(r), sub = [r.owner, r.track ? r.track.label : r.stage, s.text].filter(Boolean).join(' · ');
280
- return `<div class="tg-r${cls || ''}${o.sel === r.key ? ' sel' : ''}" data-row="${esc(r.key)}"><button type="button" class="tg-n ini2" data-key="${esc(r.key)}" title="${esc(sub)}" aria-label="${esc(r.title + ', ' + sub)}"><i class="cz-dot ${toneOf(r)}${toneOf(r) === 'you' ? ' m-info' : toneOf(r) === 'late' || toneOf(r) === 'risk' ? ' m-warn' : ''}" aria-hidden="true"></i><b>${r.inProgram && o.memberIcon ? o.memberIcon(r.inProgram) : ''}${esc(r.title)}</b></button><div class="tg-p"${ext(r)}>${ov}${dated(r) ? qBar(r, X, now, false, fmt, pxPct) + edgeTabs(r, X, now, false) : ND}</div></div>`; };
433
+ return `<div class="tg-r${cls || ''}${o.sel === r.key ? ' sel' : ''}" data-row="${esc(r.key)}"><button type="button" class="tg-n ini2" data-key="${esc(r.key)}" title="${esc(sub)}" aria-label="${esc(r.title + ', ' + sub)}"><i class="cz-dot ${toneOf(r, now)}${toneOf(r, now) === 'you' ? ' m-info' : toneOf(r, now) === 'late' || toneOf(r, now) === 'risk' ? ' m-warn' : ''}" aria-hidden="true"></i><b>${r.inProgram && o.memberIcon ? o.memberIcon(r.inProgram) : ''}${esc(r.title)}</b></button><div class="tg-p"${ext(r)}>${ov}${dated(r) ? qBar(r, X, now, false, fmt, pxPct, msO) + edgeTabs(r, X, now, false) : ND}</div></div>`; };
281
434
  // programs first, then the product (PgTimeline): the program's row brackets its initiatives' bars and draws its milestones as diamonds
282
435
  const body = G ? G.map((g) => {
283
436
  if (g.kind !== 'program') return o.prodHtml(g) + (o.folded(g.key) ? '' : g.rows.map((r) => one(r, ' tg-gr')).join(''));
@@ -74,6 +74,14 @@ body.bd-page main.bd-main { position: relative; max-width: none; margin: 16px; p
74
74
  .bd-page .crmenu > button { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border-radius: 12px; font: 600 13.5px var(--cz-sans); color: var(--cz-ink); white-space: nowrap; }
75
75
  .bd-page .crmenu > button:hover, .bd-page .crmenu > button:focus-visible { background: var(--cz-well); }
76
76
  .bd-page .crmenu > button .bd-wtag { margin-left: auto; }
77
+ /* the product menu ticks several (batch 11 item 7): a blue tick when on, a grey dash on All products when only some are */
78
+ .bd-page .crmenu > button .crtk { margin-left: auto; width: 18px; height: 18px; flex: none; display: inline-flex; }
79
+ .bd-page .crmenu > button .crtk svg { width: 18px; height: 18px; fill: none; stroke: var(--cz-blue); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
80
+ .bd-page .crmenu > button .crtk.part svg { stroke: var(--cz-ink3); }
81
+ .bd-page .crmenu > button[aria-checked="false"] { color: var(--cz-ink2); }
82
+ .bd-page .crmenu .crsep { height: 1px; margin: 4px 8px; background: var(--cz-hair); }
83
+ .bd-pickw .crumb #crBoard { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
84
+ .bd-pickw .crumb #crBoard b { font-weight: 700; color: var(--cz-ink3); }
77
85
  .bd-page .crmenu em { margin-left: auto; font-style: normal; font-size: 12px; font-weight: 600; color: var(--cz-ink3); }
78
86
  .bd-page .tbrow { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 6px 0 12px; font: 600 13.5px var(--cz-sans); color: var(--cz-ink2); }
79
87
  .bd-page .tbrow[hidden] { display: none; }
@@ -504,6 +512,7 @@ button.tg-n:hover b { color: var(--cz-blueink); }
504
512
  .bd-show-s { display: inline-flex; }
505
513
  .bd-ib { width: 44px; height: 44px; }
506
514
  .bd-pickw .crumb, .bd-pickw .crumb #crBoard { height: 34px; }
515
+ .bd-pickw .crumb #crBoard { max-width: 150px; }
507
516
  .bd-tabs, .bd-sp, .bd-vr { display: none !important; }
508
517
  .bd-chiprow { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; gap: 6px; mask-image: linear-gradient(90deg, black 85%, transparent); -webkit-mask-image: linear-gradient(90deg, black 85%, transparent); }
509
518
  .bd-chiprow::-webkit-scrollbar { display: none; }
@@ -690,6 +699,7 @@ button.bd-lr:hover { background: var(--bd-row); }
690
699
  .bd-mi .k { margin-left: auto; font-size: 12px; color: var(--cz-ink3); font-weight: 600; white-space: nowrap; }
691
700
  .bd-mi .tx { display: flex; flex-direction: column; min-width: 0; flex: 1; padding: 6px 0; }
692
701
  .bd-mi .tx > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
702
+ .bd-mi .tx small { font-size: 12px; font-weight: 600; color: var(--cz-ink3); }
693
703
  .bd-mi mark { background: var(--cz-bluebg); color: var(--cz-blueink); border-radius: 3px; }
694
704
  .bd-mlbl { margin: 0; font-size: 12px; font-weight: 800; color: var(--cz-ink3); padding: 8px 12px 4px; }
695
705
  .bd-mnote { padding: 4px 12px 8px; }
@@ -1260,3 +1270,73 @@ body.bd-spick .bd-hd .bd-tools { margin-left: auto; }
1260
1270
  .bd-hold .bd-ib { width: 36px; height: 36px; background: var(--cz-well); }
1261
1271
  .bd-pp.bd-hold { padding: 14px 16px; gap: 8px; width: 300px; }
1262
1272
  .bd-pp.bd-hold.sheet { width: auto; }
1273
+
1274
+ /* A milestone task's ◇ on the initiative's row (feedback batch 11 item 3; canvas XmlA1Board, XmlA4Hover, XmlA5Phone, XmlA7Spans): hollow while
1275
+ * open, filled grey when done (a card ring keeps it apart from the bar), an orange outline when late. The short date sits under it. A 24 px hit
1276
+ * area carries the tooltip. A counted ◇ lists its milestones under it. Not draggable. */
1277
+ .tg-tm, .tg-tmc { position: absolute; top: 50%; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; transform: rotate(45deg); border-radius: 2px; background: var(--cz-card); border: 2px solid var(--bd-done); box-sizing: border-box; z-index: 3; }
1278
+ .tg-tm::before, .tg-tmc::before { content: ''; position: absolute; inset: -8px; }
1279
+ .tg-tm.dn, .tg-end.dn { background: var(--bd-done); box-shadow: 0 0 0 2px var(--cz-card); }
1280
+ .tg-tm.late, .tg-tmc.late { border-color: var(--cz-dot-late); }
1281
+ .tg-tmc { all: unset; box-sizing: border-box; position: absolute; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; transform: rotate(45deg); border-radius: 4px; background: var(--cz-card); border: 2px solid var(--bd-done); z-index: 3; cursor: pointer; display: flex; align-items: center; justify-content: center; }
1282
+ .tg-tmc.dn { background: var(--bd-done); }
1283
+ .tg-tmc b { transform: rotate(-45deg); font-size: 10px; font-weight: 800; color: var(--cz-ink2); }
1284
+ .tg-tmc.dn b { color: var(--cz-card); }
1285
+ .tg-tmc.late b { color: var(--cz-late); }
1286
+ .tg-tmc:focus-visible, .tg-tmc[aria-expanded="true"] { outline: 2px solid var(--cz-blue); outline-offset: 3px; }
1287
+ .tg-tml { position: absolute; top: calc(50% + 9px); transform: translateX(-50%); font-size: 11px; font-weight: 700; color: var(--cz-ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; z-index: 3; pointer-events: none; }
1288
+ .tg-tml.late { color: var(--cz-late); font-weight: 800; }
1289
+ .tg-msp { position: fixed; z-index: 60; min-width: 240px; max-width: min(360px, calc(100vw - 16px)); padding: 6px; background: var(--cz-card); border-radius: 16px; box-shadow: 0 12px 32px rgba(0,0,0,.16), 0 0 0 1px var(--cz-hair); }
1290
+ .tg-msp .o { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 8px 12px; border-radius: 10px; font-size: 14px; font-weight: 700; color: var(--cz-ink); cursor: pointer; }
1291
+ .tg-msp .o:hover, .tg-msp .o:focus-visible { background: var(--cz-well2); }
1292
+ .tg-msp .o > span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
1293
+ .tg-msp .k { font-size: 13px; font-weight: 700; color: var(--cz-ink2); }
1294
+ .tg-msp .k.late { color: var(--cz-late); }
1295
+ .tg-tm-i { flex: none; width: 10px; height: 10px; transform: rotate(45deg); border-radius: 2px; border: 2px solid var(--bd-done); box-sizing: border-box; }
1296
+ .tg-tm-i.dn { background: var(--bd-done); }
1297
+ .tg-tm-i.late { border-color: var(--cz-dot-late); }
1298
+ .tg-msp.sh { left: 0; right: 0; bottom: 0; top: auto; max-width: none; border-radius: 24px 24px 0 0; padding: 10px 12px calc(16px + env(safe-area-inset-bottom)); }
1299
+ .tg-msp.sh .gr { display: block; width: 36px; height: 4px; margin: 0 auto 10px; border-radius: 2px; background: var(--cz-hair); }
1300
+ .tg-msp.sh .h { display: block; padding: 4px 12px 8px; font-size: 16px; font-weight: 800; color: var(--cz-ink); }
1301
+ .tgq-r .tg-tm, .tgq-r .tg-tmc { top: 50%; }
1302
+ /* planned versus actual (batch 11 item 8; canvas PvaAC4Board): the saved plan's thin line with end caps under the bar, the slip after the end
1303
+ * date (+14d orange, −15d grey), an initiative with drafts only drawn dashed, the legend's Plan and Draft keys. Milestone date labels drop
1304
+ * under the plan line (+13 px). Dashed blue stays the Jira forecast; dotted stays a hold. */
1305
+ .tg-pl { position: absolute; top: calc(50% + 10px); height: 1.6px; background: var(--cz-ink2); z-index: 1; }
1306
+ .tg-pl::before, .tg-pl::after { content: ""; position: absolute; top: -3px; width: 1.6px; height: 7.6px; background: var(--cz-ink2); }
1307
+ .tg-pl::before { left: 0; } .tg-pl::after { right: 0; }
1308
+ .tg-p:has(.tg-pl) .tg-tml { top: calc(50% + 22px); }
1309
+ .tg-slip { font-weight: 800; color: var(--cz-ink3); }
1310
+ .tg-slip.late { color: var(--cz-late); }
1311
+ .tg-bar.tg-dr { background: transparent; border: 1.5px dashed color-mix(in srgb, var(--cz-ink3) 75%, var(--cz-card)); box-sizing: border-box; }
1312
+ .tg-lgd .k.pln { width: 16px; height: 1.6px; border-radius: 0; background: var(--cz-ink2); position: relative; vertical-align: 3px; }
1313
+ .tg-lgd .k.pln::before, .tg-lgd .k.pln::after { content: ""; position: absolute; top: -3px; width: 1.6px; height: 7.6px; background: var(--cz-ink2); }
1314
+ .tg-lgd .k.pln::before { left: 0; } .tg-lgd .k.pln::after { right: 0; }
1315
+ .tg-lgd .k.drf { border: 1.5px dashed var(--cz-ink3); box-sizing: border-box; }
1316
+ /* No activity (feedback batch 11 item 13; canvas XgapA1Board, XgapAHard, XgapA3Phone, XgapAGrill): a gap of 2 weeks or more with no dated work is a
1317
+ 2 px hairline in the To do grey at the bar's middle, one press (a 24 px area) with its words. A skipped stage between two dated ones is one » on
1318
+ the hairline, or on the bar at the joint. Kept apart from a hold (dotted + ⏸), a draft (dashed box) and the plan line (dark, end caps). */
1319
+ .tg-ng { all: unset; box-sizing: border-box; position: absolute; top: 50%; height: 24px; margin-top: -12px; z-index: 2; cursor: pointer; }
1320
+ span.tg-ng { cursor: default; }
1321
+ .tg-ng::before { content: ""; position: absolute; left: 0; right: 0; top: 11px; height: 2px; background: var(--bd-plan); }
1322
+ .tg-ng:hover::before, .tg-ng[aria-expanded="true"]::before { background: var(--bd-done); }
1323
+ .tg-ng:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 0; border-radius: 6px; }
1324
+ .tg-sk { position: absolute; top: 50%; left: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--cz-card); color: var(--cz-ink3); z-index: 3; }
1325
+ .tg-sk.on { width: 14px; height: 14px; margin: -7px 0 0 -7px; background: none; color: var(--cz-ink2); }
1326
+ .tg-sk svg, .tg-lgd .k.sk svg, .tg-sk-i svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
1327
+ .tg-lgd .k.ng { width: 18px; height: 2px; border-radius: 0; background: var(--bd-plan); vertical-align: 3px; }
1328
+ .tg-lgd .k.sk { width: 12px; height: 12px; background: none; vertical-align: -2px; color: var(--cz-ink3); }
1329
+ /* the gap's card: its words, and + New task with its dates while part of it is ahead (XgapAHard 2) */
1330
+ .tg-gpc { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 10px 10px 10px 14px; }
1331
+ .tg-gpc .w { flex: 1; min-width: 0; }
1332
+ .tg-gpc p { margin: 0; font-size: 13px; font-weight: 800; color: var(--cz-ink); }
1333
+ .tg-gpc p.s { margin-top: 2px; font-size: 12px; font-weight: 600; color: var(--cz-ink2); }
1334
+ .tg-gpc .gp-add { all: unset; box-sizing: border-box; flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--cz-ink); color: var(--cz-card); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
1335
+ .tg-gpc .gp-add svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
1336
+ .tg-gpc .gp-add:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; }
1337
+ /* the phone's row sheet: a gap and a skipped stage are lines in date order with the milestones; words only */
1338
+ .tg-msp .o.i { cursor: default; font-weight: 600; color: var(--cz-ink2); }
1339
+ .tg-msp .o.i:hover { background: none; }
1340
+ .tg-msp .o.i small { display: block; font-size: 12px; font-weight: 500; color: var(--cz-ink3); white-space: normal; }
1341
+ .tg-ng-i { flex: none; width: 12px; height: 2px; background: var(--bd-done); }
1342
+ .tg-sk-i { flex: none; width: 12px; display: inline-flex; color: var(--cz-ink3); }
@@ -738,3 +738,6 @@ form.hm-box textarea { min-height: 48px; border: 0; background: none; resize: no
738
738
  .hm-recp.paused .pill { background: var(--cz-well); color: var(--cz-ink3); }
739
739
  .hm-recp.paused i { background: var(--cz-dot-q); }
740
740
  }
741
+ /* a milestone task's small grey ◇ after its name (feedback batch 11 item 3) */
742
+ .hm-rt.ms { flex-direction: row; align-items: center; gap: 6px; }
743
+ .hv-ms { flex: none; display: inline-flex; color: var(--cz-ink3); }
@@ -18,7 +18,7 @@ import { onRecording } from './rec-state.js';
18
18
  import { liveItems, keepOrder, pillLabel, rowLabel, clock, elapsed } from './live-model.js';
19
19
 
20
20
  const esc = (v) => String(v == null ? '' : v).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[c]);
21
- const SHEET = '/pm/cozy-live-pill.css';
21
+ const SHEET = new URL('./cozy-live-pill.css', import.meta.url).href;
22
22
  const CHECK = '<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M5 12.5l4.5 4.5L19 7.5"/></svg>';
23
23
  const PHONE = '(max-width: 760px)';
24
24
  const mac = () => { try { return /Mac|iPhone|iPad/.test(navigator.platform || navigator.userAgent || ''); } catch { return false; } };
@@ -24,7 +24,7 @@ export const PLACES = [
24
24
  export { fabLabel };
25
25
  const THEME_KEY = 'pmos.c3.theme';
26
26
  const THEMES = [['light', 'Light'], ['dark', 'Dark'], ['auto', 'Auto']];
27
- const CSS = '/pm/cozy-ev.css';
27
+ const CSS = new URL('./cozy-ev.css', import.meta.url).href;
28
28
  const N = { news: 0, stale: null, here: 'home' };
29
29
 
30
30
  const store = { get(k) { try { return localStorage.getItem(k); } catch { return null; } }, set(k, v) { try { if (v) localStorage.setItem(k, v); else localStorage.removeItem(k); } catch { /* a private window */ } } };
@@ -32,7 +32,7 @@ export function ensureCss() {
32
32
  if (css || typeof document === 'undefined' || !document.head) return;
33
33
  css = true;
34
34
  if (document.querySelector('link[data-cz-steps-css]')) return;
35
- const l = document.createElement('link'); l.rel = 'stylesheet'; l.href = '/pm/cozy-steps.css'; l.dataset.czStepsCss = ''; document.head.appendChild(l);
35
+ const l = document.createElement('link'); l.rel = 'stylesheet'; l.href = new URL('./cozy-steps.css', import.meta.url).href; l.dataset.czStepsCss = ''; document.head.appendChild(l);
36
36
  }
37
37
 
38
38
  /** The 8-tick spinner (it turns in steps; still under reduced motion). */
@@ -12,7 +12,7 @@
12
12
  * copyText(text, said) copies the text and says so in the page's toast (setSay) */
13
13
  import { esc, toast } from './premium-shell.js';
14
14
 
15
- const CSS = '/pm/cozy-xv.css';
15
+ const CSS = new URL('./cozy-xv.css', import.meta.url).href;
16
16
  if (typeof document !== 'undefined' && !document.querySelector(`link[href="${CSS}"]`)) {
17
17
  const l = document.createElement('link'); l.rel = 'stylesheet'; l.href = CSS; document.head.appendChild(l);
18
18
  }
@@ -0,0 +1,36 @@
1
+ /* pm/doc-follow.js — a read-only view of a document that follows the file (PM, 2026-10-26: "When chat make update on the file that being shown on the
2
+ * current viewer, I should not need to refresh page. I should not need to manually commit as well").
3
+ *
4
+ * followDoc({ ws, ini, path, alive, onText }) -> Promise that settles when alive() turns false
5
+ * ws the workspace the view opened the document in
6
+ * ini the initiative it belongs to, or '': its chat writes in the initiative's own worktree, and that copy is the one read
7
+ * alive() true while the view still shows this document
8
+ * onText(text|null) the text, at once and again after each change; null when it could not be read
9
+ * Every few seconds GET /api/doc-sheet/stamp names the workspace that holds the live copy and the text's hash; a new hash reads GET /api/doc there.
10
+ * A file the stamp cannot check (not Markdown, or an older server) is read once. */
11
+ const CHECK_MS = 2500;
12
+ const qs = (o) => Object.entries(o).filter(([, v]) => v).map(([k, v]) => k + '=' + encodeURIComponent(v)).join('&');
13
+ async function json(url) { try { const r = await fetch(url, { credentials: 'same-origin' }); return await r.json(); } catch { return null; } }
14
+ async function text(url) { try { const r = await fetch(url, { credentials: 'same-origin' }); return r.ok ? await r.text() : null; } catch { return null; } }
15
+
16
+ export async function followDoc({ ws = '', ini = '', path, alive = () => true, onText = () => {} } = {}) {
17
+ let seen = null, first = true;
18
+ while (alive()) {
19
+ if (first || (typeof document === 'undefined' || !document.hidden)) {
20
+ const s = await json('/api/doc-sheet/stamp?' + qs({ ws, ini, path }));
21
+ if (!alive()) return;
22
+ if (!s || s.ok !== true) { // not a file the stamp checks: read it once, as before
23
+ if (first) onText(await text('/api/doc?' + qs({ ws, path })));
24
+ return;
25
+ }
26
+ const key = (s.ws || '') + '|' + s.hash;
27
+ if (key !== seen) {
28
+ const t = await text('/api/doc?' + qs({ ws: s.ws || ws, path }));
29
+ if (!alive()) return;
30
+ if (t != null || first) { seen = t != null ? key : seen; onText(t); }
31
+ }
32
+ first = false;
33
+ }
34
+ await new Promise((ok) => setTimeout(ok, CHECK_MS));
35
+ }
36
+ }