create-pmos 0.402.0 → 0.404.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 (110) hide show
  1. package/package.json +25 -30
  2. package/payload/AGENTS.md +2 -0
  3. package/payload/KIT-VERSION +1 -1
  4. package/payload/mods/pmos-cockpit/hooks/lib/session-facts.mjs +1 -1
  5. package/payload/planning/evals/eval-calibration.md +1 -1
  6. package/payload/planning/okrs/health-budgets.md +1 -1
  7. package/payload/state/discoveries.md +1 -1
  8. package/workspace/board-programs-test.js +32 -5
  9. package/workspace/briefing-premium-adddoc-test.js +28 -22
  10. package/workspace/briefing-premium-board-test.js +91 -73
  11. package/workspace/briefing-premium-calendar-2-test.js +23 -10
  12. package/workspace/briefing-premium-calendar-3-test.js +23 -19
  13. package/workspace/briefing-premium-calendar-test.js +19 -17
  14. package/workspace/briefing-premium-initiative-test.js +25 -12
  15. package/workspace/briefing-premium-insights-test.js +31 -18
  16. package/workspace/briefing-premium-metrics-test.js +8 -8
  17. package/workspace/briefing-premium-test.js +4 -3
  18. package/workspace/changelog.json +24 -0
  19. package/workspace/fixtures/premium-viewer-fixtures.js +24 -2
  20. package/workspace/guide/jira.md +38 -6
  21. package/workspace/guide/programs.md +2 -0
  22. package/workspace/home-rows-test.js +184 -0
  23. package/workspace/lib/briefing-premium-agent.js +3 -0
  24. package/workspace/lib/calendar-layers.js +8 -4
  25. package/workspace/lib/initiative-layout.js +4 -3
  26. package/workspace/lib/jira-cli.js +17 -12
  27. package/workspace/lib/jira-status.js +1 -1
  28. package/workspace/lib/jira-tickets.js +126 -24
  29. package/workspace/lib/meeting-files.js +58 -0
  30. package/workspace/lib/meeting-learn.js +139 -0
  31. package/workspace/lib/meeting-material.js +12 -5
  32. package/workspace/lib/notes.js +3 -0
  33. package/workspace/lib/program-chat.js +32 -0
  34. package/workspace/lib/routes-brief-page.js +8 -1
  35. package/workspace/lib/routes-calendar-views.js +24 -3
  36. package/workspace/lib/routes-meeting-material.js +38 -0
  37. package/workspace/lib/routes-meeting-points.js +23 -3
  38. package/workspace/package-lock.json +2 -2
  39. package/workspace/package.json +1 -1
  40. package/workspace/premium-board-actions-test.js +30 -24
  41. package/workspace/premium-chat-context-test.js +1 -1
  42. package/workspace/premium-chat-goal-view-test.js +1 -1
  43. package/workspace/premium-chat-viewer-test.js +1 -1
  44. package/workspace/premium-core-doc-issue-test.js +13 -7
  45. package/workspace/premium-discuss-landing-test.js +83 -0
  46. package/workspace/premium-link-suggest-test.js +103 -0
  47. package/workspace/premium-report-read-test.js +86 -82
  48. package/workspace/premium-vw-backlog-test.js +6 -5
  49. package/workspace/premium-vw-cal-test.js +46 -23
  50. package/workspace/premium-vw-item-test.js +8 -6
  51. package/workspace/premium-vw-jira-test.js +3 -2
  52. package/workspace/premium-vw-meet-test.js +122 -66
  53. package/workspace/premium-vw-notes-test.js +7 -6
  54. package/workspace/premium-vw-rec-test.js +14 -13
  55. package/workspace/premium-vw-slides-test.js +11 -5
  56. package/workspace/program-panel-test.js +64 -55
  57. package/workspace/public/pm/bd-acts.js +1 -1
  58. package/workspace/public/pm/bd-asks.js +22 -7
  59. package/workspace/public/pm/bd-ini-panel.js +232 -0
  60. package/workspace/public/pm/bd-pop.js +2 -2
  61. package/workspace/public/pm/bd-prog-panel.js +176 -191
  62. package/workspace/public/pm/cozy-board.css +5 -28
  63. package/workspace/public/pm/cozy-evui.js +4 -2
  64. package/workspace/public/pm/cozy-home-rows.css +54 -0
  65. package/workspace/public/pm/cozy-home.css +9 -0
  66. package/workspace/public/pm/cozy-insights.css +1 -2
  67. package/workspace/public/pm/cozy-mtg-present.css +160 -0
  68. package/workspace/public/pm/cozy-panel.css +11 -34
  69. package/workspace/public/pm/cozy-rec-pill.css +12 -0
  70. package/workspace/public/pm/cozy-rec-pill.js +46 -0
  71. package/workspace/public/pm/cozy-viewer.js +307 -43
  72. package/workspace/public/pm/cozy-vw-mtg.css +96 -94
  73. package/workspace/public/pm/cozy-vw-rp.css +40 -25
  74. package/workspace/public/pm/cozy-vw-shell.css +127 -0
  75. package/workspace/public/pm/cozy-xv.css +51 -0
  76. package/workspace/public/pm/cozy-xv.js +34 -0
  77. package/workspace/public/pm/goal-chat.js +1 -1
  78. package/workspace/public/pm/home-app.js +122 -58
  79. package/workspace/public/pm/home-chat.js +11 -2
  80. package/workspace/public/pm/home-day.js +64 -0
  81. package/workspace/public/pm/home-ini-model.js +1 -1
  82. package/workspace/public/pm/home-ini.js +197 -54
  83. package/workspace/public/pm/home-list.js +6 -14
  84. package/workspace/public/pm/home-mentions.js +187 -0
  85. package/workspace/public/pm/home-rec-row.js +67 -0
  86. package/workspace/public/pm/home-review.js +20 -10
  87. package/workspace/public/pm/home-task.js +19 -18
  88. package/workspace/public/pm/home-today.js +3 -3
  89. package/workspace/public/pm/premium-board.js +83 -235
  90. package/workspace/public/pm/premium-insights.js +118 -82
  91. package/workspace/public/pm/premium-mtg-present.js +408 -100
  92. package/workspace/public/pm/premium-mtg-replay.js +70 -10
  93. package/workspace/public/pm/premium-report-read.js +118 -63
  94. package/workspace/public/pm/premium-vw-cal.js +62 -34
  95. package/workspace/public/pm/premium-vw-mtg.js +348 -192
  96. package/workspace/public/pm/rec-state.js +63 -0
  97. package/workspace/public/pm/rp-parts.js +33 -8
  98. package/workspace/public/pm/tk-draft.js +107 -0
  99. package/workspace/public/pm/tk-model.js +134 -0
  100. package/workspace/public/pm/tk-send.js +124 -0
  101. package/workspace/public/pm/tk-tasks.css +120 -0
  102. package/workspace/public/premium-board.html +0 -1
  103. package/workspace/server.js +4 -2
  104. package/workspace/skills/jira-push.skill +3 -3
  105. package/workspace/test-lists/prd-to-jira.json +6 -0
  106. package/workspace/test-lists/program-chat.json +6 -0
  107. package/workspace/test-lists/viewer-home-rows.json +9 -0
  108. package/workspace/test-lists/viewer-meetings.json +9 -0
  109. package/workspace/test-lists/viewer-shell-a.json +15 -0
  110. package/workspace/tk-tasks-test.js +199 -0
@@ -42,28 +42,28 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
42
42
  /* R1 Record: a meeting on now with no note */
43
43
  const A = await F.open(browser, BASE, '/premium-viewer.html?open=meeting&event=ev-live&date=' + F.dayKey(W.LIVE), { noLive: true });
44
44
  const p = A.page;
45
- ok('R1 a meeting on now with no note shows Record in its head', await until(() => p.evaluate(() => !!document.querySelector('#czViewer .vzm-hc [data-a="record"]')), 15000));
45
+ ok('R1 a meeting on now with no note shows Record in its summary, an icon only', await until(() => p.evaluate(() => { const b = document.querySelector('#czViewer .czs-sum [data-a="record"]'); return !!b && b.getAttribute('aria-label') === 'Record' && !b.textContent.trim(); }), 15000));
46
46
  await tap(p, '[data-a="record"]');
47
47
  ok('R1 Record asks first: tell everyone, then start', await until(async () => /Tell everyone first/.test(await text(p)) && !!(await p.$('#czViewer [data-a="recgo"]'))));
48
48
  ok('R1 nothing is made before the second press', posted(A.S, '/api/notes/new').length === 0);
49
49
  await tap(p, '[data-a="recgo"]');
50
50
  ok('R1 I told them, start makes the note and starts the recorder', await until(() => posted(A.S, '/api/notes/new').length === 1 && posted(A.S, '/api/notes/record').length === 1), JSON.stringify(A.S.posts.map((x) => x.path)));
51
- ok('R1 the card turns live: Recording, with Stop', await until(async () => (await p.textContent('#czViewer .vzm-state')) === 'Recording' && !!(await p.$('#czViewer .vzm-rec [data-a="stop"]')), 12000));
51
+ ok('R1 the card turns live: Recording · mm:ss, with Stop', await until(async () => /^Recording · \d{2}:\d{2}$/.test(await p.textContent('#czViewer .czs-sum .czs-line')) && !!(await p.$('#czViewer .czs-sum [data-a="stop"]')), 12000));
52
52
 
53
53
  /* R2 Highlight */
54
- await tap(p, '.vzm-rec [data-a="hl"]');
54
+ await tap(p, '.czs-sum [data-a="hl"]');
55
55
  ok('R2 Highlight starts the recorder\'s highlight', await until(() => p.evaluate(() => window.__premiumRecorder._hl === 1)));
56
56
 
57
57
  /* R3 the live notes */
58
58
  await p.fill('#czViewer [data-a="mine"]', 'Ask about the dates');
59
59
  ok('R3 what you type is saved to the note', await until(() => posted(A.S, '/api/notes/save').some((x) => x.body.body === 'Ask about the dates')), JSON.stringify(posted(A.S, '/api/notes/save')));
60
- await tap(p, '.vzm-rec [data-a="pause"]');
60
+ await tap(p, '.czs-sum [data-a="pause"]');
61
61
  ok('R3 Pause pauses the recorder (POST /api/notes/pause)', await until(() => posted(A.S, '/api/notes/pause').length === 1));
62
- ok('R3 a paused note offers Resume in its recording line, with no Waiting for design marker', await until(async () => !!(await p.$('#czViewer .vzm-rec [data-a="resume"]')) && !(await p.$('#czViewer [data-cz-placeholder]'))));
63
- await tap(p, '.vzm-rec [data-a="resume"]');
62
+ ok('R3 a paused note offers Resume in its recording line, with no Waiting for design marker', await until(async () => !!(await p.$('#czViewer .czs-sum [data-a="resume"]')) && !(await p.$('#czViewer [data-cz-placeholder]'))));
63
+ await tap(p, '.czs-sum [data-a="resume"]');
64
64
  ok('R3 Resume records again', await until(() => posted(A.S, '/api/notes/record').length === 2));
65
- await until(async () => !!(await p.$('#czViewer .vzm-rec [data-a="stop"]')));
66
- await tap(p, '.vzm-rec [data-a="stop"]');
65
+ await until(async () => !!(await p.$('#czViewer .czs-sum [data-a="stop"]')));
66
+ await tap(p, '.czs-sum [data-a="stop"]');
67
67
  ok('R3 Stop asks first', await until(async () => /Stop for good/.test(await text(p))));
68
68
  await tap(p, '[data-a="stopgo"]');
69
69
  ok('R3 Stop and write the notes stops the recorder', await until(() => posted(A.S, '/api/notes/stop').length === 1));
@@ -73,15 +73,16 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
73
73
  /* R3 Private on a recording note */
74
74
  const B = await F.open(browser, BASE, '/premium-viewer.html?open=meeting&note=n2', { init: () => { window.__premiumHolding = { id: 'n2' }; } });
75
75
  const q = B.page;
76
- await until(() => q.evaluate(() => !!document.querySelector('#czViewer [data-a="priv"]')), 15000);
77
- await tap(q, '[data-a="priv"]');
76
+ await until(() => q.evaluate(() => !!document.querySelector('#czViewer .vz-mtg')), 15000);
77
+ ok('R3 Make this note private is in ⋯, last, as the one red row', await until(async () => { const r = await F.more(q); return r && r[r.length - 1] === 'Make this note private'; }));
78
+ await F.more(q, 'Make this note private');
78
79
  ok('R3 Private asks first', await until(async () => /Make this note private/.test(await text(q))));
79
80
  await tap(q, '[data-a="privgo"]');
80
81
  ok('R3 Make it private posts private: true', await until(() => posted(B.S, '/api/notes/private').some((x) => x.body.id === 'n2' && x.body.private === true)));
81
82
 
82
83
  /* R4 Focus */
83
- await tap(q, '[data-a="tab"][data-k="focus"]');
84
- ok('R4 Focus is a tab of the live card, with the topics and no Waiting for design marker', await until(async () => !(await q.$('#czViewer [data-cz-placeholder]')) && /The Issue button/.test(await text(q))), (await text(q)).slice(0, 300));
84
+ if (await q.evaluate(() => document.querySelector('#czViewer [data-czs-fold="agenda"]').getAttribute('aria-expanded') !== 'true')) await tap(q, '[data-czs-fold="agenda"]');
85
+ ok('R4 Focus is the live card\'s Agenda fold, with the topics and no Waiting for design marker', await until(async () => !(await q.$('#czViewer [data-cz-placeholder]')) && /The Issue button/.test(await text(q))), (await text(q)).slice(0, 300));
85
86
  await B.ctx.close();
86
87
 
87
88
  /* R5 New note: an untitled note recorded at once */
@@ -96,7 +97,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
96
97
 
97
98
  /* R6 floors */
98
99
  const D = await F.open(browser, BASE, '/premium-viewer.html?open=meeting&note=n2', { w: 390, h: 844, init: () => { window.__premiumHolding = { id: 'n2' }; } });
99
- await until(() => D.page.evaluate(() => !!document.querySelector('#czViewer .vzm-rec')), 15000);
100
+ await until(() => D.page.evaluate(() => !!document.querySelector('#czViewer .czs-sum [data-a="stop"]')), 15000);
100
101
  const fl = await D.page.evaluate(() => ({ over: document.documentElement.scrollWidth - innerWidth, chip: !!document.querySelector('#recChip, #recCtl') }));
101
102
  ok('R6 on a phone the live card has no sideways scroll, and no old round mic or record chip is drawn', fl.over <= 0 && !fl.chip, JSON.stringify(fl));
102
103
  await D.ctx.close();
@@ -80,14 +80,18 @@ const disk = () => fs.readFileSync(path.join(dir, pNew), 'utf8');
80
80
  await p.goto(BASE + '/premium-viewer.html?open=report&path=' + encodeURIComponent(RDraft.draftPath(dir, CAD, slot)));
81
81
  return until(() => p.evaluate(() => !!document.querySelector('#czViewer .vz-rp0 .vz-slide')));
82
82
  };
83
+ /* shell A's ⋯ (cozy-viewer.js): Edit sits there, with the rest of what the report can do besides its one primary */
84
+ const pick = (pg, l) => pg.evaluate(async (lab) => { document.querySelector('#czViewer [data-cz-vw="more"]').click(); await new Promise((r) => setTimeout(r, 60)); const b = [...document.querySelectorAll('#czViewer .cz-vw-menu [role="menuitem"]')].find((x) => x.querySelector('span').textContent === lab); if (b) b.click(); return !!b; }, l);
85
+ const menuOf = (pg) => pg.evaluate(async () => { document.querySelector('#czViewer [data-cz-vw="more"]').click(); await new Promise((r) => setTimeout(r, 60)); const L = [...document.querySelectorAll('#czViewer .cz-vw-menu [role="menuitem"] > span:first-of-type')].map((x) => x.textContent); document.querySelector('#czViewer [data-cz-vw="more"]').click(); return L; });
83
86
  const openEditor = async () => {
84
- await P('edit');
87
+ await until(() => p.evaluate(() => !!document.querySelector('#czViewer [data-cz-vw="more"]')));
88
+ await pick(p, 'Edit');
85
89
  return until(() => p.evaluate(() => !!document.querySelector('#czViewer [data-vz-ed] .sl .sl-stage .sl-cv')));
86
90
  };
87
91
 
88
92
  /* O: opening */
89
93
  ok('O1 a draft report opens in the Viewer card', await openReader('2026-10-12'));
90
- ok('O2 on Slides, the bar\'s Edit says it edits the slides, and there is no other Edit the slides', await p.evaluate(() => /slides/i.test(document.querySelector('#czViewer [data-r="edit"]').title) && document.querySelectorAll('#czViewer [data-r="edit"]').length === 1));
94
+ ok('O2 on Slides, Edit is under ⋯ once, and the card draws no other Edit (XvAReportMore)', await until(() => p.evaluate(() => !!document.querySelector('#czViewer [data-cz-vw="more"]'))) && (await menuOf(p)).filter((x) => x === 'Edit').length === 1 && await p.evaluate(() => !document.querySelector('#czViewer .cz-vw-body [data-r="edit"]')));
91
95
  ok('O3 Edit mounts the slide editor in the card, with no dialog and no tab; the parts the design does not draw (slide tools, speaker notes) are marked Waiting for design', await openEditor() && await p.evaluate(() => !document.querySelector('#dlg, #vTabs') && !!document.querySelector('#czViewer [data-cz-placeholder="Slide tools"]') && !!document.querySelector('#czViewer [data-cz-placeholder="Speaker notes"]')));
92
96
  ok('O3 the panel\'s toolbar drives it: Undo, Redo, Insert, Layout, Theme, Cancel and Save, and the cycle chip says Editing', await p.evaluate(() => [...document.querySelectorAll('#czViewer .vz-tb > button')].map((b) => b.dataset.r).join() === 'ed|undo,ed|redo,ins,ed|layout,ed|theme,edcancel,edsave' && /Editing the Oct 12 draft/.test(document.querySelector('#czViewer [data-r="cycm"]').textContent)), await p.evaluate(() => [...document.querySelectorAll('#czViewer .vz-tb > button')].map((b) => b.dataset.r).join()));
93
97
  let s = await st();
@@ -227,7 +231,9 @@ const disk = () => fs.readFileSync(path.join(dir, pNew), 'utf8');
227
231
 
228
232
  /* I: an issued report */
229
233
  await openReader('2026-10-05');
230
- ok('I1 an issued report has no Edit and no Issue: it reads as Slides or Page', await p.evaluate(() => !document.querySelector('#czViewer [data-r="edit"]') && !document.querySelector('#czViewer [data-r="issue"]') && !!document.querySelector('#czViewer [data-r="view|deck"]')));
234
+ await until(() => p.evaluate(() => /^Issued/.test((document.querySelector('#czViewer .czs-line') || {}).textContent || '')));
235
+ const im = await menuOf(p);
236
+ ok('I1 an issued report has no Edit and no Issue: it reads as slides or as a page', !im.includes('Edit') && im.includes('Read as a page') && await p.evaluate(() => !document.querySelector('#czViewer [data-czs-act="issue"], #czViewer [data-r="issue"]')), im.join());
231
237
  ok('I3 the issued file is not changed', fs.readFileSync(path.join(dir, pOld), 'utf8') === OLD);
232
238
  ok('X no page error', errs.length === 0, errs.join(' | '));
233
239
  await ctx.close();
@@ -238,8 +244,8 @@ const disk = () => fs.readFileSync(path.join(dir, pNew), 'utf8');
238
244
  q.on('pageerror', (e) => e2.push(String(e)));
239
245
  await q.goto(BASE + '/premium-viewer.html?theme=dark&open=report&path=' + encodeURIComponent(pNew));
240
246
  await until(() => q.evaluate(() => !!document.querySelector('#czViewer .vz-rp0 .vz-slide')));
241
- await q.$eval('#czViewer .vz-tb > [data-r="more"]', (x) => x.click());
242
- await q.$eval('#czViewer .vz-pop [data-r="edit"]', (x) => x.click()); // on a phone Edit sits in More
247
+ await until(() => q.evaluate(() => !!document.querySelector('#czViewer [data-cz-vw="more"]')));
248
+ await pick(q, 'Edit'); // Edit sits under ⋯ at every width
243
249
  await until(() => q.evaluate(() => !!document.querySelector('#czViewer [data-vz-ed] .sl .sl-stage .sl-cv')));
244
250
  await sleep(300);
245
251
  const m = await q.evaluate((v) => {
@@ -1,14 +1,15 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
- /* program-panel-test.js — the program panel and the side panel's width on the Board (initiative program-hierarchy P5, P9, B1; canvas PgProgram,
4
- * PgMilestones, XnAgBoardPanel). Serves the real page from the real server; GET /api/board-premium answers each product of Project Ascent
5
- * (fixtures/program-ascent.js through fixtures/board-premium-facts.js programFacts), GET /api/programs its programs, and the program writes are
6
- * captured, not written.
7
- * P open on ?program=, the head, no chat box · G goals per half, each KR's name and whether it is met · M the track and the Milestones tab ·
8
- * W waits on you, in Home · T the tree, another product read from its board · K every task by level, and the sort card after Turn into a
9
- * program · F folds kept · O the Board's program row opens it, an initiative from the tree opens the Board's panel · X task done and a
10
- * program check · B1 60 % wide, the grip · S the phone sheet. Per product the KRs (GET /api/boards/anchors), the Insights goals (GET
11
- * /api/insights-premium) and the PMOS tasks (GET /api/boards/items) answer from fixtures/program-ascent.js. */
3
+ /* program-panel-test.js — the program panel on the Board (initiative program-hierarchy P5, P9; canvas PgProgram, PgMilestones), re-shelled
4
+ * into the Viewer's shell A by the second kit (initiative viewer-shell-a, V9; canvas XvABoard). Serves the real page from the real server;
5
+ * GET /api/board-premium answers each product of Project Ascent (fixtures/program-ascent.js through fixtures/board-premium-facts.js
6
+ * programFacts), GET /api/programs its programs, and the program writes are captured, not written.
7
+ * P open on ?program=, the shell's header, no chat box · G goals per half, each KR's name and whether it is met · M the track and the
8
+ * Milestones row · W waits on you, in Home · T the initiatives per product, another product read from its board · K every task by level,
9
+ * and the sort card after Turn into a program · F folds kept · O the Board's program row opens it, an initiative opens the Board's
10
+ * initiative in the same shell · X task done and a program check · V floats at 560 px, the grip · S full screen on a phone. Per product the
11
+ * KRs (GET /api/boards/anchors), the Insights goals (GET /api/insights-premium) and the PMOS tasks (GET /api/boards/items) answer from
12
+ * fixtures/program-ascent.js. */
12
13
  const path = require('path');
13
14
  const { spawn } = require('child_process');
14
15
  const { findBrowser } = require('./lib/find-browser');
@@ -59,84 +60,92 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
59
60
  await page.goto(BASE + '/premium-board.html' + qs);
60
61
  return { page, ctx: c, errors, posts };
61
62
  };
62
- const shown = (p) => until(() => p.evaluate(() => { const k = document.querySelector('#ppPeek'); return k && !k.hidden && !!k.querySelector('#ppTitle'); }));
63
+ const shown = (p) => until(() => p.evaluate(() => { const v = document.querySelector('#czViewer'); return !!v && !v.hidden && /^Viewer: Program/.test(v.getAttribute('aria-label') || '') && !!v.querySelector('.pp-vw .czs-sum'); }));
64
+ const fold = (p, id) => p.click(`#czViewer [data-czs-fold="${id}"]`);
65
+ const isOpen = (p, id) => p.evaluate((k) => { const b = document.querySelector(`#czViewer [data-czs-fold="${k}"]`); return !!b && b.getAttribute('aria-expanded') === 'true'; }, id);
63
66
 
64
67
  /* ── desktop ── */
65
68
  const D = await open();
66
69
  const p = D.page;
67
- ok('P ?program=<id> opens the program panel once the board and the programs are read', await shown(p));
68
- await sleep(1500); // the other product's board and the program reads land after the panel opened: none of them opens it again
69
- ok('P ?program=<id> sends bd:program once: one path opens the panel', await p.evaluate(() => window.__bdp) === 1, String(await p.evaluate(() => window.__bdp)));
70
- const hd = await p.evaluate(() => { const k = document.querySelector('#ppPeek'); const r = k.getBoundingClientRect(); return { t: k.querySelector('#ppTitle').textContent, ch: k.querySelector('.pp-ch').textContent, tools: [...k.querySelectorAll('.pk-tools [aria-label]')].map((b) => b.getAttribute('aria-label')), input: k.querySelectorAll('input, textarea').length, w: Math.round(r.width), vw: innerWidth, sel: !!document.querySelector('#ibBody [data-prow="project-ascent"].sel') }; });
71
- ok('P the head is the program icon, "title · goal", the owner and the span, and four icon buttons; there is no chat box', hd.t === 'Project Ascent · CIAM migration' && hd.ch === 'Wawan · Sep 2026 to Jun 2028' && hd.tools.join('|') === 'Ask about Project Ascent in Home|Open the charter|More: add initiative, move initiative in, archive|Close' && hd.input === 0, JSON.stringify(hd));
72
- ok('B1 the program panel is 60 % of the width on desktop, and its band row on the Board is selected', Math.abs(hd.w - Math.round(hd.vw * 0.6)) <= 1 && hd.sel, JSON.stringify(hd));
73
- const g = await p.evaluate(() => ({ per: document.querySelector('#ppPeek .pp-per').textContent.trim(), krs: [...document.querySelectorAll('#ppPeek .pp-goal .pp-kr:not(.ghost) b')].map((b) => b.textContent) }));
70
+ ok('P ?program=<id> opens the program in the Viewer once the board and the programs are read', await shown(p));
71
+ await sleep(1500); // the other product's board and the program reads land after the program opened: none of them opens it again
72
+ ok('P ?program=<id> sends bd:program once: one path opens the program', await p.evaluate(() => window.__bdp) === 1, String(await p.evaluate(() => window.__bdp)));
73
+ const hd = await p.evaluate(() => { const v = document.querySelector('#czViewer'); const r = v.getBoundingClientRect(); return { t: v.querySelector('.cz-vw-title').textContent, kind: (v.querySelector('.cz-vw-kind') || {}).textContent, meta: (v.querySelector('.czs-meta') || {}).textContent, tools: [...v.querySelectorAll('.cz-vw-head [data-cz-vw], [data-cz-vw]')].filter((b) => b.closest('#czViewer') && !b.classList.contains('cz-vw-grip')).map((b) => b.getAttribute('aria-label')), input: v.querySelectorAll('.cz-vw-body input, .cz-vw-body textarea').length, tabs: v.querySelectorAll('.pp-tab, [role="tab"]').length, w: Math.round(r.width), right: Math.round(innerWidth - r.right), sel: !!document.querySelector('#ibBody [data-prow="project-ascent"].sel') }; });
74
+ ok('P the shell\'s header names it once ("title · goal"), with Discuss in chat, ⋯, Open wide and Close; the summary says the owner and the span; there is no chat box and no tab', hd.t === 'Project Ascent · CIAM migration' && hd.kind === 'Program' && hd.meta === 'Wawan · Sep 2026 to Jun 2028' && [...new Set(hd.tools)].join('|') === 'Discuss in chat|More|Open wide|Close the viewer' && hd.input === 0 && hd.tabs === 0, JSON.stringify(hd));
75
+ ok('V the program floats at 560 px over the page\'s right edge, and its band row on the Board is selected', hd.w === 560 && hd.right < 40 && hd.sel, JSON.stringify(hd));
76
+ const sm = await p.evaluate(() => ({ line: (document.querySelector('#czViewer .czs-line') || {}).textContent, pri: (document.querySelector('#czViewer .czs-pri') || {}).textContent || '' }));
77
+ ok('P the summary line is the next milestone (Waits on you counts itself in its row, said once); no primary while every task has a level', /^Next: Pilot live/.test(sm.line) && sm.pri === '', JSON.stringify(sm));
78
+ const g = await p.evaluate(() => ({ per: document.querySelector('#czViewer .pp-per').textContent.trim(), krs: [...document.querySelectorAll('#czViewer .pp-goal .pp-kr:not(.ghost) b')].map((b) => b.textContent) }));
74
79
  ok('G the goals are the KRs its initiatives anchor to, once each, for the current half', g.per === 'H2 2026' && g.krs.slice().sort().join() === 'KR 1.2,KR 2.1,KR 2.3', JSON.stringify(g));
75
- const gn = await until(() => p.evaluate(() => { const c = [...document.querySelectorAll('#ppPeek .pp-goal .pp-kr:not(.ghost)')].map((k) => ({ kr: k.querySelector('b').textContent, text: k.textContent, dot: k.querySelector('.pp-gd') ? (k.querySelector('.pp-gd.off') ? 'off' : 'ok') : '', label: k.getAttribute('aria-label') || '' })); return c.length && c.every((x) => x.dot) ? c : null; }));
80
+ const gn = await until(() => p.evaluate(() => { const c = [...document.querySelectorAll('#czViewer .pp-goal .pp-kr:not(.ghost)')].map((k) => ({ kr: k.querySelector('b').textContent, text: k.textContent, dot: k.querySelector('.pp-gd') ? (k.querySelector('.pp-gd.off') ? 'off' : 'ok') : '', label: k.getAttribute('aria-label') || '' })); return c.length && c.every((x) => x.dot) ? c : null; }));
76
81
  const kr = (id) => (gn || []).find((x) => x.kr === id) || {};
77
82
  ok('G each KR shows its name from the OKR files and whether Insights reads it as met: 1.2 met, 2.1 on course, 2.3 behind', !!gn
78
83
  && /KR 2\.1Sign-in success 99\.5%$/.test(kr('KR 2.1').text) && /Retire legacy IdP$/.test(kr('KR 2.3').text) && /Microsite conversion \+8%$/.test(kr('KR 1.2').text)
79
84
  && kr('KR 1.2').dot === 'ok' && /, met$/.test(kr('KR 1.2').label) && kr('KR 2.1').dot === 'ok' && /on course$/.test(kr('KR 2.1').label) && kr('KR 2.3').dot === 'off' && /behind$/.test(kr('KR 2.3').label), JSON.stringify(gn));
80
- const mt = await p.evaluate(() => { const t = document.querySelector('#ppPeek .pp-mt'); return { caps: [...t.querySelectorAll('.pp-cap')].map((c) => c.textContent.trim()), ms: [...t.querySelectorAll('.pp-m b')].map((b) => b.textContent), next: (t.querySelector('.pp-dm.n') || {}).parentElement && t.querySelector('.pp-dm.n').parentElement.querySelector('b').textContent, rd: (t.querySelector('.pp-rd') || {}).getAttribute && t.querySelector('.pp-rd').getAttribute('aria-label') }; });
85
+ const mt = await p.evaluate(() => { const t = document.querySelector('#czViewer .pp-mt'); return { caps: [...t.querySelectorAll('.pp-cap')].map((c) => c.textContent.trim()), ms: [...t.querySelectorAll('.pp-m b')].map((b) => b.textContent), next: (t.querySelector('.pp-dm.n') || {}).parentElement && t.querySelector('.pp-dm.n').parentElement.querySelector('b').textContent, rd: (t.querySelector('.pp-rd') || {}).getAttribute && t.querySelector('.pp-rd').getAttribute('aria-label') }; });
81
86
  ok('M the track shows 3 milestones between a done cluster and an "N more" cluster; the next one is marked and counts its initiatives', mt.caps.join('|') === '1 done|4 more' && mt.ms.join('|') === 'Charter approved|Pilot live|Pilot users invited' && mt.next === 'Pilot live' && mt.rd === '0 of 2 initiatives ready', JSON.stringify(mt));
82
- await p.click('#ppPeek .pp-cap:not(.dn)');
83
- const ml = await until(() => p.evaluate(() => { const l = document.querySelector('#ppPeek .pp-ml'); return l ? { tab: document.querySelector('#ppPeek .pp-tab[aria-selected="true"]').textContent.trim(), groups: [...l.querySelectorAll('.pp-mg')].map((x) => x.textContent.trim()), check: [...l.querySelectorAll('.pp-mr')].filter((x) => /A program check/.test(x.textContent)).map((x) => x.querySelector('b').textContent) } : null; }));
84
- ok('M "N more" opens the Milestones tab: Done, Next and Later, and a milestone with no initiative is a program check', !!ml && ml.tab === 'Milestones 8' && ml.groups.join('|') === 'Done · 2|Next · 1|Later · 5' && ml.check.join() === 'Support ready,Program review', JSON.stringify(ml));
85
- await p.click('#ppPeek .pp-mr button.pp-dm[data-ms="support-ready"]');
87
+ const rows = await until(() => p.evaluate(() => { const r = [...document.querySelectorAll('#czViewer .czs-row')].map((b) => b.querySelector('b').textContent + ':' + ((b.querySelector('.czs-n') || {}).textContent || '')); return r.length >= 7 ? r : null; }));
88
+ ok('P the tabs are folding rows: Waits on you, On the program, On its initiatives, On their epics, Initiatives, Milestones, Documents, each with its count', !!rows && /^Waits on you:1\|On the program:2\|On its initiatives:\d+\|On their epics:\d+\|Initiatives:3\|Milestones:8\|Documents:\d+$/.test(rows.join('|')), JSON.stringify(rows));
89
+ await p.click('#czViewer .pp-cap:not(.dn)');
90
+ const ml = await until(() => p.evaluate(() => { const l = document.querySelector('#czViewer [data-czs-id="ms"] .pp-ml'); return l && !l.closest('[hidden]') ? { groups: [...l.querySelectorAll('.pp-mg')].map((x) => x.textContent.trim()), check: [...l.querySelectorAll('.pp-mr')].filter((x) => /A program check/.test(x.textContent)).map((x) => x.querySelector('b').textContent) } : null; }));
91
+ ok('M "N more" opens the Milestones row: Done, Next and Later, and a milestone with no initiative is a program check', !!ml && ml.groups.join('|') === 'Done · 2|Next · 1|Later · 5' && ml.check.join() === 'Support ready,Program review', JSON.stringify(ml));
92
+ await p.click('#czViewer .pp-mr button.pp-dm[data-ms="support-ready"]');
86
93
  const ck = await until(() => D.posts.find((x) => x.path === '/api/programs/check'));
87
94
  ok('X a program check\'s diamond marks it done (POST /api/programs/check)', !!ck && ck.body.program === 'project-ascent' && ck.body.milestone === 'support-ready' && ck.body.done === true, JSON.stringify(ck));
88
- const nr = await p.evaluate(() => [...document.querySelectorAll('#ppPeek .pp-needs .pp-nr')].map((a) => ({ t: a.querySelector('b').textContent, href: a.getAttribute('href'), box: !!a.querySelector('.pp-ck'), sub: a.querySelector('.t span').textContent })));
95
+ const nr = await p.evaluate(() => [...document.querySelectorAll('#czViewer .pp-needs .pp-nr')].map((a) => ({ t: a.querySelector('b').textContent, href: a.getAttribute('href'), box: !!a.querySelector('.pp-ck'), sub: a.querySelector('.t span').textContent })));
89
96
  ok('W waits on you lists your program task as a check box, and it opens in Home at that item; Dara\'s task is not yours', nr.length === 1 && nr[0].t === 'Sign the CIAM vendor order form' && nr[0].box && /^\/premium\.html\?/.test(nr[0].href) && /item=pt%3Aproject-ascent%3Apt-vendor-form/.test(nr[0].href) && /^On the program · /.test(nr[0].sub), JSON.stringify(nr));
90
- await p.click('#ppPeek .pp-tab[data-tab="tree"]');
91
- const tr = await until(() => p.evaluate(() => { const t = document.querySelector('#ppPeek .pp-tree[role="tree"]'); if (!t || /reading its board|not read/.test(t.textContent)) return null; return { rows: [...t.querySelectorAll('.pp-nd.ini .x, .pp-nd.prd2')].map((x) => (x.classList.contains('prd2') ? x.lastChild.textContent : x.textContent).trim()), here: [...t.querySelectorAll('button.pp-open')].map((b) => b.textContent), away: [...t.querySelectorAll('a.pp-open')].map((a) => a.getAttribute('href')) }; }));
92
- ok('T the tree is the program\'s tasks, then each product with its initiatives; the other product\'s initiative is read from its own board and links there', !!tr && tr.rows[0] === 'On the program' && tr.rows.indexOf('IDPF') > 0 && tr.rows.indexOf('Microsites') > tr.rows.indexOf('IDPF') && tr.rows.includes('Microsite sign-in on CIAM') && tr.here.length === 2 && tr.away.length === 1 && /ws=microsites&focus=microsite-signin/.test(tr.away[0]), JSON.stringify(tr));
93
- await p.click('#ppPeek .pp-tab[data-tab="tasks"]');
94
- const tk = await until(() => p.evaluate(() => { const t = document.querySelector('#ppPeek .pp-tree[role="tree"]'); const n = document.querySelector('#ppPeek .pp-tab[data-tab="tasks"] .n'); if (!t || !n || n.textContent !== '7') return null; return { n: n.textContent, heads: [...t.querySelectorAll('.pp-nd.ini .x')].map((x) => x.textContent), rows: [...t.querySelectorAll('a.pp-tk')].map((a) => ({ t: a.querySelector('.x').textContent, href: a.getAttribute('href') })), sort: !!document.querySelector('#ppPeek .pp-sort') }; }));
95
- ok('K the Tasks tab counts every open task of the program and its initiatives, by level; an initiative\'s task opens in Home; no sort card without Turn into a program', !!tk && tk.heads.join('|') === 'On the program|On its initiatives|On their epics'
96
- && tk.rows.length === 5 && tk.rows.some((x) => x.t === 'Pick the sign-in widget') && !tk.rows.some((x) => /Not in the program|Read the Descope docs/.test(x.t)) && /^\/premium\.html\?ws=idpf&ini=legacy-idp-sunset$/.test(tk.rows.find((x) => x.t === 'Draft the cutover plan').href) && !tk.sort, JSON.stringify(tk));
97
- await p.click('#ppPeek .pp-tab[data-tab="tree"]');
98
- await p.click('#ppPeek .pp-nd.ini.pg .tw');
99
- ok('F a group folds', await until(() => p.evaluate(() => document.querySelector('#ppPeek .pp-nd.ini.pg').getAttribute('aria-expanded') === 'false' && !document.querySelector('#ppPeek [data-pp="done"]'))));
100
- await p.click('#ppPeek [data-pp="close"]');
101
- ok('P Close closes the panel', await until(() => p.evaluate(() => document.querySelector('#ppPeek').hidden && !document.body.classList.contains('pk-on'))));
97
+ const tr = await until(() => p.evaluate(() => { const t = document.querySelector('#czViewer [data-czs-id="tree"] .pp-tree[role="tree"]'); if (!t || /reading its board|not read/.test(t.textContent)) return null; return { rows: [...t.querySelectorAll('.pp-nd.ini .x, .pp-nd.prd2')].map((x) => (x.classList.contains('prd2') ? x.lastChild.textContent : x.textContent).trim()), here: [...t.querySelectorAll('button.pp-open')].map((b) => b.textContent), away: [...t.querySelectorAll('a.pp-open')].map((a) => a.getAttribute('href')) }; }));
98
+ ok('T Initiatives lists each product with its initiatives; the other product\'s initiative is read from its own board and links there', !!tr && tr.rows[0] === 'IDPF' && tr.rows.indexOf('Microsites') > tr.rows.indexOf('IDPF') && tr.rows.includes('Microsite sign-in on CIAM') && tr.here.length === 2 && tr.away.length === 1 && /ws=microsites&focus=microsite-signin/.test(tr.away[0]), JSON.stringify(tr));
99
+ const tk = await until(() => p.evaluate(() => { const one = (k) => { const s = document.querySelector(`#czViewer [data-czs-id="${k}"]`); return s ? { n: (s.querySelector('.czs-n') || {}).textContent || '', rows: [...s.querySelectorAll('a.pp-tk')].map((a) => ({ t: a.querySelector('.x').textContent, href: a.getAttribute('href') })) } : null; };
100
+ const i = one('itasks'), e = one('etasks'); return i && e ? { i, e, sort: !!(document.querySelector('#czViewer .czs-pri') || {}).textContent } : null; }));
101
+ if (tk) { await fold(p, 'itasks'); await fold(p, 'etasks'); }
102
+ const tk2 = await p.evaluate(() => [...document.querySelectorAll('#czViewer [data-czs-id="itasks"] a.pp-tk, #czViewer [data-czs-id="etasks"] a.pp-tk')].map((a) => ({ t: a.querySelector('.x').textContent, href: a.getAttribute('href') })));
103
+ ok('K every open task of its initiatives has a row by level, On its initiatives and On their epics (with On the program, 7); an initiative\'s task opens in Home; no sort primary without Turn into a program', !!tk && +tk.i.n + +tk.e.n === 5
104
+ && tk2.length === 5 && tk2.some((x) => x.t === 'Pick the sign-in widget') && !tk2.some((x) => /Not in the program|Read the Descope docs/.test(x.t)) && /^\/premium\.html\?ws=idpf&ini=legacy-idp-sunset$/.test((tk2.find((x) => x.t === 'Draft the cutover plan') || {}).href) && !tk.sort, JSON.stringify({ tk, tk2 }));
105
+ await fold(p, 'itasks'); await fold(p, 'etasks');
106
+ await fold(p, 'tree');
107
+ ok('F a row folds', await until(() => p.evaluate(() => document.querySelector('#czViewer [data-czs-fold="tree"]').getAttribute('aria-expanded') === 'false')));
108
+ await p.click('#czViewer [data-cz-vw="close"]');
109
+ ok('P Close closes the Viewer', await until(() => p.evaluate(() => document.querySelector('#czViewer').hidden)));
102
110
  await p.reload();
103
111
  await shown(p);
104
- ok('F the fold and the tab are kept after a reload', await until(() => p.evaluate(() => { const g2 = document.querySelector('#ppPeek .pp-nd.ini.pg'); return !!g2 && g2.getAttribute('aria-expanded') === 'false' && document.querySelector('#ppPeek .pp-tab[aria-selected="true"]').dataset.tab === 'tree'; })));
105
- await p.click('#ppPeek .pp-nd.ini.pg .tw');
106
- await until(() => p.evaluate(() => !!document.querySelector('#ppPeek [data-pp="done"]')));
107
- await p.click('#ppPeek [data-pp="done"][data-key="pt-vendor-form"]');
112
+ ok('F the folds are kept after a reload', await until(async () => !(await isOpen(p, 'tree')) && await isOpen(p, 'ms')));
113
+ await fold(p, 'tasks');
114
+ await until(() => p.evaluate(() => !!document.querySelector('#czViewer [data-pp="done"][data-key="pt-vendor-form"]')));
115
+ await p.click('#czViewer [data-pp="done"][data-key="pt-vendor-form"]');
108
116
  const dn = await until(() => D.posts.find((x) => x.path === '/api/programs/task-done'));
109
117
  ok('X a program task\'s check box marks it done (POST /api/programs/task-done)', !!dn && dn.body.key === 'pt-vendor-form' && dn.body.done === true && dn.body.program === 'project-ascent', JSON.stringify(dn));
110
- await p.click('#ppPeek button.pp-open[data-ini="descope-parity"]');
111
- const ip = await until(() => p.evaluate(() => { const k = document.querySelector('#peek'); if (!k || k.hidden) return null; const r = k.getBoundingClientRect(); return { t: document.querySelector('#pkTitle').textContent, prog: document.querySelector('#ppPeek').hidden, w: Math.round(r.width), vw: innerWidth, lad: [...k.querySelectorAll('.pk-lad span')].map((s) => s.textContent).join() }; }));
112
- ok('O an initiative in the tree opens the Board\'s initiative panel in the same place, and the program panel closes', !!ip && ip.t === 'Descope feature parity' && ip.prog, JSON.stringify(ip));
113
- ok('B1 the initiative panel is 60 % of the width on desktop and names the steps in full (XnAgBoardPanel)', !!ip && Math.abs(ip.w - Math.round(ip.vw * 0.6)) <= 1 && ip.lad === 'Triage,Discover,Plan,Prioritize,Build,Deliver,Monitor,Evaluate', JSON.stringify(ip));
118
+ await fold(p, 'tree');
119
+ await until(() => p.evaluate(() => !!document.querySelector('#czViewer button.pp-open[data-ini="descope-parity"]')));
120
+ await p.click('#czViewer button.pp-open[data-ini="descope-parity"]');
121
+ const ip = await until(() => p.evaluate(() => { const v = document.querySelector('#czViewer'); if (!v || v.hidden || !/Initiative/.test(v.getAttribute('aria-label') || '')) return null; return { t: v.querySelector('.cz-vw-title').textContent, peek: !document.querySelector('#peek'), stg: v.querySelectorAll('.xv-stg i').length }; }));
122
+ ok('O an initiative in the tree opens the Board\'s initiative in the same shell, with its eight steps (XvABoard)', !!ip && ip.t === 'Descope feature parity' && ip.peek && ip.stg === 8, JSON.stringify(ip));
114
123
  await p.keyboard.press('Escape');
115
- await until(() => p.evaluate(() => document.querySelector('#peek').hidden));
124
+ await until(() => p.evaluate(() => document.querySelector('#czViewer').hidden));
116
125
  await p.click('#ibBody [data-prog="project-ascent"]');
117
- ok('O the Board\'s program row opens the program panel (bd:program)', await shown(p));
118
- await p.focus('.pk-grip');
126
+ ok('O the Board\'s program row opens the program (bd:program)', await shown(p));
127
+ await p.focus('#czViewer .cz-vw-grip');
119
128
  await p.keyboard.press('ArrowLeft');
120
- const gw = await p.evaluate(() => { const r = document.querySelector('#ppPeek').getBoundingClientRect(); let kept = null; try { kept = localStorage.getItem('pmos.board.pkw'); } catch { /* none */ } return { w: Math.round(r.width), vw: innerWidth, kept, now: document.querySelector('.pk-grip').getAttribute('aria-valuenow') }; });
121
- ok('B1 the grip on the panel\'s edge widens it within 50 to 70 %, and the width is kept', Math.abs(gw.w - Math.round(gw.vw * 0.62)) <= 1 && gw.kept === '62' && gw.now === '62', JSON.stringify(gw));
129
+ const gw = await p.evaluate(() => { const r = document.querySelector('#czViewer').getBoundingClientRect(); let kept = null; try { kept = localStorage.getItem('cz-vw-w:program'); } catch { /* none */ } return { w: Math.round(r.width), kept }; });
130
+ ok('V the grip on the Viewer\'s edge widens it, and the width is kept for programs', gw.w === 584 && gw.kept === '584', JSON.stringify(gw));
122
131
  await p.keyboard.press('Escape');
123
- ok('P Escape closes the panel and gives the focus back to the program row', await until(() => p.evaluate(() => document.querySelector('#ppPeek').hidden && document.activeElement && document.activeElement.matches('[data-prog="project-ascent"]'))));
132
+ ok('P Escape closes the Viewer', await until(() => p.evaluate(() => document.querySelector('#czViewer').hidden)));
124
133
  ok('0 no page error on desktop', D.errors.length === 0, D.errors.join(' | '));
125
134
  await D.ctx.close();
126
135
 
127
136
  /* ── Turn into a program: the sort card counts the tasks of the initiative it came from that have no level, and sorting starts in Home ── */
128
137
  const U = await open({ programs: F.programs().map((x) => ({ ...x, from: 'legacy-idp-sunset' })) });
129
138
  await shown(U.page);
130
- const so = await until(() => U.page.evaluate(() => { const c = document.querySelector('#ppPeek .pp-sort'); return c ? { t: c.querySelector('b').textContent, href: c.querySelector('a.pp-cta').getAttribute('href') } : null; }));
131
- ok('K after Turn into a program the sort card counts the tasks from before the split (not the one already on an epic) and opens the sorting in Home', !!so && so.t === '2 tasks from before the split have no level yet' && /^\/premium\.html\?ws=idpf&ask=program%3Aproject-ascent&q=/.test(so.href), JSON.stringify(so));
139
+ const so = await until(() => U.page.evaluate(() => { const c = document.querySelector('#czViewer a.czs-pri'); return c ? { t: (document.querySelector('#czViewer .czs-p') || {}).textContent || '', label: c.textContent, href: c.getAttribute('href') } : null; }));
140
+ ok('K after Turn into a program the summary counts the tasks from before the split (not the one already on an epic), and its primary opens the sorting in Home', !!so && /^2 tasks from before the split have no level yet\./.test(so.t) && so.label === 'Review the suggested homes' && /^\/premium\.html\?ws=idpf&ask=program%3Aproject-ascent&q=/.test(so.href), JSON.stringify(so));
132
141
  ok('0 no page error after Turn into a program', U.errors.length === 0, U.errors.join(' | '));
133
142
  await U.ctx.close();
134
143
 
135
144
  /* ── phone ── */
136
145
  const S = await open({ w: 390, h: 844 });
137
- ok('S on a phone the program panel opens', await shown(S.page));
138
- const sh = await S.page.evaluate(() => { const r = document.querySelector('#ppPeek').getBoundingClientRect(); return { l: Math.round(r.left), w: Math.round(r.width), b: Math.round(innerHeight - r.bottom), vw: innerWidth, grip: getComputedStyle(document.querySelector('.pk-grip')).display, wide: document.documentElement.scrollWidth <= innerWidth + 1 }; });
139
- ok('S it is the Board\'s bottom sheet across the width, with no grip and no sideways scroll', sh.l === 0 && sh.w === sh.vw && sh.b === 0 && sh.grip === 'none' && sh.wide, JSON.stringify(sh));
146
+ ok('S on a phone the program opens', await shown(S.page));
147
+ const sh = await S.page.evaluate(() => { const r = document.querySelector('#czViewer').getBoundingClientRect(); const g = document.querySelector('#czViewer .cz-vw-grip'); return { l: Math.round(r.left), w: Math.round(r.width), h: Math.round(r.height), vw: innerWidth, vh: innerHeight, grip: !g || getComputedStyle(g).display === 'none', wide: document.documentElement.scrollWidth <= innerWidth + 1 }; });
148
+ ok('S it covers the whole screen, with no grip and no sideways scroll', sh.l === 0 && sh.w === sh.vw && sh.h === sh.vh && sh.grip && sh.wide, JSON.stringify(sh));
140
149
  ok('0 no page error on a phone', S.errors.length === 0, S.errors.join(' | '));
141
150
  await S.ctx.close();
142
151
  finish();
@@ -308,7 +308,7 @@ const DKINDS = ['In PMOS', 'Confluence', 'Google Docs', 'Google Slides'];
308
308
  const radios = (name, L, cur) => `<div class="bd-rad" role="radiogroup">${L.map(([v, l]) => `<label><input type="radio" name="${name}" value="${esc(v)}"${v === cur ? ' checked' : ''}><span>${esc(l)}</span></label>`).join('')}</div>`;
309
309
  function openAddDoc(from) {
310
310
  panel('Add a document', `<form class="bd-form" data-form="adddoc"><label>Title<input name="title" maxlength="80" placeholder="For example: UAT plan"></label><p class="bd-albl">Who writes it</p>${radios('writer', [['drafts', 'PMOS drafts it'], ['you', 'I write it']], 'drafts')}<label>Where it lives<select name="kind">${DKINDS.map((k) => `<option>${k}</option>`).join('')}</select></label><label>Address<input name="url" maxlength="300" placeholder="https://" disabled></label><p class="bd-amut">It is saved on the board's record. PMOS does not read or sync a linked page.</p>${msg('formM')}<div class="bd-arow"><button type="submit" class="bd-btn solid">Add</button><button type="button" class="bd-btn" data-pk="close">Not now</button></div></form>`, from, { eye: 'Documents' });
311
- const f = $('#peek form[data-form="adddoc"]'); if (f) f.kind.onchange = () => { f.url.disabled = f.kind.value === 'In PMOS'; };
311
+ const f = $('#czViewer form[data-form="adddoc"]'); if (f) f.kind.onchange = () => { f.url.disabled = f.kind.value === 'In PMOS'; };
312
312
  }
313
313
 
314
314
  /* ── Metrics and Notifications ─────────────────────────────────────────────────────────────────────────────────── */
@@ -293,16 +293,18 @@ function grillHtml() {
293
293
  + (qs.length ? `<div class="bd-qhd"><b>${qs.length} ${qs.length === 1 ? 'question' : 'questions'} before the BRD</b><span class="bd-amut">Only what the material does not answer</span></div>${qs.map(card).join('')}` : '<p class="bd-amut">Nothing is left to ask: the BRD can start from what you gave.</p>')
294
294
  + `<p class="bd-amsg" id="grM" role="status"></p><div class="bd-arow bd-pfoot">${qs.length ? `<button type="button" class="bd-btn solid" data-grill="next">${last ? 'Done' : 'Next question'}</button>` : ''}<button type="button" class="bd-btn ghost" data-grill="later">Later</button><span class="bd-amut bd-push">${open ? 'Later keeps them as the next step' : 'Every question is answered'}</span></div></div>`;
295
295
  }
296
+ /** The questions in the Viewer's shell (premium-board.js actsPanel): the shell's Close (×, Escape) is the same as Later. */
297
+ const grillPanel = (from) => A.panel(grillHtml(), from || null, 'pk-new', { onClose: () => { later(); } });
296
298
  export async function openGrill(id, title, stage, fresh, from) {
297
299
  Q = { id, title, stage, fresh: !!fresh, data: null, at: 0 };
298
- A.panel(grillHtml(), from || null, 'pk-new');
300
+ grillPanel(from);
299
301
  const g = await gget(id); if (!Q || Q.id !== id) return;
300
302
  Q.data = g; Q.at = Math.max(0, g ? g.questions.findIndex((x) => !x.answer) : 0);
301
- A.panel(grillHtml(), null, 'pk-new');
303
+ grillPanel();
302
304
  }
303
305
  async function saveCur() {
304
306
  const cur = Q.data && Q.data.questions[Q.at]; if (!cur) return true;
305
- const box = document.querySelector('#peek .bd-qc.on'); if (!box) return true;
307
+ const box = document.querySelector('#czViewer .bd-qc.on'); if (!box) return true;
306
308
  const typed = (box.querySelector('input[name="qa"]') || {}).value || '', chip = box.querySelector('[data-qchip].on');
307
309
  const answer = typed.trim() || (chip ? chip.dataset.qchip : '');
308
310
  if (answer === (cur.answer || '')) return true;
@@ -311,17 +313,30 @@ async function saveCur() {
311
313
  Q.data = r; return true;
312
314
  }
313
315
  document.addEventListener('click', async (e) => {
314
- if (!Q || !e.target.closest('#peek')) return;
315
- const c = e.target.closest('[data-qchip]'); if (c) { $$('#peek [data-qchip]').forEach((x) => { const on = x === c && !x.classList.contains('on'); x.classList.toggle('on', on); x.setAttribute('aria-checked', String(on)); }); return; }
316
- const go = e.target.closest('[data-qgo]'); if (go) { if (await saveCur()) { Q.at = +go.dataset.qgo; A.panel(grillHtml(), null, 'pk-new'); } return; }
316
+ if (!Q || !e.target.closest('#czViewer')) return;
317
+ const c = e.target.closest('[data-qchip]'); if (c) { $$('#czViewer [data-qchip]').forEach((x) => { const on = x === c && !x.classList.contains('on'); x.classList.toggle('on', on); x.setAttribute('aria-checked', String(on)); }); return; }
318
+ const go = e.target.closest('[data-qgo]'); if (go) { if (await saveCur()) { Q.at = +go.dataset.qgo; grillPanel(); } return; }
317
319
  const b = e.target.closest('[data-grill]'); if (!b) return;
318
320
  if (!(await saveCur())) return;
319
321
  const open = Q.data ? Q.data.questions.filter((x) => !x.answer).length : 0, title = Q.title;
320
- if (b.dataset.grill === 'next' && Q.at < ((Q.data && Q.data.questions.length) || 0) - 1) { Q.at++; A.panel(grillHtml(), null, 'pk-new'); const i = $('#peek .bd-qc.on input'); if (i) i.focus(); return; }
322
+ if (b.dataset.grill === 'next' && Q.at < ((Q.data && Q.data.questions.length) || 0) - 1) { Q.at++; grillPanel(); const i = $('#czViewer .bd-qc.on input'); if (i) i.focus(); return; }
321
323
  if (b.dataset.grill === 'later' && open) await post('/api/board-grill/later', { ws: wsOf(Q.id), id: Q.id }).catch(() => null);
322
324
  Q = null; A.close();
323
325
  A.say(open ? 'Kept as the next step of ' + title + ': ' + open + ' open ' + (open === 1 ? 'question' : 'questions') + '.' : 'The answers are kept on ' + title + ' for its BRD.');
324
326
  A.load();
325
327
  });
328
+ /** The shell closed the questions while they showed: the answer typed is kept, and the open ones stay as the next step, as Later does. */
329
+ async function later() {
330
+ if (!Q) return;
331
+ const q = Q, cur = q.data && q.data.questions[q.at], box = document.querySelector('#czViewer .bd-qc.on');
332
+ const typed = box ? ((box.querySelector('input[name="qa"]') || {}).value || '').trim() || ((box.querySelector('[data-qchip].on') || {}).dataset || {}).qchip || '' : '';
333
+ Q = null;
334
+ let data = q.data;
335
+ if (cur && typed && typed !== (cur.answer || '')) { const r = await post('/api/board-grill/answer', { ws: wsOf(q.id), id: q.id, q: cur.key, answer: typed }).catch(() => null); if (r && r.ok) data = r; }
336
+ const open = data ? data.questions.filter((x) => !x.answer).length : 0;
337
+ if (open) await post('/api/board-grill/later', { ws: wsOf(q.id), id: q.id }).catch(() => null);
338
+ A.say(open ? 'Kept as the next step of ' + q.title + ': ' + open + ' open ' + (open === 1 ? 'question' : 'questions') + '.' : 'The answers are kept on ' + q.title + ' for its BRD.');
339
+ A.load();
340
+ }
326
341
  export const grillOpen = () => !!Q;
327
342
  export function dropGrill() { Q = null; N = null; }