create-pmos 0.431.0 → 0.432.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 (58) 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/board-programs-test.js +10 -4
  7. package/workspace/briefing-premium-board-test.js +24 -22
  8. package/workspace/briefing-premium-initiative-test.js +10 -5
  9. package/workspace/briefing-premium-products-test.js +2 -0
  10. package/workspace/briefing-premium-sources-test.js +15 -8
  11. package/workspace/briefing-premium-work-test.js +6 -3
  12. package/workspace/changelog.json +12 -0
  13. package/workspace/ev-everywhere-test.js +40 -33
  14. package/workspace/guide/briefing-premium.md +1 -1
  15. package/workspace/guide/data-freshness.md +3 -1
  16. package/workspace/guide/home.md +25 -16
  17. package/workspace/guide/initiative-boards.md +6 -6
  18. package/workspace/guide/programs.md +2 -2
  19. package/workspace/ini-workflow-test.js +13 -8
  20. package/workspace/lib/briefing-premium.js +6 -3
  21. package/workspace/lib/engine/boards.js +13 -2
  22. package/workspace/lib/ini-deleted.js +58 -0
  23. package/workspace/lib/initiative-rows.js +4 -1
  24. package/workspace/lib/routes-boards.js +48 -0
  25. package/workspace/lib/search-index.js +3 -1
  26. package/workspace/package-lock.json +2 -2
  27. package/workspace/package.json +1 -1
  28. package/workspace/premium-board-actions-test.js +50 -32
  29. package/workspace/premium-briefing-depth-test.js +33 -34
  30. package/workspace/premium-core-doc-issue-test.js +1 -1
  31. package/workspace/premium-vw-backlog-test.js +1 -1
  32. package/workspace/premium-vw-item-test.js +1 -1
  33. package/workspace/premium-vw-jira-test.js +1 -1
  34. package/workspace/program-leave-test.js +20 -19
  35. package/workspace/public/pm/bd-acts.js +7 -5
  36. package/workspace/public/pm/bd-ini-panel.js +57 -25
  37. package/workspace/public/pm/cozy-ev.css +22 -7
  38. package/workspace/public/pm/cozy-evmodel.js +3 -3
  39. package/workspace/public/pm/cozy-nav.js +29 -32
  40. package/workspace/public/pm/cozy-news.js +11 -27
  41. package/workspace/public/pm/cozy-settings.js +68 -11
  42. package/workspace/public/pm/cozy-sources.js +5 -89
  43. package/workspace/public/pm/cozy-today.css +19 -1
  44. package/workspace/public/pm/hi-pop.css +21 -0
  45. package/workspace/public/pm/hi-pop.js +5 -5
  46. package/workspace/public/pm/home-app.js +62 -25
  47. package/workspace/public/pm/home-day.js +60 -2
  48. package/workspace/public/pm/home-ini.js +66 -27
  49. package/workspace/public/pm/home-more.js +9 -50
  50. package/workspace/public/pm/home-today.js +4 -2
  51. package/workspace/public/pm/ini-more.js +78 -42
  52. package/workspace/public/pm/ini-view-model.js +1 -1
  53. package/workspace/public/pm/ini-view.css +17 -0
  54. package/workspace/public/pm/ini-view.js +25 -7
  55. package/workspace/public/pm/premium-board.js +4 -3
  56. package/workspace/public/pm/prog-move.js +26 -0
  57. package/workspace/public/premium.html +0 -1
  58. package/workspace/stage-card-test.js +10 -1
@@ -51,7 +51,7 @@ const lines = (name) => {
51
51
  /** A press on a choice chip inside the dialog's pane, as a click event on the element (Playwright's pointer check races the dialog's spring). */
52
52
  const tap = (pg, sel) => pg.$eval(sel, (b) => b.click());
53
53
  // the Board's first questions (board-grill: start, file, answer, later) write only triage-answers.jsonl and the material folder; intake/draft only drafts
54
- const ALLOWED = /^\/api\/(?:boards\/(?:asks\/(?:add|accept|decline)|move|archive)|lifecycle|briefing-premium\/note|board-grill\/(?:start|file|answer|later)|intake\/draft|initiative-layout|proposals\/look)$/; // initiative-layout: the card's Moves on by itself switch (premium-uncovered-features); proposals/look: Create asks Claude to look for the new initiative elsewhere (batch 12 item 4)
54
+ const ALLOWED = /^\/api\/(?:boards\/(?:asks\/(?:add|accept|decline)|move|archive|wontdo|ini-delete|ini-restore)|lifecycle|briefing-premium\/note|board-grill\/(?:start|file|answer|later)|intake\/draft|initiative-layout|proposals\/look)$/; // initiative-layout: the card's Moves on by itself switch (premium-uncovered-features); proposals/look: Create asks Claude to look for the new initiative elsewhere (batch 12 item 4); wontdo: the stage picker's Won't do and its Undo (batch 16 item 5c)
55
55
 
56
56
  (async () => {
57
57
  const exe = findBrowser();
@@ -93,6 +93,9 @@ const ALLOWED = /^\/api\/(?:boards\/(?:asks\/(?:add|accept|decline)|move|archive
93
93
  const vwPick = async (pg, label) => { const L = await vwMenu(pg), i = L.indexOf(label); if (i < 0) { await pg.keyboard.press('Escape'); return false; } await pg.locator('.cz-vw-menu [role="menuitem"]').nth(i).click(); return true; };
94
94
  const more = async (id, label) => { await until(() => listed(id), 30000); await p.click(`#ibBody .ini2[data-key="board:${id}"]`); return vwPick(p, label); };
95
95
  const acts = async (id, label = 'Move to a stage') => (await more(id, label)) && until(() => p.evaluate(() => { const m = document.querySelector('#bdPop'); return !!m && !m.hidden; }));
96
+ // batch 16 item 5c (FmI2Stage): the stage moves, hold, Won't do and Archive sit in the stage chip's picker, not the ⋯
97
+ const spOpen = async (id) => { await until(() => listed(id), 30000); await p.click(`#ibBody .ini2[data-key="board:${id}"]`); await until(() => p.evaluate(() => !!document.querySelector('#czViewer:not([hidden]) [data-iv-stagepick]'))); await p.click('#czViewer [data-iv-stagepick]'); return until(() => p.evaluate(() => { const el = document.querySelector('.hi-pop'); return el ? { st: [...el.querySelectorAll('[data-sp-go]')].map((b) => ({ name: b.querySelector('span').textContent, now: b.getAttribute('aria-checked') === 'true', off: b.disabled })), life: [...el.querySelectorAll('[data-sp-life] span')].map((x) => x.textContent) } : null; })); };
98
+ const spLife = async (id, label) => { await spOpen(id); await p.click(`.hi-pop [data-sp-life]:has(> span:text-is("${label}"))`); };
96
99
  const closeAll = async () => { for (let i = 0; i < 4; i++) { if (await p.evaluate(() => (!document.querySelector('#czViewer') || document.querySelector('#czViewer').hidden) && (!document.querySelector('#bdPop') || document.querySelector('#bdPop').hidden))) return; await p.keyboard.press('Escape'); await sleep(100); } };
97
100
  await until(() => p.evaluate(() => document.querySelectorAll('#ibBody .ini2').length > 0), 30000);
98
101
  await p.click('#chAsks');
@@ -147,47 +150,46 @@ const ALLOWED = /^\/api\/(?:boards\/(?:asks\/(?:add|accept|decline)|move|archive
147
150
  /* M move and Undo, from the panel's ⋯ (BdActions) */
148
151
  await until(() => listed('pa-one'), 30000); await p.click('#ibBody .ini2[data-key="board:pa-one"]');
149
152
  const m1 = await vwMenu(p); await p.keyboard.press('Escape');
150
- ok('M1 ⋯ offers Move to a stage, Put on hold, Archive and Cancel the initiative, red and last', ['Move to a stage', 'Put on hold', 'Archive'].every((l) => m1.includes(l)) && m1[m1.length - 1] === 'Cancel the initiative', JSON.stringify(m1));
153
+ ok('M1 ⋯ is the short menu: Copy and The record, Delete red and last; no stage moves or endings (FmI1Menu)', ['Copy', 'The record'].every((l) => m1.includes(l)) && m1[m1.length - 1] === 'Delete' && m1.length <= 7 && !['Move to a stage', 'Put on hold', 'Archive', 'Cancel the initiative'].some((l) => m1.includes(l)), JSON.stringify(m1));
151
154
  await closeAll();
152
- ok('M1 Move to a stage lists the later stages first to move to', await acts('pa-one') && await p.evaluate(() => !!document.querySelector('#bdPop [data-rowact^="mv:"]')), await p.evaluate(() => document.querySelector('#bdPop').textContent));
155
+ const sp = await spOpen('pa-one');
156
+ const at = sp ? sp.st.findIndex((x) => x.now) : -1;
157
+ ok('M1 the stage chip lists every stage with the current one marked, then Put on hold, Won’t do and Archive', !!sp && at >= 0 && sp.st.length > at + 1 && sp.life.join('|') === 'Put on hold|Won’t do|Archive', JSON.stringify(sp));
153
158
  await p.keyboard.press('Escape');
154
- ok('M2 Escape closes the menu and gives the focus back to the Viewer\'s ⋯ button', await until(() => p.evaluate(() => document.querySelector('#bdPop').hidden && document.activeElement.dataset.czVw === 'more')), await p.evaluate(() => document.activeElement.outerHTML.slice(0, 120)));
159
+ ok('M2 Escape closes the picker and gives the focus back to the stage chip', await until(() => p.evaluate(() => !document.querySelector('.hi-pop') && 'ivStagepick' in document.activeElement.dataset)), await p.evaluate(() => document.activeElement.outerHTML.slice(0, 120)));
155
160
  await p.keyboard.press('Escape');
156
161
  ok('M2 a second Escape closes the Viewer and gives the focus back to the row', await until(() => p.evaluate(() => document.querySelector('#czViewer').hidden && !!document.activeElement.closest('#ibBody'))));
157
162
  const from = ready.model.initiatives.list.rows.find((r) => r.id === 'pa-one').acts.stage;
158
- await acts('pa-one'); await p.click('#bdPop [data-rowact^="mv:"]');
163
+ await spOpen('pa-one'); await p.click(`.hi-pop [data-sp-go="${at + 1}"]`);
159
164
  const mv = await toastIs(/^Moved to/);
160
- ok('M3 Move records one move line and says what it recorded', !!mv && lines('boards.jsonl').filter((l) => l.kind === 'move' && l.id === 'pa-one').length === 1, mv);
165
+ ok('M3 a later stage in the picker records one move line at once and says what it recorded', !!mv && lines('boards.jsonl').filter((l) => l.kind === 'move' && l.id === 'pa-one').length === 1, mv);
161
166
  await p.click('#bdToast .bd-undo');
162
167
  ok('M4 Undo writes the move back', !!(await toastIs(new RegExp('Back in ' + from))) && lines('boards.jsonl').filter((l) => l.kind === 'move' && l.id === 'pa-one').pop().to === from);
163
168
  await closeAll();
164
169
 
165
- /* L hold, resume, cancel, reopen, archive, restore: each at once, with Undo */
166
- await more('pa-one', 'Put on hold');
170
+ /* L hold, resume, Won't do, Back to Triage, archive, restore: from the stage chip (batch 16 item 5c; Cancel merged into Won't do) */
171
+ await spLife('pa-one', 'Put on hold');
167
172
  const hl = await until(() => lines('lifecycle.jsonl').find((l) => l.initiative_id === 'pa-one' && l.state === 'on-hold'));
168
173
  ok('L1 Hold records one on-hold line at once, with a check-back day 30 days on, and Undo', !!hl && /^\d{4}-\d{2}-\d{2}$/.test(hl.back || '') && Math.round((Date.parse(hl.back) - Date.now()) / 86400000) >= 29 && !!(await toastIs(/On hold · .* check back/)), JSON.stringify(hl));
169
174
  await closeAll();
170
175
  ok('L2 the row then says On hold', await until(async () => { const t = await p.evaluate(() => { const b = document.querySelector('#ibBody .ini2[data-key="board:pa-one"]'); return b ? b.textContent : ''; }); return /On hold/.test(t); }, 30000));
171
- await p.click('#ibBody .ini2[data-key="board:pa-one"]');
172
- const l2 = await vwMenu(p);
173
- ok('L2 ⋯ offers Resume in place of Put on hold, and no stage moves', l2.includes('Resume') && !l2.includes('Put on hold') && !l2.includes('Move to a stage') && !l2.includes('Move back a stage'), JSON.stringify(l2));
174
- await p.locator('.cz-vw-menu [role="menuitem"]').nth(l2.indexOf('Resume')).click();
176
+ const l2 = await spOpen('pa-one');
177
+ ok('L2 the stage chip offers Resume in place of Put on hold, and no stage moves', !!l2 && l2.life.includes('Resume') && !l2.life.includes('Put on hold') && l2.st.every((x) => x.now || x.off), JSON.stringify(l2));
178
+ await p.click('.hi-pop [data-sp-life]:has(> span:text-is("Resume"))');
175
179
  ok('L3 Resume records an active line', await until(() => { const L = lines('lifecycle.jsonl').filter((l) => l.initiative_id === 'pa-one'); return L.length && L[L.length - 1].state === 'active'; }));
176
180
  await closeAll();
177
181
  await until(() => p.evaluate(() => { const b = document.querySelector('#ibBody .ini2[data-key="board:pa-one"]'); return b && !/On hold/.test(b.textContent); }), 30000);
178
- await acts('pa-one', 'Cancel the initiative');
179
- ok('L4 Cancel asks why, with the same chips as Decline, and records nothing yet', !!(await popOn(/Why cancel .*Out of scope.*Already planned.*Not now.*Other/)) && !lines('lifecycle.jsonl').some((l) => l.initiative_id === 'pa-one' && l.state === 'cancelled'));
180
- await p.click('#bdPop [data-why="Not now"]'); await p.click('#bdPop [data-rowact="cancel-go"]');
181
- ok('L4 Cancel records a cancelled line with the reason', await until(() => lines('lifecycle.jsonl').some((l) => l.initiative_id === 'pa-one' && l.state === 'cancelled' && l.reason === 'Not now')));
182
- ok('L5 the row leaves the track and the ⋯ menu\'s Cancelled and archived item counts it', await until(() => p.evaluate(() => !document.querySelector('#ibBody .bt-l[data-row="board:pa-one"]') && /1 cancelled/.test((document.querySelector('#bdGone') || {}).textContent || '')), 30000));
183
- await closeAll();
184
- await p.click('#moreBtn'); await p.click('#bdGone'); await peekOn('Cancelled and archived');
185
- ok('L6 a cancelled initiative offers Reopen only', await p.evaluate(() => [...document.querySelectorAll('#czViewer .bd-gr [data-rowact]')].map((b) => b.dataset.rowact).join() === 'reopen'));
186
- await p.click('#czViewer .bd-gr [data-rowact="reopen"]');
187
- ok('L6 Reopen records an active line', await until(() => { const L = lines('lifecycle.jsonl').filter((l) => l.initiative_id === 'pa-one'); return L[L.length - 1].state === 'active'; }));
182
+ await spLife('pa-one', 'Won’t do');
183
+ ok('L4 Won’t do asks why, with its chips, and records nothing yet', await until(() => p.evaluate(() => !!document.querySelector('.hi-pop [data-wf-why]') && document.querySelector('.hi-pop [data-wf-go]').disabled)) && !lines('boards.jsonl').some((l) => l.kind === 'ini-end' && l.id === 'pa-one'));
184
+ await p.click('.hi-pop [data-wf-why]'); await p.click('.hi-pop [data-wf-go]');
185
+ ok('L4 Won’t do records an ini-end line with the reason', await until(() => lines('boards.jsonl').some((l) => l.kind === 'ini-end' && l.id === 'pa-one' && l.reason && !l.back)));
186
+ // the Undo in its toast is Back to Triage (ini-wf.js); the picker's own Back to Triage is checked on Home (ini-workflow-test.js W7)
187
+ ok('L5 the toast says it and offers Undo', !!(await toastIs(/won’t do/)));
188
+ await p.click('#bdToast .bd-undo');
189
+ ok('L6 Back to Triage records the back line', await until(() => lines('boards.jsonl').some((l) => l.kind === 'ini-end' && l.id === 'pa-one' && l.back === true)));
188
190
  await closeAll();
189
191
  await until(() => listed('pa-one'), 30000);
190
- await more('pa-one', 'Archive');
192
+ await spLife('pa-one', 'Archive');
191
193
  ok('L7 Archive records one archive line at once, with no reason asked', await until(() => lines('boards.jsonl').some((l) => l.kind === 'ini-archive' && l.id === 'pa-one' && l.archived === true)));
192
194
  ok('L8 the ⋯ menu\'s item counts it as archived', await until(() => p.evaluate(() => /1 archived/.test((document.querySelector('#bdGone') || {}).textContent || '')), 30000));
193
195
  await p.click('#bdToast .bd-undo');
@@ -198,7 +200,7 @@ const ALLOWED = /^\/api\/(?:boards\/(?:asks\/(?:add|accept|decline)|move|archive
198
200
  Stage view; the card moves a stage with Move and Back (premium-uncovered-features, canvas InStage) */
199
201
  const I = await open('/premium-initiative.html?id=pa-one&ws=' + encodeURIComponent(B.ws) + '&board=' + encodeURIComponent(B.id));
200
202
  const ip = I.page;
201
- const viaMore = async (pg, label) => { const it = (l) => `#czViewer .cz-vw-menu [role="menuitem"]:has(> span:first-child:text-is("${l}"))`, more = async () => { await pg.click('#czViewer:not([hidden]) [data-cz-vw="more"]'); await until(() => pg.evaluate(() => !!document.querySelector('#czViewer .cz-vw-menu'))); }; await more(); for (let i = 0; i < 20 && !(await pg.$(it(label))) && !(await pg.$(it('Move to a stage'))); i++) { await pg.keyboard.press('Escape'); await pg.waitForTimeout(250); await more(); } if (!(await pg.$(it(label))) && (await pg.$(it('Move to a stage')))) { await pg.click(it('Move to a stage')); await until(() => pg.evaluate(() => !!document.querySelector('#czViewer:not([hidden]) [data-hi-v="stage"]'))); if (label === 'Stage') return; await more(); } await pg.click(it(label)); }; // the page's ⋯ holds Move to a stage; the Stage view's ⋯ holds Documents, Open the full record and Sprint (batch 11 item 20)
203
+ const viaMore = async (pg, label) => { const it = (l) => `#czViewer .cz-vw-menu [role="menuitem"]:has(> span:first-child:text-is("${l}"))`, more = async () => { await pg.click('#czViewer:not([hidden]) [data-cz-vw="more"]'); await until(() => pg.evaluate(() => !!document.querySelector('#czViewer .cz-vw-menu'))); }, view = (v) => until(() => pg.evaluate((x) => !!document.querySelector(`#czViewer:not([hidden]) [data-hi-v="${x}"]`), v)); if ((await pg.$('#czViewer:not([hidden]) [data-hi-v="page"]')) && (await pg.$('#czViewer:not([hidden]) [data-iv-docs]')) && !['Split into a new initiative', 'Merge into', 'Program', 'Open on the Board', 'Copy', 'The record', 'Delete'].includes(label)) { await pg.click('#czViewer:not([hidden]) [data-iv-docs]'); await view('docs'); if (label === 'Documents') return; } await more(); for (let i = 0; i < 20 && !(await pg.$(it(label))) && !(await pg.$(it('Stage'))); i++) { await pg.keyboard.press('Escape'); await pg.waitForTimeout(250); await more(); } if (!(await pg.$(it(label))) && (await pg.$(it('Stage')))) { await pg.click(it('Stage')); await view('stage'); if (label === 'Stage') return; await more(); } await pg.click(it(label)); }; // batch 16 item 5c: the page's ⋯ is short; Documents opens from its fold, and the Documents view's ⋯ holds Stage, whose ⋯ holds Documents, Open the full record and Sprint
202
204
  const landed = await until(() => ip.evaluate(() => { const q = new URLSearchParams(location.search); return location.pathname === '/premium.html' && q.get('ini') === 'pa-one' && !!q.get('ws') && !!q.get('board') && !!document.querySelector('#czViewer .iv-sc'); }), 60000);
203
205
  ok('I0 the expand link lands on Home with the initiative selected, ws and board kept', !!landed, await ip.evaluate(() => location.href));
204
206
  // the page holds the Tasks (batch 11 item 20)
@@ -213,19 +215,17 @@ const ALLOWED = /^\/api\/(?:boards\/(?:asks\/(?:add|accept|decline)|move|archive
213
215
  await closeAll(); await p.click('#ibBody .ini2[data-key="board:pa-one"]'); const boardM = await vwMenu(p);
214
216
  if (process.env.PMOS_SHOTS) {
215
217
  await p.screenshot({ path: path.join(process.env.PMOS_SHOTS, 'ini-more-board.png') }); await p.keyboard.press('Escape');
216
- await vwPick(p, 'Change workflow'); await sleep(600); await p.screenshot({ path: path.join(process.env.PMOS_SHOTS, 'ini-more-board-wf.png') }); await p.keyboard.press('Escape');
217
- await vwPick(p, 'Add a stakeholder'); await sleep(400); await p.screenshot({ path: path.join(process.env.PMOS_SHOTS, 'ini-more-board-person.png') }); await p.keyboard.press('Escape');
218
218
  }
219
219
  await p.keyboard.press('Escape'); await closeAll();
220
220
  const { ORDER } = await import('./public/pm/ini-more.js');
221
221
  const rank = (l) => ORDER.findIndex((o) => l === o || l.startsWith(o + ' '));
222
222
  const inOrder = (L) => L.every((l, i) => rank(l) >= 0 && (i === 0 || rank(l) >= rank(L[i - 1])));
223
223
  ok('X1 Home and the Board give the same ⋯ items in the same order (Home adds Open on the Board)', JSON.stringify(homeM.filter((l) => l !== 'Open on the Board')) === JSON.stringify(boardM) && homeM.includes('Open on the Board'), JSON.stringify({ homeM, boardM }));
224
- ok('X2 the order is the one menu\'s: change it, its place, look at it, end it, then stop it, red and last', inOrder(homeM) && inOrder(boardM) && boardM[0] === 'Change workflow' && boardM[boardM.length - 1] === 'Cancel the initiative' && !boardM.includes('Open in full') && !boardM.includes('Move, hold, cancel or archive'), JSON.stringify(boardM));
224
+ ok('X2 the order is the one menu\'s: split or merge, its program, look at it, then Delete, red and last', inOrder(homeM) && inOrder(boardM) && boardM[boardM.length - 1] === 'Delete' && !boardM.includes('Change workflow') && !boardM.includes('Cancel the initiative') && !boardM.includes('Open in full') && !boardM.includes('Move, hold, cancel or archive'), JSON.stringify(boardM));
225
225
  }
226
226
  await (async (pg) => { if (await pg.$('#czViewer [data-hi-view="stage"]')) await pg.click('#czViewer [data-hi-view="stage"]'); else await viaMore(pg, 'Stage'); })(ip);
227
227
  const bar = await until(() => ip.evaluate(() => { const v = document.querySelector('#czViewer:not([hidden])'); if (!v || !v.querySelector('[data-ov-move]')) return null; const cur = v.querySelector('[data-ov-move][aria-pressed="true"]'); return { moves: [...v.querySelectorAll('[data-ov-move]')].map((x) => x.dataset.ovMove), cur: cur ? cur.dataset.ovMove : '', life: [...v.querySelectorAll('[data-ov-life]')].map((x) => x.dataset.ovLife) }; }), 60000);
228
- ok('I1 the Overview offers the stages, the current one pressed, and the lifecycle presses', !!bar && bar.moves.length > 1 && !!bar.cur && bar.moves.indexOf(bar.cur) < bar.moves.length - 1 && bar.life.join() === 'on-hold,cancelled', JSON.stringify(bar) + ' ' + (await ip.evaluate(() => (document.querySelector('#czViewer .cz-vw-body') || {}).innerText || 'no Viewer')).slice(0, 400));
228
+ ok('I1 the Overview offers the stages, the current one pressed, and the lifecycle presses', !!bar && bar.moves.length > 1 && !!bar.cur && bar.moves.indexOf(bar.cur) < bar.moves.length - 1 && bar.life.join() === 'on-hold', JSON.stringify(bar) + ' ' + (await ip.evaluate(() => (document.querySelector('#czViewer .cz-vw-body') || {}).innerText || 'no Viewer')).slice(0, 400));
229
229
  const n0 = lines('boards.jsonl').filter(isMove).length;
230
230
  const next = bar ? bar.moves[bar.moves.indexOf(bar.cur) + 1] : '';
231
231
  await ip.click(`#czViewer [data-ov-move="${next}"]`);
@@ -256,6 +256,22 @@ const ALLOWED = /^\/api\/(?:boards\/(?:asks\/(?:add|accept|decline)|move|archive
256
256
  ok('I5 the Moves on by itself switch is a file-mode record of the initiative', await until(() => lines('initiative-layout.jsonl').some((l) => l.kind === 'auto' && l.initiative === 'pa-one' && l.on === false)) && await until(() => ip.evaluate(() => (document.querySelector('.hi-pop [data-hi-auto]') || {}).getAttribute && document.querySelector('.hi-pop [data-hi-auto]').getAttribute('aria-checked') === 'false')));
257
257
  }
258
258
 
259
+ /* D Delete (batch 16 item 5d, FmI3Deleted): the last row of ⋯, no confirm; the toast names it and its tasks and keeps Undo 8 s; Undo brings it back */
260
+ {
261
+ await closeAll(); await until(() => listed('pa-one'), 30000);
262
+ const d0 = lines('boards.jsonl').length;
263
+ await p.click('#ibBody .ini2[data-key="board:pa-one"]'); await vwPick(p, 'Delete');
264
+ const said = await until(() => p.evaluate(() => { const t = document.querySelector('#hiToast:not([hidden])'); return t ? t.querySelector('span').textContent : null; }));
265
+ const delLine = await until(() => lines('boards.jsonl').slice(d0).find((l) => l.kind === 'ini-delete' && l.id === 'pa-one'));
266
+ ok('D1 Delete asks nothing, writes one ini-delete line and says "Deleted <name>", with its tasks when it had any', !!delLine && /^Deleted .+?( and its \d+ tasks?)?$/.test(said || '') && !!(await p.evaluate(() => document.querySelector('#hiToast [data-hi-undo]'))), JSON.stringify([said, delLine]));
267
+ ok('D2 the initiative leaves the Board and the Viewer closes', await until(() => p.evaluate(() => ![...document.querySelectorAll('#ibBody .ini2')].some((b) => b.dataset.key === 'board:pa-one') && (!document.querySelector('#czViewer') || document.querySelector('#czViewer').hidden))));
268
+ await sleep(7000);
269
+ ok('D3 the Undo stays for 8 seconds', await p.evaluate(() => !!document.querySelector('#hiToast:not([hidden]) [data-hi-undo]')));
270
+ await p.click('#hiToast [data-hi-undo]');
271
+ ok('D4 Undo writes ini-restore and the initiative is back on the Board', !!(await until(() => lines('boards.jsonl').slice(d0).find((l) => l.kind === 'ini-restore' && l.id === 'pa-one'))) && await until(() => listed('pa-one'), 30000));
272
+ await closeAll();
273
+ }
274
+
259
275
  /* S the PMOS-self board: the model says self, the page offers no move and no New initiative */
260
276
  {
261
277
  const m = BP.build(F.facts({ board: Object.assign({}, F.facts().board, { self: true }), asks: [] }));
@@ -266,8 +282,10 @@ const ALLOWED = /^\/api\/(?:boards\/(?:asks\/(?:add|accept|decline)|move|archive
266
282
  await S.page.click('#chAsks');
267
283
  ok('S1 the PMOS-self board names the router in its asks popover and hides New initiative', await until(() => S.page.evaluate(() => /pmos-router/.test((document.querySelector('#bdPop') || {}).textContent || '') && document.querySelector('#newIni').hidden)));
268
284
  await S.page.keyboard.press('Escape');
269
- await S.page.click('#ibBody .ini2'); const s2 = await vwMenu(S.page);
270
- ok('S2 its ⋯ has no stage move and no workflow to change, and keeps Put on hold', !s2.includes('Move to a stage') && !s2.includes('Move back a stage') && !s2.includes('Moves on by itself') && !s2.includes('Change workflow') && s2.includes('Put on hold'), JSON.stringify(s2));
285
+ await S.page.click('#ibBody .ini2'); await until(() => S.page.evaluate(() => !!document.querySelector('#czViewer:not([hidden]) [data-iv-stagepick]'))); await S.page.click('#czViewer [data-iv-stagepick]');
286
+ const s2 = await until(() => S.page.evaluate(() => { const el = document.querySelector('.hi-pop'); return el ? { go: [...el.querySelectorAll('[data-sp-go]:not([disabled])')].length, all: el.querySelectorAll('[data-sp-go]').length, auto: !!el.querySelector('[data-sp-auto]'), life: [...el.querySelectorAll('[data-sp-life]')].map((x) => x.dataset.spLife) } : null; }));
287
+ ok('S2 its stage picker moves no stage and changes no workflow, and keeps Put on hold', !!s2 && s2.all > 1 && s2.go <= 1 && s2.life.includes('hold') && !s2.life.includes('wontDo') && !s2.life.includes('archive'), JSON.stringify(s2));
288
+ await S.page.keyboard.press('Escape');
271
289
  await S.ctx.close();
272
290
  }
273
291
 
@@ -287,8 +305,8 @@ const ALLOWED = /^\/api\/(?:boards\/(?:asks\/(?:add|accept|decline)|move|archive
287
305
  await until(() => S.page.evaluate(() => document.querySelectorAll('#ibBody .ini2').length > 0), 30000);
288
306
  const f = await S.page.evaluate(() => ({ wide: document.documentElement.scrollWidth > innerWidth + 1, small: [...document.querySelectorAll('#ibBody .ini2, #chAsks, #newIni')].filter((b) => b.offsetParent && (b.getBoundingClientRect().width < 44 || b.getBoundingClientRect().height < 44)).map((b) => b.className + ':' + Math.round(b.getBoundingClientRect().width) + 'x' + Math.round(b.getBoundingClientRect().height)) }));
289
307
  ok('F1 at 390 px there is no sideways scroll and every new control is at least 44 px', !f.wide && !f.small.length, JSON.stringify(f));
290
- await S.page.click('#ibBody .ini2'); await vwPick(S.page, 'Move to a stage');
291
- const mi = await until(() => S.page.evaluate(() => { const L = [...document.querySelectorAll('#bdPop.sheet:not([hidden]) .bd-mi')]; return L.length ? L.every((b) => b.getBoundingClientRect().height >= 44) && document.documentElement.scrollWidth <= innerWidth + 1 : null; }));
308
+ await S.page.click('#ibBody .ini2'); await until(() => S.page.evaluate(() => !!document.querySelector('#czViewer:not([hidden]) [data-iv-stagepick]'))); await S.page.click('#czViewer [data-iv-stagepick]');
309
+ const mi = await until(() => S.page.evaluate(() => { const L = [...document.querySelectorAll('.hi-pop .hi-mi')]; return L.length ? L.every((b) => b.getBoundingClientRect().height >= 44) && document.documentElement.scrollWidth <= innerWidth + 1 : null; }));
292
310
  ok('F2 the action rows are 44 px tall and the open sheet adds no sideways scroll', !!mi);
293
311
  await S.ctx.close();
294
312
  }
@@ -2,8 +2,10 @@
2
2
  'use strict';
3
3
  /* premium-briefing-depth-test.js — Around you (initiative premium-briefing-depth; planning/prd/premium-briefing-depth-prd.md R1 to R9).
4
4
  * Re-pointed by premium-agreed-design: the Briefing card and its dialogs are gone. Re-pointed again by premium-uncovered-features (canvas
5
- * HmAround): Around you is gone too. New for you (cozy-news.js, from the place menu) holds the mentions, the digests and the prep line, and
6
- * its "Where the rest went" rows open the old views (home-around.js), each with Back to New for you. Data freshness is Sources (cozy-sources.js).
5
+ * HmAround): Around you is gone too. New for you (cozy-news.js) holds the mentions and the digests; the old views (home-around.js) still open,
6
+ * each with Back to New for you. Re-pointed again by feedback batch 16 item 5 (canvas FmAudit, FmA3Settings): New for you opens from the
7
+ * New for you fold of Your day and its "Where the rest went" rows and meetings ring are gone, so this suite opens the views by their key;
8
+ * data freshness is Settings › Connectors.
7
9
  * The row summaries of the old card are gone with it; each view's own line (.ar-say) carries the count.
8
10
  * A real server on a scratch repository (c3-scan-fixture.js: PMOS_DRIVER=off, so no agent
9
11
  * ever runs), with a driver ledger, a scan ledger and a brief of today that this suite seeds with the writers the product uses. The real page
@@ -94,11 +96,12 @@ const GANTT = [
94
96
  await p.route('**/api/scan/now', (r) => json(r, { ok: true, scan: 'scan-00000000ff' }));
95
97
  await p.route('**/api/sources/refresh', (r) => json(r, { ok: true, started: 'session' }));
96
98
  await p.route('**/api/sources/refresh-all', (r) => json(r, { ok: true, joined: false, started: ['calendar'], already: [], failed: [], all: { started_at: new Date().toISOString(), reads: ['calendar'], derived: ['brief'], phase: 'read', done: false, steps: [{ id: 'calendar', label: 'Calendar', step: 'read', state: 'running' }, { id: 'brief', label: 'Morning briefing', step: 'derived', state: 'waiting' }] } }));
97
- /* New for you: the place menu, then New for you; it reads what is new and names where the rest went */
98
- const REST = ['pulse', 'rep', 'prop', 'scan'];
99
+ /* New for you: the whole list (what "N more" in Your day's fold opens) */
100
+ const newsUp = () => p.evaluate(() => !!document.querySelector('#czViewer:not([hidden]) .ev-news .ev-head') && !document.querySelector('#czViewer .ev-news .ev-skelrow'));
99
101
  const openCard = async () => {
100
- await until(() => p.$('#czFab')); await p.click('#czFab'); await p.click('#czMenu [data-cz-news]');
101
- await until(() => p.evaluate(() => !!document.querySelector('#czViewer:not([hidden]) .ev-news [data-ev-rest]') && !document.querySelector('#czViewer .ev-news .ev-skelrow')), 30000);
102
+ await until(() => p.$('#czFab'));
103
+ await p.evaluate(() => import('/pm/cozy-news.js').then((M) => M.openNews({})));
104
+ await until(newsUp, 30000);
102
105
  };
103
106
  await p.goto(`${F.BASE}/premium.html?ws=${encodeURIComponent(ws)}`);
104
107
  await until(() => p.evaluate(() => document.querySelectorAll('#hmList .hm-g').length > 0), 30000);
@@ -106,20 +109,19 @@ const GANTT = [
106
109
  await openCard();
107
110
  const say = () => p.evaluate(() => (document.querySelector('#czViewer .ar-say') || {}).textContent || '');
108
111
  const body = () => p.evaluate(() => (document.querySelector('#czViewer .cz-vw-body .bd-a') || {}).textContent || '');
109
- // a view opens from its "Where the rest went" row when New for you names it; mentions are New for you's own rows, so their full view opens directly
112
+ // a view opens by its key (New for you no longer names them: "Where the rest went" is gone, feedback batch 16 item 5)
110
113
  const open = async (k) => {
111
- const sel = `#czViewer .ev-news [data-ev-rest="${k}"]`; // p.click finds the row again if New for you redraws it between the look and the press
112
- if (REST.includes(k) && await p.$(sel)) await p.click(sel); else await p.evaluate((x) => import('/pm/home-around.js').then((M) => M.openAround(x)), k);
114
+ await p.evaluate((x) => import('/pm/home-around.js').then((M) => M.openAround(x)), k);
113
115
  await until(() => p.evaluate((x) => !!document.querySelector(`#czViewer .bd-a[data-bd-view="${x}"] *`), k));
114
116
  };
115
- const close = async () => { await p.click('#czViewer [data-bda="back"]'); await until(() => p.evaluate(() => !!document.querySelector('#czViewer .ev-news [data-ev-rest]'))); };
117
+ const close = async () => { await p.click('#czViewer [data-bda="back"]'); await until(newsUp); };
116
118
  const click = async (sel) => { await until(() => p.$(sel)); await p.click(sel); };
117
119
  const shotDir = process.env.BRIEFING_DEPTH_SHOTS;
118
120
  const shot = async (n) => { if (shotDir) { await sleep(700); fs.mkdirSync(shotDir, { recursive: true }); await p.screenshot({ path: path.join(shotDir, n + '.png') }); } };
119
121
 
120
122
  /* R: New for you, in place of the card */
121
- const R0 = await p.evaluate(() => ({ rest: [...document.querySelectorAll('#czViewer .ev-news [data-ev-rest]')].map((b) => b.dataset.evRest), list: !!document.querySelector('#aroundBody, #aroundCap'), text: document.querySelector('#czViewer').textContent }));
122
- ok('R1 New for you names where the rest of Around you went, one row each, and draws no Around you list', R0.rest.join() === REST.join() && !R0.list, JSON.stringify(R0.rest));
123
+ const R0 = await p.evaluate(() => ({ chrome: [...document.querySelectorAll('#czViewer .ev-news [data-ev-rest], #czViewer .ev-news .ev-two, #czViewer .ev-news .ev-foot, #czViewer .ev-news .ar-prep')].length, list: !!document.querySelector('#aroundBody, #aroundCap'), text: document.querySelector('#czViewer').textContent }));
124
+ ok('R1 New for you draws its items only: no Where the rest went, no legend, no Not here note, no meetings ring, no Around you list (FmAudit)', R0.chrome === 0 && !R0.list && !/Where the rest went|Not here, so nothing shows twice/.test(R0.text), JSON.stringify(R0).slice(0, 300));
123
125
  ok('R3 the mentions that wait are New for you\'s own rows', /Dana/.test(R0.text) && /Mentions/.test(R0.text), R0.text.slice(0, 300));
124
126
  ok('R8 opening New for you wrote nothing', posts.length === 0, JSON.stringify(posts));
125
127
  ok('R9 New for you is drawn to its design: no Waiting for design marker', !/Waiting for design/.test(R0.text));
@@ -247,29 +249,30 @@ const GANTT = [
247
249
  } else ok('S9 Scan now is off and says why', /switched off|cannot start|left/.test(await body()), await body());
248
250
  await close();
249
251
 
250
- /* F: data freshness is Sources now (cozy-sources.js); the old view's key opens it */
252
+ /* F: data freshness is Settings › Connectors now (feedback batch 16 item 5, FmA3Settings); the old view's key opens it */
251
253
  await p.evaluate(() => import('/pm/home-around.js').then((M) => M.openAround('src')));
252
- await until(() => p.evaluate(() => document.querySelectorAll('#czViewer .ev-src .ev-trow[data-src]').length > 0), 20000);
253
- const ft = await p.evaluate(() => document.querySelector('#czViewer .ev-src').textContent);
254
- const srcRows = await p.evaluate(() => document.querySelectorAll('#czViewer .ev-src .ev-trow[data-src]').length);
255
- ok('F1 Sources lists the workspace\'s sources with when each was last read, and says it never posts', srcRows >= 3 && /Last read/.test(ft) && /never posts to them/.test(ft) && !/up to date/i.test(ft), ft);
254
+ await until(() => p.evaluate(() => document.querySelectorAll('#evSettings:not([hidden]) .ev-fr[data-src]').length > 0), 20000);
255
+ const ft = await p.evaluate(() => document.querySelector('#evSettings .ev-st-main').textContent);
256
+ const srcRows = await p.evaluate(() => document.querySelectorAll('#evSettings .ev-fr[data-src]').length);
257
+ ok('F1 Settings › Connectors lists the workspace\'s sources with when each was last read, and says it never posts', srcRows >= 3 && /read /.test(ft) && /never posts/.test(ft) && !/up to date/i.test(ft), ft);
256
258
  await shot('src-1280-light');
257
- const one = await p.evaluate(() => { const b = document.querySelector('#czViewer .ev-src [data-ev-read]'); return b ? b.dataset.evRead : null; });
259
+ const one = await p.evaluate(() => { const b = document.querySelector('#evSettings .ev-fr [data-ev-read]'); return b ? b.dataset.evRead : null; });
258
260
  if (one) {
259
- await click(`#czViewer .ev-src [data-ev-read="${one}"]`);
261
+ await click(`#evSettings .ev-fr [data-ev-read="${one}"]`);
260
262
  await until(() => posts.some((x) => x.path === '/api/sources/refresh'));
261
263
  const rf = posts.filter((x) => x.path === '/api/sources/refresh');
262
264
  ok('F2 Read again posts one sources/refresh for that source', rf.length === 1 && rf[0].body.source === one && rf[0].body.ws === ws, JSON.stringify(rf));
263
- ok('F3 it says what it started', await until(() => p.evaluate(() => /agent session started|Reading it again/.test(document.querySelector('#czViewer .ev-src').textContent))));
264
- } else ok('F2 no source is behind, so no row offers Read again', !/Read again/.test(ft.replace(/Read all again/g, '')), ft);
265
- const all = await p.evaluate(() => { const b = document.querySelector('#czViewer .ev-src [data-ev-all]'); return b ? b.disabled : null; });
265
+ ok('F3 it says what it started', await until(() => p.evaluate(() => /agent session started|Reading it again/.test(document.querySelector('#evSettings .ev-st-main').textContent))));
266
+ } else ok('F2 no source is behind, so no row offers ↻ Read again', await p.evaluate(() => !document.querySelector('#evSettings [data-ev-read]')), ft);
267
+ const all = await p.evaluate(() => { const b = document.querySelector('#evSettings [data-ev-readall]'); return b ? b.disabled : null; });
266
268
  if (all === false) {
267
269
  const n1 = posts.filter((x) => x.path === '/api/sources/refresh').length;
268
- await click('#czViewer .ev-src [data-ev-all]');
270
+ await click('#evSettings [data-ev-readall]');
269
271
  await until(() => posts.some((x) => x.path === '/api/sources/refresh-all'));
270
272
  const made = posts.filter((x) => x.path === '/api/sources/refresh-all');
271
273
  ok('F4 Read all again posts one ordered run (the sources, then the Briefing), and no refresh of each source', made.length === 1 && made[0].body.ws === ws && posts.filter((x) => x.path === '/api/sources/refresh').length === n1, JSON.stringify(made));
272
274
  } else ok('F4 Read all again is off while a run is going', all === true, String(all));
275
+ await p.keyboard.press('Escape'); await until(() => p.evaluate(() => !document.querySelector('#evSettings:not([hidden])')));
273
276
  await p.keyboard.press('Escape'); await until(() => p.evaluate(() => !document.querySelector('#czViewer:not([hidden])')));
274
277
 
275
278
  /* E: a source that fails is named, never shown empty */
@@ -337,20 +340,13 @@ const GANTT = [
337
340
  /* the Scan now status on the scan row, from the server's own manual count */
338
341
  ok('RS1 the scan view says how many manual scans are left, or why Scan now is off', /\d+ of \d+ manual scans left today|switched off|cannot start/.test(st), st);
339
342
 
340
- /* P: the prep ring over Today, counted from the meetings the brief page holds */
343
+ /* P: the prep ring is gone from New for you (feedback batch 16 item 5b, FmAudit: Your day holds the day's meetings) */
341
344
  const tm = (id, m, state, before) => ({ id, title: 'Meeting ' + id, start: iso(m), end: iso(m + 30), minutes: 30, people: [], initiative: null, prepared: false, before, state });
342
345
  const TODAY = [tm('a', -90, 'past', []), tm('b', 20, 'next', []), tm('c', 120, 'later', [{ id: 'x1', title: 'Send the deck', due: null }]), tm('d', 200, 'later', [])];
343
346
  await p.route('**/api/brief-page*', async (r) => { const res = await r.fetch(); const b = await res.json(); json(r, { ...b, today: TODAY }); });
344
347
  await p.goto(`${F.BASE}/premium.html?ws=${encodeURIComponent(ws)}`);
345
348
  await openCard();
346
- await until(() => p.evaluate(() => { const c = document.querySelector('#czViewer #prep'); return c && !c.hidden && /prepped/.test(c.textContent); }), 30000);
347
- const prep = await p.evaluate(() => { const c = document.querySelector('#prep'); return { t: c.textContent, ring: !!c.querySelector('circle.rg'), l: c.querySelector('svg').getAttribute('aria-label') }; });
348
- ok('PR1 the ring counts the meetings left and those with nothing to do before them', /Meeting b at \d\d:\d\d is next/.test(prep.t) && /3 meetings left today\. 2 of 3 prepped\./.test(prep.t) && prep.ring && prep.l === '2 of 3 prepped', JSON.stringify(prep));
349
- // Home has no day strip (another day is the Calendar's, in the Viewer): the ring is not shown when no meeting is left today
350
- await p.unroute('**/api/brief-page*');
351
- await p.route('**/api/brief-page*', async (r) => { const res = await r.fetch(); const b = await res.json(); json(r, { ...b, today: TODAY.map((m) => ({ ...m, state: 'past' })) }); });
352
- await p.reload(); await openCard();
353
- ok('PR2 the ring is not shown when no meeting is left today', !!(await until(() => p.evaluate(() => { const c = document.querySelector('#czViewer #prep'); return !!c && c.hidden; }), 10000)));
349
+ ok('PR1 New for you draws no meetings ring, even with meetings left today', await p.evaluate(() => !document.querySelector('#czViewer #prep, #czViewer .ar-prep')));
354
350
  await p.unroute('**/api/brief-page*');
355
351
 
356
352
  /* L: floors */
@@ -360,7 +356,7 @@ const GANTT = [
360
356
  await shot('card-390-light');
361
357
  const side = await p.evaluate(() => document.documentElement.scrollWidth - innerWidth);
362
358
  ok('L1 at 390 wide the page does not scroll sideways', side <= 0, String(side));
363
- const small = await p.evaluate(() => [...document.querySelectorAll('#czViewer .ev-news [data-ev-rest]')].filter((b) => b.getBoundingClientRect().height < 44).map((b) => b.dataset.evRest));
359
+ const small = await p.evaluate(() => [...document.querySelectorAll('#czViewer .ev-news .ev-trow')].filter((b) => b.getBoundingClientRect().height < 44).map((b) => b.textContent.slice(0, 40)));
364
360
  ok('L2 every row is 44 px tall at least', small.length === 0, small.join());
365
361
  await open('men');
366
362
  const wide = await p.evaluate(() => { const d = document.querySelector('#czViewer .cz-vw-body'); return [document.documentElement.scrollWidth - innerWidth, d.scrollWidth - d.clientWidth]; });
@@ -375,7 +371,10 @@ const GANTT = [
375
371
  await close().catch(() => {});
376
372
  const raw = await p.evaluate(() => { const c = getComputedStyle(document.querySelector('#czViewer')); return [c.backgroundColor, getComputedStyle(document.body).backgroundColor]; });
377
373
  ok('L4 in the dark theme the card has a background of its own', raw[0] !== 'rgba(0, 0, 0, 0)' && raw[0] !== raw[1] || raw[0] !== '', raw.join());
378
- const focus = await p.evaluate(() => { const b = document.querySelector('#czViewer .ev-news [data-ev-rest]'); b.focus(); const c = getComputedStyle(b); return [c.outlineStyle, c.outlineWidth, c.boxShadow]; });
374
+ // a keyboard focus (Tab), so :focus-visible applies as it does for a PM on the keyboard
375
+ await p.evaluate(() => { const b = document.querySelector('#czViewer .ev-news button') || document.querySelector('#czViewer .cz-vw-hd button'); b.focus(); });
376
+ await p.keyboard.press('Shift+Tab'); await p.keyboard.press('Tab');
377
+ const focus = await p.evaluate(() => { const b = document.activeElement; const c = getComputedStyle(b); return [c.outlineStyle, c.outlineWidth, c.boxShadow]; });
379
378
  ok('L5 a row shows a focus ring', focus[0] !== 'none' || focus[2] !== 'none', focus.join());
380
379
  /* K: the simple Agent proposals dialog at 390, light and dark, and with the phone keyboard open */
381
380
  const P4 = 'p-bbbbbbbb04', P5 = 'p-bbbbbbbb05';
@@ -114,7 +114,7 @@ const BODY = '## Purpose\n\nWhy this board exists.\n\n## Scope\n\nWhat it covers
114
114
  and a draft opens a minimal reader in the Viewer (Waiting for design) with the Issue it bar, Read and Edit */
115
115
  // Documents is shell A (XvADocs): its groups after the first are folded, so a row is unfolded before it is pressed
116
116
  const unfold = (p, sel) => p.evaluate((q) => { const n = document.querySelector(q); const f = n && !n.offsetParent && n.closest('.czs-sec') && n.closest('.czs-sec').querySelector('[data-czs-fold]'); if (f) f.click(); }, sel);
117
- const viaMore = async (pg, label) => { const it = (l) => `#czViewer .cz-vw-menu [role="menuitem"]:has(> span:first-child:text-is("${l}"))`, more = async () => { await pg.click('#czViewer:not([hidden]) [data-cz-vw="more"]'); await until(() => pg.evaluate(() => !!document.querySelector('#czViewer .cz-vw-menu'))); }; await more(); for (let i = 0; i < 20 && !(await pg.$(it(label))) && !(await pg.$(it('Move to a stage'))); i++) { await pg.keyboard.press('Escape'); await pg.waitForTimeout(250); await more(); } if (!(await pg.$(it(label))) && (await pg.$(it('Move to a stage')))) { await pg.click(it('Move to a stage')); await until(() => pg.evaluate(() => !!document.querySelector('#czViewer:not([hidden]) [data-hi-v="stage"]'))); if (label === 'Stage') return; await more(); } await pg.click(it(label)); }; // the page's ⋯ holds Move to a stage; the Stage view's ⋯ holds Documents, Open the full record and Sprint (batch 11 item 20)
117
+ const viaMore = async (pg, label) => { const it = (l) => `#czViewer .cz-vw-menu [role="menuitem"]:has(> span:first-child:text-is("${l}"))`, more = async () => { await pg.click('#czViewer:not([hidden]) [data-cz-vw="more"]'); await until(() => pg.evaluate(() => !!document.querySelector('#czViewer .cz-vw-menu'))); }, view = (v) => until(() => pg.evaluate((x) => !!document.querySelector(`#czViewer:not([hidden]) [data-hi-v="${x}"]`), v)); if ((await pg.$('#czViewer:not([hidden]) [data-hi-v="page"]')) && (await pg.$('#czViewer:not([hidden]) [data-iv-docs]')) && !['Split into a new initiative', 'Merge into', 'Program', 'Open on the Board', 'Copy', 'The record', 'Delete'].includes(label)) { await pg.click('#czViewer:not([hidden]) [data-iv-docs]'); await view('docs'); if (label === 'Documents') return; } await more(); for (let i = 0; i < 20 && !(await pg.$(it(label))) && !(await pg.$(it('Stage'))); i++) { await pg.keyboard.press('Escape'); await pg.waitForTimeout(250); await more(); } if (!(await pg.$(it(label))) && (await pg.$(it('Stage')))) { await pg.click(it('Stage')); await view('stage'); if (label === 'Stage') return; await more(); } await pg.click(it(label)); }; // batch 16 item 5c: the page's ⋯ is short; Documents opens from its fold, and the Documents view's ⋯ holds Stage, whose ⋯ holds Documents, Open the full record and Sprint
118
118
  // the initiative's page (canvas HbC): its list row opens it again when the Viewer shows something else
119
119
  const ovOpen = async (p) => { await until(() => p.evaluate(() => !!document.querySelector('#hmList [data-hm-sel^="i:"][aria-current="true"]')), 60000);
120
120
  if (!(await p.$('#czViewer:not([hidden]) [data-hi-v="page"]'))) await p.click('#hmList [data-hm-sel^="i:"][aria-current="true"]');
@@ -62,7 +62,7 @@ const SPRINTS = { ok: true, source: 'jira', readAt: '2026-10-19T09:00:00Z', velo
62
62
  S.reads.length = 0;
63
63
  return { page, ctx, S };
64
64
  };
65
- const viaMore = async (pg, label) => { const it = (l) => `#czViewer .cz-vw-menu [role="menuitem"]:has(> span:first-child:text-is("${l}"))`, more = async () => { await pg.click('#czViewer:not([hidden]) [data-cz-vw="more"]'); await until(() => pg.evaluate(() => !!document.querySelector('#czViewer .cz-vw-menu'))); }; await more(); for (let i = 0; i < 20 && !(await pg.$(it(label))) && !(await pg.$(it('Move to a stage'))); i++) { await pg.keyboard.press('Escape'); await pg.waitForTimeout(250); await more(); } if (!(await pg.$(it(label))) && (await pg.$(it('Move to a stage')))) { await pg.click(it('Move to a stage')); await until(() => pg.evaluate(() => !!document.querySelector('#czViewer:not([hidden]) [data-hi-v="stage"]'))); if (label === 'Stage') return; await more(); } await pg.click(it(label)); }; // the page's ⋯ holds Move to a stage; the Stage view's ⋯ holds Documents, Open the full record and Sprint (batch 11 item 20)
65
+ const viaMore = async (pg, label) => { const it = (l) => `#czViewer .cz-vw-menu [role="menuitem"]:has(> span:first-child:text-is("${l}"))`, more = async () => { await pg.click('#czViewer:not([hidden]) [data-cz-vw="more"]'); await until(() => pg.evaluate(() => !!document.querySelector('#czViewer .cz-vw-menu'))); }, view = (v) => until(() => pg.evaluate((x) => !!document.querySelector(`#czViewer:not([hidden]) [data-hi-v="${x}"]`), v)); if ((await pg.$('#czViewer:not([hidden]) [data-hi-v="page"]')) && (await pg.$('#czViewer:not([hidden]) [data-iv-docs]')) && !['Split into a new initiative', 'Merge into', 'Program', 'Open on the Board', 'Copy', 'The record', 'Delete'].includes(label)) { await pg.click('#czViewer:not([hidden]) [data-iv-docs]'); await view('docs'); if (label === 'Documents') return; } await more(); for (let i = 0; i < 20 && !(await pg.$(it(label))) && !(await pg.$(it('Stage'))); i++) { await pg.keyboard.press('Escape'); await pg.waitForTimeout(250); await more(); } if (!(await pg.$(it(label))) && (await pg.$(it('Stage')))) { await pg.click(it('Stage')); await view('stage'); if (label === 'Stage') return; await more(); } await pg.click(it(label)); }; // batch 16 item 5c: the page's ⋯ is short; Documents opens from its fold, and the Documents view's ⋯ holds Stage, whose ⋯ holds Documents, Open the full record and Sprint
66
66
  const toSprint = async (page) => {
67
67
  if (!(await page.evaluate(() => !!document.querySelector('#czViewer:not([hidden]) [data-hi-v]')))) { await (async (g) => { const P = '#czViewer:not([hidden]) [data-hi-v="page"]', r = '#hmList [data-hm-sel^="i:"][aria-current="true"]'; for (let i = 0; i < 4 && !(await g.$(P)) && (await g.$('#czViewer:not([hidden]) [data-cz-vw="back"]')); i++) { await g.click('#czViewer [data-cz-vw="back"]'); await g.waitForTimeout(150); } if (await g.$(P)) return; if (await g.$(r)) await g.click(r); else await g.reload(); await g.waitForSelector(P + ' .iv', { timeout: 30000 }); })(page); /* ← back to the initiative's page, else its row, else the address again (an initiative the list does not show) */ /* the page holds the Tasks (batch 11 item 20) */ }
68
68
  await until(() => page.evaluate(() => !!document.querySelector('#czViewer:not([hidden]) [data-hi-v]')), 5000);
@@ -51,7 +51,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
51
51
  S.up = await until(() => page.evaluate(() => !!document.querySelector('#czViewer .iv-sc') && !!window.__premiumWorkItem), 20000);
52
52
  return { page, ctx, S };
53
53
  };
54
- const viaMore = async (pg, label) => { const it = (l) => `#czViewer .cz-vw-menu [role="menuitem"]:has(> span:first-child:text-is("${l}"))`, more = async () => { await pg.click('#czViewer:not([hidden]) [data-cz-vw="more"]'); await until(() => pg.evaluate(() => !!document.querySelector('#czViewer .cz-vw-menu'))); }; await more(); for (let i = 0; i < 20 && !(await pg.$(it(label))) && !(await pg.$(it('Move to a stage'))); i++) { await pg.keyboard.press('Escape'); await pg.waitForTimeout(250); await more(); } if (!(await pg.$(it(label))) && (await pg.$(it('Move to a stage')))) { await pg.click(it('Move to a stage')); await until(() => pg.evaluate(() => !!document.querySelector('#czViewer:not([hidden]) [data-hi-v="stage"]'))); if (label === 'Stage') return; await more(); } await pg.click(it(label)); }; // the page's ⋯ holds Move to a stage; the Stage view's ⋯ holds Documents, Open the full record and Sprint (batch 11 item 20)
54
+ const viaMore = async (pg, label) => { const it = (l) => `#czViewer .cz-vw-menu [role="menuitem"]:has(> span:first-child:text-is("${l}"))`, more = async () => { await pg.click('#czViewer:not([hidden]) [data-cz-vw="more"]'); await until(() => pg.evaluate(() => !!document.querySelector('#czViewer .cz-vw-menu'))); }, view = (v) => until(() => pg.evaluate((x) => !!document.querySelector(`#czViewer:not([hidden]) [data-hi-v="${x}"]`), v)); if ((await pg.$('#czViewer:not([hidden]) [data-hi-v="page"]')) && (await pg.$('#czViewer:not([hidden]) [data-iv-docs]')) && !['Split into a new initiative', 'Merge into', 'Program', 'Open on the Board', 'Copy', 'The record', 'Delete'].includes(label)) { await pg.click('#czViewer:not([hidden]) [data-iv-docs]'); await view('docs'); if (label === 'Documents') return; } await more(); for (let i = 0; i < 20 && !(await pg.$(it(label))) && !(await pg.$(it('Stage'))); i++) { await pg.keyboard.press('Escape'); await pg.waitForTimeout(250); await more(); } if (!(await pg.$(it(label))) && (await pg.$(it('Stage')))) { await pg.click(it('Stage')); await view('stage'); if (label === 'Stage') return; await more(); } await pg.click(it(label)); }; // batch 16 item 5c: the page's ⋯ is short; Documents opens from its fold, and the Documents view's ⋯ holds Stage, whose ⋯ holds Documents, Open the full record and Sprint
55
55
  const overview = async (page) => { await (async (g) => { const P = '#czViewer:not([hidden]) [data-hi-v="page"]', r = '#hmList [data-hm-sel^="i:"][aria-current="true"]'; for (let i = 0; i < 4 && !(await g.$(P)) && (await g.$('#czViewer:not([hidden]) [data-cz-vw="back"]')); i++) { await g.click('#czViewer [data-cz-vw="back"]'); await g.waitForTimeout(150); } if (await g.$(P)) return; if (await g.$(r)) await g.click(r); else await g.reload(); await g.waitForSelector(P + ' .iv', { timeout: 30000 }); })(page); /* ← back to the initiative's page, else its row, else the address again (an initiative the list does not show) */ /* the page holds the Tasks (batch 11 item 20) */ return until(() => page.evaluate(() => !!document.querySelector('#czViewer [data-cz-vw="more"]') && !!document.querySelector('#czViewer [data-iv-task="t1"]'))); };
56
56
  const cur = (page) => page.evaluate(() => { const p = document.querySelector('#czViewer:not([hidden]) .obody.vw'); return { on: p ? p.dataset.vw : null, title: (document.querySelector('#czVwTitle') || {}).textContent || '', n: document.querySelectorAll('#czViewer .obody.vw').length }; });
57
57
  const paneTxt = (page, id) => page.evaluate((k) => { const p = document.querySelector(`#czViewer .obody.vw[data-vw="${CSS.escape(k)}"]`); return p ? p.textContent.replace(/\s+/g, ' ') : ''; }, id);
@@ -71,7 +71,7 @@ const TICKETS = {
71
71
  const model = (sprints) => BP.build(F.facts({ sprints }));
72
72
  const IMODEL = IP.build(IF.facts());
73
73
  // Home's initiative layout (premium-agreed-design): the card's Overview has the Sprint press; the Viewer shows one item at a time
74
- const viaMore = async (pg, label) => { const it = (l) => `#czViewer .cz-vw-menu [role="menuitem"]:has(> span:first-child:text-is("${l}"))`, more = async () => { await pg.click('#czViewer:not([hidden]) [data-cz-vw="more"]'); await until(() => pg.evaluate(() => !!document.querySelector('#czViewer .cz-vw-menu'))); }; await more(); for (let i = 0; i < 20 && !(await pg.$(it(label))) && !(await pg.$(it('Move to a stage'))); i++) { await pg.keyboard.press('Escape'); await pg.waitForTimeout(250); await more(); } if (!(await pg.$(it(label))) && (await pg.$(it('Move to a stage')))) { await pg.click(it('Move to a stage')); await until(() => pg.evaluate(() => !!document.querySelector('#czViewer:not([hidden]) [data-hi-v="stage"]'))); if (label === 'Stage') return; await more(); } await pg.click(it(label)); }; // the page's ⋯ holds Move to a stage; the Stage view's ⋯ holds Documents, Open the full record and Sprint (batch 11 item 20)
74
+ const viaMore = async (pg, label) => { const it = (l) => `#czViewer .cz-vw-menu [role="menuitem"]:has(> span:first-child:text-is("${l}"))`, more = async () => { await pg.click('#czViewer:not([hidden]) [data-cz-vw="more"]'); await until(() => pg.evaluate(() => !!document.querySelector('#czViewer .cz-vw-menu'))); }, view = (v) => until(() => pg.evaluate((x) => !!document.querySelector(`#czViewer:not([hidden]) [data-hi-v="${x}"]`), v)); if ((await pg.$('#czViewer:not([hidden]) [data-hi-v="page"]')) && (await pg.$('#czViewer:not([hidden]) [data-iv-docs]')) && !['Split into a new initiative', 'Merge into', 'Program', 'Open on the Board', 'Copy', 'The record', 'Delete'].includes(label)) { await pg.click('#czViewer:not([hidden]) [data-iv-docs]'); await view('docs'); if (label === 'Documents') return; } await more(); for (let i = 0; i < 20 && !(await pg.$(it(label))) && !(await pg.$(it('Stage'))); i++) { await pg.keyboard.press('Escape'); await pg.waitForTimeout(250); await more(); } if (!(await pg.$(it(label))) && (await pg.$(it('Stage')))) { await pg.click(it('Stage')); await view('stage'); if (label === 'Stage') return; await more(); } await pg.click(it(label)); }; // batch 16 item 5c: the page's ⋯ is short; Documents opens from its fold, and the Documents view's ⋯ holds Stage, whose ⋯ holds Documents, Open the full record and Sprint
75
75
  const overview = async (pg) => { await (async (g) => { const P = '#czViewer:not([hidden]) [data-hi-v="page"]', r = '#hmList [data-hm-sel^="i:"][aria-current="true"]'; for (let i = 0; i < 4 && !(await g.$(P)) && (await g.$('#czViewer:not([hidden]) [data-cz-vw="back"]')); i++) { await g.click('#czViewer [data-cz-vw="back"]'); await g.waitForTimeout(150); } if (await g.$(P)) return; if (await g.$(r)) await g.click(r); else await g.reload(); await g.waitForSelector(P + ' .iv', { timeout: 30000 }); })(pg); /* ← back to the initiative's page, else its row, else the address again (an initiative the list does not show) */ /* the page holds the Tasks (batch 11 item 20) */ return until(() => pg.evaluate(() => !!document.querySelector('#czViewer:not([hidden]) [data-hi-v]'))); };
76
76
  const openSprint = async (pg) => { if (!(await pg.$('#czViewer:not([hidden]) [data-hi-v]'))) await overview(pg); /* open() already showed the Overview */ await viaMore(pg, 'Sprint'); };
77
77
  const open = async ({ w = 1280, h = 900, theme = 'light', sprints = SPRINTS, tickets = TICKETS } = {}) => {
@@ -4,7 +4,7 @@
4
4
  * agreed 2026-10-26; canvas LpA1More, LpA2Other, LpA3Done, LpA4Phone, LpA5PhoneDone). Serves the real pages from the real server. The program
5
5
  * routes are answered here by lib/routes-programs.js itself, over two temp workspaces seeded with Project Ascent's ledgers
6
6
  * (fixtures/program-ascent.js) and a second program, Partner identity, so a reload reads back what the press wrote.
7
- * B Board: ⋯ of an initiative in the program holds Move out of it and Move to another program (no Turn into a program); Move out is one press,
7
+ * B Board: ⋯ of an initiative in the program holds one Program entry (batch 16 item 5c); its picker's No program is one press,
8
8
  * the toast says where it went and the milestone it left, with Undo; the row shows under its product, still selected; Undo puts it back in
9
9
  * its place; Move to another program lists the other program with its count; a phone's ⋯ holds the same items
10
10
  * H Home: the initiative page's ⋯ holds the same two items; an initiative in no program keeps Turn into a program and has neither */
@@ -97,6 +97,9 @@ const waitsOf = (id) => ((R.all(rctx).find((p) => p.id === 'project-ascent') ||
97
97
  };
98
98
  const menu = async (p) => { await p.click('#czViewer [data-cz-vw="more"]'); await p.waitForTimeout(80); return p.evaluate(() => [...document.querySelectorAll('.cz-vw-menu [role="menuitem"]')].map((b) => b.textContent.trim())); };
99
99
  const kids = (p) => p.evaluate(() => [...document.querySelectorAll('#ibBody [data-po-list]:not([data-po-list^="@"]) > [data-po-id]')].map((r) => r.dataset.poId));
100
+ // batch 16 item 5c (FmI1Menu): the ⋯ holds one Program entry; its picker lists the programs (this one marked Now), then No program
101
+ const bdList = (p) => until(() => p.evaluate(() => { const h = document.querySelector('#bdPop'); return h && !h.hidden && h.querySelector('[data-pm-to]') ? [...h.querySelectorAll('[data-pm-to]')].map((b) => b.textContent.trim()) : null; }));
102
+ const bdPick = async (p, text) => { await menu(p); await p.click('.cz-vw-menu [role="menuitem"]:has(> span:text-is("Program"))'); const l = await bdList(p); if (text) await p.click(`#bdPop [data-pm-to] >> text=${text}`); return l; };
100
103
  const toast = (p) => p.evaluate(() => { const t = document.querySelector('#bdToast'); return t && !t.hidden ? t.textContent : ''; });
101
104
 
102
105
  /* B — the Board's initiative panel */
@@ -105,12 +108,12 @@ const waitsOf = (id) => ((R.all(rctx).find((p) => p.id === 'project-ascent') ||
105
108
  await p.click('#ibBody .bt-kid .bt-nm >> text=Legacy IdP sunset');
106
109
  await p.waitForSelector('#czViewer:not([hidden])');
107
110
  const m = await menu(p);
108
- ok('B ⋯ of an initiative in a program: Move out of it and Move to another program, after the plan dates; no Turn into a program',
109
- m.includes('Move out of Project Ascent') && m.some((x) => /^Move to another program/.test(x)) && !m.includes('Turn into a program') && m.indexOf('Move out of Project Ascent') > m.indexOf('Change the plan dates'), JSON.stringify(m));
110
- ok('B the two items carry their icons', await p.evaluate(() => [...document.querySelectorAll('.cz-vw-menu [role="menuitem"]')].filter((b) => /^Move (out|to another)/.test(b.textContent.trim())).every((b) => !!b.querySelector('svg'))));
111
+ ok('B ⋯ of an initiative in a program: one Program entry that names it (FmI1Menu)', m.includes('ProgramProject Ascent') && !m.some((x) => /^Move (out|to another)|Turn into a program/.test(x)), JSON.stringify(m));
112
+ ok('B the Program entry carries its icon', await p.evaluate(() => [...document.querySelectorAll('.cz-vw-menu [role="menuitem"]')].filter((b) => /^Program/.test(b.textContent.trim())).every((b) => !!b.querySelector('svg'))));
113
+ await p.keyboard.press('Escape');
111
114
  if (process.env.SHOTS) await p.screenshot({ path: process.env.SHOTS + '/board-more.png' });
112
115
  const n0 = posts.length;
113
- await p.click('.cz-vw-menu [role="menuitem"] >> text=Move out of Project Ascent');
116
+ await bdPick(p, 'No program');
114
117
  await until(async () => !(await kids(p)).includes('legacy-idp-sunset'));
115
118
  const t = await toast(p);
116
119
  ok('B Move out is one press: one leave, no confirm; the toast says where it went and the milestone it left, with Undo',
@@ -125,12 +128,11 @@ const waitsOf = (id) => ((R.all(rctx).find((p) => p.id === 'project-ascent') ||
125
128
  // Move to another program
126
129
  await p.click('#ibBody .bt-kid .bt-nm >> text=Legacy IdP sunset');
127
130
  await p.waitForSelector('#czViewer:not([hidden])');
128
- await menu(p);
129
- await p.click('.cz-vw-menu [role="menuitem"] >> text=Move to another program');
130
- const list = await until(() => p.evaluate(() => { const h = document.querySelector('#bdPop'); return h && !h.hidden ? [...h.querySelectorAll('[data-pm-to]')].map((b) => b.textContent.trim()) : null; }));
131
- ok('B Move to another program lists the other open program, with its count', !!list && list.length === 1 && /Partner identity/.test(list[0]) && /1 initiative/.test(list[0]), JSON.stringify(list));
131
+ const list = await bdPick(p);
132
+ const other = (list || []).filter((x) => /Partner identity/.test(x));
133
+ ok('B the picker lists this program as Now, the other open program with its count, then No program', !!list && list.some((x) => /Project Ascent\s*Now/.test(x)) && other.length === 1 && /1 initiative/.test(other[0]) && list[list.length - 1] === 'No program', JSON.stringify(list));
132
134
  if (process.env.SHOTS) await p.screenshot({ path: process.env.SHOTS + '/board-other.png' });
133
- await p.click('#bdPop [data-pm-to="0"]');
135
+ await p.click('#bdPop [data-pm-to] >> text=Partner identity');
134
136
  await until(async () => !(await kids(p)).includes('legacy-idp-sunset'));
135
137
  ok('B the move lands in Partner identity; the toast says so with Undo', /Moved to Partner identity · off 1 milestone/.test(await toast(p)) && (R.all(rctx).find((x) => x.id === 'partner-identity').members.some((m) => m.initiative === 'legacy-idp-sunset')), await toast(p));
136
138
  await p.click('#bdToast .bd-undo');
@@ -145,8 +147,9 @@ const waitsOf = (id) => ((R.all(rctx).find((p) => p.id === 'project-ascent') ||
145
147
  await row.click();
146
148
  await p.waitForSelector('#czViewer:not([hidden])');
147
149
  const m = await menu(p);
148
- ok('B phone: the ⋯ sheet holds the same two items', m.includes('Move out of Project Ascent') && m.some((x) => /^Move to another program/.test(x)), JSON.stringify(m));
149
- await p.click('.cz-vw-menu [role="menuitem"] >> text=Move out of Project Ascent');
150
+ ok('B phone: the ⋯ sheet holds the same Program entry', m.includes('ProgramProject Ascent'), JSON.stringify(m));
151
+ await p.keyboard.press('Escape');
152
+ await bdPick(p, 'No program');
150
153
  const t = await until(() => toast(p));
151
154
  ok('B phone: the toast is short: where it is now and the milestone it left', /^Now under IDPF · off 1 milestone/.test(t), t);
152
155
  if (process.env.SHOTS) await p.screenshot({ path: process.env.SHOTS + '/board-phone-done.png' });
@@ -182,20 +185,18 @@ const waitsOf = (id) => ((R.all(rctx).find((p) => p.id === 'project-ascent') ||
182
185
  };
183
186
  ok('H the initiative page opens', await goPage('legacy-idp-sunset'));
184
187
  const m = await menu(p);
185
- ok('H the page\'s ⋯ holds Move out of Project Ascent and Move to another program; no Turn into a program', m.includes('Move out of Project Ascent') && m.some((x) => /^Move to another program/.test(x)) && !m.includes('Turn into a program'), JSON.stringify(m));
188
+ ok('H the page\'s ⋯ holds one Program entry that names it (FmI1Menu)', m.includes('ProgramProject Ascent') && !m.some((x) => /^Move (out|to another)|Turn into a program/.test(x)), JSON.stringify(m));
186
189
  if (process.env.SHOTS) await p.screenshot({ path: process.env.SHOTS + '/home-more.png' });
187
- await p.click('.cz-vw-menu [role="menuitem"] >> text=Move to another program');
190
+ await p.click('.cz-vw-menu [role="menuitem"]:has(> span:text-is("Program"))');
188
191
  const list = await until(() => p.evaluate(() => { const h = document.querySelector('.hi-pop.menu'); return h ? [...h.querySelectorAll('[data-hi-mi]')].map((b) => b.textContent.trim()) : null; }));
189
- ok('H Move to another program lists Partner identity', !!list && list.length === 1 && /Partner identity/.test(list[0]), JSON.stringify(list));
190
- await p.keyboard.press('Escape');
191
- await menu(p);
192
- await p.click('.cz-vw-menu [role="menuitem"] >> text=Move out of Project Ascent');
192
+ ok('H the picker lists Partner identity and ends with No program', !!list && list.some((x) => /Partner identity/.test(x)) && list[list.length - 1] === 'No program', JSON.stringify(list));
193
+ await p.click('.hi-pop.menu [data-hi-mi] >> text=No program');
193
194
  const t = await until(() => p.evaluate(() => { const el = document.querySelector('#toast'); return el && el.classList.contains('on') ? el.textContent : ''; }));
194
195
  ok('H Move out: the toast says where it went, with Undo; the program lets it go', /Moved out of Project Ascent · now under .+ · off 1 milestone/.test(t) && /Undo/.test(t) && !members().includes('legacy-idp-sunset'), t);
195
196
  await p.click('#toast .undo');
196
197
  await until(() => members().includes('legacy-idp-sunset'));
197
198
  ok('H Undo puts it back, with the milestone', members().includes('legacy-idp-sunset') && waitsOf('legacy-idp-off').includes('legacy-idp-sunset'));
198
- ok('H an initiative in no program keeps Turn into a program and has no Move items', await goPage('eshop-inline-login') && await (async () => { const m2 = await menu(p); return m2.includes('Turn into a program') && !m2.some((x) => /^Move (out|to another)/.test(x)); })());
199
+ ok('H an initiative in no program: its Program picker ends with Make it a program, and has no No program', await goPage('eshop-inline-login') && await (async () => { const m2 = await menu(p); if (!m2.includes('Program')) return false; await p.click('.cz-vw-menu [role="menuitem"]:has(> span:text-is("Program"))'); const l2 = await until(() => p.evaluate(() => { const h = document.querySelector('.hi-pop.menu'); return h ? [...h.querySelectorAll('[data-hi-mi]')].map((b) => b.textContent.trim()) : null; })); return !!l2 && l2[l2.length - 1] === 'Make it a program' && !l2.includes('No program'); })());
199
200
  ok('H no page error', !errors.length, errors.join(' | '));
200
201
  await ctx.close();
201
202
  }
@@ -73,7 +73,7 @@ const move = (id, to, why) => post('/api/boards/move', { ...own(id), id, to, ...
73
73
  const prevOf = (r) => ({ life: r.acts.life, reason: r.acts.reason, backDay: r.acts.backDay || null });
74
74
  const lifeBack = (r, p) => (p.life === 'hold' ? life(r.id, 'on-hold', p.reason, p.backDay) : p.life === 'cancelled' ? life(r.id, 'cancelled', p.reason) : life(r.id, 'active', 'undo'));
75
75
  /** How much of the step is ready, for "Move to <next> · 2 of 4 ready": the parts or tickets counted toward its output. */
76
- const readyOf = (r) => { const t = r.track || {}; return t.count && /\d+ of \d+/.test(t.count) ? t.count.replace(/ parts?$/, '') + ' ready' : ''; };
76
+ export const readyOf = (r) => { const t = r.track || {}; return t.count && /\d+ of \d+/.test(t.count) ? t.count.replace(/ parts?$/, '') + ' ready' : ''; };
77
77
  function reasonHtml(r, kind, to) {
78
78
  const L = kind === 'cancel' ? WHY_NOT : BACK_WHY;
79
79
  const q = kind === 'cancel' ? 'Why cancel ' + r.title + '?' : 'Why back to ' + to + '?';
@@ -86,11 +86,13 @@ function stageHtml(r) {
86
86
  const a = r.acts, cur = a.stages.indexOf(a.stage);
87
87
  return `<p class="bd-mlbl">Move to a stage</p>` + a.stages.map((s, i) => (i === cur ? '' : `<button type="button" class="bd-mi" role="menuitem" data-rowact="${i > cur ? 'mv:' : 'back:'}${i}" data-id="${esc(r.key)}">${SV(i > cur ? I.go : I.back)}<span>${esc(s)}</span>${i === cur + 1 && readyOf(r) ? `<span class="k">${esc(readyOf(r))}</span>` : ''}</button>`)).join('');
88
88
  }
89
- /** One press of the initiative's ⋯ (pm/ini-more.js, feedback batch 14 item 5), by the row menu's own handlers: stage lists the stages,
90
- * back:<stage> and cancel ask why in a card under the ⋯, hold and resume act at once with Undo. */
89
+ /** One press of the initiative's ⋯ or its stage chip (pm/ini-more.js, feedback batch 14 item 5, batch 16 item 5c), by the row menu's own
90
+ * handlers: stage lists the stages, fwd:<stage> moves there at once with Undo, back:<stage> and cancel ask why in a card under the press,
91
+ * hold and resume act at once with Undo. */
91
92
  function moreAct(r, k, btn) {
92
93
  if (!r || !r.acts) return;
93
94
  if (k === 'hold' || k === 'resume') { runRow(r, k, null); return; }
95
+ if (k.startsWith('fwd:')) { runRow(r, 'go:' + k.slice(4), btn); return; } // the stage chip's picker (batch 16 item 5c): at once, Undo in the toast
94
96
  const card = (html, label, cls) => Pop.open(html, btn, { label, role: cls ? 'menu' : 'dialog', width: cls ? 270 : 300, align: 'right', cls: cls || '', focus: '[data-why], .bd-mi' });
95
97
  if (k === 'stage') card(stageHtml(r), 'Move ' + r.title + ' to a stage', 'bd-menu');
96
98
  else if (k === 'cancel') card(reasonHtml(r, 'cancel'), 'Cancel ' + r.title);
@@ -99,8 +101,8 @@ function moreAct(r, k, btn) {
99
101
  async function runRow(r, k, btn) {
100
102
  const a = r.acts, p = prevOf(r), m = $('#rowM');
101
103
  if (k === 'menu') { Pop.close(true); return; } // Not now
102
- if (k.startsWith('mv:') || k.startsWith('back-go:')) {
103
- const to = k.startsWith('mv:') ? a.stages[+k.slice(3)] : k.slice(8), fromStage = a.stage, why = k.startsWith('back-go:') ? whyOf(Pop.el()) : '';
104
+ if (k.startsWith('mv:') || k.startsWith('go:') || k.startsWith('back-go:')) {
105
+ const to = k.startsWith('mv:') ? a.stages[+k.slice(3)] : k.startsWith('go:') ? k.slice(3) : k.slice(8), fromStage = a.stage, why = k.startsWith('back-go:') ? whyOf(Pop.el()) : '';
104
106
  if (!to) return;
105
107
  const res = await press(btn, m, () => move(r.id, to, why)); if (!res) return;
106
108
  const w = Array.isArray(res.warnings) && res.warnings.length ? ' Warning: ' + res.warnings.join('; ') + '. Warnings never block.' : '';