create-pmos 0.413.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 +13 -13
- 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 +12 -1
- package/payload/state/discoveries.md +1 -1
- package/workspace/briefing-premium-board-test.js +45 -9
- package/workspace/briefing-premium-test.js +3 -2
- package/workspace/changelog.json +12 -0
- package/workspace/guide/programs.md +13 -0
- package/workspace/guide/workflows.md +7 -0
- package/workspace/home-other-product-test.js +18 -0
- package/workspace/lib/board-premium.js +1 -0
- package/workspace/lib/headless.js +10 -1
- package/workspace/lib/initiative-chat.js +2 -1
- package/workspace/lib/milestone-review.js +120 -0
- package/workspace/lib/milestone-suggest.js +176 -0
- package/workspace/lib/pmos-verbs.js +6 -0
- package/workspace/lib/program-cli.js +56 -0
- package/workspace/lib/programs.js +4 -1
- package/workspace/lib/routes-boards.js +4 -2
- package/workspace/lib/routes-programs.js +73 -7
- package/workspace/lib/task-cli.js +120 -0
- 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 +3 -1
- 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/cozy-home.css +5 -0
- package/workspace/public/pm/cozy-panel.css +2 -0
- package/workspace/public/pm/cozy-viewer.js +2 -0
- package/workspace/public/pm/cozy-xv.css +51 -16
- package/workspace/public/pm/cozy-xv.js +6 -5
- package/workspace/public/pm/home-app.js +13 -11
- package/workspace/public/pm/home-ask.js +9 -3
- package/workspace/public/pm/home-chat.js +10 -1
- package/workspace/public/pm/home-list.js +12 -7
- package/workspace/public/pm/home-today.js +5 -8
- 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 +1 -1
- package/workspace/public/pm/premium-initiative-head.js +13 -4
- package/workspace/public/pm/program-charter.js +47 -7
- package/workspace/public/pm/program-model.js +4 -1
- 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/test-lists/bd-ini-panel.json +5 -0
- package/workspace/test-lists/milestone-suggest.json +6 -0
|
@@ -3,12 +3,14 @@
|
|
|
3
3
|
* views open the same item now. The shell floats at 560 px over the page's right edge, with its grip, and does not push the page.
|
|
4
4
|
*
|
|
5
5
|
* mount(o) once, from premium-board.js. o: { M() the model, statusOf(r), fmt(iso), md(date), ago(iso), segHtml(r), barHtml(o),
|
|
6
|
-
* grill(id) the open first questions, dayTitle(track) the current step's tooltip, rowOf(key), pageHref(r), askHref(r, q), refreshJira(), send(r) the Send to Jira sheet, acts(r, btn) the row
|
|
6
|
+
* grill(id) the open first questions, dayTitle(track) the current step's tooltip, usual(track) the usual days in it, rowOf(key), pageHref(r), askHref(r, q), refreshJira(), send(r) the Send to Jira sheet, acts(r, btn) the row
|
|
7
7
|
* actions popover, grillOpen(r, btn), onShow(key, from) / onHide() so the page marks the row the item came from,
|
|
8
8
|
* programOf(r) the program it is in or null, turnProgram(r) "Turn into a program" (POST /api/programs/turn) }
|
|
9
|
-
* openIni(r, from) the initiative: the shell's header (icon, the title once, Discuss in chat, ⋯, open
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* openIni(r, from) the initiative (XipB, feedback batch 4 item 1): the shell's header (icon, the title once, Discuss in chat, ⋯, open
|
|
10
|
+
* wide, close); the summary card: the status, ONE sentence that says why (whyOf), where the progress number comes from,
|
|
11
|
+
* the owner and the workflow; the stage card: the current stage of the initiative's OWN workflow, its ladder, the
|
|
12
|
+
* tickets or exit steps, the next stage; the Plan card: one drawn line (planModel), every date with its year when it is
|
|
13
|
+
* not this year; then the folding rows: drafted tickets, Jira against the PRD, linked
|
|
12
14
|
* openTicket(r, k) the ticket as a drill-in: ← goes back to the initiative; the summary says what blocks it and what that delays
|
|
13
15
|
* refresh() draws the shown item again after a new read, in place · close() · shown() → the key of the initiative shown, or null
|
|
14
16
|
*
|
|
@@ -18,6 +20,10 @@
|
|
|
18
20
|
import * as VW from './cozy-viewer.js';
|
|
19
21
|
import { esc } from './premium-shell.js';
|
|
20
22
|
import { lr, stageBar, chips, copyText } from './cozy-xv.js';
|
|
23
|
+
import { stepsHtml, stepTail, nodeHtml } from './cozy-steps.js';
|
|
24
|
+
import { wfIcon } from './wf-model.js';
|
|
25
|
+
import { editHref } from './bd-wf.js';
|
|
26
|
+
import { ladderOf, whyOf as whyOfSteps, planModel } from './bd-ini-model.js';
|
|
21
27
|
|
|
22
28
|
let O = null;
|
|
23
29
|
let cur = null; // { key, tk } the initiative shown, and its ticket while the drill-in is shown
|
|
@@ -28,51 +34,109 @@ const tkState = (k) => (k.blocked ? 'Blocked' + (k.reason ? ' by ' + k.reason.re
|
|
|
28
34
|
const isJiraStep = (t) => (t.key === 'build' || t.key === 'deliver') && (t.tickets || []).length > 0;
|
|
29
35
|
const jiraAt = () => { const J = (O.M() && O.M().jira) || {}; return J.readAt ? 'Jira · ' + O.ago(J.readAt) : ''; };
|
|
30
36
|
|
|
31
|
-
/* ── the initiative (XvABoard) ── */
|
|
32
|
-
/** The
|
|
37
|
+
/* ── the initiative (XvABoard, read as XipB: the why first, the stage card, the plan line) ── */
|
|
38
|
+
/** The model's own day (lib/board-premium.js today), so "N days ago" counts as the row's "N days over" does; the clock when it is absent. */
|
|
39
|
+
const nowOf = () => { const m = /^(\d{4})-(\d{2})-(\d{2})/.exec(String((O.M() && O.M().today) || '')); return m ? new Date(+m[1], +m[2] - 1, +m[3], 12).getTime() : Date.now(); };
|
|
40
|
+
/** Where the progress number comes from, said once: Jira's reading when the tickets count it, else the percent typed into the record. */
|
|
41
|
+
function progSource(r) {
|
|
42
|
+
const t = r.track || {};
|
|
43
|
+
if (isJiraStep(t)) return jiraAt();
|
|
44
|
+
return r.progress != null && Number.isFinite(Number(r.progress)) ? Math.round(Number(r.progress)) + '% done · typed in by hand' : '';
|
|
45
|
+
}
|
|
46
|
+
/** The meta line: the owner's avatar and name, then the workflow's icon and name (each fact has one place on the panel). */
|
|
47
|
+
function whoHtml(r) {
|
|
48
|
+
const L = ladderOf(r, (O.M() && O.M().steps) || []), wf = L.wf;
|
|
49
|
+
const av = r.owner ? `<span class="xv-av" aria-hidden="true">${esc(String(r.owner).charAt(0).toUpperCase())}</span>${esc(r.owner)}` : 'No owner';
|
|
50
|
+
return `<p class="czs-meta xv-who">${av}<span aria-hidden="true">·</span>${wfIcon(wf, 16)}${esc(wf.name || 'Product feature')}</p>`;
|
|
51
|
+
}
|
|
52
|
+
/** The summary card: what waits on you leads, with its one primary; otherwise the status and the one sentence that says why. */
|
|
33
53
|
export function iniSummary(r) {
|
|
34
54
|
const t = r.track || {}, s = O.statusOf(r), it = TI(r), g = r.id && O.grill(r.id);
|
|
35
|
-
const
|
|
36
|
-
const meta = [
|
|
37
|
-
const right = isJiraStep(t) ? jiraAt() : '';
|
|
55
|
+
const L = ladderOf(r, (O.M() && O.M().steps) || []);
|
|
56
|
+
const meta = [r.owner || 'No owner', (L.wf && L.wf.name) || 'Product feature'].join(' · '), extra = whoHtml(r), right = progSource(r), why = whyOfSteps(r, (O.M() && O.M().steps) || [], nowOf());
|
|
38
57
|
if (t.you && t.youKind) {
|
|
39
58
|
const prd = t.youKind === 'drift' && it && it.links && it.links.prd;
|
|
40
|
-
return { line: t.you, tone: 'you', text: t.youWhy || '', meta, right, primary: prd ? { label: 'Open the PRD', act: 'doc:' + prd } : t.youKind === 'commit' && r.id ? { label: 'Send to Jira', act: 'commit' } : r.id ? { label: t.you, href: O.pageHref(r) } : null };
|
|
59
|
+
return { line: t.you, tone: 'you', text: t.youWhy || why, meta: '', metaText: meta, extra, right, primary: prd ? { label: 'Open the PRD', act: 'doc:' + prd } : t.youKind === 'commit' && r.id ? { label: 'Send to Jira', act: 'commit' } : r.id ? { label: t.you, href: O.pageHref(r) } : null };
|
|
41
60
|
}
|
|
42
61
|
if (t.you) {
|
|
43
62
|
const rel = r.release ? r.release.name : t.output, open = (t.tickets || []).filter((k) => k.status !== 'Done').length;
|
|
44
|
-
return { line: 'Your sign-off' + (rel ? ' · ' + rel : ''), tone: 'you', meta, right,
|
|
63
|
+
return { line: 'Your sign-off' + (rel ? ' · ' + rel : ''), tone: 'you', meta: '', metaText: meta, extra, right,
|
|
45
64
|
text: open ? open + ' ' + plural(open, 'ticket is', 'tickets are') + ' still open, so the sign-off can wait until they close.' : 'Every release ticket is done. Release notes are not on record in PMOS.',
|
|
46
65
|
primary: r.id ? { label: 'Sign off ' + (rel || 'the release'), href: O.pageHref(r) } : null };
|
|
47
66
|
}
|
|
48
|
-
if (g && g.open) return { line: g.open + ' ' + plural(g.open, 'question', 'questions') + ' before the BRD', tone: 'you', meta, text: (g.later ? 'You chose to answer later. ' : '') + 'PMOS asks what the BRD needs that the Why does not say yet.', primary: { label: 'Answer the questions', act: 'grill' } };
|
|
67
|
+
if (g && g.open) return { line: g.open + ' ' + plural(g.open, 'question', 'questions') + ' before the BRD', tone: 'you', meta: '', metaText: meta, extra, right, text: (g.later ? 'You chose to answer later. ' : '') + 'PMOS asks what the BRD needs that the Why does not say yet.', primary: { label: 'Answer the questions', act: 'grill' } };
|
|
49
68
|
const tone = s.tone === 'late' || s.tone === 'risk' || s.tone === 'red' ? 'warn' : '';
|
|
50
|
-
|
|
69
|
+
// say it once: when the sentence counts the days past the plan, the status line says only Late (the row's "N days over" is the list's)
|
|
70
|
+
return { line: s.tone === 'late' && /^The plan ended /.test(why) ? 'Late' : s.text, tone, meta: '', metaText: meta, extra, right, text: why };
|
|
51
71
|
}
|
|
52
|
-
/** The skipped steps, each with its reason (lib/board-trail.js), under the
|
|
53
|
-
function skipText(
|
|
54
|
-
const
|
|
72
|
+
/** The skipped steps, each with its reason (lib/board-trail.js), under the ladder. */
|
|
73
|
+
function skipText(r, L) {
|
|
74
|
+
const t = r.track || {};
|
|
75
|
+
if (L.own) {
|
|
76
|
+
const sk = L.skipped.map((j) => r.wfStages[j]).filter(Boolean);
|
|
77
|
+
return sk.map((s) => s.name + ' skipped' + (s.skipped && s.skipped.why ? '. ' + s.skipped.why : '.')).join(' ');
|
|
78
|
+
}
|
|
79
|
+
const sk = (t.skipped || []).map((j) => L.steps[j]).filter(Boolean);
|
|
55
80
|
if (!sk.length) return '';
|
|
56
81
|
const why = sk.map((s) => { const w = (t.skipWhy || []).find((x) => x.stage === s.key); return w && w.why ? s.label + ' skipped. ' + w.why : null; });
|
|
57
82
|
if (why.every(Boolean)) return why.join(' ');
|
|
58
83
|
return sk.map((s) => s.label).join(', ') + ' skipped: it was moved past ' + (sk.length === 1 ? 'that step' : 'those steps') + '. No reason is on record.';
|
|
59
84
|
}
|
|
60
|
-
|
|
61
|
-
|
|
85
|
+
const TK_SHOWN = 3;
|
|
86
|
+
const moreOpen = new Set(); // the initiatives whose open tickets are all shown (a press on "N more open")
|
|
87
|
+
/** Build and Deliver: the open tickets, blocked first, three shown, then "N more open" with the done count; Deliver's two parts. */
|
|
88
|
+
function ticketsHtml(r) {
|
|
89
|
+
const t = r.track || {};
|
|
90
|
+
const open = t.tickets.filter((k) => k.status !== 'Done').sort((a, b) => (b.blocked ? 1 : 0) - (a.blocked ? 1 : 0)), done = t.tickets.filter((k) => k.status === 'Done');
|
|
91
|
+
const all = moreOpen.has(r.key), shown = all ? open : open.slice(0, TK_SHOWN), more = open.length - shown.length;
|
|
92
|
+
const doneOf = done.length + ' of ' + t.tickets.length + ' ' + plural(t.tickets.length, 'ticket', 'tickets') + ' done';
|
|
93
|
+
let h = shown.map((k) => lr({ tk: k.key, mk: k.blocked ? 'warn' : '', title: `<em>${esc(k.key)}</em> ${esc(k.title)}`, sub: [tkState(k), k.assignee, k.age != null ? k.age + 'd' : ''].filter(Boolean).join(' · ') })).join('');
|
|
94
|
+
if (more > 0) h += `<button type="button" class="xv-lr go" data-xb="tkmore"><span class="xv-mk" aria-hidden="true"></span><span class="w"><b>${esc(more + ' more open')}</b><span>${esc(doneOf)}</span></span></button>`;
|
|
95
|
+
else if (done.length) h += lr({ mk: 'done', title: esc(doneOf), sub: done.slice(0, 3).map((k) => k.title.toLowerCase()).join(', ') + (done.length > 3 ? ', …' : '') });
|
|
96
|
+
if (t.key === 'deliver') h += lr({ title: 'Release notes', sub: 'not on record' }) + lr({ mk: t.you ? 'you' : '', title: 'Your sign-off', sub: t.you ? 'waiting' : 'after the tickets' });
|
|
97
|
+
return h;
|
|
98
|
+
}
|
|
99
|
+
/** The exit steps of the current stage, as the shared step list (stage card D): the stage's own To finish list and its output on another
|
|
100
|
+
* workflow; on Product feature the parts of the step's output that the records count. */
|
|
101
|
+
function exitSteps(r, L) {
|
|
62
102
|
const t = r.track || {};
|
|
63
|
-
if (
|
|
64
|
-
const
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
103
|
+
if (L.own) {
|
|
104
|
+
const st = L.stage || {}, out = [];
|
|
105
|
+
for (const f of Array.isArray(st.finish) ? st.finish : []) if (f) out.push({ state: 'wait', label: f.charAt(0).toUpperCase() + f.slice(1) });
|
|
106
|
+
const o = st.output || {};
|
|
107
|
+
if (o.name && !out.some((x) => x.label.toLowerCase() === String(o.name).toLowerCase())) out.push(o.kind === 'signoff' ? { state: 'you', label: 'Your sign-off: ' + o.name } : { state: 'wait', label: o.name.charAt(0).toUpperCase() + o.name.slice(1) });
|
|
108
|
+
return out;
|
|
109
|
+
}
|
|
110
|
+
return (t.segs || []).filter((s) => s.name).map((s) => (s.cls === 'dn' ? { state: 'done', label: s.name } : s.cls === 'yo' ? { state: 'you', label: s.name, note: s.st || '' } : { state: 'wait', label: s.name, note: s.st && s.st !== 'to do' ? s.st : '' }));
|
|
111
|
+
}
|
|
112
|
+
const PLUS = '<svg aria-hidden="true" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 5v14M5 12h14"/></svg>';
|
|
113
|
+
/** The stage card (XipB; the Home stage card D look): the current stage of the initiative's own workflow, where it stands ("5 of 7 · day 0
|
|
114
|
+
* of ~14"), its ladder, then what finishes it: the tickets on Build and Deliver, else the exit steps, else "No exit steps on record" with
|
|
115
|
+
* the icon-only add; the last row is the next stage. */
|
|
116
|
+
export function stageCardHtml(r) {
|
|
117
|
+
const t = r.track || {}, L = ladderOf(r, (O.M() && O.M().steps) || []);
|
|
118
|
+
const u = O.usual ? O.usual(t) : null;
|
|
119
|
+
const where = [L.k >= 0 ? (L.k + 1) + ' of ' + L.steps.length : '', t.days != null ? 'day ' + t.days + (u && u.days != null ? ' of ~' + u.days : '') : ''].filter(Boolean).join(' · ');
|
|
120
|
+
const title = L.name || 'Stage not on record';
|
|
121
|
+
const nowTitle = O.dayTitle ? O.dayTitle({ ...t, label: title }) : title;
|
|
122
|
+
const sk = skipText(r, L);
|
|
123
|
+
let body = '';
|
|
124
|
+
const tail = L.next ? stepTail({ name: L.next.label, note: 'Next stage' }) : ''; // its node is the diamond (cozy-xv.css), so the name carries no second ◆
|
|
125
|
+
if (!L.own && isJiraStep(t)) body = ticketsHtml(r);
|
|
126
|
+
else if (!L.own && (t.key === 'build' || t.key === 'deliver')) body = '<p class="xv-q">No Jira ticket has been read for it yet.</p>' + (tail ? stepsHtml([], { cls: 'xv-sl', tail }) : '');
|
|
127
|
+
else {
|
|
128
|
+
const steps = exitSteps(r, L);
|
|
129
|
+
if (steps.length) body = stepsHtml(steps, { cls: 'xv-sl', label: 'To finish ' + title, tail });
|
|
130
|
+
else {
|
|
131
|
+
// nothing finishes this stage on record: say so, and the icon-only add opens the stage in the workflow editor (WfAStage, To finish)
|
|
132
|
+
const add = L.own && L.stage && L.stage.key ? `<a class="xv-add" href="${esc(editHref(L.wf) + '&stage=' + encodeURIComponent(L.stage.key) + (r.ws || (O.M() && O.M().board && O.M().board.ws) ? '&ws=' + encodeURIComponent(r.ws || O.M().board.ws) : ''))}" aria-label="Add an exit step" title="Add an exit step">${PLUS}</a>` : '';
|
|
133
|
+
const none = `<li class="cz-sli${add ? ' has-act' : ''}"><div class="cz-st wt xv-none">${nodeHtml('wait')}<span class="tx"><span class="lb">No exit steps on record</span><small>${esc(L.own ? 'Add the steps that finish ' + title + ', so PMOS can count them.' : 'Nothing is counted toward ' + title + ' yet.')}</small></span></div>${add}</li>`;
|
|
134
|
+
body = stepsHtml([], { cls: 'xv-sl', tail: none + tail });
|
|
135
|
+
}
|
|
72
136
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
137
|
+
const aria = L.k >= 0 ? L.steps.length + ' stages of ' + (L.wf.name || 'Product feature') + '. Stage ' + (L.k + 1) + ', ' + title : 'No stage on record';
|
|
138
|
+
return `<section class="xv-card xv-sc" aria-label="${esc('Stage · ' + title)}"><div class="xv-ch"><b>${esc(title)}</b>${where ? `<span class="r">${esc(where)}</span>` : ''}</div>`
|
|
139
|
+
+ stageBar(L.steps, L.k, L.skipped, nowTitle, aria) + (sk ? `<p class="xv-q xv-skip">${esc(sk)}</p>` : '') + body + '</section>';
|
|
76
140
|
}
|
|
77
141
|
function draftedHtml(d, g) {
|
|
78
142
|
return d.slice(0, 8).map((x) => lr({ mk: x.waiting ? 'you' : '', title: (x.id ? `<em>${esc(x.id)}</em> ` : '') + esc(x.summary || ''), sub: 'not in Jira' })).join('')
|
|
@@ -89,36 +153,39 @@ function linkedChips(r) {
|
|
|
89
153
|
D.map((d) => `<span class="xv-chip" title="${esc((d.title || d.id) + ': ' + DEP_ST(d))}">${esc('Waits on ' + (d.title || d.id))}</span>`),
|
|
90
154
|
epic ? [`<span class="xv-chip">${esc('Epic ' + epic)}</span>`] : []);
|
|
91
155
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
+
|
|
101
|
-
|
|
102
|
-
if (
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
156
|
+
const CAL = '<svg aria-hidden="true" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M5 6h14v14H5zM5 10h14M9 3v4M15 3v4"/></svg>';
|
|
157
|
+
/** The Plan card: one drawn line, its legend naming only what is drawn, then what its dates wait on. */
|
|
158
|
+
function planHtml(r) {
|
|
159
|
+
const m = planModel(r, nowOf()), it = TI(r), D = (it && it.deps) || [];
|
|
160
|
+
if (!m && !D.length) return '';
|
|
161
|
+
const w = (a, b) => Math.max(0.5, b - a);
|
|
162
|
+
const pos = (x) => (x <= 8 ? '0' : x >= 92 ? '-100%' : '-50%');
|
|
163
|
+
const say = m ? [m.marks.find((x) => x.kind === 'start'), m.marks.find((x) => x.kind === 'end')].filter(Boolean).map((x) => (x.kind === 'start' ? 'Plan from ' : 'to ') + x.label).join(' ')
|
|
164
|
+
+ (m.over ? ', ' + m.overBar.days + ' days past the plan' : '') + (m.exp ? '. Jira’s pace ends it ' + m.marks.find((x) => x.kind === 'jira').label : '') + '.' : '';
|
|
165
|
+
let line = '';
|
|
166
|
+
if (m) {
|
|
167
|
+
line = `<div class="xv-pl" role="img" aria-label="${esc(say)}">`
|
|
168
|
+
+ (m.bar ? `<i class="bar" style="left:${m.bar.from}%;width:${w(m.bar.from, m.bar.to)}%"></i>` : '')
|
|
169
|
+
+ (m.overBar ? `<i class="over" style="left:${m.overBar.from}%;width:${w(m.overBar.from, m.overBar.to)}%"></i>` : '')
|
|
170
|
+
+ (m.expBar ? `<i class="exp" style="left:${m.expBar.from}%;width:${w(m.expBar.from, m.expBar.to)}%"></i>` : '')
|
|
171
|
+
+ m.marks.map((x) => `<i class="tk${x.kind === 'today' && x.warn ? ' am' : x.kind === 'jira' ? ' e' : ''}" style="left:${x.at}%"></i>`).join('')
|
|
172
|
+
+ m.marks.filter((x) => !x.hide).map((x) => `<span class="lb${x.kind === 'today' || x.kind === 'jira' ? ' tp' : ''}${x.kind === 'today' && x.warn ? ' w' : ''}${x.kind === 'jira' ? ' e' : ''}" data-pl="${x.kind}" style="left:${x.at}%;transform:translateX(${pos(x.at)})">`
|
|
173
|
+
+ (x.kind === 'start' ? esc(x.label) : `<b>${esc(x.label)}</b>${x.word ? ' ' + esc(x.word) : ''}`) + '</span>').join('')
|
|
174
|
+
+ '</div>'
|
|
175
|
+
+ `<div class="xv-lg" aria-hidden="true">${m.legend.map((x) => `<span><i class="${x.kind}"></i>${esc(x.text)}</span>`).join('')}</div>`;
|
|
106
176
|
}
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
return
|
|
177
|
+
const open = D.filter((d) => d.known && !d.done);
|
|
178
|
+
const deps = D.length ? `<p class="xv-q"><b>Waits on ${esc(D.map((d) => d.title || d.id).join(', '))}.</b> ${esc(D.map((d) => (d.title || d.id) + ': ' + DEP_ST(d)).join(' · '))}.${open.length ? ' Its own dates hold only once ' + (open.length === 1 ? 'that one is' : 'those are') + ' done.' : ''}</p>` : '';
|
|
179
|
+
return `<section class="xv-card xv-plan" aria-label="Plan"><div class="xv-ch">${CAL}<b>Plan</b></div>${line}${deps}</section>`;
|
|
110
180
|
}
|
|
111
181
|
function iniSections(r) {
|
|
112
|
-
const
|
|
113
|
-
S.push({ id: 'out', title: t.output || 'No step on record', count: t.count || '', open: true, render: () => outputHtml(r) });
|
|
182
|
+
const it = TI(r), S = [];
|
|
114
183
|
const d = ((it && it.drafted) || []).filter((x) => !x.key);
|
|
115
184
|
if (d.length) S.push({ id: 'drafted', title: 'Drafted in PMOS', count: d.length, render: () => draftedHtml(d, (it && it.gate) || {}) });
|
|
116
185
|
const dr = (it && it.drift) || [];
|
|
117
186
|
if (dr.length) S.push({ id: 'drift', title: 'Jira differs from the PRD', count: dr.length, render: () => driftHtml(dr) });
|
|
118
187
|
const L = linkedChips(r);
|
|
119
188
|
if (L.length) S.push({ id: 'linked', title: 'Linked', count: L.length, render: () => chips(L) });
|
|
120
|
-
const dates = datesHtml(r);
|
|
121
|
-
if (dates) S.push({ id: 'dates', title: 'Dates and trend', render: () => dates });
|
|
122
189
|
return S;
|
|
123
190
|
}
|
|
124
191
|
/** ⋯ in the shell's order: change it, look back, then link and copy. Archive and cancel stay in the row actions, with their Undo. */
|
|
@@ -136,17 +203,14 @@ function iniMore(r) {
|
|
|
136
203
|
}
|
|
137
204
|
/** The initiative as plain text, for Copy as text: the summary, the output and the open tickets. */
|
|
138
205
|
function iniText(r) {
|
|
139
|
-
const s = iniSummary(r), t = r.track || {};
|
|
140
|
-
const lines = [r.title, [s.line, s.
|
|
206
|
+
const s = iniSummary(r), t = r.track || {}, L = ladderOf(r, (O.M() && O.M().steps) || []);
|
|
207
|
+
const lines = [r.title, [s.line, s.metaText].filter(Boolean).join(' · ')];
|
|
141
208
|
if (s.text) lines.push(s.text);
|
|
142
|
-
if (
|
|
209
|
+
if (L.name) lines.push('', L.name + (L.k >= 0 ? ' · ' + (L.k + 1) + ' of ' + L.steps.length : ''));
|
|
143
210
|
for (const k of (t.tickets || []).filter((x) => x.status !== 'Done')) lines.push('- ' + k.key + ' ' + k.title + ' · ' + tkState(k) + (k.assignee ? ' · ' + k.assignee : ''));
|
|
144
211
|
return lines.join('\n');
|
|
145
212
|
}
|
|
146
|
-
|
|
147
|
-
const t = r.track || {}, sk = skipText(t);
|
|
148
|
-
return VW.czSummary(iniSummary(r)) + stageBar(O.M().steps || [], t.k, t.skipped, O.dayTitle ? O.dayTitle(t) : '') + (sk ? `<p class="xv-q xv-skip">${esc(sk)}</p>` : '') + VW.czSections(iniSections(r), { key: 'board' });
|
|
149
|
-
}
|
|
213
|
+
const iniBody = (r) => VW.czSummary(iniSummary(r)) + stageCardHtml(r) + planHtml(r) + VW.czSections(iniSections(r), { key: 'board' });
|
|
150
214
|
/** Presses inside the shown item: a ticket opens its drill-in; the primary; the PRD-change question. A [data-doc] goes to the page's handler. */
|
|
151
215
|
function wire(body, key) {
|
|
152
216
|
body.onclick = (e) => {
|
|
@@ -154,6 +218,7 @@ function wire(body, key) {
|
|
|
154
218
|
const tk = e.target.closest('[data-tk]'); if (tk) { const k = ((r.track && r.track.tickets) || []).find((x) => x.key === tk.dataset.tk); if (k) openTicket(r, k); return; }
|
|
155
219
|
const a = e.target.closest('[data-czs-act], [data-xb]'); if (!a) return;
|
|
156
220
|
const act = a.dataset.czsAct || a.dataset.xb;
|
|
221
|
+
if (act === 'tkmore') { moreOpen.add(key); body.innerHTML = iniBody(r); return; }
|
|
157
222
|
if (act === 'grill') O.grillOpen(r, a);
|
|
158
223
|
else if (act === 'commit') O.send(r); // the Commit of drafted tickets opens the Send sheet (tk-send.js), the one path to Jira
|
|
159
224
|
else if (act === 'drift') location.assign(O.askHref(r, a.dataset.q || ''));
|
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
* holds, in the shell's order: add an initiative, move one in, copy link, copy as text, and archive (red, last, with a confirmation)
|
|
15
15
|
* · the charter (pm/program-charter.js, canvas MsB*): the one editor of the program's fields and milestones. Ways in: its icon in the
|
|
16
16
|
* header, the pencil on the Milestones row, and "Add the first milestone" where the track would be
|
|
17
|
+
* · Claude's milestone suggestions (pm/ms-suggest.js, canvas XmsgB): with no milestone yet, they take the place of "Add the first milestone";
|
|
18
|
+
* later changes lead Waits on you. ✓ keeps one (the charter is written at once), the pencil opens the charter with it filled in, ✕ drops it
|
|
17
19
|
* · the summary card: the next milestone, else what waits on you; the owner and the span; one primary, "Review the suggested homes", only
|
|
18
20
|
* after Turn into a program while tasks of the initiative it came from have no level yet; Claude sorts them in Home
|
|
19
21
|
* · the goals: the KRs its initiatives anchor to, for one year half with a period picker; the earlier halves fold into one chip
|
|
@@ -25,13 +27,14 @@
|
|
|
25
27
|
* shows) and its PMOS tasks (GET /api/boards/items). A part whose read failed is left out, never guessed. Every fold is kept in this browser. */
|
|
26
28
|
import { pmPost } from './http.js';
|
|
27
29
|
import { esc, store } from './premium-shell.js';
|
|
28
|
-
import { programState, milestoneTrack, milestoneGroups, goalsByPeriod, shortDay } from './program-model.js';
|
|
30
|
+
import { programState, milestoneTrack, milestoneGroups, goalsByPeriod, shortDay, toJira, milestoneStep } from './program-model.js';
|
|
29
31
|
import { STEPS } from './premium-initiative-head.js';
|
|
30
32
|
import * as VW from './cozy-viewer.js';
|
|
31
33
|
import * as Pop from './bd-pop.js';
|
|
32
34
|
import { copyText } from './cozy-xv.js';
|
|
33
35
|
import { programRename } from './rename-press.js';
|
|
34
36
|
import { openCharter as charterForm, renamed as charterRenamed } from './program-charter.js';
|
|
37
|
+
import * as MSG from './ms-suggest.js';
|
|
35
38
|
|
|
36
39
|
const SV = (d, w) => `<svg viewBox="0 0 24 24" width="${w || 18}" height="${w || 18}" aria-hidden="true"><path d="${d}"/></svg>`;
|
|
37
40
|
const I = {
|
|
@@ -163,15 +166,17 @@ function goalsHtml(st) {
|
|
|
163
166
|
/** The readiness dots of a milestone: one per initiative it waits on, filled when that one is past its own ◆ stage (D99). */
|
|
164
167
|
const rdHtml = (m) => (m.n ? `<span class="pp-rd" role="img" aria-label="${m.ready} of ${m.n} ${plural(m.n, 'initiative', 'initiatives')} ready">${Array.from({ length: m.n }, (_, j) => `<i${j < m.ready ? ' class="on"' : ''}></i>`).join('')}</span>` : '');
|
|
165
168
|
const waitsLine = (m) => (m.check ? 'A program check, no initiative to wait on' : 'Waits on ' + m.titles.join(' and '));
|
|
166
|
-
function trackHtml(st) {
|
|
167
|
-
// no milestone yet: one dashed way into the charter, at Milestones (
|
|
169
|
+
function trackHtml(st, p) {
|
|
170
|
+
// no milestone yet: Claude's first suggestions when it has some (canvas XmsgB), else one dashed way into the charter, at Milestones (MsEmpty)
|
|
171
|
+
const S = MSG.openOf(p);
|
|
172
|
+
if (!st.milestones.length && S.length) return `<div class="pp-sec"><p class="lbl">Program milestones</p>${MSG.firstHtml(p, S)}</div>`;
|
|
168
173
|
if (!st.milestones.length) return `<div class="pp-sec"><p class="lbl">Program milestones</p><button type="button" class="pp-first" data-pp="first"><span class="gd" aria-hidden="true"></span>Add the first milestone</button></div>`;
|
|
169
174
|
const T = milestoneTrack(st, 3), n = Math.max(1, T.shown.length);
|
|
170
175
|
const lastDone = T.shown.map((m) => m.done).lastIndexOf(true);
|
|
171
176
|
// the filled line runs to halfway between the last done milestone in view and the next one; with none in view, to the done cluster
|
|
172
177
|
const f = T.shown.length && lastDone === T.shown.length - 1 ? lastDone + 0.5 : lastDone >= 0 ? lastDone + 1 : T.done.length ? 0 : -1;
|
|
173
178
|
const cl = (L, done) => (L.length ? `<button type="button" class="pp-cap${done ? ' dn' : ''}" data-pp="ms" aria-label="${L.length} ${done ? 'earlier ' + plural(L.length, 'milestone', 'milestones') + ', done' : 'later ' + plural(L.length, 'milestone', 'milestones')}. Show all milestones"><span class="st3" aria-hidden="true">${L.slice(0, 3).map(() => '<i></i>').join('')}</span>${L.length} ${done ? 'done' : 'more'}</button>` : '<span></span>');
|
|
174
|
-
const one = (m) => `<div class="pp-m${m.late ? ' late' : ''}" title="${esc(waitsLine(m))}${m.check ? '' : ' reaching ' + (m.reach || 'its ◆ stage')}"><span class="pp-dm${m.done ? ' d' : st.next && m.id === st.next.id ? ' n' : ''}" aria-hidden="true"></span><b>${esc(m.name)}</b><span class="pp-md">${esc(m.day)}${m.done ? '' : rdHtml(m)}</span></div>`;
|
|
179
|
+
const one = (m) => `<div class="pp-m${m.late || m.risk ? ' late' : ''}" title="${esc(waitsLine(m))}${m.check ? '' : ' reaching ' + (m.reach || 'its ◆ stage')}${m.risk ? '. At risk: ' + esc(m.risk) : ''}"><span class="pp-dm${m.done ? ' d' : st.next && m.id === st.next.id ? ' n' : ''}" aria-hidden="true"></span><b>${esc(m.name)}</b><span class="pp-md">${esc(m.day)}${m.done ? '' : rdHtml(m)}</span></div>`;
|
|
175
180
|
return `<div class="pp-sec"><p class="lbl">Program milestones</p><div class="pp-mt" style="--pp-n:${n};--pp-f:${f}"${f < 0 ? ' data-nofill' : ''}>${cl(T.done, true)}${T.shown.map(one).join('')}${cl(T.more, false)}</div></div>`;
|
|
176
181
|
}
|
|
177
182
|
/** What waits on you in the program: your open program tasks, then each initiative's next action that is yours. Each opens in Home. */
|
|
@@ -218,7 +223,7 @@ function iniNode(p, st, i, tasks) {
|
|
|
218
223
|
epics.forEach((e, j) => { kids += `<div class="pp-nd l2" role="treeitem"><span class="k">${esc(e)}</span><span class="x">${j === 0 && epics.length === 1 && tk.length ? esc(tk.length + ' ' + plural(tk.length, 'ticket', 'tickets')) : ''}</span>${j === 0 && epics.length === 1 && tk.length ? `<span class="r">${done} of ${tk.length} done</span>` : ''}</div>`; });
|
|
219
224
|
const drafted = ((r.trail && r.trail.drafted) || []).filter((x) => !x.key).length;
|
|
220
225
|
if (drafted) kids += `<div class="pp-nd l2 q" role="treeitem"><span class="x">${drafted} draft ${plural(drafted, 'ticket', 'tickets')}, not in Jira yet</span></div>`;
|
|
221
|
-
if (!epics.length && !drafted) kids += `<div class="pp-nd l2 q" role="treeitem"><span class="x">${i.at >= 0 && i.at < PLAN ? 'No epics yet · they come from the work breakdown at Plan' : 'No epic in Jira yet'}</span></div>`;
|
|
226
|
+
if (!epics.length && !drafted && toJira(r)) kids += `<div class="pp-nd l2 q" role="treeitem"><span class="x">${i.at >= 0 && i.at < PLAN ? 'No epics yet · they come from the work breakdown at Plan' : 'No epic in Jira yet'}</span></div>`;
|
|
222
227
|
}
|
|
223
228
|
return `<div class="pp-nd ini" role="treeitem" aria-expanded="${!fold.has(k)}">${twHtml(k)}${name}${stg ? `<span class="pp-stg">${esc(stg)}</span>` : ''}</div>${kids}`;
|
|
224
229
|
}
|
|
@@ -254,7 +259,7 @@ function msHtml(st) {
|
|
|
254
259
|
// a program check's diamond is its own mark: a press marks it done or open again (POST /api/programs/check)
|
|
255
260
|
const dm = m.check ? `<button type="button" class="pp-dm${m.done ? ' d' : g.key === 'next' ? ' n' : ''}" data-pp="check" data-ms="${esc(m.id)}" data-done="${m.done ? '0' : '1'}" aria-pressed="${m.done}" aria-label="${m.done ? 'Open again' : 'Mark done'}: ${esc(m.name)}" title="${m.done ? 'Open again' : 'Mark done'}"></button>`
|
|
256
261
|
: `<span class="pp-dm${m.done ? ' d' : g.key === 'next' ? ' n' : ''}" aria-hidden="true"></span>`;
|
|
257
|
-
return `<div class="pp-mr${m.done ? ' done' : ''}${m.late ? ' late' : ''}" role="listitem">${dm}<b>${esc(m.name)}</b><span class="d">${m.done ? '' : rdHtml(m)}${esc(m.day)}${m.late ? ' · late' : ''}</span>${m.done ? '' : `<span class="w">${esc(waitsLine(m))}</span>`}</div>`;
|
|
262
|
+
return `<div class="pp-mr${m.done ? ' done' : ''}${m.late || m.risk ? ' late' : ''}" role="listitem">${dm}<b>${esc(m.name)}</b><span class="d">${m.done ? '' : rdHtml(m)}${esc(m.day)}${m.late ? ' · late' : m.risk ? ' · at risk' : ''}</span>${m.done ? '' : `<span class="w">${esc(m.risk ? 'At risk: ' + m.risk : waitsLine(m))}</span>`}</div>`;
|
|
258
263
|
}).join(''));
|
|
259
264
|
}).join('')}</div>`;
|
|
260
265
|
}
|
|
@@ -281,7 +286,7 @@ function nameOf(id) {
|
|
|
281
286
|
}
|
|
282
287
|
/** The charter (canvas MsBCharter): the one editor of the program's fields and milestones, a drill-in, so ← comes back to the program.
|
|
283
288
|
* at 'milestones': it opens at Milestones (the pencil on the Milestones row, "Add the first milestone", MsB0Entry, MsEmpty). */
|
|
284
|
-
function openCharter(p, at) {
|
|
289
|
+
function openCharter(p, at, suggest) {
|
|
285
290
|
const st = programState(p, rowsOf);
|
|
286
291
|
// the name is the agreed rename press (MsB4Rename): it saves at once, as on the program, and the form keeps the new name
|
|
287
292
|
const rename = programRename({ pmPost, program: p, onSaved: async (o) => {
|
|
@@ -290,21 +295,26 @@ function openCharter(p, at) {
|
|
|
290
295
|
} });
|
|
291
296
|
rename.save = ((save) => async (title, x) => { const r = await save(title, x); if (!r.ok) return r; p.title = r.title; rename.value = r.title; return { ...r, title: titleOf(p) }; })(rename.save);
|
|
292
297
|
rename.value = p.title;
|
|
293
|
-
charterForm({ VW, pmPost, p, st, rename, title: titleOf(p), nameOf, at, reload: () => O.reload(), say: (m) => O.say(m)
|
|
298
|
+
charterForm({ VW, pmPost, p, st, rename, title: titleOf(p), nameOf, at, suggest, reload: () => O.reload(), say: (m) => O.say(m),
|
|
299
|
+
// the charter's Check now (canvas XmsgB): Claude reviews the milestones at the next tick; the line says it is checking until it ends
|
|
300
|
+
checkNow: async () => { const r = await pmPost('/api/programs/review', { program: p.id }).catch(() => null); if (!r || !r.ok) { O.say((r && r.error) || 'Claude could not start the check. The server did not say why.'); return false; } O.reload(); return true; },
|
|
301
|
+
review: () => (progOf(p.id) || p).review || null });
|
|
294
302
|
}
|
|
295
303
|
|
|
296
304
|
/* ── the shell: summary first, then the folding rows ── */
|
|
297
305
|
/** The summary card: the next milestone (else what waits on you); the owner and the span; one primary only when tasks from before Turn into a
|
|
298
306
|
* program (p.from) still have no level. */
|
|
307
|
+
/** Claude's milestone changes that lead Waits on you: every open one once the program has a milestone (before that they sit on the track). */
|
|
308
|
+
const changesOf = (p, st) => (st.milestones.length ? MSG.openOf(p) : []);
|
|
299
309
|
function summaryOf(p, st) {
|
|
300
|
-
const N = needs(p, st), n = unsorted(p, st), nx = st.next;
|
|
310
|
+
const N = needs(p, st).concat(changesOf(p, st)), n = unsorted(p, st), nx = st.next;
|
|
301
311
|
const meta = [p.owner, st.span.label].filter(Boolean).join(' · ');
|
|
302
312
|
const sortText = n ? n + ' ' + plural(n, 'task', 'tasks') + ' from before the split ' + (n === 1 ? 'has' : 'have') + ' no level yet. Claude suggests a home for each: the program, an initiative or an epic.' : '';
|
|
303
313
|
const primary = n ? { label: 'Review the suggested homes', href: homeHref({ ws: p.home, ask: 'program:' + p.id, q: 'Suggest a home for each task of ' + p.title + ' that has no level yet' }) } : null;
|
|
304
314
|
const next = nx ? 'Next: ' + nx.name + (nx.day ? ' · ' + nx.day : '') : '';
|
|
305
315
|
// The Waits on you row already counts what waits on you (say it once), so the line is the next milestone while there is one.
|
|
306
316
|
if (!nx && N.length) return { line: N.length + ' ' + plural(N.length, 'waits', 'wait') + ' on you', tone: 'you', text: sortText, meta, primary };
|
|
307
|
-
if (nx) return { line: next, tone: nx.late ? 'warn' : '', text: sortText || waitsLine(nx) + (nx.check ? '.' : ' reaching ' + (nx.reach || 'its ◆ stage') + '.'), meta, primary };
|
|
317
|
+
if (nx) return { line: next, tone: nx.late || nx.risk ? 'warn' : '', text: sortText || waitsLine(nx) + (nx.check ? '.' : ' reaching ' + (nx.reach || 'its ◆ stage') + '.'), meta, primary };
|
|
308
318
|
return { line: '', text: sortText, meta, primary };
|
|
309
319
|
}
|
|
310
320
|
function needsList(p, st) {
|
|
@@ -312,10 +322,11 @@ function needsList(p, st) {
|
|
|
312
322
|
return L.map((x) => `<a class="pp-nr" href="${esc(x.href)}" aria-label="${x.task ? 'Task' : 'Waits on you'}: ${esc(x.title)}. Opens in Home"><span class="mk2">${x.task ? `<span class="pp-ck${x.late ? ' late' : ''}"></span>` : '<span class="pp-dt"></span>'}</span><span class="t"><b>${esc(x.title)}</b><span>${esc(x.sub)}</span></span><span class="go">${SV(I.out, 14)}</span></a>`).join('');
|
|
313
323
|
}
|
|
314
324
|
function bodyHtml(p) {
|
|
315
|
-
const st = programState(p, rowsOf), N = needs(p, st), D = docsOf(st), T = iniTasks(st);
|
|
325
|
+
const st = programState(p, rowsOf), N = needs(p, st), D = docsOf(st), T = iniTasks(st), C = changesOf(p, st);
|
|
326
|
+
facts(p, st);
|
|
316
327
|
const L = T.filter((t) => t.level === 'initiative'), E = T.filter((t) => t.level === 'epic');
|
|
317
328
|
const rows = [
|
|
318
|
-
N.length ? { id: 'needs', title: 'Waits on you', count: N.length, open: true, render: () => `<div class="pp-needs" role="group" aria-label="Waits on you">${needsList(p, st)}</div>` } : null,
|
|
329
|
+
N.length || C.length ? { id: 'needs', title: 'Waits on you', count: N.length + C.length, open: true, render: () => `<div class="pp-needs" role="group" aria-label="Waits on you">${MSG.rowsHtml(p, C)}${needsList(p, st)}</div>` } : null,
|
|
319
330
|
{ id: 'tasks', title: 'On the program', count: st.openTasks.length, open: adding, render: () => tasksHtml(p, st) },
|
|
320
331
|
// every open task of its initiatives, by level (PgProgram "Tasks"): on the initiative itself, then on their epics
|
|
321
332
|
L.length ? { id: 'itasks', title: 'On its initiatives', count: L.length, render: () => levelHtml(p, L, 'Tasks on its initiatives') } : null,
|
|
@@ -325,7 +336,19 @@ function bodyHtml(p) {
|
|
|
325
336
|
tail: `<button type="button" class="cz-vw-ib" data-pp="edit" aria-label="Edit the milestones in the charter" title="Edit in the charter">${SV(I.pen, 15)}</button>` } : null,
|
|
326
337
|
{ id: 'docs', title: 'Documents', count: D.length + 1, render: () => docsHtml(p, st) },
|
|
327
338
|
];
|
|
328
|
-
|
|
339
|
+
// Home on a phone (O.talk gives a function): the program's own chat is not beside the panel, so the panel ends with the way to it
|
|
340
|
+
const talk = O && O.talk && O.talk() ? `<button type="button" class="hi-talk" data-pp="talk">Message Claude about ${esc(p.title)}</button>` : '';
|
|
341
|
+
return VW.czSummary(summaryOf(p, st)) + goalsHtml(st) + trackHtml(st, p) + VW.czSections(rows, { key: 'program' }) + talk;
|
|
342
|
+
}
|
|
343
|
+
/** The ◆ dates this page reads for the program's initiatives (a Jira slip moves one too). A change from what the server last heard asks Claude
|
|
344
|
+
* to review once (POST /api/programs/facts); each reading is sent once per page load. */
|
|
345
|
+
const FACTS = new Set();
|
|
346
|
+
function facts(p, st) {
|
|
347
|
+
if (st.missing.length) return; // a product's board is still being read: its dates would look moved
|
|
348
|
+
const fp = MSG.factsOf(st, milestoneStep), k = p.id + '|' + fp;
|
|
349
|
+
if (!fp || (p.review && p.review.facts === fp) || FACTS.has(k)) return;
|
|
350
|
+
FACTS.add(k);
|
|
351
|
+
pmPost('/api/programs/facts', { program: p.id, fp }).catch(() => null);
|
|
329
352
|
}
|
|
330
353
|
const shownHere = () => { const c = VW.current && VW.current(); return !!(cur && c && c.id === 'program:' + cur.id); };
|
|
331
354
|
/** Draws the program again in place, keeping the scroll and the focus on the same press. */
|
|
@@ -384,7 +407,7 @@ function openPanel(id, from) {
|
|
|
384
407
|
cur = { id, from: from && !(VW.body() && VW.body().contains(from)) ? from : (cur && cur.id === id && cur.from) || null };
|
|
385
408
|
body.classList.add('pp-vw');
|
|
386
409
|
const q = progOf(id); if (q) { readAway(q); readMore(q); body.innerHTML = bodyHtml(q); }
|
|
387
|
-
body.onclick = (e) => { const b = e.target.closest('[data-pp]'); if (b && body.contains(b)) press(b); };
|
|
410
|
+
body.onclick = (e) => { const m = e.target.closest('[data-ms-act]'); if (m && body.contains(m) && !m.disabled) { suggestPress(m); return; } const b = e.target.closest('[data-pp]'); if (b && body.contains(b)) press(b); };
|
|
388
411
|
body.onsubmit = submit;
|
|
389
412
|
document.querySelectorAll('#ibBody [data-prow]').forEach((x) => x.classList.toggle('sel', x.dataset.prow === id));
|
|
390
413
|
},
|
|
@@ -404,6 +427,7 @@ function showRow(id) {
|
|
|
404
427
|
|
|
405
428
|
async function press(b) {
|
|
406
429
|
const a = b.dataset.pp, p = cur && progOf(cur.id); if (!p) return;
|
|
430
|
+
if (a === 'talk') { const t = O.talk && O.talk(); if (t) t(); return; }
|
|
407
431
|
if (a === 'fold') setFold(b.dataset.fold);
|
|
408
432
|
else if (a === 'ms' || a === 'itasks') showRow(a);
|
|
409
433
|
else if (a === 'period') { O._perOpen = !O._perOpen; draw(true); }
|
|
@@ -422,6 +446,22 @@ async function press(b) {
|
|
|
422
446
|
O.say(b.dataset.done === '1' ? 'Marked done.' : 'Open again.'); O.reload();
|
|
423
447
|
}
|
|
424
448
|
}
|
|
449
|
+
/** A press on one of Claude's suggestions: keep (or keep all), drop (or drop all), or change it in the charter. */
|
|
450
|
+
async function suggestPress(b) {
|
|
451
|
+
const p = cur && progOf(cur.id); if (!p) return;
|
|
452
|
+
const a = b.dataset.msAct, L = MSG.openOf(p), it = L.find((x) => x.key === b.dataset.key);
|
|
453
|
+
if (a === 'edit') { if (it) openCharter(p, 'milestones', it); return; }
|
|
454
|
+
const keys = a === 'keepall' || a === 'dropall' ? L.map((x) => x.key) : it ? [it.key] : [];
|
|
455
|
+
if (!keys.length) return;
|
|
456
|
+
const how = a === 'keep' || a === 'keepall' ? 'keep' : 'decline';
|
|
457
|
+
VW.body().querySelectorAll('[data-ms-act]').forEach((x) => { x.disabled = true; });
|
|
458
|
+
let done = 0, err = '';
|
|
459
|
+
// one at a time: each keep writes the whole charter, so the next one reads the charter the last one wrote
|
|
460
|
+
for (const k of keys) { const r = await MSG.answer(pmPost, progOf(p.id) || p, k, how); if (!r.ok) { err = r.error; break; } done++; if (keys.length > 1) await O.reload(); }
|
|
461
|
+
if (err) O.say(err);
|
|
462
|
+
else O.say(how === 'keep' ? (done === 1 ? 'Kept. The charter has it.' : done + ' kept. The charter has them.') : (done === 1 ? 'Dropped. Claude will not suggest it again from this source.' : done + ' dropped.'));
|
|
463
|
+
await O.reload(); draw();
|
|
464
|
+
}
|
|
425
465
|
async function submit(e) {
|
|
426
466
|
const f = e.target.closest('[data-pp-form="task"]'); if (!f) return;
|
|
427
467
|
e.preventDefault();
|
|
@@ -251,6 +251,11 @@ body.cz-home { min-height: 100vh; overflow: hidden; }
|
|
|
251
251
|
/* every kind of ask, one card (canvas XcbOptions "Every kind of ask", home-ask.js): part of the agent's message, in line with its text, no
|
|
252
252
|
* avatar of its own; the kind's label, what it asks, before → after where the change holds both, then the answers as labeled icons */
|
|
253
253
|
.hm-askw, .hm-askc { padding-left: 38px; }
|
|
254
|
+
/* a tap on the blue progress line brings the card into view and pulses it once (home-chat.js plPress), so the tap is seen even when the card
|
|
255
|
+
* was already on screen */
|
|
256
|
+
.hm-flash .hm-askk, .hm-a.hm-flash .hm-ab { animation: hm-flash .9s ease-out 1; border-radius: 16px; }
|
|
257
|
+
@keyframes hm-flash { 0% { box-shadow: inset 0 0 0 1.5px var(--cz-blue), 0 0 0 0 var(--cz-blue); } 40% { box-shadow: inset 0 0 0 1.5px var(--cz-blue), 0 0 0 5px color-mix(in srgb, var(--cz-blue) 30%, transparent); } 100% { box-shadow: inset 0 0 0 1.5px var(--cz-blue), 0 0 0 0 transparent; } }
|
|
258
|
+
@media (prefers-reduced-motion: reduce) { .hm-flash .hm-askk, .hm-a.hm-flash .hm-ab { animation: none; } }
|
|
254
259
|
.hm-askk { padding: 10px 12px 12px; border-radius: 16px; background: linear-gradient(180deg, var(--cz-bluebg) 0%, var(--cz-card) 70%); box-shadow: inset 0 0 0 1.5px var(--cz-blue); display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
|
|
255
260
|
.hm-askk .k { margin: 0; font-size: 12px; font-weight: 700; color: var(--cz-ink3); }
|
|
256
261
|
.hm-askk .q { font-size: 14px; font-weight: 700; color: var(--cz-ink); overflow-wrap: anywhere; }
|
|
@@ -17,6 +17,8 @@ html[data-theme="dark"] body.bd-page, html[data-theme="dark"] body.cz-home { --p
|
|
|
17
17
|
.pp-sec { display: flex; flex-direction: column; }
|
|
18
18
|
.pp-sec .lbl { font-size: 12px; font-weight: 800; color: var(--cz-ink3); margin: 0 0 6px; }
|
|
19
19
|
.pp-vw .czs-body { padding: 0 6px 8px; }
|
|
20
|
+
/* Home on a phone: the way to the program's own chat ends the panel (.hi-talk is home-ini.css) */
|
|
21
|
+
.pp-vw > .hi-talk { display: block; width: calc(100% - 32px); margin: 12px 16px 24px; }
|
|
20
22
|
.pp-vw .czs-body .pp-tree, .pp-vw .czs-body .pp-ml { border: 0; border-radius: 12px; }
|
|
21
23
|
|
|
22
24
|
/* the period picker */
|
|
@@ -148,6 +148,8 @@ export function czSummary(o = {}) {
|
|
|
148
148
|
const pri = (p && p.label) || also || sec
|
|
149
149
|
? `<div class="czs-acts">${!p || !p.label ? '' : p.href ? `<a class="czs-pri" href="${esc(p.href)}"${p.blank ? ' target="_blank" rel="noopener"' : ''}>${esc(p.label)}</a>` : `<button type="button" class="czs-pri" data-czs-act="${esc(p.act || 'primary')}"${p.disabled ? ' disabled' : ''}>${esc(p.label)}</button>`}${sec}${also}</div>`
|
|
150
150
|
: '';
|
|
151
|
+
// nothing to say draws no card, never an empty pill (zero is silence; feedback batch 4: an empty card over a new program's milestones)
|
|
152
|
+
if (!line && !text && !meta && !o.extra && !pri) return '';
|
|
151
153
|
return `<div class="czs-sum">${line}${text}${meta}${o.extra || ''}${pri}</div>`;
|
|
152
154
|
}
|
|
153
155
|
const foldKey = (key, id) => 'cz-vw-fold:' + kindKey(key) + ':' + String(id);
|
|
@@ -2,13 +2,58 @@
|
|
|
2
2
|
* XvOptAJira, XvAInsight), drawn by pm/cozy-xv.js and the panels that use it. Token vars from cozy.css only; cozy-vw-shell.css draws the
|
|
3
3
|
* header, the summary card and the folding rows. No motion. */
|
|
4
4
|
|
|
5
|
-
/* the stage
|
|
6
|
-
|
|
7
|
-
.xv-stg
|
|
8
|
-
.xv-stg i
|
|
9
|
-
.xv-stg i.
|
|
5
|
+
/* the stage ladder in the stage card (XipB .lad): one bar a stage of the initiative's own workflow; passed grey, the current one blue,
|
|
6
|
+
* a skipped one hatched, a milestone a diamond */
|
|
7
|
+
.xv-stg { display: flex; gap: 3px; align-items: center; flex: none; min-height: 10px; }
|
|
8
|
+
.xv-stg i { flex: 1; height: 6px; border-radius: 3px; background: var(--cz-well2); display: block; }
|
|
9
|
+
.xv-stg i.on { background: color-mix(in srgb, var(--cz-ink3) 55%, var(--cz-card)); }
|
|
10
|
+
.xv-stg i.now { background: var(--cz-blue); height: 8px; }
|
|
10
11
|
.xv-stg i.sk { background: repeating-linear-gradient(135deg, var(--cz-well2) 0 3px, transparent 3px 6px); }
|
|
11
|
-
.xv-
|
|
12
|
+
.xv-stg i.ms { flex: 0 0 9px; height: 9px; border-radius: 2px; transform: rotate(45deg); }
|
|
13
|
+
.xv-skip { margin: 0 !important; }
|
|
14
|
+
|
|
15
|
+
/* the stage card and the Plan card (XipB .card2): a quiet outlined card, its head the name and where it stands */
|
|
16
|
+
.xv-card { border: 1px solid var(--cz-hair); border-radius: 18px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
|
|
17
|
+
.xv-ch { display: flex; align-items: center; gap: 8px; color: var(--cz-ink); }
|
|
18
|
+
.xv-ch b { font-size: 15px; font-weight: 800; }
|
|
19
|
+
.xv-ch .r { margin-left: auto; font-size: 12.5px; color: var(--cz-ink3); font-weight: 700; white-space: nowrap; }
|
|
20
|
+
.xv-sc .xv-lr { padding-left: 0; padding-right: 0; }
|
|
21
|
+
.xv-sl { margin: 0; }
|
|
22
|
+
.xv-sl .cz-nd.tl { width: 14px; height: 14px; margin: 4px; border-radius: 3px; transform: rotate(45deg); border-style: solid; }
|
|
23
|
+
.xv-none .tx small { color: var(--cz-ink3); }
|
|
24
|
+
.xv-none .cz-nd { border-style: dashed; }
|
|
25
|
+
.xv-sl .tail .nm { color: var(--cz-ink3); font-weight: 600; }
|
|
26
|
+
.cz-sli.has-act { display: flex; align-items: flex-start; gap: 8px; }
|
|
27
|
+
.cz-sli.has-act > .xv-none { flex: 1; }
|
|
28
|
+
.xv-add { width: 32px; height: 32px; border-radius: 50%; background: var(--cz-blueink); color: var(--cz-card); display: inline-flex; align-items: center; justify-content: center; flex: none; margin-top: 6px; }
|
|
29
|
+
.xv-add:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; }
|
|
30
|
+
|
|
31
|
+
/* the summary's meta: the owner's avatar and name, the workflow's icon and name */
|
|
32
|
+
.xv-who { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
|
|
33
|
+
.xv-av { width: 22px; height: 22px; border-radius: 50%; background: var(--cz-bluebg); color: var(--cz-blueink); font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex: none; }
|
|
34
|
+
.xv-who .wfi { color: var(--cz-ink3); }
|
|
35
|
+
|
|
36
|
+
/* the plan line (XipB .pl): your plan grey, past the plan amber dashed, Jira's pace blue dashed, a tick for today */
|
|
37
|
+
.xv-pl { position: relative; height: 56px; margin: 2px 4px 0; }
|
|
38
|
+
.xv-pl .bar { position: absolute; top: 18px; height: 10px; border-radius: 5px; background: var(--cz-well2); }
|
|
39
|
+
.xv-pl .over, .xv-pl .exp { position: absolute; top: 21px; height: 4px; border-radius: 2px; }
|
|
40
|
+
.xv-pl .over { background: repeating-linear-gradient(90deg, var(--cz-dot-risk) 0 6px, transparent 6px 10px); }
|
|
41
|
+
.xv-pl .exp { background: repeating-linear-gradient(90deg, var(--cz-blueink) 0 6px, transparent 6px 10px); }
|
|
42
|
+
.xv-pl .tk { position: absolute; top: 12px; width: 2px; height: 22px; margin-left: -1px; border-radius: 1px; background: var(--cz-ink); }
|
|
43
|
+
.xv-pl .tk.am { background: var(--cz-dot-risk); }
|
|
44
|
+
.xv-pl .tk.e { background: var(--cz-blueink); }
|
|
45
|
+
.xv-pl .lb { position: absolute; top: 38px; font-size: 11.5px; font-weight: 700; color: var(--cz-ink3); white-space: nowrap; }
|
|
46
|
+
.xv-pl .lb.tp { top: -2px; }
|
|
47
|
+
.xv-pl .lb b { color: var(--cz-ink); font-weight: 800; }
|
|
48
|
+
.xv-pl .lb.w, .xv-pl .lb.w b { color: var(--cz-risk); }
|
|
49
|
+
.xv-pl .lb.e, .xv-pl .lb.e b { color: var(--cz-blueink); }
|
|
50
|
+
.xv-lg { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--cz-ink3); font-weight: 600; }
|
|
51
|
+
.xv-lg span { display: inline-flex; align-items: center; gap: 5px; }
|
|
52
|
+
.xv-lg i { display: inline-block; width: 14px; height: 4px; border-radius: 2px; background: var(--cz-well2); }
|
|
53
|
+
.xv-lg i.over { background: repeating-linear-gradient(90deg, var(--cz-dot-risk) 0 4px, transparent 4px 6px); }
|
|
54
|
+
.xv-lg i.exp { background: repeating-linear-gradient(90deg, var(--cz-blueink) 0 4px, transparent 4px 6px); }
|
|
55
|
+
.xv-lg i.today { width: 2px; height: 12px; background: var(--cz-ink); }
|
|
56
|
+
.xv-lg i.today.am { background: var(--cz-dot-risk); }
|
|
12
57
|
|
|
13
58
|
/* one row in a section (XvABoard .lr): a mark, a title, one quiet line; a ticket row is a press */
|
|
14
59
|
.xv-lr { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 10px; border-radius: 12px; font: inherit; font-size: 13.5px; color: var(--cz-ink); background: none; border: 0; width: 100%; box-sizing: border-box; text-align: left; }
|
|
@@ -35,17 +80,7 @@ button.xv-chip { cursor: pointer; }
|
|
|
35
80
|
button.xv-chip:focus-visible, .xv-mini:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; }
|
|
36
81
|
.xv-mini { height: 30px; padding: 0 12px; border-radius: 999px; background: var(--cz-bluebg); color: var(--cz-blueink); font: 700 12.5px var(--cz-sans); border: 0; cursor: pointer; }
|
|
37
82
|
|
|
38
|
-
/* dates and trend: three boxes, then the progress bar */
|
|
39
|
-
.xv-dg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
|
|
40
|
-
.xv-box { background: color-mix(in srgb, var(--cz-well) 50%, var(--cz-card)); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
|
|
41
|
-
.xv-box > span { font-size: 12px; color: var(--cz-ink3); }
|
|
42
|
-
.xv-box > b { font-size: 14px; font-weight: 800; }
|
|
43
|
-
.xv-box.late > b { color: var(--cz-risk); }
|
|
44
|
-
.xv-bh { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
|
|
45
|
-
.xv-bh span { color: var(--cz-ink3); }
|
|
46
|
-
.xv-seg { padding: 2px 0 4px; }
|
|
47
83
|
|
|
48
84
|
@media (max-width: 760px) {
|
|
49
|
-
.xv-dg { grid-template-columns: 1fr 1fr; }
|
|
50
85
|
.xv-lr { min-height: 48px; }
|
|
51
86
|
}
|