create-pmos 0.422.0 → 0.424.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 (102) hide show
  1. package/package.json +25 -25
  2. package/payload/KIT-VERSION +2 -2
  3. package/payload/planning/evals/eval-calibration.md +1 -1
  4. package/payload/planning/okrs/health-budgets.md +1 -1
  5. package/payload/state/discoveries.md +1 -1
  6. package/payload/state/log.md +1 -1
  7. package/workspace/board-programs-test.js +28 -0
  8. package/workspace/briefing-premium-adddoc-test.js +1 -1
  9. package/workspace/briefing-premium-board-test.js +12 -10
  10. package/workspace/briefing-premium-initiative-test.js +30 -38
  11. package/workspace/briefing-premium-products-test.js +16 -3
  12. package/workspace/changelog.json +24 -0
  13. package/workspace/guide/briefing-premium.md +1 -1
  14. package/workspace/guide/claude-proposes.md +37 -0
  15. package/workspace/guide/home.md +9 -2
  16. package/workspace/guide/index.md +1 -0
  17. package/workspace/guide/programs.md +1 -0
  18. package/workspace/guide/workflows.md +5 -1
  19. package/workspace/home-pill-test.js +138 -0
  20. package/workspace/ini-workflow-test.js +4 -4
  21. package/workspace/lib/board-premium.js +3 -2
  22. package/workspace/lib/custom-docs.js +65 -3
  23. package/workspace/lib/engine/boards.js +25 -2
  24. package/workspace/lib/headless.js +14 -1
  25. package/workspace/lib/initiative-writer.js +63 -1
  26. package/workspace/lib/plan-items.js +36 -5
  27. package/workspace/lib/pmos-verbs.js +3 -0
  28. package/workspace/lib/programs.js +11 -3
  29. package/workspace/lib/proposal-runs.js +148 -0
  30. package/workspace/lib/proposals.js +370 -0
  31. package/workspace/lib/propose-cli.js +96 -0
  32. package/workspace/lib/route-modules.js +2 -0
  33. package/workspace/lib/routes-board-premium.js +33 -0
  34. package/workspace/lib/routes-boards.js +50 -10
  35. package/workspace/lib/routes-initiatives.js +12 -0
  36. package/workspace/lib/routes-proposals.js +325 -0
  37. package/workspace/lib/routes-task-links.js +336 -0
  38. package/workspace/lib/split-merge-suggest.js +162 -0
  39. package/workspace/lib/split-merge.js +379 -0
  40. package/workspace/lib/task-cli.js +58 -5
  41. package/workspace/lib/task-items.js +14 -2
  42. package/workspace/lib/task-links.js +422 -0
  43. package/workspace/package-lock.json +2 -2
  44. package/workspace/package.json +1 -1
  45. package/workspace/premium-board-actions-test.js +4 -4
  46. package/workspace/premium-core-doc-issue-test.js +2 -2
  47. package/workspace/premium-vw-backlog-test.js +3 -3
  48. package/workspace/premium-vw-item-test.js +3 -3
  49. package/workspace/premium-vw-jira-test.js +6 -6
  50. package/workspace/product-lane-test.js +165 -0
  51. package/workspace/program-panel-test.js +1 -1
  52. package/workspace/public/pm/bd-asks.js +3 -0
  53. package/workspace/public/pm/bd-ini-panel.js +16 -6
  54. package/workspace/public/pm/bd-prog.js +6 -1
  55. package/workspace/public/pm/bd-span.js +69 -15
  56. package/workspace/public/pm/bd-views.js +3 -2
  57. package/workspace/public/pm/cozy-board.css +10 -0
  58. package/workspace/public/pm/cozy-today.css +23 -0
  59. package/workspace/public/pm/cozy-viewer.js +14 -3
  60. package/workspace/public/pm/cozy-vw-shell.css +8 -0
  61. package/workspace/public/pm/home-app.js +45 -14
  62. package/workspace/public/pm/home-ini-model.js +0 -34
  63. package/workspace/public/pm/home-ini.js +72 -204
  64. package/workspace/public/pm/home-task.js +2 -1
  65. package/workspace/public/pm/home-today.js +66 -16
  66. package/workspace/public/pm/ini-groups.js +253 -0
  67. package/workspace/public/pm/ini-links.js +519 -0
  68. package/workspace/public/pm/ini-props.js +218 -0
  69. package/workspace/public/pm/ini-tasks.js +58 -22
  70. package/workspace/public/pm/ini-versions.js +14 -9
  71. package/workspace/public/pm/ini-view-model.js +93 -4
  72. package/workspace/public/pm/ini-view.css +306 -18
  73. package/workspace/public/pm/ini-view.js +161 -36
  74. package/workspace/public/pm/premium-board.js +54 -6
  75. package/workspace/public/pm/premium-vw-item.js +2 -1
  76. package/workspace/public/pm/split-merge.css +77 -0
  77. package/workspace/public/pm/split-merge.js +265 -0
  78. package/workspace/public/pm/stage-line.js +414 -0
  79. package/workspace/public/pm/task-card.css +13 -0
  80. package/workspace/public/pm/task-card.js +42 -5
  81. package/workspace/public/pm/wf-page.css +2 -0
  82. package/workspace/public/pm/wf-page.js +2 -0
  83. package/workspace/public/pm/wf-stage.js +2 -1
  84. package/workspace/server.js +52 -3
  85. package/workspace/skills/initiative-propose.skill +45 -0
  86. package/workspace/split-merge-ui-test.js +175 -0
  87. package/workspace/stage-card-test.js +13 -12
  88. package/workspace/task-card-test.js +3 -2
  89. package/workspace/task-delete-test.js +126 -0
  90. package/workspace/task-links-test.js +239 -0
  91. package/workspace/task-milestones-test.js +1 -1
  92. package/workspace/task-plans-test.js +6 -0
  93. package/workspace/task-views-test.js +1 -1
  94. package/workspace/test-lists/bd-ini-panel.json +8 -2
  95. package/workspace/test-lists/claude-proposes.json +5 -0
  96. package/workspace/test-lists/home-sessions-pill.json +6 -0
  97. package/workspace/test-lists/product-lane.json +6 -0
  98. package/workspace/test-lists/split-merge.json +15 -0
  99. package/workspace/test-lists/task-delete.json +5 -0
  100. package/workspace/test-lists/task-links.json +6 -0
  101. package/workspace/tk-tasks-test.js +186 -57
  102. package/workspace/workflows-setup-test.js +4 -3
@@ -1,9 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
- /* tk-tasks-test.js — the PRD-to-Jira tasks in Home's Viewer (kit 2, T1 to T3; canvas PgTkList, PgTkDraft, PgTkSend, PgTkSent, XvATasks).
4
- * Serves the real page from the real server. GET /api/jira/tickets answers the view lib/jira-tickets.js builds from a synthetic repository
5
- * (two epics, a ticket that lacks text); the writes are caught, so nothing reaches Jira or the repository. Screenshots go to SHOTS when set.
6
- * T1 the tasks grouped by epic, the send icon, the sent state · T2 the drafted ticket · T3 the Send sheet, its one labeled Send */
3
+ /* tk-tasks-test.js — the initiative's Tasks section groups its tasks and sends the PRD's tickets to Jira (feedback batch 11 item 20: the old
4
+ * All tasks panel is retired; canvas In development, row "Tasks takes over the old All tasks panel": XtaA1Group, XtaA2Epic, XtaA3Mine,
5
+ * XtaA4NewTask, XtaA5Phone; kit 2, T1 to T3: PgTkDraft, PgTkSend, PgTkSent). Serves the real page from the real server. GET /api/jira/tickets
6
+ * answers the view lib/jira-tickets.js builds from a synthetic repository (two epics, a ticket that lacks text); the writes are caught, so
7
+ * nothing reaches Jira or the repository. Screenshots go to TK_SHOTS when set.
8
+ * G1 the group icon and its menu · T1 By epic by itself, the send icon, the sent state · T2 the drafted ticket · T3 the Send sheet, its one
9
+ * labeled Send · G2 Your groups: drag between, ⋯, New group · G3 Timeline and Kanban draw the groups · G4 the phone · G5 the Board's panel
10
+ * · G6 the old panel is gone, New → A task opens the Tasks field */
7
11
  const fs = require('fs');
8
12
  const path = require('path');
9
13
  const { spawn } = require('child_process');
@@ -53,8 +57,16 @@ SENT.tickets.find((t) => t.id === 'S2').jira = { status: 'To Do', category: 'tod
53
57
  SENT.checkedAt = new Date(new Date().setHours(9, 2, 0, 0)).toISOString();
54
58
 
55
59
  const mk = () => IP.build(F.facts());
56
- const BOARD = BP.build(BF.facts());
60
+ /* the initiative's own tasks, on the Board's row both pages read (the fixture's day is 2026-10-17) */
61
+ const TASKS = [
62
+ { uid: 'task-a', title: 'Parity check for the 23 documented rows', status: 'In progress', owner: 'Claude', start: '2026-10-14', end: '2026-10-21', section: 'discover' },
63
+ { uid: 'task-b', title: 'Stakeholder review with Security', status: 'To do', owner: 'Wawan', section: 'discover' },
64
+ { uid: 'task-c', title: 'Plan the rollout', status: 'To do', owner: 'Wawan', start: '2026-11-02', end: '2026-11-06', section: 'plan' },
65
+ { uid: 'task-d', title: 'Kick-off notes with the team', status: 'Done', owner: 'Wawan', end: '2026-10-12', section: 'discover' },
66
+ ];
67
+ const BOARD = (() => { const M = BP.build(BF.facts()); const r = M.rows.find((x) => x.id === I); r.tasks = TASKS.map((t) => ({ ...t })); return M; })();
57
68
  const BRIEF = BRP.build(BRF.facts());
69
+ const LAYOUT = { ok: true, auto: true, held: [], by: 'stage', names: [], of: {}, stage: {}, sets: [] };
58
70
 
59
71
  (async () => {
60
72
  const exe = findBrowser();
@@ -65,51 +77,93 @@ const BRIEF = BRP.build(BRF.facts());
65
77
  await T.waitForServer(BASE);
66
78
  browser = await chromium.launch({ executablePath: exe });
67
79
 
68
- const open = async ({ w = 1440, h = 900, theme = 'light', view = VIEW, layout = {} } = {}) => {
69
- const ctx = await browser.newContext({ viewport: { width: w, height: h } });
80
+ // the layout answers like lib/initiative-layout.js folds it: a press changes it, and the next read sees the change
81
+ const open = async ({ w = 1440, h = 900, theme = 'light', view = VIEW, layout = {}, page: pg = 'home', touch = false } = {}) => {
82
+ const ctx = await browser.newContext({ viewport: { width: w, height: h }, hasTouch: touch, isMobile: touch });
70
83
  const page = await ctx.newPage();
71
84
  const errors = [], posts = [];
72
- let cur = view;
85
+ let cur = view, L = { ...LAYOUT, ...layout };
73
86
  page.on('pageerror', (e) => errors.push(String((e && e.message) || e)));
74
87
  page.on('request', (rq) => { if (rq.method() === 'POST') posts.push({ path: new URL(rq.url()).pathname, body: JSON.parse(rq.postData() || '{}') }); });
75
88
  const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'application/json', body: JSON.stringify(b) });
89
+ const press = (b) => {
90
+ if (b.kind === 'by') L = { ...L, by: b.by, picked: true };
91
+ else if (b.kind === 'groups') { const of = {}; for (const [k, v] of Object.entries(L.of)) if (b.names.includes(v)) of[k] = v; L = { ...L, names: b.names, of }; }
92
+ else if (b.kind === 'rename') { const of = {}; for (const [k, v] of Object.entries(L.of)) of[k] = v === b.from ? b.to : v; L = { ...L, names: L.names.map((n) => (n === b.from ? b.to : n)), of }; }
93
+ else if (b.kind === 'place') { const of = { ...L.of }; if (b.group) of[b.task] = b.group; else delete of[b.task]; L = { ...L, of }; }
94
+ else if (b.kind === 'set') L = { ...L, sets: L.sets.concat({ name: b.name, names: b.names }) };
95
+ return L;
96
+ };
76
97
  await page.route('**/api/initiative-premium*', (r) => json(r, { ok: true, state: 'ready', model: mk(), as_of: Date.now() }));
77
98
  await page.route(/\/api\/board-premium(\?.*)?$/, (r) => json(r, { ok: true, state: 'ready', model: BOARD, as_of: Date.now() }));
78
99
  await page.route(/\/api\/briefing-premium(\?.*)?$/, (r) => json(r, { ok: true, state: 'ready', model: BRIEF, as_of: Date.now() }));
79
100
  await page.route('**/api/briefing-premium/**', (r) => json(r, { ok: true, turns: [], working: false }));
80
- await page.route(/\/api\/initiative-layout(\?.*)?$/, (r) => (r.request().method() === 'GET' ? json(r, { ok: true, auto: true, held: [], by: 'stage', names: [], of: {}, stage: {}, sets: [], ...layout }) : json(r, { ok: true, auto: true, held: [], by: (JSON.parse(r.request().postData() || '{}').by) || 'stage', picked: true, names: [], of: {}, stage: {}, sets: [] })));
101
+ await page.route('**/api/board-trail*', (r) => json(r, { ok: false, error: 'not in this check' }, 500));
102
+ await page.route(/\/api\/initiative-layout(\?.*)?$/, (r) => json(r, r.request().method() === 'GET' ? L : press(JSON.parse(r.request().postData() || '{}'))));
81
103
  await page.route(/\/api\/jira\/tickets(\?.*)?$/, (r) => json(r, { ...cur, ws: 'w1', pushing: null, checking: null }));
82
104
  await page.route(/\/api\/boards\/items(\?.*)?$/, (r) => json(r, { ok: true, ws: 'w1', board: 'w1', jiraProjects: ['IDPF'], items: [], initiatives: [] }));
105
+ await page.route(/\/api\/boards\/tasks\//, (r) => json(r, { ok: true }));
83
106
  await page.route(/\/api\/jira\/(push|epic|edit|draft)$/, (r) => json(r, { ok: true, session: 's1', tickets: 7 }));
107
+ if (pg === 'board') {
108
+ await page.goto(BASE + '/premium-board.html?theme=' + theme);
109
+ await until(() => page.evaluate(() => document.querySelectorAll('#ibBody .ini2, #ibBody .bt-l').length > 0), 20000);
110
+ await page.evaluate((id) => { const b = [...document.querySelectorAll(`[data-row="board:${id}"] .bt-nm, [data-key="board:${id}"]`)].find((x) => x.offsetParent); if (b) b.click(); }, I);
111
+ const up = await until(() => page.evaluate(() => !!document.querySelector('#czViewer .iv .iv-th')), 20000);
112
+ return { ctx, page, errors, posts, up, set: (v) => { cur = v; } };
113
+ }
84
114
  await page.goto(BASE + '/premium.html?ini=' + I + '&ws=w1&board=w1&theme=' + theme);
85
115
  const up = await until(() => page.evaluate(() => !!document.querySelector('#czViewer .iv-sc')), 30000);
86
116
  return { ctx, page, errors, posts, up, set: (v) => { cur = v; } };
87
117
  };
88
118
  const V = '#czViewer:not([hidden])';
89
- const tasks = async (p) => {
90
- await (async (g) => { const P = '#czViewer:not([hidden]) [data-hi-v="page"]', r = '#hmList [data-hm-sel^="i:"][aria-current="true"]'; for (let i = 0; i < 4 && !(await g.$(P)) && (await g.$('#czViewer:not([hidden]) [data-cz-vw="back"]')); i++) { await g.click('#czViewer [data-cz-vw="back"]'); await g.waitForTimeout(150); } if (await g.$(P)) return; if (await g.$(r)) await g.click(r); else await g.reload(); await g.waitForSelector(P + ' .iv', { timeout: 30000 }); })(p); /* ← back to the initiative's page, else its row, else the address again (an initiative the list does not show) */ await p.click('#czViewer [data-cz-vw="more"]').then(() => p.click('.cz-vw-menu [role="menuitem"]:has(> span:first-child:text-is("All tasks"))')); /* the initiative's page (canvas HbC): its + drills into Tasks */
91
- return until(() => p.evaluate((v) => !!document.querySelector(v + ' .tk-g .tk-row'), V), 30000);
92
- };
93
119
  const shot = async (p, name) => { if (!SHOTS) return; fs.mkdirSync(SHOTS, { recursive: true }); await sleep(250); await p.screenshot({ path: path.join(SHOTS, name) }); };
94
120
  const txt = (p, s) => p.evaluate((q) => ((document.querySelector(q) || {}).textContent || '').replace(/\s+/g, ' ').trim(), s);
121
+ const heads = (p) => p.evaluate((v) => [...document.querySelectorAll(v + ' .iv-wbs .iv-ws b')].map((b) => b.textContent), V);
122
+ const epics = (p) => until(() => p.evaluate((v) => !!document.querySelector(v + ' .iv-wbs .ig-tk'), V), 20000);
123
+ const lastPost = (A, route) => A.posts.filter((x) => x.path === route).pop();
95
124
 
96
- /* T1 · desktop: shell A, grouped by epic */
125
+ /* G1 · T1 · desktop: the page's Tasks, grouped by epic by itself */
97
126
  const A = await open(), p = A.page;
98
127
  ok('0 Home draws the initiative', A.up);
99
- ok('T1 the Tasks open grouped by epic once tickets are drafted', await tasks(p));
100
- const heads = await p.evaluate((v) => [...document.querySelectorAll(v + ' .tk-g .tk-ghb b')].map((b) => b.textContent), V);
101
- ok('T1 one group per epic, in the PRD\'s order, then Your tasks', heads.join('|') === 'Sign-in and sign-up|Sessions, SSO and second factor|Your tasks', JSON.stringify(heads));
102
- ok('T1 each epic group has its send icon; Your tasks has none', await p.evaluate((v) => [...document.querySelectorAll(v + ' .tk-g')].map((g) => !!g.querySelector('[data-tk-sendg]')).join() === 'true,true,false', V));
103
- ok('T1 a long group shows three tasks and "N more"', await p.evaluate((v) => { const g = document.querySelector(v + ' .tk-g'); return g.querySelectorAll('.tk-row').length === 3 && /^2 more/.test(g.querySelector('.tk-fold').textContent.trim()); }, V));
104
- ok('T1 a drafted task reads "Story · M", with no status square', /Sign-in parity\s*Story · M/.test(await txt(p, V + ' .tk-row')) && !(await p.$(V + ' .tk-row .tk-sq')));
105
- ok('T1 the summary card comes first, with one primary, Send to Jira', /drafted, not in Jira/.test(await txt(p, V + ' .czs-sum')) && (await txt(p, V + ' .czs-sum .czs-pri')) === 'Send to Jira' && (await p.$$(V + ' .czs-pri')).length === 1);
106
- ok('T1 no Tasks | Documents | Stage switch on a desktop: they sit under ⋯', !(await p.$(V + ' [data-hi-view]')));
107
- await p.click(V + ' .tk-g .tk-fold');
108
- ok('T1 "N more" shows the rest, with the marker on the task that lacks text', await until(() => p.evaluate((v) => { const g = document.querySelector(v + ' .tk-g'); const m = g.querySelector('.tk-mk.warn'); return g.querySelectorAll('.tk-row').length === 5 && m && /Missing/.test(m.getAttribute('aria-label')); }, V)));
109
- await shot(p, 'tasks-1440.png');
128
+ ok('T1 Tasks groups by epic by itself once the tickets are drafted', await epics(p));
129
+ const hd = await p.evaluate((v) => [...document.querySelector(v + ' .iv-th').children].map((e) => (e.getAttribute('aria-label') || e.className || e.tagName) + (e.textContent.trim() && e.matches('button') ? '+text' : '')).join(), V);
130
+ ok('G1 one icon-only "Group tasks by" press in the Tasks header, right side, before the view switch', /Group tasks by,Tasks view,Add a task/.test(hd), hd);
131
+ ok('G1 the group icon shows its grouping is not the default', await p.evaluate((v) => document.querySelector(v + ' [data-ig-by]').classList.contains('on'), V));
132
+ ok('T1 one group per epic, in the PRD\'s order, then Your tasks', (await heads(p)).join('|') === 'Sign-in and sign-up|Sessions, SSO and second factor|Your tasks', JSON.stringify(await heads(p)));
133
+ const sends = await p.evaluate((v) => [...document.querySelectorAll(v + ' .iv-wbs > :is(.iv-wsw, .iv-ws)')].map((g) => !!g.querySelector('[data-ig-send]')).join(), V);
134
+ ok('T1 each epic has its send icon; Your tasks has none', sends === 'true,true,false', sends);
135
+ ok('T1 an epic\'s count says how many are drafted', /5 drafted/.test(await txt(p, V + ' .iv-wbs > .iv-wsw')));
136
+ ok('T1 a drafted ticket row has no box, reads "Story · M" and opens the draft', await p.evaluate((v) => { const r = document.querySelector(v + ' .ig-tk'); return !!r && r.dataset.igTk === 'S1' && !r.querySelector('.iv-cb') && !!r.querySelector('.ig-tkd') && /Sign-in parity\s*Story · M/.test(r.textContent); }, V));
137
+ ok('T1 the ticket that lacks text carries its marker', await p.evaluate((v) => { const m = document.querySelector(v + ' .ig-tk[data-ig-tk="S5"] .ig-mk.warn'); return !!m && /Missing/.test(m.getAttribute('aria-label')); }, V));
138
+ ok('T1 the card leads Tasks: "N tickets are drafted, not in Jira" with one Send to Jira', /6 tickets are drafted, not in Jira/.test(await txt(p, V + ' .ig-sum')) && (await txt(p, V + ' .ig-sum [data-ig-sendall]')) === 'Send to Jira' && (await p.$$(V + ' [data-ig-sendall]')).length === 1, await txt(p, V + ' .ig-sum'));
139
+ await shot(p, 'tasks-epic-1440.png');
140
+ /* batch 12 item 0 · the stage card's stage while Tasks is grouped by epic: Tasks keeps the epic grouping, shows that stage's tasks only */
141
+ const st = await p.evaluate((v) => { const b = [...document.querySelectorAll(v + ' .iv-tl .iv-tlp[data-iv-stage]')].find((x) => !x.classList.contains('now')); return b ? { key: b.dataset.ivStage, title: b.title } : null; }, V);
142
+ ok('S0 the stage card has a stage part to press', !!st, JSON.stringify(st));
143
+ if (st) {
144
+ await p.click(`${V} .iv-tl .iv-tlp[data-iv-stage="${st.key}"]`);
145
+ const only = await until(() => p.evaluate((v) => { const c = document.querySelector(v + ' .iv-th [data-ig-all]'); return c ? c.textContent.trim() : null; }, V));
146
+ ok('S0 the Tasks header names the stage shown, with a ✕ to show every stage', !!only && st.title.includes(only), only + ' / ' + st.title);
147
+ ok('S0 the grouping stays: the group icon is still on, and no stage section opens in its place', await p.evaluate((v) => document.querySelector(v + ' [data-ig-by]').classList.contains('on'), V));
148
+ ok('S0 a stage with no Jira tickets shows no epic groups', await p.evaluate((v) => !document.querySelector(v + ' .ig-tk') && !document.querySelector(v + ' .ig-sum'), V));
149
+ await shot(p, 'tasks-epic-stage-1440.png');
150
+ await p.click(V + ' .iv-th [data-ig-all]');
151
+ ok('S0 the ✕ shows every stage again: the epics come back', await epics(p) && await p.evaluate((v) => !document.querySelector(v + ' [data-ig-all]'), V));
152
+ }
153
+ await p.click(V + ' [data-ig-by]');
154
+ const gm = await until(() => p.evaluate(() => { const m = document.querySelector('.ig-pop [role="menu"]'); return m ? [...m.querySelectorAll('[role^="menuitem"]')].map((b) => b.innerText.replace(/\s+/g, ' ').trim() + (b.getAttribute('aria-checked') === 'true' ? '*' : '')) : null; }));
155
+ ok('G1 the menu: Group by Stage, Epic, Your groups, Owner, Status, then New group; Epic is checked', !!gm && gm.join('|') === 'Stage|Epic 2 epics*|Your groups|Owner|Status|New group', JSON.stringify(gm));
156
+ await shot(p, 'group-menu-1440.png');
157
+ await p.click('.ig-pop [role="menuitemradio"]:has-text("Stage")');
158
+ const by = await until(() => lastPost(A, '/api/initiative-layout'));
159
+ ok('G1 a pick is kept for the workspace: by stage', !!by && by.body.kind === 'by' && by.body.by === 'stage' && by.body.initiative === I && by.body.ws === 'w1', JSON.stringify(by && by.body));
160
+ ok('G1 Stage draws the stages again, with no ticket rows', await until(() => p.evaluate((v) => !document.querySelector(v + ' .ig-tk') && !document.querySelector(v + ' .ig-sum') && [...document.querySelectorAll(v + ' .iv-wbs .iv-ws b')].some((b) => /Discover/.test(b.textContent)), V)));
161
+ await p.click(V + ' [data-ig-by]');
162
+ await p.click('.ig-pop [role="menuitemradio"]:has-text("Epic")');
163
+ await epics(p);
110
164
 
111
- /* T3 · the Send sheet from a group's send icon */
112
- await p.click(V + ' .tk-g [data-tk-sendg]');
165
+ /* T3 · the Send sheet from an epic's send icon */
166
+ await p.click(V + ' [data-ig-send]');
113
167
  const sheet = await until(() => p.evaluate(() => { const s = document.querySelector('.tk-sheet'); return s && s.querySelector('[data-tk-go]') ? s.textContent.replace(/\s+/g, ' ') : null; }));
114
168
  ok('T3 the sheet names the project and the new epic after the group', !!sheet && /Project\s*IDPF/.test(sheet) && /Epic\s*New: Sign-in and sign-up/.test(sheet), sheet);
115
169
  ok('T3 the complete tickets are ticked, the one that lacks text is not', await p.evaluate(() => [...document.querySelectorAll('.tk-sheet [data-tk-tick]')].map((b) => b.getAttribute('aria-checked') + (b.getAttribute('aria-disabled') ? '!' : '')).join() === 'true,true,true,true,false!'));
@@ -129,7 +183,8 @@ const BRIEF = BRP.build(BRF.facts());
129
183
  ok('T3 the sheet closes after the send', await until(() => p.evaluate(() => !document.querySelector('.tk-sheet'))));
130
184
 
131
185
  /* T2 · one drafted ticket */
132
- await p.click(V + ' .tk-row[data-tk-open="S1"]');
186
+ await epics(p);
187
+ await p.click(V + ' .ig-tk[data-ig-tk="S1"]');
133
188
  const dr = await until(() => p.evaluate((v) => { const b = document.querySelector(v + ' .tk-draft'); return b ? b.textContent.replace(/\s+/g, ' ') : null; }, V));
134
189
  ok('T2 the drafted ticket: its four fields', !!dr && /Type\s*Story/.test(dr) && /Priority\s*High/.test(dr) && /Estimate\s*M/.test(dr) && /Depends on\s*Nothing/.test(dr), dr);
135
190
  ok('T2 User story and Acceptance criteria shown, the criteria numbered', /User story\s*As a customer/.test(dr) && (await p.$$(V + ' .tk-ac')).length === 3);
@@ -137,7 +192,7 @@ const BRIEF = BRP.build(BRF.facts());
137
192
  ok('T2 one send icon, and ← back to the tasks', !!(await p.$(V + ' [data-tk-send]')) && !!(await p.$('#czViewer [data-cz-vw="back"]')));
138
193
  await shot(p, 'draft-1440.png');
139
194
  await p.click(V + ' [data-tk-field="priority"]');
140
- await p.click('.hi-pop [role="menuitemradio"]:has-text("Highest")');
195
+ await p.click('.ig-pop [role="menuitemradio"]:has-text("Highest")');
141
196
  const ed = await until(() => A.posts.find((x) => x.path === '/api/jira/edit'));
142
197
  ok('T2 a field changes in place: an edit of the draft, never Jira', !!ed && ed.body.id === 'S1' && ed.body.patch.priority === 'Highest', JSON.stringify(ed));
143
198
  await p.click(V + ' [data-tk-fold="flow"]');
@@ -150,49 +205,123 @@ const BRIEF = BRP.build(BRF.facts());
150
205
  ok('T2 the send icon opens the sheet with this ticket ticked', await until(() => p.evaluate(() => [...document.querySelectorAll('.tk-sheet [data-tk-tick][aria-checked="true"]')].map((b) => b.dataset.tkTick).join() === 'S1')));
151
206
  await p.keyboard.press('Escape');
152
207
  await p.click('#czViewer [data-cz-vw="back"]');
153
- ok('T2 ← returns to the tasks, still pressable', await until(() => p.evaluate((v) => !!document.querySelector(v + ' .tk-g .tk-row'), V)));
154
- await p.click(V + ' [data-czs-act="tk-sendall"]');
155
- ok('T3 the summary\'s Send to Jira opens the same sheet with every group', await until(() => p.evaluate(() => document.querySelectorAll('.tk-sheet .tk-sec').length === 2)));
208
+ ok('T2 ← returns to the page\'s Tasks, still pressable', await epics(p));
209
+ await p.click(V + ' [data-ig-sendall]');
210
+ ok('T3 the card\'s Send to Jira opens the same sheet with every group', await until(() => p.evaluate(() => document.querySelectorAll('.tk-sheet .tk-sec').length === 2)));
211
+ await p.keyboard.press('Escape');
212
+
213
+ /* G6 · the old panel is gone */
214
+ await p.click('#czViewer [data-cz-vw="more"]');
215
+ const more = await until(() => p.evaluate(() => { const m = document.querySelector('.cz-vw-menu'); return m ? [...m.querySelectorAll('[role="menuitem"] > span:first-child')].map((s) => s.textContent) : null; }));
216
+ ok('G6 the page\'s ⋯ has no "All tasks"', !!more && !more.includes('All tasks'), JSON.stringify(more));
156
217
  await p.keyboard.press('Escape');
157
218
  ok('0 no page error', !A.errors.length, A.errors.join(' | '));
158
219
  await A.ctx.close();
159
220
 
160
- /* T1 · after the send, and the phone */
221
+ /* G2 · Your groups: drag a task between them, the group's ⋯, New group */
161
222
  {
162
- const B = await open({ w: 390, h: 844, view: SENT }), q = B.page;
163
- ok('T1 phone: the Tasks open grouped by epic', await tasks(q));
164
- ok('T1 phone: the Tasks | Documents | Stage switch stays', !!(await q.$(V + ' [data-hi-view="tasks"]')));
165
- const row = await q.evaluate((v) => { const r = document.querySelector(v + ' .tk-row'); return r ? { t: r.textContent.replace(/\s+/g, ' ').trim(), sq: (r.querySelector('.tk-sq') || {}).className, av: (r.querySelector('.tk-av') || {}).textContent, lab: (r.querySelector('.tk-ck') || {}).getAttribute && r.querySelector('.tk-ck').getAttribute('aria-label') } : null; }, V);
166
- ok('T1 after the send: the key, a status square and the assignee', !!row && /Sign-in parity\s*IDPF-411/.test(row.t) && /doing/.test(row.sq) && row.av === 'Ru' && row.lab === 'In Jira: In Progress', JSON.stringify(row));
167
- ok('T1 "Jira read at 9:02" is said once', (await q.$$eval(V + ' .tk-read', (n) => n.map((x) => x.textContent))).join() === 'Jira read at 9:02');
168
- ok('T1 a group keeps its send icon while a task in it is not in Jira', await q.evaluate((v) => [...document.querySelectorAll(v + ' .tk-g')].slice(0, 2).map((g) => !!g.querySelector('[data-tk-sendg]')).join() === 'true,true', V));
169
- await shot(q, 'sent-390.png');
223
+ const B = await open({ layout: { by: 'mine', picked: true, names: ['Design', 'Legal'], of: { 'task:task-a': 'Design' }, sets: [{ name: 'Design · Legal', names: ['Design', 'Legal'] }] } }), q = B.page;
224
+ ok('G2 a grouping the PM chose wins over the Epic default', await until(() => q.evaluate((v) => !document.querySelector(v + ' .ig-tk') && [...document.querySelectorAll(v + ' .iv-wbs .iv-ws b')].map((b) => b.textContent).join('|') === 'Design|Legal|Not in a group', V), 20000), JSON.stringify(await heads(q)));
225
+ ok('G2 each of the PM\'s groups has its ⋯; Not in a group has none', await q.evaluate((v) => [...document.querySelectorAll(v + ' .iv-wbs > .ig-dz')].map((g) => !!g.querySelector('[data-ig-gmore]')).join() === 'true,true,false', V));
226
+ await q.click(V + ' .ig-dz[data-ig-drop=""] [data-iv-fold]');
227
+ await until(() => q.evaluate((v) => !!document.querySelector(v + ' [data-ig-drag="task-b"]'), V));
228
+ await shot(q, 'tasks-mine-1440.png');
229
+ await q.dragAndDrop(V + ' [data-ig-drag="task-b"]', V + ' .ig-dz[data-ig-drop="Legal"] .iv-ws');
230
+ const pl = await until(() => lastPost(B, '/api/initiative-layout'));
231
+ ok('G2 a task dragged onto Legal is placed there, kept for the workspace', !!pl && pl.body.kind === 'place' && pl.body.task === 'task:task-b' && pl.body.group === 'Legal', JSON.stringify(pl && pl.body));
232
+ ok('G2 the toast says "Moved to Legal." with Undo', await until(() => q.evaluate(() => { const t = document.getElementById('hiToast'); return !!t && !t.hidden && /Moved to Legal\./.test(t.textContent) && !!t.querySelector('[data-hi-undo]'); })));
233
+ ok('G2 Legal now holds the task', await until(() => q.evaluate((v) => /Stakeholder review/.test((document.querySelector(v + ' .ig-dz[data-ig-drop="Legal"]') || {}).textContent || ''), V)));
234
+ await q.click('#hiToast [data-hi-undo]');
235
+ const un = await until(() => { const x = lastPost(B, '/api/initiative-layout'); return x && x.body.group === '' ? x : null; });
236
+ ok('G2 Undo puts it back where it was', !!un && un.body.task === 'task:task-b', JSON.stringify(un && un.body));
237
+ await q.click(V + ' [data-ig-gmore="Legal"]');
238
+ const gmm = await until(() => q.evaluate(() => { const m = document.querySelector('.ig-pop [role="menu"]'); return m ? [...m.querySelectorAll('[role="menuitem"]')].map((b) => b.innerText.replace(/\s+/g, ' ').trim()) : null; }));
239
+ ok('G2 a group\'s ⋯: Rename, Delete the group (its tasks stay)', !!gmm && gmm.join('|') === 'Rename|Delete the group Its tasks stay', JSON.stringify(gmm));
240
+ await q.click('.ig-pop [role="menuitem"]:has-text("Rename")');
241
+ await q.fill('.ig-pop input', 'Legal and filing');
242
+ await q.keyboard.press('Enter');
243
+ const rn = await until(() => lastPost(B, '/api/initiative-layout'));
244
+ ok('G2 Rename writes the new name', !!rn && rn.body.kind === 'rename' && rn.body.from === 'Legal' && rn.body.to === 'Legal and filing', JSON.stringify(rn && rn.body));
245
+ await q.click(V + ' [data-ig-by]');
246
+ const gm2 = await until(() => q.evaluate(() => { const m = document.querySelector('.ig-pop [role="menu"]'); return m ? m.textContent.replace(/\s+/g, ' ') : null; }));
247
+ ok('G2 the menu lists Your group sets, then New group', !!gm2 && /Your group sets\s*Design · Legal/.test(gm2) && /New group$/.test(gm2.trim()), gm2);
248
+ await q.click('.ig-pop [role="menuitem"]:has-text("New group")');
249
+ await q.fill('.ig-pop input', 'Filing');
250
+ await q.click('.ig-pop [data-ig-ok]');
251
+ const ng = await until(() => { const x = lastPost(B, '/api/initiative-layout'); return x && x.body.kind === 'groups' ? x : null; });
252
+ ok('G2 New group adds a group to the PM\'s own', !!ng && ng.body.names.join('|') === 'Design|Legal and filing|Filing', JSON.stringify(ng && ng.body));
253
+ await shot(q, 'tasks-mine-after-1440.png');
254
+
255
+ /* G3 · Timeline and Kanban draw the same groups */
256
+ await q.click(V + ' [data-iv-view="timeline"]');
257
+ const tg = await until(() => q.evaluate((v) => { const g = [...document.querySelectorAll(v + ' .ivt-gh b')].map((b) => b.textContent); return g.length ? g : null; }, V));
258
+ ok('G3 Timeline draws the same groups', !!tg && tg.join('|') === 'Design|Legal and filing|Filing|Not in a group', JSON.stringify(tg));
259
+ await shot(q, 'timeline-mine-1440.png');
260
+ await q.click(V + ' [data-iv-view="kanban"]');
261
+ ok('G3 Kanban\'s picker is the group picker: All first', await until(() => q.evaluate((v) => { const b = document.querySelector(v + ' [data-iv-kstage]'); return !!b && b.textContent.trim() === 'All' && /^Group: All/.test(b.getAttribute('aria-label')); }, V)));
262
+ await q.click(V + ' [data-iv-kstage]');
263
+ const kg = await until(() => q.evaluate(() => { const m = document.querySelector('.ivq-m'); return m ? [...m.querySelectorAll('[role="menuitemradio"]')].map((b) => b.querySelector('span:nth-child(2)').textContent) : null; }));
264
+ ok('G3 the picker lists All and each group', !!kg && kg.join('|') === 'All|Design|Legal and filing|Filing|Not in a group', JSON.stringify(kg));
265
+ await q.keyboard.press('Escape');
266
+ await q.click(V + ' [data-iv-view="list"]');
267
+ ok('0 Your groups: no page error', !B.errors.length, B.errors.join(' | '));
170
268
  await B.ctx.close();
171
- const C = await open({ w: 390, h: 844 }), c = C.page;
172
- await tasks(c);
173
- await shot(c, 'tasks-390.png');
174
- await c.click(V + ' .tk-g [data-tk-sendg]');
269
+ }
270
+
271
+ /* G4 · the phone: the header fits, the group menu is a sheet, the sent state */
272
+ {
273
+ const C = await open({ w: 390, h: 844, view: SENT }), c = C.page;
274
+ ok('G4 phone: the Tasks open grouped by epic', await epics(c));
275
+ const fit = await c.evaluate((v) => { const h = document.querySelector(v + ' .iv-th'), r = h.getBoundingClientRect(); const kids = [...h.children].filter((e) => e.offsetParent); return { over: h.scrollWidth > h.clientWidth + 1, rows: new Set(kids.filter((e) => e.matches('button, .ivx-seg')).map((e) => Math.round(e.getBoundingClientRect().top))).size, right: Math.max(...kids.map((e) => e.getBoundingClientRect().right)) <= r.right + 1, views: [...h.querySelectorAll('.ivx-sb')].filter((b) => b.offsetParent).length }; }, V);
276
+ ok('G4 phone: the header holds the group icon, the view in use and + on one line, nothing cut', !fit.over && fit.rows === 1 && fit.right && fit.views === 1, JSON.stringify(fit));
277
+ await c.click(V + ' .ivx-sb[aria-pressed="true"]');
278
+ const vm = await until(() => c.evaluate(() => { const m = document.querySelector('.ivq-m'); return m ? [...m.querySelectorAll('[role="menuitemradio"]')].map((b) => b.textContent.trim()) : null; }));
279
+ ok('G4 phone: the view icon opens List, Timeline and Kanban', !!vm && vm.join('|') === 'List|Timeline|Kanban', JSON.stringify(vm));
280
+ await c.keyboard.press('Escape');
281
+ const row = await c.evaluate((v) => { const r = document.querySelector(v + ' .ig-tk[data-ig-tk="S1"]'); return r ? { t: r.textContent.replace(/\s+/g, ' ').trim(), sq: (r.querySelector('.ig-sq') || {}).className, av: (r.querySelector('.ivt-av') || {}).textContent, lab: r.querySelector('.ig-sq') && r.querySelector('.ig-sq').getAttribute('aria-label') } : null; }, V);
282
+ ok('T1 after the send: the key, a status square and the assignee', !!row && /IDPF-411 Sign-in parity/.test(row.t) && /doing/.test(row.sq) && row.av === 'Ru' && row.lab === 'In Jira: In Progress', JSON.stringify(row));
283
+ ok('T1 "Jira read at 9:02" is said once', (await c.$$eval(V + ' .ig-read', (n) => n.map((x) => x.textContent))).join() === 'Jira read at 9:02');
284
+ ok('T1 an epic keeps its send icon while a ticket in it is not in Jira', await c.evaluate((v) => [...document.querySelectorAll(v + ' .iv-wbs > :is(.iv-wsw, .iv-ws)')].slice(0, 2).map((g) => !!g.querySelector('[data-ig-send]')).join() === 'true,true', V));
285
+ await shot(c, 'sent-390.png');
286
+ await c.click(V + ' [data-ig-by]');
287
+ ok('G4 phone: the group menu rises from the bottom as a sheet', await until(() => c.evaluate(() => { const s = document.querySelector('.ig-pop.sheet'); if (!s) return false; const r = s.getBoundingClientRect(); return Math.abs(r.bottom - innerHeight) < 2 && r.left === 0; })));
288
+ await shot(c, 'group-sheet-390.png');
289
+ await c.keyboard.press('Escape');
290
+ await c.click(V + ' [data-ig-send]');
175
291
  await until(() => c.evaluate(() => !!document.querySelector('.tk-sheet.phone [data-tk-go]')));
176
- ok('T3 phone: the sheet rises from the bottom', await c.evaluate(() => { const r = document.querySelector('.tk-sheet').getBoundingClientRect(); return Math.abs(r.bottom - innerHeight) < 2 && r.left === 0; }));
177
- await shot(c, 'send-390.png');
292
+ ok('T3 phone: the Send sheet rises from the bottom', await c.evaluate(() => { const r = document.querySelector('.tk-sheet').getBoundingClientRect(); return Math.abs(r.bottom - innerHeight) < 2 && r.left === 0; }));
178
293
  await c.keyboard.press('Escape');
179
- await c.click(V + ' .tk-row[data-tk-open="S1"]');
180
- await until(() => c.evaluate((v) => !!document.querySelector(v + ' .tk-draft'), V));
181
- await shot(c, 'draft-390.png');
182
- ok('0 phone: no page error', !C.errors.length && !B.errors.length, C.errors.concat(B.errors).join(' | '));
294
+ ok('0 phone: no page error', !C.errors.length, C.errors.join(' | '));
183
295
  await C.ctx.close();
184
296
  const D = await open({ theme: 'dark' }), d = D.page;
185
- await tasks(d);
186
- await shot(d, 'tasks-1440-dark.png');
297
+ await epics(d);
298
+ await shot(d, 'tasks-epic-1440-dark.png');
187
299
  await D.ctx.close();
188
300
  }
189
301
 
190
- /* the PM chose another grouping: it stays */
302
+ /* G5 · the Board's panel: the same section */
191
303
  {
192
- const E = await open({ layout: { by: 'mine', picked: true, names: ['Design'] } }), e = E.page;
193
- await (async (g) => { const P = '#czViewer:not([hidden]) [data-hi-v="page"]', r = '#hmList [data-hm-sel^="i:"][aria-current="true"]'; for (let i = 0; i < 4 && !(await g.$(P)) && (await g.$('#czViewer:not([hidden]) [data-cz-vw="back"]')); i++) { await g.click('#czViewer [data-cz-vw="back"]'); await g.waitForTimeout(150); } if (await g.$(P)) return; if (await g.$(r)) await g.click(r); else await g.reload(); await g.waitForSelector(P + ' .iv', { timeout: 30000 }); })(e); /* ← back to the initiative's page, else its row, else the address again (an initiative the list does not show) */ await e.click('#czViewer [data-cz-vw="more"]').then(() => e.click('.cz-vw-menu [role="menuitem"]:has(> span:first-child:text-is("All tasks"))')); /* the initiative's page (canvas HbC): its + drills into Tasks */
194
- ok('T1 a grouping the PM chose wins over the Epic default', await until(() => e.evaluate((v) => !!document.querySelector(v + ' .hi-tg') && !document.querySelector(v + ' .tk-row'), V)));
304
+ const E = await open({ page: 'board' }), e = E.page;
305
+ ok('G5 the Board\'s panel has the group icon and groups by epic by itself', E.up && !!(await e.$(V + ' .iv-th [data-ig-by]')) && await epics(e));
306
+ await e.click(V + ' [data-ig-by]');
307
+ await e.click('.ig-pop [role="menuitemradio"]:has-text("Owner")');
308
+ ok('G5 By owner on the Board: one group per owner', await until(() => e.evaluate((v) => [...document.querySelectorAll(v + ' .iv-wbs .iv-ws b')].map((b) => b.textContent).join('|') === 'Claude|Wawan', V)), JSON.stringify(await heads(e)));
309
+ await shot(e, 'board-owner-1440.png');
310
+ ok('0 Board: no page error', !E.errors.length, E.errors.join(' | '));
195
311
  await E.ctx.close();
196
312
  }
313
+
314
+ /* G6 · New → A task opens the initiative with the cursor in the Tasks field (XtaA4NewTask) */
315
+ {
316
+ const N = await open({ layout: { by: 'stage', picked: true } }), n = N.page;
317
+ await n.click('[data-hm-new]');
318
+ await n.click('#hmMenu [data-hm-mi]:has-text("A task")').catch(() => n.click('[data-hm-mi]:has-text("A task")'));
319
+ await n.click('[data-hm-mi]:has-text("Self-serve onboarding v2")');
320
+ ok('G6 New → A task: the page with the Tasks field open, the cursor in it', await until(() => n.evaluate(() => { const f = document.querySelector('#czViewer [data-hi-v="page"] #ivAddTask'); return !!f && document.activeElement === f; }), 15000));
321
+ ok('G6 no old Tasks view: no #ovTask anywhere', !(await n.$('#ovTask')));
322
+ await shot(n, 'new-task-1440.png');
323
+ ok('0 New → A task: no page error', !N.errors.length, N.errors.join(' | '));
324
+ await N.ctx.close();
325
+ }
197
326
  finish();
198
327
  })();
@@ -256,10 +256,11 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
256
256
  ok('M Product feature ships with PMOS: no add, no drag, no rename; Copy it', PF.adds === 0 && PF.drag === 0 && !PF.rn && PF.copy && /ships with PMOS/.test(PF.text), JSON.stringify(PF));
257
257
  await p.click('.wf-card[data-stage="build"]');
258
258
  await until(() => viewer(p).then((x) => x && x.title === 'Build'));
259
- ok('M its stage panel is read-only', await p.evaluate(() => [...document.querySelectorAll('#czViewer .cz-vw-body button, #czViewer .cz-vw-body input')].every((x) => x.disabled) && !document.querySelector('#czViewer [data-cz-vw-rn]')));
260
- await p.keyboard.press('Escape');
261
- await p.click('[data-wf-copy]');
259
+ ok('M its stage panel is read-only, with Copy it as its one press', await p.evaluate(() => [...document.querySelectorAll('#czViewer .cz-vw-body button:not([data-st-copy]), #czViewer .cz-vw-body input')].every((x) => x.disabled) && !document.querySelector('#czViewer [data-cz-vw-rn]') && !document.querySelector('#czViewer [data-st-copy]').disabled));
260
+ await p.click('#czViewer [data-st-copy]');
262
261
  ok('M Copy makes "Copy of Product feature" and opens it', await until(() => p.evaluate(() => (document.querySelector('.wf-h1') || {}).textContent === 'Copy of Product feature' && document.querySelectorAll('[data-add]').length === 3)));
262
+ ok('M the panel\'s Copy it opens the same stage in the copy, ready to change', await until(() => viewer(p).then((x) => x && x.title === 'Build')) && await p.evaluate(() => !document.querySelector('#czViewer [data-st-copy]') && [...document.querySelectorAll('#czViewer .cz-vw-body [data-st-kind]')].every((x) => !x.disabled)));
263
+ await p.keyboard.press('Escape');
263
264
  ok('M no page error on the editor', D.errors.length === 0, D.errors.join(' | '));
264
265
  await D.ctx.close();
265
266