create-pmos 0.402.0 → 0.403.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 (103) hide show
  1. package/package.json +13 -13
  2. package/payload/KIT-VERSION +1 -1
  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/workspace/board-programs-test.js +6 -5
  7. package/workspace/briefing-premium-adddoc-test.js +28 -22
  8. package/workspace/briefing-premium-board-test.js +91 -73
  9. package/workspace/briefing-premium-calendar-2-test.js +23 -10
  10. package/workspace/briefing-premium-calendar-3-test.js +23 -19
  11. package/workspace/briefing-premium-calendar-test.js +19 -17
  12. package/workspace/briefing-premium-initiative-test.js +25 -12
  13. package/workspace/briefing-premium-insights-test.js +31 -18
  14. package/workspace/briefing-premium-metrics-test.js +8 -8
  15. package/workspace/briefing-premium-test.js +4 -3
  16. package/workspace/changelog.json +12 -0
  17. package/workspace/fixtures/premium-viewer-fixtures.js +24 -2
  18. package/workspace/guide/jira.md +38 -6
  19. package/workspace/home-rows-test.js +184 -0
  20. package/workspace/lib/calendar-layers.js +8 -4
  21. package/workspace/lib/initiative-layout.js +4 -3
  22. package/workspace/lib/jira-cli.js +17 -12
  23. package/workspace/lib/jira-status.js +1 -1
  24. package/workspace/lib/jira-tickets.js +126 -24
  25. package/workspace/lib/meeting-files.js +58 -0
  26. package/workspace/lib/meeting-learn.js +139 -0
  27. package/workspace/lib/meeting-material.js +12 -5
  28. package/workspace/lib/notes.js +3 -0
  29. package/workspace/lib/routes-brief-page.js +8 -1
  30. package/workspace/lib/routes-calendar-views.js +24 -3
  31. package/workspace/lib/routes-meeting-material.js +38 -0
  32. package/workspace/lib/routes-meeting-points.js +23 -3
  33. package/workspace/package-lock.json +2 -2
  34. package/workspace/package.json +1 -1
  35. package/workspace/premium-board-actions-test.js +30 -24
  36. package/workspace/premium-chat-context-test.js +1 -1
  37. package/workspace/premium-chat-goal-view-test.js +1 -1
  38. package/workspace/premium-chat-viewer-test.js +1 -1
  39. package/workspace/premium-core-doc-issue-test.js +13 -7
  40. package/workspace/premium-discuss-landing-test.js +83 -0
  41. package/workspace/premium-link-suggest-test.js +103 -0
  42. package/workspace/premium-report-read-test.js +86 -82
  43. package/workspace/premium-vw-backlog-test.js +6 -5
  44. package/workspace/premium-vw-cal-test.js +46 -23
  45. package/workspace/premium-vw-item-test.js +8 -6
  46. package/workspace/premium-vw-jira-test.js +3 -2
  47. package/workspace/premium-vw-meet-test.js +122 -66
  48. package/workspace/premium-vw-notes-test.js +7 -6
  49. package/workspace/premium-vw-rec-test.js +14 -13
  50. package/workspace/premium-vw-slides-test.js +11 -5
  51. package/workspace/program-panel-test.js +64 -55
  52. package/workspace/public/pm/bd-acts.js +1 -1
  53. package/workspace/public/pm/bd-asks.js +22 -7
  54. package/workspace/public/pm/bd-ini-panel.js +229 -0
  55. package/workspace/public/pm/bd-pop.js +2 -2
  56. package/workspace/public/pm/bd-prog-panel.js +176 -191
  57. package/workspace/public/pm/cozy-board.css +5 -28
  58. package/workspace/public/pm/cozy-evui.js +4 -2
  59. package/workspace/public/pm/cozy-home-rows.css +54 -0
  60. package/workspace/public/pm/cozy-home.css +9 -0
  61. package/workspace/public/pm/cozy-insights.css +1 -2
  62. package/workspace/public/pm/cozy-mtg-present.css +160 -0
  63. package/workspace/public/pm/cozy-panel.css +11 -34
  64. package/workspace/public/pm/cozy-rec-pill.css +12 -0
  65. package/workspace/public/pm/cozy-rec-pill.js +46 -0
  66. package/workspace/public/pm/cozy-viewer.js +307 -43
  67. package/workspace/public/pm/cozy-vw-mtg.css +96 -94
  68. package/workspace/public/pm/cozy-vw-rp.css +40 -25
  69. package/workspace/public/pm/cozy-vw-shell.css +127 -0
  70. package/workspace/public/pm/cozy-xv.css +51 -0
  71. package/workspace/public/pm/cozy-xv.js +34 -0
  72. package/workspace/public/pm/home-app.js +122 -58
  73. package/workspace/public/pm/home-chat.js +11 -2
  74. package/workspace/public/pm/home-day.js +64 -0
  75. package/workspace/public/pm/home-ini-model.js +1 -1
  76. package/workspace/public/pm/home-ini.js +197 -54
  77. package/workspace/public/pm/home-list.js +6 -14
  78. package/workspace/public/pm/home-mentions.js +187 -0
  79. package/workspace/public/pm/home-rec-row.js +67 -0
  80. package/workspace/public/pm/home-review.js +20 -10
  81. package/workspace/public/pm/home-task.js +19 -18
  82. package/workspace/public/pm/home-today.js +3 -3
  83. package/workspace/public/pm/premium-board.js +73 -235
  84. package/workspace/public/pm/premium-insights.js +118 -82
  85. package/workspace/public/pm/premium-mtg-present.js +408 -100
  86. package/workspace/public/pm/premium-mtg-replay.js +70 -10
  87. package/workspace/public/pm/premium-report-read.js +118 -63
  88. package/workspace/public/pm/premium-vw-cal.js +62 -34
  89. package/workspace/public/pm/premium-vw-mtg.js +348 -192
  90. package/workspace/public/pm/rec-state.js +63 -0
  91. package/workspace/public/pm/rp-parts.js +33 -8
  92. package/workspace/public/pm/tk-draft.js +107 -0
  93. package/workspace/public/pm/tk-model.js +134 -0
  94. package/workspace/public/pm/tk-send.js +124 -0
  95. package/workspace/public/pm/tk-tasks.css +120 -0
  96. package/workspace/public/premium-board.html +0 -1
  97. package/workspace/server.js +4 -2
  98. package/workspace/skills/jira-push.skill +3 -3
  99. package/workspace/test-lists/prd-to-jira.json +6 -0
  100. package/workspace/test-lists/viewer-home-rows.json +9 -0
  101. package/workspace/test-lists/viewer-meetings.json +9 -0
  102. package/workspace/test-lists/viewer-shell-a.json +15 -0
  103. package/workspace/tk-tasks-test.js +199 -0
@@ -3,9 +3,11 @@
3
3
  /* premium-vw-cal-test.js — Calendar | Notes in the Viewer card, the Calendar side (initiative premium-viewer, R8; re-pointed for premium-agreed-design,
4
4
  * area viewer; redrawn for premium-uncovered-features, area meetings: MtCalendar and MtPhone). Serves the real /premium-viewer.html from the
5
5
  * real server; GET /api/calendar-views and the notes are answered by stand-ins (fixtures/premium-viewer-fixtures.js).
6
- * C1 the card: Calendar | Notes, the range, Day | Week | Month and New note · C2 the week grid: linked filled, not linked dashed with Link it,
7
- * today's column and its now line · C3 the day: Mon–Fri and the day's entries with chips · C4 a meeting opens its card · C5 Link it opens What
8
- * it is about · C6 Month, previous, next, Today · C7 honest states · C8 floors at 390px · C9 on Home, the Viewer widens for the week
6
+ * Viewer kit (XvACal): one item, "Calendar", opens on the day with today's summary first; Week and Month are in ⋯.
7
+ * C1 the item: Calendar | Notes and +, today's summary, ⋯ with the ranges and New note · C2 the week grid (⋯ Week): linked filled, not linked
8
+ * dashed with Link it, today's column and its now line · C3 the day: Mon–Fri with load bars and one list; a chip only where it asks for a
9
+ * look · C4 a meeting opens its card · C5 Link it opens What it is about · C6 Month, previous, next, Today · C7 honest states · C8 floors at
10
+ * 390px · C9 on Home, the Viewer widens for the week and not for the day
9
11
  * Every wait polls the page; no fixed sleep stands in for a state. */
10
12
  const path = require('path');
11
13
  const { spawn } = require('child_process');
@@ -37,15 +39,31 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
37
39
  browser = await chromium.launch({ executablePath: exe });
38
40
  const tap = (p, sel) => p.$eval('#czViewer ' + sel, (b) => b.click());
39
41
  const text = (p) => p.evaluate(() => (document.querySelector('#czViewer') || {}).innerText || '');
42
+ /** ⋯ in the Viewer's header: its rows, or press the one named. */
43
+ const more = async (p, label) => {
44
+ await p.$eval('#czViewer [data-cz-vw="more"]', (b) => b.click());
45
+ await until(() => p.evaluate(() => !!document.querySelector('#czViewer .cz-vw-menu')), 5000);
46
+ const rows = await p.evaluate(() => [...document.querySelectorAll('#czViewer .cz-vw-menu [role="menuitem"]')].map((b) => b.innerText.replace(/\n/g, ' ').trim()));
47
+ if (label) await p.evaluate((l) => [...document.querySelectorAll('#czViewer .cz-vw-menu [role="menuitem"]')].find((b) => b.querySelector('span').textContent === l).click(), label);
48
+ else await p.keyboard.press('Escape');
49
+ return rows;
50
+ };
51
+ const weekday = ![0, 6].includes(new Date().getDay());
40
52
 
41
53
  const A = await F.open(browser, BASE, '/premium-viewer.html?open=calendar');
42
54
  const p = A.page;
43
- const up = await until(() => p.evaluate(() => !!document.querySelector('#czViewer .vzc-wk') && document.querySelectorAll('#czViewer .vzc-ev').length > 0), 15000);
44
- ok('C1 the calendar opens in the Viewer card on its week', up);
55
+ const up = await until(() => p.evaluate(() => document.querySelectorAll('#czViewer .vzc-dy').length === 5 && document.querySelectorAll('#czViewer .vzc-de').length > 0), 15000);
56
+ ok('C1 the calendar opens in the Viewer on the day', up);
45
57
  if (!up) return finish(1);
46
- ok('C1 the card holds Calendar | Notes, Day | Week | Month and New note, and no conversation', await p.evaluate(() => [...document.querySelectorAll('#czViewer [data-c="tab"]')].map((b) => b.textContent).join() === 'Calendar,Notes'
47
- && [...document.querySelectorAll('#czViewer [data-c="view"]')].map((b) => b.textContent + ':' + b.getAttribute('aria-pressed')).join() === 'Day:false,Week:true,Month:false' && !!document.querySelector('#czViewer [data-c="new"][aria-label="New note"]') && !document.querySelector('#dlg, .stream')));
48
- ok('C1 the header names it; the range says "N to M Mon"', await p.evaluate(() => document.querySelector('#czViewer .cz-vw-kind').textContent === 'Meetings' && /^\d{1,2}( \w{3})? to \d{1,2} \w{3}$/.test(document.querySelector('#czViewer .vzc-head h2').textContent)));
58
+ ok('C1 the item holds Calendar | Notes and + (New note), and no conversation', await p.evaluate(() => [...document.querySelectorAll('#czViewer [data-c="tab"]')].map((b) => b.textContent + ':' + b.getAttribute('aria-selected')).join() === 'Calendar:true,Notes:false'
59
+ && !!document.querySelector('#czViewer [data-c="new"][aria-label="New note"]') && !document.querySelector('#czViewer .vzc-head') && !document.querySelector('#dlg, .stream')));
60
+ ok('C1 the header says Calendar, of Meetings', await p.evaluate(() => document.querySelector('#czViewer .cz-vw-kind').textContent === 'Meetings' && document.querySelector('#czViewer .cz-vw-title').textContent === 'Calendar'));
61
+ const sum = await p.evaluate(() => { const s = document.querySelector('#czViewer .czs-sum'); return s && { line: s.querySelector('.czs-line').innerText, text: (s.querySelector('.czs-p') || {}).innerText || '', pri: (s.querySelector('[data-czs-act]') || {}).textContent || '' }; });
62
+ ok('C1 today\'s summary comes first: "Today · N meetings · h", then what is next or live, with one primary', sum && /^Today · \d+ meetings?( · [\d.]+ (h|min))?$/.test(sum.line) && (/^(Next|Recording now|Paused): /.test(sum.text) ? /^Open the (prep|notes)$/.test(sum.pri) : !sum.pri), JSON.stringify(sum));
63
+ const rows = await more(p);
64
+ ok('C1 ⋯ holds Day (shown), Week, Month, the range moves, Back to today and New note', /^Day shown,Week,Month,Previous week,Next week,Back to today,New note no calendar event/.test(rows.join()), rows.join());
65
+ await more(p, 'Week');
66
+ ok('C2 ⋯ Week draws the week grid with its range head and Day', await until(() => p.evaluate(() => !!document.querySelector('#czViewer .vzc-wk') && document.querySelectorAll('#czViewer .vzc-ev').length > 0 && /^\d{1,2}( \w{3})? to \d{1,2} \w{3}$/.test(document.querySelector('#czViewer .vzc-head h2').textContent) && !!document.querySelector('#czViewer .vzc-head [data-c="view"][data-k="day"]')), 10000));
49
67
 
50
68
  /* C2 the week grid */
51
69
  const wk = await p.evaluate(() => ({ cols: document.querySelectorAll('#czViewer .vzc-col').length, now: !!document.querySelector('#czViewer .vzc-hd.now'), line: !!document.querySelector('#czViewer .vzc-nl'),
@@ -57,20 +75,20 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
57
75
  ok('C2 each block is placed by custom properties set after the markup', wk.styled > 0);
58
76
  ok('C2 the legend: Linked, Not linked, and what a press does', /Linked\s*Not linked\s*Press a meeting to open its prep or notes here/.test(await p.evaluate(() => document.querySelector('#czViewer .vzc-leg').innerText.replace(/\n/g, ' '))));
59
77
 
60
- /* C3 the day (on a Saturday or Sunday no day of the Mon–Fri strip is today, so none is pressed) */
61
- const WEEKDAY = [1, 2, 3, 4, 5].includes(new Date().getDay());
62
- await tap(p, '[data-c="view"][data-k="day"]');
78
+ /* C3 the day */
79
+ await tap(p, '.vzc-head [data-c="view"][data-k="day"]');
63
80
  await until(() => p.evaluate(() => document.querySelectorAll('#czViewer .vzc-dy').length === 5 && document.querySelectorAll('#czViewer .vzc-de').length > 0), 10000);
64
- const strip = await p.evaluate(() => [...document.querySelectorAll('#czViewer .vzc-dy')].map((d) => ({ dow: d.querySelector('span').textContent, on: d.getAttribute('aria-pressed') })));
65
- ok('C3 Day: Monday to Friday, today pressed, the range says "· today"', strip.map((d) => d.dow).join() === 'Mon,Tue,Wed,Thu,Fri' && (WEEKDAY ? strip.filter((d) => d.on === 'true').length === 1 && /· today$/.test(await p.evaluate(() => document.querySelector('#czViewer .vzc-head h2').textContent)) : strip.every((d) => d.on !== 'true')), JSON.stringify(strip));
81
+ const strip = await p.evaluate(() => [...document.querySelectorAll('#czViewer .vzc-dy')].map((d) => ({ dow: d.querySelector('span').textContent, on: d.getAttribute('aria-pressed'), bar: !!d.querySelector('.vzc-lb') })));
82
+ ok('C3 Day: Monday to Friday, each with its load bar; today pressed on a weekday', strip.map((d) => d.dow).join() === 'MON,TUE,WED,THU,FRI' && strip.every((d) => d.bar) && strip.filter((d) => d.on === 'true').length === (weekday ? 1 : 0), JSON.stringify(strip));
66
83
  const day = await text(p);
67
- ok('C3 the day: its count, each entry at its time with a chip', /\d (meetings?|entries) · /.test(day) && /Viewer sync/.test(day) && await p.evaluate(() => [...document.querySelectorAll('#czViewer .vzc-de')].every((r) => r.querySelector('.vz-cc'))), day.slice(0, 400));
68
- ok('C3 a note recorded without an event shows Link it; a done meeting Done', /Compare meeting note apps/.test(day) && /Link it/.test(day) && /Done/.test(day));
84
+ const chips = await p.evaluate(() => [...document.querySelectorAll('#czViewer .vzc-de .vz-cc')].map((c) => c.textContent));
85
+ ok('C3 the day: one list, each entry at its time; a chip only on Link it or a live recording', /Viewer sync/.test(day) && chips.length > 0 && chips.every((c) => /^(Link it|Recording|Paused)$/.test(c)) && await p.evaluate(() => !!document.querySelector('#czViewer .vzc-list')), JSON.stringify(chips));
86
+ ok('C3 a note recorded without an event shows Link it; a met meeting says notes ready', /Compare meeting note apps/.test(day) && /Link it/.test(day) && /notes ready/.test(day));
69
87
  const other = await p.evaluate(() => { const b = [...document.querySelectorAll('#czViewer .vzc-dy')].find((d) => d.getAttribute('aria-pressed') === 'false'); b.click(); return b.dataset.k; });
70
88
  ok('C3 another day lists its own meetings', await until(async () => /1:1 with Dita/.test(await text(p))), other);
71
- // back to the day the view opened on: today on a weekday; on a Saturday or Sunday the page opened again, since the strip has no button for today
72
- if (WEEKDAY) await p.evaluate(() => [...document.querySelectorAll('#czViewer .vzc-dy')][[...document.querySelectorAll('#czViewer .vzc-dy')].findIndex((d) => /today/.test(d.getAttribute('aria-label')))].click());
73
- else { await p.reload(); await until(() => p.evaluate(() => !!document.querySelector('#czViewer [data-c="view"][data-k="day"]')), 15000); await tap(p, '[data-c="view"][data-k="day"]'); }
89
+ // back to today: its day in the strip, or ⋯ Back to today on a weekend (the strip is Monday to Friday)
90
+ if (weekday) await p.evaluate(() => [...document.querySelectorAll('#czViewer .vzc-dy')].find((d) => /today/.test(d.getAttribute('aria-label'))).click());
91
+ else await more(p, 'Back to today');
74
92
 
75
93
  /* C4 a meeting opens its card */
76
94
  await until(async () => /Viewer sync/.test(await text(p)));
@@ -81,6 +99,8 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
81
99
  /* C5 Link it */
82
100
  const B = await F.open(browser, BASE, '/premium-viewer.html?open=calendar');
83
101
  const q = B.page;
102
+ await until(() => q.evaluate(() => !!document.querySelector('#czViewer .vzc-dy')), 15000);
103
+ await more(q, 'Week');
84
104
  await until(() => q.evaluate(() => !!document.querySelector('#czViewer .vzc-ev [data-c="link"]')), 15000);
85
105
  await tap(q, '.vzc-ev [data-c="link"]');
86
106
  ok('C5 Link it opens the meeting with What it is about open', await until(() => q.evaluate(() => !!document.querySelector('#czViewer .vz-mtg') && !!document.querySelector('#czViewer .vzm-pop [data-a="aboutq"]'))), (await text(q)).slice(0, 300));
@@ -90,9 +110,9 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
90
110
  /* C6 Month, previous, next, Today */
91
111
  const C = await F.open(browser, BASE, '/premium-viewer.html?open=calendar');
92
112
  const r = C.page;
93
- await until(() => r.evaluate(() => !!document.querySelector('#czViewer .vzc-wk')), 15000);
113
+ await until(() => r.evaluate(() => !!document.querySelector('#czViewer .vzc-dy')), 15000);
94
114
  const n0 = C.S.gets.filter((g) => g.startsWith('/api/calendar-views')).length;
95
- await tap(r, '[data-c="view"][data-k="month"]');
115
+ await more(r, 'Month');
96
116
  ok('C6 Month reads the month and draws its grid', await until(() => C.S.gets.some((g) => /view=month/.test(g))) && await until(() => r.evaluate(() => !!document.querySelector('#czViewer .vzc-mg') && /^\w+ \d{4}$/.test(document.querySelector('#czViewer .vzc-head h2').textContent))));
97
117
  const n1 = C.S.gets.filter((g) => g.startsWith('/api/calendar-views')).length;
98
118
  const head = () => r.evaluate(() => document.querySelector('#czViewer .vzc-head h2').textContent);
@@ -102,10 +122,10 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
102
122
  await until(async () => C.S.gets.filter((g) => g.startsWith('/api/calendar-views')).length > n1 && (await head()) !== m0);
103
123
  await tap(r, '[data-c="nav"][data-k="0"]');
104
124
  ok('C6 next and Today read again', await until(() => C.S.gets.filter((g) => g.startsWith('/api/calendar-views')).length >= n0 + 3));
105
- await tap(r, '[data-c="view"][data-k="week"]');
125
+ await more(r, 'Week');
106
126
  await until(() => r.evaluate(() => !!document.querySelector('#czViewer .vzc-wk')));
107
127
  await tap(r, '.vzc-dn');
108
- ok('C6 a day name in the week opens that day', await until(() => r.evaluate(() => document.querySelector('#czViewer [data-c="view"][data-k="day"]').getAttribute('aria-pressed') === 'true')));
128
+ ok('C6 a day name in the week opens that day', await until(() => r.evaluate(() => !document.querySelector('#czViewer .vzc-wk') && document.querySelectorAll('#czViewer .vzc-dy').length === 5)));
109
129
  await C.ctx.close();
110
130
 
111
131
  /* C7 honest states: a calendar that does not answer */
@@ -129,9 +149,12 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
129
149
  const G = await F.open(browser, BASE, '/premium.html', { w: 1440, h: 900 });
130
150
  await until(() => G.page.evaluate(() => !!(window.czViews && window.czViews.openCalendar)), 15000);
131
151
  await G.page.evaluate(() => window.czViews.openCalendar());
152
+ await until(() => G.page.evaluate(() => !!document.querySelector('#czViewer .vzc-dy')), 15000);
153
+ ok('C9 the day sits at the side\'s width', await G.page.evaluate(() => !document.querySelector('#czViewer').dataset.vzw));
154
+ await more(G.page, 'Week');
132
155
  const wide = await until(() => G.page.evaluate(() => { const v = document.querySelector('#czViewer'); return v && v.dataset.vzw === 'cal' && document.querySelector('#czViewer .vzc-wk') && v.getBoundingClientRect().width > 600 && { w: v.getBoundingClientRect().width, hv: !!document.querySelector('#czViewer .hv') }; }), 15000)
133
156
  || await G.page.evaluate(() => { const v = document.querySelector('#czViewer'); return v && { w: v.getBoundingClientRect().width, hv: !!document.querySelector('#czViewer .hv') }; }); // the width comes with the stylesheet
134
- ok('C9 on premium.html, czViews.openCalendar() draws the week in a wider Viewer, with no bare .hv class in the card', wide && wide.w > 600 && !wide.hv, JSON.stringify(wide));
157
+ ok('C9 on premium.html, ⋯ Week draws the week in a wider Viewer, with no bare .hv class in the card', wide && wide.w > 600 && !wide.hv, JSON.stringify(wide));
135
158
  await G.ctx.close();
136
159
  finish();
137
160
  })();
@@ -51,7 +51,8 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
51
51
  S.up = await until(() => page.evaluate(() => !!document.querySelector('.hm-card [data-hm-ov]') && !!window.__premiumWorkItem), 20000);
52
52
  return { page, ctx, S };
53
53
  };
54
- const overview = async (page) => { if (!(await page.locator('.hm-card [data-hm-ov]').isVisible())) await page.click('#hmNeeds'); await page.click('.hm-card [data-hm-ov]'); /* a phone: the initiative card is in the top bar's sheet */ return until(() => page.evaluate(() => !!document.querySelector('#czViewer [data-ov-record]') && !!document.querySelector('#czViewer [data-ov-tk="task:t1"]'))); };
54
+ const viaMore = async (pg, label) => { await pg.click('#czViewer:not([hidden]) [data-cz-vw="more"]'); await until(() => pg.evaluate(() => !!document.querySelector('#czViewer .cz-vw-menu'))); await pg.click(`#czViewer .cz-vw-menu [role="menuitem"]:has(> span:first-child:text-is("${label}"))`); }; // the Overview's other views, Open the full record and Sprint sit under ⋯ (XvATasks)
55
+ const overview = async (page) => { if (!(await page.locator('.hm-card [data-hm-ov]').isVisible())) await page.click('#hmNeeds'); await page.click('.hm-card [data-hm-ov]'); /* a phone: the initiative card is in the top bar's sheet */ return until(() => page.evaluate(() => !!document.querySelector('#czViewer [data-cz-vw="more"]') && !!document.querySelector('#czViewer [data-ov-tk="task:t1"]'))); };
55
56
  const cur = (page) => page.evaluate(() => { const p = document.querySelector('#czViewer:not([hidden]) .obody.vw'); return { on: p ? p.dataset.vw : null, title: (document.querySelector('#czVwTitle') || {}).textContent || '', n: document.querySelectorAll('#czViewer .obody.vw').length }; });
56
57
  const paneTxt = (page, id) => page.evaluate((k) => { const p = document.querySelector(`#czViewer .obody.vw[data-vw="${CSS.escape(k)}"]`); return p ? p.textContent.replace(/\s+/g, ' ') : ''; }, id);
57
58
  const INI = 'item:ini:self-serve-v2';
@@ -60,9 +61,9 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
60
61
  {
61
62
  const { page, ctx, S } = await open();
62
63
  ok('R9 Home loads the initiative with the Viewer\'s item views', S.up);
63
- ok('R9 the Overview offers Open the full record and an Open press on each task', await overview(page));
64
+ ok('R9 the Overview offers Open the full record (under ⋯) and an Open press on each task', await overview(page));
64
65
  const n0 = S.vgets.length;
65
- await page.click('#czViewer [data-ov-record]');
66
+ await viaMore(page, 'Open the full record');
66
67
  await until(async () => /Checks/.test(await paneTxt(page, INI)));
67
68
  let s = await cur(page), t = await paneTxt(page, INI);
68
69
  ok('R9 the record opens in the Viewer in place of the Overview, one item at a time', s.on === INI && s.n === 1, JSON.stringify(s));
@@ -106,15 +107,16 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
106
107
  const up = await until(() => page.evaluate(() => document.querySelectorAll('#ibBody [data-key]').length > 0), 20000);
107
108
  ok('R9 the Board loads', up);
108
109
  await page.click('#ibBody .ini2[data-key="board:self-serve-v2"]'); // a phone opens on the List view (premium-uncovered-features, BdPhone)
109
- const pk = await until(() => page.evaluate(() => { const k = document.querySelector('#peek'); return k && !k.hidden ? { record: !!k.querySelector('[data-pk="record"]'), dlg: !!document.querySelector('#dlg.on'), href: (k.querySelector('[data-pk="expand"]') || {}).getAttribute ? k.querySelector('[data-pk="expand"]').getAttribute('href') : '' } : null; }));
110
- ok('R9 an initiative row opens the Board\'s side panel, not the dialog, and its expand leads to the initiative page, where the record tab is', !!pk && !pk.record && !pk.dlg && /^\/premium-initiative\.html\?id=self-serve-v2&ws=w1&board=w1$/.test(pk.href), JSON.stringify(pk));
110
+ /* re-pointed (viewer-shell-a, XvABoard): the initiative opens in the Viewer's shell A; "Open in full" under ⋯ leads to the initiative page */
111
+ const pk = await until(() => page.evaluate(() => { const v = document.querySelector('#czViewer'), c = window.czViewer && window.czViewer.current(); return v && !v.hidden && c && c.kind === 'Initiative' ? { record: !!v.querySelector('[data-pk="record"]'), dlg: !!document.querySelector('#dlg.on'), href: c.url || '' } : null; }));
112
+ ok('R9 an initiative row opens the Board\'s initiative in the Viewer, not the dialog, and its "Open in full" leads to the initiative page, where the record tab is', !!pk && !pk.record && !pk.dlg && /^\/premium-initiative\.html\?id=self-serve-v2&ws=w1&board=w1$/.test(pk.href), JSON.stringify(pk));
111
113
  ok('R9 no page error on the Board', errors.length === 0, errors.join(' | '));
112
114
  await ctx.close();
113
115
  }
114
116
  {
115
117
  const { page, ctx, S } = await open({ w: 390, h: 844, theme: 'dark' });
116
118
  await overview(page);
117
- await page.click('#czViewer [data-ov-record]');
119
+ await viaMore(page, 'Open the full record');
118
120
  await until(async () => /Checks/.test(await paneTxt(page, INI)));
119
121
  const fl = await page.evaluate((k) => {
120
122
  const p = document.querySelector(`#czViewer .obody.vw[data-vw="${CSS.escape(k)}"]`);
@@ -71,8 +71,9 @@ const TICKETS = {
71
71
  const model = (sprints) => BP.build(F.facts({ sprints }));
72
72
  const IMODEL = IP.build(IF.facts());
73
73
  // Home's initiative layout (premium-agreed-design): the card's Overview has the Sprint press; the Viewer shows one item at a time
74
- const overview = async (pg) => { if (!(await pg.locator('.hm-card [data-hm-ov]').isVisible())) await pg.click('#hmNeeds'); await pg.click('.hm-card [data-hm-ov]'); /* a phone: the initiative card is in the top bar's sheet */ return until(() => pg.evaluate(() => !!document.querySelector('#czViewer [data-ov-sprint]'))); };
75
- const openSprint = async (pg) => { if (!(await pg.$('#czViewer:not([hidden]) [data-ov-sprint]'))) await overview(pg); /* open() already showed the Overview */ await pg.click('#czViewer [data-ov-sprint]'); };
74
+ const viaMore = async (pg, label) => { await pg.click('#czViewer:not([hidden]) [data-cz-vw="more"]'); await until(() => pg.evaluate(() => !!document.querySelector('#czViewer .cz-vw-menu'))); await pg.click(`#czViewer .cz-vw-menu [role="menuitem"]:has(> span:first-child:text-is("${label}"))`); }; // the Overview's other views, Open the full record and Sprint sit under ⋯ (XvATasks)
75
+ const overview = async (pg) => { if (!(await pg.locator('.hm-card [data-hm-ov]').isVisible())) await pg.click('#hmNeeds'); await pg.click('.hm-card [data-hm-ov]'); /* a phone: the initiative card is in the top bar's sheet */ return until(() => pg.evaluate(() => !!document.querySelector('#czViewer:not([hidden]) [data-hi-v]'))); };
76
+ const openSprint = async (pg) => { if (!(await pg.$('#czViewer:not([hidden]) [data-hi-v]'))) await overview(pg); /* open() already showed the Overview */ await viaMore(pg, 'Sprint'); };
76
77
  const open = async ({ w = 1280, h = 900, theme = 'light', sprints = SPRINTS, tickets = TICKETS } = {}) => {
77
78
  const ctx = await browser.newContext({ viewport: { width: w, height: h }, colorScheme: theme });
78
79
  await ctx.addInitScript((t) => { try { localStorage.setItem('pmos.c3.theme', t); } catch { /* none */ } }, theme);
@@ -1,13 +1,15 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
- /* premium-vw-meet-test.js — the meeting in the Viewer card (initiative premium-viewer, R3; re-pointed for premium-agreed-design, area viewer:
4
- * Main.dc.html AgPrep / AgMeetLive / AgMeeting; re-pointed again for premium-uncovered-features, meetings: MtAfter, MtFocus, MtReplay, MtMaterial).
3
+ /* premium-vw-meet-test.js — the meeting in the Viewer (initiative premium-viewer, R3; re-pointed for premium-agreed-design, premium-uncovered-features
4
+ * and the Viewer kit build, meetings: XvAPrep, XvALive, XvAReplay, XvAReplayEdit, XvAMaterial, XvAMaterialPreview, XvAPresent).
5
5
  * Serves the real /premium-viewer.html from the real server; the notes, the calendar, Focus, the replay and the viewer-meeting record are answered
6
6
  * by stand-ins (fixtures/premium-viewer-fixtures.js), so each press can be read off the request the page sent. The routes' own behaviour is in
7
- * their own suites; the pure half is in premium-vw-meet.test.js, premium-vw-agreed.test.js and premium-uncovered-meetings.test.js.
8
- * One card with no conversation: a meeting to come is prep with no tabs; a live one has Live notes | Focus | Transcript; a done one has
9
- * Notes | Replay | Transcript, Notes open.
10
- * S1 tabs · S2 head · S3 After · S4 Make task and Becomes V.4 · S5 Before (prep) · S6 During · S7 series membership · S8 no note · S9 writes · S10 floors
7
+ * their own suites; the pure half is in premium-vw-agreed.test.js, premium-uncovered-meetings.test.js and viewer-meetings.test.js.
8
+ * Viewer shell A: one summary first (its state line, the words, one quiet meta line, one primary or the icon-only presses), then folds; no tabs.
9
+ * ⋯ in the header holds what is used less (What it is about, the meetings before and after, Copy, New meeting, the source, shots, series, Private).
10
+ * S1 summary first · S2 header and ⋯ · S3 After: replay, folds, Transcript · S4 Make task and Becomes V.4 · S5 a correction and what PMOS learns
11
+ * S6 Before (prep): Record, agenda minutes, material preview and ←, Present and the audience window, Add material, Upload a file
12
+ * S7 During · S8 series membership · S9 writes · S10 no note · S11 floors
11
13
  * Every wait polls the page; no fixed sleep stands in for a state. */
12
14
  const path = require('path');
13
15
  const { spawn } = require('child_process');
@@ -38,47 +40,47 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
38
40
  await T.waitForServer(BASE);
39
41
  browser = await chromium.launch({ executablePath: exe });
40
42
  const body = (p) => p.evaluate(() => (document.querySelector('#czViewer .cz-vw-body') || {}).innerText || '');
41
- const tabs = (p) => p.evaluate(() => [...document.querySelectorAll('#czViewer .vzm-tabs [data-a="tab"]')].map((x) => x.dataset.k + (x.getAttribute('aria-selected') === 'true' ? '*' : '')).join());
42
43
  const press = (p, sel) => p.$eval('#czViewer ' + sel, (b) => b.click());
44
+ const folds = (p) => p.evaluate(() => [...document.querySelectorAll('#czViewer [data-czs-fold]')].map((x) => x.dataset.czsFold + (x.getAttribute('aria-expanded') === 'true' ? '*' : '')).join());
45
+ const unfold = async (p, id) => { if (await p.evaluate((k) => document.querySelector(`#czViewer [data-czs-fold="${k}"]`).getAttribute('aria-expanded') !== 'true', id)) await press(p, `[data-czs-fold="${id}"]`); };
46
+ const sum = (p) => p.evaluate(() => { const s = document.querySelector('#czViewer .czs-sum'); return s ? { line: s.querySelector('.czs-line').innerText, text: (s.querySelector('.czs-p') || {}).innerText || '', meta: (s.querySelector('.czs-meta') || {}).innerText || '', pri: (s.querySelector('[data-czs-act]') || {}).textContent || '' } : null; });
43
47
 
44
- /* an ended meeting with notes */
48
+ /* an ended meeting with notes and a recording */
45
49
  const A = await F.open(browser, BASE, '/premium-viewer.html?open=meeting&note=n1');
46
50
  const p = A.page;
47
- const up = await until(() => p.evaluate(() => !!document.querySelector('#czViewer .vz-mtg[data-mk="notes"]') && /Next steps/.test(document.body.innerText)), 15000);
48
- ok('0 the meeting opens in the Viewer card on its own page', up);
51
+ const up = await until(() => p.evaluate(() => !!document.querySelector('#czViewer .vz-mtg[data-mk="notes"]') && !!document.querySelector('#czViewer .czs-sum')), 15000);
52
+ ok('0 the meeting opens in the Viewer on its own page', up);
49
53
  if (!up) return finish(1);
50
54
 
51
- /* S1 tabs */
52
- ok('S1 a done meeting has Notes, Replay and Transcript, Notes open', await tabs(p) === 'notes*,replay,tr', await tabs(p));
53
- ok('S1 no Detail or Conversation switch, no #dlg', await p.evaluate(() => !document.querySelector('#dlg, #dTabs, .stream')));
54
- ok('S1 the note was read from GET /api/notes/one', A.S.gets.some((g) => g.startsWith('/api/notes/one?id=n1')));
55
+ /* S1 summary first */
56
+ const s1 = await sum(p);
57
+ ok('S1 the summary: "N of M points kept · K to confirm", the overview, and one primary, Confirm K', /^\d+ of \d+ points kept · (\d+) to confirm$/.test(s1.line) && /opens next to the chat/.test(s1.text) && s1.pri === 'Confirm ' + s1.line.match(/(\d+) to confirm/)[1], JSON.stringify(s1));
58
+ ok('S1 the summary is the body\'s first child, before the replay card and the folds', await p.evaluate(() => document.querySelector('#czViewer .cz-vw-body').firstElementChild.classList.contains('czs-sum') && !!document.querySelector('#czViewer .vzp-card .vzp-pl')));
59
+ ok('S1 then the folds: All kept, Next steps, Since the last one, Facts, Prep and material, Transcript; no tabs', (await folds(p)).replace(/\*/g, '') === 'kept,steps,since,facts,prep,tr' && !(await p.$('#czViewer [role="tablist"]')), await folds(p));
60
+ ok('S1 no Detail or Conversation switch, no #dlg; the note was read from GET /api/notes/one', await p.evaluate(() => !document.querySelector('#dlg, #dTabs, .stream')) && A.S.gets.some((g) => g.startsWith('/api/notes/one?id=n1')));
55
61
 
56
- /* S2 the head */
57
- const head = await p.evaluate(() => ({ state: !!document.querySelector('#czViewer .vzm-state'), sub: document.querySelector('#czViewer .vzm-sub').textContent, about: document.querySelector('#czViewer [data-a="m-about"]').textContent, ser: (document.querySelector('#czViewer .vzm-sn') || {}).textContent || '', kind: document.querySelector('#czViewer .cz-vw-kind').textContent }));
58
- ok('S2 the head: the time and the people, About Viewer, the series 4 of 4, ⋯ and no state chip once done', /31 min/.test(head.sub) && /Ana, Dita, Wawan/.test(head.sub) && head.about === 'Viewer' && head.ser === '4 of 4' && !head.state && await p.evaluate(() => !!document.querySelector('#czViewer [data-a="more"]')), JSON.stringify(head));
59
- ok('S2 the header kind is Meeting notes', head.kind === 'Meeting notes', head.kind);
60
- await press(p, '[data-a="more"]');
61
- const menu = await until(() => p.evaluate(() => { const b = [...document.querySelectorAll('#czViewer [role="menu"] [data-a]')]; return b.length ? b.map((x) => x.dataset.a) : null; }));
62
- ok('S2 ⋯ holds Copy as Markdown, New meeting, What Record and Focus do', menu && menu.join() === 'm-copy,m-fresh,m-why', JSON.stringify(menu));
63
- ok('S2 each menu item has a sub-line', await p.evaluate(() => [...document.querySelectorAll('#czViewer [role="menu"] [data-a]')].every((b) => b.innerText.split('\n').length >= 2)));
62
+ /* S2 the header and ⋯ */
63
+ const hd = await p.evaluate(() => ({ kind: document.querySelector('#czViewer .cz-vw-kind').textContent, title: document.querySelector('#czViewer .cz-vw-title').textContent, about: document.querySelector('#czViewer .czs-sum [data-a="m-about"]').textContent }));
64
+ ok('S2 the header: Meeting notes, the title with its day and time; the meta line: About Viewer, 31 min, the people, 4 of 4 in the series', hd.kind === 'Meeting notes' && /^Viewer sync · today \d{2}:\d{2}$/.test(hd.title) && /Viewer/.test(hd.about) && /31 min/.test(s1.meta) && /Ana, Dita, Wawan/.test(s1.meta) && /4 of 4 in the series/.test(s1.meta), JSON.stringify([hd, s1.meta]));
65
+ const m1 = await F.more(p);
66
+ ok('S2 ⋯ holds Change what it is about, the meeting before, Copy as Markdown, New meeting, What Record and Focus do, Not part of this series', m1 && m1.slice(0, 6).join('|') === 'Change what it is about|The meeting before · Thu 15 Oct|Copy as Markdown|New meeting|What Record and Focus do|Not part of this series', JSON.stringify(m1));
64
67
  await p.context().grantPermissions(['clipboard-read', 'clipboard-write']).catch(() => {});
65
- await press(p, '[data-a="m-copy"]');
68
+ await F.more(p, 'Copy as Markdown');
66
69
  const clip = await until(() => p.evaluate(() => navigator.clipboard.readText().catch(() => '')));
67
70
  ok('S2 Copy as Markdown copies the notes', /^# Viewer sync/.test(clip || '') && /Diffs can be approved/.test(clip || ''), String(clip).slice(0, 200));
68
71
 
69
72
  /* S3 After */
73
+ await unfold(p, 'since'); await unfold(p, 'facts');
70
74
  const after = await body(p);
71
- ok('S3 the summary, Since the last one, decisions and next steps', /opens next to the chat/.test(after) && /Since the last one/.test(after) && /Raised again/.test(after) && /Diffs can be approved/.test(after) && /Add a print view/.test(after), after.slice(0, 400));
72
- ok('S3 Facts mentioned: Matches and Not checked', /Facts mentioned/.test(after) && /Matches/.test(after) && /Not checked/.test(after));
73
- await press(p, '[data-a="tab"][data-k="replay"]');
74
- ok('S3 the Replay tab has the screen thumbnails, with no Waiting for design marker', await until(() => p.evaluate(() => document.querySelectorAll('#czViewer .vzp-th').length === 3 && !document.querySelector('#czViewer [data-cz-placeholder]'))));
75
- await press(p, '.vzp-th[data-a="seekto"]');
75
+ ok('S3 Since the last one and Facts mentioned, Matches and Not checked', /Raised again/.test(after) && /Matches/.test(after) && /Not checked/.test(after), after.slice(0, 600));
76
+ ok('S3 the replay card has the screen thumbnails, with no Waiting for design marker', await until(() => p.evaluate(() => document.querySelectorAll('#czViewer .vzp-card .vzp-th').length > 0 && !document.querySelector('#czViewer [data-cz-placeholder]'))));
77
+ await press(p, '.vzp-card .vzp-th[data-a="seekto"]');
76
78
  ok('S3 a thumbnail moves the replay to its time', await until(() => p.evaluate(() => /^03:10/.test((document.querySelector('#czViewer [data-clk="pos"]') || {}).textContent || ''))), await p.evaluate(() => (document.querySelector('#czViewer [data-clk="pos"]') || {}).textContent));
77
- await press(p, '[data-a="tab"][data-k="tr"]');
78
- ok('S3 the Transcript tab shows the lines, Dita named', await until(async () => /The Viewer sits beside the chat now/.test(await body(p)) && /Dita/.test(await body(p))));
79
- await press(p, '[data-a="tab"][data-k="notes"]');
79
+ await unfold(p, 'tr');
80
+ ok('S3 the Transcript fold shows the lines, Dita named', await until(async () => /The Viewer sits beside the chat now/.test(await body(p)) && /Dita/.test(await body(p))));
80
81
 
81
82
  /* S4 Make task: a work-item becomes V.4 Drafted in PMOS */
83
+ await unfold(p, 'steps');
82
84
  await until(() => p.evaluate(() => !!document.querySelector('#czViewer [data-a="makewi"][data-i="0"]')));
83
85
  ok('S4 each step offers Make task and an icon-only work-item press', await p.evaluate(() => !!document.querySelector('#czViewer [data-a="maketask"][data-i="0"]') && !document.querySelector('#czViewer [data-a="makewi"][data-i="0"]').textContent.trim()));
84
86
  await press(p, '[data-a="makewi"][data-i="0"]');
@@ -87,66 +89,120 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
87
89
  await press(p, '[data-a="maketask"][data-i="1"]');
88
90
  ok('S4 Make task writes one plan item for the step', await until(() => A.S.posts.some((x) => x.path === '/api/plan-items' && JSON.stringify(x.body).includes('Move saved views'))));
89
91
 
90
- /* S7 series membership */
91
- await press(p, '[data-a="sermenu"]');
92
- await until(() => p.evaluate(() => !!document.querySelector('#czViewer [data-a="m-serout"]')));
93
- await press(p, '[data-a="m-serout"]');
94
- ok('S7 Not part of this series posts key off', await until(() => A.S.posts.some((x) => x.path === '/api/notes/series-member' && x.body.key === 'off')));
92
+ /* S5 a correction, and what PMOS learns (XvAReplayEdit) */
93
+ await unfold(p, 'kept');
94
+ const pid = await p.evaluate(() => { const b = document.querySelector('#czViewer [data-czs-id="kept"] [data-a="pedit"]'); if (b) b.click(); return b && b.dataset.id; });
95
+ ok('S5 tapping a kept point opens the editor in place: the kinds, the words, what PMOS will remember', !!pid && await until(() => p.evaluate(() => !!document.querySelector('#czViewer .vzp-ed [data-a="etext"]') && document.querySelectorAll('#czViewer .vzp-ed [data-a="ekind"]').length === 3 && document.querySelector('#czViewer .vzp-ed [data-a="esave"]').disabled)), pid);
96
+ const kNow = await p.evaluate(() => document.querySelector('#czViewer .vzp-ed [data-a="ekind"][aria-checked="true"]').dataset.k);
97
+ const kNew = kNow === 'question' ? 'action' : 'question';
98
+ await press(p, `.vzp-ed [data-a="ekind"][data-k="${kNew}"]`);
99
+ ok('S5 a changed kind strikes the old reading, says what PMOS will remember, offers Only fix this one, and Save', await until(() => p.evaluate(() => !!document.querySelector('#czViewer .vzp-ed .vzp-was s') && /I will remember this\./.test(document.querySelector('#czViewer .vzp-learn').textContent) && !!document.querySelector('#czViewer .vzp-ed [data-a="elearn"]') && !document.querySelector('#czViewer .vzp-ed [data-a="esave"]').disabled)));
100
+ await press(p, '.vzp-ed [data-a="esave"]');
101
+ const ed = await until(() => A.S.posts.find((x) => x.path === '/api/meeting-points/edit'));
102
+ ok('S5 Save posts the correction with its original and learn on', ed && ed.body.note === 'n1' && ed.body.id === pid && ed.body.kind === kNew && ed.body.orig && ed.body.learn !== false, JSON.stringify(ed && ed.body));
103
+ ok('S5 the page says Fixed and what it will remember, with Undo', await until(async () => /Fixed\./.test(await body(p)) && !!(await p.$('#czViewer .vz-msg [data-a="msgundo"]'))), (await body(p)).slice(0, 300));
104
+ await press(p, '.vz-msg [data-a="msgundo"]');
105
+ ok('S5 Undo forgets the lesson (POST /api/meeting-points/forget)', await until(() => A.S.posts.some((x) => x.path === '/api/meeting-points/forget' && x.body.lesson === 'l0123456789')), JSON.stringify(A.S.posts.map((x) => x.path)));
106
+ await press(p, '.czs-sum [data-czs-act="confirmall"]');
107
+ ok('S5 Confirm in the summary confirms what is left to confirm', await until(() => A.S.posts.some((x) => x.path === '/api/meeting-points' && x.body.verdict === 'confirmed' && x.body.ids.length > 0)), JSON.stringify(A.S.posts.filter((x) => x.path === '/api/meeting-points')));
108
+
109
+ /* S8 series membership */
110
+ await F.more(p, 'Not part of this series');
111
+ ok('S8 ⋯ Not part of this series posts key off', await until(() => A.S.posts.some((x) => x.path === '/api/notes/series-member' && x.body.key === 'off')));
95
112
 
96
113
  /* S9 writes: only the presses */
97
- const allowed = ['/api/viewer-meeting/work-item', '/api/plan-items', '/api/notes/series-member'];
114
+ const allowed = ['/api/viewer-meeting/work-item', '/api/plan-items', '/api/notes/series-member', '/api/meeting-points/edit', '/api/meeting-points/forget', '/api/meeting-points'];
98
115
  ok('S9 the page wrote only what was pressed', A.S.posts.every((x) => allowed.includes(x.path)), JSON.stringify(A.S.posts.map((x) => x.path)));
99
116
  ok('S9 no page error', A.errors.length === 0, A.errors.join(' | '));
100
117
  await A.ctx.close();
101
118
 
102
- /* S5 Before: a meeting to come, no note */
119
+ /* S6 Before: a meeting to come, no note */
103
120
  const B = await F.open(browser, BASE, '/premium-viewer.html?open=meeting&event=ev-rail&date=' + F.dayKey(F.world().RAIL), { scene: 'prep' });
104
121
  const q = B.page;
105
- const prepUp = await until(() => q.evaluate(() => !!document.querySelector('#czViewer .vz-mtg[data-mk="prep"]')), 15000);
106
- ok('S5 a meeting to come opens on prep, with no tabs and Record in the head', prepUp && await tabs(q) === '' && await q.evaluate(() => !!document.querySelector('#czViewer .vzm-hc [data-a="record"]')), await tabs(q));
107
- const pre = await body(q);
108
- ok('S5 Prepared for you, What matters today, Agenda with minutes, Material', /Prepared for you/.test(pre) && /What matters today/.test(pre) && /Agenda/.test(pre) && /10 min/.test(pre) && /Rail PRD/.test(pre), pre.slice(0, 500));
109
- ok('S5 the state chip says Starts in about 30 min', /Starts in (29|30|31) min/.test(await q.textContent('#czViewer .vzm-state')), await q.textContent('#czViewer .vzm-state'));
122
+ const prepUp = await until(() => q.evaluate(() => !!document.querySelector('#czViewer .vz-mtg[data-mk="prep"]') && !!document.querySelector('#czViewer .czs-sum')), 15000);
123
+ const s6 = await sum(q);
124
+ ok('S6 a meeting to come: "Starts in about 30 min", its purpose, About · people · N of M ready, and an icon-only Record', prepUp && /^Starts in (29|30|31) min$/.test(s6.line) && /Agree the rail/.test(s6.text) && /ready/.test(s6.meta) && await q.evaluate(() => { const b = document.querySelector('#czViewer .czs-sum [data-a="record"]'); return !!b && !b.textContent.trim(); }), JSON.stringify(s6));
125
+ ok('S6 the folds: Agenda open, What matters today, To be ready, Material', /^agenda\*,matters,ready,mat/.test(await folds(q)), await folds(q));
126
+ await unfold(q, 'matters');
127
+ ok('S6 What matters today and Agenda with minutes', /The SSO spike/.test(await body(q)) && /10 min/.test(await body(q)), (await body(q)).slice(0, 500));
110
128
  await q.$eval('#czViewer [data-a="min"][data-i="1"]', (b) => b.click());
111
129
  await until(() => q.evaluate(() => !!document.querySelector('#czViewer [data-a="minin"]')));
112
130
  await q.fill('#czViewer [data-a="minin"]', '15'); await q.press('#czViewer [data-a="minin"]', 'Enter');
113
- ok('S5 changing a topic\'s minutes posts them to /api/viewer-meeting/agenda', await until(() => B.S.posts.some((x) => x.path === '/api/viewer-meeting/agenda' && x.body.min === 15)), JSON.stringify(B.S.posts));
131
+ ok('S6 changing a topic\'s minutes posts them to /api/viewer-meeting/agenda', await until(() => B.S.posts.some((x) => x.path === '/api/viewer-meeting/agenda' && x.body.min === 15)), JSON.stringify(B.S.posts));
132
+ await unfold(q, 'mat');
133
+ const mrows = await q.evaluate(() => [...document.querySelectorAll('#czViewer .vzm-mats [data-a="mat"]')].map((b) => b.innerText.replace(/\n/g, ' · ')));
134
+ ok('S6 each material row says its kind and how it opens; Present is an icon on what can be presented', mrows.length === 3 && /Release deck · PMOS deck/.test(mrows[0]) && /Website · opens live · for The report panel/.test(mrows[2]) && await q.evaluate(() => [...document.querySelectorAll('#czViewer .vzm-mats [data-a="present"]')].every((b) => !b.textContent.trim())), JSON.stringify(mrows));
135
+ /* the preview: only you see it, ← comes back */
136
+ await press(q, '.vzm-mats [data-a="mat"][data-i="0"]');
137
+ ok('S6 a material row opens its preview in the Viewer, only for you, with ← back', await until(() => q.evaluate(() => !!document.querySelector('#czViewer .vzx-pv') && /only you see this\. The meeting does not\./.test(document.querySelector('#czViewer .vzx-pvl').textContent) && !!document.querySelector('#czViewer [data-cz-vw="back"]'))), (await body(q)).slice(0, 300));
138
+ ok('S6 the preview\'s ⋯ holds Remove from this meeting', await until(async () => { const r = await F.more(q); return r && r.some((x) => /^Remove from this meeting/.test(x)); }));
139
+ await q.$eval('#czViewer [data-cz-vw="back"]', (b) => b.click());
140
+ ok('S6 ← comes back to the meeting', await until(() => q.evaluate(() => !!document.querySelector('#czViewer .vz-mtg[data-mk="prep"]') && !document.querySelector('#czViewer .vzx-pv'))));
141
+ /* Present: the audience window opens with the press, the presenter fills the page */
142
+ await unfold(q, 'mat');
143
+ const popP = q.context().waitForEvent('page', { timeout: 8000 }).catch(() => null);
144
+ await press(q, '.vzm-mats [data-a="present"][data-i="0"]');
145
+ const aud = await popP;
146
+ ok('S6 Present opens the audience window in the same press', !!aud);
147
+ ok('S6 the presenter: Stop is an icon (Esc), and the share spot names the call app\'s Share', await until(() => q.evaluate(() => { const s = document.querySelector('.vzx [data-x="end"]'); return !!s && !s.textContent.trim() && /Esc/.test(s.getAttribute('aria-label')) && /Share/.test(document.querySelector('.vzx [data-x="share"]').textContent); })), 10000);
148
+ if (aud) ok('S6 the audience window shows the stage only', await until(() => aud.evaluate(() => !!document.querySelector('.vzx-aud') && !document.querySelector('[data-x="end"]')).catch(() => false), 8000));
149
+ await q.keyboard.press('Escape');
150
+ ok('S6 Esc stops presenting and the meeting is back', await until(() => q.evaluate(() => !document.querySelector('.vzx') && !!document.querySelector('#czViewer .vz-mtg'))));
151
+ /* Add material: find, paste a link, or upload a file */
114
152
  await q.$eval('#czViewer [data-a="addmat"]', (b) => b.click());
115
- ok('S5 Add material opens its popover under the list, with no Waiting for design marker', await until(() => q.evaluate(() => !!document.querySelector('#czViewer .vzm-anc[data-pop="mat"] .vzm-pop [data-a="matq"]') && !document.querySelector('#czViewer [data-cz-placeholder]'))));
153
+ ok('S6 Add material opens its popover under the list: Upload a file, Paste a link, Find in PMOS', await until(() => q.evaluate(() => !!document.querySelector('#czViewer .vzm-anc[data-pop="mat"] .vzm-pop [data-a="matq"]') && !!document.querySelector('#czViewer .vzm-pop input[type="file"][data-a="matfile"]') && !!document.querySelector('#czViewer .vzm-pop [data-a="matlink"]') && !document.querySelector('#czViewer [data-cz-placeholder]'))));
154
+ // the card draws again as the presenter closes: a file picked on an input that was replaced meanwhile is still sent (its own change handler)
155
+ await q.setInputFiles('#czViewer .vzm-pop input[type="file"][data-a="matfile"]', { name: 'Board shot.png', mimeType: 'image/png', buffer: Buffer.from('\x89PNG....') });
156
+ ok('S6 Upload a file sends the bytes, then adds the kept file to the meeting', await until(() => B.S.posts.some((x) => x.path === '/api/meeting-material/file' && x.body.name === 'Board shot.png' && x.body.size > 0) && B.S.posts.some((x) => x.path === '/api/meeting-material' && x.body.item && x.body.item.kind === 'file' && /Board-shot\.png$/.test(x.body.item.ref))), JSON.stringify(B.S.posts.slice(-3)));
157
+ ok('S6 no page error', B.errors.length === 0, B.errors.join(' | '));
116
158
  await B.ctx.close();
117
159
 
118
- /* S6 During: a note that records */
160
+ /* S7 During: a note that records */
119
161
  const C = await F.open(browser, BASE, '/premium-viewer.html?open=meeting&note=n2', { init: () => { window.__premiumHolding = { id: 'n2' }; } });
120
162
  const r = C.page;
121
- const liveUp = await until(() => r.evaluate(() => !!document.querySelector('#czViewer .vz-mtg[data-mk="live"]')), 15000);
122
- ok('S6 a recording note opens on Live notes, with Focus and Transcript beside it', liveUp && await tabs(r) === 'notes*,focus,tr', await tabs(r));
163
+ const liveUp = await until(() => r.evaluate(() => !!document.querySelector('#czViewer .vz-mtg[data-mk="live"]') && !!document.querySelector('#czViewer .czs-sum')), 15000);
164
+ const s7 = await sum(r);
165
+ ok('S7 a recording note: "Recording · mm:ss", Now on the topic, the source, and the icon-only Stop, Highlight and Pause', liveUp && /^Recording · \d{2}:\d{2}$/.test(s7.line) && /^Now on: The Issue button, topic 2 of 3\./.test(s7.text) && /Zoom app · microphone and meeting/.test(s7.meta)
166
+ && await r.evaluate(() => ['stop', 'hl', 'pause'].every((k) => { const b = document.querySelector(`#czViewer .czs-sum [data-a="${k}"]`); return b && !b.textContent.trim(); })), JSON.stringify(s7));
167
+ ok('S7 the folds: Your notes and Material open, Caught so far, Highlights, Agenda, Transcript', (await folds(r)) === 'mine*,caught,mat*,hl,agenda,tr', await folds(r));
168
+ await unfold(r, 'caught'); await unfold(r, 'hl');
123
169
  const lv = await body(r);
124
- ok('S6 the recording line, the audio source line, Pause shots and Private', /Recording · /.test(lv) && /Listening to Zoom app/.test(lv) && /Pause shots/.test(lv) && /Private: keep only what I type/.test(lv), lv.slice(0, 400));
125
- ok('S6 Now on with the topic bars, Caught so far, Highlights', /Now on/.test(lv) && await r.evaluate(() => document.querySelectorAll('#czViewer .vz-stretch rect').length === 3) && /Caught so far: 1 decision, 2 next steps/.test(lv) && /Highlights/.test(lv) && /Issue is the blue button/.test(lv), lv.slice(0, 600));
126
- await r.$eval('#czViewer [data-a="shots"]', (b) => b.click());
127
- ok('S6 Pause shots posts shots paused for the note', await until(() => C.S.posts.some((x) => x.path === '/api/viewer-meeting/capture' && x.body.id === 'n2' && x.body.shots === 'paused')));
128
- await r.$eval('#czViewer [data-a="src"]', (b) => b.click());
170
+ ok('S7 Caught so far and Highlights', /1 decision/.test(lv) && /2 next steps/.test(lv) && /Issue is the blue button/.test(lv), lv.slice(0, 600));
171
+ const m7 = await F.more(r);
172
+ ok('S7 ⋯ holds Listen to another app, Pause screen shots, and Make this note private last', m7 && m7.includes('Listen to another app') && m7.includes('Pause screen shots') && m7[m7.length - 1] === 'Make this note private', JSON.stringify(m7));
173
+ await F.more(r, 'Pause screen shots');
174
+ ok('S7 ⋯ Pause screen shots posts shots paused for the note', await until(() => C.S.posts.some((x) => x.path === '/api/viewer-meeting/capture' && x.body.id === 'n2' && x.body.shots === 'paused')));
175
+ await F.more(r, 'Listen to another app');
176
+ await until(() => r.evaluate(() => !!document.querySelector('#czViewer [data-a="app"][data-id="meet"]')));
129
177
  await r.$eval('#czViewer [data-a="app"][data-id="meet"]', (b) => b.click());
130
- ok('S6 picking where the meeting is posts the app', await until(() => C.S.posts.some((x) => x.path === '/api/viewer-meeting/capture' && x.body.app === 'meet')));
178
+ ok('S7 picking where the meeting is posts the app', await until(() => C.S.posts.some((x) => x.path === '/api/viewer-meeting/capture' && x.body.app === 'meet')));
179
+ await unfold(r, 'tr');
131
180
  await r.$eval('#czViewer .vz-who', (b) => b.click());
132
181
  await until(() => r.evaluate(() => !!document.querySelector('#czViewer [data-a="namein"]')));
133
182
  await r.fill('#czViewer [data-a="namein"]', 'Ana Lima'); await r.$eval('#czViewer [data-a="nameok"]', (b) => b.click());
134
- ok('S6 naming a speaker posts the name for the line\'s source', await until(() => C.S.posts.some((x) => x.path === '/api/notes/speaker' && x.body.name === 'Ana Lima' && x.body.id === 'n2')), JSON.stringify(C.S.posts.slice(-2)));
183
+ ok('S7 naming a speaker in the Transcript posts the name for the line\'s source', await until(() => C.S.posts.some((x) => x.path === '/api/notes/speaker' && x.body.name === 'Ana Lima' && x.body.id === 'n2')), JSON.stringify(C.S.posts.slice(-2)));
184
+ ok('S7 no page error', C.errors.length === 0, C.errors.join(' | '));
135
185
  await C.ctx.close();
136
186
 
137
- /* S8 a note that is not there */
187
+ /* S10 a note that is not there */
138
188
  const D = await F.open(browser, BASE, '/premium-viewer.html?open=meeting&note=nope');
139
- ok('S8 a note that is not there says so, and the card still opens', await until(() => D.page.evaluate(() => !!document.querySelector('#czViewer') && /Untitled note|could not|not/.test(document.querySelector('#czViewer').innerText))));
189
+ ok('S10 a note that is not there says so, and the card still opens', await until(() => D.page.evaluate(() => !!document.querySelector('#czViewer') && /Untitled note|could not|not/.test(document.querySelector('#czViewer').innerText))));
140
190
  await D.ctx.close();
141
191
 
142
- /* S10 floors: a phone, and no old layout */
143
- const E = await F.open(browser, BASE, '/premium-viewer.html?open=meeting&note=n1', { w: 390, h: 844 });
144
- await until(() => E.page.evaluate(() => !!document.querySelector('#czViewer .vz-mtg')), 15000);
145
- const fl = await E.page.evaluate(() => ({ over: document.documentElement.scrollWidth - innerWidth, full: (() => { const r = document.querySelector('#czViewer').getBoundingClientRect(); return r.left === 0 && Math.round(r.width) === innerWidth; })(),
146
- c3: [...document.querySelectorAll('script[src],link[href]')].some((x) => /c3-/.test(x.src || x.href)), old: !!document.querySelector('#czViewer #dTabs, #czViewer .stream') }));
147
- ok('S10 on a phone the card is the whole screen with no sideways scroll and no Detail/Conversation tabs', fl.over <= 0 && fl.full && !fl.old, JSON.stringify(fl));
148
- ok('S10 no c3 file is loaded', !fl.c3);
149
- ok('S10 no page error on the phone', E.errors.length === 0, E.errors.join(' | '));
150
- await E.ctx.close();
192
+ /* S11 floors: a phone (XvAPhMeet), and no old layout */
193
+ // the meeting's own presses: the summary's (the shell's primary button is the shell's) and the folds; a press may keep its drawn size and take a 44 px hit area from ::before
194
+ const HITS = () => { window.hits = () => [...document.querySelectorAll('#czViewer .czs-sum button:not(.czs-pri), #czViewer [data-czs-fold]')].filter((b) => { if (!b.getClientRects().length) return false; const pb = getComputedStyle(b, '::before'), hit = pb.content !== 'none' && pb.position === 'absolute' ? parseFloat(pb.height) || 0 : 0; return Math.max(b.getBoundingClientRect().height, hit) < 44; }).map((b) => (b.dataset.a || b.dataset.czsFold || b.className) + ':' + Math.round(b.getBoundingClientRect().height)); };
195
+ for (const [u, o] of [['/premium-viewer.html?open=meeting&note=n1', {}], ['/premium-viewer.html?open=meeting&note=n2', { init: () => { window.__premiumHolding = { id: 'n2' }; } }]]) {
196
+ const E = await F.open(browser, BASE, u, { w: 390, h: 844, ...o });
197
+ await E.page.evaluate(HITS);
198
+ await until(() => E.page.evaluate(() => !!document.querySelector('#czViewer .vz-mtg') && !!document.querySelector('#czViewer .czs-sum')), 15000);
199
+ const fl = await until(async () => { const v = await E.page.evaluate(() => ({ over: document.documentElement.scrollWidth - innerWidth, full: (() => { const r = document.querySelector('#czViewer').getBoundingClientRect(); return r.left === 0 && Math.round(r.width) === innerWidth; })(),
200
+ c3: [...document.querySelectorAll('script[src],link[href]')].some((x) => /c3-/.test(x.src || x.href)), old: !!document.querySelector('#czViewer #dTabs, #czViewer .stream'),
201
+ small: hits() })); return v.small.length === 0 ? v : null; }, 8000)
202
+ || await E.page.evaluate(() => ({ small: hits() }));
203
+ ok(`S11 on a phone (${/n2/.test(u) ? 'live' : 'notes'}) the card is the whole screen, no sideways scroll, no Detail/Conversation tabs, the summary's presses and the folds at least 44 px`, fl.over <= 0 && fl.full && !fl.old && fl.small.length === 0, JSON.stringify(fl));
204
+ ok(`S11 no c3 file is loaded and no page error on the phone (${/n2/.test(u) ? 'live' : 'notes'})`, !fl.c3 && E.errors.length === 0, E.errors.join(' | '));
205
+ await E.ctx.close();
206
+ }
151
207
  finish();
152
208
  })();
@@ -50,8 +50,8 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
50
50
  /* N1 open */
51
51
  const A = await open('/premium-viewer.html?open=notes');
52
52
  const p = A.page;
53
- ok('N1 ?open=notes opens the Viewer card on its Notes side', await until(() => p.evaluate(() => document.querySelectorAll('#czViewer .vzc-grp').length > 0 && document.querySelector('#czViewer .vzc-tabs [data-c="tab"][data-k="notes"]').getAttribute('aria-selected') === 'true'), 15000), (await text(p)).slice(0, 300));
54
- ok('N1 the card has the Calendar and Notes tabs, the search and the kind chips, and no tabs strip or conversation', await p.evaluate(() => !!document.querySelector('#czViewer [data-c="tab"][data-k="cal"]') && !!document.querySelector('#czViewer [data-c="q"]') && document.querySelectorAll('#czViewer [data-c="filter"]').length === 4 && !document.querySelector('#vTabs, #dlg, .stream')));
53
+ ok('N1 ?open=notes opens the Viewer card on its Notes side', await until(() => p.evaluate(() => document.querySelectorAll('#czViewer .vzc-grp').length > 0 && document.querySelector('#czViewer .vzc-seg [data-c="tab"][data-k="notes"]').getAttribute('aria-selected') === 'true'), 15000), (await text(p)).slice(0, 300));
54
+ ok('N1 the card has the Calendar | Notes switch, the search and the kind chips, and no tabs strip or conversation', await p.evaluate(() => !!document.querySelector('#czViewer [data-c="tab"][data-k="cal"]') && !!document.querySelector('#czViewer [data-c="q"]') && document.querySelectorAll('#czViewer [data-c="filter"]').length === 4 && !document.querySelector('#vTabs, #dlg, .stream')));
55
55
 
56
56
  /* N2 groups */
57
57
  const g = await groups(p);
@@ -83,9 +83,10 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
83
83
  await tap(p, '[data-c="ser"][data-k="viewer-sync"]');
84
84
  ok('N3 pressing the series card unfolds its notes, newest first', await until(async () => (await ids(p)).slice(0, 2).join() === 'n1,n0'), JSON.stringify(await ids(p)));
85
85
  await tap(p, '[data-c="note"][data-id="n1"]');
86
- ok('N5 a note of the series opens and says N of M', await until(async () => /4 of 4/.test(await text(p))) && A.S.gets.some((x) => /notes\/one\?id=n1/.test(x)), (await text(p)).slice(0, 300));
87
- await tap(p, '.vzm-ser [data-a="note"]');
88
- ok('N5 paging reads the meeting before into the same card', await until(() => A.S.gets.some((x) => /notes\/one\?id=n0/.test(x))) && await p.evaluate(() => document.querySelectorAll('#czViewer .vz-mtg').length === 1));
86
+ ok('N5 a note of the series opens and its summary says 4 of 4 in the series', await until(async () => /4 of 4/.test(await text(p))) && A.S.gets.some((x) => /notes\/one\?id=n1/.test(x)), (await text(p)).slice(0, 300));
87
+ ok('N5 ⋯ holds the meeting before, and no meeting after the last one', await until(async () => { const r = await F.more(p); return r && r.some((x) => /^The meeting before/.test(x)) && !r.some((x) => /^The meeting after/.test(x)); }));
88
+ await F.more(p, 'The meeting before');
89
+ ok('N5 paging (⋯ The meeting before) reads the meeting before into the same card', await until(() => A.S.gets.some((x) => /notes\/one\?id=n0/.test(x))) && await p.evaluate(() => document.querySelectorAll('#czViewer .vz-mtg').length === 1));
89
90
 
90
91
  /* N6 Change what it is about */
91
92
  await p.evaluate(() => window.czViews.openNotes({}));
@@ -125,7 +126,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
125
126
  for (const th of ['light', 'dark']) {
126
127
  const P = await open('/premium-viewer.html?open=notes&theme=' + th, { w: 390, h: 844 });
127
128
  await until(() => P.page.evaluate(() => document.querySelectorAll('#czViewer .vzc-grp').length > 0), 15000);
128
- const fl = () => P.page.evaluate(() => ({ over: document.documentElement.scrollWidth - innerWidth, small: [...document.querySelectorAll('#czViewer .vzc-nr, #czViewer .vzc-tabs button, #czViewer [data-c="filter"]')].filter((b) => { if (!b.getClientRects().length) return false; const pb = getComputedStyle(b, '::before'), hit = pb.content !== 'none' && pb.position === 'absolute' ? parseFloat(pb.height) || 0 : 0; return Math.max(b.getBoundingClientRect().height, hit) < 44; }).length })); // a press may keep its drawn size (the Agreed mockup's segment and New note) and take a 44 px hit area from ::before
129
+ const fl = () => P.page.evaluate(() => ({ over: document.documentElement.scrollWidth - innerWidth, small: [...document.querySelectorAll('#czViewer .vzc-nr, #czViewer .vzc-seg button, #czViewer [data-c="filter"]')].filter((b) => { if (!b.getClientRects().length) return false; const pb = getComputedStyle(b, '::before'), hit = pb.content !== 'none' && pb.position === 'absolute' ? parseFloat(pb.height) || 0 : 0; return Math.max(b.getBoundingClientRect().height, hit) < 44; }).length })); // a press may keep its drawn size (the Agreed mockup's segment and New note) and take a 44 px hit area from ::before
129
130
  // the Meetings stylesheet loads after the list is drawn: measure once it applies, and fail if it never does
130
131
  const f0 = await until(async () => { const v = await fl(); return v.small === 0 ? v : null; }, 8000) || await fl();
131
132
  if (shotDir) await P.page.screenshot({ path: path.join(shotDir, `list-390-${th}.png`) });