create-pmos 0.434.0 → 0.436.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 +25 -25
- 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/state/discoveries.md +1 -1
- package/workspace/changelog.json +24 -0
- package/workspace/fixtures/ready-reports.js +145 -0
- package/workspace/guide/home.md +1 -1
- package/workspace/guide/index.md +1 -0
- package/workspace/guide/initiative-boards.md +1 -1
- package/workspace/guide/ready-made-dashboards.md +62 -0
- package/workspace/lib/board-premium.js +1 -1
- package/workspace/lib/engine/boards.js +1 -1
- package/workspace/lib/intel-report.js +36 -5
- package/workspace/lib/ready-reports.js +616 -0
- package/workspace/lib/report-dashboards.js +5 -0
- package/workspace/lib/report-setups.js +16 -7
- package/workspace/lib/route-modules.js +1 -0
- package/workspace/lib/routes-board-premium.js +5 -0
- package/workspace/lib/routes-boards.js +3 -2
- package/workspace/lib/routes-ready-reports.js +455 -0
- package/workspace/lib/routes-report-setups.js +4 -3
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/program-charter-test.js +11 -7
- package/workspace/program-panel-test.js +1 -1
- package/workspace/public/pm/bd-ini-panel.js +23 -6
- package/workspace/public/pm/bd-prog-panel.js +58 -10
- package/workspace/public/pm/cozy-viewer.js +2 -2
- package/workspace/public/pm/cozy-vw-rp.css +13 -0
- package/workspace/public/pm/dash-view.css +111 -0
- package/workspace/public/pm/dash-view.js +261 -0
- package/workspace/public/pm/home-app.js +26 -0
- package/workspace/public/pm/home-data.js +3 -2
- package/workspace/public/pm/home-ini.js +19 -1
- package/workspace/public/pm/home-task.js +4 -2
- package/workspace/public/pm/ini-tasks.js +34 -6
- package/workspace/public/pm/ini-view.css +4 -0
- package/workspace/public/pm/premium-insights.js +10 -2
- package/workspace/public/pm/premium-report-read.js +36 -5
- package/workspace/public/pm/premium-vw-item.js +2 -0
- package/workspace/public/pm/ready-lib.css +29 -0
- package/workspace/public/pm/ready-lib.js +62 -0
- package/workspace/public/pm/task-card.css +1 -0
- package/workspace/public/pm/task-card.js +8 -3
- package/workspace/ready-dash-ui-test.js +227 -0
- package/workspace/server.js +2 -0
- package/workspace/task-delete-test.js +31 -0
- package/workspace/task-views-test.js +16 -0
- package/workspace/test-lists/batch17-ready-reports.json +9 -0
- package/workspace/test-lists/ready-reports-ui.json +6 -0
|
@@ -32,7 +32,8 @@
|
|
|
32
32
|
* thumbnails; Undo and Redo dim when there is nothing to take back or do again. premium-vw-slides.js draws it in the card.
|
|
33
33
|
*
|
|
34
34
|
* openReport(row, hand) row = a Reports card document { cadence, slot, date, path, state, archived }; hand = { ws, name, cycles, onIssue, onChange }
|
|
35
|
-
* openReportView(ref, o) ref = a report path reports/<cadence>/<date>.md or a row; the window.czViews entry (premium-vw-open.js)
|
|
35
|
+
* openReportView(ref, o) ref = a report path reports/<cadence>/<date>.md or a row; the window.czViews entry (premium-vw-open.js).
|
|
36
|
+
* o.cuts: a ready-made report (batch 17 item 1, PbG5): Sponsors · 1 minute | Team · full over the same numbers
|
|
36
37
|
* wordsOf(md, fallback) the document as { title, sections: [{ h, lines }] } (pure)
|
|
37
38
|
* slideHtml(lines) a section's lines as html (pure) · splitRender(html) · slideCard(s, mini) · fit(root) · schedLabel(setup) (pure)
|
|
38
39
|
*
|
|
@@ -67,6 +68,7 @@ const P = {
|
|
|
67
68
|
page: '<path d="M6 3h9l4 4v14H6zM14 3v5h5"/>', print: '<path d="M7 9V4h10v5M7 17H5v-6h14v6h-2M8 14h8v6H8z"/>', hist: '<path d="M3 12a9 9 0 1 0 3-6.7L3 8M3 3v5h5M12 7v5l3 2"/>',
|
|
68
69
|
warn: '<path d="M12 4l9 16H3zM12 10v4M12 17h.01"/>', bin: '<path d="M5 7h14M10 7V4h4v3M7 7l1 13h8l1-13"/>', box: '<path d="M4 5h16v4H4zM5 9v10h14V9M10 13h4"/>', lock: '<rect x="5" y="11" width="14" height="10" rx="2"/><path d="M8 11V8a4 4 0 0 1 8 0v3"/>',
|
|
69
70
|
redo2: '<path d="M20 11a8 8 0 1 0-2.3 5.7M20 4v7h-7"/>', undo: '<path d="M9 14 4 9l5-5M4 9h11a5 5 0 0 1 0 10h-3"/>', redo: '<path d="m15 14 5-5-5-5M20 9H9a5 5 0 0 0 0 10h3"/>',
|
|
71
|
+
people: '<path d="M9 11a3.5 3.5 0 1 0 0-7a3.5 3.5 0 1 0 0 7M2.5 20a6.5 6.5 0 0 1 13 0M16 4.5a3.5 3.5 0 0 1 0 6.5M18 14a6 6 0 0 1 3.5 6"/>', list: '<path d="M9 6h11M9 12h11M9 18h11M4.5 6h.01M4.5 12h.01M4.5 18h.01"/>',
|
|
70
72
|
plus: '<path d="M12 5v14M5 12h14"/>', dl: '<path d="M12 4v11M7 10l5 5 5-5M5 20h14"/>', live: '<path d="M3 17l5-5 4 4 8-8M16 8h4v4"/>', layout: '<rect x="4" y="4" width="16" height="16" rx="2"/><path d="M4 10h16M10 10v10"/>',
|
|
71
73
|
theme: '<path d="M12 3a9 9 0 1 0 0 18c1 0 1.5-.8 1.5-1.6 0-1-.8-1.4-.8-2.4 0-1 .8-1.6 1.8-1.6H17a4 4 0 0 0 4-4c0-4.6-4-8.4-9-8.4z"/><circle cx="7.5" cy="11" r="1"/><circle cx="10.5" cy="7.5" r="1"/><circle cx="15" cy="7.5" r="1"/>',
|
|
72
74
|
};
|
|
@@ -345,9 +347,37 @@ function sumHtml() {
|
|
|
345
347
|
primary: { act: S.primary.r, label: S.primary.label, icon: PRI_ICON[S.primary.r] || 'back', disabled: R.busy } });
|
|
346
348
|
}
|
|
347
349
|
/** The bar (OvReport): Slides | Document | Live page, then Edit (a draft), Present, Share (when it is not the primary) and Download. */
|
|
350
|
+
/* ── the two cuts of one ready-made report (batch 17 item 1, canvas PbG5): Sponsors (1 minute) and Team (full), the same numbers. The team cut
|
|
351
|
+
* is the document as drafted; the sponsors cut is read from it (GET /api/ready-reports/cut). Under the switch, each section of the team cut,
|
|
352
|
+
* ticked when the sponsors read it too, else "Team only". The team cut is the one that is edited. */
|
|
353
|
+
function cutsHtml() {
|
|
354
|
+
const C = R.cuts; if (!C || R.edit) return '';
|
|
355
|
+
const b = (k, icon, l) => `<button type="button" data-r="cut|${k}" aria-pressed="${C.on === k}">${icon}<span>${l}</span></button>`;
|
|
356
|
+
const seg = `<div class="rp-seg vz-cuts" role="group" aria-label="Who reads it">${b('sponsors', ic('people', 15), 'Sponsors · 1 minute')}${b('team', ic('list', 15), 'Team · full')}</div>`;
|
|
357
|
+
let list = '';
|
|
358
|
+
if (C.on === 'sponsors' && C.teamW && R.W) {
|
|
359
|
+
const has = new Set(R.W.sections.map((x) => String(x.h).toLowerCase()));
|
|
360
|
+
// the lead before the first heading (wordsOf's "Summary") is the answer and its 3 points, as the design names it
|
|
361
|
+
list = `<p class="vz-lab">Sponsors read</p><ul class="vz-cutl">${C.teamW.sections.filter((x) => x.h).map((x) => { const on = has.has(String(x.h).toLowerCase()); return `<li class="${on ? 'on' : ''}"><span class="vz-cb" aria-hidden="true">${on ? ic('check', 12) : ''}</span><span><b>${esc(x.h === 'Summary' ? 'The answer and 3 points' : x.h)}</b>${on ? '' : '<small>Team only</small>'}</span></li>`; }).join('')}</ul><p class="vz-note">Same numbers in both.</p>`;
|
|
362
|
+
}
|
|
363
|
+
return `<div class="vz-cut">${seg}${C.err ? `<p class="vz-msg" role="status">${esc(C.err)}</p>` : ''}${list}</div>`;
|
|
364
|
+
}
|
|
365
|
+
async function cutTo(k) {
|
|
366
|
+
const C = R.cuts, me = R; if (!C || C.on === k) return;
|
|
367
|
+
if (k === 'team') { C.on = 'team'; if (C.team != null) { R.text = C.team; R.W = wordsOf(R.text, R.name); } return draw(); }
|
|
368
|
+
if (C.sponsors == null) {
|
|
369
|
+
const j = await Promise.resolve(pmGet('/api/ready-reports/cut?' + q({ ws: R.ws, path: R.row.path, cut: 'sponsors' }))).catch(() => null);
|
|
370
|
+
if (R !== me) return;
|
|
371
|
+
if (!j || !j.ok || typeof j.markdown !== 'string') { C.err = (j && j.error) || 'The sponsors cut could not be read. The team cut is shown.'; return draw(); }
|
|
372
|
+
C.sponsors = j.markdown;
|
|
373
|
+
}
|
|
374
|
+
C.err = ''; C.team = C.team == null ? R.text : C.team; C.teamW = wordsOf(C.team, R.name); C.on = 'sponsors';
|
|
375
|
+
R.text = C.sponsors; R.W = wordsOf(R.text, R.name); R.i = 0;
|
|
376
|
+
draw();
|
|
377
|
+
}
|
|
348
378
|
function barHtml() {
|
|
349
379
|
return rpBarHtml({ view: R.view, views: [['deck', 'Slides'], ['doc', 'Document'], ['live', 'Live page']], tools: [
|
|
350
|
-
R.issued ? null : { act: 'edit', label: 'Edit', icon: 'pen' }, { act: 'present', label: 'Present', icon: 'present' },
|
|
380
|
+
R.issued || (R.cuts && R.cuts.on === 'sponsors') ? null : { act: 'edit', label: 'Edit', icon: 'pen' }, { act: 'present', label: 'Present', icon: 'present' },
|
|
351
381
|
R.issued && !R.archived ? null : { act: 'share', label: 'Share', icon: 'share', exp: R.pop === 'share', pop: 'dialog' },
|
|
352
382
|
{ act: 'dlm', label: 'Download', icon: 'dl', exp: R.pop === 'dl' }] });
|
|
353
383
|
}
|
|
@@ -397,7 +427,7 @@ function bodyHtml() {
|
|
|
397
427
|
}
|
|
398
428
|
const view = R.err ? `<p class="vz-msg" data-tone="bad" role="alert">The document could not be read: ${esc(R.err)}</p>` : !R.W ? '<p class="vz-empty" role="status">Reading the report.</p>'
|
|
399
429
|
: R.view === 'deck' ? deckHtml() : R.view === 'live' ? liveView() : pageHtml();
|
|
400
|
-
return `<div class="vz-rpb">${R.conf ? confHtml() : R.W ? sumHtml() : ''}${R.msg ? `<p class="vz-msg" role="status" data-tone="${R.msg.tone || ''}">${esc(R.msg.text)}</p>` : ''}${R.W && !R.err ? barHtml() : ''}${view}${R.W && !R.err ? foldsHtml() : ''}${askHtml()}</div>`;
|
|
430
|
+
return `<div class="vz-rpb">${R.conf ? confHtml() : R.W ? sumHtml() : ''}${R.W && !R.err ? cutsHtml() : ''}${R.msg ? `<p class="vz-msg" role="status" data-tone="${R.msg.tone || ''}">${esc(R.msg.text)}</p>` : ''}${R.W && !R.err ? barHtml() : ''}${view}${R.W && !R.err ? foldsHtml() : ''}${askHtml()}</div>`;
|
|
401
431
|
}
|
|
402
432
|
const tipText = (i, n) => `Slide ${i + 1} of ${n}. Click an item to change it; double-click text to type.`;
|
|
403
433
|
/** The editor's slide and its undo history changed: the tip and the dimmed Undo and Redo follow it. */
|
|
@@ -472,6 +502,7 @@ export function fit(root) { root.querySelectorAll('.vz-fr').forEach((c) => { if
|
|
|
472
502
|
const say = (text, tone) => { R.msg = { text, tone }; draw(); };
|
|
473
503
|
async function act([k, v], t) {
|
|
474
504
|
if (k === 'pop') { R.pop = v || null; return draw(); }
|
|
505
|
+
if (k === 'cut') return cutTo(v);
|
|
475
506
|
if (k === 'bf') return briefAct(v, t.dataset.r.split('|').slice(2).join('|'));
|
|
476
507
|
if (k === 'lv') return liveAct(v, t.dataset.r.split('|').slice(2).join('|'));
|
|
477
508
|
if (k === 'dlm') { R.pop = R.pop === 'dl' ? null : 'dl'; return draw(); }
|
|
@@ -859,7 +890,7 @@ export async function openReport(row, hand = {}) {
|
|
|
859
890
|
if (R) present(false);
|
|
860
891
|
const me = R = { row, ws: hand.ws || '', id: c.cadence, name: hand.name || row.name || c.cadence || 'Report', audience: hand.audience || '', issued: row.state === 'issued', archived: !!row.archived,
|
|
861
892
|
text: '', err: '', W: null, view: 'deck', BF: null, bfRaw: null, bfMsg: '', LV: null, blank: false, i: 0, cyc: null, setup: undefined, pop: null, conf: false, checks: null, issueErr: '', busy: false, ask: '', askErr: '', edit: false, msg: null,
|
|
862
|
-
sch: schedPick(null), schErr: '', shr: null, shares: null, more: [], hand, cycles: (hand.cycles || []).slice(), onIssue: hand.onIssue || null, onChange: hand.onChange || null, vid: 'report:' + row.path };
|
|
893
|
+
sch: schedPick(null), schErr: '', shr: null, shares: null, more: [], hand, cuts: hand.cuts ? { on: 'team', team: null, sponsors: null, err: '' } : null, cycles: (hand.cycles || []).slice(), onIssue: hand.onIssue || null, onChange: hand.onChange || null, vid: 'report:' + row.path };
|
|
863
894
|
const head = me.head = () => ({ id: me.vid, kind: 'Report' + (me.audience ? ' · ' + me.audience : ''), title: me.name, icon: me.view === 'doc' ? 'doc' : 'report', full: true, url: viewUrl(row, me.ws), more: me.more,
|
|
864
895
|
render: (b) => { syncMore(); b.innerHTML = panelHtml(); wire(b); }, onClose: () => { if (R === me && !me.reopen) { present(false); R = null; } } });
|
|
865
896
|
vOpen(head());
|
|
@@ -886,7 +917,7 @@ async function watchFile(me) {
|
|
|
886
917
|
while (R === me) {
|
|
887
918
|
await new Promise((ok) => setTimeout(ok, CHECK_MS));
|
|
888
919
|
if (R !== me) return;
|
|
889
|
-
if (document.hidden || me.edit || me.busy || me.pop) continue;
|
|
920
|
+
if (document.hidden || me.edit || me.busy || me.pop || (me.cuts && me.cuts.on === 'sponsors')) continue; // the sponsors cut is read from the file, not the file
|
|
890
921
|
const h = await stamp();
|
|
891
922
|
if (R !== me || !h) continue;
|
|
892
923
|
if (seen && h !== seen) { await reread(); if (R === me && !me.edit && !me.pop) draw(); }
|
|
@@ -99,6 +99,7 @@ export function openWorkItem(o) {
|
|
|
99
99
|
return;
|
|
100
100
|
}
|
|
101
101
|
const check = () => { try { setCheck('vw:' + vid, checkOf(t)); } catch { /* the old dialog has no header check */ } };
|
|
102
|
+
const del = deleteEntry({ ws, board, t, post: (p, b) => pmPost(p, b), toast: toastUndo, done: () => { cache.clear(); vwClose(vid); } });
|
|
102
103
|
card = mountCard(host, t, {
|
|
103
104
|
save: boardSaver({ ws, board, t, post: (p, b) => pmPost(p, b) }),
|
|
104
105
|
toast: toastUndo,
|
|
@@ -107,6 +108,7 @@ export function openWorkItem(o) {
|
|
|
107
108
|
iniTitleOf: (id) => ((lists.inis || []).find((x) => x.id === id) || {}).title || id,
|
|
108
109
|
inis: () => lists.inis || [], owners: () => lists.owners || [], groups: () => lists.groups, sections: () => lists.sections,
|
|
109
110
|
history: historyFor({ ws, board, t, post: (p, b) => pmPost(p, b) }), // what Claude changed with your ✓ (batch 12, TpA6)
|
|
111
|
+
...(del ? { remove: del.on } : {}), // the trash at the end of the Status row (batch 17 item 2): ⋯ Delete's own write and Undo
|
|
110
112
|
});
|
|
111
113
|
check();
|
|
112
114
|
// the pickers' lists: the board's initiatives and owners, the initiative's groups (read once, after the card shows)
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/* pm/ready-lib.css — the ready-made reports in Reports and dashboards (pm/ready-lib.js; canvas PbA6Library, PbG4Overlap). Token vars only, over
|
|
2
|
+
* pm/cozy.css; every class starts with rl-. */
|
|
3
|
+
.rl { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
|
|
4
|
+
.rl-lead { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--cz-bluebg); border: 1px solid color-mix(in srgb, var(--cz-blueink) 18%, transparent); }
|
|
5
|
+
.rl-lead p { margin: 0; flex: 1; min-width: 0; font-size: var(--fs-4); line-height: 1.45; color: var(--cz-ink2); }
|
|
6
|
+
.rl-lead b { color: var(--cz-ink); font-weight: 800; }
|
|
7
|
+
.rl-sp { flex: none; color: var(--cz-blueink); margin-top: 3px; display: inline-flex; }
|
|
8
|
+
.rl-ok { all: unset; box-sizing: border-box; cursor: pointer; flex: none; width: 44px; height: 44px; border-radius: 999px; background: var(--cz-blue); color: var(--cz-onsolid); display: inline-flex; align-items: center; justify-content: center; }
|
|
9
|
+
.rl-ok[disabled] { opacity: .45; cursor: default; }
|
|
10
|
+
.rl-h { margin: 6px 0 0; font-size: var(--fs-4); font-weight: 800; color: var(--cz-ink); }
|
|
11
|
+
.rl-h span { font-weight: 700; color: var(--cz-ink3); }
|
|
12
|
+
.rl-card { background: var(--cz-card); border: 1px solid var(--cz-hair); border-radius: 16px; padding: 2px 14px; display: flex; flex-direction: column; }
|
|
13
|
+
.rl-row { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; padding: 10px 0; width: 100%; }
|
|
14
|
+
.rl-card > * + * { border-top: 1px solid var(--cz-hair); }
|
|
15
|
+
.rl-fold { cursor: pointer; }
|
|
16
|
+
.rl-fold > svg { flex: none; color: var(--cz-ink3); }
|
|
17
|
+
.rl-fold[aria-expanded="true"] > svg { transform: rotate(180deg); }
|
|
18
|
+
.rl-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
|
|
19
|
+
.rl-t b { font-size: var(--fs-4); font-weight: 800; }
|
|
20
|
+
.rl-t small { font-size: var(--fs-2); line-height: 1.4; color: var(--cz-ink3); }
|
|
21
|
+
.rl-pk { color: var(--cz-blueink); }
|
|
22
|
+
.rl-av { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--cz-bluebg); color: var(--cz-blueink); display: inline-flex; align-items: center; justify-content: center; }
|
|
23
|
+
.rl-sw { all: unset; box-sizing: border-box; cursor: pointer; flex: none; width: 44px; height: 26px; border-radius: 999px; background: var(--cz-well2, var(--cz-hair)); position: relative; }
|
|
24
|
+
.rl-sw i { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--cz-card); box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: left .15s ease; }
|
|
25
|
+
.rl-sw.on { background: var(--cz-blue); }
|
|
26
|
+
.rl-sw.on i { left: 21px; }
|
|
27
|
+
.rl-sw[disabled] { opacity: .45; cursor: default; }
|
|
28
|
+
.rl-sw:focus-visible, .rl-ok:focus-visible, .rl-fold:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; }
|
|
29
|
+
@media (prefers-reduced-motion: reduce) { .rl-sw i { transition: none; } }
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/* pm/ready-lib.js — the ready-made reports in Reports and dashboards (batch 17 item 1, design A+; canvas In development: PbA6Library, PbG4Overlap,
|
|
2
|
+
* PbG6Trust). Intelligence's ⋯ › Reports and dashboards side panel puts it at the top, before the reports the PM made ("Yours").
|
|
3
|
+
*
|
|
4
|
+
* readLib(ws) GET /api/ready-reports/library?ws → { lead, groups, yours, overlap } | null (null: the route is missing or refused, so
|
|
5
|
+
* the panel shows only what it showed before)
|
|
6
|
+
* libHtml(L, o) the ✦ card (Claude's picks: "To keep your week light I'd schedule only 3"), then one Ready-made group per scope (a
|
|
7
|
+
* program, a product, the initiatives), each report a switch; Claude's picks carry ✦. The weekly updates that are off
|
|
8
|
+
* fold into "N more". The overlap card (PbG4: one person gets at most one update a week) and its "Who gets what" list.
|
|
9
|
+
* o: { open: Set of folded groups shown }
|
|
10
|
+
* wireLib(el, h) the presses: a switch (POST /api/ready-reports/switch), ✓ on the picks card (/picks), ✓ on the overlap card (/overlap),
|
|
11
|
+
* the folds. h: { ws, toast(text), reload(), redraw(), open: Set }
|
|
12
|
+
* Nothing here sends anything: a switch only says whether Claude drafts that report at its moment. */
|
|
13
|
+
import { pmPost } from './http.js';
|
|
14
|
+
|
|
15
|
+
const CSS = new URL('./ready-lib.css', import.meta.url).href;
|
|
16
|
+
if (typeof document !== 'undefined' && document.head && !document.querySelector(`link[href="${CSS}"]`)) {
|
|
17
|
+
const l = document.createElement('link'); l.rel = 'stylesheet'; l.href = CSS; document.head.appendChild(l);
|
|
18
|
+
}
|
|
19
|
+
const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]));
|
|
20
|
+
const SV = (d, w = 18, sw = 1.8) => `<svg aria-hidden="true" width="${w}" height="${w}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="${sw}" stroke-linecap="round" stroke-linejoin="round"><path d="${d}"/></svg>`;
|
|
21
|
+
const I = { spark: 'M12 3l1.8 4.7L18.5 9.5l-4.7 1.8L12 16l-1.8-4.7L5.5 9.5l4.7-1.8z', chk: 'M5 12l5 5 9-10', down: 'M7 10l5 5 5-5', merge: 'M6 4v6a4 4 0 0 0 4 4h8M14 10l4 4-4 4',
|
|
22
|
+
people: 'M9 11a3.5 3.5 0 1 0 0-7a3.5 3.5 0 1 0 0 7M2.5 20a6.5 6.5 0 0 1 13 0M16 4.5a3.5 3.5 0 0 1 0 6.5M18 14a6 6 0 0 1 3.5 6' };
|
|
23
|
+
const LEVEL = { program: 'program', product: 'product', initiative: 'initiatives' };
|
|
24
|
+
|
|
25
|
+
export async function readLib(ws) {
|
|
26
|
+
try { const r = await fetch('/api/ready-reports/library?' + new URLSearchParams(ws ? { ws } : {}).toString(), { credentials: 'same-origin' }); if (r.status !== 200) return null; const j = await r.json(); return j && j.ok !== false && Array.isArray(j.groups) ? j : null; } catch { return null; }
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const sw = (scope, r) => `<button type="button" class="rl-sw${r.on ? ' on' : ''}" role="switch" aria-checked="${!!r.on}" aria-label="${esc((r.on ? 'Stop drafting ' : 'Draft ') + r.name)}" data-rl="switch" data-scope="${esc(scope)}" data-kind="${esc(r.kind)}"><i></i></button>`;
|
|
30
|
+
const row = (scope, r) => `<div class="rl-row"><span class="rl-t"><b>${r.pick ? '<span class="rl-pk" aria-label="Claude\'s pick">✦</span> ' : ''}${esc(r.name)}</b>${r.sub ? `<small>${esc(r.sub)}</small>` : ''}</span>${sw(scope, r)}</div>`;
|
|
31
|
+
|
|
32
|
+
/** The library's ready-made part, as html. Zero is silence: no group draws nothing. */
|
|
33
|
+
export function libHtml(L, o = {}) {
|
|
34
|
+
if (!L || !(L.groups || []).length) return '';
|
|
35
|
+
const open = o.open || new Set();
|
|
36
|
+
const lead = L.lead && L.lead.text ? `<div class="rl-lead"><span class="rl-sp">${SV(I.spark, 16)}</span><p><b>${esc(L.lead.text)}</b>${L.lead.rest ? ' ' + esc(L.lead.rest) : ''}</p>`
|
|
37
|
+
+ `<button type="button" class="rl-ok" data-rl="picks" aria-label="Keep Claude's picks" title="Keep Claude's picks">${SV(I.chk, 18, 2.4)}</button></div>` : '';
|
|
38
|
+
const ov = L.overlap && L.overlap.lead ? `<div class="rl-lead"><span class="rl-sp">${SV(I.spark, 16)}</span><p><b>${esc(L.overlap.lead)}</b>${L.overlap.rest ? ' ' + esc(L.overlap.rest) : ''}</p>`
|
|
39
|
+
+ `<button type="button" class="rl-ok" data-rl="overlap" aria-label="Send one update that carries the others" title="Send one update that carries the others">${SV(I.merge, 18, 2.2)}</button></div>`
|
|
40
|
+
+ ((L.overlap.people || []).length ? `<h4 class="rl-h">${esc(L.overlap.title || 'Who gets what')}</h4><div class="rl-card">${L.overlap.people.map((p) => `<div class="rl-row"><span class="rl-av">${SV(I.people, 16)}</span><span class="rl-t"><b>${esc(p.who)}</b>${p.sub ? `<small>${esc(p.sub)}</small>` : ''}</span></div>`).join('')}</div>` : '') : '';
|
|
41
|
+
const groups = L.groups.map((g) => {
|
|
42
|
+
const k = g.scope || g.name, more = g.more && g.more.count ? (() => { const on = open.has(k); return `<button type="button" class="rl-row rl-fold" data-rl="fold" data-k="${esc(k)}" aria-expanded="${on}"><span class="rl-t"><b>${esc(g.more.text || g.more.count + ' more weekly updates')}</b>${g.more.sub ? `<small>${esc(g.more.sub)}</small>` : ''}</span>${SV(I.down, 16)}</button>${on ? (g.more.rows || []).map((r) => row(g.scope, r)).join('') : ''}`; })() : '';
|
|
43
|
+
// the folded rows sit after the first row, as the design draws them (one ✦ pick, then "4 more weekly updates", then the other kinds)
|
|
44
|
+
const R = g.rows || [];
|
|
45
|
+
return `<h4 class="rl-h">${esc(g.name)}${g.level ? ` <span>· ${esc(LEVEL[g.level] || g.level)}</span>` : ''}</h4><div class="rl-card">${R.slice(0, 1).map((r) => row(g.scope, r)).join('')}${more}${R.slice(1).map((r) => row(g.scope, r)).join('')}</div>`;
|
|
46
|
+
}).join('');
|
|
47
|
+
return `<div class="rl">${lead}${ov}${groups}${(L.yours || []).length || o.yours ? '<h4 class="rl-h">Yours</h4>' : ''}</div>`;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function wireLib(el, h) {
|
|
51
|
+
el.addEventListener('click', async (e) => {
|
|
52
|
+
const b = e.target.closest('[data-rl]'); if (!b || b.disabled || !el.contains(b)) return;
|
|
53
|
+
const a = b.dataset.rl;
|
|
54
|
+
if (a === 'fold') { const k = b.dataset.k; if (h.open.has(k)) h.open.delete(k); else h.open.add(k); h.redraw(); return; }
|
|
55
|
+
b.disabled = true;
|
|
56
|
+
const done = async (r, ok) => { if (!r || r.ok === false) { b.disabled = false; h.toast((r && r.error) || 'Nothing was changed. The server did not say why.'); return; } h.toast(ok); await h.reload(); };
|
|
57
|
+
if (a === 'switch') { const on = b.getAttribute('aria-checked') !== 'true'; return done(await Promise.resolve(pmPost('/api/ready-reports/switch', { ws: h.ws || undefined, scope: b.dataset.scope, kind: b.dataset.kind, on })).catch(() => null), on ? 'On. Claude drafts it at its moment; nothing goes out until you approve it.' : 'Off. Claude no longer drafts it.'); }
|
|
58
|
+
if (a === 'picks') return done(await Promise.resolve(pmPost('/api/ready-reports/picks', { ws: h.ws || undefined })).catch(() => null), 'Kept. Only Claude\'s picks are scheduled; the rest draft at their moment.');
|
|
59
|
+
if (a === 'overlap') return done(await Promise.resolve(pmPost('/api/ready-reports/overlap', { ws: h.ws || undefined })).catch(() => null), 'One update each. The wider one carries the others as sections.');
|
|
60
|
+
b.disabled = false;
|
|
61
|
+
});
|
|
62
|
+
}
|
|
@@ -97,3 +97,4 @@
|
|
|
97
97
|
.tkc .tkc-h li small { font-size: var(--fs-2); color: var(--cz-ink3); line-height: 1.4; }
|
|
98
98
|
.tkc .tkc-hu { width: 30px; height: 30px; border-radius: 999px; border: 0; background: none; color: var(--cz-ink2); display: inline-flex; align-items: center; justify-content: center; flex: none; cursor: pointer; }
|
|
99
99
|
.tkc .tkc-hu:hover { background: var(--cz-well); color: var(--cz-ink); }
|
|
100
|
+
.tkc .seg .ivq-del:hover, .tkc .seg .ivq-del:focus-visible { color: var(--cz-red); background: var(--cz-redbg, transparent); }
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
* dueLine(t, now) → { text, late, lateText, none } the due row's words and the late text
|
|
18
18
|
* mountCard(el, t, h) → { draw } wires the card; h: { save(patch) → Promise<{ ok, error?, from? }>, toast(msg, undo?),
|
|
19
19
|
* openIni(id), inis() → [{ id, title }], owners() → [names], groups() → [names] | null,
|
|
20
|
-
* sections() → [{ key, name, milestone }] | null, now?(), changed?(t)
|
|
20
|
+
* sections() → [{ key, name, milestone }] | null, now?(), changed?(t),
|
|
21
|
+
* remove?() — the trash at the end of the Status row (batch 17 item 2; deleteEntry's on) }
|
|
21
22
|
* boardSaver({ ws, board, t, post, layout }) → save the board's routes behind h.save: status → tasks/state, owner, notes, dates, the
|
|
22
23
|
* section and the initiative → tasks/edit, the group → /api/initiative-layout place,
|
|
23
24
|
* a Jira ticket's notes → tickets/note. Each answers { ok, from } so Undo is save(from). */
|
|
@@ -38,6 +39,7 @@ const I = {
|
|
|
38
39
|
clear: '<path d="M6 6l12 12M18 6L6 18"/>', tick: '<path d="M20 6 9 17l-5-5"/>', user: '<circle cx="12" cy="8.5" r="3.5"/><path d="M5 20a7 7 0 0 1 14 0"/>',
|
|
39
40
|
flag: '<path d="M6 21V4M6 4h11l-2 4 2 4H6"/>', drag: '<path d="M12 3v18M3 12h18M12 3l-3 3M12 3l3 3M12 21l-3-3M12 21l3-3M3 12l3-3M3 12l3 3M21 12l-3-3M21 12l-3 3"/>',
|
|
40
41
|
dia: '<path d="M12 4l8 8-8 8-8-8z"/>',
|
|
42
|
+
bin: '<path d="M5 7h14M10 7V4h4v3M7 7l1 13h8l1-13"/>',
|
|
41
43
|
};
|
|
42
44
|
const ico = (d, w = 16) => `<svg width="${w}" height="${w}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${d}</svg>`;
|
|
43
45
|
export const esc = (s) => String(s == null ? '' : s).replace(/[&<>"]/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"' }[c]));
|
|
@@ -172,7 +174,9 @@ export function cardHtml(t, o = {}) {
|
|
|
172
174
|
// after a divider, the ◇ toggle (feedback batch 11 item 3, canvas XmlA2Flag): its due date shows as ◇ on the Board and the timeline
|
|
173
175
|
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';
|
|
174
176
|
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>`;
|
|
175
|
-
|
|
177
|
+
// last, after its own divider, the trash (batch 17 item 2): the same Delete as the Tasks list's status picker, with Undo in the toast
|
|
178
|
+
const delBtn = o.del ? `<span class="vr" aria-hidden="true"></span><button type="button" class="ivq-del" data-tkc-del aria-label="Delete task" title="Delete task">${ico(I.bin, 15)}</button>` : '';
|
|
179
|
+
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}${delBtn}</div></div>`
|
|
176
180
|
+ `<span class="k">Due</span><div class="v"><span class="anc">${dueBtn}${dOpen ? picker(t, o, now) : ''}</span>${late}</div>`
|
|
177
181
|
+ `<span class="k">Owner</span><div class="v"><span class="anc">${ownerBtn}${ownerPop}</span></div></div>`;
|
|
178
182
|
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>`;
|
|
@@ -226,7 +230,7 @@ export function mountCard(el, t, h) {
|
|
|
226
230
|
const draw = () => {
|
|
227
231
|
const keep = document.activeElement && el.contains(document.activeElement) && document.activeElement.matches('[data-tkc-notes]');
|
|
228
232
|
if (keep) return; // never redraw under the PM's typing
|
|
229
|
-
el.innerHTML = cardHtml(t, { ...st, ...lists(), hist: st.hist, histOpen: st.histOpen, now: h.now ? h.now() : Date.now() });
|
|
233
|
+
el.innerHTML = cardHtml(t, { ...st, ...lists(), hist: st.hist, histOpen: st.histOpen, del: !!h.remove, now: h.now ? h.now() : Date.now() });
|
|
230
234
|
const f = el.querySelector('.tkc-new input'); if (f && (st.open === 'owner' || st.open === 'group')) f.focus();
|
|
231
235
|
};
|
|
232
236
|
const word = (kind) => (WORDS[kind] || (() => 'Saved'))(t, h);
|
|
@@ -262,6 +266,7 @@ export function mountCard(el, t, h) {
|
|
|
262
266
|
}
|
|
263
267
|
if (d.tkcState) { if (d.tkcState !== t.status) { st.open = null; change('status', { status: d.tkcState }); } return; }
|
|
264
268
|
if ('tkcMs' in d) { st.open = null; change('milestone', { milestone: !t.milestone }); return; }
|
|
269
|
+
if ('tkcDel' in d && h.remove) { st.open = null; b.disabled = true; Promise.resolve(h.remove()).catch(() => null).then(() => { if (b.isConnected) b.disabled = false; }); return; }
|
|
265
270
|
if (d.tkcDay != null && b.closest('.tkc-dp')) { pick(d.tkcDay); return; }
|
|
266
271
|
if (d.tkcField) { st.field = d.tkcField; st.month = ''; draw(); return; }
|
|
267
272
|
if (d.tkcMonth) { st.month = d.tkcMonth; draw(); return; }
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
/* ready-dash-ui-test.js — the ready-made Dashboard in the program panel and the initiative view, and a ready-made report's two cuts in the one
|
|
4
|
+
* report Viewer (batch 17 item 1; canvas PbH1Header, PbA1, PbA2, PbA7, PbG2, PbG5). Serves the real Board page from the real server; Project
|
|
5
|
+
* Ascent comes from fixtures/program-ascent.js, and the /api/ready-reports routes answer fixtures/ready-reports.js, the shape the backend agreed.
|
|
6
|
+
* H the header: one toggle icon where the charter icon was (a gauge, "Show the dashboard", aria-pressed false); none before the dashboard reads
|
|
7
|
+
* D the Dashboard: ✦ line with Adler's face, Goals, Milestones, Needs you, Reports in order; the toggle shows a list, pressed; the pencil on
|
|
8
|
+
* Milestones opens the charter · W wide (1440): two columns (PbA7) · N ✓ on Needs you keeps the pick (POST /api/proposals/keep)
|
|
9
|
+
* R a report row opens the one report Viewer: Sponsors · 1 minute | Team · full; Sponsors reads the cut and lists the Team-only sections
|
|
10
|
+
* L the last choice per page: after a reload the Dashboard opens first
|
|
11
|
+
* I the initiative view on the Board has the same toggle; a held report (PbG2): Wait posts the hold
|
|
12
|
+
* M on a phone (390): the title keeps 150 px, the Dashboard fits the width, no page error · S the type scale only
|
|
13
|
+
* P the product page on Home (390 and 1440) is the product's Dashboard, with no toggle (PbA3, PbG8).
|
|
14
|
+
* PMOS_SHOTS=<dir> also saves the screenshots. */
|
|
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: 'ready-dash-ui' });
|
|
20
|
+
const BP = require('./lib/board-premium.js');
|
|
21
|
+
const F = require('./fixtures/board-premium-facts.js');
|
|
22
|
+
const A = require('./fixtures/program-ascent.js');
|
|
23
|
+
const RR = require('./fixtures/ready-reports.js');
|
|
24
|
+
|
|
25
|
+
const BASE = T.BASE;
|
|
26
|
+
const SHOTS = process.env.PMOS_SHOTS || '';
|
|
27
|
+
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
28
|
+
const until = async (fn, ms = 10000, step = 100) => { const t0 = Date.now(); for (;;) { let v; try { v = await fn(); } catch { v = null; } if (v) return v; if (Date.now() - t0 > ms) return v; await sleep(step); } };
|
|
29
|
+
const results = [];
|
|
30
|
+
const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + String(extra).slice(0, 700) : ''}`); };
|
|
31
|
+
let srv = null; let browser = null;
|
|
32
|
+
const finish = async (code) => {
|
|
33
|
+
if (browser) await browser.close().catch(() => {});
|
|
34
|
+
if (srv) { try { srv.kill('SIGKILL'); } catch { /* gone */ } }
|
|
35
|
+
T.killTmux();
|
|
36
|
+
const bad = results.filter((x) => !x.cond).length;
|
|
37
|
+
console.log(`\n${results.length - bad}/${results.length} ready-dash-ui assertions passed`);
|
|
38
|
+
process.exit(code !== undefined ? code : (bad ? 1 : 0));
|
|
39
|
+
};
|
|
40
|
+
process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
41
|
+
|
|
42
|
+
const TEAM = '# Inline login slips to early December unless passkeys move to v1.1\n\n1. Sign-in at checkout is +1.2 of +5 points.\n2. Build is 14 of 23 tickets.\n3. Cutting passkeys keeps 18 Nov.\n\n## Your decision\n\nShip 18 Nov without passkeys.\n\n## Scorecard\n\n| Goal | Now |\n|---|---|\n| Checkout | +1.2 |\n\n## Tickets and risks\n\n14 of 23 done.\n\n## Next week\'s plan\n\nCut passkeys.\n';
|
|
43
|
+
const SPONSORS = '# Inline login slips to early December unless passkeys move to v1.1\n\n1. Sign-in at checkout is +1.2 of +5 points.\n2. Build is 14 of 23 tickets.\n3. Cutting passkeys keeps 18 Nov.\n\n## Your decision\n\nShip 18 Nov without passkeys.\n\n## Scorecard\n\n| Goal | Now |\n|---|---|\n| Checkout | +1.2 |\n';
|
|
44
|
+
|
|
45
|
+
(async () => {
|
|
46
|
+
const exe = process.env.PMOS_CHROME || findBrowser();
|
|
47
|
+
if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the suite cannot run'); return finish(1); }
|
|
48
|
+
let chromium;
|
|
49
|
+
try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
|
|
50
|
+
srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
|
|
51
|
+
await T.waitForServer(BASE);
|
|
52
|
+
browser = await chromium.launch({ executablePath: exe });
|
|
53
|
+
if (SHOTS) fs.mkdirSync(SHOTS, { recursive: true });
|
|
54
|
+
const shot = async (p, name) => { if (SHOTS) { await sleep(450); await p.screenshot({ path: path.join(SHOTS, name + '.png') }); } };
|
|
55
|
+
|
|
56
|
+
const open = async ({ w = 1440, h = 900, dark = false, ctx = null, dash = {} } = {}) => {
|
|
57
|
+
const c = ctx || await browser.newContext({ viewport: { width: w, height: h }, colorScheme: dark ? 'dark' : 'light' });
|
|
58
|
+
const page = await c.newPage();
|
|
59
|
+
const errors = [], posts = [], gets = [];
|
|
60
|
+
page.on('pageerror', (e) => errors.push(String((e && e.stack) || e)));
|
|
61
|
+
const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'application/json', body: JSON.stringify(b) }), wsOf = (r) => new URL(r.request().url()).searchParams.get('ws') || 'idpf';
|
|
62
|
+
await page.route('**/api/board-premium*', (r) => json(r, { ok: true, state: 'ready', model: BP.build(F.programFacts(wsOf(r))), as_of: Date.now() }));
|
|
63
|
+
await page.route('**/api/programs', (r) => json(r, { ok: true, programs: F.programs() }));
|
|
64
|
+
await page.route('**/api/boards/anchors*', (r) => json(r, { ok: true, anchors: A.ANCHORS[wsOf(r)] || [] }));
|
|
65
|
+
await page.route('**/api/insights-premium*', (r) => json(r, { ok: true, model: { goals: A.GOALS[wsOf(r)] || [] } }));
|
|
66
|
+
await page.route('**/api/boards/items*', (r) => json(r, { ok: true, items: A.ITEMS[wsOf(r)] || [] }));
|
|
67
|
+
await page.route('**/api/programs/*', (r) => json(r, { ok: true }));
|
|
68
|
+
await page.route('**/api/board-trail*', (r) => json(r, { ok: false, error: 'not in this check' }, 500));
|
|
69
|
+
await page.route('**/api/metric-drafts**', (r) => json(r, { ok: true, rows: [], run: { state: 'idle', step: 0, reads: [] } }));
|
|
70
|
+
// the ready-made dashboards, per scope (the backend's GET /api/ready-reports/dashboard), and its writes
|
|
71
|
+
const D = { 'program:project-ascent': RR.program(), 'initiative:descope-parity': RR.initiative(), ...dash };
|
|
72
|
+
await page.route('**/api/ready-reports/**', (r) => {
|
|
73
|
+
const rq = r.request(), u = new URL(rq.url());
|
|
74
|
+
if (rq.method() === 'GET' && u.pathname === '/api/ready-reports/dashboard') { const s = u.searchParams.get('scope'); gets.push({ scope: s, from: u.searchParams.get('from'), ws: u.searchParams.get('ws') }); return D[s] ? json(r, D[s]) : json(r, { ok: false, error: 'no such scope' }, 404); }
|
|
75
|
+
if (rq.method() === 'GET' && u.pathname === '/api/ready-reports/cut') { gets.push({ cut: u.searchParams.get('cut'), path: u.searchParams.get('path') }); return json(r, { ok: true, cut: 'sponsors', markdown: SPONSORS }); }
|
|
76
|
+
posts.push({ path: u.pathname, body: JSON.parse(rq.postData() || '{}') });
|
|
77
|
+
return json(r, { ok: true });
|
|
78
|
+
});
|
|
79
|
+
await page.route('**/api/proposals/**', (r) => { posts.push({ path: new URL(r.request().url()).pathname, body: JSON.parse(r.request().postData() || '{}') }); return json(r, { ok: true }); });
|
|
80
|
+
// the one report Viewer's reads: the document, its cycles; the rest answer nothing to show
|
|
81
|
+
await page.route('**/api/doc?*', (r) => r.fulfill({ contentType: 'text/markdown', body: TEAM }));
|
|
82
|
+
await page.route('**/api/report-documents*', (r) => json(r, { ok: true, docs: [{ path: 'reports/one-login-sponsor/2026-10-29.md', slot: '2026-10-29', state: 'draft' }] }));
|
|
83
|
+
await page.route('**/api/doc-sheet/stamp*', (r) => json(r, { ok: true, hash: 'h1' }));
|
|
84
|
+
await page.goto(BASE + '/premium-board.html?ws=idpf&program=project-ascent');
|
|
85
|
+
await until(() => page.evaluate(() => { const v = document.querySelector('#czViewer'); return !!v && !v.hidden && !!v.querySelector('.pp-vw'); }), 15000);
|
|
86
|
+
return { page, ctx: c, errors, posts, gets, D };
|
|
87
|
+
};
|
|
88
|
+
const head = (p) => p.evaluate(() => {
|
|
89
|
+
const h = document.querySelector('#czViewer .cz-vw-head') || document.querySelector('#czViewer'); const t = document.querySelector('#czViewer [data-cz-vw-p="dash"]');
|
|
90
|
+
return { toggle: t ? { label: t.getAttribute('aria-label'), title: t.getAttribute('title'), pressed: t.getAttribute('aria-pressed'), text: t.textContent.trim() } : null,
|
|
91
|
+
charter: !!document.querySelector('#czViewer [data-cz-vw-p="charter"]'), title: (() => { const e = document.querySelector('#czViewer .cz-vw-t'); return e ? Math.round(e.getBoundingClientRect().width) : 0; })(),
|
|
92
|
+
presses: [...h.querySelectorAll('[data-cz-vw="press"]')].map((b) => b.getAttribute('aria-label')) };
|
|
93
|
+
});
|
|
94
|
+
const dash = (p) => p.evaluate(() => {
|
|
95
|
+
const d = document.querySelector('#czViewer .db'); if (!d) return null;
|
|
96
|
+
return { heads: [...d.querySelectorAll('.db-h')].map((x) => x.textContent), hd: (d.querySelector('.db-hd b') || {}).textContent || '', face: !!d.querySelector('.db-hd .db-face svg, .db-hd .db-face .ad-dot'),
|
|
97
|
+
cols: getComputedStyle(d.querySelector('.db-grid')).gridTemplateColumns.split(' ').filter(Boolean).length, w: d.getBoundingClientRect().width, over: d.scrollWidth > d.clientWidth + 1 };
|
|
98
|
+
});
|
|
99
|
+
const sizes = (p, sel) => p.evaluate((s) => [...new Set([...document.querySelectorAll(s + ', ' + s + ' *')].filter((e) => e.childNodes.length && [...e.childNodes].some((n) => n.nodeType === 3 && n.textContent.trim())).map((e) => getComputedStyle(e).fontSize))], sel);
|
|
100
|
+
const SCALE = new Set(['11px', '12px', '14px', '16px', '20px', '28px']);
|
|
101
|
+
|
|
102
|
+
/* ── H: the header ── */
|
|
103
|
+
const X = await open();
|
|
104
|
+
const p = X.page;
|
|
105
|
+
const h0 = await until(async () => { const h = await head(p); return h.toggle ? h : null; });
|
|
106
|
+
ok('H one toggle icon in the charter\'s place: a gauge, "Show the dashboard", not pressed, icon-only', !!h0 && !h0.charter && h0.toggle.label === 'Show the dashboard' && h0.toggle.title === 'Show the dashboard' && h0.toggle.pressed === 'false' && !h0.toggle.text, JSON.stringify(h0));
|
|
107
|
+
ok('H the dashboard is read for the program, as a press to act (a Board row)', X.gets.some((g) => g.scope === 'program:project-ascent' && g.from === 'act' && g.ws === 'idpf'), JSON.stringify(X.gets));
|
|
108
|
+
ok('H Work opens first: the panel\'s own summary shows, no Dashboard', await p.evaluate(() => !!document.querySelector('#czViewer .pp-vw .czs-sum') && !document.querySelector('#czViewer .db')));
|
|
109
|
+
|
|
110
|
+
/* ── D: the Dashboard ── */
|
|
111
|
+
await p.click('#czViewer [data-cz-vw-p="dash"]');
|
|
112
|
+
const d0 = await until(() => dash(p));
|
|
113
|
+
ok('D the blocks in order: Goals, Milestones, Needs you, Reports; no empty block', !!d0 && d0.heads.join() === 'Goals,Milestones,Needs you,Reports', JSON.stringify(d0));
|
|
114
|
+
ok('D the ✦ line leads with what Claude handled, with Adler\'s face', !!d0 && d0.hd === '3 of 4 milestones hold their dates. I drafted the sponsor update for Thursday.' && d0.face, JSON.stringify(d0));
|
|
115
|
+
const h1 = await head(p);
|
|
116
|
+
ok('D the same icon now shows the list to go back, pressed', !!h1.toggle && h1.toggle.label === 'Show the work' && h1.toggle.pressed === 'true', JSON.stringify(h1));
|
|
117
|
+
ok('D in the 560 px panel the blocks stack in one column', !!d0 && d0.cols === 1, JSON.stringify(d0));
|
|
118
|
+
const ds = await sizes(p, '#czViewer .db');
|
|
119
|
+
ok('S the Dashboard uses the type scale only', ds.length && ds.every((x) => SCALE.has(x)), ds.join());
|
|
120
|
+
await shot(p, 'PbA2Prog-desk-built');
|
|
121
|
+
|
|
122
|
+
/* ── W: wide ── */
|
|
123
|
+
await p.click('#czViewer [data-cz-vw="wide"]');
|
|
124
|
+
const dw = await until(async () => { const d = await dash(p); return d && d.cols === 2 ? d : null; }, 4000);
|
|
125
|
+
ok('W wide (PbA7): two columns, each block its own card', !!dw && dw.cols === 2, JSON.stringify(await dash(p)));
|
|
126
|
+
await shot(p, 'PbA7Desk-built');
|
|
127
|
+
await p.click('#czViewer [data-cz-vw="wide"]');
|
|
128
|
+
|
|
129
|
+
/* ── N: Needs you ✓ ── */
|
|
130
|
+
await p.click('#czViewer .db-need [data-db="needs"][data-k="keep"]');
|
|
131
|
+
const kp = await until(() => X.posts.find((x) => x.path === '/api/proposals/keep'));
|
|
132
|
+
ok('N ✓ keeps Claude\'s pick: POST /api/proposals/keep with the proposal ids and the initiative', !!kp && kp.body.ids.join() === 'p-dates-1' && kp.body.initiative === 'descope-parity' && kp.body.ws === 'idpf', JSON.stringify(kp));
|
|
133
|
+
ok('N the dashboard is read again after the press', (await until(() => X.gets.filter((g) => g.scope === 'program:project-ascent').length >= 2, 3000)));
|
|
134
|
+
|
|
135
|
+
/* ── the Milestones pencil opens the charter, ← comes back to the Dashboard ── */
|
|
136
|
+
await p.click('#czViewer .db [data-db="milestones"]');
|
|
137
|
+
ok('D the pencil on Milestones opens the charter', !!(await until(() => p.evaluate(() => window.czViewer && window.czViewer.current() && /^charter:/.test(window.czViewer.current().id)), 4000)));
|
|
138
|
+
await p.click('#czViewer [data-cz-vw="back"]');
|
|
139
|
+
ok('D ← comes back to the Dashboard', !!(await until(() => p.evaluate(() => !!document.querySelector('#czViewer .db')), 4000)));
|
|
140
|
+
|
|
141
|
+
/* ── R: a report row, and its two cuts ── */
|
|
142
|
+
await p.click('#czViewer .db [data-db="report"][data-k="r-sponsor"]');
|
|
143
|
+
const seg = await until(() => p.evaluate(() => { const s = document.querySelector('#czViewer .vz-cuts'); return s ? [...s.querySelectorAll('button')].map((b) => b.textContent + ':' + b.getAttribute('aria-pressed')) : null; }), 8000);
|
|
144
|
+
ok('R the report opens in the one report Viewer with Sponsors · 1 minute | Team · full, Team first', !!seg && seg.join() === 'Sponsors · 1 minute:false,Team · full:true', JSON.stringify(seg));
|
|
145
|
+
await shot(p, 'PbA4Report-team-built');
|
|
146
|
+
await p.click('#czViewer .vz-cuts [data-r="cut|sponsors"]');
|
|
147
|
+
const cut = await until(() => p.evaluate(() => { const L = [...document.querySelectorAll('#czViewer .vz-cutl li')]; return L.length ? L.map((l) => (l.classList.contains('on') ? '✓' : '·') + l.querySelector('b').textContent + (l.querySelector('small') ? ' (' + l.querySelector('small').textContent + ')' : '')) : null; }), 5000);
|
|
148
|
+
ok('R Sponsors reads the cut (GET /api/ready-reports/cut) and ticks what sponsors read; the rest say Team only', !!cut && cut.join(' / ') === '✓The answer and 3 points / ✓Your decision / ✓Scorecard / ·Tickets and risks (Team only) / ·Next week\'s plan (Team only)', JSON.stringify(cut));
|
|
149
|
+
ok('R the cut was read for this file', X.gets.some((g) => g.cut === 'sponsors' && g.path === 'reports/one-login-sponsor/2026-10-29.md'));
|
|
150
|
+
ok('R Edit is not offered on the sponsors cut (the team cut is the one edited)', await p.evaluate(() => !document.querySelector('#czViewer [data-r="edit"]')));
|
|
151
|
+
await shot(p, 'PbG5Readers-built');
|
|
152
|
+
await p.click('#czViewer .vz-cuts [data-r="cut|team"]');
|
|
153
|
+
ok('R Team shows the full draft again', !!(await until(() => p.evaluate(() => !document.querySelector('#czViewer .vz-cutl') && document.querySelector('#czViewer [data-r="cut|team"]').getAttribute('aria-pressed') === 'true'), 3000)));
|
|
154
|
+
ok('0 no page error (desk)', X.errors.length === 0, X.errors.join(' | '));
|
|
155
|
+
await p.close();
|
|
156
|
+
|
|
157
|
+
/* ── L: the last choice per page ── */
|
|
158
|
+
const L = await open({ ctx: X.ctx });
|
|
159
|
+
const dl = await until(() => dash(L.page), 8000);
|
|
160
|
+
ok('L after a reload the Dashboard opens first: the PM\'s last choice on this program', !!dl && dl.heads[0] === 'Goals', JSON.stringify(dl));
|
|
161
|
+
|
|
162
|
+
/* ── I: the initiative view on the Board ── */
|
|
163
|
+
await L.page.click('#czViewer [data-cz-vw-p="dash"]'); // back to the work, so the tree is there
|
|
164
|
+
await until(() => L.page.evaluate(() => { const b = document.querySelector('#czViewer [data-czs-fold="tree"]'); if (b && b.getAttribute('aria-expanded') !== 'true') b.click(); return !!document.querySelector('#czViewer button.pp-open[data-ini="descope-parity"]'); }));
|
|
165
|
+
await L.page.click('#czViewer button.pp-open[data-ini="descope-parity"]');
|
|
166
|
+
const it = await until(async () => { const h = await head(L.page); return h.toggle && (await L.page.evaluate(() => !!document.querySelector('#czViewer .iv'))) ? h : null; }, 8000);
|
|
167
|
+
ok('I the initiative view carries the same toggle; Work shows first', !!it && it.toggle.label === 'Show the dashboard', JSON.stringify(it));
|
|
168
|
+
ok('I the initiative\'s dashboard is read for its scope', L.gets.some((g) => g.scope === 'initiative:descope-parity'));
|
|
169
|
+
await L.page.click('#czViewer [data-cz-vw-p="dash"]');
|
|
170
|
+
const di = await until(() => dash(L.page));
|
|
171
|
+
ok('I PbA1: Goal, Ships, Needs you, Reports', !!di && di.heads.join() === 'Goal,Ships,Needs you,Reports', JSON.stringify(di));
|
|
172
|
+
ok('I Ships: the range against the promise', await L.page.evaluate(() => /28 Nov to 5 Dec/.test(document.querySelector('#czViewer .db').textContent) && /promised 18 Nov/.test(document.querySelector('#czViewer .db').textContent)));
|
|
173
|
+
await shot(L.page, 'PbA1Ini-desk-built');
|
|
174
|
+
ok('0 no page error (initiative)', L.errors.length === 0, L.errors.join(' | '));
|
|
175
|
+
await X.ctx.close();
|
|
176
|
+
|
|
177
|
+
/* ── G: a held report (PbG2) ── */
|
|
178
|
+
const G = await open({ dash: { 'program:project-ascent': { ...RR.held(), scope: 'program:project-ascent' } } });
|
|
179
|
+
await until(async () => (await head(G.page)).toggle);
|
|
180
|
+
await G.page.click('#czViewer [data-cz-vw-p="dash"]');
|
|
181
|
+
await until(() => dash(G.page));
|
|
182
|
+
ok('G the held update: the honest ✦ line and Skip, Send with a note, Wait', await G.page.evaluate(() => !!document.querySelector('#czViewer .db-hd.warn') && document.querySelectorAll('#czViewer .db-held .db-ib').length === 3));
|
|
183
|
+
await G.page.click('#czViewer .db-held [data-k="r-weekly|wait"]');
|
|
184
|
+
const hp = await until(() => G.posts.find((x) => x.path === '/api/ready-reports/hold'));
|
|
185
|
+
ok('G Wait posts the hold (POST /api/ready-reports/hold, act wait)', !!hp && hp.body.act === 'wait' && hp.body.kind === 'weekly' && hp.body.scope === 'program:project-ascent', JSON.stringify(hp));
|
|
186
|
+
await shot(G.page, 'PbG2Stale-built');
|
|
187
|
+
ok('0 no page error (held)', G.errors.length === 0, G.errors.join(' | '));
|
|
188
|
+
await G.ctx.close();
|
|
189
|
+
|
|
190
|
+
/* ── Z: no dashboard: no toggle ── */
|
|
191
|
+
const Z = await open({ dash: { 'program:project-ascent': null } });
|
|
192
|
+
await until(() => Z.gets.some((g) => g.scope === 'program:project-ascent'), 5000); await sleep(500);
|
|
193
|
+
const hz = await head(Z.page);
|
|
194
|
+
ok('Z the dashboard cannot be read: no toggle, the work as before', !hz.toggle && !hz.charter, JSON.stringify(hz));
|
|
195
|
+
await Z.ctx.close();
|
|
196
|
+
|
|
197
|
+
/* ── M: a phone ── */
|
|
198
|
+
const M = await open({ w: 390, h: 844, dark: true });
|
|
199
|
+
const hm = await until(async () => { const h = await head(M.page); return h.toggle ? h : null; });
|
|
200
|
+
ok('M at 390 px the title keeps 150 px beside the one toggle (PbH1Header)', !!hm && hm.title >= 150, JSON.stringify(hm));
|
|
201
|
+
await M.page.click('#czViewer [data-cz-vw-p="dash"]');
|
|
202
|
+
const dm = await until(() => dash(M.page));
|
|
203
|
+
ok('M the Dashboard fits the phone: one column, no sideways scroll', !!dm && dm.cols === 1 && !dm.over && dm.w <= 390, JSON.stringify(dm));
|
|
204
|
+
ok('M every press is at least 40 px', await M.page.evaluate(() => [...document.querySelectorAll('#czViewer .db .db-ib')].every((b) => b.getBoundingClientRect().width >= 40)));
|
|
205
|
+
await shot(M.page, 'PbA2Prog-phone-dark-built');
|
|
206
|
+
ok('0 no page error (phone)', M.errors.length === 0, M.errors.join(' | '));
|
|
207
|
+
await M.ctx.close();
|
|
208
|
+
|
|
209
|
+
/* ── P: the product page on Home is the product's Dashboard (PbA3, PbG8): no toggle; Goals as dots, Ships next, This week ── */
|
|
210
|
+
for (const [w, hgt, nm] of [[390, 844, 'phone'], [1440, 900, 'desk']]) {
|
|
211
|
+
const c = await browser.newContext({ viewport: { width: w, height: hgt } });
|
|
212
|
+
const pg = await c.newPage(); const errs = [], gets = [];
|
|
213
|
+
pg.on('pageerror', (e) => errs.push(String((e && e.stack) || e)));
|
|
214
|
+
await pg.route('**/api/ready-reports/dashboard*', (r) => { const u = new URL(r.request().url()); gets.push({ scope: u.searchParams.get('scope'), from: u.searchParams.get('from') }); return r.fulfill({ contentType: 'application/json', body: JSON.stringify(RR.product()) }); });
|
|
215
|
+
await pg.goto(BASE + '/premium.html?ini=product');
|
|
216
|
+
const pd = await until(() => pg.evaluate(() => { const d = document.querySelector('#czViewer .db'); if (!d) return null; return { heads: [...d.querySelectorAll('.db-h')].map((x) => x.textContent), sum: (d.querySelector('.db-sum b') || {}).textContent || '', late: !!d.querySelector('.db-late'), over: d.scrollWidth > d.clientWidth + 1, toggle: !!document.querySelector('#czViewer [data-cz-vw-p="dash"]') }; }), 15000);
|
|
217
|
+
ok('P (' + nm + ') the product page is the Dashboard: Goals folded to dots, Ships next, This week with the late update; no toggle', !!pd && pd.sum === 'Goals' && pd.heads.join() === 'Ships next,This week' && pd.late && !pd.toggle && !pd.over, JSON.stringify(pd));
|
|
218
|
+
const mx = await pg.evaluate(() => { const b = document.querySelector('#czViewer .db [data-db="metrics"]'); if (!b) return null; const r = b.getBoundingClientRect(), s = document.querySelector('#czViewer .db-sum').getBoundingClientRect(); return { w: r.width, label: b.getAttribute('aria-label'), beside: Math.abs((r.top + r.height / 2) - (s.top + s.height / 2)) < 12 }; });
|
|
219
|
+
ok('P (' + nm + ') the metrics review keeps its way in: one icon at the Goals head, 40 px', !!mx && mx.label === 'Open the metrics review' && mx.w >= 40 && mx.beside, JSON.stringify(mx));
|
|
220
|
+
if (nm === 'desk') { await pg.click('#czViewer .db [data-db="metrics"]'); ok('P the icon opens the metrics review, ← back to the product', !!(await until(() => pg.evaluate(() => { const c = window.czViewer && window.czViewer.current(); return c && c.id !== 'product' ? c.id : null; })))); }
|
|
221
|
+
ok('P (' + nm + ') read as a page to read (scope product)', gets.some((g) => g.scope === 'product' && g.from === 'read'), JSON.stringify(gets));
|
|
222
|
+
await shot(pg, 'PbA3Product-' + nm + '-built');
|
|
223
|
+
ok('0 no page error (product, ' + nm + ')', errs.length === 0, errs.join(' | '));
|
|
224
|
+
await c.close();
|
|
225
|
+
}
|
|
226
|
+
return finish();
|
|
227
|
+
})();
|
package/workspace/server.js
CHANGED
|
@@ -2661,6 +2661,8 @@ const dashboardScheduleTick = () => {
|
|
|
2661
2661
|
let setups = null; try { setups = require('./lib/routes-report-setups.js'); } catch { setups = null; }
|
|
2662
2662
|
(setups ? setups.tick(reportSetupsCtx()) : Promise.resolve())
|
|
2663
2663
|
.catch((e) => warnWriteFail('report setups tick', e))
|
|
2664
|
+
.then(() => { let rr = null; try { rr = require('./lib/routes-ready-reports.js'); } catch { return null; } return rr.tick(reportSetupsCtx()); }) // batch 17 item 1: the ready-made reports
|
|
2665
|
+
.catch((e) => warnWriteFail('ready reports tick', e))
|
|
2664
2666
|
.then(() => m.runDue({ getWs, runtimeDir: STATE }))
|
|
2665
2667
|
.catch((e) => warnWriteFail('dashboard schedule tick', e));
|
|
2666
2668
|
};
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
* the toast says "Deleted · <title>." with Undo, and Undo restores it
|
|
8
8
|
* I a breakdown item (<initiative>.<10 characters>) gets the same trash; a Jira ticket draws no caret, so it has none
|
|
9
9
|
* P the phone: a long press on the box opens the same picker, with the trash
|
|
10
|
+
* V the Task Viewer (batch 17 item 2; Wawan: "no delete menu on Task viewer"): its Status row ends in the same trash after its own divider,
|
|
11
|
+
* ⋯ opens and ends in Delete, and a press deletes at once with the Undo toast and closes the Viewer
|
|
10
12
|
* SHOTS_16=<dir>: the picker with the trash, the toast, and the phone, into <dir>. */
|
|
11
13
|
const path = require('path');
|
|
12
14
|
const { spawn } = require('child_process');
|
|
@@ -104,6 +106,35 @@ const ITEMS = [
|
|
|
104
106
|
await ctx.close();
|
|
105
107
|
}
|
|
106
108
|
|
|
109
|
+
/* V — the Task Viewer, opened from the task's title on the panel */
|
|
110
|
+
{
|
|
111
|
+
const { ctx, page: p, errors, posts } = await open();
|
|
112
|
+
await p.route('**/api/boards/items*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, items: [], initiatives: [] }) }));
|
|
113
|
+
await p.route('**/api/initiative-layout*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, names: [], of: {} }) }));
|
|
114
|
+
await p.route('**/api/proposals/history*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, history: [] }) }));
|
|
115
|
+
await p.click('#ibBody [data-key="board:scarlet"]');
|
|
116
|
+
await p.waitForSelector('.iv-tr', { timeout: 8000 });
|
|
117
|
+
await unfold(p);
|
|
118
|
+
await p.click('.iv-tt[data-iv-task="task-api"]');
|
|
119
|
+
await p.waitForSelector('.tkc .seg', { timeout: 8000 }).catch(() => {});
|
|
120
|
+
const row = await p.evaluate(() => {
|
|
121
|
+
const seg = document.querySelector('.tkc .seg'); if (!seg) return null;
|
|
122
|
+
const b = seg.querySelector('.ivq-del');
|
|
123
|
+
return b ? { lbl: b.getAttribute('aria-label'), text: b.textContent, last: seg.lastElementChild === b, afterVr: !!(b.previousElementSibling && b.previousElementSibling.classList.contains('vr')) } : { none: true };
|
|
124
|
+
});
|
|
125
|
+
ok('V the Viewer\'s Status row ends in the trash, icon only, after its own divider', row && row.lbl === 'Delete task' && row.text === '' && row.last && row.afterVr, JSON.stringify(row));
|
|
126
|
+
await p.click('[data-cz-vw="more"]'); await p.waitForTimeout(200);
|
|
127
|
+
const menu = await p.evaluate(() => [...document.querySelectorAll('.cz-vw-menu button')].map((x) => x.textContent.trim()));
|
|
128
|
+
ok('V ⋯ opens and its last entry is Delete', menu.length && menu[menu.length - 1] === 'Delete', JSON.stringify(menu));
|
|
129
|
+
await p.keyboard.press('Escape'); await p.mouse.click(5, 5); await p.waitForTimeout(150);
|
|
130
|
+
await shot(p, 'delete-viewer-1440');
|
|
131
|
+
await p.click('.tkc .seg .ivq-del'); await p.waitForTimeout(500);
|
|
132
|
+
const after = await p.evaluate(() => ({ toast: (document.getElementById('bdToast') || {}).textContent || '', card: !!document.querySelector('.tkc .seg'), dialog: !!document.querySelector('[role="alertdialog"], dialog[open]') }));
|
|
133
|
+
ok('V the trash deletes at once: the delete route, no confirm, the toast with Undo, and the Viewer closes', posts.length === 1 && posts[0][0] === 'delete' && posts[0][1].task === 'task-api' && !after.dialog && !after.card && /^Deleted · Ship the article summaries API\.\s*Undo$/.test(after.toast.trim()), JSON.stringify({ posts, after }));
|
|
134
|
+
ok('the Viewer threw nothing', !errors.length, errors.join('\n'));
|
|
135
|
+
await ctx.close();
|
|
136
|
+
}
|
|
137
|
+
|
|
107
138
|
/* P — the phone: a long press on the box opens the picker, with the trash */
|
|
108
139
|
{
|
|
109
140
|
const { ctx, page: p, errors } = await open({ w: 390, h: 844, phone: true });
|
|
@@ -151,6 +151,12 @@ const model = () => { const M = BP.build(F.facts()); const r = M.rows.find((x) =
|
|
|
151
151
|
const mz = await until(() => p.evaluate(() => { const z = document.querySelector('#czViewer [data-iv-zoom]'); return z && z.textContent === 'Months' ? document.querySelector('#czViewer .ivt').dataset.px : null; }));
|
|
152
152
|
ok('V4 the zoom picker changes Weeks to Months', mz === '4', mz);
|
|
153
153
|
await p.click('#czViewer [data-iv-zoom]');
|
|
154
|
+
const zl = await p.evaluate(() => [...document.querySelectorAll('.tkc.ivq [data-ivq-i]')].map((x) => x.textContent.trim()));
|
|
155
|
+
ok('V4 the zoom picker offers Weeks, Months, Quarter, Year, 2 years and 5 years (batch 17 item 3)', ['Weeks', 'Months', 'Quarter', 'Year', '2 years', '5 years'].every((t) => zl.some((x) => x.includes(t))), JSON.stringify(zl));
|
|
156
|
+
await p.evaluate(() => { const b = [...document.querySelectorAll('.tkc.ivq [data-ivq-i]')].find((x) => /5 years/.test(x.textContent)); if (b) b.click(); });
|
|
157
|
+
const y5 = await until(() => p.evaluate(() => { const z = document.querySelector('#czViewer [data-iv-zoom]'); if (!z || z.textContent !== '5 years') return null; const T = document.querySelector('#czViewer .ivt'); return { px: T.dataset.px, ticks: [...T.querySelectorAll('.ivt-r.ax .ivt-c span')].map((e) => e.textContent.trim()).filter(Boolean).slice(0, 8) }; }));
|
|
158
|
+
ok('V4 5 years draws the axis by year', y5 && y5.px === '0.16' && y5.ticks.length && y5.ticks.every((t) => /^\d{4}$/.test(t)), JSON.stringify(y5));
|
|
159
|
+
await p.click('#czViewer [data-iv-zoom]');
|
|
154
160
|
await p.evaluate(() => { const b = [...document.querySelectorAll('.tkc.ivq [data-ivq-i]')].find((x) => /Weeks/.test(x.textContent)); if (b) b.click(); });
|
|
155
161
|
await until(() => p.evaluate(() => (document.querySelector('#czViewer [data-iv-zoom]') || {}).textContent === 'Weeks'));
|
|
156
162
|
|
|
@@ -175,6 +181,16 @@ const model = () => { const M = BP.build(F.facts()); const r = M.rows.find((x) =
|
|
|
175
181
|
await p.keyboard.press('Escape');
|
|
176
182
|
ok('V5 Escape closes the picker and leaves the panel open', await p.evaluate(() => !document.querySelector('.tkc.ivq') && !!document.querySelector('#czViewer .ivt')));
|
|
177
183
|
|
|
184
|
+
/* V4 full width (batch 17 item 3): the Timeline takes the window, as the Board's does; Escape goes back to the panel */
|
|
185
|
+
const pw = await p.evaluate(() => document.querySelector('#czViewer').getBoundingClientRect().width);
|
|
186
|
+
await p.click('#czViewer [data-iv-full]');
|
|
187
|
+
const fw = await until(() => p.evaluate(() => { const r = document.querySelector('#czViewer').getBoundingClientRect(); return r.width > innerWidth - 40 ? { w: Math.round(r.width), pressed: document.querySelector('#czViewer [data-iv-full]').getAttribute('aria-pressed') } : null; }));
|
|
188
|
+
ok('V4 Full width spreads the Timeline over the window, the icon pressed', !!fw && fw.pressed === 'true' && pw < fw.w, JSON.stringify({ pw, fw }));
|
|
189
|
+
await shot(p, 'timeline-full-1440');
|
|
190
|
+
await p.keyboard.press('Escape');
|
|
191
|
+
const back = await until(() => p.evaluate(() => (!document.body.classList.contains('ivt-full') && !!document.querySelector('#czViewer .ivt') ? Math.round(document.querySelector('#czViewer').getBoundingClientRect().width) : null)));
|
|
192
|
+
ok('V4 Escape takes the Timeline back to the panel, the Viewer stays open', back != null && back < fw.w, String(back));
|
|
193
|
+
|
|
178
194
|
/* V6 Kanban: one stage at a time (the current first), columns by status, Won't do a folded strip */
|
|
179
195
|
await p.click('#czViewer [data-iv-view="kanban"]');
|
|
180
196
|
await until(() => p.evaluate(() => !!document.querySelector('#czViewer .ivk')));
|