create-pmos 0.397.0 → 0.399.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.
Files changed (195) hide show
  1. package/package.json +25 -25
  2. package/payload/KIT-VERSION +2 -2
  3. package/payload/planning/evals/eval-calibration.md +1 -1
  4. package/payload/planning/okrs/health-budgets.md +1 -1
  5. package/payload/state/discoveries.md +1 -1
  6. package/payload/state/log.md +1 -1
  7. package/workspace/briefing-premium-adddoc-test.js +105 -52
  8. package/workspace/briefing-premium-board-test.js +284 -128
  9. package/workspace/briefing-premium-calendar-2-test.js +135 -198
  10. package/workspace/briefing-premium-calendar-3-test.js +143 -418
  11. package/workspace/briefing-premium-calendar-test.js +85 -196
  12. package/workspace/briefing-premium-doc-edit-test.js +99 -83
  13. package/workspace/briefing-premium-initiative-test.js +175 -290
  14. package/workspace/briefing-premium-insights-test.js +414 -219
  15. package/workspace/briefing-premium-metrics-test.js +55 -97
  16. package/workspace/briefing-premium-products-test.js +44 -28
  17. package/workspace/briefing-premium-sources-test.js +70 -49
  18. package/workspace/briefing-premium-test.js +155 -648
  19. package/workspace/briefing-premium-work-test.js +88 -283
  20. package/workspace/changelog.json +24 -0
  21. package/workspace/ev-everywhere-test.js +210 -0
  22. package/workspace/fixtures/board-premium-trail.js +32 -0
  23. package/workspace/fixtures/premium-viewer-fixtures.js +187 -0
  24. package/workspace/guide/briefing-premium.md +3 -1
  25. package/workspace/guide/home.md +68 -0
  26. package/workspace/guide/index.md +1 -0
  27. package/workspace/lib/agent-roles.js +71 -0
  28. package/workspace/lib/board-grill.js +63 -0
  29. package/workspace/lib/board-premium.js +121 -24
  30. package/workspace/lib/board-trail.js +223 -0
  31. package/workspace/lib/home-work-item.js +58 -0
  32. package/workspace/lib/initiative-layout.js +77 -0
  33. package/workspace/lib/insights-goals.js +196 -0
  34. package/workspace/lib/insights-premium.js +64 -15
  35. package/workspace/lib/insights-records.js +115 -0
  36. package/workspace/lib/jira-tickets.js +1 -1
  37. package/workspace/lib/meeting-points.js +52 -0
  38. package/workspace/lib/news-for-you.js +88 -0
  39. package/workspace/lib/notes-series.js +29 -6
  40. package/workspace/lib/report-confirm.js +48 -0
  41. package/workspace/lib/route-modules.js +12 -0
  42. package/workspace/lib/routes-board-docs.js +46 -0
  43. package/workspace/lib/routes-board-grill.js +90 -0
  44. package/workspace/lib/routes-board-trail.js +33 -0
  45. package/workspace/lib/routes-home-desk.js +176 -0
  46. package/workspace/lib/routes-home-review.js +108 -0
  47. package/workspace/lib/routes-initiative-layout.js +57 -0
  48. package/workspace/lib/routes-insights-premium.js +16 -4
  49. package/workspace/lib/routes-insights-records.js +133 -0
  50. package/workspace/lib/routes-meeting-points.js +37 -0
  51. package/workspace/lib/routes-news.js +57 -0
  52. package/workspace/lib/routes-notes.js +3 -1
  53. package/workspace/lib/routes-report-confirm.js +31 -0
  54. package/workspace/lib/routes-search.js +38 -0
  55. package/workspace/lib/routes-viewer.js +108 -0
  56. package/workspace/lib/search-index.js +176 -0
  57. package/workspace/lib/transcript-steps.js +123 -0
  58. package/workspace/lib/viewer-meeting.js +205 -0
  59. package/workspace/lib/viewer-report.js +89 -0
  60. package/workspace/package-lock.json +2 -2
  61. package/workspace/package.json +1 -1
  62. package/workspace/premium-board-actions-test.js +128 -82
  63. package/workspace/premium-briefing-depth-test.js +104 -90
  64. package/workspace/premium-chat-attach-test.js +54 -63
  65. package/workspace/premium-chat-chart-tab-test.js +37 -37
  66. package/workspace/premium-chat-context-test.js +19 -18
  67. package/workspace/premium-chat-goal-view-test.js +23 -23
  68. package/workspace/premium-chat-notes-test.js +26 -31
  69. package/workspace/premium-chat-report-tab-test.js +46 -28
  70. package/workspace/premium-chat-term-test.js +16 -16
  71. package/workspace/premium-chat-viewer-test.js +60 -59
  72. package/workspace/premium-core-doc-issue-test.js +52 -43
  73. package/workspace/premium-html-viewer-test.js +14 -17
  74. package/workspace/premium-phone-card-test.js +10 -3
  75. package/workspace/premium-phone-room-test.js +41 -35
  76. package/workspace/premium-report-read-test.js +152 -197
  77. package/workspace/premium-viewer-download-test.js +19 -22
  78. package/workspace/premium-viewer-flicker-test.js +11 -16
  79. package/workspace/premium-viewer-share-test.js +6 -9
  80. package/workspace/premium-viewer-test.js +41 -60
  81. package/workspace/premium-vw-backlog-test.js +53 -33
  82. package/workspace/premium-vw-cal-test.js +97 -128
  83. package/workspace/premium-vw-copy-test.js +17 -33
  84. package/workspace/premium-vw-doc-test.js +17 -10
  85. package/workspace/premium-vw-item-test.js +50 -49
  86. package/workspace/premium-vw-jira-test.js +53 -27
  87. package/workspace/premium-vw-meet-test.js +115 -187
  88. package/workspace/premium-vw-notes-test.js +88 -109
  89. package/workspace/premium-vw-rec-test.js +71 -194
  90. package/workspace/premium-vw-slides-test.js +46 -50
  91. package/workspace/premium-welcome-test.js +3 -2
  92. package/workspace/premium-work-depth-test.js +61 -53
  93. package/workspace/public/pm/bd-acts.js +383 -0
  94. package/workspace/public/pm/bd-asks.js +261 -0
  95. package/workspace/public/pm/bd-pop.js +59 -0
  96. package/workspace/public/pm/bd-span.js +222 -82
  97. package/workspace/public/pm/bd-stages.js +25 -11
  98. package/workspace/public/pm/bd-views.js +169 -0
  99. package/workspace/public/pm/c3-doc-sheet.js +1 -1
  100. package/workspace/public/pm/c3-md.js +3 -395
  101. package/workspace/public/pm/c3-phone-detail.js +1 -1
  102. package/workspace/public/pm/c3-phone-model.js +3 -68
  103. package/workspace/public/pm/chat-term.js +3 -3
  104. package/workspace/public/pm/cozy-board.css +798 -230
  105. package/workspace/public/pm/cozy-ev.css +228 -0
  106. package/workspace/public/pm/cozy-evmodel.js +106 -0
  107. package/workspace/public/pm/cozy-evui.js +47 -0
  108. package/workspace/public/pm/cozy-home.css +570 -142
  109. package/workspace/public/pm/cozy-home.js +5 -3
  110. package/workspace/public/pm/cozy-insights.css +437 -170
  111. package/workspace/public/pm/cozy-md.js +396 -0
  112. package/workspace/public/pm/cozy-nav.js +104 -29
  113. package/workspace/public/pm/cozy-news.js +140 -0
  114. package/workspace/public/pm/cozy-placeholder.js +26 -0
  115. package/workspace/public/pm/cozy-search.js +203 -0
  116. package/workspace/public/pm/cozy-settings.js +198 -0
  117. package/workspace/public/pm/cozy-sources.js +89 -0
  118. package/workspace/public/pm/cozy-today.css +217 -0
  119. package/workspace/public/pm/cozy-viewer.css +3 -3
  120. package/workspace/public/pm/cozy-viewer.js +145 -0
  121. package/workspace/public/pm/cozy-vw-mtg.css +350 -0
  122. package/workspace/public/pm/cozy-vw-rp.css +152 -0
  123. package/workspace/public/pm/cozy-vw.css +485 -0
  124. package/workspace/public/pm/cozy.css +83 -1
  125. package/workspace/public/pm/home-adddoc.js +48 -0
  126. package/workspace/public/pm/home-app.js +1179 -0
  127. package/workspace/public/pm/home-around.js +413 -0
  128. package/workspace/public/pm/home-chat.js +512 -0
  129. package/workspace/public/pm/home-data.js +312 -0
  130. package/workspace/public/pm/home-dictate.js +54 -0
  131. package/workspace/public/pm/home-draft.js +68 -0
  132. package/workspace/public/pm/home-ini-model.js +190 -0
  133. package/workspace/public/pm/home-ini.css +171 -0
  134. package/workspace/public/pm/home-ini.js +456 -0
  135. package/workspace/public/pm/home-list.js +276 -0
  136. package/workspace/public/pm/home-more.js +132 -0
  137. package/workspace/public/pm/home-phone-card.js +109 -0
  138. package/workspace/public/pm/home-review.js +104 -0
  139. package/workspace/public/pm/home-task.js +67 -0
  140. package/workspace/public/pm/home-today.js +144 -0
  141. package/workspace/public/pm/home-work.js +547 -0
  142. package/workspace/public/pm/phone-moment.js +69 -0
  143. package/workspace/public/pm/pm-work-view.js +1 -1
  144. package/workspace/public/pm/premium-attach.js +4 -0
  145. package/workspace/public/pm/premium-board.js +548 -395
  146. package/workspace/public/pm/premium-chart-tab.js +109 -62
  147. package/workspace/public/pm/premium-deck.js +3 -3
  148. package/workspace/public/pm/premium-first.js +23 -21
  149. package/workspace/public/pm/premium-insights.js +1102 -581
  150. package/workspace/public/pm/premium-meeting.js +61 -549
  151. package/workspace/public/pm/premium-mtg-present.js +138 -0
  152. package/workspace/public/pm/premium-mtg-replay.js +142 -0
  153. package/workspace/public/pm/premium-notes.js +1 -1
  154. package/workspace/public/pm/premium-report-frame.css +20 -0
  155. package/workspace/public/pm/premium-report-read.js +669 -476
  156. package/workspace/public/pm/premium-report-tab.js +116 -67
  157. package/workspace/public/pm/premium-shell.js +76 -123
  158. package/workspace/public/pm/premium-viewer.js +22 -1
  159. package/workspace/public/pm/premium-vw-cal.js +277 -48
  160. package/workspace/public/pm/premium-vw-doc.css +6 -0
  161. package/workspace/public/pm/premium-vw-doc.js +40 -2
  162. package/workspace/public/pm/premium-vw-file.js +2 -2
  163. package/workspace/public/pm/premium-vw-meet.js +6 -83
  164. package/workspace/public/pm/premium-vw-mtg.js +958 -0
  165. package/workspace/public/pm/premium-vw-notes.js +116 -68
  166. package/workspace/public/pm/premium-vw-open.js +35 -0
  167. package/workspace/public/pm/premium-vw-page.js +16 -0
  168. package/workspace/public/pm/premium-vw-rec.js +11 -218
  169. package/workspace/public/pm/premium-vw-slides.css +5 -0
  170. package/workspace/public/pm/premium-vw-slides.js +44 -8
  171. package/workspace/public/pm/rp-parts.js +269 -0
  172. package/workspace/public/pm/term-view.js +22 -0
  173. package/workspace/public/premium-board.html +29 -70
  174. package/workspace/public/premium-initiative.html +8 -48
  175. package/workspace/public/premium-insights.html +26 -64
  176. package/workspace/public/premium-viewer.html +20 -0
  177. package/workspace/public/premium.html +18 -107
  178. package/workspace/r/m1.png +0 -0
  179. package/workspace/r/m2.png +0 -0
  180. package/workspace/r/m3.png +0 -0
  181. package/workspace/r/nl.png +0 -0
  182. package/workspace/server.js +18 -3
  183. package/workspace/test-files.json +1 -0
  184. package/workspace/test-lists/home-libs.json +9 -0
  185. package/workspace/test-lists/initiative-layout.json +9 -0
  186. package/workspace/test-lists/premium-report-read.json +1 -1
  187. package/workspace/test-lists/premium-uncovered-meetings.json +9 -0
  188. package/workspace/test-lists/premium-uncovered-reports.json +9 -0
  189. package/workspace/test-lists/premium-vw-agreed.json +9 -0
  190. package/workspace/test-lists/premium-vw-notes.json +1 -1
  191. package/workspace/test-lists/uf-everywhere.json +15 -0
  192. package/workspace/test-lists/uf-home.json +9 -0
  193. package/workspace/test-lists/uncovered-board.json +9 -0
  194. package/workspace/public/pm/premium-work.js +0 -729
  195. package/workspace/public/pm/premium.js +0 -1146
@@ -1,23 +1,23 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
- /* premium-vw-meet-test.js — the meeting detail laid out as the console's note sheet (initiative premium-viewer, R3, slice S3; planning/prd/premium-viewer-prd.md).
4
- * Serves the real Briefing from the real server. The Briefing model, the calendar, the notes and the note (GET /api/notes/one) are answered by stand-ins,
5
- * so each press can be read off the request the page sent. The routes' own behaviour is in their own suites; the pure half is in premium-vw-meet.test.js.
6
- * The detail is one scroll: the part that fits the meeting's state comes first and open, the others folded (no Before, During and After switch, PM 2026-10-20).
7
- * S1 parts · S2 head · S3 After · S4 Make task · S5 Before (with the prep brief) · S6 During · S7 series membership · S8 no note · S9 writes · S10 floors
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; re-pointed again for premium-uncovered-features, meetings: MtAfter, MtFocus, MtReplay, MtMaterial).
5
+ * Serves the real /premium-viewer.html from the real server; the notes, the calendar, Focus, the replay and the viewer-meeting record are answered
6
+ * by stand-ins (fixtures/premium-viewer-fixtures.js), so each press can be read off the request the page sent. The routes' own behaviour is in
7
+ * their own suites; the pure half is in premium-vw-meet.test.js, premium-vw-agreed.test.js and premium-uncovered-meetings.test.js.
8
+ * One card with no conversation: a meeting to come is prep with no tabs; a live one has Live notes | Focus | Transcript; a done one has
9
+ * Notes | Replay | Transcript, Notes open.
10
+ * S1 tabs · 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
11
  * Every wait polls the page; no fixed sleep stands in for a state. */
9
12
  const path = require('path');
10
13
  const { spawn } = require('child_process');
11
14
  const { findBrowser } = require('./lib/find-browser');
12
15
  const T = require('./test-run').configure({ name: 'premium-vw-meet' });
13
- const B = require('./lib/briefing-premium.js');
14
- const F = require('./fixtures/briefing-premium-facts.js');
16
+ const F = require('./fixtures/premium-viewer-fixtures.js');
15
17
 
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); } };
18
+ const BASE = T.BASE, until = F.until;
19
19
  const results = [];
20
- const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + extra : ''}`); };
20
+ const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + String(extra).slice(0, 500) : ''}`); };
21
21
  let srv = null; let browser = null;
22
22
  const finish = async (code) => {
23
23
  if (browser) await browser.close().catch(() => {});
@@ -29,31 +29,6 @@ const finish = async (code) => {
29
29
  };
30
30
  process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
31
31
 
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
32
  (async () => {
58
33
  const exe = findBrowser();
59
34
  if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the suite cannot run'); return finish(1); }
@@ -62,163 +37,116 @@ const PNG = Buffer.from('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR
62
37
  srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
63
38
  await T.waitForServer(BASE);
64
39
  browser = await chromium.launch({ executablePath: exe });
40
+ const body = (p) => p.evaluate(() => (document.querySelector('#czViewer .cz-vw-body') || {}).innerText || '');
41
+ const tabs = (p) => p.evaluate(() => [...document.querySelectorAll('#czViewer .vzm-tabs [data-a="tab"]')].map((x) => x.dataset.k + (x.getAttribute('aria-selected') === 'true' ? '*' : '')).join());
42
+ const press = (p, sel) => p.$eval('#czViewer ' + sel, (b) => b.click());
65
43
 
66
- const facts = () => { const f = F.facts(); f.meetings = [{ start: START.getTime(), end: END.getTime(), title: 'Weekly sync', with: 'Dara, Sam', initiative: null }]; return f; };
67
- const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'application/json', body: JSON.stringify(b) });
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);
44
+ /* an ended meeting with notes */
45
+ const A = await F.open(browser, BASE, '/premium-viewer.html?open=meeting&note=n1');
111
46
  const p = A.page;
47
+ const up = await until(() => p.evaluate(() => !!document.querySelector('#czViewer .vz-mtg[data-mk="notes"]') && /Next steps/.test(document.body.innerText)), 15000);
48
+ ok('0 the meeting opens in the Viewer card on its own page', up);
49
+ if (!up) return finish(1);
112
50
 
113
- /* S1 the stage */
114
- const st = await until(() => p.evaluate(() => { const b = [...document.querySelectorAll('#oMain .vm-part')]; return b.length === 3 && /migration check/.test(document.querySelector('#oMain').textContent) ? b.map((x) => x.dataset.part + ':' + x.open).join() : null; }));
115
- ok('S1 a meeting with notes shows Notes first and open, and the other parts folded', st === 'after:true,before:false,during:false', String(st));
116
- ok('S1 there is no Before, During and After switch', await p.evaluate(() => !document.querySelector('#oMain [data-ph], #oMain .vm-ph')));
117
- ok('S1 the note was read from GET /api/notes/one for the meeting\'s note', A.oneGets[0] === 'n1', JSON.stringify(A.oneGets));
51
+ /* S1 tabs */
52
+ ok('S1 a done meeting has Notes, Replay and Transcript, Notes open', await tabs(p) === 'notes*,replay,tr', await tabs(p));
53
+ ok('S1 no Detail or Conversation switch, no #dlg', await p.evaluate(() => !document.querySelector('#dlg, #dTabs, .stream')));
54
+ ok('S1 the note was read from GET /api/notes/one', A.S.gets.some((g) => g.startsWith('/api/notes/one?id=n1')));
118
55
 
119
56
  /* S2 the head */
120
- const head = await p.evaluate(() => ({ sub: document.querySelector('#dSub').textContent, ppl: (document.querySelector('#oMain [data-vm="ppl"]') || {}).textContent || '', pplHidden: document.querySelector('#oMain .vm-ppl').hidden, about: !!document.querySelector('#oMain .vm-menu [data-vm="about"]'), lines: [...document.querySelectorAll('#oMain .vm-ln')].map((x) => x.textContent), ser: (document.querySelector('#oMain .vm-ser') || {}).textContent || '', prev: (document.querySelector('#oMain [data-vm="prev"]') || {}).dataset, next: !!document.querySelector('#oMain [data-vm="next"][data-id="n2"]'), sel: !!document.querySelector('#mtgSel') }));
121
- ok('S2 the dialog head says when the meeting is; the detail says its state and folds its people to a count, with Change in More', / to /.test(head.sub) && head.lines.some((l) => /Done/.test(l)) && /^2 people$/.test(head.ppl.trim()) && head.pplHidden && head.about && head.sel, JSON.stringify(head));
122
- await p.click('#oMain [data-vm="ppl"]');
123
- ok('S2 the people count opens the names', await until(() => p.evaluate(() => !document.querySelector('#oMain .vm-ppl').hidden && /Dara/.test(document.querySelector('#oMain .vm-ppl').textContent) && /Sam/.test(document.querySelector('#oMain .vm-ppl').textContent))));
124
- ok('S2 the series line says N of M and pages to the meeting before and after; Not part of this series is in More', /Weekly sync · 2 of 3/.test(head.ser) && head.prev && head.prev.id === 'n0' && head.next && !/Not part of this series/.test(head.ser) && await p.evaluate(() => !!document.querySelector('#oMain .vm-menu [data-vm="serout"]')), head.ser);
57
+ const head = await p.evaluate(() => ({ state: !!document.querySelector('#czViewer .vzm-state'), sub: document.querySelector('#czViewer .vzm-sub').textContent, about: document.querySelector('#czViewer [data-a="m-about"]').textContent, ser: (document.querySelector('#czViewer .vzm-sn') || {}).textContent || '', kind: document.querySelector('#czViewer .cz-vw-kind').textContent }));
58
+ ok('S2 the head: the time and the people, About Viewer, the series 4 of 4, ⋯ and no state chip once done', /31 min/.test(head.sub) && /Ana, Dita, Wawan/.test(head.sub) && head.about === 'Viewer' && head.ser === '4 of 4' && !head.state && await p.evaluate(() => !!document.querySelector('#czViewer [data-a="more"]')), JSON.stringify(head));
59
+ ok('S2 the header kind is Meeting notes', head.kind === 'Meeting notes', head.kind);
60
+ await press(p, '[data-a="more"]');
61
+ const menu = await until(() => p.evaluate(() => { const b = [...document.querySelectorAll('#czViewer [role="menu"] [data-a]')]; return b.length ? b.map((x) => x.dataset.a) : null; }));
62
+ ok('S2 ⋯ holds Copy as Markdown, New meeting, What Record and Focus do', menu && menu.join() === 'm-copy,m-fresh,m-why', JSON.stringify(menu));
63
+ ok('S2 each menu item has a sub-line', await p.evaluate(() => [...document.querySelectorAll('#czViewer [role="menu"] [data-a]')].every((b) => b.innerText.split('\n').length >= 2)));
64
+ await p.context().grantPermissions(['clipboard-read', 'clipboard-write']).catch(() => {});
65
+ await press(p, '[data-a="m-copy"]');
66
+ const clip = await until(() => p.evaluate(() => navigator.clipboard.readText().catch(() => '')));
67
+ ok('S2 Copy as Markdown copies the notes', /^# Viewer sync/.test(clip || '') && /Diffs can be approved/.test(clip || ''), String(clip).slice(0, 200));
125
68
 
126
69
  /* S3 After */
127
- const af = (await part(p, 'after')).text;
128
- ok('S3 Since the last one lists the step done, raised again and the new one', /Since the last one, /.test(af) && /Write the runbook/.test(af) && /Done/.test(af) && /Raised again/.test(af) && /New/.test(af));
129
- ok('S3 the summary, the Decision and Why table and the open question come from the final notes', /The team reviewed the migration check\./.test(af) && /Keep the new copy/.test(af) && /Completion rose six points\./.test(af) && /Do old workspaces need a manual step\?/.test(af));
130
- const tb = await p.evaluate(() => ({ dec: [...document.querySelectorAll('#oMain [data-vm-t="decisions"] th')].map((x) => x.textContent).join('|'), act: [...document.querySelectorAll('#oMain [data-vm-t="actions"] tbody td')].slice(0, 3).map((x) => x.textContent).join('|'),
131
- img: !!document.querySelector('#oMain .vm-shots img[src*="/api/notes/screen?id=n1"]'), aud: (document.querySelector('#oMain audio.vm-aud') || {}).src || '', fold: (document.querySelector('#oMain details.vm-fold summary') || {}).textContent || '' }));
132
- ok('S3 the tables have Decision and Why, and Next step with owner and due', tb.dec === 'Decision|Why' && tb.act === 'Start the migration check|Sam|2026-10-22', JSON.stringify(tb));
133
- ok('S3 the screenshot, the kept audio and the folded transcript are shown', tb.img && /\/api\/notes\/recording\?id=n1&b=64/.test(tb.aud) && /Transcript · 2 lines/.test(tb.fold), JSON.stringify(tb));
134
-
135
- /* S4 Make task */
136
- await p.click('#oMain .mtg-task');
137
- await until(() => A.planPosts.length === 1);
138
- const pp = A.planPosts[0];
139
- ok('S4 Make task posts one planned event to the note\'s initiative with the owner and due', pp && pp.ws === 'w1' && pp.events[0].ev === 'planned' && pp.events[0].initiative === 'premium-ux' && pp.events[0].owner === 'person:Sam' && pp.events[0].due === '2026-10-22' && pp.events[0].stage === 'st1', JSON.stringify(pp));
140
- ok('S4 the step says Task made and the status says where it went', await until(() => p.evaluate(() => /Added to Premium UX, under Intake\./.test(document.querySelector('#mtgStatus').textContent) && document.querySelector('#oMain .mtg-task').textContent === 'Task made')));
141
- await p.click('#mtgUndo'); await until(() => A.planPosts.length === 2);
142
- ok('S4 Undo withdraws the item', A.planPosts[1].events[0].ev === 'withdrawn' && A.planPosts[1].events[0].item === 'item-9');
143
-
144
- /* S5 Before */
145
- await stage(p, 'before');
146
- const bf = (await part(p, 'before')).text;
147
- ok('S5 Before shows what was carried in, the agenda with what was heard, and what it is for', /Carried in from/.test(bf) && /Book the readout/.test(bf) && /1 of 2 heard/.test(bf) && /What it is for/.test(bf) && /Release PRD/.test(bf), bf.slice(0, 300));
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; })));
70
+ const after = await body(p);
71
+ 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));
72
+ ok('S3 Facts mentioned: Matches and Not checked', /Facts mentioned/.test(after) && /Matches/.test(after) && /Not checked/.test(after));
73
+ await press(p, '[data-a="tab"][data-k="replay"]');
74
+ ok('S3 the Replay tab has the screen thumbnails, with no Waiting for design marker', await until(() => p.evaluate(() => document.querySelectorAll('#czViewer .vzp-th').length === 3 && !document.querySelector('#czViewer [data-cz-placeholder]'))));
75
+ await press(p, '.vzp-th[data-a="seekto"]');
76
+ ok('S3 a thumbnail moves the replay to its time', await until(() => p.evaluate(() => /^03:10/.test((document.querySelector('#czViewer [data-clk="pos"]') || {}).textContent || ''))), await p.evaluate(() => (document.querySelector('#czViewer [data-clk="pos"]') || {}).textContent));
77
+ await press(p, '[data-a="tab"][data-k="tr"]');
78
+ ok('S3 the Transcript tab shows the lines, Dita named', await until(async () => /The Viewer sits beside the chat now/.test(await body(p)) && /Dita/.test(await body(p))));
79
+ await press(p, '[data-a="tab"][data-k="notes"]');
80
+
81
+ /* S4 Make task: a work-item becomes V.4 Drafted in PMOS */
82
+ await until(() => p.evaluate(() => !!document.querySelector('#czViewer [data-a="makewi"][data-i="0"]')));
83
+ ok('S4 each step offers Make task and an icon-only work-item press', await p.evaluate(() => !!document.querySelector('#czViewer [data-a="maketask"][data-i="0"]') && !document.querySelector('#czViewer [data-a="makewi"][data-i="0"]').textContent.trim()));
84
+ await press(p, '[data-a="makewi"][data-i="0"]');
85
+ 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));
86
+ 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));
87
+ await press(p, '[data-a="maketask"][data-i="1"]');
88
+ ok('S4 Make 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
89
 
162
90
  /* S7 series membership */
163
- await more(p); await p.click('#oMain .vm-menu [data-vm="serout"]');
164
- await until(() => A.memberPosts.length === 1);
165
- ok('S7 Not part of this series posts the note with key off', A.memberPosts[0].id === 'n1' && A.memberPosts[0].key === 'off', JSON.stringify(A.memberPosts));
166
- ok('S7 the note is read again and the line offers Put it back', await until(() => p.evaluate(() => /Taken out of its series/.test(document.querySelector('#oMain').textContent) && !!document.querySelector('#oMain [data-vm="serback"]'))));
167
- await p.click('#oMain [data-vm="serback"]'); await until(() => A.memberPosts.length === 2);
168
- ok('S7 Put it back posts the note with no key', A.memberPosts[1].key === null, JSON.stringify(A.memberPosts[1]));
169
-
170
- /* S2 a meeting of the series opens beside this one as a viewer tab (the frame, premium-viewer S1) */
171
- await until(() => p.evaluate(() => !!document.querySelector('#oMain [data-vm="prev"][data-id="n0"]')));
172
- await p.click('#oMain [data-vm="prev"]');
173
- const tab = await until(() => p.evaluate(() => { const t = document.querySelector('#vTabs'), pane = document.querySelector('#dOut .obody.vw[data-vw="meet-note"]'); return t && !t.hidden && pane && !pane.hidden && /Since the last one/.test(pane.textContent) ? { tabs: [...t.querySelectorAll('.vtab')].map((x) => x.textContent.trim()), main: document.querySelector('#oMain').hidden, ph: [...pane.querySelectorAll('.vm-part')].length } : null; }));
174
- ok('S2 the meeting before opens as a viewer tab beside the meeting, with its own parts in one scroll', tab && tab.tabs.length === 2 && tab.main && tab.ph === 3 && A.oneGets.includes('n0'), JSON.stringify([tab, A.oneGets]));
175
- await p.click('#dOut .obody.vw[data-vw="meet-note"] [data-vm="next"]');
176
- ok('S2 paging in the tab reads the next meeting into the same tab', await until(() => A.oneGets.includes('n2')) && await p.evaluate(() => document.querySelectorAll('#vTabs .vtab').length === 2));
177
- await p.click('#vTabs .vx');
178
- ok('S2 closing the tab shows the meeting again', await until(() => p.evaluate(() => !document.querySelector('#oMain').hidden && document.querySelector('#vTabs').hidden)));
179
-
180
- /* S8 a meeting with no note */
181
- const Z = await open({ notes: [], note: null });
182
- const zst = await until(() => Z.page.evaluate(() => { const b = document.querySelector('#oMain .vm-part'); return b && b.dataset.part === 'before' && b.open && /No notes for this meeting\./.test(document.querySelector('#oMain').textContent); }));
183
- ok('S8 with no note the detail shows Prep first and open, and the Notes part says there are no notes', zst);
184
- ok('S8 with no note During says nothing was transcribed, and no note was asked for', /Nothing was transcribed/.test((await part(Z.page, 'during')).text) && Z.oneGets.length === 0 && !(await Z.page.evaluate(() => !!document.querySelector('#oMain .vm-ser'))));
185
-
186
- /* S9 writes */
187
- const posts = [...new Set([].concat(A.reqs, Z.reqs).filter((r) => /^POST /.test(r)))].sort();
188
- ok('S9 the only writes are Make task and the series membership', posts.join() === 'POST /api/notes/series-member,POST /api/plan-items', posts.join());
189
- for (const [pth, body] of [['/api/notes/series-member', { id: 'n-nothing', key: 'off' }]]) {
190
- const res = await fetch(BASE + pth, { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify(body) });
191
- ok(`S9 ${pth} without the launch nonce is refused`, res.status === 403, String(res.status));
192
- }
193
- await A.ctx.close(); await Z.ctx.close();
194
-
195
- /* S10 floors (PMOS_SHOTS=<dir> also saves a picture of each stage) */
196
- const shotDir = process.env.PMOS_SHOTS || '';
197
- for (const [w, h, th] of [[1280, 900, 'light'], [1280, 900, 'dark']]) {
198
- if (!shotDir) break;
199
- const P = await open({ w, h, theme: th });
200
- await until(() => P.page.evaluate(() => /migration check/.test(document.querySelector('#oMain').textContent)));
201
- for (const k of ['after', 'before', 'during']) { await stage(P.page, k); await P.page.screenshot({ path: path.join(shotDir, `${k}-${w}-${th}.png`) }); }
202
- await P.ctx.close();
203
- }
204
- for (const th of ['light', 'dark']) {
205
- const P = await open({ w: 390, h: 844, theme: th });
206
- await until(() => P.page.evaluate(() => /migration check/.test(document.querySelector('#oMain').textContent)));
207
- /* measure once the meeting stylesheet has loaded and the dialog's presses are live, not on the first unstyled frame */
208
- await until(() => P.page.evaluate(() => document.querySelector('#oMain').dataset.ready === 'meeting' && [...document.styleSheets].some((x) => /premium-vw-meet\.css/.test(x.href || '') && x.cssRules.length > 0)));
209
- const fl = () => P.page.evaluate(() => ({ scroll: document.documentElement.scrollWidth <= innerWidth + 1 && document.querySelector('#oMain').scrollWidth <= document.querySelector('#oMain').clientWidth + 1,
210
- btn: [...document.querySelectorAll('#oMain .vm-sh, #oMain .vm-menu > summary, #oMain .vm-ib, #oMain .vm-lk, #oMain .mtg-task')].filter((b) => b.getClientRects().length).map((b) => Math.round(Math.min(b.getBoundingClientRect().width, b.getBoundingClientRect().height))) }));
211
- const f0 = await fl();
212
- if (shotDir) await P.page.screenshot({ path: path.join(shotDir, `after-390-${th}.png`) });
213
- await stage(P.page, 'before'); const f1 = await fl();
214
- ok(`S10 at 390 px (${th}) the detail has no sideways scroll and every press is at least 44 px`, f0.scroll && f1.scroll && f0.btn.length > 3 && [...f0.btn, ...f1.btn].every((n) => n >= 44), JSON.stringify([f0, f1]));
215
- const head = () => P.page.evaluate(() => ({ shrunk: document.querySelector('#dlg').classList.contains('shrunk'), cmp: document.querySelector('#dlg').classList.contains('cmp'), tabs: getComputedStyle(document.querySelector('#dTabs')).display }));
216
- const scrollTo = (y) => P.page.evaluate((v) => { document.querySelector('#dOut').scrollTop = v; }, y);
217
- await scrollTo(400); const s1 = await until(async () => { const h = await head(); return h.shrunk && h.tabs === 'none' ? h : null; });
218
- await scrollTo(0); const s0 = await until(async () => { const h = await head(); return !h.shrunk && h.tabs !== 'none' ? h : null; });
219
- ok(`S10 (${th}) on a phone the head shrinks to the title once the detail scrolls, and grows back at the top`, s1 && s0 && s1.cmp, JSON.stringify([s1, s0, await head()]));
220
- await P.ctx.close();
221
- }
222
- ok('S9 no page error in any run', SESS.every((x) => x.errors.length === 0), JSON.stringify(SESS.map((x) => x.errors).filter((e) => e.length)));
223
- return finish();
224
- })().catch((e) => { console.error(e); finish(1); });
91
+ await press(p, '[data-a="sermenu"]');
92
+ await until(() => p.evaluate(() => !!document.querySelector('#czViewer [data-a="m-serout"]')));
93
+ await press(p, '[data-a="m-serout"]');
94
+ 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')));
95
+
96
+ /* S9 writes: only the presses */
97
+ const allowed = ['/api/viewer-meeting/work-item', '/api/plan-items', '/api/notes/series-member'];
98
+ 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)));
99
+ ok('S9 no page error', A.errors.length === 0, A.errors.join(' | '));
100
+ await A.ctx.close();
101
+
102
+ /* S5 Before: a meeting to come, no note */
103
+ const B = await F.open(browser, BASE, '/premium-viewer.html?open=meeting&event=ev-rail&date=' + F.dayKey(F.world().RAIL), { scene: 'prep' });
104
+ const q = B.page;
105
+ const prepUp = await until(() => q.evaluate(() => !!document.querySelector('#czViewer .vz-mtg[data-mk="prep"]')), 15000);
106
+ ok('S5 a meeting to come opens on prep, with no tabs and Record in the head', prepUp && await tabs(q) === '' && await q.evaluate(() => !!document.querySelector('#czViewer .vzm-hc [data-a="record"]')), await tabs(q));
107
+ const pre = await body(q);
108
+ 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));
109
+ ok('S5 the state chip says Starts in about 30 min', /Starts in (29|30|31) min/.test(await q.textContent('#czViewer .vzm-state')), await q.textContent('#czViewer .vzm-state'));
110
+ await q.$eval('#czViewer [data-a="min"][data-i="1"]', (b) => b.click());
111
+ await until(() => q.evaluate(() => !!document.querySelector('#czViewer [data-a="minin"]')));
112
+ await q.fill('#czViewer [data-a="minin"]', '15'); await q.press('#czViewer [data-a="minin"]', 'Enter');
113
+ 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));
114
+ await q.$eval('#czViewer [data-a="addmat"]', (b) => b.click());
115
+ ok('S5 Add material opens its popover under the list, with no Waiting for design marker', await until(() => q.evaluate(() => !!document.querySelector('#czViewer .vzm-anc[data-pop="mat"] .vzm-pop [data-a="matq"]') && !document.querySelector('#czViewer [data-cz-placeholder]'))));
116
+ await B.ctx.close();
117
+
118
+ /* S6 During: a note that records */
119
+ const C = await F.open(browser, BASE, '/premium-viewer.html?open=meeting&note=n2', { init: () => { window.__premiumHolding = { id: 'n2' }; } });
120
+ const r = C.page;
121
+ const liveUp = await until(() => r.evaluate(() => !!document.querySelector('#czViewer .vz-mtg[data-mk="live"]')), 15000);
122
+ ok('S6 a recording note opens on Live notes, with Focus and Transcript beside it', liveUp && await tabs(r) === 'notes*,focus,tr', await tabs(r));
123
+ const lv = await body(r);
124
+ ok('S6 the recording line, 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));
125
+ 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), lv.slice(0, 600));
126
+ await r.$eval('#czViewer [data-a="shots"]', (b) => b.click());
127
+ 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')));
128
+ await r.$eval('#czViewer [data-a="src"]', (b) => b.click());
129
+ await r.$eval('#czViewer [data-a="app"][data-id="meet"]', (b) => b.click());
130
+ 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')));
131
+ await r.$eval('#czViewer .vz-who', (b) => b.click());
132
+ await until(() => r.evaluate(() => !!document.querySelector('#czViewer [data-a="namein"]')));
133
+ await r.fill('#czViewer [data-a="namein"]', 'Ana Lima'); await r.$eval('#czViewer [data-a="nameok"]', (b) => b.click());
134
+ 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)));
135
+ await C.ctx.close();
136
+
137
+ /* S8 a note that is not there */
138
+ const D = await F.open(browser, BASE, '/premium-viewer.html?open=meeting&note=nope');
139
+ 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))));
140
+ await D.ctx.close();
141
+
142
+ /* S10 floors: a phone, and no old layout */
143
+ const E = await F.open(browser, BASE, '/premium-viewer.html?open=meeting&note=n1', { w: 390, h: 844 });
144
+ await until(() => E.page.evaluate(() => !!document.querySelector('#czViewer .vz-mtg')), 15000);
145
+ 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; })(),
146
+ c3: [...document.querySelectorAll('script[src],link[href]')].some((x) => /c3-/.test(x.src || x.href)), old: !!document.querySelector('#czViewer #dTabs, #czViewer .stream') }));
147
+ 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.old, JSON.stringify(fl));
148
+ ok('S10 no c3 file is loaded', !fl.c3);
149
+ ok('S10 no page error on the phone', E.errors.length === 0, E.errors.join(' | '));
150
+ await E.ctx.close();
151
+ finish();
152
+ })();