create-pmos 0.397.0 → 0.398.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/package.json +13 -13
  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 +101 -52
  8. package/workspace/briefing-premium-board-test.js +252 -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 +86 -196
  12. package/workspace/briefing-premium-doc-edit-test.js +95 -83
  13. package/workspace/briefing-premium-initiative-test.js +159 -296
  14. package/workspace/briefing-premium-insights-test.js +337 -219
  15. package/workspace/briefing-premium-metrics-test.js +53 -97
  16. package/workspace/briefing-premium-products-test.js +40 -27
  17. package/workspace/briefing-premium-sources-test.js +66 -48
  18. package/workspace/briefing-premium-test.js +150 -647
  19. package/workspace/briefing-premium-work-test.js +88 -283
  20. package/workspace/changelog.json +12 -0
  21. package/workspace/fixtures/board-premium-trail.js +32 -0
  22. package/workspace/fixtures/premium-viewer-fixtures.js +182 -0
  23. package/workspace/guide/briefing-premium.md +3 -1
  24. package/workspace/guide/home.md +47 -0
  25. package/workspace/guide/index.md +1 -0
  26. package/workspace/lib/agent-roles.js +71 -0
  27. package/workspace/lib/board-premium.js +85 -19
  28. package/workspace/lib/board-trail.js +223 -0
  29. package/workspace/lib/home-work-item.js +58 -0
  30. package/workspace/lib/insights-goals.js +196 -0
  31. package/workspace/lib/insights-premium.js +62 -14
  32. package/workspace/lib/insights-records.js +101 -0
  33. package/workspace/lib/jira-tickets.js +1 -1
  34. package/workspace/lib/route-modules.js +4 -0
  35. package/workspace/lib/routes-board-trail.js +33 -0
  36. package/workspace/lib/routes-home-desk.js +176 -0
  37. package/workspace/lib/routes-insights-premium.js +12 -3
  38. package/workspace/lib/routes-insights-records.js +129 -0
  39. package/workspace/lib/routes-notes.js +1 -0
  40. package/workspace/lib/routes-viewer.js +108 -0
  41. package/workspace/lib/transcript-steps.js +123 -0
  42. package/workspace/lib/viewer-meeting.js +205 -0
  43. package/workspace/lib/viewer-report.js +89 -0
  44. package/workspace/package-lock.json +2 -2
  45. package/workspace/package.json +1 -1
  46. package/workspace/premium-board-actions-test.js +85 -75
  47. package/workspace/premium-briefing-depth-test.js +66 -53
  48. package/workspace/premium-chat-attach-test.js +54 -63
  49. package/workspace/premium-chat-chart-tab-test.js +35 -37
  50. package/workspace/premium-chat-context-test.js +19 -18
  51. package/workspace/premium-chat-goal-view-test.js +23 -23
  52. package/workspace/premium-chat-notes-test.js +26 -31
  53. package/workspace/premium-chat-report-tab-test.js +32 -28
  54. package/workspace/premium-chat-term-test.js +16 -16
  55. package/workspace/premium-chat-viewer-test.js +60 -59
  56. package/workspace/premium-core-doc-issue-test.js +50 -43
  57. package/workspace/premium-html-viewer-test.js +14 -17
  58. package/workspace/premium-phone-card-test.js +7 -2
  59. package/workspace/premium-phone-room-test.js +41 -35
  60. package/workspace/premium-report-read-test.js +115 -197
  61. package/workspace/premium-viewer-download-test.js +19 -22
  62. package/workspace/premium-viewer-flicker-test.js +11 -16
  63. package/workspace/premium-viewer-share-test.js +6 -9
  64. package/workspace/premium-viewer-test.js +41 -60
  65. package/workspace/premium-vw-backlog-test.js +53 -33
  66. package/workspace/premium-vw-cal-test.js +82 -128
  67. package/workspace/premium-vw-copy-test.js +17 -33
  68. package/workspace/premium-vw-doc-test.js +11 -10
  69. package/workspace/premium-vw-item-test.js +50 -49
  70. package/workspace/premium-vw-jira-test.js +53 -27
  71. package/workspace/premium-vw-meet-test.js +118 -187
  72. package/workspace/premium-vw-notes-test.js +85 -108
  73. package/workspace/premium-vw-rec-test.js +72 -194
  74. package/workspace/premium-vw-slides-test.js +46 -50
  75. package/workspace/premium-welcome-test.js +3 -2
  76. package/workspace/premium-work-depth-test.js +61 -53
  77. package/workspace/public/pm/bd-acts.js +305 -0
  78. package/workspace/public/pm/bd-span.js +186 -82
  79. package/workspace/public/pm/bd-stages.js +25 -11
  80. package/workspace/public/pm/c3-doc-sheet.js +1 -1
  81. package/workspace/public/pm/c3-md.js +3 -395
  82. package/workspace/public/pm/c3-phone-detail.js +1 -1
  83. package/workspace/public/pm/c3-phone-model.js +3 -68
  84. package/workspace/public/pm/chat-term.js +3 -3
  85. package/workspace/public/pm/cozy-board.css +497 -230
  86. package/workspace/public/pm/cozy-home.css +570 -142
  87. package/workspace/public/pm/cozy-home.js +5 -3
  88. package/workspace/public/pm/cozy-insights.css +296 -167
  89. package/workspace/public/pm/cozy-md.js +396 -0
  90. package/workspace/public/pm/cozy-nav.js +17 -6
  91. package/workspace/public/pm/cozy-placeholder.js +26 -0
  92. package/workspace/public/pm/cozy-viewer.css +3 -3
  93. package/workspace/public/pm/cozy-viewer.js +144 -0
  94. package/workspace/public/pm/cozy-vw.css +485 -0
  95. package/workspace/public/pm/cozy.css +83 -1
  96. package/workspace/public/pm/home-adddoc.js +48 -0
  97. package/workspace/public/pm/home-app.js +905 -0
  98. package/workspace/public/pm/home-around.js +515 -0
  99. package/workspace/public/pm/home-chat.js +459 -0
  100. package/workspace/public/pm/home-data.js +312 -0
  101. package/workspace/public/pm/home-draft.js +68 -0
  102. package/workspace/public/pm/home-more.js +249 -0
  103. package/workspace/public/pm/home-phone-card.js +109 -0
  104. package/workspace/public/pm/home-work.js +519 -0
  105. package/workspace/public/pm/phone-moment.js +69 -0
  106. package/workspace/public/pm/pm-work-view.js +1 -1
  107. package/workspace/public/pm/premium-attach.js +4 -0
  108. package/workspace/public/pm/premium-board.js +423 -394
  109. package/workspace/public/pm/premium-chart-tab.js +110 -62
  110. package/workspace/public/pm/premium-deck.js +3 -3
  111. package/workspace/public/pm/premium-first.js +25 -21
  112. package/workspace/public/pm/premium-insights.js +792 -568
  113. package/workspace/public/pm/premium-meeting.js +61 -549
  114. package/workspace/public/pm/premium-notes.js +1 -1
  115. package/workspace/public/pm/premium-report-frame.css +20 -0
  116. package/workspace/public/pm/premium-report-read.js +509 -480
  117. package/workspace/public/pm/premium-report-tab.js +87 -63
  118. package/workspace/public/pm/premium-shell.js +72 -119
  119. package/workspace/public/pm/premium-viewer.js +22 -1
  120. package/workspace/public/pm/premium-vw-cal.js +187 -48
  121. package/workspace/public/pm/premium-vw-doc.css +6 -0
  122. package/workspace/public/pm/premium-vw-doc.js +40 -2
  123. package/workspace/public/pm/premium-vw-file.js +2 -2
  124. package/workspace/public/pm/premium-vw-meet.js +6 -83
  125. package/workspace/public/pm/premium-vw-mtg.js +731 -0
  126. package/workspace/public/pm/premium-vw-notes.js +56 -69
  127. package/workspace/public/pm/premium-vw-open.js +35 -0
  128. package/workspace/public/pm/premium-vw-page.js +16 -0
  129. package/workspace/public/pm/premium-vw-rec.js +11 -218
  130. package/workspace/public/pm/premium-vw-slides.css +5 -0
  131. package/workspace/public/pm/premium-vw-slides.js +44 -8
  132. package/workspace/public/pm/term-view.js +22 -0
  133. package/workspace/public/premium-board.html +28 -70
  134. package/workspace/public/premium-initiative.html +8 -48
  135. package/workspace/public/premium-insights.html +22 -60
  136. package/workspace/public/premium-viewer.html +20 -0
  137. package/workspace/public/premium.html +16 -107
  138. package/workspace/server.js +18 -3
  139. package/workspace/test-files.json +1 -0
  140. package/workspace/test-lists/home-libs.json +9 -0
  141. package/workspace/test-lists/premium-report-read.json +1 -1
  142. package/workspace/test-lists/premium-vw-agreed.json +9 -0
  143. package/workspace/test-lists/premium-vw-notes.json +1 -1
  144. package/workspace/public/pm/premium-work.js +0 -729
  145. package/workspace/public/pm/premium.js +0 -1146
@@ -1,25 +1,21 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
- /* briefing-premium-calendar-2-test.js — Add and Remove material and Make task in the premium meeting dialog (initiative briefing-premium-calendar, slice 2;
4
- * planning/prd/briefing-premium-calendar-2-prd.md M1 to M7). Serves the real page from the real server. The Briefing model, the calendar answer, the replay and the material
5
- * are answered by stand-ins, so each press can be read off the request the page sent; the routes' own behaviour is in their own suites.
6
- * M1 add material · M2 remove · M3 what each press records · M4 make task · M5 honest states · M6 only the named writes · M7 floors and fidelity
3
+ /* briefing-premium-calendar-2-test.js — Add and Remove material and Make task in the meeting card (initiative briefing-premium-calendar, slice 2;
4
+ * planning/prd/briefing-premium-calendar-2-prd.md M1 to M7; re-pointed for premium-agreed-design, area viewer: the meeting opens in the Viewer card,
5
+ * /premium-viewer.html, not in the old Briefing dialog). Serves the real page from the real server; the calendar, the notes, the material and the
6
+ * plan items are answered by stand-ins (fixtures/premium-viewer-fixtures.js), so each press can be read off the request the page sent.
7
+ * The Add material sheet has no design in the Agreed mockup: it is the plain version, marked "Waiting for design".
8
+ * M1 add material · M2 remove · M3 what each press records · M4 make task · M5 honest states · M6 only the named writes · M7 floors
7
9
  * Every wait polls the page; no fixed sleep stands in for a state. */
8
- const fs = require('fs');
9
10
  const path = require('path');
10
11
  const { spawn } = require('child_process');
11
12
  const { findBrowser } = require('./lib/find-browser');
12
- const CT = require('./lib/premium-console-type'); // the mockup is read with the console's type (PM, 2026-10-19), as premium.css is
13
- const CT_VENDOR = 'file://' + path.join(__dirname, 'public', 'vendor') + '/';
14
13
  const T = require('./test-run').configure({ name: 'briefing-premium-calendar-2' });
15
- const B = require('./lib/briefing-premium.js');
16
- const F = require('./fixtures/briefing-premium-facts.js');
14
+ const F = require('./fixtures/premium-viewer-fixtures.js');
17
15
 
18
- const BASE = T.BASE;
19
- const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
20
- const until = async (fn, ms = 10000, step = 100) => { const t0 = Date.now(); for (;;) { const v = await fn(); if (v) return v; if (Date.now() - t0 > ms) return v; await sleep(step); } };
16
+ const BASE = T.BASE, until = F.until;
21
17
  const results = [];
22
- const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + extra : ''}`); };
18
+ const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + String(extra).slice(0, 500) : ''}`); };
23
19
  let srv = null; let browser = null;
24
20
  const finish = async (code) => {
25
21
  if (browser) await browser.close().catch(() => {});
@@ -31,33 +27,7 @@ const finish = async (code) => {
31
27
  };
32
28
  process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
33
29
 
34
- const pad = (n) => String(n).padStart(2, '0');
35
- const dayKey = (d) => `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`;
36
- 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)}`; };
37
- const NOW = new Date();
38
- const at = (h, m, plus = 0) => { const d = new Date(NOW.getFullYear(), NOW.getMonth(), NOW.getDate() + plus, h, m, 0, 0); return d; };
39
- const monday = () => { const d = new Date(NOW.getFullYear(), NOW.getMonth(), NOW.getDate()); d.setDate(d.getDate() - ((d.getDay() + 6) % 7)); return d; };
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
- const put = (d, e) => cells.find((c) => c.key === dayKey(d)).events.push(e);
44
- put(at(9, 30), { id: 'ev-checkout', at: iso(at(9, 30)), end: iso(at(10, 15)), title: 'Checkout sync', attendees: ['Priya', 'Dara'] });
45
- put(at(14, 0), { id: 'ev-sprint', at: iso(at(14, 0)), end: iso(at(15, 0)), title: 'Sprint planning', attendees: ['Dara', 'Priya', 'Sam'], series: 'sprint-planning' });
46
- const other = at(9, 30, NOW.getDay() === 0 ? -1 : 1); // a day other than today, still in the week unless it runs off the end
47
- if (cells.some((c) => c.key === dayKey(other))) put(other, { id: 'ev-standup', at: iso(other), end: iso(new Date(other.getTime() + 30 * 60000)), title: 'Standup', attendees: [] });
48
- return { ok: true, view: 'week', range: { start: cells[0].key, end: cells[6].key }, cells, events_source: 'calendar-memory', today: dayKey(NOW),
49
- context: { 'ev-sprint': { phase: 'upcoming', level: { kind: 'board', ws: 'w1', id: 'idpf', name: 'IDPF', why: 'you linked it to the board', by: 'pm' } } },
50
- link_boards: [{ ws: 'w1', id: 'idpf', name: 'IDPF' }, { ws: 'w1', id: 'pay', name: 'Payments' }], gantt: [{ id: 'premium-ux', title: 'Premium UX' }] };
51
- };
52
- const REPLAY0 = { ok: true, note: { id: 'n1', title: 'Sprint planning notes' }, meeting: { title: 'Sprint planning', attendees: ['Dara', 'Priya', 'Sam'] }, audio: { url: '/x', ms: 1500000 }, length_ms: 1500000, lines: [{}],
53
- keys: [{ k: 'decision', text: 'Plan the sprint with eight people', state: 'draft' }, { k: 'action', text: 'Sam confirms the data fix owner', owner: 'Sam', due: 'Tue', state: 'owner' }, { k: 'question', text: 'Does a release eat the capacity?', state: 'open' }] };
54
- const MATERIAL = { ok: true, key: 'k', items: [{ id: 'm1', kind: 'doc', ref: 'r', title: 'Capacity sheet', scope: 'series' }, { id: 'm2', kind: 'link', url: 'https://x.example', title: 'Roadmap', scope: 'meeting' }] };
55
- const MOCKUP = fs.readFileSync(path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'briefing-artifact.html'), 'utf8');
56
-
57
-
58
- const REPLAY = Object.assign({}, REPLAY0, { note: { id: 'n1', title: 'Sprint planning notes', ws: 'w1', initiative: { id: 'premium-ux', title: 'Premium UX', ws: 'w1' } } });
59
- const REPLAY_NOINI = Object.assign({}, REPLAY0, { note: { id: 'n1', title: 'Sprint planning notes' } });
60
- const SUGGEST = { ok: true, suggested: [{ kind: 'pmos-doc', ref: 'planning/prd/premium-ux-prd.md', title: 'Premium UX PRD', meta: 'document', ws: 'w1' }], found: [{ kind: 'report', ref: 'planning/reports/q3.md', title: 'Q3 report', meta: 'report', ws: 'w1' }] };
30
+ const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'application/json', body: JSON.stringify(b) });
61
31
 
62
32
  (async () => {
63
33
  const exe = findBrowser();
@@ -67,172 +37,139 @@ const SUGGEST = { ok: true, suggested: [{ kind: 'pmos-doc', ref: 'planning/prd/p
67
37
  srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
68
38
  await T.waitForServer(BASE);
69
39
  browser = await chromium.launch({ executablePath: exe });
40
+ const W = F.world();
41
+ const tap = (p, sel) => p.$eval('#czViewer ' + sel, (b) => b.click());
42
+ const text = (p) => p.evaluate(() => (document.querySelector('#czViewer') || {}).innerText || '');
43
+ const posted = (S, pth) => S.posts.filter((x) => x.path === pth);
44
+ const ALL = [];
70
45
 
71
- const facts = () => { const f = F.facts(); f.meetings = [{ start: at(14, 0).getTime(), end: at(15, 0).getTime(), title: 'Sprint planning', with: 'Dara, Priya, Sam', initiative: null }]; return f; };
72
- const open = async ({ w = 1280, h = 900, theme = 'light', replay = REPLAY, items = [{ id: 'm1', kind: 'link', url: 'https://x.example/road', title: 'Roadmap', scope: 'meeting', from: 'you' }], writeStatus = 200, planStatus = 200, stages = [{ id: 'st1', label: 'Intake' }], stage = 'before' } = {}) => {
73
- const ctx = await browser.newContext({ viewport: { width: w, height: h } });
74
- const page = await ctx.newPage();
75
- const S = { errors: [], reqs: [], matPosts: [], planPosts: [], suggestGets: [], items: items.slice() };
76
- page.on('pageerror', (e) => S.errors.push(String((e && e.message) || e)));
77
- page.on('request', (r) => { if (r.url().startsWith(BASE)) S.reqs.push(r.method() + ' ' + new URL(r.url()).pathname); });
78
- const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'application/json', body: JSON.stringify(b) });
79
- await page.route('**/api/briefing-premium*', (r) => json(r, { ok: true, state: 'ready', model: B.build(facts()), as_of: Date.now() }));
80
- await page.route('**/api/calendar-views*', (r) => json(r, weekAnswer()));
81
- await page.route('**/api/meeting-replay*', (r) => json(r, replay));
82
- await page.route('**/api/meeting-material/suggest*', (r) => { S.suggestGets.push(new URL(r.request().url()).search); json(r, SUGGEST); });
83
- await page.route('**/api/meeting-material?*', (r) => {
84
- const req = r.request();
85
- if (req.method() === 'POST') {
86
- const b = JSON.parse(req.postData() || '{}'); S.matPosts.push(b);
87
- if (writeStatus !== 200) return json(r, { ok: false, error: 'a page press is required' }, writeStatus);
88
- if (b.op === 'add') S.items.push(Object.assign({ id: 'n' + S.items.length, from: 'you', scope: b.scope }, b.item));
89
- else S.items = S.items.filter((i) => (i.ref || i.url) !== (b.item.ref || b.item.url));
90
- return json(r, { ok: true, items: S.items });
91
- }
92
- return json(r, { ok: true, key: 'k', items: S.items });
93
- });
94
- await page.route('**/api/meeting-material', (r) => {
95
- const req = r.request(); const b = JSON.parse(req.postData() || '{}'); S.matPosts.push(b);
96
- if (writeStatus !== 200) return json(r, { ok: false, error: 'a page press is required' }, writeStatus);
97
- if (b.op === 'add') S.items.push(Object.assign({ id: 'n' + S.items.length, from: 'you', scope: b.scope }, b.item));
98
- else S.items = S.items.filter((i) => (i.ref || i.url) !== (b.item.ref || b.item.url));
99
- return json(r, { ok: true, items: S.items });
100
- });
101
- await page.route('**/api/plan-items*', (r) => {
102
- const req = r.request();
103
- if (req.method() === 'POST') { const b = JSON.parse(req.postData() || '{}'); S.planPosts.push(b); return planStatus === 200 ? json(r, { ok: true, written: [{ item: 'item-9' }] }) : json(r, { ok: false, error: 'a page press is required' }, planStatus); }
104
- return json(r, { ok: true, stages });
105
- });
106
- await page.route('**/api/calendar-links', (r) => json(r, { ok: true }));
107
- await page.goto(BASE + '/premium.html?theme=' + theme);
108
- S.up = await until(() => page.evaluate(() => document.querySelectorAll('#rank .rr').length > 0 && document.querySelectorAll('#tl .ev').length > 0), 20000);
109
- await until(() => page.evaluate(() => document.querySelectorAll('#wkStrip [data-day]').length === 5)); // the card's day strip: today is picked, so the row is a Today row
110
- await page.evaluate(() => { const r = [...document.querySelectorAll('#tl .ev')].find((e) => e.querySelector('b').textContent === 'Sprint planning'); r.id = 'rowSprint'; r.click(); });
111
- S.dlg = await until(() => page.evaluate(() => document.querySelector('#dlg').classList.contains('on') && !!document.querySelector('#mmAdd') && /Roadmap|No material/.test(document.querySelector('#oMain').textContent)));
112
- // the detail shows Notes first and open when the meeting has notes: material is in Prep and material, Make task in Notes and next steps
113
- if (S.dlg && stage) { await page.evaluate((k) => { const d = document.querySelector(`#oMain .vm-body[data-part="${k}"]`); if (d && !d.open) d.querySelector('summary').click(); }, stage); S.dlg = await until(() => page.evaluate((k) => document.querySelector(`#oMain .vm-body[data-part="${k}"]`).open, stage)); }
114
- return Object.assign(S, { ctx, page });
46
+ /* the material of "Rail review": what is linked is kept per test, so Remove and Undo can be read back from the list */
47
+ const material = (X, o = {}) => {
48
+ X.mat = [{ kind: 'pmos-doc', title: 'Rail PRD', ref: 'planning/prd/rail.md', from: 'you', scope: 'series' }, { kind: 'link', title: 'Figma: report panel', url: 'https://x.example/f', topic: 'The report panel', scope: 'meeting' }];
49
+ X.sugg = [];
50
+ return Promise.all([
51
+ X.page.route('**/api/meeting-focus?*', async (r) => { const res = await r.fetch().catch(() => null); let b = {}; try { b = res ? await res.json() : {}; } catch { b = {}; } return json(r, { ...b, ok: true, material: X.mat }); }),
52
+ X.page.route('**/api/meeting-material/suggest*', (r) => { const qq = new URL(r.request().url()).searchParams.get('q') || ''; X.sugg.push(qq); return json(r, { ok: true, suggested: [{ kind: 'pmos-doc', title: 'Rail brief', ref: 'planning/briefs/rail.md', meta: 'Brief · Oct 20' }], found: qq.length >= 2 ? [{ kind: 'report', title: 'Partner review', ref: 'reports/partner-review/2026-10-12.md', meta: 'Report · Oct 12' }] : [] }); }),
53
+ X.page.route('**/api/meeting-material?*', (r) => json(r, { ok: true, key: 'k', items: X.mat, topics: o.noTopics ? [] : [{ id: 't1', text: 'Rail placement' }, { id: 't2', text: 'Phone layout' }] })),
54
+ X.page.route('**/api/meeting-material', (r) => {
55
+ const b = JSON.parse(r.request().postData() || '{}'); X.S.posts.push({ path: '/api/meeting-material', body: b });
56
+ if (X.refuse) return json(r, { ok: false, error: X.refuse }, 409);
57
+ const same = (m) => (b.item.url ? m.url === b.item.url : m.ref === b.item.ref) && (m.scope || 'meeting') === b.scope;
58
+ if (b.op === 'remove') X.mat = X.mat.filter((m) => !same(m));
59
+ else X.mat = X.mat.concat([{ ...b.item, scope: b.scope, from: 'you', ...(b.topic ? { topic: b.topic } : {}) }]);
60
+ return json(r, { ok: true, items: X.mat });
61
+ }),
62
+ ]);
63
+ };
64
+ const openRail = async (o = {}) => {
65
+ const X = await F.open(browser, BASE, '/premium-viewer.html?open=calendar', { scene: 'prep', noLive: true, ...o });
66
+ ALL.push(X);
67
+ await material(X, o);
68
+ await X.page.goto(BASE + '/premium-viewer.html?open=meeting&event=ev-rail&date=' + F.dayKey(W.RAIL));
69
+ X.up = await until(() => X.page.evaluate(() => !!document.querySelector('#czViewer [data-a="addmat"]')), 15000);
70
+ return X;
115
71
  };
116
- const text = (p) => p.evaluate(() => document.querySelector('#oMain').textContent);
117
72
 
118
- const A = await open();
119
- ok('0 the dialog opens on a week row with Add material', A.up && A.dlg);
120
- if (!A.up || !A.dlg) return finish(1);
73
+ /* M1 add material */
74
+ const A = await openRail();
121
75
  const p = A.page;
76
+ ok('M1 a calendar meeting opens in the Viewer card with + Add material in Prep', A.up, (await text(p)).slice(0, 300));
77
+ if (!A.up) return finish(1);
78
+ ok('M2 the material is listed with the scope it was linked at', await until(async () => /Rail PRD/.test(await text(p)) && /every meeting of the series/.test(await text(p)) && /For The report panel/.test(await text(p))), (await text(p)).slice(0, 600));
79
+ await tap(p, '[data-a="addmat"]');
80
+ ok('M1 the sheet opens in the card, marked Waiting for design, with what is linked, Find in PMOS and Or paste a link', await until(() => p.evaluate(() => !!document.querySelector('#czViewer [data-cz-placeholder="Add material"]') && !!document.querySelector('#czViewer [data-f="q"]') && !!document.querySelector('#czViewer [data-f="url"]') && document.querySelectorAll('#czViewer [data-f="rm"]').length === 2)));
81
+ ok('M1 the sheet says the invite is not changed', /The invite in your calendar is not changed/.test(await text(p)));
82
+ ok('M1 Suggested asks for the level of this meeting and shows what it returned', await until(async () => A.sugg.includes('') && /Rail brief/.test(await text(p))), JSON.stringify(A.sugg));
83
+ await p.fill('#czViewer [data-f="q"]', 'p');
84
+ await p.waitForTimeout(400); // the search waits 220 ms after typing stops; a one-letter search must not ask
85
+ ok('M1 a one-letter search asks for nothing', !A.sugg.includes('p'), JSON.stringify(A.sugg));
86
+ await p.fill('#czViewer [data-f="q"]', 'partner');
87
+ ok('M1 Find in PMOS shows what the search returned', await until(async () => A.sugg.includes('partner') && /Partner review/.test(await text(p))), JSON.stringify(A.sugg));
88
+ await p.fill('#czViewer [data-f="url"]', 'http://x.example/plain');
89
+ await tap(p, '[data-f="addurl"]');
90
+ ok('M1 an address that is not https says so and is not added', await until(async () => /Only an https link can be added/.test(await text(p))) && posted(A.S, '/api/meeting-material').length === 0);
91
+ ok('M3 the sheet offers a topic of the meeting', await until(() => p.evaluate(() => { const s = document.querySelector('#czViewer [data-f="topic"]'); return s && [...s.options].map((o) => o.textContent).join('|') === 'For the whole meeting|For Rail placement|For Phone layout'; })));
92
+ await p.selectOption('#czViewer [data-f="topic"]', 'Rail placement');
93
+ await p.check('#czViewer [data-f="series"]');
94
+ await p.click('#czViewer [data-f="pick"]');
95
+ const add = await until(() => posted(A.S, '/api/meeting-material')[0]);
96
+ ok('M1 Add posts one line to /api/meeting-material for the series, with the topic', add && add.body.op === 'add' && add.body.scope === 'series' && add.body.topic === 'Rail placement' && add.body.event.id === 'ev-rail' && add.body.item.ref === 'reports/partner-review/2026-10-12.md', JSON.stringify(add && add.body));
97
+ ok('M3 the list is read again and shows the new row, and the status says what was added', await until(async () => /Partner review/.test(await text(p)) && /Added “Partner review” for every meeting of the series\./.test(await text(p)) && !(await p.$('#czViewer [data-cz-placeholder="Add material"]'))), (await text(p)).slice(0, 500));
122
98
 
123
- /* M1 the sheet */
124
- ok('M2 each removable row has Remove, and the row says its scope', await p.evaluate(() => { const b = document.querySelector('.mtg-rm'); return !!b && /Roadmap/.test(b.getAttribute('aria-label')) && /document itself is not changed/.test(b.title) && /for this meeting/.test(b.closest('.mat').textContent); }));
125
- await p.click('#mmAdd');
126
- const sheet = await until(() => p.evaluate(() => { const s = document.querySelector('.mtg-sheet'); return s && /Premium UX PRD/.test(s.textContent) ? s.textContent : null; }));
127
- ok('M1 the sheet opens in the dialog with Suggested, Find in PMOS and Or paste a link', sheet && /Suggested for this meeting/.test(sheet) && /Find in PMOS/.test(sheet) && /Or paste a link/.test(sheet), String(sheet).slice(0, 200));
128
- ok('M1 the sheet says the invite is not changed, and focus is on Back', sheet && /invite in your calendar is not changed/.test(sheet) && await p.evaluate(() => document.activeElement && document.activeElement.id === 'mmBack'));
129
- ok('M1 Suggested asked for the workspace-free level query of this meeting', A.suggestGets.length >= 1 && !/q=/.test(A.suggestGets[0]), JSON.stringify(A.suggestGets));
130
- await p.fill('#mmFind', 'q3');
131
- const found = await until(() => p.evaluate(() => /Q3 report/.test(document.querySelector('#mmFound').textContent)));
132
- ok('M1 Find in PMOS shows what the search returned, and nothing for one letter', found && A.suggestGets.some((q) => /q=q3/.test(q)));
133
- await p.fill('#mmFind', 'q');
134
- ok('M1 a one-letter search shows nothing', await until(() => p.evaluate(() => document.querySelector('#mmFound').textContent === '')));
135
- await p.fill('#mmLinkIn', 'not a link');
136
- ok('M1 an address that is not https says so and cannot be picked', await p.evaluate(() => /Paste an https address/.test(document.querySelector('#mmPaste').textContent) && !document.querySelector('#mmPaste [data-pick]')));
137
- ok('M1 no Add button shows before something is picked', await p.evaluate(() => !document.querySelector('#mmDo')));
138
- await p.click('#mmSug [data-pick]');
139
- const opt = await p.evaluate(() => ({ line: document.querySelector('#mmLine').textContent, pressed: [...document.querySelectorAll('[data-scope]')].map((b) => b.dataset.scope + ':' + b.getAttribute('aria-pressed')).join(), picked: document.querySelector('#mmSug .mtg-on') && document.querySelector('#mmSug .mtg-on').textContent }));
140
- ok('M3 picking says what Add records, before the press', /Adds “Premium UX PRD” to this meeting\. The calendar is not written\./.test(opt.line) && opt.picked === 'Picked' && /meeting:true,series:false/.test(opt.pressed), JSON.stringify(opt));
141
- await p.click('[data-scope=series]');
142
- ok('M3 the line follows the scope', await p.evaluate(() => /to every meeting in the series\./.test(document.querySelector('#mmLine').textContent)));
143
- await p.click('#mmCancel');
144
- ok('M1 Cancel returns to the meeting and focus returns to Add material', await p.evaluate(() => !document.querySelector('.mtg-sheet') && document.activeElement && document.activeElement.id === 'mmAdd') && A.matPosts.length === 0);
145
-
146
- /* M1 add */
147
- await p.click('#mmAdd'); await until(() => p.evaluate(() => /Premium UX PRD/.test(document.querySelector('#mmSug').textContent)));
148
- await p.click('#mmSug [data-pick]'); await p.click('[data-scope=series]'); await p.click('#mmDo');
149
- await until(() => A.matPosts.length === 1);
150
- ok('M1 Add posts one line to /api/meeting-material for the series', A.matPosts.length === 1 && A.matPosts[0].op === 'add' && A.matPosts[0].scope === 'series' && A.matPosts[0].item.ref === 'planning/prd/premium-ux-prd.md' && A.matPosts[0].event.series === 'sprint-planning' && A.matPosts[0].event.id === 'ev-sprint', JSON.stringify(A.matPosts));
151
- const after = await until(() => p.evaluate(() => /Premium UX PRD/.test(document.querySelector('#oMain').textContent) && !document.querySelector('.mtg-sheet') ? { text: document.querySelector('#oMain').textContent, focus: document.activeElement && document.activeElement.id } : null));
152
- ok('M3 the list is read again from the route and shows the new row, and the status says what was added', after && /Premium UX PRD/.test(after.text) && /for every meeting of this series/.test(after.text) && /Added “Premium UX PRD” to every meeting in the series\./.test(after.text) && after.focus === 'mmAdd', JSON.stringify(after));
153
-
154
- /* M2 remove and undo */
155
- const nRm = A.matPosts.length;
156
- await p.click('.mtg-rm[aria-label="Remove Roadmap"]');
157
- await until(() => A.matPosts.length === nRm + 1);
158
- const rm = A.matPosts[nRm];
159
- ok('M2 Remove posts the url at the scope the row was added', rm.op === 'remove' && rm.scope === 'meeting' && rm.item.url === 'https://x.example/road', JSON.stringify(rm));
160
- const gone = await until(() => p.evaluate(() => /Removed “Roadmap” from this meeting\. The document itself is not changed\./.test(document.querySelector('#mtgStatus').textContent) && !/for this meeting.*Roadmap/.test(document.querySelector('#oMain').textContent) && !!document.querySelector('#mtgUndo')));
161
- ok('M2 the row leaves after the list is read again, and the status offers Undo', gone);
162
- await p.click('#mtgUndo');
163
- await until(() => A.matPosts.length === nRm + 2);
164
- ok('M2 Undo adds the same item back at the same scope', A.matPosts[nRm + 1].op === 'add' && A.matPosts[nRm + 1].scope === 'meeting' && A.matPosts[nRm + 1].item.url === 'https://x.example/road', JSON.stringify(A.matPosts[nRm + 1]));
165
- ok('M2 the row is back and the status says so', await until(() => p.evaluate(() => /Put back\./.test(document.querySelector('#mtgStatus').textContent) && /Roadmap/.test(document.querySelector('#oMain').textContent))));
166
- ok('M6 nothing else was written by the material work', A.planPosts.length === 0 && ![...A.reqs].some((r) => /POST \/api\/(notes|meeting-focus|calendar-links)/.test(r)));
167
- ok('M6 no page error so far', A.errors.length === 0, JSON.stringify(A.errors));
99
+ /* M2 remove, then Undo */
100
+ await tap(p, '[data-a="addmat"]');
101
+ await until(() => p.evaluate(() => document.querySelectorAll('#czViewer [data-f="rm"]').length === 3));
102
+ await p.click('#czViewer [data-f="rm"][aria-label="Remove Rail PRD"]');
103
+ const rm = await until(() => posted(A.S, '/api/meeting-material').find((x) => x.body.op === 'remove'));
104
+ ok('M2 Remove posts the item at the scope it was added', rm && rm.body.scope === 'series' && rm.body.item.ref === 'planning/prd/rail.md', JSON.stringify(rm && rm.body));
105
+ ok('M2 the row leaves after the list is read again, and the status offers Undo', await until(async () => !/Rail PRD/.test((await text(p)).replace(/Removed “Rail PRD”\./, '')) && !!(await p.$('#czViewer [data-a="msgundo"]'))), (await text(p)).slice(0, 500));
106
+ await tap(p, '[data-a="msgundo"]');
107
+ const back = await until(() => posted(A.S, '/api/meeting-material').filter((x) => x.body.op === 'add')[1]);
108
+ ok('M2 Undo adds the same item back at the same scope', back && back.body.scope === 'series' && back.body.item.ref === 'planning/prd/rail.md', JSON.stringify(back && back.body));
109
+ ok('M2 the row is back and the status says so', await until(async () => /It is back/.test(await text(p)) && /Rail PRD/.test(await text(p))));
168
110
 
169
- /* M5 refusals */
170
- const D = await open({ writeStatus: 403 });
171
- await D.page.click('.mtg-rm');
172
- const refused = await until(() => D.page.evaluate(() => /The material was not removed: a page press is required/.test(document.querySelector('#mtgStatus').textContent) && /Roadmap/.test(document.querySelector('#oMain').textContent)));
173
- ok('M5 a refused Remove shows the reason and the row stays', refused && D.items.length === 1);
174
- await D.page.click('#mmAdd'); await until(() => D.page.evaluate(() => /Premium UX PRD/.test(document.querySelector('#mmSug').textContent)));
175
- await D.page.fill('#mmLinkIn', 'https://typed.example/page');
176
- await D.page.click('#mmDo');
177
- const refAdd = await until(() => D.page.evaluate(() => /The material was not saved: a page press is required/.test(document.querySelector('#mmLine').textContent) ? { still: !!document.querySelector('.mtg-sheet'), typed: document.querySelector('#mmLinkIn').value, again: !document.querySelector('#mmDo').disabled } : null));
178
- ok('M5 a refused Add shows the reason, keeps the sheet and what was typed, and can be pressed again', refAdd && refAdd.still && refAdd.typed === 'https://typed.example/page' && refAdd.again, JSON.stringify(refAdd));
179
- ok('M5 the refused writes changed nothing in the list', D.items.length === 1);
111
+ /* M5 refused writes */
112
+ A.refuse = 'the material store is busy';
113
+ await tap(p, '[data-a="addmat"]');
114
+ await until(() => p.evaluate(() => document.querySelectorAll('#czViewer [data-f="rm"]').length > 0));
115
+ const n0 = A.mat.length;
116
+ await p.click('#czViewer [data-f="rm"]');
117
+ ok('M5 a refused Remove shows the reason, and the sheet stays', await until(async () => /Not removed: the material store is busy/.test(await text(p)) && !!(await p.$('#czViewer [data-cz-placeholder="Add material"]'))));
118
+ await p.fill('#czViewer [data-f="url"]', 'https://x.example/notes');
119
+ await tap(p, '[data-f="addurl"]');
120
+ ok('M5 a refused Add shows the reason, keeps the sheet and what was typed', await until(async () => /Not added: the material store is busy/.test(await text(p)) && (await p.inputValue('#czViewer [data-f="url"]')) === 'https://x.example/notes'));
121
+ A.refuse = '';
122
+ await tap(p, '[data-f="addurl"]');
123
+ ok('M5 it can be pressed again', await until(() => A.mat.some((m) => m.url === 'https://x.example/notes')) && A.mat.length === n0 + 1);
124
+ const mats = [...new Set(A.S.posts.map((x) => x.path))];
125
+ ok('M6 the material work wrote only to /api/meeting-material', mats.join() === '/api/meeting-material', mats.join());
126
+ ok('M6 no page error so far', A.errors.length === 0, A.errors.join(' | '));
127
+ await A.ctx.close();
180
128
 
181
- /* M4 make task */
182
- const N = await open({ stage: 'after' });
183
- const steps = await text(N.page);
184
- ok('M4 the next step has Make task, and decisions and questions have none', /Make task/.test(steps) && await N.page.evaluate(() => document.querySelectorAll('.mtg-task').length === 1));
185
- await N.page.click('.mtg-task');
186
- await until(() => N.planPosts.length === 1);
187
- const pp = N.planPosts[0];
188
- ok('M4 Make task posts one planned event in the first stage with the owner and due', pp.ws === 'w1' && pp.events.length === 1 && pp.events[0].ev === 'planned' && pp.events[0].initiative === 'premium-ux' && pp.events[0].stage === 'st1' && pp.events[0].title === 'Sam confirms the data fix owner' && pp.events[0].owner === 'person:Sam', JSON.stringify(pp));
189
- const made = await until(() => N.page.evaluate(() => /Added to Premium UX, under Intake\./.test(document.querySelector('#mtgStatus').textContent) && document.querySelector('.mtg-task').textContent === 'Task made' && document.querySelector('.mtg-task').disabled ? true : null));
190
- ok('M4 the step says Task made and the status says where it went', made);
191
- await N.page.click('#mtgUndo');
192
- await until(() => N.planPosts.length === 2);
193
- ok('M4 Undo withdraws the item', N.planPosts[1].events[0].ev === 'withdrawn' && N.planPosts[1].events[0].item === 'item-9' && N.planPosts[1].events[0].initiative === 'premium-ux', JSON.stringify(N.planPosts[1]));
194
- ok('M4 after Undo the step can be made a task again', await until(() => N.page.evaluate(() => document.querySelector('.mtg-task').textContent === 'Make task' && !document.querySelector('.mtg-task').disabled)));
195
- const NI = await open({ stage: 'after', replay: REPLAY_NOINI });
196
- await NI.page.click('.mtg-task');
197
- ok('M4 with no initiative the button says to link one and writes nothing', await until(() => NI.page.evaluate(() => /Link the note to an initiative first/.test(document.querySelector('#mtgStatus').textContent))) && NI.planPosts.length === 0);
198
- const NS = await open({ stage: 'after', stages: [] });
199
- await NS.page.click('.mtg-task');
200
- ok('M4 an initiative with no stage says so and writes nothing', await until(() => NS.page.evaluate(() => /The task was not made: The initiative has no stage/.test(document.querySelector('#mtgStatus').textContent))) && NS.planPosts.length === 0);
201
- const NR = await open({ stage: 'after', planStatus: 403 });
202
- await NR.page.click('.mtg-task');
203
- ok('M5 a refused Make task shows the reason and the step stays open', await until(() => NR.page.evaluate(() => /The task was not made: a page press is required/.test(document.querySelector('#mtgStatus').textContent) && document.querySelector('.mtg-task').textContent === 'Make task' && !document.querySelector('.mtg-task').disabled)));
129
+ /* M4 make task, on the note of "Viewer sync" */
130
+ const B = await F.open(browser, BASE, '/premium-viewer.html?open=meeting&note=n1', { noLive: true });
131
+ ALL.push(B);
132
+ const q = B.page;
133
+ await until(() => q.evaluate(() => !!document.querySelector('#czViewer [data-a="task"]')), 15000);
134
+ ok('M4 each next step has Make task, and decisions and questions have none', await q.evaluate(() => document.querySelectorAll('#czViewer [data-a="task"]').length === 3));
135
+ await tap(q, '[data-a="task"][data-i="0"]');
136
+ await tap(q, '[data-a="maketask"][data-i="0"]');
137
+ const pl = await until(() => posted(B.S, '/api/plan-items')[0]);
138
+ const ev = pl && pl.body.events && pl.body.events[0];
139
+ ok('M4 Make task posts one planned event in the first stage with the owner', ev && ev.ev === 'planned' && ev.initiative === 'viewer' && ev.stage === 'st1' && ev.owner === 'person:Ana' && ev.title === 'Add a print view for documents' && pl.body.ws === 'w1', JSON.stringify(pl && pl.body));
140
+ ok('M4 the status says where it went, with Undo', await until(async () => /Added to Viewer, under Intake/.test(await text(q)) && !!(await q.$('#czViewer [data-a="msgundo"]'))));
141
+ await tap(q, '[data-a="msgundo"]');
142
+ const wd = await until(() => posted(B.S, '/api/plan-items')[1]);
143
+ ok('M4 Undo withdraws the item', wd && wd.body.events[0].ev === 'withdrawn' && wd.body.events[0].item === 'item-9', JSON.stringify(wd && wd.body));
144
+ ok('M4 after Undo the step can be made a task again', await until(async () => /The task is withdrawn/.test(await text(q)) && !!(await q.$('#czViewer [data-a="task"][data-i="0"]'))));
145
+ /* an initiative with no stage; a refused write */
146
+ await q.route('**/api/plan-items*', (r) => (r.request().method() === 'POST' ? (B.S.posts.push({ path: '/api/plan-items', body: JSON.parse(r.request().postData() || '{}') }), json(r, { ok: false, error: 'the plan is locked' }, 409)) : json(r, { ok: true, stages: B.noStage ? [] : [{ id: 'st1', label: 'Intake' }] })));
147
+ B.noStage = true;
148
+ const before = posted(B.S, '/api/plan-items').length;
149
+ await tap(q, '[data-a="task"][data-i="1"]'); await tap(q, '[data-a="maketask"][data-i="1"]');
150
+ ok('M4 an initiative with no stage says so and writes nothing', await until(async () => /The initiative has no stage to put the step in/.test(await text(q))) && posted(B.S, '/api/plan-items').length === before);
151
+ B.noStage = false;
152
+ await tap(q, '[data-a="task"][data-i="1"]'); await tap(q, '[data-a="maketask"][data-i="1"]');
153
+ ok('M5 a refused Make task shows the reason and the step stays open', await until(async () => /The task was not made: the plan is locked/.test(await text(q))) && !!(await q.$('#czViewer [data-a="task"][data-i="1"]')));
154
+ await B.ctx.close();
204
155
 
205
- /* M6 the allow-list */
206
- const all = [].concat(A.reqs, D.reqs, N.reqs, NI.reqs, NS.reqs, NR.reqs);
207
- const posts = [...new Set(all.filter((r) => /^POST /.test(r)))].sort();
208
- ok('M6 the only writes the page sent are the material and the plan items', posts.join() === 'POST /api/meeting-material,POST /api/plan-items', posts.join());
209
- ok('M6 no recording, Focus, note or calendar write was sent', !all.some((r) => /POST \/api\/(notes|meeting-focus|calendar)/.test(r)));
210
- ok('M6 no page error', [A, D, N, NI, NS, NR].every((x) => x.errors.length === 0), JSON.stringify([A, D, N, NI, NS, NR].map((x) => x.errors)));
156
+ /* M4 a note with no initiative */
157
+ const C = await F.open(browser, BASE, '/premium-viewer.html?open=meeting&note=n1', { noLive: true, init: () => {} });
158
+ ALL.push(C);
159
+ await C.page.route('**/api/notes/one*', (r) => json(r, { ok: true, note: { ...W.NOTE, initiative: null, series: null }, place: null }));
160
+ await C.page.reload();
161
+ await until(() => C.page.evaluate(() => !!document.querySelector('#czViewer [data-a="task"]')), 15000);
162
+ await tap(C.page, '[data-a="task"][data-i="0"]'); await tap(C.page, '[data-a="maketask"][data-i="0"]');
163
+ ok('M4 with no initiative the press says to link one and writes nothing', await until(async () => /Link the note to an initiative first/.test(await text(C.page))) && posted(C.S, '/api/plan-items').length === 0);
164
+ await C.ctx.close();
211
165
 
212
- /* M7 floors and fidelity */
213
- for (const th of ['light', 'dark']) {
214
- const P = await open({ w: 390, h: 844, theme: th });
215
- const f1 = await P.page.evaluate(() => ({ scroll: document.documentElement.scrollWidth <= innerWidth + 1, btn: [...document.querySelectorAll('#mmAdd,.mtg-rm,.mtg-task,#oMain .vm-sh')].filter((b) => b.getClientRects().length).map((b) => Math.min(b.getBoundingClientRect().width, b.getBoundingClientRect().height)) }));
216
- await P.page.click('#mmAdd'); await until(() => P.page.evaluate(() => /Premium UX PRD/.test(document.querySelector('#mmSug').textContent)));
217
- await P.page.click('#mmSug [data-pick]');
218
- const f2 = await P.page.evaluate(() => ({ scroll: document.documentElement.scrollWidth <= innerWidth + 1 && document.querySelector('#oMain').scrollWidth <= document.querySelector('#oMain').clientWidth + 1, btn: [...document.querySelectorAll('#mmBack,#mmDo,#mmCancel,[data-scope],[data-pick],.mtg-in')].map((b) => Math.min(b.getBoundingClientRect().width, b.getBoundingClientRect().height)) }));
219
- ok(`M7 at 390 px (${th}) the dialog and the sheet have no sideways scroll and every press is at least 44 px`, f1.scroll && f2.scroll && f1.btn.every((n) => n >= 44) && f2.btn.every((n) => n >= 44), JSON.stringify([f1, f2]));
220
- await P.ctx.close();
221
- }
222
- const css = (page, sel) => page.evaluate((s) => { const e = document.querySelector(s); if (!e) return null; const c = getComputedStyle(e); return ['fontWeight', 'borderRadius'].map((k) => c[k]).join('|'); }, sel);
223
- const mk = await browser.newContext({ viewport: { width: 1280, height: 900 } }); const mp = await mk.newPage();
224
- await mp.setContent(MOCKUP); await CT.applyToPage(mp, CT_VENDOR); await mp.waitForTimeout(500);
225
- const ctaM = await mp.evaluate(() => { const b = document.createElement('button'); b.className = 'cta'; document.body.appendChild(b); const c = getComputedStyle(b); return c.fontWeight + '|' + c.borderRadius; });
226
- const addM = await mp.evaluate(() => { const b = document.createElement('button'); b.className = 'addb'; document.body.appendChild(b); const c = getComputedStyle(b); return c.fontWeight + '|' + c.borderRadius; }), F1 = await open(), addB = await css(F1.page, '#mmAdd');
227
- await F1.page.click('#mmAdd'); await until(() => F1.page.evaluate(() => /Premium UX PRD/.test(document.querySelector('#mmSug').textContent))); await F1.page.click('#mmSug [data-pick]');
228
- const doB = await css(F1.page, '#mmDo');
229
- // re-pointed for premium-agreed-design: the Agreed design's dialog CTA is a pill at weight 800 (cozy-viewer.css .cz .dlg .cta), not the mockup's 600;
230
- // the add button keeps the mockup's pill and weight
231
- ok('M7 fidelity: the buttons keep the pill radius, the add button the mockup\'s weight and the CTA the Agreed design\'s', ctaM && addB && addB === addM && doB === '800|' + ctaM.split('|')[1] && /^999/.test(ctaM.split('|')[1]), ctaM + ' / ' + addM + ' vs ' + addB + ' / ' + doB);
232
- const labM = await mp.evaluate(() => { const e = document.querySelector('.label'); return e ? getComputedStyle(e).fontSize + '|' + getComputedStyle(e).textTransform : null; });
233
- const labP = await F1.page.evaluate(() => { const e = document.querySelector('.mtg-sec .label'); return e ? getComputedStyle(e).fontSize + '|' + getComputedStyle(e).textTransform : null; });
234
- // re-pointed for premium-agreed-design: the Agreed design's labels keep the mockup's 12 px but drop its uppercase (cozy-viewer.css .cz .dlg .label)
235
- ok('M7 fidelity: a sheet section label keeps the mockup\'s size in the Agreed design\'s sentence case', labM && labP && labP.split('|')[0] === labM.split('|')[0] && labP.split('|')[1] === 'none', labM + ' vs ' + labP);
236
- await mk.close();
166
+ /* M7 floors */
167
+ const D = await openRail({ w: 390, h: 844 });
168
+ await tap(D.page, '[data-a="addmat"]');
169
+ await until(() => D.page.evaluate(() => !!document.querySelector('#czViewer [data-f="url"]')));
170
+ const fl = await D.page.evaluate(() => ({ over: document.documentElement.scrollWidth - innerWidth }));
171
+ ok('M7 at 390 px the sheet has no sideways scroll', fl.over <= 0, JSON.stringify(fl));
172
+ await D.ctx.close();
173
+ ok('M6 no page error in any run', ALL.every((x) => x.errors.length === 0), JSON.stringify(ALL.map((x) => x.errors).filter((e) => e.length)));
237
174
  return finish();
238
175
  })().catch((e) => { console.error(e); finish(1); });