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,22 +1,20 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
|
-
/* premium-vw-rec-test.js — note recording in the
|
|
4
|
-
* real
|
|
5
|
-
* stand-in that makes the same requests the console's recorder makes (record, pause,
|
|
6
|
-
*
|
|
3
|
+
/* premium-vw-rec-test.js — note recording in the Viewer's meeting card (initiative premium-viewer, S4; re-pointed for premium-agreed-design, area viewer:
|
|
4
|
+
* Main.dc.html AgMeetLive). Serves the real /premium-viewer.html from the real server; the notes, the calendar and Focus are answered by stand-ins
|
|
5
|
+
* (fixtures/premium-viewer-fixtures.js), and the recorder is a stand-in that makes the same requests the console's recorder makes (record, pause,
|
|
6
|
+
* stop) and opens no microphone. The routes' own behaviour is in their own suites.
|
|
7
|
+
* R1 Record (consent, then start) · R2 the live chip and Highlight · R3 the live notes (your notes, Private, Pause, Stop) · R4 Focus · R5 New note · R6 floors
|
|
7
8
|
* Every wait polls the page; no fixed sleep stands in for a state. */
|
|
8
9
|
const path = require('path');
|
|
9
10
|
const { spawn } = require('child_process');
|
|
10
11
|
const { findBrowser } = require('./lib/find-browser');
|
|
11
12
|
const T = require('./test-run').configure({ name: 'premium-vw-rec' });
|
|
12
|
-
const
|
|
13
|
-
const F = require('./fixtures/briefing-premium-facts.js');
|
|
13
|
+
const F = require('./fixtures/premium-viewer-fixtures.js');
|
|
14
14
|
|
|
15
|
-
const BASE = T.BASE;
|
|
16
|
-
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
17
|
-
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); } };
|
|
15
|
+
const BASE = T.BASE, until = F.until;
|
|
18
16
|
const results = [];
|
|
19
|
-
const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + extra : ''}`); };
|
|
17
|
+
const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + String(extra).slice(0, 500) : ''}`); };
|
|
20
18
|
let srv = null; let browser = null;
|
|
21
19
|
const finish = async (code) => {
|
|
22
20
|
if (browser) await browser.close().catch(() => {});
|
|
@@ -28,42 +26,6 @@ const finish = async (code) => {
|
|
|
28
26
|
};
|
|
29
27
|
process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
30
28
|
|
|
31
|
-
const pad = (n) => String(n).padStart(2, '0');
|
|
32
|
-
const dayKey = (d) => `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`;
|
|
33
|
-
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)}`; };
|
|
34
|
-
const NOW = new Date();
|
|
35
|
-
const midnight = new Date(NOW.getFullYear(), NOW.getMonth(), NOW.getDate());
|
|
36
|
-
const monday = () => { const d = new Date(midnight); d.setDate(d.getDate() - ((d.getDay() + 6) % 7)); return d; };
|
|
37
|
-
/* "Live review" is under way now (it starts at most 10 minutes ago, never before midnight), so the Record menu lists it. */
|
|
38
|
-
const START = new Date(Math.max(midnight.getTime(), Math.floor((NOW.getTime() - 10 * 60000) / 60000) * 60000)), END = new Date(START.getTime() + 60 * 60000);
|
|
39
|
-
const weekAnswer = (none) => {
|
|
40
|
-
const m = monday(), cells = [];
|
|
41
|
-
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: [] }); }
|
|
42
|
-
if (!none) cells.find((c) => c.key === dayKey(START)).events.push({ id: 'ev-live', at: iso(START), end: iso(END), title: 'Live review', attendees: ['Priya', 'Dara'] });
|
|
43
|
-
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: [] };
|
|
44
|
-
};
|
|
45
|
-
const FOCUS = () => ({ ok: true, now_ms: Date.now(), date: dayKey(NOW), event: { id: 'ev-live', title: 'Live review', at: iso(START), end: iso(END), attendees: ['Priya', 'Dara'] },
|
|
46
|
-
note: { id: 'n1', title: 'Live review', state: 'recording', lines: 3 }, topics: [{ id: 'capacity', text: 'Capacity', state: 'discussed', minutes: 4 }, { id: 'risks', text: 'Risks', state: 'now', minutes: 2 }],
|
|
47
|
-
runs: [{ topic: 'capacity', from_min: 0, to_min: 4 }, { topic: 'risks', from_min: 4, to_min: null }], gist: 'The room is weighing the risks to the date.', chips: [], tail: [{ who: 'Dara', text: 'Next the risks' }],
|
|
48
|
-
captured: { decisions: [{ text: 'Plan with eight people' }], actions: [], questions: [] }, material: [{ title: 'Q4 deck', kind: 'pmos-deck', ref: 'reports/q4', topic: 'Risks' }, { title: 'Wiki page', kind: 'link', url: 'https://x.example/w' }],
|
|
49
|
-
companion: { on: true, running: false, error: null } });
|
|
50
|
-
|
|
51
|
-
/* the stand-in recorder: the console's recorder makes these same requests; this one opens no microphone */
|
|
52
|
-
const RECORDER = () => {
|
|
53
|
-
window.__premiumRecorder = {
|
|
54
|
-
_id: null, _started: null, _banner: null, _hl: 0,
|
|
55
|
-
async listen(id) {
|
|
56
|
-
const r = await fetch('/api/notes/record', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ id }) }).then((x) => x.json());
|
|
57
|
-
if (!r.ok) { this._banner = r.error; return false; }
|
|
58
|
-
this._id = id; this._started = Date.now() - 65000; return true;
|
|
59
|
-
},
|
|
60
|
-
async pause() { await fetch('/api/notes/pause', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ id: this._id }) }); this._id = null; },
|
|
61
|
-
async stop(id) { await fetch('/api/notes/stop', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ id }) }); this._id = null; return { discarded: false }; },
|
|
62
|
-
highlight() { this._hl++; return true; }, highlighting() { return this._hl ? { state: 'listening', open: true } : null; },
|
|
63
|
-
listening() { return this._id; }, started() { return this._started; }, banner() { const b = this._banner; this._banner = null; return b; },
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
|
|
67
29
|
(async () => {
|
|
68
30
|
const exe = findBrowser();
|
|
69
31
|
if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the suite cannot run'); return finish(1); }
|
|
@@ -72,155 +34,72 @@ const RECORDER = () => {
|
|
|
72
34
|
srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
|
|
73
35
|
await T.waitForServer(BASE);
|
|
74
36
|
browser = await chromium.launch({ executablePath: exe });
|
|
37
|
+
const W = F.world();
|
|
38
|
+
const tap = (p, sel) => p.$eval('#czViewer ' + sel, (b) => b.click());
|
|
39
|
+
const text = (p) => p.evaluate(() => (document.querySelector('#czViewer') || {}).innerText || '');
|
|
40
|
+
const posted = (S, pth) => S.posts.filter((x) => x.path === pth);
|
|
75
41
|
|
|
76
|
-
|
|
77
|
-
const
|
|
78
|
-
const open = async ({ w = 1280, h = 900, theme = 'light', notes = [], url = '/premium.html', none = false } = {}) => {
|
|
79
|
-
const ctx = await browser.newContext({ viewport: { width: w, height: h } });
|
|
80
|
-
const page = await ctx.newPage();
|
|
81
|
-
const S = { errors: [], reqs: [], notes: notes.map((n) => ({ ...n })), newPosts: [], recPosts: [], pausePosts: [], stopPosts: [], savePosts: [], privPosts: [], focusGets: 0 };
|
|
82
|
-
page.on('pageerror', (e) => S.errors.push(String((e && e.message) || e)));
|
|
83
|
-
page.on('dialog', (d) => d.dismiss());
|
|
84
|
-
page.on('request', (r) => { if (r.url().startsWith(BASE)) S.reqs.push(r.method() + ' ' + new URL(r.url()).pathname); });
|
|
85
|
-
const noteBy = (id) => S.notes.find((n) => n.id === id);
|
|
86
|
-
const body = (r) => JSON.parse(r.request().postData() || '{}');
|
|
87
|
-
await page.route('**/api/briefing-premium*', (r) => json(r, { ok: true, state: 'ready', model: B.build(facts()), as_of: Date.now() }));
|
|
88
|
-
await page.route('**/api/calendar-views*', (r) => json(r, weekAnswer(none)));
|
|
89
|
-
await page.route('**/api/meeting-replay*', (r) => json(r, { ok: false, error: 'none' }, 404));
|
|
90
|
-
await page.route('**/api/meeting-material*', (r) => json(r, { ok: true, key: 'k', items: [] }));
|
|
91
|
-
await page.route('**/api/notes/one*', (r) => {
|
|
92
|
-
const n = noteBy(new URL(r.request().url()).searchParams.get('id'));
|
|
93
|
-
if (!n) return json(r, { ok: false, error: 'no such note' }, 404);
|
|
94
|
-
return json(r, { ok: true, note: { body: '', speakers: { system: 'Dara' }, transcript: [{ t: 4000, source: 'mic', text: 'Welcome everyone' }, { t: 9000, source: 'system', text: 'We plan eight people' }], highlights: [{ id: 'h1', text: 'Plan with eight people', from: 61000, cat: 'decision' }], ...n }, screen: { frames: [] } });
|
|
95
|
-
});
|
|
96
|
-
await page.route('**/api/notes/new', (r) => {
|
|
97
|
-
const b = body(r); S.newPosts.push(b);
|
|
98
|
-
const m = b.meeting || null;
|
|
99
|
-
let n = m ? S.notes.find((x) => x.meeting && x.meeting.event_id === m.event_id) : null;
|
|
100
|
-
if (!n) { n = { id: 'n' + (S.notes.length + 1), title: (m && m.title) || '', state: 'idle', updated_at: new Date().toISOString(), meeting: m ? { kind: 'event', event_id: m.event_id, start: m.start, title: m.title } : null }; S.notes.push(n); }
|
|
101
|
-
return json(r, { ok: true, note: n, reused: false });
|
|
102
|
-
});
|
|
103
|
-
await page.route('**/api/notes/record', (r) => { const b = body(r); S.recPosts.push(b); noteBy(b.id).state = 'recording'; return json(r, { ok: true }); });
|
|
104
|
-
await page.route('**/api/notes/pause', (r) => { const b = body(r); S.pausePosts.push(b); const n = noteBy(b.id); if (n) { n.state = 'paused'; n.resume_until = new Date(Date.now() + 3600000).toISOString(); } return json(r, { ok: true }); });
|
|
105
|
-
await page.route('**/api/notes/stop', (r) => { const b = body(r); S.stopPosts.push(b); const n = noteBy(b.id); if (n) n.state = 'ended'; return json(r, { ok: true }); });
|
|
106
|
-
await page.route('**/api/notes/save', (r) => { const b = body(r); S.savePosts.push(b); const n = noteBy(b.id); if (n) n.body = b.body; return json(r, { ok: true }); });
|
|
107
|
-
await page.route('**/api/notes/private', (r) => { const b = body(r); S.privPosts.push(b); const n = noteBy(b.id); if (n) n.private = !!b.private; return json(r, { ok: true, private: !!b.private }); });
|
|
108
|
-
await page.route(/\/api\/notes$/, (r) => json(r, { ok: true, notes: S.notes }));
|
|
109
|
-
await page.route(/\/api\/meeting-focus(\?|$)/, (r) => { S.focusGets++; return json(r, FOCUS()); });
|
|
110
|
-
await page.route('**/api/calendar-links', (r) => json(r, { ok: true }));
|
|
111
|
-
await page.addInitScript(RECORDER);
|
|
112
|
-
await page.goto(BASE + url + (url.includes('?') ? '&' : '?') + 'theme=' + theme);
|
|
113
|
-
if (url === '/premium.html') S.up = await until(() => page.evaluate(() => document.querySelectorAll('#rank .rr').length > 0 && !!document.querySelector('#recCtl')), 20000);
|
|
114
|
-
return Object.assign(S, { ctx, page });
|
|
115
|
-
};
|
|
116
|
-
const chip = (p) => p.evaluate(() => { const c = document.querySelector('#recChip'); return c && !c.hidden ? c.textContent : null; });
|
|
117
|
-
const tabs = (p) => p.evaluate(() => [...document.querySelectorAll('#vTabs .vtab')].map((t) => t.textContent.trim()).join('|'));
|
|
118
|
-
const pane = (p, id) => p.evaluate((x) => { const e = document.querySelector(`#dOut .obody.vw[data-vw="${x}"]`); return e && !e.hidden ? e.textContent : ''; }, id);
|
|
119
|
-
|
|
120
|
-
/* a new note: the mic lists today's meetings and New note, or with no meeting asks for a new note at once */
|
|
121
|
-
const newNote = async (pg) => { await pg.click('#recCtl [data-rc="mic"]'); await until(() => pg.evaluate(() => !!document.querySelector('#recCtl [data-rc="new"], #recCtl [data-rc="go"]'))); if (await pg.$('#recCtl .recm [data-rc="new"]')) await pg.click('#recCtl .recm [data-rc="new"]'); await pg.click('#recCtl [data-rc="go"]'); };
|
|
122
|
-
|
|
123
|
-
/* R1 the Record control */
|
|
124
|
-
const A = await open();
|
|
125
|
-
ok('0 the Briefing opens with the Record control on its top bar', A.up);
|
|
126
|
-
if (!A.up) return finish(1);
|
|
42
|
+
/* R1 Record: a meeting on now with no note */
|
|
43
|
+
const A = await F.open(browser, BASE, '/premium-viewer.html?open=meeting&event=ev-live&date=' + F.dayKey(W.LIVE), { noLive: true });
|
|
127
44
|
const p = A.page;
|
|
128
|
-
ok('R1
|
|
129
|
-
|
|
130
|
-
await p
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
ok('R1
|
|
134
|
-
await p.
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
ok('R3
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
ok('R3
|
|
148
|
-
await p
|
|
149
|
-
|
|
150
|
-
await
|
|
151
|
-
|
|
152
|
-
await
|
|
153
|
-
ok('R3
|
|
154
|
-
|
|
155
|
-
await p.evaluate(() => document.querySelector('#vTabs .vtab').click());
|
|
156
|
-
const dur = await until(() => p.evaluate(() => { const b = document.querySelector('#oMain .vm-body[data-part="during"]'); return b && b.open && b.querySelector('[data-rv-stage] .rvh') ? b.textContent : ''; }));
|
|
157
|
-
ok('R3 the meeting detail opens on During, and During is the live capture: Recording, Highlight, Pause, Stop and your notes', /Recording/.test(dur) && /Highlight/.test(dur) && /Pause/.test(dur) && /Stop/.test(dur) && /Your notes/.test(dur) && await p.evaluate(() => !document.querySelector('#oMain .rvt')), dur.slice(0, 200));
|
|
158
|
-
ok('R3 the During stage and the Live notes tab each label their own notes box', await p.evaluate(() => { const ids = [...document.querySelectorAll('#dOut [data-rv-mine]')].map((t) => t.id); return ids.length === 2 && ids[0] !== ids[1] && ids.every((i) => !!document.querySelector(`label[for="${i}"]`)); }));
|
|
159
|
-
|
|
160
|
-
/* R2 the chip on the Briefing (the dialog sits over it, so it is closed first) */
|
|
161
|
-
await p.keyboard.press('Escape'); await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on')));
|
|
162
|
-
const c1 = await until(async () => { const t = await chip(p); return t && /Recording Live review/.test(t) ? t : ''; });
|
|
163
|
-
ok('R2 the chip on the Briefing has Highlight, Pause, Focus, Open and Stop', await p.evaluate(() => ['hl', 'pause', 'fv', 'open', 'stop'].every((a) => !!document.querySelector(`#recChip [data-r="${a}"]`))), c1);
|
|
164
|
-
await p.click('#recChip [data-r="hl"]');
|
|
165
|
-
ok('R2 Highlight starts the recorder\'s highlight and says so', await until(async () => /Highlighting/.test((await chip(p)) || '')) && await p.evaluate(() => window.__premiumRecorder._hl === 1));
|
|
166
|
-
|
|
167
|
-
/* R4 Focus */
|
|
168
|
-
await p.click('#recChip [data-r="fv"]');
|
|
169
|
-
const fv = await until(async () => { const t = await pane(p, 'focus:n1'); return /Risks/.test(t) ? t : ''; });
|
|
170
|
-
ok('R4 Focus opens as a tab with the topic now, the sentence, the lines, the counts and the material', /Now/.test(fv) && /weighing the risks/.test(fv) && /Next the risks/.test(fv) && /Captured so far/.test(fv) && /Q4 deck/.test(fv) && /Wiki page/.test(fv), fv.slice(0, 300));
|
|
171
|
-
ok('R4 a PMOS deck has Present and Audience view; a link has Open', await p.evaluate(() => { const li = [...document.querySelectorAll('#dOut .fvst li')]; return li.length === 2 && !!li[0].querySelector('[data-fv="present"]') && !!li[0].querySelector('[data-fv="aud"]') && !!li[1].querySelector('[data-fv="open"]') && !li[1].querySelector('[data-fv="present"]'); }));
|
|
172
|
-
const g0 = A.focusGets;
|
|
173
|
-
ok('R4 Focus reads again every 3 seconds while its tab is shown', await until(() => A.focusGets >= g0 + 2, 9000), String(A.focusGets - g0));
|
|
174
|
-
await p.click('#vTabs .vtab[data-vw="rec:n1"]');
|
|
175
|
-
const g1 = A.focusGets; await sleep(4000);
|
|
176
|
-
ok('R4 Focus stops reading while its tab is hidden', A.focusGets <= g1 + 1, String(A.focusGets - g1));
|
|
177
|
-
|
|
178
|
-
/* R3 Pause, Resume, Stop from the tab */
|
|
179
|
-
await p.click('#dOut .obody.vw:not([hidden]) [data-rv="pause"]');
|
|
180
|
-
ok('R3 Pause pauses through the route and the tab says Paused with Resume', await until(() => A.pausePosts.length === 1) && await until(async () => /Paused/.test(await pane(p, 'rec:n1')) && /Resume/.test(await pane(p, 'rec:n1'))));
|
|
181
|
-
await p.click('#dOut .obody.vw:not([hidden]) [data-rv="resume"]');
|
|
182
|
-
ok('R3 Resume listens again on the same note without asking twice', await until(() => A.recPosts.length === 2) && A.newPosts.length === 1);
|
|
183
|
-
await until(async () => /Recording/.test(await pane(p, 'rec:n1')));
|
|
184
|
-
await p.click('#dOut .obody.vw:not([hidden]) [data-rv="stop"]');
|
|
185
|
-
ok('R3 Stop asks first and says a stopped meeting cannot be resumed', await until(async () => /cannot be resumed/.test(await pane(p, 'rec:n1'))) && A.stopPosts.length === 0);
|
|
186
|
-
await p.click('#dOut .obody.vw:not([hidden]) [data-rv="stopgo"]');
|
|
187
|
-
ok('R3 Stop for good ends it through the route, and the Record control comes back', await until(() => A.stopPosts.length === 1) && await until(() => p.evaluate(() => !document.querySelector('#recCtl').hidden)));
|
|
188
|
-
ok('R5 no page error on the Briefing', A.errors.length === 0, A.errors.join(' | '));
|
|
45
|
+
ok('R1 a meeting on now with no note shows Record in its head', await until(() => p.evaluate(() => (document.querySelector('#czViewer .vz-pri') || {}).dataset && document.querySelector('#czViewer .vz-pri').dataset.k === 'record'), 15000));
|
|
46
|
+
await tap(p, '[data-a="record"]');
|
|
47
|
+
ok('R1 Record asks first: tell everyone, then start', await until(async () => /Tell everyone first/.test(await text(p)) && !!(await p.$('#czViewer [data-a="recgo"]'))));
|
|
48
|
+
ok('R1 nothing is made before the second press', posted(A.S, '/api/notes/new').length === 0);
|
|
49
|
+
await tap(p, '[data-a="recgo"]');
|
|
50
|
+
ok('R1 I told them, start makes the note and starts the recorder', await until(() => posted(A.S, '/api/notes/new').length === 1 && posted(A.S, '/api/notes/record').length === 1), JSON.stringify(A.S.posts.map((x) => x.path)));
|
|
51
|
+
ok('R1 the card turns live: Recording, with Stop', await until(async () => (await p.textContent('#czViewer .vz-chip')) === 'Recording' && !!(await p.$('#czViewer .vz-pri[data-k="stop"]'))), 12000);
|
|
52
|
+
|
|
53
|
+
/* R2 Highlight */
|
|
54
|
+
await tap(p, '.vz-bar [data-a="hl"]');
|
|
55
|
+
ok('R2 Highlight starts the recorder\'s highlight', await until(() => p.evaluate(() => window.__premiumRecorder._hl === 1)));
|
|
56
|
+
|
|
57
|
+
/* R3 the live notes */
|
|
58
|
+
await p.fill('#czViewer [data-a="mine"]', 'Ask about the dates');
|
|
59
|
+
ok('R3 what you type is saved to the note', await until(() => posted(A.S, '/api/notes/save').some((x) => x.body.body === 'Ask about the dates')), JSON.stringify(posted(A.S, '/api/notes/save')));
|
|
60
|
+
await tap(p, '.vz-bar [data-a="pause"]');
|
|
61
|
+
ok('R3 Pause pauses the recorder (POST /api/notes/pause)', await until(() => posted(A.S, '/api/notes/pause').length === 1));
|
|
62
|
+
ok('R3 a paused note offers Resume, marked Waiting for design', await until(async () => !!(await p.$('#czViewer .vz-pri[data-k="resume"]')) && !!(await p.$('#czViewer [data-cz-placeholder="Paused and not-capturing states"]'))));
|
|
63
|
+
await tap(p, '.vz-pri[data-k="resume"]');
|
|
64
|
+
ok('R3 Resume records again', await until(() => posted(A.S, '/api/notes/record').length === 2));
|
|
65
|
+
await until(async () => !!(await p.$('#czViewer .vz-pri[data-k="stop"]')));
|
|
66
|
+
await tap(p, '.vz-pri[data-k="stop"]');
|
|
67
|
+
ok('R3 Stop asks first', await until(async () => /Stop for good/.test(await text(p))));
|
|
68
|
+
await tap(p, '[data-a="stopgo"]');
|
|
69
|
+
ok('R3 Stop and write the notes stops the recorder', await until(() => posted(A.S, '/api/notes/stop').length === 1));
|
|
70
|
+
ok('R3 no page error', A.errors.length === 0, A.errors.join(' | '));
|
|
189
71
|
await A.ctx.close();
|
|
190
72
|
|
|
191
|
-
/*
|
|
192
|
-
const
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
ok('
|
|
197
|
-
|
|
198
|
-
await
|
|
73
|
+
/* R3 Private on a recording note */
|
|
74
|
+
const B = await F.open(browser, BASE, '/premium-viewer.html?open=meeting¬e=n2', { init: () => { window.__premiumHolding = { id: 'n2' }; } });
|
|
75
|
+
const q = B.page;
|
|
76
|
+
await until(() => q.evaluate(() => !!document.querySelector('#czViewer [data-a="priv"]')), 15000);
|
|
77
|
+
await tap(q, '[data-a="priv"]');
|
|
78
|
+
ok('R3 Private asks first', await until(async () => /Make this note private/.test(await text(q))));
|
|
79
|
+
await tap(q, '[data-a="privgo"]');
|
|
80
|
+
ok('R3 Make it private posts private: true', await until(() => posted(B.S, '/api/notes/private').some((x) => x.body.id === 'n2' && x.body.private === true)));
|
|
199
81
|
|
|
200
|
-
/*
|
|
201
|
-
|
|
202
|
-
await
|
|
203
|
-
ok('
|
|
204
|
-
await
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
ok('
|
|
212
|
-
await
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
}
|
|
225
|
-
return finish();
|
|
226
|
-
})().catch((e) => { console.error(e); finish(1); });
|
|
82
|
+
/* R4 Focus */
|
|
83
|
+
await tap(q, '[data-a="more"]');
|
|
84
|
+
await tap(q, '[data-a="m-focus"]');
|
|
85
|
+
ok('R4 Focus opens its minimal view, marked Waiting for design, with the topics', await until(async () => !!(await q.$('#czViewer [data-cz-placeholder="Focus"]')) && /The Issue button/.test(await text(q))), (await text(q)).slice(0, 300));
|
|
86
|
+
await B.ctx.close();
|
|
87
|
+
|
|
88
|
+
/* R5 New note: an untitled note recorded at once */
|
|
89
|
+
const C = await F.open(browser, BASE, '/premium-viewer.html?open=calendar', { noLive: true });
|
|
90
|
+
const r = C.page;
|
|
91
|
+
await until(() => r.evaluate(() => !!document.querySelector('#czViewer [data-c="new"]')), 15000);
|
|
92
|
+
await tap(r, '[data-c="new"]');
|
|
93
|
+
ok('R5 New note makes an untitled note and records it', await until(() => posted(C.S, '/api/notes/new').some((x) => x.body.title === '') && posted(C.S, '/api/notes/record').length === 1), JSON.stringify(C.S.posts.map((x) => x.path)));
|
|
94
|
+
ok('R5 and opens it live in the card', await until(() => r.evaluate(() => !!document.querySelector('#czViewer .vz-mtg[data-mk="live"]'))));
|
|
95
|
+
ok('R5 window.czViews.newNote is registered for Home', await r.evaluate(() => typeof window.czViews.newNote === 'function'));
|
|
96
|
+
await C.ctx.close();
|
|
97
|
+
|
|
98
|
+
/* R6 floors */
|
|
99
|
+
const D = await F.open(browser, BASE, '/premium-viewer.html?open=meeting¬e=n2', { w: 390, h: 844, init: () => { window.__premiumHolding = { id: 'n2' }; } });
|
|
100
|
+
await until(() => D.page.evaluate(() => !!document.querySelector('#czViewer .vz-bar')), 15000);
|
|
101
|
+
const fl = await D.page.evaluate(() => ({ over: document.documentElement.scrollWidth - innerWidth, chip: !!document.querySelector('#recChip, #recCtl') }));
|
|
102
|
+
ok('R6 on a phone the live card has no sideways scroll, and no old round mic or record chip is drawn', fl.over <= 0 && !fl.chip, JSON.stringify(fl));
|
|
103
|
+
await D.ctx.close();
|
|
104
|
+
finish();
|
|
105
|
+
})();
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
|
-
/* premium-vw-slides-test.js — the slide editor in the
|
|
4
|
-
* A real server on a scratch git repository with two cycles
|
|
5
|
-
*
|
|
3
|
+
/* premium-vw-slides-test.js — the slide editor in the Viewer card (initiative premium-viewer, R-SL1, R6, R7; planning/prd/premium-viewer-prd.md;
|
|
4
|
+
* re-pointed for premium-agreed-design, area viewer: ReportPanel.dc.html in edit mode). A real server on a scratch git repository with two cycles
|
|
5
|
+
* of one report (one issued). /premium-viewer.html?open=report opens a cycle in the Viewer card; Edit mounts the slide editor in the card, and the
|
|
6
|
+
* panel's own toolbar (Undo, Redo, Insert, Layout, Theme, Cancel, Save) drives it; the editor is marked "Waiting for design". The presenter view
|
|
7
|
+
* (N4 to N11) is the editor's own Present: the panel has no entry to it yet, so those checks press the editor's button directly.
|
|
8
|
+
* Every save goes through the real POST /api/doc-sheet/edit and is read back from disk.
|
|
6
9
|
* O opening · E editing · S save and read back · H a hand edit wins · C a stale file · N Present · I issued · F floors
|
|
7
10
|
* Set SLIDES_SHOTS=<dir> to save screenshots at 1280 and 390 wide. Every wait polls the page; no fixed sleep stands in for a state. */
|
|
8
11
|
const fs = require('fs');
|
|
@@ -70,30 +73,26 @@ const disk = () => fs.readFileSync(path.join(dir, pNew), 'utf8');
|
|
|
70
73
|
p.on('request', (r) => { if (r.method() === 'POST') posts.push(new URL(r.url()).pathname); });
|
|
71
74
|
const shot = async (n) => { if (process.env.SLIDES_SHOTS) await p.screenshot({ path: path.join(process.env.SLIDES_SHOTS, n + '.png') }); };
|
|
72
75
|
const tap = (sel) => p.$eval(sel, (b) => b.click());
|
|
73
|
-
const V = '#
|
|
76
|
+
const V = '#czViewer [data-vz-ed]'; // Edit mounts the slide editor inside the Viewer card's report panel
|
|
77
|
+
const P = (k) => tap('#czViewer [data-r="' + k + '"]'); // a press on the panel's toolbar
|
|
74
78
|
const st = () => p.evaluate((pth) => { const S = window.__premiumSlides && window.__premiumSlides.state(pth); return S ? { i: S.i, n: S.deck.slides.length, theme: S.deck.theme, dirty: S.dirty, ro: S.ro, sel: S.sel, msg: S.msg, slides: JSON.parse(JSON.stringify(S.deck.slides)) } : null; }, pNew);
|
|
75
79
|
const openReader = async (slot) => {
|
|
76
|
-
await p.goto(BASE + '/premium-
|
|
77
|
-
|
|
78
|
-
if (await p.locator('#listSeg').isHidden()) await tap('#listF'); await tap('#listSeg [data-f="rep"]'); // the one list (insights-one-list L5): the Reports filter holds the report files
|
|
79
|
-
await until(() => p.evaluate(() => document.querySelectorAll('#listRows [data-rpt]').length === 1)); // one row per report (PM 2026-10-22); it opens the latest cycle
|
|
80
|
-
await tap(`#listRows [data-rpt="${CAD}"]`);
|
|
81
|
-
await until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('on') && !!document.querySelector('#rdSlide')));
|
|
82
|
-
if (slot !== '2026-10-12') { await tap('#dSub [data-rr="cycm"]'); await tap(`#dSub [data-rr="cyc|${RDraft.draftPath(dir, CAD, slot)}"]`); await until(() => p.evaluate(() => /issued/.test(document.querySelector('#dEye').textContent))); }
|
|
83
|
-
return until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('on') && !!document.querySelector('#rdSlide')));
|
|
80
|
+
await p.goto(BASE + '/premium-viewer.html?open=report&path=' + encodeURIComponent(RDraft.draftPath(dir, CAD, slot)));
|
|
81
|
+
return until(() => p.evaluate(() => !!document.querySelector('#czViewer .vz-rp0 .vz-slide')));
|
|
84
82
|
};
|
|
85
83
|
const openEditor = async () => {
|
|
86
|
-
await
|
|
87
|
-
return until(() => p.evaluate(() => !!document.querySelector('#
|
|
84
|
+
await P('edit');
|
|
85
|
+
return until(() => p.evaluate(() => !!document.querySelector('#czViewer [data-vz-ed] .sl .sl-stage .sl-cv')));
|
|
88
86
|
};
|
|
89
87
|
|
|
90
88
|
/* O: opening */
|
|
91
|
-
ok('O1 a draft report opens in the
|
|
92
|
-
ok('O2 on Slides, the bar\'s Edit says it edits the slides, and there is no other Edit the slides', await p.evaluate(() => /slides/i.test(document.querySelector('#
|
|
93
|
-
ok('O3 Edit
|
|
89
|
+
ok('O1 a draft report opens in the Viewer card', await openReader('2026-10-12'));
|
|
90
|
+
ok('O2 on Slides, the bar\'s Edit says it edits the slides, and there is no other Edit the slides', await p.evaluate(() => /slides/i.test(document.querySelector('#czViewer [data-r="edit"]').title) && document.querySelectorAll('#czViewer [data-r="edit"]').length === 1));
|
|
91
|
+
ok('O3 Edit mounts the slide editor in the card, with no dialog and no tab; the parts the design does not draw (slide tools, speaker notes) are marked Waiting for design', await openEditor() && await p.evaluate(() => !document.querySelector('#dlg, #vTabs') && !!document.querySelector('#czViewer [data-cz-placeholder="Slide tools"]') && !!document.querySelector('#czViewer [data-cz-placeholder="Speaker notes"]')));
|
|
92
|
+
ok('O3 the panel\'s toolbar drives it: Undo, Redo, Insert, Layout, Theme, Cancel and Save, and the cycle chip says Editing', await p.evaluate(() => [...document.querySelectorAll('#czViewer .vz-tb > button')].map((b) => b.dataset.r).join() === 'ed|undo,ed|redo,ins,ed|layout,ed|theme,edcancel,edsave' && /Editing the Oct 12 draft/.test(document.querySelector('#czViewer [data-r="cycm"]').textContent)), await p.evaluate(() => [...document.querySelectorAll('#czViewer .vz-tb > button')].map((b) => b.dataset.r).join()));
|
|
94
93
|
let s = await st();
|
|
95
94
|
ok('O4 the report reads as a title slide and one slide per section', s && s.n === 5 && s.slides[0].l === 'title' && s.slides.map((x) => x.els[0].html).join('|') === 'Partner review, 12 Oct|Headline|Initiatives|Partner note|Sources', s && s.slides.map((x) => x.els[0].html).join('|'));
|
|
96
|
-
ok('O5 the
|
|
95
|
+
ok('O5 the editor knows the document has no slide layout yet, and the card does not show the note (the design draws none)', s && /no slide layout yet/.test(s.msg) && await p.evaluate((v) => document.querySelector(v + ' .sl-msg').hidden, V), s && s.msg);
|
|
97
96
|
ok('O6 the rail shows five slides, the first current', await p.evaluate((v) => [...document.querySelectorAll(v + ' .sl-th')].length === 5 && document.querySelector(v + ' .sl-th[aria-current="true"]').dataset.k === '0', V));
|
|
98
97
|
ok('O7 the note of a report is not slide text', !(await p.evaluate((v) => document.querySelector(v + ' .sl-rail').textContent, V)).includes('pmos:note'));
|
|
99
98
|
await shot('slides-open-1280');
|
|
@@ -102,7 +101,7 @@ const disk = () => fs.readFileSync(path.join(dir, pNew), 'utf8');
|
|
|
102
101
|
await tap(V + ' [data-go="1"]');
|
|
103
102
|
const box = async (k) => p.evaluate(([v, k2]) => { const n = document.querySelectorAll(v + ' .sl-stage .sl-it')[k2]; const r = n.getBoundingClientRect(); return { x: r.x, y: r.y, w: r.width, h: r.height, g: n.dataset.g }; }, [V, k]);
|
|
104
103
|
let b = await box(1);
|
|
105
|
-
await p.mouse.move(b.x + b.w / 2, b.y + 10); await p.mouse.down(); await p.mouse.move(b.x + b.w / 2 +
|
|
104
|
+
await p.mouse.move(b.x + b.w / 2, b.y + 10); await p.mouse.down(); await p.mouse.move(b.x + b.w / 2 + 20, b.y + 22, { steps: 6 }); await p.mouse.up(); // the card's stage is small: a short drag keeps the item on the slide
|
|
106
105
|
s = await st();
|
|
107
106
|
ok('E1 dragging an item moves it on the canvas', s.slides[1].els[1].x > 72 && s.slides[1].els[1].y > 150 && s.dirty, JSON.stringify(s.slides[1].els[1]));
|
|
108
107
|
await p.$eval(V + ' .sl-stage', (e) => e.scrollIntoView({ block: 'center' }));
|
|
@@ -111,17 +110,18 @@ const disk = () => fs.readFileSync(path.join(dir, pNew), 'utf8');
|
|
|
111
110
|
const w0 = s.slides[1].els[1].w;
|
|
112
111
|
await p.mouse.move(se.x, se.y); await p.mouse.down(); await p.mouse.move(se.x + 80, se.y - 30, { steps: 6 }); await p.mouse.up();
|
|
113
112
|
s = await st();
|
|
114
|
-
ok('E2 a corner handle resizes the item', s.slides[1].els[1].w < w0, s.slides[1].els[1].w + ' vs ' + w0);
|
|
113
|
+
ok('E2 a corner handle resizes the item', s.slides[1].els[1].w < w0, s.slides[1].els[1].w + ' vs ' + w0 + ' ' + JSON.stringify(se) + ' ' + await p.evaluate((pt) => { const e = document.elementFromPoint(pt.x, pt.y); return e ? e.className + '|' + (e.parentElement || {}).className : 'none'; }, se));
|
|
115
114
|
b = await box(0);
|
|
116
115
|
await p.mouse.dblclick(b.x + 20, b.y + b.h / 2);
|
|
117
116
|
await until(() => p.evaluate(() => document.activeElement && document.activeElement.isContentEditable));
|
|
118
117
|
await p.keyboard.press('End'); await p.keyboard.type(' this week');
|
|
118
|
+
await p.$eval(V + ' details.sl-notes', (d) => { d.open = true; }); // the speaker notes fold away under the stage (Waiting for design)
|
|
119
119
|
await p.click(V + ' .sl-notes textarea'); await p.keyboard.type('Say the number first.');
|
|
120
120
|
s = await st();
|
|
121
121
|
ok('E3 double-click types into a text item', s.slides[1].els[0].html === 'Headline this week', s.slides[1].els[0].html);
|
|
122
122
|
ok('E4 speaker notes are typed into the slide', s.slides[1].notes === 'Say the number first.');
|
|
123
123
|
ok('E5 the rail shows the edit on the slide\'s thumbnail', /Headline this week/.test(await p.evaluate((v) => document.querySelectorAll(v + ' .sl-mini')[1].textContent, V)));
|
|
124
|
-
await
|
|
124
|
+
await P('ins'); await P('ed|chart');
|
|
125
125
|
await until(() => p.$(V + ' .sl-pop .sl-grid'));
|
|
126
126
|
await p.fill(V + ' .sl-pop input[data-r="0"][data-i="0"]', 'Aug'); await p.fill(V + ' .sl-pop input[data-r="0"][data-i="1"]', '24');
|
|
127
127
|
await tap(V + ' .sl-pop [data-addrow]');
|
|
@@ -130,11 +130,11 @@ const disk = () => fs.readFileSync(path.join(dir, pNew), 'utf8');
|
|
|
130
130
|
s = await st();
|
|
131
131
|
const chart = s.slides[1].els.find((e) => e.t === 'chart');
|
|
132
132
|
ok('E6 Chart adds a chart and its data is edited in a grid', chart && JSON.stringify(chart.data) === '[["Aug",24],["Sep",30]]' && await p.evaluate((v) => document.querySelectorAll(v + ' .sl-stage .sl-bar').length === 2, V), JSON.stringify(chart));
|
|
133
|
-
await
|
|
133
|
+
await P('ins'); await P('ed|shape');
|
|
134
134
|
await tap(V + ' .sl-ctx [data-c="fill"][data-v="soft"]'); await tap(V + ' .sl-ctx [data-c="round"]');
|
|
135
135
|
s = await st();
|
|
136
136
|
ok('E7 Shape adds a shape and its fill and corners change', s.slides[1].els.some((e) => e.t === 'shape' && e.fill === 'soft' && e.round));
|
|
137
|
-
await
|
|
137
|
+
await P('ins'); await P('ed|img');
|
|
138
138
|
await until(() => p.$(V + ' .sl-pop form'));
|
|
139
139
|
await p.fill(V + ' .sl-pop input[name="src"]', 'https://evil.example/x.png');
|
|
140
140
|
await tap(V + ' .sl-pop [type="submit"]');
|
|
@@ -142,17 +142,19 @@ const disk = () => fs.readFileSync(path.join(dir, pNew), 'utf8');
|
|
|
142
142
|
await p.fill(V + ' .sl-pop input[name="src"]', 'planning/design/screen.png');
|
|
143
143
|
await p.fill(V + ' .sl-pop input[name="alt"]', 'The setup screen'); await tap(V + ' .sl-pop [type="submit"]');
|
|
144
144
|
ok('E9 an image from the workspace shows through /api/asset', await until(() => p.evaluate((v) => { const i = document.querySelector(v + ' .sl-stage img'); return i && i.complete && i.naturalWidth > 0 && i.getAttribute('src').startsWith('/api/asset?'); }, V)));
|
|
145
|
-
await
|
|
146
|
-
await
|
|
145
|
+
await P('ed|theme'); await tap(V + ' .sl-pop [data-pick="sky"]');
|
|
146
|
+
await P('ed|layout'); await tap(V + ' .sl-pop [data-pick="two"]');
|
|
147
147
|
s = await st();
|
|
148
148
|
ok('E10 Theme and Layout change the deck and the slide, keeping the title', s.theme === 'sky' && s.slides[1].l === 'two' && s.slides[1].els.filter((e) => e.k === 'body' || e.k === 'body2').length === 2 && s.slides[1].els.find((e) => e.k === 'title').html === 'Headline this week');
|
|
149
149
|
await tap(V + ' [data-dn="1"]');
|
|
150
150
|
s = await st();
|
|
151
151
|
ok('E11 Move down reorders the slides', s.slides[2].els.find((e) => e.k === 'title').html === 'Headline this week' && s.i === 2);
|
|
152
|
+
await tap(V + ' [data-go="4"]'); // the slide tools act on the current slide
|
|
152
153
|
await tap(V + ' [data-del="4"]');
|
|
153
154
|
ok('E12 Delete removes a slide', (await st()).n === 4);
|
|
154
|
-
await
|
|
155
|
-
ok('E13 Undo puts the slide back, and Redo takes it away again', (await st()).n === 5 && await (async () => { await
|
|
155
|
+
await P('ed|undo');
|
|
156
|
+
ok('E13 Undo puts the slide back, and Redo takes it away again', (await st()).n === 5 && await (async () => { await P('ed|redo'); const n = (await st()).n; await P('ed|undo'); return n === 4 && (await st()).n === 5; })());
|
|
157
|
+
await tap(V + ' [data-go="2"]'); // back to the moved slide (E12 went to slide 5 to delete it)
|
|
156
158
|
await tap(V + ' [data-add]'); await tap(V + ' .sl-pop [data-pick="big"]');
|
|
157
159
|
s = await st();
|
|
158
160
|
ok('E14 Add slide adds one from a layout after the current one', s.n === 6 && s.slides[3].l === 'big' && s.i === 3);
|
|
@@ -161,17 +163,15 @@ const disk = () => fs.readFileSync(path.join(dir, pNew), 'utf8');
|
|
|
161
163
|
/* S: save, and read back from disk */
|
|
162
164
|
posts.length = 0;
|
|
163
165
|
const wsNow = await p.evaluate((pth) => window.__premiumSlides.state(pth).ws, pNew);
|
|
164
|
-
await
|
|
165
|
-
await until(() => p
|
|
166
|
-
await p.fill(V + ' .sl-savef input[name="why"]', 'Slides for Thursday'); await tap(V + ' .sl-savef [type="submit"]');
|
|
167
|
-
await until(() => p.evaluate(() => !document.querySelector('#rdEd'))); // Save writes, then brings the report back
|
|
166
|
+
await P('edsave');
|
|
167
|
+
await until(() => p.evaluate(() => !document.querySelector('#czViewer [data-vz-ed]'))); // Save writes, then brings the report back
|
|
168
168
|
const md = disk();
|
|
169
169
|
ok('S1 Save writes once through the document sheet\'s edit route', JSON.stringify(posts) === '["/api/doc-sheet/edit"]', JSON.stringify(posts));
|
|
170
170
|
ok('S2 the file is markdown with a slide block under each heading', (md.match(/^<!-- pmos:slide \{/gm) || []).length === 6 && /^# Partner review, 12 Oct\n<!-- pmos:slide/m.test(md) && /\ndeck_theme: sky\n/.test(md), md.slice(0, 300));
|
|
171
171
|
ok('S3 the slide\'s text, its chart data and its image are written as markdown', md.includes('## Headline this week\n') && md.includes('| Sep | 30 |') && md.includes(''));
|
|
172
172
|
ok('S4 the speaker notes and the report note are in the file', md.includes('"notes":"Say the number first."') && md.includes('<!-- pmos:note partner-activation -->\nThe PM\'s words.\n<!-- /pmos:note -->'));
|
|
173
|
-
ok('S5 the reason is kept in the document\'s revision log', await p.evaluate(async ([pth, ws]) => { const r = await fetch('/api/doc-sheet/log?' + new URLSearchParams({ ...(ws ? { ws } : {}), path: pth })).then((x) => x.json()); return JSON.stringify(r).includes('
|
|
174
|
-
ok('S6 the
|
|
173
|
+
ok('S5 the reason is kept in the document\'s revision log', await p.evaluate(async ([pth, ws]) => { const r = await fetch('/api/doc-sheet/log?' + new URLSearchParams({ ...(ws ? { ws } : {}), path: pth })).then((x) => x.json()); return JSON.stringify(r).includes('Edited the slides in the report'); }, [pNew, wsNow]));
|
|
174
|
+
ok('S6 the card says it is saved and shows the saved words, without the slide blocks', await until(() => p.evaluate(() => { const t = document.querySelector('#czViewer').textContent; return /Saved\. The reason is in the Edit log/.test(t) && [...document.querySelectorAll('#czViewer .vz-th')].some((b) => /Headline this week/.test(b.getAttribute('aria-label'))) && !t.includes('pmos:slide'); })));
|
|
175
175
|
await openReader('2026-10-12'); await openEditor();
|
|
176
176
|
s = await st();
|
|
177
177
|
ok('S7 opened again, the deck is as it was saved, with no "no layout" note', s.n === 6 && s.theme === 'sky' && s.slides[2].l === 'two' && s.slides[2].notes === 'Say the number first.' && JSON.stringify(s.slides[2].els.find((e) => e.t === 'chart').data) === '[["Aug",24],["Sep",30]]' && !s.msg, JSON.stringify({ n: s.n, msg: s.msg }));
|
|
@@ -184,12 +184,11 @@ const disk = () => fs.readFileSync(path.join(dir, pNew), 'utf8');
|
|
|
184
184
|
ok('H1 a slide edited in the file shows the file\'s text and says so', ini && ini.changed && /shipped to all partners/.test(JSON.stringify(ini.els)) && /changed in the file outside the editor/.test(await p.textContent(V + ' .sl-msg')), s.msg);
|
|
185
185
|
|
|
186
186
|
/* C: the file changes while the editor is open */
|
|
187
|
-
await
|
|
187
|
+
await P('ins'); await P('ed|text'); await p.keyboard.type('New words');
|
|
188
188
|
fs.writeFileSync(path.join(dir, pNew), disk() + '\n');
|
|
189
189
|
posts.length = 0;
|
|
190
|
-
await
|
|
191
|
-
ok('C1 a save over a file that changed is refused with a reason, and nothing is written', await until(() => p.evaluate((
|
|
192
|
-
await p.keyboard.press('Escape');
|
|
190
|
+
await P('edsave');
|
|
191
|
+
ok('C1 a save over a file that changed is refused with a reason, and nothing is written', await until(() => p.evaluate(() => /changed since the slides were opened/.test((document.querySelector('#czViewer .vz-msg') || {}).textContent || ''))) && posts.length === 0, JSON.stringify(posts) + ' ' + await p.evaluate(() => (document.querySelector('#czViewer .vz-msg') || {}).textContent));
|
|
193
192
|
|
|
194
193
|
/* N: Present */
|
|
195
194
|
await tap(V + ' [data-go="0"]');
|
|
@@ -198,7 +197,7 @@ const disk = () => fs.readFileSync(path.join(dir, pNew), 'utf8');
|
|
|
198
197
|
await p.keyboard.press('ArrowRight');
|
|
199
198
|
ok('N2 the arrow keys move while presenting', /^2 \//.test(await p.textContent('.sl-pres .sl-pn')));
|
|
200
199
|
await p.keyboard.press('Escape');
|
|
201
|
-
ok('N3 Escape stops presenting and leaves the
|
|
200
|
+
ok('N3 Escape stops presenting and leaves the card open', await until(() => p.evaluate(() => !document.querySelector('.sl-pres') && !!document.querySelector('#czViewer [data-vz-ed] .sl-cv'))));
|
|
202
201
|
|
|
203
202
|
/* N: the presenter view (R-SL2) */
|
|
204
203
|
await tap(V + ' [data-go="0"]');
|
|
@@ -222,13 +221,13 @@ const disk = () => fs.readFileSync(path.join(dir, pNew), 'utf8');
|
|
|
222
221
|
await p.click('.sl-pres [data-c="kind"]');
|
|
223
222
|
ok('N9 Slides only shows the slide without the notes and offers the presenter view back', await p.evaluate(() => { const o = document.querySelector('.sl-pres'); return o.dataset.k === 'aud' && !o.querySelector('textarea') && /Presenter view/.test(o.querySelector('[data-c="kind"]').textContent); }));
|
|
224
223
|
await p.keyboard.press('Escape');
|
|
225
|
-
ok('N10 stopping closes the audience window and the editor shows the last slide presented', await until(() => aw.isClosed()) && (await st()).i === j + 1 && await p.evaluate(() => document.querySelector('#
|
|
226
|
-
await
|
|
224
|
+
ok('N10 stopping closes the audience window and the editor shows the last slide presented', await until(() => aw.isClosed()) && (await st()).i === j + 1 && await p.evaluate(() => !!document.querySelector('#czViewer [data-vz-ed]')));
|
|
225
|
+
await P('ed|undo');
|
|
227
226
|
ok('N11 Undo takes back the notes typed while presenting', (await st()).slides[j].notes === 'Say the number first.');
|
|
228
227
|
|
|
229
228
|
/* I: an issued report */
|
|
230
229
|
await openReader('2026-10-05');
|
|
231
|
-
ok('I1 an issued report has no Edit and no Issue: it reads as Slides or Page', await p.evaluate(() => !document.querySelector('#
|
|
230
|
+
ok('I1 an issued report has no Edit and no Issue: it reads as Slides or Page', await p.evaluate(() => !document.querySelector('#czViewer [data-r="edit"]') && !document.querySelector('#czViewer [data-r="issue"]') && !!document.querySelector('#czViewer [data-r="view|deck"]')));
|
|
232
231
|
ok('I3 the issued file is not changed', fs.readFileSync(path.join(dir, pOld), 'utf8') === OLD);
|
|
233
232
|
ok('X no page error', errs.length === 0, errs.join(' | '));
|
|
234
233
|
await ctx.close();
|
|
@@ -237,18 +236,15 @@ const disk = () => fs.readFileSync(path.join(dir, pNew), 'utf8');
|
|
|
237
236
|
{
|
|
238
237
|
const c2 = await browser.newContext({ viewport: { width: 390, height: 844 }, hasTouch: true, isMobile: true, colorScheme: 'dark' }), q = await c2.newPage(), e2 = [];
|
|
239
238
|
q.on('pageerror', (e) => e2.push(String(e)));
|
|
240
|
-
await q.goto(BASE + '/premium-
|
|
241
|
-
await until(() => q.evaluate(() => !!document.querySelector('#
|
|
242
|
-
await q.$eval('#
|
|
243
|
-
await
|
|
244
|
-
await q
|
|
245
|
-
await until(() => q.evaluate(() => document.querySelector('#dlg').classList.contains('on') && !!document.querySelector('#rdSlide')));
|
|
246
|
-
await q.$eval('#oMain [data-rr="edit"]', (x) => x.click());
|
|
247
|
-
await until(() => q.evaluate(() => !!document.querySelector('#oMain #rdEd .sl .sl-stage .sl-cv')));
|
|
239
|
+
await q.goto(BASE + '/premium-viewer.html?theme=dark&open=report&path=' + encodeURIComponent(pNew));
|
|
240
|
+
await until(() => q.evaluate(() => !!document.querySelector('#czViewer .vz-rp0 .vz-slide')));
|
|
241
|
+
await q.$eval('#czViewer .vz-tb > [data-r="more"]', (x) => x.click());
|
|
242
|
+
await q.$eval('#czViewer .vz-pop [data-r="edit"]', (x) => x.click()); // on a phone Edit sits in More
|
|
243
|
+
await until(() => q.evaluate(() => !!document.querySelector('#czViewer [data-vz-ed] .sl .sl-stage .sl-cv')));
|
|
248
244
|
await sleep(300);
|
|
249
245
|
const m = await q.evaluate((v) => {
|
|
250
246
|
const r = (e) => e.getBoundingClientRect(), vis = (e) => e.offsetParent !== null && r(e).width > 0;
|
|
251
|
-
const bs = [...document.querySelectorAll(
|
|
247
|
+
const bs = [...document.querySelectorAll('#czViewer .vz-tb > button, ' + v + ' .sl-tha .sl-b')].filter(vis);
|
|
252
248
|
const rail = document.querySelector(v + ' .sl-rail'), stage = document.querySelector(v + ' .sl-stage');
|
|
253
249
|
return { minH: Math.min(...bs.map((b) => r(b).height)), minW: Math.min(...bs.map((b) => r(b).width)), over: document.documentElement.scrollWidth > innerWidth + 1,
|
|
254
250
|
railBelow: r(rail).top >= r(stage).bottom - 1, stageFits: r(stage).right <= innerWidth + 1, bg: getComputedStyle(document.querySelector(v + ' .sl-notes textarea')).backgroundColor };
|