create-pmos 0.396.0 → 0.398.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. package/package.json +25 -25
  2. package/payload/KIT-VERSION +2 -2
  3. package/payload/planning/evals/eval-calibration.md +1 -1
  4. package/payload/planning/okrs/health-budgets.md +1 -1
  5. package/payload/scripts/nine-stages.js +49 -20
  6. package/payload/state/discoveries.md +1 -1
  7. package/payload/state/log.md +1 -1
  8. package/workspace/briefing-premium-adddoc-test.js +103 -74
  9. package/workspace/briefing-premium-board-test.js +316 -154
  10. package/workspace/briefing-premium-calendar-2-test.js +135 -195
  11. package/workspace/briefing-premium-calendar-3-test.js +143 -413
  12. package/workspace/briefing-premium-calendar-test.js +86 -185
  13. package/workspace/briefing-premium-doc-edit-test.js +95 -83
  14. package/workspace/briefing-premium-initiative-test.js +166 -294
  15. package/workspace/briefing-premium-insights-test.js +351 -214
  16. package/workspace/briefing-premium-metrics-test.js +53 -118
  17. package/workspace/briefing-premium-products-test.js +40 -27
  18. package/workspace/briefing-premium-sources-test.js +91 -52
  19. package/workspace/briefing-premium-test.js +150 -633
  20. package/workspace/briefing-premium-work-test.js +88 -269
  21. package/workspace/changelog.json +24 -0
  22. package/workspace/fixtures/board-premium-facts.js +2 -1
  23. package/workspace/fixtures/board-premium-jira.js +28 -0
  24. package/workspace/fixtures/board-premium-trail.js +32 -0
  25. package/workspace/fixtures/initiative-premium-facts.js +2 -1
  26. package/workspace/fixtures/initiatives-api/list.json +30 -42
  27. package/workspace/fixtures/initiatives-api/roadmap.json +40 -56
  28. package/workspace/fixtures/initiatives-api/sheet.json +10 -14
  29. package/workspace/fixtures/insights-premium-facts.js +11 -2
  30. package/workspace/fixtures/premium-viewer-fixtures.js +182 -0
  31. package/workspace/guide/briefing-premium.md +3 -1
  32. package/workspace/guide/home.md +47 -0
  33. package/workspace/guide/index.md +2 -0
  34. package/workspace/guide/lifecycle.md +51 -0
  35. package/workspace/home-shot.js +38 -0
  36. package/workspace/lib/agent-roles.js +71 -0
  37. package/workspace/lib/board-premium.js +160 -3
  38. package/workspace/lib/board-trail.js +223 -0
  39. package/workspace/lib/engine/boards.js +15 -14
  40. package/workspace/lib/engine/nine-stages.js +49 -20
  41. package/workspace/lib/engine/signals/detectors.js +13 -11
  42. package/workspace/lib/home-work-item.js +58 -0
  43. package/workspace/lib/insights-goals.js +196 -0
  44. package/workspace/lib/insights-premium.js +126 -1
  45. package/workspace/lib/insights-records.js +101 -0
  46. package/workspace/lib/jira-tickets.js +1 -1
  47. package/workspace/lib/route-modules.js +4 -0
  48. package/workspace/lib/routes-board-premium.js +3 -2
  49. package/workspace/lib/routes-board-trail.js +33 -0
  50. package/workspace/lib/routes-home-desk.js +176 -0
  51. package/workspace/lib/routes-initiatives.js +1 -1
  52. package/workspace/lib/routes-insights-premium.js +19 -3
  53. package/workspace/lib/routes-insights-records.js +129 -0
  54. package/workspace/lib/routes-notes.js +1 -0
  55. package/workspace/lib/routes-viewer.js +108 -0
  56. package/workspace/lib/transcript-steps.js +123 -0
  57. package/workspace/lib/vendor/scripts/nine-stages.js +49 -20
  58. package/workspace/lib/viewer-meeting.js +205 -0
  59. package/workspace/lib/viewer-report.js +89 -0
  60. package/workspace/package-lock.json +2 -2
  61. package/workspace/package.json +1 -1
  62. package/workspace/premium-agreed-viewer-shots.js +76 -0
  63. package/workspace/premium-board-actions-test.js +85 -73
  64. package/workspace/premium-briefing-depth-test.js +66 -53
  65. package/workspace/premium-chat-attach-test.js +54 -63
  66. package/workspace/premium-chat-chart-tab-test.js +35 -36
  67. package/workspace/premium-chat-context-test.js +22 -19
  68. package/workspace/premium-chat-goal-view-test.js +28 -26
  69. package/workspace/premium-chat-notes-test.js +29 -33
  70. package/workspace/premium-chat-report-tab-test.js +35 -25
  71. package/workspace/premium-chat-term-test.js +16 -14
  72. package/workspace/premium-chat-viewer-test.js +60 -53
  73. package/workspace/premium-core-doc-issue-test.js +50 -41
  74. package/workspace/premium-html-viewer-test.js +17 -18
  75. package/workspace/premium-phone-card-test.js +8 -2
  76. package/workspace/premium-phone-room-test.js +42 -31
  77. package/workspace/premium-report-read-test.js +115 -197
  78. package/workspace/premium-viewer-download-test.js +19 -22
  79. package/workspace/premium-viewer-flicker-test.js +11 -16
  80. package/workspace/premium-viewer-share-test.js +6 -9
  81. package/workspace/premium-viewer-test.js +41 -60
  82. package/workspace/premium-vw-backlog-test.js +53 -31
  83. package/workspace/premium-vw-cal-test.js +82 -123
  84. package/workspace/premium-vw-copy-test.js +17 -33
  85. package/workspace/premium-vw-doc-test.js +12 -11
  86. package/workspace/premium-vw-item-test.js +50 -48
  87. package/workspace/premium-vw-jira-test.js +55 -26
  88. package/workspace/premium-vw-meet-test.js +118 -187
  89. package/workspace/premium-vw-notes-test.js +85 -107
  90. package/workspace/premium-vw-rec-test.js +72 -193
  91. package/workspace/premium-vw-slides-test.js +46 -50
  92. package/workspace/premium-welcome-test.js +3 -2
  93. package/workspace/premium-work-depth-test.js +63 -51
  94. package/workspace/public/pm/bd-acts.js +305 -0
  95. package/workspace/public/pm/bd-span.js +224 -0
  96. package/workspace/public/pm/bd-stages.js +47 -0
  97. package/workspace/public/pm/c3-doc-sheet.js +1 -1
  98. package/workspace/public/pm/c3-md.js +3 -395
  99. package/workspace/public/pm/c3-phone-detail.js +1 -1
  100. package/workspace/public/pm/c3-phone-model.js +3 -68
  101. package/workspace/public/pm/chat-term.js +3 -3
  102. package/workspace/public/pm/cozy-board.css +640 -0
  103. package/workspace/public/pm/cozy-home.css +580 -0
  104. package/workspace/public/pm/cozy-home.js +172 -0
  105. package/workspace/public/pm/cozy-initiative.css +138 -0
  106. package/workspace/public/pm/cozy-insights.css +421 -0
  107. package/workspace/public/pm/cozy-md.js +396 -0
  108. package/workspace/public/pm/cozy-nav.js +65 -0
  109. package/workspace/public/pm/cozy-placeholder.js +26 -0
  110. package/workspace/public/pm/cozy-viewer.css +143 -0
  111. package/workspace/public/pm/cozy-viewer.js +144 -0
  112. package/workspace/public/pm/cozy-vw.css +485 -0
  113. package/workspace/public/pm/cozy.css +254 -0
  114. package/workspace/public/pm/home-adddoc.js +48 -0
  115. package/workspace/public/pm/home-app.js +905 -0
  116. package/workspace/public/pm/home-around.js +515 -0
  117. package/workspace/public/pm/home-chat.js +459 -0
  118. package/workspace/public/pm/home-data.js +312 -0
  119. package/workspace/public/pm/home-draft.js +68 -0
  120. package/workspace/public/pm/home-more.js +249 -0
  121. package/workspace/public/pm/home-phone-card.js +109 -0
  122. package/workspace/public/pm/home-work.js +519 -0
  123. package/workspace/public/pm/lifecycle-lens-model.js +45 -27
  124. package/workspace/public/pm/lifecycle-lens.js +22 -11
  125. package/workspace/public/pm/phone-moment.js +69 -0
  126. package/workspace/public/pm/pm-work-view.js +1 -1
  127. package/workspace/public/pm/premium-attach.js +4 -0
  128. package/workspace/public/pm/premium-board.js +544 -253
  129. package/workspace/public/pm/premium-brief.js +1 -1
  130. package/workspace/public/pm/premium-chart-tab.js +110 -62
  131. package/workspace/public/pm/premium-chat.js +17 -10
  132. package/workspace/public/pm/premium-deck.js +3 -3
  133. package/workspace/public/pm/premium-first.js +25 -21
  134. package/workspace/public/pm/premium-initiative-head.js +138 -0
  135. package/workspace/public/pm/premium-initiative.js +28 -4
  136. package/workspace/public/pm/premium-insights.js +950 -440
  137. package/workspace/public/pm/premium-meeting.js +61 -549
  138. package/workspace/public/pm/premium-notes.js +1 -1
  139. package/workspace/public/pm/premium-report-frame.css +20 -0
  140. package/workspace/public/pm/premium-report-read.js +509 -480
  141. package/workspace/public/pm/premium-report-tab.js +87 -63
  142. package/workspace/public/pm/premium-shell.js +107 -124
  143. package/workspace/public/pm/premium-viewer.js +27 -1
  144. package/workspace/public/pm/premium-vw-cal.js +187 -48
  145. package/workspace/public/pm/premium-vw-doc.css +6 -0
  146. package/workspace/public/pm/premium-vw-doc.js +40 -2
  147. package/workspace/public/pm/premium-vw-file.js +2 -2
  148. package/workspace/public/pm/premium-vw-jira-model.js +22 -5
  149. package/workspace/public/pm/premium-vw-jira.css +11 -0
  150. package/workspace/public/pm/premium-vw-jira.js +11 -4
  151. package/workspace/public/pm/premium-vw-meet.js +6 -83
  152. package/workspace/public/pm/premium-vw-mtg.js +731 -0
  153. package/workspace/public/pm/premium-vw-notes.js +56 -69
  154. package/workspace/public/pm/premium-vw-open.js +35 -0
  155. package/workspace/public/pm/premium-vw-page.js +16 -0
  156. package/workspace/public/pm/premium-vw-rec.js +11 -215
  157. package/workspace/public/pm/premium-vw-slides.css +5 -0
  158. package/workspace/public/pm/premium-vw-slides.js +44 -8
  159. package/workspace/public/pm/term-view.js +22 -0
  160. package/workspace/public/premium-board.html +57 -64
  161. package/workspace/public/premium-chat.html +7 -33
  162. package/workspace/public/premium-initiative.html +8 -41
  163. package/workspace/public/premium-insights.html +63 -62
  164. package/workspace/public/premium-viewer.html +20 -0
  165. package/workspace/public/premium-work.html +6 -72
  166. package/workspace/public/premium.html +21 -66
  167. package/workspace/public/vendor/nunito-var.woff2 +0 -0
  168. package/workspace/server.js +25 -3
  169. package/workspace/test-files.json +1 -0
  170. package/workspace/test-lists/home-libs.json +9 -0
  171. package/workspace/test-lists/premium-agreed-viewer.json +9 -0
  172. package/workspace/test-lists/premium-report-read.json +1 -1
  173. package/workspace/test-lists/premium-vw-agreed.json +9 -0
  174. package/workspace/test-lists/premium-vw-notes.json +1 -1
  175. package/workspace/third-party/README.md +1 -0
  176. package/workspace/public/pm/premium-work.js +0 -719
  177. package/workspace/public/pm/premium.js +0 -1133
@@ -61,38 +61,33 @@ const SHOTS = process.env.PMOS_SHOTS || '';
61
61
  await page.route('**/api/sessions', json({ sessions: [{ id: 's-flicker', origin: 'chat:k-flicker', name: 'Funnel report', shown: 'running', state: 'running' }] }));
62
62
  await page.route('**/api/doc/locate*', json({ ok: true, ws: 'w0', rel: HTMLF, abs: '/Users/pm/pmos/' + HTMLF, name: '2026-10-19.html', mtime: 1, size: REPORT.length }));
63
63
  await page.route('**/api/doc?*', (r) => r.fulfill({ status: 200, contentType: 'text/plain', headers: { 'X-Doc-Kind': 'html' }, body: REPORT }));
64
- await page.goto(BASE + '/premium.html?theme=' + theme);
65
- await until(() => page.evaluate(() => !!document.querySelector('#dlg')), 15000);
66
- await page.evaluate(async () => {
67
- const S = await import('/pm/premium-shell.js');
68
- S.openDlg({ eye: 'Your item', title: 'Funnel report', say: 'Ask about the report.', noteKey: 'k-flicker', pane: '<article class="paper doc"><p>Item record</p></article>', label: 'Item record' });
69
- S.loadThread('k-flicker');
70
- });
71
- const fp = await until(() => page.$('#dBody .stream button.fpath[data-file]'), 8000);
64
+ // premium-agreed-design: the session's conversation is Home's chat (?session= names it) and the file it names opens in the Viewer card
65
+ await page.goto(BASE + '/premium.html?session=s-flicker&theme=' + theme);
66
+ const fp = await until(() => page.$('#hmLog button.fpath[data-file]'), 15000);
72
67
  if (fp) await fp.evaluate((b) => b.click()); // on a phone the dialog opens on the Detail side, so the press goes through the button's own handler
73
68
  return { ctx, page, errors, conv };
74
69
  };
75
70
 
76
71
  {
77
72
  const { page, errors, conv, ctx } = await open();
78
- const fr = await until(() => page.$('#dOut .obody.vw iframe.vwframe'), 8000);
73
+ const fr = await until(() => page.$('#czViewer .obody.vw iframe.vwframe'), 8000);
79
74
  ok('the chat names the report and the press opens it in the viewer as a frame', !!fr);
80
75
  await sleep(1500); // the first draw's entrance has played
81
76
  await page.evaluate(() => {
82
- window.__rise = 0; window.__loads = 0; window.__frame = document.querySelector('#dOut .obody.vw iframe.vwframe');
83
- window.__turns = [...document.querySelectorAll('#dBody .stream .turn')];
84
- document.querySelector('#dBody').addEventListener('animationstart', (e) => { if (e.animationName === 'rise') window.__rise++; });
77
+ window.__rise = 0; window.__loads = 0; window.__frame = document.querySelector('#czViewer .obody.vw iframe.vwframe');
78
+ window.__turns = [...document.querySelectorAll('#hmLog .hm-u, #hmLog .hm-a')];
79
+ document.querySelector('#hmLog').addEventListener('animationstart', () => { window.__rise++; }); // any entrance a turn plays again
85
80
  if (window.__frame) window.__frame.addEventListener('load', () => { window.__loads++; });
86
81
  });
87
82
  await sleep(7000); // three conversation reads and two list reads
88
- const st = await page.evaluate(() => ({ rise: window.__rise, turns: window.__turns.length, same: window.__turns.every((t) => t.isConnected), frame: window.__frame === document.querySelector('#dOut .obody.vw iframe.vwframe'), loads: window.__loads }));
83
+ const st = await page.evaluate(() => ({ rise: window.__rise, turns: window.__turns.length, same: window.__turns.every((t) => t.isConnected), frame: window.__frame === document.querySelector('#czViewer .obody.vw iframe.vwframe'), loads: window.__loads }));
89
84
  ok('F1 while nothing changes, the turns stay the same nodes over several reads', st.turns >= 2 && st.same, JSON.stringify(st));
90
85
  ok('F1 no turn replays its entrance while nothing changes', st.rise === 0, JSON.stringify(st));
91
86
  ok('F2 the viewer keeps the same frame and never reloads it', st.frame && st.loads === 0, JSON.stringify(st));
92
87
  conv.messages.push({ role: 'user', text: 'Add the weekly view.' }, { role: 'assistant', text: 'Added the weekly view.' });
93
- const got = await until(() => page.evaluate(() => /Added the weekly view/.test(document.querySelector('#dBody .stream').textContent)), 6000);
88
+ const got = await until(() => page.evaluate(() => /Added the weekly view/.test(document.querySelector('#hmLog').textContent)), 6000);
94
89
  await sleep(800);
95
- const st2 = await page.evaluate(() => ({ rise: window.__rise, frame: window.__frame === document.querySelector('#dOut .obody.vw iframe.vwframe'), loads: window.__loads }));
90
+ const st2 = await page.evaluate(() => ({ rise: window.__rise, frame: window.__frame === document.querySelector('#czViewer .obody.vw iframe.vwframe'), loads: window.__loads }));
96
91
  ok('F3 a new message still shows in the conversation', !!got);
97
92
  ok('F3 the redraw for it does not replay the entrance of the turns on screen', st2.rise === 0, JSON.stringify(st2));
98
93
  ok('F3 the viewer frame is untouched by the new message', st2.frame && st2.loads === 0, JSON.stringify(st2));
@@ -103,7 +98,7 @@ const SHOTS = process.env.PMOS_SHOTS || '';
103
98
  if (SHOTS) {
104
99
  for (const [w, h] of [[1280, 900], [390, 844]]) for (const theme of ['light', 'dark']) {
105
100
  const { page, ctx } = await open({ w, h, theme });
106
- await until(() => page.$('#dOut .obody.vw iframe.vwframe'), 8000);
101
+ await until(() => page.$('#czViewer .obody.vw iframe.vwframe'), 8000);
107
102
  await sleep(1500);
108
103
  fs.mkdirSync(SHOTS, { recursive: true });
109
104
  await page.screenshot({ path: path.join(SHOTS, `after-${w}-${theme}.png`) });
@@ -148,17 +148,14 @@ const SHOTS = process.env.PMOS_SHOTS || '';
148
148
  const errors = [];
149
149
  page.on('pageerror', (e) => errors.push(String((e && e.message) || e)));
150
150
  await page.route('**/api/brief-page*', (r) => r.fulfill({ contentType: 'application/json', body: '{"ok":false,"error":"off in this suite"}' }));
151
- await page.goto(BASE + '/premium.html?theme=' + theme);
152
- await until(() => page.evaluate(() => !!document.querySelector('#dlg')), 15000);
153
- await page.evaluate(async () => {
154
- const Sh = await import('/pm/premium-shell.js');
155
- Sh.openDlg({ eye: 'Your item', title: 'Share plan', say: 'The PRD is in the repo.', noteKey: null, pane: '<article class="paper doc"><p>Item record</p></article>', label: 'Item record' });
156
- });
157
- await page.evaluate((f) => { const b = document.createElement('button'); b.type = 'button'; b.className = 'fpath'; b.dataset.file = f; b.textContent = f; document.querySelector('#dBody .stream').append(b); b.click(); }, PRD);
158
- await until(() => page.$('#dOut .obody.vw:not([hidden]) [data-fsh]'), 10000);
151
+ // premium-agreed-design: a chat is Home's own (?about= names the conversation) and a file it names opens in the Viewer card
152
+ await page.goto(BASE + '/premium.html?about=work:share-test&theme=' + theme);
153
+ await until(() => page.evaluate(() => !!document.querySelector('#hmLog') && !!document.querySelector('#hmFoot textarea')), 15000);
154
+ await page.evaluate((f) => { const b = document.createElement('button'); b.type = 'button'; b.className = 'fpath'; b.dataset.file = f; b.textContent = f; document.querySelector('#hmLog').append(b); b.click(); }, PRD);
155
+ await until(() => page.$('#czViewer:not([hidden]) .obody.vw [data-fsh]'), 10000);
159
156
  return { ctx, page, errors };
160
157
  };
161
- const ICON = '#dOut .obody.vw:not([hidden]) [data-fsh]';
158
+ const ICON = '#czViewer:not([hidden]) .obody.vw [data-fsh]';
162
159
  {
163
160
  const { page, errors, ctx } = await open();
164
161
  await page.click(ICON);
@@ -1,8 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
- /* premium-viewer-test.js — the premium dialog's right pane as a viewer with tabs (initiative premium-viewer, S1; planning/prd/premium-viewer-prd.md R1, R7).
4
- * Serves the real Briefing page from the real server with the Briefing model answered by a stand-in, opens a row's dialog, then drives window.__premiumViewer.
5
- * R1 tabs: open, switch, close, at most 4 extra, #oMain kept with its handlers, reset on the next dialog · R7 floors: 390px, 44px targets, dark theme
3
+ /* premium-viewer-test.js — the Viewer (initiative premium-viewer, S1; planning/prd/premium-viewer-prd.md R1, R7; re-pointed by premium-agreed-design, area viewer).
4
+ * The Agreed design replaced the dialog's tabbed right pane with one Viewer card (window.czViewer, cozy-viewer.js) that shows one item at a time.
5
+ * Serves the real Home page from the real server with the Briefing model answered by a stand-in, then drives window.__premiumViewer (the views'
6
+ * entry, which opens in the card when the page has no dialog) and window.czViewer.
7
+ * R1 the card: open, refill on the same id, one item at a time (no tabs, no dialog), the page's own nodes untouched, close and Escape, confirm, style
8
+ * R7 floors: 390px covers the screen, 44px targets, dark theme
6
9
  * Every wait polls the page; no fixed sleep stands in for a state. */
7
10
  const path = require('path');
8
11
  const { spawn } = require('child_process');
@@ -43,73 +46,52 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
43
46
  page.on('pageerror', (e) => S.errors.push(String((e && e.message) || e)));
44
47
  await page.route('**/api/briefing-premium*', (r) => r.fulfill({ status: 200, contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model: B.build(F.facts()), as_of: Date.now() }) }));
45
48
  await page.goto(BASE + '/premium.html?theme=' + theme);
46
- S.up = await until(() => page.evaluate(() => document.querySelectorAll('#rank .rr .rhd').length > 0 && !!window.__premiumViewer), 20000);
49
+ await until(() => page.evaluate(() => document.querySelectorAll('#hmList .hm-r').length > 0 && !!window.czViewer), 20000);
50
+ await page.evaluate(() => import('/pm/premium-viewer.js'));
51
+ S.up = await until(() => page.evaluate(() => !!window.__premiumViewer && !!window.czViewer), 10000);
47
52
  return { page, ctx, S };
48
53
  };
49
- /* opens the first row that opens a dialog on this page (a row with its own page would navigate away) */
50
- const openDialog = async (page) => {
51
- const n = await page.evaluate(() => document.querySelectorAll('#rank .rr .rhd').length);
52
- for (let i = 0; i < n; i++) {
53
- const url = page.url();
54
- await page.evaluate((k) => document.querySelectorAll('#rank .rr .rhd')[k].click(), i);
55
- if (await until(() => page.evaluate(() => document.querySelector('#dlg').classList.contains('on')), 3000)) return true;
56
- if (page.url() !== url) { await page.goBack(); await until(() => page.evaluate(() => document.querySelectorAll('#rank .rr .rhd').length > 0 && !!window.__premiumViewer), 20000); }
57
- }
58
- return false;
59
- };
60
54
  const st = (page) => page.evaluate(() => {
61
- const t = document.querySelector('#vTabs'), m = document.querySelector('#oMain'), lab = document.querySelector('#oLab');
55
+ const v = document.querySelector('#czViewer');
62
56
  const vis = (e) => !!e && !e.hidden && getComputedStyle(e).display !== 'none';
63
- return { ...window.__premiumViewer.vwState(), strip: vis(t), lab: vis(lab), main: vis(m), tabs: t ? [...t.querySelectorAll('.vtab')].map((x) => x.dataset.vw) : [],
64
- sel: t ? [...t.querySelectorAll('.vtab[aria-selected="true"]')].map((x) => x.dataset.vw) : [], panes: [...document.querySelectorAll('#dOut .obody.vw')].map((p) => [p.dataset.vw, vis(p)]) };
57
+ return { open: vis(v), cur: window.czViewer.current(), cards: document.querySelectorAll('#czViewer').length, panes: [...document.querySelectorAll('#czViewer .obody.vw')].map((p) => p.dataset.vw),
58
+ title: v ? (v.querySelector('.cz-vw-title') || {}).textContent : '', tabs: !!document.querySelector('#vTabs, .vtab'), dlg: !!document.querySelector('#dlg') };
65
59
  });
66
60
 
67
61
  /* R1 desktop */
68
62
  {
69
63
  const { page, ctx, S } = await open();
70
- ok('R1 the Briefing loads with the viewer module', S.up);
71
- ok('R1 a row opens the dialog', await openDialog(page));
64
+ ok('R1 Home loads with the viewer module and the Viewer card', S.up);
65
+ // the page's own list: a node and a handler on it must survive every open and close of the Viewer (the old #oMain rule)
66
+ await page.evaluate(() => { const m = document.querySelector('#hmList'); window.__hits = 0; m.addEventListener('click', () => { window.__hits++; }); const p = document.createElement('p'); p.id = 'vwMark'; p.textContent = 'mark'; m.append(p); });
72
67
  let s = await st(page);
73
- ok('R1 with no extra tab the strip is hidden, #oLab shows, #oMain shows', !s.strip && s.lab && s.main && s.ids.length === 0, JSON.stringify(s));
74
- /* a page's handler on #oMain, and a node inside it, must survive the tabs */
75
- await page.evaluate(() => { const m = document.querySelector('#oMain'); window.__hits = 0; m.addEventListener('click', () => { window.__hits++; }); const p = document.createElement('p'); p.id = 'vwMark'; p.textContent = 'mark'; m.append(p); });
68
+ ok('R1 with nothing opened there is no tab strip and no old dialog', !s.tabs && !s.dlg, JSON.stringify(s));
76
69
  await page.evaluate(() => window.__premiumViewer.vwOpen({ id: 'a', title: 'Alpha doc', icon: 'doc', html: '<p id="paneA">Alpha</p>', wire: (el) => { el.querySelector('#paneA').dataset.wired = '1'; } }));
77
70
  s = await st(page);
78
- ok('R1 opening an item shows the strip with the main tab and the item, the item selected', s.strip && !s.lab && JSON.stringify(s.tabs) === '["main","a"]' && JSON.stringify(s.sel) === '["a"]' && !s.main, JSON.stringify(s));
79
- ok('R1 the item fills its own pane and wire runs on it', await page.evaluate(() => document.querySelector('#paneA') && document.querySelector('#paneA').dataset.wired === '1'));
80
- ok('R1 the main tab is labelled with the dialog\'s label and has no close button', await page.evaluate(() => { const t = document.querySelector('#vTabs .vtab[data-vw="main"]'); return t.textContent.trim() === document.querySelector('#oLab').textContent.trim() && !t.querySelector('.vx'); }));
81
- await page.click('#vTabs .vtab[data-vw="main"]');
82
- s = await st(page);
83
- ok('R1 a click on the main tab shows #oMain and hides the item', s.main && s.on === 'main' && s.panes.every((p) => !p[1]), JSON.stringify(s));
84
- ok('R1 #oMain was not re-rendered: the node inside it and its handler are still there', await page.evaluate(() => { document.querySelector('#vwMark').click(); return !!document.querySelector('#oMain #vwMark') && window.__hits === 1; }));
71
+ ok('R1 opening an item shows the Viewer card with its title, and no tab strip', s.open && s.cards === 1 && s.title === 'Alpha doc' && JSON.stringify(s.panes) === '["a"]' && !s.tabs, JSON.stringify(s));
72
+ ok('R1 the item fills the card and wire runs on it', await page.evaluate(() => document.querySelector('#czViewer #paneA') && document.querySelector('#czViewer #paneA').dataset.wired === '1'));
73
+ ok('R1 the page\'s own list was not re-rendered: the node inside it and its handler are still there', await page.evaluate(() => { document.querySelector('#vwMark').click(); return !!document.querySelector('#hmList #vwMark') && window.__hits === 1; }));
85
74
  await page.evaluate(() => window.__premiumViewer.vwOpen({ id: 'a', title: 'Alpha doc', html: '<p id="paneA">Alpha 2</p>' }));
86
75
  s = await st(page);
87
- ok('R1 opening the same id again refills that tab and shows it, with no second tab', s.ids.length === 1 && s.on === 'a' && (await page.textContent('#paneA')) === 'Alpha 2', JSON.stringify(s));
76
+ ok('R1 opening the same id again refills the card, with no second item', s.cards === 1 && JSON.stringify(s.panes) === '["a"]' && (await page.textContent('#czViewer #paneA')) === 'Alpha 2', JSON.stringify(s));
88
77
  for (const id of ['b', 'c', 'd', 'e']) await page.evaluate((x) => window.__premiumViewer.vwOpen({ id: x, title: 'Item ' + x, html: `<p>${x}</p>` }), id);
89
78
  s = await st(page);
90
- ok('R1 at most 4 extra tabs: the fifth closes the oldest', JSON.stringify(s.ids) === '["b","c","d","e"]' && s.on === 'e' && s.panes.length === 4, JSON.stringify(s));
91
- await page.click('#vTabs .vtab[data-vw="e"] .vx');
92
- s = await st(page);
93
- ok('R1 closing the shown tab shows the one before it', JSON.stringify(s.ids) === '["b","c","d"]' && s.on === 'd', JSON.stringify(s));
94
- await page.focus('#vTabs .vtab[data-vw="d"]');
95
- await page.keyboard.press('ArrowLeft');
96
- s = await st(page);
97
- ok('R1 the arrow keys move between tabs', s.on === 'c' && (await page.evaluate(() => document.activeElement.dataset.vw)) === 'c', JSON.stringify(s));
98
- await page.keyboard.press('Delete');
99
- s = await st(page);
100
- ok('R1 Delete closes the focused tab', JSON.stringify(s.ids) === '["b","d"]', JSON.stringify(s));
101
- const yes = page.evaluate(() => window.__premiumViewer.vwConfirm(document.querySelector('#dOut .obody.vw:not([hidden])'), { text: 'Undo all 3 edits?', yes: 'Undo all' }));
102
- await until(() => page.evaluate(() => !!document.querySelector('.vcf')));
103
- ok('R1 vwConfirm draws a card with the question in the shown pane', (await page.textContent('.vcf p')) === 'Undo all 3 edits?');
104
- await page.click('.vcf [data-a="1"]');
79
+ ok('R1 one item at a time: each open replaces the one shown', s.cards === 1 && JSON.stringify(s.panes) === '["e"]' && s.cur && s.cur.id === 'vw:e' && !s.tabs, JSON.stringify(s));
80
+ const yes = page.evaluate(() => window.__premiumViewer.vwConfirm(document.querySelector('#czViewer .obody.vw'), { text: 'Undo all 3 edits?', yes: 'Undo all' }));
81
+ await until(() => page.evaluate(() => !!document.querySelector('#czViewer .vcf')));
82
+ ok('R1 vwConfirm draws a card with the question in the shown item', (await page.textContent('#czViewer .vcf p')) === 'Undo all 3 edits?');
83
+ await page.click('#czViewer .vcf [data-a="1"]');
105
84
  ok('R1 vwConfirm resolves true on the yes button and removes the card', (await yes) === true && !(await page.$('.vcf')));
106
- await page.evaluate(() => window.__premiumViewer.vwStyle('none-such'));
107
- ok('R1 vwStyle adds the view\'s stylesheet link once', await page.evaluate(() => { window.__premiumViewer.vwStyle('none-such'); window.__premiumViewer.vwStyle('../x'); const l = document.querySelectorAll('link[data-vw-css="none-such"]'); return l.length === 1 && l[0].getAttribute('href') === '/pm/premium-vw-none-such.css' && !document.querySelector('link[href*="/x.css"]'); }));
85
+ ok('R1 vwStyle adds the view\'s stylesheet link once', await page.evaluate(() => { window.__premiumViewer.vwStyle('none-such'); window.__premiumViewer.vwStyle('none-such'); window.__premiumViewer.vwStyle('../x'); const l = document.querySelectorAll('link[data-vw-css="none-such"]'); return l.length === 1 && l[0].getAttribute('href') === '/pm/premium-vw-none-such.css' && !document.querySelector('link[href*="/x.css"]'); }));
86
+ await page.click('#czViewer [data-cz-vw="close"]');
87
+ s = await st(page);
88
+ ok('R1 Close empties and hides the card', !s.open && s.panes.length === 0, JSON.stringify(s));
89
+ await page.evaluate(() => window.__premiumViewer.vwOpen({ id: 'f', title: 'Item f', html: '<p>f</p>' }));
108
90
  await page.keyboard.press('Escape');
109
- await until(() => page.evaluate(() => !document.querySelector('#dlg').classList.contains('on')), 3000);
110
- await openDialog(page);
91
+ ok('R1 Escape closes the Viewer', !!(await until(() => page.evaluate(() => !window.czViewer.isOpen()), 3000)));
92
+ await page.evaluate(() => window.__premiumViewer.vwOpen({ id: 'g', title: 'Item g', html: '<p>g</p>' }));
111
93
  s = await st(page);
112
- ok('R1 the next dialog starts with no extra tab', s.ids.length === 0 && !s.strip && s.main && s.panes.length === 0, JSON.stringify(s));
94
+ ok('R1 the next item starts alone in the card', s.open && JSON.stringify(s.panes) === '["g"]', JSON.stringify(s));
113
95
  ok('R1 no page error', S.errors.length === 0, S.errors.join(' | '));
114
96
  await ctx.close();
115
97
  }
@@ -117,18 +99,17 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
117
99
  /* R7 phone and dark theme */
118
100
  {
119
101
  const { page, ctx, S } = await open({ w: 390, h: 844, theme: 'dark' });
120
- ok('R7 a row opens the dialog at 390px', await openDialog(page));
121
- for (const id of ['a', 'b']) await page.evaluate((x) => window.__premiumViewer.vwOpen({ id: x, title: 'A long item title ' + x, html: `<p>${x}</p>` }), id);
102
+ for (const id of ['a', 'b']) await page.evaluate((x) => window.__premiumViewer.vwOpen({ id: x, title: 'A long item title that does not fit on one line of a phone ' + x, html: `<p>${x}</p>` }), id);
122
103
  const m = await page.evaluate(() => {
123
104
  const r = (e) => e.getBoundingClientRect();
124
- const tabs = [...document.querySelectorAll('#vTabs .vtab:not([hidden])')], xs = [...document.querySelectorAll('#vTabs .vtab:not([hidden]) .vx')]; // tabs past the strip's width sit in the +N menu (premium-chat-viewer V6)
125
- return { tabH: Math.min(...tabs.map((t) => r(t).height)), xH: Math.min(...xs.map((t) => r(t).height)), xW: Math.min(...xs.map((t) => r(t).width)),
126
- over: document.documentElement.scrollWidth > window.innerWidth, stripW: r(document.querySelector('#vTabs')).right <= window.innerWidth + 1,
127
- bg: getComputedStyle(document.querySelector('#vTabs .vtab[aria-selected="true"]')).backgroundColor };
105
+ const v = document.querySelector('#czViewer'), ib = [...v.querySelectorAll('.cz-vw-ib')];
106
+ return { ibH: Math.min(...ib.map((t) => r(t).height)), ibW: Math.min(...ib.map((t) => r(t).width)), w: r(v).width, h: r(v).height,
107
+ over: document.documentElement.scrollWidth > window.innerWidth, bg: getComputedStyle(v).backgroundColor };
128
108
  });
129
- ok('R7 tabs and close buttons are at least 44px at 390px', m.tabH >= 44 && m.xH >= 44 && m.xW >= 44, JSON.stringify(m));
130
- ok('R7 the strip fits the width and the page does not scroll sideways', m.stripW && !m.over, JSON.stringify(m));
131
- ok('R7 in the dark theme the selected tab is not a light card', (() => { const c = (m.bg.match(/\d+/g) || []).slice(0, 3).map(Number); return c.length === 3 && c[0] + c[1] + c[2] < 3 * 160; })(), m.bg);
109
+ ok('R7 the card covers the screen at 390px', m.w >= 389 && m.h >= 843, JSON.stringify(m));
110
+ ok('R7 the header buttons are at least 44px at 390px', m.ibH >= 44 && m.ibW >= 44, JSON.stringify(m));
111
+ ok('R7 the page does not scroll sideways', !m.over, JSON.stringify(m));
112
+ ok('R7 in the dark theme the card is not a light card', (() => { const c = (m.bg.match(/\d+/g) || []).slice(0, 3).map(Number); return c.length === 3 && c[0] + c[1] + c[2] < 3 * 160; })(), m.bg);
132
113
  ok('R7 no page error', S.errors.length === 0, S.errors.join(' | '));
133
114
  await ctx.close();
134
115
  }
@@ -1,14 +1,18 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
3
  /* premium-vw-backlog-test.js — the Jira backlog as a viewer tab on the premium Board (initiative premium-viewer, R10, R7; planning/prd/premium-viewer-prd.md).
4
- * Serves the real Board page from the real server with the Board model and GET /api/boards/sprints answered by stand-ins, opens the Sprint
5
- * card's dialog, presses "Open the backlog", then reads the tab. Every wait polls the page; no fixed sleep stands in for a state. */
4
+ * Re-pointed for premium-agreed-design: the Agreed Board has no Sprint card and opens no dialog, so the backlog is reached the way the
5
+ * viewer still offers it: the sprint view's "Open the backlog", with the sprint view opened through its module over a task dialog of the
6
+ * initiative page. GET /api/boards/sprints and the page models are stand-ins. The Board is checked to carry none of it. Every wait polls the page; no fixed sleep stands in for a state. */
6
7
  const path = require('path');
7
8
  const { spawn } = require('child_process');
8
9
  const { findBrowser } = require('./lib/find-browser');
9
10
  const T = require('./test-run').configure({ name: 'premium-vw-backlog' });
10
11
  const BP = require('./lib/board-premium.js');
11
12
  const F = require('./fixtures/board-premium-facts.js');
13
+ const IP = require('./lib/initiative-premium.js');
14
+ const IF = require('./fixtures/initiative-premium-facts.js');
15
+ const IMODEL = IP.build(IF.facts());
12
16
 
13
17
  const BASE = T.BASE;
14
18
  const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
@@ -50,49 +54,56 @@ const SPRINTS = { ok: true, source: 'jira', readAt: '2026-10-19T09:00:00Z', velo
50
54
  await page.route('**/api/board-premium*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model, as_of: Date.now() }) }));
51
55
  await page.route('**/api/briefing-premium/**', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, turns: [] }) }));
52
56
  await page.route('**/api/boards/sprints*', (r) => { S.reads.push(new URL(r.request().url()).search); r.fulfill({ contentType: 'application/json', body: JSON.stringify(sprints) }); });
53
- await page.goto(BASE + '/premium-board.html?theme=' + theme);
54
- S.up = await until(() => page.evaluate(() => !!document.querySelector('#cSpr [data-open="board:sprint"]') && !!window.__premiumViewer), 20000);
57
+ await page.route('**/api/initiative-premium*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model: IMODEL, as_of: Date.now() }) }));
58
+ await page.goto(BASE + '/premium-initiative.html?id=self-serve-v2&ws=w1&board=w1&theme=' + theme);
59
+ // the Board's expand link lands on Home's initiative layout (premium-agreed-design); its Overview has the Sprint press, and the Viewer shows one item at a time
60
+ S.up = await until(() => page.evaluate(() => !!document.querySelector('.hm-card [data-hm-ov]') && !!window.__premiumViewer && !!window.__premiumVwJira), 20000);
61
+ if (S.up) { if (!(await page.locator('.hm-card [data-hm-ov]').isVisible())) await page.click('#hmNeeds'); await page.click('.hm-card [data-hm-ov]'); /* a phone: the initiative card is in the top bar's sheet */ S.up = await until(() => page.evaluate(() => !!document.querySelector('#czViewer [data-ov-sprint]'))); }
62
+ S.reads.length = 0;
55
63
  return { page, ctx, S };
56
64
  };
65
+ const toSprint = async (page) => {
66
+ if (!(await page.evaluate(() => !!document.querySelector('#czViewer:not([hidden]) [data-ov-sprint]')))) { if (!(await page.locator('.hm-card [data-hm-ov]').isVisible())) await page.click('#hmNeeds'); await page.click('.hm-card [data-hm-ov]'); }
67
+ await until(() => page.evaluate(() => !!document.querySelector('#czViewer [data-ov-sprint]')), 5000);
68
+ await page.click('#czViewer [data-ov-sprint]');
69
+ return until(() => page.evaluate(() => !!document.querySelector('#czViewer .obody.vw[data-vw="sprint:w1"] [data-jbl]')), 5000);
70
+ };
57
71
  const openBacklog = async (page) => {
58
- await page.click('#cSpr [data-open="board:sprint"]');
59
- await until(() => page.evaluate(() => document.querySelector('#dlg').classList.contains('on') && !!document.querySelector('#openBacklog')), 5000);
60
- const btn = await page.$('#openBacklog');
61
- if (!btn) return false;
62
- await page.evaluate(() => document.querySelector('#openBacklog').click());
63
- return until(() => page.evaluate(() => document.querySelectorAll('#dOut .obody.vw .bl-s').length > 0), 5000);
72
+ if (!(await toSprint(page))) return false;
73
+ await page.click('#czViewer .obody.vw[data-vw="sprint:w1"] [data-jbl]');
74
+ return until(() => page.evaluate(() => document.querySelectorAll('#czViewer .obody.vw .bl-s').length > 0), 5000);
64
75
  };
76
+ const curId = (page) => page.evaluate(() => { const e = document.querySelectorAll('#czViewer:not([hidden]) .obody.vw'); return e.length === 1 ? e[0].dataset.vw : [...e].map((x) => x.dataset.vw).join(); });
65
77
  const read = (page) => page.evaluate(() => {
66
- const p = document.querySelector('#dOut .obody.vw:not([hidden])');
78
+ const p = document.querySelector('#czViewer:not([hidden]) .obody.vw');
67
79
  return { secs: p ? [...p.querySelectorAll('.bl-s')].map((s) => [s.querySelector('.bl-h b').textContent, [...s.querySelectorAll('.bl-k')].map((k) => k.textContent)]) : [],
68
- text: p ? p.textContent.replace(/\s+/g, ' ') : '', tabs: window.__premiumViewer.vwState() };
80
+ text: p ? p.textContent.replace(/\s+/g, ' ') : '', on: p ? p.dataset.vw : null };
69
81
  });
70
82
 
71
83
  /* R10 desktop */
72
84
  {
73
85
  const { page, ctx, S } = await open();
74
- ok('R10 the Board loads with its Sprint card', S.up);
75
- ok('R10 the sprint dialog has "Open the backlog", and it opens the backlog as a tab', await openBacklog(page));
86
+ ok('R10 Home loads the initiative with its Overview open', S.up);
87
+ ok('R10 the sprint view has "Open the backlog", and it opens the backlog in the Viewer', await openBacklog(page));
76
88
  let s = await read(page);
77
- ok('R10 the tab is open beside the dialog\'s own detail and the sprint tab, and #oMain is kept', s.tabs.ids.includes('backlog:w1') && /^backlog:/.test(s.tabs.on) && await page.evaluate(() => !!document.querySelector('#oMain #openBacklog')), JSON.stringify(s.tabs));
89
+ ok('R10 the backlog is the Viewer\'s one item, and the initiative is still the page behind it', s.on === 'backlog:w1' && await page.evaluate(() => new URLSearchParams(location.search).get('ini') === 'self-serve-v2' && !!document.querySelector('.hm-card [data-hm-ov]')), JSON.stringify(s.on));
78
90
  ok('R10 the board is read with its workspace and board', S.reads.length >= 1 && S.reads.every((q) => /board=w1/.test(q) && /ws=w1/.test(q)), JSON.stringify(S.reads));
79
91
  ok('R10 the open sprints first, then the Backlog, each with its tickets by key', JSON.stringify(s.secs) === '[["S 14",["P-1","P-2"]],["S 15",[]],["Backlog",["P-3","Q-2"]]]', JSON.stringify(s.secs));
80
92
  ok('R10 it says what it leaves out and that Jira owns rank and sprint', /Only the tickets this board's initiatives pushed/.test(s.text) && /Ranking and moving between sprints happen in Jira/.test(s.text));
81
- ok('R10 a blocked ticket says why; points and initiative are shown', /Flagged in Jira/.test(s.text) && /3 points, 1 not estimated/.test(s.text) && await page.evaluate(() => document.querySelectorAll('#dOut .obody.vw .bl-in').length === 4));
82
- ok('R10 nothing can be dragged or sent to Jira', await page.evaluate(() => !document.querySelector('#dOut .obody.vw[data-vw="backlog:w1"] [draggable="true"]') && !/Send to Jira/.test(document.querySelector('#dOut .obody.vw[data-vw="backlog:w1"]').textContent)));
83
- await page.click('#dOut .obody.vw [data-f="bug"]');
93
+ ok('R10 a blocked ticket says why; points and initiative are shown', /Flagged in Jira/.test(s.text) && /3 points, 1 not estimated/.test(s.text) && await page.evaluate(() => document.querySelectorAll('#czViewer .obody.vw .bl-in').length === 4));
94
+ ok('R10 nothing can be dragged or sent to Jira', await page.evaluate(() => !document.querySelector('#czViewer .obody.vw[data-vw="backlog:w1"] [draggable="true"]') && !/Send to Jira/.test(document.querySelector('#czViewer .obody.vw[data-vw="backlog:w1"]').textContent)));
95
+ await page.click('#czViewer .obody.vw [data-f="bug"]');
84
96
  s = await read(page);
85
97
  ok('R10 the Bugs filter keeps the bug and says when a section has none', JSON.stringify(s.secs.map((x) => x[1])) === '[[],[],["Q-2"]]' && /None match this filter/.test(s.text), JSON.stringify(s.secs));
86
- await page.click('#dOut .obody.vw [data-f="blocked"]');
98
+ await page.click('#czViewer .obody.vw [data-f="blocked"]');
87
99
  s = await read(page);
88
100
  ok('R10 the Blocked filter keeps the blocked ticket', JSON.stringify(s.secs.map((x) => x[1])) === '[["P-2"],[],[]]', JSON.stringify(s.secs));
89
- await page.click('#dOut .obody.vw [data-f=""]');
90
- await page.click('#dOut .obody.vw [data-tk="Q-2"]');
91
- ok('R10 a row opens its ticket in the Jira ticket tab', await until(() => page.evaluate(() => window.__premiumViewer.vwState().on === 'jira:Q-2'), 5000), JSON.stringify(await page.evaluate(() => window.__premiumViewer.vwState())));
92
- await page.evaluate(() => window.__premiumViewer.vwClose('backlog:w1'));
93
- await until(() => page.evaluate(() => !!document.querySelector('#dOut .obody.vw[data-vw="sprint:w1"] [data-jbl]')), 5000);
94
- await page.evaluate(() => { window.__premiumViewer.vwShow('sprint:w1'); document.querySelector('#dOut .obody.vw[data-vw="sprint:w1"] [data-jbl]').click(); });
95
- ok('R10 the sprint tab\'s "Open the backlog" opens the backlog tab', await until(() => page.evaluate(() => window.__premiumViewer.vwState().on === 'backlog:w1'), 5000));
101
+ await page.click('#czViewer .obody.vw [data-f=""]');
102
+ await page.click('#czViewer .obody.vw [data-tk="Q-2"]');
103
+ ok('R10 a row opens its ticket in the Viewer, in place of the backlog', await until(async () => (await curId(page)) === 'jira:Q-2', 5000), JSON.stringify(await curId(page)));
104
+ await toSprint(page);
105
+ await page.click('#czViewer .obody.vw[data-vw="sprint:w1"] [data-jbl]');
106
+ ok('R10 the sprint view\'s "Open the backlog" opens the backlog again', await until(async () => (await curId(page)) === 'backlog:w1', 5000));
96
107
  ok('R10 no page error', S.errors.length === 0, S.errors.join(' | '));
97
108
  await ctx.close();
98
109
  }
@@ -100,21 +111,32 @@ const SPRINTS = { ok: true, source: 'jira', readAt: '2026-10-19T09:00:00Z', velo
100
111
  /* R10 no reading */
101
112
  {
102
113
  const { page, ctx, S } = await open({ sprints: { ok: true, source: 'none', readAt: null, sprints: [], velocity: [], backlog: { readAt: null, issues: [], points: null, links: {} } } });
103
- await page.click('#cSpr [data-open="board:sprint"]');
104
- await until(() => page.evaluate(() => !!document.querySelector('#openBacklog')), 5000);
105
- await page.evaluate(() => document.querySelector('#openBacklog').click());
106
- ok('R10 with no Jira reading the tab says so', await until(() => page.evaluate(() => /No Jira reading for this board yet/.test((document.querySelector('#dOut .obody.vw[data-vw="backlog:w1"]') || {}).textContent || '')), 5000));
114
+ await page.evaluate(() => window.__premiumVwBacklog ? window.__premiumVwBacklog.openBacklog({ ws: 'w1', board: 'w1' }) : import('/pm/premium-vw-backlog.js').then((m) => m.openBacklog({ ws: 'w1', board: 'w1' })));
115
+ ok('R10 with no Jira reading the tab says so', await until(() => page.evaluate(() => /No Jira reading for this board yet/.test((document.querySelector('#czViewer .obody.vw[data-vw="backlog:w1"]') || {}).textContent || '')), 5000));
107
116
  ok('R10 no page error (no reading)', S.errors.length === 0, S.errors.join(' | '));
108
117
  await ctx.close();
109
118
  }
110
119
 
120
+ /* the Agreed Board (premium-agreed-design) carries no Sprint card, no backlog button and no dialog of its own */
121
+ {
122
+ const ctx = await browser.newContext({ viewport: { width: 1280, height: 900 } }), page = await ctx.newPage(), errs = [];
123
+ page.on('pageerror', (e) => errs.push(String((e && e.message) || e)));
124
+ const model = BP.build(F.facts({ sprints: { source: 'jira', readAt: SPRINTS.readAt, sprints: [SPRINT] } }));
125
+ await page.route('**/api/board-premium*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model, as_of: Date.now() }) }));
126
+ await page.goto(BASE + '/premium-board.html');
127
+ const up = await until(() => page.evaluate(() => document.querySelectorAll('#ibBody .bt-l').length > 0), 20000);
128
+ ok('R10 the Agreed Board has no Sprint card or backlog button; its sprint chip opens the read-only Sprint and release panel, "Waiting for design"', up && await page.evaluate(() => !document.querySelector('#cSpr, #openBacklog, #popSpr')) && (await page.click('#chSprint'), await until(() => page.evaluate(() => { const k = document.querySelector('#peek'); return !!k && !k.hidden && (document.querySelector('#pkTitle') || {}).textContent === 'Sprint and release' && /Waiting for design/.test(k.textContent) && !document.querySelector('#peek [data-jbl]') && !!!document.querySelector('#dlg.on'); }))));
129
+ ok('R10 no page error on the Board', errs.length === 0, errs.join(' | '));
130
+ await ctx.close();
131
+ }
132
+
111
133
  /* R7 phone and dark theme */
112
134
  {
113
135
  const { page, ctx, S } = await open({ w: 390, h: 844, theme: 'dark' });
114
136
  ok('R7 the backlog opens at 390px', await openBacklog(page));
115
137
  await page.evaluate(() => Promise.race([Promise.all(document.getAnimations().filter((a) => a.effect && a.effect.getTiming().iterations !== Infinity).map((a) => a.finished.catch(() => {}))), new Promise((r) => setTimeout(r, 3000))])); // the dialog's open transition scales its buttons: measure them once it ends
116
138
  const m = await page.evaluate(() => {
117
- const p = document.querySelector('#dOut .obody.vw:not([hidden])');
139
+ const p = document.querySelector('#czViewer:not([hidden]) .obody.vw');
118
140
  const small = [...p.querySelectorAll('button')].filter((b) => b.getBoundingClientRect().width && b.getBoundingClientRect().height < 44).map((b) => b.textContent.trim().slice(0, 20));
119
141
  return { small, wide: document.documentElement.scrollWidth > window.innerWidth + 1, bg: getComputedStyle(p.querySelector('.bl-s')).backgroundColor };
120
142
  });