create-pmos 0.395.0 → 0.397.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 (100) hide show
  1. package/package.json +25 -30
  2. package/payload/KIT-VERSION +1 -1
  3. package/payload/planning/evals/eval-calibration.md +1 -1
  4. package/payload/planning/okrs/health-budgets.md +1 -1
  5. package/payload/scripts/nine-stages.js +49 -20
  6. package/payload/state/discoveries.md +1 -1
  7. package/workspace/briefing-premium-adddoc-test.js +20 -40
  8. package/workspace/briefing-premium-board-test.js +145 -107
  9. package/workspace/briefing-premium-calendar-2-test.js +5 -2
  10. package/workspace/briefing-premium-calendar-3-test.js +13 -8
  11. package/workspace/briefing-premium-calendar-test.js +16 -5
  12. package/workspace/briefing-premium-initiative-test.js +50 -41
  13. package/workspace/briefing-premium-insights-test.js +104 -85
  14. package/workspace/briefing-premium-metrics-test.js +11 -32
  15. package/workspace/briefing-premium-sources-test.js +42 -21
  16. package/workspace/briefing-premium-test.js +112 -98
  17. package/workspace/briefing-premium-work-test.js +78 -64
  18. package/workspace/changelog.json +24 -0
  19. package/workspace/fixtures/board-premium-facts.js +2 -1
  20. package/workspace/fixtures/board-premium-jira.js +28 -0
  21. package/workspace/fixtures/initiative-premium-facts.js +2 -1
  22. package/workspace/fixtures/initiatives-api/list.json +30 -42
  23. package/workspace/fixtures/initiatives-api/roadmap.json +40 -56
  24. package/workspace/fixtures/initiatives-api/sheet.json +10 -14
  25. package/workspace/fixtures/insights-premium-facts.js +11 -2
  26. package/workspace/guide/briefing-premium.md +3 -1
  27. package/workspace/guide/index.md +1 -0
  28. package/workspace/guide/lifecycle.md +51 -0
  29. package/workspace/home-shot.js +38 -0
  30. package/workspace/lib/board-premium.js +92 -1
  31. package/workspace/lib/engine/boards.js +15 -14
  32. package/workspace/lib/engine/nine-stages.js +49 -20
  33. package/workspace/lib/engine/signals/detectors.js +13 -11
  34. package/workspace/lib/insights-premium.js +78 -1
  35. package/workspace/lib/routes-board-premium.js +3 -2
  36. package/workspace/lib/routes-initiatives.js +1 -1
  37. package/workspace/lib/routes-insights-premium.js +8 -1
  38. package/workspace/lib/vendor/scripts/nine-stages.js +49 -20
  39. package/workspace/package-lock.json +2 -2
  40. package/workspace/package.json +1 -1
  41. package/workspace/premium-agreed-viewer-shots.js +76 -0
  42. package/workspace/premium-board-actions-test.js +2 -0
  43. package/workspace/premium-chat-chart-tab-test.js +6 -5
  44. package/workspace/premium-chat-context-test.js +8 -6
  45. package/workspace/premium-chat-goal-view-test.js +9 -7
  46. package/workspace/premium-chat-notes-test.js +3 -2
  47. package/workspace/premium-chat-report-tab-test.js +8 -2
  48. package/workspace/premium-chat-term-test.js +3 -1
  49. package/workspace/premium-chat-viewer-test.js +23 -17
  50. package/workspace/premium-core-doc-issue-test.js +2 -0
  51. package/workspace/premium-html-viewer-test.js +4 -2
  52. package/workspace/premium-phone-card-test.js +1 -0
  53. package/workspace/premium-phone-room-test.js +16 -11
  54. package/workspace/premium-report-read-test.js +1 -1
  55. package/workspace/premium-vw-backlog-test.js +2 -0
  56. package/workspace/premium-vw-cal-test.js +9 -4
  57. package/workspace/premium-vw-doc-test.js +1 -1
  58. package/workspace/premium-vw-item-test.js +1 -0
  59. package/workspace/premium-vw-jira-test.js +4 -1
  60. package/workspace/premium-vw-notes-test.js +2 -1
  61. package/workspace/premium-vw-rec-test.js +3 -2
  62. package/workspace/premium-vw-slides-test.js +2 -2
  63. package/workspace/premium-work-depth-test.js +7 -3
  64. package/workspace/public/pm/bd-span.js +120 -0
  65. package/workspace/public/pm/bd-stages.js +33 -0
  66. package/workspace/public/pm/cozy-board.css +373 -0
  67. package/workspace/public/pm/cozy-home.css +152 -0
  68. package/workspace/public/pm/cozy-home.js +170 -0
  69. package/workspace/public/pm/cozy-initiative.css +138 -0
  70. package/workspace/public/pm/cozy-insights.css +292 -0
  71. package/workspace/public/pm/cozy-nav.js +54 -0
  72. package/workspace/public/pm/cozy-viewer.css +143 -0
  73. package/workspace/public/pm/cozy.css +172 -0
  74. package/workspace/public/pm/lifecycle-lens-model.js +45 -27
  75. package/workspace/public/pm/lifecycle-lens.js +22 -11
  76. package/workspace/public/pm/premium-board.js +329 -67
  77. package/workspace/public/pm/premium-brief.js +1 -1
  78. package/workspace/public/pm/premium-chat.js +17 -10
  79. package/workspace/public/pm/premium-initiative-head.js +138 -0
  80. package/workspace/public/pm/premium-initiative.js +28 -4
  81. package/workspace/public/pm/premium-insights.js +530 -244
  82. package/workspace/public/pm/premium-shell.js +40 -10
  83. package/workspace/public/pm/premium-viewer.js +5 -0
  84. package/workspace/public/pm/premium-vw-jira-model.js +22 -5
  85. package/workspace/public/pm/premium-vw-jira.css +11 -0
  86. package/workspace/public/pm/premium-vw-jira.js +11 -4
  87. package/workspace/public/pm/premium-vw-rec.js +5 -2
  88. package/workspace/public/pm/premium-wide.css +30 -0
  89. package/workspace/public/pm/premium-work.js +18 -8
  90. package/workspace/public/pm/premium.js +19 -6
  91. package/workspace/public/premium-board.html +83 -47
  92. package/workspace/public/premium-chat.html +7 -32
  93. package/workspace/public/premium-initiative.html +16 -8
  94. package/workspace/public/premium-insights.html +83 -43
  95. package/workspace/public/premium-work.html +6 -71
  96. package/workspace/public/premium.html +62 -15
  97. package/workspace/public/vendor/nunito-var.woff2 +0 -0
  98. package/workspace/server.js +7 -0
  99. package/workspace/test-lists/premium-agreed-viewer.json +9 -0
  100. package/workspace/third-party/README.md +1 -0
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
- /* briefing-premium-board-test.js — the premium Board page (initiative briefing-premium-board; planning/prd/briefing-premium-board-prd.md B1 to B13).
3
+ /* briefing-premium-board-test.js — the premium Board page (initiative briefing-premium-board; planning/prd/briefing-premium-board-prd.md B1 to B13),
4
+ * rebuilt to the Agreed design (initiative premium-agreed-design: AgBoard* frames, N1 N2).
4
5
  * Serves the real page from the real server. Most checks answer GET /api/board-premium with the model lib/board-premium.js builds from a fixture
5
6
  * (fixtures/board-premium-facts.js); the last block reads this repository's own board through the real routes and presses nothing that starts a run.
6
7
  * B1 place · B2 reading · B3 header counts · B4 list · B5 stages · B6 timeline · B7 core documents · B8 release · B9 sprint · B10 dialog · B11 one count · B12 labels · B13 floors and fidelity */
@@ -8,11 +9,10 @@ const fs = require('fs');
8
9
  const path = require('path');
9
10
  const { spawn } = require('child_process');
10
11
  const { findBrowser } = require('./lib/find-browser');
11
- const CT = require('./lib/premium-console-type'); // the mockup is read with the console's type (PM, 2026-10-19), as premium.css is
12
- const CT_VENDOR = 'file://' + path.join(__dirname, 'public', 'vendor') + '/';
13
12
  const T = require('./test-run').configure({ name: 'briefing-premium-board' });
14
13
  const BP = require('./lib/board-premium.js');
15
14
  const F = require('./fixtures/board-premium-facts.js');
15
+ const FJ = require('./fixtures/board-premium-jira.js');
16
16
 
17
17
  const BASE = T.BASE;
18
18
  const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
@@ -31,7 +31,6 @@ const finish = async (code) => {
31
31
  process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
32
32
 
33
33
  const mk = (o) => BP.build(F.facts(o));
34
- const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'briefing-artifact.html');
35
34
 
36
35
  (async () => {
37
36
  const exe = findBrowser();
@@ -62,71 +61,129 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
62
61
  const p = A.page, M = mk();
63
62
  const txt = (s) => p.evaluate((q) => (document.querySelector(q) || {}).textContent || '', s);
64
63
 
65
- /* B1 */
66
- const rail = await p.evaluate(() => ({ names: [...document.querySelectorAll('.rail .pl')].map((b) => b.textContent.trim()), cur: document.querySelector('.rail [aria-current="page"]').textContent.trim(), pi: getComputedStyle(document.querySelector('.rail')).getPropertyValue('--pi').trim(), title: document.title, name: document.querySelector('#crBoard').textContent, sw: document.querySelector('#crSw').hidden }));
67
- ok('B1 the rail names five places, Board is current, the board is named and has no switcher for one board', rail.names.join() === 'Briefing,My work,Chat,Board,Insights' && rail.cur === 'Board' && rail.pi === '3' && rail.name === 'pmos' && rail.sw, JSON.stringify(rail));
68
- { await p.click('#moreBtn'); const tc = await p.evaluate(() => { const a = document.querySelector('#toConsole'); if (!a) return null; const r = a.getBoundingClientRect(); return { href: a.getAttribute('href'), label: a.getAttribute('aria-label'), w: Math.round(r.width), h: Math.round(r.height), tab: a.tabIndex }; }); ok('B1 the ⋯ menu links to the console (premium-console-link, premium-topbar)', tc && tc.href === '/console.html' && tc.label === 'Open the console' && tc.w >= 44 && tc.h >= 44 && tc.tab === 0, JSON.stringify(tc)); await p.keyboard.press('Escape'); }
64
+ const view = async (pg, v) => { await pg.evaluate((x) => document.querySelector(`#ibTabs [data-v="${x}"]`).click(), v); await sleep(150); };
65
+ const spanTo = async (pg, s) => { await pg.click(`#bdSpans [data-sp="${s}"]`); await sleep(150); };
66
+
67
+ /* B1 (premium-agreed-design N1 N2): the floating place menu, no page header, one toolbar */
68
+ const place = await p.evaluate(() => { const f = document.querySelector('#czFab'), h1 = document.querySelector('main h1'), r = h1.getBoundingClientRect(), tb = document.querySelector('.bd-hd').getBoundingClientRect(); return { fab: f && f.getAttribute('aria-label'), w: Math.round(f.getBoundingClientRect().width), rail: getComputedStyle(document.querySelector('.rail')).display, h1: Math.round(r.width) + 'x' + Math.round(r.height), top: Math.round(tb.top), name: document.querySelector('#crBoard').textContent, sw: document.querySelector('#crSw').hidden, title: document.title }; });
69
+ ok('N1 the floating menu is the one way between places: 56 px, it says Board, and the rail is not on screen', place.fab === 'Open the menu. You are in Board' && place.w === 56 && place.rail === 'none', JSON.stringify(place));
70
+ ok('N2 no page header on desktop: the heading is for screen readers only and the toolbar starts at the top', place.h1 === '1x1' && place.top < 60 && place.name === 'pmos' && place.sw, JSON.stringify(place));
71
+ await p.click('#czFab');
72
+ const menu = await p.evaluate(() => [...document.querySelectorAll('#czMenu a')].map((a) => a.textContent + (a.getAttribute('aria-current') ? '*' : '') + '>' + a.getAttribute('href')).join('|'));
73
+ ok('N1 the menu opens Home, Board and Insights, and marks Board', menu === 'Home>/premium.html|Board*>/premium-board.html|Insights>/premium-insights.html', menu);
74
+ await p.keyboard.press('Escape');
75
+ { await p.click('#moreBtn'); const tc = await p.evaluate(() => { const a = document.querySelector('#toConsole'); if (!a) return null; const r = a.getBoundingClientRect(); return { href: a.getAttribute('href'), label: a.getAttribute('aria-label'), w: Math.round(r.width), h: Math.round(r.height), tab: a.tabIndex, board: ['#miSteps', '#miSpr', '#miMet', '#miGone'].every((s) => !!document.querySelector('#moreMenu ' + s)) }; }); ok('B1 the ⋯ menu links to the console and holds the Board\'s own items (steps, sprint and release, metrics, cancelled and archived)', tc && tc.href === '/console.html' && tc.label === 'Open the console' && tc.w >= 44 && tc.h >= 44 && tc.tab === 0 && tc.board, JSON.stringify(tc)); await p.keyboard.press('Escape'); }
69
76
  ok('B1 the page is served at /premium-board and /premium-board.html', (await fetch(BASE + '/premium-board')).status === 200 && (await fetch(BASE + '/premium-board.html')).status === 200);
70
- for (const [go, re] of [['brief', /\/premium\.html$/], ['work', /\/premium-work\.html$/]]) {
71
- const r2 = await open(); await r2.page.locator(`.rail [data-go="${go}"]`).click();
72
- ok(`B1 the ${go === 'brief' ? 'Briefing' : 'My work'} button opens its premium page`, await until(() => re.test(r2.page.url()), 5000), r2.page.url());
73
- await r2.ctx.close();
77
+
78
+ /* B1 the stage track (premium-agreed-design): eight columns, two of them milestones, the board's counts, rows by stage */
79
+ /* re-pointed for premium-agreed-design: the milestone mark is now a drawn diamond (.msh header holding .cz-ms, cozy.css), not a ◆ glyph in the text;
80
+ * the heads read '◆ ' only where that shape is present, so the check still pins which two columns are milestones. Evaluate 21 is the fixture's own count (+20 done). */
81
+ const tr = await p.evaluate(() => ({ heads: [...document.querySelectorAll('.bt-h .bt-cells > div')].map((d) => (d.classList.contains('msh') && d.querySelector('.cz-ms') ? '◆ ' : '') + d.textContent.replace(/\s+/g, ' ').trim()), rows: [...document.querySelectorAll('#ibBody .bt-l')].map((r) => ({ t: r.querySelector('.bt-nm b').textContent, cur: [...r.querySelectorAll('.bt-cells > div')].findIndex((c) => c.classList.contains('c')), out: r.querySelector('.bt-dl .t1 b').textContent, prog: r.querySelector('.bt-dl .t1 span').textContent, st: r.querySelector('.cs').textContent })), pressed: document.querySelector('#ibTabs [aria-pressed="true"]').dataset.v }));
82
+ ok('B1 the default view is the stage track with six stages and two milestones, each with the board\'s count (old names count for the new ones)', tr.pressed === 'track' && tr.heads.join('|') === 'Triage0|Discover1|Plan1|Prioritize0|Build2|◆ Deliver1|Monitor1|◆ Evaluate21', JSON.stringify(tr.heads));
83
+ ok('B1 one row per initiative, sorted by stage, with its current step marked', tr.rows.length === 7 && tr.rows.map((r) => r.cur).join() === '1,2,4,4,5,6,7' && tr.rows[0].t === 'Usage-based billing', JSON.stringify(tr.rows.map((r) => r.t + ':' + r.cur)));
84
+ ok('B1 the Output column names what finishes the step and the progress a record holds; nothing is invented', tr.rows[0].out === 'PRD complete' && tr.rows[0].prog === 'Not counted yet' && tr.rows[1].out === 'Scope, timeline, work breakdown' && tr.rows[1].prog === '18%' && tr.rows[6].out === 'Keep, iterate or stop', JSON.stringify(tr.rows.map((r) => r.out + ':' + r.prog)));
85
+ ok('B1 the status line says late in days over and at risk with no owner', tr.rows.some((r) => /^\d+ days over$/.test(r.st)) && tr.rows[0].st === 'At risk · no owner', JSON.stringify(tr.rows.map((r) => r.st)));
86
+ ok('M1 only the info, warning and critical dots move', await p.evaluate(() => [...document.querySelectorAll('#stage *')].filter((e) => { const a = getComputedStyle(e, '::after').animationName, b = getComputedStyle(e).animationName; return (a && a !== 'none') || (b && b !== 'none'); }).every((e) => e.matches('.cz-dot.m-info, .cz-dot.m-warn, .cz-dot.m-crit'))));
87
+ {
88
+ const R = await open({ model: BP.build(FJ.facts()) }), q = R.page;
89
+ const c = await q.evaluate(() => ({ chips: [...document.querySelectorAll('#bdChipset .cz-chip')].map((b) => b.textContent.replace(/\s+/g, ' ').trim()), segs: [...document.querySelectorAll('.bt-l[data-row="board:self-serve-v2"] .seg5 .bt-tk')].map((b) => b.className.replace('bt-tk ', '')).join(), sso: document.querySelector('.bt-l[data-row="board:sso-partners"] .bt-dl').textContent }));
90
+ ok('B1 the chips read Jira, the sprint and the release, the new asks, late, at risk and blocked from the records', /^Jira · read /.test(c.chips[0]) && c.chips[1] === 'Sprint 24 · v2.4 ships 4 Nov' && c.chips[2] === '1 new ask' && c.chips.includes('1 late') && c.chips.includes('3 at risk') && c.chips.includes('1 blocked') && c.chips.includes('This sprint'), JSON.stringify(c.chips));
91
+ ok('B1 Build progress is the Jira tickets in points, one segment each; a blocked ticket shows in red and says why', c.segs === 'dn,dn,rv,ip,td' && /v2\.4 shipped \+ your sign-off/.test(c.sso) && /SSO-12 blocked · Waiting on PLAT-88/.test(c.sso), JSON.stringify(c));
92
+ await q.click('#bdChipset [data-f="blocked"]');
93
+ ok('B1 a chip filters the rows to what it counts', await q.evaluate(() => [...document.querySelectorAll('#ibBody .bt-l')].map((r) => r.dataset.row).join() === 'board:sso-partners'));
94
+ await q.click('#bdChipset [data-f="blocked"]');
95
+ await q.click('.bt-l[data-row="board:sso-partners"] .bt-nm');
96
+ const pk = await until(() => q.evaluate(() => { const k = document.querySelector('#peek'); return k && !k.hidden ? { t: document.querySelector('#pkTitle').textContent, tks: [...k.querySelectorAll('.gi em')].map((e) => e.textContent).join(), lad: k.querySelectorAll('.pk-lad span').length, cur: (k.querySelector('.pk-lad span.c') || {}).textContent, sel: !!document.querySelector('.bt-l.sel[data-row="board:sso-partners"]') } : null; }));
97
+ ok('B1 a row opens the initiative panel: its ladder, its output with the Jira tickets, and the row is marked', !!pk && pk.t === 'SSO for partners' && pk.tks === 'SSO-12,SSO-10,SSO-14,SSO-15' && pk.lad === 8 && pk.cur === 'Deliv' && pk.sel, JSON.stringify(pk));
98
+ await q.click('#peek .gi[data-tk="SSO-12"]');
99
+ const tk = await until(() => q.evaluate(() => { const t = document.querySelector('#pkTitle'); return t && /SSO-12/.test(t.textContent) ? { t: t.textContent, body: document.querySelector('#peek').textContent.replace(/\s+/g, ' '), jira: (document.querySelector('#peek a[href*="jira.example"]') || {}).href } : null; }));
100
+ ok('B1 V1 a ticket opens its Jira panel: blocked and why, the sprint, the assignee as the reading holds it, when Jira was read, and a link to Jira', !!tk && /Blocked in Jira\. Waiting on PLAT-88/.test(tk.body) && /Sprint 24/.test(tk.body) && /Assignee/.test(tk.body) && /Read/.test(tk.body) && /change only in Jira/.test(tk.body) && /browse\/SSO-12/.test(tk.jira || ''), JSON.stringify(tk));
101
+ await q.keyboard.press('Escape');
102
+ ok('B1 Escape closes the panel', await until(() => q.evaluate(() => document.querySelector('#peek').hidden)));
103
+ await q.click('.bt-l[data-row="board:self-serve-v2"] .bt-tk:nth-child(3)');
104
+ ok('B1 a deliverable segment on the row opens its Jira ticket', await until(() => q.evaluate(() => /ONB-34/.test((document.querySelector('#pkTitle') || {}).textContent || ''))));
105
+ await q.keyboard.press('Escape');
106
+ await q.click('#chAsks');
107
+ ok('B1 the new asks chip opens the asks with Accept and Decline', await until(() => q.evaluate(() => !document.querySelector('#popAsks').hidden && document.querySelectorAll('#cAsks .baa').length === 1)));
108
+ await q.keyboard.press('Escape');
109
+ await q.click('#stHelp');
110
+ ok('B1 what finishes each step: eight steps with their output and where the count comes from', await until(() => q.evaluate(() => !document.querySelector('#popSteps').hidden && /Release shipped, your sign-off/.test(document.querySelector('#popSteps').textContent) && document.querySelectorAll('#popSteps .bd-tbl:not(.bd-tbl4) .bd-tr').length === 9)));
111
+ await q.keyboard.press('Escape');
112
+ /* B3 Ask about this goes to Home */
113
+ await q.route('**/premium.html?**', (r) => r.fulfill({ contentType: 'text/html', body: '<title>home</title>' }));
114
+ await q.click('.bt-l[data-row="board:sso-partners"] .bt-nm'); await until(() => q.evaluate(() => !document.querySelector('#peek').hidden));
115
+ await q.fill('#peek .pk-ask input', 'When does SSO ship?'); await q.press('#peek .pk-ask input', 'Enter');
116
+ await until(() => /premium\.html/.test(q.url()), 5000);
117
+ const u = new URL(q.url());
118
+ ok('B3 the Board has no chat: Ask about this opens Home with the question as a quick ask in that initiative', u.pathname === '/premium.html' && u.searchParams.get('ask') === 'sso-partners' && u.searchParams.get('q') === 'When does SSO ship?' && u.searchParams.get('ws') === 'w1', q.url());
119
+ ok('0 no page error on the stage track', R.errors.length === 0, R.errors.join(' | '));
120
+ await R.ctx.close();
74
121
  }
75
122
 
76
123
  /* B3 + B11 */
77
124
  const head = await p.evaluate(() => ({ cap: document.querySelector('#iniCap').textContent, bar: document.querySelector('#iniBar').getAttribute('aria-valuenow') + '/' + document.querySelector('#iniBar').getAttribute('aria-valuemax'), w: document.querySelector('#iniBar b').style.width, dock: document.querySelector('#dN').textContent + ' ' + document.querySelector('#dLab').textContent, snap: document.querySelector('#snap').textContent, note: document.querySelector('#iniNote').textContent }));
78
125
  ok('B3 the header counts are the board\'s: 5 of 9 on track, 3 at risk, 1 late, with a bar', head.cap === '5 of 9 open on track · 3 at risk · 1 late' && head.bar === '5/9' && Math.abs(parseFloat(head.w) - 55.5) < 1, JSON.stringify(head));
79
126
  ok('B11 the dock counts at risk plus late from the same counts', head.dock === '4 need a look');
80
- ok('B12 the header says what is real, and the note says how many are loaded', /^Real data · as of 09:12$/.test(head.snap) && /7 of 9 open initiatives are loaded: late and at-risk ones first/.test(head.note), JSON.stringify(head));
127
+ ok('B12 the status says what is real, and the note says how many are loaded', /^Real data · as of 09:12$/.test(head.snap) && /7 of 9 open initiatives are loaded: late and at-risk ones first/.test(head.note), JSON.stringify(head));
81
128
 
82
- /* B4 list */
83
- const list = await p.evaluate(() => ({ titles: [...document.querySelectorAll('#ibBody .ini2 .it b')].map((b) => b.textContent.replace('Do this first', '')), tags: [...document.querySelectorAll('#ibBody .tgf')].length, first: document.querySelector('#ibBody .ini2').classList.contains('first'), subs: [...document.querySelectorAll('#ibBody .ini2 .it small')].map((x) => x.textContent), stages: [...document.querySelectorAll('#ibBody .ini2 .wst em')].map((x) => x.textContent), segs: [...document.querySelectorAll('#ibBody .ini2')].map((r) => [...r.querySelectorAll('.sg2 i')].map((i) => i.className || '-').join('')), pg: [...document.querySelectorAll('#ibBody .ini2')].map((r) => (r.querySelector('.pg b') || {}).style ? r.querySelector('.pg b').style.width : ''), rl: [...document.querySelectorAll('#ibBody .ini2 .rl')].map((x) => x.textContent), over: [...document.querySelectorAll('#ibBody .rl.over')].length }));
84
- ok('B4 one row per initiative in the board\'s order, with owner and lane from the record', list.titles.length === 7 && list.titles[0] === 'Self-serve onboarding v2' && list.subs[0] === 'Dara · feature · Late' && list.subs[2] === 'No owner · feature · At risk', JSON.stringify(list.subs));
85
- ok('B4 "Do this first" tags the late first row only, and the row carries the ember bar', list.tags === 1 && list.first);
86
- ok('B4 the workflow bar fills to the stage, and the stage says it is derived', list.segs[0] === 'pppppn---'.replace(/-/g, '') + '' || list.segs[0].length === 9, list.segs[0]);
129
+ /* B4 list (kept as a view) */
130
+ await view(p, 'list');
131
+ const list = await p.evaluate(() => ({ titles: [...document.querySelectorAll('#ibBody .ini2 .it b')].map((b) => b.textContent.replace('Do this first', '')), tags: [...document.querySelectorAll('#ibBody .tgf')].length, first: document.querySelector('#ibBody .ini2').classList.contains('first'), subs: [...document.querySelectorAll('#ibBody .ini2 .it small')].map((x) => x.textContent), stages: [...document.querySelectorAll('#ibBody .ini2 .wst em')].map((x) => x.textContent), pg: [...document.querySelectorAll('#ibBody .ini2')].map((r) => (r.querySelector('.pg b') || {}).style ? r.querySelector('.pg b').style.width : ''), rl: [...document.querySelectorAll('#ibBody .ini2 .rl')].map((x) => x.textContent), over: [...document.querySelectorAll('#ibBody .rl.over')].length }));
132
+ ok('B4 the List view keeps one row per initiative in the board\'s order, with owner and lane from the record', list.titles.length === 7 && list.titles[0] === 'Self-serve onboarding v2' && list.subs[0] === 'Dara · feature · Late' && list.subs[2] === 'No owner · feature · At risk', JSON.stringify(list.subs));
133
+ ok('B4 "Do this first" tags the late first row only', list.tags === 1 && list.first);
87
134
  ok('B4 progress and a finish date only where a record holds them; "Not planned" otherwise; a past finish is marked', list.pg[0] === '62%' && list.pg[2] === '' && list.rl[0] === '10 Oct' && list.rl[2] === 'Not planned' && list.over === 1 && /derived/.test(list.stages[0]), JSON.stringify([list.pg, list.rl, list.over]));
88
135
  ok('B4 no demo label, no invented owner and no estimate is drawn', !(await p.evaluate(() => /demo|~\d+ min/i.test(document.querySelector('#cIni').textContent))));
89
- // show more
90
136
  {
91
137
  const f = F.facts(); f.rows = Array.from({ length: 30 }, (_, i) => F.row('r' + i, 'Initiative ' + i)); f.counts.open = 60;
92
138
  const R = await open({ model: BP.build(f) }), q = R.page;
93
- const n0 = await q.evaluate(() => document.querySelectorAll('#ibBody .ini2').length);
94
- await q.click('#more'); const n1 = await q.evaluate(() => document.querySelectorAll('#ibBody .ini2').length);
95
- ok('B4 the list shows 25 rows and "Show more" adds the rest that are loaded', n0 === 25 && n1 === 30 && !(await q.evaluate(() => !!document.querySelector('#more'))), JSON.stringify([n0, n1]));
139
+ const n0 = await q.evaluate(() => document.querySelectorAll('#ibBody .bt-l').length);
140
+ await q.click('#more'); const n1 = await q.evaluate(() => document.querySelectorAll('#ibBody .bt-l').length);
141
+ ok('B4 the track shows 25 rows and "Show more" adds the rest that are loaded', n0 === 25 && n1 === 30 && !(await q.evaluate(() => !!document.querySelector('#more'))), JSON.stringify([n0, n1]));
96
142
  await R.ctx.close();
97
143
  }
98
144
 
99
- /* B5 stages */
100
- ok('B3 the view is one chip in the Initiatives head that says List, and its menu (List, By stage, Timeline) starts shut (premium-calmer-first-screen)', await p.evaluate(() => document.querySelector('#ibF').textContent.trim() === 'List' && document.querySelector('#ibTabs').hidden && document.querySelector('#ibF').getAttribute('aria-expanded') === 'false' && [...document.querySelectorAll('#ibTabs button')].map((b) => b.textContent).join() === 'List,By stage,Timeline' && !!document.querySelector('#cIni .ch #ibF')));
101
- await (async (pg, v) => { if (await pg.locator('#ibTabs').isHidden()) await pg.click('#ibF'); await pg.click(`#ibTabs [data-v="${v}"]`); })(p, 'stages');
102
- const stg = await p.evaluate(() => ({ cols: [...document.querySelectorAll('#ibBody .isc')].map((c) => c.querySelector('.label').textContent.replace(/\s+/g, ' ').trim()), cards: document.querySelectorAll('#ibBody .icd').length, none: [...document.querySelectorAll('#ibBody .isc')].filter((c) => /None/.test(c.textContent)).length, pressed: document.querySelector('#ibTabs [aria-pressed="true"]').textContent }));
103
- ok('B5 one column per workflow stage with the board\'s own count; a stage with none says so', stg.cols.length === 9 && stg.cols[0] === 'Discover 1' && stg.cols.includes('Build 2') && stg.cols.includes('Evaluate 21') && stg.cols.includes('Ideate 0') && stg.none === 3 && stg.cards === 7 && stg.pressed === 'By stage', JSON.stringify(stg));
104
- /* B6 timeline */
105
- await (async (pg, v) => { if (await pg.locator('#ibTabs').isHidden()) await pg.click('#ibF'); await pg.click(`#ibTabs [data-v="${v}"]`); })(p, 'time');
106
- const tl = await p.evaluate(() => ({ rows: [...document.querySelectorAll('#ibBody .tlr')].map((r) => ({ t: r.querySelector('.tlt b').textContent, n: r.querySelector('.tln b').textContent, w: r.querySelector('.tln small').textContent, l: r.querySelector('.tlb').style.getPropertyValue('--l'), ww: r.querySelector('.tlb').style.getPropertyValue('--w'), bd: r.classList.contains('bd') })), today: !!document.querySelector('#ibBody .tlplot .td'), none: document.querySelector('#ibBody .tlnone').textContent }));
107
- ok('B6 a bar for each initiative with both dates, with days left or over; the others are counted and not drawn', tl.rows.length === 3 && tl.rows[0].t === 'Self-serve onboarding v2' && tl.rows[0].n === '7' && tl.rows[0].w === 'days over' && tl.rows[2].w === 'days left' && /4 initiatives have no dates on record/.test(tl.none) && tl.today, JSON.stringify(tl));
108
- ok('B6 each bar sits inside the scale', tl.rows.every((r) => parseFloat(r.l) >= 0 && parseFloat(r.l) + parseFloat(r.ww) <= 100.01) && tl.rows[0].bd);
145
+ /* B5 By stage (kept as a view): the board's own workflow columns */
146
+ await view(p, 'stages');
147
+ const stg = await p.evaluate(() => ({ cols: [...document.querySelectorAll('#ibBody .isc')].map((c) => c.querySelector('.label').textContent.replace(/\s+/g, ' ').trim()), cards: document.querySelectorAll('#ibBody .icd').length, pressed: document.querySelector('#ibTabs [aria-pressed="true"]').dataset.v }));
148
+ ok('B5 By stage keeps one column per workflow stage with the board\'s own count', stg.cols.length === M.initiatives.stages.length && stg.cols[0] === M.initiatives.stages[0].stage + ' ' + M.initiatives.stages[0].count && stg.cards === 7 && stg.pressed === 'stages', JSON.stringify(stg));
149
+
150
+ /* B6 (premium-agreed-design B2) the timeline: plan against the Jira forecast, six spans, themes at the long spans */
151
+ await view(p, 'time');
152
+ const tl = await p.evaluate(() => ({ spans: [...document.querySelectorAll('#bdSpans button')].map((b) => b.textContent + (b.getAttribute('aria-pressed') === 'true' ? '*' : '')).join(), shown: !document.querySelector('#bdSpans').hidden, rows: [...document.querySelectorAll('#ibBody .tg-r .tg-n.ini2 b')].map((b) => b.textContent), bars: document.querySelectorAll('#ibBody .tg-bar').length, none: (document.querySelector('.tg-none') || {}).textContent || '', ask: (document.querySelector('#askDates') || {}).href || '' }));
153
+ ok('B6 the timeline has six spans and starts on Quarter, one row per initiative with dates; the others are named, with an ask to propose dates', tl.shown && tl.spans === 'Sprint,Quarter*,Half,Year,2 yr,5 yr' && tl.rows.length === 3 && tl.bars === 3 && /4 have no dates/.test(tl.none) && /\/premium\.html\?ask=board%3Aw1&q=Propose/.test(tl.ask), JSON.stringify(tl));
154
+ await spanTo(p, 'year');
155
+ ok('B6 Year groups by theme, with the initiatives as bars inside', await p.evaluate(() => document.querySelectorAll('#ibBody .tg-th').length === 1 && document.querySelectorAll('#ibBody .tg-th .tg-line').length === 3 && /O1 · q3-2026/.test(document.querySelector('#ibBody .tg-th').textContent)));
156
+ await spanTo(p, 'y5');
157
+ ok('B6 5 yr shows themes only, as phases', await p.evaluate(() => document.querySelectorAll('#ibBody .tg-phase').length === 1 && document.querySelectorAll('#ibBody .tg-line').length === 0));
158
+ await spanTo(p, 'sprint');
159
+ ok('B6 Sprint with no Jira read says so', await p.evaluate(() => /No sprint is on record/.test(document.querySelector('#ibBody').textContent)));
160
+ await spanTo(p, 'quarter');
109
161
  {
110
162
  const f = F.facts(); f.rows = f.rows.map((r) => ({ ...r, start: null, end: null }));
111
- const R = await open({ model: BP.build(f) }); await (async (pg, v) => { if (await pg.locator('#ibTabs').isHidden()) await pg.click('#ibF'); await pg.click(`#ibTabs [data-v="${v}"]`); })(R.page, 'time');
112
- ok('B6 with no dates anywhere it draws nothing and says so', await R.page.evaluate(() => document.querySelectorAll('#ibBody .tlr').length === 0 && /No initiative has both a start and an end date on record/.test(document.querySelector('#ibBody').textContent)));
163
+ const R = await open({ model: BP.build(f) }); await view(R.page, 'time');
164
+ ok('B6 with no dates anywhere it draws nothing and says so', await R.page.evaluate(() => document.querySelectorAll('#ibBody .tg-bar').length === 0 && /No initiative on screen has a date on record/.test(document.querySelector('#ibBody').textContent)));
113
165
  await R.ctx.close();
114
166
  }
115
- await (async (pg, v) => { if (await pg.locator('#ibTabs').isHidden()) await pg.click('#ibF'); await pg.click(`#ibTabs [data-v="${v}"]`); })(p, 'list');
167
+ await view(p, 'track');
116
168
 
117
- /* B9 B8 */
169
+ /* B9 B8 the sprint and the release, behind the sprint chip */
118
170
  ok('B9 with no Jira read the sprint card says so and draws nothing', await p.evaluate(() => /No sprint is on record/.test(document.querySelector('#sprBody').textContent) && document.querySelector('#sprCap').textContent === 'none' && !document.querySelector('#sprBody .spr')));
119
171
  ok('B8 with no release the card says none is on record', await p.evaluate(() => /No release is on record/.test(document.querySelector('#relBody').textContent)));
120
172
  {
121
173
  const R = await open({ model: mk({ sprints: { source: 'jira', readAt: '2026-10-16', sprints: [{ name: 'Sprint 42', state: 'active', start: '2026-10-12', end: '2026-10-23', counts: { todo: 11, doing: 9, done: 14 }, goal: 'Self-serve onboarding reaches beta' }] }, nextRelease: { id: 'r1', type: 'minor', at: '2026-10-23T00:00:00Z' } }) });
122
- const d = await R.page.evaluate(() => ({ sp: document.querySelector('#sprBody').textContent.replace(/\s+/g, ' '), cnt: [...document.querySelectorAll('#sprBody .cnt b')].map((b) => b.textContent).join(), rel: document.querySelector('#relBody').textContent.replace(/\s+/g, ' '), cap: document.querySelector('#relCap').textContent }));
123
- ok('B9 B8 a sprint read and a release are drawn from their records', d.cnt === '14,9,11' && /Goal: Self-serve onboarding reaches beta/.test(d.sp) && /Sprint review in 6 days/.test(d.sp) && /r1Next23 Oct · 6 days away/.test(d.rel), JSON.stringify(d));
174
+ await R.page.click('#chSprint');
175
+ const d = await R.page.evaluate(() => ({ open: !document.querySelector('#popSpr').hidden, sp: document.querySelector('#sprBody').textContent.replace(/\s+/g, ' '), cnt: [...document.querySelectorAll('#sprBody .cnt b')].map((b) => b.textContent).join(), rel: document.querySelector('#relBody').textContent.replace(/\s+/g, ' '), cap: document.querySelector('#relCap').textContent }));
176
+ ok('B9 B8 the sprint chip opens the sprint and the release, drawn from their records', d.open && d.cnt === '14,9,11' && /Goal: Self-serve onboarding reaches beta/.test(d.sp) && /Sprint review in 6 days/.test(d.sp) && /r1Next23 Oct · 6 days away/.test(d.rel), JSON.stringify(d));
177
+ await R.page.click('#sprBody .spr');
178
+ ok('B9 the sprint opens its dialog, as before', await until(() => R.page.evaluate(() => document.querySelector('#dlg').classList.contains('on') && document.querySelector('#dTitle').textContent === 'Sprint 42')));
124
179
  await R.ctx.close();
125
180
  }
126
181
 
127
- /* B7 core documents */
182
+ /* B7 core documents, on the Documents tab */
183
+ await p.click('#tabDocs');
184
+ ok('B7 the Documents tab shows the core documents and hides the initiatives', await p.evaluate(() => !document.querySelector('#cDocs').hidden && document.querySelector('#cIni').hidden && document.querySelector('#tabDocs').getAttribute('aria-selected') === 'true'));
128
185
  const docs = await p.evaluate(() => ({ cap: document.querySelector('#docCap').textContent, rows: [...document.querySelectorAll('#docBody .dmr')].map((r) => ({ t: r.querySelector('.dmn b').textContent, s: r.querySelector('.dmm .s').textContent.trim(), b: r.querySelector('.dmcta') ? r.querySelector('.dmcta').textContent.trim() : null, dis: r.querySelector('.dmcta') ? r.querySelector('.dmcta').disabled : null, kind: r.querySelector('.dmcta') ? (r.querySelector('.dmcta').dataset.draft ? 'draft' : 'go') : null })), all: document.querySelector('#cDocs').textContent }));
129
- ok('B7 the documents come from the record with their state, and the summary counts them', docs.cap === '6' && docs.rows.length === 6 && docs.rows[0].t === 'Board charter' && docs.rows[0].s === 'Not started' && docs.rows[1].s === 'Live' && docs.rows[3].s === 'Draft' && docs.rows[4].s === 'Stale', JSON.stringify(docs));
186
+ ok('B7 the documents come from the record with their state, and the tab counts them', docs.cap === '6' && docs.rows.length === 6 && docs.rows[0].t === 'Board charter' && docs.rows[0].s === 'Not started' && docs.rows[1].s === 'Live' && docs.rows[3].s === 'Draft' && docs.rows[4].s === 'Stale', JSON.stringify(docs));
130
187
  ok('B7 the button is the record\'s own action: Draft it, Set it up, Open; a draft to review and a document with no action have none; a running one is off', docs.rows[0].b === 'Draft it' && docs.rows[0].kind === 'draft' && docs.rows[2].b === 'Set it up' && docs.rows[2].kind === 'go' && docs.rows[1].b === 'Open' && docs.rows[3].b === null && docs.rows[5].b === 'Drafting' && docs.rows[5].dis === true, JSON.stringify(docs.rows));
131
188
  ok('B7 Drop is not on the page, and the list has no Issue it press (it is in a draft\'s reader)', !/\bDrop\b/.test(docs.all) && await p.evaluate(() => !document.querySelector('#docBody [data-rd="issue"], #docBody button.dmcta')?.textContent.includes('Issue it')));
132
189
  A.set({ status: 200, body: { ok: true, run: 'r1' } });
@@ -138,53 +195,51 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
138
195
  A.set({ status: 409, body: { ok: false, error: 'a run is already drafting that document' } });
139
196
  await p.locator('#docBody [data-draft="charter"]').click();
140
197
  ok('B7 a refused press shows the route\'s reason and turns the button back on', await until(() => p.evaluate(() => /already drafting/.test(document.querySelector('#toast').textContent) && !document.querySelector('#docBody [data-draft="charter"]').disabled)));
198
+ await p.click('#tabIni');
141
199
 
142
- /* B10 dialog */
143
- await p.locator('#ibBody .ini2').first().click(); await until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(700);
144
- const dlg = await p.evaluate(() => ({ title: document.querySelector('#dTitle').textContent, sub: document.querySelector('#dSub').textContent, grid: [...document.querySelectorAll('#oMain .kv2 span')].map((s) => s.textContent).join('|'), path: document.querySelector('#oMain .dpath').textContent, buttons: [...document.querySelectorAll('#card button')].length, hold: document.querySelector('#holdWhy').textContent, ask: !!document.querySelector('#askGo'), label: document.querySelector('#oLab').textContent }));
145
- ok('B10 an initiative opens its record as a grid with the path of its file, the read-only agent beside it and no press', dlg.title === 'Self-serve onboarding v2' && /Stage\|Build \(derived\)/.test(dlg.grid) && /Progress\|62%/.test(dlg.grid) && dlg.path === 'planning/initiatives/self-serve-v2.md' && dlg.buttons === 0 && dlg.ask && /This dialog changes nothing/.test(dlg.hold) && dlg.label === 'Initiative record', JSON.stringify(dlg));
146
- A.setThread({ ok: true, working: false, turns: [] });
147
- await p.fill('#askIn', 'Why is this late?'); const nA = A.posts.length; await p.press('#askIn', 'Enter');
148
- ok('B10 a question posts the initiative key and the text', await until(() => A.posts.length > nA && A.posts[A.posts.length - 1].path === '/api/briefing-premium/ask' && A.posts[A.posts.length - 1].body.key === 'board:self-serve-v2' && A.posts[A.posts.length - 1].body.text === 'Why is this late?'));
200
+ /* B10 the record dialog, from the panel's Record */
201
+ await p.locator('#ibBody .bt-l[data-row="board:self-serve-v2"] .bt-nm').click(); await until(() => p.evaluate(() => !document.querySelector('#peek').hidden));
202
+ await p.click('#peek [data-pk="record"]'); await until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(700);
203
+ const dlg = await p.evaluate(() => ({ title: document.querySelector('#dTitle').textContent, grid: [...document.querySelectorAll('#oMain .kv2 span')].map((s) => s.textContent).join('|'), path: document.querySelector('#oMain .dpath').textContent, buttons: [...document.querySelectorAll('#card button')].length, hold: document.querySelector('#holdWhy').textContent, label: document.querySelector('#oLab').textContent }));
204
+ ok('B10 the panel\'s Record opens the initiative\'s record as a grid with the path of its file and no press', dlg.title === 'Self-serve onboarding v2' && /Stage\|Build \(derived\)/.test(dlg.grid) && /Progress\|62%/.test(dlg.grid) && dlg.path === 'planning/initiatives/self-serve-v2.md' && dlg.buttons === 0 && /This dialog changes nothing/.test(dlg.hold) && dlg.label === 'Initiative record', JSON.stringify(dlg));
149
205
  await p.keyboard.press('Escape'); await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on')));
206
+ ok('B13 closing the dialog gives the focus back to the panel\'s Record', await until(() => p.evaluate(() => document.activeElement && document.activeElement.dataset.pk === 'record')), await p.evaluate(() => document.activeElement.tagName + '.' + document.activeElement.className + ' peek=' + document.querySelector('#peek').hidden + ' dlg=' + document.querySelector('#dlg').className));
207
+ await p.keyboard.press('Escape');
208
+ ok('B13 Escape then closes the panel and gives the focus back to the row', await until(() => p.evaluate(() => document.querySelector('#peek').hidden && document.activeElement.classList.contains('bt-nm'))), await p.evaluate(() => document.activeElement.tagName + '.' + document.activeElement.className + ' peek=' + document.querySelector('#peek').hidden + ' bam2=' + !!document.querySelector('.bam2') + ' pops=' + [...document.querySelectorAll('.bd-pop')].filter((x) => !x.hidden).map((x) => x.id)));
150
209
  ok('0 no page error', A.errors.length === 0, A.errors.join(' | '));
151
210
  await A.ctx.close();
152
211
 
153
- /* B14 a click opens the initiative page; the switch makes it a popup and the choice is kept */
212
+ /* B14 the panel's expand opens the initiative page (Page, the default) or the record dialog (Popup); the choice is kept */
154
213
  {
155
214
  const D = await open({ mode: null });
156
215
  const mode0 = await D.page.evaluate(() => [...document.querySelectorAll('#modeSeg button')].map((b) => b.dataset.m + ':' + b.getAttribute('aria-pressed')).join('|'));
157
216
  ok('B14 the Page setting is the default', mode0 === 'page:true|popup:false', mode0);
158
217
  await D.page.route('**/premium-initiative.html*', (r) => r.fulfill({ contentType: 'text/html', body: '<title>x</title>' }));
159
- await D.page.locator('#ibBody .ini2').first().click(); await sleep(600);
218
+ await D.page.locator('#ibBody .bt-l[data-row="board:self-serve-v2"] .bt-nm').click(); await until(() => D.page.evaluate(() => !document.querySelector('#peek').hidden));
219
+ ok('B14 a click on an initiative opens its panel and stays on the Board', new URL(D.page.url()).pathname === '/premium-board.html');
220
+ await D.page.click('#peek [data-pk="expand"]'); await sleep(600);
160
221
  const u = new URL(D.page.url());
161
- ok('B14 a click on an initiative opens its page with the initiative, the workspace and the board', u.pathname === '/premium-initiative.html' && u.searchParams.get('id') === 'self-serve-v2' && u.searchParams.get('ws') === 'w1' && u.searchParams.get('board') === 'w1', D.page.url());
222
+ ok('B14 the panel\'s expand opens the initiative page with the initiative, the workspace and the board', u.pathname === '/premium-initiative.html' && u.searchParams.get('id') === 'self-serve-v2' && u.searchParams.get('ws') === 'w1' && u.searchParams.get('board') === 'w1', D.page.url());
162
223
  await D.page.goBack(); await until(() => D.page.evaluate(() => document.querySelectorAll('#ibBody .ini2').length > 0));
163
- await D.page.click('#moreBtn'); await D.page.click('#modeSeg [data-m="popup"]'); await D.page.keyboard.press('Escape'); // premium-topbar: the switch is in the Board's ⋯ menu
164
- await D.page.locator('#ibBody .ini2').first().click();
165
- ok('B14 the Popup setting opens the dialog and stays on the Board', await until(() => D.page.evaluate(() => document.querySelector('#dlg').classList.contains('on'))) && new URL(D.page.url()).pathname === '/premium-board.html');
224
+ await D.page.click('#moreBtn'); await D.page.click('#modeSeg [data-m="popup"]'); await D.page.keyboard.press('Escape');
225
+ await D.page.locator('#ibBody .bt-l[data-row="board:self-serve-v2"] .bt-nm').click(); await until(() => D.page.evaluate(() => !document.querySelector('#peek').hidden));
226
+ await D.page.click('#peek [data-pk="expand"]');
227
+ ok('B14 the Popup setting makes expand open the dialog and stay on the Board', await until(() => D.page.evaluate(() => document.querySelector('#dlg').classList.contains('on'))) && new URL(D.page.url()).pathname === '/premium-board.html');
166
228
  await D.page.keyboard.press('Escape'); await D.page.reload(); await until(() => D.page.evaluate(() => document.querySelectorAll('#ibBody .ini2').length > 0));
167
229
  ok('B14 the choice is kept after a reload', await D.page.evaluate(() => document.querySelector('#modeSeg [data-m="popup"]').getAttribute('aria-pressed') === 'true'));
168
230
  ok('0 no page error on the switch', D.errors.length === 0, D.errors.join(' | '));
169
231
  await D.ctx.close();
170
232
  }
171
233
 
172
- /* B15 the crumb, "Coming up" and the documents manager, as the mockup draws them */
234
+ /* B15 the product picker and the documents manager */
173
235
  {
174
236
  const base = F.facts(), docs3 = Object.assign({}, base.docs, { docs: base.docs.docs.concat([F.doc('intake', 'Intake log'), F.doc('roadmap', 'Roadmap note')]) });
175
237
  const D = await open({ model: BP.build(Object.assign({}, base, { docs: docs3 })) });
176
238
  const q = D.page;
177
- ok('B15 the third card is "Next release", as the mockup names it', await q.evaluate(() => document.querySelector('#hRel').textContent === 'Next release'));
178
- ok('B15 the header is the crumb: the board\'s name, no switcher for one board, and no chat button (Chat is in the rail)', await q.evaluate(() => document.querySelector('#crBoard').disabled && document.querySelector('#crBoard').textContent === 'pmos' && document.querySelector('#crSw').hidden && !document.querySelector('#crAsk') && !document.querySelector('#bsw')));
179
- await q.click('.rail [data-go="chat"]'); await until(() => q.evaluate(() => /premium-chat\.html/.test(location.pathname) && document.querySelector('#dlg').classList.contains('on')), 10000); await sleep(500);
180
- const bd = await q.evaluate(() => ({ title: document.querySelector('#dTitle').textContent, ask: document.querySelector('#askF').hidden }));
181
- ok('B15 Chat opens the Chat page on the board\'s conversation (premium-chat-page)', /about=board%3Athis-board/.test(q.url()) && bd.title === 'Ask about the pmos board' && bd.ask === false, JSON.stringify({ ...bd, url: q.url() }));
182
- D.setThread({ ok: true, working: false, turns: [] }); await q.fill('#askIn', 'What is late?'); const nq = D.posts.length; await q.press('#askIn', 'Enter');
183
- ok('B15 a question about the board posts the board key and the text', await until(() => D.posts.length > nq && D.posts[D.posts.length - 1].path === '/api/briefing-premium/ask' && D.posts[D.posts.length - 1].body.key === 'board:this-board' && D.posts[D.posts.length - 1].body.text === 'What is late?'));
184
- await q.goBack(); await until(() => q.evaluate(() => document.querySelectorAll('#ibBody .ini2').length > 0), 20000);
239
+ ok('B15 the picker names the board, has no switcher for one board, and the Board has no chat button', await q.evaluate(() => document.querySelector('#crBoard').disabled && document.querySelector('#crBoard').textContent === 'pmos' && document.querySelector('#crSw').hidden && !document.querySelector('#crAsk') && !document.querySelector('#askIn')));
240
+ await q.click('#tabDocs');
185
241
  const dm = await q.evaluate(() => ({ cap: document.querySelector('#docCap').textContent, sum: document.querySelector('.dsum').textContent.replace(/\s+/g, ' '), bar: document.querySelectorAll('.dprog i').length, tabs: [...document.querySelectorAll('#dmF button')].map((b) => b.textContent.replace(/\s+/g, '')).join(','), link: (document.querySelector('.dsum .dlink') || {}).textContent }));
186
- ok('B15 the documents have the mockup\'s summary, progress bar, filter and search, from one set of counts', dm.cap === '8' && /1 draft to review/.test(dm.sum) && /5 not started/.test(dm.sum) && /1 up to date/.test(dm.sum) && dm.bar === 8 && dm.tabs === 'All8,Notstarted5,Draft1,Uptodate1' && /Draft the 3 not started/.test(dm.link || ''), JSON.stringify(dm));
187
- await q.click('#dmF [data-dmf="none"]'); ok('B15 the filter shows the documents not started', (await q.evaluate(() => [...document.querySelectorAll('#docBody .dmn b')].map((b) => b.textContent))).join('|') === 'Board charter|Board status report|Board risks|Intake log|Roadmap note'.replace('|Board risks', '') || true);
242
+ ok('B15 the documents have the summary, progress bar, filter and search, from one set of counts', dm.cap === '8' && /1 draft to review/.test(dm.sum) && /5 not started/.test(dm.sum) && /1 up to date/.test(dm.sum) && dm.bar === 8 && dm.tabs === 'All8,Notstarted5,Draft1,Uptodate1' && /Draft the 3 not started/.test(dm.link || ''), JSON.stringify(dm));
188
243
  await q.click('#dmF [data-dmf="all"]'); await q.fill('#dmQ', 'intake'); ok('B15 the search finds a document and keeps the focus', (await q.evaluate(() => [...document.querySelectorAll('#docBody .dmn b')].map((b) => b.textContent))).join('|') === 'Intake log' && await q.evaluate(() => document.activeElement.id === 'dmQ'));
189
244
  await q.fill('#dmQ', 'zzz'); ok('B15 no match says so', /No document matches/.test(await q.evaluate(() => document.querySelector('#docBody').textContent))); await q.fill('#dmQ', '');
190
245
  D.set({ status: 200, body: { ok: true, run: 'rb' } }); const nb = D.posts.length; await q.click('.dsum .dlink');
@@ -195,14 +250,10 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
195
250
 
196
251
  /* B2 reading and failure */
197
252
  {
198
- let n = 0;
199
- const R = await open({ answers: (c) => (c < 3 ? { status: 202, body: { ok: true, state: 'reading' } } : { status: 200, body: { ok: true, state: 'ready', model: mk(), as_of: Date.now() } }) });
200
- // open() waits for the list; check what the page said on the way by reading it after the fact through a second page
201
- await R.ctx.close();
202
253
  const ctx = await browser.newContext({ viewport: { width: 1280, height: 900 } }), pg = await ctx.newPage(); let calls = 0;
203
254
  await pg.route('**/api/board-premium*', (r) => { calls++; if (calls < 2) return r.fulfill({ status: 202, contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'reading' }) }); return r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model: mk(), as_of: Date.now() }) }); });
204
255
  await pg.goto(BASE + '/premium-board.html');
205
- ok('B2 while the board is read the page says so, with the seconds, and shows no list instead of a guess', await until(() => pg.evaluate(() => /Reading the board · \d+ s so far/.test(document.querySelector('#snap').textContent) && document.querySelectorAll('#ibBody .ini2').length === 0 && /shows nothing until it has read/.test(document.querySelector('#ibBody').textContent)), 4000));
256
+ ok('B2 while the board is read the page says so, with the seconds, and shows no row instead of a guess', await until(() => pg.evaluate(() => /Reading the board · \d+ s so far/.test(document.querySelector('#snap').textContent) && document.querySelectorAll('#ibBody .ini2').length === 0 && /shows nothing until it has read/.test(document.querySelector('#ibBody').textContent)), 4000));
206
257
  ok('B2 it asks again and draws when the answer is ready', await until(() => pg.evaluate(() => document.querySelectorAll('#ibBody .ini2').length === 7 && /^Real data/.test(document.querySelector('#snap').textContent)), 9000));
207
258
  await ctx.close();
208
259
  const c2 = await browser.newContext({ viewport: { width: 1280, height: 900 } }), p2 = await c2.newPage();
@@ -212,21 +263,27 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
212
263
  await c2.close();
213
264
  }
214
265
 
215
- /* B13 floors */
266
+ /* B13 floors: the phone */
216
267
  for (const theme of ['light', 'dark']) {
217
- const R = await open({ w: 390, h: 844, theme }), q = R.page;
218
- const m = await q.evaluate(() => { const small = [...document.querySelectorAll('#ibTabs button, #ibBody .ini2, #docBody .dmcta, #bsw')].filter((b) => !b.closest('[hidden]') && b.getBoundingClientRect().height > 0 && b.getBoundingClientRect().height < 44).map((b) => b.className + ':' + Math.round(b.getBoundingClientRect().height)); return { over: document.documentElement.scrollWidth > innerWidth + 1, small }; });
219
- ok(`B13 at 390 px (${theme}) the page has no sideways scroll and every control is 44 px`, !m.over && m.small.length === 0, JSON.stringify(m));
220
- await (async (pg, v) => { if (await pg.locator('#ibTabs').isHidden()) await pg.click('#ibF'); await pg.click(`#ibTabs [data-v="${v}"]`); })(q, 'stages'); await (async (pg, v) => { if (await pg.locator('#ibTabs').isHidden()) await pg.click('#ibF'); await pg.click(`#ibTabs [data-v="${v}"]`); })(q, 'time');
221
- ok(`B13 at 390 px (${theme}) the stage and timeline views do not scroll sideways`, await q.evaluate(() => document.documentElement.scrollWidth <= innerWidth + 1));
222
- await (async (pg, v) => { if (await pg.locator('#ibTabs').isHidden()) await pg.click('#ibF'); await pg.click(`#ibTabs [data-v="${v}"]`); })(q, 'list'); await q.locator('#ibBody .ini2').first().click(); await until(() => q.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(900);
223
- const g = await q.evaluate(() => { const r = document.querySelector('#dlg').getBoundingClientRect(); return { l: Math.round(r.left), w: Math.round(r.width), vw: innerWidth, tabs: getComputedStyle(document.querySelector('#dTabs')).display }; });
224
- ok(`B13 at 390 px (${theme}) the dialog is full width and its Detail / Conversation switch is shown`, g.l === 0 && g.w === g.vw && g.tabs !== 'none', JSON.stringify(g));
268
+ const R = await open({ w: 390, h: 844, theme, model: BP.build(FJ.facts()) }), q = R.page;
269
+ const m = await q.evaluate(() => { const small = [...document.querySelectorAll('#ibTabs button, #ibBody .ini2, #ibBody .inim, #bdChipset .cz-chip, .cz-tab, #newIni, #bdFind')].filter((b) => !b.closest('[hidden]') && b.getBoundingClientRect().height > 0 && b.getBoundingClientRect().height < 44).map((b) => b.className + ':' + Math.round(b.getBoundingClientRect().height)); const fab = document.querySelector('#czFab').getBoundingClientRect(); return { over: document.documentElement.scrollWidth > innerWidth + 1, small, fabRight: Math.round(innerWidth - fab.right), top: Math.round(document.querySelector('.bd-hd').getBoundingClientRect().height) }; });
270
+ ok(`B13 at 390 px (${theme}) the page has no sideways scroll, the top bar is one line, the menu sits bottom right, and every control is 44 px`, !m.over && m.small.length === 0 && m.fabRight < 40 && m.top <= 56, JSON.stringify(m));
271
+ await view(q, 'stages'); const s1 = await q.evaluate(() => document.documentElement.scrollWidth <= innerWidth + 1);
272
+ await view(q, 'time'); const s2 = await q.evaluate(() => document.documentElement.scrollWidth <= innerWidth + 1);
273
+ ok(`B13 at 390 px (${theme}) the stage and timeline views do not scroll sideways`, s1 && s2);
274
+ await view(q, 'track'); await q.locator('#ibBody .bt-l[data-row="board:sso-partners"] .bt-nm').click();
275
+ const g = await until(() => q.evaluate(() => { const k = document.querySelector('#peek'); if (k.hidden) return null; const r = k.getBoundingClientRect(); return { l: Math.round(r.left), w: Math.round(r.width), b: Math.round(innerHeight - r.bottom), vw: innerWidth }; }));
276
+ ok(`B13 at 390 px (${theme}) the initiative panel is a bottom sheet across the width`, !!g && g.l === 0 && g.w === g.vw && g.b === 0, JSON.stringify(g));
277
+ await q.click('#peek [data-pk="record"]'); await until(() => q.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(900);
278
+ const d = await q.evaluate(() => { const r = document.querySelector('#dlg').getBoundingClientRect(); return { l: Math.round(r.left), w: Math.round(r.width), vw: innerWidth, tabs: getComputedStyle(document.querySelector('#dTabs')).display }; });
279
+ ok(`B13 at 390 px (${theme}) the record dialog is full width and its Detail / Conversation switch is shown`, d.l === 0 && d.w === d.vw && d.tabs !== 'none', JSON.stringify(d));
280
+ ok(`0 no page error at 390 px (${theme})`, R.errors.length === 0, R.errors.join(' | '));
225
281
  await R.ctx.close();
226
282
  }
227
283
  {
228
- const R = await open(); await R.page.locator('#ibBody .ini2').first().focus(); await R.page.keyboard.press('Enter'); await until(() => R.page.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(500);
229
- ok('B13 the page behind a dialog is inert, Escape closes it and focus returns to the row', await R.page.evaluate(() => ['.rail', 'main.stage', '#dock'].every((s) => document.querySelector(s).inert)) && (await R.page.keyboard.press('Escape'), await until(() => R.page.evaluate(() => !document.querySelector('#dlg').classList.contains('on') && document.activeElement.classList.contains('ini2')))));
284
+ const R = await open(); await R.page.locator('#ibBody .bt-nm').first().focus(); await R.page.keyboard.press('Enter'); await until(() => R.page.evaluate(() => !document.querySelector('#peek').hidden));
285
+ await R.page.click('#peek [data-pk="record"]'); await until(() => R.page.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(500);
286
+ ok('B13 the page behind a dialog is inert', await R.page.evaluate(() => ['main.stage', '#dock'].every((s) => document.querySelector(s).inert)));
230
287
  await R.ctx.close();
231
288
  }
232
289
 
@@ -238,42 +295,23 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
238
295
  const m = j && j.model;
239
296
  ok('E2 the real model\'s counts agree with each other: the header, the dock and the late and at-risk rows', !!m && m.dock.needs === m.initiatives.risk + m.initiatives.late && m.initiatives.on + m.initiatives.risk + m.initiatives.late + m.initiatives.hold === m.initiatives.open && m.initiatives.list.rows.slice(0, 5).every((r) => r.bad || m.initiatives.risk + m.initiatives.late === 0), m ? JSON.stringify(m.initiatives).slice(0, 200) : '');
240
297
  ok('E3 the real model draws no sprint and no release without a source, and no demo data', !!m && !m.sprint.name && !m.release.at && !/demo/i.test(JSON.stringify({ h: m.header, s: m.sprint, r: m.release, d: m.docs, b: m.board })));
298
+ ok('E3 the real model has the eight steps and a track on every row', !!m && m.steps.length === 8 && m.initiatives.list.rows.every((r) => r.track && typeof r.track.k === 'number'));
241
299
  const post = await fetch(BASE + '/api/board-premium', { method: 'POST', headers: await T.pressHeaders(BASE), body: '{}' }).then((r) => r.status);
242
300
  ok('E4 the model route is read-only', post === 405, String(post));
243
301
  const ctx = await browser.newContext({ viewport: { width: 1280, height: 900 } }), pg = await ctx.newPage(), errs = [];
244
302
  pg.on('pageerror', (e) => errs.push(String(e)));
245
303
  await pg.goto(BASE + '/premium-board.html');
246
- ok('E5 the real page draws this repository\'s board and its header agrees with the route', await until(() => pg.evaluate((cap) => document.querySelectorAll('#ibBody .ini2').length > 0 && document.querySelector('#iniCap').textContent.replace(/\s+/g, ' ').startsWith(cap), `${m.initiatives.on} of ${m.initiatives.open} open on track`), 30000));
304
+ ok('E5 the real page draws this repository\'s board and its counts agree with the route', await until(() => pg.evaluate((cap) => document.querySelectorAll('#ibBody .ini2').length > 0 && document.querySelector('#iniCap').textContent.replace(/\s+/g, ' ').startsWith(cap), `${m.initiatives.on} of ${m.initiatives.open} open on track`), 30000));
247
305
  ok('E6 the real page has no script error', errs.length === 0, errs.join(' | '));
248
306
  await ctx.close();
249
307
  }
250
308
 
251
- /* B13 fidelity against the mockup */
252
- if (!fs.existsSync(MOCKUP)) ok('B13 the mockup is in the repository', false, MOCKUP);
253
- else {
254
- const PAIRS = [['rail', '.rail'], ['card', '#cIni'], ['heading', '#hIni'], ['inih', '.inih'], ['row', '.ini2'], ['title', '.ini2 .it b'], ['subtitle', '.ini2 .it small'], ['stage', '.ini2 .wst em'], ['segs', '.ini2 .sg2'], ['progress', '.ini2 .pg i'], ['finish', '.ini2 .rl'], ['tag', '.tgf'], ['docs', '#cDocs'], ['dmr', '.dmr'], ['dmi', '.dmi'], ['dmt', '.dmn b'], ['dmd', '.dmn>small'], ['cta', '.dmcta.alt'], ['dock', '.dock']];
255
- const SKIP_W = ['row', 'title', 'subtitle', 'stage', 'finish', 'tag', 'dmr', 'dmt', 'dmd', 'cta', 'segs', 'progress', 'spr', 'docs', 'card', 'heading', 'inih'];
256
- const PROPS = ['fontSize', 'fontWeight', 'fontFamily', 'color', 'backgroundColor', 'borderRadius', 'paddingTop', 'paddingLeft', 'letterSpacing', 'lineHeight', 'boxShadow', 'backdropFilter', 'borderTopColor'];
257
- const grab = (pg) => pg.evaluate(([pairs, props]) => { const o = {}; for (const [n, s0] of pairs) { const s = (n === 'rail' || n === 'dock') ? s0 : 'main.stage:not([hidden]) ' + s0; const e = document.querySelector(s); if (!e) { o[n] = null; continue; } const cs = getComputedStyle(e), r = e.getBoundingClientRect(), v = { left: Math.round(r.left), width: Math.round(r.width) }; props.forEach((k) => { v[k] = cs[k]; }); o[n] = v; } return o; }, [PAIRS, PROPS]);
258
- for (const [w, h] of [[1280, 900], [390, 844]]) for (const th of ['light', 'dark']) {
259
- const m = await (await browser.newContext({ viewport: { width: w, height: h } })).newPage();
260
- await m.goto('file://' + MOCKUP); await CT.applyToPage(m, CT_VENDOR);
261
- await until(() => m.evaluate(() => document.querySelectorAll('#rank .rr').length > 0));
262
- await m.evaluate((t) => { document.documentElement.dataset.theme = t; document.querySelector('.pl[data-p="init"]').click(); }, th);
263
- await until(() => m.evaluate(() => document.querySelectorAll('#ibBody .ini2').length > 0)); await sleep(900);
264
- const R = await open({ w, h, theme: th }); await sleep(500);
265
- const a = await grab(m), c = await grab(R.page), diffs = [];
266
- for (const [n] of PAIRS) {
267
- if (!a[n] || !c[n]) { diffs.push(n + ' missing'); continue; }
268
- for (const k of Object.keys(a[n])) {
269
- const geom = k === 'left' || k === 'width';
270
- if (geom && (SKIP_W.includes(n) && k === 'width' || ['title', 'subtitle', 'stage', 'finish', 'tag', 'dmt', 'dmd', 'cta', 'segs', 'progress'].includes(n) && k === 'left')) continue;
271
- if (geom ? Math.abs(a[n][k] - c[n][k]) > 2 : a[n][k] !== c[n][k]) diffs.push(`${n}.${k} ${a[n][k]} | ${c[n][k]}`);
272
- }
273
- }
274
- ok(`B13 styles and geometry match the mockup at ${w} px, ${th}`, diffs.length === 0, diffs.join(' ; '));
275
- await m.context().close(); await R.ctx.close();
276
- }
309
+ /* B13 the Agreed design's look: Nunito, the soft panel, the chips and the track's rows */
310
+ for (const th of ['light', 'dark']) {
311
+ const R = await open({ w: 1440, h: 900, theme: th }), q = R.page;
312
+ const s = await q.evaluate(() => { const cs = (sel) => getComputedStyle(document.querySelector(sel)); const main = cs('main.bd-main'), row = document.querySelector('.bt-l').getBoundingClientRect(); return { font: cs('body').fontFamily, rad: main.borderTopLeftRadius, bg: main.backgroundColor, chip: Math.round(document.querySelector('#chJira').getBoundingClientRect().height), row: Math.round(row.height), tab: cs('#tabIni').fontWeight, fab: cs('#czFab').borderTopLeftRadius }; });
313
+ ok(`B13 the look of the Agreed design at 1440 px, ${th}: Nunito, a 28 px panel, 30 px chips, 54 px rows`, /^"?Nunito/.test(s.font) && s.rad === '28px' && s.chip === 30 && s.row >= 54 && s.row <= 62 && s.tab === '700' && (th === 'light' ? s.bg === 'rgb(255, 255, 255)' : s.bg !== 'rgb(255, 255, 255)'), JSON.stringify(s));
314
+ await R.ctx.close();
277
315
  }
278
316
  return finish();
279
317
  })().catch((e) => { console.error(e); finish(1); });
@@ -226,10 +226,13 @@ const SUGGEST = { ok: true, suggested: [{ kind: 'pmos-doc', ref: 'planning/prd/p
226
226
  const addM = await mp.evaluate(() => { const b = document.createElement('button'); b.className = 'addb'; document.body.appendChild(b); const c = getComputedStyle(b); return c.fontWeight + '|' + c.borderRadius; }), F1 = await open(), addB = await css(F1.page, '#mmAdd');
227
227
  await F1.page.click('#mmAdd'); await until(() => F1.page.evaluate(() => /Premium UX PRD/.test(document.querySelector('#mmSug').textContent))); await F1.page.click('#mmSug [data-pick]');
228
228
  const doB = await css(F1.page, '#mmDo');
229
- ok('M7 fidelity: the buttons keep the mockup\'s pill radius and weight', ctaM && addB && addB === addM && doB === ctaM, ctaM + ' / ' + addM + ' vs ' + addB + ' / ' + doB);
229
+ // re-pointed for premium-agreed-design: the Agreed design's dialog CTA is a pill at weight 800 (cozy-viewer.css .cz .dlg .cta), not the mockup's 600;
230
+ // the add button keeps the mockup's pill and weight
231
+ ok('M7 fidelity: the buttons keep the pill radius, the add button the mockup\'s weight and the CTA the Agreed design\'s', ctaM && addB && addB === addM && doB === '800|' + ctaM.split('|')[1] && /^999/.test(ctaM.split('|')[1]), ctaM + ' / ' + addM + ' vs ' + addB + ' / ' + doB);
230
232
  const labM = await mp.evaluate(() => { const e = document.querySelector('.label'); return e ? getComputedStyle(e).fontSize + '|' + getComputedStyle(e).textTransform : null; });
231
233
  const labP = await F1.page.evaluate(() => { const e = document.querySelector('.mtg-sec .label'); return e ? getComputedStyle(e).fontSize + '|' + getComputedStyle(e).textTransform : null; });
232
- ok('M7 fidelity: a sheet section label uses the mockup\'s label type', labM && labP && labM === labP, labM + ' vs ' + labP);
234
+ // re-pointed for premium-agreed-design: the Agreed design's labels keep the mockup's 12 px but drop its uppercase (cozy-viewer.css .cz .dlg .label)
235
+ ok('M7 fidelity: a sheet section label keeps the mockup\'s size in the Agreed design\'s sentence case', labM && labP && labP.split('|')[0] === labM.split('|')[0] && labP.split('|')[1] === 'none', labM + ' vs ' + labP);
233
236
  await mk.close();
234
237
  return finish();
235
238
  })().catch((e) => { console.error(e); finish(1); });
@@ -220,14 +220,15 @@ const RECORDER = () => {
220
220
  await press(Lv.page, 'rec'); await press(Lv.page, 'go'); await until(() => Lv.recPosts.length === 1);
221
221
  await until(async () => /Recording/.test((await chip(Lv.page)) || ''));
222
222
  Lv.leave = false;
223
- await Lv.page.goto(BASE + '/premium-work.html').catch(() => {});
223
+ // re-pointed for premium-agreed-design H3: /premium-work.html now redirects to Home (premium.html), so the page the PM leaves for is the Board
224
+ await Lv.page.goto(BASE + '/premium-board.html').catch(() => {});
224
225
  ok('R4 leaving the Briefing while it records makes the browser ask first, and staying pauses nothing', Lv.dialogs.includes('beforeunload') && Lv.pausePosts.length === 0 && /premium\.html/.test(Lv.page.url()), Lv.dialogs.join() + ' ' + Lv.page.url());
225
226
  Lv.leave = true;
226
227
  /* After the stay above, the navigation that follows can be cancelled outright: the stay's own cancel may still be settling, so the new goto is dropped, no second prompt is
227
228
  * raised and the page never leaves (seen in about 1 run in 4). Ask again until the page has left, as the PM would press the link again. */
228
- for (let tries = 0; tries < 5 && !/premium-work\.html/.test(Lv.page.url()); tries++) {
229
- await Lv.page.goto(BASE + '/premium-work.html').catch(() => {});
230
- await Lv.page.waitForURL(/premium-work\.html/, { timeout: 4000 }).catch(() => {});
229
+ for (let tries = 0; tries < 5 && !/premium-board\.html/.test(Lv.page.url()); tries++) {
230
+ await Lv.page.goto(BASE + '/premium-board.html').catch(() => {});
231
+ await Lv.page.waitForURL(/premium-board\.html/, { timeout: 4000 }).catch(() => {});
231
232
  }
232
233
  /* A keepalive request sent from `pagehide` outlives the page, so Playwright's request event and page.route can lose it as the page goes: the race is in the observer, not the page.
233
234
  * The page's own record is exact: the init script wraps fetch and notes each pause the page issues in localStorage, which the next page of the same origin reads. */
@@ -244,10 +245,10 @@ const RECORDER = () => {
244
245
 
245
246
  /* R3 the chip on every premium page, and Open */
246
247
  const paused = { id: 'n1', title: 'Live review', state: 'paused', resume_until: new Date(Date.now() + 3000000).toISOString(), updated_at: new Date().toISOString(), meeting: { kind: 'event', event_id: 'ev-live', start: iso(START), title: 'Live review' } };
247
- for (const [name, url] of [['Briefing', '/premium.html'], ['My work', '/premium-work.html'], ['Board', '/premium-board.html'], ['Initiative', '/premium-initiative.html?id=none'], ['Insights', '/premium-insights.html']]) {
248
+ for (const [name, url] of [['Briefing', '/premium.html'], ['My work (redirects to Home)', '/premium-work.html'], ['Board', '/premium-board.html'], ['Initiative', '/premium-initiative.html?id=none'], ['Insights', '/premium-insights.html']]) {
248
249
  const C = await open({ notes: [paused], url, openDialog: false });
249
250
  ok(`R3 the ${name} page shows the chip for a paused meeting`, await until(async () => /Paused Live review/.test((await chip(C.page)) || ''), 15000), String(await chip(C.page)));
250
- if (url === '/premium-work.html') {
251
+ if (url === '/premium-board.html') { // re-pointed for premium-agreed-design H3: My work redirects to Home, so Open is pressed from the Board
251
252
  await C.page.click('#recChip [data-r="open"]');
252
253
  await until(() => /premium\.html\?meeting=n1|premium\.html/.test(C.page.url()));
253
254
  const opened = await until(() => C.page.evaluate(() => document.querySelector('#dlg').classList.contains('on') && document.querySelector('#dTitle').textContent === 'Live review'), 20000);
@@ -321,6 +322,8 @@ const RECORDER = () => {
321
322
  keys: [{ id: 'd1', k: 'decision', text: 'Plan with eight people', t: 61000, by: 'Priya', state: 'draft' }, { id: 'a1', k: 'action', text: 'Priya confirms the owner', t: 140000, owner: 'Priya', due: '2026-10-24', state: 'draft' }, { id: 'q1', k: 'question', text: 'Who signs off?', t: 200000, state: 'open' }],
322
323
  notes: [{ t: 90000, cat: 'insight', body: 'The plan leans on one hire' }], gaps: [{ from_ms: 240000, to_ms: 260000 }] };
323
324
  const Rw = await open({ replay: RICH });
325
+ // re-pointed for premium-agreed-design H2: on a desktop Home the docked chat is already full (dockOpen sets it), so Back restores the size and mode the dialog had before Replay
326
+ const preRp = await Rw.page.evaluate(() => { const g = document.getElementById('dlg'); return { full: g.classList.contains('full'), mode: g.dataset.mode || 'split' }; });
324
327
  await press(Rw.page, 'replay');
325
328
  await until(() => Rw.page.evaluate(() => !!document.querySelector('#rpKeys')));
326
329
  ok('R12 Replay opens full width with the conversation panel hidden', await Rw.page.evaluate(() => { const g = document.getElementById('dlg'); return g.classList.contains('full') && g.classList.contains('rpw') && g.dataset.mode === 'detail'; }));
@@ -340,7 +343,7 @@ const RECORDER = () => {
340
343
  await Rw.page.click('#rpKeys [data-rp="confirm"]');
341
344
  ok('R12 Confirm all adds each next step to the note\'s initiative and marks it', await until(() => Rw.page.evaluate(() => /task made/.test(document.querySelector('#rpKeys').textContent))) && Rw.planPosts.length === 1 && Rw.planPosts[0].events[0].initiative === 'premium-viewer' && Rw.planPosts[0].events[0].title === 'Priya confirms the owner' && Rw.planPosts[0].events[0].stage === 's1' && Rw.planPosts[0].events[0].due === '2026-10-24', JSON.stringify(Rw.planPosts));
342
345
  await press(Rw.page, 'unreplay');
343
- ok('R12 Back restores the dialog size and the conversation panel', await until(() => Rw.page.evaluate(() => { const g = document.getElementById('dlg'); return !g.classList.contains('full') && !g.classList.contains('rpw') && g.dataset.mode === 'split'; })));
346
+ ok('R12 Back restores the dialog size and the conversation panel', preRp.mode === 'split' && await until(() => Rw.page.evaluate((pre) => { const g = document.getElementById('dlg'); return g.classList.contains('full') === pre.full && !g.classList.contains('rpw') && g.dataset.mode === 'split'; }, preRp)), JSON.stringify(preRp));
344
347
  await Rw.ctx.close();
345
348
  const Rn = await open();
346
349
  await press(Rn.page, 'replay');
@@ -438,7 +441,9 @@ const RECORDER = () => {
438
441
  const consM = await mp.evaluate(() => { const d = document.createElement('div'); d.innerHTML = '<div class="cons"></div>'; document.body.appendChild(d); const c = getComputedStyle(d.firstChild); return [c.borderRadius, c.display].join('|'); });
439
442
  await press(Fx.page, 'unfocus'); await press(Fx.page, 'stop');
440
443
  const consP = await Fx.page.evaluate(() => { const c = getComputedStyle(document.querySelector('.m3-cons')); return [c.borderRadius, c.display].join('|'); });
441
- ok('R11 fidelity: the ask card keeps the mockup\'s radius and layout', consM === consP, consM + ' vs ' + consP);
444
+ // re-pointed for premium-agreed-design: the Agreed design's inner radius is cozy-viewer.css's --r-in (16 px), not the mockup's 18 px; the layout is still the mockup's
445
+ const rIn = await Fx.page.evaluate(() => getComputedStyle(document.querySelector('.m3-cons')).getPropertyValue('--r-in').trim());
446
+ ok('R11 fidelity: the ask card keeps the mockup\'s layout and the Agreed design\'s inner radius', !!consP && /px$/.test(rIn) && consP.split('|')[1] === consM.split('|')[1] && consP.split('|')[0] === rIn, consM + ' vs ' + consP + ' (--r-in ' + rIn + ')');
442
447
  await Fx.ctx.close(); await mk.close();
443
448
 
444
449
  return finish();