create-pmos 0.415.0 → 0.417.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 +2 -2
- 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/payload/state/log.md +1 -1
- package/workspace/briefing-premium-adddoc-test.js +3 -3
- package/workspace/briefing-premium-board-test.js +72 -43
- package/workspace/briefing-premium-doc-edit-test.js +2 -2
- package/workspace/briefing-premium-initiative-test.js +19 -22
- package/workspace/briefing-premium-insights-test.js +28 -17
- package/workspace/changelog.json +24 -0
- package/workspace/core-docs-workflow-test.js +1 -1
- package/workspace/guide/workflows.md +4 -3
- package/workspace/ini-workflow-test.js +11 -11
- package/workspace/lib/board-premium.js +7 -2
- package/workspace/lib/board-trail.js +6 -1
- package/workspace/lib/engine/boards.js +8 -2
- package/workspace/lib/initiative-chat.js +4 -3
- package/workspace/lib/initiative-premium.js +5 -3
- package/workspace/lib/insights-premium.js +9 -1
- package/workspace/lib/pmos-verbs.js +1 -1
- package/workspace/lib/route-modules.js +1 -0
- package/workspace/lib/routes-boards.js +73 -6
- package/workspace/lib/routes-live.js +53 -0
- package/workspace/lib/task-cli.js +88 -24
- package/workspace/lib/task-items.js +3 -1
- package/workspace/lib/workflow-cli.js +10 -4
- package/workspace/milestone-suggest-test.js +2 -1
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-board-actions-test.js +12 -8
- package/workspace/premium-chat-report-tab-test.js +13 -5
- package/workspace/premium-core-doc-issue-test.js +1 -1
- package/workspace/premium-report-read-test.js +66 -51
- package/workspace/premium-vw-backlog-test.js +3 -3
- package/workspace/premium-vw-doc-test.js +3 -3
- package/workspace/premium-vw-item-test.js +4 -4
- package/workspace/premium-vw-jira-test.js +14 -13
- package/workspace/premium-vw-slides-test.js +7 -5
- package/workspace/program-panel-test.js +1 -1
- package/workspace/public/pm/bd-ini-panel.js +68 -230
- package/workspace/public/pm/cozy-insights.css +15 -0
- package/workspace/public/pm/cozy-live-pill.css +48 -0
- package/workspace/public/pm/cozy-live-pill.js +141 -0
- package/workspace/public/pm/cozy-viewer.js +4 -3
- package/workspace/public/pm/cozy-vw-rp.css +48 -0
- package/workspace/public/pm/home-app.js +45 -8
- package/workspace/public/pm/home-chat.js +5 -2
- package/workspace/public/pm/home-ini.js +57 -22
- package/workspace/public/pm/home-task.js +16 -5
- package/workspace/public/pm/ini-view-model.js +277 -0
- package/workspace/public/pm/ini-view.css +122 -0
- package/workspace/public/pm/ini-view.js +180 -0
- package/workspace/public/pm/live-model.js +104 -0
- package/workspace/public/pm/ov-view.css +44 -0
- package/workspace/public/pm/premium-board.js +15 -16
- package/workspace/public/pm/premium-insights.js +61 -35
- package/workspace/public/pm/premium-report-read.js +74 -50
- package/workspace/public/pm/premium-report-tab.js +36 -15
- package/workspace/public/pm/premium-shell.js +1 -1
- package/workspace/public/pm/premium-vw-item-model.js +6 -3
- package/workspace/public/pm/premium-vw-item.js +25 -6
- package/workspace/public/pm/premium-vw-jira.js +17 -15
- package/workspace/public/pm/rp-parts.js +75 -12
- package/workspace/public/pm/task-card.css +24 -49
- package/workspace/public/pm/task-card.js +90 -64
- package/workspace/public/pm/tk-view.css +21 -0
- package/workspace/public/pm/tk-view.js +216 -0
- package/workspace/public/pm/wf-page.js +2 -0
- package/workspace/server.js +24 -1
- package/workspace/stage-card-test.js +49 -41
- package/workspace/task-card-test.js +83 -38
- package/workspace/test-files.json +3 -1
- package/workspace/test-lists/bd-ini-panel.json +3 -3
- package/workspace/tk-tasks-test.js +3 -3
- package/workspace/public/pm/bd-ini-model.js +0 -81
- package/workspace/public/pm/cozy-rec-pill.css +0 -12
- package/workspace/public/pm/cozy-rec-pill.js +0 -46
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
|
-
/* task-card-test.js — a task edited where it opens (third feedback batch item 7,
|
|
4
|
-
*
|
|
5
|
-
* P pure: task-card.js (the card
|
|
3
|
+
/* task-card-test.js — a task edited where it opens (third feedback batch item 7), laid out as the one task Viewer and the one Jira ticket
|
|
4
|
+
* Viewer of batch 6 item 1b (canvas OvViewers "Task", "Jira ticket", phone light and dark). Two halves:
|
|
5
|
+
* P pure: task-card.js (the facts card, the due row and late text, the check box, where it sits, which route each change takes) and
|
|
6
|
+
* tk-view.js (the ticket: what blocks it leads, the facts in plain text, the description cut at five lines, the folds).
|
|
6
7
|
* D the real page from the real server, its routes answered from the fixtures: a PMOS task opened from the initiative (premium-vw-item.js)
|
|
7
|
-
* and from Home's list (home-task.js) is the same
|
|
8
|
-
* header's check box is the quick Done; a Jira ticket
|
|
8
|
+
* and from Home's list (home-task.js) is the same view; status, dates, owner, notes, the section, the group and the initiative save at
|
|
9
|
+
* once with Undo; the header's check box is the quick Done; a Jira ticket opens the ticket Viewer, its notes editable; the phone.
|
|
9
10
|
* PMOS_SHOTS=<dir> also saves a screenshot of each state there. */
|
|
10
11
|
const path = require('path');
|
|
11
12
|
const fs = require('fs');
|
|
@@ -23,6 +24,16 @@ const BRF = require('./fixtures/briefing-premium-facts.js');
|
|
|
23
24
|
const BASE = T.BASE;
|
|
24
25
|
const SHOTS = process.env.PMOS_SHOTS || '';
|
|
25
26
|
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
27
|
+
/* SHOTS_1B=<dir>: the Viewer as it is now, light and dark, at 1440 and 390 wide (batch 6 item 1b's screenshots); the page is put back after. */
|
|
28
|
+
const four = async (p, name) => {
|
|
29
|
+
const dir = process.env.SHOTS_1B; if (!dir) return;
|
|
30
|
+
const vp = p.viewportSize();
|
|
31
|
+
for (const [w, h, tag] of [[1440, 900, 'desktop'], [390, 844, 'phone']]) for (const sch of ['light', 'dark']) {
|
|
32
|
+
await p.setViewportSize({ width: w, height: h }); await p.emulateMedia({ colorScheme: sch }); await new Promise((r) => setTimeout(r, 350));
|
|
33
|
+
await p.screenshot({ path: require('path').join(dir, `${name}-${tag}-${sch}.png`) });
|
|
34
|
+
}
|
|
35
|
+
await p.setViewportSize(vp); await p.emulateMedia({ colorScheme: null }); await new Promise((r) => setTimeout(r, 250));
|
|
36
|
+
};
|
|
26
37
|
const until = async (fn, ms = 10000, step = 100) => { const t0 = Date.now(); for (;;) { const v = await fn(); if (v) return v; if (Date.now() - t0 > ms) return v; await sleep(step); } };
|
|
27
38
|
const results = [];
|
|
28
39
|
const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + String(extra).slice(0, 600) : ''}`); };
|
|
@@ -45,28 +56,52 @@ async function pure() {
|
|
|
45
56
|
const h = C.cardHtml(t, { now, groups: ['Tender committee'], inis: [{ id: 'tender', title: 'Tender new CIAM' }, { id: 'descope', title: 'Descope' }] });
|
|
46
57
|
ok('P1 five status buttons, the current one says its name and is checked; the others are icon-only with a name for a screen reader', (h.match(/data-tkc-state=/g) || []).length === 5
|
|
47
58
|
&& /class="i-prog on" role="radio" aria-checked="true" data-tkc-state="In progress" title="In progress">.*In progress<\/button>/.test(h) && /aria-checked="false" data-tkc-state="Done" aria-label="Done"/.test(h), h.slice(0, 900));
|
|
48
|
-
ok('P1
|
|
49
|
-
ok('P1
|
|
50
|
-
|
|
59
|
+
ok('P1 one facts card: Status, Due, Owner, in that order', /<div class="ovf tkc-f"><span class="k">Status<\/span>[^]*<span class="k">Due<\/span>[^]*<span class="k">Owner<\/span>/.test(h));
|
|
60
|
+
ok('P1 the due row says the day, the late text sits beside it in amber', /aria-label="Oct 8\. Change the dates"[^>]*>Oct 8<\/button>/.test(h) && /<span class="r late">· 17 days late<\/span>/.test(h), h.slice(h.indexOf('Due'), h.indexOf('Due') + 400));
|
|
61
|
+
ok('P1 the owner is its avatar and name; notes edit in place; where it sits is one row with the move icon', /Owner: Wawan/.test(h) && /<span class="av">W<\/span>Wawan/.test(h) && /<textarea class="nt" id="tkcNotes" data-tkc-notes[^>]*>Minutes of 7 Oct\.<\/textarea>/.test(h)
|
|
62
|
+
&& /class="ovw tk-ini"><button type="button" class="go" data-tkc="ini"/.test(h) && /data-tkc="move"/.test(h));
|
|
63
|
+
ok('P1 no group chip: the group is said in the where row', !/class="chip/.test(h) && /<\/svg>Tender committee<\/small>/.test(h), h.slice(h.indexOf('ovw')));
|
|
51
64
|
ok('P1 no Type, Reference or Source rows and no "own dialog" line', !/Reference|Source|own dialog|>Type</.test(h));
|
|
52
65
|
ok('P1 the title is escaped', !C.cardHtml({ ...t, iniTitle: '<img src=x>' }, { now }).includes('<img'));
|
|
53
66
|
const done = C.cardHtml({ ...t, status: 'Done' }, { now });
|
|
54
|
-
ok('P2 a Done task: the late
|
|
67
|
+
ok('P2 a Done task: the late text goes quiet', !/late/.test(done));
|
|
55
68
|
const bare = C.cardHtml({ ...t, start: '', due: '', owner: '', group: '', notes: '' }, { now, groups: [] });
|
|
56
|
-
ok('P2 empty fields are quiet icons with a next action: Add dates, Add an owner,
|
|
57
|
-
ok('P2
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
69
|
+
ok('P2 empty fields are quiet icons with a next action: Add dates, Add an owner, Add notes', /aria-label="Add dates"/.test(bare) && /aria-label="Add an owner"/.test(bare) && /placeholder="Add notes"/.test(bare));
|
|
70
|
+
ok('P2 nothing to move to (no section, no group, no other initiative): no move icon', !/data-tkc="move"/.test(C.cardHtml({ ...t, group: '' }, { now, inis: [{ id: 'tender' }] })));
|
|
71
|
+
const S = [{ key: 'poc', name: 'Technical POC' }, { key: 'award', name: 'Award decision', milestone: true }];
|
|
72
|
+
const w = C.cardHtml({ ...t, group: '', section: 'award', wbs: { id: 'w10', title: '10 Technical committee review' } }, { now, sections: S });
|
|
73
|
+
ok('P9 where it sits: initiative › section (a milestone carries its diamond) › breakdown item', /<b>Tender new CIAM<\/b><small><svg[^>]*><path d="M12 4l8 8-8 8-8-8z"\/><\/svg>Award decision<span class="sep" aria-hidden="true">›<\/span>10 Technical committee review<\/small>/.test(w), w.slice(w.indexOf('ovw')));
|
|
74
|
+
ok('P9 a task in no section says so once the stages are known; with no stages it says nothing', /Not in a stage<\/small>/.test(C.cardHtml({ ...t, group: '' }, { now, sections: S })) && !/Not in a stage/.test(C.cardHtml({ ...t, group: '' }, { now })));
|
|
75
|
+
const mp = C.cardHtml({ ...t, section: 'poc' }, { now, sections: S, groups: ['Tender committee', 'Legal'], inis: [{ id: 'tender' }, { id: 'descope', title: 'Descope' }], open: 'move' });
|
|
76
|
+
ok('P9 the move icon lists the sections first (the current one checked, then Not in a stage), the groups, then the other initiatives', /<p class="h">Section<\/p>[^]*aria-checked="true" data-tkc-section="poc"[^]*data-tkc-section=""[^]*<p class="h">Group<\/p>[^]*data-tkc-group="Legal"[^]*<p class="h">Initiative<\/p>[^]*data-tkc-move="descope"/.test(mp), mp.slice(mp.indexOf('tkc-pop')));
|
|
77
|
+
const P = await C.placeOf({ title: '10.5 TC to review', section: 'award' }, S, [{ uid: 'h', title: '10 Technical committee review' }, { uid: 'x', title: '11 Contract' }]);
|
|
78
|
+
ok('P9 placeOf: the section by its key (item 1\'s sectionOf), the item\'s stage by key or name, the breakdown item from the code in the title', P.section === 'award' && P.wbs && P.wbs.title === '10 Technical committee review'
|
|
79
|
+
&& (await C.placeOf({ title: 'No code here', itemStage: 'poc' }, S, [])).section === 'poc' && (await C.placeOf({ title: 'No code here', itemStage: 'Award decision' }, S, [])).section === 'award' && (await C.placeOf({ title: 'x', section: 'gone' }, S, [])).section === '' && (await C.placeOf({ title: '10 Technical committee review' }, S, [{ title: '10 Technical committee review' }])).wbs === null, JSON.stringify(P));
|
|
80
|
+
ok('P3 the due row: one day, a range in a month, across months, none', C.dueLine({ due: '2026-10-08', start: '2026-10-08' }, now).text === 'Oct 8' && C.dueLine({ start: '2026-10-08', due: '2026-10-10' }, now).text === 'Oct 8 → 10'
|
|
81
|
+
&& C.dueLine({ start: '2026-09-28', due: '2026-10-10' }, now).text === 'Sep 28 → Oct 10' && C.dueLine({}, now).none);
|
|
61
82
|
ok('P3 late text: "1 day late", "Today", nothing when closed', C.dueLine({ due: '2026-10-24', status: 'To do' }, now).lateText === '1 day late' && C.dueLine({ due: '2026-10-25', status: 'To do' }, now).lateText === 'Today' && C.dueLine({ due: '2026-10-01', status: "Won't do" }, now).lateText === '');
|
|
62
83
|
const dp = C.cardHtml({ ...t, due: '2026-10-10' }, { now, open: 'dates' });
|
|
63
|
-
ok('P4 the picker opens under the due button: Start and Due, Today/Tomorrow/Fri/clear, the month, the range marked', /class="anc"><button type="button" class="due-b[^"]*open"[^]*<div class="tkc-pop tkc-dp"/.test(dp) && /<small>Start<\/small><b>8
|
|
64
|
-
&& /<small>Due<\/small><b>10
|
|
84
|
+
ok('P4 the picker opens under the due button: Start and Due, Today/Tomorrow/Fri/clear, the month, the range marked', /class="anc"><button type="button" class="due-b[^"]*open"[^]*<div class="tkc-pop tkc-dp"/.test(dp) && /<small>Start<\/small><b>Oct 8<\/b>/.test(dp)
|
|
85
|
+
&& /<small>Due<\/small><b>Oct 10<\/b>/.test(dp) && />Tomorrow</.test(dp) && /October 2026/.test(dp) && /class="rg"[^>]*>9</.test(dp) && /data-tkc-day="2026-10-10" class="a"/.test(dp), dp.slice(dp.indexOf('tkc-dp'), dp.indexOf('tkc-dp') + 700));
|
|
65
86
|
ok('P5 the check box: half for In progress, a press marks it done; Done marks it not done; a Jira ticket\'s is not a press', C.checkOf(t).state === 'prog' && C.checkOf(t).label === 'Mark done'
|
|
66
87
|
&& C.checkOf({ ...t, status: 'Done' }).label === 'Mark not done' && C.checkOf({ ...t, jira: { key: 'CIAM-214' } }).disabled === true);
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
|
|
88
|
+
const TV = await mod('tk-view.js');
|
|
89
|
+
const read = new Date(now - 4 * 60000).toISOString();
|
|
90
|
+
const tk = TV.ticketOf({ base: { key: 'CIAM-214', title: 'Federation with the legacy IdP', raw: 'In progress', blocked: true, reason: 'Waiting on PLAT-88', assignee: 'Dita S.', sprint: 'MAD Sprint 115', points: 5, url: 'https://jira.example/browse/CIAM-214' },
|
|
91
|
+
model: { ok: true, key: 'CIAM-214', inJira: true, title: 'Federation with the legacy IdP', sections: [{ key: 'story', name: 'User Story', text: 'Users who still sign in with the legacy IdP keep working through the move. '.repeat(6) }, { key: 'acceptance', name: 'Acceptance Criteria', text: '- one\n- two\n- three\n- four' }],
|
|
92
|
+
links: [{ rel: 'depends on', ref: 'CIAM-210', key: 'CIAM-210', title: 'Token lifetimes', open: true }, { rel: 'blocks', ref: 'CIAM-220', key: 'CIAM-220', title: 'Cut-over', open: true }], epic: { key: 'CIAM-200', title: 'Federation' }, subtasks: { done: 1, total: 3 } },
|
|
93
|
+
notes: 'Ask Dita if the legacy IdP can stay up.', ini: 'descope', iniTitle: 'Descope platform build', stage: 'Build', readAt: read });
|
|
94
|
+
const j = TV.tkHtml(tk, { now, blockerTitle: (k) => (k === 'PLAT-88' ? 'Gateway upgrade' : '') });
|
|
95
|
+
ok('P6 a Jira ticket: what blocks it leads ("Blocked by PLAT-88", "Jira · 4 min ago", what it holds)', /czs-line warn[^]*<span>Blocked by PLAT-88<\/span><span class="czs-r">Jira · 4 min ago<\/span>/.test(j) && /PLAT-88 is Gateway upgrade\. It holds Build\./.test(j), j.slice(0, 700));
|
|
96
|
+
ok('P6 the facts in plain text, then "Jira owns these. They change only in Jira."', /<span class="k">Status<\/span><span class="v" data-tkv-f="status">In progress<\/span>/.test(j) && /data-tkv-f="assignee"><span class="av j">DS<\/span>Dita S\./.test(j)
|
|
97
|
+
&& /data-tkv-f="sprint">MAD Sprint 115/.test(j) && /data-tkv-f="points">5/.test(j) && !/data-tkv-f="due"/.test(j) && /<p class="foot">Jira owns these\. They change only in Jira\.<\/p>/.test(j) && !/data-tkc-state|<button[^>]*data-tkc/.test(j));
|
|
98
|
+
ok('P6 the description from Jira, cut at five lines with an icon to open the rest; the notes are the PM\'s, editable', /Description <small>· from Jira<\/small><\/p><div class="ovd cut">/.test(j) && /data-tkv="more" aria-expanded="false" aria-label="Show all of it"/.test(j)
|
|
99
|
+
&& /<textarea class="nt" id="tkvNotes" data-tkv-notes[^>]*>Ask Dita if the legacy IdP can stay up\.<\/textarea>/.test(j) && !/Acceptance Criteria/.test(j.slice(0, j.indexOf('czs-secs'))));
|
|
100
|
+
ok('P6 where it sits: initiative › stage › epic, no move icon; the folds Acceptance criteria 4, Subtasks 1 of 3 done, Linked 2; Open in Jira at the foot', /<b>Descope platform build<\/b><small>Build<span class="sep" aria-hidden="true">›<\/span>Epic Federation<\/small>/.test(j) && !/ovmv/.test(j)
|
|
101
|
+
&& /<b>Acceptance criteria<\/b><span class="czs-n">4<\/span>/.test(j) && /<b>Subtasks<\/b><span class="czs-n">1 of 3 done<\/span>/.test(j) && /<b>Linked<\/b><span class="czs-n">2<\/span>/.test(j) && /class="ovft"><a href="https:\/\/jira\.example\/browse\/CIAM-214"[^>]*>[^]*Open in Jira<\/a>/.test(j));
|
|
102
|
+
const calm = TV.tkHtml({ ...tk, blocked: false, reason: '', description: 'Short.', acceptance: [], subtasks: null, links: [] }, { now });
|
|
103
|
+
ok('P6 not blocked: no summary card (it would repeat the facts); how fresh the read is moves to the facts\' foot; a short text has no open icon; no empty fold', !/czs-sum/.test(calm) && /They change only in Jira\. Read 4 min ago\.<\/p>/.test(calm) && !/data-tkv="more"/.test(calm) && !/czs-secs/.test(calm), calm.slice(0, 600));
|
|
104
|
+
ok('P6 the ticket\'s words are escaped', !TV.tkHtml({ ...tk, title: '<img src=x>', description: '<script>x</script>', notes: '<b>' }, { now }).match(/<script>|<img src=x>|<b><\/textarea>/));
|
|
70
105
|
ok('P6 freshness words', C.freshness(new Date(now - 30e3).toISOString(), now) === 'read just now' && C.freshness(new Date(now - 3 * 36e5).toISOString(), now) === 'read 3 h ago' && C.freshness(new Date(now - 2 * 864e5).toISOString(), now) === 'read 2 days ago' && C.freshness('', now) === '');
|
|
71
106
|
const calls = []; const post = async (p, b) => { calls.push([p, b]); return { ok: true }; };
|
|
72
107
|
const sv = C.boardSaver({ ws: 'w1', board: 'b1', t, post });
|
|
@@ -106,7 +141,7 @@ async function pure() {
|
|
|
106
141
|
await page.route(/\/api\/board-premium(\?.*)?$/, (r) => json(r, { ok: true, state: 'ready', model: BOARD, as_of: Date.now() }));
|
|
107
142
|
await page.route(/\/api\/briefing-premium(\?.*)?$/, (r) => json(r, { ok: true, state: 'ready', model: BRIEF, as_of: Date.now() }));
|
|
108
143
|
await page.route('**/api/briefing-premium/**', (r) => json(r, { ok: true, turns: [], working: false }));
|
|
109
|
-
await page.route(/\/api\/boards\/items(\?.*)?$/, (r) => json(r, { ok: true, items, initiatives: [{ id: 'self-serve-v2', title: 'Self-serve onboarding v2' }, { id: 'other', title: 'Partner portal' }] }));
|
|
144
|
+
await page.route(/\/api\/boards\/items(\?.*)?$/, (r) => json(r, { ok: true, items, initiatives: [{ id: 'self-serve-v2', title: 'Self-serve onboarding v2', stages: [{ key: 'discover', name: 'Discover' }, { key: 'build', name: 'Build', milestone: false }] }, { id: 'other', title: 'Partner portal', stages: [] }] }));
|
|
110
145
|
const layout = { ok: true, auto: true, held: [], by: 'mine', names: ['Launch', 'Legal'], of: { 'task:t1': 'Launch' }, stage: {}, sets: [] };
|
|
111
146
|
await page.route('**/api/initiative-layout*', (r) => {
|
|
112
147
|
if (r.request().method() !== 'POST') return json(r, layout);
|
|
@@ -127,7 +162,7 @@ async function pure() {
|
|
|
127
162
|
const el = document.querySelector(c); if (!el) return null;
|
|
128
163
|
const t = (n) => (n ? n.textContent.replace(/\s+/g, ' ').trim() : '');
|
|
129
164
|
const chk = document.querySelector('#czViewer .cz-vw-chk');
|
|
130
|
-
return { on: t(el.querySelector('.seg .on')), due: t(el.querySelector('.due-b')), late: t(el.querySelector('.
|
|
165
|
+
return { on: t(el.querySelector('.seg .on')), due: t(el.querySelector('.due-b')), late: t(el.querySelector('.ovf .r')), owner: (el.querySelector('.own-b') || { getAttribute: () => '' }).getAttribute('aria-label'), where: t(el.querySelector('.tk-ini small')),
|
|
131
166
|
notes: (el.querySelector('[data-tkc-notes]') || {}).value, ini: t(el.querySelector('.tk-ini .go b')), move: !!el.querySelector('[data-tkc="move"]'), chk: chk ? { cls: chk.className, label: chk.getAttribute('aria-label'), dis: chk.disabled } : null,
|
|
132
167
|
msg: t(el.querySelector('.tkc-msg')), toast: t(document.getElementById('toast')), undo: !!document.querySelector('#toast .undo'), rows: /Reference|Source|own dialog/.test(el.textContent) };
|
|
133
168
|
}, C);
|
|
@@ -138,12 +173,13 @@ async function pure() {
|
|
|
138
173
|
const A = await open(), p = A.page;
|
|
139
174
|
ok('D1 the page is up', A.up);
|
|
140
175
|
await openTask(p, 'task:t1');
|
|
141
|
-
const v = await until(async () => { const x = await view(p); return x && x.
|
|
142
|
-
ok('D1 the task opens as the
|
|
176
|
+
const v = await until(async () => { const x = await view(p); return x && /Launch/.test(x.where) ? x : null; }, 15000);
|
|
177
|
+
ok('D1 the task opens as the one task Viewer: the facts card (To do on, the dates, the owner), notes, and where it sits with its group and the move icon', v && v.on === 'To do' && /Oct 20 → 27/.test(v.due) && v.owner === 'Owner: Dara. Change' && /Not in a stage/.test(v.where) && /Launch/.test(v.where)
|
|
143
178
|
&& v.ini === 'Self-serve onboarding v2' && v.move, JSON.stringify(v));
|
|
144
179
|
ok('D1 the header carries the check box in the tile\'s place', v && v.chk && /s-todo/.test(v.chk.cls) && v.chk.label === 'Mark done', JSON.stringify(v && v.chk));
|
|
145
180
|
ok('D1 no Type, Reference or Source rows', v && !v.rows);
|
|
146
181
|
await shot(p, 'task-rest-1440', '#czViewer');
|
|
182
|
+
await four(p, 'task');
|
|
147
183
|
// status
|
|
148
184
|
await p.click(C + ' [data-tkc-state="In progress"]');
|
|
149
185
|
ok('D2 a status press saves at once (tasks/state) and says so with Undo; the check box turns half', await until(async () => { const x = await view(p); return x.on === 'In progress' && /Now in progress/.test(x.toast) && x.undo && /s-prog/.test(x.chk.cls); })
|
|
@@ -163,7 +199,7 @@ async function pure() {
|
|
|
163
199
|
ok('D4 a tap on the due line opens the picker right under it, on Due', dp && dp.under && dp.due, JSON.stringify(dp));
|
|
164
200
|
await shot(p, 'task-dates-1440', '#czViewer');
|
|
165
201
|
await p.click(C + ' .tkc-dp [data-tkc-day="2026-10-29"]');
|
|
166
|
-
ok('D4 a day saves the due date at once (tasks/edit) with Undo; the picker stays open for the start', await until(async () => /20 → 29
|
|
202
|
+
ok('D4 a day saves the due date at once (tasks/edit) with Undo; the picker stays open for the start', await until(async () => /Oct 20 → 29/.test((await view(p)).due)) && last(A, '/api/boards/tasks/edit').body.due === '2026-10-29'
|
|
167
203
|
&& await p.evaluate((c) => !!document.querySelector(c + ' .tkc-dp'), C));
|
|
168
204
|
await p.click(C + ' .tkc-dp [data-tkc-field="start"]');
|
|
169
205
|
await p.click(C + ' .tkc-dp [data-tkc-day="2026-10-31"]');
|
|
@@ -175,13 +211,21 @@ async function pure() {
|
|
|
175
211
|
await until(() => p.evaluate((c) => !!document.querySelector(c + ' [data-tkc-form="owner"] input'), C));
|
|
176
212
|
await p.fill(C + ' [data-tkc-form="owner"] input', 'Rudi');
|
|
177
213
|
await p.press(C + ' [data-tkc-form="owner"] input', 'Enter');
|
|
178
|
-
ok('D5 a new owner saves at once and the
|
|
214
|
+
ok('D5 a new owner saves at once and the Owner row shows it', await until(async () => (await view(p)).owner === 'Owner: Rudi. Change') && last(A, '/api/boards/tasks/edit').body.owner === 'Rudi');
|
|
179
215
|
await p.click('#toast .undo');
|
|
180
|
-
ok('D5 Undo gives the owner back', await until(async () => (await view(p)).
|
|
216
|
+
ok('D5 Undo gives the owner back', await until(async () => (await view(p)).owner === 'Owner: Dara. Change') && last(A, '/api/boards/tasks/edit').body.owner === 'Dara');
|
|
217
|
+
// the section: the move icon's first list
|
|
218
|
+
await p.click(C + ' [data-tkc="move"]');
|
|
219
|
+
const secs = await until(() => p.evaluate((c) => { const L = [...document.querySelectorAll(c + ' [data-tkc-section]')].map((b) => b.textContent.trim()); return L.length ? L : null; }, C));
|
|
220
|
+
ok('D6 the move icon lists the initiative\'s stages as sections, then Not in a stage', secs && secs.join() === 'Discover,Build,Not in a stage', JSON.stringify(secs));
|
|
221
|
+
await shot(p, 'task-move-1440', '#czViewer');
|
|
222
|
+
await p.click(C + ' [data-tkc-section="build"]');
|
|
223
|
+
ok('D6 a section saves at once (tasks/edit section) and the where row says it; Undo puts it back', await until(async () => { const x = await view(p); return /^Build/.test(x.where) && /In Build/.test(x.toast) && x.undo; }) && last(A, '/api/boards/tasks/edit').body.section === 'build'
|
|
224
|
+
&& (await p.click('#toast .undo'), await until(async () => /Not in a stage/.test((await view(p)).where))) && last(A, '/api/boards/tasks/edit').body.section === '', JSON.stringify(await view(p)));
|
|
181
225
|
// group
|
|
182
|
-
await p.click(C + ' [data-tkc="
|
|
226
|
+
await p.click(C + ' [data-tkc="move"]');
|
|
183
227
|
await p.click(C + ' [data-tkc-group="Legal"]');
|
|
184
|
-
ok('D6 a group from the initiative\'s groups (initiative-layout place)', await until(async () => (await view(p)).
|
|
228
|
+
ok('D6 a group from the initiative\'s groups (initiative-layout place)', await until(async () => /Legal/.test((await view(p)).where)) && last(A, '/api/initiative-layout').body.group === 'Legal' && last(A, '/api/initiative-layout').body.task === 'task:t1');
|
|
185
229
|
// notes
|
|
186
230
|
await p.click(C + ' [data-tkc-notes]');
|
|
187
231
|
await p.keyboard.type('Ask legal before the UAT.');
|
|
@@ -190,7 +234,7 @@ async function pure() {
|
|
|
190
234
|
// move
|
|
191
235
|
await p.click(C + ' [data-tkc="move"]');
|
|
192
236
|
const mv = await until(() => p.evaluate((c) => [...document.querySelectorAll(c + ' [data-tkc-move]')].map((b) => b.textContent.trim()), C));
|
|
193
|
-
ok('D8 the move icon lists the board\'s other initiatives', mv && mv.join() === 'Partner portal', JSON.stringify(mv));
|
|
237
|
+
ok('D8 the move icon also lists the board\'s other initiatives', mv && mv.join() === 'Partner portal', JSON.stringify(mv));
|
|
194
238
|
await p.click(C + ' [data-tkc-move="other"]');
|
|
195
239
|
ok('D8 a move saves at once and the initiative row follows; Undo moves it back', await until(async () => (await view(p)).ini === 'Partner portal') && last(A, '/api/boards/tasks/edit').body.initiative === 'other'
|
|
196
240
|
&& (await p.click('#toast .undo'), await until(async () => (await view(p)).ini === 'Self-serve onboarding v2')) && last(A, '/api/boards/tasks/edit').body.initiative === 'self-serve-v2');
|
|
@@ -198,15 +242,16 @@ async function pure() {
|
|
|
198
242
|
await A.ctx.close();
|
|
199
243
|
}
|
|
200
244
|
|
|
201
|
-
/* D10 a Jira ticket: Jira's
|
|
245
|
+
/* D10 a Jira ticket opens the one ticket Viewer (tk-view.js): Jira's facts plain with how fresh, notes editable */
|
|
202
246
|
{
|
|
203
247
|
const A = await open(), p = A.page;
|
|
204
248
|
await openTask(p, 'task:ONB-12');
|
|
205
|
-
const v = await until(() => p.evaluate((
|
|
206
|
-
return {
|
|
207
|
-
ok('D10 a Jira ticket: the status as plain text, "
|
|
249
|
+
const v = await until(() => p.evaluate(() => { const el = document.querySelector('#czViewer .tkv'); if (!el) return null; const t = (n) => (n ? n.textContent.replace(/\s+/g, ' ').trim() : '');
|
|
250
|
+
return { status: t(el.querySelector('[data-tkv-f="status"]')), foot: t(el.querySelector('.ovf .foot')), seg: !!el.querySelector('[data-tkc-state]'), move: !!el.querySelector('.ovmv'), where: t(el.querySelector('.ovw b')), chk: (document.querySelector('#czViewer .cz-vw-chk') || {}).disabled }; }), 15000);
|
|
251
|
+
ok('D10 a Jira ticket: the status as plain text, "Jira owns these … Read 4 min ago", no status buttons, no move; Jira owns the status, so the header shows the tile, not a check box', v && v.status === 'In progress' && /Jira owns these\. They change only in Jira\. Read 4 min ago\./.test(v.foot) && !v.seg && !v.move && v.where === 'Self-serve onboarding v2' && v.chk === undefined, JSON.stringify(v));
|
|
208
252
|
await shot(p, 'task-jira-1440', '#czViewer');
|
|
209
|
-
await p
|
|
253
|
+
await four(p, 'ticket-item');
|
|
254
|
+
await p.click('#czViewer [data-tkv-notes]');
|
|
210
255
|
await p.keyboard.type('Ask Dita about the cut-over.');
|
|
211
256
|
await p.keyboard.press('Control+Enter');
|
|
212
257
|
ok('D10 its notes are the PM\'s own and save by its key', await until(() => { const x = last(A, '/api/boards/tickets/note'); return x && x.body.ref === 'ONB-12' && x.body.notes === 'Ask Dita about the cut-over.'; }), JSON.stringify(A.posts));
|
|
@@ -222,19 +267,19 @@ async function pure() {
|
|
|
222
267
|
M.openTask({ uid: 't1', src: 'pmos', title: 'UAT with five partners', status: 'To do', owner: 'Dara', ini: 'self-serve-v2', start: '2026-10-20', end: '2026-10-27', board: 'w1' },
|
|
223
268
|
{ VW, pmPost: H.pmPost, toast: () => {}, now: () => Date.now(), ws: 'w1', board: 'w1', iniTitle: () => 'Self-serve onboarding v2', openIni: () => {}, askInChat: () => {}, owners: () => ['Dara', 'Rudi'], inis: () => [] });
|
|
224
269
|
});
|
|
225
|
-
const v = await until(async () => { const x = await view(p); return x && x.
|
|
226
|
-
ok('D11 Home\'s list: the same
|
|
270
|
+
const v = await until(async () => { const x = await view(p); return x && /Launch/.test(x.where) && /Not in a stage/.test(x.where) ? x : null; }, 15000);
|
|
271
|
+
ok('D11 Home\'s list: the same view, with the check box, the group read from the layout and the section from the board', v && v.on === 'To do' && v.chk && /s-todo/.test(v.chk.cls), JSON.stringify(v));
|
|
227
272
|
await p.click(C + ' [data-tkc-state="Won\'t do"]');
|
|
228
273
|
ok('D11 a status press from Home saves through the same route', await until(() => (last(A, '/api/boards/tasks/state') || { body: {} }).body.state === "Won't do"));
|
|
229
274
|
ok('D11 the page raised no error', A.errors.length === 0, A.errors.join(' | '));
|
|
230
275
|
await A.ctx.close();
|
|
231
276
|
}
|
|
232
277
|
|
|
233
|
-
/* D12 the phone, dark: the same
|
|
278
|
+
/* D12 the phone, dark: the same view, full screen */
|
|
234
279
|
{
|
|
235
280
|
const A = await open({ w: 390, h: 844, theme: 'dark' }), p = A.page;
|
|
236
281
|
await openTask(p, 'task:t1');
|
|
237
|
-
const v = await until(async () => { const x = await view(p); return x && x.
|
|
282
|
+
const v = await until(async () => { const x = await view(p); return x && /Launch/.test(x.where) ? x : null; }, 15000);
|
|
238
283
|
const fit = await p.evaluate((c) => { const el = document.querySelector(c); const r = el.getBoundingClientRect(); return { w: r.width, over: document.documentElement.scrollWidth > innerWidth + 1, segW: el.querySelector('.seg').getBoundingClientRect().right <= innerWidth }; }, C);
|
|
239
284
|
ok('D12 the phone: the card fills the sheet with no sideways scroll, and the status buttons fit', v && fit.w > 300 && !fit.over && fit.segW, JSON.stringify(fit));
|
|
240
285
|
await p.click(C + ' [data-tkc="dates"]');
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"goal-chat.test.js",
|
|
41
41
|
"phone-day.test.js",
|
|
42
42
|
"home-sessions.test.js",
|
|
43
|
+
"live-pill.test.js",
|
|
43
44
|
"chat-ask.test.js",
|
|
44
45
|
"chat-md.test.js",
|
|
45
46
|
"md-table.test.js",
|
|
@@ -227,7 +228,8 @@
|
|
|
227
228
|
"glossary.test.js": 1,
|
|
228
229
|
"needs-overdue.test.js": 1,
|
|
229
230
|
"briefing-scope.test.js": 1,
|
|
230
|
-
"settings-store.test.js": 1
|
|
231
|
+
"settings-store.test.js": 1,
|
|
232
|
+
"live-pill.test.js": 1
|
|
231
233
|
},
|
|
232
234
|
"_comment_seconds": "Measured wall time of each suite run alone (4-CPU sandbox, 2026-10-05). Only the ORDER uses it: the slowest suites start first, and --shard deals suites to the least-loaded shard so the shards finish together. A wrong or missing number never skips a suite; a missing one counts as 10."
|
|
233
235
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"_comment": "feedback batch
|
|
3
|
-
"modules": ["
|
|
4
|
-
"seconds": { "
|
|
2
|
+
"_comment": "feedback batch 6 items 1 and 3 (OvIniA): ONE initiative view on the Board, Home and the phone. The node suite is pure (ini-view-model.js); the browser half is in briefing-premium-board-test.js (the Board's panel) and stage-card-test.js (Home's page).",
|
|
3
|
+
"modules": ["ini-view-model.test.js"],
|
|
4
|
+
"seconds": { "ini-view-model.test.js": 1 }
|
|
5
5
|
}
|
|
@@ -82,12 +82,12 @@ const BRIEF = BRP.build(BRF.facts());
|
|
|
82
82
|
await page.route(/\/api\/boards\/items(\?.*)?$/, (r) => json(r, { ok: true, ws: 'w1', board: 'w1', jiraProjects: ['IDPF'], items: [], initiatives: [] }));
|
|
83
83
|
await page.route(/\/api\/jira\/(push|epic|edit|draft)$/, (r) => json(r, { ok: true, session: 's1', tickets: 7 }));
|
|
84
84
|
await page.goto(BASE + '/premium.html?ini=' + I + '&ws=w1&board=w1&theme=' + theme);
|
|
85
|
-
const up = await until(() => page.evaluate(() => !!document.querySelector('
|
|
85
|
+
const up = await until(() => page.evaluate(() => !!document.querySelector('#czViewer .iv-sc')), 30000);
|
|
86
86
|
return { ctx, page, errors, posts, up, set: (v) => { cur = v; } };
|
|
87
87
|
};
|
|
88
88
|
const V = '#czViewer:not([hidden])';
|
|
89
89
|
const tasks = async (p) => {
|
|
90
|
-
await (async (g) => { const P = '#czViewer:not([hidden]) [data-hi-v="page"]', r = '#hmList [data-hm-sel^="i:"][aria-current="true"]'; for (let i = 0; i < 4 && !(await g.$(P)) && (await g.$('#czViewer:not([hidden]) [data-cz-vw="back"]')); i++) { await g.click('#czViewer [data-cz-vw="back"]'); await g.waitForTimeout(150); } if (await g.$(P)) return; if (await g.$(r)) await g.click(r); else await g.reload(); await g.waitForSelector(P + ' .
|
|
90
|
+
await (async (g) => { const P = '#czViewer:not([hidden]) [data-hi-v="page"]', r = '#hmList [data-hm-sel^="i:"][aria-current="true"]'; for (let i = 0; i < 4 && !(await g.$(P)) && (await g.$('#czViewer:not([hidden]) [data-cz-vw="back"]')); i++) { await g.click('#czViewer [data-cz-vw="back"]'); await g.waitForTimeout(150); } if (await g.$(P)) return; if (await g.$(r)) await g.click(r); else await g.reload(); await g.waitForSelector(P + ' .iv', { timeout: 30000 }); })(p); /* ← back to the initiative's page, else its row, else the address again (an initiative the list does not show) */ await p.click('#czViewer [data-cz-vw="more"]').then(() => p.click('.cz-vw-menu [role="menuitem"]:has(> span:first-child:text-is("All tasks"))')); /* the initiative's page (canvas HbC): its + drills into Tasks */
|
|
91
91
|
return until(() => p.evaluate((v) => !!document.querySelector(v + ' .tk-g .tk-row'), V), 30000);
|
|
92
92
|
};
|
|
93
93
|
const shot = async (p, name) => { if (!SHOTS) return; fs.mkdirSync(SHOTS, { recursive: true }); await sleep(250); await p.screenshot({ path: path.join(SHOTS, name) }); };
|
|
@@ -190,7 +190,7 @@ const BRIEF = BRP.build(BRF.facts());
|
|
|
190
190
|
/* the PM chose another grouping: it stays */
|
|
191
191
|
{
|
|
192
192
|
const E = await open({ layout: { by: 'mine', picked: true, names: ['Design'] } }), e = E.page;
|
|
193
|
-
await (async (g) => { const P = '#czViewer:not([hidden]) [data-hi-v="page"]', r = '#hmList [data-hm-sel^="i:"][aria-current="true"]'; for (let i = 0; i < 4 && !(await g.$(P)) && (await g.$('#czViewer:not([hidden]) [data-cz-vw="back"]')); i++) { await g.click('#czViewer [data-cz-vw="back"]'); await g.waitForTimeout(150); } if (await g.$(P)) return; if (await g.$(r)) await g.click(r); else await g.reload(); await g.waitForSelector(P + ' .
|
|
193
|
+
await (async (g) => { const P = '#czViewer:not([hidden]) [data-hi-v="page"]', r = '#hmList [data-hm-sel^="i:"][aria-current="true"]'; for (let i = 0; i < 4 && !(await g.$(P)) && (await g.$('#czViewer:not([hidden]) [data-cz-vw="back"]')); i++) { await g.click('#czViewer [data-cz-vw="back"]'); await g.waitForTimeout(150); } if (await g.$(P)) return; if (await g.$(r)) await g.click(r); else await g.reload(); await g.waitForSelector(P + ' .iv', { timeout: 30000 }); })(e); /* ← back to the initiative's page, else its row, else the address again (an initiative the list does not show) */ await e.click('#czViewer [data-cz-vw="more"]').then(() => e.click('.cz-vw-menu [role="menuitem"]:has(> span:first-child:text-is("All tasks"))')); /* the initiative's page (canvas HbC): its + drills into Tasks */
|
|
194
194
|
ok('T1 a grouping the PM chose wins over the Epic default', await until(() => e.evaluate((v) => !!document.querySelector(v + ' .hi-tg') && !document.querySelector(v + ' .tk-row'), V)));
|
|
195
195
|
await E.ctx.close();
|
|
196
196
|
}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
/* pm/bd-ini-model.js — the Board's initiative panel, read as XipB (feedback batch 4 item 1, agreed 2026-10-25): what the panel says, as data.
|
|
2
|
-
* Pure: no DOM, no reads. pm/bd-ini-panel.js draws it; bd-ini-model.test.js checks it.
|
|
3
|
-
*
|
|
4
|
-
* dateY(iso, now) "Aug 11" this year, "Feb 3, 2027" in any other: a date never reads as this year's when it is not
|
|
5
|
-
* ladderOf(r, pfSteps) the stages of the initiative's OWN workflow (r.wfStages, D99), the current one, the skipped ones and the next one;
|
|
6
|
-
* Product feature is the board's eight steps (pfSteps)
|
|
7
|
-
* whyOf(r, pfSteps, now) the one sentence under the status: the plan end passed, or Jira's pace runs past it, then the first blocked ticket
|
|
8
|
-
* planModel(r, now) the Plan card's line: your plan, past the plan, Jira's pace, today, as percents of the span; null with no date
|
|
9
|
-
* blockedLine(track) "SLV-144 is blocked by PLAT-88." */
|
|
10
|
-
const plural = (n, a, b) => (n === 1 ? a : b);
|
|
11
|
-
const dayWord = (n) => n + ' ' + plural(n, 'day', 'days');
|
|
12
|
-
const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
13
|
-
const dayOf = (iso) => { const m = /^(\d{4})-(\d{2})-(\d{2})/.exec(String(iso || '')); return m ? new Date(+m[1], +m[2] - 1, +m[3]) : null; };
|
|
14
|
-
const todayOf = (now) => { const d = new Date(now == null ? Date.now() : now); return new Date(d.getFullYear(), d.getMonth(), d.getDate()); };
|
|
15
|
-
const between = (a, b) => Math.round((b - a) / 864e5);
|
|
16
|
-
/** "Aug 11" this year, "Feb 3, 2027" in any other year: a date never reads as this year's when it is not. */
|
|
17
|
-
export function dateY(iso, now) {
|
|
18
|
-
const d = dayOf(iso); if (!d) return '';
|
|
19
|
-
return MON[d.getMonth()] + ' ' + d.getDate() + (d.getFullYear() !== todayOf(now).getFullYear() ? ', ' + d.getFullYear() : '');
|
|
20
|
-
}
|
|
21
|
-
const PF_ID = 'product-feature';
|
|
22
|
-
/** The initiative's own workflow, when it is not Product feature and the row carries its stages (D99). */
|
|
23
|
-
export const ownWf = (r) => !!(r && r.wf && r.wf.id && r.wf.id !== PF_ID && Array.isArray(r.wfStages) && r.wfStages.length && r.wfStage);
|
|
24
|
-
/** The ladder of the initiative's own workflow: { steps [{ key, label, ms }], k (the current one), skipped [indexes], next (the stage after,
|
|
25
|
-
* skipped ones left out), name (the current stage's name), wf }. Product feature is the board's eight steps. */
|
|
26
|
-
export function ladderOf(r, pfSteps) {
|
|
27
|
-
const t = r.track || {};
|
|
28
|
-
if (ownWf(r)) {
|
|
29
|
-
const S = r.wfStages, k = S.findIndex((s) => s.key === r.wfStage.key);
|
|
30
|
-
const skipped = S.map((s, j) => (s.status === 'skipped' && j !== k ? j : -1)).filter((j) => j >= 0);
|
|
31
|
-
const next = k >= 0 ? S.slice(k + 1).find((s) => s.status !== 'skipped') || null : null;
|
|
32
|
-
return { own: true, steps: S.map((s) => ({ key: s.key, label: s.name, ms: !!s.milestone })), k, skipped, name: r.wfStage.name || (k >= 0 ? S[k].name : ''), stage: k >= 0 ? S[k] : r.wfStage,
|
|
33
|
-
next: next ? { key: next.key, label: next.name, ms: !!next.milestone } : null, wf: r.wf };
|
|
34
|
-
}
|
|
35
|
-
const S = (pfSteps || []).map((s) => ({ key: s.key, label: s.label, ms: !!s.ms })), k = t.k == null ? -1 : t.k, sk = new Set(t.skipped || []);
|
|
36
|
-
const next = k >= 0 ? S.slice(k + 1).find((s, j) => !sk.has(k + 1 + j)) || null : null;
|
|
37
|
-
return { own: false, steps: S, k, skipped: [...sk], name: k >= 0 && S[k] ? S[k].label : (t.label || r.stage || ''), stage: null, next, wf: r.wf || { id: PF_ID, name: 'Product feature', icon: 'feature' } };
|
|
38
|
-
}
|
|
39
|
-
/** The first open ticket Jira flags as blocked, said in words: "SLV-144 is blocked by PLAT-88." */
|
|
40
|
-
export function blockedLine(t) {
|
|
41
|
-
const k = (t.tickets || []).find((x) => x.blocked && x.status !== 'Done'); if (!k) return '';
|
|
42
|
-
const on = /\b([A-Z][A-Z0-9]+-\d+)\b/.exec(k.reason || '');
|
|
43
|
-
return k.key + ' is blocked' + (on && on[1] !== k.key ? ' by ' + on[1] : '') + '.';
|
|
44
|
-
}
|
|
45
|
-
/** The one sentence that says why the status is what it is, from the record: the plan end passed, or Jira's pace runs past it. '' when
|
|
46
|
-
* neither holds (the status says enough). now: ms, for the tests. */
|
|
47
|
-
export function whyOf(r, pfSteps, now) {
|
|
48
|
-
const t = r.track || {}, today = todayOf(now), end = dayOf(r.end), fc = dayOf(t.forecast), L = ladderOf(r, pfSteps);
|
|
49
|
-
const done = r.status === 'done' || r.status === 'cancelled';
|
|
50
|
-
const said = [];
|
|
51
|
-
if (end && end < today && !done) said.push('The plan ended ' + dateY(r.end, now) + ', ' + dayWord(between(end, today)) + ' ago, and ' + r.title + ' is in ' + (L.name || 'a stage not on record') + '.');
|
|
52
|
-
else if (end && fc && fc > end && !done) said.push('Jira’s pace ends it ' + dateY(t.forecast, now) + ', ' + dayWord(between(end, fc)) + ' after your plan.');
|
|
53
|
-
const bl = blockedLine(t); if (bl) said.push(bl);
|
|
54
|
-
return said.join(' ');
|
|
55
|
-
}
|
|
56
|
-
/** The plan line's model (XipB): the grey bar is your plan (start → planned end), amber dashed is past the plan to today, blue dashed is
|
|
57
|
-
* Jira's expected end beyond the plan, a tick for today. Positions are percents of the span drawn. null when no record holds a date for it
|
|
58
|
-
* (zero is silence). now: ms, for the tests. */
|
|
59
|
-
export function planModel(r, now) {
|
|
60
|
-
const t = r.track || {}, today = todayOf(now), st = dayOf(r.start), end = dayOf(r.end), fc = dayOf(t.forecast);
|
|
61
|
-
if (!end && !fc) return null;
|
|
62
|
-
const done = r.status === 'done' || r.status === 'cancelled';
|
|
63
|
-
const over = !!(end && end < today && !done), exp = !!(fc && (!end || fc > end) && !done);
|
|
64
|
-
const pts = [st, end, today, exp ? fc : null].filter(Boolean), lo = Math.min(...pts), hi = Math.max(...pts), span = hi - lo || 1;
|
|
65
|
-
const at = (d) => Math.round(((d - lo) / span) * 1000) / 10;
|
|
66
|
-
const m = { over, exp, today: at(today), marks: [], legend: [] };
|
|
67
|
-
if (end) m.bar = { from: at(st || (exp && !over ? today : end)), to: at(end) };
|
|
68
|
-
if (over) m.overBar = { from: at(end), to: at(today), days: between(end, today) };
|
|
69
|
-
if (exp) m.expBar = { from: at(end && end > today ? end : today), to: at(fc), days: end ? between(end, fc) : null };
|
|
70
|
-
if (st) m.marks.push({ at: at(st), label: dateY(r.start, now), kind: 'start' });
|
|
71
|
-
if (end) m.marks.push({ at: at(end), label: dateY(r.end, now), word: 'plan end', kind: 'end' });
|
|
72
|
-
// Today and Jira's date both label the top: when they would touch, Today keeps its tick and the legend names it instead
|
|
73
|
-
const crowd = exp && Math.abs(at(fc) - at(today)) < 24;
|
|
74
|
-
m.marks.push({ at: at(today), label: 'Today', kind: 'today', warn: over, ...(crowd ? { hide: true } : {}) });
|
|
75
|
-
if (exp) m.marks.push({ at: at(fc), label: dateY(t.forecast, now), word: 'Jira', kind: 'jira' });
|
|
76
|
-
if (end) m.legend.push({ kind: 'plan', text: 'Your plan' });
|
|
77
|
-
if (over) m.legend.push({ kind: 'over', text: 'Past the plan · ' + dayWord(m.overBar.days) });
|
|
78
|
-
if (exp) m.legend.push({ kind: 'exp', text: 'Jira’s pace' + (m.expBar.days != null ? ' · ' + dayWord(m.expBar.days) + ' more' : '') });
|
|
79
|
-
if (!over || crowd) m.legend.push({ kind: over ? 'today am' : 'today', text: 'Today' });
|
|
80
|
-
return m;
|
|
81
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/* pm/cozy-rec-pill.css — the live-recording pill beside the floating menu (canvas XvARecBoard), drawn by pm/cozy-rec-pill.js inside #czNav, so it
|
|
2
|
-
* follows the menu button and hides with it. Token vars from cozy.css only. No motion: the clock is the only thing that changes. */
|
|
3
|
-
.cz-rec { position: absolute; left: 68px; bottom: 8px; height: 40px; padding: 0 14px 0 12px; border-radius: 999px; background: var(--cz-card); box-shadow: var(--cz-float), 0 0 0 1.5px color-mix(in srgb, var(--cz-dot-red) 35%, var(--cz-card)); display: inline-flex; align-items: center; gap: 8px; font: 700 13px var(--cz-sans); color: var(--cz-ink); text-decoration: none; white-space: nowrap; max-width: min(320px, calc(100vw - 120px)); z-index: 1; }
|
|
4
|
-
.cz-rec[hidden] { display: none; }
|
|
5
|
-
.cz-rec .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--cz-dot-red); flex: none; }
|
|
6
|
-
.cz-rec .tt { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
|
|
7
|
-
.cz-rec .tm { color: var(--cz-red); font-variant-numeric: tabular-nums; flex: none; }
|
|
8
|
-
.cz-rec.paused .dot { background: var(--cz-dot-q); }
|
|
9
|
-
.cz-rec.paused .tm { color: var(--cz-ink3); }
|
|
10
|
-
.cz-rec:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; }
|
|
11
|
-
/* a phone: the menu button is bottom right, so the pill sits to its left */
|
|
12
|
-
@media (max-width: 760px) { .cz-rec { left: auto; right: 68px; } }
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/* pm/cozy-rec-pill.js — the live-recording pill beside the floating menu on the Board and Insights (initiative viewer-shell-a, V9; canvas
|
|
2
|
-
* XvARecBoard). While a meeting records, a quiet pill sits next to the menu button: a red dot, the meeting's title and its clock. A press
|
|
3
|
-
* goes back to the recording (Home with the meeting open). With no recording there is no pill (zero is silence). The state comes from
|
|
4
|
-
* pm/rec-state.js, which reads the notes the server keeps, so a recording started on another page shows here too. Nothing is written.
|
|
5
|
-
*
|
|
6
|
-
* mountRecPill(doc = document) once per page, after mountNav: the pill lives inside #czNav, so it hides whenever the menu hides */
|
|
7
|
-
import { onRecording } from './rec-state.js';
|
|
8
|
-
|
|
9
|
-
const esc = (v) => String(v == null ? '' : v).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c]);
|
|
10
|
-
|
|
11
|
-
const CSS = '/pm/cozy-rec-pill.css';
|
|
12
|
-
/** The meeting clock: m:ss under an hour, then h:mm:ss. */
|
|
13
|
-
export function clock(ms) {
|
|
14
|
-
const s = Math.max(0, Math.floor((Number(ms) || 0) / 1000)), h = Math.floor(s / 3600), m = Math.floor((s % 3600) / 60), r = String(s % 60).padStart(2, '0');
|
|
15
|
-
return h ? h + ':' + String(m).padStart(2, '0') + ':' + r : m + ':' + r;
|
|
16
|
-
}
|
|
17
|
-
/** The time heard so far for a State, now. */
|
|
18
|
-
export const elapsed = (st, now = Date.now()) => (st && st.on ? (Number(st.elapsedMs) || 0) + (st.paused ? 0 : Math.max(0, now - (Number(st.readAt) || now))) : 0);
|
|
19
|
-
|
|
20
|
-
export function mountRecPill(doc = document) {
|
|
21
|
-
if (!doc.querySelector(`link[href="${CSS}"]`)) { const l = doc.createElement('link'); l.rel = 'stylesheet'; l.href = CSS; doc.head.appendChild(l); }
|
|
22
|
-
let st = null, tick = null, tries = 0;
|
|
23
|
-
const place = () => {
|
|
24
|
-
const nav = doc.getElementById('czNav');
|
|
25
|
-
if (!nav) { if (tries++ < 50) setTimeout(place, 100); return null; }
|
|
26
|
-
let a = doc.getElementById('czRec');
|
|
27
|
-
if (!a) { a = doc.createElement('a'); a.id = 'czRec'; a.className = 'cz-rec'; a.hidden = true; nav.appendChild(a); }
|
|
28
|
-
return a;
|
|
29
|
-
};
|
|
30
|
-
const draw = () => {
|
|
31
|
-
const a = doc.getElementById('czRec') || place(); if (!a) return;
|
|
32
|
-
if (!st || !st.on || st.here) { a.hidden = true; a.removeAttribute('href'); return; }
|
|
33
|
-
const t = clock(elapsed(st));
|
|
34
|
-
a.href = st.href || '/premium.html';
|
|
35
|
-
a.classList.toggle('paused', !!st.paused);
|
|
36
|
-
a.setAttribute('aria-label', 'Back to the recording: ' + st.title + ', ' + (st.paused ? 'paused at ' : '') + t);
|
|
37
|
-
a.innerHTML = `<i class="dot" aria-hidden="true"></i><span class="tt">${esc(st.title)}</span> <span class="tm">${esc(t)}</span>`;
|
|
38
|
-
a.hidden = false;
|
|
39
|
-
};
|
|
40
|
-
place();
|
|
41
|
-
onRecording((s) => {
|
|
42
|
-
st = s; draw();
|
|
43
|
-
if (tick) { clearInterval(tick); tick = null; }
|
|
44
|
-
if (s && s.on && !s.paused) tick = setInterval(draw, 1000);
|
|
45
|
-
});
|
|
46
|
-
}
|