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
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
|
-
/* premium-vw-item-test.js — an initiative and its tasks as
|
|
4
|
-
* Serves the real
|
|
5
|
-
*
|
|
3
|
+
/* premium-vw-item-test.js — an initiative and its tasks as views of the Viewer (initiative premium-viewer, S7; planning/prd/premium-viewer-prd.md R9, R6, R7).
|
|
4
|
+
* Serves the real Home and Board pages from the real server with /api/initiative-premium and /api/board-premium answered by stand-ins built from the
|
|
5
|
+
* libraries' own fixtures. Since premium-agreed-design the initiative is a layout inside Home and the Viewer shows one item at a time (no tabs): the
|
|
6
|
+
* Overview offers Open the full record and opens each task; inside the record a task opens in its place, and the task's initiative link brings the record back.
|
|
6
7
|
* Every wait polls the page; no fixed sleep stands in for a state. */
|
|
7
8
|
const path = require('path');
|
|
8
9
|
const { spawn } = require('child_process');
|
|
@@ -42,86 +43,87 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
|
42
43
|
const open = async ({ w = 1280, h = 900, theme = 'light', answer = null } = {}) => {
|
|
43
44
|
const ctx = await browser.newContext({ viewport: { width: w, height: h } });
|
|
44
45
|
const page = await ctx.newPage();
|
|
45
|
-
const S = { errors: [], gets: [] };
|
|
46
|
+
const S = { errors: [], gets: [], vgets: [] }; // vgets: the Viewer's own reads (no page headers), apart from Home's
|
|
46
47
|
page.on('pageerror', (e) => S.errors.push(String((e && e.message) || e)));
|
|
47
|
-
await page.route('**/api/initiative-premium*', (r) => { S.gets.push(r.request().
|
|
48
|
+
await page.route('**/api/initiative-premium*', (r) => { const u = r.request().url(); S.gets.push(u); if (!r.request().headers()['x-pmos-nonce']) S.vgets.push(u); const a = answer ? answer(u, S.gets.filter((x) => x === u).length) : { status: 200, body: { ok: true, state: 'ready', model: MODEL, as_of: Date.now() } }; r.fulfill({ status: a.status, contentType: 'application/json', body: JSON.stringify(a.body) }); });
|
|
48
49
|
await page.route('**/api/briefing-premium/**', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, turns: [], working: false }) }));
|
|
49
|
-
await page.goto(BASE + '/premium
|
|
50
|
-
S.up = await until(() => page.evaluate(() => !!document.querySelector('
|
|
50
|
+
await page.goto(BASE + '/premium.html?ini=self-serve-v2&ws=w1&board=w1&theme=' + theme);
|
|
51
|
+
S.up = await until(() => page.evaluate(() => !!document.querySelector('.hm-card [data-hm-ov]') && !!window.__premiumWorkItem), 20000);
|
|
51
52
|
return { page, ctx, S };
|
|
52
53
|
};
|
|
53
|
-
const
|
|
54
|
-
const
|
|
54
|
+
const overview = async (page) => { if (!(await page.locator('.hm-card [data-hm-ov]').isVisible())) await page.click('#hmNeeds'); await page.click('.hm-card [data-hm-ov]'); /* a phone: the initiative card is in the top bar's sheet */ return until(() => page.evaluate(() => !!document.querySelector('#czViewer [data-ov-record]') && !!document.querySelector('#czViewer [data-ov-tk="task:t1"]'))); };
|
|
55
|
+
const cur = (page) => page.evaluate(() => { const p = document.querySelector('#czViewer:not([hidden]) .obody.vw'); return { on: p ? p.dataset.vw : null, title: (document.querySelector('#czVwTitle') || {}).textContent || '', n: document.querySelectorAll('#czViewer .obody.vw').length }; });
|
|
56
|
+
const paneTxt = (page, id) => page.evaluate((k) => { const p = document.querySelector(`#czViewer .obody.vw[data-vw="${CSS.escape(k)}"]`); return p ? p.textContent.replace(/\s+/g, ' ') : ''; }, id);
|
|
55
57
|
const INI = 'item:ini:self-serve-v2';
|
|
56
58
|
|
|
57
|
-
/* R9 on
|
|
59
|
+
/* R9 on Home's initiative layout, at 1280 */
|
|
58
60
|
{
|
|
59
61
|
const { page, ctx, S } = await open();
|
|
60
|
-
ok('R9 the initiative
|
|
61
|
-
|
|
62
|
-
const n0 = S.
|
|
63
|
-
|
|
64
|
-
await page.click('#oMain [data-vwopen]');
|
|
62
|
+
ok('R9 Home loads the initiative with the Viewer\'s item views', S.up);
|
|
63
|
+
ok('R9 the Overview offers Open the full record and an Open press on each task', await overview(page));
|
|
64
|
+
const n0 = S.vgets.length;
|
|
65
|
+
await page.click('#czViewer [data-ov-record]');
|
|
65
66
|
await until(async () => /Checks/.test(await paneTxt(page, INI)));
|
|
66
|
-
let s = await
|
|
67
|
-
ok('R9 the
|
|
68
|
-
ok('R9 the
|
|
69
|
-
ok('R9 the
|
|
70
|
-
await page.click(`#
|
|
67
|
+
let s = await cur(page), t = await paneTxt(page, INI);
|
|
68
|
+
ok('R9 the record opens in the Viewer in place of the Overview, one item at a time', s.on === INI && s.n === 1, JSON.stringify(s));
|
|
69
|
+
ok('R9 the record holds the record, next step, checks, tasks and links', ['planning/initiatives/self-serve-v2.md', 'q3-2026:o1:kr1', 'Dara', '30 Oct', 'Next: contract', 'Checks', 'Sandbox key step', 'UAT with five partners', 'planning/evals/self-serve-v2-eval-rubric.md'].every((x) => t.includes(x)), t.slice(0, 500));
|
|
70
|
+
ok('R9 the record loads its own stylesheet', await page.evaluate(() => !!document.querySelector('link[data-vw-css="item"]')));
|
|
71
|
+
await page.click(`#czViewer .obody.vw[data-vw="${INI}"] [data-vwtask="task:t1"]`);
|
|
71
72
|
const TK = 'item:task:self-serve-v2:task:t1';
|
|
72
73
|
await until(async () => /UAT with five partners/.test(await paneTxt(page, TK)));
|
|
73
|
-
s = await
|
|
74
|
-
ok('R9 a task inside the
|
|
75
|
-
ok('R9 the task
|
|
76
|
-
ok('R9
|
|
77
|
-
await page.click(`#
|
|
78
|
-
s = await
|
|
79
|
-
ok('R9 the initiative link brings the
|
|
80
|
-
await page.
|
|
81
|
-
|
|
82
|
-
s = await st(page);
|
|
83
|
-
ok('R9 a new dialog starts with no extra tab; the task\'s own dialog offers Open the initiative', s.ids.length === 0 && await page.evaluate(() => /Open the initiative/.test((document.querySelector('#oMain [data-vwopen]') || {}).textContent || '')), JSON.stringify(s));
|
|
74
|
+
s = await cur(page); t = await paneTxt(page, TK);
|
|
75
|
+
ok('R9 a task inside the record opens in its place, named by the task', s.on === TK && s.title === 'UAT with five partners', JSON.stringify(s));
|
|
76
|
+
ok('R9 the task shows owner, start, due and status', ['Dara', '20 Oct', '27 Oct', 'To do', 'PMOS task'].every((x) => t.includes(x)), t);
|
|
77
|
+
ok('R9 the record and its task read the route once', S.vgets.length - n0 === 1, String(S.vgets.length - n0));
|
|
78
|
+
await page.click(`#czViewer .obody.vw[data-vw="${TK}"] [data-vwini]`);
|
|
79
|
+
s = await cur(page);
|
|
80
|
+
ok('R9 the initiative link brings the record back, not a second one', await until(async () => (await cur(page)).on === INI) && (await cur(page)).n === 1, JSON.stringify(s));
|
|
81
|
+
ok('R9 the task press in the Overview opens the same task view', await overview(page) && await page.click('#czViewer [data-ov-tk="task:t1"]').then(() => until(async () => (await cur(page)).on === TK && /PMOS task/.test(await paneTxt(page, TK)))), JSON.stringify(await cur(page)));
|
|
82
|
+
ok('R9 the old dialog never opens', await page.evaluate(() => { const d = document.querySelector('#dlg'); return !d || !d.classList.contains('on'); }));
|
|
84
83
|
ok('R9 no page error', S.errors.length === 0, S.errors.join(' | '));
|
|
85
84
|
await ctx.close();
|
|
86
85
|
}
|
|
87
86
|
|
|
88
|
-
/* R6 a route that is reading, then fails */
|
|
87
|
+
/* R6 a route that is reading, then fails (only for the other initiative: Home's own read is answered) */
|
|
89
88
|
{
|
|
90
|
-
const { page, ctx, S } = await open({ answer: (n) => (
|
|
91
|
-
await page.locator('#cIniTk .tkq').first().click(); await until(() => page.evaluate(() => document.querySelector('#dlg').classList.contains('on')));
|
|
89
|
+
const { page, ctx, S } = await open({ answer: (u, n) => (!/id=other-two/.test(u) ? { status: 200, body: { ok: true, state: 'ready', model: MODEL } } : n <= 2 ? { status: 202, body: { ok: true, state: 'reading' } } : { status: 500, body: { ok: false, state: 'error', error: 'the board could not be read' } }) });
|
|
92
90
|
await page.evaluate(() => window.__premiumWorkItem.openWorkItem({ kind: 'initiative', id: 'other-two', title: 'Other' }));
|
|
93
|
-
ok('R6 while the route reads, the
|
|
91
|
+
ok('R6 while the route reads, the view says so', await until(async () => /Reading the initiative/.test(await paneTxt(page, 'item:ini:other-two')), 3000));
|
|
94
92
|
ok('R6 a failed read says what failed and invents nothing', await until(async () => /could not be read: the board could not be read/.test(await paneTxt(page, 'item:ini:other-two')), 8000), await paneTxt(page, 'item:ini:other-two'));
|
|
93
|
+
ok('R6 no page error', S.errors.length === 0, S.errors.join(' | '));
|
|
95
94
|
await ctx.close();
|
|
96
95
|
}
|
|
97
96
|
|
|
98
|
-
/* R9
|
|
97
|
+
/* R9 the Board (premium-agreed-design): the Agreed Board opens an initiative in its side panel and never the dialog; its expand leads to the
|
|
98
|
+
* initiative (Home's initiative layout), where the record is. R7 floors at 390 in dark: the same record, opened from Home's Overview. */
|
|
99
99
|
{
|
|
100
100
|
const ctx = await browser.newContext({ viewport: { width: 390, height: 844 } });
|
|
101
101
|
const page = await ctx.newPage(); const errors = [];
|
|
102
102
|
page.on('pageerror', (e) => errors.push(String((e && e.message) || e)));
|
|
103
|
-
await page.addInitScript(() => { try { localStorage.setItem('pmos.premium.openAs', 'popup'); } catch { /* none */ } });
|
|
104
103
|
await page.route('**/api/board-premium*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model: BP.build(BF.facts()), as_of: Date.now() }) }));
|
|
105
|
-
await page.route('**/api/initiative-premium*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model: MODEL, as_of: Date.now() }) }));
|
|
106
104
|
await page.route('**/api/briefing-premium/**', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, turns: [], working: false }) }));
|
|
107
105
|
await page.goto(BASE + '/premium-board.html?theme=dark');
|
|
108
106
|
const up = await until(() => page.evaluate(() => document.querySelectorAll('#ibBody [data-key]').length > 0), 20000);
|
|
109
107
|
ok('R9 the Board loads', up);
|
|
110
|
-
|
|
111
|
-
await until(() => page.evaluate(() => document.querySelector('#
|
|
112
|
-
ok('R9 an initiative row opens the Board dialog
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
108
|
+
await page.click('#ibBody .bt-l[data-row="board:self-serve-v2"] .bt-nm');
|
|
109
|
+
const pk = await until(() => page.evaluate(() => { const k = document.querySelector('#peek'); return k && !k.hidden ? { record: !!k.querySelector('[data-pk="record"]'), dlg: !!document.querySelector('#dlg.on'), href: (k.querySelector('[data-pk="expand"]') || {}).getAttribute ? k.querySelector('[data-pk="expand"]').getAttribute('href') : '' } : null; }));
|
|
110
|
+
ok('R9 an initiative row opens the Board\'s side panel, not the dialog, and its expand leads to the initiative page, where the record tab is', !!pk && !pk.record && !pk.dlg && /^\/premium-initiative\.html\?id=self-serve-v2&ws=w1&board=w1$/.test(pk.href), JSON.stringify(pk));
|
|
111
|
+
ok('R9 no page error on the Board', errors.length === 0, errors.join(' | '));
|
|
112
|
+
await ctx.close();
|
|
113
|
+
}
|
|
114
|
+
{
|
|
115
|
+
const { page, ctx, S } = await open({ w: 390, h: 844, theme: 'dark' });
|
|
116
|
+
await overview(page);
|
|
117
|
+
await page.click('#czViewer [data-ov-record]');
|
|
118
|
+
await until(async () => /Checks/.test(await paneTxt(page, INI)));
|
|
117
119
|
const fl = await page.evaluate((k) => {
|
|
118
|
-
const p = document.querySelector(`#
|
|
120
|
+
const p = document.querySelector(`#czViewer .obody.vw[data-vw="${CSS.escape(k)}"]`);
|
|
119
121
|
const small = [...p.querySelectorAll('button, a')].filter((b) => b.offsetParent && b.getBoundingClientRect().height < 44).map((b) => b.textContent.trim().slice(0, 30));
|
|
120
122
|
return { wide: document.documentElement.scrollWidth <= 390, small, bg: getComputedStyle(p.querySelector('.vwi-l') || p).backgroundColor };
|
|
121
|
-
},
|
|
123
|
+
}, INI);
|
|
122
124
|
ok('R7 at 390px in dark: no sideways scroll, every press at least 44px', fl.wide && fl.small.length === 0, JSON.stringify(fl));
|
|
123
125
|
ok('R7 dark theme cards are dark', /rgba?\((\d+), (\d+), (\d+)/.test(fl.bg) && +RegExp.$1 < 80, fl.bg);
|
|
124
|
-
ok('
|
|
126
|
+
ok('R7 no page error at 390px in dark', S.errors.length === 0, S.errors.join(' | '));
|
|
125
127
|
await ctx.close();
|
|
126
128
|
}
|
|
127
129
|
finish();
|
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
/* premium-vw-jira-test.js — the Jira tabs of the premium viewer in a real browser (initiative premium-viewer S5; planning/prd/premium-viewer-prd.md R5 to R7).
|
|
4
4
|
* A real server; the Board page's model and the two Jira reads are route stand-ins (GET /api/board-premium, /api/boards/sprints, /api/jira/tickets), since
|
|
5
5
|
* Jira readings are written only by an agent session holding the PM's Atlassian connection.
|
|
6
|
-
* B the
|
|
6
|
+
* B the sprint as a board by status in a viewer tab · K a card opens its ticket · N no Jira data says so · A the Agreed Board's sprint chip
|
|
7
|
+
* Re-pointed for premium-agreed-design: the Agreed Board has no Sprint card and opens no dialog (its sprint chip shows "Waiting for design"),
|
|
8
|
+
* so the sprint view is opened through its module (openSprint) over a task dialog of the initiative page, which loads the same view.
|
|
7
9
|
* F floors: 390 px with no sideways scroll, 44 px targets, light and dark, no write */
|
|
8
10
|
const path = require('path');
|
|
9
11
|
const { spawn } = require('child_process');
|
|
@@ -11,6 +13,8 @@ const { findBrowser } = require('./lib/find-browser');
|
|
|
11
13
|
const T = require('./test-run').configure({ name: 'premium-vw-jira' });
|
|
12
14
|
const BP = require('./lib/board-premium.js');
|
|
13
15
|
const F = require('./fixtures/board-premium-facts.js');
|
|
16
|
+
const IP = require('./lib/initiative-premium.js');
|
|
17
|
+
const IF = require('./fixtures/initiative-premium-facts.js');
|
|
14
18
|
|
|
15
19
|
const BASE = T.BASE;
|
|
16
20
|
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
@@ -65,9 +69,13 @@ const TICKETS = {
|
|
|
65
69
|
browser = await chromium.launch({ executablePath: exe });
|
|
66
70
|
|
|
67
71
|
const model = (sprints) => BP.build(F.facts({ sprints }));
|
|
72
|
+
const IMODEL = IP.build(IF.facts());
|
|
73
|
+
// Home's initiative layout (premium-agreed-design): the card's Overview has the Sprint press; the Viewer shows one item at a time
|
|
74
|
+
const overview = async (pg) => { if (!(await pg.locator('.hm-card [data-hm-ov]').isVisible())) await pg.click('#hmNeeds'); await pg.click('.hm-card [data-hm-ov]'); /* a phone: the initiative card is in the top bar's sheet */ return until(() => pg.evaluate(() => !!document.querySelector('#czViewer [data-ov-sprint]'))); };
|
|
75
|
+
const openSprint = async (pg) => { if (!(await pg.$('#czViewer:not([hidden]) [data-ov-sprint]'))) await overview(pg); /* open() already showed the Overview */ await pg.click('#czViewer [data-ov-sprint]'); };
|
|
68
76
|
const open = async ({ w = 1280, h = 900, theme = 'light', sprints = SPRINTS, tickets = TICKETS } = {}) => {
|
|
69
77
|
const ctx = await browser.newContext({ viewport: { width: w, height: h }, colorScheme: theme });
|
|
70
|
-
await ctx.addInitScript((t) => { try { localStorage.setItem('pmos.
|
|
78
|
+
await ctx.addInitScript((t) => { try { localStorage.setItem('pmos.c3.theme', t); } catch { /* none */ } }, theme);
|
|
71
79
|
const page = await ctx.newPage(), errors = [], posts = [], reads = [];
|
|
72
80
|
page.on('pageerror', (e) => errors.push(String((e && e.message) || e)));
|
|
73
81
|
page.on('request', (rq) => { const u = new URL(rq.url()); if (rq.method() === 'POST') posts.push(u.pathname); if (/^\/api\/(jira|boards\/sprints)/.test(u.pathname)) reads.push(u.pathname + u.search); });
|
|
@@ -75,19 +83,24 @@ const TICKETS = {
|
|
|
75
83
|
await page.route('**/api/board-premium*', (r) => json(r, { ok: true, state: 'ready', model: model(sprints), as_of: Date.now() }));
|
|
76
84
|
await page.route('**/api/boards/sprints*', (r) => json(r, sprints));
|
|
77
85
|
await page.route('**/api/jira/tickets*', (r) => json(r, tickets));
|
|
78
|
-
await page.
|
|
79
|
-
await
|
|
86
|
+
await page.route('**/api/initiative-premium*', (r) => json(r, { ok: true, state: 'ready', model: IMODEL, as_of: Date.now() }));
|
|
87
|
+
await page.route('**/api/briefing-premium/**', (r) => json(r, { ok: true, turns: [], working: false }));
|
|
88
|
+
await page.goto(BASE + '/premium-initiative.html?id=self-serve-v2&ws=w1&board=w1&theme=' + theme); // the Board's expand link: Home with the initiative
|
|
89
|
+
await until(() => page.evaluate(() => !!document.querySelector('.hm-card [data-hm-ov]') && !!window.__premiumVwJira), 20000);
|
|
90
|
+
await overview(page);
|
|
91
|
+
await sleep(300); reads.length = 0; posts.length = 0; // Home's own reads; the checks below are about the sprint view's
|
|
80
92
|
return { ctx, page, errors, posts, reads };
|
|
81
93
|
};
|
|
82
|
-
const
|
|
83
|
-
const paneText = (p, id) => p.evaluate((x) => { const e = document.querySelector(`#
|
|
94
|
+
const curId = (p) => p.evaluate(() => { const e = document.querySelectorAll('#czViewer:not([hidden]) .obody.vw'); return e.length === 1 ? e[0].dataset.vw : [...e].map((x) => x.dataset.vw).join(); });
|
|
95
|
+
const paneText = (p, id) => p.evaluate((x) => { const e = document.querySelector(`#czViewer:not([hidden]) .obody.vw[data-vw="${CSS.escape(x)}"]`); return e && !e.hidden ? e.textContent : null; }, id);
|
|
84
96
|
|
|
85
97
|
/* B the sprint */
|
|
86
98
|
const A = await open();
|
|
87
99
|
const p = A.page;
|
|
88
|
-
await p.
|
|
100
|
+
const mainTxt = await p.evaluate(() => document.querySelector('#czViewer .cz-vw-body').textContent); // the Overview
|
|
101
|
+
await openSprint(p);
|
|
89
102
|
const board = await until(async () => { const t = await paneText(p, 'sprint:w1'); return t && /Migration check/.test(t) ? t : null; });
|
|
90
|
-
ok('B1 the
|
|
103
|
+
ok('B1 the sprint view opens in the Viewer in place of the Overview', !!board && (await curId(p)) === 'sprint:w1', JSON.stringify(await curId(p)));
|
|
91
104
|
ok('B2 the board names the sprint, its dates, goal, days left and points from the read', /Sprint 14 · 7 Oct – 21 Oct/.test(board) && /Sprint goal · from the tickets/i.test(board) && /Ship guided setup/.test(board) && /Three tickets on guided setup/.test(board) && /In Jira: “Setup”/.test(board) && /2 days left/.test(board) && /3 of 10 points done/.test(board), board);
|
|
92
105
|
const cols = await p.evaluate(() => [...document.querySelectorAll('.jcol')].map((c) => c.querySelector('.jcolh').textContent + ':' + c.querySelectorAll('.jcrd').length).join());
|
|
93
106
|
ok('B3 the cards sit in To do, In progress and Done by the reading\'s category', cols === 'To do2:2,In progress1:1,Done1:1', cols);
|
|
@@ -104,9 +117,9 @@ const TICKETS = {
|
|
|
104
117
|
ok('B11 shut again, the fold stays shut on the active sprint', await p.evaluate(() => document.querySelector('#jpast').hidden));
|
|
105
118
|
await p.click('.jcrd[data-k="OPS-9"]');
|
|
106
119
|
const o9 = await until(async () => { const t = await paneText(p, 'jira:OPS-9'); return t && /Rotate keys/.test(t) ? t : null; });
|
|
107
|
-
ok('B12 a ticket on no initiative opens its tab from the sprint read, with its Jira link', !!o9 && /on no initiative of this board/.test(o9) && await p.evaluate(() => [...document.querySelectorAll('#
|
|
108
|
-
await p
|
|
109
|
-
ok('B6 the view says it is read-only and moves nothing', /Read-only: Jira owns each ticket's status and sprint/.test(board) && !(await p.$('#
|
|
120
|
+
ok('B12 a ticket on no initiative opens its tab from the sprint read, with its Jira link', !!o9 && /on no initiative of this board/.test(o9) && await p.evaluate(() => [...document.querySelectorAll('#czViewer .obody.vw a[href]')].some((a) => a.href === 'https://acme.atlassian.net/browse/OPS-9')), o9);
|
|
121
|
+
await openSprint(p); await until(async () => /Migration check/.test((await paneText(p, 'sprint:w1')) || '')); // back to the sprint: one item at a time
|
|
122
|
+
ok('B6 the view says it is read-only and moves nothing', /Read-only: Jira owns each ticket's status and sprint/.test(board) && !(await p.$('#czViewer .obody.vw [draggable="true"]')));
|
|
110
123
|
await p.click('.jseg [data-sp="Sprint 15"]');
|
|
111
124
|
ok('B7 the other sprint is one press away, and an empty one draws empty columns', !!(await until(async () => { const t = await paneText(p, 'sprint:w1'); return t && /Sprint 15 · 22 Oct – 4 Nov/.test(t) && /No goal yet\. The Jira status check writes one from the tickets/.test(t) && (t.match(/None/g) || []).length === 3; })));
|
|
112
125
|
await p.click('.jseg [data-sp="Sprint 14"]');
|
|
@@ -115,18 +128,19 @@ const TICKETS = {
|
|
|
115
128
|
/* K the ticket */
|
|
116
129
|
await p.click('.jcrd[data-k="PMOS-142"]');
|
|
117
130
|
const tk = await until(async () => { const t = await paneText(p, 'jira:PMOS-142'); return t && /Acceptance Criteria/.test(t) ? t : null; });
|
|
118
|
-
ok('K1 a card opens its ticket
|
|
131
|
+
ok('K1 a card opens its ticket in place of the sprint', !!tk && (await curId(p)) === 'jira:PMOS-142', JSON.stringify(await curId(p)));
|
|
119
132
|
ok('K2 the ticket shows key, title, status, sprint, points and priority', /PMOS-142/.test(tk) && /Migration check for older workspaces/.test(tk) && /To Do/.test(tk) && /Sprint 14 · active/.test(tk) && /5 pt/.test(tk) && /High/.test(tk), tk);
|
|
120
133
|
ok('K3 the description is the draft\'s sections, rendered as markdown with nothing run', /User Story/.test(tk) && await p.evaluate(() => !!document.querySelector('.jmd strong') && !document.querySelector('.jmd img[onerror]') && !window.__pwned));
|
|
121
134
|
ok('K4 subtasks are the reading\'s count, and links come from the draft', /Subtasks · 1 of 3 done/.test(tk) && /blocks/.test(tk) && /PMOS-152/.test(tk) && /planning\/prd\/self-serve-v2-prd.md/.test(tk));
|
|
122
|
-
ok('K5 no comments, history or fields panel: a line sends the rest to Jira with a real link', /
|
|
123
|
-
&&
|
|
124
|
-
|
|
135
|
+
ok('K5 no comments, history or fields panel: a line sends the rest to Jira with a real link', /Comments, history and the other fields stay in Jira/.test(tk) && /Jira owns the status and the assignee/.test(tk)
|
|
136
|
+
&& /Assignee\s*Not in the Jira read/.test(tk) && /Jira\s*Read (\d+ (min|hours?|days?) ago|just now)/.test(tk) && !/pull request|\bPR\b|builder/i.test(tk) && !/Comments \(/.test(tk)
|
|
137
|
+
&& await p.evaluate(() => [...document.querySelectorAll('#czViewer .obody.vw a[href]')].every((a) => a.href === 'https://acme.atlassian.net/browse/PMOS-142' && a.target === '_blank' && /noopener/.test(a.rel))));
|
|
138
|
+
await p.click('#czViewer .obody.vw [data-jt="PMOS-152"]');
|
|
125
139
|
ok('K6 a linked ticket opens in its own tab', !!(await until(async () => { const t = await paneText(p, 'jira:PMOS-152'); return t && /Release to existing workspaces/.test(t) && /No sprint/.test(t); })));
|
|
126
|
-
await p.click('#
|
|
127
|
-
const k7 = await until(() => p.evaluate(() => { const m = document.querySelector('#
|
|
128
|
-
ok('K7 the
|
|
129
|
-
ok('K8 the views read the two Jira routes only, and wrote nothing', A.posts.filter((x) => !/thread|note/.test(x)).length === 0 && A.reads.every((r) => /^\/api\/(jira\/tickets|boards\/sprints)\?/.test(r)) && A.reads.some((r) => /jira\/tickets\?.*initiative=self-serve-v2/.test(r)), JSON.stringify([A.posts, A.reads]));
|
|
140
|
+
if (!(await p.locator('.hm-card [data-hm-ov]').isVisible())) await p.click('#hmNeeds'); await p.click('.hm-card [data-hm-ov]');
|
|
141
|
+
const k7 = await until(() => p.evaluate((t0) => { const m = document.querySelector('#czViewer:not([hidden]) .cz-vw-body'); return m && m.textContent === t0 ? m.textContent : null; }, mainTxt));
|
|
142
|
+
ok('K7 the Overview comes back with its own facts, as before', !!k7, await p.evaluate(() => ((document.querySelector('#czViewer .cz-vw-body') || {}).textContent || '').slice(0, 300)));
|
|
143
|
+
ok('K8 the views read the two Jira routes only, and wrote nothing', A.posts.filter((x) => !/thread|note|seen/.test(x)).length === 0 && A.reads.every((r) => /^\/api\/(jira\/tickets|boards\/sprints)\?/.test(r)) && A.reads.some((r) => /jira\/tickets\?.*initiative=self-serve-v2/.test(r)), JSON.stringify([A.posts, A.reads]));
|
|
130
144
|
ok('K9 no page error', A.errors.length === 0, A.errors.join(' | '));
|
|
131
145
|
await A.ctx.close();
|
|
132
146
|
|
|
@@ -148,7 +162,7 @@ const TICKETS = {
|
|
|
148
162
|
await Q.page.evaluate(async () => { const m = await import('/pm/premium-vw-jira.js'); m.openTicket({ ws: 'w1', board: 'w1', initiative: 'self-serve-v2', ref: 'IDPF-2611' }); });
|
|
149
163
|
const q = await until(async () => { const x = await paneText(Q.page, 'jira:IDPF-2611'); return x && /Not read yet/.test(x) ? x : null; });
|
|
150
164
|
ok('N3 a ticket nothing stored holds says Not read yet, when Jira was last read, and offers Read it now (popup context slice 4)', !!q && /Not read yet: IDPF-2611\. The last Jira read \(read \d\d:\d\d\) does not hold it/.test(q) && /Read it now/.test(q)
|
|
151
|
-
&& Q.reads.some((r) => /^\/api\/jira\/ticket\?.*key=IDPF-2611/.test(r)) && Q.posts.length === 0, q || JSON.stringify(Q.reads));
|
|
165
|
+
&& Q.reads.some((r) => /^\/api\/jira\/ticket\?.*key=IDPF-2611/.test(r)) && Q.posts.filter((x) => !/seen/.test(x)).length === 0, q || JSON.stringify(Q.reads));
|
|
152
166
|
await Q.ctx.close();
|
|
153
167
|
// the route itself: a ticket no snapshot holds is found in the stored Jira source read, with what the read says and when
|
|
154
168
|
const fs = require('fs'), path = require('path');
|
|
@@ -160,23 +174,38 @@ const TICKETS = {
|
|
|
160
174
|
&& g2.ticket === null && g2.jira_read_at === '2026-10-21T07:02:00.000Z' && g3.ticket && g3.ticket.key === 'IDPF-2611', JSON.stringify([g1, g2]));
|
|
161
175
|
}
|
|
162
176
|
|
|
163
|
-
/* I the initiative
|
|
177
|
+
/* I the initiative (Home's layout, reached by the Board's expand link) loads the ticket view for its Jira tasks; a Jira task's Open press opens its ticket */
|
|
164
178
|
{
|
|
165
179
|
const I = await open();
|
|
166
|
-
await I.page.
|
|
167
|
-
ok('
|
|
180
|
+
await I.page.click('#czViewer [data-ov-tk="task:ONB-12"]');
|
|
181
|
+
ok('I2 a Jira task in the Overview opens its ticket in the Viewer', !!(await until(async () => (await curId(I.page)) === 'jira:ONB-12')), JSON.stringify(await curId(I.page)));
|
|
182
|
+
await I.page.goto(BASE + '/premium-initiative.html?id=self-serve-v2&ws=w1&board=w1');
|
|
183
|
+
ok('I1 the initiative loads the Jira view module without a page error', !!(await until(() => I.page.evaluate(() => !!window.__premiumVwJira))) && I.errors.length === 0, I.errors.join(' | '));
|
|
168
184
|
await I.ctx.close();
|
|
169
185
|
}
|
|
170
186
|
|
|
187
|
+
/* A the Agreed Board (premium-agreed-design): its sprint chip names the sprint and shows "Waiting for design"; it opens no dialog */
|
|
188
|
+
{
|
|
189
|
+
const ctx = await browser.newContext({ viewport: { width: 1280, height: 900 } }), pg = await ctx.newPage(), errs = [];
|
|
190
|
+
pg.on('pageerror', (e) => errs.push(String((e && e.message) || e)));
|
|
191
|
+
await pg.route('**/api/board-premium*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model: model({ source: 'jira', readAt: new Date().toISOString(), sprints: [{ name: 'Sprint 14', state: 'active', start: '2026-10-07', end: '2026-10-21', counts: { todo: 2, doing: 1, done: 1 }, issues: [] }] }), as_of: Date.now() }) }));
|
|
192
|
+
await pg.goto(BASE + '/premium-board.html');
|
|
193
|
+
await until(() => pg.evaluate(() => !!document.querySelector('#chSprint')), 20000);
|
|
194
|
+
const chip = await pg.evaluate(() => document.querySelector('#chSprint').textContent.trim());
|
|
195
|
+
await pg.click('#chSprint');
|
|
196
|
+
ok('A1 the Board\'s sprint chip names the sprint and opens its read-only Sprint and release panel, tagged "Waiting for design", in the side panel, never the dialog', chip === 'Sprint 14' && await until(() => pg.evaluate(() => (() => { const k = document.querySelector('#peek'); return !!k && !k.hidden && (document.querySelector('#pkTitle') || {}).textContent === 'Sprint and release' && /Waiting for design/.test(k.textContent) && /Sprint 14/.test(k.textContent) && /Nothing here changes Jira/.test(k.textContent); })() && !!!document.querySelector('#dlg.on') && !document.querySelector('#cSpr'))), chip);
|
|
197
|
+
ok('A2 no page error on the Board', errs.length === 0, errs.join(' | '));
|
|
198
|
+
await ctx.close();
|
|
199
|
+
}
|
|
200
|
+
|
|
171
201
|
/* F floors */
|
|
172
202
|
for (const theme of ['light', 'dark']) {
|
|
173
203
|
const S = await open({ w: 390, h: 844, theme });
|
|
174
|
-
await S.page
|
|
204
|
+
await openSprint(S.page);
|
|
175
205
|
await until(() => S.page.$('.jcrd[data-k="PMOS-142"]'));
|
|
176
|
-
await S.page.evaluate(() => { const d = document.querySelector('#dlg'); if (d) d.classList.add('vopen'); const b = document.querySelector('#dTabs button[data-t="out"]'); if (b) b.click(); });
|
|
177
206
|
await sleep(400);
|
|
178
207
|
const f = await S.page.evaluate(() => {
|
|
179
|
-
const pane = document.querySelector('#
|
|
208
|
+
const pane = document.querySelector('#czViewer:not([hidden]) .obody.vw');
|
|
180
209
|
const small = [...pane.querySelectorAll('button.jcrd,.jseg button,.jbtn')].filter((b) => b.getBoundingClientRect().height && b.getBoundingClientRect().height < 44).map((b) => b.textContent.trim().slice(0, 30));
|
|
181
210
|
const crd = getComputedStyle(pane.querySelector('.jcrd')).backgroundColor, ink = getComputedStyle(pane.querySelector('.jcrd b')).color;
|
|
182
211
|
return { wide: document.documentElement.scrollWidth > innerWidth + 1, paneWide: pane.scrollWidth > pane.clientWidth + 1, small, crd, ink };
|