create-pmos 0.421.0 → 0.422.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/anchor-resolve.js +93 -15
- package/payload/state/discoveries.md +1 -1
- package/workspace/board-programs-test.js +59 -3
- package/workspace/briefing-premium-board-test.js +1 -1
- package/workspace/changelog.json +12 -0
- package/workspace/fixtures/report-api/draft.json +2 -1
- package/workspace/guide/briefing-premium.md +1 -0
- package/workspace/guide/home.md +5 -2
- package/workspace/guide/programs.md +4 -3
- package/workspace/home-other-product-test.js +55 -0
- package/workspace/lib/board-premium.js +18 -4
- package/workspace/lib/doc-live-root.js +37 -0
- package/workspace/lib/engine/anchor-resolve.js +93 -15
- package/workspace/lib/engine/boards.js +7 -2
- package/workspace/lib/engine/intake.js +1 -1
- package/workspace/lib/hold-spans.js +24 -10
- package/workspace/lib/kg.js +1 -1
- package/workspace/lib/report-draft.js +3 -0
- package/workspace/lib/route-modules.js +1 -0
- package/workspace/lib/routes-board-premium.js +6 -0
- package/workspace/lib/routes-boards.js +48 -9
- package/workspace/lib/routes-doc-sheet.js +29 -1
- package/workspace/lib/routes-programs.js +44 -5
- package/workspace/lib/routes-task-plans.js +333 -0
- package/workspace/lib/task-cli.js +16 -9
- package/workspace/lib/task-items.js +1 -1
- package/workspace/lib/task-plans.js +232 -0
- package/workspace/lib/vendor/scripts/anchor-resolve.js +93 -15
- package/workspace/lib/vendor/scripts/intake.js +1 -1
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-vw-doc-test.js +26 -3
- package/workspace/program-leave-test.js +203 -0
- package/workspace/public/pm/bd-acts.js +5 -2
- package/workspace/public/pm/bd-ini-panel.js +20 -7
- package/workspace/public/pm/bd-prog-panel.js +22 -7
- package/workspace/public/pm/bd-span.js +175 -25
- package/workspace/public/pm/cozy-board.css +80 -0
- package/workspace/public/pm/cozy-home.css +3 -0
- package/workspace/public/pm/doc-follow.js +36 -0
- package/workspace/public/pm/home-app.js +38 -7
- package/workspace/public/pm/home-ini.js +11 -2
- package/workspace/public/pm/home-list.js +2 -2
- package/workspace/public/pm/home-today.js +3 -1
- package/workspace/public/pm/ini-tasks.js +81 -16
- package/workspace/public/pm/ini-versions.js +343 -0
- package/workspace/public/pm/ini-view-model.js +27 -41
- package/workspace/public/pm/ini-view.css +82 -0
- package/workspace/public/pm/ini-view.js +17 -10
- package/workspace/public/pm/premium-board.js +109 -18
- package/workspace/public/pm/premium-report-read.js +20 -1
- package/workspace/public/pm/premium-shell.js +29 -4
- package/workspace/public/pm/premium-vw-doc.js +46 -11
- package/workspace/public/pm/prog-move.js +69 -0
- package/workspace/public/pm/task-card.css +3 -0
- package/workspace/public/pm/task-card.js +10 -3
- package/workspace/task-milestones-test.js +176 -0
- package/workspace/task-plans-test.js +175 -0
- package/workspace/task-views-test.js +2 -2
- package/workspace/test-lists/program-leave.json +6 -0
- package/workspace/test-lists/task-milestones.json +6 -0
- package/workspace/test-lists/task-plans.json +6 -0
- package/workspace/test-lists/viewer-live-file.json +9 -0
- package/workspace/timeline-holds-test.js +61 -4
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/* pm/prog-move.js — move an initiative out of its program, or to another one (feedback batch 11 item 2, option A agreed 2026-10-26; canvas
|
|
2
|
+
* LpA1More, LpA2Other, LpA3Done, LpA4Phone, LpA5PhoneDone). The initiative's ⋯ gets the two items on the Board panel (bd-ini-panel.js), the Home
|
|
3
|
+
* initiative page (home-ini.js) and the phone sheet that uses the same menu. "Turn into a program" stays for an initiative in no program.
|
|
4
|
+
*
|
|
5
|
+
* moveItems(o) the ⋯ items, or [] when the initiative is in no program:
|
|
6
|
+
* "Move out of <program>" one press, no confirm (POST /api/programs/member leave)
|
|
7
|
+
* "Move to another program ›" the other open programs, "state · N initiatives"; hidden when there is none
|
|
8
|
+
* o: { programs() GET /api/programs' list, ws the initiative's workspace, id, product the product group it lands in, pmPost, say(msg, undo)
|
|
9
|
+
* the page's toast, reload() the page and its programs read again, openList(anchor, label, rows [{ label, sub, icon, go }]) the page's
|
|
10
|
+
* small menu, phone() true on a phone, stateOf?(p) the program's state from programState }
|
|
11
|
+
* outText(program, product, n, phone) the toast: "Moved out of Project Ascent · now under IDPF · off 1 milestone"; a phone says only
|
|
12
|
+
* "Now under IDPF · off 1 milestone". Zero milestones is silence.
|
|
13
|
+
*
|
|
14
|
+
* The leave also takes the initiative off the charter's milestones that wait on it (lib/routes-programs.js answers `off`): a milestone that waits
|
|
15
|
+
* on an initiative that left could never be done. Undo rejoins the old program with `back` = that list, so the milestones wait on it again; the
|
|
16
|
+
* program's order line still names it, so it comes back to its place. Tasks, the KR anchor, the workflow, Jira links and the chat do not move. */
|
|
17
|
+
import { programOf } from './program-model.js';
|
|
18
|
+
|
|
19
|
+
export const OUT_ICON = 'M14 4h6v6M20 4l-8 8M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5';
|
|
20
|
+
export const LAYERS_ICON = 'M12 3l9 5-9 5-9-5zM3 13l9 5 9-5M3 17.5l9 5 9-5';
|
|
21
|
+
const ms = (n) => (n ? ' · off ' + n + ' milestone' + (n === 1 ? '' : 's') : '');
|
|
22
|
+
|
|
23
|
+
export function outText(p, product, n, phone) {
|
|
24
|
+
if (phone && product) return 'Now under ' + product + ms(n);
|
|
25
|
+
return 'Moved out of ' + p.title + (product ? ' · now under ' + product : '') + ms(n);
|
|
26
|
+
}
|
|
27
|
+
/** The program's line in the list: its state and how many initiatives it holds ("Running · 3 initiatives"). */
|
|
28
|
+
function subOf(o, p) {
|
|
29
|
+
const n = (p.members || []).length, st = o.stateOf ? o.stateOf(p) : null;
|
|
30
|
+
return (st && st.state ? st.state + ' · ' : '') + n + ' initiative' + (n === 1 ? '' : 's');
|
|
31
|
+
}
|
|
32
|
+
/** The workspace of the initiative's member line: the leave goes beside it, where the ledger folds it. */
|
|
33
|
+
const wsIn = (p, o) => ((p.members || []).find((m) => m.initiative === o.id && (!m.ws || !o.ws || m.ws === o.ws)) || {}).ws || o.ws || null;
|
|
34
|
+
|
|
35
|
+
export function moveItems(o) {
|
|
36
|
+
const L = (o.programs && o.programs()) || [], p = o.id ? programOf(L, o.ws || '', o.id) : null;
|
|
37
|
+
if (!p) return [];
|
|
38
|
+
const out = [{ label: 'Move out of ' + p.title, icon: OUT_ICON, on: () => moveOut(o, p) }];
|
|
39
|
+
const others = L.filter((x) => x && x.id !== p.id && !x.archived);
|
|
40
|
+
if (others.length) {
|
|
41
|
+
out.push({ label: 'Move to another program', icon: LAYERS_ICON, note: '›',
|
|
42
|
+
on: (b) => o.openList(b, 'Move to', others.map((x) => ({ label: x.title, sub: subOf(o, x), icon: LAYERS_ICON, go: () => moveInto(o, p, x) }))) });
|
|
43
|
+
}
|
|
44
|
+
return out;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
async function moveOut(o, p) {
|
|
48
|
+
const ws = wsIn(p, o);
|
|
49
|
+
const r = await o.pmPost('/api/programs/member', { ws, program: p.id, initiative: o.id, leave: true }).catch(() => null);
|
|
50
|
+
if (!r || !r.ok) { o.say((r && r.error) || 'It did not move out. The server did not say why.'); return; }
|
|
51
|
+
const off = r.off || [];
|
|
52
|
+
o.say(outText(p, o.product, off.length, o.phone && o.phone()), () => back(o, ws, p, off));
|
|
53
|
+
await o.reload();
|
|
54
|
+
}
|
|
55
|
+
async function moveInto(o, p, to) {
|
|
56
|
+
const ws = wsIn(p, o);
|
|
57
|
+
const r = await o.pmPost('/api/programs/member', { ws, program: to.id, initiative: o.id }).catch(() => null);
|
|
58
|
+
if (!r || !r.ok) { o.say((r && r.error) || 'It did not move. The server did not say why.'); return; }
|
|
59
|
+
const off = (r.left && r.left.off) || [];
|
|
60
|
+
o.say('Moved to ' + to.title + ms(off.length), () => back(o, ws, p, off));
|
|
61
|
+
await o.reload();
|
|
62
|
+
}
|
|
63
|
+
/** Undo: rejoin the old program (which leaves the new one), and wait on the milestones again. */
|
|
64
|
+
async function back(o, ws, p, off) {
|
|
65
|
+
const u = await o.pmPost('/api/programs/member', { ws, program: p.id, initiative: o.id, back: off }).catch(() => null);
|
|
66
|
+
o.say(u && u.ok ? 'Back in ' + p.title + '.' : (u && u.error) || 'The undo did not land.');
|
|
67
|
+
await o.reload();
|
|
68
|
+
return u;
|
|
69
|
+
}
|
|
@@ -81,3 +81,6 @@
|
|
|
81
81
|
.tkc .ovf { column-gap: 12px; padding: 12px 14px; }
|
|
82
82
|
.tkc .ovf .tkc-dp { left: -64px; } /* the picker starts at the card's edge, so it stays on the screen */
|
|
83
83
|
}
|
|
84
|
+
/* the ◇ milestone toggle after a divider (feedback batch 11 item 3, canvas XmlA2Flag) */
|
|
85
|
+
.tkc .seg .vr { width: 1px; height: 20px; background: var(--cz-hair); margin: 0 3px; align-self: center; }
|
|
86
|
+
.tkc .seg .ivq-ms.on { width: auto; padding: 0 12px 0 9px; gap: 6px; background: var(--cz-bluebg); color: var(--cz-blueink); font-weight: 800; font-size: 13px; box-shadow: inset 0 0 0 1.5px var(--cz-blue); }
|
|
@@ -57,7 +57,7 @@ export function taskOf(row, extra = {}) {
|
|
|
57
57
|
uid: r.uid || '', key: r.key && /^task:/.test(r.key) ? r.key : 'task:' + (r.uid || r.key || ''), title: r.title || '', status: r.status || r.state || 'To do',
|
|
58
58
|
start: r.start || '', due: r.end || r.due || '', owner: r.owner || '', notes: r.notes || '', ini: r.ini || extra.ini || '',
|
|
59
59
|
iniTitle: extra.iniTitle || '', group: extra.group != null ? extra.group : '', board: r.board || extra.board || '',
|
|
60
|
-
section: typeof r.section === 'string' ? r.section : '', wbs: r.wbs && (r.wbs.title || r.wbs.id) ? { id: r.wbs.id || '', title: r.wbs.title || r.wbs.id } : null,
|
|
60
|
+
section: typeof r.section === 'string' ? r.section : '', milestone: !!r.milestone, wbs: r.wbs && (r.wbs.title || r.wbs.id) ? { id: r.wbs.id || '', title: r.wbs.title || r.wbs.id } : null,
|
|
61
61
|
jira: jira ? { key: r.ref || r.key || r.uid || '', readAt: r.readAt || extra.readAt || '' } : null,
|
|
62
62
|
};
|
|
63
63
|
}
|
|
@@ -167,7 +167,10 @@ export function cardHtml(t, o = {}) {
|
|
|
167
167
|
const ownerBtn = t.owner
|
|
168
168
|
? `<button type="button" class="own-b${oOpen ? ' open' : ''}" data-tkc="owner" aria-label="Owner: ${esc(t.owner)}. Change" title="Owner" aria-expanded="${oOpen}"><span class="av">${esc(initials(t.owner))}</span>${esc(t.owner)}</button>`
|
|
169
169
|
: `<button type="button" class="own-b ghost${oOpen ? ' open' : ''}" data-tkc="owner" aria-label="Add an owner" title="Owner" aria-expanded="${oOpen}"><span class="av no"></span></button>`;
|
|
170
|
-
|
|
170
|
+
// after a divider, the ◇ toggle (feedback batch 11 item 3, canvas XmlA2Flag): its due date shows as ◇ on the Board and the timeline
|
|
171
|
+
const msOn = !!t.milestone, msTip = msOn ? 'A milestone. Press to make it a plain task' : 'Make it a milestone: its due date shows as ◇ on the Board and the timeline';
|
|
172
|
+
const msBtn = `<span class="vr" aria-hidden="true"></span><button type="button" class="ivq-ms${msOn ? ' on' : ''}" data-tkc-ms aria-pressed="${msOn}" aria-label="${msOn ? 'Milestone' : 'Make it a milestone'}" title="${msTip}">${ico(I.dia, 15)}${msOn ? 'Milestone' : ''}</button>`;
|
|
173
|
+
const facts = `<div class="ovf tkc-f"><span class="k">Status</span><div class="v"><div class="seg" role="radiogroup" aria-label="Status">${seg}${msBtn}</div></div>`
|
|
171
174
|
+ `<span class="k">Due</span><div class="v"><span class="anc">${dueBtn}${dOpen ? picker(t, o, now) : ''}</span>${late}</div>`
|
|
172
175
|
+ `<span class="k">Owner</span><div class="v"><span class="anc">${ownerBtn}${ownerPop}</span></div></div>`;
|
|
173
176
|
const notes = `<div class="ovb"><label class="ovl" for="tkcNotes">Notes</label><textarea class="nt" id="tkcNotes" data-tkc-notes rows="2" maxlength="4000" placeholder="Add notes">${esc(t.notes)}</textarea></div>`;
|
|
@@ -196,6 +199,7 @@ const WORDS = {
|
|
|
196
199
|
notes: () => 'Notes saved',
|
|
197
200
|
dates: (t) => (dueLine(t).text || 'No dates'),
|
|
198
201
|
initiative: (t) => 'Moved to ' + (t.iniTitle || t.ini),
|
|
202
|
+
milestone: (t) => (t.milestone ? 'Milestone' : 'Not a milestone'),
|
|
199
203
|
};
|
|
200
204
|
|
|
201
205
|
export function mountCard(el, t, h) {
|
|
@@ -234,6 +238,7 @@ export function mountCard(el, t, h) {
|
|
|
234
238
|
const b = e.target.closest('button'); if (!b || b.disabled || !el.contains(b)) return;
|
|
235
239
|
const d = b.dataset;
|
|
236
240
|
if (d.tkcState) { if (d.tkcState !== t.status) { st.open = null; change('status', { status: d.tkcState }); } return; }
|
|
241
|
+
if ('tkcMs' in d) { st.open = null; change('milestone', { milestone: !t.milestone }); return; }
|
|
237
242
|
if (d.tkcDay != null && b.closest('.tkc-dp')) { pick(d.tkcDay); return; }
|
|
238
243
|
if (d.tkcField) { st.field = d.tkcField; st.month = ''; draw(); return; }
|
|
239
244
|
if (d.tkcMonth) { st.month = d.tkcMonth; draw(); return; }
|
|
@@ -303,13 +308,15 @@ export function boardSaver(o) {
|
|
|
303
308
|
const { ws, board, t, post } = o;
|
|
304
309
|
return async (patch) => {
|
|
305
310
|
if (t.jira) {
|
|
311
|
+
// a Jira ticket takes the ◇ flag only (batch 11 item 3); its date stays Jira's
|
|
312
|
+
if (patch.milestone != null) return post('/api/boards/tasks/edit', { ws, board, task: t.jira.key, milestone: !!patch.milestone });
|
|
306
313
|
if (patch.notes == null) return { ok: false, error: 'Jira owns this. Change it in Jira.' };
|
|
307
314
|
return post('/api/boards/tickets/note', { ws, board, ref: t.jira.key, notes: patch.notes });
|
|
308
315
|
}
|
|
309
316
|
if (patch.status != null) return post('/api/boards/tasks/state', { ws, board, task: t.uid, state: patch.status });
|
|
310
317
|
if (patch.group != null) return post('/api/initiative-layout', { ws, kind: 'place', initiative: t.ini, task: t.key, group: patch.group });
|
|
311
318
|
const body = {};
|
|
312
|
-
for (const k of ['owner', 'notes', 'start', 'due', 'section', 'initiative']) if (patch[k] != null) body[k] = patch[k];
|
|
319
|
+
for (const k of ['owner', 'notes', 'start', 'due', 'section', 'initiative', 'milestone']) if (patch[k] != null) body[k] = patch[k];
|
|
313
320
|
return post('/api/boards/tasks/edit', { ws, board, task: t.uid, ...body });
|
|
314
321
|
};
|
|
315
322
|
}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
/* task-milestones-test.js — several milestones per initiative on the page (feedback batch 11 item 3; canvas In development, row "Several
|
|
4
|
+
* milestones per initiative": XmlA1Board, XmlA4Hover, XmlA5Phone, XmlA7Spans, XmlA2Flag, XmlA3Viewer, XmlAGrill). Serves the real page from the
|
|
5
|
+
* real server; GET /api/board-premium answers a board built by lib/board-premium.js from rows and work items that carry the ◇ flag. The page's
|
|
6
|
+
* clock is the fixture's (17 Oct 2026). POST /api/boards/tasks/edit is answered here and its bodies are kept.
|
|
7
|
+
* B the Board row: one ◇ per milestone at its due date, filled when done, orange and an orange date when late (the row's dot turns orange
|
|
8
|
+
* too); the Evaluate task IS the end ◇ (said once); the Deliver task keeps its own ◇ with "◆ Deliver" in its name; the legend says Milestone
|
|
9
|
+
* M close ◇s merge into one counted ◇; pressing it lists them under it; a row opens the task card
|
|
10
|
+
* S Quarter puts a date under each ◇; 5 yr none
|
|
11
|
+
* F the status picker: ◇ after a divider; a press writes milestone true; the List shows ◇ after a milestone's title and asks for a due date
|
|
12
|
+
* V the Tasks Timeline: a milestone's bar ends in its ◇ with the date; a dashed guide drops at its date
|
|
13
|
+
* P the phone: no dates; a tap on the row's lane opens a sheet with its milestones
|
|
14
|
+
* SHOTS_3=<dir>: the Board, the counted ◇'s list, the picker, the Tasks Timeline and the phone sheet, into <dir>. */
|
|
15
|
+
const path = require('path');
|
|
16
|
+
const { spawn } = require('child_process');
|
|
17
|
+
const { findBrowser } = require('./lib/find-browser');
|
|
18
|
+
const T = require('./test-run').configure({ name: 'task-milestones' });
|
|
19
|
+
const BP = require('./lib/board-premium.js');
|
|
20
|
+
const F = require('./fixtures/board-premium-facts.js');
|
|
21
|
+
|
|
22
|
+
const BASE = T.BASE;
|
|
23
|
+
const results = [];
|
|
24
|
+
const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + extra : ''}`); };
|
|
25
|
+
let srv = null; let browser = null;
|
|
26
|
+
const finish = async (code) => {
|
|
27
|
+
if (browser) await browser.close().catch(() => {});
|
|
28
|
+
if (srv) { try { srv.kill('SIGKILL'); } catch { /* gone */ } }
|
|
29
|
+
T.killTmux();
|
|
30
|
+
const bad = results.filter((x) => !x.cond).length;
|
|
31
|
+
console.log(`\n${results.length - bad}/${results.length} task-milestones assertions passed`);
|
|
32
|
+
process.exit(code !== undefined ? code : (bad ? 1 : 0));
|
|
33
|
+
};
|
|
34
|
+
process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
35
|
+
|
|
36
|
+
const ROWS = [
|
|
37
|
+
F.row('scarlet', 'Scarlet — ST What’s The News', { owner: 'Wawan', stage: 'Build', start: '2026-11-02', end: '2027-03-31', progress: 30 }),
|
|
38
|
+
F.row('passkey', 'Passkey sign-in', { owner: 'Lee', start: '2026-09-15', end: '2027-02-26', progress: 45 }),
|
|
39
|
+
F.row('recovery', 'Recovery codes', { owner: 'Dara', start: '2026-12-01', end: '2027-04-30', progress: 10 }),
|
|
40
|
+
F.row('email-otp', 'Email OTP', { start: '2026-11-10', end: '2027-06-30', progress: 5 }),
|
|
41
|
+
];
|
|
42
|
+
const it = (ini, uid, title, o) => ({ uid, key: '', kind: 'Task', src: 'pmos', title, status: 'To do', owner: 'Wawan', ini, start: null, end: null, ref: uid, board: 'w1', milestone: true, ...o });
|
|
43
|
+
const ITEMS = [
|
|
44
|
+
it('scarlet', 'task-pilot', 'Pilot with 2 newsrooms', { status: 'Done', start: '2026-11-02', end: '2026-12-11', section: 'build' }),
|
|
45
|
+
it('scarlet', 'task-api', 'Ship the article summaries API', { status: 'In progress', start: '2026-11-02', end: '2027-01-08', section: 'build', milestone: false }),
|
|
46
|
+
it('scarlet', 'task-feat', 'Feature delivered', { start: '2027-01-18', end: '2027-01-29', section: 'deliver' }),
|
|
47
|
+
it('scarlet', 'task-kpi', 'KPI evaluated', { start: '2027-03-22', end: '2027-03-31', section: 'evaluate' }),
|
|
48
|
+
it('scarlet', 'task-faq', 'Support FAQ', { section: 'evaluate', end: null }),
|
|
49
|
+
it('passkey', 'task-late', 'Beta to staff', { start: '2026-10-01', end: '2026-10-16' }),
|
|
50
|
+
it('passkey', 'task-pk2', 'Rollout 50%', { end: '2026-12-18' }),
|
|
51
|
+
it('recovery', 'task-c1', 'Codes live', { end: '2027-03-02' }),
|
|
52
|
+
it('recovery', 'task-c2', 'Support FAQ live', { end: '2027-03-06' }),
|
|
53
|
+
it('recovery', 'task-wont', 'Dropped', { end: '2027-02-01', status: "Won't do" }),
|
|
54
|
+
];
|
|
55
|
+
|
|
56
|
+
(async () => {
|
|
57
|
+
const exe = findBrowser();
|
|
58
|
+
if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the suite cannot run'); return finish(1); }
|
|
59
|
+
let chromium;
|
|
60
|
+
try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
|
|
61
|
+
srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
|
|
62
|
+
await T.waitForServer(BASE);
|
|
63
|
+
browser = await chromium.launch({ executablePath: exe });
|
|
64
|
+
|
|
65
|
+
/** The Board on the timeline. o: { w, h, span, dark, tasksView } */
|
|
66
|
+
const open = async (o = {}) => {
|
|
67
|
+
const ctx = await browser.newContext({ viewport: { width: o.w || 1440, height: o.h || 900 }, colorScheme: o.dark ? 'dark' : 'light', hasTouch: !!o.phone, isMobile: !!o.phone });
|
|
68
|
+
const page = await ctx.newPage();
|
|
69
|
+
const errors = [], posts = [];
|
|
70
|
+
page.on('pageerror', (e) => errors.push(String((e && e.stack) || e)));
|
|
71
|
+
await page.clock.setFixedTime(new Date(F.NOW));
|
|
72
|
+
const rows = ROWS.map((r) => ({ ...r }));
|
|
73
|
+
await page.route('**/api/board-premium*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model: BP.build(F.facts({ rows, total: rows.length, columns: [], items: ITEMS.map((x) => ({ ...x })) })), as_of: Date.now() }) }));
|
|
74
|
+
await page.route('**/api/programs', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, programs: [] }) }));
|
|
75
|
+
await page.route('**/api/board-trail*', (r) => r.fulfill({ status: 500, contentType: 'application/json', body: JSON.stringify({ ok: false, error: 'not in this check' }) }));
|
|
76
|
+
await page.route('**/api/boards/tasks/edit', (r) => { posts.push(JSON.parse(r.request().postData() || '{}')); r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, from: { milestone: false } }) }); });
|
|
77
|
+
await page.addInitScript(([s]) => { try { if (!sessionStorage.getItem('set')) { sessionStorage.setItem('set', '1'); for (const [k, v] of Object.entries(s)) localStorage.setItem(k, v); } } catch { /* none */ } }, [{ 'pmos.board.view': 'time', 'pmos.board.pview': 'time', 'pmos.board.span': o.span || 'year', 'pmos.tasks.view': o.tasksView || 'list', 'pmos.tasks.zoom': 'month' }]);
|
|
78
|
+
await page.goto(BASE + '/premium-board.html?ws=w1&board=w1');
|
|
79
|
+
await page.waitForSelector('#ibBody [data-row]', { timeout: 15000 });
|
|
80
|
+
await page.waitForTimeout(500);
|
|
81
|
+
return { ctx, page, errors, posts };
|
|
82
|
+
};
|
|
83
|
+
const shots = process.env.SHOTS_3;
|
|
84
|
+
const shot = async (p, name) => { if (shots) await p.screenshot({ path: path.join(shots, name + '.png') }); };
|
|
85
|
+
const rowOf = (p, key) => p.evaluate((k) => {
|
|
86
|
+
const r = document.querySelector(`#ibBody [data-row="${k}"]`); if (!r) return null;
|
|
87
|
+
return {
|
|
88
|
+
dot: (r.querySelector('.cz-dot') || {}).className || '',
|
|
89
|
+
tm: [...r.querySelectorAll('.tg-tm')].map((x) => x.className + '|' + x.getAttribute('title')),
|
|
90
|
+
tmc: [...r.querySelectorAll('.tg-tmc')].map((x) => x.className + '|' + x.textContent + '|' + x.dataset.msIds),
|
|
91
|
+
tml: [...r.querySelectorAll('.tg-tml')].map((x) => x.className + '|' + x.textContent),
|
|
92
|
+
end: r.querySelector('.tg-end') ? r.querySelector('.tg-end').className + '|' + r.querySelector('.tg-end').getAttribute('title') : '',
|
|
93
|
+
};
|
|
94
|
+
}, key);
|
|
95
|
+
|
|
96
|
+
/* B M — desktop, Year */
|
|
97
|
+
{
|
|
98
|
+
const { ctx, page: p, errors } = await open();
|
|
99
|
+
const sc = await rowOf(p, 'board:scarlet');
|
|
100
|
+
ok('B one ◇ per milestone: the done Pilot filled, Feature delivered open with "◆ Deliver" in its name; no ◇ for a plain task or one with no due date',
|
|
101
|
+
sc && sc.tm.length === 2 && /tg-tm dn\|Pilot with 2 newsrooms · Dec 11 · done/.test(sc.tm[0]) && /^tg-tm\|Feature delivered · Jan 29 · ◆ Deliver$/.test(sc.tm[1]), JSON.stringify(sc));
|
|
102
|
+
ok('B said once: the Evaluate task IS the end ◇ and takes its name; it is not drawn again', sc && /^tg-end\|KPI evaluated · Mar 31 · ◆ Evaluate$/.test(sc.end) && !sc.tm.some((x) => /KPI/.test(x)), JSON.stringify(sc));
|
|
103
|
+
ok('S Year cuts each date to fit and puts it under its ◇', sc && sc.tml.map((x) => x.split('|')[1]).join() === 'Dec 11,Jan 29', JSON.stringify(sc && sc.tml));
|
|
104
|
+
const pk = await rowOf(p, 'board:passkey');
|
|
105
|
+
ok('B a late milestone: an orange outline and an orange date, and the row\'s dot turns orange', pk && /tg-tm late/.test(pk.tm[0]) && /tg-tml late\|Oct 16/.test(pk.tml[0]) && /cz-dot late/.test(pk.dot), JSON.stringify(pk));
|
|
106
|
+
const rc = await rowOf(p, 'board:recovery');
|
|
107
|
+
ok('M two milestones four days apart merge into one counted ◇ with the range under it; Won\'t do is not drawn', rc && rc.tm.length === 0 && rc.tmc.length === 1 && /^tg-tmc\|2\|task-c1 task-c2$/.test(rc.tmc[0]) && rc.tml.join() === 'tg-tml|Mar 2–6', JSON.stringify(rc));
|
|
108
|
+
const lg = await p.evaluate(() => (document.querySelector('#bdChipset .tg-lgd') || document.querySelector('.tg-lgd') || {}).textContent || '');
|
|
109
|
+
ok('B the legend says Milestone, not "Deliver or Evaluate"', /Milestone/.test(lg) && !/Deliver or Evaluate/.test(lg), lg);
|
|
110
|
+
await shot(p, 'milestones-board-1440');
|
|
111
|
+
await p.click('#ibBody [data-row="board:recovery"] .tg-tmc');
|
|
112
|
+
const list = await p.evaluate(() => { const m = document.querySelector('.tg-msp'); return m ? [...m.querySelectorAll('[data-ms-open]')].map((b) => b.textContent) : null; });
|
|
113
|
+
ok('M the counted ◇ lists its milestones right under it: ◇, name, date', list && list.join('|') === 'Codes liveMar 2|Support FAQ liveMar 6', JSON.stringify(list));
|
|
114
|
+
await shot(p, 'milestones-board-list-1440');
|
|
115
|
+
await p.keyboard.press('Escape');
|
|
116
|
+
ok('M Escape closes the list', await p.evaluate(() => !document.querySelector('.tg-msp')));
|
|
117
|
+
ok('the Board threw nothing', !errors.length, errors.join('\n'));
|
|
118
|
+
await ctx.close();
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/* S — Quarter and 5 yr */
|
|
122
|
+
{
|
|
123
|
+
const { ctx, page: p } = await open({ span: 'quarter' });
|
|
124
|
+
const sc = await rowOf(p, 'board:scarlet');
|
|
125
|
+
ok('S Quarter puts a short date under every ◇', sc && sc.tml.map((x) => x.split('|')[1]).join() === 'Dec 11,Jan 29', JSON.stringify(sc && sc.tml));
|
|
126
|
+
await ctx.close();
|
|
127
|
+
const { ctx: c5, page: p5 } = await open({ span: 'y5' });
|
|
128
|
+
const s5 = await rowOf(p5, 'board:scarlet');
|
|
129
|
+
ok('S 5 yr draws the ◇s with no dates', s5 && !s5.tml.length && (s5.tm.length + s5.tmc.length) >= 1, JSON.stringify(s5));
|
|
130
|
+
await c5.close();
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/* F V — the initiative panel: the List, the status picker, the Tasks Timeline */
|
|
134
|
+
{
|
|
135
|
+
const { ctx, page: p, errors, posts } = await open();
|
|
136
|
+
await p.click('#ibBody [data-key="board:scarlet"]');
|
|
137
|
+
await p.waitForSelector('.iv-tr', { timeout: 8000 });
|
|
138
|
+
// every stage open, so each task row is drawn
|
|
139
|
+
const unfold = async (sel) => { for (let i = 0; i < 12; i++) { const b = await p.$(sel); if (!b) break; await b.click(); await p.waitForTimeout(80); } };
|
|
140
|
+
await unfold('.iv-ws[data-iv-fold^="sec:"][aria-expanded="false"]');
|
|
141
|
+
const rows = await p.evaluate(() => [...document.querySelectorAll('.iv-tr')].map((r) => ({ t: (r.querySelector('.iv-tt') || {}).textContent, ms: !!r.querySelector('.iv-ms'), ask: (r.querySelector('.iv-dc.ms') || {}).textContent || '' })));
|
|
142
|
+
const by = (t) => rows.find((x) => x.t === t) || {};
|
|
143
|
+
ok('F the List shows a small ◇ after a milestone task\'s title, none after a plain task', by('Feature delivered').ms && by('KPI evaluated').ms && !by('Ship the article summaries API').ms, JSON.stringify(rows));
|
|
144
|
+
ok('F a milestone with no due date asks for it in a dashed chip', by('Support FAQ').ask === 'Set the due date', JSON.stringify(by('Support FAQ')));
|
|
145
|
+
await p.click('.iv-tr:has(.iv-tt:text-is("Ship the article summaries API")) .iv-car');
|
|
146
|
+
const pick = await p.evaluate(() => { const b = document.querySelector('.ivq-st .ivq-ms'); return b ? { lbl: b.getAttribute('aria-label'), tip: b.getAttribute('title'), pressed: b.getAttribute('aria-pressed'), vr: document.querySelectorAll('.ivq-st .vr').length, text: b.textContent } : null; });
|
|
147
|
+
ok('F the status picker holds ◇ after a divider, icon only, its tooltip says what it does', pick && pick.lbl === 'Make it a milestone' && pick.pressed === 'false' && pick.vr === 2 && pick.text === '' && /due date shows as ◇ on the Board and the timeline/.test(pick.tip), JSON.stringify(pick));
|
|
148
|
+
await shot(p, 'milestones-picker-1440');
|
|
149
|
+
await p.click('.ivq-st .ivq-ms'); await p.waitForTimeout(300);
|
|
150
|
+
ok('F pressing ◇ writes milestone true for that task', posts.length === 1 && posts[0].task === 'task-api' && posts[0].milestone === true, JSON.stringify(posts));
|
|
151
|
+
// the Tasks Timeline
|
|
152
|
+
await p.evaluate(() => { const b = document.querySelector('[data-iv-view="timeline"]'); if (b) b.click(); });
|
|
153
|
+
await p.waitForSelector('.ivt', { timeout: 5000 });
|
|
154
|
+
await unfold('.ivt-gh[data-iv-fold^="sec:"][aria-expanded="false"]');
|
|
155
|
+
const tv = await p.evaluate(() => ({ ms: [...document.querySelectorAll('.ivt-ms')].map((x) => x.className + '|' + x.textContent), guides: document.querySelectorAll('.ivt-grid i.ms').length, lg: (document.querySelector('.ivt-lg') || {}).textContent || '' }));
|
|
156
|
+
ok('V a milestone\'s bar ends in its ◇ with the date beside it; a done one filled', tv.ms.some((x) => /^ivt-ms dn\|Dec 11$/.test(x)) && tv.ms.some((x) => /^ivt-ms\|Jan 29$/.test(x)) && tv.ms.some((x) => /^ivt-ms\|Mar 31$/.test(x)), JSON.stringify(tv));
|
|
157
|
+
ok('V a faint dashed guide drops at each milestone date, and the legend names Milestone', tv.guides === 3 && /Milestone/.test(tv.lg), JSON.stringify(tv));
|
|
158
|
+
await shot(p, 'milestones-viewer-timeline-1440');
|
|
159
|
+
ok('the panel threw nothing', !errors.length, errors.join('\n'));
|
|
160
|
+
await ctx.close();
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/* P — the phone */
|
|
164
|
+
{
|
|
165
|
+
const { ctx, page: p, errors } = await open({ w: 390, h: 844, phone: true });
|
|
166
|
+
const sc = await rowOf(p, 'board:scarlet');
|
|
167
|
+
ok('P the phone draws the ◇s with no dates', sc && sc.tm.length === 2 && !sc.tml.length, JSON.stringify(sc));
|
|
168
|
+
await p.click('#ibBody .tgq-r[data-row="board:scarlet"] > .tg-p', { position: { x: 300, y: 10 } });
|
|
169
|
+
const sh = await p.evaluate(() => { const m = document.querySelector('.tg-msp.sh'); return m ? { h: (m.querySelector('.h') || {}).textContent, rows: [...m.querySelectorAll('[data-ms-open]')].map((b) => b.textContent) } : null; });
|
|
170
|
+
ok('P a tap on the row opens a sheet with its milestones, the end one too', sh && sh.h === 'Scarlet — ST What’s The News' && sh.rows.join('|') === 'Pilot with 2 newsroomsDec 11|Feature deliveredJan 29|KPI evaluatedMar 31', JSON.stringify(sh));
|
|
171
|
+
await shot(p, 'milestones-phone-390');
|
|
172
|
+
ok('the phone threw nothing', !errors.length, errors.join('\n'));
|
|
173
|
+
await ctx.close();
|
|
174
|
+
}
|
|
175
|
+
finish();
|
|
176
|
+
})();
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
/* task-plans-test.js — planned versus actual on the real pages (feedback batch 11 item 8; canvas In development, row "Planned vs actual":
|
|
4
|
+
* PvaAC1Live, PvaAC2Menu, PvaAC3Draft, PvaAC4Board, PvaAC5Phone). Serves the real Board page from the real server; GET /api/board-premium
|
|
5
|
+
* answers fixtures/board-premium-facts.js with tasks, decorated by lib/task-plans.js from a saved plan and drafts. The page's clock is the
|
|
6
|
+
* fixture's (17 Oct 2026). The writes are answered here: nothing reaches a ledger.
|
|
7
|
+
* B Board timeline: the plan's thin line under the bar, the slip after the end date, a draft-only initiative dashed with its drafts named,
|
|
8
|
+
* the legend's To do, Plan and Draft
|
|
9
|
+
* V the initiative's Tasks timeline: the chip "Live" with the count of drafts, the end slip chip, a plan line only where the dates differ,
|
|
10
|
+
* ⊕ after a task added after the plan, a dropped task keeps only its line
|
|
11
|
+
* M the chip's menu right under it: Show (Live, drafts, New draft from Live), Compare with (plans, Nothing, Save Live as a plan)
|
|
12
|
+
* D a draft: the chip names it in blue, its bars are dashed, the seal "Make … live" shows; its summary, then ✓ posts Make live
|
|
13
|
+
* P a phone: the menu opens as a bottom sheet
|
|
14
|
+
* SHOTS=<dir> writes the screenshots there. */
|
|
15
|
+
const path = require('path');
|
|
16
|
+
const fs = require('fs');
|
|
17
|
+
const { spawn } = require('child_process');
|
|
18
|
+
const { findBrowser } = require('./lib/find-browser');
|
|
19
|
+
const T = require('./test-run').configure({ name: 'task-plans-ui' });
|
|
20
|
+
const BP = require('./lib/board-premium.js');
|
|
21
|
+
const F = require('./fixtures/board-premium-facts.js');
|
|
22
|
+
const TP = require('./lib/task-plans.js');
|
|
23
|
+
|
|
24
|
+
const BASE = T.BASE;
|
|
25
|
+
const SHOTS = process.env.SHOTS || '';
|
|
26
|
+
const results = [];
|
|
27
|
+
const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + extra : ''}`); };
|
|
28
|
+
let srv = null; let browser = null;
|
|
29
|
+
const finish = async (code) => {
|
|
30
|
+
if (browser) await browser.close().catch(() => {});
|
|
31
|
+
if (srv) { try { srv.kill('SIGKILL'); } catch { /* gone */ } }
|
|
32
|
+
T.killTmux();
|
|
33
|
+
const bad = results.filter((x) => !x.cond).length;
|
|
34
|
+
console.log(`\n${results.length - bad}/${results.length} task-plans-ui assertions passed`);
|
|
35
|
+
process.exit(code !== undefined ? code : (bad ? 1 : 0));
|
|
36
|
+
};
|
|
37
|
+
process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
38
|
+
|
|
39
|
+
/* the board: Partner API rate limits runs late against its plan; Usage-based billing has drafts only */
|
|
40
|
+
const task = (ini, uid, title, start, end, status = 'To do', o = {}) => ({ src: 'pmos', kind: 'Task', ini, uid, title, status, owner: 'Lee', start, end, ...o });
|
|
41
|
+
const ITEMS = [
|
|
42
|
+
task('partner-rate-limits', 'task-a', 'Draft the limits spec', '2026-10-05', '2026-10-20', 'In progress'),
|
|
43
|
+
task('partner-rate-limits', 'task-b', 'Ship the limits API', '2026-10-21', '2026-11-30'),
|
|
44
|
+
task('partner-rate-limits', 'task-c', 'Load test at 3x peak', '2026-11-10', '2026-11-20'),
|
|
45
|
+
task('partner-rate-limits', 'task-d', 'Offline docs', '2026-11-01', '2026-11-10', "Won't do"),
|
|
46
|
+
task('partner-rate-limits', 'task-e', 'Partner FAQ', '2026-11-02', '2026-11-06'),
|
|
47
|
+
];
|
|
48
|
+
const plan = { at: '2026-10-02T10:00:00Z', kind: 'plan', plan: 'plan-1', board: 'w1', initiative: 'partner-rate-limits', name: 'Proposal A · Oct 2', source: 'draft',
|
|
49
|
+
tasks: [{ uid: 'task-a', title: 'Draft the limits spec', start: '2026-10-05', due: '2026-10-16' }, { uid: 'task-b', title: 'Ship the limits API', start: '2026-10-21', due: '2026-11-16' },
|
|
50
|
+
{ uid: 'task-d', title: 'Offline docs', start: '2026-11-01', due: '2026-11-10' }, { uid: 'task-e', title: 'Partner FAQ', start: '2026-11-02', due: '2026-11-06' }] };
|
|
51
|
+
const copy = ITEMS.filter((x) => x.status !== "Won't do").map((x, i) => ({ ...TP.taskOfLive(x), k: 'c' + i }));
|
|
52
|
+
const LINES = [plan,
|
|
53
|
+
{ at: '2026-10-15T09:00:00Z', kind: 'draft-new', draft: 'draft-c1', board: 'w1', initiative: 'partner-rate-limits', name: 'Change 1 · faster pilot', from: 'live', tasks: copy },
|
|
54
|
+
{ at: '2026-10-15T09:01:00Z', kind: 'draft-task', draft: 'draft-c1', k: 'c1', set: { due: '2026-11-23' } },
|
|
55
|
+
{ at: '2026-10-10T09:00:00Z', kind: 'draft-new', draft: 'draft-p', board: 'w1', initiative: 'usage-billing', name: 'Proposal A', auto: true, from: 'empty', tasks: [] },
|
|
56
|
+
{ at: '2026-10-10T09:01:00Z', kind: 'draft-task', draft: 'draft-p', k: 'p1', add: { title: 'Interview 5 billing leads', start: '2026-10-26', due: '2026-11-06', status: 'To do' } },
|
|
57
|
+
{ at: '2026-10-10T09:02:00Z', kind: 'draft-task', draft: 'draft-p', k: 'p2', add: { title: 'Metering service', start: '2026-11-09', due: '2027-01-29', status: 'To do' } },
|
|
58
|
+
{ at: '2026-10-11T09:00:00Z', kind: 'draft-new', draft: 'draft-q', board: 'w1', initiative: 'usage-billing', name: 'Proposal B · lean', auto: false, from: 'draft-p', tasks: [{ k: 'q1', src: null, title: 'Metering, lean', start: '2026-11-02', due: '2026-12-18', status: 'To do' }] },
|
|
59
|
+
];
|
|
60
|
+
function model() {
|
|
61
|
+
const m = BP.build(F.facts({ items: ITEMS.map((x) => ({ ...x })) }));
|
|
62
|
+
TP.decorate(m.rows, TP.fold(LINES));
|
|
63
|
+
for (const r of m.rows) if (r.id === 'partner-rate-limits') { r.start = '2026-10-05'; r.end = '2026-11-30'; }
|
|
64
|
+
return m;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
(async () => {
|
|
68
|
+
const exe = findBrowser();
|
|
69
|
+
if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the suite cannot run'); return finish(1); }
|
|
70
|
+
let chromium;
|
|
71
|
+
try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
|
|
72
|
+
srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
|
|
73
|
+
await T.waitForServer(BASE);
|
|
74
|
+
browser = await chromium.launch({ executablePath: exe });
|
|
75
|
+
const shot = async (page, name, sel) => { if (!SHOTS) return; fs.mkdirSync(SHOTS, { recursive: true }); const p = path.join(SHOTS, name + '.png'); if (sel) await page.locator(sel).first().screenshot({ path: p }); else await page.screenshot({ path: p }); };
|
|
76
|
+
|
|
77
|
+
const open = async (o = {}) => {
|
|
78
|
+
const ctx = await browser.newContext({ viewport: { width: o.w || 1440, height: o.h || 900 } });
|
|
79
|
+
const page = await ctx.newPage();
|
|
80
|
+
const errors = [], posts = [];
|
|
81
|
+
page.on('pageerror', (e) => errors.push(String((e && e.stack) || e)));
|
|
82
|
+
await page.clock.setFixedTime(new Date(F.NOW));
|
|
83
|
+
await page.route('**/api/board-premium*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model: model(), as_of: Date.now() }) }));
|
|
84
|
+
await page.route('**/api/board-trail*', (r) => r.fulfill({ status: 500, contentType: 'application/json', body: JSON.stringify({ ok: false, error: 'not in this check' }) }));
|
|
85
|
+
await page.route('**/api/task-plans/preview*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, summary: { added: 0, moved: 1, changed: 1, dropped: 0, conflicts: [], milestones: [], planName: 'Change 1 · faster pilot · Oct 17', notChosen: [] } }) }));
|
|
86
|
+
await page.route('**/api/task-plans/live', (r) => { posts.push({ url: r.request().url(), body: r.request().postDataJSON() }); r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, plan: 'plan-2', name: 'Change 1 · faster pilot', summary: {}, versions: null }) }); });
|
|
87
|
+
await page.addInitScript(([s]) => { try { if (!sessionStorage.getItem('set')) { sessionStorage.setItem('set', '1'); for (const [k, v] of Object.entries(s)) localStorage.setItem(k, v); } } catch { /* none */ } },
|
|
88
|
+
[{ 'pmos.board.view': 'time', 'pmos.board.span': o.span || 'half', 'pmos.tasks.view': 'timeline', 'pmos.tasks.zoom': 'month', ...(o.store || {}) }]);
|
|
89
|
+
await page.goto(BASE + '/premium-board.html?ws=w1&board=w1');
|
|
90
|
+
await page.waitForSelector('#ibBody [data-key]', { timeout: 15000 });
|
|
91
|
+
await page.waitForTimeout(500);
|
|
92
|
+
return { ctx, page, errors, posts };
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
// ── B: the Board timeline
|
|
96
|
+
{
|
|
97
|
+
const { ctx, page, errors, posts } = await open();
|
|
98
|
+
const B = await page.evaluate(() => {
|
|
99
|
+
const row = (k) => document.querySelector(`.tg-r[data-row="${k}"]`);
|
|
100
|
+
const pr = row('board:partner-rate-limits'), ub = row('board:usage-billing');
|
|
101
|
+
const lg = document.querySelector('.tg-lgd');
|
|
102
|
+
return { line: !!(pr && pr.querySelector('.tg-pl')), slip: pr ? (pr.querySelector('.tg-slip') || {}).textContent || '' : '', lineTip: pr && pr.querySelector('.tg-pl') ? pr.querySelector('.tg-pl').getAttribute('title') : '',
|
|
103
|
+
draft: !!(ub && ub.querySelector('.tg-bar.tg-dr')), draftTip: ub && ub.querySelector('.tg-dr') ? ub.querySelector('.tg-dr').getAttribute('title') : '',
|
|
104
|
+
others: [...document.querySelectorAll('.tg-r[data-row]')].filter((r) => r !== pr && r.querySelector('.tg-pl')).length, legend: lg ? lg.textContent : '' };
|
|
105
|
+
});
|
|
106
|
+
ok('B1 the plan\'s thin line sits under the bar of the initiative that has a saved plan, named on hover', B.line && /Plan · Proposal A/.test(B.lineTip), JSON.stringify(B));
|
|
107
|
+
ok('B2 the slip after the end date: +14d (late)', B.slip === '+14d', JSON.stringify(B));
|
|
108
|
+
ok('B3 an initiative with drafts only draws its newest draft dashed, and its title names both drafts', B.draft && /Proposal B · lean/.test(B.draftTip) && /Newest: Proposal B · lean|Newest: Proposal A/.test(B.draftTip), JSON.stringify(B));
|
|
109
|
+
ok('B4 no plan line where no plan is saved (zero is silence)', B.others === 0, JSON.stringify(B));
|
|
110
|
+
ok('B5 the legend: "Planned" is "To do"; Plan and Draft show while they are drawn', /To do/.test(B.legend) && !/Planned/.test(B.legend) && /Plan/.test(B.legend) && /Draft/.test(B.legend), B.legend);
|
|
111
|
+
await shot(page, 'PvaBuild1Board');
|
|
112
|
+
|
|
113
|
+
// ── V: the initiative's Tasks timeline
|
|
114
|
+
await page.locator('.tg-n[data-key="board:partner-rate-limits"]').first().click();
|
|
115
|
+
await page.waitForSelector('#czViewer .iv-th', { timeout: 8000 });
|
|
116
|
+
await page.waitForTimeout(300);
|
|
117
|
+
const V = await page.evaluate(() => {
|
|
118
|
+
const v = document.querySelector('#czViewer');
|
|
119
|
+
const chip = v.querySelector('[data-vs-chip]'), rows = [...v.querySelectorAll('.ivt-r.k')];
|
|
120
|
+
const by = (t) => rows.find((r) => r.querySelector('.iv-tt') && r.querySelector('.iv-tt').textContent === t);
|
|
121
|
+
const has = (t, s) => { const r = by(t); return !!(r && r.querySelector(s)); };
|
|
122
|
+
return { chip: chip ? chip.textContent.trim() : '', chipDr: chip ? chip.classList.contains('dr') : null, slip: (v.querySelector('.vs-slip') || {}).textContent || '',
|
|
123
|
+
lineA: has('Draft the limits spec', '.ivt-pl'), lineFaq: has('Partner FAQ', '.ivt-pl'), addC: has('Load test at 3x peak', '.vs-add'), slipB: (by('Ship the limits API') && (by('Ship the limits API').querySelector('.ivt-sl') || {}).textContent) || '',
|
|
124
|
+
legend: (v.querySelector('.ivt-lg') || {}).textContent || '', seal: !!v.querySelector('[data-vs-live]') };
|
|
125
|
+
});
|
|
126
|
+
ok('V1 the chip says Live with 1 draft, grey; the header sums the end slip (+14d)', /^Live\s*1/.test(V.chip) && V.chipDr === false && V.slip === '+14d', JSON.stringify(V));
|
|
127
|
+
ok('V2 a plan line where the dates differ, none where they match', V.lineA && !V.lineFaq, JSON.stringify(V));
|
|
128
|
+
ok('V3 ⊕ after a task added after the plan; the slip after a late date', V.addC && /\+14d/.test(V.slipB), JSON.stringify(V));
|
|
129
|
+
ok('V4 the legend names the plan; no seal on Live', /Plan · Proposal A/.test(V.legend) && !V.seal, JSON.stringify(V));
|
|
130
|
+
await shot(page, 'PvaBuild2Live', '#czViewer');
|
|
131
|
+
|
|
132
|
+
// ── M: the chip's menu
|
|
133
|
+
await page.locator('#czViewer [data-vs-chip]').click();
|
|
134
|
+
await page.waitForSelector('.vs-pop .vs-m', { timeout: 4000 });
|
|
135
|
+
const M = await page.evaluate(() => { const m = document.querySelector('.vs-pop .vs-m'); return { text: m.textContent, show: [...m.querySelectorAll('[data-vs-show]')].length, cmp: [...m.querySelectorAll('[data-vs-cmp]')].length, save: !!m.querySelector('[data-vs-save]'), nw: !!m.querySelector('[data-vs-new]'), checked: [...m.querySelectorAll('[aria-checked="true"]')].map((b) => b.textContent.trim()) }; });
|
|
136
|
+
ok('M1 the menu: Show (Live, the draft), New draft from Live; Compare with (the plan, the draft, Nothing), Save Live as a plan', M.show === 2 && M.cmp === 3 && M.save && M.nw && /Show/.test(M.text) && /Compare with/.test(M.text), JSON.stringify(M));
|
|
137
|
+
ok('M2 Live and the plan are the ones picked', M.checked.length === 2 && /^Live/.test(M.checked[0]) && /Proposal A/.test(M.checked[1]), JSON.stringify(M.checked));
|
|
138
|
+
await shot(page, 'PvaBuild3Menu');
|
|
139
|
+
|
|
140
|
+
// ── D: a draft
|
|
141
|
+
await page.locator('.vs-pop [data-vs-show="draft-c1"]').click();
|
|
142
|
+
await page.waitForTimeout(300);
|
|
143
|
+
const D = await page.evaluate(() => { const v = document.querySelector('#czViewer'), chip = v.querySelector('[data-vs-chip]'); return { chip: chip.textContent.trim(), dr: chip.classList.contains('dr'), dashed: v.querySelectorAll('.ivt-b.dr').length, seal: !!v.querySelector('[data-vs-live]'), count: (v.querySelector('.iv-th .n') || {}).textContent || '' }; });
|
|
144
|
+
ok('D1 the chip names the draft in blue; every bar is dashed; the seal shows', /Change 1/.test(D.chip) && D.dr && D.dashed >= 3 && D.seal, JSON.stringify(D));
|
|
145
|
+
const wide = await page.evaluate(() => { const b = document.querySelector('#czViewer .cz-vw-body'), h = document.querySelector('#czViewer .iv-th'); return { body: b.scrollWidth - b.clientWidth, head: h.scrollWidth - Math.round(h.getBoundingClientRect().width) }; });
|
|
146
|
+
ok('D5 a long draft name wraps the head; the Viewer never scrolls sideways', wide.body <= 0 && wide.head <= 1, JSON.stringify(wide));
|
|
147
|
+
ok('D2 the count says how many tasks the draft holds, without its name again (the chip says it)', /^4 tasks$/.test(D.count.trim()), D.count);
|
|
148
|
+
await page.locator('#czViewer [data-vs-live]').click();
|
|
149
|
+
await page.waitForSelector('.vs-pop .vs-cf', { timeout: 4000 });
|
|
150
|
+
const cf = await page.locator('.vs-pop .vs-cf').textContent();
|
|
151
|
+
ok('D3 Make live shows what changes right under the seal: 1 date moved, the plan it saves', /1 date moved/.test(cf) && /Saved as the plan/.test(cf), cf);
|
|
152
|
+
await shot(page, 'PvaBuild4Draft');
|
|
153
|
+
await page.locator('.vs-pop [data-vs-cf="yes"]').click();
|
|
154
|
+
await page.waitForTimeout(400);
|
|
155
|
+
ok('D4 ✓ posts Make live for that draft', posts.length === 1 && posts[0].body.draft === 'draft-c1', JSON.stringify(posts));
|
|
156
|
+
ok('B6 no page error', errors.length === 0, errors.join(' | '));
|
|
157
|
+
await ctx.close();
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// ── P: a phone, the chip's menu as a bottom sheet
|
|
161
|
+
{
|
|
162
|
+
const { ctx, page, errors } = await open({ w: 390, h: 844 });
|
|
163
|
+
const n = page.locator('[data-key="board:partner-rate-limits"]').first();
|
|
164
|
+
await n.click();
|
|
165
|
+
await page.waitForSelector('#czViewer [data-vs-chip]', { timeout: 8000 });
|
|
166
|
+
await page.locator('#czViewer [data-vs-chip]').click();
|
|
167
|
+
await page.waitForSelector('.vs-pop.sheet', { timeout: 4000 });
|
|
168
|
+
const P = await page.evaluate(() => { const r = document.querySelector('.vs-pop.sheet').getBoundingClientRect(); return { bottom: Math.round(r.bottom), w: Math.round(r.width), scroll: document.documentElement.scrollWidth }; });
|
|
169
|
+
ok('P1 on a phone the menu is a bottom sheet the width of the screen; no sideways scroll', P.bottom === 844 && P.w === 390 && P.scroll <= 390, JSON.stringify(P));
|
|
170
|
+
ok('P2 no page error', errors.length === 0, errors.join(' | '));
|
|
171
|
+
await shot(page, 'PvaBuild5Phone');
|
|
172
|
+
await ctx.close();
|
|
173
|
+
}
|
|
174
|
+
finish();
|
|
175
|
+
})().catch((e) => { console.error(e); finish(1); });
|
|
@@ -141,7 +141,7 @@ const model = () => { const M = BP.build(F.facts()); const r = M.rows.find((x) =
|
|
|
141
141
|
ghost: !!T.querySelector('.ivt-g[data-iv-date="task-d"]'), zoom: document.querySelector('#czViewer [data-iv-zoom]').textContent, seen: today.left > nw.right && today.left < sc.getBoundingClientRect().right,
|
|
142
142
|
lg: document.querySelector('#czViewer .ivt-lg').textContent, arch: /Old spike notes/.test(T.textContent) };
|
|
143
143
|
});
|
|
144
|
-
ok('V4 Timeline keeps the List\'s stage groups', tl.groups.join('|') === 'Triage|Discover|
|
|
144
|
+
ok('V4 Timeline keeps the List\'s stage groups, one per stage (batch 11 item 5)', tl.groups.join('|') === 'Triage|Discover|Plan|Prioritize|Build|Deliver|Monitor|Evaluate', JSON.stringify(tl.groups));
|
|
145
145
|
ok('V4 bars by start and due: in progress light blue, late amber; a due day only is a circle; no dates is a dashed date press', /ivt-b/.test(tl.a) && / pr/.test(tl.a) && /ivt-d/.test(tl.b) && /ivt-b lt/.test(tl.c) && tl.ghost, JSON.stringify(tl));
|
|
146
146
|
ok('V4 Weeks is the first zoom; it opens on today, the Today line in view; the legend sits under it', tl.zoom === 'Weeks' && tl.seen && /To do.*In progress.*Late.*Due only.*Jira, read only/.test(tl.lg), JSON.stringify(tl));
|
|
147
147
|
ok('V4 an archived task shows nowhere in Timeline', !tl.arch);
|
|
@@ -184,7 +184,7 @@ const model = () => { const M = BP.build(F.facts()); const r = M.rows.find((x) =
|
|
|
184
184
|
await shot(p, 'kanban-1440');
|
|
185
185
|
await p.click('#czViewer [data-iv-kstage]');
|
|
186
186
|
const st = await until(() => p.evaluate(() => { const q = document.querySelector('.tkc.ivq .ivq-m'); return q ? [...q.querySelectorAll('[data-ivq-i]')].map((b) => b.textContent.replace(/\s+/g, ' ').trim()) : null; }));
|
|
187
|
-
ok('V6 the stage picker: current stage first, All stages, then the rest, each with its count', st && st.join('|') === 'Discover1 late · 4 open|All stages5 open|Triage|
|
|
187
|
+
ok('V6 the stage picker: current stage first, All stages, then the rest, each with its count', st && st.join('|') === 'Discover1 late · 4 open|All stages5 open|Triage|Plan1 open|Prioritize|Build|Deliver|Monitor|Evaluate', JSON.stringify(st));
|
|
188
188
|
await p.evaluate(() => { const b = [...document.querySelectorAll('.tkc.ivq [data-ivq-i]')].find((x) => /All stages/.test(x.textContent)); if (b) b.click(); });
|
|
189
189
|
const all = await until(() => p.evaluate(() => (document.querySelector('#czViewer [data-iv-kstage]') || {}).textContent === 'All stages' ? document.querySelectorAll('#czViewer .ivk-d').length : null));
|
|
190
190
|
ok('V6 All stages shows every task but the archived one (Won\'t do stays in its folded strip)', all === 6, String(all));
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "feedback batch 11 item 2 (option A): move an initiative out of its program, or to another, from its ⋯ on the Board panel, the Home page and the phone sheet; the leave takes it off the charter's milestones and Undo puts them back (canvas LpA1More, LpA2Other, LpA3Done, LpA4Phone, LpA5PhoneDone).",
|
|
3
|
+
"modules": ["program-leave.test.js"],
|
|
4
|
+
"panels": ["program-leave-test.js"],
|
|
5
|
+
"seconds": { "program-leave.test.js": 2, "program-leave-test.js": 45 }
|
|
6
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "Feedback batch 11 item 3, several milestones per initiative: a ◇ flag on any task, one ◇ per milestone on the Board timeline and the Viewer Tasks timeline. The modules suite reads the task-milestone lines; the panels suite drives the Board and the Viewer in a browser.",
|
|
3
|
+
"modules": ["task-milestones.test.js"],
|
|
4
|
+
"panels": ["task-milestones-test.js"],
|
|
5
|
+
"seconds": { "task-milestones.test.js": 6, "task-milestones-test.js": 40 }
|
|
6
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "Feedback batch 11 item 8, planned versus actual: drafts of an initiative's tasks, saved plans, Make live and its Undo (lib/task-plans.js, lib/routes-task-plans.js). The modules suite folds pure and then serves a scratch server; the panels suite drives the Board and the Viewer in a browser.",
|
|
3
|
+
"modules": ["task-plans.test.js"],
|
|
4
|
+
"panels": ["task-plans-test.js"],
|
|
5
|
+
"seconds": { "task-plans.test.js": 6, "task-plans-test.js": 40 }
|
|
6
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "feedback batch 11 item 1: the Viewer follows chat's edits to the open file, from the initiative's worktree, with no commit (pure + a real git worktree).",
|
|
3
|
+
"modules": [
|
|
4
|
+
"doc-live-file.test.js"
|
|
5
|
+
],
|
|
6
|
+
"seconds": {
|
|
7
|
+
"doc-live-file.test.js": 1
|
|
8
|
+
}
|
|
9
|
+
}
|