create-pmos 0.480.0 → 0.481.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 -14
- package/payload/KIT-VERSION +1 -1
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/state/discoveries.md +1 -1
- package/workspace/briefing-premium-board-test.js +1 -3
- package/workspace/briefing-premium-insights-test.js +6 -6
- package/workspace/briefing-premium-metrics-test.js +5 -84
- package/workspace/briefing-premium-sources-test.js +6 -1
- package/workspace/changelog.json +12 -0
- package/workspace/guide/briefing-premium.md +9 -3
- package/workspace/guide/programs.md +4 -2
- package/workspace/lib/board-pack.js +1 -1
- package/workspace/lib/goal-chat.js +3 -0
- package/workspace/lib/metric-drafts.js +37 -6
- package/workspace/lib/ready-reports.js +6 -4
- package/workspace/lib/report-chat.js +1 -0
- package/workspace/lib/routes-metric-drafts.js +2 -1
- package/workspace/lib/routes-ready-reports.js +6 -2
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-html-viewer-test.js +2 -0
- package/workspace/public/pm/bd-acts.js +2 -20
- package/workspace/public/pm/bd-prog-panel.js +1 -2
- package/workspace/public/pm/cozy-board.css +0 -11
- package/workspace/public/pm/cozy-home.css +5 -0
- package/workspace/public/pm/cozy-insights.css +31 -0
- package/workspace/public/pm/cozy-vw-rp.css +5 -0
- package/workspace/public/pm/dash-view.css +19 -0
- package/workspace/public/pm/dash-view.js +49 -11
- package/workspace/public/pm/goal-chat.js +10 -3
- package/workspace/public/pm/home-app.js +31 -89
- package/workspace/public/pm/home-chat.js +19 -4
- package/workspace/public/pm/home-goal.js +1 -1
- package/workspace/public/pm/home-line.js +16 -1
- package/workspace/public/pm/home-list.js +1 -1
- package/workspace/public/pm/premium-board.js +2 -2
- package/workspace/public/pm/premium-insights.js +64 -11
- package/workspace/public/pm/premium-report-read.js +34 -4
- package/workspace/public/pm/premium-report-tab.js +57 -6
- package/workspace/public/pm/premium-vw-file.js +4 -0
- package/workspace/public/pm/prog-page.css +1 -1
- package/workspace/public/pm/prog-page.js +6 -3
- package/workspace/public/pm/report-chat.js +8 -2
- package/workspace/public/pm/trends-review.js +55 -0
- package/workspace/ready-dash-ui-test.js +1 -3
- package/workspace/test-files.json +1 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/* trends-review.js — the words of Intelligence › Delivery trends (batch 22 item 4, canvas MxA–MxD): the month in one ✦ line, "Up N vs last week"
|
|
2
|
+
* on each tile, and "What moved it". PURE: no DOM, no fetch. Every sentence is made from a tile's own value and series; a tile that is not read
|
|
3
|
+
* says nothing, and a number that is not there is never guessed.
|
|
4
|
+
*
|
|
5
|
+
* changeOf(ser, dec) → { d, txt } | null the last week against the one before it, as "Up 7 vs last week"; null when either week is blank
|
|
6
|
+
* movedRows(tiles) → [{ key, label, note, effect }] only the tiles that moved (zero is silence)
|
|
7
|
+
* monthLine(o) → text | null { month, tiles, open } → "November so far: merges are up (...), but 7 of your 14 open initiatives are blocked."
|
|
8
|
+
*
|
|
9
|
+
* A tile here: { key, label, v, ser, abs, change, s } — v is the text shown, ser the weekly series, abs set when the tile is not read, change the
|
|
10
|
+
* server's own { d, txt } where the Board measure has one. lowBetter says which way is good. */
|
|
11
|
+
export const LOW_BETTER = { blocked: true, late: true, idle: true, scope: true, corrections: true, merges: false };
|
|
12
|
+
|
|
13
|
+
const num = (v) => (typeof v === 'number' && Number.isFinite(v) ? v : null);
|
|
14
|
+
const round = (v, dec) => Math.round(v * 10 ** dec) / 10 ** dec;
|
|
15
|
+
|
|
16
|
+
export function changeOf(ser, dec = 0) {
|
|
17
|
+
const S = Array.isArray(ser) ? ser : [], n = S.length, cur = num(S[n - 1]), prev = num(S[n - 2]);
|
|
18
|
+
if (cur === null || prev === null) return null;
|
|
19
|
+
const d = round(cur - prev, dec), a = Math.abs(d).toFixed(dec);
|
|
20
|
+
return { d, txt: (d === 0 ? 'No change' : (d > 0 ? 'Up ' : 'Down ') + a) + ' vs last week' };
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const moved = (t) => !t.abs && t.change && t.change.d !== 0 && !/^No change/.test(t.change.txt);
|
|
24
|
+
export function movedRows(tiles) {
|
|
25
|
+
return (tiles || []).filter(moved).map((t) => ({ key: t.key, label: t.label, note: t.note || '', effect: t.change.txt }));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const list = (a) => (a.length < 2 ? a.join('') : a.slice(0, -1).join(', ') + ' and ' + a[a.length - 1]);
|
|
29
|
+
export function monthLine({ month, tiles, open }) {
|
|
30
|
+
const T = (k) => (tiles || []).find((t) => t.key === k && !t.abs) || null, n = (t) => (t ? Number(t.v) : NaN);
|
|
31
|
+
const good = [], bad = [];
|
|
32
|
+
const mer = T('merges'), cor = T('corrections'), blk = T('blocked'), idl = T('idle'), lat = T('late');
|
|
33
|
+
if (cor) {
|
|
34
|
+
const c = cor.change;
|
|
35
|
+
if (c && c.d < 0) good.push('corrections fell to ' + cor.v + ' per 100 runs');
|
|
36
|
+
else if (c && c.d > 0) bad.push('corrections rose to ' + cor.v + ' per 100 runs'); // no change: the tile says the value, the line stays quiet
|
|
37
|
+
}
|
|
38
|
+
if (mer && Number.isFinite(n(mer))) {
|
|
39
|
+
const d = mer.change ? mer.change.d : null, v = n(mer);
|
|
40
|
+
if (d > 0) good.push('merges are up (' + v + ' this week, ' + d + ' more than last week)');
|
|
41
|
+
else if (d < 0) bad.push('merges are down (' + v + ' this week, ' + -d + ' fewer than last week)');
|
|
42
|
+
else if (d === 0) good.push('merges held at ' + v);
|
|
43
|
+
}
|
|
44
|
+
const of = open ? 'of your ' + open + ' open initiatives ' : '';
|
|
45
|
+
const bl = n(blk), id = n(idl), la = n(lat);
|
|
46
|
+
const tail = [];
|
|
47
|
+
if (bl > 0) tail.push(open ? bl + ' ' + of + (bl === 1 ? 'is' : 'are') + ' blocked' : bl + ' open ' + (bl === 1 ? 'initiative is' : 'initiatives are') + ' blocked');
|
|
48
|
+
if (id > 0) tail.push(id + (open && !tail.length ? ' ' + of : ' ') + (id === 1 ? 'has' : 'have') + ' been idle for a month');
|
|
49
|
+
if (la > 0) tail.push(la + (la === 1 ? ' is' : ' are') + ' late');
|
|
50
|
+
bad.push(...tail);
|
|
51
|
+
if (!good.length && !bad.length) return null;
|
|
52
|
+
const head = (month ? month + ' so far: ' : '');
|
|
53
|
+
const s = good.length ? list(good) + (bad.length ? ', but ' + list(bad) : '') : list(bad);
|
|
54
|
+
return head + s + '.';
|
|
55
|
+
}
|
|
@@ -195,9 +195,7 @@ const SPONSORS = '# Inline login slips to early December unless passkeys move to
|
|
|
195
195
|
const pd = await until(() => pg.evaluate(() => { const v = document.querySelector('#czViewer .pv'); if (!v) return null; return { goal: !!v.querySelector('.pv-gc'), tabs: [...v.querySelectorAll('[data-pv="tab"]')].map((t) => t.dataset.k + (t.getAttribute('aria-selected') === 'true' ? '*' : '')), over: v.scrollWidth > v.clientWidth + 1, toggle: !!document.querySelector('#czViewer [data-cz-vw-p="dash"]') }; }), 15000);
|
|
196
196
|
ok('P (' + nm + ') the product page is the one page: the goal card, Tasks, Initiatives (open first), Reports, Documents; no toggle', !!pd && pd.goal && pd.tabs.join() === 'tasks,initiatives*,reports,documents' && !pd.toggle && !pd.over, JSON.stringify(pd));
|
|
197
197
|
await pg.click('#czViewer [data-pv="tab"][data-k="reports"]');
|
|
198
|
-
|
|
199
|
-
ok('P (' + nm + ') the metrics review keeps its way in: a row in the Reports tab, 40 px', !!mx && /Metrics review/.test(mx.text) && mx.h >= 40, JSON.stringify(mx));
|
|
200
|
-
if (nm === 'desk') { await pg.click('#czViewer [data-hp="metrics"]'); ok('P the row opens the metrics review, ← back to the product', !!(await until(() => pg.evaluate(() => { const c = window.czViewer && window.czViewer.current(); return c && c.id !== 'product' ? c.id : null; })))); }
|
|
198
|
+
ok('P (' + nm + ') the Reports tab has no Metrics review row: it is Intelligence › Delivery trends now', await pg.evaluate(() => !document.querySelector('#czViewer [data-hp="metrics"]')));
|
|
201
199
|
ok('P (' + nm + ') read as a page to read (scope product)', gets.some((g) => g.scope === 'product' && g.from === 'read'), JSON.stringify(gets));
|
|
202
200
|
await shot(pg, 'RdProgProduct-' + nm + '-built');
|
|
203
201
|
ok('0 no page error (product, ' + nm + ')', errs.length === 0, errs.join(' | '));
|