create-pmos 0.398.0 → 0.399.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) 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/briefing-premium-adddoc-test.js +18 -14
  7. package/workspace/briefing-premium-board-test.js +80 -48
  8. package/workspace/briefing-premium-calendar-2-test.js +36 -36
  9. package/workspace/briefing-premium-calendar-3-test.js +39 -39
  10. package/workspace/briefing-premium-calendar-test.js +23 -24
  11. package/workspace/briefing-premium-doc-edit-test.js +6 -2
  12. package/workspace/briefing-premium-initiative-test.js +38 -16
  13. package/workspace/briefing-premium-insights-test.js +114 -37
  14. package/workspace/briefing-premium-metrics-test.js +6 -4
  15. package/workspace/briefing-premium-products-test.js +10 -7
  16. package/workspace/briefing-premium-sources-test.js +25 -22
  17. package/workspace/briefing-premium-test.js +46 -42
  18. package/workspace/briefing-premium-work-test.js +9 -9
  19. package/workspace/changelog.json +12 -0
  20. package/workspace/ev-everywhere-test.js +210 -0
  21. package/workspace/fixtures/premium-viewer-fixtures.js +11 -6
  22. package/workspace/guide/home.md +39 -18
  23. package/workspace/guide/index.md +1 -1
  24. package/workspace/lib/board-grill.js +63 -0
  25. package/workspace/lib/board-premium.js +36 -5
  26. package/workspace/lib/initiative-layout.js +77 -0
  27. package/workspace/lib/insights-premium.js +3 -2
  28. package/workspace/lib/insights-records.js +21 -7
  29. package/workspace/lib/meeting-points.js +52 -0
  30. package/workspace/lib/news-for-you.js +88 -0
  31. package/workspace/lib/notes-series.js +29 -6
  32. package/workspace/lib/report-confirm.js +48 -0
  33. package/workspace/lib/route-modules.js +8 -0
  34. package/workspace/lib/routes-board-docs.js +46 -0
  35. package/workspace/lib/routes-board-grill.js +90 -0
  36. package/workspace/lib/routes-home-review.js +108 -0
  37. package/workspace/lib/routes-initiative-layout.js +57 -0
  38. package/workspace/lib/routes-insights-premium.js +4 -1
  39. package/workspace/lib/routes-insights-records.js +8 -4
  40. package/workspace/lib/routes-meeting-points.js +37 -0
  41. package/workspace/lib/routes-news.js +57 -0
  42. package/workspace/lib/routes-notes.js +2 -1
  43. package/workspace/lib/routes-report-confirm.js +31 -0
  44. package/workspace/lib/routes-search.js +38 -0
  45. package/workspace/lib/search-index.js +176 -0
  46. package/workspace/package-lock.json +2 -2
  47. package/workspace/package.json +1 -1
  48. package/workspace/premium-board-actions-test.js +86 -50
  49. package/workspace/premium-briefing-depth-test.js +55 -54
  50. package/workspace/premium-chat-chart-tab-test.js +4 -2
  51. package/workspace/premium-chat-report-tab-test.js +16 -2
  52. package/workspace/premium-core-doc-issue-test.js +15 -13
  53. package/workspace/premium-phone-card-test.js +5 -3
  54. package/workspace/premium-report-read-test.js +55 -18
  55. package/workspace/premium-vw-backlog-test.js +2 -2
  56. package/workspace/premium-vw-cal-test.js +50 -35
  57. package/workspace/premium-vw-doc-test.js +9 -3
  58. package/workspace/premium-vw-item-test.js +1 -1
  59. package/workspace/premium-vw-jira-test.js +2 -2
  60. package/workspace/premium-vw-meet-test.js +37 -40
  61. package/workspace/premium-vw-notes-test.js +21 -19
  62. package/workspace/premium-vw-rec-test.js +11 -12
  63. package/workspace/premium-welcome-test.js +3 -3
  64. package/workspace/premium-work-depth-test.js +3 -3
  65. package/workspace/public/pm/bd-acts.js +303 -225
  66. package/workspace/public/pm/bd-asks.js +261 -0
  67. package/workspace/public/pm/bd-pop.js +59 -0
  68. package/workspace/public/pm/bd-span.js +49 -13
  69. package/workspace/public/pm/bd-views.js +169 -0
  70. package/workspace/public/pm/cozy-board.css +301 -0
  71. package/workspace/public/pm/cozy-ev.css +228 -0
  72. package/workspace/public/pm/cozy-evmodel.js +106 -0
  73. package/workspace/public/pm/cozy-evui.js +47 -0
  74. package/workspace/public/pm/cozy-insights.css +148 -10
  75. package/workspace/public/pm/cozy-nav.js +103 -39
  76. package/workspace/public/pm/cozy-news.js +140 -0
  77. package/workspace/public/pm/cozy-search.js +203 -0
  78. package/workspace/public/pm/cozy-settings.js +198 -0
  79. package/workspace/public/pm/cozy-sources.js +89 -0
  80. package/workspace/public/pm/cozy-today.css +217 -0
  81. package/workspace/public/pm/cozy-viewer.js +1 -0
  82. package/workspace/public/pm/cozy-vw-mtg.css +350 -0
  83. package/workspace/public/pm/cozy-vw-rp.css +152 -0
  84. package/workspace/public/pm/home-adddoc.js +5 -5
  85. package/workspace/public/pm/home-app.js +329 -55
  86. package/workspace/public/pm/home-around.js +24 -126
  87. package/workspace/public/pm/home-chat.js +67 -14
  88. package/workspace/public/pm/home-data.js +6 -6
  89. package/workspace/public/pm/home-dictate.js +54 -0
  90. package/workspace/public/pm/home-draft.js +6 -6
  91. package/workspace/public/pm/home-ini-model.js +190 -0
  92. package/workspace/public/pm/home-ini.css +171 -0
  93. package/workspace/public/pm/home-ini.js +456 -0
  94. package/workspace/public/pm/home-list.js +276 -0
  95. package/workspace/public/pm/home-more.js +17 -134
  96. package/workspace/public/pm/home-phone-card.js +4 -4
  97. package/workspace/public/pm/home-review.js +104 -0
  98. package/workspace/public/pm/home-task.js +67 -0
  99. package/workspace/public/pm/home-today.js +144 -0
  100. package/workspace/public/pm/home-work.js +54 -26
  101. package/workspace/public/pm/premium-board.js +163 -39
  102. package/workspace/public/pm/premium-chart-tab.js +4 -5
  103. package/workspace/public/pm/premium-first.js +5 -7
  104. package/workspace/public/pm/premium-insights.js +499 -202
  105. package/workspace/public/pm/premium-mtg-present.js +138 -0
  106. package/workspace/public/pm/premium-mtg-replay.js +142 -0
  107. package/workspace/public/pm/premium-report-read.js +216 -52
  108. package/workspace/public/pm/premium-report-tab.js +44 -19
  109. package/workspace/public/pm/premium-shell.js +7 -7
  110. package/workspace/public/pm/premium-vw-cal.js +150 -60
  111. package/workspace/public/pm/premium-vw-mtg.js +488 -261
  112. package/workspace/public/pm/premium-vw-notes.js +61 -0
  113. package/workspace/public/pm/rp-parts.js +269 -0
  114. package/workspace/public/premium-board.html +4 -3
  115. package/workspace/public/premium-insights.html +10 -10
  116. package/workspace/public/premium.html +3 -1
  117. package/workspace/r/m1.png +0 -0
  118. package/workspace/r/m2.png +0 -0
  119. package/workspace/r/m3.png +0 -0
  120. package/workspace/r/nl.png +0 -0
  121. package/workspace/test-lists/initiative-layout.json +9 -0
  122. package/workspace/test-lists/premium-uncovered-meetings.json +9 -0
  123. package/workspace/test-lists/premium-uncovered-reports.json +9 -0
  124. package/workspace/test-lists/uf-everywhere.json +15 -0
  125. package/workspace/test-lists/uf-home.json +9 -0
  126. package/workspace/test-lists/uncovered-board.json +9 -0
@@ -94,9 +94,10 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
94
94
  {
95
95
  await p.click('#newB'); const nw = await p.evaluate(() => [...document.querySelectorAll('#newMenu [data-new]')].map((b) => b.dataset.new).join()); await p.keyboard.press('Escape');
96
96
  ok('B1 + offers New goal, New dashboard and New chart', nw === 'goal,dash,chart', nw);
97
- await p.click('#filtB'); const fl = await p.evaluate(() => ({ heads: [...document.querySelectorAll('#filtMenu .ins-mh')].map((h) => h.textContent).join(), owners: [...document.querySelectorAll('#filtMenu [data-fk="owner"]')].map((b) => b.dataset.fv).join(), lanes: [...document.querySelectorAll('#filtMenu [data-fk="lane"]')].map((b) => b.dataset.fv).join(), label: document.querySelector('#filtB').getAttribute('aria-label') }));
97
+ await p.click('#filtB'); const fl = await p.evaluate(() => ({ heads: [...document.querySelectorAll('#filtMenu .ins-mh')].map((h) => h.textContent).join(), status: [...document.querySelectorAll('#filtMenu [data-fk="status"]')].map((b) => b.textContent).join(), owners: [...document.querySelectorAll('#filtMenu [data-fk="owner"]')].map((b) => b.dataset.fv).join(), kinds: [...document.querySelectorAll('#filtMenu [data-fk="kind"]')].map((b) => b.textContent).join(), chips: document.querySelectorAll('#filtMenu .cz-chip').length, label: document.querySelector('#filtB').getAttribute('aria-label') }));
98
98
  await p.keyboard.press('Escape');
99
- ok('B1 the filter is by objective, owner, type and lane; owners and lanes come from the work that moves the goals', fl.heads === 'Objective,Owner,Type,Lane' && fl.owners === 'Dara,Lee,Mira' && fl.lanes === 'feature' && /owner/.test(fl.label) && /lane/.test(fl.label), JSON.stringify(fl));
99
+ /* re-pointed (premium-uncovered-features, IsMenus): the filter is chips by status, owner and kind */
100
+ ok('B1 the filter is chips by status, owner and kind; the owners are the goals\' owners and the work that moves them', fl.heads === 'Status,Owner,Kind' && fl.status === 'Off track,On track,Hit,No readings' && fl.owners === 'Dara,Lee,Mira' && fl.kinds === 'Goals,Health budgets' && /status, owner or kind/.test(fl.label), JSON.stringify(fl));
100
101
  await p.click('#moreB'); const mo = await p.evaluate(() => [...document.querySelectorAll('#moreMenu [data-more]')].map((b) => b.dataset.more + ':' + (b.disabled ? 'off' : 'on')).join()); await p.click('#moreMenu [data-more="about"]');
101
102
  const ab = await until(() => vw(p));
102
103
  ok('B1 ⋯ holds Sources, Export and About these numbers; About opens in the Viewer card', mo === 'sources:on,export:on,about:on' && ab && ab.title === 'About these numbers' && /straight line through the last four readings/.test(ab.text), JSON.stringify([mo, ab]));
@@ -109,10 +110,21 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
109
110
  const u = new URL(rq.url());
110
111
  ok('B1 Export asks the export route for this workspace\'s goals as CSV', u.searchParams.get('ws') === 'w1' && u.searchParams.get('board') === 'w1', u.search); await R.ctx.close(); }
111
112
  await vwClose(p);
112
- await p.click('#findB'); await p.fill('#findIn', 'uptime'); await sleep(150);
113
+ await p.click('#findB'); await p.fill('#findIn', 'partner'); await sleep(150);
114
+ const fr = await p.evaluate(() => ({ heads: [...document.querySelectorAll('#findRes .ins-mh')].map((h) => h.textContent).join(), goals: [...document.querySelectorAll('#findRes [data-fo="goal"]')].map((b) => b.dataset.id).join(), mark: (document.querySelector('#findRes mark') || {}).textContent, dash: [...document.querySelectorAll('#findRes [data-fo="dash"]')].map((b) => b.dataset.id).join() }));
115
+ ok('B1 Find is a popover: goals, reports and dashboards that hold the words, the words marked (IsMenus)', fr.heads === 'Goals,Reports,Dashboards' && fr.goals === 'krm-act,krm-up,krm-nps' && /^partner$/i.test(fr.mark) && fr.dash === 'pd-1', JSON.stringify(fr));
116
+ await p.fill('#findIn', 'uptime'); await sleep(150);
113
117
  const fd = await p.evaluate(() => [...document.querySelectorAll('#goalTbl [data-goal]')].map((r) => r.dataset.goal).join());
114
118
  await p.click('#findX'); await sleep(100);
115
- 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, fd);
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
+ await p.click('#findB'); await p.fill('#findIn', 'activation'); await sleep(100); await p.click('#findRes [data-fo="goal"]');
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));
123
+ await vwClose(p);
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
+ 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));
126
+ await p.click('#prodPick'); const pr = await p.evaluate(() => ({ head: document.querySelector('#prodMenu .ins-mh').textContent, items: [...document.querySelectorAll('#prodMenu [data-board]')].map((b) => b.textContent).join(), pf: !!document.querySelector('#prodMenu [data-portfolio]') })); await p.keyboard.press('Escape');
127
+ ok('B1 the product picker says Product; with one product there is no Portfolio to roll up', pr.head === 'Product' && pr.items === 'pmos' && !pr.pf, JSON.stringify(pr));
116
128
  }
117
129
 
118
130
  /* G1 the Goals table */
@@ -125,7 +137,7 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
125
137
  const leg = await p.evaluate(() => document.querySelector('#goalTbl .ins-th .ins-mvh').textContent.replace(/\s+/g, ' '));
126
138
  ok('G1 the Moved by header carries the legend: skipped and milestone', /Skipped/.test(leg) && /Milestone/.test(leg), leg);
127
139
  const nps = await p.evaluate(() => document.querySelector('#goalTbl [data-goal="krm-nps"]').textContent);
128
- ok('G1 a goal with one reading draws no line and no pace: it says so', /One reading, no series yet/.test(nps) && /needs a second reading/.test(nps) && /No initiative anchors to it/.test(nps), nps);
140
+ ok('G1 a goal with one reading draws no line and no pace: it shows the one value and No trend yet (IsMenus)', /1 reading/.test(nps) && /No trend yet/.test(nps) && /needs a second reading/.test(nps) && /No initiative anchors to it/.test(nps), nps);
129
141
  const up = await txt('#goalTbl [data-goal="krm-up"] .pace');
130
142
  ok('G1 a percentage pace never passes 100%, and a goal ahead of its time says so', /^≈100% by Dec 31/.test(up) && /ahead: 67% done, 39% of time gone/.test(up), up);
131
143
  const ch = await txt('#goalTbl [data-goal="krm-churn"]');
@@ -140,18 +152,36 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
140
152
  await R.ctx.close();
141
153
  await p.click('#goalTbl [data-budget="docs"] .nm');
142
154
  const v = await until(() => vw(p));
143
- ok('G1 a budget press opens its detail (what it covers, its cap, its reading), marked as waiting for design', v && v.title === 'docs' && v.wait === 'A health budget’s detail' && /documentation upkeep/.test(v.text) && /20% of a quarter/.test(v.text) && /1 of 6 open initiatives/.test(v.text), JSON.stringify(v));
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')));
144
158
  await vwClose(p);
145
159
  }
146
- /* G1 a goal's detail and readings: a minimal form, marked as waiting for design; it adds a reading through the KR metric route */
160
+ /* 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
161
+ * the KR metric route; Moved by; On your dashboards, whose switch saves that dashboard */
147
162
  {
148
- const R = await open(), q = R.page, sent = [];
163
+ const R = await open(), q = R.page, sent = [], saved = [];
149
164
  await q.route('**/api/records/kr-metrics/reading', (r) => { sent.push(JSON.parse(r.request().postData() || '{}')); r.fulfill({ contentType: 'application/json', body: '{"ok":true}' }); });
165
+ await q.route('**/api/premium-dashboards/save', (r) => { saved.push(JSON.parse(r.request().postData() || '{}')); r.fulfill({ contentType: 'application/json', body: '{"ok":true}' }); });
150
166
  await q.click('#goalTbl [data-goal="krm-act"] .nm');
151
167
  const v = await until(() => vw(q));
152
- ok('G1 on All goals a goal press opens its detail and readings (not the old dialog), marked as waiting for design', v && v.title === 'Partner activation' && v.wait === 'A goal’s detail and readings' && (await q.evaluate(() => document.querySelectorAll('#czViewer .ins-rd li').length)) === 4 && await q.evaluate(() => !document.querySelector('#dlg')), JSON.stringify(v)); // re-pointed (insights fix): the page has no old dialog at all
153
- await q.fill('#czViewer [data-rdf] [name="v"]', '31'); await q.click('#czViewer [data-rdf] button[type="submit"]'); await until(() => sent.length > 0, 4000);
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]));
170
+ 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);
173
+ 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);
154
175
  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
+ await until(() => q.evaluate(() => !!document.querySelector('#czViewer [data-gx="dash"]')), 4000);
177
+ await q.click('#czViewer [data-gx="dash"]'); await until(() => saved.length > 0, 4000);
178
+ 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);
181
+ await vwClose(q);
182
+ 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);
155
185
  await R.ctx.close();
156
186
  }
157
187
  /* G1 the period (AgInsPeriod) */
@@ -183,20 +213,29 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
183
213
  }
184
214
  {
185
215
  const R = await open(), q = R.page, sent = [];
186
- await q.route(/\/api\/(board-metric-targets\/save|insights-records\/target)/, (r) => { sent.push([new URL(r.request().url()).pathname, JSON.parse(r.request().postData() || '{}')]); r.fulfill({ contentType: 'application/json', body: '{"ok":true,"targets":{}}' }); });
187
- await q.click('#bmBody [data-tile="merges"]'); const v = await until(() => vw(q));
188
- await q.fill('#czViewer [data-tgf] [name="tg"]', '150'); await q.click('#czViewer [data-tgf] button[type="submit"]'); await until(() => sent.length > 0, 4000);
189
- ok('G1 a tile press opens its target, marked as waiting for design; a Board measure\'s target goes to the Board\'s target route', v && v.title === 'Merged a week' && v.wait === 'Setting a Delivery trends target' && sent[0][0] === '/api/board-metric-targets/save' && sent[0][1].key === 'merges' && sent[0][1].target === 150, JSON.stringify([v, sent]));
190
- await vwClose(q); await q.click('#bmBody [data-tile="late"]'); await until(() => vw(q));
191
- await q.fill('#czViewer [data-tgf] [name="tg"]', '0'); await q.click('#czViewer [data-tgf] button[type="submit"]'); await until(() => sent.length > 1, 4000);
192
- ok('G1 the Late initiatives target is kept in the page\'s own records', sent[1] && sent[1][0] === '/api/insights-records/target' && sent[1][1].key === 'late' && sent[1][1].target === 0, JSON.stringify(sent));
216
+ await q.route(/\/api\/(board-metric-targets\/save|insights-records\/target|insights-records\/tile)/, (r) => { sent.push([new URL(r.request().url()).pathname, JSON.parse(r.request().postData() || '{}')]); r.fulfill({ contentType: 'application/json', body: '{"ok":true,"targets":{}}' }); });
217
+ await q.click('#bmBody [data-tile="merges"]'); await until(() => q.evaluate(() => !!document.querySelector('#tgPop')));
218
+ const pop = await q.evaluate(() => ({ h: document.querySelector('#tgPop .ins-h3').textContent, dirs: [...document.querySelectorAll('#tgPop [data-v]')].map((b) => b.textContent + ':' + b.getAttribute('aria-pressed')).join(), range: document.querySelector('#tgPop p.note').textContent, chip: document.querySelector('#tgChip').getAttribute('aria-checked'), tile: document.querySelector('#bmBody [data-tile="merges"]').getAttribute('aria-expanded'), say: document.querySelector('#bmBody [data-tile="merges"] .tg').textContent, viewer: !!document.querySelector('#czViewer:not([hidden])') }));
219
+ ok('G1 a tile press opens its target over the tiles: At least (more merges is better), At most or No target, the tile\'s range, the Board chip (IsTarget)', pop.h === 'Target for merged a week' && pop.dirs === 'At least:true,At most:false,No target:false' && /^Last 3 weeks: 150 to 174, median 160\./.test(pop.range) && /amber only after 2 weeks/.test(pop.range) && pop.chip === 'true' && pop.tile === 'true' && pop.say === 'Setting target…' && !pop.viewer, JSON.stringify(pop));
220
+ await q.fill('#tgV', '150'); await q.fill('#tgFrom', '2026-10-19'); await q.click('#tgSet'); await until(() => sent.length > 1, 4000);
221
+ ok('G1 Set target sends the number to the Board\'s target route and how it is read to the page\'s own records', sent[0][0] === '/api/board-metric-targets/save' && sent[0][1].key === 'merges' && sent[0][1].target === 150 && sent[1][0] === '/api/insights-records/tile' && sent[1][1].dir === 'at least' && sent[1][1].from === '2026-10-19' && sent[1][1].chip === true && await until(() => q.evaluate(() => !document.querySelector('#tgPop')), 5000), JSON.stringify(sent)); // the popover closes once both saves answer
222
+ await q.click('#bmBody [data-tile="late"]'); await until(() => q.evaluate(() => !!document.querySelector('#tgPop')));
223
+ await q.fill('#tgV', '0'); await q.click('#tgChip'); await q.click('#tgSet'); await until(() => sent.length > 3, 4000);
224
+ ok('G1 the Late initiatives target is kept in the page\'s own records, at most by default, and the chip can be left off', sent[2] && sent[2][0] === '/api/insights-records/target' && sent[2][1].key === 'late' && sent[2][1].target === 0 && sent[3][1].dir === 'at most' && sent[3][1].chip === false, JSON.stringify(sent));
225
+ await q.click('#bmBody [data-tile="idle"]'); await until(() => q.evaluate(() => !!document.querySelector('#tgPop'))); await q.click('#tgPop [data-v="none"]'); await q.click('#tgSet'); await until(() => sent.length > 5, 4000);
226
+ ok('G1 No target clears the number', sent[4][1].key === 'idle' && sent[4][1].target === null && sent[5][1].dir === 'none', JSON.stringify(sent.slice(4)));
227
+ await q.click('#bmBody [data-tile="scope"]'); await until(() => q.evaluate(() => !!document.querySelector('#tgPop'))); await q.keyboard.press('Escape');
228
+ ok('G1 Escape closes the target and gives the tile its focus back', await q.evaluate(() => !document.querySelector('#tgPop') && document.activeElement && document.activeElement.dataset.tile === 'scope'));
229
+ await q.click('#viewChip'); await q.click('#viewMenu [data-view="trends"]'); await sleep(150);
230
+ const tv = await q.evaluate(() => { const T = [...document.querySelectorAll('#bmBody [data-tile]')].map((t) => t.getBoundingClientRect()); return { name: document.querySelector('#viewName').textContent, h: document.querySelector('.ins-trends.big h2').textContent, rows: document.querySelectorAll('#goalTbl [data-goal]').length, cols: T.filter((t) => Math.abs(t.top - T[0].top) < 2).length, tg: [...document.querySelectorAll('#bmBody .tg')].map((x) => x.textContent).join('|') }; });
231
+ ok('G1 Delivery trends is a view of its own: the six tiles three to a row, each with its target line', tv.name === 'Delivery trends' && tv.h === 'Delivery trends' && tv.rows === 0 && tv.cols === 3 && tv.tg.split('|').length === 6, JSON.stringify(tv));
193
232
  await R.ctx.close();
194
233
  }
195
234
  {
196
235
  const R = await open({ model: mk({ ins: { charts: {}, verdicts: {}, targets: { late: 0 } }, initiatives: F.INITIATIVES.map((r, i) => Object.assign({}, r, i < 2 ? { start: '2026-10-15' } : {})) }) });
197
236
  const t = await until(async () => { const x = await R.page.evaluate(() => ['late', 'scope'].map((k) => { const e = document.querySelector(`#bmBody [data-tile="${k}"]`); return e && e.querySelector('.v').textContent + ':' + (e.getAttribute('aria-label') || '').replace(/^[^,]+, [^,]+, /, '') + ':' + e.classList.contains('warn'); })); return x[0] ? x : null; });
198
237
  /* re-pointed (insights fix): the target is said in the tile's label and title, not as a line under the value */
199
- ok('G1 Late shows its target and is marked when over it; Scope added counts the initiatives that start this week, with its line', t && t[0] === '1:late today, target 0:true' && /^2:/.test(t[1]) && await R.page.evaluate(() => !!document.querySelector('#bmBody [data-tile="scope"] svg')), JSON.stringify(t));
238
+ ok('G1 Late shows its target and is marked when over it; Scope added counts the initiatives that start this week, with its line', t && t[0] === '1:late today, Target: at most 0:true' && /^2:/.test(t[1]) && await R.page.evaluate(() => !!document.querySelector('#bmBody [data-tile="scope"] svg')), JSON.stringify(t));
200
239
  await R.ctx.close();
201
240
  }
202
241
  {
@@ -295,42 +334,45 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
295
334
  {
296
335
  const R = await open(), q = R.page;
297
336
  await q.click('#tabLibrary');
298
- const lb = await q.evaluate(() => ({ seg: [...document.querySelectorAll('#listSeg [data-f]')].map((b) => b.textContent.replace(/\s+/g, ' ').trim()).join(), sug: document.querySelector('#sugB').textContent, note: document.querySelector('#pLibrary .ins-lnote').textContent, heads: [...document.querySelectorAll('#repAsks .ins-lhead span')].map((s) => s.textContent).join('|'), rpt: [...document.querySelectorAll('#listRows [data-rpt]')].map((r) => r.dataset.rpt + '|' + r.querySelector('.ins-when').textContent + '|' + r.querySelector('.ins-dots + small').textContent + '|' + r.querySelector('.ins-from').textContent).join(' / '), setups: document.querySelectorAll('#listRows [data-setup]').length, asks: document.querySelectorAll('#listRows [data-ask]').length, cards: [...document.querySelectorAll('#listRows .ins-dcard')].map((c) => c.dataset.d + (c.querySelector('.ins-pinned') ? '*' : '')).join(), cap: document.querySelector('#repCap').textContent }));
299
- ok('L1 Library: the All, Reports and Dashboards chips, the suggestions chip, and the note that reports are made in Home', lb.seg === 'All 9,Reports 5,Dashboards 4' && lb.sug === '1 suggestion from your work' && /Reports are made in Home/.test(lb.note) && lb.cap === '9', JSON.stringify(lb));
300
- ok('L1 the reports table has the design\'s columns; a draft says "Draft ready for" its date; no schedule and no source are said, not made up', lb.heads === '|Report · audience|When|Issued · next|Built from|' && /Draft ready for Oct 14/.test(lb.rpt) && /No schedule/.test(lb.rpt) && /Not recorded/.test(lb.rpt) && lb.setups === 1 && lb.asks === 2, JSON.stringify(lb.rpt));
337
+ /* re-pointed (premium-uncovered-features, IsLibrary): the bar hands New report to Home, Found in your work is cards, the reports are Report · Next · Status */
338
+ const lb = await q.evaluate(() => ({ note: document.querySelector('#pLibrary .ins-lnote').textContent, nr: document.querySelector('#newRep').getAttribute('href'), found: document.querySelector('#listRows .ins-fdh b').textContent, fcards: [...document.querySelectorAll('#listRows .ins-fcard')].map((c) => c.dataset.f + ':' + [...c.querySelectorAll('.ins-btn[data-fx]')].map((b) => b.textContent).join('/')).join(), heads: [...document.querySelectorAll('#repAsks .ins-rlh span')].map((s) => s.textContent).join('|'), rows: [...document.querySelectorAll('#listRows .ins-rl:not(.ins-rlh)')].map((r) => r.querySelector('.nm b').textContent + '|' + r.querySelector('.nx').textContent + '|' + r.querySelector('.st').textContent).join(' / '), setups: document.querySelectorAll('#listRows [data-setup]').length, asks: document.querySelectorAll('#listRows [data-ask]').length, cards: [...document.querySelectorAll('#listRows .ins-dcard')].map((c) => c.dataset.d + (c.querySelector('.ins-pinned') ? '*' : '')).join(), cap: document.querySelector('#repCap').textContent, old: !!document.querySelector('#listSeg, #sugB') }));
339
+ ok('L1 Library: reports are made in Home, New report in Home hands off there, and Found in your work holds the finding as a card', /Reports are made in Home/.test(lb.note) && /^\/premium\.html\?ws=w1&ask=insights&q=Make%20a%20new%20report/.test(lb.nr) && lb.found === 'Found in your work · 1' && lb.fcards === 'f-1:Set it up/Not a report' && lb.cap === '9' && !lb.old, JSON.stringify(lb));
340
+ ok('L1 the reports table is Report, Next and Status; a draft says "Draft ready for" its date; a request says Proposal or Working', lb.heads === 'Report|Next|Status' && /Draft ready for Oct 14/.test(lb.rows) && /Partner update\|First draft [^|]+\|Runs every other monday/i.test(lb.rows) && /Churn for finance\|—\|Proposal/.test(lb.rows) && lb.setups === 1 && lb.asks === 2, JSON.stringify(lb.rows));
301
341
  ok('L1 dashboards are cards; only the pinned one carries the pin', lb.cards === 'all*,pd-1,p:Growth,p:Reliability', lb.cards);
302
- await q.click('#listSeg [data-f="dash"]'); const onlyD = await q.evaluate(() => ({ r: document.querySelectorAll('#listRows [data-rpt], #listRows [data-setup], #listRows [data-ask]').length, d: document.querySelectorAll('#listRows .ins-dcard').length })); await q.click('#listSeg [data-f="all"]');
303
- ok('L1 the Dashboards chip lists only the dashboards', onlyD.r === 0 && onlyD.d === 4, JSON.stringify(onlyD));
304
342
  const rs = []; await q.route('**/api/report-setups/*', (r) => { rs.push([new URL(r.request().url()).pathname.replace('/api/report-setups/', ''), JSON.parse(r.request().postData() || '{}')]); r.fulfill({ contentType: 'application/json', body: '{"ok":true,"drafted":{"slot":"2026-10-23","path":"planning/reports/x/2026-10-23.md"}}' }); });
305
343
  const lastRs = () => rs[rs.length - 1] || [null, {}];
306
- await q.click('#sugB'); const s1 = await until(() => vw(q));
307
- ok('L2 the suggestions open what PMOS found, with why and its evidence, marked as waiting for design', s1 && s1.wait === 'What PMOS found in your work' && /Release readiness/.test(s1.text) && /3 times in 6 weeks/.test(s1.text), JSON.stringify(s1));
308
- await q.click('#czViewer [data-f="f-1"] [data-fx="setup"]'); await until(() => rs.length > 0, 4000);
309
- ok('L2 Set it up posts that finding to the report-setups route', lastRs()[0] === 'setup' && lastRs()[1].finding === 'f-1' && lastRs()[1].ws === 'w1', JSON.stringify(rs));
344
+ await q.click('#listRows [data-f="f-1"] [data-fx="open"]'); const s1 = await until(() => vw(q));
345
+ ok('L2 a finding opens what PMOS found, with why, its evidence and the report it would set up, and no "Waiting for design"', s1 && !s1.wait && s1.title === 'Release readiness' && /3 times in 6 weeks/.test(s1.text) && /The report it would set up/.test(s1.text), JSON.stringify(s1));
310
346
  await vwClose(q);
347
+ await q.click('#listRows [data-f="f-1"] [data-fx="dismiss"]'); await sleep(150);
348
+ const nr = await q.evaluate(() => ({ gone: !document.querySelector('#listRows [data-f="f-1"]'), toast: document.querySelector('#toast').textContent }));
349
+ await q.click('#toast .cta'); await sleep(150);
350
+ ok('L2 Not a report takes the card off at once with Undo, posts nothing yet, and Undo brings it back (IsLibrary)', nr.gone && /^Not a report · Release readiness/.test(nr.toast) && /Undo/.test(nr.toast) && rs.length === 0 && await q.evaluate(() => !!document.querySelector('#listRows [data-f="f-1"]')), JSON.stringify([nr, rs]));
351
+ await q.click('#listRows [data-f="f-1"] [data-fx="setup"]'); await until(() => rs.length > 0, 4000);
352
+ ok('L2 Set it up posts that finding to the report-setups route', lastRs()[0] === 'setup' && lastRs()[1].finding === 'f-1' && lastRs()[1].ws === 'w1', JSON.stringify(rs));
311
353
  await q.click('#listRows [data-setup]'); const s2 = await until(() => vw(q));
312
- await q.click('#czViewer [data-act="pause"]'); await until(() => rs.length > 1, 4000);
313
- ok('L2 a report setup opens with its schedule and next draft, marked as waiting for design; Pause posts it', s2 && s2.wait === 'A report setup' && /Every other Monday at 09:00/.test(s2.text) && lastRs()[0] === 'pause' && lastRs()[1].id === 'partner-update', JSON.stringify([s2, rs]));
354
+ const sv = await q.evaluate(() => ({ tabs: [...document.querySelectorAll('#czViewer .ins-vtab')].map((t) => t.textContent).join(), sel: !!document.querySelector('#listRows .ins-rl.sel[data-setup]'), change: (document.querySelector('#czViewer a.ins-btn') || {}).getAttribute ? document.querySelector('#czViewer a.ins-btn').getAttribute('href') : '' }));
355
+ await q.click('#czViewer [data-sx="pause"]'); await until(() => rs.length > 1, 4000);
356
+ ok('L2 a report setup opens in the Viewer with Setup, Issues and Brief, its schedule and next draft; Pause posts it; Change the setup goes to Home', s2 && !s2.wait && /Every other Monday at 09:00/.test(s2.text) && /PMOS drafts it, you issue it/.test(s2.text) && sv.tabs === 'Setup,Issues,Brief' && sv.sel && /ask=insights&q=Change%20the%20setup%20of%20Partner%20update/.test(sv.change) && lastRs()[0] === 'pause' && lastRs()[1].id === 'partner-update', JSON.stringify([s2, sv, rs]));
357
+ await q.click('#czViewer [data-st="brief"]'); await sleep(80);
358
+ ok('L2 its Brief says what it is for and for whom', /What moved for partners this fortnight/.test(await txt('#czViewer .ins-gb', q)) && /Leadership/.test(await txt('#czViewer .ins-gb', q)));
314
359
  await vwClose(q);
315
360
  await q.click('#listRows [data-ask="a-1"]'); const s3 = await until(() => vw(q));
316
- await q.click('#czViewer [data-act="change"]'); const need = await txt('#czViewer [data-msg]', q);
361
+ await q.click('#czViewer [data-act="chg"]'); await q.click('#czViewer [data-act="change"]'); const need = await txt('#czViewer [data-msg]', q);
317
362
  await q.fill('#czViewer [data-chg]', 'quarterly'); await q.click('#czViewer [data-act="change"]'); await until(() => rs.length > 2, 4000);
318
- ok('L2 a request opens with what you asked and its proposal; Change it needs words, then posts the correction', s3 && s3.wait === 'A report request and its proposal' && /A monthly churn report for finance/.test(s3.text) && /Say what to change/.test(need) && lastRs()[0] === 'change' && lastRs()[1].id === 'a-1' && lastRs()[1].text === 'quarterly', JSON.stringify([s3, need, rs]));
319
- await vwClose(q);
320
- await q.click('#sugB'); await until(() => vw(q)); await q.click('#czViewer [data-askr]'); await sleep(150); /* re-pointed (insights fix): not on the Library bar; under the suggestions */ await q.fill('#czViewer [data-ask] textarea', 'A weekly risk note'); await q.click('#czViewer [data-ask] button[type="submit"]'); await until(() => rs.length > 3, 4000);
321
- ok('L2 Ask for a report posts the request; nothing is set up yet', lastRs()[0] === 'ask' && lastRs()[1].text === 'A weekly risk note' && await until(() => q.evaluate(() => { const v = document.querySelector('#czViewer'); return !v || v.hidden; }), 4000), JSON.stringify(rs));
363
+ ok('L2 a request from Home opens with what you asked and its proposal; Change it needs words, then posts the correction', s3 && !s3.wait && /A request from Home/.test(s3.text) && /A monthly churn report for finance/.test(s3.text) && /Set it up/.test(s3.text) && /Say what to change/.test(need) && lastRs()[0] === 'change' && lastRs()[1].id === 'a-1' && lastRs()[1].text === 'quarterly', JSON.stringify([s3, need, rs]));
322
364
  await vwClose(q);
323
- ok('L2 every Library press went to a report-setups route', R.posts.every((x) => /^POST \/api\/report-setups\/(setup|pause|change|ask)$/.test(x)), R.posts.join());
365
+ ok('L2 every Library press went to a report-setups route', R.posts.every((x) => /^POST \/api\/report-setups\/(setup|pause|change)$/.test(x)), R.posts.join());
324
366
  await q.click('#listRows [data-d="p:Reliability"]'); await sleep(150);
325
367
  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');
326
- await q.click('#tabLibrary'); await q.locator('#listRows [data-rpt]').first().click();
368
+ await q.click('#tabLibrary'); await q.locator('#listRows [data-rpt]').first().click(); // a report file with no setup opens straight in the reader
327
369
  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());
328
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"]')));
329
371
  await R.ctx.close();
330
372
  const lead = { 'planning/reports/biweekly/2026-10-14.md': 'Activation slipped to 28% this fortnight.' };
331
373
  const R2 = await open({ model: mk({ leads: lead }) });
332
374
  await R2.page.click('#tabLibrary'); const ln = await R2.page.evaluate(() => ({ dash: [...document.querySelectorAll('#listRows [data-d] .ins-mini small')].map((e) => e.textContent), rep: [...document.querySelectorAll('#listRows [data-rpt] .nm small')].map((e) => e.textContent), su: document.querySelector('#listRows [data-setup] .nm small').textContent }));
333
- ok('L5 each dashboard card draws its first goals, a report row quotes its file, a setup with no file says no draft is written yet', ln.dash[0] === 'Partner activation' && /^“Activation slipped to 28% this fortnight\.”/.test(ln.rep[0]) && /^No draft is written yet/.test(ln.su), JSON.stringify(ln));
375
+ ok('L5 each dashboard card draws its first goals, a report row quotes its file, a setup with no file says no draft is written yet', ln.dash[0] === 'Partner activation' && /“Activation slipped to 28% this fortnight\.”/.test(ln.rep[0]) && /No draft is written yet/.test(ln.su), JSON.stringify(ln));
334
376
  await R2.ctx.close();
335
377
  }
336
378
 
@@ -461,6 +503,41 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
461
503
  await ctx.close();
462
504
  }
463
505
 
506
+ /* M: Portfolio (IsMenus): with two products the picker counts each one's goals and rolls them up, grouped by product */
507
+ {
508
+ const two = [{ ws: 'w1', id: 'w1', name: 'pmos', goals: 5 }, { ws: 'w2', id: 'w2', name: 'Billing', goals: 1 }];
509
+ const other = IP.build(F.facts({ board: { ws: 'w2', id: 'w2', name: 'Billing' }, boards: two, outcomes: F.facts().outcomes.slice(0, 1).map((o) => Object.assign({}, o, { id: 'krm-inv', name: 'Invoices paid on time' })), initiatives: [], saved: [] }));
510
+ const R = await open({ model: mk({ boards: two }) }), q = R.page, asked = [];
511
+ await q.route('**/api/insights-premium?ws=w2*', (r) => { asked.push(r.request().url()); r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model: other }) }); });
512
+ await q.click('#prodPick'); const pm = await q.evaluate(() => ({ items: [...document.querySelectorAll('#prodMenu [data-board]')].map((b) => b.textContent).join(), pf: (document.querySelector('#prodMenu [data-portfolio]') || {}).textContent, note: (document.querySelector('#prodMenu .ins-mnote') || {}).textContent }));
513
+ ok('M1 the product picker counts each product\'s goals, then Portfolio rolls them up', pm.items === 'pmos5 goals,Billing1 goal' && pm.pf === 'Portfolio · all products' && /rolls goals up across products/.test(pm.note), JSON.stringify(pm));
514
+ await q.click('#prodMenu [data-portfolio]');
515
+ 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
+ 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
+ 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));
519
+ await vwClose(q);
520
+ await q.click('#prodPick'); await q.click('#prodMenu [data-board="w1"]'); await sleep(150);
521
+ ok('M1 picking the open product again leaves Portfolio', (await txt('#prodName', q)) === 'pmos' && (await q.evaluate(() => document.querySelectorAll('#goalTbl [data-goal]').length)) === 5);
522
+ await R.ctx.close();
523
+ }
524
+ /* P: the phone (IsPhone): the goal detail full screen with Readings, Moved by and Dashboards; a report setup as a sheet */
525
+ {
526
+ const R = await open({ w: 390, h: 844 }), q = R.page;
527
+ 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);
532
+ await vwClose(q);
533
+ await q.click('#tabLibrary'); await q.click('#listRows [data-setup]');
534
+ 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);
535
+ ok('P1 on a phone a report setup opens as a sheet: Draft it now, Pause, Change the setup in Home', !!sh && sh.title === 'Partner update' && sh.btns === 'Draft it now,Pause,Change the setup in Home' && !sh.viewer && sh.bottom === 0, JSON.stringify(sh));
536
+ await q.keyboard.press('Escape');
537
+ ok('P1 Escape closes the sheet', await q.evaluate(() => !document.querySelector('#repSheet, #repScrim')));
538
+ await R.ctx.close();
539
+ }
540
+
464
541
  /* I11 fidelity to the Agreed design (AgInsGoals, AgInsPhone): Nunito, the cozy panel, the pill tabs, the table, the strip and the six tiles */
465
542
  for (const [w, h] of [[1440, 900], [390, 844]]) {
466
543
  const R = await open({ w, h }); await sleep(300);
@@ -68,8 +68,8 @@ const ready = (model) => ({ status: 200, body: { ok: true, state: 'ready', model
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, tag: (document.querySelector('#peek .bd-wtag') || {}).textContent, cap: document.querySelector('#metW .bd-amut').textContent, ins: (document.querySelector('#metW a[href^="/premium-insights.html"]') || {}).textContent, dlg: !!document.querySelector('#dlg.on') }));
72
- ok('C1 it is a plain panel tagged "Waiting for design", says which repository it counts and links to Insights; no old dialog', place.t === 'Metrics' && place.tag === 'Waiting for design' && /^counted from idpf/.test(place.cap) && /Targets and longer ranges are on Insights/.test(place.ins || '') && !place.dlg, JSON.stringify(place));
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') }));
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 */
75
75
  const t0 = shown;
@@ -150,8 +150,10 @@ const ready = (model) => ({ status: 200, body: { ok: true, state: 'ready', model
150
150
  await q.goto(BASE + '/premium-insights.html');
151
151
  const v = await until(async () => { const x = await q.evaluate(() => Object.fromEntries([...document.querySelectorAll('#bmBody [data-tile]')].map((e) => [e.dataset.tile, e.querySelector('.v').textContent]))); return x.corrections && x.corrections !== 'Reading' ? x : null; }, 20000);
152
152
  ok('C10 Insights\' Delivery trends show the Board\'s measures with the same values', !!v && v.corrections === '10.0' && v.merges === '3' && v.idle === '1', JSON.stringify(v));
153
- await q.click('#bmBody [data-tile="merges"]'); await until(() => q.evaluate(() => !!document.querySelector('#czViewer [data-tgf]')));
154
- await q.fill('#czViewer [data-tgf] [name="tg"]', '5'); await q.click('#czViewer [data-tgf] button[type="submit"]');
153
+ // premium-uncovered-features (IsTarget): a tile opens the target popover under it, and the number goes to the Board's target route.
154
+ await q.route('**/api/insights-records/tile', (r) => r.fulfill({ contentType: 'application/json', body: '{"ok":true,"tiles":{}}' }));
155
+ await q.click('#bmBody [data-tile="merges"]'); await until(() => q.evaluate(() => !!document.querySelector('#tgPop #tgV')));
156
+ await q.fill('#tgV', '5'); await q.click('#tgSet');
155
157
  ok('C10 a target saved on Insights goes to the Board\'s target route, for this board', await until(() => saves.length === 1) && saves[0].key === 'merges' && saves[0].target === 5, JSON.stringify(saves));
156
158
  ok('C10 no page error', errs.length === 0, errs.join(' | '));
157
159
  await ctx.close();
@@ -83,7 +83,7 @@ const product = (name, cond) => {
83
83
  const page = await ctx.newPage(); const errors = [];
84
84
  page.on('pageerror', (e) => errors.push(String(e.message || e)));
85
85
  await page.goto(BASE + '/premium.html' + q, { waitUntil: 'domcontentloaded' });
86
- await page.waitForSelector('#hmList .hm-g', { state: 'attached', timeout: 30000 });
86
+ await page.waitForSelector('#hmList .hm-pg', { state: 'attached', timeout: 30000 }); // a group of the one list (premium-uncovered-features)
87
87
  return { ctx, page, errors };
88
88
  };
89
89
  // the picker: the place menu's More, then Products; the card opens in the Viewer and reads the products
@@ -95,13 +95,16 @@ const product = (name, cond) => {
95
95
  }
96
96
  };
97
97
  const pickText = (page) => page.textContent('#czViewer #hxCount');
98
- const rowsOf = (page) => page.$$eval('#hmList .hm-r[data-id^="n:decision:"]', (els) => els.map((e) => ({ key: e.dataset.id.slice(2), tag: ((e.querySelector('.hm-rt em') || {}).textContent || '').split(' · ')[0], title: e.querySelector('.hm-rt b').textContent })));
98
+ // premium-uncovered-features (canvas HmProducts): another product is a closed group of the one list ("IDPF · 1 your turn"); open it to see its rows
99
+ const openGroups = (page) => page.evaluate(() => { document.querySelectorAll('#hmList [data-hm-pg][aria-expanded="false"]').forEach((b) => b.click()); });
100
+ const rowsOf = async (page) => { await openGroups(page).catch(() => {}); return rowsOf0(page); };
101
+ const rowsOf0 = (page) => page.$$eval('#hmList .hm-r[data-id^="n:decision:"]', (els) => els.map((e) => ({ key: e.dataset.id.slice(2), tag: (e.closest('section.hm-pg') || e).getAttribute('aria-label') || '', title: e.querySelector('.hm-rt b').textContent })));
99
102
 
100
103
  {
101
104
  const { ctx, page, errors } = await open();
102
105
  await until(async () => (await rowsOf(page)).length === 2, 20000);
103
106
  const rows = await rowsOf(page);
104
- ok('P6 each row carries its product', rows.length === 2 && rows.map((r) => r.tag).sort().join() === 'IDPF,microsites', JSON.stringify(rows));
107
+ ok('P6 each row sits in its product\'s group', rows.length === 2 && rows.map((r) => r.tag).sort().join() === 'IDPF,microsites', JSON.stringify(rows));
105
108
  await pick(page);
106
109
  const snap = await until(async () => { const t = await page.textContent('#czViewer #hxSnap').catch(() => ''); return t || null; }, 10000) || '';
107
110
  ok('P1 the Products card names what is read and what is not', /IDPF and microsites/.test(snap) && /not included/.test(snap) && /\b[Pp][Mm][Oo][Ss]\b|pmos/i.test(snap), snap);
@@ -140,10 +143,10 @@ const product = (name, cond) => {
140
143
  await until(async () => (await rowsOf(page)).length === 2, 20000);
141
144
  const key = (await rowsOf(page)).find((r) => r.tag === 'IDPF').key;
142
145
  await page.click(`#hmList [data-hm-sel="n:${key}"]`);
143
- await page.waitForSelector('#czViewer [data-hv-opt]');
144
- await page.click('#czViewer [data-hv-opt="extend"]');
145
- await page.fill('#hvWhy', 'IDPF moves the date.');
146
- await page.click('#czViewer [data-hv-rec]');
146
+ await page.waitForSelector('#hmLog [data-dc-opt]'); // the decision card in the chat (canvas HmDecide)
147
+ await page.click('#hmLog [data-dc-opt="extend"]');
148
+ await page.fill('#dcWhy', 'IDPF moves the date.');
149
+ await page.click('#hmLog [data-dc-rec]');
147
150
  ok('P9 the press is recorded and the IDPF row leaves, the microsites row stays', await until(async () => { const r = await rowsOf(page); return r.length === 1 && r[0].tag === 'microsites' ? 1 : 0; }, 20000), JSON.stringify(await rowsOf(page)));
148
151
  const dA = fs.readFileSync(path.join(rootA, 'pm-decisions.md'), 'utf8'), dB = fs.readFileSync(path.join(rootB, 'pm-decisions.md'), 'utf8');
149
152
  ok('P9 the decision is in IDPF\'s journal and not in the other product\'s or the home one\'s', /KC9/.test(dA) && /IDPF moves the date/.test(dA) && !/KC9/.test(dB) && !/IDPF moves the date/.test(fs.readFileSync(path.join(home.root, 'pm-decisions.md'), 'utf8')));
@@ -5,7 +5,8 @@
5
5
  * S1/S8 no brief for today: the header says so S2/S5 the rows, each tagged Across products (the brief names no included initiative)
6
6
  * S3 the dialog opens an https link and records nothing S7 the digests in Today S9 the writes refuse a source key; the agent answers
7
7
  * S11 the source row and the digest are drawn in the Agreed design's tokens at 1280 and 390 px, light and dark; no sideways scroll
8
- * (re-pointed by premium-agreed-design: rows are Home's Needs-you rows, the digests and the read lines are in Home's minimal More cards)
8
+ * (re-pointed by premium-agreed-design: rows are Home's Needs-you rows; by premium-uncovered-features: the digests are in New for you and
9
+ * the read lines in Sources, both opened from the place menu)
9
10
  * Every wait polls the page; no fixed sleep stands in for a state. */
10
11
  const fs = require('fs');
11
12
  const os = require('os');
@@ -17,13 +18,13 @@ const T = require('./test-run').configure({ name: 'briefing-premium-sources' });
17
18
  const BASE = T.BASE;
18
19
  const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
19
20
  /* premium-agreed-design: the Briefing's ranked list, its dialog, its Today timeline and its cards are gone. A source row is a Needs-you row on
20
- * Home (its hint leads with the product, then the source and sender, then the prepared line) and opens in the Viewer. Today's digests are in
21
- * Home's minimal Around you card, and the read lines and the background line are in its minimal Sources card; both open from the place
22
- * menu's More and carry "Waiting for design". */
21
+ * Home (its hint leads with the product, then the source and sender, then the prepared line) and opens in the Viewer.
22
+ * premium-uncovered-features: Around you is gone. Today's digests are in New for you, and the read lines and the background line are in
23
+ * Sources; both open from the place menu (cozy-nav.js). */
24
+ const PLACE_ITEM = { 'Around you': '[data-cz-news]', 'New for you': '[data-cz-news]', Sources: '[data-cz-sources]' };
23
25
  const moreItem = async (pg, label, sel) => {
24
26
  if (await pg.isVisible('#czViewer')) { await pg.keyboard.press('Escape'); }
25
- await pg.click('#czFab'); await pg.click('[data-cz-more]');
26
- await pg.click(`#hmMenu [role="menuitem"]:has-text("${label}")`);
27
+ await pg.click('#czFab'); await pg.click('#czMenu ' + PLACE_ITEM[label]);
27
28
  await pg.waitForSelector('#czViewer ' + sel, { timeout: 15000 });
28
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 || '' })));
@@ -108,8 +109,10 @@ const sh = (cwd, args) => spawnSync('git', args, { cwd, encoding: 'utf8' });
108
109
  const rows = await srcRowsOf(page);
109
110
  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]));
110
111
  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]));
111
- const needN = await page.textContent('#hmNeedsN'), allRows = await page.$$eval('#hmList .hm-g[aria-label="Needs you"] .hm-r', (els) => els.length);
112
- ok('S6 Home counts the rows: the four source rows are among the Needs-you rows, and the count names them all', rows.length === 4 && new RegExp('^' + allRows + ' needs? you$').test(needN.trim()), needN + ' / ' + allRows);
112
+ // premium-uncovered-features (canvas HmMyWork): no Needs you group; the greeting counts the next steps that are yours, the source rows among them
113
+ const needN = await page.textContent('#hmList .hm-tc .big'), allRows = await page.$$eval('#hmList .hm-r[data-id^="n:"]', (els) => els.length);
114
+ const gn = /(\d+) next steps? (?:is|are) yours/.exec(needN || '');
115
+ 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);
113
116
  await page.click(`#hmList [data-hm-sel="n:${rows[0].key}"]`);
114
117
  await page.waitForSelector('#czViewer #srcLink');
115
118
  const link = await page.$eval('#czViewer #srcLink', (a) => ({ href: a.href, target: a.target, rel: a.rel, h: Math.round(a.getBoundingClientRect().height) }));
@@ -118,9 +121,9 @@ const sh = (cwd, args) => spawnSync('git', args, { cwd, encoding: 'utf8' });
118
121
  ok('S3 the card offers nothing that records or sends', (await page.$('#czViewer [data-hv-rec]')) === null && (await page.$('#czViewer [data-hv-later], #czViewer [data-hv-until]')) === null && (await page.$('#czViewer [data-hv-opt]')) === null);
119
122
  ok('S11 the link is at least 44 px high', link.h >= 44, String(link.h));
120
123
  await page.keyboard.press('Escape');
121
- await moreItem(page, 'Around you', '#aroundDig');
122
- const dig = await page.$eval('#czViewer #aroundDig', (e) => ({ h: e.querySelector('h4').textContent, t: e.textContent, href: (e.querySelector('a.srcLink') || {}).href || '' }));
123
- ok('S7 Around you lists Digests with their count', dig.h === 'Digests 1', dig.h);
124
+ await moreItem(page, 'New for you', '#aroundDig');
125
+ const dig = await page.$eval('#czViewer #aroundDig', (e) => ({ h: e.querySelector('.ev-lbl').textContent, t: e.textContent, href: (e.querySelector('a.srcLink') || {}).href || '' }));
126
+ ok('S7 New for you lists Digests with their count', dig.h === 'Digests 1', dig.h);
124
127
  ok('S7 the digest holds its lines and its link', /Decision: Ship on Friday/.test(dig.t) && /Open: Who owns QA/.test(dig.t) && dig.href === 'https://slack.example/c/1', JSON.stringify(dig).slice(0, 300));
125
128
  ok('no page error', errors.length === 0, errors.join(' | '));
126
129
  await ctx.close();
@@ -142,9 +145,9 @@ const sh = (cwd, args) => spawnSync('git', args, { cwd, encoding: 'utf8' });
142
145
  ok('H5 Sources names the read Today shows, and the initiatives, My work and the brief that Needs you shows', /^Calendar (read|not read yet|failed)/.test(rd.cal) && /Initiatives/.test(rd.moves) && /My work/.test(rd.moves) && /Brief (built|not built yet|off)/.test(rd.moves), JSON.stringify(rd));
143
146
  if (shot) await page.screenshot({ path: path.join(shot, 'cards-reads-light.png'), fullPage: true });
144
147
  }
145
- const line = await page.$eval('#czViewer #srcHealth', (e) => ({ text: e.textContent.trim(), dot: (e.querySelector('.sdot') || {}).className || '', w: Math.round(e.getBoundingClientRect().width), sw: document.documentElement.scrollWidth }));
148
+ const line = await page.$eval('#czViewer #srcHealth', (e) => ({ text: e.textContent.trim(), dot: (e.querySelector('.ev-dot') || {}).className || '', w: Math.round(e.getBoundingClientRect().width), sw: document.documentElement.scrollWidth }));
146
149
  if (theme === 'light') {
147
- ok('H2 Sources opens with the background line on top, in the level\'s colour', line.text.startsWith(h.line.slice(0, 20)) && line.dot === 'sdot ' + (h.level === 'ok' ? 'ok' : h.level), JSON.stringify(line));
150
+ ok('H2 Sources opens with the background line on top, in the level\'s colour', line.text.startsWith(h.line.slice(0, 20)) && line.dot === 'ev-dot ' + (h.level === 'ok' ? 'ok' : 'risk'), JSON.stringify(line));
148
151
  ok('H3 no Sources chip and no dot are drawn on the page; the line above carries the level (premium-agreed-design)', dot === 'none', dot);
149
152
  } else ok('H4 on a phone the line fits: no sideways scroll', line.sw <= 390 && line.w > 0, JSON.stringify(line));
150
153
  if (shot) { await sleep(1200); await page.screenshot({ path: path.join(shot, 'sources-health-' + theme + '.png') }); }
@@ -171,18 +174,18 @@ const sh = (cwd, args) => spawnSync('git', args, { cwd, encoding: 'utf8' });
171
174
  * (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
172
175
  * nothing scrolls sideways. A source row that drifted off the design's tokens fails here as it failed against the mockup. */
173
176
  {
174
- // 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 line of Around you
177
+ // 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
175
178
  const ROWS = [['row', '.hm-rm'], ['number', '.hm-dot'], ['title', '.hm-rt b'], ['subject', '.hm-rt em']];
176
- const DIGS = [['event', ''], ['eventTime', '.bd-why'], ['eventTitle', '.bd-t']];
179
+ const DIGS = [['event', ''], ['eventTime', '.ev-tx .ev-mut'], ['eventTitle', '.ev-tx b']];
177
180
  const SANS = 'var(--cz-sans)';
178
181
  /* The design's values, as the tokens name them (a value that starts var( is resolved in the page; anything else is literal) */
179
182
  const WANT = {
180
183
  row: { fontFamily: SANS, color: 'var(--cz-ink)', backgroundColor: 'transparent' },
181
184
  number: { backgroundColor: 'var(--cz-blue)', borderRadius: '50%', width: '7px', height: '7px' }, // the row's dot is blue: it waits on you
182
185
  title: { fontFamily: SANS, fontSize: '14px', fontWeight: '700', color: 'var(--cz-ink)' },
183
- subject: { fontFamily: SANS, fontSize: '12px', color: 'var(--cz-blueink)' },
184
- event: { fontFamily: SANS, color: 'var(--cz-ink)', backgroundColor: 'var(--cz-card)', borderTopColor: 'var(--cz-hair)' },
185
- eventTime: { fontSize: '12.5px', color: 'var(--cz-ink2)' },
186
+ subject: { fontFamily: SANS, fontSize: '12.5px', color: 'var(--cz-blueink)' }, // the canvas's row line (.lrow .s, premium-uncovered-features)
187
+ event: { fontFamily: SANS, color: 'var(--cz-ink)', backgroundColor: 'transparent' }, // a row of New for you's table (cozy-ev.css)
188
+ eventTime: { fontSize: '12.5px', color: 'var(--cz-ink3)' },
186
189
  eventTitle: { fontFamily: SANS, fontSize: '13.5px', fontWeight: '700', color: 'var(--cz-ink)' },
187
190
  };
188
191
  const grab = (pg, pairs, base, col) => pg.evaluate(([pairs, want, base, col]) => {
@@ -210,15 +213,15 @@ const sh = (cwd, args) => spawnSync('git', args, { cwd, encoding: 'utf8' });
210
213
  };
211
214
  for (const [w, h] of [[1280, 900], [390, 844]]) for (const th of ['light', 'dark']) {
212
215
  const R = await open({ w, h, theme: th });
213
- if (w === 390) await R.page.click('#hmNeeds'); // on a phone the list is the "N need you" sheet
216
+ // on a phone the list is the page (canvas HmPhone)
214
217
  await allNeeds(R.page);
215
218
  await sleep(500);
216
219
  const rowSel = '#hmList .hm-r[data-id^="n:src:"]';
217
- const diffs = diff(await grab(R.page, ROWS, rowSel, '.hm-g'), ROWS, 4); // the row fills its group (the group's own inset aside)
220
+ const diffs = diff(await grab(R.page, ROWS, rowSel, '.hm-pg'), ROWS, 4); // the row fills its group (the group's own inset aside)
218
221
  if (w === 390) await R.page.keyboard.press('Escape');
219
- await moreItem(R.page, 'Around you', '#aroundDig');
222
+ await moreItem(R.page, 'New for you', '#aroundDig');
220
223
  await sleep(300);
221
- diffs.push(...diff(await grab(R.page, DIGS, '#czViewer .ar-dig', '#aroundDig'), DIGS, 2));
224
+ diffs.push(...diff(await grab(R.page, DIGS, '#czViewer #aroundDig .ev-trow', '#aroundDig'), DIGS, 2));
222
225
  ok(`S11 the source row and the digest look like the Agreed design's at ${w} px, ${th}`, diffs.length === 0, diffs.join(' ; '));
223
226
  const ov = await R.page.evaluate(() => document.documentElement.scrollWidth - innerWidth);
224
227
  ok(`S11 no sideways scroll at ${w} px, ${th}`, ov <= 0, String(ov));