create-pmos 0.412.0 → 0.414.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/AGENTS.md +2 -2
- package/payload/KIT-VERSION +1 -1
- package/payload/mods/pmos-cockpit/README.md +1 -1
- package/payload/mods/pmos-cockpit/hooks/lib/guard.mjs +11 -5
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/scripts/pmos-log.sh +18 -4
- package/payload/state/discoveries.md +1 -1
- package/workspace/board-programs-test.js +2 -2
- package/workspace/briefing-premium-board-test.js +45 -9
- package/workspace/briefing-premium-test.js +3 -2
- package/workspace/changelog.json +24 -0
- package/workspace/core-docs-workflow-test.js +144 -0
- package/workspace/guide/programs.md +13 -0
- package/workspace/guide/workflows.md +15 -1
- package/workspace/home-other-product-test.js +18 -0
- package/workspace/lib/board-premium.js +8 -2
- package/workspace/lib/briefing-premium-agent.js +16 -4
- package/workspace/lib/core-docs.js +79 -14
- package/workspace/lib/engine/boards.js +20 -12
- package/workspace/lib/headless.js +10 -1
- package/workspace/lib/initiative-chat.js +50 -0
- package/workspace/lib/initiative-premium.js +17 -7
- package/workspace/lib/item-cli.js +7 -2
- package/workspace/lib/milestone-review.js +120 -0
- package/workspace/lib/milestone-suggest.js +176 -0
- package/workspace/lib/plan-items.js +1 -1
- package/workspace/lib/pmos-verbs.js +7 -1
- package/workspace/lib/program-chat.js +1 -1
- package/workspace/lib/program-cli.js +56 -0
- package/workspace/lib/programs.js +25 -6
- package/workspace/lib/routes-boards.js +77 -13
- package/workspace/lib/routes-briefing-premium.js +17 -1
- package/workspace/lib/routes-core-docs.js +3 -1
- package/workspace/lib/routes-programs.js +84 -7
- package/workspace/lib/task-cli.js +120 -0
- package/workspace/lib/workflow-chat.js +1 -0
- package/workspace/lib/workflow-cli.js +91 -6
- package/workspace/milestone-suggest-test.js +175 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-chat-line-test.js +12 -1
- package/workspace/premium-vw-item-test.js +3 -3
- package/workspace/premium-vw-jira-test.js +2 -1
- package/workspace/program-order-test.js +180 -0
- package/workspace/public/pm/bd-ini-model.js +81 -0
- package/workspace/public/pm/bd-ini-panel.js +123 -58
- package/workspace/public/pm/bd-prog-panel.js +54 -14
- package/workspace/public/pm/bd-prog.js +3 -3
- package/workspace/public/pm/cozy-home.css +5 -0
- package/workspace/public/pm/cozy-panel.css +2 -0
- package/workspace/public/pm/cozy-viewer.js +10 -3
- package/workspace/public/pm/cozy-xv.css +51 -16
- package/workspace/public/pm/cozy-xv.js +6 -5
- package/workspace/public/pm/goal-chat.js +1 -1
- package/workspace/public/pm/home-app.js +35 -19
- package/workspace/public/pm/home-ask.js +9 -3
- package/workspace/public/pm/home-chat.js +16 -2
- package/workspace/public/pm/home-ini-model.js +42 -29
- package/workspace/public/pm/home-ini.css +1 -0
- package/workspace/public/pm/home-ini.js +26 -34
- package/workspace/public/pm/home-list.js +14 -8
- package/workspace/public/pm/home-stage-card.js +3 -1
- package/workspace/public/pm/home-task.js +41 -65
- package/workspace/public/pm/home-today.js +11 -12
- package/workspace/public/pm/ms-suggest.css +50 -0
- package/workspace/public/pm/ms-suggest.js +98 -0
- package/workspace/public/pm/premium-board.js +13 -7
- package/workspace/public/pm/premium-initiative-head.js +32 -13
- package/workspace/public/pm/premium-viewer.js +1 -0
- package/workspace/public/pm/premium-vw-item-model.js +13 -7
- package/workspace/public/pm/premium-vw-item.js +49 -5
- package/workspace/public/pm/prog-order.css +47 -0
- package/workspace/public/pm/prog-order.js +188 -0
- package/workspace/public/pm/program-charter.js +47 -7
- package/workspace/public/pm/program-model.js +79 -1
- package/workspace/public/pm/task-card.css +108 -0
- package/workspace/public/pm/task-card.js +271 -0
- package/workspace/public/pm/wf-page.js +3 -0
- package/workspace/server.js +23 -1
- package/workspace/skills/milestone-review.skill +53 -0
- package/workspace/skills/workflow-setup.skill +14 -5
- package/workspace/stage-card-test.js +11 -0
- package/workspace/task-card-test.js +248 -0
- package/workspace/test-lists/bd-ini-panel.json +5 -0
- package/workspace/test-lists/core-documents-backend.json +15 -3
- package/workspace/test-lists/milestone-suggest.json +6 -0
- package/workspace/test-lists/program-order.json +6 -0
- package/workspace/test-lists/task-card.json +6 -0
- package/workspace/test-lists/workflow-stage.json +5 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/* pm/ms-suggest.js — Claude's milestone suggestions on the program panel and on Home (feedback batch 4 item 6; canvas XmsgB, sticky xmsgRules).
|
|
2
|
+
*
|
|
3
|
+
* openOf(p) the suggestions that wait on the PM (GET /api/programs' p.review.open), [] when none
|
|
4
|
+
* words(p, i) one suggestion in words: { title, day, why, src, op }
|
|
5
|
+
* firstHtml(p, L) a program with no milestones: Claude's first suggestions where "Add the first milestone" was (XmsgB, first frame)
|
|
6
|
+
* rowsHtml(p, L) later changes, as rows at the top of Waits on you (XmsgB, second frame)
|
|
7
|
+
* homeSub(p) Home's Your move line under the program's name: "3 milestone changes · Pilot live to Dec 2", '' when none
|
|
8
|
+
* factsOf(st, milestoneStep) the ◆ dates of the program's initiatives as one string, for POST /api/programs/facts (a moved date asks Claude once)
|
|
9
|
+
* answer(pmPost, p, key, a) POST /api/programs/suggestion: keep (written at once), edit (saved from the charter), decline
|
|
10
|
+
*
|
|
11
|
+
* Every press is icon-only: ✓ keeps, the pencil opens the charter with the change filled in, ✕ drops it (Claude does not ask again unless the
|
|
12
|
+
* source changes). A row says why and where it came from. Nothing shows when there is nothing to suggest (zero is silence). The presses carry
|
|
13
|
+
* data-ms-act and data-key; the panel handles them. */
|
|
14
|
+
const esc = (s) => String(s == null ? '' : s).replace(/[&<>"]/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"' }[c]));
|
|
15
|
+
const SV = (d, w, sw) => `<svg viewBox="0 0 24 24" width="${w || 16}" height="${w || 16}" fill="none" stroke="currentColor" stroke-width="${sw || 1.8}" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="${d}"/></svg>`;
|
|
16
|
+
const I = {
|
|
17
|
+
check: 'M5 12l5 5 9-10', pen: 'M4 20h4L19 9l-4-4L4 16zM13.5 6.5l4 4', x: 'M6 6l12 12M18 6L6 18',
|
|
18
|
+
spark: 'M12 3v4M12 17v4M3 12h4M17 12h4M6 6l2.5 2.5M15.5 15.5L18 18M6 18l2.5-2.5M15.5 8.5L18 6',
|
|
19
|
+
cal: 'M4 6h16v14H4zM4 10h16M8 3v4M16 3v4', mic: 'M12 3a3 3 0 0 1 3 3v5a3 3 0 0 1-6 0V6a3 3 0 0 1 3-3zM5 11a7 7 0 0 0 14 0M12 18v3',
|
|
20
|
+
tk: 'M4 6h16v12H4zM8 10h8M8 14h5', dot: 'M12 12h.01',
|
|
21
|
+
};
|
|
22
|
+
const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
23
|
+
const dayOf = (iso) => { const m = /^(\d{4})-(\d{2})-(\d{2})/.exec(String(iso || '')); return m ? new Date(+m[1], +m[2] - 1, +m[3]) : null; };
|
|
24
|
+
/** "Nov 14" this year, "Feb 20, 2027" another year. */
|
|
25
|
+
export function shortDate(iso, now = Date.now()) {
|
|
26
|
+
const d = dayOf(iso); if (!d) return '';
|
|
27
|
+
return MON[d.getMonth()] + ' ' + d.getDate() + (d.getFullYear() !== new Date(now).getFullYear() ? ', ' + d.getFullYear() : '');
|
|
28
|
+
}
|
|
29
|
+
const list = (a) => (a.length < 2 ? a.join('') : a.slice(0, -1).join(', ') + ' and ' + a[a.length - 1]);
|
|
30
|
+
const plural = (n, a, b) => (n === 1 ? a : b);
|
|
31
|
+
(function sheet() { // once, at import: the panel opens on the Board and in Home's Viewer, and the look must come with it on both
|
|
32
|
+
if (typeof document === 'undefined' || !document.head || typeof document.getElementById !== 'function' || document.getElementById('msgCss')) return;
|
|
33
|
+
const l = document.createElement('link'); l.id = 'msgCss'; l.rel = 'stylesheet';
|
|
34
|
+
try { l.href = new URL('./ms-suggest.css', import.meta.url).href; } catch { l.href = '/pm/ms-suggest.css'; }
|
|
35
|
+
document.head.appendChild(l);
|
|
36
|
+
})();
|
|
37
|
+
|
|
38
|
+
export const openOf = (p) => ((p && p.review && Array.isArray(p.review.open)) ? p.review.open : []);
|
|
39
|
+
const msOf = (p, id) => ((p && p.milestones) || []).find((m) => m.id === id) || null;
|
|
40
|
+
export function words(p, i, now) {
|
|
41
|
+
const m = i.milestone ? msOf(p, i.milestone) : null, name = (m && m.name) || i.name || 'A milestone';
|
|
42
|
+
const title = i.op === 'add' ? i.name
|
|
43
|
+
: i.op === 'move' ? 'Move ' + name + ' to ' + shortDate(i.date, now)
|
|
44
|
+
: i.op === 'rename' ? 'Rename ' + name + ' to ' + i.name
|
|
45
|
+
: i.op === 'drop' ? 'Drop ' + name
|
|
46
|
+
: 'Mark ' + name + ' at risk';
|
|
47
|
+
return { op: i.op, title, day: i.op === 'add' ? shortDate(i.date, now) : '', why: i.why, src: i.src || { kind: '', label: '' } };
|
|
48
|
+
}
|
|
49
|
+
const SRC_ICON = { jira: I.tk, meeting: I.mic, task: I.tk, target: I.cal, deliver: '', member: '', charter: '' };
|
|
50
|
+
function srcHtml(s) {
|
|
51
|
+
if (!s || !s.label) return '';
|
|
52
|
+
// an initiative or a ◆ date carries the program's diamond; Jira and tasks a ticket; meetings a mic; the target a calendar
|
|
53
|
+
const mark = SRC_ICON[s.kind] ? SV(SRC_ICON[s.kind], 12) : '<i class="msg-gd" aria-hidden="true"></i>';
|
|
54
|
+
return `<span class="msg-src">${mark}${esc(s.label)}</span>`;
|
|
55
|
+
}
|
|
56
|
+
function presses(i, t) {
|
|
57
|
+
return `<span class="msg-ends"><button type="button" class="msg-ok" data-ms-act="keep" data-key="${esc(i.key)}" aria-label="${esc('Keep: ' + t)}" title="Keep">${SV(I.check, 15, 2.4)}</button>`
|
|
58
|
+
+ `<button type="button" class="msg-ib" data-ms-act="edit" data-key="${esc(i.key)}" aria-label="${esc('Change in the charter: ' + t)}" title="Change in the charter">${SV(I.pen, 15)}</button>`
|
|
59
|
+
+ `<button type="button" class="msg-ib" data-ms-act="drop" data-key="${esc(i.key)}" aria-label="${esc('Drop: ' + t)}" title="Drop">${SV(I.x, 15)}</button></span>`;
|
|
60
|
+
}
|
|
61
|
+
function rowHtml(p, i, cls) {
|
|
62
|
+
const w = words(p, i);
|
|
63
|
+
return `<div class="msg-r${cls ? ' ' + cls : ''}" role="listitem"><span class="msg-mk" aria-hidden="true">${SV(I.spark, 14)}</span>`
|
|
64
|
+
+ `<span class="msg-t"><span class="msg-h"><b>${esc(w.title)}</b>${w.day ? `<span class="msg-d">${esc(w.day)}</span>` : ''}</span><span class="msg-w">${esc(w.why)}</span>${srcHtml(w.src)}</span>${presses(i, w.title)}</div>`;
|
|
65
|
+
}
|
|
66
|
+
/** What the first suggestions came from, in words: "the initiatives' ◆ dates, a task and the steering notes". */
|
|
67
|
+
function fromWords(L) {
|
|
68
|
+
const out = [];
|
|
69
|
+
const add = (s) => { if (s && !out.includes(s)) out.push(s); };
|
|
70
|
+
for (const i of L) {
|
|
71
|
+
const k = i.src && i.src.kind;
|
|
72
|
+
add(k === 'deliver' || k === 'member' ? 'the initiatives\' ◆ dates' : k === 'task' ? 'a task' : k === 'meeting' ? 'the ' + String(i.src.label).replace(/,.*$/, '').toLowerCase() + ' notes'
|
|
73
|
+
: k === 'jira' ? 'Jira' : k === 'target' ? 'the target date' : k === 'charter' ? 'the charter' : '');
|
|
74
|
+
}
|
|
75
|
+
return list(out);
|
|
76
|
+
}
|
|
77
|
+
export function firstHtml(p, L) {
|
|
78
|
+
const n = L.length, from = fromWords(L);
|
|
79
|
+
const all = L.length > 1 ? `<span class="msg-ends"><button type="button" class="msg-ok" data-ms-act="keepall" aria-label="Keep all ${n} suggestions" title="Keep all">${SV(I.check, 15, 2.4)}</button>`
|
|
80
|
+
+ `<button type="button" class="msg-ib" data-ms-act="dropall" aria-label="Drop all ${n} suggestions" title="Drop all">${SV(I.x, 15)}</button></span>` : '';
|
|
81
|
+
return `<div class="msg-box" role="group" aria-label="Claude's suggested milestones"><div class="msg-hd"><span class="msg-mk" aria-hidden="true">${SV(I.spark, 14)}</span>`
|
|
82
|
+
+ `<span class="msg-ht"><b>Claude suggests ${n} ${plural(n, 'milestone', 'milestones')}</b>${from ? ' from ' + esc(from) : ''}</span>${all}</div>`
|
|
83
|
+
+ `<div role="list">${L.map((i) => rowHtml(p, i, 'first')).join('')}</div></div>`;
|
|
84
|
+
}
|
|
85
|
+
export function rowsHtml(p, L) { return L.length ? `<div class="msg-list" role="list" aria-label="Claude's milestone changes">${L.map((i) => rowHtml(p, i, '')).join('')}</div>` : ''; }
|
|
86
|
+
export function homeSub(p) {
|
|
87
|
+
const L = openOf(p); if (!L.length) return '';
|
|
88
|
+
if (!((p && p.milestones) || []).length && L.every((i) => i.op === 'add')) return L.length + ' ' + plural(L.length, 'milestone', 'milestones') + ' suggested';
|
|
89
|
+
return L.length + ' milestone ' + plural(L.length, 'change', 'changes') + ' · ' + words(p, L[0]).title.replace(/^Move /, '');
|
|
90
|
+
}
|
|
91
|
+
/** The ◆ dates the page reads for the program's initiatives: "ini:2026-11-14,…" sorted, '' when none has one. */
|
|
92
|
+
export function factsOf(st, step) {
|
|
93
|
+
return ((st && st.inis) || []).map((i) => { const s = step(i.row); return s && s.date ? i.id + ':' + s.date : ''; }).filter(Boolean).sort().join(',');
|
|
94
|
+
}
|
|
95
|
+
export async function answer(pmPost, p, key, a) {
|
|
96
|
+
const r = await pmPost('/api/programs/suggestion', { program: p.id, key, answer: a }).catch(() => null);
|
|
97
|
+
return r && r.ok ? { ok: true } : { ok: false, error: (r && r.error) || 'Not saved. The server did not say why.' };
|
|
98
|
+
}
|
|
@@ -31,6 +31,7 @@ import { programOf } from './program-model.js';
|
|
|
31
31
|
import { open as viewerOpen } from './cozy-viewer.js';
|
|
32
32
|
import * as VW from './cozy-viewer.js';
|
|
33
33
|
import * as PP from './bd-prog-panel.js';
|
|
34
|
+
import * as PO from './prog-order.js'; // the order of a program's initiatives: the grip and Claude's order from the dates (canvas RoADrag, RoASuggest)
|
|
34
35
|
import * as BI from './bd-ini-panel.js';
|
|
35
36
|
import { initiativeRename } from './rename-press.js';
|
|
36
37
|
import { setSay } from './cozy-xv.js';
|
|
@@ -328,7 +329,7 @@ function bandsHtml(r, t) {
|
|
|
328
329
|
return `<span class="${cls}" title="${esc(title)}">${i === at ? `<em>${esc(x.name)} · ${DAYS(t)}</em>` : ''}</span>`;
|
|
329
330
|
}).join('')}</div>`).join('');
|
|
330
331
|
}
|
|
331
|
-
function trackRow(r, cls = '') {
|
|
332
|
+
function trackRow(r, cls = '', po = false) {
|
|
332
333
|
const t = r.track || { k: -1, label: r.stage || 'No stage', output: '', segs: [], skipped: [] }, s = statusOf(r), pf = TK.mode === 'pf';
|
|
333
334
|
const S = pf ? M.steps : TK.steps || [];
|
|
334
335
|
const own = !pf && TK.mode === 'wf' ? WF.stagesOfRow(r) : null, cur = own ? WF.stageOfRow(r) : null;
|
|
@@ -338,13 +339,13 @@ function trackRow(r, cls = '') {
|
|
|
338
339
|
const cells = TK.mode === 'cats' ? bandsHtml(r, t) : S.map((st, j) => {
|
|
339
340
|
const cls = ['sc', j === 0 ? 'f0' : '', j === S.length - 1 ? 'l' : '', st.ms ? 'ms' : '', j < k ? 'p' : '', sk.has(j) ? 'k' : '', j === k ? 'c bg' : ''].filter(Boolean).join(' ');
|
|
340
341
|
const why = sk.has(j) && (pf ? (t.skipWhy || []).find((x) => x.stage === st.key) : ((own || []).find((y) => y.key === st.key) || {}).skipped);
|
|
341
|
-
const title = j === k ? dayTitle(t) : sk.has(j) ? st.label + ' skipped' + (why && why.why ? ': ' + why.why : '') : '';
|
|
342
|
+
const title = j === k ? dayTitle(t) : sk.has(j) ? st.label + ' skipped' + (why && why.why ? ': ' + why.why : '') : st.label + (j < k ? ' · done' : ''); // every bar names its stage on hover
|
|
342
343
|
const eta = E && E.j === j ? E : null;
|
|
343
344
|
const etaH = eta ? `<small class="eta${eta.late ? ' late' : ''}" title="${esc(eta.what + (eta.late ? ', passed' : ''))}">${esc(eta.text)}</small>` : '';
|
|
344
345
|
return `<div class="${cls}" role="cell"${title ? ` title="${esc(title)}"` : ''}>${j === k ? `<span class="cur"><u class="cz-dot ${s.tone} ${s.mo}"></u>${eta ? etaH : `<small>${DAYS(t)}</small>`}</span>` : '<i></i>' + etaH}</div>`;
|
|
345
346
|
}).join('');
|
|
346
347
|
const many = TK.mode === 'cats'; // All: each row names its workflow with its icon (WfATrack)
|
|
347
|
-
return `<div class="bt-r bt-l${cls}${peek && peek.key === r.key && peek.kind !== 'acts' ? ' sel' : ''}${r.acts && r.acts.life === 'hold' ? ' held' : ''}" role="row" data-row="${esc(r.key)}"
|
|
348
|
+
return `<div class="bt-r bt-l${cls}${peek && peek.key === r.key && peek.kind !== 'acts' ? ' sel' : ''}${r.acts && r.acts.life === 'hold' ? ' held' : ''}" role="row" data-row="${esc(r.key)}"${po ? ` data-po-id="${esc(r.id)}"` : ''}>${po ? PO.gripHtml(r.title) : ''}`
|
|
348
349
|
+ `<button type="button" class="ini2 bt-nm" data-key="${esc(r.key)}" role="rowheader" aria-haspopup="dialog"><b>${r.inProgram ? PG.memberIcon(PGS, r.inProgram) : ''}${many ? WF.wfIcon(WF.wfOf(r), 18) : ''}${esc(r.title)}</b><span class="cs s-${s.tone}"><i class="cz-dot ${s.tone}"></i>${esc(s.text)}</span><span class="bt-pst">${t.ms ? '<i class="cz-ms" aria-hidden="true"></i>' : ''}${esc(t.label)} · ${DAYS(t)}</span></button>`
|
|
349
350
|
+ `<div class="${cellsCls()}" role="presentation"${cellsStyle()}>${cells}</div>`
|
|
350
351
|
+ `<div class="bt-dl" role="cell"><div class="t1"><b>${esc(outName(t.output))}</b><span>${esc(t.count || '')}</span></div>${segHtml(r)}<div class="t3">${lineHtml(r)}</div></div></div>`;
|
|
@@ -378,8 +379,10 @@ function drawTrack(L) {
|
|
|
378
379
|
const meFold = (rs) => { const seen2 = new Set(), on = [], off = []; for (const r of rs) { if (isME(r) && seen2.has(r.track.k) && !foldOpen) off.push(r); else { if (isME(r)) seen2.add(r.track.k); on.push(r); } } return { on, off }; };
|
|
379
380
|
const rows = G ? G.map((g) => {
|
|
380
381
|
if (g.kind === 'program') {
|
|
381
|
-
|
|
382
|
-
|
|
382
|
+
// a program's rows follow its order (option A): each product's rows are one list the grip reorders (RoADrag)
|
|
383
|
+
const kids = PG.folded(g.key) ? '' : g.products.map((sub) => (g.products.length > 1 ? PG.subHtml(sub.name) : '') + `<div role="presentation" class="po-list" data-po-list="${esc(g.program.id)}">${sub.rows.map((r) => trackRow(r, ' bt-kid' + (r === g.rows[g.rows.length - 1] ? ' last' : ''), true)).join('')}</div>`).join('');
|
|
384
|
+
const st = progState(g.program);
|
|
385
|
+
return PG.bandHtml(g, st, { steps: S, plain: TK.mode !== 'pf', sug: PO.sugHtml(g.program, st) }) + kids;
|
|
383
386
|
}
|
|
384
387
|
if (PG.folded(g.key)) return PG.prodHtml(g);
|
|
385
388
|
const f = meFold(g.rows); inGroups += f.off.length;
|
|
@@ -555,7 +558,7 @@ async function loadOthers() {
|
|
|
555
558
|
let a = null; try { a = await (await fetch('/api/board-premium?ws=' + encodeURIComponent(w) + '&board=' + encodeURIComponent(b.id), { credentials: 'same-origin' })).json(); } catch { a = null; }
|
|
556
559
|
const m = a && a.ok && a.model; if (!m) continue; // still reading, or not read: the member stays "missing", never guessed
|
|
557
560
|
const st = m.steps || [];
|
|
558
|
-
XR[w] = { name: (m.board && (m.board.product || m.board.name)) || b.name, rows: (m.rows || []).filter((x) => x.id).map((x) => ({ id: x.id, title: x.title, stage: x.track && x.track.k >= 0 && st[x.track.k] ? st[x.track.k].key : x.stage })) };
|
|
561
|
+
XR[w] = { name: (m.board && (m.board.product || m.board.name)) || b.name, rows: (m.rows || []).filter((x) => x.id).map((x) => ({ id: x.id, title: x.title, stage: x.track && x.track.k >= 0 && st[x.track.k] ? st[x.track.k].key : x.stage, start: x.start || null, end: x.end || null })) };
|
|
559
562
|
}
|
|
560
563
|
if (Object.keys(XR).length) drawInit();
|
|
561
564
|
}
|
|
@@ -791,7 +794,7 @@ Asks.init({ M: () => M, load, say, panel: actsPanel, close: closePanel, rowOf, o
|
|
|
791
794
|
Acts.init({ M: () => M, wf: wfState, load, say, panel: actsPanel, close: closePanel, redraw: () => { drawChips(); drawInit(); if (tab === 'docs') drawDocs(); }, F, rowOf, statusOf, openIni: openIniAny,
|
|
792
795
|
openTicket: (ini, tk) => openTicket(ini, tk, $('#bdFind')), askHref, pageHref, trail: TI, docMeta, loadDocMeta, viewDoc,
|
|
793
796
|
grouping: () => ({ on: groupingOn(), byProduct }), setGrouping });
|
|
794
|
-
BI.mount({ M: () => M, statusOf, dayTitle, fmt, md, ago, segHtml, barHtml: V.barHtml, grill: (id) => GR[id], rowOf, pageHref, askHref, refreshJira: () => refreshJira(), viewDoc,
|
|
797
|
+
BI.mount({ M: () => M, statusOf, dayTitle, usual: usualOf, fmt, md, ago, segHtml, barHtml: V.barHtml, grill: (id) => GR[id], rowOf, pageHref, askHref, refreshJira: () => refreshJira(), viewDoc,
|
|
795
798
|
send: (r) => import('./tk-send.js').then((S) => S.openSend({ ws: r.ws || M.board.ws || null, board: r.boardId || M.board.id, initiative: r.id, toast: say })),
|
|
796
799
|
acts: (r, b) => Acts.open.row(r, b), grillOpen: (r, b) => Asks.openGrill(r.id, r.title, (r.track && r.track.label) || 'Triage', false, b), onShow: iniShown, onHide: iniHidden,
|
|
797
800
|
programOf: (r) => programOf(PGS, r.ws || M.board.ws || '', r.id), rename: renameIni, turnProgram });
|
|
@@ -814,6 +817,9 @@ function renameIni(r) { return r && r.id ? initiativeRename({ pmPost, ws: r.ws |
|
|
|
814
817
|
say('Renamed', async () => { const u = await o.undo(); if (!u.ok) { say(u.error); return; } renamedOn([r.id], u.title); VW.retitle(BI.vidOf(r), u.title); load(); });
|
|
815
818
|
} }) : null; }
|
|
816
819
|
setSay(say);
|
|
820
|
+
PO.mount({ programs: () => PGS, stateOf: (p) => progState(p), say,
|
|
821
|
+
saved: (p) => { const i = PGS.findIndex((x) => x.id === p.id); if (i >= 0) PGS[i] = { ...PGS[i], ...p }; if (M) drawInit(); },
|
|
822
|
+
openIni: (id, from) => { const r = (M.rows || []).find((x) => x.id === id && x.track); if (r) openIni(r, from); } });
|
|
817
823
|
PP.mount({ M: () => M, programs: () => PGS, openIni: (id, from) => openIni((M.rows || []).find((x) => x.id === id && x.track), from), close: closePanel, reload: loadPrograms, say }); // the program panel (PgProgram)
|
|
818
824
|
setTab('ini');
|
|
819
825
|
load();
|
|
@@ -6,8 +6,9 @@
|
|
|
6
6
|
* lifecycle steps with Deliver and Evaluate as milestones (◆), the previous step, the current one and the one it reaches next, what
|
|
7
7
|
* finishes the current step (done, you, agent, Jira, a person), the payoff line ("Then: ..."), the time in the stage, and one CTA.
|
|
8
8
|
*
|
|
9
|
-
* THE RULE (as lib/initiative-premium.js): every item comes from a field of a record.
|
|
10
|
-
*
|
|
9
|
+
* THE RULE (as lib/initiative-premium.js): every item comes from a field of a record. On Product feature the workflow engine's checks give
|
|
10
|
+
* the done and waiting items; on another workflow (D99) the current stage's To finish list and its output give them (scripts/workflows.js
|
|
11
|
+
* STAGE.finish, STAGE.output), and the engine's lane checks never show; the board's Jira tickets give the build item ("N of M tickets Done in Jira"); the engineers build in Jira, so the card
|
|
11
12
|
* never names a PMOS builder agent, a pull request or CI as the build story. A time in the stage shows only when a record holds one;
|
|
12
13
|
* otherwise the line gives the planned finish, or says the time is not recorded. */
|
|
13
14
|
|
|
@@ -36,6 +37,9 @@ const PAYOFF = {
|
|
|
36
37
|
evaluate: 'You decide to keep it, iterate on it or stop it.',
|
|
37
38
|
};
|
|
38
39
|
const YOU_STEPS = /^(contract|review|accept|commit|signoff|sign-off)$/;
|
|
40
|
+
// a failed review: the engine reports a FAIL verdict as a pending review whose evidence names it (scripts/workflow-state.js R3), or blocks on it
|
|
41
|
+
const failedReview = (c) => c.k === 'review' && c.state !== 'done' && c.state !== 'na' && (c.state === 'blocked' || /\bFAIL/i.test(c.owed || ''));
|
|
42
|
+
const isFailedReview = (m) => (m.checks || []).some(failedReview);
|
|
39
43
|
const STEP_SAY = { spec: 'PRD and rubric written', contract: 'Your go on the done criteria', review: 'The Review Gate failed: weigh its findings', accept: 'Your sign-off', route: 'Lane chosen', commit: 'Your Commit' };
|
|
40
44
|
const CTA_SAY = { contract: 'Review the done criteria', review: 'Open the findings', accept: 'Give your sign-off', spec: 'Ask about the PRD', commit: 'Review the Commit' };
|
|
41
45
|
const esc = (s) => String(s == null ? '' : s).replace(/[&<>"]/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"' }[c]));
|
|
@@ -65,13 +69,26 @@ export function headModel(M, now = Date.now()) {
|
|
|
65
69
|
const key = own ? (m.wfStage && m.wfStage.key) || null : stageKey(head.stage || acts.stage), at = key ? LIST.findIndex((s) => s.key === key) : -1;
|
|
66
70
|
const cur = at >= 0 ? LIST[at] : null, next = at >= 0 ? LIST[at + 1] || null : null, prev = at > 0 ? LIST[at - 1] : null;
|
|
67
71
|
const items = [];
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
if (own) {
|
|
73
|
+
// another workflow (D99): what finishes its current stage is that stage's own To finish list and its output, in the PM's words. The
|
|
74
|
+
// workflow engine's lane checks (spec, contract, Review Gate) belong to Product feature and never show here (bug 2026-10-25).
|
|
75
|
+
const st = (m.wfStages || []).find((s) => m.wfStage && s.key === m.wfStage.key) || {};
|
|
76
|
+
for (const f of Array.isArray(st.finish) ? st.finish : []) if (f) items.push({ kind: 'agent', label: cap1(f) });
|
|
77
|
+
const o = st.output || {};
|
|
78
|
+
if (o.name && !items.some((x) => x.label.toLowerCase() === String(o.name).toLowerCase())) items.push({ kind: o.kind === 'signoff' ? 'you' : 'agent', label: o.kind === 'signoff' ? 'Your sign-off: ' + o.name : cap1(o.name) });
|
|
79
|
+
} else {
|
|
80
|
+
// the workflow engine's checks: done and waiting; Build and Quality are the engineers' (Jira below), so they are not listed as PMOS work
|
|
81
|
+
for (const c of m.checks || []) {
|
|
82
|
+
if (c.k === 'build' || c.k === 'quality') continue;
|
|
83
|
+
// the Review Gate is optional (D93): a review nobody ran waits on no one, so it is not a step; only a failed one asks the PM to weigh it
|
|
84
|
+
// (feedback batch 4, item 7: every initiative said "The Review Gate failed" while none had been reviewed)
|
|
85
|
+
if (c.k === 'review' && c.state !== 'done' && !failedReview(c)) continue;
|
|
86
|
+
const say = c.k === 'review' && c.state === 'done' ? 'Reviewed' : STEP_SAY[c.k] || cap1(c.label);
|
|
87
|
+
if (c.state === 'done') items.push({ kind: 'done', label: say });
|
|
88
|
+
else if (failedReview(c)) items.push({ kind: 'you', label: say, note: c.owed || '' });
|
|
89
|
+
else if (c.state === 'blocked') items.push({ kind: 'risk', label: say + ' is blocked', note: c.owed || '' });
|
|
90
|
+
else if (c.state === 'pending' || c.state === 'current') items.push({ kind: YOU_STEPS.test(c.k) ? 'you' : 'agent', label: say, note: c.owed || '' });
|
|
91
|
+
}
|
|
75
92
|
}
|
|
76
93
|
// the build story is Jira's: the board's tickets for this initiative
|
|
77
94
|
const jira = ((m.tasks && m.tasks.rows) || []).filter((t) => /^Jira/.test(t.src || ''));
|
|
@@ -81,8 +98,8 @@ export function headModel(M, now = Date.now()) {
|
|
|
81
98
|
}
|
|
82
99
|
// the waiting record says who; a step that waits on the PM and is not in the list yet is added
|
|
83
100
|
const youWait = ov.who === 'Waits on you';
|
|
84
|
-
const step = String(ov.h || '').replace(/^Next: /, '');
|
|
85
|
-
if (youWait && step && !items.some((x) => x.kind === 'you')) items.push({ kind: 'you', label: STEP_SAY[step] || cap1(step) });
|
|
101
|
+
const step = own ? '' : String(ov.h || '').replace(/^Next: /, ''); // the engine's next step is Product feature's
|
|
102
|
+
if (!own && youWait && step && (step !== 'review' || isFailedReview(m)) && !items.some((x) => x.kind === 'you')) items.push({ kind: 'you', label: STEP_SAY[step] || cap1(step) });
|
|
86
103
|
const done = items.filter((x) => x.kind === 'done'), rest = items.filter((x) => x.kind !== 'done');
|
|
87
104
|
const life = acts.life || null;
|
|
88
105
|
const turn = rest.some((x) => x.kind === 'you') ? 'you' : life === 'hold' || life === 'cancelled' || rest.some((x) => x.kind === 'risk') ? 'stalled'
|
|
@@ -94,7 +111,8 @@ export function headModel(M, now = Date.now()) {
|
|
|
94
111
|
const end = dayOf(m.end || head.end || (m.dock && m.dock.end));
|
|
95
112
|
const finish = (head.meta || []).find((x) => /^planned finish /.test(x));
|
|
96
113
|
if (since && cur) {
|
|
97
|
-
|
|
114
|
+
// whole days, midnight to midnight: from noon on, now − since rounded up a day (stage-card D3 read 10 of ~7 on day 9)
|
|
115
|
+
const n = Math.max(0, Math.round((new Date(new Date(now).getFullYear(), new Date(now).getMonth(), new Date(now).getDate()) - since) / 864e5));
|
|
98
116
|
time = 'In ' + cur.label + ' for ' + plural(n, 'day', 'days') + (usual != null ? ' · usually ' + usual : ''); over = usual != null && n > usual;
|
|
99
117
|
clock = { n, usual, over }; // stage card D: "4 of ~6 days", amber when over; only from a record that holds the day it entered
|
|
100
118
|
} else if (finish && cur) {
|
|
@@ -102,7 +120,8 @@ export function headModel(M, now = Date.now()) {
|
|
|
102
120
|
} else if (cur) time = 'In ' + cur.label + ' · time in this stage is not recorded';
|
|
103
121
|
// one CTA: your step when it waits on you, else a question for the read-only agent
|
|
104
122
|
const cta = turn === 'you' ? (CTA_SAY[step] || ('Open ' + (step || 'the next step'))) : turn === 'stalled' ? 'Ask what is stuck' : turn === 'jira' ? 'Ask about the tickets' : 'Ask what is next';
|
|
105
|
-
const ask = turn === 'you' ? '
|
|
123
|
+
const ask = turn === 'you' && isFailedReview(m) ? 'The Review Gate failed for this initiative. Read its latest verdict and findings in planning/runs/evals.jsonl, list each failing dimension with the evidence, and say what would fix it. Change nothing.'
|
|
124
|
+
: turn === 'you' ? 'What do I need to do for the ' + (step || 'next') + ' step of this initiative? Read the evidence in this repository, say what you could not find, and change nothing.'
|
|
106
125
|
: turn === 'stalled' ? 'What is stuck in this initiative, and what would move it? Read this repository, say what you could not find, and change nothing.'
|
|
107
126
|
: turn === 'jira' ? 'Where do this initiative\'s Jira tickets stand, from the last Jira read? Name the assignee of each where the read holds one, and change nothing.'
|
|
108
127
|
: 'What happens next in this initiative, and who does it? Read this repository and change nothing.';
|
|
@@ -88,6 +88,7 @@ export function vwReopen() { if (!czLast) return false; czVw(czLast); return tru
|
|
|
88
88
|
function czVw(it) {
|
|
89
89
|
let el = null; czLast = it;
|
|
90
90
|
czOpen({ id: 'vw:' + it.id, kind: it.kind || it.title || 'Item', title: it.name || it.title || 'Item', icon: CZ_ICON[it.icon] || 'doc', url: it.url || '', rename: it.rename || null,
|
|
91
|
+
check: it.check || null, onPress: it.onPress, more: it.more, // a task's check box and its ⋯ (canvas XetX1Rest)
|
|
91
92
|
render: (body) => {
|
|
92
93
|
el = document.createElement('div'); el.className = 'obody vw'; el.dataset.vw = it.id; el.setAttribute('role', 'region'); body.append(el);
|
|
93
94
|
if (it.render) it.render(el); else el.innerHTML = it.html || '';
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
* or a task tab, so a node test loads it with import(). Every line is a field of that model; a part the model does not hold is left out,
|
|
4
4
|
* and an answer that is still reading or failed is said as such. Every value is escaped here. */
|
|
5
5
|
|
|
6
|
+
import { cardHtml, taskOf } from './task-card.js';
|
|
7
|
+
|
|
6
8
|
export const esc = (s) => String(s == null ? '' : s).replace(/[&<>"]/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"' }[c]));
|
|
7
9
|
const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
8
10
|
export const when = (iso) => { const m = /^(\d{4})-(\d{2})-(\d{2})/.exec(String(iso || '')); return m ? +m[3] + ' ' + MON[+m[2] - 1] : ''; };
|
|
@@ -45,14 +47,18 @@ export function iniHtml(m, pageHref) {
|
|
|
45
47
|
return `<article class="paper doc vwi">${top}${kv(facts)}${sec('Next', next)}${sec('Watch', watch.length ? `<ul class="vwi-w">${watch.map((w) => `<li>${esc(w)}</li>`).join('')}</ul>` : '')}${sec('Checks', checks)}${sec('Tasks', tasks)}${sec('Links', linkHtml)}${miss}<p class="vwi-foot"><a class="vwi-go" href="${esc(pageHref)}">Open the initiative page</a></p></article>`;
|
|
46
48
|
}
|
|
47
49
|
|
|
48
|
-
/** The task tab. A task
|
|
49
|
-
|
|
50
|
+
/** The task tab. A PMOS task or a Jira ticket is the one task editor (task-card.js; canvas XetX1Rest, XetX1Jira): this is its first drawing,
|
|
51
|
+
* and premium-vw-item.js mounts the same card to edit it. A PRD requirement is read from the PRD and has nothing to edit. A task the model
|
|
52
|
+
* no longer holds says so. o: { groups, inis, owners, now } for the card's pickers. */
|
|
53
|
+
export function taskHtml(m, key, o = {}) {
|
|
50
54
|
const t = findTask(m, key);
|
|
51
55
|
if (!t) return `<article class="paper doc vwi"><p class="vwi-wait" role="status">This task is no longer on ${esc(m.title)}. It may have moved to another initiative or been removed.</p>${iniLink(m)}</article>`;
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
return `<article class="paper doc vwi
|
|
56
|
+
if (t.src === 'PRD requirement') {
|
|
57
|
+
const note = 'Read from the initiative’s PRD' + (m.tasks && m.tasks.basis && m.tasks.basis.source ? ' (' + m.tasks.basis.source + ')' : '') + '. The repository records no result for one requirement.';
|
|
58
|
+
return `<article class="paper doc vwi"><div class="vwi-head"><b>${esc(t.title)}</b></div><p class="vwi-p">${esc(note)}</p>${iniLink(m)}</article>`;
|
|
59
|
+
}
|
|
60
|
+
return `<article class="paper doc vwi vwi-tk">${cardHtml(cardTask(m, t), o)}</article>`;
|
|
57
61
|
}
|
|
62
|
+
/** A task row of the model as the card's task (task-card.js taskOf). */
|
|
63
|
+
export const cardTask = (m, row, group = '') => taskOf(row, { ini: m.id, iniTitle: m.title, group, board: m.board && m.board.id });
|
|
58
64
|
const iniLink = (m) => `<section class="vwi-s"><p class="label">Initiative</p><ul class="vwi-l"><li><button type="button" class="vwi-r" data-vwini="${esc(m.id)}"><span class="vwi-t"><b>${esc(m.title)}</b><small>${esc([m.head && m.head.statusLabel, m.lane, m.board && m.board.name].filter(Boolean).join(' · '))}</small></span></button></li></ul></section>`;
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
/* pm/premium-vw-item.js — an initiative or one of its tasks as a tab of the premium dialog's viewer (initiative premium-viewer, S7; PRD R9).
|
|
2
2
|
* openWorkItem({ kind: 'initiative', id, ws?, board? }) the record, the next step, the checks, the tasks and the links
|
|
3
|
-
* openWorkItem({ kind: 'task', ini, key, ws?, board? }) one task (key 'task:<uid>' or 'req:<id>')
|
|
3
|
+
* openWorkItem({ kind: 'task', ini, key, ws?, board? }) one task (key 'task:<uid>' or 'req:<id>'), edited in place with the one
|
|
4
|
+
* task editor (task-card.js; third feedback batch item 7), or a PRD
|
|
5
|
+
* requirement read from the PRD
|
|
4
6
|
* Both read GET /api/initiative-premium, the route the initiative page reads; the HTML comes from premium-vw-item-model.js. The route answers
|
|
5
7
|
* 'reading' while the board derives, and the tab asks again. Inside a tab a task opens its own tab and the initiative link opens the initiative's. */
|
|
6
8
|
import { vwOpen, vwStyle } from './premium-viewer.js';
|
|
7
|
-
import { esc, iniId, taskId, stateOf, readingHtml, errorHtml, iniHtml, taskHtml, findTask } from './premium-vw-item-model.js';
|
|
9
|
+
import { esc, iniId, taskId, stateOf, readingHtml, errorHtml, iniHtml, taskHtml, findTask, cardTask } from './premium-vw-item-model.js';
|
|
10
|
+
import { mountCard, boardSaver, checkOf, cardStyle, toastUndo } from './task-card.js';
|
|
11
|
+
import { pmPost } from './http.js';
|
|
12
|
+
import { setCheck } from './cozy-viewer.js';
|
|
8
13
|
|
|
9
14
|
const TRIES = 20, WAIT = 1500, KEEP = 30000;
|
|
10
15
|
const cache = new Map(); // query → { at, p }: two tabs of one initiative read once
|
|
@@ -34,24 +39,32 @@ export function openWorkItem(o) {
|
|
|
34
39
|
vwStyle('item');
|
|
35
40
|
const ctx = { id: o.kind === 'task' ? o.ini : o.id, ws: o.ws || '', board: o.board || '' };
|
|
36
41
|
if (!ctx.id) return null;
|
|
37
|
-
const isTask = o.kind === 'task';
|
|
42
|
+
const isTask = o.kind === 'task', editable = isTask && /^task:/.test(o.key || '');
|
|
43
|
+
if (editable) cardStyle();
|
|
44
|
+
const vid = isTask ? taskId(ctx.id, o.key) : iniId(ctx.id);
|
|
45
|
+
let card = null, cardT = null;
|
|
38
46
|
return vwOpen({
|
|
39
|
-
id:
|
|
47
|
+
id: vid,
|
|
40
48
|
title: o.title || (isTask ? 'Task' : 'Initiative'),
|
|
41
49
|
icon: isTask ? 'tk' : 'list',
|
|
42
50
|
rename: o.rename || null, // the Viewer's rename option, from the page that knows how to write it (rename-press.js)
|
|
51
|
+
check: editable ? { state: 'todo', label: 'Mark done' } : null, // the quick Done (canvas XetX1Rest); it follows the task once read
|
|
52
|
+
onPress: (act) => { if (act === 'check' && card && cardT && !cardT.jira) card.setStatus(cardT.status === 'Done' ? 'To do' : 'Done'); },
|
|
43
53
|
render(el) {
|
|
44
54
|
el.innerHTML = readingHtml(isTask ? 'the task' : 'the initiative');
|
|
45
55
|
read(ctx).then((s) => {
|
|
46
56
|
if (!el.isConnected) return;
|
|
47
57
|
if (s.state === 'reading') { el.innerHTML = readingHtml(isTask ? 'the task' : 'the initiative'); return; }
|
|
48
58
|
if (s.state === 'error') { el.innerHTML = errorHtml(isTask ? 'The task' : 'The initiative', s.error); return; }
|
|
49
|
-
el.innerHTML = isTask ? taskHtml(s.model, o.key) : iniHtml(s.model, pageHref(ctx));
|
|
50
59
|
el._vwi = s.model;
|
|
60
|
+
const row = isTask ? findTask(s.model, o.key) : null;
|
|
61
|
+
if (editable && row) { mountTask(el, s.model, row); return; }
|
|
62
|
+
el.innerHTML = isTask ? taskHtml(s.model, o.key) : iniHtml(s.model, pageHref(ctx));
|
|
51
63
|
});
|
|
52
64
|
},
|
|
53
65
|
wire(el) {
|
|
54
66
|
el.onclick = (e) => { // delegated on the tab's own pane
|
|
67
|
+
if (card) return; // the task editor wires its own presses
|
|
55
68
|
const m = el._vwi; if (!m) return;
|
|
56
69
|
const t = e.target.closest('[data-vwtask]');
|
|
57
70
|
if (t) { const row = findTask(m, t.dataset.vwtask); openWorkItem({ kind: 'task', ini: ctx.id, key: t.dataset.vwtask, title: row ? row.title : '', ws: ctx.ws, board: ctx.board }); return; }
|
|
@@ -59,6 +72,37 @@ export function openWorkItem(o) {
|
|
|
59
72
|
};
|
|
60
73
|
},
|
|
61
74
|
});
|
|
75
|
+
/* the one task editor: a PMOS task edits in place; a Jira ticket keeps Jira's fields and takes the PM's notes */
|
|
76
|
+
function mountTask(el, m, row) {
|
|
77
|
+
const ws = ctx.ws || (m.board && m.board.ws) || '', board = ctx.board || (m.board && m.board.id) || '';
|
|
78
|
+
const t = cardT = cardTask(m, row);
|
|
79
|
+
const lists = { inis: null, owners: null, groups: null };
|
|
80
|
+
const host = document.createElement('article'); host.className = 'paper doc vwi vwi-tk'; el.innerHTML = ''; el.append(host);
|
|
81
|
+
const check = () => { try { setCheck('vw:' + vid, checkOf(t)); } catch { /* the old dialog has no header check */ } };
|
|
82
|
+
card = mountCard(host, t, {
|
|
83
|
+
save: boardSaver({ ws, board, t, post: (p, b) => pmPost(p, b) }),
|
|
84
|
+
toast: toastUndo,
|
|
85
|
+
changed: () => { cache.clear(); check(); }, // the next read of the initiative sees the change
|
|
86
|
+
openIni: (id) => openWorkItem({ kind: 'initiative', id, title: id === m.id ? m.title : '', ws: ctx.ws, board: ctx.board }),
|
|
87
|
+
openTicket: (x) => import('./premium-vw-jira.js').then((J) => J.openTicket({ ws, board, initiative: x.ini, ref: x.jira.key })).catch(() => toastUndo('The ticket could not open.')),
|
|
88
|
+
iniTitleOf: (id) => ((lists.inis || []).find((x) => x.id === id) || {}).title || id,
|
|
89
|
+
inis: () => lists.inis || [], owners: () => lists.owners || [], groups: () => lists.groups,
|
|
90
|
+
});
|
|
91
|
+
check();
|
|
92
|
+
if (t.jira) return;
|
|
93
|
+
// the pickers' lists: the board's initiatives and owners, the initiative's groups (read once, after the card shows)
|
|
94
|
+
const q = (p) => fetch(p, { credentials: 'same-origin' }).then((r) => r.json()).catch(() => null);
|
|
95
|
+
const wq = ws ? '&ws=' + encodeURIComponent(ws) : '';
|
|
96
|
+
Promise.all([board ? q('/api/boards/items?board=' + encodeURIComponent(board) + wq) : null, q('/api/initiative-layout?initiative=' + encodeURIComponent(t.ini) + wq)]).then(([items, L]) => {
|
|
97
|
+
if (!host.isConnected) return;
|
|
98
|
+
if (items && items.ok) {
|
|
99
|
+
lists.inis = (items.initiatives || []).map((x) => ({ id: x.id, title: x.title }));
|
|
100
|
+
lists.owners = [...new Set((items.items || []).filter((x) => x.src === 'pmos' && x.owner).map((x) => x.owner))];
|
|
101
|
+
}
|
|
102
|
+
if (L && L.ok) { lists.groups = L.names || []; t.group = (L.of || {})[t.key] || ''; }
|
|
103
|
+
card.draw();
|
|
104
|
+
});
|
|
105
|
+
}
|
|
62
106
|
}
|
|
63
107
|
|
|
64
108
|
/** The press a dialog's pane carries to open the initiative's full record as a tab. */
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/* pm/prog-order.css — the order of a program's initiatives (pm/prog-order.js; canvas RoADrag, RoASuggest, RoAApplied, RoAPhone). Loaded once by
|
|
2
|
+
* prog-order.js mount, on the Board and on Home. Token variables only (cozy.css). */
|
|
3
|
+
:root { --po-prog: var(--bd-prog, rgb(91,79,176)); }
|
|
4
|
+
.po-grip { position: absolute; left: 18px; top: 50%; margin-top: -12px; width: 22px; height: 24px; border-radius: 7px; border: 0; padding: 0; display: inline-flex; align-items: center; justify-content: center; color: var(--cz-ink3); background: var(--cz-card); opacity: 0; cursor: grab; z-index: 2; touch-action: none; }
|
|
5
|
+
.po-grip svg { width: 16px; height: 16px; }
|
|
6
|
+
[data-po-id]:hover .po-grip, [data-po-id]:focus-within .po-grip, .po-lift .po-grip { opacity: 1; }
|
|
7
|
+
.po-grip:focus-visible { opacity: 1; outline: 2px solid var(--cz-blue); outline-offset: 1px; }
|
|
8
|
+
.po-lift { position: relative; z-index: 5; background: var(--cz-card); box-shadow: 0 18px 40px -16px rgba(42,46,53,.35), 0 0 0 1px var(--cz-hair); border-radius: 14px; }
|
|
9
|
+
.po-lift .po-grip { background: var(--cz-well); color: var(--cz-ink); cursor: grabbing; }
|
|
10
|
+
body.po-dragging, body.po-dragging * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
|
|
11
|
+
.po-slot { grid-column: 1 / -1; height: 10px; margin: 4px 14px; border-radius: 6px; border: 1.5px dashed var(--cz-blue); background: var(--cz-bluebg); }
|
|
12
|
+
.po-list { display: contents; }
|
|
13
|
+
/* ✦ in the program header */
|
|
14
|
+
.po-sug { position: relative; width: 32px; height: 32px; border-radius: 10px; border: 0; padding: 0; display: inline-flex; align-items: center; justify-content: center; color: var(--po-prog); background: transparent; flex: none; cursor: pointer; }
|
|
15
|
+
.po-sug:hover { background: var(--cz-well); }
|
|
16
|
+
.po-sug:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; }
|
|
17
|
+
.po-sug svg { width: 17px; height: 17px; }
|
|
18
|
+
.po-nd { position: absolute; right: 4px; top: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--cz-blue); box-shadow: 0 0 0 2px var(--cz-card); }
|
|
19
|
+
.po-nd::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit; animation: po-info 6s ease-out infinite; }
|
|
20
|
+
@keyframes po-info { 0% { transform: scale(1); opacity: .25; } 35%, 100% { transform: scale(1.9); opacity: 0; } }
|
|
21
|
+
/* the suggestion */
|
|
22
|
+
.po-pop { position: fixed; z-index: 80; background: var(--cz-card); color: var(--cz-ink); border-radius: 20px; box-shadow: 0 30px 70px -24px rgba(42,46,53,.38), 0 0 0 1px var(--cz-hair); padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 10px; box-sizing: border-box; font-family: var(--cz-sans, inherit); max-height: calc(100vh - 24px); overflow: auto; }
|
|
23
|
+
.po-pop h4 { margin: 0; font-size: 14.5px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
|
|
24
|
+
.po-sp { color: var(--po-prog); display: inline-flex; }
|
|
25
|
+
.po-sp svg { width: 17px; height: 17px; }
|
|
26
|
+
.po-why { font-size: 12.5px; color: var(--cz-ink2); line-height: 1.45; margin: 0; }
|
|
27
|
+
.po-so { display: grid; grid-template-columns: 22px 1fr auto; gap: 2px 10px; align-items: center; padding: 8px 10px; border-radius: 12px; background: var(--cz-well); }
|
|
28
|
+
.po-so .n { font-size: 12px; font-weight: 800; color: var(--cz-ink3); text-align: center; }
|
|
29
|
+
.po-so b { font-size: 13px; font-weight: 800; min-width: 0; }
|
|
30
|
+
.po-so .dt { font-size: 12px; color: var(--cz-ink3); font-weight: 600; white-space: nowrap; }
|
|
31
|
+
.po-so .r { grid-column: 2 / -1; font-size: 11.5px; color: var(--cz-ink3); line-height: 1.35; }
|
|
32
|
+
.po-so.mv .n { color: var(--cz-blueink); }
|
|
33
|
+
.po-so.mv b::after { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--cz-blue); margin-left: 6px; vertical-align: 2px; }
|
|
34
|
+
.po-so.nod { background: transparent; border: 1.5px dashed var(--cz-hair); }
|
|
35
|
+
.po-adb { width: 26px; height: 26px; border-radius: 8px; border: 0; padding: 0; display: inline-flex; align-items: center; justify-content: center; color: var(--cz-blueink); background: var(--cz-bluebg); cursor: pointer; }
|
|
36
|
+
.po-adb svg { width: 15px; height: 15px; }
|
|
37
|
+
.po-acts { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
|
|
38
|
+
.po-ib { width: 36px; height: 36px; border-radius: 999px; border: 0; padding: 0; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--cz-ink2); background: var(--cz-well); }
|
|
39
|
+
.po-ib svg { width: 17px; height: 17px; }
|
|
40
|
+
.po-ib.ok { background: var(--cz-ink); color: var(--cz-card); }
|
|
41
|
+
.po-ib:focus-visible, .po-adb:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; }
|
|
42
|
+
/* Home: the grip sits on the row's mark */
|
|
43
|
+
.hv-card .po-grip { left: 4px; }
|
|
44
|
+
/* a phone: no grip; hold the row, then drag (RoAPhone) */
|
|
45
|
+
@media (hover: none) { .po-grip { display: none; } .po-lift .po-grip { display: inline-flex; left: auto; right: 8px; opacity: 1; } }
|
|
46
|
+
body.cz-home .hv-r.po-lift { background: var(--cz-card); box-shadow: 0 18px 40px -14px rgba(42,46,53,.38), 0 0 0 1px var(--cz-hair); z-index: 5; }
|
|
47
|
+
@media (prefers-reduced-motion: reduce) { .po-nd::after { animation: none; } }
|