create-pmos 0.443.0 → 0.444.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 (56) hide show
  1. package/package.json +13 -13
  2. package/payload/KIT-VERSION +1 -1
  3. package/payload/planning/evals/eval-calibration.md +1 -1
  4. package/payload/planning/okrs/health-budgets.md +1 -1
  5. package/payload/state/discoveries.md +1 -1
  6. package/workspace/briefing-premium-board-test.js +8 -2
  7. package/workspace/briefing-premium-insights-test.js +40 -38
  8. package/workspace/briefing-premium-test.js +2 -1
  9. package/workspace/changelog.json +12 -0
  10. package/workspace/goals-clear-ui-test.js +34 -20
  11. package/workspace/guide/home.md +5 -0
  12. package/workspace/intel-report-ui-test.js +1 -1
  13. package/workspace/lib/board-premium.js +1 -1
  14. package/workspace/lib/engine/boards.js +9 -2
  15. package/workspace/lib/routes-boards.js +40 -1
  16. package/workspace/live-pill-round-test.js +178 -0
  17. package/workspace/okr-goals-ui-test.js +21 -19
  18. package/workspace/package-lock.json +2 -2
  19. package/workspace/package.json +1 -1
  20. package/workspace/panels-test.js +231 -0
  21. package/workspace/premium-rec-tab-test.js +2 -1
  22. package/workspace/premium-vw-item-test.js +10 -2
  23. package/workspace/premium-vw-jira-test.js +3 -0
  24. package/workspace/public/pm/bd-ini-panel.js +3 -2
  25. package/workspace/public/pm/cozy-adler.js +21 -0
  26. package/workspace/public/pm/cozy-divider.css +32 -0
  27. package/workspace/public/pm/cozy-divider.js +45 -0
  28. package/workspace/public/pm/cozy-insights.css +14 -0
  29. package/workspace/public/pm/cozy-live-pill.css +16 -22
  30. package/workspace/public/pm/cozy-live-pill.js +28 -17
  31. package/workspace/public/pm/cozy-panels.css +59 -0
  32. package/workspace/public/pm/cozy-panels.js +524 -0
  33. package/workspace/public/pm/cozy-viewer.js +146 -70
  34. package/workspace/public/pm/goals-clear.js +9 -2
  35. package/workspace/public/pm/home-app.js +22 -11
  36. package/workspace/public/pm/home-ini.js +9 -3
  37. package/workspace/public/pm/home-today.js +4 -2
  38. package/workspace/public/pm/ini-edit.js +401 -0
  39. package/workspace/public/pm/ini-tasks.js +42 -18
  40. package/workspace/public/pm/ini-versions.js +18 -4
  41. package/workspace/public/pm/ini-view-model.js +8 -4
  42. package/workspace/public/pm/ini-view.css +88 -1
  43. package/workspace/public/pm/ini-view.js +42 -11
  44. package/workspace/public/pm/premium-board.js +8 -6
  45. package/workspace/public/pm/premium-insights.js +205 -43
  46. package/workspace/public/pm/task-card.css +2 -0
  47. package/workspace/public/pm/task-card.js +4 -1
  48. package/workspace/stage-card-tasks-test.js +396 -0
  49. package/workspace/stage-card-test.js +1 -1
  50. package/workspace/task-delete-test.js +9 -1
  51. package/workspace/task-milestones-test.js +3 -3
  52. package/workspace/task-press-test.js +12 -4
  53. package/workspace/task-views-test.js +8 -4
  54. package/workspace/test-lists/batch18-live-pill-round.json +10 -0
  55. package/workspace/test-lists/batch18-panels.json +9 -0
  56. package/workspace/test-lists/stage-card-tasks.json +6 -0
@@ -0,0 +1,396 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+ /* stage-card-tasks-test.js — a task changed where it sits in the initiative's Tasks List (feedback batch 18 item 16, agreed A, Wawan
4
+ * 2026-10-28 13:48 "promote to ready for development then build"; main canvas In development, frames StA1Rows to StA10bDragPhone).
5
+ * Serves the real pages (Home's Viewer, premium.html, and the Board's panel, premium-board.html) from the real server. The Board read is a
6
+ * fixture that answers the writes the way the server does: a rename, a stage, a date, a new task and an order show on the next read.
7
+ * S1 the rows: one line, the due day only on a phone, nothing without dates, "◇ Nov 14", + on each open stage and none on the header
8
+ * S2 a title press opens the row in place: the name field, then one line: status, Start – Due, ⋯ (one row at a time; Esc closes)
9
+ * S3 rename: Enter saves (Undo) · S4 the status chip: the five icons only · S5 the date chips: the picker opens on that day
10
+ * S6 ⋯: Milestone, Move to a stage, Open the task card, Delete · S7 a milestone has one date · S8 + adds into its stage, the field stays
11
+ * S9 a Jira row: title and status read-only, "<Status> in Jira · read N min ago", dates editable, no Delete
12
+ * S10 drag on a desktop: to another stage (section + order), inside a stage (order only, kept on the next read)
13
+ * S11 a long press on a phone's title lifts the row · S12 a milestone on the Timeline is its ◇ only; Kanban says "◇ Nov 14"
14
+ * S13 light and dark, phone and desktop: no page error. PMOS_SHOTS=<dir> writes the screens. */
15
+ const path = require('path');
16
+ const { spawn } = require('child_process');
17
+ const { findBrowser } = require('./lib/find-browser');
18
+ const T = require('./test-run').configure({ name: 'stage-card-tasks' });
19
+ const BP = require('./lib/board-premium.js');
20
+ const F = require('./fixtures/board-premium-facts.js');
21
+ const BRP = require('./lib/briefing-premium.js');
22
+ const BRF = require('./fixtures/briefing-premium-facts.js');
23
+ const IP = require('./lib/initiative-premium.js');
24
+ const IF = require('./fixtures/initiative-premium-facts.js');
25
+
26
+ const BASE = T.BASE, SHOTS = process.env.PMOS_SHOTS || '';
27
+ const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
28
+ const until = async (fn, ms = 10000, step = 100) => { const t0 = Date.now(); for (;;) { let v = null; try { v = await fn(); } catch { v = null; } if (v) return v; if (Date.now() - t0 > ms) return v; await sleep(step); } };
29
+ const results = [];
30
+ const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + String(extra).slice(0, 500) : ''}`); };
31
+ let srv = null; let browser = null;
32
+ const finish = async (code) => {
33
+ if (browser) await browser.close().catch(() => {});
34
+ if (srv) { try { srv.kill('SIGKILL'); } catch { /* gone */ } }
35
+ T.killTmux();
36
+ const bad = results.filter((x) => !x.cond).length;
37
+ console.log(`\n${results.length - bad}/${results.length} stage-card-tasks assertions passed`);
38
+ process.exit(code !== undefined ? code : (bad ? 1 : 0));
39
+ };
40
+ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
41
+
42
+ /* the fixture's day is 2026-10-17; Home's self-serve-v2 and the Board's usage-billing get the same tasks */
43
+ const TASKS = () => [
44
+ { uid: 'task-b1', title: 'Brief support on the device limit', status: 'To do', owner: 'Wawan', start: '2026-10-30', end: '2026-11-06', section: 'build' },
45
+ { uid: 'task-b2', title: 'IDPF-3387 Refactor the AppAuthService', status: 'To do', owner: 'Ruth Lim', start: '2026-10-27', end: '2026-11-07', section: 'build' },
46
+ { uid: 'task-b3', title: 'Device limit enforcement', status: 'To do', owner: 'Sam Hu', start: '2026-11-03', end: '2026-11-12', section: 'build' },
47
+ { uid: 'task-b4', title: 'Session must expire on logout', status: 'To do', owner: 'Sam Hu', section: 'build' },
48
+ { uid: 'task-b5', title: 'Kick-off notes', status: 'Done', owner: 'Wawan', end: '2026-10-12', section: 'build' },
49
+ { uid: 'task-d1', title: 'MAGW migration ready', status: 'To do', owner: 'Wawan', end: '2026-11-14', milestone: true, section: 'deliver' },
50
+ ];
51
+ const TICKETS = [{ key: 'IDPF-3387', title: 'Refactor the AppAuthService', status: 'In progress', raw: 'In Progress' }];
52
+
53
+ (async () => {
54
+ const exe = findBrowser();
55
+ if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the suite cannot run'); return finish(1); }
56
+ let chromium;
57
+ try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
58
+ srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT), PMOS_SELF_ROOT: path.resolve(__dirname, '..') }) });
59
+ await T.waitForServer(BASE);
60
+ browser = await chromium.launch({ executablePath: exe });
61
+
62
+ // where: 'home' (premium.html's Viewer) or 'board' (the Board's panel)
63
+ const open = async ({ where = 'home', w = 390, h = 844, theme = 'light', view = 'list' } = {}) => {
64
+ const touch = w < 700, id = where === 'home' ? 'self-serve-v2' : 'usage-billing';
65
+ const ctx = await browser.newContext({ viewport: { width: w, height: h }, hasTouch: touch, isMobile: touch, colorScheme: theme });
66
+ await ctx.addInitScript((v) => { localStorage.setItem('pmos.tasks.view', v); localStorage.setItem('pmos.tasks.zoom', 'month'); }, view);
67
+ const page = await ctx.newPage(), errors = [], posts = [];
68
+ // the board's state: the writes land here, and the next read shows them
69
+ const S = { tasks: TASKS(), order: {} };
70
+ const M = () => {
71
+ const m = BP.build(F.facts()); const r = m.rows.find((x) => x.id === id);
72
+ r.tasks = S.tasks.map((t) => { const L = S.order[t.section || ''] || [], i = L.indexOf(t.uid); return { ...t, ...(i >= 0 ? { rank: i } : {}) }; });
73
+ r.track = { ...(r.track || {}), tickets: TICKETS };
74
+ m.jira = { ...(m.jira || {}), readAt: new Date(Date.now() - 4 * 60000).toISOString() };
75
+ return m;
76
+ };
77
+ const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'application/json', body: JSON.stringify(b) });
78
+ page.on('pageerror', (e) => errors.push(String((e && e.stack) || e)));
79
+ await page.route('**/api/board-premium*', (r) => json(r, { ok: true, state: 'ready', model: M(), as_of: Date.now() }));
80
+ await page.route('**/api/board-trail*', (r) => json(r, { ok: false }, 500));
81
+ await page.route('**/api/initiative-premium*', (r) => json(r, { ok: true, state: 'ready', model: IP.build(IF.facts()), as_of: Date.now() }));
82
+ await page.route(/\/api\/briefing-premium(\?.*)?$/, (r) => json(r, { ok: true, state: 'ready', model: BRP.build(BRF.facts()), as_of: Date.now() }));
83
+ await page.route('**/api/briefing-premium/**', (r) => json(r, { ok: true, turns: [], working: false }));
84
+ await page.route('**/api/jira/tickets*', (r) => json(r, { ok: false, error: 'not in this check' }));
85
+ await page.route(/\/api\/(boards\/|lifecycle)/, (r) => {
86
+ const rq = r.request(), p = new URL(rq.url()).pathname; if (rq.method() === 'GET') return json(r, { ok: true });
87
+ const b = JSON.parse(rq.postData() || '{}'); posts.push({ path: p, body: b });
88
+ const t = S.tasks.find((x) => x.uid === b.task);
89
+ if (p === '/api/boards/tasks/rename' && t) { const from = t.title; t.title = b.title; return json(r, { ok: true, from }); }
90
+ if (p === '/api/boards/tasks/state' && t) { t.status = b.state; return json(r, { ok: true }); }
91
+ if (p === '/api/boards/tasks/edit' && t) {
92
+ const from = {};
93
+ for (const k of ['start', 'due', 'section', 'milestone']) if (k in b) { const f = k === 'due' ? 'end' : k; from[k] = k === 'milestone' ? !!t.milestone : t[f] || ''; t[f] = b[k]; }
94
+ return json(r, { ok: true, from });
95
+ }
96
+ if (p === '/api/boards/tasks/add') { const uid = 'task-n' + S.tasks.length; S.tasks.push({ uid, title: b.title, status: 'To do', owner: 'Wawan', start: b.start || '', end: b.due || '', section: b.section || '' }); return json(r, { ok: true, item: { uid } }); }
97
+ if (p === '/api/boards/tasks/delete') { S.tasks = S.tasks.filter((x) => x.uid !== b.task); return json(r, { ok: true }); }
98
+ if (p === '/api/boards/tasks/order') { const from = S.order[b.section] || []; S.order[b.section] = b.tasks; return json(r, { ok: true, from }); }
99
+ return json(r, { ok: true });
100
+ });
101
+ if (where === 'home') await page.goto(BASE + '/premium.html?ini=self-serve-v2&ws=w1&board=w1&theme=' + theme);
102
+ else {
103
+ await page.goto(BASE + '/premium-board.html?theme=' + theme);
104
+ await until(() => page.evaluate(() => document.querySelectorAll('#ibBody .ini2, #ibBody .bt-l').length > 0), 20000);
105
+ await page.evaluate(() => { const b = [...document.querySelectorAll('[data-row="board:usage-billing"] .bt-nm, [data-key="board:usage-billing"]')].find((x) => x.offsetParent); if (b) b.click(); });
106
+ }
107
+ await until(() => page.evaluate((v) => !!document.querySelector(v === 'list' ? '#czViewer .iv-wbs' : '#czViewer :is(.ivt, .iva, .ivk)'), view), 20000);
108
+ // Build and Deliver open (the Board's initiative is in Discover; Home's is in Build)
109
+ await openStage(page, 'build'); await openStage(page, 'deliver');
110
+ await sleep(200);
111
+ return { ctx, page, errors, posts, S };
112
+ };
113
+ const openStage = (pg, key) => pg.evaluate((k) => {
114
+ const rest = document.querySelector('#czViewer .iv-rest[aria-expanded="false"]');
115
+ const h = document.querySelector(`#czViewer .iv-ws[data-iv-sec="${k}"]`);
116
+ if (!h && rest) rest.click();
117
+ const h2 = document.querySelector(`#czViewer .iv-ws[data-iv-sec="${k}"]`); if (h2 && h2.getAttribute('aria-expanded') === 'false') h2.click();
118
+ }, key).then(() => sleep(150)).then(() => pg.evaluate((k) => { const h = document.querySelector(`#czViewer .iv-ws[data-iv-sec="${k}"]`); if (h && h.getAttribute('aria-expanded') === 'false') h.click(); }, key)).then(() => sleep(150));
119
+ const shot = async (pg, name) => { if (SHOTS) await pg.screenshot({ path: path.join(SHOTS, name + '.png') }).catch(() => {}); };
120
+ const lastPost = (A, route) => A.posts.filter((x) => x.path === route).pop();
121
+ const toast = (pg) => pg.evaluate(() => { const t = [...document.querySelectorAll('#bdToast, .cz-toast, #czToast, [class*="toast"]')].find((x) => x.getClientRects().length && getComputedStyle(x).visibility !== 'hidden' && /\S/.test(x.textContent)); return t ? t.textContent.replace(/\s+/g, ' ').trim() : ''; });
122
+ const undo = (pg) => pg.evaluate(() => { const L = [...document.querySelectorAll('button')].filter((x) => x.offsetParent && /^Undo$/.test((x.textContent || '').trim() || x.getAttribute('aria-label') || '')); const b = L.pop() || document.querySelector('#bdToast .bd-undo'); if (b) { b.click(); return L.length ? 'also: ' + L.map((x) => x.parentElement.id || x.parentElement.className).join() : true; } return false; });
123
+ const rowsOf = (pg, key) => pg.evaluate((k) => [...document.querySelectorAll(`#czViewer .iv-wl[data-iv-sec="${k}"] > .iv-tr[data-iv-r]`)].map((r) => r.dataset.ivR), key);
124
+
125
+ /* ── Home, phone ── */
126
+ const A = await open(), p = A.page;
127
+ /* S1 the rows */
128
+ await p.evaluate(() => { const m = document.querySelector('#czViewer .iv-wl[data-iv-sec="build"] > .iv-more'); if (m) m.click(); }); await sleep(200); // the fourth open task
129
+ const R1 = await p.evaluate(() => {
130
+ const row = (u) => document.querySelector(`#czViewer .iv-tr[data-iv-r="${u}"]`);
131
+ const vis = (e) => !!e && getComputedStyle(e).display !== 'none' && e.getBoundingClientRect().width > 0;
132
+ const b1 = row('task-b1'), b4 = row('task-b4'), d1 = row('task-d1'), b2 = row('task-b2');
133
+ const tt = b1 && b1.querySelector('.iv-tt').getBoundingClientRect(), dc = b1 && b1.querySelector('.iv-dc').getBoundingClientRect();
134
+ return {
135
+ oneLine: !!(tt && dc && Math.abs((tt.top + tt.height / 2) - (dc.top + dc.height / 2)) < 6 && b1.getBoundingClientRect().height <= 52),
136
+ phoneDue: b1 && b1.querySelector('.iv-dc').innerText.trim(), startHidden: !vis(b1 && b1.querySelector('.iv-dst')),
137
+ undated: b4 && !b4.querySelector('.iv-dc'), ms: d1 && d1.querySelector('.iv-dc').innerText.trim(), msTitleGlyph: !!(d1 && d1.querySelector('.iv-tn .iv-ms')), msIcon: !!(d1 && d1.querySelector('.iv-dc .iv-dms svg')),
138
+ plus: [...document.querySelectorAll('#czViewer .iv-plus')].map((b) => b.getAttribute('aria-label')), headPlus: !!document.querySelector('#czViewer .iv-th [data-iv-add]'),
139
+ jira: b2 && !!b2.querySelector('.iv-jq.ig-sq') && !b2.querySelector('[data-iv-check]'),
140
+ grips: [...document.querySelectorAll('#czViewer .iv-grip')].filter(vis).length,
141
+ };
142
+ });
143
+ ok('S1 a phone row is one line: the title, its due day at the right (the start hidden)', R1.oneLine && R1.phoneDue === 'Nov 6' && R1.startHidden, JSON.stringify(R1));
144
+ ok('S1 a row with no dates shows none (zero is silence)', R1.undated, JSON.stringify(R1));
145
+ ok('S1 a milestone row says "◇ Nov 14", its ◇ once (not after the title)', R1.ms === 'Nov 14' && R1.msIcon && !R1.msTitleGlyph, JSON.stringify(R1));
146
+ ok('S1 each open stage has its own icon-only + ("New task in …"); the Tasks header has none', R1.plus.join('|') === 'New task in Build|New task in Deliver' && !R1.headPlus, JSON.stringify(R1));
147
+ ok('S1 a Jira row shows the square for its Jira status, no box; a phone draws no grip', R1.jira && R1.grips === 0, JSON.stringify(R1));
148
+ await shot(p, 'S1-rows-390');
149
+
150
+ /* S2 open in place */
151
+ await p.click('#czViewer [data-iv-edit="task-b1"]');
152
+ // the field takes the focus a frame or more after the row opens (ini-edit.js focusLater): wait for it, a slow runner is late
153
+ await until(() => p.evaluate(() => !!document.activeElement && document.activeElement.matches('#czViewer .iv-ed[data-iv-open="task-b1"] .iv-edn')), 4000);
154
+ const R2 = await until(() => p.evaluate(() => {
155
+ const r = document.querySelector('#czViewer .iv-ed[data-iv-open="task-b1"]'); if (!r) return null;
156
+ const f = r.querySelector('.iv-edn'), line = [...r.querySelectorAll('.iv-edl > *')].map((e) => e.getAttribute('aria-label') || e.textContent.trim());
157
+ const dates = [...r.querySelectorAll('.iv-edd')], more = r.querySelector('[data-iv-more]');
158
+ return { val: f && f.value, focus: document.activeElement === f, line, moreAfter: !!(more && dates.length && more.getBoundingClientRect().left - dates[dates.length - 1].getBoundingClientRect().right < 40), h: Math.round(more.getBoundingClientRect().height) };
159
+ }));
160
+ ok('S2 a title press opens the row in place: the name field, focused', R2 && R2.val === 'Brief support on the device limit' && R2.focus, JSON.stringify(R2));
161
+ ok('S2 one line under it: the status chip, Start – Due, then ⋯ right after the dates', R2 && R2.line.join('|') === 'Status: To do. Change|Start: Oct 30. Change|–|Due: Nov 6. Change|More for this task' && R2.moreAfter, JSON.stringify(R2));
162
+ ok('S2 ⋯ is a 44 px target on a phone', R2 && R2.h >= 44, JSON.stringify(R2));
163
+ await shot(p, 'S2-open-390');
164
+ await p.click('#czViewer [data-iv-edit="task-b3"]');
165
+ const one = await until(() => p.evaluate(() => { const o = [...document.querySelectorAll('#czViewer .iv-ed')].map((r) => r.dataset.ivOpen); return o.length === 1 && o[0] === 'task-b3' ? o : null; }));
166
+ ok('S2 one row is open at a time', !!one, JSON.stringify(one));
167
+ await p.keyboard.press('Escape');
168
+ ok('S2 Esc closes it', await until(() => p.evaluate(() => !document.querySelector('#czViewer .iv-ed')), 3000));
169
+
170
+ /* S3 rename */
171
+ await p.click('#czViewer [data-iv-edit="task-b1"]');
172
+ await until(() => p.evaluate(() => document.activeElement && document.activeElement.matches('.iv-edn')));
173
+ await p.keyboard.press('End'); await p.keyboard.type(' (v2)'); await p.keyboard.press('Enter');
174
+ const rn = await until(() => lastPost(A, '/api/boards/tasks/rename'));
175
+ ok('S3 Enter saves the new name (POST /api/boards/tasks/rename)', rn && rn.body.task === 'task-b1' && rn.body.title === 'Brief support on the device limit (v2)', JSON.stringify(rn));
176
+ const t3 = await until(async () => { const t = await toast(p); return /Renamed/.test(t) ? t : null; }, 4000);
177
+ ok('S3 the toast says Renamed, with Undo; the row closes and shows the new name', /Undo/.test(t3 || '') && await until(() => p.evaluate(() => !document.querySelector('#czViewer .iv-ed') && /\(v2\)/.test(document.querySelector('#czViewer [data-iv-edit="task-b1"]').textContent))), t3);
178
+ await undo(p);
179
+ const ru = await until(() => A.posts.filter((x) => x.path === '/api/boards/tasks/rename').length === 2 ? lastPost(A, '/api/boards/tasks/rename') : null);
180
+ ok('S3 Undo puts the old name back', ru && ru.body.title === 'Brief support on the device limit', JSON.stringify(ru));
181
+
182
+ /* S4 the status chip */
183
+ await p.click('#czViewer [data-iv-edit="task-b1"]');
184
+ await until(() => p.evaluate(() => !!document.querySelector('#czViewer .iv-ed')));
185
+ await p.click('#czViewer .iv-ed .iv-edst');
186
+ const st = await until(() => p.evaluate(() => { const q = document.querySelector('.tkc.ivq .ivq-st'); return q ? { n: q.querySelectorAll('[data-ivq-state]').length, ms: !!q.querySelector('.ivq-ms'), del: !!q.querySelector('.ivq-del') } : null; }));
187
+ ok('S4 the status chip opens the task card\'s five status icons only (the ◇ and Delete are in ⋯)', st && st.n === 5 && !st.ms && !st.del, JSON.stringify(st));
188
+ await shot(p, 'S4-status-390');
189
+ await p.click('.tkc.ivq [data-ivq-state="In progress"]');
190
+ const sp = await until(() => lastPost(A, '/api/boards/tasks/state'));
191
+ ok('S4 a status picked there saves at once', sp && sp.body.task === 'task-b1' && sp.body.state === 'In progress', JSON.stringify(sp));
192
+
193
+ /* S5 the date chips: a phone's picker is a bottom sheet; Start opens on the start */
194
+ await until(() => p.evaluate(() => !!document.querySelector('#czViewer .iv-ed [data-f="start"]')));
195
+ await p.click('#czViewer .iv-ed [data-f="start"]');
196
+ const dp = await until(() => p.evaluate(() => { const q = document.querySelector('.tkc.ivq.sheet .tkc-dp'); if (!q) return null; const r = q.getBoundingClientRect(); return { on: (q.querySelector('[data-tkc-field].on') || {}).textContent, bottom: Math.round(innerHeight - r.bottom), head: (q.querySelector('.ivd-h b') || {}).textContent, sub: (q.querySelector('.ivd-s') || {}).textContent }; }));
197
+ ok('S5 Start opens the task card\'s picker on the start day, as a bottom sheet on a phone', dp && dp.on === 'StartOct 30' && dp.bottom <= 1 && dp.head === 'Dates' && /Brief support/.test(dp.sub || ''), JSON.stringify(dp));
198
+ await shot(p, 'S5-dates-390');
199
+ await p.click('.tkc.ivq [data-tkc-day="2026-10-28"]');
200
+ const ds = await until(() => { const x = lastPost(A, '/api/boards/tasks/edit'); return x && x.body.start === '2026-10-28' ? x : null; });
201
+ const dueNext = await until(() => p.evaluate(() => (document.querySelector('.tkc.ivq [data-tkc-field].on') || {}).textContent));
202
+ ok('S5 a start picked saves at once, and the next tap is the due day', !!ds && /^Due/.test(dueNext || ''), JSON.stringify({ ds, dueNext }));
203
+ await p.click('.tkc.ivq [data-ivd-x]');
204
+
205
+ /* S6 ⋯ */
206
+ await until(() => p.evaluate(() => !document.querySelector('.tkc.ivq')));
207
+ if (!(await p.$('#czViewer .iv-ed'))) await p.click('#czViewer [data-iv-edit="task-b1"]');
208
+ await until(() => p.evaluate(() => !!document.querySelector('#czViewer .iv-ed [data-iv-more]')));
209
+ await p.click('#czViewer .iv-ed [data-iv-more]');
210
+ const mm = await until(() => p.evaluate(() => { const q = document.querySelector('.tkc.ivq .ive-m'); return q ? [...q.querySelectorAll('button')].map((b) => b.textContent.trim()) : null; }));
211
+ ok('S6 ⋯ holds Milestone, Move to a stage, Open the task card and Delete task', mm && mm.join('|') === 'Milestone|Move to a stage|Open the task card|Delete task', JSON.stringify(mm));
212
+ await shot(p, 'S6-more-390');
213
+ await p.click('.tkc.ivq [data-ive-mv]');
214
+ const sl = await until(() => p.evaluate(() => { const q = document.querySelector('.tkc.ivq .ive-m'); const b = q && [...q.querySelectorAll('[data-ive-to]')]; return b && b.length ? b.map((x) => x.textContent.trim() + (x.getAttribute('aria-checked') === 'true' ? '*' : '')) : null; }));
215
+ ok('S6 Move to a stage lists the workflow\'s stages, the task\'s own checked', sl && sl.includes('Build*') && sl.includes('Deliver') && sl[sl.length - 1] === 'Not in a stage', JSON.stringify(sl));
216
+ await p.click('.tkc.ivq [data-ive-to="deliver"]');
217
+ const mv = await until(() => { const x = lastPost(A, '/api/boards/tasks/edit'); return x && x.body.section === 'deliver' ? x : null; });
218
+ const t6 = await until(async () => { const t = await toast(p); return /Moved to Deliver/.test(t) ? t : null; }, 4000);
219
+ const inD = await until(async () => ((await rowsOf(p, 'deliver')).includes('task-b1') ? true : null), 4000);
220
+ ok('S6 a stage picked there moves the task (section), "Moved to Deliver" with Undo, and it shows under Deliver', mv && /Undo/.test(t6 || '') && inD, JSON.stringify({ mv, t6 }));
221
+ await undo(p);
222
+ const mu = await until(() => { const x = lastPost(A, '/api/boards/tasks/edit'); return x && x.body.section === 'build' ? x : null; });
223
+ ok('S6 Undo puts it back in Build', !!mu, JSON.stringify(A.posts.slice(-2)));
224
+
225
+ /* S7 a milestone has one date */
226
+ await until(async () => (await rowsOf(p, 'build')).includes('task-b1'));
227
+ await p.click('#czViewer [data-iv-edit="task-b3"]');
228
+ await until(() => p.evaluate(() => !!document.querySelector('#czViewer .iv-ed [data-iv-more]')));
229
+ await p.click('#czViewer .iv-ed [data-iv-more]');
230
+ await until(() => p.evaluate(() => !!document.querySelector('.tkc.ivq [data-ive-ms]')));
231
+ await p.click('.tkc.ivq [data-ive-ms]');
232
+ const ms = await until(() => { const x = lastPost(A, '/api/boards/tasks/edit'); return x && x.body.milestone === true ? x : null; });
233
+ ok('S7 ⋯ Milestone makes it a milestone and clears its start (one date), keeping the due day', ms && ms.body.task === 'task-b3' && ms.body.start === '' && ms.body.due == null, JSON.stringify(ms));
234
+ const one7 = await until(() => p.evaluate(() => { const r = document.querySelector('#czViewer .iv-ed[data-iv-open="task-b3"]'); if (!r) return null; const d = [...r.querySelectorAll('.iv-edd')]; return d.length === 1 && d[0].dataset.one === '1' ? d[0].getAttribute('aria-label') : null; }));
235
+ ok('S7 the open row then shows one ◇ date chip, no Start and Due', one7 === 'Milestone date: Nov 12. Change', one7);
236
+ await p.click('#czViewer .iv-ed .iv-edd');
237
+ const op7 = await until(() => p.evaluate(() => { const q = document.querySelector('.tkc.ivq .tkc-dp'); return q ? { tabs: q.querySelectorAll('[data-tkc-field]').length, head: (q.querySelector('.ivd-h b') || {}).textContent, sub: (q.querySelector('.ivd-s') || {}).textContent } : null; }));
238
+ ok('S7 its picker is one date: "◇ Date", no Start and Due tabs', op7 && op7.tabs === 0 && op7.head === 'Date' && /one date: the milestone/.test(op7.sub || ''), JSON.stringify(op7));
239
+ await shot(p, 'S7-milestone-390');
240
+ await p.click('.tkc.ivq [data-tkc-day="2026-11-13"]');
241
+ const m7 = await until(() => { const x = lastPost(A, '/api/boards/tasks/edit'); return x && x.body.due === '2026-11-13' ? x : null; });
242
+ ok('S7 a day picked saves the due day only, and the picker closes', m7 && m7.body.start == null && await until(() => p.evaluate(() => !document.querySelector('.tkc.ivq')), 2000), JSON.stringify(m7));
243
+ await p.keyboard.press('Escape');
244
+
245
+ await until(async () => /Dates saved/.test(await toast(p)), 3000); // the date's toast lands after its read
246
+ /* S8 + on a stage */
247
+ await p.click('#czViewer .iv-plus[data-iv-plus="build"]');
248
+ await until(() => p.evaluate(() => !!document.activeElement && document.activeElement.matches('#czViewer .iv-addin input')), 4000);
249
+ const f8 = await until(() => p.evaluate(() => { const f = document.querySelector('#czViewer .iv-wl[data-iv-sec="build"] > .iv-addin'); if (!f) return null; const first = f.parentElement.firstElementChild; return { top: first === f, ph: f.querySelector('input').placeholder, focus: document.activeElement === f.querySelector('input'), dates: !!f.parentElement.querySelector('.iv-addd [data-iv-adddt]') }; }));
250
+ ok('S8 + opens the field at the top of that stage, focused, with an optional Dates chip', f8 && f8.top && f8.ph === 'New task in Build' && f8.focus && f8.dates, JSON.stringify(f8));
251
+ await p.keyboard.type('Release note for app teams'); await p.keyboard.press('Enter');
252
+ const ad = await until(() => lastPost(A, '/api/boards/tasks/add'));
253
+ ok('S8 Enter adds the task into that stage (section build)', ad && ad.body.title === 'Release note for app teams' && ad.body.section === 'build', JSON.stringify(ad));
254
+ const t8 = await until(async () => { const t = await toast(p); return /Added to Build/.test(t) ? t : null; }, 4000);
255
+ const k8 = await until(() => p.evaluate(() => { const i = document.querySelector('#czViewer .iv-addin input'); return i && i.value === '' && document.activeElement === i ? true : null; }), 4000);
256
+ ok('S8 the toast says "Added to Build" with Undo; the field stays open, empty and focused', /Undo/.test(t8 || '') && k8, JSON.stringify({ t8, k8 }));
257
+ await shot(p, 'S8-add-390');
258
+ const u8 = await undo(p);
259
+ const du = await until(() => lastPost(A, '/api/boards/tasks/delete'));
260
+ ok('S8 Undo takes the new task out', du && /^task-n/.test(du.body.task || ''), JSON.stringify({ u8, du, last: A.posts.slice(-3) }));
261
+ await p.keyboard.press('Escape');
262
+ ok('S8 Esc closes the field', await until(() => p.evaluate(() => !document.querySelector('#czViewer .iv-addin')), 3000));
263
+
264
+ /* S9 a Jira row */
265
+ await p.click('#czViewer [data-iv-edit="task-b2"]');
266
+ const j9 = await until(() => p.evaluate(() => { const r = document.querySelector('#czViewer .iv-ed[data-iv-open="task-b2"]'); if (!r) return null; return { field: !!r.querySelector('input'), st: !!r.querySelector('.iv-edst'), line: (r.querySelector('.iv-edj') || {}).textContent, dates: r.querySelectorAll('.iv-edd').length }; }));
267
+ ok('S9 a Jira row in place: the title and status read-only, "In Progress in Jira · read 4 min ago", start and due editable', j9 && !j9.field && !j9.st && j9.line === 'In Progress in Jira · read 4 min ago' && j9.dates === 2, JSON.stringify(j9));
268
+ await shot(p, 'S9-jira-390');
269
+ await p.click('#czViewer .iv-ed [data-f="due"]');
270
+ await until(() => p.evaluate(() => !!document.querySelector('.tkc.ivq .tkc-dp')));
271
+ await p.click('.tkc.ivq [data-tkc-day="2026-11-09"]');
272
+ const jd = await until(() => { const x = lastPost(A, '/api/boards/tasks/edit'); return x && x.body.task === 'task-b2' ? x : null; });
273
+ ok('S9 its due day saves to the task, kept in PMOS', jd && jd.body.due === '2026-11-09', JSON.stringify(jd));
274
+ await until(() => p.evaluate(() => !!document.querySelector('#czViewer .iv-ed [data-iv-more]')));
275
+ await p.click('#czViewer .iv-ed [data-iv-more]');
276
+ const jm = await until(() => p.evaluate(() => { const q = document.querySelector('.tkc.ivq .ive-m'); return q ? [...q.querySelectorAll('button')].map((b) => b.textContent.trim()) : null; }));
277
+ ok('S9 its ⋯ has Open the ticket and no Delete; the ◇ is allowed', jm && jm.join('|') === 'Milestone|Move to a stage|Open the ticket', JSON.stringify(jm));
278
+ await p.keyboard.press('Escape'); await p.keyboard.press('Escape');
279
+
280
+ /* S11 a long press on a phone's title lifts the row; a drop on Deliver's header moves it there */
281
+ await until(() => p.evaluate(() => !document.querySelector('.tkc.ivq')));
282
+ {
283
+ const n0 = A.posts.length;
284
+ await p.evaluate(() => document.querySelector('#czViewer .iv-ws[data-iv-sec="deliver"]').scrollIntoView({ block: 'center' })); await sleep(200);
285
+ const at = await p.evaluate(() => { const t = document.querySelector('#czViewer [data-iv-edit="task-b3"]').getBoundingClientRect(), h = document.querySelector('#czViewer .iv-ws[data-iv-sec="deliver"]').getBoundingClientRect(); return { x: t.left + 30, y: t.top + t.height / 2, hx: h.left + 80, hy: h.top + h.height / 2 }; });
286
+ const pre11 = await p.evaluate(() => ({ fly: !!document.querySelector('.iv-fly'), ed: !!document.querySelector('#czViewer .iv-ed, #czViewer .iv-addin'), dl: document.querySelectorAll('.iv-dl').length }));
287
+ const cdp = await p.context().newCDPSession(p);
288
+ await cdp.send('Input.dispatchTouchEvent', { type: 'touchStart', touchPoints: [{ x: at.x, y: at.y }] });
289
+ await sleep(650);
290
+ const lifted = await p.evaluate(() => ({ fly: !!document.querySelector('.iv-fly'), ghost: !!document.querySelector('#czViewer .iv-tr.iv-ghost') }));
291
+ for (let i = 1; i <= 8; i++) { await cdp.send('Input.dispatchTouchEvent', { type: 'touchMove', touchPoints: [{ x: at.x + (at.hx - at.x) * i / 8, y: at.y + (at.hy - at.y) * i / 8 }] }); await sleep(40); }
292
+ const mid = await p.evaluate(([x, y]) => ({ at: (() => { const e = document.elementFromPoint(x, y); return e ? e.className + ' < ' + (e.parentElement || {}).className + ' wbs:' + !!e.closest('.iv-wbs') : null; })(), fly: (document.querySelector('.iv-fly') || {}).className, tgt: (document.querySelector('#czViewer .iv-ws.iv-tgt') || {}).dataset, line: !!document.querySelector('#czViewer .iv-dl:not([hidden])'), tip: (document.querySelector('.iv-dtip') || {}).textContent }), [at.hx, at.hy]);
293
+ await shot(p, 'S11-drag-390');
294
+ await cdp.send('Input.dispatchTouchEvent', { type: 'touchEnd', touchPoints: [] });
295
+ ok('S11 a long press on the title lifts the row: it follows the finger, its slot stays as a dashed ghost', lifted.fly && lifted.ghost, JSON.stringify(lifted));
296
+ ok('S11 over Deliver\'s header the stage lights up and a blue line shows where it lands', mid.tgt && mid.tgt.ivSec === 'deliver' && mid.line && /^Drop: last in Deliver/.test(mid.tip || ''), JSON.stringify({ mid, pre11, at }));
297
+ const mv11 = await until(() => { const x = A.posts.slice(n0).find((y) => y.path === '/api/boards/tasks/edit' && y.body.section === 'deliver'); return x || null; });
298
+ const or11 = await until(() => A.posts.slice(n0).find((y) => y.path === '/api/boards/tasks/order') || null);
299
+ ok('S11 the drop moves it to Deliver (section) and writes the order there, last', mv11 && mv11.body.task === 'task-b3' && or11 && or11.body.section === 'deliver' && or11.body.tasks[or11.body.tasks.length - 1] === 'task-b3', JSON.stringify({ mv11, or11 }));
300
+ ok('S11 the click after the lift opens nothing', await p.evaluate(() => !document.querySelector('#czViewer .iv-ed')));
301
+ }
302
+ ok('S13 Home phone light: no page error', A.errors.length === 0, A.errors.join(' | '));
303
+ await A.ctx.close();
304
+
305
+ /* ── the Board's panel, desktop ── */
306
+ const B = await open({ where: 'board', w: 1440, h: 900 }), q = B.page;
307
+ await q.hover('#czViewer .iv-tr[data-iv-r="task-b1"]');
308
+ const R10 = await q.evaluate(() => { const r = document.querySelector('#czViewer .iv-tr[data-iv-r="task-b1"]'), g = r.querySelector('.iv-grip'); return { grip: !!g && getComputedStyle(g).opacity === '1', dates: r.querySelector('.iv-dc').textContent.replace(/\s+/g, ' ').trim(), av: !!r.querySelector('.iv-rav') }; });
309
+ ok('S10 desktop: a row shows start – due at the right and the owner\'s face; on hover the grip shows', R10.grip && R10.dates === 'Oct 30 – Nov 6' && R10.av, JSON.stringify(R10));
310
+ await shot(q, 'S10-rows-1440');
311
+ // inside the stage: the third row above the first
312
+ const b0 = await rowsOf(q, 'build');
313
+ const drag = async (fromSel, toSel, dy = 0) => {
314
+ const g = await q.evaluate((s) => { const e = document.querySelector(s).getBoundingClientRect(); return { x: e.left + e.width / 2, y: e.top + e.height / 2 }; }, fromSel);
315
+ await q.mouse.move(g.x, g.y); await q.mouse.down();
316
+ const t = await q.evaluate(([s, d]) => { const e = document.querySelector(s).getBoundingClientRect(); return { x: e.left + 60, y: e.top + (d === 'top' ? 4 : e.height / 2) }; }, [toSel, dy]);
317
+ for (let i = 1; i <= 10; i++) { await q.mouse.move(g.x + (t.x - g.x) * i / 10, g.y + (t.y - g.y) * i / 10); await sleep(20); }
318
+ return async () => { await q.mouse.up(); };
319
+ };
320
+ const n1 = B.posts.length;
321
+ const drop1 = await drag(`#czViewer .iv-tr[data-iv-r="${b0[2]}"] .iv-grip`, `#czViewer .iv-tr[data-iv-r="${b0[0]}"]`, 'top');
322
+ const mid1 = await q.evaluate(() => ({ line: !!document.querySelector('#czViewer .iv-dl:not([hidden])'), ghost: !!document.querySelector('#czViewer .iv-ghost'), tgt: (document.querySelector('#czViewer .iv-ws.iv-tgt') || {}).dataset }));
323
+ await shot(q, 'S10-drag-1440');
324
+ await drop1();
325
+ const o1 = await until(() => B.posts.slice(n1).find((x) => x.path === '/api/boards/tasks/order') || null);
326
+ ok('S10 dragging a row up inside its stage shows the ghost, the lit stage and the line; the drop saves the order only', mid1.line && mid1.ghost && mid1.tgt && mid1.tgt.ivSec === 'build' && o1 && o1.body.section === 'build' && o1.body.tasks.slice(0, 3).join() === [b0[2], b0[0], b0[1]].join() && o1.body.tasks.includes('task-b4') && !B.posts.slice(n1).some((x) => x.path === '/api/boards/tasks/edit'), JSON.stringify({ mid1, o1, b0 }));
327
+ const b1 = await until(async () => { const r = await rowsOf(q, 'build'); return r[0] === b0[2] ? r : null; }, 5000);
328
+ ok('S10 the new order shows on the next read (a task-order record)', !!b1, JSON.stringify(b1));
329
+ const t10 = await until(async () => { const t = await toast(q); return /Order saved/.test(t) ? t : null; }, 4000);
330
+ await undo(q);
331
+ const ou = await until(() => { const L = B.posts.filter((x) => x.path === '/api/boards/tasks/order'); return L.length === 2 ? L[1] : null; });
332
+ ok('S10 "Order saved" with Undo; Undo puts the old order back', /Undo/.test(t10 || '') && ou && Array.isArray(ou.body.tasks) && ou.body.tasks.length === 0, JSON.stringify({ t10, ou }));
333
+ // into another stage (once the Undo's read has put the rows back)
334
+ await until(async () => (await rowsOf(q, 'build')).join() === b0.join(), 5000);
335
+ const n2 = B.posts.length;
336
+ const drop2 = await drag('#czViewer .iv-tr[data-iv-r="task-b1"] .iv-grip', '#czViewer .iv-ws[data-iv-sec="deliver"]');
337
+ await drop2();
338
+ const e2 = await until(() => B.posts.slice(n2).find((x) => x.path === '/api/boards/tasks/edit') || null);
339
+ const o2 = await until(() => B.posts.slice(n2).find((x) => x.path === '/api/boards/tasks/order') || null);
340
+ ok('S10 a drop on another stage moves it there (section) and puts it last; status and dates stay', e2 && e2.body.section === 'deliver' && !('start' in e2.body) && !('due' in e2.body) && o2 && o2.body.section === 'deliver' && o2.body.tasks.join() === 'task-d1,task-b1', JSON.stringify({ e2, o2 }));
341
+ // ⋯ › Open the task card opens the one task editor
342
+ await until(async () => (await rowsOf(q, 'deliver')).includes('task-b1')); await sleep(500);
343
+ await q.click('#czViewer [data-iv-edit="task-b1"]');
344
+ const R8 = await until(() => q.evaluate(() => { const r = document.querySelector('#czViewer .iv-ed[data-iv-open="task-b1"]'); if (!r) return null; const d = [...r.querySelectorAll('.iv-edd')], m = r.querySelector('[data-iv-more]'); return { gap: Math.round(m.getBoundingClientRect().left - d[d.length - 1].getBoundingClientRect().right), w: Math.round(r.getBoundingClientRect().width) }; }));
345
+ ok('S2 desktop: ⋯ sits right after the dates, not at the far edge', R8 && R8.gap < 30, JSON.stringify(R8));
346
+ await shot(q, 'S2-open-1440');
347
+ await q.click('#czViewer .iv-ed [data-iv-more]');
348
+ await until(() => q.evaluate(() => !!document.querySelector('.tkc.ivq [data-ive-card]')));
349
+ await shot(q, 'S6-more-1440');
350
+ await q.click('.tkc.ivq [data-ive-card]');
351
+ ok('S6 Open the task card opens the one task editor', await until(() => q.evaluate(() => !!document.querySelector('#czViewer .tkc, #czViewer [data-cz-vw="back"]')), 6000));
352
+ ok('S13 Board desktop light: no page error', B.errors.length === 0, B.errors.join(' | '));
353
+ await B.ctx.close();
354
+
355
+ /* S12 the Timeline and Kanban */
356
+ const C = await open({ where: 'board', w: 1440, h: 900, view: 'timeline' }), c = C.page;
357
+ await c.evaluate(() => { const b = [...document.querySelectorAll('#czViewer .ivt-gh')].find((x) => /Deliver/.test(x.textContent) && x.getAttribute('aria-expanded') === 'false'); if (b) b.click(); });
358
+ const T12 = await until(() => c.evaluate(() => { const d = document.querySelector('#czViewer .ivt [data-ivt-bar="task-d1"]'); return d ? { cls: d.className, one: d.dataset.one, label: (document.querySelector('#czViewer .ivt-ms.lb b') || {}).textContent } : null; }));
359
+ ok('S12 Timeline: a milestone is its ◇ on its date with no bar, the date beside it', T12 && /\bivt-d\b/.test(T12.cls) && /\bms\b/.test(T12.cls) && !/ivt-b/.test(T12.cls) && T12.label === 'Nov 14', JSON.stringify(T12));
360
+ await c.click('#czViewer .ivt [data-ivt-bar="task-d1"]');
361
+ const p12 = await until(() => c.evaluate(() => { const q = document.querySelector('.tkc.ivq .tkc-dp'); return q ? { tabs: q.querySelectorAll('[data-tkc-field]').length, one: !!q.querySelector('.one') } : null; }));
362
+ ok('S12 its press opens the one-date picker', p12 && p12.tabs === 0 && p12.one, JSON.stringify(p12));
363
+ await c.keyboard.press('Escape');
364
+ await shot(c, 'S12-timeline-1440');
365
+ const dms = await c.evaluate(() => { const d = document.querySelector('#czViewer .ivt [data-ivt-bar="task-d1"]').getBoundingClientRect(); return { x: d.left + d.width / 2, y: d.top + d.height / 2 }; });
366
+ await c.mouse.move(dms.x, dms.y); await c.mouse.down();
367
+ for (let i = 1; i <= 6; i++) { await c.mouse.move(dms.x + i * 6, dms.y); await sleep(20); }
368
+ await c.mouse.up();
369
+ const dd = await until(() => { const x = lastPost(C, '/api/boards/tasks/edit'); return x && x.body.task === 'task-d1' ? x : null; });
370
+ ok('S12 dragging the ◇ moves its date (the due day only)', dd && /^2026-11-\d\d$/.test(dd.body.due || '') && dd.body.due !== '2026-11-14' && !('start' in dd.body), JSON.stringify(dd));
371
+ await c.evaluate(() => { localStorage.setItem('pmos.tasks.view', 'kanban'); });
372
+ await c.evaluate(() => document.querySelector('#czViewer [data-iv-vbtn]').click());
373
+ await until(() => c.evaluate(() => !!document.querySelector('.tkc.ivq .ivs')));
374
+ await c.click('.tkc.ivq [data-ivs-view="kanban"]'); await c.keyboard.press('Escape');
375
+ await c.evaluate(() => { const b = document.querySelector('#czViewer [data-iv-kstage]'); if (b) b.click(); });
376
+ await until(() => c.evaluate(() => !!document.querySelector('.tkc.ivq .ivq-m')));
377
+ await c.evaluate(() => { const b = [...document.querySelectorAll('.tkc.ivq .ivq-m button')].find((x) => /Deliver/.test(x.textContent)); if (b) b.click(); });
378
+ const k12 = await until(() => c.evaluate(() => { const d = [...document.querySelectorAll('#czViewer .ivk-d')].find((x) => /MAGW migration ready/.test(x.textContent)); return d ? { date: (d.querySelector('.iv-dc') || {}).innerText, glyph: !!d.querySelector('.iv-dms svg'), title: !!d.querySelector('.iv-tt + .iv-ms') } : null; }));
379
+ ok('S12 Kanban: a milestone card says "◇ Nov 14" (its ◇ once)', k12 && /^Nov \d+$/.test((k12.date || '').trim()) && k12.glyph && !k12.title, JSON.stringify(k12));
380
+ await shot(c, 'S12-kanban-1440');
381
+ ok('S13 Board Timeline and Kanban: no page error', C.errors.length === 0, C.errors.join(' | '));
382
+ await C.ctx.close();
383
+
384
+ /* S13 dark, phone and desktop */
385
+ for (const [where, w, h] of [['home', 390, 844], ['board', 1440, 900], ['home', 1440, 900]]) {
386
+ const D = await open({ where, w, h, theme: 'dark' }), d = D.page;
387
+ await d.click('#czViewer [data-iv-edit="task-b1"]');
388
+ await until(() => d.evaluate(() => !!document.querySelector('#czViewer .iv-ed')));
389
+ const bg = await d.evaluate(() => { const r = document.querySelector('#czViewer .iv-ed'), f = r.querySelector('.iv-edn'); return { row: getComputedStyle(r).backgroundColor, field: getComputedStyle(f).backgroundColor, ink: getComputedStyle(f).color }; });
390
+ ok(`S13 ${where} ${w} dark: the open row and its field take the dark tokens`, bg.row !== 'rgb(255, 255, 255)' && bg.field !== 'rgb(255, 255, 255)' && bg.ink !== 'rgb(0, 0, 0)', JSON.stringify(bg));
391
+ await shot(d, `S13-${where}-${w}-dark`);
392
+ ok(`S13 ${where} ${w} dark: no page error`, D.errors.length === 0, D.errors.join(' | '));
393
+ await D.ctx.close();
394
+ }
395
+ return finish();
396
+ })();
@@ -186,7 +186,7 @@ async function pure() {
186
186
  const f = BF.facts(); f.rows = f.rows.map((r) => (r.id === 'self-serve-v2' ? { ...r, stage: 'Build', start: '2026-06-01', end: '2027-02-01', status: 'on track' } : r));
187
187
  const B = BP.build(f), row = B.rows.find((x) => x.id === 'self-serve-v2'); row.tasks = TASKS; row.start = '2026-06-01'; row.end = '2027-02-01';
188
188
  const A = await open({ w: 1440, h: 900, board: B }), p = A.page;
189
- if (!(await p.evaluate((v) => document.querySelector(v + ' .iv').getBoundingClientRect().width >= 820, V))) await p.click('#czViewer [data-cz-vw="wide"]');
189
+ if (!(await p.evaluate((v) => document.querySelector(v + ' .iv').getBoundingClientRect().width >= 820, V))) await p.evaluate(() => window.czViewer.wide(true)); // Home's header has ⧉ in place of ⤢ since batch 18 item 15; wide() is the same width
190
190
  const mc = await until(() => p.evaluate((v) => { const m = document.querySelector(v + ' .iv-cl > .iv-msc'); if (!m || !m.offsetParent) return null; const rows = [...m.querySelectorAll('.iv-msr')];
191
191
  return { head: m.querySelector('.iv-msh').textContent.replace(/\s+/g, ' ').trim(), rows: rows.map((r) => r.className.replace('iv-msr', '').trim() + ':' + r.textContent.replace(/\s+/g, ' ').trim()), tick: m.querySelectorAll('.iv-msr.dn .iv-msk.dn svg').length,
192
192
  press: rows.every((r) => r.dataset.ivMs && /Open its task$/.test(r.getAttribute('aria-label'))), after: !!(m.previousElementSibling && m.previousElementSibling.classList.contains('iv-card')) }; }, V));
@@ -38,6 +38,14 @@ const ITEMS = [
38
38
  it('scarlet.a1b2c3d4e5', 'WP2 Newsroom pilot plan', { store: 'item', end: '2026-12-11' }),
39
39
  ];
40
40
 
41
+ // batch 18 item 16: with quick changes on, a title press opens the row in place; the task card is under its ⋯ (Open the task card)
42
+ const openCard = async (pg, uid, V = '#czViewer') => {
43
+ if (await pg.$(`${V} [data-iv-task="${uid}"]`)) return pg.click(`${V} [data-iv-task="${uid}"]`);
44
+ await pg.click(`${V} [data-iv-edit="${uid}"]`);
45
+ await pg.click(`${V} .iv-ed[data-iv-open="${uid}"] [data-iv-more]`);
46
+ await pg.waitForSelector('.tkc.ivq [data-ive-card]', { timeout: 8000 });
47
+ return pg.click('.tkc.ivq [data-ive-card]');
48
+ };
41
49
  (async () => {
42
50
  const exe = findBrowser();
43
51
  if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the suite cannot run'); return finish(1); }
@@ -115,7 +123,7 @@ const ITEMS = [
115
123
  await p.click('#ibBody [data-key="board:scarlet"]');
116
124
  await p.waitForSelector('.iv-tr', { timeout: 8000 });
117
125
  await unfold(p);
118
- await p.click('.iv-tt[data-iv-task="task-api"]');
126
+ await openCard(p, 'task-api', '#czViewer');
119
127
  await p.waitForSelector('.tkc .seg', { timeout: 8000 }).catch(() => {});
120
128
  const row = await p.evaluate(() => {
121
129
  const seg = document.querySelector('.tkc .seg'); if (!seg) return null;
@@ -148,9 +148,9 @@ const ITEMS = [
148
148
  // every stage open, so each task row is drawn
149
149
  const unfold = async (sel) => { for (let i = 0; i < 12; i++) { const b = await p.$(sel); if (!b) break; await b.click(); await p.waitForTimeout(80); } };
150
150
  await unfold('.iv-ws[data-iv-fold^="sec:"][aria-expanded="false"]');
151
- const rows = await p.evaluate(() => [...document.querySelectorAll('.iv-tr')].map((r) => ({ t: (r.querySelector('.iv-tt') || {}).textContent, ms: !!r.querySelector('.iv-ms'), ask: (r.querySelector('.iv-dc.ms') || {}).textContent || '' })));
151
+ const rows = await p.evaluate(() => [...document.querySelectorAll('.iv-tr')].map((r) => ({ t: (r.querySelector('.iv-tt') || {}).textContent, ms: !!r.querySelector('.iv-ms, .iv-dms'), ask: (r.querySelector('.iv-dc.ms') || {}).textContent || '' })));
152
152
  const by = (t) => rows.find((x) => x.t === t) || {};
153
- ok('F the List shows a small ◇ after a milestone task\'s title, none after a plain task', by('Feature delivered').ms && by('KPI evaluated').ms && !by('Ship the article summaries API').ms, JSON.stringify(rows));
153
+ ok('F the List shows a small ◇ on a milestone task (with its date, batch 18 item 16), none on a plain task', by('Feature delivered').ms && by('KPI evaluated').ms && !by('Ship the article summaries API').ms, JSON.stringify(rows));
154
154
  ok('F a milestone with no due date asks for it in a dashed chip', by('Support FAQ').ask === 'Set the due date', JSON.stringify(by('Support FAQ')));
155
155
  await p.click('.iv-tr:has(.iv-tt:text-is("Ship the article summaries API")) .iv-car');
156
156
  const pick = await p.evaluate(() => { const b = document.querySelector('.ivq-st .ivq-ms'); return b ? { lbl: b.getAttribute('aria-label'), tip: b.getAttribute('title'), pressed: b.getAttribute('aria-pressed'), vr: document.querySelectorAll('.ivq-st .vr').length, text: b.textContent } : null; });
@@ -167,7 +167,7 @@ const ITEMS = [
167
167
  await p.waitForSelector('.ivt', { timeout: 5000 });
168
168
  await unfold('.ivt-gh[data-iv-fold^="sec:"][aria-expanded="false"]');
169
169
  const tv = await p.evaluate(() => ({ ms: [...document.querySelectorAll('.ivt-ms')].map((x) => x.className + '|' + x.textContent), guides: document.querySelectorAll('.ivt-grid i.ms').length, lg: (document.querySelector('.ivt-lg') || {}).textContent || '' }));
170
- ok('V a milestone\'s bar ends in its ◇ with the date beside it; a done one filled', tv.ms.some((x) => /^ivt-ms dn\|Dec 11$/.test(x)) && tv.ms.some((x) => /^ivt-ms\|Jan 29$/.test(x)) && tv.ms.some((x) => /^ivt-ms\|Mar 31$/.test(x)), JSON.stringify(tv));
170
+ ok('V a milestone is its ◇ only, no bar (batch 18 item 16), the date beside it; a done one filled', tv.ms.some((x) => /^ivt-ms lb dn\|Dec 11$/.test(x)) && tv.ms.some((x) => /^ivt-ms lb\|Jan 29$/.test(x)) && tv.ms.some((x) => /^ivt-ms lb\|Mar 31$/.test(x)), JSON.stringify(tv));
171
171
  ok('V a faint dashed guide drops at each milestone date, and the legend names Milestone', tv.guides === 3 && /Milestone/.test(tv.lg), JSON.stringify(tv));
172
172
  await shot(p, 'milestones-viewer-timeline-1440');
173
173
  ok('the panel threw nothing', !errors.length, errors.join('\n'));
@@ -62,9 +62,17 @@ async function page(url) {
62
62
  await p.goto(BASE + url);
63
63
  return { ctx, p, errors, posts };
64
64
  }
65
+ // batch 18 item 16: with quick changes on, a title press opens the row in place; the task card is under its ⋯ (Open the task card)
66
+ const openCard = async (pg, uid, V = '#czViewer') => {
67
+ if (await pg.$(`${V} [data-iv-task="${uid}"]`)) return pg.click(`${V} [data-iv-task="${uid}"]`);
68
+ await pg.click(`${V} [data-iv-edit="${uid}"]`);
69
+ await pg.click(`${V} .iv-ed[data-iv-open="${uid}"] [data-iv-more]`);
70
+ await pg.waitForSelector('.tkc.ivq [data-ive-card]', { timeout: 8000 });
71
+ return pg.click('.tkc.ivq [data-ive-card]');
72
+ };
65
73
  // the view's task rows: every stage section opened, so each task the board holds is drawn
66
74
  const openSections = (p) => p.evaluate((v) => { let n = 0; for (const b of document.querySelectorAll(v + ' .iv-ws[aria-expanded="false"], ' + v + ' .iv-grp[aria-expanded="false"]')) { b.click(); n++; } return n; }, V);
67
- const titleBtn = (p, uid) => until(async () => { await openSections(p); return p.evaluate((a) => !!document.querySelector(a[0] + ` [data-iv-task="${a[1]}"]`), [V, uid]); }, 10000);
75
+ const titleBtn = (p, uid) => until(async () => { await openSections(p); return p.evaluate((a) => !!document.querySelector(a[0] + ` :is([data-iv-task="${a[1]}"], [data-iv-edit="${a[1]}"])`), [V, uid]); }, 10000);
68
76
  // the one task editor: the initiative's view gave way, the Viewer's title is the task's, and the card (task-card.js) is drawn with its Status row
69
77
  const editorOf = (p, title) => until(() => p.evaluate((a) => { const v = document.querySelector(a[0]), c = window.czViewer && window.czViewer.current(); if (!v || !c) return null;
70
78
  const t = (v.querySelector('.cz-vw-title') || {}).textContent || '';
@@ -86,11 +94,11 @@ const back = (p) => p.evaluate(() => { const b = document.querySelector('#czView
86
94
  const up = await until(() => hp.evaluate((v) => !!document.querySelector(v + ' [data-hi-v="page"] .iv-sc'), V), 30000);
87
95
  ok('T0 Home opens the initiative\'s page', up);
88
96
  ok('T1 each task\'s title is a press', await titleBtn(hp, 't1') && await titleBtn(hp, 't2'));
89
- await hp.click(`${V} [data-iv-task="t1"]`);
97
+ await openCard(hp, 't1', V);
90
98
  ok('T1 a task the initiative\'s read holds opens the one task editor', await editorOf(hp, TASKS[0].title), await hp.evaluate((v) => { const c = window.czViewer.current(); return c.kind + ' / ' + document.querySelector(v).textContent.slice(0, 300); }, V));
91
99
  ok('T1 ← goes back to the initiative\'s page', await back(hp) && await until(() => hp.evaluate((v) => !!document.querySelector(v + ' [data-hi-v="page"]'), V), 5000));
92
100
  await titleBtn(hp, 't2');
93
- await hp.click(`${V} [data-iv-task="t2"]`);
101
+ await openCard(hp, 't2', V);
94
102
  ok('T2 a task only the board\'s row holds opens the same editor, not a dead end', await editorOf(hp, TASKS[1].title), await hp.evaluate((v) => (document.querySelector(v) || {}).textContent, V));
95
103
  await shot(hp, 'home-task-press-1440.png');
96
104
  ok('T2 ← goes back to the page', await back(hp) && await until(() => hp.evaluate((v) => !!document.querySelector(v + ' [data-hi-v="page"]'), V), 5000));
@@ -110,7 +118,7 @@ const back = (p) => p.evaluate(() => { const b = document.querySelector('#czView
110
118
  await bp.click(row);
111
119
  ok('T4 its panel opens', await until(() => bp.evaluate(() => { const c = window.czViewer && window.czViewer.current(); return !!c && c.kind === 'Initiative'; }), 8000));
112
120
  ok('T4 a task\'s title on the panel is a press', await titleBtn(bp, 't2'));
113
- await bp.click(`${V} [data-iv-task="t2"]`);
121
+ await openCard(bp, 't2', V);
114
122
  ok('T4 it opens the one task editor', await editorOf(bp, TASKS[1].title), await bp.evaluate((v) => (document.querySelector(v) || {}).textContent, V));
115
123
  await shot(bp, 'board-task-press-1440.png');
116
124
  ok('T4 ← goes back to the initiative', await back(bp) && await until(() => bp.evaluate(() => { const c = window.czViewer && window.czViewer.current(); return !!c && c.kind === 'Initiative'; }), 5000));
@@ -106,10 +106,10 @@ const IF = require('./fixtures/initiative-premium-facts.js');
106
106
  const sw = await p.evaluate(() => { const b = document.querySelector('#czViewer .iv-th [data-iv-vbtn]'); return b ? b.getAttribute('aria-label') + (b.textContent.trim() ? '+text' : '') : null; });
107
107
  ok('V1 the Tasks header has one icon-only view button; the first time it is List', sw === 'Tasks view: List. Change the view, grouping or zoom', sw);
108
108
  const order = await p.evaluate(() => [...document.querySelector('#czViewer .iv-th').children].map((e) => e.className || e.tagName).join());
109
- ok('V1 the header holds the view button and + only, in that order', /,ivx-vb,iv-ib$/.test(order) && !/ivx-seg|ig-by|ivx-pick/.test(order), order);
109
+ ok('V1 the header holds the view button only: + sits on each open stage (batch 18 item 16)', /,ivx-vb$/.test(order) && !/ivx-seg|ig-by|ivx-pick/.test(order), order);
110
110
 
111
111
  /* V11 the List: only the stages with something open; the rest wait in one fold at the foot; a stage folds after 3 tasks */
112
- const L0 = await p.evaluate(() => ({ secs: [...document.querySelectorAll('#czViewer .iv-wbs > .iv-ws .w b')].map((b) => b.textContent), rest: (document.querySelector('#czViewer .iv-rest') || {}).textContent || null,
112
+ const L0 = await p.evaluate(() => ({ secs: [...document.querySelectorAll('#czViewer .iv-wbs > .iv-ws .w b, #czViewer .iv-wbs > .iv-wsw > .iv-ws .w b')].map((b) => b.textContent), rest: (document.querySelector('#czViewer .iv-rest') || {}).textContent || null,
113
113
  rows: [...document.querySelectorAll('#czViewer .iv-wbs .iv-wl > .iv-tr .iv-tt')].map((e) => e.textContent), more: (document.querySelector('#czViewer .iv-wl > .iv-more') || {}).textContent || null }));
114
114
  ok('V11 the List shows only Discover and Plan (each has something open); the six others wait in one fold', L0.secs.join('|') === 'Discover|Plan' && /^6 stages\s*nothing open/.test(L0.rest || ''), JSON.stringify(L0));
115
115
  ok('V11 Discover shows 3 tasks, then "1 more"', L0.rows.length === 3 && /^1 more/.test(L0.more || ''), JSON.stringify(L0));
@@ -117,7 +117,7 @@ const IF = require('./fixtures/initiative-premium-facts.js');
117
117
  const L1 = await until(() => p.evaluate(() => { const n = document.querySelectorAll('#czViewer .iv-wbs .iv-wl > .iv-tr .iv-tt').length; return n > 3 ? n : null; }));
118
118
  ok('V11 "1 more" shows the rest of the stage', L1 === 4, String(L1));
119
119
  await p.click('#czViewer .iv-rest');
120
- const L2 = await until(() => p.evaluate(() => { const s = [...document.querySelectorAll('#czViewer .iv-wbs > .iv-ws .w b')].map((b) => b.textContent); return s.length > 2 ? s : null; }));
120
+ const L2 = await until(() => p.evaluate(() => { const s = [...document.querySelectorAll('#czViewer .iv-wbs > .iv-ws .w b, #czViewer .iv-wbs > .iv-wsw > .iv-ws .w b')].map((b) => b.textContent); return s.length > 2 ? s : null; }));
121
121
  ok('V11 the fold opens the stages with nothing open, in order', L2 && L2.join('|') === 'Discover|Plan|Triage|Prioritize|Build|Deliver|Monitor|Evaluate', JSON.stringify(L2));
122
122
  await p.click('#czViewer .iv-rest');
123
123
 
@@ -159,7 +159,7 @@ const IF = require('./fixtures/initiative-premium-facts.js');
159
159
 
160
160
  /* V3 the date press opens the task card's start and due picker right under it; an undated row shows a calendar icon on hover only */
161
161
  const dbtn = await p.evaluate(() => { const b = document.querySelector('#czViewer .iv-tr [data-iv-date="task-c"]'); const n = document.querySelector('#czViewer .iv-tr [data-iv-date="task-d"]'); return { t: b && b.textContent, w: b && b.classList.contains('w'), none: n && getComputedStyle(n).opacity, nl: n && n.getAttribute('aria-label') }; });
162
- ok('V3 the dates in a row are a press, amber when late; an undated row\'s calendar icon is hidden until hover', dbtn.t === 'Oct 8 – Oct 10' && dbtn.w && dbtn.none === '0' && /^Add dates: Stakeholder review/.test(dbtn.nl), JSON.stringify(dbtn));
162
+ ok('V3 the dates in a row are a press, amber when late; an undated row shows none (batch 18 item 16: zero is silence, its open row sets them)', dbtn.t === 'Oct 8 – Oct 10' && dbtn.w && dbtn.none == null, JSON.stringify(dbtn));
163
163
  await p.click('#czViewer .iv-tr [data-iv-date="task-c"]');
164
164
  const dp = await until(() => p.evaluate(() => { const q = document.querySelector('.tkc.ivq .tkc-dp'); if (!q) return null; return { two: [...q.querySelectorAll('[data-tkc-field]')].map((b) => b.textContent).join('|'), on: (q.querySelector('[data-tkc-field].on') || {}).textContent }; }));
165
165
  ok('V3 the start and due picker opens with the due field picked', dp && dp.two === 'StartOct 8|DueOct 10' && dp.on === 'DueOct 10', JSON.stringify(dp));
@@ -472,12 +472,16 @@ const IF = require('./fixtures/initiative-premium-facts.js');
472
472
  await j.click('.tkc.ivq .tkc-dp [data-tkc-day="2026-10-24"]');
473
473
  const dd = await until(() => J.posts.find((x) => x.path === '/api/boards/tasks/edit' && x.body.task === 'j2'));
474
474
  ok('H7 a linked task\'s dates are the PM\'s: the date press saves the day on the task, kept in PMOS', !!dd && dd.body.due === '2026-10-24' && /kept in PMOS/.test(tip || ''), JSON.stringify({ dd: dd && dd.body, tip }));
475
+ const lkc = await j.evaluate(() => { const e = document.querySelector('#czViewer .iv-tr .iv-tt em.lk'); return e ? getComputedStyle(e).color : ''; });
475
476
  await sleep(600);
476
477
  await sheetPick(j, 'view', 'timeline');
477
478
  await until(() => j.evaluate(() => !!document.querySelector('#czViewer .ivt')));
478
479
  await sleep(300);
479
480
  const T7 = await j.evaluate(() => { const r = document.querySelector('#czViewer [data-ivt-bar="j2"]').closest('.ivt-r'); return { sq: !!r.querySelector('.iv-jq.ig-sq'), box: !!r.querySelector('[data-iv-check]'), drag: document.querySelector('#czViewer [data-ivt-bar="j2"]').hasAttribute('data-ivt-drag'), plain: !!document.querySelector('#czViewer [data-iv-check="j3"]') }; });
480
481
  ok('H7 Timeline: the linked task shows the Jira square, no box, and its bar drags; the plain one keeps its box', T7.sq && !T7.box && T7.drag && T7.plain, JSON.stringify(T7));
482
+ // batch 18 item 11 gap: the linked key is blue and in the text font on the Timeline, as the List draws it (not the grey mono of a ticket's key)
483
+ const kc = await j.evaluate(() => { const st = (e) => e ? (({ color, fontFamily }) => ({ color, fontFamily }))(getComputedStyle(e)) : null; return { tl: st(document.querySelector('#czViewer [data-ivt-bar="j2"]').closest('.ivt-r').querySelector('.iv-tt em')), tt: st(document.querySelector('#czViewer [data-ivt-bar="j2"]').closest('.ivt-r').querySelector('.iv-tt')) }; });
484
+ ok('H7 Timeline: the linked key is blue like the List, in the title\'s font', !!kc.tl && kc.tl.color === lkc && kc.tl.fontFamily === kc.tt.fontFamily, JSON.stringify({ kc, lkc }));
481
485
  const bb = await j.evaluate(() => { const r = document.querySelector('#czViewer [data-ivt-bar="j2"]').getBoundingClientRect(); return { x: r.left + r.width / 2, y: r.top + r.height / 2 }; });
482
486
  const n0 = J.posts.length;
483
487
  await j.mouse.move(bb.x, bb.y); await j.mouse.down(); await j.mouse.move(bb.x + 20, bb.y, { steps: 3 }); await j.mouse.move(bb.x + 42, bb.y, { steps: 3 }); await j.mouse.up();
@@ -0,0 +1,10 @@
1
+ {
2
+ "_comment": "batch 18 item 15-B: the Live pill as a 44 px round number above the menu button (pm/cozy-live-pill.js), the panel divider's look with Adler's sprout or the day's charm (pm/cozy-divider.js, cozy-adler.js charmIcon), and Home's list head fold. live-pill-round-test.js drives the real Board and Home with GET /api/live answered by the suite.",
3
+ "modules": [],
4
+ "panels": [
5
+ "live-pill-round-test.js"
6
+ ],
7
+ "seconds": {
8
+ "live-pill-round-test.js": 25
9
+ }
10
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "_comment": "Panels side by side on Home, like a tablet: the divider snaps and closes at an edge, open beside by drag, the placement menu, slide over, memory per initiative, Present slides the chat away (feedback batch 18 item 15, build 15-A; cozy-panels.js, cozy-viewer.js several Viewers). A browser suite.",
3
+ "panels": [
4
+ "panels-test.js"
5
+ ],
6
+ "seconds": {
7
+ "panels-test.js": 45
8
+ }
9
+ }