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,23 +1,21 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
|
-
/* premium-vw-meet-test.js — the meeting
|
|
4
|
-
* Serves the real
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
3
|
+
/* premium-vw-meet-test.js — the meeting in the Viewer card (initiative premium-viewer, R3; re-pointed for premium-agreed-design, area viewer:
|
|
4
|
+
* Main.dc.html AgPrep / AgMeetLive / AgMeeting). Serves the real /premium-viewer.html from the real server; the notes, the calendar, Focus, the
|
|
5
|
+
* replay and the viewer-meeting record are answered by stand-ins (fixtures/premium-viewer-fixtures.js), so each press can be read off the request
|
|
6
|
+
* the page sent. The routes' own behaviour is in their own suites; the pure half is in premium-vw-meet.test.js and premium-vw-agreed.test.js.
|
|
7
|
+
* One card, no tabs and no conversation: parts in a fixed order Prep → Transcript → Notes, the one that fits the meeting's state open.
|
|
8
|
+
* S1 parts · S2 head · S3 After · S4 Make task and Becomes V.4 · S5 Before (prep) · S6 During · S7 series membership · S8 no note · S9 writes · S10 floors
|
|
8
9
|
* Every wait polls the page; no fixed sleep stands in for a state. */
|
|
9
10
|
const path = require('path');
|
|
10
11
|
const { spawn } = require('child_process');
|
|
11
12
|
const { findBrowser } = require('./lib/find-browser');
|
|
12
13
|
const T = require('./test-run').configure({ name: 'premium-vw-meet' });
|
|
13
|
-
const
|
|
14
|
-
const F = require('./fixtures/briefing-premium-facts.js');
|
|
14
|
+
const F = require('./fixtures/premium-viewer-fixtures.js');
|
|
15
15
|
|
|
16
|
-
const BASE = T.BASE;
|
|
17
|
-
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
18
|
-
const until = async (fn, ms = 10000, step = 100) => { const t0 = Date.now(); for (;;) { const v = await fn(); if (v) return v; if (Date.now() - t0 > ms) return v; await sleep(step); } };
|
|
16
|
+
const BASE = T.BASE, until = F.until;
|
|
19
17
|
const results = [];
|
|
20
|
-
const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + extra : ''}`); };
|
|
18
|
+
const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + String(extra).slice(0, 500) : ''}`); };
|
|
21
19
|
let srv = null; let browser = null;
|
|
22
20
|
const finish = async (code) => {
|
|
23
21
|
if (browser) await browser.close().catch(() => {});
|
|
@@ -29,31 +27,6 @@ const finish = async (code) => {
|
|
|
29
27
|
};
|
|
30
28
|
process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
31
29
|
|
|
32
|
-
const pad = (n) => String(n).padStart(2, '0');
|
|
33
|
-
const dayKey = (d) => `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`;
|
|
34
|
-
const iso = (d) => { const off = -d.getTimezoneOffset(), a = Math.abs(off); return `${dayKey(d)}T${pad(d.getHours())}:${pad(d.getMinutes())}:00${off >= 0 ? '+' : '-'}${pad(Math.floor(a / 60))}:${pad(a % 60)}`; };
|
|
35
|
-
const NOW = new Date();
|
|
36
|
-
const midnight = new Date(NOW.getFullYear(), NOW.getMonth(), NOW.getDate());
|
|
37
|
-
const monday = () => { const d = new Date(midnight); d.setDate(d.getDate() - ((d.getDay() + 6) % 7)); return d; };
|
|
38
|
-
/* "Weekly sync" started at most 10 minutes ago (never before midnight), so it is a Today row; START is in whole minutes, as the calendar answer holds it */
|
|
39
|
-
const START = new Date(Math.max(midnight.getTime(), Math.floor((NOW.getTime() - 10 * 60000) / 60000) * 60000)), END = new Date(START.getTime() + 45 * 60000);
|
|
40
|
-
const weekAnswer = () => {
|
|
41
|
-
const m = monday(), cells = [];
|
|
42
|
-
for (let i = 0; i < 7; i++) { const d = new Date(m.getFullYear(), m.getMonth(), m.getDate() + i); cells.push({ key: dayKey(d), start: dayKey(d), end: dayKey(d), events: [] }); }
|
|
43
|
-
cells.find((c) => c.key === dayKey(START)).events.push({ id: 'ev-sync', at: iso(START), end: iso(END), title: 'Weekly sync', attendees: ['Dara', 'Sam'] });
|
|
44
|
-
return { ok: true, view: 'week', range: { start: cells[0].key, end: cells[6].key }, cells, events_source: 'calendar-memory', today: dayKey(NOW), context: {}, link_boards: [], gantt: [] };
|
|
45
|
-
};
|
|
46
|
-
const ROW = { id: 'n1', title: 'Weekly sync', state: 'ended', updated_at: NOW.toISOString(), meeting: { kind: 'event', event_id: 'ev-sync', start: iso(START), title: 'Weekly sync' }, series: { key: 'weekly-sync' } };
|
|
47
|
-
const NOTE = { ...ROW, meeting_ms: 32 * 60000,
|
|
48
|
-
meeting: { ...ROW.meeting, end: iso(END), context: { with: 'Dara and Sam', purpose: 'Agree what blocks the release.', agenda: ['Migration check status', 'Hiring loop'], links: [{ label: 'Release PRD', url: 'https://x.example/prd' }] } },
|
|
49
|
-
initiative: { id: 'premium-ux', ws: 'w1', title: 'Premium UX' }, board: { id: 'b1', ws: 'w1', title: 'Growth' },
|
|
50
|
-
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?' }] },
|
|
51
|
-
final: { segments: [{ t: 61000, spk: 'meeting', text: 'The migration check status is not started.' }, { t: 125000, spk: 'mic', text: 'Then we keep the copy.' }] }, speakers: { meeting: 'Dara' } };
|
|
52
|
-
const PLACE = { key: 'weekly-sync', title: 'Weekly sync', pos: 2, count: 3, by: 'calendar', prev: { id: 'n0', at: '2026-10-06T10:00:00Z', overview: 'The copy test plan.' }, next: { id: 'n2', at: '2026-10-20T10:00:00Z' },
|
|
53
|
-
since: { at: '2026-10-06T10:00:00Z', items: [{ text: 'Write the runbook', owner: 'Sam', state: 'done' }, { text: 'Book the readout', owner: 'Dara', state: 'again' }], fresh: [{ text: 'Start the migration check', owner: 'Sam' }] },
|
|
54
|
-
carried_in: [{ text: 'Book the readout', owner: 'Dara' }], carried: {} };
|
|
55
|
-
const PNG = Buffer.from('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==', 'base64');
|
|
56
|
-
|
|
57
30
|
(async () => {
|
|
58
31
|
const exe = findBrowser();
|
|
59
32
|
if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the suite cannot run'); return finish(1); }
|
|
@@ -62,163 +35,121 @@ const PNG = Buffer.from('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR
|
|
|
62
35
|
srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
|
|
63
36
|
await T.waitForServer(BASE);
|
|
64
37
|
browser = await chromium.launch({ executablePath: exe });
|
|
38
|
+
const body = (p) => p.evaluate(() => (document.querySelector('#czViewer .cz-vw-body') || {}).innerText || '');
|
|
39
|
+
const parts = (p) => p.evaluate(() => [...document.querySelectorAll('#czViewer .vz-part')].map((x) => x.dataset.part + ':' + x.dataset.open).join());
|
|
40
|
+
const press = (p, sel) => p.$eval('#czViewer ' + sel, (b) => b.click());
|
|
65
41
|
|
|
66
|
-
|
|
67
|
-
const
|
|
68
|
-
const SESS = [];
|
|
69
|
-
/* opts: notes (the rows GET /api/notes holds), note (the note GET /api/notes/one answers) */
|
|
70
|
-
const open = async ({ w = 1280, h = 900, theme = 'light', notes = [ROW], note = NOTE } = {}) => {
|
|
71
|
-
const ctx = await browser.newContext({ viewport: { width: w, height: h } });
|
|
72
|
-
const page = await ctx.newPage();
|
|
73
|
-
const S = { errors: [], reqs: [], planPosts: [], memberPosts: [], oneGets: [], out: false };
|
|
74
|
-
page.on('pageerror', (e) => S.errors.push(String((e && e.message) || e)));
|
|
75
|
-
page.on('request', (r) => { if (r.url().startsWith(BASE)) S.reqs.push(r.method() + ' ' + new URL(r.url()).pathname); });
|
|
76
|
-
await page.route('**/api/briefing-premium*', (r) => json(r, { ok: true, state: 'ready', model: B.build(facts()), as_of: Date.now() }));
|
|
77
|
-
await page.route('**/api/calendar-views*', (r) => json(r, weekAnswer()));
|
|
78
|
-
await page.route('**/api/meeting-replay*', (r) => json(r, { ok: false, error: 'no note' }, 404));
|
|
79
|
-
await page.route('**/api/meeting-material*', (r) => json(r, { ok: true, key: 'k', items: [] }));
|
|
80
|
-
await page.route('**/api/meeting-focus?*', (r) => json(r, { ok: true, brief: { gist: ['Agree what blocks the release.'], planning: false, matters: [{ tag: 'Late', tone: 'bad', text: 'Ship the SSO spike', meta: 'due 14 Oct', ref: { type: 'item' } }], last: { id: 'n0', title: 'Weekly sync', at: '2026-10-06T10:00:00Z', private: false, overview: 'The copy test plan.', decisions: [], actions: [] }, earlier: 1, prep: null, links: [], refs: [] } }));
|
|
81
|
-
await page.route('**/api/notes/recording*', (r) => r.fulfill({ status: 200, contentType: 'audio/wav', body: Buffer.alloc(0) }));
|
|
82
|
-
await page.route('**/api/notes/screen*', (r) => r.fulfill({ status: 200, contentType: 'image/png', body: PNG }));
|
|
83
|
-
await page.route('**/api/notes/series?*', (r) => json(r, { ok: true, series: { key: 'weekly-sync', meetings: [] } }));
|
|
84
|
-
await page.route('**/api/notes/one*', (r) => {
|
|
85
|
-
const id = new URL(r.request().url()).searchParams.get('id'); S.oneGets.push(id);
|
|
86
|
-
const n = S.out ? { ...note, series_pm: 'off' } : note;
|
|
87
|
-
return json(r, { ok: true, note: n, recording: { bytes: 64 }, screen: { frames: [{ t: 120000, why: 'A slide with the plan' }] }, place: S.out ? null : PLACE });
|
|
88
|
-
});
|
|
89
|
-
await page.route('**/api/notes/series-member', (r) => { const b = JSON.parse(r.request().postData() || '{}'); S.memberPosts.push(b); S.out = b.key === 'off'; return json(r, { ok: true }); });
|
|
90
|
-
await page.route(/\/api\/notes$/, (r) => json(r, { ok: true, notes }));
|
|
91
|
-
await page.route('**/api/plan-items*', (r) => {
|
|
92
|
-
const req = r.request();
|
|
93
|
-
if (req.method() === 'POST') { const b = JSON.parse(req.postData() || '{}'); S.planPosts.push(b); return json(r, { ok: true, written: [{ item: 'item-9' }] }); }
|
|
94
|
-
return json(r, { ok: true, stages: [{ id: 'st1', label: 'Intake' }] });
|
|
95
|
-
});
|
|
96
|
-
await page.goto(BASE + '/premium.html?theme=' + theme);
|
|
97
|
-
S.up = await until(() => page.evaluate(() => document.querySelectorAll('#rank .rr').length > 0 && document.querySelectorAll('#tl .ev').length > 0), 20000);
|
|
98
|
-
await until(() => page.evaluate(() => document.querySelectorAll('#wkStrip [data-day]').length === 5));
|
|
99
|
-
await page.evaluate(() => { const r = [...document.querySelectorAll('#tl .ev')].find((e) => e.querySelector('b').textContent === 'Weekly sync'); r.click(); });
|
|
100
|
-
S.dlg = await until(() => page.evaluate(() => document.querySelector('#dlg').classList.contains('on') && !!document.querySelector('#oMain .vm-part')));
|
|
101
|
-
SESS.push(S);
|
|
102
|
-
return Object.assign(S, { ctx, page });
|
|
103
|
-
};
|
|
104
|
-
const part = (p, k) => p.evaluate((x) => { const e = document.querySelector(`#oMain .vm-body[data-part="${x}"]`); return e ? { shown: e.open, text: e.textContent } : null; }, k);
|
|
105
|
-
const stage = async (p, k) => { if (!((await part(p, k)) || {}).shown) await p.click(`#oMain .vm-body[data-part="${k}"] > summary`); await until(async () => ((await part(p, k)) || {}).shown); };
|
|
106
|
-
const more = async (p) => { if (!(await p.evaluate(() => document.querySelector('#oMain .vm-menu').open))) await p.click('#oMain .vm-menu > summary'); };
|
|
107
|
-
|
|
108
|
-
const A = await open();
|
|
109
|
-
ok('0 the meeting dialog opens with its parts in one scroll', A.up && A.dlg);
|
|
110
|
-
if (!A.up || !A.dlg) return finish(1);
|
|
42
|
+
/* an ended meeting with notes */
|
|
43
|
+
const A = await F.open(browser, BASE, '/premium-viewer.html?open=meeting¬e=n1');
|
|
111
44
|
const p = A.page;
|
|
45
|
+
const up = await until(() => p.evaluate(() => !!document.querySelector('#czViewer .vz-mtg[data-mk="notes"]') && /Notes and next steps/.test(document.body.innerText)), 15000);
|
|
46
|
+
ok('0 the meeting opens in the Viewer card on its own page', up);
|
|
47
|
+
if (!up) return finish(1);
|
|
112
48
|
|
|
113
|
-
/* S1
|
|
114
|
-
|
|
115
|
-
ok('S1
|
|
116
|
-
ok('S1
|
|
117
|
-
ok('S1 the note was read from GET /api/notes/one
|
|
49
|
+
/* S1 parts */
|
|
50
|
+
ok('S1 three parts in the order Prep, Transcript, Notes; Notes open for an ended meeting', await parts(p) === 'prep:false,live:false,notes:true', await parts(p));
|
|
51
|
+
ok('S1 each part has a sub-line', await p.evaluate(() => [...document.querySelectorAll('#czViewer .vz-ph small')].every((s) => s.textContent.trim().length > 3)));
|
|
52
|
+
ok('S1 no tabs, no Detail or Conversation switch, no #dlg', await p.evaluate(() => !document.querySelector('#czViewer [role="tablist"], #dlg, #dTabs, .stream')));
|
|
53
|
+
ok('S1 the note was read from GET /api/notes/one', A.S.gets.some((g) => g.startsWith('/api/notes/one?id=n1')));
|
|
118
54
|
|
|
119
55
|
/* S2 the head */
|
|
120
|
-
const head = await p.evaluate(() => ({
|
|
121
|
-
ok('S2
|
|
122
|
-
|
|
123
|
-
ok('S2 the
|
|
124
|
-
|
|
56
|
+
const head = await p.evaluate(() => ({ chip: document.querySelector('#czViewer .vz-chip').textContent, ppl: document.querySelector('#czViewer [data-a="ppl"]').textContent, pri: (document.querySelector('#czViewer .vz-pri') || {}).textContent || '', r2: document.querySelector('#czViewer .vz-r2').textContent, kind: document.querySelector('#czViewer .cz-vw-kind').textContent, open: (document.querySelector('#czViewer [data-cz-vw="open"]') || document.querySelector('#czViewer .cz-vw-hd button')).disabled }));
|
|
57
|
+
ok('S2 row 1: Done, 3 people, Replay, ⋯', head.chip === 'Done' && /3 people/.test(head.ppl) && head.pri === 'Replay' && await p.evaluate(() => !!document.querySelector('#czViewer [data-a="more"]')), JSON.stringify(head));
|
|
58
|
+
ok('S2 row 2: the time, About Viewer and the series 4 of 4', /to/.test(head.r2) && /About Viewer/.test(head.r2) && /Viewer sync · 4 of 4/.test(head.r2), head.r2);
|
|
59
|
+
ok('S2 the header kind is Meeting notes', head.kind === 'Meeting notes', head.kind);
|
|
60
|
+
await press(p, '[data-a="ppl"]');
|
|
61
|
+
ok('S2 the people chip lists them', /Ana/.test(await body(p)) && /Dita/.test(await body(p)));
|
|
62
|
+
await press(p, '[data-a="more"]');
|
|
63
|
+
const menu = await p.evaluate(() => [...document.querySelectorAll('#czViewer .vz-menu b')].map((b) => b.textContent));
|
|
64
|
+
ok('S2 ⋯ holds Focus, Change what it is about, Copy as Markdown, New meeting, Not part of this series, What Record and Focus do', ['Focus', 'about', 'Markdown', 'New meeting', 'series', 'Record'].every((w) => menu.some((m) => m.includes(w))), menu.join(' | '));
|
|
65
|
+
ok('S2 each menu item has a sub-line', await p.evaluate(() => [...document.querySelectorAll('#czViewer .vz-menu small')].every((s) => s.textContent.trim())));
|
|
66
|
+
await p.context().grantPermissions(['clipboard-read', 'clipboard-write']).catch(() => {});
|
|
67
|
+
await press(p, '[data-a="m-copy"]');
|
|
68
|
+
const clip = await until(() => p.evaluate(() => navigator.clipboard.readText().catch(() => '')));
|
|
69
|
+
ok('S2 Copy as Markdown copies the notes', /^# Viewer sync/.test(clip || '') && /Diffs can be approved/.test(clip || ''), String(clip).slice(0, 200));
|
|
125
70
|
|
|
126
71
|
/* S3 After */
|
|
127
|
-
const
|
|
128
|
-
ok('S3
|
|
129
|
-
ok('S3 the summary, the
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
ok('S3 the
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
await p
|
|
137
|
-
await until(() =>
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
await
|
|
146
|
-
|
|
147
|
-
ok('
|
|
148
|
-
const prep = await until(() => p.evaluate(() => { const b = document.querySelector('#oMain .vm-body[data-part="before"] [data-vm-prep]'); return b ? b.textContent : ''; }));
|
|
149
|
-
ok('S5 Before opens with the meeting prep the console card shows: In short and What matters today; the note already carries in the meeting before', /In short/.test(prep) && /Agree what blocks the release/.test(prep) && /What matters today/.test(prep) && /Ship the SSO spike/.test(prep) && !/Since the last one/.test(prep), String(prep).slice(0, 200));
|
|
150
|
-
ok('S5 Before keeps Prepared for you and Material', /Prepared for you/.test(bf) && /Material/.test(bf) && await p.evaluate(() => !!document.querySelector('#mmAdd') && !!document.querySelector('#mmAdd').offsetParent));
|
|
151
|
-
ok('S1 opening a part keeps the others as they were, and a redraw keeps what was opened', await p.evaluate(() => document.querySelector('#oMain .vm-body[data-part="before"]').open && document.querySelector('#oMain .vm-body[data-part="after"]').open));
|
|
152
|
-
|
|
153
|
-
/* S6 During */
|
|
154
|
-
await stage(p, 'during');
|
|
155
|
-
const du = (await part(p, 'during')).text;
|
|
156
|
-
ok('S6 During lists the transcript with times and the speakers the note names', /01:01/.test(du) && /Dara/.test(du) && /The migration check status is not started\./.test(du) && /You/.test(du), du.slice(0, 200));
|
|
157
|
-
await more(p);
|
|
158
|
-
ok('S6 Focus and What Record and Focus do are in the More menu', await p.evaluate(() => !!document.querySelector('#oMain .vm-menu [data-m3="focus"]').offsetParent && !!document.querySelector('#oMain .vm-menu [data-m3="why"]').offsetParent));
|
|
159
|
-
await p.click('#oMain .vm-menu [data-m3="why"]');
|
|
160
|
-
ok('S6 What Record and Focus do opens both explanations and closes the menu', await until(() => p.evaluate(() => { const w = document.querySelector('#oMain .acts2 > .why'); return w && !w.hidden && /microphone/.test(w.textContent) && /every 3 seconds/.test(w.textContent) && !document.querySelector('#oMain .vm-menu').open; })));
|
|
72
|
+
const after = await body(p);
|
|
73
|
+
ok('S3 the replay track with its screen thumbnails', await p.evaluate(() => !!document.querySelector('#czViewer .vz-trk') && document.querySelectorAll('#czViewer .vz-shot').length === 3));
|
|
74
|
+
ok('S3 the summary, Since the last one, decisions and next steps', /opens next to the chat/.test(after) && /Since the last one/.test(after) && /Raised again/.test(after) && /Diffs can be approved/.test(after) && /Add a print view/.test(after), after.slice(0, 400));
|
|
75
|
+
ok('S3 Facts mentioned: Matches and Not checked', /Facts mentioned/.test(after) && /Matches/.test(after) && /Not checked/.test(after));
|
|
76
|
+
await press(p, '[data-a="more"]'); // Full replay is the last item of the ⋯ menu (the mockup's replay well has no row for it)
|
|
77
|
+
ok('S3 Full replay is in the menu, marked Waiting for design', await p.evaluate(() => { const b = document.querySelector('#czViewer .vz-menu [data-a="m-replay"]'); return !!b && b.dataset.czPlaceholder === 'Full Replay view' && b === [...document.querySelectorAll('#czViewer .vz-menu [data-a]')].pop(); }));
|
|
78
|
+
await press(p, '[data-a="more"]');
|
|
79
|
+
await press(p, '[data-a="tr"]');
|
|
80
|
+
ok('S3 the transcript toggle shows the lines, Dita named', await until(async () => /The Viewer sits beside the chat now/.test(await body(p)) && /Dita/.test(await body(p))));
|
|
81
|
+
await press(p, '[data-a="seekto"]');
|
|
82
|
+
ok('S3 a thumbnail moves the replay to its time', await until(() => p.evaluate(() => /^03:10 of/.test((document.querySelector('#czViewer [data-clk="pos"]') || {}).textContent || ''))));
|
|
83
|
+
|
|
84
|
+
/* S4 Make task: a work-item becomes V.4 Drafted in PMOS */
|
|
85
|
+
await press(p, '[data-a="task"][data-i="0"]');
|
|
86
|
+
ok('S4 Make task offers A task or A work-item', await p.evaluate(() => !!document.querySelector('#czViewer [data-a="maketask"]') && !!document.querySelector('#czViewer [data-a="makewi"]')));
|
|
87
|
+
await press(p, '[data-a="makewi"][data-i="0"]');
|
|
88
|
+
ok('S4 a work-item posts the step to /api/viewer-meeting/work-item', await until(() => A.S.posts.some((x) => x.path === '/api/viewer-meeting/work-item' && x.body.note === 'n1' && x.body.step.text === 'Add a print view for documents')), JSON.stringify(A.S.posts));
|
|
89
|
+
ok('S4 the step says Becomes V.4, and the message names the Commit gate', await until(async () => /Becomes V\.4/.test(await body(p)) && /Commit gate/.test(await body(p))), (await body(p)).slice(0, 300));
|
|
90
|
+
await press(p, '[data-a="task"][data-i="1"]');
|
|
91
|
+
await press(p, '[data-a="maketask"][data-i="1"]');
|
|
92
|
+
ok('S4 A task writes one plan item for the step', await until(() => A.S.posts.some((x) => x.path === '/api/plan-items' && JSON.stringify(x.body).includes('Move saved views'))));
|
|
161
93
|
|
|
162
94
|
/* S7 series membership */
|
|
163
|
-
await
|
|
164
|
-
await
|
|
165
|
-
ok('S7 Not part of this series posts
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
await
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
await
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
ok('
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
await
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
})().catch((e) => { console.error(e); finish(1); });
|
|
95
|
+
await press(p, '[data-a="more"]');
|
|
96
|
+
await press(p, '[data-a="m-serout"]');
|
|
97
|
+
ok('S7 Not part of this series posts key off', await until(() => A.S.posts.some((x) => x.path === '/api/notes/series-member' && x.body.key === 'off')));
|
|
98
|
+
|
|
99
|
+
/* S9 writes: only the presses */
|
|
100
|
+
const allowed = ['/api/viewer-meeting/work-item', '/api/plan-items', '/api/notes/series-member'];
|
|
101
|
+
ok('S9 the page wrote only what was pressed', A.S.posts.every((x) => allowed.includes(x.path)), JSON.stringify(A.S.posts.map((x) => x.path)));
|
|
102
|
+
ok('S9 no page error', A.errors.length === 0, A.errors.join(' | '));
|
|
103
|
+
await A.ctx.close();
|
|
104
|
+
|
|
105
|
+
/* S5 Before: a meeting to come, no note */
|
|
106
|
+
const B = await F.open(browser, BASE, '/premium-viewer.html?open=meeting&event=ev-rail&date=' + F.dayKey(F.world().RAIL), { scene: 'prep' });
|
|
107
|
+
const q = B.page;
|
|
108
|
+
const prepUp = await until(() => q.evaluate(() => !!document.querySelector('#czViewer .vz-mtg[data-mk="prep"]')), 15000);
|
|
109
|
+
ok('S5 a meeting to come opens on Prep', prepUp && await parts(q) === 'prep:true,live:false,notes:false', await parts(q));
|
|
110
|
+
const pre = await body(q);
|
|
111
|
+
ok('S5 Prepared for you, What matters today, Agenda with minutes, Material', /Prepared for you/.test(pre) && /What matters today/.test(pre) && /Agenda/.test(pre) && /10 min/.test(pre) && /Rail PRD/.test(pre), pre.slice(0, 500));
|
|
112
|
+
ok('S5 the chip says Starts in about 30 min', /Starts in (29|30|31) min/.test(await q.textContent('#czViewer .vz-chip')), await q.textContent('#czViewer .vz-chip'));
|
|
113
|
+
await q.$eval('#czViewer [data-a="min"][data-i="1"]', (b) => b.click());
|
|
114
|
+
await until(() => q.evaluate(() => !!document.querySelector('#czViewer [data-a="minin"]')));
|
|
115
|
+
await q.fill('#czViewer [data-a="minin"]', '15'); await q.press('#czViewer [data-a="minin"]', 'Enter');
|
|
116
|
+
ok('S5 changing a topic\'s minutes posts them to /api/viewer-meeting/agenda', await until(() => B.S.posts.some((x) => x.path === '/api/viewer-meeting/agenda' && x.body.min === 15)), JSON.stringify(B.S.posts));
|
|
117
|
+
await q.$eval('#czViewer [data-a="addmat"]', (b) => b.click());
|
|
118
|
+
ok('S5 Add material opens its minimal sheet, marked Waiting for design', await until(() => q.evaluate(() => !!document.querySelector('#czViewer [data-cz-placeholder="Add material"]'))));
|
|
119
|
+
await B.ctx.close();
|
|
120
|
+
|
|
121
|
+
/* S6 During: a note that records */
|
|
122
|
+
const C = await F.open(browser, BASE, '/premium-viewer.html?open=meeting¬e=n2', { init: () => { window.__premiumHolding = { id: 'n2' }; } });
|
|
123
|
+
const r = C.page;
|
|
124
|
+
const liveUp = await until(() => r.evaluate(() => !!document.querySelector('#czViewer .vz-mtg[data-mk="live"]')), 15000);
|
|
125
|
+
ok('S6 a recording note opens on the Transcript part', liveUp && await parts(r) === 'prep:false,live:true,notes:false', await parts(r));
|
|
126
|
+
const lv = await body(r);
|
|
127
|
+
ok('S6 the bar, the audio source line, Pause shots and Private', /Recording · /.test(lv) && /Listening to Zoom app/.test(lv) && /Pause shots/.test(lv) && /Private: keep only what I type/.test(lv), lv.slice(0, 400));
|
|
128
|
+
ok('S6 Now on with the topic bars, Caught so far, Highlights', /Now on/.test(lv) && await r.evaluate(() => document.querySelectorAll('#czViewer .vz-stretch rect').length === 3) && /Caught so far: 1 decision, 2 next steps/.test(lv) && /Highlights/.test(lv) && /Issue is the blue button/.test(lv));
|
|
129
|
+
await r.$eval('#czViewer [data-a="shots"]', (b) => b.click());
|
|
130
|
+
ok('S6 Pause shots posts shots paused for the note', await until(() => C.S.posts.some((x) => x.path === '/api/viewer-meeting/capture' && x.body.id === 'n2' && x.body.shots === 'paused')));
|
|
131
|
+
await r.$eval('#czViewer [data-a="src"]', (b) => b.click());
|
|
132
|
+
await r.$eval('#czViewer [data-a="app"][data-id="meet"]', (b) => b.click());
|
|
133
|
+
ok('S6 picking where the meeting is posts the app', await until(() => C.S.posts.some((x) => x.path === '/api/viewer-meeting/capture' && x.body.app === 'meet')));
|
|
134
|
+
await r.$eval('#czViewer .vz-who', (b) => b.click());
|
|
135
|
+
await until(() => r.evaluate(() => !!document.querySelector('#czViewer [data-a="namein"]')));
|
|
136
|
+
await r.fill('#czViewer [data-a="namein"]', 'Ana Lima'); await r.$eval('#czViewer [data-a="nameok"]', (b) => b.click());
|
|
137
|
+
ok('S6 naming a speaker posts the name for the line\'s source', await until(() => C.S.posts.some((x) => x.path === '/api/notes/speaker' && x.body.name === 'Ana Lima' && x.body.id === 'n2')), JSON.stringify(C.S.posts.slice(-2)));
|
|
138
|
+
await C.ctx.close();
|
|
139
|
+
|
|
140
|
+
/* S8 a note that is not there */
|
|
141
|
+
const D = await F.open(browser, BASE, '/premium-viewer.html?open=meeting¬e=nope');
|
|
142
|
+
ok('S8 a note that is not there says so, and the card still opens', await until(() => D.page.evaluate(() => !!document.querySelector('#czViewer') && /Untitled note|could not|not/.test(document.querySelector('#czViewer').innerText))));
|
|
143
|
+
await D.ctx.close();
|
|
144
|
+
|
|
145
|
+
/* S10 floors: a phone, and no old layout */
|
|
146
|
+
const E = await F.open(browser, BASE, '/premium-viewer.html?open=meeting¬e=n1', { w: 390, h: 844 });
|
|
147
|
+
await until(() => E.page.evaluate(() => !!document.querySelector('#czViewer .vz-mtg')), 15000);
|
|
148
|
+
const fl = await E.page.evaluate(() => ({ over: document.documentElement.scrollWidth - innerWidth, full: (() => { const r = document.querySelector('#czViewer').getBoundingClientRect(); return r.left === 0 && Math.round(r.width) === innerWidth; })(),
|
|
149
|
+
c3: [...document.querySelectorAll('script[src],link[href]')].some((x) => /c3-/.test(x.src || x.href)), tabs: !!document.querySelector('#czViewer [role="tablist"]') }));
|
|
150
|
+
ok('S10 on a phone the card is the whole screen with no sideways scroll and no Detail/Conversation tabs', fl.over <= 0 && fl.full && !fl.tabs, JSON.stringify(fl));
|
|
151
|
+
ok('S10 no c3 file is loaded', !fl.c3);
|
|
152
|
+
ok('S10 no page error on the phone', E.errors.length === 0, E.errors.join(' | '));
|
|
153
|
+
await E.ctx.close();
|
|
154
|
+
finish();
|
|
155
|
+
})();
|