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
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
/* pm/bd-deliveries.js — the Deliveries lane on the Board timeline (feedback batch 13 item 4, calmer timeline A6: XcalmA6Lane, XcalmA6Grill,
|
|
2
|
+
* XcalmA6Fold, XcalmA6Phone). One row under the axis says what lands when: a list per column, the date then the name.
|
|
3
|
+
* · A column is a week on Sprint, a month on Quarter and Half, a quarter on Year, a half on 2 yr and a year on 5 yr.
|
|
4
|
+
* · An entry is a milestone the timeline draws (pm/bd-pins.js shownMs: Pinned, All or None), else the row's committed end named as the row
|
|
5
|
+
* names it (the end milestone's name, else Deliver or Evaluate), else "≈" and the Jira forecast. A program's own milestone has the program icon.
|
|
6
|
+
* Drafts are not in the lane: it shows Live only.
|
|
7
|
+
* · Missed (the date passed, not done) is orange and on top. Done folds away; a past column says "✓ N delivered". Due today says "Today". At risk
|
|
8
|
+
* or slipped is amber, and the hover says the planned date. On hold is grey, with "?" when no return date is set. Same day: off track first, then A–Z.
|
|
9
|
+
* · At most 4 per column, then "+N more" (the list of that column). At 5 yr a busy column shows its count only. The current column has a faint wash.
|
|
10
|
+
* · Hover an entry: its row gets a faint wash and its ◇ a ring (a folded group: the group row). Press opens the initiative (data-key, as the row name).
|
|
11
|
+
* · The lane folds to one line, "Next · Nov 2 MAGW on auth-service · 13 more this year · 1 missed", remembered per person.
|
|
12
|
+
* · A phone shows the next 3 above the rows (missed first), with "All".
|
|
13
|
+
* · Nothing to show (Filter = None, nothing pinned): no lane at all.
|
|
14
|
+
* Pure apart from the remembered fold and wire(), which hooks the hover and the fold onto the Board's body. */
|
|
15
|
+
import { shownMs, msMode } from './bd-pins.js';
|
|
16
|
+
const TICK = '<svg aria-hidden="true" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12l5 5 9-10"/></svg>'; // the delivered mark, drawn (conformance R28-13: no glyph controls)
|
|
17
|
+
|
|
18
|
+
const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
19
|
+
const WD = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
|
|
20
|
+
const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]));
|
|
21
|
+
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; };
|
|
22
|
+
const md = (d) => MON[d.getMonth()] + ' ' + d.getDate();
|
|
23
|
+
const iso = (d) => d.getFullYear() + '-' + String(d.getMonth() + 1).padStart(2, '0') + '-' + String(d.getDate()).padStart(2, '0');
|
|
24
|
+
const midnight = (d) => new Date(d.getFullYear(), d.getMonth(), d.getDate());
|
|
25
|
+
const SV = (d) => `<svg viewBox="0 0 24 24" aria-hidden="true"><path d="${d}"/></svg>`;
|
|
26
|
+
const FLAG = 'M5 21V4M5 4h11l-2 4 2 4H5', PROG = 'M12 3l9 5-9 5-9-5zM3 13l9 5 9-5M3 17.5l9 5 9-5', CHD = 'M7 10l5 5 5-5', CHR = 'M9 6l6 6-6 6';
|
|
27
|
+
const P = (x) => x.toFixed(2) + '%';
|
|
28
|
+
const MAX = 4;
|
|
29
|
+
|
|
30
|
+
/** The lane's column for each span (XcalmA6Grill 1): w week, m month, q quarter, h half, y year. */
|
|
31
|
+
export const COL_UNIT = { sprint: 'w', quarter: 'm', half: 'm', year: 'q', y2: 'h', y5: 'y' };
|
|
32
|
+
const colStart = (u, d) => (u === 'w' ? new Date(d.getFullYear(), d.getMonth(), d.getDate() - ((d.getDay() + 6) % 7))
|
|
33
|
+
: u === 'm' ? new Date(d.getFullYear(), d.getMonth(), 1) : u === 'q' ? new Date(d.getFullYear(), d.getMonth() - (d.getMonth() % 3), 1)
|
|
34
|
+
: u === 'h' ? new Date(d.getFullYear(), d.getMonth() < 6 ? 0 : 6, 1) : new Date(d.getFullYear(), 0, 1));
|
|
35
|
+
const colNext = (u, d) => (u === 'w' ? new Date(d.getFullYear(), d.getMonth(), d.getDate() + 7) : new Date(d.getFullYear(), d.getMonth() + ({ m: 1, q: 3, h: 6 }[u] || 12), 1));
|
|
36
|
+
/** The lane's columns over the window: [{ a, b }], the first and last cut to the window. */
|
|
37
|
+
export function columnsOf(W, span) {
|
|
38
|
+
const u = COL_UNIT[span] || 'm', out = [];
|
|
39
|
+
for (let a = colStart(u, W.from); a < W.to; a = colNext(u, a)) { const b = colNext(u, a); out.push({ a: a < W.from ? W.from : a, b: b > W.to ? W.to : b }); }
|
|
40
|
+
return out;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** The fold, remembered per person. */
|
|
44
|
+
const FOLD_KEY = 'pmos.board.dlFold';
|
|
45
|
+
let FOLD = null;
|
|
46
|
+
export function folded() {
|
|
47
|
+
if (FOLD === null) { let v = null; try { v = localStorage.getItem(FOLD_KEY); } catch { v = null; } FOLD = v === '1'; }
|
|
48
|
+
return FOLD;
|
|
49
|
+
}
|
|
50
|
+
export function setFolded(on) {
|
|
51
|
+
FOLD = !!on;
|
|
52
|
+
try { localStorage.setItem(FOLD_KEY, FOLD ? '1' : '0'); } catch { /* no storage: the fold lasts until the reload */ }
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const openHold = (r) => (Array.isArray(r.holds) ? r.holds : []).find((h) => h && day(h.from) && !day(h.to)) || null;
|
|
56
|
+
const endName = (r) => (r.track && r.track.k >= 6 ? 'Evaluate' : 'Deliver');
|
|
57
|
+
/** The slip in words: "+1 wk", "+3d". */
|
|
58
|
+
const slipWords = (n) => (n >= 7 ? '+' + Math.round(n / 7) + ' wk' : '+' + n + 'd');
|
|
59
|
+
|
|
60
|
+
/** What lands when: every entry the lane lists, by date. o: { rows, groups, now, progState, mode }. An entry:
|
|
61
|
+
* { key, id, name, date, done, late, risk, hold, back, fc, prog, row, grp, planned, slip } — key: the initiative row (press opens it); prog: the program. */
|
|
62
|
+
export function entriesOf(o) {
|
|
63
|
+
const mode = o.mode || msMode();
|
|
64
|
+
if (mode === 'none') return [];
|
|
65
|
+
const now = midnight(o.now || new Date()), out = [], grp = {};
|
|
66
|
+
for (const g of o.groups || []) {
|
|
67
|
+
if (g.kind === 'program') for (const x of g.products || []) for (const r of x.rows || []) grp[r.key] = 'p:' + g.program.id;
|
|
68
|
+
else for (const r of g.rows || []) grp[r.key] = 'l:' + g.key;
|
|
69
|
+
}
|
|
70
|
+
for (const r of o.rows || []) {
|
|
71
|
+
const s = day(r.start), e = day(r.end), fc = r.track && day(r.track.forecast);
|
|
72
|
+
if (!s && !e && r.draft) continue; // a draft or a proposal is not Live (XcalmA6Grill 9)
|
|
73
|
+
const h = openHold(r), back = h ? day(h.back) : null;
|
|
74
|
+
const base = { key: r.key, row: r, grp: grp[r.key] || '', hold: !!h, back };
|
|
75
|
+
const slip = r.plan && r.plan.slip > 0 ? r.plan.slip : 0;
|
|
76
|
+
const atEnd = (d) => !!(e && +d === +e);
|
|
77
|
+
const one = (id, name, d, done, isEnd) => {
|
|
78
|
+
const late = !done && !h && (d < now || (isEnd && r.over && now > e));
|
|
79
|
+
const risk = !done && !late && !h && isEnd && (r.status === 'at risk' || slip > 0);
|
|
80
|
+
const planned = isEnd && slip ? new Date(d.getFullYear(), d.getMonth(), d.getDate() - slip) : null;
|
|
81
|
+
out.push({ ...base, id, name, date: d, done: !!done, late, risk, fc: false, planned, slip: isEnd ? slip : 0 });
|
|
82
|
+
};
|
|
83
|
+
const dated = (r.milestones || []).filter((m) => m && day(m.date));
|
|
84
|
+
if (dated.length) { for (const m of shownMs(r, mode)) one(m.id, m.name, day(m.date), m.done, atEnd(day(m.date))); continue; }
|
|
85
|
+
if (e) { one('', endName(r), e, !!(r.track && (r.track.k >= 6 && endName(r) === 'Deliver')), true); continue; }
|
|
86
|
+
// only Jira has a date (XcalmA6Grill 8): "≈" and the forecast; PMOS never presents a forecast as a commitment
|
|
87
|
+
if (fc) out.push({ ...base, id: '', name: r.title, date: fc, done: false, late: false, risk: false, fc: true, planned: null, slip: 0 });
|
|
88
|
+
}
|
|
89
|
+
// a program's own milestone (XcalmA6Grill 10): the program icon; it opens the program
|
|
90
|
+
for (const g of o.groups || []) {
|
|
91
|
+
if (g.kind !== 'program' || !o.progState) continue;
|
|
92
|
+
const st = o.progState(g.program) || {};
|
|
93
|
+
for (const m of st.milestones || []) {
|
|
94
|
+
const d = day(m.date); if (!d) continue;
|
|
95
|
+
const first = (o.rows || []).find((r) => (m.waits || []).includes(r.id));
|
|
96
|
+
out.push({ key: first ? first.key : '', id: m.id, name: m.name, date: d, done: !!m.done, late: !!m.late, risk: !m.done && !m.late && !!m.risk, hold: false, back: null, fc: false,
|
|
97
|
+
prog: g.program, from: m.titles || [], row: first || null, grp: 'p:' + g.program.id, planned: null, slip: 0 });
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return out.sort(byDate);
|
|
101
|
+
}
|
|
102
|
+
/** By date; the same day: off track first, then A–Z (XcalmA6Grill 11). */
|
|
103
|
+
const offTrack = (x) => (x.late ? 0 : x.risk || x.hold ? 1 : 2);
|
|
104
|
+
const byDate = (p, q) => p.date - q.date || offTrack(p) - offTrack(q) || String(p.name).localeCompare(String(q.name));
|
|
105
|
+
/** Missed first (orange, on top: XcalmA6Grill 4), then by date. */
|
|
106
|
+
const missedFirst = (p, q) => (q.late - p.late) || byDate(p, q);
|
|
107
|
+
|
|
108
|
+
/** An entry's date words: "Today", "≈ Oct 26", "Mar 1?" for a hold with no return date. */
|
|
109
|
+
const dateWords = (x, now) => (x.fc ? '≈ ' : '') + (+x.date === +midnight(now) ? 'Today' : md(x.date)) + (x.hold && !x.back ? '?' : '');
|
|
110
|
+
const toneOf = (x) => (x.done ? 'dn' : x.late ? 'late' : x.hold ? 'hold' : x.risk ? 'risk' : x.fc ? 'fc' : '');
|
|
111
|
+
/** An entry's hover (XcalmA6Lane): what, when; its state; where it comes from. */
|
|
112
|
+
export function hoverOf(x, now) {
|
|
113
|
+
const head = x.name + ' · ' + WD[x.date.getDay()] + ' ' + md(x.date) + (x.date.getFullYear() !== midnight(now).getFullYear() ? ', ' + x.date.getFullYear() : '');
|
|
114
|
+
const state = x.done ? 'Delivered' : x.late ? 'Missed · due ' + md(x.date) : x.hold ? 'On hold' + (x.back ? ', back ' + md(x.back) : ', no return date')
|
|
115
|
+
: x.fc ? 'Jira forecast · not a commitment' : x.risk ? 'At risk' + (x.planned ? ' · planned ' + md(x.planned) + ' (' + slipWords(x.slip) + ')' : '') : '';
|
|
116
|
+
const from = x.prog ? 'Program milestone · ' + x.prog.title + (x.from && x.from.length ? ' · from ' + x.from.join(', ') : '')
|
|
117
|
+
: [x.row && x.row.title, x.row && x.row.product].filter(Boolean).join(' · ') + ' · press to open';
|
|
118
|
+
return [head, state, from].filter(Boolean).join('\n');
|
|
119
|
+
}
|
|
120
|
+
/** The lines of a list (pm/premium-board.js lanePop): name, initiative, date and tone. */
|
|
121
|
+
const listData = (L) => esc(JSON.stringify(L.map((x) => ({ k: x.key, n: x.name, t: x.prog ? x.prog.title : x.row ? x.row.title : '', d: iso(x.date), s: x.late ? 'late' : x.done ? 'dn' : '' }))));
|
|
122
|
+
const attrs = (x) => (x.prog ? ` data-prog="${esc(x.prog.id)}" data-dl-prog="${esc(x.prog.id)}"` : ` data-key="${esc(x.key)}" data-dl-row="${esc(x.key)}"`)
|
|
123
|
+
+ (x.id ? ` data-dl-ms="${esc(x.id)}"` : '') + (x.grp ? ` data-dl-grp="${esc(x.grp)}"` : '');
|
|
124
|
+
function entryHtml(x, now) {
|
|
125
|
+
const t = toneOf(x), tip = hoverOf(x, now);
|
|
126
|
+
return `<button type="button" class="dl-e${t ? ' ' + t : ''}"${attrs(x)} title="${esc(tip)}" aria-label="${esc(tip.replace(/\n/g, '. '))}"><small>${esc(dateWords(x, now))}</small><b>${x.prog ? `<i class="dl-pg">${SV(PROG)}</i>` : ''}<span>${esc(x.name)}</span></b></button>`;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/** One column's list (XcalmA6Grill 2, 3, 4). */
|
|
130
|
+
function columnHtml(c, E, now, X, span) {
|
|
131
|
+
const today = midnight(now), past = c.b <= today, cur = c.a <= today && today < c.b;
|
|
132
|
+
const L = E.filter((x) => x.date >= c.a && x.date < c.b);
|
|
133
|
+
const done = L.filter((x) => x.done), show = L.filter((x) => !x.done).sort(missedFirst);
|
|
134
|
+
const w = `width:${P(Math.max(0, X(c.b) - X(c.a)))}`, cls = 'dl-c' + (cur ? ' now' : '');
|
|
135
|
+
let html = '';
|
|
136
|
+
if (span === 'y5' && show.length > MAX) {
|
|
137
|
+
html = `<button type="button" class="dl-more n" data-ms-lane="${listData(L)}" aria-haspopup="menu">${show.length} deliveries</button>`;
|
|
138
|
+
} else {
|
|
139
|
+
html = show.slice(0, MAX).map((x) => entryHtml(x, now)).join('');
|
|
140
|
+
if (show.length > MAX) html += `<button type="button" class="dl-more" data-ms-lane="${listData(L)}" aria-haspopup="menu">+${show.length - MAX} more</button>`;
|
|
141
|
+
}
|
|
142
|
+
// done folds away; a past column says how many landed (XcalmA6Grill 3)
|
|
143
|
+
if (past && done.length) html += `<button type="button" class="dl-dn" data-ms-lane="${listData(done)}" aria-haspopup="menu" aria-label="${done.length} delivered. List them">${TICK} ${done.length} delivered</button>`;
|
|
144
|
+
return `<div class="${cls}" style="${w}">${html}</div>`;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/** The folded line (XcalmA6Fold): "Next · Nov 2 MAGW on auth-service · 13 more this year · 1 missed". */
|
|
148
|
+
export function foldWords(E, now) {
|
|
149
|
+
const today = midnight(now), open = E.filter((x) => !x.done && !x.late && x.date >= today), missed = E.filter((x) => x.late).length;
|
|
150
|
+
const next = open[0] || null, more = open.filter((x) => x !== next && x.date.getFullYear() === today.getFullYear()).length;
|
|
151
|
+
const done = E.filter((x) => x.done).length;
|
|
152
|
+
return { next, more, missed, done };
|
|
153
|
+
}
|
|
154
|
+
function foldHtml(E, now) {
|
|
155
|
+
const f = foldWords(E, now), parts = [];
|
|
156
|
+
if (f.more) parts.push(`${f.more} more this year`);
|
|
157
|
+
if (f.missed) parts.push(`<span class="late">${f.missed} missed</span>`);
|
|
158
|
+
const next = f.next ? `<span class="dl-fx">Next</span><button type="button" class="dl-fn"${attrs(f.next)} title="${esc(hoverOf(f.next, now))}"><small class="${toneOf(f.next)}">${esc(dateWords(f.next, now))}</small> ${f.next.prog ? `<i class="dl-pg">${SV(PROG)}</i>` : ''}${esc(f.next.name)}</button>` : '';
|
|
159
|
+
const rest = parts.length ? `<span class="dl-fr">${next ? '· ' : ''}${parts.join(' · ')}</span>` : '';
|
|
160
|
+
const none = !next && !parts.length ? `<span class="dl-fr">${f.done ? TICK + ' ' + f.done + ' delivered' : 'Nothing ahead'}</span>` : '';
|
|
161
|
+
return `<div class="dl-fold">${next}${rest}${none}</div>`;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/** The phone's card (XcalmA6Phone): "Next deliveries · N missed", the next 3 (missed first), and All (the list by date). */
|
|
165
|
+
function phoneHtml(E, now) {
|
|
166
|
+
const today = midnight(now), missed = E.filter((x) => x.late), ahead = E.filter((x) => !x.done && !x.late && x.date >= today);
|
|
167
|
+
const L = missed.concat(ahead).slice(0, 3);
|
|
168
|
+
if (!L.length) return '';
|
|
169
|
+
const all = E.filter((x) => !x.done);
|
|
170
|
+
const line = (x) => `<button type="button" class="dl-pl"${attrs(x)} aria-label="${esc(hoverOf(x, now).replace(/\n/g, '. '))}"><small class="${toneOf(x)}">${esc(dateWords(x, now))}</small><b>${x.prog ? `<i class="dl-pg">${SV(PROG)}</i>` : ''}<span>${esc(x.name)}</span></b></button>`;
|
|
171
|
+
return `<section class="dl-ph" aria-label="Next deliveries"><div class="dl-phh"><b>Next deliveries</b>${missed.length ? `<span class="late">· ${missed.length} missed</span>` : ''}<button type="button" class="dl-all" data-ms-lane="${listData(all)}" data-lane-name="Deliveries" aria-haspopup="dialog" aria-label="All deliveries">All</button></div>${L.map(line).join('')}</section>`;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/** The lane: the hook pm/bd-span.js calls ({ W, X, rows, groups, now, phone }), with o: { span, progState, mode }. '' when nothing lands. */
|
|
175
|
+
export function laneHtml(c, o = {}) {
|
|
176
|
+
const now = c.now || new Date();
|
|
177
|
+
const E = entriesOf({ rows: c.rows, groups: c.groups, now, progState: o.progState, mode: o.mode })
|
|
178
|
+
.filter((x) => x.date >= c.W.from && x.date < c.W.to);
|
|
179
|
+
if (!E.length) return '';
|
|
180
|
+
if (c.phone) return phoneHtml(E, now);
|
|
181
|
+
const shut = folded();
|
|
182
|
+
const name = `<div class="tg-n dl-n"><span class="dl-ic">${SV(FLAG)}</span><span class="dl-t"><b>Deliveries</b>${shut ? '' : '<small>What lands when</small>'}</span><button type="button" class="dl-fb" data-dl-fold aria-expanded="${!shut}" aria-label="${shut ? 'Open the Deliveries lane' : 'Fold the Deliveries lane to one line'}">${SV(shut ? CHR : CHD)}</button></div>`;
|
|
183
|
+
const body = shut ? foldHtml(E, now) : columnsOf(c.W, o.span).map((col) => columnHtml(col, E, now, c.X, o.span)).join('');
|
|
184
|
+
return `<div class="tg-r tg-dl${shut ? ' shut' : ''}" role="region" aria-label="Deliveries, what lands when">${name}<div class="tg-p dl-p">${body}</div></div>`;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/** Hover links the row (XcalmA6Grill 13): the row gets a faint wash and its ◇ a ring; a folded group's row instead. The fold toggles and redraws. */
|
|
188
|
+
export function wire(root, o) {
|
|
189
|
+
if (!root || root.__dl) return;
|
|
190
|
+
root.__dl = true;
|
|
191
|
+
const lit = [];
|
|
192
|
+
const clear = () => { while (lit.length) lit.pop().classList.remove('dl-hl', 'dl-ring'); };
|
|
193
|
+
const on = (el, cls) => { if (el) { el.classList.add(cls); lit.push(el); } };
|
|
194
|
+
const q = (s) => { try { return root.querySelector(s); } catch { return null; } };
|
|
195
|
+
const cs = (v) => (typeof CSS !== 'undefined' && CSS.escape ? CSS.escape(v) : String(v).replace(/["\\]/g, '\\$&'));
|
|
196
|
+
const light = (e) => {
|
|
197
|
+
const x = e.target.closest && e.target.closest('[data-dl-row], [data-dl-prog]'); clear(); if (!x) return;
|
|
198
|
+
const row = x.dataset.dlRow ? q(`.tg-r[data-row="${cs(x.dataset.dlRow)}"], .tgq-r[data-row="${cs(x.dataset.dlRow)}"]`) : null;
|
|
199
|
+
if (row) {
|
|
200
|
+
on(row, 'dl-hl');
|
|
201
|
+
const ms = x.dataset.dlMs ? row.querySelector(`[data-ms-id="${cs(x.dataset.dlMs)}"]`) : null;
|
|
202
|
+
on(ms || row.querySelector('.tg-end'), 'dl-ring');
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
const g = x.dataset.dlProg ? 'p:' + x.dataset.dlProg : x.dataset.dlGrp || '';
|
|
206
|
+
const gr = g.startsWith('p:') ? q(`[data-prow="${cs(g.slice(2))}"]`) : g.startsWith('l:') ? q(`[data-lane="${cs(g.slice(2))}"]`) : null;
|
|
207
|
+
if (gr) { on(gr, 'dl-hl'); const d = gr.querySelectorAll('.tg-pdm, .tg-tmc, .tg-tm'); on(d[d.length - 1], 'dl-ring'); }
|
|
208
|
+
};
|
|
209
|
+
root.addEventListener('mouseover', light);
|
|
210
|
+
root.addEventListener('focusin', light);
|
|
211
|
+
root.addEventListener('mouseleave', clear);
|
|
212
|
+
root.addEventListener('focusout', clear);
|
|
213
|
+
root.addEventListener('click', (e) => {
|
|
214
|
+
if (!e.target.closest('[data-dl-fold]')) return;
|
|
215
|
+
setFolded(!folded()); clear(); o.redraw();
|
|
216
|
+
const b = root.querySelector('[data-dl-fold]'); if (b) b.focus({ preventScroll: true });
|
|
217
|
+
});
|
|
218
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/* pm/bd-pin-card.css — the ◇ card on the Board timeline (feedback batch 13 item 4, XcalmA5Milestones): the initiative's milestones with a pin each.
|
|
2
|
+
* The card is a pm/bd-pop.js popover; the Filter's "Milestones on the timeline" group uses the Filter's own chips. */
|
|
3
|
+
.bd-pp.bd-pc { padding: 12px 12px 6px; }
|
|
4
|
+
.bd-pc-h { margin: 0; font: 800 13.5px/1.3 var(--cz-sans); color: var(--cz-ink); }
|
|
5
|
+
.bd-pc-sub { margin: 2px 0 6px; font-size: 12px; font-weight: 600; }
|
|
6
|
+
.bd-pc-r { display: flex; align-items: center; gap: 10px; min-height: 44px; border-top: 1px solid var(--cz-hair); }
|
|
7
|
+
.bd-pc-r .tg-tm-i { margin-left: 4px; }
|
|
8
|
+
.bd-pc-n { flex: 1; min-width: 0; font: 700 13px/1.25 var(--cz-sans); color: var(--cz-ink2); overflow-wrap: anywhere; }
|
|
9
|
+
.bd-pc-r.on .bd-pc-n { color: var(--cz-ink); }
|
|
10
|
+
.bd-pc-n small { display: block; font-size: 11.5px; font-weight: 600; color: var(--cz-ink3); }
|
|
11
|
+
.bd-pc-n small.late { color: var(--cz-late); }
|
|
12
|
+
.bd-pc-pin { all: unset; flex: none; width: 32px; height: 32px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; color: var(--cz-ink3); cursor: pointer; }
|
|
13
|
+
.bd-pc-pin svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
|
|
14
|
+
.bd-pc-pin:hover { background: var(--cz-well); }
|
|
15
|
+
.bd-pc-pin.on { color: var(--cz-blue); background: var(--cz-bluebg); }
|
|
16
|
+
.bd-pc-pin:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; }
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/* pm/bd-pin-card.js — choose which milestones the Board timeline shows (feedback batch 13 item 4, calmer timeline A5: XcalmA5Milestones).
|
|
2
|
+
* the ◇ card a press on a row's ◇ (`[data-ms-pick]`, drawn by pm/bd-span.js) opens a card under it: the milestone's name, its date and
|
|
3
|
+
* "N of M milestones on the timeline", then every milestone of the initiative with a pin toggle. A toggle writes the pin at
|
|
4
|
+
* once (POST /api/boards/tasks/edit { pinned }, a task-pin line on the board ledger) and draws the timeline again.
|
|
5
|
+
* the Filter filterGroup() is the Filter's "Milestones on the timeline: Pinned · All · None" (timeline only; pm/bd-acts.js shows it).
|
|
6
|
+
* Which milestones are pinned is pm/bd-pins.js's rule: the PM's own pin wins, else only the row's last milestone shows. */
|
|
7
|
+
import { pmPost } from './http.js';
|
|
8
|
+
import { esc } from './premium-shell.js';
|
|
9
|
+
import * as Pop from './bd-pop.js';
|
|
10
|
+
import { isPinned, shownMs, msMode, setMsMode, MS_MODES } from './bd-pins.js';
|
|
11
|
+
|
|
12
|
+
const PIN = '<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 17v5M8 3h8l-1 5 3 4H6l3-4z"/></svg>';
|
|
13
|
+
const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
14
|
+
let A = null; // the page, as pm/bd-acts.js has it: { M(), rowOf(key), redraw(), load(), say(msg) }
|
|
15
|
+
export function init(api) { A = api; }
|
|
16
|
+
|
|
17
|
+
const todayIso = () => { const M = A.M(); return M && M.today ? String(M.today).slice(0, 10) : new Date().toISOString().slice(0, 10); };
|
|
18
|
+
/** "Jun 1", with the year only when it is not this year: "Jun 1 ’27". */
|
|
19
|
+
const when = (iso) => { const y = iso.slice(0, 4); return MON[+iso.slice(5, 7) - 1] + ' ' + +iso.slice(8, 10) + (y !== todayIso().slice(0, 4) ? ' ’' + y.slice(2) : ''); };
|
|
20
|
+
const dated = (r) => ((r && r.milestones) || []).filter((m) => m && /^\d{4}-\d{2}-\d{2}/.test(String(m.date || ''))).slice().sort((a, b) => String(a.date).localeCompare(String(b.date)));
|
|
21
|
+
/** The board an initiative belongs to: its own product's with All products picked, else this board (as pm/bd-acts.js own()). */
|
|
22
|
+
const own = (id) => { const M = A.M(), r = (M.rows || []).find((x) => x.id === id && x.ws); return r ? { ws: r.ws, board: r.boardId } : { ws: M.board.ws, board: M.board.id }; };
|
|
23
|
+
|
|
24
|
+
let cur = null; // the open card: { key, id } (the row and the milestone pressed)
|
|
25
|
+
function cardHtml(r, msId) {
|
|
26
|
+
const L = dated(r), today = todayIso();
|
|
27
|
+
if (!L.length) return `<p class="bd-pc-h">${esc(r.title)}</p><p class="bd-amut bd-pc-sub">No milestone yet. Flag a task as a milestone ◇ in the initiative's Tasks.</p>`;
|
|
28
|
+
const m0 = L.find((m) => m.id === msId) || null, on = shownMs(r).length;
|
|
29
|
+
const head = m0 ? `<p class="bd-pc-h">${esc(m0.name)}</p><p class="bd-amut bd-pc-sub">${esc(when(m0.date))} · ${on} of ${L.length} ${L.length === 1 ? 'milestone' : 'milestones'} on the timeline</p>`
|
|
30
|
+
: `<p class="bd-pc-h">${esc(r.title)}</p><p class="bd-amut bd-pc-sub">${on} of ${L.length} ${L.length === 1 ? 'milestone' : 'milestones'} on the timeline</p>`;
|
|
31
|
+
const row = (m) => {
|
|
32
|
+
const p = isPinned(r, m), late = !m.done && m.date < today;
|
|
33
|
+
const say = (p ? 'Shown on the timeline: ' : 'Show on the timeline: ') + m.name;
|
|
34
|
+
return `<div class="bd-pc-r${p ? ' on' : ''}"><i class="tg-tm-i${m.done ? ' dn' : late ? ' late' : ''}" aria-hidden="true"></i><span class="bd-pc-n">${esc(m.name)}<small${late ? ' class="late"' : ''}>${esc(when(m.date))}</small></span>`
|
|
35
|
+
+ `<button type="button" class="bd-pc-pin${p ? ' on' : ''}" data-pin-ms="${esc(m.id)}" aria-pressed="${p}" aria-label="${esc(say)}" title="${p ? 'Shown on the timeline' : 'Show on the timeline'}">${PIN}</button></div>`;
|
|
36
|
+
};
|
|
37
|
+
return head + L.map(row).join('');
|
|
38
|
+
}
|
|
39
|
+
/** Opens the ◇ card under `btn` for row `key`; `msId` is the milestone pressed ('' = the row's ◇ with no task of its own). */
|
|
40
|
+
export function openCard(btn, key, msId) {
|
|
41
|
+
const r = A.rowOf(key); if (!r) return;
|
|
42
|
+
cur = { key, id: msId || '' };
|
|
43
|
+
Pop.open(cardHtml(r, cur.id), btn, { label: 'Milestones of ' + r.title, width: 300, cls: 'bd-pc', focus: '[data-pin-ms]', onClose: () => { cur = null; } });
|
|
44
|
+
}
|
|
45
|
+
async function toggle(b) {
|
|
46
|
+
const r = cur && A.rowOf(cur.key), m = r && dated(r).find((x) => x.id === b.dataset.pinMs);
|
|
47
|
+
if (!m) return;
|
|
48
|
+
const next = !isPinned(r, m), was = m.pinned, key = cur.key, id = cur.id;
|
|
49
|
+
// at once on the page; the write follows, and a refused one puts it back
|
|
50
|
+
m.pinned = next; redrawAll(key, id, m.id);
|
|
51
|
+
const res = await pmPost('/api/boards/tasks/edit', { ...own(r.id), task: m.id, pinned: next }).catch(() => null);
|
|
52
|
+
if (!res || res.ok !== true) { if (was === undefined) delete m.pinned; else m.pinned = was; redrawAll(key, id, m.id); A.say((res && res.error) || 'The pin was not saved. The server did not say why.'); return; }
|
|
53
|
+
await A.load();
|
|
54
|
+
if (cur && cur.key === key) redrawAll(key, id, m.id, true);
|
|
55
|
+
}
|
|
56
|
+
/** The timeline and the open card again; the card stays on the ◇ it opened from (drawn anew) and the focus on the toggle pressed. */
|
|
57
|
+
function redrawAll(key, id, focusId, noTimeline) {
|
|
58
|
+
if (!noTimeline) A.redraw();
|
|
59
|
+
const r = A.rowOf(key); if (!r || !Pop.isOpen()) return;
|
|
60
|
+
const sel = `[data-ms-pick="${CSS.escape(key)}"]`, btns = [...document.querySelectorAll(sel)];
|
|
61
|
+
const anchor = btns.find((x) => (x.dataset.msId || '') === id) || btns[0];
|
|
62
|
+
if (anchor) Pop.anchor(anchor);
|
|
63
|
+
Pop.redraw(cardHtml(r, id));
|
|
64
|
+
const f = Pop.el().querySelector(`[data-pin-ms="${CSS.escape(focusId)}"]`); if (f) f.focus({ preventScroll: true });
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** The Filter's group (timeline only): "Milestones on the timeline: Pinned · All · None", the choice remembered per person. */
|
|
68
|
+
export function filterGroup() {
|
|
69
|
+
const m = msMode();
|
|
70
|
+
return `<p class="bd-mlbl">Milestones on the timeline</p><div class="bd-fg" role="radiogroup" aria-label="Milestones on the timeline">${MS_MODES.map(([k, n]) => `<button type="button" class="bd-chip${k === m ? ' on' : ''}" role="radio" aria-checked="${k === m}" data-msmode="${k}">${n}</button>`).join('')}</div>`
|
|
71
|
+
+ '<p class="bd-amut bd-mnote">Pinned = the last milestone, plus any you pin.</p>';
|
|
72
|
+
}
|
|
73
|
+
/** A Filter press on Pinned, All or None; the caller draws the Filter and the page again. */
|
|
74
|
+
export function pickMode(b) { setMsMode(b.dataset.msmode); }
|
|
75
|
+
|
|
76
|
+
document.addEventListener('click', (e) => {
|
|
77
|
+
if (!A || !A.M()) return;
|
|
78
|
+
const pk = e.target.closest('[data-ms-pick]'); if (pk) { e.preventDefault(); openCard(pk, pk.dataset.msPick, pk.dataset.msId || ''); return; }
|
|
79
|
+
const pn = e.target.closest('[data-pin-ms]'); if (pn && Pop.isOpen() && Pop.el().contains(pn)) toggle(pn);
|
|
80
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/* pm/bd-pins.js — which milestones the Board timeline draws (feedback batch 13 item 4, calmer timeline A5: XcalmA5Milestones).
|
|
2
|
+
* An initiative can have many milestone tasks (iterations, a release, evaluations). The timeline draws only the pinned ones; by default that is
|
|
3
|
+
* the last one. Filter switches the whole Board: "Milestones on the timeline: Pinned · All · None", remembered per person.
|
|
4
|
+
* isPinned(r, m) a milestone's own pin (m.pinned true or false) wins; else only the row's last dated milestone is pinned
|
|
5
|
+
* shownMs(r, mode) the row's dated milestones the timeline draws, by date
|
|
6
|
+
* msMode() · setMsMode the Filter choice: 'pinned' (the default), 'all' or 'none'
|
|
7
|
+
* Pure apart from the remembered choice. */
|
|
8
|
+
const MODE_KEY = 'pmos.board.msMode';
|
|
9
|
+
export const MS_MODES = [['pinned', 'Pinned'], ['all', 'All'], ['none', 'None']];
|
|
10
|
+
const isDay = (v) => /^\d{4}-\d{2}-\d{2}/.test(String(v || ''));
|
|
11
|
+
const datedMs = (r) => (r && Array.isArray(r.milestones) ? r.milestones : []).filter((m) => m && isDay(m.date)).slice().sort((a, b) => String(a.date).localeCompare(String(b.date)));
|
|
12
|
+
|
|
13
|
+
/** Whether the timeline draws this milestone while Filter says Pinned. */
|
|
14
|
+
export function isPinned(r, m) {
|
|
15
|
+
if (typeof m.pinned === 'boolean') return m.pinned;
|
|
16
|
+
const M = datedMs(r);
|
|
17
|
+
return !!M.length && M[M.length - 1].id === m.id;
|
|
18
|
+
}
|
|
19
|
+
/** The row's dated milestones the timeline draws: none, all, or the pinned ones. */
|
|
20
|
+
export function shownMs(r, mode = msMode()) {
|
|
21
|
+
if (mode === 'none') return [];
|
|
22
|
+
const M = datedMs(r);
|
|
23
|
+
return mode === 'all' ? M : M.filter((m) => isPinned(r, m));
|
|
24
|
+
}
|
|
25
|
+
let MODE = null;
|
|
26
|
+
export function msMode() {
|
|
27
|
+
if (MODE === null) { let v = null; try { v = localStorage.getItem(MODE_KEY); } catch { v = null; } MODE = MS_MODES.some(([k]) => k === v) ? v : 'pinned'; }
|
|
28
|
+
return MODE;
|
|
29
|
+
}
|
|
30
|
+
export function setMsMode(m) {
|
|
31
|
+
MODE = MS_MODES.some(([k]) => k === m) ? m : 'pinned';
|
|
32
|
+
try { localStorage.setItem(MODE_KEY, MODE); } catch { /* no storage: the choice lasts until the reload */ }
|
|
33
|
+
}
|
|
@@ -55,5 +55,7 @@ export function close(back) {
|
|
|
55
55
|
if (from) { from.setAttribute('aria-expanded', 'false'); if (back && document.contains(from)) from.focus({ preventScroll: true }); }
|
|
56
56
|
const cb = onClose; from = null; onClose = null; if (cb) cb();
|
|
57
57
|
}
|
|
58
|
+
/** The open card's button is drawn anew (the page redrew under it): the card stays and follows the new one. */
|
|
59
|
+
export function anchor(btn) { if (!host || host.hidden || !btn) return; from = btn; btn.setAttribute('aria-expanded', 'true'); }
|
|
58
60
|
export const isOpen = () => !!host && !host.hidden;
|
|
59
61
|
export const el = () => host;
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* mergeBoards(list) All products: one Board model from every product's model, each row keeping its own product
|
|
12
12
|
* bandHtml(g, st, o) the stage track's program row: tile, title, products, your count, its spread, its next milestones
|
|
13
13
|
* prodHtml(g, o) · subHtml(name) a product group's head row (tile, name, goal dots, chevron) and a program's product sub-row
|
|
14
|
-
* prodCell(g)
|
|
14
|
+
* prodCell(g, dots) the head's fold button alone (the timeline's product lane, batch 11 item 17); dots replace the goal dots
|
|
15
15
|
* goalsFrom(fn) · goalsHtml(name) the goal dots of a product head, from Home's source (pm/home-list.js goalsOf); fn(name) gives its rows
|
|
16
16
|
*
|
|
17
17
|
* A program has no stage of its own (PM, 2026-10-23): the band shows only what its initiatives say. With one product picked, the program shows
|
|
@@ -171,9 +171,10 @@ export function prodHtml(g, cls = 'bt-prd') {
|
|
|
171
171
|
return `<div class="${cls}${folded(g.key) ? ' closed' : ''}" role="row">${prodCell(g)}</div>`;
|
|
172
172
|
}
|
|
173
173
|
/** The fold button of a product head alone: the timeline's product lane (batch 11 item 17, PlmA1Board) puts it in the name cell, its track beside it. */
|
|
174
|
-
export function prodCell(g) {
|
|
175
|
-
|
|
176
|
-
|
|
174
|
+
export function prodCell(g, dots) {
|
|
175
|
+
// the calm timeline (batch 13 item 4) passes its own dots: none while open, one per initiative off track while folded
|
|
176
|
+
const open = !folded(g.key), gl = dots !== undefined ? dots : open ? goalsHtml(g.name) : '';
|
|
177
|
+
return `<button type="button" class="bd-prdb" data-fold="${esc(g.key)}" aria-expanded="${open}" aria-label="${esc(g.name)}, ${g.rows.length} ${plural(g.rows.length, 'initiative', 'initiatives')}. ${open ? 'Fold' : 'Show'}">${tileHtml(g.name)}<span>${esc(g.name)}</span>${gl}${open || dots !== undefined ? '' : `<span class="n">${g.rows.length}</span>`}${SV(open ? CHEV_D : CHEV_R)}</button>`;
|
|
177
178
|
}
|
|
178
179
|
/** The goal dots of a product's head (PgBoard .gd), from the same source as Home's product header (pm/home-list.js goalsOf): one per KR or
|
|
179
180
|
* budget its open initiatives anchor to, green on track, amber at risk. With no goal anchored, nothing is drawn. The page sets the rows. */
|