create-pmos 0.426.0 → 0.428.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 (78) hide show
  1. package/package.json +25 -25
  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 +16 -2
  7. package/workspace/briefing-premium-board-test.js +25 -20
  8. package/workspace/briefing-premium-test.js +2 -1
  9. package/workspace/changelog.json +24 -0
  10. package/workspace/guide/briefing-premium.md +4 -2
  11. package/workspace/guide/claude-proposes.md +3 -1
  12. package/workspace/guide/home.md +32 -7
  13. package/workspace/guide/programs.md +1 -0
  14. package/workspace/home-other-product-test.js +12 -2
  15. package/workspace/lib/context-use.js +54 -0
  16. package/workspace/lib/routes-live.js +3 -1
  17. package/workspace/lib/routes-meeting-material.js +22 -1
  18. package/workspace/lib/settings-store.js +14 -0
  19. package/workspace/lib/transcript-read.js +9 -2
  20. package/workspace/milestone-pins-test.js +13 -0
  21. package/workspace/milestone-suggest-test.js +10 -4
  22. package/workspace/package-lock.json +2 -2
  23. package/workspace/package.json +1 -1
  24. package/workspace/premium-board-actions-test.js +40 -13
  25. package/workspace/premium-rec-tab-test.js +8 -0
  26. package/workspace/premium-vw-item-test.js +7 -3
  27. package/workspace/premium-vw-jira-test.js +2 -1
  28. package/workspace/program-charter-test.js +1 -1
  29. package/workspace/program-leave-test.js +2 -2
  30. package/workspace/program-order-test.js +3 -2
  31. package/workspace/program-panel-test.js +2 -1
  32. package/workspace/public/pm/bd-acts.js +20 -26
  33. package/workspace/public/pm/bd-ini-panel.js +90 -32
  34. package/workspace/public/pm/bd-pin-card.js +4 -1
  35. package/workspace/public/pm/bd-span.js +22 -12
  36. package/workspace/public/pm/cozy-home.css +7 -0
  37. package/workspace/public/pm/cozy-live-pill.css +1 -0
  38. package/workspace/public/pm/cozy-live-pill.js +2 -1
  39. package/workspace/public/pm/cozy-rec-tab.js +12 -3
  40. package/workspace/public/pm/cozy-today.css +3 -0
  41. package/workspace/public/pm/cozy-viewer.js +157 -23
  42. package/workspace/public/pm/cozy-vw-shell.css +13 -0
  43. package/workspace/public/pm/cozy.css +6 -0
  44. package/workspace/public/pm/ctx-wedge.js +45 -0
  45. package/workspace/public/pm/hi-pop.css +82 -0
  46. package/workspace/public/pm/hi-pop.js +65 -0
  47. package/workspace/public/pm/home-app.js +70 -28
  48. package/workspace/public/pm/home-chat.js +7 -2
  49. package/workspace/public/pm/home-data.js +2 -1
  50. package/workspace/public/pm/home-ini.css +6 -76
  51. package/workspace/public/pm/home-ini.js +50 -68
  52. package/workspace/public/pm/home-list.js +29 -3
  53. package/workspace/public/pm/home-today.js +26 -9
  54. package/workspace/public/pm/ini-more.js +67 -0
  55. package/workspace/public/pm/ini-view-model.js +3 -2
  56. package/workspace/public/pm/ini-view.css +3 -1
  57. package/workspace/public/pm/ini-view.js +7 -5
  58. package/workspace/public/pm/live-model.js +1 -1
  59. package/workspace/public/pm/order-model.js +85 -0
  60. package/workspace/public/pm/premium-board.js +57 -11
  61. package/workspace/public/pm/premium-insights.js +11 -1
  62. package/workspace/public/pm/premium-vw-item.js +3 -1
  63. package/workspace/public/pm/premium-vw-jira.js +2 -0
  64. package/workspace/public/pm/prog-order.js +15 -2
  65. package/workspace/public/pm/sort-order.css +17 -0
  66. package/workspace/public/pm/sort-order.js +108 -0
  67. package/workspace/public/pm/tk-view.js +3 -2
  68. package/workspace/public/pm/wf-page.js +1 -1
  69. package/workspace/public/premium-board.html +1 -0
  70. package/workspace/server.js +28 -0
  71. package/workspace/sort-order-test.js +201 -0
  72. package/workspace/stage-card-test.js +1 -0
  73. package/workspace/task-card-test.js +1 -1
  74. package/workspace/test-lists/batch13-context-use.json +5 -0
  75. package/workspace/test-lists/sort-order.json +6 -0
  76. package/workspace/test-lists/viewer-trail.json +5 -0
  77. package/workspace/tk-tasks-test.js +5 -3
  78. package/workspace/viewer-trail-test.js +145 -0
@@ -91,6 +91,21 @@ function candidates(ctx, w) {
91
91
  }
92
92
  }
93
93
  } catch { /* no library */ }
94
+ // a document a chat wrote and nobody has committed yet: the library lists tracked files only, so it is read here
95
+ try {
96
+ const seen = new Set(docs.map((d) => d.ref));
97
+ const out = require('child_process').execFileSync('git', ['ls-files', '--others', '--exclude-standard', '-z', '--', '*.md'], { cwd: root, encoding: 'utf8', maxBuffer: 16 * 1024 * 1024, stdio: ['ignore', 'pipe', 'ignore'] });
98
+ for (const rel of out.split('\0').filter(Boolean).slice(0, 2000)) {
99
+ if (seen.has(rel) || isReportPath(rel) || /(^|\/)(node_modules|\.git)\//.test(rel)) continue;
100
+ let title = '', date = '';
101
+ try {
102
+ const full = require('path').join(root, rel), head = fs.readFileSync(full, 'utf8').slice(0, 4096);
103
+ const m = /^---\n[\s\S]*?^title:\s*"?(.+?)"?\s*$/m.exec(head) || /^#\s+(.+)$/m.exec(head);
104
+ title = m ? m[1].trim() : ''; date = fs.statSync(full).mtime.toISOString().slice(0, 10);
105
+ } catch { /* the name stands for it */ }
106
+ docs.push({ kind: 'pmos-doc', ref: rel, title: title || rel.split('/').pop().replace(/\.md$/, ''), date, ini: null, ws: w.id, meta: 'Not committed yet' + (date ? ' · ' + dayText(date) : '') });
107
+ }
108
+ } catch { /* not a git repository */ }
94
109
  try {
95
110
  const rs = require('./routes-report-setups.js');
96
111
  for (const d of rs.documentsOf({ runtimeDir: ctx.runtimeDir, getWs: ctx.getWs }, w).docs || []) {
@@ -121,8 +136,14 @@ function suggest(q, ctx) {
121
136
  const text = str(q.q, 120).toLowerCase();
122
137
  let found = [];
123
138
  if (text.length >= 2) {
139
+ // a search looks in every workspace, this one first: the meeting's workspace is often not the one that holds the document
124
140
  const hit = (x) => (x.title + ' ' + x.ref).toLowerCase().includes(text);
125
- found = [...c.reports.filter(hit), ...c.docs.filter(hit)].sort(newest).slice(0, 8).map((x) => pick(x));
141
+ const others = typeof ctx.workspaceList === 'function' ? (ctx.workspaceList() || []).filter((o) => o && o.root && o.id !== w.id && o.root !== w.root) : [];
142
+ for (const [i, src] of [c, ...others.map((o) => candidates(ctx, o))].entries()) {
143
+ if (found.length >= 8) break;
144
+ const got = [...src.reports.filter(hit), ...src.docs.filter(hit)].sort(newest).map((x) => pick(x));
145
+ found.push(...(i === 0 ? got : got.map((x) => ({ ...x, meta: x.meta + ' · ' + (others[i - 1].name || others[i - 1].id) }))).slice(0, 8 - found.length));
146
+ }
126
147
  }
127
148
  return { status: 200, body: { ok: true, suggested, found } };
128
149
  }
@@ -63,6 +63,8 @@ const DEFS = Object.freeze({
63
63
  'sess.idle': one('sessions', 'computer', ['15', '30', '60', 'never'], '30'),
64
64
  'sess.share': one('sessions', 'computer', ['ws', 'job'], 'ws'),
65
65
  'look.start': one('appearance', 'computer', ['brief', 'cal', 'work', 'init', 'rep'], 'brief'),
66
+ // ONE order for Home, the Board and the Timeline (batch 14 item 8): the sort, the programs and products, the initiatives under each product
67
+ 'look.order': { section: 'appearance', scope: 'computer', type: 'order', def: { sort: 'mine', top: [], inis: {} } },
66
68
  // premium-updates: once a day by default. An open page posts the check; the server never schedules one (no-network.test.js).
67
69
  'upd.check': one('updates', 'computer', ['press', 'daily'], 'daily'),
68
70
  'upd.apply': one('updates', 'computer', ['ask', 'idle'], 'ask'),
@@ -127,6 +129,18 @@ function validate(key, value) {
127
129
  }
128
130
  // ['*'] alone is every workspace (the product picker's All, lib/briefing-premium-products.js)
129
131
  case 'ids': return value === null || Array.isArray(value) && (value.length === 1 && value[0] === '*' || value.length <= d.max && value.every((x) => typeof x === 'string' && WS_ID.test(x)) && new Set(value).size === value.length) ? null : `${key} must list at most ${d.max} workspace ids, each once, or ['*'] for every one`;
132
+ case 'order': {
133
+ // pm/order-model.js keeps a layout this small (trim)
134
+ const SORTS = ['mine', 'turn', 'date', 'stage', 'name'];
135
+ const keys = (a, n) => Array.isArray(a) && a.length <= n && a.every((x) => typeof x === 'string' && x.length > 0 && x.length <= 200 && !/[\u0000-\u001f]/.test(x));
136
+ if (!value || typeof value !== 'object' || Array.isArray(value)) return `${key} must be { sort, top, inis }`;
137
+ if (!SORTS.includes(value.sort)) return `${key}.sort must be one of ${SORTS.join(', ')}`;
138
+ if (!keys(value.top, 200)) return `${key}.top must list at most 200 keys`;
139
+ if (!value.inis || typeof value.inis !== 'object' || Array.isArray(value.inis)) return `${key}.inis must map a product to its initiatives`;
140
+ const ps = Object.entries(value.inis);
141
+ if (ps.length > 100 || !ps.every(([k, v]) => k.length <= 200 && keys(v, 300))) return `${key}.inis must hold at most 100 products of 300 initiatives each`;
142
+ return null;
143
+ }
130
144
  case 'templates': {
131
145
  if (!value || typeof value !== 'object' || Array.isArray(value)) return `${key} must name the templates`;
132
146
  const ids = Object.keys(value);
@@ -220,6 +220,7 @@ function prettyTool(name) {
220
220
  function newHarnessAcc() {
221
221
  return { model: null, effort: null, turns: 0, title: null, skills: null,
222
222
  toolCounts: {}, toolTotal: 0, tok: { input: 0, output: 0, cacheRead: 0, cacheCreate: 0 }, sawUsage: false,
223
+ ctx: null, peak: 0, // the newest real turn's { used, at } and the largest one seen (lib/context-use.js)
223
224
  // For the open-call signal (R2): pair tool_use → tool_result by id in one pass. The NEWEST
224
225
  // tool_use with no matching result is the call in flight; its record timestamp dates it. This is
225
226
  // the same "written before its result exists" property the append-only transcript guarantees.
@@ -286,6 +287,11 @@ function feedHarness(acc, raw, clean) {
286
287
  acc.tok.output += u.output_tokens || 0;
287
288
  acc.tok.cacheRead += u.cache_read_input_tokens || 0;
288
289
  acc.tok.cacheCreate += u.cache_creation_input_tokens || 0;
290
+ // context use (batch 13 item 8): the NEWEST real turn's size, not the sum. A subagent's turn has its own context and is left out.
291
+ if (m.model && m.model !== SYNTHETIC && !r.isSidechain) {
292
+ const used = (u.input_tokens || 0) + (u.cache_read_input_tokens || 0) + (u.cache_creation_input_tokens || 0) + (u.output_tokens || 0);
293
+ if (used > 0) { acc.ctx = { used, at: r.timestamp || null }; if (used > acc.peak) acc.peak = used; }
294
+ }
289
295
  }
290
296
  for (const c of (m.content || [])) {
291
297
  if (c && c.type === 'tool_use' && c.name) {
@@ -300,7 +306,7 @@ function feedHarness(acc, raw, clean) {
300
306
 
301
307
  function harnessOf(acc) {
302
308
  const out = { model: acc.model, effort: acc.effort, turns: acc.turns, tokens: null, tools: null, skills: acc.skills,
303
- title: acc.title, openCall: null, turn: null, missing: {} };
309
+ title: acc.title, openCall: null, turn: null, context: acc.ctx ? { ...acc.ctx, peak: acc.peak } : null, missing: {} };
304
310
 
305
311
  // The newest tool_use with no matching tool_result is the call in flight (R2). Map preserves
306
312
  // insertion (chronological) order, so the last unresolved entry is the newest.
@@ -326,6 +332,7 @@ function harnessOf(acc) {
326
332
  // Tokens are reported as ABSOLUTE counts and never as a percentage: the context window size
327
333
  // is not in the record, and autocompaction makes the running total move backward. A percentage
328
334
  // of an unknown denominator is not a quantity — that refusal predates this module and stands.
335
+ // `context` is absolute too; lib/context-use.js gives it a % only when it can name the window.
329
336
  if (acc.sawUsage) out.tokens = { ...acc.tok };
330
337
  else out.missing.tokens = 'the transcript records no token usage yet';
331
338
  if (!out.skills) out.missing.skills = 'the CLI listed no skills for this session';
@@ -381,7 +388,7 @@ function readHarness(file, clean = (x) => x, cache = null) {
381
388
  } catch {
382
389
  if (cache) { cache.file = null; cache.acc = null; cache.offset = 0; }
383
390
  return { model: null, effort: null, turns: 0, tokens: null, tools: null, skills: null,
384
- title: null, openCall: null, turn: null, missing: { all: "can't read the harness — the transcript could not be read" } };
391
+ title: null, openCall: null, turn: null, context: null, missing: { all: "can't read the harness — the transcript could not be read" } };
385
392
  }
386
393
  return harnessOf(acc);
387
394
  }
@@ -34,6 +34,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
34
34
  const ROWS = [
35
35
  F.row('migration', 'Migration — move from Okta to Descope', { owner: 'Wawan', stage: 'Build', start: '2026-10-01', end: '2027-09-05', progress: 20 }),
36
36
  F.row('passkey', 'Passkey sign-in', { owner: 'Lee', start: '2026-09-15', end: '2027-02-26', progress: 45 }),
37
+ F.row('otp', 'Email OTP', { owner: 'Lee', start: '2026-11-02', end: '2027-06-09', progress: 10 }),
37
38
  ];
38
39
  const it = (ini, uid, title, o) => ({ uid, key: '', kind: 'Task', src: 'pmos', title, status: 'To do', owner: 'Wawan', ini, start: null, end: null, ref: uid, board: 'w1', milestone: true, ...o });
39
40
  const ITEMS = [
@@ -43,6 +44,7 @@ const ITEMS = [
43
44
  it('migration', 'm-eval', 'Evaluation at 30 days', { end: '2027-07-01' }),
44
45
  it('migration', 'm-okta', 'Okta decommissioned', { end: '2027-09-05' }),
45
46
  it('passkey', 'p-beta', 'Beta to staff', { end: '2026-12-18' }),
47
+ it('otp', 'o-roll', 'Email OTP rolled out', { end: '2027-05-26', section: 'deliver' }),
46
48
  ];
47
49
 
48
50
  (async () => {
@@ -121,6 +123,17 @@ const ITEMS = [
121
123
  ok('T unpinning the last one writes pinned false', posts[1] && posts[1].task === 'm-okta' && posts[1].pinned === false && c && /2 of 5/.test(c.sub), JSON.stringify(posts));
122
124
  await p.keyboard.press('Escape');
123
125
  ok('C Escape closes the card', await p.evaluate(() => document.querySelector('#bdPop').hidden));
126
+ // batch 14 item 1: the row's end label and the card say the same thing
127
+ const otp = await p.evaluate(() => { const r = document.querySelector('#ibBody [data-row="board:otp"]'); const e = r && r.querySelector('.tg-end'), l = r && r.querySelector('.tg-endl');
128
+ return { id: e ? e.dataset.msId : null, label: l ? l.textContent.trim() : '', hover: l ? l.title : '', tm: r ? r.querySelectorAll('.tg-tm').length : -1 }; });
129
+ ok('E a milestone in the Deliver stage before the end names the row\'s end, at its own date; the end date is the hover; one ◇ only',
130
+ otp.id === 'o-roll' && otp.label === 'Email OTP rolled out May 26 ’27' && /Initiative ends Jun 9 ’27/.test(otp.hover) && otp.tm === 0, JSON.stringify(otp));
131
+ await p.click('[data-ms-pick="board:passkey"][data-ms-id=""]');
132
+ await p.waitForSelector('#bdPop.bd-pc:not([hidden])', { timeout: 4000 });
133
+ c = await card(p);
134
+ ok('E the plain end ◇ opens a card headed with the row\'s own label, "Deliver Feb 26 ’27"',
135
+ c && c.h === 'Deliver Feb 26 ’27' && c.sub === 'The end of Passkey sign-in · 1 of 1 milestone on the timeline', JSON.stringify(c));
136
+ await p.keyboard.press('Escape');
124
137
  ok('C the ◇ press does not open the initiative', await p.evaluate(() => !document.querySelector('.iv-tr')));
125
138
 
126
139
  /* F — the Filter */
@@ -6,7 +6,7 @@
6
6
  * F a program with no milestones: Claude's first suggestions take the place of "Add the first milestone", each with why and its source; ✓ ✎ ✕
7
7
  * are icon-only; keep all · W later changes lead Waits on you; ✓ keeps, ✕ drops · C the pencil opens the charter with the change filled in;
8
8
  * Save writes it and answers the suggestion; last checked and Check now · Z nothing to suggest, nothing shows · K the ◆ dates are reported once
9
- * · M Home's Your move has one line per program · H on a phone. PMOS_SHOTS=<dir> also saves the screenshots the frames are compared with. */
9
+ * · M Home's program card leads with its milestone changes · H on a phone. PMOS_SHOTS=<dir> also saves the screenshots the frames are compared with. */
10
10
  const path = require('path');
11
11
  const fs = require('fs');
12
12
  const { spawn } = require('child_process');
@@ -142,14 +142,20 @@ const withReview = (open, o = {}) => F.programs().map((p) => ({ ...p, ...(o.empt
142
142
 
143
143
  /* ── M: Home's Your move ── */
144
144
  const M = await open({ home: true });
145
- // Your move lives in Your day, which the greeting opens
146
- if (await until(() => M.page.$('[data-hm-day]'), 10000)) { await until(() => M.page.evaluate(() => !!document.querySelector('[data-hm-prog]')), 8000); await M.page.click('[data-hm-day]'); }
145
+ // the program's milestone changes lead its card on Home (batch 14 item 4: a desktop has no Your day; the greeting opens the calendar)
146
+ await until(() => M.page.evaluate(() => !!document.querySelector('[data-hm-prog]')), 10000);
147
147
  const hm = await until(() => M.page.evaluate(() => { const b = document.querySelector('[data-hm-sel="ms:project-ascent"]'); return b ? [...b.querySelectorAll('b, em')].map((x) => x.textContent.trim()).join(' · ') : null; }), 10000);
148
- ok('M Home\'s Your move has one line for the program: its name and the changes', hm === 'Project Ascent · 3 milestone changes · Pilot live to Dec 2', String(hm));
148
+ ok('M Home\'s program card has one line for its milestone changes, first', hm === '3 milestone changes · Pilot live to Dec 2', String(hm));
149
149
  if (hm) {
150
150
  await M.page.click('[data-hm-sel="ms:project-ascent"]');
151
151
  ok('M a tap opens the program, where the changes lead Waits on you', !!(await until(() => M.page.evaluate(() => !!document.querySelector('#czViewer [data-czs-id="needs"] .msg-r')), 8000)));
152
152
  }
153
+ // batch 14 item 4: on a desktop the greeting opens the calendar in the Viewer, not Your day
154
+ if (await M.page.$('[data-hm-day]')) {
155
+ await M.page.click('[data-hm-day]');
156
+ const vw = await until(() => M.page.evaluate(() => { const v = document.querySelector('#czViewer'); const t = v && !v.hidden ? v.textContent.replace(/\s+/g, ' ') : ''; return /Calendar|Your move/.test(t) ? t : null; }), 8000);
157
+ ok('D on a desktop the greeting opens the calendar in the Viewer; there is no Your day', vw && /Calendar/.test(vw) && !/Your move/.test(vw), String(vw).slice(0, 200));
158
+ }
153
159
  ok('0 no page error on Home', M.errors.length === 0, M.errors.join(' | '));
154
160
  await M.ctx.close();
155
161
 
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.426.0",
3
+ "version": "0.428.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.426.0",
9
+ "version": "0.428.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@xterm/addon-fit": "^0.11.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.426.0",
3
+ "version": "0.428.0",
4
4
  "private": true,
5
5
  "description": "PMOS Terminal Workspace — local companion hosting real PTYs beside the library and gates (D62)",
6
6
  "license": "MIT",
@@ -88,9 +88,11 @@ const ALLOWED = /^\/api\/(?:boards\/(?:asks\/(?:add|accept|decline)|move|archive
88
88
  const peekOn = (title) => until(() => p.evaluate((t) => { const k = document.querySelector('#czViewer'); return k && !k.hidden && (document.querySelector('#czViewer .cz-vw-title') || {}).textContent === t && !k.querySelector('.bd-wtag'); }, title));
89
89
  const popOn = (re) => until(() => p.evaluate((s) => { const k = document.querySelector('#bdPop'); return k && !k.hidden && new RegExp(s).test(k.textContent) ? k.textContent : null; }, re.source));
90
90
  const noDlg = () => p.evaluate(() => !document.querySelector('#dlg.on'));
91
- /* re-pointed (viewer-shell-a, XvABoard): the initiative opens in the Viewer, and its ⋯ holds "Move, hold, cancel or archive" */
92
- const vwActs = async (pg) => { await until(() => pg.evaluate(() => { const v = document.querySelector('#czViewer'), c = window.czViewer && window.czViewer.current(); return !!v && !v.hidden && !!c && c.kind === 'Initiative' && !!v.querySelector('[data-cz-vw="more"]'); })); await pg.click('#czViewer [data-cz-vw="more"]'); await pg.waitForSelector('.cz-vw-menu [role="menuitem"]'); const i = await pg.evaluate(() => [...document.querySelectorAll('.cz-vw-menu [role="menuitem"]')].findIndex((b) => b.textContent.trim() === 'Move, hold, cancel or archive')); await pg.locator('.cz-vw-menu [role="menuitem"]').nth(i).click(); };
93
- const acts = async (id) => { await until(() => listed(id), 30000); await p.click(`#ibBody .ini2[data-key="board:${id}"]`); await vwActs(p); return until(() => p.evaluate(() => { const m = document.querySelector('#bdPop'); return !!m && !m.hidden && m.getAttribute('role') === 'menu'; })); };
91
+ /* re-pointed (batch 14 item 5): the initiative opens in the Viewer, and its ⋯ is the one initiative menu (pm/ini-more.js): the stage presses are its items */
92
+ const vwMenu = async (pg) => { await until(() => pg.evaluate(() => { const v = document.querySelector('#czViewer'), c = window.czViewer && window.czViewer.current(); return !!v && !v.hidden && !!c && c.kind === 'Initiative' && !!v.querySelector('[data-cz-vw="more"]'); })); await pg.click('#czViewer [data-cz-vw="more"]'); await pg.waitForSelector('.cz-vw-menu [role="menuitem"]'); return pg.evaluate(() => [...document.querySelectorAll('.cz-vw-menu [role="menuitem"]')].map((b) => b.querySelector('span').textContent)); };
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
+ const more = async (id, label) => { await until(() => listed(id), 30000); await p.click(`#ibBody .ini2[data-key="board:${id}"]`); return vwPick(p, label); };
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; }));
94
96
  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); } };
95
97
  await until(() => p.evaluate(() => document.querySelectorAll('#ibBody .ini2').length > 0), 30000);
96
98
  await p.click('#chAsks');
@@ -143,7 +145,11 @@ const ALLOWED = /^\/api\/(?:boards\/(?:asks\/(?:add|accept|decline)|move|archive
143
145
  ok('N4 closing the questions with the shell\'s Close keeps the open ones as the next step, as Later does', await until(() => lines('triage-answers.jsonl').filter((l) => l.kind === 'later').length > later0) && !!(await toastIs(/Kept as the next step of Partner usage per key/)));
144
146
 
145
147
  /* M move and Undo, from the panel's ⋯ (BdActions) */
146
- ok('M1 the row menu offers the next stage with how much is ready, hold, cancel and archive', await acts('pa-one') && await p.evaluate(() => { const L = [...document.querySelectorAll('#bdPop [data-rowact] span:first-of-type')].map((b) => b.textContent); return /^Move to /.test(L[0]) && L.includes('Hold') && L.includes('Cancel') && L.includes('Archive'); }), await p.evaluate(() => document.querySelector('#bdPop').textContent));
148
+ await until(() => listed('pa-one'), 30000); await p.click('#ibBody .ini2[data-key="board:pa-one"]');
149
+ 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));
151
+ 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));
147
153
  await p.keyboard.press('Escape');
148
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)));
149
155
  await p.keyboard.press('Escape');
@@ -157,18 +163,19 @@ const ALLOWED = /^\/api\/(?:boards\/(?:asks\/(?:add|accept|decline)|move|archive
157
163
  await closeAll();
158
164
 
159
165
  /* L hold, resume, cancel, reopen, archive, restore: each at once, with Undo */
160
- await acts('pa-one'); await p.click('#bdPop [data-rowact="hold"]');
166
+ await more('pa-one', 'Put on hold');
161
167
  const hl = await until(() => lines('lifecycle.jsonl').find((l) => l.initiative_id === 'pa-one' && l.state === 'on-hold'));
162
168
  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));
163
169
  await closeAll();
164
170
  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));
165
- await acts('pa-one');
166
- ok('L2 Resume is offered and the moves are not', await p.evaluate(() => !!document.querySelector('#bdPop [data-rowact="resume"]') && !document.querySelector('#bdPop [data-rowact^="mv:"]')));
167
- await p.click('#bdPop [data-rowact="resume"]');
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();
168
175
  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'; }));
169
176
  await closeAll();
170
177
  await until(() => p.evaluate(() => { const b = document.querySelector('#ibBody .ini2[data-key="board:pa-one"]'); return b && !/On hold/.test(b.textContent); }), 30000);
171
- await acts('pa-one'); await p.click('#bdPop [data-rowact="cancel"]');
178
+ await acts('pa-one', 'Cancel the initiative');
172
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'));
173
180
  await p.click('#bdPop [data-why="Not now"]'); await p.click('#bdPop [data-rowact="cancel-go"]');
174
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')));
@@ -180,7 +187,7 @@ const ALLOWED = /^\/api\/(?:boards\/(?:asks\/(?:add|accept|decline)|move|archive
180
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'; }));
181
188
  await closeAll();
182
189
  await until(() => listed('pa-one'), 30000);
183
- await acts('pa-one'); await p.click('#bdPop [data-rowact="archive"]');
190
+ await more('pa-one', 'Archive');
184
191
  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)));
185
192
  ok('L8 the ⋯ menu\'s item counts it as archived', await until(() => p.evaluate(() => /1 archived/.test((document.querySelector('#bdGone') || {}).textContent || '')), 30000));
186
193
  await p.click('#bdToast .bd-undo');
@@ -196,6 +203,26 @@ const ALLOWED = /^\/api\/(?:boards\/(?:asks\/(?:add|accept|decline)|move|archive
196
203
  ok('I0 the expand link lands on Home with the initiative selected, ws and board kept', !!landed, await ip.evaluate(() => location.href));
197
204
  // the page holds the Tasks (batch 11 item 20)
198
205
  await until(() => ip.evaluate(() => !!document.querySelector('#czViewer:not([hidden]) [data-hi-v]')), 60000);
206
+ /* X the one initiative ⋯ (batch 14 item 5, pm/ini-more.js): Home's page and the Board's panel list the same items in the same order; only
207
+ Home has Open on the Board (the Board is where the other one is) */
208
+ {
209
+ await ip.click('#czViewer:not([hidden]) [data-cz-vw="more"]'); await ip.waitForSelector('.cz-vw-menu [role="menuitem"]');
210
+ const homeM = await ip.evaluate(() => [...document.querySelectorAll('.cz-vw-menu [role="menuitem"]')].map((b) => b.querySelector('span').textContent));
211
+ if (process.env.PMOS_SHOTS) await ip.screenshot({ path: path.join(process.env.PMOS_SHOTS, 'ini-more-home.png') });
212
+ await ip.keyboard.press('Escape');
213
+ await closeAll(); await p.click('#ibBody .ini2[data-key="board:pa-one"]'); const boardM = await vwMenu(p);
214
+ if (process.env.PMOS_SHOTS) {
215
+ 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
+ }
219
+ await p.keyboard.press('Escape'); await closeAll();
220
+ const { ORDER } = await import('./public/pm/ini-more.js');
221
+ const rank = (l) => ORDER.findIndex((o) => l === o || l.startsWith(o + ' '));
222
+ const inOrder = (L) => L.every((l, i) => rank(l) >= 0 && (i === 0 || rank(l) >= rank(L[i - 1])));
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));
225
+ }
199
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);
200
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);
201
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));
@@ -239,8 +266,8 @@ const ALLOWED = /^\/api\/(?:boards\/(?:asks\/(?:add|accept|decline)|move|archive
239
266
  await S.page.click('#chAsks');
240
267
  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)));
241
268
  await S.page.keyboard.press('Escape');
242
- await S.page.click('#ibBody .ini2'); await vwActs(S.page);
243
- ok('S2 its actions have no move', await until(() => S.page.evaluate(() => { const x = document.querySelector('#bdPop'); return x && !x.hidden && !x.querySelector('[data-rowact^="mv:"]') && !!x.querySelector('[data-rowact="hold"]'); })));
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));
244
271
  await S.ctx.close();
245
272
  }
246
273
 
@@ -260,7 +287,7 @@ const ALLOWED = /^\/api\/(?:boards\/(?:asks\/(?:add|accept|decline)|move|archive
260
287
  await until(() => S.page.evaluate(() => document.querySelectorAll('#ibBody .ini2').length > 0), 30000);
261
288
  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)) }));
262
289
  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));
263
- await S.page.click('#ibBody .ini2'); await vwActs(S.page);
290
+ await S.page.click('#ibBody .ini2'); await vwPick(S.page, 'Move to a stage');
264
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; }));
265
292
  ok('F2 the action rows are 44 px tall and the open sheet adds no sideways scroll', !!mi);
266
293
  await S.ctx.close();
@@ -134,6 +134,14 @@ async function context(o = {}) {
134
134
  await tab.$eval('#rtBar [data-a="hl"]', (b) => b.click());
135
135
  ok('T3 Highlight starts the recorder\'s highlight', await until(() => tab.evaluate(() => window.__premiumRecorder._hl === 1)));
136
136
 
137
+ /* T3b a press that gets no answer (Wawan, 2026-10-27: the clock stuck at 4:48 and the transcript stopped): the clock goes on */
138
+ await tab.evaluate(() => { const R = window.__premiumRecorder; window.__rtPause = R.pause; R.pause = () => new Promise(() => {}); window.__rtBusyMs = 2500; });
139
+ await tab.$eval('#rtBar [data-a="pause"]', (b) => b.click());
140
+ const c0 = await tab.evaluate(() => document.getElementById('rtClock').textContent);
141
+ ok('T3b while a press waits for its answer, the meeting clock still moves', await until(async () => (await tab.evaluate(() => document.getElementById('rtClock').textContent)) !== c0, 5000), c0);
142
+ ok('T3b the press gives up: the button comes back and the tab says to try again', await until(() => tab.evaluate(() => { const b = document.querySelector('#rtBar [data-a="pause"]'); return !!b && !b.disabled && /took too long/.test(document.getElementById('rtMsg').textContent); }), 8000));
143
+ await tab.evaluate(() => { window.__premiumRecorder.pause = window.__rtPause; delete window.__rtBusyMs; });
144
+
137
145
  /* T4 the next meeting while this one records: the recording tab asks once */
138
146
  await p.evaluate(() => new BroadcastChannel('pmos-rec').postMessage({ id: 'new1', switchTo: { title: 'Rail review', body: { title: 'Rail review' } }, at: Date.now() }));
139
147
  ok('T4 the recording tab asks: Stop Design crit and record Rail review?', await until(() => tab.evaluate(() => /Stop Design crit and record Rail review\?/.test(document.getElementById('rtAsk').textContent))));
@@ -107,9 +107,13 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
107
107
  const up = await until(() => page.evaluate(() => document.querySelectorAll('#ibBody [data-key]').length > 0), 20000);
108
108
  ok('R9 the Board loads', up);
109
109
  await page.click('#ibBody .ini2[data-key="board:self-serve-v2"]'); // a phone opens on the List view (premium-uncovered-features, BdPhone)
110
- /* re-pointed (viewer-shell-a, XvABoard): the initiative opens in the Viewer's shell A; "Open in full" under ⋯ leads to the initiative page */
111
- const pk = await until(() => page.evaluate(() => { const v = document.querySelector('#czViewer'), c = window.czViewer && window.czViewer.current(); return v && !v.hidden && c && c.kind === 'Initiative' ? { record: !!v.querySelector('[data-pk="record"]'), dlg: !!document.querySelector('#dlg.on'), href: c.url || '' } : null; }));
112
- ok('R9 an initiative row opens the Board\'s initiative in the Viewer, not the dialog, and its "Open in full" leads to the initiative page, where the record tab is', !!pk && !pk.record && !pk.dlg && /^\/premium-initiative\.html\?id=self-serve-v2&ws=w1&board=w1$/.test(pk.href), JSON.stringify(pk));
110
+ /* re-pointed (batch 14 item 5): the initiative opens in the Viewer's shell A; its ⋯ (the one initiative menu) has The record, as Home's has */
111
+ const pk = await until(() => page.evaluate(() => { const v = document.querySelector('#czViewer'), c = window.czViewer && window.czViewer.current(); return v && !v.hidden && c && c.kind === 'Initiative' ? { record: !!v.querySelector('[data-pk="record"]'), dlg: !!document.querySelector('#dlg.on') } : null; }));
112
+ await page.click('#czViewer [data-cz-vw="more"]'); await page.waitForSelector('.cz-vw-menu [role="menuitem"]');
113
+ const mm = await page.evaluate(() => [...document.querySelectorAll('.cz-vw-menu [role="menuitem"]')].map((b) => b.querySelector('span').textContent));
114
+ ok('R9 an initiative row opens the Board\'s initiative in the Viewer, not the dialog, and its ⋯ has The record and no Open in full', !!pk && !pk.record && !pk.dlg && mm.includes('The record') && !mm.includes('Open in full'), JSON.stringify([pk, mm]));
115
+ await page.locator('.cz-vw-menu [role="menuitem"]').nth(mm.indexOf('The record')).click();
116
+ ok('R9 The record opens the initiative\'s record as a drill-in', await until(() => page.evaluate(() => { const c = window.czViewer && window.czViewer.current(); return !!c && c.kind !== 'Initiative' && !!document.querySelector('#czViewer [data-cz-vw="back"]'); })), await page.evaluate(() => JSON.stringify(window.czViewer.current())));
113
117
  ok('R9 no page error on the Board', errors.length === 0, errors.join(' | '));
114
118
  await ctx.close();
115
119
  }
@@ -132,8 +132,9 @@ const TICKETS = {
132
132
  const tk = await until(async () => { const t = await paneText(p, 'jira:PMOS-142'); return t && /Acceptance criteria/.test(t) ? t : null; });
133
133
  ok('K1 a card opens its ticket in place of the sprint', !!tk && (await curId(p)) === 'jira:PMOS-142', JSON.stringify(await curId(p)));
134
134
  ok('K2 the ticket leads with what holds it (flagged in Jira), then the facts Jira owns: status, sprint, points and priority', /^Blocked/.test(tk) && /Flagged in Jira/.test(tk) && /StatusTo Do/.test(tk) && /SprintSprint 14/.test(tk) && /Points5/.test(tk) && /PriorityHigh/.test(tk) && /Jira owns these\. They change only in Jira\./.test(tk), tk);
135
- ok('K3 the description is the draft\'s sections, with bold kept and nothing run', /Description · from Jira/.test(tk) && /User Story/.test(tk) && await p.evaluate(() => !!document.querySelector('#czViewer .tkv .ovd strong') && !document.querySelector('#czViewer .tkv img') && !window.__pwned));
135
+ ok('K3 the description is the draft\'s sections, with bold kept and nothing run', /Description · PMOS's copy, Jira may differ/.test(tk) && /User Story/.test(tk) && await p.evaluate(() => !!document.querySelector('#czViewer .tkv .ovd strong') && !document.querySelector('#czViewer .tkv img') && !window.__pwned));
136
136
  ok('K4 the folds: acceptance criteria, subtasks as the reading\'s count, and the links from the draft; the where row names the initiative and its epic', /Acceptance criteria2/.test(tk) && /Subtasks1 of 3 done/.test(tk) && /Linked2/.test(tk) && /blocks/.test(tk) && /PMOS-152/.test(tk) && /drafted fromplanning\/prd\/self-serve-v2-prd.md/.test(tk) && /Self-serve onboarding v2Epic Self-serve v2/.test(tk));
137
+ ok('K6 batch 14 item 12: the header names the ticket by its key and title, not the key alone', await until(() => p.evaluate(() => /^PMOS-142 \S/.test(((document.querySelector('#czVwTitle') || {}).textContent || '').trim())), 5000), await p.evaluate(() => (document.querySelector('#czVwTitle') || {}).textContent));
137
138
  ok('K5 no comments, history or fields panel: Open in Jira at the foot is the one real link', !/pull request|\bPR\b|builder/i.test(tk) && !/Comments \(/.test(tk) && /Open in Jira$/.test(tk)
138
139
  && await p.evaluate(() => [...document.querySelectorAll('#czViewer .obody.vw a[href]')].every((a) => a.href === 'https://acme.atlassian.net/browse/PMOS-142' && a.target === '_blank' && /noopener/.test(a.rel))));
139
140
  await p.evaluate(() => { const f = document.querySelector('#czViewer [data-czs-fold="links"]'); if (f && f.getAttribute('aria-expanded') !== 'true') f.click(); }); // the one ticket Viewer's Linked fold (tk-view.js) opens first
@@ -85,7 +85,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
85
85
  await p.click('#czViewer [data-pp="edit"]');
86
86
  ok('W the pencil opens the charter as a drill-in (← back to the program)', await charterShown(p));
87
87
  const ch = await head(p);
88
- ok('F the header: ←, the program\'s name with "Charter" under it, no Save before a change, no ⋯', ch.tools[0] === 'Back' && /^Project Ascent · CIAM migration/.test(ch.title) && ch.sub === 'Charter' && !ch.save && !ch.tools.includes('More'), JSON.stringify(ch));
88
+ ok('F the header: ←, the program\'s name with "Charter" under it, no Save before a change, no ⋯', /^Back to /.test(ch.tools[0]) && /^Project Ascent · CIAM migration/.test(ch.title) && ch.sub === 'Charter' && !ch.save && !ch.tools.includes('More'), JSON.stringify(ch));
89
89
  const fv = await p.evaluate(() => { const v = (f) => (document.querySelector(`#czViewer [data-f="${f}"]:not(.pc-dt)`) || {}).value; return { goal: v('goal'), owner: v('owner'), jira: v('jira'), why: v('why'), start: document.querySelector('#czViewer [data-pc="date"][data-f="start"] span').textContent, target: document.querySelector('#czViewer [data-pc="date"][data-f="target"] span').textContent, lim: document.querySelector('#czViewer .pc-lim').textContent, done: document.querySelector('#czViewer button.pc-ln.dn').textContent }; });
90
90
  ok('F every field as the record holds it; the span as days; "8 of 12"; the done ones fold into "2 done · …"', fv.goal === 'CIAM migration' && fv.owner === 'Wawan' && fv.jira === '' && /^Move every product/.test(fv.why) && fv.start === 'Sep 1, 2026' && fv.target === 'Jun 30, 2028' && fv.lim === '8 of 12' && fv.done === '2 done · Vendor picked, Charter approved', JSON.stringify(fv));
91
91
  const r0 = await rowsOf(p);
@@ -96,7 +96,7 @@ const waitsOf = (id) => ((R.all(rctx).find((p) => p.id === 'project-ascent') ||
96
96
  return { ctx, page, errors };
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
- const kids = (p) => p.evaluate(() => [...document.querySelectorAll('#ibBody [data-po-list] [data-po-id]')].map((r) => r.dataset.poId));
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
100
  const toast = (p) => p.evaluate(() => { const t = document.querySelector('#bdToast'); return t && !t.hidden ? t.textContent : ''; });
101
101
 
102
102
  /* B — the Board's initiative panel */
@@ -116,7 +116,7 @@ const waitsOf = (id) => ((R.all(rctx).find((p) => p.id === 'project-ascent') ||
116
116
  ok('B Move out is one press: one leave, no confirm; the toast says where it went and the milestone it left, with Undo',
117
117
  posts.length === n0 + 1 && posts[n0].body.leave === true && /Moved out of Project Ascent · now under IDPF · off 1 milestone/.test(t) && /Undo/.test(t), JSON.stringify({ t, posts: posts.slice(n0) }));
118
118
  ok('B the program no longer has it, and Legacy IdP off no longer waits on it', !members().includes('legacy-idp-sunset') && !waitsOf('legacy-idp-off').includes('legacy-idp-sunset'), JSON.stringify({ m: members(), w: waitsOf('legacy-idp-off') }));
119
- const after = await until(() => p.evaluate(() => { const r = [...document.querySelectorAll('#ibBody [data-key]')].find((x) => /Legacy IdP sunset/.test(x.textContent) && !x.closest('[data-po-list]')); const v = document.querySelector('#czViewer'); return r ? { sel: r.classList.contains('sel') || !!r.querySelector('.sel'), open: !!v && !v.hidden && /Legacy IdP sunset/.test(v.textContent) } : null; }));
119
+ const after = await until(() => p.evaluate(() => { const r = [...document.querySelectorAll('#ibBody [data-key]')].find((x) => /Legacy IdP sunset/.test(x.textContent) && !x.closest('[data-po-list]:not([data-po-list^="@"])')); const v = document.querySelector('#czViewer'); return r ? { sel: r.classList.contains('sel') || !!r.querySelector('.sel'), open: !!v && !v.hidden && /Legacy IdP sunset/.test(v.textContent) } : null; }));
120
120
  ok('B the row shows under its product, and the panel stays on it', !!after && after.open, JSON.stringify(after));
121
121
  if (process.env.SHOTS) await p.screenshot({ path: process.env.SHOTS + '/board-done.png' });
122
122
  await p.click('#bdToast .bd-undo');
@@ -5,6 +5,7 @@
5
5
  * (fixtures/program-ascent.js) and POST /api/programs/order is answered here, from the order the page sent, so a reload reads it back.
6
6
  * B Board: the program's rows follow its order; ✦ shows (with its dot) only while the dates disagree; the suggestion lists the date order with a
7
7
  * reason per row; ✓ applies it, Undo puts the order back; ✕ is "not now" until a date changes; drag by the grip; Alt + ↓ moves a row
8
+ * (the programs, products and a product's initiatives are Home's and the Board's own lists, [data-po-list^="@"]: sort-order-test.js)
8
9
  * H Home: the program group lists the same order; the grip moves a row there too; a phone holds the row, then drags it */
9
10
  const path = require('path');
10
11
  const { spawn } = require('child_process');
@@ -69,14 +70,14 @@ const routePrograms = async (page) => {
69
70
  await page.waitForTimeout(700);
70
71
  return { ctx, page, errors };
71
72
  };
72
- const kids = (p) => p.evaluate(() => [...document.querySelectorAll('#ibBody [data-po-list] [data-po-id]')].map((r) => r.dataset.poId));
73
+ const kids = (p) => p.evaluate(() => [...document.querySelectorAll('#ibBody [data-po-list]:not([data-po-list^="@"]) > [data-po-id]')].map((r) => r.dataset.poId));
73
74
  const sug = (p) => p.evaluate(() => { const b = document.querySelector('#ibBody .bt-pg [data-po-sug]'); return b ? { dot: !!b.querySelector('.po-nd'), label: b.getAttribute('aria-label') } : null; });
74
75
 
75
76
  /* B — the Board's stage track */
76
77
  {
77
78
  ORDER = ['legacy-idp-sunset', 'descope-parity']; // the PM's order, against the dates (Descope starts Oct 5, Legacy Oct 11)
78
79
  const { ctx, page: p, errors } = await board();
79
- ok('B the program\'s rows follow its order, each with a grip', (await kids(p)).join() === 'legacy-idp-sunset,descope-parity' && (await p.locator('#ibBody [data-po-id] [data-po-grip]').count()) === 2, JSON.stringify(await kids(p)));
80
+ ok('B the program\'s rows follow its order, each with a grip', (await kids(p)).join() === 'legacy-idp-sunset,descope-parity' && (await p.locator('#ibBody [data-po-list]:not([data-po-list^="@"]) > [data-po-id] [data-po-grip]').count()) === 2, JSON.stringify(await kids(p)));
80
81
  const s = await sug(p);
81
82
  ok('B ✦ shows in the program header while the dates disagree, with the blue dot', !!s && s.dot, JSON.stringify(s));
82
83
  await p.click('#ibBody .bt-pg [data-po-sug]');
@@ -107,7 +107,8 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
107
107
  ok('F a row folds', await until(() => p.evaluate(() => document.querySelector('#czViewer [data-czs-fold="tree"]').getAttribute('aria-expanded') === 'false')));
108
108
  await p.click('#czViewer [data-cz-vw="close"]');
109
109
  ok('P Close closes the Viewer', await until(() => p.evaluate(() => document.querySelector('#czViewer').hidden)));
110
- await p.reload();
110
+ ok('P Close takes the program out of the address (batch 14 item 7: the address follows the Viewer)', !new URL(p.url()).searchParams.get('program'), p.url());
111
+ await p.goto(BASE + '/premium-board.html?ws=idpf&program=project-ascent'); // the program's own link again
111
112
  await shown(p);
112
113
  ok('F the folds are kept after a reload', await until(async () => !(await isOpen(p, 'tree')) && await isOpen(p, 'ms')));
113
114
  await fold(p, 'tasks');
@@ -1,8 +1,9 @@
1
1
  /* pm/bd-acts.js — the Board's presses and the panels and popovers around them (initiative premium-uncovered-features, Board: BdActions, BdFilter,
2
2
  * BdSprint, BdPanel, BdDocs; built on premium-agreed-design's plain versions, whose function each designed one keeps). The routes are the ones the
3
3
  * console presses, behind the launch nonce:
4
- * a row's actions (BdActions) the ⋯ menu: Move to <next> with how much of the step is ready, Back to <prev> (asks why), Hold, Cancel (asks why,
5
- * the same chips as Decline), Archive; Resume, Reopen, Restore. POST /api/boards/move { board, id, to, why? } ·
4
+ * a row's actions (BdActions) the stage presses of the initiative's ⋯ (pm/ini-more.js, batch 14 item 5; open.more): Move to a stage (the next
5
+ * with how much of the step is ready), Back to <prev> (asks why), Hold, Resume, Cancel (asks why, the same chips as
6
+ * Decline); Reopen and Restore in Cancelled and archived. POST /api/boards/move { board, id, to, why? } ·
6
7
  * /api/lifecycle { initiative_id, state, reason, back? } · /api/boards/archive { board, id, archived, reason? }.
7
8
  * Each one is done at once, with Undo in the toast, which writes the opposite line through the same route.
8
9
  * Cancelled and archived the side panel: All, On hold, Cancelled, Archived, each with Resume, Reopen or Restore
@@ -73,28 +74,6 @@ const prevOf = (r) => ({ life: r.acts.life, reason: r.acts.reason, backDay: r.ac
73
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'));
74
75
  /** How much of the step is ready, for "Move to <next> · 2 of 4 ready": the parts or tickets counted toward its output. */
75
76
  const readyOf = (r) => { const t = r.track || {}; return t.count && /\d+ of \d+/.test(t.count) ? t.count.replace(/ parts?$/, '') + ' ready' : ''; };
76
- function menuItems(r) {
77
- const a = r.acts || { stages: [], stage: '' }, cur = a.stages.indexOf(a.stage), out = [];
78
- if (a.archived) return [['restore', 'Restore', I.back, 'Back in the lists, as it was']];
79
- if (a.life === 'cancelled') return [['reopen', 'Reopen', I.back, 'Back to ' + (a.stage || 'its stage') + ', active again']];
80
- if (!M().board.self && !a.life && cur >= 0) {
81
- if (a.stages[cur + 1]) out.push(['mv:' + (cur + 1), 'Move to ' + a.stages[cur + 1], I.go, readyOf(r)]);
82
- if (cur > 0) out.push(['back:' + (cur - 1), 'Back to ' + a.stages[cur - 1], I.back, '']);
83
- }
84
- out.push(['hr']);
85
- if (a.life === 'hold') out.push(['resume', 'Resume', I.play, '']); else out.push(['hold', 'Hold', I.hold, '']);
86
- out.push(['cancel', 'Cancel', I.x, ''], ['archive', 'Archive', I.arch, '']);
87
- return out;
88
- }
89
- function menuHtml(r) {
90
- const it = menuItems(r), stage = it.some(([k]) => /^(mv|back):/.test(k));
91
- const self = M().board.self ? '<p class="bd-amut bd-mnote">The stage of a PMOS-self initiative comes from the repository. It moves when the files land.</p>' : '';
92
- return `<p class="bd-mlbl" id="mnT">${esc(r.title)}</p>${self}${stage ? '<p class="bd-mlbl">Stage</p>' : ''}`
93
- + it.map(([k, l, ic, s]) => (k === 'hr' ? (stage ? '<div class="bd-hr"></div>' : '') : `<button type="button" class="bd-mi" role="menuitem" data-rowact="${esc(k)}" data-id="${esc(r.key)}">${SV(ic)}<span>${esc(l)}</span>${s && /ready$/.test(s) ? `<span class="k">${esc(s)}</span>` : ''}</button>`)).join('');
94
- }
95
- function openRowMenu(r, btn) {
96
- Pop.open(menuHtml(r), btn, { label: 'Actions for ' + r.title, role: 'menu', width: 270, align: 'right', cls: 'bd-menu', focus: '.bd-mi' });
97
- }
98
77
  function reasonHtml(r, kind, to) {
99
78
  const L = kind === 'cancel' ? WHY_NOT : BACK_WHY;
100
79
  const q = kind === 'cancel' ? 'Why cancel ' + r.title + '?' : 'Why back to ' + to + '?';
@@ -102,9 +81,24 @@ function reasonHtml(r, kind, to) {
102
81
  + `<div class="bd-arow"><button type="button" class="bd-btn sm solid" data-rowact="${kind === 'cancel' ? 'cancel-go' : 'back-go:' + to}" data-id="${esc(r.key)}">${kind === 'cancel' ? 'Cancel initiative' : 'Back to ' + esc(to)}</button><button type="button" class="bd-btn sm ghost" data-rowact="menu" data-id="${esc(r.key)}">Not now</button></div>`
103
82
  + `<p class="bd-amut">${kind === 'cancel' ? 'Keeps its stage, its work and its history. Reopen it any time.' : 'The reason is kept with the move in the board ledger.'}</p></div>`;
104
83
  }
84
+ /** The stages to move to from the initiative's ⋯ (Move to a stage): a later one moves at once with Undo, an earlier one asks why. */
85
+ function stageHtml(r) {
86
+ const a = r.acts, cur = a.stages.indexOf(a.stage);
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
+ }
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. */
91
+ function moreAct(r, k, btn) {
92
+ if (!r || !r.acts) return;
93
+ if (k === 'hold' || k === 'resume') { runRow(r, k, null); return; }
94
+ 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
+ if (k === 'stage') card(stageHtml(r), 'Move ' + r.title + ' to a stage', 'bd-menu');
96
+ else if (k === 'cancel') card(reasonHtml(r, 'cancel'), 'Cancel ' + r.title);
97
+ else if (k.startsWith('back:')) card(reasonHtml(r, 'back', k.slice(5)), 'Back to ' + k.slice(5));
98
+ }
105
99
  async function runRow(r, k, btn) {
106
100
  const a = r.acts, p = prevOf(r), m = $('#rowM');
107
- if (k === 'menu') { Pop.redraw(menuHtml(r)); return; }
101
+ if (k === 'menu') { Pop.close(true); return; } // Not now
108
102
  if (k.startsWith('mv:') || k.startsWith('back-go:')) {
109
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()) : '';
110
104
  if (!to) return;
@@ -392,7 +386,7 @@ async function setBack(r, input) {
392
386
  await done(res, 'On hold · ' + r.title + ' · back ' + md(day(v)), async () => { const u = await lifeBack(r, p); A.say(u && u.ok ? r.title + ' is back as it was.' : errOf(u)); await A.load(); });
393
387
  }
394
388
 
395
- export const open = { hold: openHold, new: (from) => Asks.openNew(from), asks: (from) => Asks.openAsks(from), row: openRowMenu, sprint: openSprint, metrics: openMetrics, find: openFind, filter: openFilter, gone: (from) => openGone(from, 'all'), bell: openBell, trend: openTrend, release: openRelease, doc: openDocPanel };
389
+ export const open = { more: moreAct, hold: openHold, new: (from) => Asks.openNew(from), asks: (from) => Asks.openAsks(from), sprint: openSprint, metrics: openMetrics, find: openFind, filter: openFilter, gone: (from) => openGone(from, 'all'), bell: openBell, trend: openTrend, release: openRelease, doc: openDocPanel };
396
390
  export const closeDoc = () => { docOpen = null; };
397
391
 
398
392
  /* ── the presses ─────────────────────────────────────────────────────────────────────────────────────────────── */