create-pmos 0.413.0 → 0.415.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 +12 -1
- package/payload/state/discoveries.md +1 -1
- package/workspace/bin/pmos.js +1 -1
- 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/guide/programs.md +13 -0
- package/workspace/guide/workflows.md +10 -0
- package/workspace/home-other-product-test.js +18 -0
- package/workspace/lib/board-premium.js +9 -0
- package/workspace/lib/engine/boards.js +4 -2
- package/workspace/lib/goal-chat.js +46 -15
- package/workspace/lib/headless.js +10 -1
- package/workspace/lib/initiative-chat.js +5 -3
- package/workspace/lib/initiative-premium.js +4 -2
- package/workspace/lib/item-cli.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 +121 -16
- package/workspace/lib/routes-briefing-premium.js +14 -1
- package/workspace/lib/routes-programs.js +73 -7
- package/workspace/lib/task-cli.js +168 -0
- package/workspace/lib/task-items.js +86 -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 +144 -59
- 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-stage-card.js +3 -2
- 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 +11 -2
- package/workspace/public/pm/premium-initiative-head.js +25 -6
- 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
- package/workspace/test-lists/one-task-list.json +5 -0
|
@@ -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
|
}
|
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
*
|
|
6
6
|
* lr({ title, sub, right, mk, tk, attrs }) one row in a section: a mark (mk 'warn' | 'done' | 'you' | 'task' | 'late'), the title (markup),
|
|
7
7
|
* one quiet line, an end value; tk makes it a press that opens that Jira ticket
|
|
8
|
-
* stageBar(steps, k, skipped, nowTitle)
|
|
9
|
-
* nowTitle is the current one's tooltip (its days in the step, and
|
|
8
|
+
* stageBar(steps, k, skipped, nowTitle, aria) one segment per step: the passed ones grey, the current one blue, the skipped ones hatched,
|
|
9
|
+
* a milestone (s.ms) a diamond; nowTitle is the current one's tooltip (its days in the step, and
|
|
10
|
+
* the usual days); every other bar names its stage on hover; aria replaces the default label
|
|
10
11
|
* chips(list) a wrap of quiet chips (markup strings)
|
|
11
12
|
* copyText(text, said) copies the text and says so in the page's toast (setSay) */
|
|
12
13
|
import { esc, toast } from './premium-shell.js';
|
|
@@ -20,10 +21,10 @@ export const lr = (o) => {
|
|
|
20
21
|
return `<${tag} class="xv-lr${o.tk ? ' go' : ''}"${o.tk ? ` data-tk="${esc(o.tk)}"` : ''}${o.attrs || ''}><span class="xv-mk${o.mk ? ' ' + o.mk : ''}" aria-hidden="true"></span>`
|
|
21
22
|
+ `<span class="w"><b>${o.title}</b>${o.sub ? `<span>${esc(o.sub)}</span>` : ''}</span>${o.right ? `<span class="r">${o.right}</span>` : ''}</${end}>`;
|
|
22
23
|
};
|
|
23
|
-
export function stageBar(steps, k, skipped, nowTitle) {
|
|
24
|
+
export function stageBar(steps, k, skipped, nowTitle, aria) {
|
|
24
25
|
const S = steps || [], sk = new Set(skipped || []);
|
|
25
|
-
const label = k >= 0 && S[k] ? 'Stage ' + (k + 1) + ' of ' + S.length + ', ' + S[k].label : 'No stage on record';
|
|
26
|
-
return `<div class="xv-stg" role="img" aria-label="${esc(label)}">${S.map((s, j) => `<i class="${[j < k && !sk.has(j) ? 'on' : '', j === k ? 'now' : '', sk.has(j) ? 'sk' : ''].filter(Boolean).join(' ')}" title="${esc(j === k && nowTitle ? nowTitle : s.label)}"></i>`).join('')}</div>`;
|
|
26
|
+
const label = aria || (k >= 0 && S[k] ? 'Stage ' + (k + 1) + ' of ' + S.length + ', ' + S[k].label : 'No stage on record');
|
|
27
|
+
return `<div class="xv-stg" role="img" aria-label="${esc(label)}">${S.map((s, j) => `<i class="${[j < k && !sk.has(j) ? 'on' : '', j === k ? 'now' : '', sk.has(j) ? 'sk' : '', s.ms ? 'ms' : ''].filter(Boolean).join(' ')}" title="${esc(j === k && nowTitle ? nowTitle : s.label + (sk.has(j) ? ' · skipped' : j < k ? ' · done' : ''))}"></i>`).join('')}</div>`;
|
|
27
28
|
}
|
|
28
29
|
export const chips = (list) => (list && list.length ? `<div class="xv-chips">${list.join('')}</div>` : '');
|
|
29
30
|
let say = toast;
|
|
@@ -87,14 +87,14 @@ const S = {
|
|
|
87
87
|
doneOpen: false, stepsMore: false, sheet: false, rec: {}, pin: new Set(JSON.parse(store.get('pmos.home.pin') || '[]')),
|
|
88
88
|
cardFold: store.get('pmos.home.cardfold') === '1', // the card's checklist folded to one line (AgInitSpec), kept in this browser
|
|
89
89
|
// the one list (premium-uncovered-features): the filter, the picked product, which groups and initiatives are open, kept in this browser
|
|
90
|
-
filter: 'today', product: store.get('pmos.home.product') || null, kidsOff: new Set(), rest: new Set(),
|
|
90
|
+
filter: 'today', product: store.get('pmos.home.product') || null, kidsOff: new Set(), rest: new Set(), cap: false, day: false,
|
|
91
91
|
pg: (() => { try { return JSON.parse(store.get('pmos.home.pg') || '{}') || {}; } catch { return {}; } })(),
|
|
92
92
|
eodHidden: store.get('pmos.home.eod') === L.dayOf(), phoneChat: false,
|
|
93
93
|
};
|
|
94
94
|
// every fold of the list is kept in this browser (HvAC: "every group can be hidden or shown, and the choice is remembered"): the groups in
|
|
95
95
|
// pmos.home.pg, an initiative's rows and its "N more" in pmos.home.kids
|
|
96
|
-
(() => { try { const k = JSON.parse(store.get('pmos.home.kids') || '{}') || {}; for (const [n, v] of [['on', S.kids], ['off', S.kidsOff], ['rest', S.rest]
|
|
97
|
-
const keepKids = () => store.set('pmos.home.kids', JSON.stringify({ on: [...S.kids], off: [...S.kidsOff], rest: [...S.rest]
|
|
96
|
+
(() => { try { const k = JSON.parse(store.get('pmos.home.kids') || '{}') || {}; for (const [n, v] of [['on', S.kids], ['off', S.kidsOff], ['rest', S.rest]]) for (const x of k[n] || []) v.add(x); } catch { /* none kept */ } })();
|
|
97
|
+
const keepKids = () => store.set('pmos.home.kids', JSON.stringify({ on: [...S.kids], off: [...S.kidsOff], rest: [...S.rest] }));
|
|
98
98
|
const toast = (t) => { const el = $('#toast'); el.classList.remove('act'); el.textContent = t; el.classList.add('on'); clearTimeout(toast.t); toast.t = setTimeout(() => el.classList.remove('on'), 4200); };
|
|
99
99
|
/** The toast with Undo (RnASaved: "Renamed · Undo"), the shape home-work.js draws: undo() runs the write's opposite once. */
|
|
100
100
|
function toastUndo(msg, undo) {
|
|
@@ -255,7 +255,7 @@ function homeListHtml() {
|
|
|
255
255
|
// a group is open until the PM folds it; another product starts folded; "Not in an initiative" starts folded on a phone (HvAC, HvACDesk)
|
|
256
256
|
const pOpen = (g) => (g.key in S.pg ? !!S.pg[g.key] : g.kind === 'loose' ? !isPhone() : g.kind === 'program' || g.primary || M.products.length === 1 || (!!S.product && !!g.product && S.product === g.product.key));
|
|
257
257
|
return TD.listHtml(M, todayModel(), {
|
|
258
|
-
sel: S.sel || (S.ini && S.ini !== 'product' ? 'i:' + S.ini : null), selHead: S.head, isOpen: open, pOpen, restOpen: (k) => S.rest.has(k), cap: S.cap,
|
|
258
|
+
sel: S.sel || (S.ini && S.ini !== 'product' ? 'i:' + S.ini : null), selHead: S.head, isOpen: open, pOpen, restOpen: (k) => S.rest.has(k), cap: S.cap, pin: S.pin, avHtml, ready: S.ready, err: S.D.err.length ? S.D.err[0] : '',
|
|
259
259
|
product: S.product, review: R, mic: canDictate(), phone: isPhone(), day: S.day, top: S.ready ? RECROW.html() + MEN.rowHtml(S.D, { sel: S.sel }) : '',
|
|
260
260
|
});
|
|
261
261
|
}
|
|
@@ -413,9 +413,9 @@ function draw() { drawList(); drawTop(); chat.refresh(); }
|
|
|
413
413
|
function allRows() {
|
|
414
414
|
const out = [];
|
|
415
415
|
const M = S.M || L.homeList(S.D, { now: NOW() });
|
|
416
|
-
const add = (r) => { if (!r) return; out.push(r); (r.kids || []).forEach(add); };
|
|
416
|
+
const add = (r) => { if (!r) return; out.push(r); (r.kids || []).forEach(add); (r.tasks || []).forEach(add); };
|
|
417
417
|
H.needsOf(S.D).forEach(add);
|
|
418
|
-
for (const g of M.groups) { (g.flat || []).forEach(add); (g.inis || []).forEach(add); (g.rest || []).forEach(add); (g.rows || []).forEach(add); (g.tasks || []).forEach(add); }
|
|
418
|
+
for (const g of M.groups) { (g.flat || []).forEach(add); (g.inis || []).forEach(add); (g.rest || []).forEach(add); (g.rows || []).forEach(add); (g.tasks || []).forEach(add); add(g.msRow); }
|
|
419
419
|
if (M.list) M.list.rows.forEach(add);
|
|
420
420
|
if (S.filter !== 'today') { const T = L.homeList(S.D, { now: NOW() }); T.groups.forEach((g) => { (g.rows || []).forEach(add); (g.inis || []).concat(g.rest || []).forEach(add); }); }
|
|
421
421
|
for (const s of S.D.sessions) { const r = { id: 's:' + s.id, kind: 'session', sid: s.id, key: H.keyOfSession(s), ini: H.iniOfSession(s), name: H.nameOf(s), role: H.roleOf(s, S.D.desk && S.D.desk.roles), state: s.shown }; out.push(r); }
|
|
@@ -685,6 +685,7 @@ function select(id, o = {}) {
|
|
|
685
685
|
if (!r) { S.phoneChat = false; if (S.ini) openTarget(iniTarget(S.ini)); else openTarget(homeTarget()); drawList(); return; }
|
|
686
686
|
if (r.kind === 'ini') { goIni(r.ini); return; }
|
|
687
687
|
if (r.kind === 'product') { goIni('product'); return; }
|
|
688
|
+
if (r.kind === 'msreview') { goProgram(r.program); return; } // Claude's milestone changes: the program panel, where they lead Waits on you
|
|
688
689
|
S.head = null;
|
|
689
690
|
// a row with a conversation opens it; on a phone it opens over the list, with a back bar (HmPhone2)
|
|
690
691
|
if (isPhone() && (r.kind === 'update' || (r.kind === 'need' && r.row) || r.kind === 'session' || r.needSession)) S.phoneChat = true;
|
|
@@ -745,7 +746,10 @@ function goOtherProduct(g) {
|
|
|
745
746
|
render: (b) => {
|
|
746
747
|
const goals = C.items.map((x) => itemHtml({ kind: x.kind === 'ok' ? 'done' : 'risk', label: x.label })).join('') || '<p class="hm-none">No KR or budget is anchored on this board.</p>';
|
|
747
748
|
b.innerHTML = `<div class="hi-v hi-page"><section class="hi-pg" aria-label="Goals"><div class="hi-pgh"><b>Goals</b><span class="hi-n">${esc(C.of)}</span></div>${goals}</section>`
|
|
748
|
-
+ `<section class="hi-pg" aria-label="This week"><div class="hi-pgh"><b>This week</b></div><div class="hm-r hi-r"><a class="hm-rm" href="${esc(own)}" target="_blank" rel="noopener"><span class="hm-tile">${SVG(I.doc, 14)}</span><span class="hm-rt"><b>Weekly update and metrics review</b><em class="q">In ${esc(name)}'s own Home, in a new tab</em></span></a></div></section
|
|
749
|
+
+ `<section class="hi-pg" aria-label="This week"><div class="hi-pgh"><b>This week</b></div><div class="hm-r hi-r"><a class="hm-rm" href="${esc(own)}" target="_blank" rel="noopener"><span class="hm-tile">${SVG(I.doc, 14)}</span><span class="hm-rt"><b>Weekly update and metrics review</b><em class="q">In ${esc(name)}'s own Home, in a new tab</em></span></a></div></section>`
|
|
750
|
+
+ (isPhone() ? `<button type="button" class="hi-talk" data-hp="talk">Message Claude about ${esc(name)}</button>` : '') + '</div>';
|
|
751
|
+
// a phone has no chat beside the page: its own chat is one press away, as on the board's own product (Wawan, 2026-10-25)
|
|
752
|
+
b.onclick = (e) => { const t = e.target.closest('[data-hp="talk"]'); if (t) talk(); };
|
|
749
753
|
} });
|
|
750
754
|
}
|
|
751
755
|
/** A program heading's name: the program panel in the Viewer, the program's own chat (HbCProg). */
|
|
@@ -1343,7 +1347,6 @@ $('#hmList').onclick = (e) => { // delegated: every press on the list is a <bu
|
|
|
1343
1347
|
}
|
|
1344
1348
|
if (d.hmPg) { const open = b.getAttribute('aria-expanded') === 'true'; S.pg[d.hmPg] = !open; store.set('pmos.home.pg', JSON.stringify(S.pg)); drawList(); const f = $(`#hmList [data-hm-pg="${CSS.escape(d.hmPg)}"]`); if (f) f.focus(); return; }
|
|
1345
1349
|
if ('hmProd' in d) { goIni('product'); return; }
|
|
1346
|
-
if (d.hmTasks) { if (S.tasks.has(d.hmTasks)) S.tasks.delete(d.hmTasks); else S.tasks.add(d.hmTasks); keepKids(); drawList(); return; }
|
|
1347
1350
|
if (d.hmRest) { if (S.rest.has(d.hmRest)) S.rest.delete(d.hmRest); else S.rest.add(d.hmRest); keepKids(); drawList(); return; }
|
|
1348
1351
|
if (d.hmFilter) { S.filter = S.filter === d.hmFilter ? 'today' : d.hmFilter; drawList(); const f = $(`#hmList [data-hm-filter="${d.hmFilter}"]`); if (f) f.focus(); return; }
|
|
1349
1352
|
if (d.hmCheck) { checkRow(d.hmCheck); return; }
|
|
@@ -1430,7 +1433,7 @@ mountIni({ S, VW, pmGet, pmPost, toast, rowOf: (id) => iniRowOf(id), renameIni:
|
|
|
1430
1433
|
/* The program panel in Home's Viewer (HbCProg): Home's board model and programs; an initiative of it opens here, with ← back to the program.
|
|
1431
1434
|
* Read on the first program press, never at start: the panel's modules load premium-shell.js, whose start reads ?session= for the old dialog. */
|
|
1432
1435
|
let progPanel = null;
|
|
1433
|
-
const programPanel = () => progPanel || (progPanel = import('./bd-prog-panel.js').then((PP) => { PP.mount({ M: () => S.D.board, programs: () => S.D.programs || [], openIni: (id) => goIni(id), close: () => {}, reload: () => load(), say: (m) => toast(m), drill: true }); return PP; }));
|
|
1436
|
+
const programPanel = () => progPanel || (progPanel = import('./bd-prog-panel.js').then((PP) => { PP.mount({ M: () => S.D.board, programs: () => S.D.programs || [], openIni: (id) => goIni(id), close: () => {}, reload: () => load(), say: (m) => toast(m), drill: true, talk: () => (isPhone() ? talk : null) }); return PP; }));
|
|
1434
1437
|
PO.mount({ programs: () => S.D.programs || [], stateOf: (p) => (((S.M && S.M.groups) || []).find((g) => g.kind === 'program' && g.program.id === p.id) || {}).st || null,
|
|
1435
1438
|
saved: (p) => { const L2 = S.D.programs || [], i = L2.findIndex((x) => x.id === p.id); if (i >= 0) L2[i] = { ...L2[i], ...p }; drawList(); },
|
|
1436
1439
|
say: (m, undo) => (undo ? toastUndo(m, undo) : toast(m)), openIni: (id) => goIni(id) });
|
|
@@ -1466,9 +1469,8 @@ load().then(() => {
|
|
|
1466
1469
|
const about = KEY.test(P.get('about') || '') ? P.get('about') : KEY.test(asked) ? asked : null;
|
|
1467
1470
|
if (isPhone() && ((open && !blockOpen) || sid || about)) { S.phoneChat = true; drawList(); } // the conversation the address names, not the list
|
|
1468
1471
|
if (open && !blockOpen) {
|
|
1469
|
-
// ?item=pt:<program>:<key> (the program panel's link to a program task) names the row by its id;
|
|
1472
|
+
// ?item=pt:<program>:<key> (the program panel's link to a program task) names the row by its id; Home lists no task, so the chat opens
|
|
1470
1473
|
const r = allRows().find((x) => x.key === open || (/^pt:/.test(open) && x.id === open));
|
|
1471
|
-
if (r && r.kind === 'ptask') { S.pg['g:' + r.program] = true; drawList(); }
|
|
1472
1474
|
if (r) select(r.id); else if (KEY.test(open)) openTarget({ ...homeTarget(), key: open, title: open });
|
|
1473
1475
|
}
|
|
1474
1476
|
else if (sid) { const s = S.D.sessions.find((x) => x.id === sid); if (s) { S.sel = 's:' + s.id; openTarget(sessionTarget(s)); drawList(); } else { openTarget(homeTarget()); toast('That session is not on this machine.'); } }
|
|
@@ -23,6 +23,7 @@ export const ICON = {
|
|
|
23
23
|
again: 'M4 12a8 8 0 1 0 2.3-5.6M4 4v4.5h4.5',
|
|
24
24
|
to: 'M5 12h14M13 6l6 6-6 6',
|
|
25
25
|
dots: 'M5 12h.01M12 12h.01M19 12h.01',
|
|
26
|
+
term: 'M4 5h16v14H4zM8 10l3 2-3 2M13 15h3',
|
|
26
27
|
};
|
|
27
28
|
const svg = (d, w = 2) => `<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="${w}" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="${d}"></path></svg>`;
|
|
28
29
|
/** One answer as an icon button. a = { icon, label, attr, pri }. */
|
|
@@ -37,11 +38,16 @@ export function permissionAsk(conv) {
|
|
|
37
38
|
const c = conv || {};
|
|
38
39
|
if (c.state === 'ended' || !c.ask) return null;
|
|
39
40
|
const opts = Array.isArray(c.ask.options) ? c.ask.options : [];
|
|
40
|
-
|
|
41
|
+
const ch = c.change || null;
|
|
42
|
+
// a prompt whose choices PMOS could not read still asks: the card says what it can and the answer is in the terminal (never a blue line
|
|
43
|
+
// with nothing under it)
|
|
44
|
+
if (!opts.length) {
|
|
45
|
+
return { kind: 'file', label: 'Asks before it goes on', title: (ch && ch.what) || clip(c.ask.question, 200) || 'Its terminal waits for your answer',
|
|
46
|
+
from: '', to: '', answers: [{ icon: 'term', label: 'Answer in its terminal', attr: 'data-hm-term', pri: true }], more: [] };
|
|
47
|
+
}
|
|
41
48
|
const deny = opts.find((o) => /^no\b/i.test(o.label)) || opts[opts.length - 1];
|
|
42
49
|
const allow = opts[0];
|
|
43
50
|
const more = opts.filter((o) => o !== allow && o !== deny);
|
|
44
|
-
const ch = c.change || null;
|
|
45
51
|
const send = !!ch && OUTSIDE.test(ch.system || '') && WRITE.test(ch.tool || '');
|
|
46
52
|
const verb = ch && ch.tool && !/^mcp__/.test(ch.tool) ? ch.tool + ' ' : '';
|
|
47
53
|
return {
|
|
@@ -115,7 +121,7 @@ export function openAsk(conv) {
|
|
|
115
121
|
const m = ms[i];
|
|
116
122
|
if (m.role === 'user') return false;
|
|
117
123
|
if (m.role === 'tool' && m.ask) return true;
|
|
118
|
-
if (m.role === 'assistant') return !!splitAsk(m.text).block;
|
|
124
|
+
if (m.role === 'assistant') return !!blockAsk(splitAsk(m.text).block); // only a block that draws a card
|
|
119
125
|
}
|
|
120
126
|
return false;
|
|
121
127
|
}
|
|
@@ -261,7 +261,16 @@ export function mountChat(el, host) {
|
|
|
261
261
|
if (k === 'all') { C.plAll = true; drawLine(); return; }
|
|
262
262
|
if (k === 'toggle') {
|
|
263
263
|
const m = lineModel();
|
|
264
|
-
if (m && m.tone === 'you') {
|
|
264
|
+
if (m && m.tone === 'you') {
|
|
265
|
+
// the card that asks; a goal that waits on the PM asks in Claude's newest message, so that one, with the box ready for the answer.
|
|
266
|
+
// Only with neither does the tap open the goal as on a working line (a tap is never silent: feedback batch 4, item 3)
|
|
267
|
+
const a = [...log.querySelectorAll('.hm-askw, .hm-askc, .hm-a.ask')].pop() || [...log.querySelectorAll('.hm-a')].pop();
|
|
268
|
+
if (a) {
|
|
269
|
+
a.scrollIntoView({ block: 'center', behavior: 'smooth' }); a.classList.remove('hm-flash'); void a.offsetWidth; a.classList.add('hm-flash');
|
|
270
|
+
if (!a.querySelector('.hm-askk') && host.desk()) { const box = el.querySelector('textarea'); if (box) box.focus({ preventScroll: true }); }
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
265
274
|
if (host.desk()) { if (vwShows()) window.czViewer.close(); else openGoal(); return; }
|
|
266
275
|
C.plOpen = !C.plOpen; drawLine();
|
|
267
276
|
}
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
* the other products), phoneDay (GET /api/phone-day), review (GET /api/home-review) }. A part that did not answer is left out, never guessed. */
|
|
18
18
|
import { needsOf, boardRows, productCard, productName, sessionRow, nameOf, iniOfSession, todayOf, live, OPEN, hm } from './home-data.js';
|
|
19
19
|
import { programState, groupRows } from './program-model.js';
|
|
20
|
+
import { homeSub } from './ms-suggest.js';
|
|
20
21
|
import { STEPS, stageKey } from './premium-initiative-head.js';
|
|
21
22
|
|
|
22
23
|
const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
@@ -68,7 +69,6 @@ export function productsOf(D) {
|
|
|
68
69
|
}
|
|
69
70
|
|
|
70
71
|
/* ── rows ── */
|
|
71
|
-
export const TASKS_SHOWN = 3;
|
|
72
72
|
function taskHint(t, now, mine) {
|
|
73
73
|
const d = t.end ? dayDiff(t.end, now) : null;
|
|
74
74
|
const when = d == null ? '' : d === 0 ? 'due today' : d === 1 ? 'due tomorrow' : d < 0 ? plural(-d, 'day', 'days') + ' late' : 'due ' + shortDay(t.end);
|
|
@@ -117,10 +117,11 @@ function iniRowOf(D, r, needs, now) {
|
|
|
117
117
|
const mine = tasks.filter((t) => t.mine).length;
|
|
118
118
|
const run = ses.filter((s) => s.state === 'working').length;
|
|
119
119
|
const right = turn ? 'your turn' + (mine ? ' · ' + plural(mine, 'task', 'tasks') : '') : mine ? plural(mine, 'task', 'tasks') : run ? run + ' running' : 'Nothing today';
|
|
120
|
-
// next steps, sessions and today's meetings
|
|
121
|
-
|
|
120
|
+
// next steps, sessions and today's meetings sit under the initiative; its tasks do not (Wawan, 2026-10-25: Home lists no tasks, the
|
|
121
|
+
// initiative's page in the Viewer holds them). The row keeps them for Your move, where the PM's own late ones still lead
|
|
122
|
+
const kids = [...steps, ...ses.sort((a, b) => (RANK[b.state] || 0) - (RANK[a.state] || 0)), ...meet];
|
|
122
123
|
const hint = [(r.wf && r.wf.name) || 'Product feature', r.stage].filter(Boolean).join(' · '); // D99: Kind becomes Workflow
|
|
123
|
-
return { id: 'i:' + r.id, kind: 'ini', ini: r.id, name: r.title, hint, right, turn, busy: kids.length > 0, state: turn ? 'needs' : run ? 'working' : 'quiet', kids, board: r, updated: r.updated || '',
|
|
124
|
+
return { id: 'i:' + r.id, kind: 'ini', ini: r.id, name: r.title, hint, right, turn, busy: kids.length > 0, state: turn ? 'needs' : run ? 'working' : 'quiet', kids, tasks, board: r, updated: r.updated || '',
|
|
124
125
|
stage: r.stage || '', at: rowAt(r), steps: ownSteps(r), yours: kids.filter(isMove).length, late: kids.some((k) => k.kind === 'task' && k.mine && k.late) };
|
|
125
126
|
}
|
|
126
127
|
|
|
@@ -162,8 +163,11 @@ export function programGroups(D, groups, products, o, now) {
|
|
|
162
163
|
if (!inis.length && !tasks.length && !fresh) continue;
|
|
163
164
|
const st = programState(pr, rowsOf, now);
|
|
164
165
|
const turnN = inis.filter((x) => x.turn).length;
|
|
165
|
-
|
|
166
|
-
|
|
166
|
+
// Claude's milestone changes wait on the PM: one Your move line per program, never one per change (canvas XmsgB, Home frame)
|
|
167
|
+
const msSub = homeSub(pr);
|
|
168
|
+
const msRow = msSub ? { id: 'ms:' + pr.id, kind: 'msreview', program: pr.id, name: pr.title, hint: msSub, state: 'needs' } : null;
|
|
169
|
+
out.push({ key: 'g:' + pr.id, kind: 'program', program: pr, st, name: pr.title, subs, inis, rest: [], tasks, count: inis.length, turnN, msRow,
|
|
170
|
+
yours: inis.reduce((n, x) => n + x.yours, 0) + tasks.filter((t) => t.mine && t.late).length + (msRow ? 1 : 0), late: inis.some((x) => x.late) || tasks.some((t) => t.late),
|
|
167
171
|
products: st.products, closedLine: closedOf(inis.length, turnN) });
|
|
168
172
|
}
|
|
169
173
|
return out;
|
|
@@ -248,8 +252,9 @@ function moveOf(groups, needs) {
|
|
|
248
252
|
for (const g of groups) {
|
|
249
253
|
if (g.kind === 'loose') { for (const r of g.rows) if (r.check && r.late) put(late, r); else if (r.state === 'needs' || r.state === 'blocked') put(rest, r, r.kind === 'session' ? '' : bareHint(r)); continue; }
|
|
250
254
|
for (const t of g.tasks || []) if (t.mine && t.late) put(late, t, g.name);
|
|
255
|
+
if (g.msRow) put(rest, g.msRow, g.msRow.hint);
|
|
251
256
|
for (const r of g.flat || []) put(rest, r, '');
|
|
252
|
-
for (const i of (g.inis || []).concat(g.rest || [])) for (const k of i.kids) if (isMove(k)) put(k.kind === 'task' ? late : rest, k, i.name);
|
|
257
|
+
for (const i of (g.inis || []).concat(g.rest || [])) for (const k of i.kids.concat(i.tasks || [])) if (isMove(k)) put(k.kind === 'task' ? late : rest, k, i.name);
|
|
253
258
|
}
|
|
254
259
|
for (const r of needs) if (!seen.has(r.id) && !r.needSession) put(rest, r, r.kind === 'session' ? '' : bareHint(r));
|
|
255
260
|
return late.concat(rest);
|
|
@@ -33,7 +33,8 @@ export function stepRows(h, o = {}) {
|
|
|
33
33
|
for (const x of (h && h.rest) || []) {
|
|
34
34
|
if (x.kind === 'you') { you.push({ state: 'you', label: x.label, note: x.note, go: first ? { attr: 'data-hm-go', label: x.label + '. Open it' } : null, attr: first ? '' : 'data-hm-go', aria: x.label + '. Open it' }); first = false; }
|
|
35
35
|
else if (x.kind === 'agent' && o.run && !ran) { ran = true; run.push({ state: 'run', label: x.label, note: runNote(), owner: { kind: 'claude', live: true } }); }
|
|
36
|
-
else if (x.kind === 'agent') wait.push({ state: 'wait', label: x.label, note: x.note, owner: { kind: 'claude' }
|
|
36
|
+
else if (x.kind === 'agent') wait.push({ state: 'wait', label: x.label, note: x.note, owner: { kind: 'claude' },
|
|
37
|
+
...(x.task ? { act: { attr: `data-hi-chk="${esc(x.task)}"`, icon: 'check', label: 'Mark done: ' + x.label } } : {}) }); // a stage task closes here (home-ini.js hiChk)
|
|
37
38
|
else if (x.kind === 'risk') risk.push({ state: 'risk', label: x.label, note: x.note, noteWarn: true });
|
|
38
39
|
else if (x.kind === 'jira') wait.push({ state: 'wait', label: x.label, owner: { kind: 'jira' }, jira: x.jt ? { done: x.jd, total: x.jt } : null });
|
|
39
40
|
else wait.push({ state: 'wait', label: x.label, note: x.note });
|
|
@@ -87,7 +88,7 @@ export function stageCardHtml(h, o = {}) {
|
|
|
87
88
|
const fold = R.done.length ? { n: R.done.length, names: o.doneOpen ? '' : R.done.map((x) => x.label).join(', '), open: !!o.doneOpen, attr: 'data-hm-done' } : null;
|
|
88
89
|
const steps = (o.doneOpen ? R.done : []).concat(R.shown);
|
|
89
90
|
const list = stepsHtml(steps, { label: h.checkTitle, cls: 'hm-scl', fold, more: R.more > 0 ? { n: R.more, attr: 'data-hm-more' } : null, tail: o.tail || '' });
|
|
90
|
-
const none = !R.done.length && !R.open.length ? '<p class="hm-none">No
|
|
91
|
+
const none = !R.done.length && !R.open.length ? '<p class="hm-none">No task is on record for this stage.</p>' : '';
|
|
91
92
|
const turn = R.open.some((x) => x.state === 'you') ? 'you' : h.turn;
|
|
92
93
|
return `<section class="hm-card hm-pcard hm-sc" aria-label="${esc(o.title || '')}">`
|
|
93
94
|
+ `<div class="hm-box hm-scb ${esc(turn)}"><div class="hm-sch"><b>${esc(h.cur || 'No stage')}</b>${R.done.length + R.open.length ? `<span class="of">${esc(h.doneOf)}</span>` : ''}`
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* more than one product, on a desktop the filter icon for Kept and Done, New), the "N are yours" line, the Today card only while the day has
|
|
6
6
|
* a moment (a recording, a meeting soon or on now, the end of the day, the weekly review open), each program's group, then each product's
|
|
7
7
|
* group (an initials tile, the name, the goal dots, a chevron; one-line rows with the stage track on the right; sessions, next steps and
|
|
8
|
-
*
|
|
8
|
+
* meetings indented under their initiative; its tasks are on its page in the Viewer, not here), and "Not in an initiative" as a folded line. Your day (dayHtml) is a sheet over the list: the date
|
|
9
9
|
* and the day's meetings, Your move with its count, and This week with the Weekly review. Every group folds; home-app.js keeps the folds.
|
|
10
10
|
* The model is home-list.js (pure). This file only turns it into HTML: every control is a <button> (or the capture form) with a data-hm-*
|
|
11
11
|
* press that home-app.js handles. Text from the records goes through esc(). */
|
|
@@ -78,13 +78,10 @@ export function chatHeadHtml(h) {
|
|
|
78
78
|
return `${mk}${same ? lead : ''}${name}${same && !h.prog ? track(h.at == null ? -1 : h.at, h.stage || '', h.steps) : ''}${chip}`;
|
|
79
79
|
}
|
|
80
80
|
/** An initiative row: its mark, its title, the count of what is yours while it is folded, the stage track, and a chevron when something
|
|
81
|
-
* sits under it. The title opens the initiative; the chevron shows or hides its sessions, next steps
|
|
81
|
+
* sits under it. The title opens the initiative; the chevron shows or hides its sessions, next steps and meetings. */
|
|
82
82
|
function iniHtml(r, o, po) {
|
|
83
83
|
const open = o.isOpen(r.id);
|
|
84
|
-
const
|
|
85
|
-
const kids = all ? r.kids : r.kids.filter((k) => !k.extra);
|
|
86
|
-
const more = hid ? `<button type="button" class="hv-fold kid" data-hm-tasks="${esc(r.id)}" aria-expanded="${all}"><span class="hv-mk"></span>${all ? 'Fewer' : hid + ' more'}${svg(all ? P.chevU : P.chevD, 15)}</button>` : '';
|
|
87
|
-
const nest = open ? `<div class="hm-nest" role="group" aria-label="In ${esc(r.name)}">${kids.map((k) => rowHtml(k, { ...o, kid: true })).join('')}${more}</div>` : '';
|
|
84
|
+
const nest = open ? `<div class="hm-nest" role="group" aria-label="In ${esc(r.name)}">${r.kids.map((k) => rowHtml(k, { ...o, kid: true })).join('')}</div>` : '';
|
|
88
85
|
const badge = !open && r.yours ? `<span class="hv-c" role="img" aria-label="${r.yours === 1 ? '1 is yours' : r.yours + ' are yours'}">${r.yours}</span>` : '';
|
|
89
86
|
const chev = r.kids.length ? `<button type="button" class="hv-xc" data-hm-kids="${esc(r.id)}" aria-expanded="${open}" aria-label="${open ? 'Hide' : 'Show'} what is in ${esc(r.name)}">${svg(open ? P.chevD : P.chevR, 15)}</button>` : '<span class="hv-xc" aria-hidden="true"></span>';
|
|
90
87
|
return `<div class="hm-r hv-r ini st-${esc(r.state)}${o.sel === r.id ? ' sel' : ''}" data-id="${esc(r.id)}"${po ? ` data-po-id="${esc(r.ini || r.id)}"` : ''}>${po ? gripHtml(r.name) : ''}<button type="button" class="hm-rm" data-hm-sel="${esc(r.id)}"${o.sel === r.id ? ' aria-current="true"' : ''} title="${esc(r.hint)}">${markHtml(r.yours && r.state !== 'blocked' ? { state: 'needs' } : r)}`
|
|
@@ -129,8 +126,8 @@ function programHtml(g, o) {
|
|
|
129
126
|
+ `<span class="hv-tl tp" aria-hidden="true" data-cz-rail-tile="${esc(g.key)}" data-cz-rail-name="${esc(g.name)}">${svg(P.layers, 16)}${open ? '' : nd(g)}</span><b>${esc(g.name)}</b></button>${open && g.st ? sugHtml(g.program, g.st) : ''}`
|
|
130
127
|
+ `<button type="button" class="hv-pf" data-hm-pg="${esc(g.key)}" aria-expanded="${open}" aria-label="${esc(g.name)}. ${esc(line)}${g.yours ? '. ' + yoursWords(g) : ''}. ${open ? 'Close' : 'Open'} the group">${ms}<span class="hv-cv">${svg(open ? P.chevD : P.chevR, 16)}</span></button></div>`;
|
|
131
128
|
if (!open) return `<section class="hm-pg hv-g prg" aria-label="${esc(g.name)}">${head}</section>`;
|
|
132
|
-
|
|
133
|
-
|
|
129
|
+
// the program's tasks are on its panel (On the program), not on Home: Home lists no tasks (Wawan, 2026-10-25)
|
|
130
|
+
const body = g.subs.map((x) => `<div class="hv-psub" role="heading" aria-level="3"><span class="hv-st2 t${x.tone}" aria-hidden="true">${esc(x.initials)}</span>${esc(x.name)}</div><div class="po-list" data-po-list="${esc(g.program.id)}">${x.inis.map((r) => iniHtml(r, o, true)).join('')}</div>`).join('');
|
|
134
131
|
return `<section class="hm-pg hv-g prg" aria-label="${esc(g.name)}">${head}<div class="hv-card">${body || `<p class="hm-none">${(g.program.members || []).length ? 'No open initiatives' : 'No initiatives yet'}. Open the program to move some in.</p>`}</div></section>`;
|
|
135
132
|
}
|
|
136
133
|
/** "Not in an initiative" (HvAC .lh): a line under the groups. Folded it shows a blue dot when a row waits on you, an amber square when one
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/* pm/ms-suggest.css — Claude's milestone suggestions (pm/ms-suggest.js; canvas XmsgB). ms-suggest.js loads it once, so it works wherever the
|
|
2
|
+
* program panel opens (Board, Home). Token vars only, over pm/cozy.css; the program's purple falls back to the frames' when the page sets none.
|
|
3
|
+
* Quiet: no motion. Every class starts with msg-. */
|
|
4
|
+
.msg-box, .msg-list { --msg-prog: var(--pp-prog, var(--cz-c-6b4fa3)); --msg-progbg: var(--pp-progbg, rgba(107,79,163,.10)); }
|
|
5
|
+
.msg-box { border: 1px dashed color-mix(in srgb, var(--msg-prog) 45%, transparent); border-radius: 16px; overflow: hidden; }
|
|
6
|
+
.msg-hd { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; background: var(--msg-progbg); font-size: 12.5px; color: var(--cz-ink2); }
|
|
7
|
+
.msg-ht { flex: 1; min-width: 0; }
|
|
8
|
+
.msg-ht b { color: var(--msg-prog); font-weight: 700; }
|
|
9
|
+
.msg-list { display: flex; flex-direction: column; }
|
|
10
|
+
.msg-r { display: flex; align-items: flex-start; gap: 10px; padding: 10px 8px 10px 12px; }
|
|
11
|
+
.msg-box .msg-r + .msg-r, .msg-box .msg-hd + div .msg-r:first-child { border-top: 1px dashed color-mix(in srgb, var(--msg-prog) 25%, transparent); }
|
|
12
|
+
.msg-list .msg-r + .msg-r { border-top: 1px solid color-mix(in srgb, var(--cz-ink) 8%, transparent); }
|
|
13
|
+
.msg-mk { color: var(--msg-prog); display: inline-flex; flex: none; padding-top: 2px; }
|
|
14
|
+
.msg-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
|
|
15
|
+
.msg-h { display: flex; gap: 8px; align-items: baseline; width: 100%; }
|
|
16
|
+
.msg-h b { font-size: 13px; font-weight: 700; color: var(--cz-ink); flex: 1; min-width: 0; }
|
|
17
|
+
.msg-d { font-size: 12px; font-weight: 700; color: var(--cz-ink2); white-space: nowrap; }
|
|
18
|
+
.msg-w { font-size: 12px; color: var(--cz-ink3); line-height: 1.4; }
|
|
19
|
+
.msg-src { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; color: var(--cz-ink2); background: var(--cz-well); border-radius: 999px; padding: 2px 8px; }
|
|
20
|
+
.msg-src svg { color: var(--cz-ink3); }
|
|
21
|
+
.msg-gd { width: 7px; height: 7px; transform: rotate(45deg); border-radius: 2px; background: var(--msg-prog); display: inline-block; }
|
|
22
|
+
.msg-ends { display: inline-flex; align-items: center; gap: 2px; flex: none; }
|
|
23
|
+
.msg-ok, .msg-ib { all: unset; box-sizing: border-box; cursor: pointer; width: 32px; height: 32px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; }
|
|
24
|
+
.msg-ok { background: var(--msg-prog); color: var(--cz-card); }
|
|
25
|
+
.msg-ib { color: var(--cz-ink3); }
|
|
26
|
+
@media (hover: hover) { .msg-ib:hover { background: var(--cz-well); color: var(--cz-ink); } .msg-ok:hover { filter: brightness(1.08); } }
|
|
27
|
+
.msg-ok:focus-visible, .msg-ib:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; }
|
|
28
|
+
.msg-ok[disabled], .msg-ib[disabled] { opacity: .45; cursor: default; }
|
|
29
|
+
/* a phone: the touch target grows to 44 px; the row wraps its presses under the text when it is narrow */
|
|
30
|
+
@media (max-width: 760px) { .msg-ok, .msg-ib { width: 40px; height: 40px; } .msg-r { flex-wrap: wrap; } }
|
|
31
|
+
/* in Waits on you (blue well): the rows sit on the card */
|
|
32
|
+
.pp-needs .msg-list { background: var(--cz-card); border-radius: 12px; margin-bottom: 4px; }
|
|
33
|
+
|
|
34
|
+
/* the charter: last checked and Check now (XmsgB, last frame), and the change filled in from the pencil */
|
|
35
|
+
.msg-chk { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--cz-ink3); }
|
|
36
|
+
.msg-chk span { flex: 1; min-width: 0; }
|
|
37
|
+
.msg-chk .msg-ib { width: 28px; height: 28px; }
|
|
38
|
+
.msg-chk .msg-ib.on svg { animation: msg-spin 1.2s linear infinite; }
|
|
39
|
+
@keyframes msg-spin { to { transform: rotate(360deg); } }
|
|
40
|
+
@media (prefers-reduced-motion: reduce) { .msg-chk .msg-ib.on svg { animation: none; } }
|
|
41
|
+
.msg-risk { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--cz-risk); }
|
|
42
|
+
.msg-risk span { flex: 1; min-width: 0; }
|
|
43
|
+
.msg-risk { margin: 4px 0 0 30px; }
|
|
44
|
+
.msg-risk i { width: 7px; height: 7px; border-radius: 50%; background: var(--pc-amberdot, var(--cz-risk)); flex: none; }
|
|
45
|
+
.msg-risk .pc-ib { width: 28px; height: 28px; }
|
|
46
|
+
.msg-chg { display: flex; align-items: flex-start; gap: 6px; margin: 4px 0 0 30px; font-size: 12px; color: var(--cz-ink2); }
|
|
47
|
+
.msg-chg svg { color: var(--pp-prog, var(--cz-c-6b4fa3)); flex: none; margin-top: 1px; }
|
|
48
|
+
.pc-lnw.msg-on > .pc-ln { border: 1px dashed color-mix(in srgb, var(--pp-prog, var(--cz-c-6b4fa3)) 45%, transparent); border-radius: 14px; }
|
|
49
|
+
.pc-ms > .msg-chg { margin: 0 0 8px; }
|
|
50
|
+
.pc-ms > .msg-chk { margin: 0 0 8px; }
|
|
@@ -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
|
+
}
|
|
@@ -784,6 +784,15 @@ async function loadWorkflows() {
|
|
|
784
784
|
let r = null; try { r = await (await fetch('/api/workflows' + (M.board.ws ? '?ws=' + encodeURIComponent(M.board.ws) : ''), { credentials: 'same-origin' })).json(); } catch { r = null; }
|
|
785
785
|
if (r && r.ok && Array.isArray(r.workflows)) { WF.setDefs(r.workflows); drawInit(); }
|
|
786
786
|
}
|
|
787
|
+
/** A task's state from the initiative panel (✓ on its Tasks or its stage card); Undo puts the old state back. */
|
|
788
|
+
async function setTask(r, uid, state) {
|
|
789
|
+
const k = (r.tasks || []).find((x) => x.uid === uid), body = { ws: r.ws || M.board.ws, board: r.boardId || M.board.id, task: uid };
|
|
790
|
+
const res = await pmPost('/api/boards/tasks/state', { ...body, state }).catch(() => null);
|
|
791
|
+
if (!res || res.ok === false) { say((res && res.error) || 'Nothing was changed.'); return; }
|
|
792
|
+
// a breakdown item closed as Won't do is withdrawn, which the ledger cannot undo; Done can go back
|
|
793
|
+
say(state + ': ' + (k ? k.title : uid) + '.', k && state === 'Done' ? async () => { const u = await pmPost('/api/boards/tasks/state', { ...body, state: k.status }).catch(() => null); say(u && u.ok ? 'Back to ' + k.status + '.' : (u && u.error) || 'The undo did not land.'); load(); } : undefined);
|
|
794
|
+
load();
|
|
795
|
+
}
|
|
787
796
|
const viewDoc = (path) => { const a = document.createElement('button'); a.dataset.doc = path; a.hidden = true; document.body.appendChild(a); a.click(); a.remove(); };
|
|
788
797
|
const anchors = async (ws, board) => { try { const r = await (await fetch('/api/boards/anchors?ws=' + encodeURIComponent(ws || M.board.ws || '') + '&board=' + encodeURIComponent(board || M.board.id || ''), { credentials: 'same-origin' })).json(); return r && r.ok ? r.anchors || [] : []; } catch { return []; } };
|
|
789
798
|
const openIniAny = (r) => openIni(r, $('#bdBell'), 'track');
|
|
@@ -794,10 +803,10 @@ Asks.init({ M: () => M, load, say, panel: actsPanel, close: closePanel, rowOf, o
|
|
|
794
803
|
Acts.init({ M: () => M, wf: wfState, load, say, panel: actsPanel, close: closePanel, redraw: () => { drawChips(); drawInit(); if (tab === 'docs') drawDocs(); }, F, rowOf, statusOf, openIni: openIniAny,
|
|
795
804
|
openTicket: (ini, tk) => openTicket(ini, tk, $('#bdFind')), askHref, pageHref, trail: TI, docMeta, loadDocMeta, viewDoc,
|
|
796
805
|
grouping: () => ({ on: groupingOn(), byProduct }), setGrouping });
|
|
797
|
-
BI.mount({ M: () => M, statusOf, dayTitle, fmt, md, ago, segHtml, barHtml: V.barHtml, grill: (id) => GR[id], rowOf, pageHref, askHref, refreshJira: () => refreshJira(), viewDoc,
|
|
806
|
+
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,
|
|
798
807
|
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 })),
|
|
799
808
|
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,
|
|
800
|
-
programOf: (r) => programOf(PGS, r.ws || M.board.ws || '', r.id), rename: renameIni, turnProgram });
|
|
809
|
+
programOf: (r) => programOf(PGS, r.ws || M.board.ws || '', r.id), rename: renameIni, setTask, turnProgram });
|
|
801
810
|
/** Tap the title to rename (canvas RnAIni): the list, the Timeline and the panel show the new name at once; Undo is the same press.
|
|
802
811
|
* The Jira box opens Home's chat about it with the request typed, for the PM to send (PMOS holds no Jira credential, D53). */
|
|
803
812
|
// a name the PM just saved holds over a read that predates it (the board derives off the request path) until a read says it too
|