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,22 +1,20 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
- /* premium-vw-rec-test.js — note recording in the premium viewer (initiative premium-viewer, S4; the prototype Wawan approved on 2026-10-19). Serves the real pages from the
4
- * real server. The Briefing model, the calendar, the notes and Focus are answered by stand-ins, so each press can be read off the request the page sent; the recorder is a
5
- * stand-in that makes the same requests the console's recorder makes (record, pause, stop) and opens no microphone. The routes' own behaviour is in their own suites.
6
- * R1 the Record control · R2 the chip · R3 the Live notes tab · R4 Focus · R5 floors
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 B = require('./lib/briefing-premium.js');
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,156 +34,71 @@ 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
- const facts = () => { const f = F.facts(); f.meetings = [{ start: START.getTime(), end: END.getTime(), title: 'Live review', with: 'Priya, Dara', initiative: null }]; return f; };
77
- const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'application/json', body: JSON.stringify(b) });
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 Record is one round mic with no label on the page (premium-calmer-first-screen)', await p.evaluate(() => { const b = [...document.querySelectorAll('#recCtl button')].filter((x) => x.offsetParent); return b.length === 1 && b[0].dataset.rc === 'mic' && !b[0].textContent.trim() && b[0].offsetWidth <= 48; }));
129
- ok('R1 Record says what it does before the press, and nothing was sent', await p.evaluate(() => /stay on this machine/.test(document.querySelector('#recCtl [data-rc="mic"]').title)) && !A.reqs.some((r) => /^POST \/api\/notes/.test(r)));
130
- await p.click('#recCtl [data-rc="mic"]');
131
- const menu = await until(() => p.evaluate(() => { const m = document.querySelector('#recCtl .recm'); return m && !m.hidden ? m.textContent : ''; }));
132
- if (process.env.SHOTS) await p.screenshot({ path: path.join(process.env.SHOTS, 'menu-1280.png') });
133
- ok('R1 the mic lists today\'s meeting under way, marked Now, and New note', /Live review/.test(menu) && /Now/.test(menu) && /New note/.test(menu), menu);
134
- await p.click('#recCtl [data-rc="ev"]');
135
- ok('R1 the first start asks "Tell everyone first" and sends nothing', await until(() => p.evaluate(() => /Tell everyone first/.test(document.querySelector('#recCtl .recm').textContent))) && A.newPosts.length === 0);
136
- await p.click('#recCtl [data-rc="no"]');
137
- ok('R1 Not yet closes the ask and sends nothing', await until(() => p.evaluate(() => document.querySelector('#recCtl .recm').hidden)) && A.newPosts.length === 0);
138
- await p.click('#recCtl [data-rc="mic"]'); await until(() => p.evaluate(() => !!document.querySelector('#recCtl [data-rc="ev"]')));
139
- await p.click('#recCtl [data-rc="ev"]'); await p.click('#recCtl [data-rc="go"]');
140
- ok('R1 "I told them, start" makes the meeting\'s note and listens on it', await until(() => A.recPosts.length === 1) && A.newPosts[0].meeting && A.newPosts[0].meeting.event_id === 'ev-live' && A.recPosts[0].id === 'n1', JSON.stringify(A.newPosts));
141
- ok('R1 the Record control hides while a note records', await until(() => p.evaluate(() => document.querySelector('#recCtl').hidden)));
142
-
143
- /* R3 the Live notes tab */
144
- ok('R3 the meeting\'s dialog opens with a Live notes tab beside its detail', await until(async () => /Live notes/.test(await tabs(p)) && /Live review/.test(await p.evaluate(() => document.querySelector('#dTitle').textContent))), await tabs(p));
145
- const lv = await until(async () => { const t = await pane(p, 'rec:n1'); return /We plan eight people/.test(t) ? t : ''; });
146
- ok('R3 the tab shows Recording with the clock, Highlight, Pause, Stop, Focus and Private', /Recording/.test(lv) && /1:0\d/.test(lv) && /Highlight/.test(lv) && /Pause/.test(lv) && /Stop/.test(lv) && /Focus/.test(lv) && /Private/.test(lv), lv.slice(0, 300));
147
- ok('R3 the transcript names who spoke, and the highlight comes from the note', /You/.test(lv) && /Dara/.test(lv) && /Plan with eight people/.test(lv));
148
- await p.fill('#dOut .obody.vw[data-vw="rec:n1"] [data-rv-mine]', 'Ask Sam about the meter'); await p.click('#dOut .rvt');
149
- ok('R3 your notes are saved through POST /api/notes/save when you leave the box', await until(() => A.savePosts.length === 1) && A.savePosts[0].id === 'n1' && A.savePosts[0].body === 'Ask Sam about the meter', JSON.stringify(A.savePosts));
150
- await p.click('#dOut .obody.vw:not([hidden]) [data-rv="private"]');
151
- ok('R3 Private asks first, saying what it deletes, and sends nothing yet', await until(() => p.evaluate(() => /deleted now/.test((document.querySelector('#dOut .vcf') || {}).textContent || ''))) && A.privPosts.length === 0);
152
- await p.click('#dOut .vcf [data-a="0"]');
153
- ok('R3 Cancel keeps the note as it was', await until(() => p.evaluate(() => !document.querySelector('#dOut .vcf'))) && A.privPosts.length === 0);
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 .vzm-hc [data-a="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 .vzm-state')) === 'Recording' && !!(await p.$('#czViewer .vzm-rec [data-a="stop"]')), 12000));
52
+
53
+ /* R2 Highlight */
54
+ await tap(p, '.vzm-rec [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, '.vzm-rec [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 in its recording line, with no Waiting for design marker', await until(async () => !!(await p.$('#czViewer .vzm-rec [data-a="resume"]')) && !(await p.$('#czViewer [data-cz-placeholder]'))));
63
+ await tap(p, '.vzm-rec [data-a="resume"]');
64
+ ok('R3 Resume records again', await until(() => posted(A.S, '/api/notes/record').length === 2));
65
+ await until(async () => !!(await p.$('#czViewer .vzm-rec [data-a="stop"]')));
66
+ await tap(p, '.vzm-rec [data-a="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
- /* R1 New note */
192
- const N = await open();
193
- await newNote(N.page);
194
- ok('R1 New makes an untitled note with no meeting and listens on it', await until(() => N.recPosts.length === 1) && N.newPosts[0].title === '' && !N.newPosts[0].meeting);
195
- ok('R1 a note with no meeting opens in a dialog of its own with its Live notes tab', await until(async () => /Live notes/.test(await tabs(N.page)) && /Untitled note/.test(await N.page.evaluate(() => document.querySelector('#dTitle').textContent))), await tabs(N.page));
196
- ok('R1 the tab of a note with no meeting has no Focus', await until(async () => /Recording/.test(await pane(N.page, 'rec:n1'))) && !(await N.page.evaluate(() => !!document.querySelector('#dOut [data-rv="fv"]'))));
197
- ok('R5 no page error with a new note', N.errors.length === 0, N.errors.join(' | '));
198
- await N.ctx.close();
73
+ /* R3 Private on a recording note */
74
+ const B = await F.open(browser, BASE, '/premium-viewer.html?open=meeting&note=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
- /* R1 no meeting today: the mic goes straight to a new note */
201
- const E = await open({ none: true });
202
- await E.page.click('#recCtl [data-rc="mic"]');
203
- ok('R1 with no meeting of today the mic asks "Tell everyone first" for a new note, lists nothing and sends nothing', await until(() => E.page.evaluate(() => /Tell everyone first/.test(document.querySelector('#recCtl .recm').textContent) && !document.querySelector('#recCtl [data-rc="ev"]'))) && E.newPosts.length === 0);
204
- await E.page.click('#recCtl [data-rc="go"]');
205
- ok('R1 …and the start makes an untitled note with no meeting', await until(() => E.recPosts.length === 1) && E.newPosts[0].title === '' && !E.newPosts[0].meeting);
206
- await E.ctx.close();
207
-
208
- /* R2 another page */
209
- const live = { id: 'n1', title: 'Live review', state: 'recording', updated_at: new Date().toISOString(), meeting: { kind: 'event', event_id: 'ev-live', start: iso(START), title: 'Live review' } };
210
- // re-pointed for premium-agreed-design: My work now opens Home (the Briefing), so "another page" is Insights, a page that is not Home
211
- const W = await open({ notes: [live], url: '/premium-insights.html' });
212
- ok('R2 a page that is not Home (Insights) shows the chip with only Open and Stop, and no Record control', await until(async () => !!(await chip(W.page))) && await W.page.evaluate(() => [...document.querySelectorAll('#recChip button')].map((b) => b.dataset.r).join() === 'open,stop' && !document.querySelector('#recCtl')), String(await chip(W.page)));
213
- await W.ctx.close();
214
-
215
- /* R5 floors: 390 px, light and dark */
216
- for (const [w, th] of [[390, 'light'], [390, 'dark'], [1280, 'dark']]) {
217
- const P = await open({ w, h: 844, theme: th });
218
- await newNote(P.page);
219
- await until(async () => /Recording/.test(await pane(P.page, 'rec:n1')));
220
- if (w < 1000) await P.page.evaluate(() => { const t = document.querySelector('#dlg [data-tab="out"], #tabOut'); if (t) t.click(); });
221
- const f = await P.page.evaluate(() => ({ scroll: document.documentElement.scrollWidth <= innerWidth + 1, btn: [...document.querySelectorAll('#dOut .obody.vw:not([hidden]) button, #recChip button')].filter((b) => b.offsetParent).map((b) => b.offsetHeight), who: [...document.querySelectorAll('#dOut .obody.vw:not([hidden]) button, #recChip button')].filter((b) => b.offsetParent && b.offsetHeight < 44).map((b) => b.className + ':' + b.textContent.trim()) }));
222
- if (process.env.SHOTS) { await sleep(900); await P.page.screenshot({ path: path.join(process.env.SHOTS, `live-${w}-${th}.png`) }); await P.page.evaluate(() => { const b = document.querySelector('#dOut [data-rv="fv"]'); if (b) b.click(); }); await until(() => P.page.evaluate(() => !!document.querySelector('#dOut .fvnow'))); await P.page.screenshot({ path: path.join(process.env.SHOTS, `focus-${w}-${th}.png`) }); }
223
- ok(`R5 at ${w} px (${th}) the Live notes tab has no sideways scroll and every press is at least 44 px`, f.scroll && f.btn.length && f.btn.every((n) => n >= 43.5), JSON.stringify(f));
224
- await P.ctx.close();
225
- }
226
- return finish();
227
- })().catch((e) => { console.error(e); finish(1); });
82
+ /* R4 Focus */
83
+ await tap(q, '[data-a="tab"][data-k="focus"]');
84
+ ok('R4 Focus is a tab of the live card, with the topics and no Waiting for design marker', await until(async () => !(await q.$('#czViewer [data-cz-placeholder]')) && /The Issue button/.test(await text(q))), (await text(q)).slice(0, 300));
85
+ await B.ctx.close();
86
+
87
+ /* R5 New note: an untitled note recorded at once */
88
+ const C = await F.open(browser, BASE, '/premium-viewer.html?open=calendar', { noLive: true });
89
+ const r = C.page;
90
+ await until(() => r.evaluate(() => !!document.querySelector('#czViewer [data-c="new"]')), 15000);
91
+ await tap(r, '[data-c="new"]');
92
+ 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)));
93
+ ok('R5 and opens it live in the card', await until(() => r.evaluate(() => !!document.querySelector('#czViewer .vz-mtg[data-mk="live"]'))));
94
+ ok('R5 window.czViews.newNote is registered for Home', await r.evaluate(() => typeof window.czViews.newNote === 'function'));
95
+ await C.ctx.close();
96
+
97
+ /* R6 floors */
98
+ const D = await F.open(browser, BASE, '/premium-viewer.html?open=meeting&note=n2', { w: 390, h: 844, init: () => { window.__premiumHolding = { id: 'n2' }; } });
99
+ await until(() => D.page.evaluate(() => !!document.querySelector('#czViewer .vzm-rec')), 15000);
100
+ const fl = await D.page.evaluate(() => ({ over: document.documentElement.scrollWidth - innerWidth, chip: !!document.querySelector('#recChip, #recCtl') }));
101
+ 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));
102
+ await D.ctx.close();
103
+ finish();
104
+ })();
@@ -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 premium viewer (initiative premium-viewer, R-SL1, R6, R7; planning/prd/premium-viewer-prd.md).
4
- * A real server on a scratch git repository with two cycles of one report (one issued). The real Insights page opens a report, and Read >
5
- * Edit the slides opens the editor as a tab of the viewer. Every save goes through the real POST /api/doc-sheet/edit and is read back from disk.
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 = '#oMain #rdEd'; // Edit draws the slide editor inside the report dialog (PM 2026-10-22: one place to edit a report)
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-insights.html?tab=library'); // Library holds the reports (premium-agreed-design G2)
77
- await until(() => p.evaluate(() => !!document.querySelector('#listSeg [data-f="rep"]')));
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 tap('#oMain [data-rr="edit"]');
87
- return until(() => p.evaluate(() => !!document.querySelector('#oMain #rdEd .sl .sl-stage .sl-cv')));
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 reader', await openReader('2026-10-12'));
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('#oMain [data-rr="edit"]').title) && !document.querySelector('#oMain [data-rr="slides"]')));
93
- ok('O3 Edit opens the slide editor inside the report dialog: no viewer tab', await openEditor() && await p.evaluate(() => { const s = window.__premiumViewer.vwState(); return !s.ids.length && !document.querySelector('#oMain').hidden && !!document.querySelector('#rdEd [data-c="close"]'); }));
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 view says the document has no slide layout yet', /no slide layout yet/.test(await p.textContent(V + ' .sl-msg')));
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 + 60, b.y + 40, { steps: 6 }); await p.mouse.up();
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 tap(V + ' [data-c="chart"]');
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 tap(V + ' [data-c="shape"]');
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 tap(V + ' [data-c="img"]');
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 tap(V + ' [data-c="theme"]'); await tap(V + ' .sl-pop [data-pick="sky"]');
146
- await tap(V + ' [data-c="layout"]'); await tap(V + ' .sl-pop [data-pick="two"]');
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 tap(V + ' [data-c="undo"]');
155
- ok('E13 Undo puts the slide back, and Redo takes it away again', (await st()).n === 5 && await (async () => { await tap(V + ' [data-c="redo"]'); const n = (await st()).n; await tap(V + ' [data-c="undo"]'); return n === 4 && (await st()).n === 5; })());
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 tap(V + ' [data-c="save"]');
165
- await until(() => p.$(V + ' .sl-savef'));
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('![The setup screen](planning/design/screen.png)'));
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('Slides for Thursday'); }, [pNew, wsNow]));
174
- ok('S6 the report reader shows the saved words, without the slide blocks', await until(() => p.evaluate(() => { const t = document.querySelector('#oMain').textContent; return t.includes('Headline this week') && !t.includes('pmos:slide'); })));
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 tap(V + ' [data-c="text"]'); await p.keyboard.type('New words');
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 tap(V + ' [data-c="save"]'); await until(() => p.$(V + ' .sl-savef')); await tap(V + ' .sl-savef [type="submit"]');
191
- ok('C1 a save over a file that changed is refused with a reason, and nothing is written', await until(() => p.evaluate((v) => /changed since the slides were opened/.test((document.querySelector(v + ' .sl-savef .sl-err') || {}).textContent || ''), V)) && posts.length === 0, JSON.stringify(posts));
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 dialog open', await until(() => p.evaluate(() => !document.querySelector('.sl-pres') && document.querySelector('#dlg').classList.contains('on'))));
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('#dlg').classList.contains('on')));
226
- await tap(V + ' [data-c="undo"]');
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('#oMain [data-rr="edit"]') && !document.querySelector('#oMain [data-rr="issue"]') && !!document.querySelector('#oMain [data-rr="view|deck"]')));
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-insights.html?theme=dark&tab=library');
241
- await until(() => q.evaluate(() => !!document.querySelector('#listSeg [data-f="rep"]')));
242
- await q.$eval('#listSeg [data-f="rep"]', (x) => x.click());
243
- await until(() => q.evaluate(() => document.querySelectorAll('#listRows [data-rpt]').length === 1));
244
- await q.$eval(`#listRows [data-rpt="${CAD}"]`, (x) => x.click());
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(v + ' .sl-tb .sl-b, ' + v + ' .sl-tha .sl-b')].filter(vis);
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 };
@@ -136,7 +136,8 @@ const BRIEFING = { ok: true, items: [{ title: 'Refund reason codes needs an anch
136
136
 
137
137
  /* R7 the first-Briefing card, and Undo */
138
138
  const C = await open({ url: '/premium.html?ws=w1&first=imp1', tools: { calendar: { started: true }, inbox: { error: 'No connection for Inbox.' } } });
139
- ok('R7 the card sits above the columns with the import\'s item, its initiative and its file', await until(() => C.page.evaluate(() => { const c = document.querySelector('#wlFirst'); return !!c && c.nextElementSibling && c.nextElementSibling.classList.contains('cols2') && /Refund reason codes needs an anchor/.test(c.textContent) && /payments board/.test(c.textContent) && /refund-codes-prd\.md:1/.test(c.textContent); })));
139
+ // premium-agreed-design: Home has no columns; the card sits at the top of Home's list (the scroller of #hmList, above the Elsewhere foot), plain; premium-uncovered-features drew it as the Today card (HmDay), so it has no Waiting for design marker
140
+ ok('R7 the card sits at the top of Home\'s list with the import\'s item, its initiative and its file', await until(() => C.page.evaluate(() => { const c = document.querySelector('#wlFirst'); const l = document.querySelector('#hmList > .hm-lsc'); return !!c && !!l && c.parentElement === l && [...l.children].filter((x) => !x.hidden).indexOf(c) === 0 && !/Waiting for design/.test(c.textContent) && /Refund reason codes needs an anchor/.test(c.textContent) && /payments board/.test(c.textContent) && /refund-codes-prd\.md:1/.test(c.textContent); })));
140
141
  ok('R7 the card lists the ticked tools: one being read, one with its reason', await C.page.evaluate(() => /Calendar is being read in an agent session/.test(document.querySelector('#wlFirst').textContent) && /No connection for Inbox\./.test(document.querySelector('#wlFirst').textContent) && !/Slack|Jira/.test(document.querySelector('#wlFirst').textContent)));
141
142
  await click(C.page, '#wlUndo');
142
143
  ok('R7 Undo this import retracts that import and returns to the found step', await until(() => C.S.undone.length === 1) && JSON.stringify(C.S.undone[0]) === '{"ws":"w1","import_id":"imp1"}' && await until(() => C.page.url().includes('/premium-welcome.html?ws=w1&step=found')) && await heading(C.page, /What PMOS found/));
@@ -146,7 +147,7 @@ const BRIEFING = { ok: true, items: [{ title: 'Refund reason codes needs an anch
146
147
  ok('R7 a Briefing with no items says nothing needs the PM and lists nothing', await until(() => E.page.evaluate(() => { const c = document.querySelector('#wlFirst'); return !!c && /Nothing needs you right now/.test(c.textContent) && !c.querySelector('ol'); })));
147
148
  await E.ctx.close();
148
149
  const N = await open({ url: '/premium.html?ws=w1' });
149
- ok('R7 without first= the Briefing has no first card', await until(() => N.page.evaluate(() => document.querySelectorAll('#rank .rr').length > 0)) && await N.page.evaluate(() => !document.querySelector('#wlFirst')));
150
+ ok('R7 without first= Home has no first card', await until(() => N.page.evaluate(() => document.querySelectorAll('#hmList .hm-pg, #hmList .hm-none').length > 0 && !/Reading your work/.test(document.querySelector('#hmList').textContent))) && await N.page.evaluate(() => !document.querySelector('#wlFirst')));
150
151
  await N.ctx.close();
151
152
 
152
153
  /* R8 not now, R9 already imported */