create-pmos 0.412.0 → 0.413.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.
- package/package.json +13 -13
- package/payload/KIT-VERSION +1 -1
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/scripts/pmos-log.sh +6 -3
- package/payload/state/discoveries.md +1 -1
- package/workspace/board-programs-test.js +2 -2
- package/workspace/changelog.json +12 -0
- package/workspace/core-docs-workflow-test.js +144 -0
- package/workspace/guide/workflows.md +8 -1
- package/workspace/lib/board-premium.js +7 -2
- package/workspace/lib/briefing-premium-agent.js +16 -4
- package/workspace/lib/core-docs.js +79 -14
- package/workspace/lib/engine/boards.js +20 -12
- package/workspace/lib/initiative-chat.js +49 -0
- package/workspace/lib/initiative-premium.js +17 -7
- package/workspace/lib/item-cli.js +7 -2
- package/workspace/lib/plan-items.js +1 -1
- package/workspace/lib/pmos-verbs.js +1 -1
- package/workspace/lib/program-chat.js +1 -1
- package/workspace/lib/programs.js +21 -5
- package/workspace/lib/routes-boards.js +75 -13
- package/workspace/lib/routes-briefing-premium.js +17 -1
- package/workspace/lib/routes-core-docs.js +3 -1
- package/workspace/lib/routes-programs.js +12 -1
- package/workspace/lib/workflow-chat.js +1 -0
- package/workspace/lib/workflow-cli.js +91 -6
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-chat-line-test.js +9 -0
- package/workspace/premium-vw-item-test.js +3 -3
- package/workspace/premium-vw-jira-test.js +2 -1
- package/workspace/program-order-test.js +180 -0
- package/workspace/public/pm/bd-prog.js +3 -3
- package/workspace/public/pm/cozy-viewer.js +8 -3
- package/workspace/public/pm/goal-chat.js +1 -1
- package/workspace/public/pm/home-app.js +22 -8
- package/workspace/public/pm/home-chat.js +6 -1
- package/workspace/public/pm/home-ini-model.js +42 -29
- package/workspace/public/pm/home-ini.css +1 -0
- package/workspace/public/pm/home-ini.js +26 -34
- package/workspace/public/pm/home-list.js +2 -1
- package/workspace/public/pm/home-stage-card.js +3 -1
- package/workspace/public/pm/home-task.js +41 -65
- package/workspace/public/pm/home-today.js +7 -5
- package/workspace/public/pm/premium-board.js +12 -6
- package/workspace/public/pm/premium-initiative-head.js +21 -11
- package/workspace/public/pm/premium-viewer.js +1 -0
- package/workspace/public/pm/premium-vw-item-model.js +13 -7
- package/workspace/public/pm/premium-vw-item.js +49 -5
- package/workspace/public/pm/prog-order.css +47 -0
- package/workspace/public/pm/prog-order.js +188 -0
- package/workspace/public/pm/program-model.js +75 -0
- package/workspace/public/pm/task-card.css +108 -0
- package/workspace/public/pm/task-card.js +271 -0
- package/workspace/skills/workflow-setup.skill +14 -5
- package/workspace/stage-card-test.js +11 -0
- package/workspace/task-card-test.js +248 -0
- package/workspace/test-lists/core-documents-backend.json +15 -3
- package/workspace/test-lists/program-order.json +6 -0
- package/workspace/test-lists/task-card.json +6 -0
- package/workspace/test-lists/workflow-stage.json +5 -0
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
/* task-card-test.js — a task edited where it opens (third feedback batch item 7, agreed "A+C 1": canvas XetX1Rest, XetX1Dates, XetX1Done,
|
|
4
|
+
* XetX1Jira, XetX1Phone). Two halves:
|
|
5
|
+
* P pure: task-card.js (the card's markup, the due line and late text, the check box, how fresh a Jira read is, which route each change takes).
|
|
6
|
+
* D the real page from the real server, its routes answered from the fixtures: a PMOS task opened from the initiative (premium-vw-item.js)
|
|
7
|
+
* and from Home's list (home-task.js) is the same card; status, dates, owner, group, notes and move save at once with Undo; the
|
|
8
|
+
* header's check box is the quick Done; a Jira ticket's fields are plain text with its key and freshness, its notes editable; the phone.
|
|
9
|
+
* PMOS_SHOTS=<dir> also saves a screenshot of each state there. */
|
|
10
|
+
const path = require('path');
|
|
11
|
+
const fs = require('fs');
|
|
12
|
+
const { spawn } = require('child_process');
|
|
13
|
+
const { pathToFileURL } = require('url');
|
|
14
|
+
const { findBrowser } = require('./lib/find-browser');
|
|
15
|
+
const T = require('./test-run').configure({ name: 'task-card' });
|
|
16
|
+
const IP = require('./lib/initiative-premium.js');
|
|
17
|
+
const F = require('./fixtures/initiative-premium-facts.js');
|
|
18
|
+
const BP = require('./lib/board-premium.js');
|
|
19
|
+
const BF = require('./fixtures/board-premium-facts.js');
|
|
20
|
+
const BRP = require('./lib/briefing-premium.js');
|
|
21
|
+
const BRF = require('./fixtures/briefing-premium-facts.js');
|
|
22
|
+
|
|
23
|
+
const BASE = T.BASE;
|
|
24
|
+
const SHOTS = process.env.PMOS_SHOTS || '';
|
|
25
|
+
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
26
|
+
const until = async (fn, ms = 10000, step = 100) => { const t0 = Date.now(); for (;;) { const v = await fn(); if (v) return v; if (Date.now() - t0 > ms) return v; await sleep(step); } };
|
|
27
|
+
const results = [];
|
|
28
|
+
const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + String(extra).slice(0, 600) : ''}`); };
|
|
29
|
+
let srv = null; let browser = null;
|
|
30
|
+
const finish = async (code) => {
|
|
31
|
+
if (browser) await browser.close().catch(() => {});
|
|
32
|
+
if (srv) { try { srv.kill('SIGKILL'); } catch { /* gone */ } }
|
|
33
|
+
T.killTmux();
|
|
34
|
+
const bad = results.filter((x) => !x.cond).length;
|
|
35
|
+
console.log(`\n${results.length - bad}/${results.length} task-card assertions passed`);
|
|
36
|
+
process.exit(code !== undefined ? code : (bad ? 1 : 0));
|
|
37
|
+
};
|
|
38
|
+
process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
39
|
+
const mod = (f) => import(pathToFileURL(path.join(__dirname, 'public', 'pm', f)).href);
|
|
40
|
+
|
|
41
|
+
async function pure() {
|
|
42
|
+
const C = await mod('task-card.js');
|
|
43
|
+
const now = new Date(2026, 9, 25, 12).getTime();
|
|
44
|
+
const t = { uid: 'task-1', key: 'task:task-1', title: '10.5 TC to review & accept minutes', status: 'In progress', start: '2026-10-08', due: '2026-10-08', owner: 'Wawan', notes: 'Minutes of 7 Oct.', ini: 'tender', iniTitle: 'Tender new CIAM', group: 'Tender committee', jira: null };
|
|
45
|
+
const h = C.cardHtml(t, { now, groups: ['Tender committee'], inis: [{ id: 'tender', title: 'Tender new CIAM' }, { id: 'descope', title: 'Descope' }] });
|
|
46
|
+
ok('P1 five status buttons, the current one says its name and is checked; the others are icon-only with a name for a screen reader', (h.match(/data-tkc-state=/g) || []).length === 5
|
|
47
|
+
&& /class="i-prog on" role="radio" aria-checked="true" data-tkc-state="In progress" title="In progress">.*In progress<\/button>/.test(h) && /aria-checked="false" data-tkc-state="Done" aria-label="Done"/.test(h), h.slice(0, 900));
|
|
48
|
+
ok('P1 the due line says the day, the late text sits beside it', /Due 8 Oct/.test(h) && /<span class="r late">17 days late<\/span>/.test(h));
|
|
49
|
+
ok('P1 owner and group are chips; notes and the initiative edit in place; the move icon is there', /Owner: Wawan/.test(h) && /Group: Tender committee/.test(h) && /<textarea class="nt" data-tkc-notes[^>]*>Minutes of 7 Oct\.<\/textarea>/.test(h)
|
|
50
|
+
&& /data-tkc="ini"/.test(h) && /data-tkc="move"/.test(h));
|
|
51
|
+
ok('P1 no Type, Reference or Source rows and no "own dialog" line', !/Reference|Source|own dialog|>Type</.test(h));
|
|
52
|
+
ok('P1 the title is escaped', !C.cardHtml({ ...t, iniTitle: '<img src=x>' }, { now }).includes('<img'));
|
|
53
|
+
const done = C.cardHtml({ ...t, status: 'Done' }, { now });
|
|
54
|
+
ok('P2 a Done task: the late line goes quiet', !/late/.test(done) && /class="due-b ok/.test(done));
|
|
55
|
+
const bare = C.cardHtml({ ...t, start: '', due: '', owner: '', group: '', notes: '' }, { now, groups: [] });
|
|
56
|
+
ok('P2 empty fields are quiet icons with a next action: Add dates, Add an owner, Put it in a group, Add notes', /aria-label="Add dates"/.test(bare) && /aria-label="Add an owner"/.test(bare) && /aria-label="Put it in a group"/.test(bare) && /placeholder="Add notes"/.test(bare));
|
|
57
|
+
ok('P2 a page that does not know the groups draws no group chip', !/data-tkc="group"/.test(C.cardHtml(t, { now })));
|
|
58
|
+
ok('P2 no other initiative: no move icon', !/data-tkc="move"/.test(C.cardHtml(t, { now, inis: [{ id: 'tender' }] })));
|
|
59
|
+
ok('P3 the due line: one day, a range in a month, across months, none', C.dueLine({ due: '2026-10-08', start: '2026-10-08' }, now).text === 'Due 8 Oct' && C.dueLine({ start: '2026-10-08', due: '2026-10-10' }, now).text === '8 → 10 Oct'
|
|
60
|
+
&& C.dueLine({ start: '2026-09-28', due: '2026-10-10' }, now).text === '28 Sep → 10 Oct' && C.dueLine({}, now).none);
|
|
61
|
+
ok('P3 late text: "1 day late", "Today", nothing when closed', C.dueLine({ due: '2026-10-24', status: 'To do' }, now).lateText === '1 day late' && C.dueLine({ due: '2026-10-25', status: 'To do' }, now).lateText === 'Today' && C.dueLine({ due: '2026-10-01', status: "Won't do" }, now).lateText === '');
|
|
62
|
+
const dp = C.cardHtml({ ...t, due: '2026-10-10' }, { now, open: 'dates' });
|
|
63
|
+
ok('P4 the picker opens under the due button: Start and Due, Today/Tomorrow/Fri/clear, the month, the range marked', /class="anc"><button type="button" class="due-b[^"]*open"[^]*<div class="tkc-pop tkc-dp"/.test(dp) && /<small>Start<\/small><b>8 Oct<\/b>/.test(dp)
|
|
64
|
+
&& /<small>Due<\/small><b>10 Oct<\/b>/.test(dp) && />Tomorrow</.test(dp) && /October 2026/.test(dp) && /class="rg"[^>]*>9</.test(dp) && /data-tkc-day="2026-10-10" class="a"/.test(dp), dp.slice(dp.indexOf('tkc-dp'), dp.indexOf('tkc-dp') + 700));
|
|
65
|
+
ok('P5 the check box: half for In progress, a press marks it done; Done marks it not done; a Jira ticket\'s is not a press', C.checkOf(t).state === 'prog' && C.checkOf(t).label === 'Mark done'
|
|
66
|
+
&& C.checkOf({ ...t, status: 'Done' }).label === 'Mark not done' && C.checkOf({ ...t, jira: { key: 'CIAM-214' } }).disabled === true);
|
|
67
|
+
const j = C.cardHtml({ ...t, owner: 'Dita S.', jira: { key: 'CIAM-214', readAt: new Date(now - 4 * 60000).toISOString() } }, { now, inis: [{ id: 'x' }], groups: ['a'] });
|
|
68
|
+
ok('P6 a Jira ticket: status and dates plain, the key and "read 4 min ago", the assignee read-only, notes editable, no move, no group', /class="rost" title="Jira owns the status">In progress/.test(j) && /CIAM-214<\/button><span>· read 4 min ago/.test(j)
|
|
69
|
+
&& /class="chip ro" title="Jira owns the assignee"/.test(j) && /data-tkc-notes/.test(j) && !/data-tkc-state|data-tkc="move"|data-tkc="group"|data-tkc="dates"/.test(j), j);
|
|
70
|
+
ok('P6 freshness words', C.freshness(new Date(now - 30e3).toISOString(), now) === 'read just now' && C.freshness(new Date(now - 3 * 36e5).toISOString(), now) === 'read 3 h ago' && C.freshness(new Date(now - 2 * 864e5).toISOString(), now) === 'read 2 days ago' && C.freshness('', now) === '');
|
|
71
|
+
const calls = []; const post = async (p, b) => { calls.push([p, b]); return { ok: true }; };
|
|
72
|
+
const sv = C.boardSaver({ ws: 'w1', board: 'b1', t, post });
|
|
73
|
+
await sv({ status: 'Done' }); await sv({ owner: 'Rudi' }); await sv({ start: '2026-10-08', due: '2026-10-10' }); await sv({ group: 'Legal' }); await sv({ initiative: 'descope' });
|
|
74
|
+
await C.boardSaver({ ws: 'w1', board: 'b1', t: { ...t, jira: { key: 'CIAM-214' } }, post })({ notes: 'n' });
|
|
75
|
+
const refused = await C.boardSaver({ ws: 'w1', board: 'b1', t: { ...t, jira: { key: 'CIAM-214' } }, post })({ status: 'Done' });
|
|
76
|
+
ok('P7 each change takes the board\'s route: state, edit, layout place, a ticket\'s note; Jira\'s own fields are refused', calls.map((c) => c[0]).join() === '/api/boards/tasks/state,/api/boards/tasks/edit,/api/boards/tasks/edit,/api/initiative-layout,/api/boards/tasks/edit,/api/boards/tickets/note'
|
|
77
|
+
&& calls[0][1].state === 'Done' && calls[0][1].task === 'task-1' && calls[3][1].kind === 'place' && calls[3][1].task === 'task:task-1' && calls[4][1].initiative === 'descope' && calls[5][1].ref === 'CIAM-214' && refused.ok === false, JSON.stringify(calls));
|
|
78
|
+
const row = C.taskOf({ key: 'task:t1', uid: 't1', pmos: true, ref: 't1', state: 'To do', start: '2026-10-20', end: '2026-10-27', owner: 'Dara', src: 'PMOS task' }, { ini: 'a', iniTitle: 'A' });
|
|
79
|
+
const jr = C.taskOf({ key: 'task:ONB-12', uid: 'ONB-12', pmos: false, ref: 'ONB-12', state: 'In progress', src: 'Jira (read-only)', readAt: 'x' }, { ini: 'a' });
|
|
80
|
+
const it = C.taskOf({ uid: 't9', src: 'pmos', status: 'Done', end: '2026-10-01', ini: 'b' });
|
|
81
|
+
ok('P8 one shape from the initiative model and from the board\'s items', row.status === 'To do' && row.due === '2026-10-27' && row.key === 'task:t1' && !row.jira && jr.jira.key === 'ONB-12' && it.key === 'task:t9' && it.due === '2026-10-01' && it.ini === 'b');
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
(async () => {
|
|
85
|
+
await pure();
|
|
86
|
+
const exe = findBrowser();
|
|
87
|
+
if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the suite cannot run'); return finish(1); }
|
|
88
|
+
let chromium;
|
|
89
|
+
try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
|
|
90
|
+
srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT), PMOS_SELF_ROOT: path.resolve(__dirname, '..') }) });
|
|
91
|
+
await T.waitForServer(BASE);
|
|
92
|
+
browser = await chromium.launch({ executablePath: exe });
|
|
93
|
+
const BOARD = BP.build(BF.facts()), BRIEF = BRP.build(BRF.facts());
|
|
94
|
+
if (SHOTS) fs.mkdirSync(SHOTS, { recursive: true });
|
|
95
|
+
const shot = async (p, name, sel) => { if (!SHOTS) return; await sleep(300); await (sel ? p.locator(sel).first() : p).screenshot({ path: path.join(SHOTS, name + '.png') }); };
|
|
96
|
+
|
|
97
|
+
const open = async ({ w = 1440, h = 900, theme = 'light' } = {}) => {
|
|
98
|
+
const ctx = await browser.newContext({ viewport: { width: w, height: h } });
|
|
99
|
+
const page = await ctx.newPage();
|
|
100
|
+
const errors = [], posts = [];
|
|
101
|
+
page.on('pageerror', (e) => errors.push(String(e)));
|
|
102
|
+
const json = (r, b) => r.fulfill({ status: 200, contentType: 'application/json', body: JSON.stringify(b) });
|
|
103
|
+
const items = F.ITEMS.map((x) => (x.uid === 'ONB-12' ? { ...x, readAt: new Date(Date.now() - 4 * 60000).toISOString(), notes: '' } : x));
|
|
104
|
+
const model = IP.build(F.facts({ items }));
|
|
105
|
+
await page.route('**/api/initiative-premium*', (r) => json(r, { ok: true, state: 'ready', model, as_of: Date.now() }));
|
|
106
|
+
await page.route(/\/api\/board-premium(\?.*)?$/, (r) => json(r, { ok: true, state: 'ready', model: BOARD, as_of: Date.now() }));
|
|
107
|
+
await page.route(/\/api\/briefing-premium(\?.*)?$/, (r) => json(r, { ok: true, state: 'ready', model: BRIEF, as_of: Date.now() }));
|
|
108
|
+
await page.route('**/api/briefing-premium/**', (r) => json(r, { ok: true, turns: [], working: false }));
|
|
109
|
+
await page.route(/\/api\/boards\/items(\?.*)?$/, (r) => json(r, { ok: true, items, initiatives: [{ id: 'self-serve-v2', title: 'Self-serve onboarding v2' }, { id: 'other', title: 'Partner portal' }] }));
|
|
110
|
+
const layout = { ok: true, auto: true, held: [], by: 'mine', names: ['Launch', 'Legal'], of: { 'task:t1': 'Launch' }, stage: {}, sets: [] };
|
|
111
|
+
await page.route('**/api/initiative-layout*', (r) => {
|
|
112
|
+
if (r.request().method() !== 'POST') return json(r, layout);
|
|
113
|
+
const b = JSON.parse(r.request().postData() || '{}'); posts.push({ path: '/api/initiative-layout', body: b });
|
|
114
|
+
return json(r, { ...layout, of: { ...layout.of, [b.task]: b.group } });
|
|
115
|
+
});
|
|
116
|
+
for (const p of ['tasks/state', 'tasks/edit', 'tickets/note']) await page.route('**/api/boards/' + p, (r) => {
|
|
117
|
+
const b = JSON.parse(r.request().postData() || '{}'); posts.push({ path: '/api/boards/' + p, body: b });
|
|
118
|
+
return json(r, { ok: true, from: {}, item: {} });
|
|
119
|
+
});
|
|
120
|
+
await page.goto(BASE + '/premium.html?ini=self-serve-v2&ws=w1&board=w1&theme=' + theme);
|
|
121
|
+
const up = await until(() => page.evaluate(() => !!document.querySelector('#czViewer')), 30000);
|
|
122
|
+
return { ctx, page, errors, posts, up };
|
|
123
|
+
};
|
|
124
|
+
const openTask = (p, key) => p.evaluate(async (k) => { (await import('/pm/premium-vw-item.js')).openWorkItem({ kind: 'task', ini: 'self-serve-v2', key: k, title: 'x', ws: 'w1', board: 'w1' }); }, key);
|
|
125
|
+
const C = '#czViewer .tkc';
|
|
126
|
+
const view = (p) => p.evaluate((c) => {
|
|
127
|
+
const el = document.querySelector(c); if (!el) return null;
|
|
128
|
+
const t = (n) => (n ? n.textContent.replace(/\s+/g, ' ').trim() : '');
|
|
129
|
+
const chk = document.querySelector('#czViewer .cz-vw-chk');
|
|
130
|
+
return { on: t(el.querySelector('.seg .on')), due: t(el.querySelector('.due-b')), late: t(el.querySelector('.acc .r')), chips: [...el.querySelectorAll('.chips .chip')].map((x) => x.getAttribute('aria-label') || t(x)),
|
|
131
|
+
notes: (el.querySelector('[data-tkc-notes]') || {}).value, ini: t(el.querySelector('.tk-ini .go b')), move: !!el.querySelector('[data-tkc="move"]'), chk: chk ? { cls: chk.className, label: chk.getAttribute('aria-label'), dis: chk.disabled } : null,
|
|
132
|
+
msg: t(el.querySelector('.tkc-msg')), toast: t(document.getElementById('toast')), undo: !!document.querySelector('#toast .undo'), rows: /Reference|Source|own dialog/.test(el.textContent) };
|
|
133
|
+
}, C);
|
|
134
|
+
const last = (A, p) => A.posts.filter((x) => x.path === p).pop();
|
|
135
|
+
|
|
136
|
+
/* D1 a PMOS task from the initiative: the card */
|
|
137
|
+
{
|
|
138
|
+
const A = await open(), p = A.page;
|
|
139
|
+
ok('D1 the page is up', A.up);
|
|
140
|
+
await openTask(p, 'task:t1');
|
|
141
|
+
const v = await until(async () => { const x = await view(p); return x && x.chips.length >= 2 ? x : null; }, 15000);
|
|
142
|
+
ok('D1 the task opens as the card: status buttons with To do on, the dates, the owner and its group, notes, the initiative', v && v.on === 'To do' && /20 → 27 Oct/.test(v.due) && v.chips.includes('Owner: Dara. Change') && v.chips.includes('Group: Launch. Change')
|
|
143
|
+
&& v.ini === 'Self-serve onboarding v2' && v.move, JSON.stringify(v));
|
|
144
|
+
ok('D1 the header carries the check box in the tile\'s place', v && v.chk && /s-todo/.test(v.chk.cls) && v.chk.label === 'Mark done', JSON.stringify(v && v.chk));
|
|
145
|
+
ok('D1 no Type, Reference or Source rows', v && !v.rows);
|
|
146
|
+
await shot(p, 'task-rest-1440', '#czViewer');
|
|
147
|
+
// status
|
|
148
|
+
await p.click(C + ' [data-tkc-state="In progress"]');
|
|
149
|
+
ok('D2 a status press saves at once (tasks/state) and says so with Undo; the check box turns half', await until(async () => { const x = await view(p); return x.on === 'In progress' && /Now in progress/.test(x.toast) && x.undo && /s-prog/.test(x.chk.cls); })
|
|
150
|
+
&& last(A, '/api/boards/tasks/state').body.state === 'In progress' && last(A, '/api/boards/tasks/state').body.task === 't1', JSON.stringify(await view(p)));
|
|
151
|
+
await p.click('#toast .undo');
|
|
152
|
+
ok('D2 Undo puts the old status back through the same route', await until(async () => (await view(p)).on === 'To do') && last(A, '/api/boards/tasks/state').body.state === 'To do');
|
|
153
|
+
// the check box: the quick Done
|
|
154
|
+
await p.click('#czViewer .cz-vw-chk');
|
|
155
|
+
ok('D3 the check box marks it Done: the card follows, the late text is gone, the title goes quiet', await until(async () => { const x = await view(p); return x.on === 'Done' && /s-done/.test(x.chk.cls) && x.chk.label === 'Mark not done' && !/late/.test(x.late); })
|
|
156
|
+
&& await p.evaluate(() => getComputedStyle(document.querySelector('#czViewer .cz-vw-title')).textDecorationLine.includes('line-through')), JSON.stringify(await view(p)));
|
|
157
|
+
await shot(p, 'task-done-1440', '#czViewer');
|
|
158
|
+
await p.click('#czViewer .cz-vw-chk');
|
|
159
|
+
await until(async () => (await view(p)).on === 'To do');
|
|
160
|
+
// dates
|
|
161
|
+
await p.click(C + ' [data-tkc="dates"]');
|
|
162
|
+
const dp = await until(() => p.evaluate((c) => { const pop = document.querySelector(c + ' .tkc-dp'), b = document.querySelector(c + ' .due-b'); if (!pop || !b) return null; const r = pop.getBoundingClientRect(), br = b.getBoundingClientRect(); return { under: r.top >= br.bottom - 1 && Math.abs(r.left - br.left) < 4, due: pop.querySelector('[data-tkc-field="due"]').classList.contains('on') }; }, C));
|
|
163
|
+
ok('D4 a tap on the due line opens the picker right under it, on Due', dp && dp.under && dp.due, JSON.stringify(dp));
|
|
164
|
+
await shot(p, 'task-dates-1440', '#czViewer');
|
|
165
|
+
await p.click(C + ' .tkc-dp [data-tkc-day="2026-10-29"]');
|
|
166
|
+
ok('D4 a day saves the due date at once (tasks/edit) with Undo; the picker stays open for the start', await until(async () => /20 → 29 Oct/.test((await view(p)).due)) && last(A, '/api/boards/tasks/edit').body.due === '2026-10-29'
|
|
167
|
+
&& await p.evaluate((c) => !!document.querySelector(c + ' .tkc-dp'), C));
|
|
168
|
+
await p.click(C + ' .tkc-dp [data-tkc-field="start"]');
|
|
169
|
+
await p.click(C + ' .tkc-dp [data-tkc-day="2026-10-31"]');
|
|
170
|
+
ok('D4 a start after the due day moves the due day with it', await until(() => { const b = last(A, '/api/boards/tasks/edit').body; return b.start === '2026-10-31' && b.due === '2026-10-31'; }), JSON.stringify(last(A, '/api/boards/tasks/edit')));
|
|
171
|
+
await p.mouse.click(5, 5);
|
|
172
|
+
ok('D4 a press outside closes the picker', await until(() => p.evaluate((c) => !document.querySelector(c + ' .tkc-dp'), C)));
|
|
173
|
+
// owner
|
|
174
|
+
await p.click(C + ' [data-tkc="owner"]');
|
|
175
|
+
await until(() => p.evaluate((c) => !!document.querySelector(c + ' [data-tkc-form="owner"] input'), C));
|
|
176
|
+
await p.fill(C + ' [data-tkc-form="owner"] input', 'Rudi');
|
|
177
|
+
await p.press(C + ' [data-tkc-form="owner"] input', 'Enter');
|
|
178
|
+
ok('D5 a new owner saves at once and the chip shows it', await until(async () => (await view(p)).chips.includes('Owner: Rudi. Change')) && last(A, '/api/boards/tasks/edit').body.owner === 'Rudi');
|
|
179
|
+
await p.click('#toast .undo');
|
|
180
|
+
ok('D5 Undo gives the owner back', await until(async () => (await view(p)).chips.includes('Owner: Dara. Change')) && last(A, '/api/boards/tasks/edit').body.owner === 'Dara');
|
|
181
|
+
// group
|
|
182
|
+
await p.click(C + ' [data-tkc="group"]');
|
|
183
|
+
await p.click(C + ' [data-tkc-group="Legal"]');
|
|
184
|
+
ok('D6 a group from the initiative\'s groups (initiative-layout place)', await until(async () => (await view(p)).chips.includes('Group: Legal. Change')) && last(A, '/api/initiative-layout').body.group === 'Legal' && last(A, '/api/initiative-layout').body.task === 'task:t1');
|
|
185
|
+
// notes
|
|
186
|
+
await p.click(C + ' [data-tkc-notes]');
|
|
187
|
+
await p.keyboard.type('Ask legal before the UAT.');
|
|
188
|
+
await p.keyboard.press('Tab');
|
|
189
|
+
ok('D7 notes save on blur', await until(() => (last(A, '/api/boards/tasks/edit') || { body: {} }).body.notes === 'Ask legal before the UAT.') && /Notes saved/.test((await view(p)).toast));
|
|
190
|
+
// move
|
|
191
|
+
await p.click(C + ' [data-tkc="move"]');
|
|
192
|
+
const mv = await until(() => p.evaluate((c) => [...document.querySelectorAll(c + ' [data-tkc-move]')].map((b) => b.textContent.trim()), C));
|
|
193
|
+
ok('D8 the move icon lists the board\'s other initiatives', mv && mv.join() === 'Partner portal', JSON.stringify(mv));
|
|
194
|
+
await p.click(C + ' [data-tkc-move="other"]');
|
|
195
|
+
ok('D8 a move saves at once and the initiative row follows; Undo moves it back', await until(async () => (await view(p)).ini === 'Partner portal') && last(A, '/api/boards/tasks/edit').body.initiative === 'other'
|
|
196
|
+
&& (await p.click('#toast .undo'), await until(async () => (await view(p)).ini === 'Self-serve onboarding v2')) && last(A, '/api/boards/tasks/edit').body.initiative === 'self-serve-v2');
|
|
197
|
+
ok('D9 the page raised no error', A.errors.length === 0, A.errors.join(' | '));
|
|
198
|
+
await A.ctx.close();
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/* D10 a Jira ticket: Jira's fields plain, its key and freshness, notes editable */
|
|
202
|
+
{
|
|
203
|
+
const A = await open(), p = A.page;
|
|
204
|
+
await openTask(p, 'task:ONB-12');
|
|
205
|
+
const v = await until(() => p.evaluate((c) => { const el = document.querySelector(c + '.jira'); if (!el) return null; const t = (n) => (n ? n.textContent.replace(/\s+/g, ' ').trim() : '');
|
|
206
|
+
return { rost: t(el.querySelector('.rost')), jl: t(el.querySelector('.jl')), seg: !!el.querySelector('[data-tkc-state]'), move: !!el.querySelector('[data-tkc="move"]'), chk: (document.querySelector('#czViewer .cz-vw-chk') || {}).disabled }; }, C), 15000);
|
|
207
|
+
ok('D10 a Jira ticket: the status as plain text, "ONB-12 · read 4 min ago", no status buttons, no move; the check box is not a press', v && v.rost === 'In progress' && /ONB-12\s*· read 4 min ago/.test(v.jl) && !v.seg && !v.move && v.chk === true, JSON.stringify(v));
|
|
208
|
+
await shot(p, 'task-jira-1440', '#czViewer');
|
|
209
|
+
await p.click(C + ' [data-tkc-notes]');
|
|
210
|
+
await p.keyboard.type('Ask Dita about the cut-over.');
|
|
211
|
+
await p.keyboard.press('Control+Enter');
|
|
212
|
+
ok('D10 its notes are the PM\'s own and save by its key', await until(() => { const x = last(A, '/api/boards/tickets/note'); return x && x.body.ref === 'ONB-12' && x.body.notes === 'Ask Dita about the cut-over.'; }), JSON.stringify(A.posts));
|
|
213
|
+
ok('D10 the page raised no error', A.errors.length === 0, A.errors.join(' | '));
|
|
214
|
+
await A.ctx.close();
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/* D11 Home's list opens the same card (home-task.js) */
|
|
218
|
+
{
|
|
219
|
+
const A = await open(), p = A.page;
|
|
220
|
+
await p.evaluate(async () => {
|
|
221
|
+
const VW = await import('/pm/cozy-viewer.js'), M = await import('/pm/home-task.js'), H = await import('/pm/http.js');
|
|
222
|
+
M.openTask({ uid: 't1', src: 'pmos', title: 'UAT with five partners', status: 'To do', owner: 'Dara', ini: 'self-serve-v2', start: '2026-10-20', end: '2026-10-27', board: 'w1' },
|
|
223
|
+
{ VW, pmPost: H.pmPost, toast: () => {}, now: () => Date.now(), ws: 'w1', board: 'w1', iniTitle: () => 'Self-serve onboarding v2', openIni: () => {}, askInChat: () => {}, owners: () => ['Dara', 'Rudi'], inis: () => [] });
|
|
224
|
+
});
|
|
225
|
+
const v = await until(async () => { const x = await view(p); return x && x.chips.length >= 2 ? x : null; }, 15000);
|
|
226
|
+
ok('D11 Home\'s list: the same card, with the check box and the group read from the layout', v && v.on === 'To do' && v.chips.includes('Group: Launch. Change') && v.chk && /s-todo/.test(v.chk.cls), JSON.stringify(v));
|
|
227
|
+
await p.click(C + ' [data-tkc-state="Won\'t do"]');
|
|
228
|
+
ok('D11 a status press from Home saves through the same route', await until(() => (last(A, '/api/boards/tasks/state') || { body: {} }).body.state === "Won't do"));
|
|
229
|
+
ok('D11 the page raised no error', A.errors.length === 0, A.errors.join(' | '));
|
|
230
|
+
await A.ctx.close();
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/* D12 the phone, dark: the same card, chips wrap under it */
|
|
234
|
+
{
|
|
235
|
+
const A = await open({ w: 390, h: 844, theme: 'dark' }), p = A.page;
|
|
236
|
+
await openTask(p, 'task:t1');
|
|
237
|
+
const v = await until(async () => { const x = await view(p); return x && x.chips.length >= 2 ? x : null; }, 15000);
|
|
238
|
+
const fit = await p.evaluate((c) => { const el = document.querySelector(c); const r = el.getBoundingClientRect(); return { w: r.width, over: document.documentElement.scrollWidth > innerWidth + 1, segW: el.querySelector('.seg').getBoundingClientRect().right <= innerWidth }; }, C);
|
|
239
|
+
ok('D12 the phone: the card fills the sheet with no sideways scroll, and the status buttons fit', v && fit.w > 300 && !fit.over && fit.segW, JSON.stringify(fit));
|
|
240
|
+
await p.click(C + ' [data-tkc="dates"]');
|
|
241
|
+
const dp = await until(() => p.evaluate((c) => { const pop = document.querySelector(c + ' .tkc-dp'); if (!pop) return null; const r = pop.getBoundingClientRect(); return r.right <= innerWidth + 1 && r.left >= -1; }, C));
|
|
242
|
+
ok('D12 the picker stays on the screen', dp === true);
|
|
243
|
+
await shot(p, 'task-phone-390-dark');
|
|
244
|
+
ok('D12 the page raised no error', A.errors.length === 0, A.errors.join(' | '));
|
|
245
|
+
await A.ctx.close();
|
|
246
|
+
}
|
|
247
|
+
finish();
|
|
248
|
+
})();
|
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
{
|
|
2
|
-
"_comment": "core-documents backend: the sets, state, store, CLI, run, tick and needs rows in process, and the core-docs routes on a real server with a stub claude.",
|
|
3
|
-
"modules": [
|
|
4
|
-
|
|
2
|
+
"_comment": "core-documents backend: the sets, state, store, CLI, run, tick and needs rows in process, and the core-docs routes on a real server with a stub claude. core-docs-workflow.test.js: an initiative's documents follow its library workflow (D99).",
|
|
3
|
+
"modules": [
|
|
4
|
+
"core-docs.test.js",
|
|
5
|
+
"core-docs-server.test.js",
|
|
6
|
+
"core-docs-workflow.test.js"
|
|
7
|
+
],
|
|
8
|
+
"seconds": {
|
|
9
|
+
"core-docs.test.js": 4,
|
|
10
|
+
"core-docs-server.test.js": 12,
|
|
11
|
+
"core-docs-workflow.test.js": 1,
|
|
12
|
+
"core-docs-workflow-test.js": 30
|
|
13
|
+
},
|
|
14
|
+
"panels": [
|
|
15
|
+
"core-docs-workflow-test.js"
|
|
16
|
+
]
|
|
5
17
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "feedback batch 3 item 5 (option A): one order per program's initiatives, a drag grip and Claude's order from the dates (canvas RoADrag, RoASuggest, RoAApplied, RoAPhone).",
|
|
3
|
+
"modules": ["program-order.test.js"],
|
|
4
|
+
"panels": ["program-order-test.js"],
|
|
5
|
+
"seconds": { "program-order.test.js": 2, "program-order-test.js": 40 }
|
|
6
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "Third feedback batch item 7 (agreed A+C 1, 2026-10-25): a task edits where it opens, one card everywhere (task-card.js; canvas XetX1Rest, XetX1Dates, XetX1Done, XetX1Jira, XetX1Phone). The panel suite holds the pure checks too and serves the real page.",
|
|
3
|
+
"modules": [],
|
|
4
|
+
"panels": ["task-card-test.js"],
|
|
5
|
+
"seconds": { "task-card-test.js": 30 }
|
|
6
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "bug 2026-10-25 (third feedback batch, item 1): an agent sees and moves an initiative's workflow stage (pmos workflow of|move|switch), the initiative chat states it, task stages stay apart, and a library workflow's stage card lists its own To finish steps.",
|
|
3
|
+
"modules": ["workflow-stage.test.js"],
|
|
4
|
+
"seconds": { "workflow-stage.test.js": 3 }
|
|
5
|
+
}
|