create-pmos 0.425.0 → 0.427.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.
- package/package.json +25 -25
- package/payload/KIT-VERSION +1 -1
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/state/discoveries.md +1 -1
- package/workspace/board-deliveries-test.js +153 -0
- package/workspace/board-programs-test.js +19 -10
- package/workspace/board-shot.js +4 -3
- package/workspace/briefing-premium-board-test.js +2 -2
- package/workspace/calm-timeline-test.js +190 -0
- package/workspace/changelog.json +24 -0
- package/workspace/ev-everywhere-test.js +3 -1
- package/workspace/guide/claude-proposes.md +19 -2
- package/workspace/guide/programs.md +2 -1
- package/workspace/lib/board-premium.js +3 -1
- package/workspace/lib/chat-file-locate.js +40 -2
- package/workspace/lib/context-use.js +54 -0
- package/workspace/lib/engine/boards.js +8 -2
- package/workspace/lib/idle-close.js +60 -0
- package/workspace/lib/loose-proposals.js +302 -0
- package/workspace/lib/my-work-premium.js +1 -1
- package/workspace/lib/proposal-runs.js +77 -2
- package/workspace/lib/propose-cli.js +42 -1
- package/workspace/lib/route-modules.js +1 -0
- package/workspace/lib/routes-boards.js +16 -4
- package/workspace/lib/routes-brief-page.js +9 -1
- package/workspace/lib/routes-live.js +3 -1
- package/workspace/lib/routes-loose.js +210 -0
- package/workspace/lib/routes-pm-items.js +27 -17
- package/workspace/lib/task-cli.js +18 -11
- package/workspace/lib/transcript-read.js +9 -2
- package/workspace/milestone-pins-test.js +170 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-board-actions-test.js +2 -1
- package/workspace/premium-briefing-depth-test.js +1 -1
- package/workspace/premium-chat-term-test.js +13 -2
- package/workspace/premium-core-doc-issue-test.js +1 -1
- package/workspace/product-lane-test.js +30 -17
- package/workspace/public/pm/bd-acts.js +6 -3
- package/workspace/public/pm/bd-deliveries.js +218 -0
- package/workspace/public/pm/bd-pin-card.css +16 -0
- package/workspace/public/pm/bd-pin-card.js +80 -0
- package/workspace/public/pm/bd-pins.js +33 -0
- package/workspace/public/pm/bd-pop.js +2 -0
- package/workspace/public/pm/bd-prog.js +5 -4
- package/workspace/public/pm/bd-span.js +140 -102
- package/workspace/public/pm/cozy-board.css +73 -11
- package/workspace/public/pm/cozy-home.css +23 -1
- package/workspace/public/pm/cozy-live-pill.css +1 -0
- package/workspace/public/pm/cozy-live-pill.js +2 -1
- package/workspace/public/pm/cozy-today.css +7 -0
- package/workspace/public/pm/cozy.css +6 -0
- package/workspace/public/pm/ctx-wedge.js +45 -0
- package/workspace/public/pm/home-app.js +29 -2
- package/workspace/public/pm/home-chat.js +7 -2
- package/workspace/public/pm/home-data.js +6 -3
- package/workspace/public/pm/home-list.js +46 -5
- package/workspace/public/pm/home-today.js +22 -6
- package/workspace/public/pm/ini-tasks.js +4 -1
- package/workspace/public/pm/live-model.js +1 -1
- package/workspace/public/pm/loose-props.css +54 -0
- package/workspace/public/pm/loose-props.js +262 -0
- package/workspace/public/pm/premium-board.js +9 -5
- package/workspace/public/pm/term-view.js +81 -10
- package/workspace/public/premium-board.html +1 -0
- package/workspace/server.js +135 -6
- package/workspace/skills/loose-propose.skill +39 -0
- package/workspace/task-milestones-test.js +15 -6
- package/workspace/test-lists/batch13-context-use.json +5 -0
- package/workspace/test-lists/board-deliveries.json +13 -0
- package/workspace/test-lists/calm-timeline.json +5 -0
- package/workspace/test-lists/loose-props.json +9 -0
- package/workspace/test-lists/milestone-pins.json +6 -0
- package/workspace/timeline-holds-test.js +44 -42
|
@@ -25,10 +25,20 @@
|
|
|
25
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
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
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.
|
|
28
|
+
* the hairline and » only; its row sheet lists them. A gap never changes the row's dot or risk.
|
|
29
|
+
* Calmer timeline (feedback batch 13 item 4, A: XcalmA1Desk, A4Dark, A3Phone, A2Folded, A5Milestones): say it once, few marks, quiet rows.
|
|
30
|
+
* · One label per bar end: what lands, then when ("Tender award Nov 3"; the year only when it is not this year). The name is the end milestone's,
|
|
31
|
+
* else Deliver or Evaluate. The date turns amber at risk and orange late; the rest (days over, the forecast, a slip, a clash) is its hover.
|
|
32
|
+
* With no room at the right edge the label sits before the ◇, on a card chip. No date under a ◇ and no second date.
|
|
33
|
+
* · Marks: the bar (done dark, to do light), a 2 px hairline for any gap or hold (a hold's hairline opens the hold card), one ◇ (filled done,
|
|
34
|
+
* orange late), the dashed Jira forecast, Today. The dotted hold, ⏸, the amber tint, the blue ◆ and the hatched out-of-window band are gone.
|
|
35
|
+
* Only the milestones the Filter shows are drawn (pm/bd-pins.js: the pinned ones, by default the last); every ◇ presses (data-ms-pick).
|
|
36
|
+
* · Group rows draw nothing while open; folded, the roll-up line, the counted ◇s, the end date and one dot per initiative off track.
|
|
37
|
+
* · A row's dot shows only off track (late, at risk, on hold). Names wrap to two lines. One tint (programs); quarter grid lines only. */
|
|
29
38
|
import { esc } from './premium-shell.js';
|
|
30
39
|
import { mergeClose } from './program-model.js';
|
|
31
40
|
import { stagesOfRow } from './bd-wf.js';
|
|
41
|
+
import { shownMs } from './bd-pins.js';
|
|
32
42
|
|
|
33
43
|
const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
34
44
|
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; };
|
|
@@ -43,7 +53,7 @@ export const DRAWN = new Set(SPANS.map(([k]) => k));
|
|
|
43
53
|
const SV = (d) => `<svg viewBox="0 0 24 24" aria-hidden="true"><path d="${d}"/></svg>`;
|
|
44
54
|
const FLAG = 'M5 21V4M5 4h11l-2 4 2 4H5';
|
|
45
55
|
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';
|
|
46
|
-
const CHL = 'M15 6l-6 6 6 6', CHR = 'M9 6l6 6-6 6',
|
|
56
|
+
const CHL = 'M15 6l-6 6 6 6', CHR = 'M9 6l6 6-6 6', SKIP = 'M6 7l5 5-5 5M13 7l5 5-5 5';
|
|
47
57
|
|
|
48
58
|
/** 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. */
|
|
49
59
|
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 } };
|
|
@@ -89,6 +99,9 @@ const doneOf = (r) => { const p = r.track && r.track.prog; return p ? Math.max(0
|
|
|
89
99
|
const msLate = (m, now) => !m.done && day(m.date) && day(m.date) < new Date(now.getFullYear(), now.getMonth(), now.getDate());
|
|
90
100
|
export const anyMsLate = (r, now) => !!(now && (r.milestones || []).some((m) => msLate(m, now)));
|
|
91
101
|
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');
|
|
102
|
+
/** A row's dot (batch 13 item 4): only off track. 'late' | 'risk' | 'q' (on hold) | null. */
|
|
103
|
+
const offTone = (r, now) => { const t = toneOf(r, now); return t === 'late' || t === 'risk' ? t : r.status === 'on hold' ? 'q' : null; };
|
|
104
|
+
const dotHtml = (r, now) => { const t = offTone(r, now); return t ? `<i class="cz-dot ${t}${t === 'q' ? '' : ' m-warn'}" aria-hidden="true"></i>` : ''; };
|
|
92
105
|
const dated = (r) => day(r.start) || day(r.end) || (r.track && day(r.track.forecast)) || (r.draft && day(r.draft.start));
|
|
93
106
|
/** Done work leaves no edge tab (TsCGrill 5): the initiative is past Deliver, or every part it counts is done. */
|
|
94
107
|
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)));
|
|
@@ -164,31 +177,48 @@ function extentOf(r, now) {
|
|
|
164
177
|
return ds.length ? { a: new Date(Math.min(...ds)), b: new Date(Math.max(...ds)) } : null;
|
|
165
178
|
}
|
|
166
179
|
|
|
167
|
-
/**
|
|
168
|
-
|
|
180
|
+
/** A date as the calm timeline says it (batch 13 item 4): "Nov 3", and the year only when it is not this year ("Jun 10 ’27"). */
|
|
181
|
+
export const dy = (d, now) => md(d) + (d.getFullYear() !== now.getFullYear() ? ' ’' + String(d.getFullYear()).slice(2) : '');
|
|
182
|
+
/** What lands at a row's end: its end milestone's name, else the stage the end stands for. */
|
|
183
|
+
const landsOf = (r, et) => (et ? et.name : r.track && r.track.k >= 6 ? 'Evaluate' : 'Deliver');
|
|
184
|
+
/** The one label at a bar's end (XcalmA1Desk): what lands, then when; tone '' | 'risk' | 'late' | 'q' colours the date. At the right edge, with
|
|
185
|
+
* no room after the mark, it sits before it on a card chip. hover: the words a pointer reads (days over, the forecast, a slip, a clash). */
|
|
186
|
+
function endLabel(at, name, d, tone, now, pxPct, hover, slip) {
|
|
187
|
+
const date = dy(d, now), est = (name.length + date.length + 1) * 6.6 + 26;
|
|
188
|
+
const flip = pxPct && (100 - at) * pxPct < est;
|
|
189
|
+
const tip = name + ' · ' + md(d) + (d.getFullYear() !== now.getFullYear() ? ', ' + d.getFullYear() : '') + (hover && hover.length ? '. ' + hover.join('. ') : '');
|
|
190
|
+
return `<span class="tg-endl${flip ? ' l' : ''}" style="left:${P(at)}" title="${esc(tip)}"><span class="nm">${esc(name)}</span> <b${tone ? ` class="${tone}"` : ''}>${esc(date)}</b>${slip || ''}</span>`;
|
|
191
|
+
}
|
|
192
|
+
/** A slip's words for the hover (PvaAC4): "Planned May 20 → Jun 10 (+3 wk)". */
|
|
193
|
+
const slipWords = (r, e) => { const p = r.plan, b = p && day(p.end), n = p && p.slip; if (!b || !n) return ''; const w = Math.abs(n) >= 7 ? Math.round(Math.abs(n) / 7) + ' wk' : Math.abs(n) + 'd'; return 'Planned ' + md(b) + ' → ' + md(e) + ' (' + (n > 0 ? '+' : '−') + w + ')'; };
|
|
194
|
+
|
|
195
|
+
/** One initiative's marks: the plan cut by its gaps and holds, the forecast past the plan, the shown milestones, the end ◇ and one label after the
|
|
196
|
+
* furthest mark. */
|
|
169
197
|
function qBar(r, X, now, phone, fmt, pxPct, ms = {}) {
|
|
170
198
|
const s = day(r.start), e = day(r.end), fc = r.track && day(r.track.forecast), tone = toneOf(r);
|
|
171
|
-
const tm = taskMarks(r, X, now, phone, pxPct, ms), et = tm.end;
|
|
172
|
-
|
|
199
|
+
const tm = taskMarks(r, X, now, phone, pxPct, ms), et = tm.end, note = markWords(r, now);
|
|
200
|
+
const risk = r.status === 'at risk' ? 'risk' : r.status === 'on hold' ? 'q' : '';
|
|
201
|
+
let out = tm.html + depHtml(r, X, phone), clash = null;
|
|
173
202
|
if (s && e) {
|
|
174
|
-
const g = gapsHtml(r, X, now, phone, fmt, pxPct || 0, s, e, tone);
|
|
203
|
+
const g = gapsHtml(r, X, now, phone, fmt, pxPct || 0, s, e, tone, note);
|
|
175
204
|
out += g.html; clash = g.clash;
|
|
176
|
-
const over = r.over && now > e, late = fc && fc > e,
|
|
177
|
-
if (over)
|
|
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>`;
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
205
|
+
const over = r.over && now > e, late = fc && fc > e, hover = [];
|
|
206
|
+
if (over) hover.push(r.overDays + ' ' + (r.overDays === 1 ? 'day' : 'days') + ' over');
|
|
207
|
+
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>`; hover.push('Jira forecast ' + md(fc)); }
|
|
208
|
+
if (clash) hover.push(clash);
|
|
209
|
+
const sw = slipWords(r, e); if (sw) hover.push(sw);
|
|
210
|
+
// the committed end is the ◇ (PgTimeline); a milestone task in the stage it stands for IS that ◇ (say it once, batch 11 item 3): its name and its done
|
|
211
|
+
const isLate = !!(over || clash || r.late || (et && msLate(et, now)));
|
|
212
|
+
const name = landsOf(r, et), eTitle = name + ' · ' + md(e) + (et && et.stage ? ' · ◆ ' + et.stage : '') + (et && et.done ? ' · done' : isLate ? ' · late' : '');
|
|
213
|
+
out += `<button type="button" class="tg-end${et && et.done ? ' dn' : ''}${isLate ? ' late' : ''}" data-ms-pick="${esc(r.key)}" data-ms-id="${esc(et ? et.id : '')}" style="left:${P(X(e))}" aria-haspopup="dialog" aria-label="${esc(eTitle + '. Milestones of ' + r.title)}" title="${esc(eTitle + (clash ? '. ' + clash : ''))}"></button>`;
|
|
214
|
+
out += endLabel(Math.max(X(e), over ? X(now) : 0, late ? X(fc) : 0), name, e, isLate ? 'late' : risk, now, pxPct, hover, slipHtml(r));
|
|
186
215
|
} else if (fc) {
|
|
187
|
-
out += `<span class="tg-fc solo" style="left:${P(X(fc))};width:12px;margin-left:-12px" title="Jira forecast ${esc(md(fc))}"></span
|
|
216
|
+
out += `<span class="tg-fc solo" style="left:${P(X(fc))};width:12px;margin-left:-12px" title="Jira forecast ${esc(md(fc))}"></span>` + endLabel(X(fc), 'Jira forecast', fc, '', now, pxPct, [], '');
|
|
188
217
|
} else if (r.draft && day(r.draft.start)) {
|
|
189
|
-
out += draftBar(r, X, phone, fmt);
|
|
218
|
+
out += draftBar(r, X, phone, fmt, now, pxPct);
|
|
190
219
|
} else {
|
|
191
|
-
const d = s || e;
|
|
220
|
+
const d = s || e;
|
|
221
|
+
out += `<button type="button" class="tg-end" data-ms-pick="${esc(r.key)}" data-ms-id="" style="left:${P(X(d))}" aria-haspopup="dialog" aria-label="${esc((s ? 'Starts ' : 'Ends ') + md(d) + '. Milestones of ' + r.title)}" title="${s ? 'Starts' : 'Ends'} ${esc(md(d))}"></button>` + (e ? endLabel(X(d), landsOf(r, et), d, risk, now, pxPct, [], '') : '');
|
|
192
222
|
}
|
|
193
223
|
return out + planMarks(r, X, phone, fmt);
|
|
194
224
|
}
|
|
@@ -208,11 +238,11 @@ export function slipHtml(r) {
|
|
|
208
238
|
const n = r && r.plan && r.plan.slip;
|
|
209
239
|
return n ? ` <b class="tg-slip${n > 0 ? ' late' : ''}">${n > 0 ? '+' + n : '\u2212' + -n}d</b>` : '';
|
|
210
240
|
}
|
|
211
|
-
function draftBar(r, X, phone, fmt) {
|
|
241
|
+
function draftBar(r, X, phone, fmt, now, pxPct) {
|
|
212
242
|
const D = r.draft, a = day(D.start), b = day(D.end) || a;
|
|
213
243
|
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
244
|
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
|
-
+ (
|
|
245
|
+
+ endLabel(X(b), 'Draft', b, '', now, pxPct, [tip], '');
|
|
216
246
|
}
|
|
217
247
|
|
|
218
248
|
const MIN_PX = 8; // a hold or a gap narrower than this closes up (XtiA4Long, XtiAGrill 12)
|
|
@@ -228,7 +258,7 @@ export function holdWords(x, now) {
|
|
|
228
258
|
}
|
|
229
259
|
/** The plan bar cut by its holds and its plain gaps: the pieces (the done part fills them in order and skips the gaps), each hold's dotted line and ⏸,
|
|
230
260
|
* and the return date where the bar starts again. → { html, clash } — clash: the words when the return date falls after the end ◇. */
|
|
231
|
-
function gapsHtml(r, X, now, phone, fmt, pxPct, s, e, tone) {
|
|
261
|
+
function gapsHtml(r, X, now, phone, fmt, pxPct, s, e, tone, note = '') {
|
|
232
262
|
const wide = (a, b) => !pxPct || (X(b) - X(a)) * pxPct >= MIN_PX;
|
|
233
263
|
// a resumed hold narrower than 8 px closes up; a hold still running always shows, so its ⏸ is there to press
|
|
234
264
|
const H = holdSpans(r, now), shown = H.filter((x) => x.kind !== 'past' || wide(x.a, x.b));
|
|
@@ -260,11 +290,11 @@ function gapsHtml(r, X, now, phone, fmt, pxPct, s, e, tone) {
|
|
|
260
290
|
if (at < e) pieces.push([at, e, faded]);
|
|
261
291
|
const days = (p) => Math.max(0, (p[1] - p[0]) / 86400000), total = pieces.reduce((n, p) => n + days(p), 0);
|
|
262
292
|
let left = (doneOf(r) / 100) * total;
|
|
263
|
-
const hold = (H.length ? '. ' + H.map((x) => holdWords(x, now)).join('. ') : '') + (dropped.length ? '. ' + dropped.join('. ') : '');
|
|
293
|
+
const hold = (H.length ? '. ' + H.map((x) => holdWords(x, now)).join('. ') : '') + (dropped.length ? '. ' + dropped.join('. ') : '') + (note ? '. ' + note : '');
|
|
264
294
|
let html = pieces.map((p, i) => {
|
|
265
295
|
const d = days(p), f = d ? Math.max(0, Math.min(1, left / d)) : 0; left -= d;
|
|
266
296
|
const xl = i > 0 || p[0] > s ? ' xl' : '', xr = i < pieces.length - 1 || p[1] < e ? ' xr' : '';
|
|
267
|
-
return `<span class="tg-bar
|
|
297
|
+
return `<span class="tg-bar${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>`;
|
|
268
298
|
}).join('');
|
|
269
299
|
// 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
300
|
plain.forEach(([a, b], gi) => {
|
|
@@ -279,14 +309,11 @@ function gapsHtml(r, X, now, phone, fmt, pxPct, s, e, tone) {
|
|
|
279
309
|
html += phone ? `<i class="tg-sk on" style="left:${P(m.x)}" aria-hidden="true">${SV(SKIP)}</i>`
|
|
280
310
|
: `<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
311
|
}
|
|
312
|
+
// a hold is the hairline of a gap (batch 13 item 4): the same 2 px line, and one press opens the hold card (resume, change the date). The return
|
|
313
|
+
// date and how long it waits are the card's and the hover's; a hold still running is never narrower than its press
|
|
282
314
|
for (const x of shown) {
|
|
283
|
-
const late = x.kind === 'over' ? ' late' : '', l = X(x.a), w = X(x.b) - l,
|
|
284
|
-
html += `<
|
|
285
|
-
html += `<button type="button" class="tg-pz${late}${narrow ? ' sm' : ''}" data-hold="${esc(r.key)}" data-i="${x.i}" style="left:${narrow ? P(l + w / 2) : `calc(${P(l)} + 11px)`}" aria-label="${esc(holdWords(x, now) + (x.kind === 'none' ? '. Set a return date' : '. Open the hold'))}" aria-haspopup="dialog">${SV(PAUSE)}</button>`;
|
|
286
|
-
if (phone) continue;
|
|
287
|
-
if (x.kind === 'open' && x.b < e) html += `<span class="tg-hl" style="left:${P(X(x.b))}">${esc(fmt(x.b))}</span>`;
|
|
288
|
-
else if (x.kind === 'over') { const n = Math.round((now - day(x.h.back)) / 86400000); html += `<span class="tg-hl late" style="left:${P(X(x.b))}">${esc(md(day(x.h.back)) + ' · ' + n + ' ' + (n === 1 ? 'day' : 'days') + ' ago')}</span>`; }
|
|
289
|
-
else if (x.kind === 'none') html += `<span class="tg-hl" style="left:${P(X(x.b))}">no return date</span>`;
|
|
315
|
+
const late = x.kind === 'over' ? ' late' : '', l = X(x.a), w = X(x.b) - l, words = holdWords(x, now) + (x.kind === 'none' ? '. Set a return date' : '. Open the hold');
|
|
316
|
+
html += `<button type="button" class="tg-ng ho${late}" data-hold="${esc(r.key)}" data-i="${x.i}" style="left:${P(l)};width:${P(w)}" aria-label="${esc(words)}" title="${esc(holdWords(x, now))}" aria-haspopup="dialog"></button>`;
|
|
290
317
|
}
|
|
291
318
|
const ob = H.find((x) => x.kind === 'open' && x.b > e);
|
|
292
319
|
const clash = ob ? (r.track && r.track.k >= 6 ? 'Evaluate' : 'Deliver') + ' is before the return, ' + md(ob.b) : null;
|
|
@@ -307,29 +334,23 @@ function endTask(r, M) {
|
|
|
307
334
|
const end = inLast.length ? inLast[inLast.length - 1] : M.find((m) => +day(m.date) === +e) || null;
|
|
308
335
|
return end ? { ...end, stage: msStage(r, end) } : null;
|
|
309
336
|
}
|
|
310
|
-
/** One ◇ per milestone task
|
|
311
|
-
* filled grey when done,
|
|
312
|
-
*
|
|
313
|
-
*
|
|
337
|
+
/** One ◇ per milestone task the Filter shows (batch 13 item 4, XcalmA5Milestones; pm/bd-pins.js shownMs: the pinned ones, by default the last),
|
|
338
|
+
* at its due date: hollow while open, filled grey when done, orange when late. No date under it: its name and date are its hover. ◇s closer than
|
|
339
|
+
* about 40 px merge into one counted ◇ that lists them. The latest milestone task in a ◆ stage, or one on the end's own day, is the end ◇ and
|
|
340
|
+
* is not drawn again. A ◇ presses (data-ms-pick: the initiative's milestones, to pin). → { html, end } */
|
|
314
341
|
function taskMarks(r, X, now, phone, pxPct, ms) {
|
|
315
342
|
const M = (r.milestones || []).filter((m) => day(m.date));
|
|
316
343
|
if (!M.length) return { html: '', end: null };
|
|
317
|
-
const end = endTask(r, M);
|
|
318
|
-
const L = M.filter((m) => !end || m.id !== end.id).map((m) => ({ ...m, late: msLate(m, now), stage: msStage(r, m) }))
|
|
344
|
+
const end = endTask(r, M), show = new Set(shownMs(r, ms.mode || 'pinned').map((m) => m.id));
|
|
345
|
+
const L = M.filter((m) => (!end || m.id !== end.id) && show.has(m.id)).map((m) => ({ ...m, late: msLate(m, now), stage: msStage(r, m) }))
|
|
319
346
|
.filter((m) => { const x = X(day(m.date)); return x > 0 && x < 100; });
|
|
320
347
|
const C = mergeClose(L, Math.max(1, ms.reach || 7));
|
|
321
|
-
const
|
|
322
|
-
|
|
323
|
-
const fmtD = (d) => (sp === 'y2' ? my(d) : md(d));
|
|
324
|
-
const html = C.map((c, i) => {
|
|
325
|
-
const x = P(xs[i]), tone = c.late ? ' late' : c.done ? ' dn' : '';
|
|
348
|
+
const html = C.map((c) => {
|
|
349
|
+
const x = P(X(day(c.date))), tone = c.late ? ' late' : c.done ? ' dn' : '';
|
|
326
350
|
const one = c.items[0], words = (m) => m.name + ' · ' + md(day(m.date)) + (m.stage ? ' · ◆ ' + m.stage : '') + (m.late ? ' · late' : m.done ? ' · done' : '');
|
|
327
|
-
|
|
351
|
+
return c.n > 1
|
|
328
352
|
? `<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>`
|
|
329
|
-
: `<
|
|
330
|
-
if (!dates) return mark;
|
|
331
|
-
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` : '';
|
|
332
|
-
return mark + `<span class="tg-tml${c.late ? ' late' : ''}" style="left:${x}${w}">${esc(label)}</span>`;
|
|
353
|
+
: `<button type="button" class="tg-tm${tone}" data-ms-pick="${esc(r.key)}" data-ms-id="${esc(one.id)}" style="left:${x}" aria-haspopup="dialog" aria-label="${esc('Milestone ' + words(one) + '. Milestones of ' + r.title)}" title="${esc(words(one))}"></button>`;
|
|
333
354
|
}).join('');
|
|
334
355
|
return { html, end };
|
|
335
356
|
}
|
|
@@ -353,50 +374,63 @@ export function laneMilestones(rows, now) {
|
|
|
353
374
|
}
|
|
354
375
|
/** The lines a lane's list or sheet shows, as data on its ◇ or its track: name, initiative, date and tone. */
|
|
355
376
|
const laneData = (L) => esc(JSON.stringify(L.map((m) => ({ k: m.row.key, n: m.name, t: m.row.title, d: String(m.date).slice(0, 10), s: m.late ? 'late' : m.done ? 'dn' : '' }))));
|
|
356
|
-
/**
|
|
357
|
-
*
|
|
377
|
+
/** A folded group's ◇s (batch 13 item 4, XcalmA2Folded): one per milestone, close ones merged into a counted ◇ (a button on a desktop, a mark on
|
|
378
|
+
* a phone, where the lane's tap lists them). No date under them: the group's end date is its one label. */
|
|
358
379
|
function laneMarks(L, X, phone, pxPct, ms) {
|
|
359
380
|
const C = mergeClose(L.filter((m) => { const x = X(day(m.date)); return x > 0 && x < 100; }), Math.max(1, ms.reach || 7));
|
|
360
|
-
const sp = ms.sp || 'quarter', dates = !phone && sp !== 'y5', cut = sp === 'year' || sp === 'y2';
|
|
361
|
-
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);
|
|
362
|
-
const fmtD = (d) => (sp === 'y2' ? my(d) : md(d));
|
|
363
381
|
const words = (m) => m.name + ' · ' + m.row.title + ' · ' + md(day(m.date)) + (m.late ? ' · late' : m.done ? ' · done' : '');
|
|
364
|
-
return C.map((c
|
|
365
|
-
const x = P(
|
|
366
|
-
|
|
382
|
+
return C.map((c) => {
|
|
383
|
+
const x = P(X(day(c.date))), tone = c.late ? ' late' : c.done ? ' dn' : '', one = c.items[0];
|
|
384
|
+
return c.n < 2 ? `<span class="tg-tm${tone}" style="left:${x}" role="img" aria-label="${esc('Milestone ' + words(one))}" title="${esc(words(one))}"></span>`
|
|
367
385
|
: phone ? `<span class="tg-tmc${tone}" style="left:${x}" aria-hidden="true"><b>${c.n}</b></span>`
|
|
368
386
|
: `<button type="button" class="tg-tmc${tone}" data-ms-lane="${laneData(c.items)}" style="left:${x}" aria-haspopup="menu" aria-label="${esc(c.n + ' milestones, ' + c.range + ': ' + c.items.map((m) => m.name + ', ' + m.row.title).join('; '))}" title="${esc(c.items.map(words).join('\n'))}"><b aria-hidden="true">${c.n}</b></button>`;
|
|
369
|
-
if (!dates) return mark;
|
|
370
|
-
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` : '';
|
|
371
|
-
return mark + `<span class="tg-tml${c.late ? ' late' : ''}" style="left:${x}${w}">${esc(label)}</span>`;
|
|
372
387
|
}).join('');
|
|
373
388
|
}
|
|
389
|
+
/** One dot per initiative off track (late, at risk, on hold) in a folded group's name cell (XcalmA2Folded); none on track (zero is silence). */
|
|
390
|
+
function offDots(rows, now) {
|
|
391
|
+
const D = (rows || []).map((r) => offTone(r, now)).filter(Boolean);
|
|
392
|
+
if (!D.length) return '';
|
|
393
|
+
const n = (t) => D.filter((x) => x === t).length, words = [['late', 'late'], ['risk', 'at risk'], ['q', 'on hold']].filter(([t]) => n(t)).map(([t, w]) => n(t) + ' ' + w).join(', ');
|
|
394
|
+
return `<span class="tg-offd" role="img" aria-label="${esc(words)}" title="${esc(words)}">${D.slice(0, 5).map((t) => `<i class="cz-dot ${t}"></i>`).join('')}</span>`;
|
|
395
|
+
}
|
|
396
|
+
/** A folded group's track (XcalmA2Folded): the roll-up line, the counted ◇s and the end date. Open, a group draws nothing (its rows say it). */
|
|
397
|
+
function rollUp(rows, sp, X, W, o, ms, pxPct, now) {
|
|
398
|
+
if (!sp || sp.hi <= W.from || sp.lo >= W.to) return '';
|
|
399
|
+
const L = laneMilestones(rows, now);
|
|
400
|
+
const end = o.phone ? '' : `<span class="tg-endl" style="left:${P(X(sp.hi))}" title="${esc('Last end ' + md(sp.hi) + ', ' + sp.hi.getFullYear())}"><b>${esc(my(sp.hi))}</b></span>`;
|
|
401
|
+
return progLine({ rows }, sp, X, now) + laneMarks(L, X, o.phone, pxPct, ms) + end;
|
|
402
|
+
}
|
|
374
403
|
/** The product's head row on the timeline: the name cell (tile, name, goal dots, count when folded, the fold) and the lane. Open or folded it
|
|
375
404
|
* looks the same: folded, it is the product's summary. */
|
|
376
405
|
function laneRow(g, X, W, ov, o, ms, pxPct, now) {
|
|
377
|
-
const
|
|
378
|
-
const
|
|
379
|
-
if (o.phone) return `<div class="tgq-r tg-lane${shut}" data-lane="${esc(g.key)}"><div class="tgq-n tg-lnn">${
|
|
380
|
-
return `<div class="tg-r tg-lane${shut}" role="row" data-lane="${esc(g.key)}"><div class="tg-n tg-lnn" role="rowheader">${
|
|
406
|
+
const shut = o.folded(g.key), sp = progSpan(g), L = shut ? laneMilestones(g.rows, now) : [];
|
|
407
|
+
const tr = shut ? rollUp(g.rows, sp, X, W, o, ms, pxPct, now) : '', cell = o.prodCell(g, shut ? offDots(g.rows, now) : '');
|
|
408
|
+
if (o.phone) return `<div class="tgq-r tg-lane${shut ? ' closed' : ''}" data-lane="${esc(g.key)}"><div class="tgq-n tg-lnn">${cell}</div><div class="tg-p"${L.length ? ` data-lane-ms="${laneData(L)}" data-lane-name="${esc(g.name)}"` : ''}>${ov}${tr}</div></div>`;
|
|
409
|
+
return `<div class="tg-r tg-lane${shut ? ' closed' : ''}" role="row" data-lane="${esc(g.key)}"><div class="tg-n tg-lnn" role="rowheader">${cell}</div><div class="tg-p" role="cell">${ov}${tr}</div></div>`;
|
|
381
410
|
}
|
|
382
411
|
|
|
383
|
-
/** A row's
|
|
384
|
-
|
|
385
|
-
function marks(r, X, now, phone) {
|
|
412
|
+
/** A row's release sign-off and "Push tickets" (a drafted ticket waits on your Commit) as words in its bar's hover: no blue ◆ (batch 13 item 4). */
|
|
413
|
+
function markWords(r, now) {
|
|
386
414
|
const T = r.trail || {}, out = [], rd = r.release && day(r.release.iso);
|
|
387
|
-
|
|
388
|
-
if (
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
415
|
+
if (rd && r.track && (r.track.key === 'deliver' || r.track.you)) out.push(r.release.name + ' sign-off ' + md(rd));
|
|
416
|
+
if (T.you && T.you.kind === 'commit') out.push(T.you.text || 'Push tickets now');
|
|
417
|
+
return out.join('. ');
|
|
418
|
+
}
|
|
419
|
+
/** "after <initiative>" at the plan start where a dependency is not done, from a record. */
|
|
420
|
+
function depHtml(r, X, phone) {
|
|
421
|
+
const dep = ((r.trail || {}).deps || []).find((d) => d.known && !d.done), s = day(r.start);
|
|
422
|
+
if (!dep || phone) return '';
|
|
423
|
+
const x = s && X(s) > 0 && X(s) < 100 ? X(s) : 0;
|
|
424
|
+
return `<span class="tg-dep" style="left:${P(x)}" title="Waits on ${esc(dep.title || dep.id)}">${SV(LINK)}after ${esc(dep.title || dep.id)}</span>`;
|
|
393
425
|
}
|
|
394
426
|
|
|
395
|
-
/** The overlay of a row: the
|
|
396
|
-
* the today line. */
|
|
427
|
+
/** The overlay of a row: the quarter lines, the sprint band, the release line and the today line. */
|
|
397
428
|
function overlay(W, X, now, sprint, rel) {
|
|
398
|
-
|
|
399
|
-
const
|
|
429
|
+
// quarter lines only (batch 13 item 4): weeks draw month lines, months quarter lines, quarters and years their own; no hatched ends
|
|
430
|
+
const gu = W.unit === 'w' ? 'm' : W.unit === 'm' ? 'q' : W.unit, at = [];
|
|
431
|
+
if (gu) for (let d = colAdd(gu, colStart(gu, W.from), 1); d < W.to; d = colAdd(gu, d, 1)) at.push(d);
|
|
432
|
+
else W.ticks.slice(1).forEach((k) => at.push(k.at));
|
|
433
|
+
const tl = at.map((d) => `<i class="tg-gl" style="left:${P(X(d))}"></i>`).join(''), ends = '';
|
|
400
434
|
const sa = sprint && day(sprint.start), sb = sprint && day(sprint.end);
|
|
401
435
|
const band = sa && sb && sb > W.from && sa < W.to ? `<i class="tg-sb" style="left:${P(X(sa))};width:${P(X(sb) - X(sa))}"></i>` : '';
|
|
402
436
|
const ra = rel && day(rel.iso), rl = ra && ra > W.from && ra < W.to ? `<i class="tg-rl" style="left:${P(X(ra))}"></i>` : '';
|
|
@@ -412,16 +446,16 @@ function edgeTabs(r, X, now, phone) {
|
|
|
412
446
|
const a = X(x.a).toFixed(3), b = X(x.b).toFixed(3), e = day(r.end) || x.b, late = r.over && day(r.end) && now > day(r.end);
|
|
413
447
|
// ahead, a held row names its return date, not its start (XtiAGrill 11: "⏸ Mar ’27 ›")
|
|
414
448
|
const ob = openBack(r, now), lw = late ? r.overDays + ' ' + (r.overDays === 1 ? 'day' : 'days') + ' over' : my(e), rw = ob ? my(ob) : my(x.a);
|
|
415
|
-
const tab = (side, words, cls) => `<button type="button" class="tg-edge ${side}${cls}" data-edge="${side}" data-a="${a}" data-b="${b}" tabindex="-1" hidden aria-label="${esc(r.title + ': ' + (side === 'r' && ob ? 'back from hold ' : '') + words + '. Scroll to it')}">${side === 'l' ? SV(CHL) : ''}
|
|
449
|
+
const tab = (side, words, cls) => `<button type="button" class="tg-edge ${side}${cls}" data-edge="${side}" data-a="${a}" data-b="${b}" tabindex="-1" hidden aria-label="${esc(r.title + ': ' + (side === 'r' && ob ? 'back from hold ' : '') + words + '. Scroll to it')}">${side === 'l' ? SV(CHL) : ''}<span>${esc(words)}</span>${side === 'r' ? SV(CHR) : ''}</button>`;
|
|
416
450
|
if (phone) return late ? tab('l', lw, ' late') : '';
|
|
417
451
|
return (isDone(r) ? '' : tab('l', lw, late ? ' late' : '')) + (isDone(r) ? '' : tab('r', rw, ''));
|
|
418
452
|
}
|
|
419
453
|
|
|
420
|
-
/** 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
|
|
421
|
-
*
|
|
422
|
-
*
|
|
423
|
-
*
|
|
424
|
-
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 ?
|
|
454
|
+
/** 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
|
|
455
|
+
* (extra: { plan, draft }; batch 11 item 8), one hairline key for a gap or a hold while one is drawn and Skipped while a » is (extra: { gap, skip };
|
|
456
|
+
* batch 13 item 4 folds the hold into the gap's hairline), the Jira forecast, Milestone, today. `prog` is kept for the callers: a program draws
|
|
457
|
+
* no ◇ of its own while open. */
|
|
458
|
+
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 || extra.gap ? `<span><i class="k ng"></i>${hold && extra.gap ? 'Gap or hold' : hold ? 'On hold' : 'No activity'}</span>` : ''}${extra.skip ? `<span><i class="k sk">${SV(SKIP)}</i>Skipped</span>` : ''}<span><i class="k fc"></i>Jira forecast</span><span><i class="k dlv"></i>Milestone</span><span><i class="k td"></i>Today</span></span>`;
|
|
425
459
|
|
|
426
460
|
/** The dates on record a window must hold: every shown row's plan and forecast, the programs' spans and milestones, the release. */
|
|
427
461
|
function datesOf(list, M, o) {
|
|
@@ -440,8 +474,7 @@ function scaled(rows, M, o) {
|
|
|
440
474
|
// one screen shows W.cols columns; the track is as many screens wide as the window holds (pm/bd-scroll.js measures it again on screen)
|
|
441
475
|
const days = (W.to - W.from) / 86400000, viewDays = W.fixed ? days : W.cols * COL_DAYS[W.unit];
|
|
442
476
|
const ratio = days / viewDays, tpx = Math.max(200, o.trackPx || (o.phone ? 340 : 1100)), pxDay = tpx / viewDays;
|
|
443
|
-
const
|
|
444
|
-
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)
|
|
477
|
+
const msO = { sp, reach: Math.max(1, Math.round(40 / pxDay)), mode: o.msMode || 'pinned' }; // a row's milestone ◇s closer than ~40 px merge (batch 11 item 3); the Filter's milestones (batch 13 item 4)
|
|
445
478
|
const ov = overlay(W, X, now, sprint, rel), pxPct = (tpx * (W.fixed ? 1 : ratio)) / 100;
|
|
446
479
|
const ra = rel && day(rel.iso), sa = sprint && day(sprint.start), sb = sprint && day(sprint.end);
|
|
447
480
|
// an undated program member's track says so beside today, where the view opens
|
|
@@ -470,40 +503,44 @@ function scaled(rows, M, o) {
|
|
|
470
503
|
const lane = (g) => (o.prodCell && sp !== 'sprint' ? laneRow(g, X, W, ov, o, msO, pxPct, now) : o.prodHtml(g));
|
|
471
504
|
if (o.phone) {
|
|
472
505
|
// TsCPhone: each row carries its name above its bar; the name stays at the left while you swipe
|
|
473
|
-
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)}"
|
|
506
|
+
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)}">${dotHtml(r, now)}<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>`;
|
|
474
507
|
const body = G ? G.map((g) => {
|
|
475
508
|
if (g.kind !== 'program') return lane(g) + (o.folded(g.key) ? '' : g.rows.map(one).join(''));
|
|
476
|
-
const st = o.progState(g.program),
|
|
477
|
-
|
|
478
|
-
return `<div class="tgq-r tg-pg" data-prow="${esc(g.program.id)}"><div class="tgq-n tg-pgn">${progName(g, st, o)}</div><div class="tg-p">${ov}${br}${progMarks(g, st, X, W, reach, long ? my : null, true)}</div></div>` + (o.folded(g.key) ? '' : g.products.map((x) => x.rows.map(one).join('')).join(''));
|
|
509
|
+
const st = o.progState(g.program), shut = o.folded(g.key), tr = shut ? rollUp(g.rows, progSpan(g), X, W, o, msO, pxPct, now) : '';
|
|
510
|
+
return `<div class="tgq-r tg-pg${shut ? ' closed' : ''}" data-prow="${esc(g.program.id)}"><div class="tgq-n tg-pgn">${progName(g, st, o, shut ? offDots(g.rows, now) : '')}</div><div class="tg-p">${ov}${tr}</div></div>` + (shut ? '' : g.products.map((x) => x.rows.map(one).join('')).join(''));
|
|
479
511
|
}).join('') : list.map(one).join('');
|
|
480
512
|
const top = `<div class="tgq-h"><div class="tg-p">${ticks}${pill}</div></div>`;
|
|
481
513
|
const below = none.length ? `<div class="tg-none"><span>${none.length} ${none.length === 1 ? 'has' : 'have'} no dates</span>${askBtn}</div>` : '';
|
|
482
|
-
|
|
514
|
+
// the Deliveries lane (batch 13 item 4, XcalmA6Phone): a phone shows the next deliveries above the rows (o.lane draws it; none: nothing)
|
|
515
|
+
const lanePh = o.lane ? o.lane({ W, X, rows: list, groups: G, now, phone: true, pxPct }) || '' : '';
|
|
516
|
+
return { html: lanePh + `<div class="tg tg-s tgq" ${attrs}><div class="tg-scw"><div class="tg-sc" tabindex="0" role="group" aria-label="Timeline" style="${style}"><div class="tg-in">${top}<div class="tg-body">${body || empty}</div></div></div>${back}<i class="tg-fade l" aria-hidden="true"></i><i class="tg-fade r" aria-hidden="true"></i></div></div>${below}`, none };
|
|
483
517
|
}
|
|
484
518
|
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>`;
|
|
485
519
|
// 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
|
|
486
520
|
const one = (r, cls) => { const s = o.status(r), sub = [r.owner, r.track ? r.track.label : r.stage, s.text].filter(Boolean).join(' · ');
|
|
487
|
-
|
|
521
|
+
// the dot keeps its place while it is silent, so every name starts at the same line (XcalmA1Desk)
|
|
522
|
+
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)}">${dotHtml(r, now) || '<i class="tg-nodot" 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>`; };
|
|
488
523
|
// programs first, then the product (PgTimeline): the program's row brackets its initiatives' bars and draws its milestones as diamonds
|
|
489
524
|
const body = G ? G.map((g) => {
|
|
490
525
|
if (g.kind !== 'program') return lane(g) + (o.folded(g.key) ? '' : g.rows.map((r) => one(r, ' tg-gr')).join(''));
|
|
491
526
|
const lp = g.products[g.products.length - 1], last = lp ? lp.rows[lp.rows.length - 1] : null;
|
|
492
|
-
return progRow(g, o.progState(g.program), X, W, ov, o,
|
|
527
|
+
return progRow(g, o.progState(g.program), X, W, ov, o, msO, pxPct, now) + (o.folded(g.key) ? '' : g.products.map((x) => (g.products.length > 1 ? o.subHtml(x.name) : '') + x.rows.map((r) => one(r, ' tg-kid' + (r === last ? ' last' : ''))).join('')).join(''));
|
|
493
528
|
}).join('') : list.map((r) => one(r)).join('');
|
|
494
529
|
// the sprint band and the release keep their labels under the axis on Quarter, where a week is wide enough to read them
|
|
495
530
|
const axl = sp === 'quarter' ? `${sa && sb && sb > W.from && sa < W.to ? `<span class="tg-axl sb" style="left:${P(X(sa))}">Jira ${esc(sprint.name.toLowerCase())} · ${esc(md(sa))} – ${esc(md(sb))}</span>` : ''}${ra && ra > W.from && ra < W.to ? `<span class="tg-axl rl" style="left:${P(X(ra))}">${SV(FLAG)}${esc(rel.name)} · ${esc(md(ra))}</span>` : ''}` : '';
|
|
496
531
|
const axis = axl ? `<div class="tg-ax"><span class="tg-n"></span><div class="tg-p">${axl}</div></div>` : '';
|
|
497
532
|
const foot = none.length ? `<div class="tg-ft">${none.length ? `<span class="tg-none"><b>${none.length} ${none.length === 1 ? 'has' : 'have'} no dates:</b> <span>${esc(none.slice(0, 4).map((r) => r.title).join(', '))}${none.length > 4 ? ' and ' + (none.length - 4) + ' more' : ''}</span>${askBtn}</span>` : '<span></span>'}</div>` : '';
|
|
498
|
-
|
|
533
|
+
// the Deliveries lane (batch 13 item 4, XcalmA6Lane): one row under the axis, a list per column (o.lane draws it; none: nothing)
|
|
534
|
+
const laneH = o.lane ? o.lane({ W, X, rows: list, groups: G, now, phone: false, pxPct }) || '' : '';
|
|
535
|
+
return { html: `<div class="tg tg-q tg-s" ${attrs}><div class="tg-scw"><div class="tg-sc" tabindex="0" role="group" aria-label="Timeline" style="${style}"><div class="tg-in">${head}${laneH}<div class="tg-body">${body || empty}</div>${axis}</div></div><i class="tg-fade l" aria-hidden="true"></i><i class="tg-fade r" aria-hidden="true"></i></div>${foot}</div>`, none };
|
|
499
536
|
}
|
|
500
537
|
|
|
501
|
-
/** A program's row (PgTimeline .r.pg): its tile
|
|
502
|
-
*
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
const
|
|
506
|
-
return `<div class="tg-r tg-pg" data-prow="${esc(p.id)}"><div class="tg-n tg-pgn">${progName(g, st, o)}</div><div class="tg-p">${ov}${
|
|
538
|
+
/** A program's row (PgTimeline .r.pg): its tile and title. Open, its track is empty: its initiatives' rows say it (batch 13 item 4, PlmA1 is
|
|
539
|
+
* replaced). Folded, the roll-up of its initiatives: the line from the first start to the last end, their counted ◇s, the end date, and one dot per
|
|
540
|
+
* initiative off track in the name cell. A program's own milestones are the Deliveries lane's. */
|
|
541
|
+
function progRow(g, st, X, W, ov, o, ms, pxPct, now) {
|
|
542
|
+
const p = g.program, shut = o.folded(g.key), tr = shut ? rollUp(g.rows, progSpan(g), X, W, o, ms, pxPct, now || new Date()) : '';
|
|
543
|
+
return `<div class="tg-r tg-pg${shut ? ' closed' : ''}" data-prow="${esc(p.id)}"><div class="tg-n tg-pgn">${progName(g, st, o, shut ? offDots(g.rows, now) : '')}</div><div class="tg-p">${ov}${tr}</div></div>`;
|
|
507
544
|
}
|
|
508
545
|
/** A program's thin line, dotted where every member is on hold (XtiAGrill 14): the holds of the members, intersected. */
|
|
509
546
|
function progLine(g, sp, X, now) {
|
|
@@ -548,10 +585,11 @@ function progMarks(g, st, X, W, days, fmt, phone, pxPct) {
|
|
|
548
585
|
const ahead = (st.milestones || []).filter((m) => !m.done && day(m.date)).map((m) => [+X(day(m.date)).toFixed(3), m.name + ' · ' + my(day(m.date))]).sort((a, b) => a[0] - b[0]);
|
|
549
586
|
return out + (ahead.length ? `<button type="button" class="tg-edge r pg" data-edge="m" data-ms="${esc(JSON.stringify(ahead))}" tabindex="-1" hidden><span></span>${SV(CHR)}</button>` : '');
|
|
550
587
|
}
|
|
551
|
-
/** A program's name cell: the tile, the title
|
|
552
|
-
function progName(g, st, o) {
|
|
553
|
-
const p = g.program, n = o.productsOf ? o.productsOf(p) : 0;
|
|
554
|
-
|
|
588
|
+
/** A program's name cell: the tile, the title, the off-track dots while folded, the fold; the title opens the program (bd:program). */
|
|
589
|
+
function progName(g, st, o, dots = '') {
|
|
590
|
+
const p = g.program, n = o.productsOf ? o.productsOf(p) : 0, meta = n > 1 ? n + ' products' : st.state;
|
|
591
|
+
// no "Running" under the name (batch 13 item 4: quiet rows): the state stays in its label for a reader
|
|
592
|
+
return `<button type="button" class="tg-pgo" data-prog="${esc(p.id)}" aria-haspopup="dialog" aria-label="${esc(p.title)}, a program${meta ? ', ' + esc(meta) : ''}. Open the program">${o.progTile ? o.progTile() : ''}<span class="tt"><b>${esc(p.title)}</b></span></button>${dots}${o.foldBtn ? o.foldBtn(g) : ''}`;
|
|
555
593
|
}
|
|
556
594
|
/** The program groups among the page's groups (programs first, PgTimeline), with their state; [] in By product or with no program here. */
|
|
557
595
|
const progGroups = (o) => (o.groups || []).filter((g) => g.kind === 'program').map((g) => ({ g, st: o.progState ? o.progState(g.program) : { milestones: [], state: '' } }));
|