create-pmos 0.396.0 → 0.398.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +25 -25
- package/payload/KIT-VERSION +2 -2
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/scripts/nine-stages.js +49 -20
- package/payload/state/discoveries.md +1 -1
- package/payload/state/log.md +1 -1
- package/workspace/briefing-premium-adddoc-test.js +103 -74
- package/workspace/briefing-premium-board-test.js +316 -154
- package/workspace/briefing-premium-calendar-2-test.js +135 -195
- package/workspace/briefing-premium-calendar-3-test.js +143 -413
- package/workspace/briefing-premium-calendar-test.js +86 -185
- package/workspace/briefing-premium-doc-edit-test.js +95 -83
- package/workspace/briefing-premium-initiative-test.js +166 -294
- package/workspace/briefing-premium-insights-test.js +351 -214
- package/workspace/briefing-premium-metrics-test.js +53 -118
- package/workspace/briefing-premium-products-test.js +40 -27
- package/workspace/briefing-premium-sources-test.js +91 -52
- package/workspace/briefing-premium-test.js +150 -633
- package/workspace/briefing-premium-work-test.js +88 -269
- package/workspace/changelog.json +24 -0
- package/workspace/fixtures/board-premium-facts.js +2 -1
- package/workspace/fixtures/board-premium-jira.js +28 -0
- package/workspace/fixtures/board-premium-trail.js +32 -0
- package/workspace/fixtures/initiative-premium-facts.js +2 -1
- package/workspace/fixtures/initiatives-api/list.json +30 -42
- package/workspace/fixtures/initiatives-api/roadmap.json +40 -56
- package/workspace/fixtures/initiatives-api/sheet.json +10 -14
- package/workspace/fixtures/insights-premium-facts.js +11 -2
- package/workspace/fixtures/premium-viewer-fixtures.js +182 -0
- package/workspace/guide/briefing-premium.md +3 -1
- package/workspace/guide/home.md +47 -0
- package/workspace/guide/index.md +2 -0
- package/workspace/guide/lifecycle.md +51 -0
- package/workspace/home-shot.js +38 -0
- package/workspace/lib/agent-roles.js +71 -0
- package/workspace/lib/board-premium.js +160 -3
- package/workspace/lib/board-trail.js +223 -0
- package/workspace/lib/engine/boards.js +15 -14
- package/workspace/lib/engine/nine-stages.js +49 -20
- package/workspace/lib/engine/signals/detectors.js +13 -11
- package/workspace/lib/home-work-item.js +58 -0
- package/workspace/lib/insights-goals.js +196 -0
- package/workspace/lib/insights-premium.js +126 -1
- package/workspace/lib/insights-records.js +101 -0
- package/workspace/lib/jira-tickets.js +1 -1
- package/workspace/lib/route-modules.js +4 -0
- package/workspace/lib/routes-board-premium.js +3 -2
- package/workspace/lib/routes-board-trail.js +33 -0
- package/workspace/lib/routes-home-desk.js +176 -0
- package/workspace/lib/routes-initiatives.js +1 -1
- package/workspace/lib/routes-insights-premium.js +19 -3
- package/workspace/lib/routes-insights-records.js +129 -0
- package/workspace/lib/routes-notes.js +1 -0
- package/workspace/lib/routes-viewer.js +108 -0
- package/workspace/lib/transcript-steps.js +123 -0
- package/workspace/lib/vendor/scripts/nine-stages.js +49 -20
- package/workspace/lib/viewer-meeting.js +205 -0
- package/workspace/lib/viewer-report.js +89 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-agreed-viewer-shots.js +76 -0
- package/workspace/premium-board-actions-test.js +85 -73
- package/workspace/premium-briefing-depth-test.js +66 -53
- package/workspace/premium-chat-attach-test.js +54 -63
- package/workspace/premium-chat-chart-tab-test.js +35 -36
- package/workspace/premium-chat-context-test.js +22 -19
- package/workspace/premium-chat-goal-view-test.js +28 -26
- package/workspace/premium-chat-notes-test.js +29 -33
- package/workspace/premium-chat-report-tab-test.js +35 -25
- package/workspace/premium-chat-term-test.js +16 -14
- package/workspace/premium-chat-viewer-test.js +60 -53
- package/workspace/premium-core-doc-issue-test.js +50 -41
- package/workspace/premium-html-viewer-test.js +17 -18
- package/workspace/premium-phone-card-test.js +8 -2
- package/workspace/premium-phone-room-test.js +42 -31
- package/workspace/premium-report-read-test.js +115 -197
- package/workspace/premium-viewer-download-test.js +19 -22
- package/workspace/premium-viewer-flicker-test.js +11 -16
- package/workspace/premium-viewer-share-test.js +6 -9
- package/workspace/premium-viewer-test.js +41 -60
- package/workspace/premium-vw-backlog-test.js +53 -31
- package/workspace/premium-vw-cal-test.js +82 -123
- package/workspace/premium-vw-copy-test.js +17 -33
- package/workspace/premium-vw-doc-test.js +12 -11
- package/workspace/premium-vw-item-test.js +50 -48
- package/workspace/premium-vw-jira-test.js +55 -26
- package/workspace/premium-vw-meet-test.js +118 -187
- package/workspace/premium-vw-notes-test.js +85 -107
- package/workspace/premium-vw-rec-test.js +72 -193
- package/workspace/premium-vw-slides-test.js +46 -50
- package/workspace/premium-welcome-test.js +3 -2
- package/workspace/premium-work-depth-test.js +63 -51
- package/workspace/public/pm/bd-acts.js +305 -0
- package/workspace/public/pm/bd-span.js +224 -0
- package/workspace/public/pm/bd-stages.js +47 -0
- package/workspace/public/pm/c3-doc-sheet.js +1 -1
- package/workspace/public/pm/c3-md.js +3 -395
- package/workspace/public/pm/c3-phone-detail.js +1 -1
- package/workspace/public/pm/c3-phone-model.js +3 -68
- package/workspace/public/pm/chat-term.js +3 -3
- package/workspace/public/pm/cozy-board.css +640 -0
- package/workspace/public/pm/cozy-home.css +580 -0
- package/workspace/public/pm/cozy-home.js +172 -0
- package/workspace/public/pm/cozy-initiative.css +138 -0
- package/workspace/public/pm/cozy-insights.css +421 -0
- package/workspace/public/pm/cozy-md.js +396 -0
- package/workspace/public/pm/cozy-nav.js +65 -0
- package/workspace/public/pm/cozy-placeholder.js +26 -0
- package/workspace/public/pm/cozy-viewer.css +143 -0
- package/workspace/public/pm/cozy-viewer.js +144 -0
- package/workspace/public/pm/cozy-vw.css +485 -0
- package/workspace/public/pm/cozy.css +254 -0
- package/workspace/public/pm/home-adddoc.js +48 -0
- package/workspace/public/pm/home-app.js +905 -0
- package/workspace/public/pm/home-around.js +515 -0
- package/workspace/public/pm/home-chat.js +459 -0
- package/workspace/public/pm/home-data.js +312 -0
- package/workspace/public/pm/home-draft.js +68 -0
- package/workspace/public/pm/home-more.js +249 -0
- package/workspace/public/pm/home-phone-card.js +109 -0
- package/workspace/public/pm/home-work.js +519 -0
- package/workspace/public/pm/lifecycle-lens-model.js +45 -27
- package/workspace/public/pm/lifecycle-lens.js +22 -11
- package/workspace/public/pm/phone-moment.js +69 -0
- package/workspace/public/pm/pm-work-view.js +1 -1
- package/workspace/public/pm/premium-attach.js +4 -0
- package/workspace/public/pm/premium-board.js +544 -253
- package/workspace/public/pm/premium-brief.js +1 -1
- package/workspace/public/pm/premium-chart-tab.js +110 -62
- package/workspace/public/pm/premium-chat.js +17 -10
- package/workspace/public/pm/premium-deck.js +3 -3
- package/workspace/public/pm/premium-first.js +25 -21
- package/workspace/public/pm/premium-initiative-head.js +138 -0
- package/workspace/public/pm/premium-initiative.js +28 -4
- package/workspace/public/pm/premium-insights.js +950 -440
- package/workspace/public/pm/premium-meeting.js +61 -549
- package/workspace/public/pm/premium-notes.js +1 -1
- package/workspace/public/pm/premium-report-frame.css +20 -0
- package/workspace/public/pm/premium-report-read.js +509 -480
- package/workspace/public/pm/premium-report-tab.js +87 -63
- package/workspace/public/pm/premium-shell.js +107 -124
- package/workspace/public/pm/premium-viewer.js +27 -1
- package/workspace/public/pm/premium-vw-cal.js +187 -48
- package/workspace/public/pm/premium-vw-doc.css +6 -0
- package/workspace/public/pm/premium-vw-doc.js +40 -2
- package/workspace/public/pm/premium-vw-file.js +2 -2
- package/workspace/public/pm/premium-vw-jira-model.js +22 -5
- package/workspace/public/pm/premium-vw-jira.css +11 -0
- package/workspace/public/pm/premium-vw-jira.js +11 -4
- package/workspace/public/pm/premium-vw-meet.js +6 -83
- package/workspace/public/pm/premium-vw-mtg.js +731 -0
- package/workspace/public/pm/premium-vw-notes.js +56 -69
- package/workspace/public/pm/premium-vw-open.js +35 -0
- package/workspace/public/pm/premium-vw-page.js +16 -0
- package/workspace/public/pm/premium-vw-rec.js +11 -215
- package/workspace/public/pm/premium-vw-slides.css +5 -0
- package/workspace/public/pm/premium-vw-slides.js +44 -8
- package/workspace/public/pm/term-view.js +22 -0
- package/workspace/public/premium-board.html +57 -64
- package/workspace/public/premium-chat.html +7 -33
- package/workspace/public/premium-initiative.html +8 -41
- package/workspace/public/premium-insights.html +63 -62
- package/workspace/public/premium-viewer.html +20 -0
- package/workspace/public/premium-work.html +6 -72
- package/workspace/public/premium.html +21 -66
- package/workspace/public/vendor/nunito-var.woff2 +0 -0
- package/workspace/server.js +25 -3
- package/workspace/test-files.json +1 -0
- package/workspace/test-lists/home-libs.json +9 -0
- package/workspace/test-lists/premium-agreed-viewer.json +9 -0
- package/workspace/test-lists/premium-report-read.json +1 -1
- package/workspace/test-lists/premium-vw-agreed.json +9 -0
- package/workspace/test-lists/premium-vw-notes.json +1 -1
- package/workspace/third-party/README.md +1 -0
- package/workspace/public/pm/premium-work.js +0 -719
- package/workspace/public/pm/premium.js +0 -1133
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/* viewer-report.js — the three checks the Viewer's report panel shows before Issue (initiative premium-agreed-design, area viewer;
|
|
3
|
+
* ReportPanel.dc.html AgRptIssue: "All 3 sources reached · data from Oct 19", "5 slides, every section filled", "The 81% figure is 2 days old.
|
|
4
|
+
* Refresh it first?").
|
|
5
|
+
*
|
|
6
|
+
* issueChecks(markdown, { now, slot }) → [{ id, ok, text }] pure: the report's own text, read as it is
|
|
7
|
+
*
|
|
8
|
+
* sources The draft's "Sources reached and not reached" section (lib/report-draft.js writes it): every source reached, or the ones that
|
|
9
|
+
* were not, by name. The data date is the newest "as of" date the text names, else the cycle's date (slot).
|
|
10
|
+
* sections Each "## " section holds words. An empty one ("—", "none", or nothing) is named.
|
|
11
|
+
* figures The oldest figure that carries its date ("as of 2026-10-19", "Data: 19 Oct 2026"): its age in days. A figure is a number with a
|
|
12
|
+
* unit or a percent sign on the same line. With no dated figure the check passes and says so.
|
|
13
|
+
* A check that passes has ok: true; ok: false is a warning the PM reads before pressing Issue it. Nothing blocks the press. */
|
|
14
|
+
|
|
15
|
+
const MON = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'];
|
|
16
|
+
const MONN = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
17
|
+
const body = (t) => String(t || '').replace(/\r/g, '').replace(/^---\n[\s\S]*?\n---\n?/, '');
|
|
18
|
+
const DAY = 86400000;
|
|
19
|
+
/** "Oct 19", from a date in ms. */
|
|
20
|
+
const short = (ms) => { const d = new Date(ms); return MONN[d.getUTCMonth()] + ' ' + d.getUTCDate(); };
|
|
21
|
+
|
|
22
|
+
/** Every date a line names, in ms (UTC midnight): 2026-10-19, 19 Oct 2026, 19 October 2026, Oct 19 2026. */
|
|
23
|
+
function datesIn(line) {
|
|
24
|
+
const out = [];
|
|
25
|
+
for (const m of String(line).matchAll(/\b(\d{4})-(\d{2})-(\d{2})\b/g)) out.push(Date.UTC(+m[1], +m[2] - 1, +m[3]));
|
|
26
|
+
for (const m of String(line).matchAll(/\b(\d{1,2})\s+([A-Za-z]{3,9})\.?\s+(\d{4})\b/g)) { const i = MON.indexOf(m[2].slice(0, 3).toLowerCase()); if (i >= 0) out.push(Date.UTC(+m[3], i, +m[1])); }
|
|
27
|
+
for (const m of String(line).matchAll(/\b([A-Za-z]{3,9})\.?\s+(\d{1,2}),?\s+(\d{4})\b/g)) { const i = MON.indexOf(m[1].slice(0, 3).toLowerCase()); if (i >= 0) out.push(Date.UTC(+m[3], i, +m[2])); }
|
|
28
|
+
return out.filter(Number.isFinite);
|
|
29
|
+
}
|
|
30
|
+
/** The sections of the text: [{ h, lines }]. The text before the first "## " is not a section. */
|
|
31
|
+
function sectionsOf(text) {
|
|
32
|
+
const out = []; let cur = null;
|
|
33
|
+
for (const l of body(text).split('\n')) {
|
|
34
|
+
const h = /^##\s+(.*)$/.exec(l);
|
|
35
|
+
if (h) { cur = { h: h[1].trim(), lines: [] }; out.push(cur); continue; }
|
|
36
|
+
if (cur) cur.lines.push(l);
|
|
37
|
+
}
|
|
38
|
+
return out;
|
|
39
|
+
}
|
|
40
|
+
const filled = (lines) => lines.some((l) => { const t = l.replace(/<!--.*?-->/g, '').replace(/^[\s>*\-–—|:]+$/, '').trim(); return t && !/^(none|n\/a|tbd|todo|—|-)\.?$/i.test(t.replace(/^[-*]\s+/, '')); });
|
|
41
|
+
|
|
42
|
+
function sourcesCheck(S, text, slot, now) {
|
|
43
|
+
const src = S.find((s) => /^sources\b/i.test(s.h));
|
|
44
|
+
const all = body(text).split('\n');
|
|
45
|
+
const asOf = all.filter((l) => /\bas of\b|\bdata\s*:/i.test(l)).flatMap(datesIn).filter((t) => t <= now + DAY);
|
|
46
|
+
const slotMs = /^\d{4}-\d{2}-\d{2}$/.test(String(slot || '')) ? Date.parse(slot + 'T00:00:00Z') : null;
|
|
47
|
+
const dataAt = asOf.length ? Math.max(...asOf) : slotMs;
|
|
48
|
+
const from = dataAt ? ' · data from ' + short(dataAt) : '';
|
|
49
|
+
if (!src) return { id: 'sources', ok: true, text: 'The report names no sources section' + from };
|
|
50
|
+
let part = '', reached = [], missed = [];
|
|
51
|
+
for (const l of src.lines) {
|
|
52
|
+
if (/^\*\*\s*reached\s*\*\*/i.test(l.trim())) { part = 'r'; continue; }
|
|
53
|
+
if (/^\*\*\s*not reached\s*\*\*/i.test(l.trim())) { part = 'n'; continue; }
|
|
54
|
+
const b = /^\s*[-*]\s+(.*)$/.exec(l); if (!b || /^none\.?$/i.test(b[1].trim())) continue;
|
|
55
|
+
if (part === 'n') missed.push(b[1].split(':')[0].trim()); else reached.push(b[1].trim());
|
|
56
|
+
}
|
|
57
|
+
const n = reached.length + missed.length;
|
|
58
|
+
if (!n) return { id: 'sources', ok: true, text: 'No sources are listed' + from };
|
|
59
|
+
if (!missed.length) return { id: 'sources', ok: true, text: (n === 1 ? 'The 1 source' : 'All ' + n + ' sources') + ' reached' + from };
|
|
60
|
+
return { id: 'sources', ok: false, text: missed.length + ' of ' + n + (n === 1 ? ' source' : ' sources') + ' not reached: ' + missed.slice(0, 3).join(', ') + from };
|
|
61
|
+
}
|
|
62
|
+
function sectionsCheck(S) {
|
|
63
|
+
if (!S.length) return { id: 'sections', ok: false, text: 'The report has no sections yet' };
|
|
64
|
+
const empty = S.filter((s) => !filled(s.lines)).map((s) => s.h);
|
|
65
|
+
const slides = S.length + 1; // a title slide, then one per section (premium-report-read.js slides)
|
|
66
|
+
if (!empty.length) return { id: 'sections', ok: true, text: slides + ' slides, every section filled' };
|
|
67
|
+
return { id: 'sections', ok: false, text: (empty.length === 1 ? '1 section is empty: ' : empty.length + ' sections are empty: ') + empty.slice(0, 3).join(', ') };
|
|
68
|
+
}
|
|
69
|
+
function figuresCheck(text, now) {
|
|
70
|
+
let oldest = null;
|
|
71
|
+
for (const l of body(text).split('\n')) {
|
|
72
|
+
if (!/\bas of\b|\bdata\s*:|\bmeasured\b/i.test(l)) continue;
|
|
73
|
+
const fig = /(\d+(?:[.,]\d+)?\s?%|\d+(?:[.,]\d+)?\s?(?:pp|ms|s|h|d|days|pts|points)\b)/i.exec(l.replace(/\b\d{4}-\d{2}-\d{2}\b/g, ' '));
|
|
74
|
+
const ds = datesIn(l).filter((t) => t <= now + DAY);
|
|
75
|
+
if (!fig || !ds.length) continue;
|
|
76
|
+
const at = Math.min(...ds);
|
|
77
|
+
if (!oldest || at < oldest.at) oldest = { at, fig: fig[1].replace(/\s+/g, '') };
|
|
78
|
+
}
|
|
79
|
+
if (!oldest) return { id: 'figures', ok: true, text: 'No figure carries an older date' };
|
|
80
|
+
const days = Math.floor((Date.UTC(new Date(now).getUTCFullYear(), new Date(now).getUTCMonth(), new Date(now).getUTCDate()) - oldest.at) / DAY);
|
|
81
|
+
if (days <= 1) return { id: 'figures', ok: true, text: 'The ' + oldest.fig + ' figure is from ' + (days <= 0 ? 'today' : 'yesterday') };
|
|
82
|
+
return { id: 'figures', ok: false, text: 'The ' + oldest.fig + ' figure is ' + days + ' days old. Refresh it first?' };
|
|
83
|
+
}
|
|
84
|
+
function issueChecks(markdown, { now = Date.now(), slot = '' } = {}) {
|
|
85
|
+
const S = sectionsOf(markdown);
|
|
86
|
+
return [sourcesCheck(S, markdown, slot, now), sectionsCheck(S), figuresCheck(markdown, now)];
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
module.exports = { issueChecks, sectionsOf, datesIn };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.398.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pmos-workspace",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.398.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@xterm/addon-fit": "^0.11.0",
|
package/workspace/package.json
CHANGED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
/* premium-agreed-viewer-shots.js — screenshots of the initiative page and the Viewer in the Agreed design (initiative premium-agreed-design, area viewer).
|
|
4
|
+
* Not a suite: it serves the real page from the real server, answers the routes from the fixtures the browser suites use, and writes PNGs to
|
|
5
|
+
* the directory given as the first argument (default: ./shots). Run: node premium-agreed-viewer-shots.js /mnt/project-files/agreed-build */
|
|
6
|
+
const fs = require('fs');
|
|
7
|
+
const path = require('path');
|
|
8
|
+
const { spawn } = require('child_process');
|
|
9
|
+
const { findBrowser } = require('./lib/find-browser');
|
|
10
|
+
const T = require('./test-run').configure({ name: 'agreed-viewer-shots' });
|
|
11
|
+
const IP = require('./lib/initiative-premium.js');
|
|
12
|
+
const F = require('./fixtures/initiative-premium-facts.js');
|
|
13
|
+
|
|
14
|
+
const OUT = path.resolve(process.argv[2] || 'shots');
|
|
15
|
+
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
16
|
+
(async () => {
|
|
17
|
+
fs.mkdirSync(OUT, { recursive: true });
|
|
18
|
+
const srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT), PMOS_SELF_ROOT: path.resolve(__dirname, '..') }) });
|
|
19
|
+
await T.waitForServer(T.BASE);
|
|
20
|
+
const { chromium } = require('playwright-core');
|
|
21
|
+
const browser = await chromium.launch({ executablePath: findBrowser() });
|
|
22
|
+
const model = IP.build(F.facts());
|
|
23
|
+
const NOW = new Date(F.NOW);
|
|
24
|
+
const tickets = { ok: true, initiative: 'self-serve-v2', title: 'Self-serve onboarding v2', checkedAt: new Date(F.NOW - 12 * 60000).toISOString(), sectionNames: [{ key: 'story', name: 'User Story' }],
|
|
25
|
+
tickets: [{ id: 'TD-01', key: 'ONB-12', summary: 'Sandbox key step', type: 'Story', priority: 'High', depends: [], sections: { story: 'As a partner I get a sandbox key in one step.' }, jira: { status: 'In Progress', category: 'doing', assignee: { displayName: 'Rudi' }, sprint: { name: 'Sprint 14', state: 'active', start: '2026-10-07', end: '2026-10-21' } } }] };
|
|
26
|
+
const shot = async (name, w, h, theme, act) => {
|
|
27
|
+
const ctx = await browser.newContext({ viewport: { width: w, height: h } });
|
|
28
|
+
const page = await ctx.newPage();
|
|
29
|
+
await page.clock.setFixedTime(NOW).catch(() => {});
|
|
30
|
+
await page.route('**/api/initiative-premium*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model, as_of: F.NOW }) }));
|
|
31
|
+
await page.route('**/api/jira/tickets*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify(tickets) }));
|
|
32
|
+
await page.route('**/api/boards/sprints*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, source: 'none', sprints: [] }) }));
|
|
33
|
+
await page.route('**/api/briefing-premium/**', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, turns: [], working: false }) }));
|
|
34
|
+
await page.goto(T.BASE + '/premium-initiative.html?id=self-serve-v2&ws=w1&board=w1&theme=' + theme);
|
|
35
|
+
for (let i = 0; i < 100 && !(await page.$('#cIniTk')); i++) await sleep(100);
|
|
36
|
+
await sleep(600);
|
|
37
|
+
if (act) await act(page);
|
|
38
|
+
await page.screenshot({ path: path.join(OUT, name + '.png') });
|
|
39
|
+
await ctx.close();
|
|
40
|
+
};
|
|
41
|
+
await shot('viewer-initiative-1440', 1440, 900, 'light');
|
|
42
|
+
await shot('viewer-initiative-1440-dark', 1440, 900, 'dark');
|
|
43
|
+
await shot('viewer-initiative-390', 390, 844, 'light');
|
|
44
|
+
await shot('viewer-initiative-1440-folded', 1440, 900, 'light', async (p) => { await p.click('#czBox [data-czfold]'); await sleep(200); });
|
|
45
|
+
const ticket = async (p) => { await p.click('#cIniTk [data-task="task:ONB-12"]'); await sleep(1500); };
|
|
46
|
+
await shot('viewer-jira-1440', 1440, 900, 'light', ticket);
|
|
47
|
+
await shot('viewer-jira-390', 390, 844, 'light', ticket);
|
|
48
|
+
// the meeting views and the calendar in the cozy dialog: opened on this page with the shell's own dialog, from fixture answers
|
|
49
|
+
const iso = (d) => d.toISOString(), key = (d) => d.getFullYear() + '-' + String(d.getMonth() + 1).padStart(2, '0') + '-' + String(d.getDate()).padStart(2, '0');
|
|
50
|
+
const START = new Date(F.NOW - 10 * 60000), END = new Date(START.getTime() + 45 * 60000);
|
|
51
|
+
const mon = new Date(NOW.getFullYear(), NOW.getMonth(), NOW.getDate() - ((NOW.getDay() + 6) % 7));
|
|
52
|
+
const cells = []; for (let i = 0; i < 7; i++) { const d = new Date(mon.getFullYear(), mon.getMonth(), mon.getDate() + i); cells.push({ key: key(d), start: key(d), end: key(d), events: [] }); }
|
|
53
|
+
cells.find((c) => c.key === key(START)).events.push({ id: 'ev-sync', at: iso(START), end: iso(END), title: 'Weekly sync', attendees: ['Dara', 'Sam'] });
|
|
54
|
+
const week = { ok: true, view: 'week', range: { start: cells[0].key, end: cells[6].key }, cells, events_source: 'calendar-memory', today: key(NOW), context: {}, link_boards: [], gantt: [] };
|
|
55
|
+
const NOTE = { id: 'n1', title: 'Weekly sync', state: 'ended', updated_at: iso(NOW), meeting_ms: 32 * 60000, series: { key: 'weekly-sync' },
|
|
56
|
+
meeting: { kind: 'event', event_id: 'ev-sync', start: iso(START), end: iso(END), title: 'Weekly sync', context: { with: 'Dara and Sam', purpose: 'Agree what blocks the release.', agenda: ['Migration check status'] } },
|
|
57
|
+
final_notes: { overview: 'The team reviewed the migration check.', decisions: [{ text: 'Keep the new copy', why: 'Completion rose six points.' }], actions: [{ text: 'Start the migration check', owner: 'Sam', due: '2026-10-22' }], questions: [{ text: 'Do old workspaces need a manual step?' }] },
|
|
58
|
+
final: { segments: [{ t: 61000, spk: 'meeting', text: 'The migration check status is not started.' }] }, speakers: { meeting: 'Dara' } };
|
|
59
|
+
const meet = async (p, which) => {
|
|
60
|
+
await p.route('**/api/calendar-views*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify(week) }));
|
|
61
|
+
await p.route('**/api/notes/one*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, note: NOTE }) }));
|
|
62
|
+
await p.route('**/api/notes/series?*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, series: { key: 'weekly-sync', meetings: [] } }) }));
|
|
63
|
+
await p.evaluate(async (w) => {
|
|
64
|
+
const S = await import('/pm/premium-shell.js');
|
|
65
|
+
const d = { ...S, pmGet: (u) => fetch(u).then((r) => r.json()).catch(() => null), pmPost: async () => ({ ok: true }), task: async () => ({ ok: false }), openRow: () => {} };
|
|
66
|
+
if (w === 'cal') { const C = await import('/pm/premium-vw-cal.js'); C.openCalendar(d); }
|
|
67
|
+
else { S.openDlg({ eye: 'Meeting · real data', title: 'Weekly sync', say: 'The notes of the meeting.', stream: S.turnA(S.ptx('The notes of the meeting.')), pane: '<article class="paper doc"><p class="note">The meeting.</p></article>', label: 'Meeting' }); const M = await import('/pm/premium-vw-meet.js'); await M.openNoteTab(d, 'n1'); }
|
|
68
|
+
}, which);
|
|
69
|
+
await sleep(1500);
|
|
70
|
+
};
|
|
71
|
+
await shot('viewer-calendar-1440', 1440, 900, 'light', (p) => meet(p, 'cal'));
|
|
72
|
+
await shot('viewer-meeting-1440', 1440, 900, 'light', (p) => meet(p, 'note'));
|
|
73
|
+
await shot('viewer-meeting-390', 390, 844, 'light', (p) => meet(p, 'note'));
|
|
74
|
+
await browser.close(); srv.kill('SIGKILL'); T.killTmux();
|
|
75
|
+
console.log('wrote', fs.readdirSync(OUT).filter((f) => /^viewer-/.test(f)).join(' '));
|
|
76
|
+
})().catch((e) => { console.error(e); process.exit(1); });
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
3
|
/* premium-board-actions-test.js — the board presses of the premium Board and initiative pages (initiative premium-board-actions; planning/prd/premium-board-actions-prd.md A1 to A12).
|
|
4
|
-
* A real server on a scratch `team` repository (planning/initiatives, pmos/state), never the PMOS checkout. The real pages press the real routes
|
|
4
|
+
* A real server on a scratch `team` repository (planning/initiatives, pmos/state), never the PMOS checkout. The real pages press the real routes.
|
|
5
|
+
* Re-pointed for the Agreed Board (premium-agreed-design): the Board's presses are the plain versions of pm/bd-acts.js in the side panel.
|
|
5
6
|
* T triage (accept, decline) · N New initiative · M move and Undo · L hold, resume, cancel, reopen, archive, restore · I the initiative page's bar
|
|
6
7
|
* S the PMOS-self board (a model answer, since only the embedded checkout is self) · P the POST allow-list and the refusals · F floors */
|
|
7
8
|
const fs = require('fs');
|
|
@@ -74,102 +75,111 @@ const ALLOWED = /^\/api\/(?:boards\/(?:asks\/(?:add|accept|decline)|move|archive
|
|
|
74
75
|
};
|
|
75
76
|
const P = await open('/premium-board.html');
|
|
76
77
|
const p = P.page;
|
|
78
|
+
// re-pointed for the Agreed Board (premium-agreed-design): the presses live in plain versions in the side panel (pm/bd-acts.js), tagged
|
|
79
|
+
// "Waiting for design"; a row's actions open from the panel's ⋯; the toast is #bdToast with its Undo; the old dialog never opens.
|
|
77
80
|
const listed = (id) => p.evaluate((x) => [...document.querySelectorAll('#ibBody .ini2')].some((b) => b.dataset.key === 'board:' + x), id);
|
|
78
|
-
const toastIs = (re) => until(() => p.evaluate((s) => { const t = document.querySelector('#
|
|
79
|
-
const
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
const toastIs = (re) => until(() => p.evaluate((s) => { const t = document.querySelector('#bdToast'); return t && !t.hidden && new RegExp(s).test(t.textContent) ? t.textContent : null; }, re.source));
|
|
82
|
+
const peekOn = (title) => until(() => p.evaluate((t) => { const k = document.querySelector('#peek'); return k && !k.hidden && (document.querySelector('#pkTitle') || {}).textContent === t && !!k.querySelector('.bd-wtag'); }, title));
|
|
83
|
+
const noDlg = () => p.evaluate(() => !document.querySelector('#dlg.on'));
|
|
84
|
+
const acts = async (id) => { await until(() => listed(id), 30000); await p.click(`#ibBody .ini2[data-key="board:${id}"]`); await until(() => p.evaluate(() => !!document.querySelector('#peek [data-pk="acts"]'))); await p.click('#peek [data-pk="acts"]'); return peekOn('Initiative actions'); };
|
|
85
|
+
await until(() => p.evaluate(() => document.querySelectorAll('#ibBody .ini2').length > 0), 30000);
|
|
86
|
+
await p.click('#chAsks');
|
|
87
|
+
ok('A2 the New asks panel lists both asks with Accept and Decline', await until(() => p.evaluate(() => document.querySelectorAll('#peek .bd-ask').length === 2 && document.querySelectorAll('#peek [data-act="accept"]').length === 2)), await p.evaluate(() => (document.querySelector('#peek') || {}).textContent));
|
|
88
|
+
ok('A2 an ask shows its source, not an invented name, and the panel is tagged "Waiting for design"', await p.evaluate(() => /Email from Rina/.test(document.querySelector('#peek').textContent) && !/demo/i.test(document.querySelector('#peek').textContent) && !!document.querySelector('#peek .bd-wtag')));
|
|
83
89
|
|
|
84
90
|
/* T triage */
|
|
85
|
-
await p.click(`#
|
|
86
|
-
const anc = await until(() => p.evaluate(() => { const s = document.querySelector('#
|
|
91
|
+
await p.click(`#peek [data-act="accept"][data-id="${a1.body.ask.id}"]`); await peekOn('Accept ask');
|
|
92
|
+
const anc = await until(() => p.evaluate(() => { const s = document.querySelector('#peek select[name="anchor"]'); return s && !s.disabled ? [...s.options].map((o) => o.value) : null; }));
|
|
87
93
|
ok('T1 Accept opens the form with the anchors the board declares', !!anc && anc.includes('health:tech'), JSON.stringify(anc));
|
|
88
|
-
await p.fill('#
|
|
89
|
-
ok('T2 an empty title is refused on the page, before any press', await p.evaluate(() => /Give it a title/.test(document.querySelector('#
|
|
90
|
-
await p.fill('#
|
|
94
|
+
await p.fill('#peek input[name="title"]', ''); await p.click('#peek form[data-form="new"] [type="submit"]');
|
|
95
|
+
ok('T2 an empty title is refused on the page, before any press', await p.evaluate(() => /Give it a title/.test(document.querySelector('#formM').textContent)) && !P.posts.some((x) => x.path === '/api/boards/asks/accept'));
|
|
96
|
+
await p.fill('#peek input[name="title"]', 'Daily CSV of failed payouts'); await p.selectOption('#peek select[name="anchor"]', 'health:tech'); await p.click('#peek form[data-form="new"] [type="submit"]');
|
|
91
97
|
ok('T3 Accept records the accept line and a new initiative, and says so', !!(await toastIs(/accepted in/)) && lines('boards.jsonl').some((l) => l.kind === 'ask-accept' && l.ask === a1.body.ask.id), JSON.stringify(lines('boards.jsonl').map((l) => l.kind)));
|
|
92
|
-
await
|
|
93
|
-
|
|
94
|
-
await p.
|
|
95
|
-
|
|
96
|
-
await p.
|
|
98
|
+
await until(() => p.evaluate(() => document.querySelector('#chAsks') && /\b1\b/.test(document.querySelector('#chAsks').textContent)), 30000);
|
|
99
|
+
await p.click('#chAsks');
|
|
100
|
+
ok('T4 the accepted ask leaves the panel', await until(() => p.evaluate((id) => !document.querySelector(`#peek [data-act="accept"][data-id="${id}"]`) && document.querySelectorAll('#peek .bd-ask').length === 1, a1.body.ask.id)));
|
|
101
|
+
await p.click(`#peek [data-act="decline"][data-id="${a2.body.ask.id}"]`); await peekOn('Decline ask');
|
|
102
|
+
await p.click('#peek form[data-form="decline"] [type="submit"]');
|
|
103
|
+
ok('T5 Decline waits for a reason', await p.evaluate(() => document.querySelector('#peek textarea[name="why"]').validity.valueMissing) && !P.posts.some((x) => x.path === '/api/boards/asks/decline'));
|
|
104
|
+
await p.fill('#peek textarea[name="why"]', 'Not tied to a goal this quarter'); await p.click('#peek form[data-form="decline"] [type="submit"]');
|
|
97
105
|
ok('T6 Decline records the reason in the board ledger', !!(await toastIs(/Ask declined/)) && lines('boards.jsonl').some((l) => l.kind === 'ask-decline' && l.why === 'Not tied to a goal this quarter'));
|
|
98
|
-
|
|
106
|
+
await until(() => p.evaluate(() => /^No new asks|0 new asks/.test((document.querySelector('#chAsks') || {}).textContent.trim())), 30000);
|
|
107
|
+
await p.click('#chAsks');
|
|
108
|
+
ok('T7 the panel says nothing is left to triage', await until(() => p.evaluate(() => /No new ask waits for triage/.test(document.querySelector('#peek').textContent))));
|
|
109
|
+
await p.keyboard.press('Escape');
|
|
99
110
|
|
|
100
111
|
/* N New initiative */
|
|
101
112
|
ok('N1 New initiative is offered on a team board', await p.evaluate(() => !document.querySelector('#newIni').hidden));
|
|
102
|
-
await p.click('#newIni'); await
|
|
103
|
-
await until(() => p.evaluate(() => { const s = document.querySelector('#
|
|
104
|
-
await p.fill('#
|
|
105
|
-
ok('N2 an unanchored create is refused on the page', await p.evaluate(() => /Choose an anchor/.test(document.querySelector('#
|
|
106
|
-
await p.selectOption('#
|
|
113
|
+
await p.click('#newIni'); await peekOn('New initiative');
|
|
114
|
+
await until(() => p.evaluate(() => { const s = document.querySelector('#peek select[name="anchor"]'); return s && !s.disabled; }));
|
|
115
|
+
await p.fill('#peek input[name="title"]', 'Partner usage per key'); await p.click('#peek form[data-form="new"] [type="submit"]');
|
|
116
|
+
ok('N2 an unanchored create is refused on the page', await p.evaluate(() => /Choose an anchor/.test(document.querySelector('#formM').textContent)));
|
|
117
|
+
await p.selectOption('#peek select[name="anchor"]', 'health:tech'); await p.click('#peek form[data-form="new"] [type="submit"]');
|
|
107
118
|
const made = await toastIs(/created in/);
|
|
108
119
|
const recs = fs.readdirSync(path.join(team, 'planning', 'initiatives'));
|
|
109
120
|
ok('N3 Create writes an ask, its accept and a new initiative record, as the console does', !!made && recs.some((f) => /partner-usage/.test(f)) && lines('boards.jsonl').some((l) => l.kind === 'ask' && l.line === 'Partner usage per key'), made + ' / ' + recs.join());
|
|
110
121
|
|
|
111
|
-
/* M move and Undo, from the
|
|
112
|
-
await
|
|
113
|
-
await
|
|
114
|
-
|
|
115
|
-
await p.click(menuBtn);
|
|
116
|
-
const items = await until(() => p.evaluate(() => { const m = document.querySelector('.bam2'); return m ? [...m.querySelectorAll('[role="menuitem"] b')].map((b) => b.textContent) : null; }));
|
|
117
|
-
ok('M1 the row menu offers the next stage, hold, cancel and archive', !!items && /^Move to /.test(items[0]) && items.includes('Put on hold') && items.includes('Cancel') && items.includes('Archive'), JSON.stringify(items));
|
|
118
|
-
ok('M2 the menu takes the focus and the arrow keys move it; Escape closes it and gives the focus back', await (async () => {
|
|
119
|
-
const f0 = await p.evaluate(() => document.activeElement.closest('.bam2') !== null);
|
|
120
|
-
await p.keyboard.press('ArrowDown'); const f1 = await p.evaluate(() => [...document.querySelectorAll('.bam2 [role="menuitem"]')].indexOf(document.activeElement));
|
|
121
|
-
await p.keyboard.press('Escape'); const gone = await p.evaluate(() => !document.querySelector('.bam2') && document.activeElement.matches('.inim'));
|
|
122
|
-
return f0 && f1 === 1 && gone;
|
|
123
|
-
})());
|
|
122
|
+
/* M move and Undo, from the panel's ⋯ */
|
|
123
|
+
ok('M1 the initiative actions offer the next stage, hold, cancel and archive', await acts('pa-one') && await p.evaluate(() => { const L = [...document.querySelectorAll('#peek .bd-ai b')].map((b) => b.textContent); return /^Move to /.test(L[0]) && L.includes('Put on hold') && L.includes('Cancel') && L.includes('Archive'); }), await p.evaluate(() => document.querySelector('#peek').textContent));
|
|
124
|
+
await p.keyboard.press('Escape');
|
|
125
|
+
ok('M2 Escape closes the actions and gives the focus back to the row', await until(() => p.evaluate(() => document.querySelector('#peek').hidden && !!document.activeElement.closest('#ibBody'))));
|
|
124
126
|
const from = ready.model.initiatives.list.rows.find((r) => r.id === 'pa-one').acts.stage;
|
|
125
|
-
await
|
|
127
|
+
await acts('pa-one'); await p.click('#peek .bd-ai[data-k^="mv:"]');
|
|
126
128
|
const mv = await toastIs(/^Moved to/);
|
|
127
129
|
ok('M3 Move records one move line and says what it recorded', !!mv && lines('boards.jsonl').filter((l) => l.kind === 'move' && l.id === 'pa-one').length === 1, mv);
|
|
128
|
-
await p.click('#
|
|
130
|
+
await p.click('#bdToast .bd-undo');
|
|
129
131
|
ok('M4 Undo writes the move back', !!(await toastIs(new RegExp('Back in ' + from))) && lines('boards.jsonl').filter((l) => l.kind === 'move' && l.id === 'pa-one').pop().to === from);
|
|
130
132
|
|
|
131
133
|
/* L hold, resume, cancel, reopen, archive, restore */
|
|
132
|
-
await
|
|
133
|
-
await p.click(
|
|
134
|
-
await p.click('.bam2 [data-pk="hold"]'); await dlgOn();
|
|
135
|
-
await p.fill('#paHR', 'Waiting for the Q1 budget'); await tap(p, '#paHB [data-v="two"]'); await p.click('#paHGo');
|
|
134
|
+
await acts('pa-one'); await p.click('#peek .bd-ai[data-k="hold"]'); await peekOn('Put on hold');
|
|
135
|
+
await p.fill('#peek textarea[name="why"]', 'Waiting for the Q1 budget'); await p.check('#peek input[name="back"][value="two"]'); await p.click('#peek form[data-form="hold"] [type="submit"]');
|
|
136
136
|
const hl = await until(() => lines('lifecycle.jsonl').find((l) => l.initiative_id === 'pa-one' && l.state === 'on-hold'));
|
|
137
|
-
ok('L1 Put on hold records one on-hold line with the reason and a check-back day', !!hl && hl.reason === 'Waiting for the Q1 budget' && /^\d{4}-\d{2}-\d{2}$/.test(hl.back || ''), JSON.stringify(hl) + ' ' + await p.evaluate(() => (document.querySelector('#
|
|
138
|
-
ok('L2 the row then says On hold
|
|
139
|
-
await
|
|
140
|
-
ok('L2 Resume is offered and the moves are not', await
|
|
141
|
-
await p.click('.
|
|
137
|
+
ok('L1 Put on hold records one on-hold line with the reason and a check-back day', !!hl && hl.reason === 'Waiting for the Q1 budget' && /^\d{4}-\d{2}-\d{2}$/.test(hl.back || ''), JSON.stringify(hl) + ' ' + await p.evaluate(() => (document.querySelector('#formM') || {}).textContent));
|
|
138
|
+
ok('L2 the row then says On hold', await until(async () => { const t = await p.evaluate(() => { const b = document.querySelector('#ibBody .ini2[data-key="board:pa-one"]'); return b ? b.textContent : ''; }); return /On hold/.test(t); }, 30000));
|
|
139
|
+
await acts('pa-one');
|
|
140
|
+
ok('L2 Resume is offered and the moves are not', await p.evaluate(() => !!document.querySelector('#peek .bd-ai[data-k="resume"]') && !document.querySelector('#peek .bd-ai[data-k^="mv:"]')));
|
|
141
|
+
await p.click('#peek .bd-ai[data-k="resume"]');
|
|
142
142
|
ok('L3 Resume records an active line', await until(() => { const L = lines('lifecycle.jsonl').filter((l) => l.initiative_id === 'pa-one'); return L.length && L[L.length - 1].state === 'active'; }));
|
|
143
143
|
await until(() => p.evaluate(() => { const b = document.querySelector('#ibBody .ini2[data-key="board:pa-one"]'); return b && !/On hold/.test(b.textContent); }), 30000);
|
|
144
|
-
await
|
|
145
|
-
|
|
146
|
-
await
|
|
144
|
+
await acts('pa-one'); await p.click('#peek .bd-ai[data-k="cancel"]'); await peekOn('Cancel the initiative');
|
|
145
|
+
await p.click('#peek form[data-form="cancel"] [type="submit"]');
|
|
146
|
+
ok('L4 Cancel waits for a reason', await p.evaluate(() => /Pick a reason/.test(document.querySelector('#formM').textContent)) && !lines('lifecycle.jsonl').some((l) => l.initiative_id === 'pa-one' && l.state === 'cancelled'));
|
|
147
|
+
await p.check('#peek input[name="why"][value="Not worth it now"]'); await p.click('#peek form[data-form="cancel"] [type="submit"]');
|
|
147
148
|
ok('L4 Cancel records a cancelled line with the reason', await until(() => lines('lifecycle.jsonl').some((l) => l.initiative_id === 'pa-one' && l.state === 'cancelled' && l.reason === 'Not worth it now')));
|
|
148
|
-
|
|
149
|
-
await p.
|
|
150
|
-
|
|
151
|
-
await p.
|
|
149
|
+
// re-pointed for the Agreed design: the track's footer carries only the fold and the sort (AgBoard), so the count moved to the ⋯ menu's item
|
|
150
|
+
ok('L5 the row leaves the track and the ⋯ menu\'s Cancelled and archived item counts it', await until(() => p.evaluate(() => !document.querySelector('#ibBody .bt-l[data-row="board:pa-one"]') && /1 cancelled/.test((document.querySelector('#bdGone') || {}).textContent || '')), 30000));
|
|
151
|
+
await p.click('#moreBtn'); await p.click('#bdGone'); await peekOn('Cancelled and archived');
|
|
152
|
+
ok('L6 a cancelled initiative offers Reopen only', await p.evaluate(() => [...document.querySelectorAll('#peek .bd-ar [data-act]')].map((b) => b.dataset.act).join() === 'reopen'));
|
|
153
|
+
await p.click('#peek [data-act="reopen"]');
|
|
152
154
|
ok('L6 Reopen records an active line', await until(() => { const L = lines('lifecycle.jsonl').filter((l) => l.initiative_id === 'pa-one'); return L[L.length - 1].state === 'active'; }));
|
|
153
155
|
await until(() => listed('pa-one'), 30000);
|
|
154
|
-
await
|
|
155
|
-
await
|
|
156
|
+
await acts('pa-one'); await p.click('#peek .bd-ai[data-k="archive"]'); await peekOn('Archive the initiative');
|
|
157
|
+
await p.check('#peek input[name="why"][value="Duplicate"]'); await p.fill('#peek textarea[name="note"]', 'Same as the CSV export'); await p.click('#peek form[data-form="archive"] [type="submit"]');
|
|
156
158
|
ok('L7 Archive records one archive line with the reason', await until(() => lines('boards.jsonl').some((l) => l.kind === 'ini-archive' && l.id === 'pa-one' && l.archived === true && l.reason === 'Duplicate: Same as the CSV export')));
|
|
157
|
-
ok('L8 the
|
|
158
|
-
await p.click('#
|
|
159
|
+
ok('L8 the ⋯ menu\'s item counts it as archived', await until(() => p.evaluate(() => /1 archived/.test((document.querySelector('#bdGone') || {}).textContent || '')), 30000));
|
|
160
|
+
await p.click('#bdToast .bd-undo');
|
|
159
161
|
ok('L9 Undo restores it with a restore line', await until(() => lines('boards.jsonl').some((l) => l.kind === 'ini-archive' && l.id === 'pa-one' && l.archived === false)));
|
|
162
|
+
ok('L10 none of the presses opened the old dialog', await noDlg());
|
|
160
163
|
|
|
161
|
-
/* I the
|
|
164
|
+
/* I the Board's expand link: the initiative is a layout inside Home (premium-agreed-design). Its stage moves and lifecycle presses are in the Overview */
|
|
162
165
|
const I = await open('/premium-initiative.html?id=pa-one&ws=' + encodeURIComponent(B.ws) + '&board=' + encodeURIComponent(B.id));
|
|
163
166
|
const ip = I.page;
|
|
164
|
-
const
|
|
165
|
-
ok('
|
|
167
|
+
const landed = await until(() => ip.evaluate(() => { const q = new URLSearchParams(location.search); return location.pathname === '/premium.html' && q.get('ini') === 'pa-one' && !!q.get('ws') && !!q.get('board') && !!document.querySelector('.hm-card [data-hm-ov]'); }), 60000);
|
|
168
|
+
ok('I0 the expand link lands on Home with the initiative selected, ws and board kept', !!landed, await ip.evaluate(() => location.href));
|
|
169
|
+
await ip.click('.hm-card [data-hm-ov]');
|
|
170
|
+
const bar = await until(() => ip.evaluate(() => { const v = document.querySelector('#czViewer:not([hidden])'); if (!v || !v.querySelector('[data-ov-move]')) return null; const cur = v.querySelector('[data-ov-move][aria-pressed="true"]'); return { moves: [...v.querySelectorAll('[data-ov-move]')].map((x) => x.dataset.ovMove), cur: cur ? cur.dataset.ovMove : '', life: [...v.querySelectorAll('[data-ov-life]')].map((x) => x.dataset.ovLife) }; }), 60000);
|
|
171
|
+
ok('I1 the Overview offers the stages, the current one pressed, and the lifecycle presses', !!bar && bar.moves.length > 1 && !!bar.cur && bar.moves.indexOf(bar.cur) < bar.moves.length - 1 && bar.life.join() === 'on-hold,cancelled', JSON.stringify(bar) + ' ' + (await ip.evaluate(() => (document.querySelector('#czViewer .cz-vw-body') || {}).innerText || 'no Viewer')).slice(0, 400));
|
|
166
172
|
const n0 = lines('boards.jsonl').filter((l) => l.kind === 'move').length;
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
await
|
|
170
|
-
ok('
|
|
173
|
+
const next = bar ? bar.moves[bar.moves.indexOf(bar.cur) + 1] : '';
|
|
174
|
+
await ip.click(`#czViewer [data-ov-move="${next}"]`);
|
|
175
|
+
ok('I2 a stage press records one move line', await until(() => { const L = lines('boards.jsonl').filter((l) => l.kind === 'move'); return L.length === n0 + 1 && L[L.length - 1].id === 'pa-one' && L[L.length - 1].to === next; }), JSON.stringify(lines('boards.jsonl').filter((l) => l.kind === 'move').slice(-1)));
|
|
176
|
+
ok('I2 the Overview then shows the new stage pressed', await until(() => ip.evaluate((n) => !!document.querySelector(`#czViewer [data-ov-move="${n}"][aria-pressed="true"]`), next)));
|
|
177
|
+
const lif0 = lines('lifecycle.jsonl').length;
|
|
178
|
+
await ip.click('#czViewer [data-ov-life="on-hold"]');
|
|
179
|
+
ok('I3 a lifecycle press asks its reason inline, records nothing yet and opens no browser dialog', await until(() => ip.evaluate(() => !!document.querySelector('#czViewer #ovWhy'))) && lines('lifecycle.jsonl').length === lif0 && !(await ip.evaluate(() => { const d = document.querySelector('#dlg'); return !!(d && d.classList.contains('on')); })));
|
|
180
|
+
await ip.click('#czViewer [data-ov-life-no]');
|
|
181
|
+
ok('I3 Not now takes the question back', await until(() => ip.evaluate(() => !document.querySelector('#czViewer #ovWhy') && !!document.querySelector('#czViewer [data-ov-life="on-hold"]'))));
|
|
171
182
|
await ip.keyboard.press('Escape');
|
|
172
|
-
await ip.click('#paUndo').catch(() => {});
|
|
173
183
|
|
|
174
184
|
/* S the PMOS-self board: the model says self, the page offers no move and no New initiative */
|
|
175
185
|
{
|
|
@@ -178,9 +188,11 @@ const ALLOWED = /^\/api\/(?:boards\/(?:asks\/(?:add|accept|decline)|move|archive
|
|
|
178
188
|
await S.page.route('**/api/board-premium*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model: m, as_of: Date.now() }) }));
|
|
179
189
|
await S.page.reload();
|
|
180
190
|
await until(() => S.page.evaluate(() => document.querySelectorAll('#ibBody .ini2').length > 0));
|
|
181
|
-
|
|
182
|
-
await S.page.
|
|
183
|
-
|
|
191
|
+
await S.page.click('#chAsks');
|
|
192
|
+
ok('S1 the PMOS-self board names the router in its asks panel and hides New initiative', await until(() => S.page.evaluate(() => /pmos-router/.test(document.querySelector('#peek').textContent) && document.querySelector('#newIni').hidden)));
|
|
193
|
+
await S.page.keyboard.press('Escape');
|
|
194
|
+
await S.page.click('#ibBody .ini2'); await until(() => S.page.evaluate(() => !!document.querySelector('#peek [data-pk="acts"]'))); await S.page.click('#peek [data-pk="acts"]');
|
|
195
|
+
ok('S2 its actions have no move', await until(() => S.page.evaluate(() => { const x = document.querySelector('#peek .bd-alist'); return x && !x.querySelector('[data-k^="mv:"]') && !!x.querySelector('[data-k="hold"]'); })));
|
|
184
196
|
await S.ctx.close();
|
|
185
197
|
}
|
|
186
198
|
|
|
@@ -196,12 +208,12 @@ const ALLOWED = /^\/api\/(?:boards\/(?:asks\/(?:add|accept|decline)|move|archive
|
|
|
196
208
|
/* F floors */
|
|
197
209
|
{
|
|
198
210
|
const S = await open('/premium-board.html', { w: 390, h: 844 });
|
|
199
|
-
await until(() => S.page.evaluate(() => document.querySelectorAll('#ibBody .
|
|
200
|
-
const f = await S.page.evaluate(() => ({ wide: document.documentElement.scrollWidth > innerWidth + 1, small: [...document.querySelectorAll('#ibBody .
|
|
211
|
+
await until(() => S.page.evaluate(() => document.querySelectorAll('#ibBody .ini2').length > 0), 30000);
|
|
212
|
+
const f = await S.page.evaluate(() => ({ wide: document.documentElement.scrollWidth > innerWidth + 1, small: [...document.querySelectorAll('#ibBody .ini2, #chAsks, #newIni')].filter((b) => b.offsetParent && (b.getBoundingClientRect().width < 44 || b.getBoundingClientRect().height < 44)).map((b) => b.className + ':' + Math.round(b.getBoundingClientRect().width) + 'x' + Math.round(b.getBoundingClientRect().height)) }));
|
|
201
213
|
ok('F1 at 390 px there is no sideways scroll and every new control is at least 44 px', !f.wide && !f.small.length, JSON.stringify(f));
|
|
202
|
-
await S.page.click('#ibBody .
|
|
203
|
-
const mi = await until(() => S.page.evaluate(() => { const L = [...document.querySelectorAll('.
|
|
204
|
-
ok('F2 the
|
|
214
|
+
await S.page.click('#ibBody .ini2'); await until(() => S.page.evaluate(() => !!document.querySelector('#peek [data-pk="acts"]'))); await S.page.click('#peek [data-pk="acts"]');
|
|
215
|
+
const mi = await until(() => S.page.evaluate(() => { const L = [...document.querySelectorAll('#peek .bd-ai')]; return L.length ? L.every((b) => b.getBoundingClientRect().height >= 44) && document.documentElement.scrollWidth <= innerWidth + 1 : null; }));
|
|
216
|
+
ok('F2 the action rows are 44 px tall and the open sheet adds no sideways scroll', !!mi);
|
|
205
217
|
await S.ctx.close();
|
|
206
218
|
}
|
|
207
219
|
await P.ctx.close(); await I.ctx.close();
|