create-pmos 0.443.0 → 0.445.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 -25
  2. package/payload/KIT-VERSION +2 -2
  3. package/payload/planning/evals/eval-calibration.md +1 -1
  4. package/payload/planning/okrs/health-budgets.md +1 -1
  5. package/payload/state/discoveries.md +1 -1
  6. package/payload/state/log.md +1 -1
  7. package/workspace/adler-moments-test.js +8 -0
  8. package/workspace/adler-seasons-art-test.js +3 -0
  9. package/workspace/board-columns-test.js +168 -0
  10. package/workspace/board-programs-test.js +1 -1
  11. package/workspace/briefing-premium-board-test.js +91 -8
  12. package/workspace/briefing-premium-insights-test.js +83 -38
  13. package/workspace/briefing-premium-test.js +2 -1
  14. package/workspace/calm-timeline-test.js +3 -1
  15. package/workspace/changelog.json +24 -0
  16. package/workspace/goals-clear-ui-test.js +34 -20
  17. package/workspace/guide/home.md +5 -0
  18. package/workspace/guide/jira.md +13 -1
  19. package/workspace/guide/ready-made-dashboards.md +2 -2
  20. package/workspace/intel-report-ui-test.js +1 -1
  21. package/workspace/lib/board-fold.js +33 -5
  22. package/workspace/lib/board-premium.js +1 -1
  23. package/workspace/lib/console-state.js +5 -1
  24. package/workspace/lib/engine/boards.js +9 -2
  25. package/workspace/lib/factory-join.js +46 -14
  26. package/workspace/lib/freshness.js +14 -1
  27. package/workspace/lib/initiative-rows.js +38 -4
  28. package/workspace/lib/issues.js +8 -1
  29. package/workspace/lib/jira-cli.js +18 -2
  30. package/workspace/lib/jira-moves.js +119 -0
  31. package/workspace/lib/jira-tickets.js +23 -4
  32. package/workspace/lib/notes.js +4 -2
  33. package/workspace/lib/offloop.js +75 -29
  34. package/workspace/lib/page-build.js +97 -0
  35. package/workspace/lib/plan-items.js +24 -3
  36. package/workspace/lib/plan-tree.js +62 -9
  37. package/workspace/lib/ready-reports.js +22 -8
  38. package/workspace/lib/refresh.js +14 -2
  39. package/workspace/lib/routes-board-premium.js +9 -1
  40. package/workspace/lib/routes-boards.js +114 -16
  41. package/workspace/lib/routes-brief-page.js +3 -1
  42. package/workspace/lib/routes-calendar-import.js +13 -1
  43. package/workspace/lib/routes-ready-reports.js +28 -5
  44. package/workspace/lib/task-links.js +12 -1
  45. package/workspace/lib/workflows-store.js +14 -3
  46. package/workspace/live-pill-round-test.js +178 -0
  47. package/workspace/milestone-pins-test.js +1 -1
  48. package/workspace/okr-goals-ui-test.js +21 -19
  49. package/workspace/package-lock.json +2 -2
  50. package/workspace/package.json +1 -1
  51. package/workspace/panels-test.js +375 -0
  52. package/workspace/premium-rec-tab-test.js +2 -1
  53. package/workspace/premium-vw-item-test.js +10 -2
  54. package/workspace/premium-vw-jira-test.js +3 -0
  55. package/workspace/program-panel-test.js +6 -6
  56. package/workspace/public/pm/bd-cols.js +149 -0
  57. package/workspace/public/pm/bd-ini-panel.js +3 -2
  58. package/workspace/public/pm/bd-pane.js +41 -0
  59. package/workspace/public/pm/bd-span.js +29 -11
  60. package/workspace/public/pm/cozy-adler.js +21 -0
  61. package/workspace/public/pm/cozy-board.css +45 -0
  62. package/workspace/public/pm/cozy-divider.css +32 -0
  63. package/workspace/public/pm/cozy-divider.js +45 -0
  64. package/workspace/public/pm/cozy-insights.css +22 -0
  65. package/workspace/public/pm/cozy-live-pill.css +17 -22
  66. package/workspace/public/pm/cozy-live-pill.js +38 -18
  67. package/workspace/public/pm/cozy-panels.css +80 -0
  68. package/workspace/public/pm/cozy-panels.js +691 -0
  69. package/workspace/public/pm/cozy-viewer.js +148 -70
  70. package/workspace/public/pm/dash-view.js +5 -2
  71. package/workspace/public/pm/goals-clear.js +9 -2
  72. package/workspace/public/pm/home-app.js +30 -19
  73. package/workspace/public/pm/home-ini.js +9 -3
  74. package/workspace/public/pm/home-today.js +4 -2
  75. package/workspace/public/pm/ini-edit.js +405 -0
  76. package/workspace/public/pm/ini-tasks.js +175 -46
  77. package/workspace/public/pm/ini-versions.js +18 -4
  78. package/workspace/public/pm/ini-view-model.js +12 -7
  79. package/workspace/public/pm/ini-view.css +162 -26
  80. package/workspace/public/pm/ini-view.js +44 -13
  81. package/workspace/public/pm/ini-wf-model.js +9 -0
  82. package/workspace/public/pm/ini-wf.js +14 -9
  83. package/workspace/public/pm/ins-pane.js +55 -0
  84. package/workspace/public/pm/jira-move.js +50 -0
  85. package/workspace/public/pm/live-model.js +3 -2
  86. package/workspace/public/pm/pn-narrow.js +76 -0
  87. package/workspace/public/pm/premium-board.js +85 -32
  88. package/workspace/public/pm/premium-insights.js +211 -43
  89. package/workspace/public/pm/task-card.css +2 -0
  90. package/workspace/public/pm/task-card.js +4 -1
  91. package/workspace/public/premium-board.html +2 -0
  92. package/workspace/ready-dash-ui-test.js +4 -4
  93. package/workspace/server.js +71 -20
  94. package/workspace/skills/jira-move.skill +35 -0
  95. package/workspace/stage-card-tasks-test.js +397 -0
  96. package/workspace/stage-card-test.js +1 -1
  97. package/workspace/task-delete-test.js +9 -1
  98. package/workspace/task-links-test.js +1 -0
  99. package/workspace/task-milestones-test.js +3 -3
  100. package/workspace/task-plans-test.js +1 -1
  101. package/workspace/task-press-test.js +12 -4
  102. package/workspace/task-views-test.js +166 -13
  103. package/workspace/test-lists/batch18-live-pill-round.json +10 -0
  104. package/workspace/test-lists/batch18-panels.json +9 -0
  105. package/workspace/test-lists/board-columns.json +5 -0
  106. package/workspace/test-lists/jira-moves.json +11 -0
  107. package/workspace/test-lists/page-speed-fold.json +5 -0
  108. package/workspace/test-lists/page-speed-reads.json +5 -0
  109. package/workspace/test-lists/stage-card-tasks.json +6 -0
  110. package/workspace/timeline-holds-test.js +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-pmos",
3
- "version": "0.443.0",
3
+ "version": "0.445.0",
4
4
  "description": "Scaffold the PMOS portable kit — run the PMOS product-management workflow (initiative → lane-fit spec → contract → build → three gates, with work-type lanes for features, research, maintenance, incidents, and content) entirely inside your own repo, with all state as git-versioned files. Includes `workflow-sweep`, which audits the state every board derives from and separates real defects from work you simply have not done. `create-pmos workspace` also installs + launches the local Terminal Workspace GUI. No database, no network, no telemetry.",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -32,6 +32,30 @@
32
32
  "audit"
33
33
  ],
34
34
  "pmosChanges": [
35
+ {
36
+ "v": "0.445.0",
37
+ "at": "2026-10-29T01:59:56.258Z",
38
+ "f": 2,
39
+ "prs": [
40
+ {
41
+ "n": 1090,
42
+ "t": "Faster pages, panels on Board and Intelligence, task status on timelines, Jira moves (feedback batch 19)",
43
+ "s": "Faster pages, panels on Board and Intelligence, task status on timelines, Jira moves (feedback batch 19)"
44
+ }
45
+ ]
46
+ },
47
+ {
48
+ "v": "0.444.0",
49
+ "at": "2026-10-28T16:25:00.066Z",
50
+ "f": 2,
51
+ "prs": [
52
+ {
53
+ "n": 1088,
54
+ "t": "Arrange panels, manage tasks in the stage card, goals dashboard (batch 18 items 15, 16, 11 gap)",
55
+ "s": "Arrange panels, manage tasks in the stage card, goals dashboard (batch 18 items 15, 16, 11 gap)"
56
+ }
57
+ ]
58
+ },
35
59
  {
36
60
  "v": "0.443.0",
37
61
  "at": "2026-10-28T14:17:24.774Z",
@@ -247,30 +271,6 @@
247
271
  "s": "Thirteenth testing feedback batch"
248
272
  }
249
273
  ]
250
- },
251
- {
252
- "v": "0.425.0",
253
- "at": "2026-10-27T01:04:19.475Z",
254
- "f": 2,
255
- "prs": [
256
- {
257
- "n": 1066,
258
- "t": "Recording tab and one product picker (batch 12, items 1 and 5)",
259
- "s": "Recording tab and one product picker (batch 12, items 1 and 5)"
260
- }
261
- ]
262
- },
263
- {
264
- "v": "0.424.0",
265
- "at": "2026-10-27T00:38:50.632Z",
266
- "f": 2,
267
- "prs": [
268
- {
269
- "n": 1064,
270
- "t": "Twelfth testing feedback batch",
271
- "s": "Twelfth testing feedback batch"
272
- }
273
- ]
274
274
  }
275
275
  ]
276
276
  }
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@22227288
2
- assembled: 2026-10-28
1
+ kernel-source: pmos@05009594
2
+ assembled: 2026-10-29
3
3
  mode: vendor
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Eval calibration log"
4
4
  description: "Append-only record of every PM override of an evaluator verdict."
5
- generated: {by: process:create-pmos, at: "2026-10-28T14:17:21Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-29T01:59:52Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Health budgets"
4
4
  description: "Closed registry of health-budget anchors (D59), edited only by the PM."
5
- generated: {by: process:create-pmos, at: "2026-10-28T14:17:21Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-29T01:59:52Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Discoveries and friction log"
4
4
  description: "Append-only record of what runs discovered and where the process rubbed."
5
- generated: {by: process:create-pmos, at: "2026-10-28T14:17:21Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-29T01:59:52Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  Newest first, ISO dates.
4
4
 
5
- ## 2026-10-28
5
+ ## 2026-10-29
6
6
 
7
7
  - Adopted OKF v0.2 (D73).
@@ -53,6 +53,14 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
53
53
 
54
54
  const ctx = await browser.newContext({ viewport: { width: 390, height: 844 }, hasTouch: true, isMobile: true });
55
55
  const page = await ctx.newPage();
56
+ // Adler sleeps from 22:00 to 05:00 by default (adler.quiet), and a sleeping Adler shows no moment: these checks hold at any hour CI runs
57
+ await page.route(/\/api\/settings(\?.*)?$/, async (rq) => {
58
+ if (rq.request().method() !== 'GET') return rq.continue();
59
+ const r = await rq.fetch(); const j = await r.json().catch(() => null);
60
+ if (!j || !Array.isArray(j.settings)) return rq.fulfill({ response: r });
61
+ const settings = j.settings.filter((x) => x && x.key !== 'adler.quiet').concat([{ key: 'adler.quiet', value: 'never' }]);
62
+ return rq.fulfill({ response: r, json: { ...j, settings } });
63
+ });
56
64
  const errors = [], posts = [];
57
65
  page.on('pageerror', (e) => errors.push(String(e)));
58
66
  page.on('request', (rq) => { if (rq.method() === 'POST') posts.push({ path: new URL(rq.url()).pathname, body: rq.postData() || '' }); });
@@ -51,6 +51,9 @@ export const skipThisYear = (key, now) => ({ key: 'adler.dress.skip', value: key
51
51
  browser = await chromium.launch({ executablePath: exe });
52
52
  if (SHOTS) fs.mkdirSync(SHOTS, { recursive: true });
53
53
  const BRIEF = BRP.build(BRF.facts());
54
+ // a calm day: the fixture's two blocked rows would make Your day say the news plainly instead of the wish (home-day.js, concerned
55
+ // replaces it). The suite passed without this only while Home's reads were too slow to land before the press (page speed, 2026-10-29).
56
+ if (BRIEF.list && Array.isArray(BRIEF.list.rows)) BRIEF.list.rows = BRIEF.list.rows.filter((r) => r.kind !== 'blocked');
54
57
  const BOARD = BP.build(BF.facts());
55
58
 
56
59
  for (const [tag, vp] of [['390', { width: 390, height: 844, hasTouch: true, isMobile: true }], ['1280', { width: 1280, height: 860 }]]) {
@@ -0,0 +1,168 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+ /* board-columns-test.js — the Board timeline's columns and bars (batch 19 item 5, Board Track; canvas StsA8Board, StsA9BoardDark, sticky stsBoard).
4
+ * Serves the real page from the real server; GET /api/board-premium answers Project Ascent's IDPF board (fixtures/program-ascent.js) with the
5
+ * rows calm-timeline-test.js adds: a hold, a late row, an at-risk row, an initiative with several milestone tasks. The clock is 17 Oct 2026.
6
+ * C the default columns: Initiative, Stage, Status, Start, Next milestone; Status empty on track, a dot and a word off track, no dot by the name
7
+ * M Next milestone: ◇, name, date; missed in orange with +Nd; with it shown the bar's end has no label, with it off the label is back
8
+ * B 20 px rounded bars, now blue while under way, a late row's orange line to Today; the Deliveries lane on top, no Today line in it
9
+ * S a press on a column title sorts by it; a second press goes back to time order
10
+ * P the Columns menu: a check box per column, Initiative always; the choice is remembered; Escape closes it
11
+ * N a narrow Board drops columns from the right and brings them back when it widens; a phone has none
12
+ * SHOTS_COLS=<dir>: the timeline at 1440 light and dark, with the menu open, and at 1000, into <dir>. */
13
+ const path = require('path');
14
+ const { spawn } = require('child_process');
15
+ const { findBrowser } = require('./lib/find-browser');
16
+ const T = require('./test-run').configure({ name: 'board-columns' });
17
+ const BP = require('./lib/board-premium.js');
18
+ const F = require('./fixtures/board-premium-facts.js');
19
+
20
+ const BASE = T.BASE;
21
+ const results = [];
22
+ const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + extra : ''}`); };
23
+ let srv = null; let browser = null;
24
+ const finish = async (code) => {
25
+ if (browser) await browser.close().catch(() => {});
26
+ if (srv) { try { srv.kill('SIGKILL'); } catch { /* gone */ } }
27
+ T.killTmux();
28
+ const bad = results.filter((x) => !x.cond).length;
29
+ console.log(`\n${results.length - bad}/${results.length} board-columns assertions passed`);
30
+ process.exit(code !== undefined ? code : (bad ? 1 : 0));
31
+ };
32
+ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
33
+
34
+ const row = (id, title, o) => ({ id, title, lane: 'feature', stage: 'Build', cat: 'Do', owner: 'Wawan', anchor: 'q4-2026:o3:kr1', horizon: 'now', status: 'on track', start: null, end: null, progress: 30, warnings: [], rank: 0, health: 'on', updated: '2026-10-15T08:00:00.000Z', reading: 'build', stageSource: 'derived', dupOf: null, ...o });
35
+ const EXTRA = [
36
+ row('email-otp', 'Email OTP (passwordless login for every member)', { start: '2026-07-01', end: '2027-06-10', status: 'on hold', holds: [{ from: '2026-08-25', to: null, back: '2027-03-01', reason: 'Waits on the SMS vendor contract' }], stopped: { state: 'on-hold', reason: 'Waits on the SMS vendor contract', at: '2026-08-25T09:00:00.000Z', back: '2027-03-01' } }),
37
+ row('lightbox', 'Lightbox UI Adjustments', { start: '2026-08-10', end: '2026-10-12', status: 'late', progress: 80 }),
38
+ row('magw', 'MAGW migration to auth-service', { start: '2026-09-01', end: '2026-11-02', status: 'at risk', progress: 60 }),
39
+ row('migration', 'Migration — move from Okta to Descope', { start: '2026-10-15', end: '2027-09-05', progress: 15 }),
40
+ ];
41
+ const it = (ini, uid, title, o) => ({ uid, key: '', kind: 'Task', src: 'pmos', title, status: 'To do', owner: 'Wawan', ini, start: null, end: null, ref: uid, board: 'idpf', milestone: true, ...o });
42
+ const ITEMS = [
43
+ it('migration', 'm-it1', 'Iteration 1 live', { end: '2027-01-20' }),
44
+ it('migration', 'm-it2', 'Iteration 2 live', { end: '2027-03-25' }),
45
+ it('migration', 'm-rel', 'Release: all users on Descope', { end: '2027-06-01' }),
46
+ it('migration', 'm-okta', 'Okta decommissioned', { end: '2027-09-05', section: 'evaluate' }),
47
+ it('lightbox', 'l-live', 'Lightbox UI live', { end: '2026-10-12', section: 'evaluate' }),
48
+ ];
49
+
50
+ (async () => {
51
+ const exe = findBrowser();
52
+ if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the suite cannot run'); return finish(1); }
53
+ let chromium;
54
+ try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
55
+ srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
56
+ await T.waitForServer(BASE);
57
+ browser = await chromium.launch({ executablePath: exe });
58
+
59
+ /** The Board on the timeline at Year. o: { w, h, dark, phone, cols } */
60
+ const open = async (o = {}) => {
61
+ const ctx = await browser.newContext({ viewport: { width: o.w || 1440, height: o.h || 1000 }, colorScheme: o.dark ? 'dark' : 'light', hasTouch: !!o.phone, isMobile: !!o.phone });
62
+ const page = await ctx.newPage();
63
+ const errors = [];
64
+ page.on('pageerror', (e) => errors.push(String((e && e.stack) || e)));
65
+ await page.clock.setFixedTime(new Date(F.NOW));
66
+ const base = F.programFacts('idpf'), rows = base.rows.concat(EXTRA.map((r) => ({ ...r })));
67
+ await page.route('**/api/board-premium*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model: BP.build({ ...base, rows, total: rows.length, items: ITEMS.map((x) => ({ ...x })) }), as_of: Date.now() }) }));
68
+ await page.route('**/api/programs', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, programs: F.programs() }) }));
69
+ await page.route('**/api/board-trail*', (r) => r.fulfill({ status: 500, contentType: 'application/json', body: JSON.stringify({ ok: false, error: 'not in this check' }) }));
70
+ const ls = { 'pmos.board.view': 'time', 'pmos.board.pview': 'time', 'pmos.board.span': 'year' };
71
+ if (o.cols) ls['pmos.board.tlcols'] = o.cols;
72
+ await page.addInitScript(([s]) => { try { if (!sessionStorage.getItem('set')) { sessionStorage.setItem('set', '1'); for (const [k, v] of Object.entries(s)) localStorage.setItem(k, v); } } catch { /* none */ } }, [ls]);
73
+ await page.goto(BASE + '/premium-board.html?ws=idpf&board=idpf');
74
+ await page.waitForSelector('#ibBody [data-row]', { timeout: 15000 });
75
+ await page.waitForTimeout(500);
76
+ return { ctx, page, errors };
77
+ };
78
+ const shots = process.env.SHOTS_COLS;
79
+ const shot = async (p, name) => { if (shots) { await p.waitForTimeout(800); await p.screenshot({ path: path.join(shots, name + '.png') }); } };
80
+ const heads = (p) => p.evaluate(() => [...document.querySelectorAll('#ibBody .tg-h .tg-chd')].map((b) => b.textContent));
81
+ /** One row's columns and marks, read in the page. */
82
+ const rowOf = (p, key) => p.evaluate((k) => {
83
+ const r = document.querySelector(`#ibBody [data-row="${k}"]`); if (!r) return null;
84
+ const st = r.querySelector('.tg-cst'), ms = r.querySelector('.tg-cms');
85
+ return {
86
+ cells: [...r.querySelectorAll('.tg-n .tg-c')].map((c) => c.innerText.replace(/\s+/g, ' ').trim()),
87
+ status: st ? st.className : '', stDot: st ? (st.querySelector('.cz-dot') || {}).className || '' : '', nameDot: !!r.querySelector('.tg-c0 .cz-dot'),
88
+ ms: ms ? ms.className : '', labels: [...r.querySelectorAll('.tg-endl')].map((x) => x.textContent.replace(/\s+/g, ' ').trim()), end: !!r.querySelector('.tg-end'),
89
+ bar: (() => { const b = r.querySelector('.tg-bar'); return b ? { h: b.getBoundingClientRect().height, rad: parseFloat(getComputedStyle(b).borderTopLeftRadius) } : null; })(),
90
+ nw: r.querySelectorAll('.tg-bar > i.nw').length, late: (() => { const l = r.querySelector('.tg-late'); return l ? parseFloat(l.style.left) + parseFloat(l.style.width) : null; })(),
91
+ today: (() => { const t = r.querySelector('.tg-td'); return t ? parseFloat(t.style.left) : null; })(),
92
+ };
93
+ }, key);
94
+ const rowsIn = (p) => p.evaluate(() => [...document.querySelectorAll('#ibBody .tg-gr[data-row]')].map((r) => r.dataset.row.replace('board:', '')));
95
+
96
+ // ── C, M, B: the default columns at 1440 ──
97
+ {
98
+ const { ctx, page: p, errors } = await open();
99
+ await shot(p, 'cols-1440');
100
+ ok('C the default columns: Initiative, Stage, Status, Start, Next milestone', (await heads(p)).join() === 'Initiative,Stage,Status,Start,Next milestone', JSON.stringify(await heads(p)));
101
+ const dp = await rowOf(p, 'board:descope-parity'), lb = await rowOf(p, 'board:lightbox'), mg = await rowOf(p, 'board:magw'), otp = await rowOf(p, 'board:email-otp'), mig = await rowOf(p, 'board:migration'), il = await rowOf(p, 'board:eshop-inline-login');
102
+ ok('C on track the Status cell is empty; Stage and Start say the stage and the start', dp && dp.cells[0] === 'Discover' && dp.cells[1] === '' && dp.cells[2] === 'Oct 5', JSON.stringify(dp));
103
+ ok('C off track a dot and a word: Late orange, At risk amber, On hold grey; no dot before the name', lb && /late/.test(lb.status) && lb.cells[1] === 'Late' && /late/.test(lb.stDot) && mg && /risk/.test(mg.status) && mg.cells[1] === 'At risk' && otp && otp.cells[1] === 'On hold' && /\bq\b/.test(otp.stDot) && ![dp, lb, mg, otp].some((x) => x.nameDot), JSON.stringify([lb, mg, otp]));
104
+ ok('M Next milestone: the name and its date; the year only when it is not this year', mig && mig.cells[3] === 'Iteration 1 live Jan 20 ’27' && dp.cells[3] === 'Deliver Nov 12', JSON.stringify([mig, dp]));
105
+ ok('M a missed milestone is orange with +Nd', lb && /late/.test(lb.ms) && lb.cells[3] === 'Lightbox UI live Oct 12 +5d', JSON.stringify(lb));
106
+ ok('M with Next milestone shown the bar end has no label, and keeps its ◇', [dp, lb, mg, mig].every((x) => x.labels.length === 0 && x.end), JSON.stringify([dp, lb].map((x) => x.labels)));
107
+ ok('B bars are 20 px and rounded', [dp, lb, mg, mig].every((x) => x.bar && Math.round(x.bar.h) === 20 && x.bar.rad >= 10), JSON.stringify([dp, lb].map((x) => x.bar)));
108
+ ok('B a late row draws its orange line to the Today line; a row not over draws none', lb && lb.late != null && lb.today != null && Math.abs(lb.late - lb.today) < 0.2 && mg && mg.late === null, JSON.stringify([lb.late, lb.today, mg.late]));
109
+ ok('B now is blue while the work is under way; a row past Deliver has none', mg && mg.nw > 0 && il && il.nw === 0, JSON.stringify([mg && mg.nw, il && il.nw]));
110
+ const lane = await p.evaluate(() => { const b = document.querySelector('#ibBody .tg-s .tg-in'), kids = [...b.children].map((x) => x.className.split(' ').slice(0, 2).join(' ')); const dl = document.querySelector('#ibBody .tg-dl'); return { kids, td: dl ? dl.querySelectorAll('.tg-td').length : -1 }; });
111
+ ok('B the Deliveries lane is on top, under the head, and the Today line starts below it', /tg-h/.test(lane.kids[0]) && /tg-dl/.test(lane.kids[1]) && lane.td === 0, JSON.stringify(lane));
112
+ // S: a press on a column title sorts each group by it; a second press goes back to time order
113
+ const before = await rowsIn(p);
114
+ await p.click('#ibBody [data-tsort="status"]'); await p.waitForTimeout(200);
115
+ const byStatus = await rowsIn(p), aria = await p.evaluate(() => document.querySelector('#ibBody [data-tsort="status"]').getAttribute('aria-sort'));
116
+ ok('S pressing Status puts late, at risk and on hold first', byStatus.slice(0, 3).join() === 'lightbox,magw,email-otp' && aria === 'ascending', JSON.stringify(byStatus));
117
+ await p.click('#ibBody [data-tsort="status"]'); await p.waitForTimeout(200);
118
+ ok('S a second press goes back to time order', (await rowsIn(p)).join() === before.join(), JSON.stringify([before, await rowsIn(p)]));
119
+ // P: the Columns menu
120
+ ok('P the Columns button shows on the timeline', await p.evaluate(() => !document.querySelector('#bdColsw').hidden));
121
+ await p.click('#bdCols'); await p.waitForTimeout(150);
122
+ const menu = await p.evaluate(() => { const m = document.querySelector('#bdColsMenu'); return { open: !m.hidden, boxes: m.querySelectorAll('input[type=checkbox]').length, off: m.querySelectorAll('input:disabled:checked').length, on: [...m.querySelectorAll('input[data-tcol]:checked')].map((x) => x.dataset.tcol), focus: document.activeElement && document.activeElement.dataset.tcol }; });
123
+ ok('P the menu has a check box per column, Initiative always on, the defaults checked', menu.open && menu.boxes === 10 && menu.off === 1 && menu.on.join() === 'stage,status,start,ms' && menu.focus === 'stage', JSON.stringify(menu));
124
+ await shot(p, 'cols-menu');
125
+ await p.click('#bdColsMenu [data-tcol="owner"]'); await p.waitForTimeout(200);
126
+ await p.click('#bdColsMenu [data-tcol="ms"]'); await p.waitForTimeout(200);
127
+ const after = await heads(p), lb2 = await rowOf(p, 'board:lightbox');
128
+ ok('P Owner on and Next milestone off: the columns follow, and the bar end names its milestone again', after.join() === 'Initiative,Stage,Status,Start,Owner' && /Wawan$/.test(lb2.cells[3]) && lb2.labels.length === 1 && /Lightbox UI live/.test(lb2.labels[0]), JSON.stringify([after, lb2]));
129
+ ok('P the menu stays open while you choose', await p.evaluate(() => !document.querySelector('#bdColsMenu').hidden));
130
+ await p.keyboard.press('Escape'); await p.waitForTimeout(150);
131
+ ok('P Escape closes the menu and gives the focus back to the button', await p.evaluate(() => document.querySelector('#bdColsMenu').hidden && document.activeElement && document.activeElement.id === 'bdCols'));
132
+ await p.reload(); await p.waitForSelector('#ibBody [data-row]'); await p.waitForTimeout(400);
133
+ ok('P the choice is remembered after a reload', (await heads(p)).join() === 'Initiative,Stage,Status,Start,Owner', JSON.stringify(await heads(p)));
134
+ await p.click('#ibTabs [data-v="track"]'); await p.waitForTimeout(200);
135
+ ok('P the Columns button is the timeline\'s only', await p.evaluate(() => document.querySelector('#bdColsw').hidden));
136
+ ok('no page error', errors.length === 0, errors.join(' | '));
137
+ await ctx.close();
138
+ }
139
+ // ── the dark frame (StsA9BoardDark) ──
140
+ {
141
+ const { ctx, page: p, errors } = await open({ dark: true });
142
+ await shot(p, 'cols-1440-dark');
143
+ ok('C dark: the same columns, no page error', (await heads(p)).length === 5 && errors.length === 0, errors.join(' | '));
144
+ await ctx.close();
145
+ }
146
+ // ── N: narrow, then wide again; the phone ──
147
+ {
148
+ const { ctx, page: p, errors } = await open({ w: 1000 });
149
+ await shot(p, 'cols-1000');
150
+ const h = await heads(p), lb = await rowOf(p, 'board:lightbox');
151
+ ok('N at 1000 px the last columns drop from the right; the timeline keeps its room', h.length >= 2 && h.length < 5 && h.join() === 'Initiative,Stage,Status,Start,Next milestone'.split(',').slice(0, h.length).join(), JSON.stringify(h));
152
+ ok('N with Next milestone dropped the bar end names its milestone', !h.includes('Next milestone') && lb.labels.length === 1, JSON.stringify(lb));
153
+ const room = await p.evaluate(() => { const s = document.querySelector('#ibBody .tg-sc'), n = document.querySelector('#ibBody .tg-h > .tg-n'); return s.clientWidth - n.getBoundingClientRect().width; });
154
+ ok('N the timeline keeps at least 400 px', room >= 400, String(room));
155
+ await p.setViewportSize({ width: 1440, height: 1000 }); await p.waitForTimeout(500);
156
+ ok('N widened again, the columns come back', (await heads(p)).join() === 'Initiative,Stage,Status,Start,Next milestone', JSON.stringify(await heads(p)));
157
+ ok('N no page error', errors.length === 0, errors.join(' | '));
158
+ await ctx.close();
159
+ }
160
+ {
161
+ const { ctx, page: p, errors } = await open({ w: 390, h: 844, phone: true });
162
+ const ph = await p.evaluate(() => ({ heads: document.querySelectorAll('#ibBody .tg-chd, #ibBody .tg-c').length, btn: document.querySelector('#bdColsw').hidden, bars: [...document.querySelectorAll('#ibBody .tg-bar')].map((b) => Math.round(b.getBoundingClientRect().height)), scroll: document.documentElement.scrollWidth <= innerWidth + 1 }));
163
+ ok('N the phone has no columns and no Columns button; its bars are 20 px; no sideways page scroll', ph.heads === 0 && ph.btn && ph.bars.length && ph.bars.every((x) => x === 20) && ph.scroll, JSON.stringify(ph));
164
+ ok('N no page error on the phone', errors.length === 0, errors.join(' | '));
165
+ await ctx.close();
166
+ }
167
+ finish();
168
+ })();
@@ -64,7 +64,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
64
64
  });
65
65
  await page.route('**/api/programs', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, programs: o.programs || F.programs() }) }));
66
66
  await page.route('**/api/board-trail*', (r) => r.fulfill({ status: 500, contentType: 'application/json', body: JSON.stringify({ ok: false, error: 'not in this check' }) }));
67
- await page.addInitScript(([s]) => { try { if (!sessionStorage.getItem('set')) { sessionStorage.setItem('set', '1'); for (const [k, v] of Object.entries(s)) localStorage.setItem(k, v); } } catch { /* none */ } }, [{ 'pmos.board.view': o.view || 'track', 'pmos.board.pview': o.view === 'time' ? 'track' : o.view || 'track', 'pmos.board.grouping': o.grouping || 'program', ...(o.store || {}) }]);
67
+ await page.addInitScript(([s]) => { try { if (!sessionStorage.getItem('set')) { sessionStorage.setItem('set', '1'); for (const [k, v] of Object.entries(s)) localStorage.setItem(k, v); } } catch { /* none */ } }, [{ 'pmos.board.tlcols': '[]', 'pmos.board.view': o.view || 'track', 'pmos.board.pview': o.view === 'time' ? 'track' : o.view || 'track', 'pmos.board.grouping': o.grouping || 'program', ...(o.store || {}) }]);
68
68
  await page.addInitScript(() => { window.__prog = []; document.addEventListener('bd:program', (e) => window.__prog.push(e.detail && e.detail.id)); });
69
69
  // o.plain: the Board as the place menu opens it (no ws), showing the saved pick; else a one-off link to one product's board
70
70
  await page.goto(BASE + '/premium-board.html' + (o.plain ? (o.qs || '').replace(/^&/, '?') : '?ws=' + (o.ws || 'idpf') + '&board=' + (o.ws || 'idpf') + (o.qs || '')));
@@ -63,7 +63,7 @@ const IVREAD = () => {
63
63
  bars: sc ? [...sc.querySelectorAll('.mi-svg :is(.mi-st, .mi-dsh)')].map((x) => (x.classList.contains('dn') ? 'done' : x.classList.contains('q') ? 'next' : 'now')).join('|') : '',
64
64
  nm: sc && tx('.iv-mi-nm', sc), ms: sc ? [...sc.querySelectorAll('.iv-mio .iv-msr')].map((x) => x.textContent.replace(/\s+/g, ' ').trim()) : [],
65
65
  aria: sc && sc.getAttribute('aria-label'), dates: sc && tx('.iv-mio-h .iv-dtc', sc), next: sc && sc.querySelector('.iv-scgo') ? sc.querySelector('.iv-scgo').getAttribute('aria-label') : null,
66
- tasks: tx('.iv-th'), secs: [...iv.querySelectorAll('.iv-ws')].map((b) => b.textContent.replace(/\s+/g, ' ').trim()), tks: [...iv.querySelectorAll('[data-iv-ticket]')].map((e) => e.dataset.ivTicket).join(),
66
+ tasks: tx('.iv-th'), secs: [...iv.querySelectorAll('.iv-ws')].map((b) => b.textContent.replace(/\s+/g, ' ').trim()), tks: [...iv.querySelectorAll('[data-iv-ticket], .iv-tkr [data-iv-edit]')].map((e) => e.dataset.ivTicket || e.dataset.ivEdit).join(),
67
67
  rows: [...iv.querySelectorAll('.iv-tr')].map((e) => e.textContent.replace(/\s+/g, ' ').trim()), q: [...iv.querySelectorAll('.iv-q')].map((e) => e.textContent), empty: !!iv.querySelector('.iv-empty'),
68
68
  folds: [...iv.querySelectorAll('.iv-fr b, .czs-row b')].map((b) => b.textContent), body: v.querySelector('.cz-vw-body').textContent.replace(/\s+/g, ' '),
69
69
  ask: v.querySelectorAll('.cz-vw-body input, .cz-vw-body textarea').length, disc: !!v.querySelector('[data-cz-vw="discuss"]'), w: Math.round(r.width), side: Math.round(innerWidth - r.right) < 40 };
@@ -78,9 +78,10 @@ const IVREAD = () => {
78
78
  await T.waitForServer(BASE);
79
79
  browser = await chromium.launch({ executablePath: exe });
80
80
 
81
- const open = async ({ w = 1280, h = 900, theme = 'light', model = mk(), answers = null, trail = null, qs = '' } = {}) => {
81
+ const open = async ({ w = 1440, h = 900, theme = 'light', model = mk(), answers = null, trail = null, qs = '', slowSheet = 0 } = {}) => {
82
82
  const ctx = await browser.newContext({ viewport: { width: w, height: h } });
83
83
  const page = await ctx.newPage();
84
+ if (slowSheet) await page.route('**/pm/cozy-panels.css', async (r) => { await new Promise((ok) => setTimeout(ok, slowSheet)); r.continue(); }); // the panels sheet lands after the first Viewer
84
85
  let current = model, calls = 0; const errors = [], posts = []; let answer = { status: 200, body: { ok: true } }; let thread = { ok: true, turns: [], working: false };
85
86
  page.on('pageerror', (e) => errors.push(String((e && e.stack) || e)));
86
87
  await page.route('**/api/board-premium*', (r) => { calls++; if (answers) { const a = answers(calls); return r.fulfill({ status: a.status, contentType: 'application/json', body: JSON.stringify(a.body) }); } return r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model: current, as_of: Date.now() }) }); });
@@ -213,7 +214,9 @@ const IVREAD = () => {
213
214
  * the stage bar, then the folding rows. The Ask box is gone; Discuss in chat and ⋯ take its presses */
214
215
  const pk = await until(() => q.evaluate(IVREAD).then((x) => (x && x.kind === 'Initiative' ? x : null)));
215
216
  const sel = await q.evaluate(() => ({ sel: !!document.querySelector('.bt-l.sel[data-row="board:sso-partners"]'), dlg: !!document.querySelector('#dlg.on'), peek: !document.querySelector('#peek'), record: !!document.querySelector('#czViewer [data-pk="record"]') }));
216
- ok('B1 a row opens the initiative in the Viewer, floating at 560 px over the right edge, not the old dialog, and the row is marked', !!pk && pk.t === 'SSO for partners' && pk.w === 560 && pk.side && sel.peek && !sel.dlg && !sel.record && sel.sel, JSON.stringify([pk, sel]));
217
+ const split = await q.evaluate(() => { const v = document.querySelector('#czViewer'), m = document.querySelector('#stage').getBoundingClientRect(); return { float: v.classList.contains('cz-vw-float'), page: Math.round(m.width), right: Math.round(m.right) <= Math.round(v.getBoundingClientRect().left), narrow: document.querySelector('#stage').classList.contains('cz-pn-narrow') }; });
218
+ // re-pointed (panels on Board and Intelligence, BiB1Split): the Viewer opens beside the page, at a width that keeps the stage track whole
219
+ ok('B1 a row opens the initiative in the Viewer beside the page, the track kept whole, not the old dialog, and the row is marked', !!pk && pk.t === 'SSO for partners' && pk.w >= 400 && pk.w <= 560 && pk.side && !split.float && split.right && !split.narrow && split.page >= 880 && sel.peek && !sel.dlg && !sel.record && sel.sel, JSON.stringify([pk, sel, split]));
217
220
  /* re-pointed (the one view): the meta is the owner and the workflow, each fact once; the progress source is the right of the status line */
218
221
  ok('B1 the meta line holds the owner and the workflow as icons, each fact once (XvpA1)', !!pk && /Owner: Lee/.test(pk.meta) && pk.wfi === 'Product feature' && !/day|Deliver/.test(pk.meta), JSON.stringify(pk && [pk.meta, pk.wfi]));
219
222
  /* re-pointed (batch 6 rules 1, 4 and 11): the card says where it is (6 of 8 on the ladder) and how much of Deliver's tickets are done; the
@@ -224,6 +227,8 @@ const IVREAD = () => {
224
227
  if (process.env.PMOS_SHOTS) await q.screenshot({ path: path.join(process.env.PMOS_SHOTS, 'ini-deliver-1280.png') });
225
228
  const n0 = R.posts.length; if (await q.$('#czViewer [data-iv-fold="linked"][aria-expanded="false"]')) await q.click('#czViewer [data-iv-fold="linked"]'); await q.click('#czViewer [data-iv-jira]');
226
229
  ok('B1 the ↻ beside Jira\'s freshness in Linked reads Jira through the Jira source\'s own refresh, and says so', await until(() => R.posts.slice(n0).some((x) => x.path === '/api/sources/refresh' && x.body.source === 'jira' && x.body.ws === 'w1')) && await until(() => q.evaluate(() => /Reading Jira again/.test(document.querySelector('#bdToast').textContent))), JSON.stringify(R.posts.slice(n0)));
230
+ // batch 18 item 16: a ticket row's title opens the row in place; its Open the ticket sits there, after the dates
231
+ if (!(await q.$('#czViewer [data-iv-ticket="SSO-12"]'))) await q.click('#czViewer [data-iv-edit="SSO-12"]');
227
232
  await q.click('#czViewer [data-iv-ticket="SSO-12"]');
228
233
  const tk = await until(() => q.evaluate(() => { const v = document.querySelector('#czViewer'), t = v && v.querySelector('.cz-vw-title'), b = v && v.querySelector('.tkv'); return t && /SSO-12/.test(t.textContent) && b ? { t: t.textContent, back: !!v.querySelector('[data-cz-vw="back"]'), line: (v.querySelector('.czs-line') || {}).textContent || '', right: (v.querySelector('.czs-line .czs-r') || {}).textContent || '', sprint: (v.querySelector('[data-tkv-f="sprint"]') || {}).textContent, foot: (v.querySelector('.tkv .ovf .foot') || {}).textContent, where: (v.querySelector('.tkv .ovw') || {}).textContent, body: v.querySelector('.cz-vw-body').textContent.replace(/\s+/g, ' '), pri: !!v.querySelector('.czs-pri'), jira: (v.querySelector('.ovft a') || {}).href } : null; }));
229
234
  /* re-pointed (batch 6 item 1b, canvas OvViewers "Jira ticket"): the one ticket Viewer. What blocks it leads; the facts are plain text with
@@ -233,6 +238,7 @@ const IVREAD = () => {
233
238
  await four(q, 'ticket');
234
239
  await q.click('#czViewer [data-cz-vw="back"]');
235
240
  ok('B1 the ticket\'s Back goes to the initiative', await until(async () => (await vwTitle(q)) === 'SSO for partners'));
241
+ if (await q.$('#czViewer .iv-ed')) await q.keyboard.press('Escape'); // the ticket's row is still open in place (batch 18 item 16): Esc shuts it first
236
242
  await q.keyboard.press('Escape');
237
243
  ok('B1 Escape closes the Viewer', await vwShut(q));
238
244
  const n1 = R.posts.length; await q.click('#chJira');
@@ -352,8 +358,8 @@ const IVREAD = () => {
352
358
  const yr = await p.evaluate(() => ({ rows: [...document.querySelectorAll('#ibBody .tg-q[data-span="year"] .tg-n.ini2 b')].map((b) => b.textContent), bars: document.querySelectorAll('#ibBody .tg-bar').length, themes: document.querySelectorAll('#ibBody .tg-th, #ibBody .tg-tn, #ibBody .tg-phase').length, group: !!document.querySelector('#chGroup'), lgd: !!document.querySelector('#bdChipset .tg-lgd'), jira: !!document.querySelector('#chJira'), heads: [...document.querySelectorAll('#ibBody .tg-h .tg-p > span[data-y] b')].map((b) => b.textContent) }));
353
359
  ok('B6 Year draws Quarter\'s rows (TsAllSpans): one row per initiative with its bar, months as columns; no themes, no Group chip; the chips and the legend stay', yr.rows.join() === tl.rows.join() && yr.bars === 3 && !yr.themes && !yr.group && yr.lgd && yr.jira && yr.heads.length >= 12 && yr.heads.every((h) => /^[A-Z][a-z]{2}$/.test(h)), JSON.stringify(yr));
354
360
  await spanTo(p, 'y5');
355
- const y5 = await p.evaluate(() => ({ rows: document.querySelectorAll('#ibBody .tg-q[data-span="y5"] .tg-n.ini2').length, heads: [...document.querySelectorAll('#ibBody .tg-h .tg-p > span[data-y] b')].map((b) => b.textContent), dates: [...document.querySelectorAll('#ibBody .tg-endl, #ibBody .tg-lab')].map((e) => e.textContent) }));
356
- ok('B6 5 yr draws the same rows with years as columns, and each bar ends with what lands, then when (batch 13 item 4)', y5.rows === 3 && y5.heads.length >= 5 && y5.heads.every((h) => /^\d{4}$/.test(h)) && y5.dates.length === 3 && y5.dates.every((d) => /^[A-Z][\w ]* [A-Z][a-z]{2} \d{1,2}( ’\d\d)?$/.test(d)), JSON.stringify(y5));
361
+ const y5 = await p.evaluate(() => ({ rows: document.querySelectorAll('#ibBody .tg-q[data-span="y5"] .tg-n.ini2').length, heads: [...document.querySelectorAll('#ibBody .tg-h .tg-p > span[data-y] b')].map((b) => b.textContent), dates: [...document.querySelectorAll('#ibBody .tg-endl, #ibBody .tg-lab, #ibBody .tg-cms')].map((e) => e.innerText.replace(/\s+/g, ' ').trim()) })); // with the Next milestone column (batch 19 item 5) the column says it
362
+ ok('B6 5 yr draws the same rows with years as columns, and each bar ends with what lands, then when (batch 13 item 4)', y5.rows === 3 && y5.heads.length >= 5 && y5.heads.every((h) => /^\d{4}$/.test(h)) && y5.dates.length === 3 && y5.dates.every((d) => /^[A-Z][\w ]* [A-Z][a-z]{2} \d{1,2}( ’\d\d)?( \+\d+d)?$/.test(d)), JSON.stringify(y5));
357
363
  const sp = [];
358
364
  for (const [k, sel, re] of [['sprint', '.sp[data-span="sprint"]', /Initiative and ticket.*Backlog · \d+ not in/], ['half', '.tg-q[data-span="half"]', /Self-serve onboarding v2/], ['y2', '.tg-q[data-span="y2"]', /Self-serve onboarding v2/]]) { await spanTo(p, k); sp.push(await p.evaluate(([q2, r]) => { const e = document.querySelector('#ibBody ' + q2); return !!e && !document.querySelector('#ibBody .bd-wtag') && new RegExp(r).test(e.textContent); }, [sel, re.source])); }
359
365
  ok('B6 Sprint (BdSpans: tickets and the backlog row), Half and 2 yr (Quarter\'s rows) are drawn, with no "Waiting for design" tag', sp.every(Boolean), JSON.stringify(sp));
@@ -392,7 +398,7 @@ const IVREAD = () => {
392
398
  const noFull = await vwMore(D.page, 'Open in full');
393
399
  if (noFull) await D.page.keyboard.press('Escape');
394
400
  if (!noFull) await D.page.keyboard.press('Escape');
395
- ok('B14 ⋯ has no Open in full, and the header keeps Open wide', !noFull && await D.page.evaluate(() => !!document.querySelector('#czViewer [data-cz-vw="wide"]')));
401
+ ok('B14 ⋯ has no Open in full, and the header has ⧉ in place of Open wide (panels: Full screen, Split, Slide over)', !noFull && await D.page.evaluate(() => !!document.querySelector('#czViewer [data-cz-vw="place"]') && !document.querySelector('#czViewer [data-cz-vw="wide"]')));
396
402
  await D.page.click('#czViewer [data-cz-vw="more"]'); await D.page.click('.cz-vw-menu [role="menuitem"]:has(> span:text-is("Copy"))'); await D.page.click('.hi-pop [role="menuitem"]:has(> span:text-is("Link"))');
397
403
  const cl = await until(() => D.page.evaluate(() => navigator.clipboard.readText().catch(() => '')));
398
404
  const u = new URL(cl || 'http://x/none');
@@ -470,7 +476,10 @@ const IVREAD = () => {
470
476
  ok('T a linked document opens in the Viewer, as its text', await until(() => q.evaluate(() => { const v = document.querySelector('#czViewer'); return !!v && !v.hidden && /New teams stall at the invite step/.test(v.textContent); })));
471
477
  await q.keyboard.press('Escape'); await sleep(150);
472
478
  if (await vwOn(q)) { await q.keyboard.press('Escape'); await sleep(150); }
473
- await q.click('.bt-l[data-row="board:sso-partners"] .bt-nm'); await until(() => vwOn(q, 'Initiative')); await q.click('#czViewer [data-iv-ticket="SSO-12"]');
479
+ await q.click('.bt-l[data-row="board:sso-partners"] .bt-nm'); await until(() => vwOn(q, 'Initiative'));
480
+ await q.waitForSelector('#czViewer [data-iv-ticket="SSO-12"], #czViewer [data-iv-edit="SSO-12"]');
481
+ if (!(await q.$('#czViewer [data-iv-ticket="SSO-12"]'))) await q.click('#czViewer [data-iv-edit="SSO-12"]'); // batch 18 item 16: the row opens in place first
482
+ await q.click('#czViewer [data-iv-ticket="SSO-12"]');
474
483
  ok('T the ticket counts its subtasks from the Jira reading (the Subtasks fold: "1 of 3 done")', await until(() => q.evaluate(() => { const x = document.querySelector('#czViewer [data-czs-id="sub"]'); if (!x) return false; const t = x.textContent.replace(/\s+/g, ' '); return (x.querySelector('.czs-n') || {}).textContent === '1 of 3 done' && (x.querySelector('.czs-body') ? /1 done, 2 open/.test(t) : true) && !document.querySelector('#czViewer .seg5'); })));
475
484
  await q.keyboard.press('Escape'); await vwShut(q);
476
485
  /* the long spans draw Quarter's rows (timeline spans C): the trail's themes group nothing there any more, and there is no Group control */
@@ -541,8 +550,11 @@ const IVREAD = () => {
541
550
 
542
551
  /* ?focus=<initiative id>: Insights links to the Board this way, and the Board opens that initiative's panel */
543
552
  {
544
- const R = await open({ qs: '&focus=partner-rate-limits' });
553
+ const R = await open({ qs: '&focus=partner-rate-limits', slowSheet: 800 });
545
554
  ok('F1 ?focus=<id> opens that initiative in the Viewer on the Board', await until(async () => (await vwTitle(R.page)) === 'Partner API rate limits' && await R.page.evaluate(() => !!document.querySelector('.bt-l.sel[data-row="board:partner-rate-limits"]'))));
555
+ // panels on Board and Intelligence: a Viewer opened before the panels sheet lands is sized again, so the track stays whole beside it
556
+ const f1 = await R.page.evaluate(() => { const m = document.querySelector('#stage'); return { w: Math.round(m.getBoundingClientRect().width), narrow: m.classList.contains('cz-pn-narrow'), vw: Math.round(document.querySelector('#czViewer').getBoundingClientRect().width) }; });
557
+ ok('F1 the Viewer opened from the address sits beside a whole stage track, even when the panels sheet comes late', f1.w >= 880 && !f1.narrow && f1.vw >= 400, JSON.stringify(f1));
546
558
  await R.ctx.close();
547
559
  }
548
560
 
@@ -565,6 +577,77 @@ const IVREAD = () => {
565
577
  await ctx.close();
566
578
  }
567
579
 
580
+ /* PN the Board as the first panel (panels on Board and Intelligence, P-B; BiB1Split, BiB2Half, sticky "What to build" items 0, 3 and 5).
581
+ * The panels engine puts cz-pn-narrow on the page while its panel is narrower than fit(); here the class is set by hand on a 1440 window, so
582
+ * the narrow form is checked by the panel's width alone, never the window's. */
583
+ {
584
+ const R = await open({ w: 1440, h: 900 }), q = R.page;
585
+ const st = () => q.evaluate(async () => {
586
+ const P = await import('/pm/bd-pane.js'), m = document.querySelector('#stage'), cs = (e) => (e ? getComputedStyle(e) : null);
587
+ const sel = [...document.querySelectorAll('#ibBody .sel')].filter((x) => x.offsetParent), s0 = sel[0], c = cs(s0);
588
+ return { view: document.querySelector('#ibBody').dataset.view, desk: m.dataset.bdDesk, fit: P.fit(), seg: !!document.querySelector('#ibBody .bd-phseg'),
589
+ tabs: cs(document.querySelector('#ibTabs')).display, vbtn: cs(document.querySelector('#bdView')).display, pad: cs(m).paddingLeft,
590
+ vw: !!(window.czViewer && window.czViewer.isOpen()), sel: sel.map((x) => x.className.split(' ')[0]), selKey: s0 ? s0.dataset.key || s0.dataset.row : null,
591
+ blue: c ? /inset/.test(c.boxShadow) && c.backgroundColor !== 'rgba(0, 0, 0, 0)' : false, stored: localStorage.getItem('pmos.board.view') };
592
+ });
593
+ const narrowTo = (on, w) => q.evaluate(([o, px]) => { const m = document.querySelector('#stage'); m.style.maxWidth = px ? px + 'px' : ''; m.classList.toggle('cz-pn-narrow', o); }, [on, w]);
594
+ await view(q, 'track');
595
+ const d0 = await st();
596
+ ok('PN1 a wide page panel keeps the desktop view: the stage track, the view buttons, and fit() is about 880 for it', d0.view === 'track' && d0.desk === 'track' && d0.fit === 880 && !d0.seg && d0.tabs !== 'none', JSON.stringify(d0));
597
+ await view(q, 'list'); const dl = await st(); await view(q, 'track');
598
+ ok('PN1 fit() follows the desktop view: the List needs 360', dl.fit === 360, JSON.stringify(dl));
599
+ await narrowTo(true, 700); await sleep(300);
600
+ const n1 = await st();
601
+ ok('PN2 a narrow page panel on a wide window draws the narrow form: the List, with the phone\'s view switch and its toolbar', n1.view === 'list' && n1.seg && n1.tabs === 'none' && n1.vbtn !== 'none', JSON.stringify(n1));
602
+ ok('PN2 fit() still measures the desktop view, so the narrow form does not flip back', n1.desk === 'track' && n1.fit === 880, JSON.stringify(n1));
603
+ await q.click('#ibBody .bd-lrow[data-key="board:usage-billing"]');
604
+ await until(() => vwOn(q, 'Initiative'));
605
+ const n2 = await st();
606
+ ok('PN3 the open row is marked blue in the narrow form (BiB2Half)', n2.vw && n2.sel.join() === 'bd-lrow' && n2.selKey === 'board:usage-billing' && n2.blue, JSON.stringify(n2));
607
+ await q.click('#ibBody [data-pv="stages"]'); await sleep(250);
608
+ const n3 = await st();
609
+ ok('PN3 a view picked in the narrow form keeps the Viewer open and leaves the desktop\'s view alone', n3.view === 'stages' && n3.vw && n3.desk === 'track' && n3.stored === 'track', JSON.stringify(n3));
610
+ ok('PN3 the open card is marked in By stage too', n3.sel.join() === 'bd-bc' && n3.selKey === 'board:usage-billing', JSON.stringify(n3));
611
+ await narrowTo(false); await sleep(300);
612
+ const n4 = await st();
613
+ ok('PN4 a wider panel goes back to the desktop view, the Viewer still open and its row marked blue', n4.view === 'track' && !n4.seg && n4.vw && n4.selKey === 'board:usage-billing' && n4.blue, JSON.stringify(n4));
614
+ // the rows that open beside: the row's name in every view, never the grip, never a By stage card
615
+ const src = await q.evaluate(async () => {
616
+ const P = await import('/pm/bd-pane.js'), out = {};
617
+ for (const v of ['track', 'time', 'list', 'stages']) {
618
+ document.querySelector(`#ibTabs [data-v="${v}"]`).click(); await new Promise((r) => setTimeout(r, 150));
619
+ const m = [...document.querySelectorAll(P.SOURCES)];
620
+ out[v] = { n: m.length, names: m.every((e) => e.classList.contains('ini2') && !e.closest('[data-grip], .grip, .bd-grip')), cards: document.querySelectorAll(P.CARDS).length };
621
+ }
622
+ return out;
623
+ });
624
+ ok('PN5 a drag or ⌘-click opens beside from the row\'s name in the track, the timeline and the List', src.track.n > 0 && src.time.n > 0 && src.list.n > 0 && src.track.names && src.time.names && src.list.names, JSON.stringify(src));
625
+ ok('PN5 By stage cards are not drag sources (a drag there moves the stage)', src.stages.n === 0 && src.stages.cards > 0, JSON.stringify(src));
626
+ const cmd = await q.evaluate(async () => {
627
+ const got = []; window.czPanels = Object.assign(window.czPanels || {}, { openBeside: (el) => { got.push(el.dataset.key); return true; } });
628
+ const c = document.querySelector('#ibBody .bd-bc[data-key]'), drag = c.getAttribute('draggable');
629
+ c.dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true, metaKey: true }));
630
+ c.dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true, ctrlKey: true }));
631
+ c.dispatchEvent(new MouseEvent('auxclick', { bubbles: true, cancelable: true, button: 1 }));
632
+ return { got, key: c.dataset.key, drag };
633
+ });
634
+ ok('PN6 ⌘-click, Ctrl-click and a middle-click on a By stage card open it beside', cmd.got.length === 3 && cmd.got.every((k) => k === cmd.key), JSON.stringify(cmd));
635
+ await q.evaluate(() => { delete window.czPanels.openBeside; });
636
+ await q.click('#ibBody .bd-bc[data-key="board:usage-billing"]');
637
+ ok('PN6 a plain click on a card still opens it as before', await until(() => vwOn(q, 'Initiative')));
638
+ ok('PN no script error', R.errors.length === 0, R.errors.join(' | '));
639
+ await R.ctx.close();
640
+ }
641
+ /* PN7 the dark look of the narrow form: the open row stays blue */
642
+ {
643
+ const R = await open({ w: 1440, h: 900, theme: 'dark' }), q = R.page;
644
+ await q.evaluate(() => { const m = document.querySelector('#stage'); m.style.maxWidth = '700px'; m.classList.add('cz-pn-narrow'); }); await sleep(300);
645
+ await q.click('#ibBody .bd-lrow[data-key="board:usage-billing"]'); await until(() => vwOn(q, 'Initiative'));
646
+ const d = await q.evaluate(() => { const s = document.querySelector('#ibBody .bd-lrow.sel'), c = s && getComputedStyle(s); return c ? { bg: c.backgroundColor, sh: c.boxShadow } : null; });
647
+ ok('PN7 dark: the open row of the narrow form is blue, its left edge too', !!d && d.bg !== 'rgba(0, 0, 0, 0)' && /inset/.test(d.sh), JSON.stringify(d));
648
+ await R.ctx.close();
649
+ }
650
+
568
651
  /* B13 the Agreed design's look: Nunito, the soft panel, the chips and the track's rows */
569
652
  for (const th of ['light', 'dark']) {
570
653
  const R = await open({ w: 1440, h: 900, theme: th }), q = R.page;