create-pmos 0.401.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 (127) hide show
  1. package/package.json +25 -30
  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/board-programs-test.js +227 -0
  8. package/workspace/board-shot.js +54 -0
  9. package/workspace/briefing-premium-adddoc-test.js +28 -22
  10. package/workspace/briefing-premium-board-test.js +107 -82
  11. package/workspace/briefing-premium-calendar-2-test.js +23 -10
  12. package/workspace/briefing-premium-calendar-3-test.js +23 -19
  13. package/workspace/briefing-premium-calendar-test.js +20 -15
  14. package/workspace/briefing-premium-initiative-test.js +25 -12
  15. package/workspace/briefing-premium-insights-test.js +31 -18
  16. package/workspace/briefing-premium-metrics-test.js +8 -8
  17. package/workspace/briefing-premium-sources-test.js +15 -10
  18. package/workspace/briefing-premium-test.js +39 -16
  19. package/workspace/changelog.json +24 -0
  20. package/workspace/fixtures/board-premium-facts.js +20 -3
  21. package/workspace/fixtures/briefing-premium-facts.js +18 -2
  22. package/workspace/fixtures/premium-viewer-fixtures.js +24 -2
  23. package/workspace/fixtures/program-ascent.js +101 -0
  24. package/workspace/guide/home.md +11 -7
  25. package/workspace/guide/index.md +1 -0
  26. package/workspace/guide/jira.md +38 -6
  27. package/workspace/guide/programs.md +37 -0
  28. package/workspace/home-rows-test.js +184 -0
  29. package/workspace/lib/briefing-premium-products.js +4 -4
  30. package/workspace/lib/briefing-premium.js +2 -2
  31. package/workspace/lib/calendar-layers.js +8 -4
  32. package/workspace/lib/initiative-layout.js +4 -3
  33. package/workspace/lib/jira-cli.js +17 -12
  34. package/workspace/lib/jira-status.js +1 -1
  35. package/workspace/lib/jira-tickets.js +126 -24
  36. package/workspace/lib/meeting-files.js +58 -0
  37. package/workspace/lib/meeting-learn.js +139 -0
  38. package/workspace/lib/meeting-material.js +12 -5
  39. package/workspace/lib/notes.js +3 -0
  40. package/workspace/lib/programs.js +129 -0
  41. package/workspace/lib/route-modules.js +1 -0
  42. package/workspace/lib/routes-brief-page.js +8 -1
  43. package/workspace/lib/routes-briefing-premium.js +1 -1
  44. package/workspace/lib/routes-calendar-views.js +24 -3
  45. package/workspace/lib/routes-meeting-material.js +38 -0
  46. package/workspace/lib/routes-meeting-points.js +23 -3
  47. package/workspace/lib/routes-programs.js +122 -0
  48. package/workspace/package-lock.json +2 -2
  49. package/workspace/package.json +1 -1
  50. package/workspace/premium-board-actions-test.js +31 -25
  51. package/workspace/premium-chat-context-test.js +1 -1
  52. package/workspace/premium-chat-goal-view-test.js +1 -1
  53. package/workspace/premium-chat-viewer-test.js +1 -1
  54. package/workspace/premium-core-doc-issue-test.js +13 -7
  55. package/workspace/premium-discuss-landing-test.js +83 -0
  56. package/workspace/premium-link-suggest-test.js +103 -0
  57. package/workspace/premium-report-read-test.js +86 -82
  58. package/workspace/premium-vw-backlog-test.js +6 -5
  59. package/workspace/premium-vw-cal-test.js +45 -19
  60. package/workspace/premium-vw-item-test.js +8 -6
  61. package/workspace/premium-vw-jira-test.js +3 -2
  62. package/workspace/premium-vw-meet-test.js +122 -66
  63. package/workspace/premium-vw-notes-test.js +7 -6
  64. package/workspace/premium-vw-rec-test.js +14 -13
  65. package/workspace/premium-vw-slides-test.js +11 -5
  66. package/workspace/program-panel-test.js +152 -0
  67. package/workspace/public/pm/bd-acts.js +24 -15
  68. package/workspace/public/pm/bd-asks.js +111 -30
  69. package/workspace/public/pm/bd-ini-panel.js +229 -0
  70. package/workspace/public/pm/bd-pop.js +2 -2
  71. package/workspace/public/pm/bd-prog-panel.js +436 -0
  72. package/workspace/public/pm/bd-prog.js +191 -0
  73. package/workspace/public/pm/bd-span.js +98 -15
  74. package/workspace/public/pm/bd-views.js +93 -29
  75. package/workspace/public/pm/cozy-board.css +214 -20
  76. package/workspace/public/pm/cozy-evui.js +4 -2
  77. package/workspace/public/pm/cozy-home-rows.css +54 -0
  78. package/workspace/public/pm/cozy-home.css +35 -0
  79. package/workspace/public/pm/cozy-insights.css +1 -2
  80. package/workspace/public/pm/cozy-mtg-present.css +160 -0
  81. package/workspace/public/pm/cozy-panel.css +155 -0
  82. package/workspace/public/pm/cozy-rec-pill.css +12 -0
  83. package/workspace/public/pm/cozy-rec-pill.js +46 -0
  84. package/workspace/public/pm/cozy-today.css +189 -0
  85. package/workspace/public/pm/cozy-viewer.js +307 -43
  86. package/workspace/public/pm/cozy-vw-mtg.css +96 -94
  87. package/workspace/public/pm/cozy-vw-rp.css +40 -25
  88. package/workspace/public/pm/cozy-vw-shell.css +127 -0
  89. package/workspace/public/pm/cozy-xv.css +51 -0
  90. package/workspace/public/pm/cozy-xv.js +34 -0
  91. package/workspace/public/pm/home-app.js +192 -72
  92. package/workspace/public/pm/home-chat.js +17 -4
  93. package/workspace/public/pm/home-data.js +1 -1
  94. package/workspace/public/pm/home-day.js +64 -0
  95. package/workspace/public/pm/home-ini-model.js +1 -1
  96. package/workspace/public/pm/home-ini.js +197 -54
  97. package/workspace/public/pm/home-list.js +100 -27
  98. package/workspace/public/pm/home-mentions.js +187 -0
  99. package/workspace/public/pm/home-rec-row.js +67 -0
  100. package/workspace/public/pm/home-review.js +20 -10
  101. package/workspace/public/pm/home-task.js +19 -18
  102. package/workspace/public/pm/home-today.js +137 -59
  103. package/workspace/public/pm/premium-board.js +294 -288
  104. package/workspace/public/pm/premium-insights.js +118 -82
  105. package/workspace/public/pm/premium-mtg-present.js +408 -100
  106. package/workspace/public/pm/premium-mtg-replay.js +70 -10
  107. package/workspace/public/pm/premium-report-read.js +118 -63
  108. package/workspace/public/pm/premium-vw-cal.js +62 -34
  109. package/workspace/public/pm/premium-vw-mtg.js +348 -192
  110. package/workspace/public/pm/program-model.js +192 -0
  111. package/workspace/public/pm/rec-state.js +63 -0
  112. package/workspace/public/pm/rp-parts.js +33 -8
  113. package/workspace/public/pm/tk-draft.js +107 -0
  114. package/workspace/public/pm/tk-model.js +134 -0
  115. package/workspace/public/pm/tk-send.js +124 -0
  116. package/workspace/public/pm/tk-tasks.css +120 -0
  117. package/workspace/public/premium-board.html +4 -2
  118. package/workspace/server.js +4 -2
  119. package/workspace/skills/jira-push.skill +3 -3
  120. package/workspace/test-lists/board-programs.json +9 -0
  121. package/workspace/test-lists/prd-to-jira.json +6 -0
  122. package/workspace/test-lists/program-hierarchy.json +11 -0
  123. package/workspace/test-lists/program-panel.json +9 -0
  124. package/workspace/test-lists/viewer-home-rows.json +9 -0
  125. package/workspace/test-lists/viewer-meetings.json +9 -0
  126. package/workspace/test-lists/viewer-shell-a.json +15 -0
  127. package/workspace/tk-tasks-test.js +199 -0
@@ -43,7 +43,8 @@ const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'applicati
43
43
  const tap = (p, sel) => p.$eval('#czViewer ' + sel, (b) => b.click());
44
44
  const text = (p) => p.evaluate(() => (document.querySelector('#czViewer') || {}).innerText || '');
45
45
  const notesPosts = (S) => S.posts.filter((x) => x.path.startsWith('/api/notes/')).map((x) => x.path.replace('/api/notes/', ''));
46
- const chip = (p) => p.evaluate(() => (document.querySelector('#czViewer .vzm-state') || {}).textContent || '');
46
+ // Viewer shell A: the state is the summary's line, "Recording · 01:05" or "Paused at 01:05"
47
+ const chip = (p) => p.evaluate(() => { const t = (document.querySelector('#czViewer .czs-sum .czs-line') || {}).textContent || ''; return /^Recording · /.test(t) ? 'Recording' : /^Paused at /.test(t) ? 'Paused' : t; });
47
48
  const LIVE_URL = '/premium-viewer.html?open=meeting&event=ev-live&date=' + F.dayKey(W.LIVE);
48
49
  const ALL = [];
49
50
  const open = async (url, o) => { const X = await F.open(browser, BASE, url, { noLive: true, ...o }); ALL.push(X); return X; };
@@ -51,8 +52,8 @@ const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'applicati
51
52
  /* R1 record */
52
53
  const A = await open(LIVE_URL);
53
54
  const p = A.page;
54
- ok('R1 a meeting under way has Record', await until(() => p.evaluate(() => !!document.querySelector('#czViewer .vzm-hc [data-a="record"]')), 15000));
55
- await tap(p, '[data-a="more"]'); await tap(p, '[data-a="m-why"]');
55
+ ok('R1 a meeting under way has Record', await until(() => p.evaluate(() => !!document.querySelector('#czViewer .czs-sum [data-a="record"]')), 15000));
56
+ await F.more(p, 'What Record and Focus do');
56
57
  ok('R1 More says what Record and Focus do', await until(async () => /stay on this machine|on this machine/i.test(await text(p)) && !!(await p.$('#czViewer .vz-why'))), (await text(p)).slice(0, 400));
57
58
  ok('R1 nothing was sent to the notes routes before a press', notesPosts(A.S).length === 0);
58
59
  await tap(p, '[data-a="record"]');
@@ -63,14 +64,14 @@ const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'applicati
63
64
  await tap(p, '[data-a="recgo"]');
64
65
  const made = await until(() => A.S.posts.find((x) => x.path === '/api/notes/new'));
65
66
  ok('R1 "I told them, start" makes the note for the calendar event, then listens on it', made && JSON.stringify(made.body).includes('ev-live') && await until(() => notesPosts(A.S).join() === 'new,record'), JSON.stringify(made && made.body));
66
- ok('R2 the card says Recording, with the clock and Stop', await until(async () => (await chip(p)) === 'Recording' && /Recording · \d{2}:\d{2}/.test(await text(p)) && !!(await p.$('#czViewer .vzm-rec [data-a="stop"]'))));
67
+ ok('R2 the card says Recording, with the clock and Stop', await until(async () => (await chip(p)) === 'Recording' && /Recording · \d{2}:\d{2}/.test(await text(p)) && !!(await p.$('#czViewer .czs-sum [data-a="stop"]'))));
67
68
  ok('R3 no floating record chip is drawn while it records', !(await p.$('#recChip, #recCtl')));
68
69
 
69
70
  /* R2 pause and resume */
70
- await tap(p, '.vzm-rec [data-a="pause"]');
71
- ok('R2 Pause pauses through the route and the card says Paused with Resume', await until(async () => (await chip(p)) === 'Paused' && /Recording paused at \d{2}:\d{2} · nothing is kept while paused/.test(await text(p)) && !!(await p.$('#czViewer .vzm-rec [data-a="resume"]'))));
71
+ await tap(p, '.czs-sum [data-a="pause"]');
72
+ ok('R2 Pause pauses through the route and the card says Paused with Resume', await until(async () => (await chip(p)) === 'Paused' && /Paused at \d{2}:\d{2}\s+Nothing is kept while paused\./.test(await text(p)) && !!(await p.$('#czViewer .czs-sum [data-a="resume"]'))));
72
73
  ok('R3 no record chip while it is paused either', !(await p.$('#recChip, #recCtl')));
73
- await tap(p, '.vzm-rec [data-a="resume"]');
74
+ await tap(p, '.czs-sum [data-a="resume"]');
74
75
  ok('R2 Resume listens again on the same note, without asking for consent twice', await until(() => notesPosts(A.S).join() === 'new,record,pause,record') && !/Tell everyone first/.test(await text(p)));
75
76
 
76
77
  /* R4 leaving while it records */
@@ -81,12 +82,12 @@ const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'applicati
81
82
  ok('R4 leaving the page while it records makes the browser ask first, and staying pauses nothing', await until(() => dialog === 'beforeunload') && notesPosts(A.S).join() === 'new,record,pause,record', String(dialog));
82
83
 
83
84
  /* R1 stop */
84
- await until(() => p.evaluate(() => !!document.querySelector('#czViewer .vzm-rec [data-a="stop"]')));
85
- await tap(p, '.vzm-rec [data-a="stop"]');
85
+ await until(() => p.evaluate(() => !!document.querySelector('#czViewer .czs-sum [data-a="stop"]')));
86
+ await tap(p, '.czs-sum [data-a="stop"]');
86
87
  ok('R1 Stop asks first', await until(async () => /Stop for good/.test(await text(p))));
87
88
  await tap(p, '[data-a="askno"]');
88
89
  ok('R1 Not yet on the ask stops nothing', await until(async () => !/Stop for good/.test(await text(p))) && !notesPosts(A.S).includes('stop'));
89
- await tap(p, '.vzm-rec [data-a="stop"]');
90
+ await tap(p, '.czs-sum [data-a="stop"]');
90
91
  await tap(p, '[data-a="stopgo"]');
91
92
  ok('R1 Stop for good ends the meeting through the route, and the card says so', await until(async () => notesPosts(A.S).includes('stop') && /Stopped\. The final notes are written now/.test(await text(p))));
92
93
  ok('R10 the notes writes sent were new, record, pause, record, stop and nothing else', notesPosts(A.S).join() === 'new,record,pause,record,stop', notesPosts(A.S).join());
@@ -123,9 +124,10 @@ const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'applicati
123
124
  /* R5 Focus */
124
125
  const B = await open('/premium-viewer.html?open=meeting&note=n2', { noLive: false, init: () => { window.__premiumHolding = { id: 'n2' }; } });
125
126
  const q = B.page;
126
- await until(() => q.evaluate(() => !!document.querySelector('#czViewer [data-a="tab"][data-k="focus"]')), 15000);
127
- await tap(q, '[data-a="tab"][data-k="focus"]'); // premium-uncovered-features (meetings, MtFocus): Focus is a tab of the live meeting
128
- ok('R5 Focus: Now · topic 2 of 3, the topic, and the agenda with the minutes used', await until(async () => { const t = await text(q); return /Now · topic 2 of 3/.test(t) && /The Issue button/.test(t) && /One toolbar row/.test(t) && /Phone layout/.test(t) && /\d+ of 10/.test(t) && !(await q.$('#czViewer [data-cz-placeholder]')); }), (await text(q)).slice(0, 600));
127
+ await until(() => q.evaluate(() => !!document.querySelector('#czViewer [data-czs-fold="agenda"]')), 15000);
128
+ // Viewer kit (XvALive): the topic now is in the summary; the agenda with the minutes used and Change topic are the Agenda fold
129
+ if (await q.evaluate(() => document.querySelector('#czViewer [data-czs-fold="agenda"]').getAttribute('aria-expanded') !== 'true')) await tap(q, '[data-czs-fold="agenda"]');
130
+ ok('R5 Focus: Now on the topic, topic 2 of 3, and the agenda with the minutes used', await until(async () => { const t = await text(q); return /Now on: The Issue button, topic 2 of 3\./.test(t) && /One toolbar row/.test(t) && /Phone layout/.test(t) && /\d+ of 10/.test(t) && !(await q.$('#czViewer [data-cz-placeholder]')); }), (await text(q)).slice(0, 600));
129
131
  const f0 = B.S.gets.filter((g) => g.startsWith('/api/meeting-focus')).length;
130
132
  ok('R5 Focus reads again while the meeting is live', await until(() => B.S.gets.filter((g) => g.startsWith('/api/meeting-focus')).length >= f0 + 2, 12000));
131
133
  await tap(q, '[data-a="topic"]');
@@ -141,8 +143,10 @@ const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'applicati
141
143
  /* R7 Replay */
142
144
  const C = await open('/premium-viewer.html?open=meeting&note=n1');
143
145
  const r = C.page;
144
- ok('R7 a kept recording has the Replay tab', await until(() => r.evaluate(() => !!document.querySelector('#czViewer [data-a="tab"][data-k="replay"]')), 15000));
145
- await tap(r, '[data-a="tab"][data-k="replay"]');
146
+ // Viewer kit (XvAReplay): no tabs; the replay card sits under the summary, the kept points are the "All N kept" fold, the lines the Transcript fold
147
+ const unfold = async (id) => { if (await r.evaluate((k) => document.querySelector(`#czViewer [data-czs-fold="${k}"]`).getAttribute('aria-expanded') !== 'true', id)) await tap(r, `[data-czs-fold="${id}"]`); };
148
+ ok('R7 a kept recording has the replay card under the summary', await until(() => r.evaluate(() => !!document.querySelector('#czViewer .vzp-card .vzp-pl') && !document.querySelector('#czViewer [role="tablist"]')), 15000));
149
+ await unfold('kept');
146
150
  const playing = () => r.evaluate(() => /^Pause/.test((document.querySelector('#czViewer .vzp-dt [data-a="play"]') || { getAttribute: () => '' }).getAttribute('aria-label') || ''));
147
151
  ok('R7 Replay shows the player, the strip and the kept points (MtReplay)', await until(() => r.evaluate(() => !!document.querySelector('#czViewer .vzp-dt .vzp-strip') && document.querySelectorAll('#czViewer .vzp-kr').length > 0)));
148
152
  await tap(r, '.vzp-dt [data-a="play"]');
@@ -157,16 +161,16 @@ const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'applicati
157
161
  await r.$eval('#czViewer .vzp-dt .vzp-th[data-a="seekto"]', (b) => b.click());
158
162
  ok('R7 a capture plays from its time, with the topic of that time', await until(async () => /^03:1\d$/.test(await pos()) && await r.evaluate(() => /Viewer beside the chat/.test((document.querySelector('#czViewer .vzp-top[aria-current="true"]') || {}).textContent || ''))), await pos());
159
163
  await tap(r, '.vzp-dt [data-a="play"]');
160
- /* R12 every line: the Transcript tab seeks the Replay */
161
- await tap(r, '[data-a="tab"][data-k="tr"]');
164
+ /* R12 every line: the Transcript fold seeks the replay */
165
+ await unfold('tr');
162
166
  ok('R12 the Transcript lists every line, each with its time to play from', await until(async () => /Saved views move in their own work-item\./.test(await text(r)) && !!(await r.$('#czViewer [data-a="trseek"][data-t="760000"]'))), (await text(r)).slice(0, 300));
163
167
  await r.$eval('#czViewer [data-a="trseek"][data-t="760000"]', (b) => b.click());
164
- ok('R12 a line plays from its time, back on the Replay tab', await until(async () => /^12:[45]\d$/.test(await pos()) && await r.evaluate(() => document.querySelector('#czViewer [data-a="tab"][data-k="replay"]').getAttribute('aria-selected') === 'true')), await pos());
168
+ ok('R12 a line plays from its time in the replay card', await until(async () => /^12:[45]\d$/.test(await pos())), await pos());
165
169
  await C.ctx.close();
166
170
 
167
171
  /* R11 floors */
168
172
  const D = await open('/premium-viewer.html?open=meeting&note=n2', { noLive: false, w: 390, h: 844, init: () => { window.__premiumHolding = { id: 'n2' }; } });
169
- await until(() => D.page.evaluate(() => !!document.querySelector('#czViewer .vzm-rec')), 15000);
173
+ await until(() => D.page.evaluate(() => !!document.querySelector('#czViewer .czs-sum [data-a="stop"]')), 15000);
170
174
  const fl = await D.page.evaluate(() => ({ over: document.documentElement.scrollWidth - innerWidth, chip: !!document.querySelector('#recChip, #recCtl') }));
171
175
  ok('R11 at 390 px the live card has no sideways scroll and no floating record chip', fl.over <= 0 && !fl.chip, JSON.stringify(fl));
172
176
  await D.ctx.close();
@@ -43,37 +43,42 @@ const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'applicati
43
43
  const ALL = [];
44
44
  const open = async (url, o) => { const X = await F.open(browser, BASE, url, { noLive: true, ...o }); ALL.push(X); return X; };
45
45
 
46
- /* C1 the strip */
46
+ /* C1 the strip (on a Saturday or Sunday no day of the Mon–Fri strip is today, so none is pressed) */
47
47
  const A = await open('/premium-viewer.html?open=calendar');
48
48
  const p = A.page;
49
- ok('C1 the calendar opens in the Viewer card', await until(() => p.evaluate(() => !!document.querySelector('#czViewer [data-c="view"][data-k="day"]')), 15000));
50
- await tap(p, '[data-c="view"][data-k="day"]'); // premium-uncovered-features (meetings): the desk opens on the week; Day is the strip and the day's list
51
- await until(() => p.evaluate(() => document.querySelectorAll('#czViewer .vzc-dy').length === 5));
49
+ // Viewer kit (XvACal): the calendar opens on the day, with today's summary first; the week and month are in ⋯
50
+ ok('C1 the calendar opens in the Viewer card on the day', await until(() => p.evaluate(() => document.querySelectorAll('#czViewer .vzc-dy').length === 5 && document.querySelectorAll('#czViewer .vzc-de').length > 0), 15000));
51
+ const weekday = ![0, 6].includes(new Date().getDay());
52
+ await until(() => p.evaluate(() => [...document.querySelectorAll('#czViewer .vzc-dy')].every((d) => d.getBoundingClientRect().height >= 44)), 8000); // the Meetings stylesheet loads after the day is drawn
52
53
  const strip = await p.evaluate(() => [...document.querySelectorAll('#czViewer .vzc-dy')].map((d) => ({ dow: d.querySelector('span').textContent, on: d.getAttribute('aria-pressed'), h: Math.round(d.getBoundingClientRect().height) })));
53
- ok('C1 the strip has Monday to Friday and today is pressed', strip.map((d) => d.dow).join() === 'Mon,Tue,Wed,Thu,Fri' && strip.filter((d) => d.on === 'true').length === 1, JSON.stringify(strip));
54
+ ok('C1 the strip has Monday to Friday and today is pressed on a weekday', strip.map((d) => d.dow).join() === 'MON,TUE,WED,THU,FRI' && strip.filter((d) => d.on === 'true').length === (weekday ? 1 : 0), JSON.stringify(strip));
54
55
  ok('C1 each day button is at least 44 px', strip.every((d) => d.h >= 44), JSON.stringify(strip));
55
56
  ok('C1 the week is read once when the page opens, for today\'s week, and Day reads nothing more', weekReads(A.S) === 1 && A.S.gets.some((g) => g.includes('view=week')), JSON.stringify(A.S.gets.filter((g) => g.startsWith('/api/calendar-views'))));
56
57
 
57
58
  /* C2 the day */
58
59
  const today = await text(p);
59
- ok('C2 the day is named "· today" and its entries counted', /\w{3} \d{1,2} \w{3} · today/.test(today) && /\d+ (entr(y|ies)|meetings?)/.test(today), today.slice(0, 400));
60
- ok('C2 a row shows the time, the title, what it is about and the people', /\d{2}:\d{2}\s+Rail review\s+Viewer · Sam, Wawan/.test(today), today.slice(0, 600));
60
+ ok('C2 today\'s summary counts its meetings', /Today · \d+ meetings?/.test(today), today.slice(0, 400));
61
+ ok('C2 a row shows the time, the title and what it is about; the people are in the summary when it is next', /\d{2}:\d{2}\s+Rail review\s+Viewer/.test(today) && (!/Next: Rail review/.test(today) || /Next: Rail review with Sam, Wawan at \d{2}:\d{2}\./.test(today)), today.slice(0, 600));
61
62
  await p.evaluate(() => [...document.querySelectorAll('#czViewer .vzc-dy')].find((d) => d.getAttribute('aria-pressed') === 'false' && /: 1 meeting$/.test(d.getAttribute('aria-label'))).click());
62
- ok('C2 pressing a day lists that day only, with its count', await until(async () => { const t = await text(p); return /1:1 with Dita/.test(t) && !/Rail review/.test(t) && /\b1 meeting\b/.test(t); }), (await text(p)).slice(0, 400));
63
+ const list = () => p.evaluate(() => [...document.querySelectorAll('#czViewer .vzc-list, #czViewer .vzc-days ~ .vzc-mut')].map((e) => e.innerText).join('\n')); // the summary above stays today's
64
+ ok('C2 pressing a day lists that day only, with its count', await until(async () => { const t = await list(); return /1:1 with Dita/.test(t) && !/Rail review/.test(t) && /\b1 meeting\b/.test(t); }), await list());
63
65
  ok('C2 another day of the same week is not read again', weekReads(A.S) === 1);
64
- await p.evaluate(() => [...document.querySelectorAll('#czViewer .vzc-dy')].find((d) => /today/.test(d.getAttribute('aria-label'))).click());
66
+ if (weekday) await p.evaluate(() => [...document.querySelectorAll('#czViewer .vzc-dy')].find((d) => /today/.test(d.getAttribute('aria-label'))).click());
67
+ else await F.more(p, 'Back to today'); // the strip is Monday to Friday
65
68
  ok('C2 pressing today brings Today back unchanged', await until(async () => (await text(p)) === today));
66
69
 
67
70
  /* C4 a meeting */
68
71
  await p.evaluate(() => [...document.querySelectorAll('#czViewer .vzc-de')].find((r) => /Rail review/.test(r.textContent)).click());
69
- ok('C4 a row opens the meeting card with its title and when', await until(async () => /Rail review/.test(await p.textContent('#czViewer .cz-vw-title')) && /Today · \d{2}:\d{2}/.test(await text(p))), (await text(p)).slice(0, 300));
72
+ ok('C4 a row opens the meeting card with its title and when', await until(async () => /^Rail review · \d{2}:\d{2}$/.test(await p.textContent('#czViewer .cz-vw-title')) && /^(Starts in \d+ (min|h)|On now)/.test(await p.textContent('#czViewer .czs-line'))), (await text(p)).slice(0, 300));
70
73
  ok('C4 the card reads Focus for that meeting, and no replay (it has no note)', await until(() => A.S.gets.some((g) => /meeting-focus\?event=ev-rail/.test(g))) && !A.S.gets.some((g) => /meeting-replay/.test(g)));
71
74
  ok('C4 the card has no conversation and no tabs', await p.evaluate(() => !document.querySelector('#dlg, .stream, #vTabs')));
72
75
 
73
76
  /* C6, C7, C8 the parts */
74
- ok('C6 with no note the card is the prep: Prepared for you, and no tabs', /Prepared for you/.test(await text(p)) && !(await p.$('#czViewer [role="tablist"]')));
75
- ok('C7 the material is listed, with who linked it and its topic; a deck has Present', /Rail PRD · added by you/.test(await text(p)) && /For The report panel/.test(await text(p)) && !!(await p.$('#czViewer [data-a="present"]')));
76
- ok('C8 with no recording the card offers no Replay', !(await p.$('#czViewer [data-a="tab"][data-k="replay"]')));
77
+ ok('C6 with no note the card is the prep: the gist first, Record as an icon, the Agenda fold, and no tabs', /Agree the rail before the Commit\./.test(await p.textContent('#czViewer .czs-sum')) && !!(await p.$('#czViewer .czs-sum [data-a="record"]')) && !!(await p.$('#czViewer [data-czs-fold="agenda"]')) && !(await p.$('#czViewer [role="tablist"]')));
78
+ if (await p.evaluate(() => document.querySelector('#czViewer [data-czs-fold="mat"]').getAttribute('aria-expanded') !== 'true')) await tap(p, '[data-czs-fold="mat"]');
79
+ const mats = await p.evaluate(() => document.querySelector('#czViewer .vzm-mats').innerText);
80
+ ok('C7 the material fold lists each with its kind, how it opens and its topic; a deck has Present', /Rail PRD\s+PMOS document/.test(mats) && /Website · opens live · for The report panel/.test(mats) && !!(await p.$('#czViewer .vzm-mats [data-a="present"]')), mats);
81
+ ok('C8 with no recording the card offers no Replay', !(await p.$('#czViewer .vzp-card')));
77
82
 
78
83
  /* C5 link it: a calendar meeting is linked for its whole series */
79
84
  await tap(p, '[data-a="m-about"]');
@@ -94,7 +99,7 @@ const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'applicati
94
99
 
95
100
  /* C8 a kept recording offers Replay */
96
101
  const R = await open('/premium-viewer.html?open=meeting&note=n1');
97
- ok('C8 a kept recording offers Replay, and the card reads its replay', await until(() => R.page.evaluate(() => !!document.querySelector('#czViewer [data-a="tab"][data-k="replay"]')), 15000) && R.S.gets.some((g) => /meeting-replay\?note=n1/.test(g)));
102
+ ok('C8 a kept recording offers Replay, and the card reads its replay', await until(() => R.page.evaluate(() => !!document.querySelector('#czViewer .vzp-card .vzp-pl')), 15000) && R.S.gets.some((g) => /meeting-replay\?note=n1/.test(g)));
98
103
  await R.ctx.close();
99
104
 
100
105
  /* C3 honest states */
@@ -102,7 +107,7 @@ const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'applicati
102
107
  await E.page.route('**/api/calendar-views*', (r) => { const w = W.week(); w.cells.forEach((c) => { c.events = []; }); return json(r, w); });
103
108
  await E.page.route(/\/api\/notes(\?.*)?$/, (r) => json(r, { ok: true, notes: [], series_open: {} }));
104
109
  await E.page.reload();
105
- ok('C3 an empty week says so', await until(async () => /No meetings in this week/.test(await text(E.page)) && !(await E.page.$('#czViewer .vzc-ev'))), (await text(E.page)).slice(0, 400));
110
+ ok('C3 an empty day says so, and today\'s summary says no meetings', await until(async () => /No meetings on this day\./.test(await text(E.page)) && /Today · no meetings/.test(await text(E.page)) && !(await E.page.$('#czViewer .vzc-de'))), (await text(E.page)).slice(0, 400));
106
111
  await E.page.route('**/api/calendar-views*', (r) => json(r, { ok: false, error: 'the calendar is not connected' }, 500));
107
112
  await E.page.reload();
108
113
  ok('C3 a failed read says the calendar was not read, with the reason, and draws no meeting', await until(async () => /The calendar was not read\. the calendar is not connected/.test(await text(E.page))) && !(await E.page.$('#czViewer .vzc-ev')), (await text(E.page)).slice(0, 300));
@@ -73,12 +73,17 @@ const WRITES = /^\/api\/(?:boards\/(?:move|tasks\/(?:add|state))|lifecycle|core-
73
73
  // ready: the card is drawn from the board's row (kind · anchor) and, when the initiative reads, from its record (the ladder)
74
74
  async function ready(page, full = true) { return until(() => page.evaluate((f) => !!document.querySelector('.hm-card [data-hm-ov]') && /·/.test((document.querySelector('.hm-card .hm-sw .k') || {}).textContent || '') && (!f || !!((document.querySelector('.hm-card .hm-lad b') || {}).textContent || '').trim()), full), 30000); }
75
75
  const txt = (p, s) => p.evaluate((q) => ((document.querySelector(q) || {}).textContent || '').replace(/\s+/g, ' ').trim(), s);
76
- // the Overview opens on Tasks, with Documents and Stage beside it (premium-uncovered-features, canvas InTasks, InDocs, InStage); view names the one to show
77
- const show = async (p, view) => { await p.click(`${V} [data-hi-view="${view}"]`); return until(() => p.evaluate((a) => !!document.querySelector(a[0] + ` [data-hi-v="${a[1]}"]`), [V, view])); };
76
+ // the Overview opens on Tasks; a phone keeps the Tasks, Documents and Stage switch, and in shell A on a desktop the other views sit under ⋯ (XvATasks); view names the one to show
77
+ const LABEL = { tasks: 'Tasks', docs: 'Documents', stage: 'Stage' };
78
+ const show = async (p, view) => {
79
+ if (await p.evaluate((a) => !!document.querySelector(a[0] + ` [data-hi-view="${a[1]}"]`), [V, view])) await p.click(`${V} [data-hi-view="${view}"]`);
80
+ else { await p.click('#czViewer [data-cz-vw="more"]'); await until(() => p.evaluate(() => !!document.querySelector('#czViewer .cz-vw-menu'))); await p.click(`#czViewer .cz-vw-menu [role="menuitem"]:has(> span:first-child:text-is("${LABEL[view]}"))`); }
81
+ return until(() => p.evaluate((a) => !!document.querySelector(a[0] + ` [data-hi-v="${a[1]}"]`), [V, view])); };
82
+ const moreLabels = (p) => p.evaluate(async () => { const b = document.querySelector('#czViewer [data-cz-vw="more"]'); if (!b) return []; b.click(); await new Promise((r) => setTimeout(r, 50)); const m = document.querySelector('#czViewer .cz-vw-menu'); const out = m ? [...m.querySelectorAll('[role="menuitem"] span:first-of-type')].map((x) => x.textContent) : []; b.click(); return out; });
78
83
  const overview = async (p, view = 'stage') => {
79
84
  if (!(await p.evaluate(() => { const b = document.querySelector('.hm-card [data-hm-ov]'); return !!b && !!b.offsetParent; }))) await p.click('#hmNeeds'); // a phone shows the list (and its card) in the sheet
80
85
  await p.click('.hm-card [data-hm-ov]');
81
- const s = await until(() => p.evaluate((v) => { const o = document.querySelector(v); if (!o) return null; if (o.querySelector('[data-hi-view]')) return 'ok'; return /could not be read/.test(o.textContent) ? 'err' : null; }, V), 30000);
86
+ const s = await until(() => p.evaluate((v) => { const o = document.querySelector(v); if (!o) return null; if (o.querySelector('[data-hi-v]')) return 'ok'; return /could not be read/.test(o.textContent) ? 'err' : null; }, V), 30000);
82
87
  if (s === 'ok' && view) await show(p, view);
83
88
  return !!s; };
84
89
  const writes = (X) => X.posts.filter((x) => WRITES.test(x.path));
@@ -131,17 +136,19 @@ const WRITES = /^\/api\/(?:boards\/(?:move|tasks\/(?:add|state))|lifecycle|core-
131
136
  ok('I7 a file opens as its page in the Viewer, not a dialog', await until(() => p.evaluate((v) => !!document.querySelector(v + ' .obody.vw[data-vw="doc:planning/prd/self-serve-v2-prd.md"]') && !(document.querySelector('#dlg') && !!document.querySelector('#dlg.on')), V), 15000));
132
137
 
133
138
  /* I4 the Overview */
134
- ok('I4 the card\'s Overview press opens the initiative in the Viewer on its Tasks, with Documents and Stage beside it, and no Waiting for design marker', await overview(p, null) && await p.evaluate((v) => /Tasks/.test(document.querySelector('#czViewer .cz-vw-kind').textContent) && [...document.querySelectorAll(v + ' [data-hi-view]')].map((b) => b.textContent).join() === 'Tasks,Documents,Stage' && !document.querySelector(v + ' .hx-wait'), V));
139
+ const i4 = await overview(p, null) && await p.evaluate((v) => /Tasks/.test(document.querySelector('#czViewer .cz-vw-kind').textContent) && !document.querySelector(v + ' [data-hi-view]') && !document.querySelector(v + ' .hx-wait'), V);
140
+ const i4m = await moreLabels(p);
141
+ ok('I4 the card\'s Overview press opens the initiative in the Viewer on its Tasks, with Documents and Stage under ⋯ on a desktop (XvATasks), and no Waiting for design marker', i4 && ['Group tasks by', 'Documents', 'Stage', 'Open the full record'].every((l) => i4m.includes(l)), JSON.stringify(i4m));
135
142
  const tk = await p.evaluate((v) => { const o = document.querySelector(v); return { tasks: [...o.querySelectorAll('[data-ov-tkrow]')].map((r) => r.dataset.ovTkrow).sort(), checks: [...o.querySelectorAll('button[data-hi-chk]')].map((b) => b.dataset.hiChk).sort() }; }, V);
136
143
  await show(p, 'stage');
137
144
  const st = await p.evaluate((v) => { const o = document.querySelector(v); return { moves: [...o.querySelectorAll('[data-ov-move]')].map((b) => b.dataset.ovMove), cur: (o.querySelector('[data-ov-move][aria-pressed="true"]') || {}).textContent, life: [...o.querySelectorAll('[data-ov-life]')].map((b) => b.dataset.ovLife) }; }, V);
138
145
  await show(p, 'docs');
139
- const ov = await p.evaluate((v) => { const o = document.querySelector(v); return { docs: [...o.querySelectorAll('[data-ov-doc]')].map((d) => d.dataset.ovDoc).sort(), draft: [...o.querySelectorAll('[data-ov-draft]')].map((b) => b.dataset.ovDraft).sort(), drafting: [...o.querySelectorAll('[data-ov-doc]')].filter((d) => /Drafting/.test(d.textContent)).map((d) => d.dataset.ovDoc), dread: [...o.querySelectorAll('[data-ov-dread]')].map((b) => b.dataset.ovDread), sum: (o.querySelector('[data-ov-dsum]') || {}).textContent || '' }; }, V);
146
+ const ov = await p.evaluate((v) => { const o = document.querySelector(v); return { docs: [...o.querySelectorAll('[data-ov-doc]')].map((d) => d.dataset.ovDoc).sort(), draft: [...o.querySelectorAll('[data-ov-draft], [data-czs-act^="draft:"], [data-ov-none]')].map((b) => b.dataset.ovDraft || b.dataset.ovNone || b.dataset.czsAct.slice(6)).sort(), pri: ((o.querySelector('.czs-pri[data-czs-act^="draft:"]') || {}).dataset || {}).czsAct || '', drafting: [...o.querySelectorAll('[data-ov-doc]')].filter((d) => /Drafting/.test(d.textContent)).map((d) => d.dataset.ovDoc), dread: [...o.querySelectorAll('[data-ov-dread]')].map((b) => b.dataset.ovDread), sum: (o.querySelector('[data-ov-dsum]') || {}).textContent || '' }; }, V);
140
147
  const M = mk();
141
148
  ok('I4 the Stage view lists the board\'s stages with the current one pressed, and the lifecycle presses', JSON.stringify(st.moves) === JSON.stringify(M.acts.stages) && st.cur === 'Build' && st.life.join() === 'on-hold,cancelled', JSON.stringify(st));
142
149
  ok('I6 the tasks are the record\'s, and only a PMOS task has a check box it can change', JSON.stringify(tk.tasks) === JSON.stringify(M.tasks.rows.map((t) => t.key).sort()) && JSON.stringify(tk.checks) === JSON.stringify(M.tasks.rows.filter((t) => t.pmos && t.uid).map((t) => t.key).sort()), JSON.stringify(tk));
143
150
  ok('I7 the core documents are the non-technical ones, with the engine\'s summary', JSON.stringify(ov.docs) === JSON.stringify(M.docs.rows.filter((d) => !d.tech).map((d) => d.key).sort()) && ov.sum === M.docs.cap, JSON.stringify(ov));
144
- ok('I7 a document not started offers Draft it; a running one says Drafting and has no press; a draft offers Read', ov.draft.join() === 'problem,research' && ov.drafting.join() === 'launch' && ov.dread.length === M.docs.rows.filter((d) => !d.tech && d.st === 'draft' && d.path && d.slot).length, JSON.stringify(ov));
151
+ ok('I7 a document not started offers Draft it (the summary\'s one primary drafts the first, the rest offer it from their row); a running one says Drafting and has no press; a draft offers Read', /^draft:(problem|research)$/.test(ov.pri) && [...new Set(ov.draft)].filter((k) => k === 'problem' || k === 'research').sort().join() === 'problem,research' && ov.drafting.join() === 'launch' && ov.dread.length === M.docs.rows.filter((d) => !d.tech && d.st === 'draft' && d.path && d.slot).length, JSON.stringify(ov));
145
152
 
146
153
  /* I10 presses */
147
154
  const mint = await T.nonce(BASE);
@@ -170,17 +177,22 @@ const WRITES = /^\/api\/(?:boards\/(?:move|tasks\/(?:add|state))|lifecycle|core-
170
177
  await until(() => p.evaluate((a) => !!document.querySelector(a[0] + ` [data-hi-tmore="${a[1]}"]`), [V, pk]));
171
178
  await p.click(`${V} [data-hi-tmore="${pk}"]`);
172
179
  await until(() => p.evaluate(() => !!document.querySelector('.hi-pop[role="menu"]')));
173
- await settle(() => p.click('.hi-pop[role="menu"] [role="menuitemradio"]:has(span:text-is("In progress"))'));
180
+ await settle(() => p.click('.hi-pop[role="menu"] [role="menuitemradio"]:has(> span:first-child:text-is("In progress"))'));
174
181
  const ts = await until(() => A.posts.find((x) => x.path === '/api/boards/tasks/state'));
175
182
  ok('I10 a status change posts the board, the task and the state, and nothing else', ts && Object.keys(ts.body).sort().join() === 'board,state,task,ws' && ts.body.state === 'In progress', JSON.stringify(ts && ts.body));
176
183
  await show(p, 'docs');
177
- await until(() => p.evaluate((v) => !!document.querySelector(v + ' [data-ov-draft="problem"]'), V));
178
- await settle(() => p.click(`${V} [data-ov-draft="problem"]`));
184
+ await until(() => p.evaluate((v) => !!document.querySelector(v + ' .czs-pri[data-czs-act^="draft:"]'), V));
185
+ const first = await p.evaluate((v) => document.querySelector(v + ' .czs-pri[data-czs-act^="draft:"]').dataset.czsAct.slice(6), V);
186
+ await settle(() => p.click(`${V} .czs-pri[data-czs-act^="draft:"]`));
179
187
  const dr = await until(() => A.posts.find((x) => x.path === '/api/core-docs/draft'));
180
- ok('I10 Draft it posts the workspace, the initiative scope and the key and nothing else', dr && Object.keys(dr.body).sort().join() === 'key,scope,ws' && dr.body.scope === 'initiative:self-serve-v2' && dr.body.key === 'problem', JSON.stringify(dr && dr.body));
188
+ ok('I10 Draft it posts the workspace, the initiative scope and the key and nothing else', dr && Object.keys(dr.body).sort().join() === 'key,scope,ws' && dr.body.scope === 'initiative:self-serve-v2' && dr.body.key === first, JSON.stringify(dr && dr.body));
181
189
  A.set({ status: 409, body: { ok: false, error: 'PMOS is already drafting this document.' } });
182
- await until(() => p.evaluate((v) => !!document.querySelector(v + ' [data-ov-draft="research"]'), V));
183
- await p.click(`${V} [data-ov-draft="research"]`);
190
+ const other = first === 'problem' ? 'research' : 'problem';
191
+ await until(() => p.evaluate((a) => !!document.querySelector(a[0] + ` [data-ov-none="${a[1]}"], ` + a[0] + ` [data-czs-act="draft:${a[1]}"]`), [V, other]));
192
+ if (await p.evaluate((a) => !!document.querySelector(a[0] + ` [data-czs-act="draft:${a[1]}"]`), [V, other])) await p.click(`${V} [data-czs-act="draft:${other}"]`);
193
+ else {
194
+ await p.evaluate((a) => { const n = document.querySelector(a[0] + ` [data-ov-none="${a[1]}"]`); const f = n && !n.offsetParent && n.closest('.czs-sec') && n.closest('.czs-sec').querySelector('[data-czs-fold]'); if (f) f.click(); }, [V, other]); // its group is folded
195
+ await p.click(`${V} [data-ov-none="${other}"]`); await until(() => p.evaluate(() => !!document.querySelector('.hi-pop'))); await p.click('.hi-pop button:has-text("Draft it now")'); }
184
196
  ok('I10 a refused press shows the route\'s reason in the Overview', await until(async () => /already drafting/.test(await txt(p, V + ' #ovMsg'))));
185
197
  A.set({ status: 200, body: { ok: true } });
186
198
  ok('I10 every press carried the launch nonce and no writer field', !!mint && writes(A).length >= 5 && writes(A).every((x) => x.headers['x-pmos-nonce'] === mint && !['by', 'via', 'at', 'actor', 'pm', 'nonce'].some((k) => k in x.body)), JSON.stringify(writes(A).map((x) => x.path)));
@@ -207,6 +219,7 @@ const WRITES = /^\/api\/(?:boards\/(?:move|tasks\/(?:add|state))|lifecycle|core-
207
219
  {
208
220
  const N = await open({ w: 390, h: 844 });
209
221
  await overview(N.page, null);
222
+ ok('I4 a phone keeps the Tasks, Documents and Stage switch (PgTkList)', await N.page.evaluate((v) => [...document.querySelectorAll(v + ' [data-hi-view]')].map((b) => b.textContent).join() === 'Tasks,Documents,Stage', V));
210
223
  const fls = [];
211
224
  for (const view of ['tasks', 'docs', 'stage']) {
212
225
  await show(N.page, view);
@@ -119,7 +119,7 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
119
119
  ok('B1 Find narrows the goals as you type, and its close shows every goal again', fd === 'krm-up' && (await p.evaluate(() => document.querySelectorAll('#goalTbl [data-goal]').length)) === 5 && await p.evaluate(() => document.querySelector('#findRow').hidden), fd);
120
120
  await p.click('#findB'); await p.fill('#findIn', 'activation'); await sleep(100); await p.click('#findRes [data-fo="goal"]');
121
121
  const fo = await until(() => vw(p));
122
- ok('B1 a goal found opens its detail, and Find closes', fo && fo.title === 'Partner activation' && await p.evaluate(() => document.querySelector('#findRow').hidden), JSON.stringify(fo));
122
+ ok('B1 a goal found opens its detail, and Find closes', fo && fo.title === 'KR 1.1 · Partner activation' && await p.evaluate(() => document.querySelector('#findRow').hidden), JSON.stringify(fo));
123
123
  await vwClose(p);
124
124
  await p.click('#viewChip'); const vm = await p.evaluate(() => ({ head: document.querySelector('#viewMenu .ins-mh').textContent, items: [...document.querySelectorAll('#viewMenu [data-view]')].map((b) => b.dataset.view + ((b.querySelector('.k') || {}).textContent ? ':' + b.querySelector('.k').textContent : '')).join(), nd: !!document.querySelector('#viewMenu [data-newdash]') })); await p.keyboard.press('Escape');
125
125
  ok('B1 the Dashboard menu lists every view with the default one marked, then Delivery trends, then New dashboard (IsMenus)', vm.head === 'Dashboard' && vm.items === 'all:default,pd-1,p:Growth,p:Reliability,trends' && vm.nd, JSON.stringify(vm));
@@ -153,8 +153,9 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
153
153
  await p.click('#goalTbl [data-budget="docs"] .nm');
154
154
  const v = await until(() => vw(p));
155
155
  ok('G1 a budget press opens its detail in the goal\'s frame: its reading, its cap, what it covers (IsGoal)', v && v.title === 'docs' && !v.wait && /documentation upkeep/.test(v.text) && /cap 20% of a quarter/.test(v.text) && /1 of 6 open on the Board/.test(v.text), JSON.stringify(v));
156
- await p.click('#czViewer [data-bt="moved"]'); await sleep(100);
157
- ok('G1 its Moved by tab lists the work anchored to it', /Docs search/.test(await txt('#czViewer .ins-gb')));
156
+ /* re-pointed (viewer-shell-a, XvAInsight): Moved by is a folding row under the summary, not a tab */
157
+ await p.click('#czViewer [data-czs-fold="bmoved"]'); await sleep(100);
158
+ ok('G1 its Moved by row lists the work anchored to it', /Docs search/.test(await txt('#czViewer [data-czs-id="bmoved"] .czs-body')));
158
159
  await vwClose(p);
159
160
  }
160
161
  /* G1 a goal's detail (IsGoal): Readings with the chart, its target and the ship date of the work that moves it; the readings; Add a reading through
@@ -165,23 +166,34 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
165
166
  await q.route('**/api/premium-dashboards/save', (r) => { saved.push(JSON.parse(r.request().postData() || '{}')); r.fulfill({ contentType: 'application/json', body: '{"ok":true}' }); });
166
167
  await q.click('#goalTbl [data-goal="krm-act"] .nm');
167
168
  const v = await until(() => vw(q));
168
- const d = await q.evaluate(() => ({ kind: (document.querySelector('#czViewer .cz-vw-kind') || {}).textContent, tabs: [...document.querySelectorAll('#czViewer .ins-vtab')].map((t) => t.textContent + ':' + t.getAttribute('aria-selected')).join(), edit: !!document.querySelector('#czViewer [data-gx="chart"]'), sub: document.querySelector('#czViewer .ins-gsub').textContent, tg: (document.querySelector('#czViewer .ins-gch .tgl') || {}).textContent, ship: (document.querySelector('#czViewer .ins-gch .shipl') || {}).textContent, pts: document.querySelectorAll('#czViewer .ins-gch .pt').length, rows: document.querySelectorAll('#czViewer .ins-rd3').length, all: (document.querySelector('#czViewer [data-gx="all"]') || {}).textContent, moved: (document.querySelector('#czViewer [data-gx="moved"]') || {}).textContent, sw: [...document.querySelectorAll('#czViewer [data-gx="dash"]')].map((b) => b.getAttribute('aria-label') + ':' + b.getAttribute('aria-checked')).join(), dlg: !!document.querySelector('#dlg') }));
169
- ok('G1 on All goals a goal press opens its detail: Readings and Moved by, Edit chart, the now and target line, and no "Waiting for design" (IsGoal)', v && v.title === 'Partner activation' && !v.wait && /^Goal · KR 1\.1/.test(d.kind) && d.tabs === 'Readings:true,Moved by:false' && d.edit && d.sub === '28% now · 50% by Dec 31' && !d.dlg, JSON.stringify([v, d]));
169
+ /* re-pointed (viewer-shell-a, XvAInsight): the goal is the shell's summary card, the chart, then the folding rows Readings, Moved by and
170
+ * On your dashboards; Edit chart is under ⋯; Readings opens on a press */
171
+ await q.click('#czViewer [data-czs-fold="read"]'); await sleep(80);
172
+ const d = await q.evaluate(() => ({ kind: (document.querySelector('#czViewer .cz-vw-kind') || {}).textContent, tabs: [...document.querySelectorAll('#czViewer .czs-row b')].map((t) => t.textContent).join(), more: !!document.querySelector('#czViewer [data-cz-vw="more"]'), sub: document.querySelector('#czViewer .czs-line').textContent, pri: (document.querySelector('#czViewer .czs-pri') || {}).textContent, tg: (document.querySelector('#czViewer .ins-gch .tgl') || {}).textContent, ship: (document.querySelector('#czViewer .ins-gch .shipl') || {}).textContent, pts: document.querySelectorAll('#czViewer .ins-gch .pt').length, rows: document.querySelectorAll('#czViewer .ins-rd3').length, all: (document.querySelector('#czViewer [data-gx="all"]') || {}).textContent, moved: (document.querySelector('#czViewer [data-czs-fold="moved"] .czs-n') || {}).textContent, sw: [...document.querySelectorAll('#czViewer [data-gx="dash"]')].map((b) => b.getAttribute('aria-label') + ':' + b.getAttribute('aria-checked')).join(), dlg: !!document.querySelector('#dlg') }));
173
+ ok('G1 on All goals a goal press opens its detail: the now and target line, Add a reading as the one primary, the rows Readings, Moved by and On your dashboards, and ⋯; no "Waiting for design" (XvAInsight)', v && v.title === 'KR 1.1 · Partner activation' && !v.wait && d.kind === 'Goal' && d.tabs === 'Readings,Moved by,On your dashboards' && d.more && d.sub === '28% now · target 50% by Dec 31' && d.pri === 'Add a reading' && /Down 2% since Oct 1\./.test(v.text) && !d.dlg, JSON.stringify([v, d]));
170
174
  ok('G1 the chart draws each reading, the target with its value and the ship date of the work that moves it', d.tg === 'Target 50%' && d.ship === 'SSO for partners shipped' && d.pts === 4, JSON.stringify(d));
171
- ok('G1 the newest three readings show with their source, then All 4 readings; Moved by names the work', d.rows === 3 && d.all === 'All 4 readings' && /^Moved by: SSO for partners, Self-serve onboarding v2$/.test(d.moved), JSON.stringify(d));
172
- ok('G1 On your dashboards has a switch for each saved dashboard, on where the goal is', d.sw === 'On Weekly partner review:true', d.sw);
175
+ ok('G1 the newest three readings show with their source, then All 4 readings; Moved by counts the work', d.rows === 3 && d.all === 'All 4 readings' && d.moved === '2', JSON.stringify(d));
176
+ await q.click('#czViewer [data-czs-fold="dash"]'); await sleep(80);
177
+ const sw = await q.evaluate(() => [...document.querySelectorAll('#czViewer [data-gx="dash"]')].map((b) => b.getAttribute('aria-label') + ':' + b.getAttribute('aria-checked')).join());
178
+ ok('G1 On your dashboards has a switch for each saved dashboard, on where the goal is', sw === 'On Weekly partner review:true', sw);
179
+ await q.click('#czViewer [data-cz-vw="more"]'); await sleep(80);
180
+ const mi = await q.evaluate(() => [...document.querySelectorAll('.cz-vw-menu [role="menuitem"]')].map((b) => b.textContent.trim()).join('|'));
181
+ ok('G1 ⋯ holds Edit chart, then Copy link and Copy as text (xvMore order)', /^Edit chart\|Copy link\|Copy as text/.test(mi), mi);
182
+ await q.click('#czViewer .cz-vw-title'); await sleep(80); // a press outside the menu closes it
173
183
  await q.click('#czViewer [data-gx="all"]'); ok('G1 All readings shows every reading', (await q.evaluate(() => document.querySelectorAll('#czViewer .ins-rd3').length)) === 4);
174
- await q.click('#czViewer [data-gx="add"]'); await q.fill('#czViewer [data-rdf] [name="v"]', '31'); await q.click('#czViewer [data-rdf] button[type="submit"]'); await until(() => sent.length > 0, 4000);
184
+ await q.click('#czViewer [data-czs-act="add"]'); await q.fill('#czViewer [data-rdf] [name="v"]', '31'); await q.click('#czViewer [data-rdf] button[type="submit"]'); await until(() => sent.length > 0, 4000);
175
185
  ok('G1 Add a reading posts the date and the number to the KR metric reading route', sent.length === 1 && sent[0].rid === 'krm-act' && sent[0].value === 31 && sent[0].at === '2026-10-18' && sent[0].ws === 'w1', JSON.stringify(sent));
176
186
  await until(() => q.evaluate(() => !!document.querySelector('#czViewer [data-gx="dash"]')), 4000);
177
187
  await q.click('#czViewer [data-gx="dash"]'); await until(() => saved.length > 0, 4000);
178
188
  ok('G1 the dashboard switch saves that dashboard without the goal', saved[0] && saved[0].id === 'pd-1' && saved[0].charts.join() === 'krm-ttfc,krm-gone' && saved[0].ws === 'w1', JSON.stringify(saved));
179
- await q.click('#czViewer [data-gt="moved"]'); await sleep(100);
180
- ok('G1 Moved by lists the initiatives on their lifecycle track', (await q.evaluate(() => document.querySelectorAll('#czViewer .ins-gb .ins-ini').length)) === 2);
189
+ if (!(await q.evaluate(() => { const b = document.querySelector('#czViewer [data-czs-fold="moved"]'); return b && b.getAttribute('aria-expanded') === 'true'; }))) await q.click('#czViewer [data-czs-fold="moved"]');
190
+ await sleep(100);
191
+ ok('G1 Moved by lists the initiatives on their lifecycle track', (await q.evaluate(() => document.querySelectorAll('#czViewer [data-czs-id="moved"] .ins-ini').length)) === 2);
181
192
  await vwClose(q);
182
193
  await q.click('#goalTbl [data-goal="krm-nps"] .nm'); await until(() => vw(q));
183
- const e1 = await txt('#czViewer .ins-etr', q);
184
- ok('G1 a goal with one reading says a trend needs 2 readings and where the next comes from, with Add a reading (IsMenus)', /A trend needs 2 readings\./.test(e1) && /Add a reading/.test(e1), e1);
194
+ const e1 = await txt('#czViewer .ins-etr', q), p1 = await txt('#czViewer .czs-pri', q);
195
+ /* re-pointed (viewer-shell-a): Add a reading is the summary card's one primary, so the empty trend does not repeat it */
196
+ ok('G1 a goal with one reading says a trend needs 2 readings and where the next comes from, with Add a reading (IsMenus)', /A trend needs 2 readings\./.test(e1) && p1 === 'Add a reading', e1 + ' | ' + p1);
185
197
  await R.ctx.close();
186
198
  }
187
199
  /* G1 the period (AgInsPeriod) */
@@ -367,7 +379,7 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
367
379
  ok('L3 a dashboard card opens Goals on that view', (await txt('#viewName', q)) === 'Reliability' && (await q.evaluate(() => document.querySelector('#tabGoals').getAttribute('aria-selected'))) === 'true' && (await q.evaluate(() => [...document.querySelectorAll('#goalTbl [data-goal]')].map((r) => r.dataset.goal).join())) === 'krm-up,krm-churn');
368
380
  await q.click('#tabLibrary'); await q.locator('#listRows [data-rpt]').first().click(); // a report file with no setup opens straight in the reader
369
381
  ok('L4 a report opens in the page\'s reader, not the console (premium-report-read R1; re-pointed by premium-agreed-design: the reader is the report panel in the Viewer card)', await until(() => q.evaluate(() => !!document.querySelector('#czViewer:not([hidden]) .vz-rp0')), 5000) && /premium-insights\.html/.test(q.url()), q.url());
370
- ok('L4 a draft report has Issue in the reader, so nothing sends you to the console to issue it', await until(() => q.evaluate(() => !!document.querySelector('#czViewer .vz-rp0 [data-r="issue"]')), 8000) && await q.evaluate(() => !document.querySelector('#czViewer a[href*="console.html"]')));
382
+ ok('L4 a draft report has Issue in the reader, so nothing sends you to the console to issue it', await until(() => q.evaluate(() => !!document.querySelector('#czViewer .vz-rp0 .czs-sum [data-czs-act="issue"]')), 8000) && await q.evaluate(() => !document.querySelector('#czViewer a[href*="console.html"]')));
371
383
  await R.ctx.close();
372
384
  const lead = { 'planning/reports/biweekly/2026-10-14.md': 'Activation slipped to 28% this fortnight.' };
373
385
  const R2 = await open({ model: mk({ leads: lead }) });
@@ -515,7 +527,7 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
515
527
  const pf = await until(async () => { const x = await q.evaluate(() => ({ name: document.querySelector('#prodName').textContent, groups: [...document.querySelectorAll('#goalTbl .ins-grp')].map((g) => g.querySelector('[role="cell"]').textContent), rows: document.querySelectorAll('#goalTbl [data-goal]').length, brief: document.querySelector('#brief').textContent, budgets: document.querySelectorAll('#goalTbl [data-budget]').length })); return x.groups.includes('Billing') ? x : null; }, 6000);
516
528
  ok('M1 Portfolio reads the other product once and groups every goal by product; budgets stay with their product', !!pf && pf.name === 'Portfolio' && pf.groups.slice(0, 2).join() === 'pmos,Billing' && pf.rows === 6 && /^Portfolio: 6 goals across 2 products/.test(pf.brief) && pf.budgets === 0 && asked.length === 1, JSON.stringify(pf));
517
529
  await q.click('#goalTbl [data-goal="w2~krm-inv"] .nm'); const gv = await until(() => vw(q));
518
- ok('M1 a goal of another product opens its detail, named with its product and not on this product\'s dashboards', gv && gv.title === 'Invoices paid on time' && /Billing/.test(gv.text) && !(await q.evaluate(() => document.querySelector('#czViewer [data-gx="dash"], #czViewer [data-gx="chart"]'))), JSON.stringify(gv));
530
+ ok('M1 a goal of another product opens its detail, named with its product and not on this product\'s dashboards', gv && /Invoices paid on time$/.test(gv.title) && /Billing/.test(gv.text) && !(await q.evaluate(() => document.querySelector('#czViewer [data-gx="dash"], #czViewer [data-gx="chart"]'))), JSON.stringify(gv));
519
531
  await vwClose(q);
520
532
  await q.click('#prodPick'); await q.click('#prodMenu [data-board="w1"]'); await sleep(150);
521
533
  ok('M1 picking the open product again leaves Portfolio', (await txt('#prodName', q)) === 'pmos' && (await q.evaluate(() => document.querySelectorAll('#goalTbl [data-goal]').length)) === 5);
@@ -525,10 +537,11 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
525
537
  {
526
538
  const R = await open({ w: 390, h: 844 }), q = R.page;
527
539
  await q.click('#goalCards [data-goal="krm-act"]'); await until(() => vw(q));
528
- const ph = await q.evaluate(() => { const v = document.querySelector('#czViewer').getBoundingClientRect(); return { w: Math.round(v.width), tabs: [...document.querySelectorAll('#czViewer .ins-vtab')].map((t) => t.textContent).join(), first: document.querySelector('#czViewer .ins-gd').firstElementChild.className, add: (document.querySelector('#czViewer .ins-btn.wide[data-gx="add"]') || {}).textContent, over: document.documentElement.scrollWidth > innerWidth }; });
529
- ok('P1 on a phone the goal detail covers the screen: the chart first, then Readings, Moved by and Dashboards, and a full-width Add a reading', ph.w === 390 && ph.tabs === 'Readings,Moved by,Dashboards' && ph.first === 'ins-gh' && ph.add === 'Add a reading' && !ph.over, JSON.stringify(ph));
530
- await q.click('#czViewer [data-gt="dash"]'); await sleep(80);
531
- ok('P1 the Dashboards tab holds the switches', (await q.evaluate(() => document.querySelectorAll('#czViewer .ins-gb [data-gx="dash"]').length)) === 1);
540
+ /* re-pointed (viewer-shell-a, XvAInsight): on a phone it is the same shell, full screen: the summary with Add a reading, the chart, the rows */
541
+ const ph = await q.evaluate(() => { const v = document.querySelector('#czViewer').getBoundingClientRect(), b = document.querySelector('#czViewer .cz-vw-body'); return { w: Math.round(v.width), tabs: [...document.querySelectorAll('#czViewer .czs-row b')].map((t) => t.textContent).join(), first: b.firstElementChild.className, add: (document.querySelector('#czViewer .czs-pri') || {}).textContent, over: document.documentElement.scrollWidth > innerWidth }; });
542
+ ok('P1 on a phone the goal detail covers the screen: the summary with Add a reading first, then Readings, Moved by and On your dashboards', ph.w === 390 && ph.tabs === 'Readings,Moved by,On your dashboards' && ph.first === 'czs-sum' && ph.add === 'Add a reading' && !ph.over, JSON.stringify(ph));
543
+ await q.click('#czViewer [data-czs-fold="dash"]'); await sleep(80);
544
+ ok('P1 the On your dashboards row holds the switches', (await q.evaluate(() => document.querySelectorAll('#czViewer [data-czs-id="dash"] [data-gx="dash"]').length)) === 1);
532
545
  await vwClose(q);
533
546
  await q.click('#tabLibrary'); await q.click('#listRows [data-setup]');
534
547
  const sh = await until(() => q.evaluate(() => { const s = document.querySelector('#repSheet'); return s ? { title: s.querySelector('.ins-h3').textContent, btns: [...s.querySelectorAll('button, a')].map((b) => b.textContent).join(','), viewer: !!document.querySelector('#czViewer:not([hidden])'), bottom: Math.round(innerHeight - s.getBoundingClientRect().bottom) } : null; }), 4000);
@@ -61,14 +61,14 @@ const ready = (model) => ({ status: 200, body: { ok: true, state: 'ready', model
61
61
  if (await page.isVisible('#moreBtn')) { await page.click('#moreBtn'); await page.click('#bdMetrics'); } else await page.click('#ibBody [data-open="metrics"]'); // re-pointed: Metrics is in the ⋯ menu (desktop) or the phone's plain row
62
62
  return { ctx, page, errors, calls: () => calls };
63
63
  };
64
- const tilesOf = (pg) => pg.evaluate(() => [...document.querySelectorAll('#peek .bd-met')].map((t) => ({ k: t.dataset.met, s: [...t.querySelector('summary').children].map((c) => c.textContent), look: t.classList.contains('look') })));
64
+ const tilesOf = (pg) => pg.evaluate(() => [...document.querySelectorAll('#czViewer .bd-met')].map((t) => ({ k: t.dataset.met, s: [...t.querySelector('summary').children].map((c) => c.textContent), look: t.classList.contains('look') })));
65
65
 
66
66
  /* C1 */
67
67
  const A = await open(), p = A.page;
68
68
  const shown = await until(async () => { const t = await tilesOf(p); return t.length === 4 ? t : null; });
69
69
  ok('C1 the Metrics link under the track opens the board\'s four measures in the side panel', !!shown);
70
70
  if (!shown) return finish(1);
71
- const place = await p.evaluate(() => ({ t: document.querySelector('#pkTitle').textContent, cap: document.querySelector('#metW .bd-amut').textContent, ins: (document.querySelector('#metW a[href^="/premium-insights.html"]') || {}).textContent, dlg: !!document.querySelector('#dlg.on') }));
71
+ const place = await p.evaluate(() => ({ t: document.querySelector('#czViewer .cz-vw-title').textContent, cap: document.querySelector('#metW .bd-amut').textContent, ins: (document.querySelector('#metW a[href^="/premium-insights.html"]') || {}).textContent, dlg: !!document.querySelector('#dlg.on') }));
72
72
  ok('C1 it is a side panel that says which repository it counts and links to Insights; no old dialog', place.t === 'Metrics' && /^counted from idpf/.test(place.cap) && /Targets and longer ranges are on Insights/.test(place.ins || '') && !place.dlg, JSON.stringify(place));
73
73
 
74
74
  /* C2 */
@@ -84,10 +84,10 @@ const ready = (model) => ({ status: 200, body: { ok: true, state: 'ready', model
84
84
  }
85
85
 
86
86
  /* C4 the definition and the values by week */
87
- await p.click('#peek .bd-met[data-met="corrections"] summary');
88
- const d = await p.evaluate(() => { const t = document.querySelector('#peek .bd-met[data-met="corrections"]'); return { open: t.open, def: t.querySelector(':scope > .bd-amut').textContent, wk: t.querySelectorAll('.bd-kv b').length, vals: [...t.querySelectorAll('.bd-kv b')].map((b) => b.textContent) }; });
87
+ await p.click('#czViewer .bd-met[data-met="corrections"] summary');
88
+ const d = await p.evaluate(() => { const t = document.querySelector('#czViewer .bd-met[data-met="corrections"]'); return { open: t.open, def: t.querySelector(':scope > .bd-amut').textContent, wk: t.querySelectorAll('.bd-kv b').length, vals: [...t.querySelectorAll('.bd-kv b')].map((b) => b.textContent) }; });
89
89
  ok('C4 a measure opens its definition and its values by week; a week with too few runs is not kept', d.open && /per 100 agent runs/.test(d.def) && d.wk === 8 && d.vals[7] === '10' && d.vals[0] === 'Not kept yet', JSON.stringify(d));
90
- ok('C4 the panel holds no press that records anything', await p.evaluate(() => !document.querySelector('#peek form, #peek [data-act]')));
90
+ ok('C4 the panel holds no press that records anything', await p.evaluate(() => !document.querySelector('#czViewer form, #czViewer [data-act]')));
91
91
  ok('0 no page error', A.errors.length === 0, A.errors.join(' | '));
92
92
  await A.ctx.close();
93
93
 
@@ -98,7 +98,7 @@ const ready = (model) => ({ status: 200, body: { ok: true, state: 'ready', model
98
98
  ok('C5 while the workflow is derived Blocked says Reading, and the panel asks again until it is filled', await until(async () => /^Reading/.test(await idle())) && await until(async () => (await idle()) === '1', 9000) && R.calls() >= 2, String(R.calls()));
99
99
  await R.ctx.close();
100
100
  const F2 = await open({ answers: () => ({ status: 500, body: { ok: false, state: 'error', error: 'the repository could not be read' } }) });
101
- ok('C5 a failed read says why and draws no tile', await until(() => F2.page.evaluate(() => /The reason: the repository could not be read/.test((document.querySelector('#metW') || {}).textContent || '') && !document.querySelector('#peek .bd-met'))));
101
+ ok('C5 a failed read says why and draws no tile', await until(() => F2.page.evaluate(() => /The reason: the repository could not be read/.test((document.querySelector('#metW') || {}).textContent || '') && !document.querySelector('#czViewer .bd-met'))));
102
102
  await F2.ctx.close();
103
103
  }
104
104
 
@@ -106,7 +106,7 @@ const ready = (model) => ({ status: 200, body: { ok: true, state: 'ready', model
106
106
  for (const theme of ['light', 'dark']) {
107
107
  const R = await open({ w: 390, h: 844, theme }), q = R.page;
108
108
  await until(async () => (await tilesOf(q)).length === 4);
109
- const m = await q.evaluate(() => ({ over: document.documentElement.scrollWidth > innerWidth + 1, small: [...document.querySelectorAll('#peek .bd-met summary')].filter((b) => b.getBoundingClientRect().height < 44).length }));
109
+ const m = await q.evaluate(() => ({ over: document.documentElement.scrollWidth > innerWidth + 1, small: [...document.querySelectorAll('#czViewer .bd-met summary')].filter((b) => b.getBoundingClientRect().height < 44).length }));
110
110
  ok(`C6 at 390 px (${theme}) the panel does not scroll sideways and every measure is 44 px or more`, !m.over && m.small === 0, JSON.stringify(m));
111
111
  ok(`C6 no page error at 390 px (${theme})`, R.errors.length === 0, R.errors.join(' | '));
112
112
  await R.ctx.close();
@@ -123,7 +123,7 @@ const ready = (model) => ({ status: 200, body: { ok: true, state: 'ready', model
123
123
  await pg.goto(BASE + '/premium-board.html');
124
124
  await until(() => pg.evaluate(() => document.querySelectorAll('#ibBody .ini2').length > 0), 40000); await sleep(800);
125
125
  await pg.click('#moreBtn'); await pg.click('#bdMetrics');
126
- ok('C7 the real PMOS board opens its Metrics panel with four measures and no script error', await until(() => pg.evaluate(() => document.querySelectorAll('#peek .bd-met').length === 4), 30000) && errs.length === 0, errs.join(' | '));
126
+ ok('C7 the real PMOS board opens its Metrics panel with four measures and no script error', await until(() => pg.evaluate(() => document.querySelectorAll('#czViewer .bd-met').length === 4), 30000) && errs.length === 0, errs.join(' | '));
127
127
  await ctx.close();
128
128
  }
129
129
 
@@ -27,7 +27,7 @@ const moreItem = async (pg, label, sel) => {
27
27
  await pg.click('#czFab'); await pg.click('#czMenu ' + PLACE_ITEM[label]);
28
28
  await pg.waitForSelector('#czViewer ' + sel, { timeout: 15000 });
29
29
  };
30
- const srcRowsOf = (pg) => pg.$$eval('#hmList .hm-r[data-id^="n:src:"]', (els) => els.map((e) => ({ key: e.dataset.id.slice(2), title: e.querySelector('.hm-rt b').textContent, line2: (e.querySelector('.hm-rt em') || {}).textContent || '' })));
30
+ const srcRowsOf = (pg) => pg.$$eval('#hmList .hm-r[data-id^="n:src:"]', (els) => els.map((e) => ({ key: e.dataset.id.slice(2), title: e.querySelector('.hm-rt b').textContent, line2: (e.querySelector('.hm-rt em') || {}).textContent || (e.querySelector('.hm-rm') || { title: '' }).title || '' }))); // Home A + C (HvAC): a row is one line; the second line is the row's title (its tooltip)
31
31
  const allNeeds = async (pg) => { for (let i = 0; i < 20; i++) { const t = await pg.textContent('#hmList [data-hm-allneeds]').catch(() => null); if (t === null || !/Show$/.test(t.trim())) return; await pg.click('#hmList [data-hm-allneeds]', { timeout: 2000 }).catch(() => {}); await sleep(150); } };
32
32
  const until = async (fn, ms = 15000, step = 150) => { const t0 = Date.now(); for (;;) { let v = null; try { v = await fn(); } catch { v = null; } if (v) return v; if (Date.now() - t0 > ms) return v; await sleep(step); } };
33
33
  const results = [];
@@ -101,7 +101,8 @@ const sh = (cwd, args) => spawnSync('git', args, { cwd, encoding: 'utf8' });
101
101
  // the greeting is a morning card (the evening shows the day's recap instead): the page reads a fixed morning clock
102
102
  const am = new Date(); am.setHours(10, 0, 0, 0); await page.clock.setFixedTime(am);
103
103
  await page.goto(BASE + '/premium.html?theme=' + theme, { waitUntil: 'domcontentloaded' });
104
- await page.waitForSelector('#hmList .hm-r[data-id^="n:src:"]', { state: 'attached', timeout: 60000 });
104
+ // the list is drawn: on a phone "Not in an initiative" starts folded (Home A + C, HvAC), so its folded line stands for its rows there
105
+ await page.waitForSelector(w > 760 ? '#hmList .hm-r[data-id^="n:src:"]' : '#hmList .hv-lh', { state: 'attached', timeout: 60000 });
105
106
  return { ctx, page, errors };
106
107
  };
107
108
 
@@ -109,11 +110,11 @@ const sh = (cwd, args) => spawnSync('git', args, { cwd, encoding: 'utf8' });
109
110
  const { ctx, page, errors } = await open();
110
111
  await allNeeds(page);
111
112
  const rows = await srcRowsOf(page);
112
- ok('S2 the first row is two lines: the title, then the product, the source and sender · the verb and the prepared line', rows[0] && rows[0].title === 'Confirm the Thursday review' && rows[0].line2 === 'Across products · Mail · Anna Lee · Reply: Confirm Thursday', JSON.stringify(rows[0]));
113
+ ok('S2 the first row is its title, with the product, the source and sender · the verb and the prepared line as its detail', rows[0] && rows[0].title === 'Confirm the Thursday review' && rows[0].line2 === 'Across products · Mail · Anna Lee · Reply: Confirm Thursday', JSON.stringify(rows[0]));
113
114
  ok('S2 a row with a verb and no prepared line shows the verb alone', rows[1] && /Confluence · Budi Santoso · Sign off$/.test(rows[1].line2), JSON.stringify(rows[1]));
114
115
  // premium-uncovered-features (canvas HmMyWork): no Needs you group; the greeting counts the next steps that are yours, the source rows among them
115
- const needN = await page.textContent('#hmList .hm-tc .big'), allRows = await page.$$eval('#hmList .hm-r[data-id^="n:"]', (els) => els.length);
116
- const gn = /(\d+) next steps? (?:is|are) yours/.exec(needN || '');
116
+ const needN = await page.textContent('#hmList .hv-sub'), allRows = await page.$$eval('#hmList .hm-r[data-id^="n:"]', (els) => els.length);
117
+ const gn = /(\d+) (?:is|are) yours/.exec(needN || ''); // "N are yours" (HvAC)
117
118
  ok('S6 Home counts the rows: the four source rows are among the next steps, and the greeting counts them all', rows.length === 4 && !!gn && +gn[1] >= allRows && allRows >= 4, needN + ' / ' + allRows);
118
119
  await page.click(`#hmList [data-hm-sel="n:${rows[0].key}"]`);
119
120
  await page.waitForSelector('#czViewer #srcLink');
@@ -176,16 +177,17 @@ const sh = (cwd, args) => spawnSync('git', args, { cwd, encoding: 'utf8' });
176
177
  * (cozy.css, cozy-home.css), resolved in the page itself for the theme under test; the row and the digest still fill their column, and still
177
178
  * nothing scrolls sideways. A source row that drifted off the design's tokens fails here as it failed against the mockup. */
178
179
  {
179
- // re-pointed again for the Agreed design's Home: the source row is a Needs-you row of Home's list, and the digest is a row of New for you
180
- const ROWS = [['row', '.hm-rm'], ['number', '.hm-dot'], ['title', '.hm-rt b'], ['subject', '.hm-rt em']];
180
+ // re-pointed again for the Agreed design's Home: the source row is a Needs-you row of Home's list, and the digest is a row of New for you.
181
+ // Re-pointed for Home A + C (HvAC, HvACDesk): a row is one line, its mark and its title; the subject moved to the row's tooltip and
182
+ // accessible name, and the title is 14.5 px on a desktop, 15 px on a phone, weight 600
183
+ const ROWS = [['row', '.hm-rm'], ['number', '.hv-d'], ['title', '.hm-rt b']];
181
184
  const DIGS = [['event', ''], ['eventTime', '.ev-tx .ev-mut'], ['eventTitle', '.ev-tx b']];
182
185
  const SANS = 'var(--cz-sans)';
183
186
  /* The design's values, as the tokens name them (a value that starts var( is resolved in the page; anything else is literal) */
184
187
  const WANT = {
185
188
  row: { fontFamily: SANS, color: 'var(--cz-ink)', backgroundColor: 'transparent' },
186
- number: { backgroundColor: 'var(--cz-blue)', borderRadius: '50%', width: '7px', height: '7px' }, // the row's dot is blue: it waits on you
187
- title: { fontFamily: SANS, fontSize: '14px', fontWeight: '700', color: 'var(--cz-ink)' },
188
- subject: { fontFamily: SANS, fontSize: '12.5px', color: 'var(--cz-blueink)' }, // the canvas's row line (.lrow .s, premium-uncovered-features)
189
+ number: { backgroundColor: 'var(--cz-blue)', borderRadius: '50%', width: '8px', height: '8px' }, // the row's dot is blue: it waits on you (HvAC .d)
190
+ title: { fontFamily: SANS, fontSize: '14.5px', fontWeight: '600', color: 'var(--cz-ink)' }, // HvACDesk .t; 15px on a phone (HvAC .t b)
189
191
  event: { fontFamily: SANS, color: 'var(--cz-ink)', backgroundColor: 'transparent' }, // a row of New for you's table (cozy-ev.css)
190
192
  eventTime: { fontSize: '12.5px', color: 'var(--cz-ink3)' },
191
193
  eventTitle: { fontFamily: SANS, fontSize: '13.5px', fontWeight: '700', color: 'var(--cz-ink)' },
@@ -217,6 +219,9 @@ const sh = (cwd, args) => spawnSync('git', args, { cwd, encoding: 'utf8' });
217
219
  const R = await open({ w, h, theme: th });
218
220
  // on a phone the list is the page (canvas HmPhone)
219
221
  await allNeeds(R.page);
222
+ // on a phone "Not in an initiative" starts folded (HvAC): open it to reach the source row
223
+ if (w === 390) { const lh = await R.page.$('#hmList .hv-lh[aria-expanded="false"]'); if (lh) await lh.click(); }
224
+ WANT.title.fontSize = w === 390 ? '15px' : '14.5px';
220
225
  await sleep(500);
221
226
  const rowSel = '#hmList .hm-r[data-id^="n:src:"]';
222
227
  const diffs = diff(await grab(R.page, ROWS, rowSel, '.hm-pg'), ROWS, 4); // the row fills its group (the group's own inset aside)