create-pmos 0.402.0 → 0.404.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/package.json +25 -30
  2. package/payload/AGENTS.md +2 -0
  3. package/payload/KIT-VERSION +1 -1
  4. package/payload/mods/pmos-cockpit/hooks/lib/session-facts.mjs +1 -1
  5. package/payload/planning/evals/eval-calibration.md +1 -1
  6. package/payload/planning/okrs/health-budgets.md +1 -1
  7. package/payload/state/discoveries.md +1 -1
  8. package/workspace/board-programs-test.js +32 -5
  9. package/workspace/briefing-premium-adddoc-test.js +28 -22
  10. package/workspace/briefing-premium-board-test.js +91 -73
  11. package/workspace/briefing-premium-calendar-2-test.js +23 -10
  12. package/workspace/briefing-premium-calendar-3-test.js +23 -19
  13. package/workspace/briefing-premium-calendar-test.js +19 -17
  14. package/workspace/briefing-premium-initiative-test.js +25 -12
  15. package/workspace/briefing-premium-insights-test.js +31 -18
  16. package/workspace/briefing-premium-metrics-test.js +8 -8
  17. package/workspace/briefing-premium-test.js +4 -3
  18. package/workspace/changelog.json +24 -0
  19. package/workspace/fixtures/premium-viewer-fixtures.js +24 -2
  20. package/workspace/guide/jira.md +38 -6
  21. package/workspace/guide/programs.md +2 -0
  22. package/workspace/home-rows-test.js +184 -0
  23. package/workspace/lib/briefing-premium-agent.js +3 -0
  24. package/workspace/lib/calendar-layers.js +8 -4
  25. package/workspace/lib/initiative-layout.js +4 -3
  26. package/workspace/lib/jira-cli.js +17 -12
  27. package/workspace/lib/jira-status.js +1 -1
  28. package/workspace/lib/jira-tickets.js +126 -24
  29. package/workspace/lib/meeting-files.js +58 -0
  30. package/workspace/lib/meeting-learn.js +139 -0
  31. package/workspace/lib/meeting-material.js +12 -5
  32. package/workspace/lib/notes.js +3 -0
  33. package/workspace/lib/program-chat.js +32 -0
  34. package/workspace/lib/routes-brief-page.js +8 -1
  35. package/workspace/lib/routes-calendar-views.js +24 -3
  36. package/workspace/lib/routes-meeting-material.js +38 -0
  37. package/workspace/lib/routes-meeting-points.js +23 -3
  38. package/workspace/package-lock.json +2 -2
  39. package/workspace/package.json +1 -1
  40. package/workspace/premium-board-actions-test.js +30 -24
  41. package/workspace/premium-chat-context-test.js +1 -1
  42. package/workspace/premium-chat-goal-view-test.js +1 -1
  43. package/workspace/premium-chat-viewer-test.js +1 -1
  44. package/workspace/premium-core-doc-issue-test.js +13 -7
  45. package/workspace/premium-discuss-landing-test.js +83 -0
  46. package/workspace/premium-link-suggest-test.js +103 -0
  47. package/workspace/premium-report-read-test.js +86 -82
  48. package/workspace/premium-vw-backlog-test.js +6 -5
  49. package/workspace/premium-vw-cal-test.js +46 -23
  50. package/workspace/premium-vw-item-test.js +8 -6
  51. package/workspace/premium-vw-jira-test.js +3 -2
  52. package/workspace/premium-vw-meet-test.js +122 -66
  53. package/workspace/premium-vw-notes-test.js +7 -6
  54. package/workspace/premium-vw-rec-test.js +14 -13
  55. package/workspace/premium-vw-slides-test.js +11 -5
  56. package/workspace/program-panel-test.js +64 -55
  57. package/workspace/public/pm/bd-acts.js +1 -1
  58. package/workspace/public/pm/bd-asks.js +22 -7
  59. package/workspace/public/pm/bd-ini-panel.js +232 -0
  60. package/workspace/public/pm/bd-pop.js +2 -2
  61. package/workspace/public/pm/bd-prog-panel.js +176 -191
  62. package/workspace/public/pm/cozy-board.css +5 -28
  63. package/workspace/public/pm/cozy-evui.js +4 -2
  64. package/workspace/public/pm/cozy-home-rows.css +54 -0
  65. package/workspace/public/pm/cozy-home.css +9 -0
  66. package/workspace/public/pm/cozy-insights.css +1 -2
  67. package/workspace/public/pm/cozy-mtg-present.css +160 -0
  68. package/workspace/public/pm/cozy-panel.css +11 -34
  69. package/workspace/public/pm/cozy-rec-pill.css +12 -0
  70. package/workspace/public/pm/cozy-rec-pill.js +46 -0
  71. package/workspace/public/pm/cozy-viewer.js +307 -43
  72. package/workspace/public/pm/cozy-vw-mtg.css +96 -94
  73. package/workspace/public/pm/cozy-vw-rp.css +40 -25
  74. package/workspace/public/pm/cozy-vw-shell.css +127 -0
  75. package/workspace/public/pm/cozy-xv.css +51 -0
  76. package/workspace/public/pm/cozy-xv.js +34 -0
  77. package/workspace/public/pm/goal-chat.js +1 -1
  78. package/workspace/public/pm/home-app.js +122 -58
  79. package/workspace/public/pm/home-chat.js +11 -2
  80. package/workspace/public/pm/home-day.js +64 -0
  81. package/workspace/public/pm/home-ini-model.js +1 -1
  82. package/workspace/public/pm/home-ini.js +197 -54
  83. package/workspace/public/pm/home-list.js +6 -14
  84. package/workspace/public/pm/home-mentions.js +187 -0
  85. package/workspace/public/pm/home-rec-row.js +67 -0
  86. package/workspace/public/pm/home-review.js +20 -10
  87. package/workspace/public/pm/home-task.js +19 -18
  88. package/workspace/public/pm/home-today.js +3 -3
  89. package/workspace/public/pm/premium-board.js +83 -235
  90. package/workspace/public/pm/premium-insights.js +118 -82
  91. package/workspace/public/pm/premium-mtg-present.js +408 -100
  92. package/workspace/public/pm/premium-mtg-replay.js +70 -10
  93. package/workspace/public/pm/premium-report-read.js +118 -63
  94. package/workspace/public/pm/premium-vw-cal.js +62 -34
  95. package/workspace/public/pm/premium-vw-mtg.js +348 -192
  96. package/workspace/public/pm/rec-state.js +63 -0
  97. package/workspace/public/pm/rp-parts.js +33 -8
  98. package/workspace/public/pm/tk-draft.js +107 -0
  99. package/workspace/public/pm/tk-model.js +134 -0
  100. package/workspace/public/pm/tk-send.js +124 -0
  101. package/workspace/public/pm/tk-tasks.css +120 -0
  102. package/workspace/public/premium-board.html +0 -1
  103. package/workspace/server.js +4 -2
  104. package/workspace/skills/jira-push.skill +3 -3
  105. package/workspace/test-lists/prd-to-jira.json +6 -0
  106. package/workspace/test-lists/program-chat.json +6 -0
  107. package/workspace/test-lists/viewer-home-rows.json +9 -0
  108. package/workspace/test-lists/viewer-meetings.json +9 -0
  109. package/workspace/test-lists/viewer-shell-a.json +15 -0
  110. package/workspace/tk-tasks-test.js +199 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-pmos",
3
- "version": "0.402.0",
3
+ "version": "0.404.0",
4
4
  "description": "Scaffold the PMOS portable kit — run the PMOS product-management workflow (initiative → lane-fit spec → contract → build → three gates, with work-type lanes for features, research, maintenance, incidents, and content) entirely inside your own repo, with all state as git-versioned files. Includes `workflow-sweep`, which audits the state every board derives from and separates real defects from work you simply have not done. `create-pmos workspace` also installs + launches the local Terminal Workspace GUI. No database, no network, no telemetry.",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -32,6 +32,30 @@
32
32
  "audit"
33
33
  ],
34
34
  "pmosChanges": [
35
+ {
36
+ "v": "0.404.0",
37
+ "at": "2026-10-24T05:07:12.902Z",
38
+ "f": 2,
39
+ "prs": [
40
+ {
41
+ "n": 1034,
42
+ "t": "Chat names the real program press; add Turn into a program to the initiative ⋯",
43
+ "s": "Chat names the real program press; add Turn into a program to the initiative ⋯"
44
+ }
45
+ ]
46
+ },
47
+ {
48
+ "v": "0.403.0",
49
+ "at": "2026-10-24T03:40:15.576Z",
50
+ "f": 2,
51
+ "prs": [
52
+ {
53
+ "n": 1033,
54
+ "t": "Viewer shell A, Home rows, meetings, reports and PRD to Jira (second kit)",
55
+ "s": "Viewer shell A, Home rows, meetings, reports and PRD to Jira (second kit)"
56
+ }
57
+ ]
58
+ },
35
59
  {
36
60
  "v": "0.402.0",
37
61
  "at": "2026-10-24T03:05:59.743Z",
@@ -262,35 +286,6 @@
262
286
  "s": "A task's Jira ticket from the stored reads, with Read it now"
263
287
  }
264
288
  ]
265
- },
266
- {
267
- "v": "0.384.0",
268
- "at": "2026-10-21T13:39:28.616Z",
269
- "f": 2,
270
- "prs": [
271
- {
272
- "n": 993,
273
- "t": "A Work item from the brief opens on its source",
274
- "s": "A Work item from the brief opens on its source"
275
- },
276
- {
277
- "n": 995,
278
- "t": "Claude's stored lead shows first in a popup, with Refresh",
279
- "s": "Claude's stored lead shows first in a popup, with Refresh"
280
- }
281
- ]
282
- },
283
- {
284
- "v": "0.383.0",
285
- "at": "2026-10-21T13:13:17.082Z",
286
- "f": 2,
287
- "prs": [
288
- {
289
- "n": 994,
290
- "t": "Share a viewer file as a password link that needs no Cloudflare login",
291
- "s": "Share a viewer file as a password link that needs no Cloudflare login"
292
- }
293
- ]
294
289
  }
295
290
  ]
296
291
  }
package/payload/AGENTS.md CHANGED
@@ -48,6 +48,8 @@ It refuses frontmatter, fenced and indented code, table rows, headings, delibera
48
48
  | `log_friction` / `log_discovery` | append to `pmos/state/discoveries.md` (ISO date, `#friction` tag where applicable) |
49
49
  | `get_agent_runs` / `get_friction` | read those same files (your episodic memory — consult before contracting) |
50
50
 
51
+ **Programs** (the level above initiatives, across products) are not an initiative key. A program is a line in `pmos/state/programs.jsonl`: `{"kind":"program",…}` is the charter and `{"kind":"member","program":"<id>","initiative":"<id>"}` puts an initiative in it. Never add `kind`, `program`, `programme`, `parent_program` or `parent_programme` to an initiative record: nothing reads them. You do not write `programs.jsonl`: the PM makes a program on the Board (an initiative's ⋯ → **Turn into a program**, or + → **New program**).
52
+
51
53
  State files are **append-only**: never rewrite or delete an existing line or initiative record; correct by appending. When a vendored skill names a hosted tool, apply this table — the skill bodies are single-sourced from the PMOS kernel and are not forked for file mode.
52
54
 
53
55
  ## Work-type lanes (D56)
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@76a70406
1
+ kernel-source: pmos@d588f370
2
2
  assembled: 2026-10-24
3
3
  mode: vendor
@@ -18,7 +18,7 @@ export const PRODUCT_STEPS = ['route', 'anchor', 'prototype', 'understand', 'spe
18
18
  export const PM_ARTIFACT_STEPS = ['route', 'brief', 'draft', 'review', 'approved', 'handoff'];
19
19
  export const KNOWN_STEPS = new Set([...PRODUCT_STEPS, ...PM_ARTIFACT_STEPS]);
20
20
  export const STEP_STATUSES = ['done', 'na', 'unknown', 'pending', 'blocked'];
21
- export const STAGES = ['intake', 'spec', 'contract', 'build', 'eval', 'accepted', 'brief', 'draft', 'review'];
21
+ export const STAGES = ['intake', 'spec', 'contract', 'build', 'eval', 'accepted', 'brief', 'draft', 'review', 'handoff'];
22
22
  export const LANES = ['feature', 'discovery', 'chore', 'incident', 'content', 'prototype'];
23
23
  export const PROFILES = ['product-code', 'pm-artifacts'];
24
24
 
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Eval calibration log"
4
4
  description: "Append-only record of every PM override of an evaluator verdict."
5
- generated: {by: process:create-pmos, at: "2026-10-24T03:05:56Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-24T05:07:10Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Health budgets"
4
4
  description: "Closed registry of health-budget anchors (D59), edited only by the PM."
5
- generated: {by: process:create-pmos, at: "2026-10-24T03:05:56Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-24T05:07:10Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Discoveries and friction log"
4
4
  description: "Append-only record of what runs discovered and where the process rubbed."
5
- generated: {by: process:create-pmos, at: "2026-10-24T03:05:56Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-24T05:07:10Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -81,8 +81,8 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
81
81
  ok('G there is no "Not in a program" group, and Programs first draws no grouping chip (the choice lives in Filter)', !/Not in a program/.test(tr.text) && tr.grp);
82
82
 
83
83
  await p.click('#ibBody .bt-pg [data-prog]');
84
- ok('O pressing the band dispatches bd:program with the program id and opens no initiative panel', (await events(p)).join() === 'project-ascent' && await p.evaluate(() => document.querySelector('#peek').hidden), JSON.stringify(await events(p)));
85
- await p.keyboard.press('Escape'); await p.waitForFunction(() => { const k = document.querySelector('#ppPeek'); return !k || k.hidden; });
84
+ ok('O pressing the band dispatches bd:program with the program id and opens no initiative panel', (await events(p)).join() === 'project-ascent' && await p.evaluate(() => !/Initiative/.test(((window.czViewer && window.czViewer.current()) || {}).kind || '')), JSON.stringify(await events(p)));
85
+ await p.keyboard.press('Escape'); await p.waitForFunction(() => { const v = document.querySelector('#czViewer'); return !v || v.hidden; });
86
86
 
87
87
  await p.click('#ibBody .bt-pg [data-fold]');
88
88
  const f1 = await p.evaluate(() => ({ kids: document.querySelectorAll('#ibBody .bt-kid').length, band: !!document.querySelector('#ibBody .bt-pg'), exp: document.querySelector('#ibBody .bt-pg [data-fold]').getAttribute('aria-expanded'), st: localStorage.getItem('pmos.board.fold') }));
@@ -138,7 +138,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
138
138
  await p.click('#ibBody .bd-lh.pd [data-fold]');
139
139
  ok('K a product lane folds to its head', await p.evaluate(() => [...document.querySelectorAll('#ibBody .bd-kc .bd-bc .t')].every((b) => b.textContent !== 'Usage-based billing') && !!document.querySelector('#ibBody .bd-lh.pd')));
140
140
  await p.click('#ibBody .bd-lh.pg [data-prog]');
141
- ok('O pressing the program swimlane dispatches bd:program and nothing else', (await events(p)).join() === 'project-ascent' && await p.evaluate(() => document.querySelector('#peek').hidden));
141
+ ok('O pressing the program swimlane dispatches bd:program and nothing else', (await events(p)).join() === 'project-ascent' && await p.evaluate(() => !/Initiative/.test(((window.czViewer && window.czViewer.current()) || {}).kind || '')));
142
142
  ok('the Kanban threw nothing', !errors.length, errors.join('\n'));
143
143
  await ctx.close();
144
144
  }
@@ -161,9 +161,10 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
161
161
  ok('T the program\'s initiatives sit under it as one-line rows: a status dot and the name', t.kids.join() === 'Legacy IdP sunset,Descope feature parity' && t.oneLine, JSON.stringify(t));
162
162
  ok('T a legend in the chip row names done, planned, the program milestone, Deliver or Evaluate and today', /Done in Jira/.test(t.lgd) && /Planned/.test(t.lgd) && /Program milestone/.test(t.lgd) && /Deliver or Evaluate/.test(t.lgd) && /Today/.test(t.lgd), t.lgd);
163
163
  await p.click('#ibBody .tg-pg .tg-pgo');
164
- await p.keyboard.press('Escape'); await p.waitForFunction(() => { const k = document.querySelector('#ppPeek'); return !k || k.hidden; });
164
+ // the program opens in the floating Viewer (shell A), which sits over the right of the timeline; close it before the next press
165
+ await p.keyboard.press('Escape'); await p.waitForFunction(() => { const v = document.querySelector('#czViewer'); return !v || v.hidden; });
165
166
  await p.click('#ibBody .tg-pg .tg-clu');
166
- ok('O the program row and its counted diamond dispatch bd:program and nothing else', (await events(p)).join() === 'project-ascent,project-ascent' && await p.evaluate(() => document.querySelector('#peek').hidden));
167
+ ok('O the program row and its counted diamond dispatch bd:program and nothing else', (await events(p)).join() === 'project-ascent,project-ascent' && await p.evaluate(() => !/Initiative/.test(((window.czViewer && window.czViewer.current()) || {}).kind || '')));
167
168
  ok('the timeline threw nothing', !errors.length, errors.join('\n'));
168
169
  await ctx.close();
169
170
  }
@@ -222,5 +223,31 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
222
223
  ok('Z on a phone the program is a head card with its next milestone, and nothing scrolls sideways', await R.page.evaluate(() => document.documentElement.scrollWidth <= innerWidth + 1 && !!document.querySelector('#ibBody .bt-pg .bd-pm') && getComputedStyle(document.querySelector('#ibBody .bt-pg .bt-spread')).display === 'none'));
223
224
  await R.ctx.close();
224
225
  }
226
+
227
+ /* P7 Turn into a program: the initiative's ⋯ offers it when the initiative is in no program, presses POST /api/programs/turn and opens
228
+ * the new program (bug 2026-10-24: the press was never on the page, so "Set Project Ascent as Program" had nowhere to go) */
229
+ {
230
+ const { ctx, page: p, errors } = await open({ programs: [] });
231
+ let sent = null;
232
+ await p.route('**/api/programs/turn', (r) => { sent = JSON.parse(r.request().postData() || '{}'); r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, program: { id: 'legacy-idp-sunset' } }) }); });
233
+ const menu = async () => { 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())); };
234
+ await p.click('#ibBody .bt-nm >> text=Legacy IdP sunset');
235
+ await p.waitForSelector('#czViewer:not([hidden])');
236
+ const m = await menu();
237
+ ok('P7 an initiative in no program: ⋯ offers Turn into a program, after the plan dates', m.indexOf('Turn into a program') === m.indexOf('Change the plan dates') + 1, JSON.stringify(m));
238
+ await p.click('.cz-vw-menu [role="menuitem"] >> text=Turn into a program');
239
+ await p.waitForTimeout(400);
240
+ const ev = await events(p);
241
+ ok('P7 the press sends the initiative and its title, then opens the new program', sent && sent.initiative && sent.title === 'Legacy IdP sunset' && ev.includes('legacy-idp-sunset'), JSON.stringify({ sent, ev }));
242
+ ok('P7 the page threw nothing', !errors.length, errors.join('\n'));
243
+ await ctx.close();
244
+ const R = await open();
245
+ await R.page.click('#ibBody .bt-kid .bt-nm >> text=Legacy IdP sunset');
246
+ await R.page.waitForSelector('#czViewer:not([hidden])');
247
+ await R.page.click('#czViewer [data-cz-vw="more"]'); await R.page.waitForTimeout(80);
248
+ const m2 = await R.page.evaluate(() => [...document.querySelectorAll('.cz-vw-menu [role="menuitem"]')].map((b) => b.textContent.trim()));
249
+ ok('P7 an initiative that is in a program has no Turn into a program', m2.length > 0 && !m2.includes('Turn into a program'), JSON.stringify(m2));
250
+ await R.ctx.close();
251
+ }
225
252
  finish();
226
253
  })();
@@ -35,7 +35,7 @@ const CUSTOM = [
35
35
  const PAGES = {
36
36
  board: { file: '/premium-board.html', api: '**/api/board-premium*', scope: 'board:w1', mk: (custom) => BP.build(BF.facts({ custom })), ready: '#ibBody .ini2', btn: '#addDoc', qs: '?theme=' },
37
37
  // the initiative is a layout inside Home (premium-agreed-design): Add a document is in its Overview, a minimal form in the Viewer (Waiting for design)
38
- initiative: { file: '/premium.html', api: '**/api/initiative-premium*', scope: 'initiative:self-serve-v2', mk: (custom) => IP.build(IF.facts({ custom })), ready: '.hm-card [data-hm-ov]', btn: '#czViewer [data-ov-adddoc]', qs: '?ini=self-serve-v2&ws=w1&board=w1&theme=' },
38
+ initiative: { file: '/premium.html', api: '**/api/initiative-premium*', scope: 'initiative:self-serve-v2', mk: (custom) => IP.build(IF.facts({ custom })), ready: '.hm-card [data-hm-ov]', btn: '#czViewer [data-hi-v="docs"]', qs: '?ini=self-serve-v2&ws=w1&board=w1&theme=' },
39
39
  };
40
40
 
41
41
  (async () => {
@@ -64,8 +64,11 @@ const PAGES = {
64
64
  return { ctx, page, errors, posts, up, calls: () => calls, setCustom: (c) => { current = c; }, reply: (a) => { reply = a; } };
65
65
  };
66
66
  const txt = (p, s) => p.evaluate((q) => (document.querySelector(q) || {}).textContent || '', s);
67
+ const viaMore = async (pg, label) => { await pg.click('#czViewer:not([hidden]) [data-cz-vw="more"]'); await until(() => pg.evaluate(() => !!document.querySelector('#czViewer .cz-vw-menu'))); await pg.click(`#czViewer .cz-vw-menu [role="menuitem"]:has(> span:first-child:text-is("${label}"))`); }; // the Overview's other views, Open the full record and Sprint sit under ⋯ (XvATasks)
67
68
  // the Overview opens on Tasks; Add a document is on its Documents view (premium-uncovered-features, canvas InDocs)
68
- async function docsView(page) { if (await until(() => page.evaluate(() => !!document.querySelector('#czViewer [data-hi-view="docs"]')), 20000)) await page.click('#czViewer [data-hi-view="docs"]'); }
69
+ // Documents is shell A (XvADocs): Add a document is under its ⋯, with Group by and Show
70
+ async function addDoc(page) { await page.click('#czViewer [data-cz-vw="more"]'); await page.click('#czViewer .cz-vw-menu button:has-text("Add a document")'); }
71
+ async function docsView(page) { if (await until(() => page.evaluate(() => !!document.querySelector('#czViewer:not([hidden]) [data-hi-v]')), 20000)) await (async (pg) => { if (await pg.$('#czViewer [data-hi-view="docs"]')) await pg.click('#czViewer [data-hi-view="docs"]'); else await viaMore(pg, 'Documents'); })(page); }
69
72
 
70
73
  /* the Board (premium-uncovered-features, BdDocs): the Documents tab is a table with an Add a document form in the side panel;
71
74
  the same route, the same fields, the same refusals */
@@ -75,37 +78,37 @@ const PAGES = {
75
78
  if (!A.up) return finish(1);
76
79
  ok('board A1 the Documents tab has an Add a document button', await p.evaluate(() => { const b = document.querySelector('#docBody #addDoc'); return !!b && b.textContent === 'Add a document'; }));
77
80
  await p.click('#addDoc');
78
- const form = await until(() => p.evaluate(() => { const f = document.querySelector('#peek form[data-form="adddoc"]'); return f ? { title: document.querySelector('#pkTitle').textContent, seg: [...f.querySelectorAll('.bd-rad span')].map((x) => x.textContent), kinds: [...f.kind.options].map((o) => o.textContent), uOff: f.url.disabled, note: f.querySelector('.bd-amut').textContent, dlg: !!document.querySelector('#dlg.on') } : null; }));
81
+ const form = await until(() => p.evaluate(() => { const f = document.querySelector('#czViewer form[data-form="adddoc"]'); return f ? { title: document.querySelector('#czViewer .cz-vw-title').textContent, seg: [...f.querySelectorAll('.bd-rad span')].map((x) => x.textContent), kinds: [...f.kind.options].map((o) => o.textContent), uOff: f.url.disabled, note: f.querySelector('.bd-amut').textContent, dlg: !!document.querySelector('#dlg.on') } : null; }));
79
82
  ok('board A1 the side panel has the dialog\'s fields, and the old dialog stays shut', !!form && form.title === 'Add a document' && form.seg.join() === 'PMOS drafts it,I write it' && form.kinds.join() === 'In PMOS,Confluence,Google Docs,Google Slides' && form.uOff && !form.dlg, JSON.stringify(form));
80
83
  ok('board A7 it says the document is saved and the linked page is not read', !!form && /saved on the board's record/.test(form.note) && /does not read or sync/.test(form.note), form && form.note);
81
- const go = '#peek form[data-form="adddoc"] [type="submit"]';
84
+ const go = '#czViewer form[data-form="adddoc"] [type="submit"]';
82
85
  await p.click(go); await sleep(120);
83
86
  ok('board A4 an empty title is refused in the panel and posts nothing', /Give the document a title/.test(await txt(p, '#formM')) && A.posts.length === 0);
84
- await p.fill('#peek input[name="title"]', 'UAT plan'); await p.selectOption('#peek select[name="kind"]', 'Confluence');
85
- ok('board A1 the address field opens for a link kind', await p.evaluate(() => !document.querySelector('#peek input[name="url"]').disabled));
87
+ await p.fill('#czViewer input[name="title"]', 'UAT plan'); await p.selectOption('#czViewer select[name="kind"]', 'Confluence');
88
+ ok('board A1 the address field opens for a link kind', await p.evaluate(() => !document.querySelector('#czViewer input[name="url"]').disabled));
86
89
  await p.click(go); await sleep(120);
87
90
  ok('board A4 a link kind with no address is refused in the panel and posts nothing', /Paste the address of the Confluence page/.test(await txt(p, '#formM')) && A.posts.length === 0);
88
91
  A.reply({ status: 409, body: { ok: false, error: '“UAT plan” is already on this board.' } });
89
- await p.fill('#peek input[name="url"]', 'https://example.atlassian.net/wiki/x'); await p.click(go); await sleep(300);
90
- ok('board A4 a refusal from the route is shown in the panel, which stays open', /already on this/.test(await txt(p, '#formM')) && await p.evaluate((g) => !document.querySelector('#peek').hidden && !document.querySelector(g).disabled, go));
92
+ await p.fill('#czViewer input[name="url"]', 'https://example.atlassian.net/wiki/x'); await p.click(go); await sleep(300);
93
+ ok('board A4 a refusal from the route is shown in the panel, which stays open', /already on this/.test(await txt(p, '#formM')) && await p.evaluate((g) => !document.querySelector('#czViewer').hidden && !document.querySelector(g).disabled, go));
91
94
  A.reply({ status: 200, body: { ok: true } }); const calls0 = A.calls();
92
- await p.check('#peek input[name="writer"][value="you"]'); await p.click(go); await sleep(500);
95
+ await p.check('#czViewer input[name="writer"][value="you"]'); await p.click(go); await sleep(500);
93
96
  const last = A.posts[A.posts.length - 1], mint = await T.nonce(BASE);
94
97
  const want = { ws: 'w1', scope: P.scope, title: 'UAT plan', writer: 'you', kind: 'Confluence', url: 'https://example.atlassian.net/wiki/x' };
95
98
  ok('board A3 the press posts the entered fields to the one route, with the launch nonce and no writer field', last && last.path === '/api/custom-docs/add' && JSON.stringify(Object.keys(last.body).sort()) === JSON.stringify(Object.keys(want).sort()) && Object.keys(want).every((k) => last.body[k] === want[k] || k === 'ws') && !!mint && last.headers['x-pmos-nonce'] === mint && !['by', 'via', 'at', 'actor', 'pm', 'nonce'].some((k) => k in last.body), JSON.stringify(last && last.body));
96
99
  ok('board A3 nothing else was posted', A.posts.every((x) => x.path === '/api/custom-docs/add'));
97
- ok('board A1 the panel closes, the page reads again and says it was added', A.calls() > calls0 && await p.evaluate(() => document.querySelector('#peek').hidden && /is added to the board's documents/.test(document.querySelector('#bdToast').textContent)));
100
+ ok('board A1 the panel closes, the page reads again and says it was added', A.calls() > calls0 && await p.evaluate(() => document.querySelector('#czViewer').hidden && /is added to the board's documents/.test(document.querySelector('#bdToast').textContent)));
98
101
  A.setCustom(CUSTOM); await p.reload(); await until(() => p.evaluate((s) => !!document.querySelector(s), P.ready), 20000); await p.click('#tabDocs'); await sleep(300);
99
102
  const rows = await p.evaluate(() => [...document.querySelectorAll('#docBody .bd-dt[data-docrow]')].map((r) => { const c = r.querySelectorAll('[role="cell"]'); return { id: r.dataset.docrow, t: r.querySelector('[data-opendoc]').textContent, s: c[1].textContent, when: c[2].textContent, by: c[3].textContent, btn: r.querySelectorAll('button').length }; }));
100
103
  const uat = rows.find((r) => r.t === 'UAT plan'), con = rows.find((r) => r.t === 'Contract');
101
104
  ok('board A5 an unlinked document reads Not started with the date it was added, who writes it, and no press but its title', uat && uat.s === 'Not started' && /18 Oct/.test(uat.when) && /You write it/.test(uat.by) && uat.btn === 1, JSON.stringify(uat));
102
105
  ok('board A5 a linked document reads Linked and has no press but its title', con && con.s === 'Linked' && con.btn === 1, JSON.stringify(con));
103
106
  await p.click(`#docBody [data-opendoc="${con.id}"]`);
104
- ok('board A5 a linked document opens with its address as text', await until(() => p.evaluate(() => { const o = document.querySelector('#peek'); return !o.hidden && /Lives in Confluence: https:\/\/example\.atlassian\.net/.test(o.textContent) && !o.querySelector('a[href^="https://example"]'); })), await txt(p, '#peek'));
107
+ ok('board A5 a linked document opens with its address as text', await until(() => p.evaluate(() => { const o = document.querySelector('#czViewer'); return !o.hidden && /Lives in Confluence: https:\/\/example\.atlassian\.net/.test(o.textContent) && !o.querySelector('a[href^="https://example"]'); })), await txt(p, '#czViewer'));
105
108
  ok('board no page error', A.errors.length === 0, A.errors.join(' | '));
106
109
  await A.ctx.close();
107
110
  const N = await open('board', { w: 390, h: 844 }); await N.page.click('#addDoc'); await sleep(300);
108
- const fl = await N.page.evaluate(() => ({ over: document.documentElement.scrollWidth > innerWidth + 1, add: Math.round(document.querySelector('#addDoc').getBoundingClientRect().height), go: Math.round(document.querySelector('#peek form[data-form="adddoc"] [type="submit"]').getBoundingClientRect().height) }));
111
+ const fl = await N.page.evaluate(() => ({ over: document.documentElement.scrollWidth > innerWidth + 1, add: Math.round(document.querySelector('#addDoc').getBoundingClientRect().height), go: Math.round(document.querySelector('#czViewer form[data-form="adddoc"] [type="submit"]').getBoundingClientRect().height) }));
109
112
  ok('board A8 at 390 px no sideways scroll with the form open, and its buttons are 44 px', !fl.over && fl.add >= 44 && fl.go >= 44, JSON.stringify(fl));
110
113
  await N.ctx.close();
111
114
  }
@@ -117,8 +120,9 @@ const PAGES = {
117
120
  const dlgShut = () => p.evaluate(() => { const d = document.querySelector('#dlg'); return !d || !d.classList.contains('on'); });
118
121
  ok(`${kind} 0 the page draws (Home with the initiative, its Overview open)`, A.up);
119
122
  if (!A.up) return finish(1);
120
- ok(`${kind} A1 the Overview's Documents view has an Add a document button`, await p.evaluate((s) => { const b = document.querySelector(s); return !!b && /Add a document/.test(b.textContent + ' ' + (b.getAttribute('aria-label') || '')) && !b.hidden; }, P.btn));
121
- await p.click(P.btn); await until(() => p.evaluate(() => !!document.querySelector('#czViewer #adT')));
123
+ await p.click('#czViewer [data-cz-vw="more"]');
124
+ ok(`${kind} A1 the Overview's Documents view has Add a document under ⋯`, await p.evaluate(() => [...document.querySelectorAll('#czViewer .cz-vw-menu button')].some((b) => /^Add a document/.test(b.textContent.trim()))));
125
+ await p.click('#czViewer .cz-vw-menu button:has-text("Add a document")'); await until(() => p.evaluate(() => !!document.querySelector('#czViewer #adT')));
122
126
  const form = await p.evaluate((V) => ({ open: !!document.querySelector(V + ' #adT'), title: (document.querySelector('#czVwTitle') || {}).textContent || '', wait: !!document.querySelector(V + ' .hx-wait'), phase: !!document.querySelector(V + ' #adPh'), seg: [...document.querySelectorAll(V + ' #adW button')].map((b) => b.textContent), kinds: [...document.querySelectorAll(V + ' #adK option')].map((o) => o.textContent), uOff: document.querySelector(V + ' #adU').disabled, note: (document.querySelector(V + ' [data-ad-note]') || {}).textContent || '' }), F);
123
127
  ok(`${kind} A1 the form in the Viewer has the dialog's fields, with no "Waiting for design" tag (premium-uncovered-features), and the old dialog stays shut`, form.open && /^Add a document/.test(form.title) && !form.wait && form.phase === ini && form.seg.join() === 'PMOS drafts it,I write it' && form.kinds.join() === 'In PMOS,Confluence,Google Docs,Google Slides' && form.uOff && await dlgShut(), JSON.stringify(form));
124
128
  ok(`${kind} A7 the form says the document is saved and the linked page is not read`, /saved on the (board|initiative)'s record/.test(form.note) && /does not read or sync/.test(form.note), form.note);
@@ -139,24 +143,25 @@ const PAGES = {
139
143
  if (ini) want.phase = 'Plan';
140
144
  ok(`${kind} A3 the press posts the entered fields to the one route, with the launch nonce and no writer field`, last && last.path === '/api/custom-docs/add' && JSON.stringify(Object.keys(last.body).sort()) === JSON.stringify(Object.keys(want).sort()) && Object.keys(want).every((k) => last.body[k] === want[k] || k === 'ws') && !!mint && last.headers['x-pmos-nonce'] === mint && !['by', 'via', 'at', 'actor', 'pm', 'nonce'].some((k) => k in last.body), JSON.stringify(last && last.body));
141
145
  ok(`${kind} A3 nothing else was posted`, A.posts.every((x) => x.path === '/api/custom-docs/add'));
142
- ok(`${kind} A1 the form closes, the initiative is read again and its Overview comes back`, await until(() => A.calls() > calls0) && await until(() => p.evaluate(() => !document.querySelector('#czViewer #adT') && !!document.querySelector('#czViewer [data-ov-adddoc]'))));
146
+ ok(`${kind} A1 the form closes, the initiative is read again and its Overview comes back`, await until(() => A.calls() > calls0) && await until(() => p.evaluate(() => !document.querySelector('#czViewer #adT') && !!document.querySelector('#czViewer [data-hi-v="docs"]'))));
143
147
  A.setCustom(CUSTOM.map((d) => Object.assign({}, d, { scope: P.scope }))); await p.reload();
144
148
  await until(() => p.evaluate((s) => !!document.querySelector(s), P.ready), 20000); await p.click(P.ready); await docsView(p);
145
149
  await until(() => p.evaluate(() => !!document.querySelector('#czViewer [data-ov-doc="custom:cd-2"]')), 20000);
146
150
  // a row: the title, its state pill, then what it is (when, who writes it, where it lives) and the link as text (InDocs)
147
- const rows = await p.evaluate(() => [...document.querySelectorAll('#czViewer [data-ov-doc]')].map((r) => ({ t: (r.querySelector('b') || {}).textContent || '', meta: [(r.querySelector('.hi-pill') || {}).textContent || '', (r.querySelector('em') || {}).textContent || ''].join(' · '), small: (r.querySelector('small') || {}).textContent || '', btn: r.querySelectorAll('button:not([disabled]):not([data-ov-none])').length, none: !!r.querySelector('[data-ov-none]') }))); // a document with no file says so when pressed (testing fixes); it opens nothing
151
+ // shell A (XvADocs): a row is one press, its title then one quiet line (when, who writes it, the state) and the link as text
152
+ const rows = await p.evaluate(() => [...document.querySelectorAll('#czViewer [data-ov-doc]')].map((r) => { const w = r.querySelector('.w') || r, sub = [...w.querySelectorAll(':scope > span')].map((x) => x.textContent); return { t: (w.firstChild && w.firstChild.nodeType === 3 ? w.firstChild.textContent : '').trim(), meta: sub.filter((x) => !/: https?:/.test(x)).join(' · '), small: sub.filter((x) => /: https?:/.test(x)).join(' '), btn: r.querySelectorAll('button:not([disabled]):not([data-ov-none])').length, none: !!r.querySelector('[data-ov-none]') }; })); // a document with no file says so when pressed (testing fixes); it opens nothing
148
153
  const uat = rows.find((r) => r.t === 'UAT plan'), con = rows.find((r) => r.t === 'Contract');
149
- ok(`${kind} A5 an unlinked document reads Not started with the date it was added and no press`, uat && /^Not started/.test(uat.meta) && /added 18 Oct/.test(uat.meta) && /You write it/.test(uat.meta) && uat.btn === 0 && uat.none, JSON.stringify(uat));
150
- ok(`${kind} A5 a linked document reads Linked, shows its address as text and has no press`, con && /^Linked/.test(con.meta) && /Confluence: https:\/\/example\.atlassian\.net/.test(con.small) && con.btn === 0 && !/Up to date/.test(con.meta), JSON.stringify(con));
154
+ ok(`${kind} A5 an unlinked document reads Not started with the date it was added and no press`, uat && /Not started/.test(uat.meta) && /added 18 Oct/.test(uat.meta) && /You write it/.test(uat.meta) && uat.btn === 0 && uat.none, JSON.stringify(uat));
155
+ ok(`${kind} A5 a linked document reads Linked, shows its address as text and has no press`, con && /Linked/.test(con.meta) && /Confluence: https:\/\/example\.atlassian\.net/.test(con.small) && con.btn === 0 && !/Up to date/.test(con.meta), JSON.stringify(con));
151
156
  const sum = await txt(p, '#czViewer [data-ov-dsum]');
152
157
  ok(`${kind} A5 the summary counts one linked and the up-to-date ones`, /1\s*linked/.test(sum) && /up to date/.test(sum), sum);
153
158
  ok(`${kind} A5 a linked document is listed apart from the up-to-date ones (no Up to date on it, no Open press)`, !!con && !/Up to date/.test(con.meta) && con.btn === 0); // the old filter chips are not in the Agreed design
154
- await p.click(P.btn); await until(() => p.evaluate(() => !!document.querySelector('#czViewer #adT')));
159
+ await addDoc(p); await until(() => p.evaluate(() => !!document.querySelector('#czViewer #adT')));
155
160
  await p.keyboard.press('Escape'); await sleep(250);
156
161
  ok(`${kind} A8 Escape closes the form`, await p.evaluate(() => !document.querySelector('#czViewer #adT')));
157
162
  ok(`${kind} no page error`, A.errors.length === 0, A.errors.join(' | '));
158
163
  await A.ctx.close();
159
- const N = await open(kind, { w: 390, h: 844 }); await N.page.click(P.btn); await until(() => N.page.evaluate(() => !!document.querySelector('#czViewer #adT')));
164
+ const N = await open(kind, { w: 390, h: 844 }); await addDoc(N.page); await until(() => N.page.evaluate(() => !!document.querySelector('#czViewer #adT')));
160
165
  const floors = await N.page.evaluate(() => { const h = (s) => Math.round(document.querySelector('#czViewer ' + s).getBoundingClientRect().height); return { go: h('#adGo'), no: h('#adNo'), t: h('#adT'), k: h('#adK'), w: h('#adW button'), fs: getComputedStyle(document.querySelector('#czViewer #adT')).fontSize }; });
161
166
  ok(`${kind} A8 at 390 px the presses and fields are at least 44 px and the fields do not zoom the page`, [floors.go, floors.no, floors.t, floors.k, floors.w].every((v) => v >= 44) && parseFloat(floors.fs) >= 16, JSON.stringify(floors));
162
167
  ok(`${kind} A8 no sideways scroll at 390 px with the form open`, await N.page.evaluate(() => document.documentElement.scrollWidth <= innerWidth + 1 && document.querySelector('#czViewer').getBoundingClientRect().right <= innerWidth + 1));
@@ -187,8 +192,9 @@ const PAGES = {
187
192
  * the solid colour. The colours are read from the page's own tokens, so a theme is checked against itself. */
188
193
  for (const [w, h] of [[1280, 900], [390, 844]]) for (const th of ['light', 'dark']) {
189
194
  const R = await open('initiative', { w, h, theme: th });
190
- const btn = await R.page.evaluate(() => { const cs = getComputedStyle(document.querySelector('#czViewer [data-ov-adddoc]')); return { ff: cs.fontFamily, br: cs.borderRadius }; });
191
- await R.page.click('#czViewer [data-ov-adddoc]'); await until(() => R.page.evaluate(() => !!document.querySelector('#czViewer #adT')));
195
+ await R.page.click('#czViewer [data-cz-vw="more"]'); // the press is a ⋯ menu item now (shell A): its font, and the round ⋯ it hangs from
196
+ const btn = await R.page.evaluate(() => { const cs = getComputedStyle(document.querySelector('#czViewer .cz-vw-menu button')), m = getComputedStyle(document.querySelector('#czViewer [data-cz-vw="more"]')); return { ff: cs.fontFamily, br: m.borderRadius }; });
197
+ await R.page.click('#czViewer .cz-vw-menu button:has-text("Add a document")'); await until(() => R.page.evaluate(() => !!document.querySelector('#czViewer #adT')));
192
198
  const g = await R.page.evaluate(() => {
193
199
  const tok = (v, prop) => { const x = document.createElement('i'); x.style.setProperty(prop, 'var(' + v + ')'); document.querySelector('#czViewer').appendChild(x); const c = getComputedStyle(x)[prop === 'color' ? 'color' : 'backgroundColor']; x.remove(); return c; };
194
200
  const cs = (s) => getComputedStyle(document.querySelector(s));