create-pmos 0.422.0 → 0.423.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +13 -13
- package/payload/KIT-VERSION +1 -1
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/state/discoveries.md +1 -1
- package/workspace/board-programs-test.js +28 -0
- package/workspace/briefing-premium-adddoc-test.js +1 -1
- package/workspace/briefing-premium-board-test.js +12 -10
- package/workspace/briefing-premium-initiative-test.js +30 -38
- package/workspace/changelog.json +12 -0
- package/workspace/guide/briefing-premium.md +1 -1
- package/workspace/guide/home.md +9 -2
- package/workspace/guide/programs.md +1 -0
- package/workspace/guide/workflows.md +5 -1
- package/workspace/ini-workflow-test.js +4 -4
- package/workspace/lib/board-premium.js +3 -2
- package/workspace/lib/custom-docs.js +65 -3
- package/workspace/lib/engine/boards.js +25 -2
- package/workspace/lib/initiative-writer.js +63 -1
- package/workspace/lib/plan-items.js +36 -5
- package/workspace/lib/programs.js +11 -3
- package/workspace/lib/route-modules.js +1 -0
- package/workspace/lib/routes-board-premium.js +22 -0
- package/workspace/lib/routes-boards.js +50 -10
- package/workspace/lib/routes-initiatives.js +12 -0
- package/workspace/lib/routes-task-links.js +329 -0
- package/workspace/lib/split-merge-suggest.js +162 -0
- package/workspace/lib/split-merge.js +379 -0
- package/workspace/lib/task-cli.js +58 -5
- package/workspace/lib/task-items.js +14 -2
- package/workspace/lib/task-links.js +422 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-board-actions-test.js +2 -2
- package/workspace/premium-core-doc-issue-test.js +2 -2
- package/workspace/premium-vw-backlog-test.js +3 -3
- package/workspace/premium-vw-item-test.js +3 -3
- package/workspace/premium-vw-jira-test.js +6 -6
- package/workspace/product-lane-test.js +165 -0
- package/workspace/program-panel-test.js +1 -1
- package/workspace/public/pm/bd-ini-panel.js +16 -6
- package/workspace/public/pm/bd-prog.js +6 -1
- package/workspace/public/pm/bd-span.js +69 -15
- package/workspace/public/pm/bd-views.js +3 -2
- package/workspace/public/pm/cozy-board.css +10 -0
- package/workspace/public/pm/home-app.js +25 -8
- package/workspace/public/pm/home-ini-model.js +0 -34
- package/workspace/public/pm/home-ini.js +72 -204
- package/workspace/public/pm/ini-groups.js +228 -0
- package/workspace/public/pm/ini-links.js +561 -0
- package/workspace/public/pm/ini-tasks.js +58 -22
- package/workspace/public/pm/ini-versions.js +14 -9
- package/workspace/public/pm/ini-view-model.js +88 -4
- package/workspace/public/pm/ini-view.css +259 -18
- package/workspace/public/pm/ini-view.js +140 -32
- package/workspace/public/pm/premium-board.js +54 -6
- package/workspace/public/pm/split-merge.css +77 -0
- package/workspace/public/pm/split-merge.js +265 -0
- package/workspace/public/pm/stage-line.js +414 -0
- package/workspace/public/pm/task-card.js +5 -3
- package/workspace/public/pm/wf-page.css +2 -0
- package/workspace/public/pm/wf-page.js +2 -0
- package/workspace/public/pm/wf-stage.js +2 -1
- package/workspace/server.js +15 -1
- package/workspace/split-merge-ui-test.js +175 -0
- package/workspace/stage-card-test.js +12 -11
- package/workspace/task-card-test.js +3 -2
- package/workspace/task-delete-test.js +126 -0
- package/workspace/task-links-test.js +227 -0
- package/workspace/task-milestones-test.js +1 -1
- package/workspace/task-plans-test.js +6 -0
- package/workspace/task-views-test.js +1 -1
- package/workspace/test-lists/bd-ini-panel.json +8 -2
- package/workspace/test-lists/product-lane.json +6 -0
- package/workspace/test-lists/split-merge.json +15 -0
- package/workspace/test-lists/task-delete.json +5 -0
- package/workspace/test-lists/task-links.json +6 -0
- package/workspace/tk-tasks-test.js +173 -57
- package/workspace/workflows-setup-test.js +4 -3
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
/* product-lane-test.js — milestones on the product lane (feedback batch 11 item 17; canvas In development, row "Milestones on the product lane":
|
|
4
|
+
* PlmA1Board, PlmA2Folded, PlmA3Phone, sticky plmRules). Serves the real page from the real server; GET /api/board-premium answers All products,
|
|
5
|
+
* two products built by lib/board-premium.js from rows and work items that carry the ◇ flag. The page's clock is the fixture's (17 Oct 2026).
|
|
6
|
+
* L the lane: the product's head row carries every milestone of its initiatives (the ◇ tasks and each row's end ◇), the same ◇ (filled done,
|
|
7
|
+
* orange late), close ones merged into a counted ◇ with the range under it, a thin line from the first start to the last end
|
|
8
|
+
* H hover on a single ◇ names the milestone and its initiative
|
|
9
|
+
* P pressing a counted ◇ lists its milestones with their initiatives; a line opens that initiative
|
|
10
|
+
* F folded, the lane is the same; the head shows the count
|
|
11
|
+
* S Quarter puts a date under each ◇, 5 yr none
|
|
12
|
+
* Q the phone: ◇ only, no dates; a tap on the lane opens a sheet with the product's milestones in date order
|
|
13
|
+
* SHOTS_17=<dir>: the Board, the counted ◇'s list, folded and the phone sheet, into <dir>. */
|
|
14
|
+
const path = require('path');
|
|
15
|
+
const { spawn } = require('child_process');
|
|
16
|
+
const { findBrowser } = require('./lib/find-browser');
|
|
17
|
+
const T = require('./test-run').configure({ name: 'product-lane' });
|
|
18
|
+
const BP = require('./lib/board-premium.js');
|
|
19
|
+
const F = require('./fixtures/board-premium-facts.js');
|
|
20
|
+
|
|
21
|
+
const BASE = T.BASE;
|
|
22
|
+
const results = [];
|
|
23
|
+
const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + extra : ''}`); };
|
|
24
|
+
let srv = null; let browser = null;
|
|
25
|
+
const finish = async (code) => {
|
|
26
|
+
if (browser) await browser.close().catch(() => {});
|
|
27
|
+
if (srv) { try { srv.kill('SIGKILL'); } catch { /* gone */ } }
|
|
28
|
+
T.killTmux();
|
|
29
|
+
const bad = results.filter((x) => !x.cond).length;
|
|
30
|
+
console.log(`\n${results.length - bad}/${results.length} product-lane assertions passed`);
|
|
31
|
+
process.exit(code !== undefined ? code : (bad ? 1 : 0));
|
|
32
|
+
};
|
|
33
|
+
process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
34
|
+
|
|
35
|
+
const ROWS = [
|
|
36
|
+
F.row('scarlet', 'Scarlet — ST What’s The News', { owner: 'Wawan', stage: 'Build', start: '2026-11-02', end: '2027-03-31', progress: 30 }),
|
|
37
|
+
F.row('passkey', 'Passkey sign-in', { owner: 'Lee', start: '2026-09-15', end: '2027-02-26', progress: 45 }),
|
|
38
|
+
F.row('recovery', 'Recovery codes', { owner: 'Dara', start: '2026-12-01', end: '2027-04-30', progress: 10 }),
|
|
39
|
+
F.row('email-otp', 'Email OTP', { start: '2026-11-10', end: '2027-06-30', progress: 5 }),
|
|
40
|
+
];
|
|
41
|
+
const PRODUCT = { scarlet: 'pmos-scarlet', passkey: 'pmos-scarlet', recovery: 'pmos-idpf', 'email-otp': 'pmos-idpf' };
|
|
42
|
+
const it = (ini, uid, title, o) => ({ uid, key: '', kind: 'Task', src: 'pmos', title, status: 'To do', owner: 'Wawan', ini, start: null, end: null, ref: uid, board: 'w1', milestone: true, ...o });
|
|
43
|
+
const ITEMS = [
|
|
44
|
+
it('scarlet', 'task-pilot', 'Pilot with 2 newsrooms', { status: 'Done', start: '2026-11-02', end: '2026-12-11', section: 'build' }),
|
|
45
|
+
it('scarlet', 'task-feat', 'Feature delivered', { start: '2027-01-18', end: '2027-01-29', section: 'deliver' }),
|
|
46
|
+
it('scarlet', 'task-kpi', 'KPI evaluated', { start: '2027-03-22', end: '2027-03-31', section: 'evaluate' }),
|
|
47
|
+
it('passkey', 'task-late', 'Design review', { start: '2026-10-01', end: '2026-10-16' }),
|
|
48
|
+
it('passkey', 'task-pk2', 'Security sign-off', { end: '2026-12-18' }),
|
|
49
|
+
it('recovery', 'task-c1', 'Codes live', { end: '2027-03-02' }),
|
|
50
|
+
it('recovery', 'task-c2', 'Support FAQ live', { end: '2027-03-06' }),
|
|
51
|
+
];
|
|
52
|
+
/** All products: the two products' rows on one board (pm/bd-prog.js groupsOf draws a head per product). */
|
|
53
|
+
function model() {
|
|
54
|
+
const rows = ROWS.map((r) => ({ ...r }));
|
|
55
|
+
const m = BP.build(F.facts({ rows, total: rows.length, columns: [], items: ITEMS.map((x) => ({ ...x })) }));
|
|
56
|
+
m.board.all = true;
|
|
57
|
+
const put = (r) => { const k = String(r.id || r.key || '').replace(/^board:/, ''); if (PRODUCT[k]) r.product = PRODUCT[k]; };
|
|
58
|
+
(m.rows || []).forEach(put); ((m.initiatives && m.initiatives.list && m.initiatives.list.rows) || []).forEach(put);
|
|
59
|
+
return m;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
(async () => {
|
|
63
|
+
const exe = findBrowser();
|
|
64
|
+
if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the suite cannot run'); return finish(1); }
|
|
65
|
+
let chromium;
|
|
66
|
+
try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
|
|
67
|
+
srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
|
|
68
|
+
await T.waitForServer(BASE);
|
|
69
|
+
browser = await chromium.launch({ executablePath: exe });
|
|
70
|
+
|
|
71
|
+
/** The Board on the timeline, All products. o: { w, h, span, phone, fold } */
|
|
72
|
+
const open = async (o = {}) => {
|
|
73
|
+
const ctx = await browser.newContext({ viewport: { width: o.w || 1440, height: o.h || 900 }, hasTouch: !!o.phone, isMobile: !!o.phone });
|
|
74
|
+
const page = await ctx.newPage();
|
|
75
|
+
const errors = [];
|
|
76
|
+
page.on('pageerror', (e) => errors.push(String((e && e.stack) || e)));
|
|
77
|
+
await page.clock.setFixedTime(new Date(F.NOW));
|
|
78
|
+
const M = model();
|
|
79
|
+
await page.route('**/api/board-premium*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model: M, as_of: Date.now() }) }));
|
|
80
|
+
await page.route('**/api/programs', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, programs: [] }) }));
|
|
81
|
+
await page.route('**/api/board-trail*', (r) => r.fulfill({ status: 500, contentType: 'application/json', body: JSON.stringify({ ok: false, error: 'not in this check' }) }));
|
|
82
|
+
await page.addInitScript(([s]) => { try { if (!sessionStorage.getItem('set')) { sessionStorage.setItem('set', '1'); for (const [k, v] of Object.entries(s)) localStorage.setItem(k, v); } } catch { /* none */ } },
|
|
83
|
+
[{ 'pmos.board.view': 'time', 'pmos.board.pview': 'time', 'pmos.board.span': o.span || 'year', 'pmos.board.fold': JSON.stringify(o.fold || []) }]);
|
|
84
|
+
await page.goto(BASE + '/premium-board.html?ws=w1&board=w1');
|
|
85
|
+
await page.waitForSelector('#ibBody .tg-lane', { timeout: 15000 });
|
|
86
|
+
await page.waitForTimeout(400);
|
|
87
|
+
return { ctx, page, errors };
|
|
88
|
+
};
|
|
89
|
+
const shots = process.env.SHOTS_17;
|
|
90
|
+
const shot = async (p, name) => { if (shots) await p.screenshot({ path: path.join(shots, name + '.png') }); };
|
|
91
|
+
const laneOf = (p, key) => p.evaluate((k) => {
|
|
92
|
+
const r = document.querySelector(`#ibBody .tg-lane[data-lane="${k}"]`); if (!r) return null;
|
|
93
|
+
return {
|
|
94
|
+
name: (r.querySelector('.bd-prdb') || {}).textContent || '',
|
|
95
|
+
n: (r.querySelector('.bd-prdb .n') || {}).textContent || '',
|
|
96
|
+
span: r.querySelectorAll('.tg-span').length,
|
|
97
|
+
tm: [...r.querySelectorAll('.tg-tm')].map((x) => x.className + '|' + x.getAttribute('title')),
|
|
98
|
+
tmc: [...r.querySelectorAll('.tg-tmc')].map((x) => x.className + '|' + x.textContent),
|
|
99
|
+
tml: [...r.querySelectorAll('.tg-tml')].map((x) => x.textContent),
|
|
100
|
+
};
|
|
101
|
+
}, key);
|
|
102
|
+
|
|
103
|
+
/* L H P — desktop, Year */
|
|
104
|
+
{
|
|
105
|
+
const { ctx, page: p, errors } = await open();
|
|
106
|
+
const a = await laneOf(p, 'p:pmos-scarlet'), b = await laneOf(p, 'p:pmos-idpf');
|
|
107
|
+
ok('L each product\'s head row is a lane: its name cell with the fold, its track with a thin line', a && b && /pmos-scarlet/.test(a.name) && a.span >= 1 && b.span >= 1, JSON.stringify({ a, b }));
|
|
108
|
+
ok('L the lane rolls up the ◇ tasks and each end ◇ of its initiatives; Dec 11 and Dec 18 merge into one counted ◇',
|
|
109
|
+
a && a.tm.length === 4 && a.tmc.length === 1 && /^tg-tmc dn|^tg-tmc/.test(a.tmc[0]) && a.tmc[0].endsWith('|2') && a.tml.join() === 'Oct 16,Dec 11–18,Jan 29,Feb 26,Mar 31', JSON.stringify(a));
|
|
110
|
+
ok('L the same ◇: late is orange, the Evaluate task IS the end ◇ (said once), a plain end ◇ is named Deliver',
|
|
111
|
+
a && /^tg-tm late\|Design review · Passkey sign-in · Oct 16 · late$/.test(a.tm[0]) && a.tm.some((x) => /KPI evaluated · Scarlet/.test(x)) && a.tm.some((x) => /^tg-tm\|Deliver · Passkey sign-in · Feb 26$/.test(x)) && !a.tm.some((x) => /Committed/.test(x)), JSON.stringify(a && a.tm));
|
|
112
|
+
ok('H a single ◇\'s hover names the milestone and its initiative', a && a.tm.some((x) => x.endsWith('|Feature delivered · Scarlet — ST What’s The News · Jan 29')), JSON.stringify(a && a.tm));
|
|
113
|
+
ok('L the other product\'s lane: Mar 2 and Mar 6 merge; Apr 30 and Jun 30 are the ends', b && b.tmc.length === 1 && b.tml.join() === 'Mar 2–6,Apr 30,Jun 30', JSON.stringify(b));
|
|
114
|
+
const lg = await p.evaluate(() => (document.querySelector('.tg-lgd') || {}).textContent || '');
|
|
115
|
+
ok('L the legend gets no new entry', !/lane|product/i.test(lg), lg);
|
|
116
|
+
await shot(p, 'lane-board-1440');
|
|
117
|
+
await p.click('#ibBody .tg-lane[data-lane="p:pmos-scarlet"] .tg-tmc');
|
|
118
|
+
const list = await p.evaluate(() => { const m = document.querySelector('.tg-msp'); return m ? [...m.querySelectorAll('[data-ms-ini]')].map((x) => x.textContent) : null; });
|
|
119
|
+
ok('P the counted ◇ lists its milestones: name, initiative, date', list && list.join('|') === 'Pilot with 2 newsroomsScarlet — ST What’s The NewsDec 11|Security sign-offPasskey sign-inDec 18', JSON.stringify(list));
|
|
120
|
+
await shot(p, 'lane-list-1440');
|
|
121
|
+
await p.click('.tg-msp [data-ms-ini="board:passkey"]');
|
|
122
|
+
await p.waitForTimeout(400);
|
|
123
|
+
ok('P a line opens its initiative', await p.evaluate(() => !document.querySelector('.tg-msp') && !!document.querySelector('#ibBody [data-row="board:passkey"].sel')));
|
|
124
|
+
ok('the Board threw nothing', !errors.length, errors.join('\n'));
|
|
125
|
+
await ctx.close();
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/* F — folded */
|
|
129
|
+
{
|
|
130
|
+
const { ctx, page: p } = await open({ fold: ['p:pmos-scarlet', 'p:pmos-idpf'] });
|
|
131
|
+
const a = await laneOf(p, 'p:pmos-scarlet');
|
|
132
|
+
const rows = await p.evaluate(() => document.querySelectorAll('#ibBody .tg-r[data-row]').length);
|
|
133
|
+
ok('F folded, the lane looks the same and the head shows the count', a && a.n === '2' && a.tm.length === 4 && a.tmc.length === 1 && rows === 0, JSON.stringify({ a, rows }));
|
|
134
|
+
await shot(p, 'lane-folded-1440');
|
|
135
|
+
await ctx.close();
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/* S — Quarter and 5 yr */
|
|
139
|
+
{
|
|
140
|
+
const { ctx, page: p } = await open({ span: 'quarter' });
|
|
141
|
+
const a = await laneOf(p, 'p:pmos-scarlet');
|
|
142
|
+
ok('S Quarter puts a date under every ◇ in view', a && a.tml.length >= 4 && a.tml.every((x) => /^[A-Z][a-z]{2} \d/.test(x)), JSON.stringify(a && a.tml));
|
|
143
|
+
await ctx.close();
|
|
144
|
+
const { ctx: c5, page: p5 } = await open({ span: 'y5' });
|
|
145
|
+
const a5 = await laneOf(p5, 'p:pmos-scarlet');
|
|
146
|
+
ok('S 5 yr draws the ◇s with no dates', a5 && !a5.tml.length && (a5.tm.length + a5.tmc.length) >= 1, JSON.stringify(a5));
|
|
147
|
+
await c5.close();
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/* Q — the phone */
|
|
151
|
+
{
|
|
152
|
+
const { ctx, page: p, errors } = await open({ w: 390, h: 844, phone: true });
|
|
153
|
+
const a = await p.evaluate(() => { const r = document.querySelector('#ibBody .tgq-r.tg-lane[data-lane="p:pmos-scarlet"]'); return r ? { marks: r.querySelectorAll('.tg-tm, .tg-tmc').length, dates: r.querySelectorAll('.tg-tml').length, btn: r.querySelectorAll('.tg-p button').length } : null; });
|
|
154
|
+
ok('Q the phone draws the lane\'s ◇s with no dates', a && a.marks >= 1 && a.dates === 0 && a.btn === 0, JSON.stringify(a));
|
|
155
|
+
await p.evaluate(() => { const t = document.querySelector('#ibBody .tgq-r.tg-lane[data-lane="p:pmos-scarlet"] > .tg-p'); t.click(); });
|
|
156
|
+
await p.waitForTimeout(200);
|
|
157
|
+
const sh = await p.evaluate(() => { const m = document.querySelector('.tg-msp.sh'); return m ? { h: (m.querySelector('.h') || {}).textContent, lines: [...m.querySelectorAll('[data-ms-ini]')].map((x) => x.querySelector('span').firstChild.textContent + '|' + x.querySelector('.k').textContent) } : null; });
|
|
158
|
+
ok('Q a tap on the lane opens a sheet with the product\'s milestones in date order',
|
|
159
|
+
sh && sh.h === 'pmos-scarlet' && sh.lines.join() === 'Design review|Oct 16,Pilot with 2 newsrooms|Dec 11,Security sign-off|Dec 18,Feature delivered|Jan 29,Deliver|Feb 26,KPI evaluated|Mar 31', JSON.stringify(sh));
|
|
160
|
+
await shot(p, 'lane-phone-390');
|
|
161
|
+
ok('the phone threw nothing', !errors.length, errors.join('\n'));
|
|
162
|
+
await ctx.close();
|
|
163
|
+
}
|
|
164
|
+
finish();
|
|
165
|
+
})();
|
|
@@ -118,7 +118,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
|
118
118
|
await fold(p, 'tree');
|
|
119
119
|
await until(() => p.evaluate(() => !!document.querySelector('#czViewer button.pp-open[data-ini="descope-parity"]')));
|
|
120
120
|
await p.click('#czViewer button.pp-open[data-ini="descope-parity"]');
|
|
121
|
-
const ip = await until(() => p.evaluate(() => { const v = document.querySelector('#czViewer'); if (!v || v.hidden || !/Initiative/.test(v.getAttribute('aria-label') || '')) return null; return { t: v.querySelector('.cz-vw-title').textContent, peek: !document.querySelector('#peek'), stg: v.querySelectorAll('.iv-
|
|
121
|
+
const ip = await until(() => p.evaluate(() => { const v = document.querySelector('#czViewer'); if (!v || v.hidden || !/Initiative/.test(v.getAttribute('aria-label') || '')) return null; return { t: v.querySelector('.cz-vw-title').textContent, peek: !document.querySelector('#peek'), stg: new Set([...v.querySelectorAll('.iv-tl .iv-tlp')].map((x) => x.dataset.ivStage)).size + v.querySelectorAll('.iv-tl .iv-tl-sk').length }; }));
|
|
122
122
|
ok('O an initiative in the tree opens the Board\'s initiative in the same shell, with its eight steps (XvABoard)', !!ip && ip.t === 'Descope feature parity' && ip.peek && ip.stg === 8, JSON.stringify(ip));
|
|
123
123
|
await p.keyboard.press('Escape');
|
|
124
124
|
await until(() => p.evaluate(() => document.querySelector('#czViewer').hidden));
|
|
@@ -5,9 +5,10 @@
|
|
|
5
5
|
* questions, usual(track) the usual days in the step, rowOf(key), pageHref(r), askHref(r, q), refreshJira(), send(r) the
|
|
6
6
|
* Send to Jira sheet, acts(r, btn) the row actions popover, grillOpen(r, btn), onShow(key, from) / onHide() so the page
|
|
7
7
|
* marks the row the item came from, programOf(r) the program it is in or null, openProgram(id, btn), turnProgram(r)
|
|
8
|
-
* "Turn into a program", moveItems(r) Move out of its program and Move to another (pm/prog-move.js),
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* "Turn into a program", moveItems(r) Move out of its program and Move to another (pm/prog-move.js), smItems(r) and
|
|
9
|
+
* smPress(r, act, btn) Split into a new initiative and Merge into (pm/split-merge.js), openIniId(id) a row by its record id, setTask(r, uid, state) a task's state, setDates(r, uid, { start?, due? }) its days (the Tasks
|
|
10
|
+
* views' quick changes, batch 9 item 5b), removeTask(r, uid) the status picker's trash (batch 11 item 16), addTask(r, title) a new task (POST /api/boards/tasks/add),
|
|
11
|
+
* openTask(r, task) the task's own editor, hold(r, i, btn) a hold's menu (the stage card's ⏸, batch 11 item 21), viewDoc(path), reload() a new read of the Board and toast(text, undo?) (planned
|
|
11
12
|
* versus actual, pm/ini-versions.js) }
|
|
12
13
|
* openIni(r, from) the initiative: the ONE view (pm/ini-view.js from pm/ini-view-model.js, feedback batch 6 item 1; canvas OvIniA), the
|
|
13
14
|
* same as Home's initiative page: the summary card, the stage card with its dates line (it replaced the Plan card, item 3),
|
|
@@ -66,7 +67,9 @@ function iniMore(r) {
|
|
|
66
67
|
if (r.id && O.turnProgram && !(O.programOf && O.programOf(r))) more.push({ label: 'Turn into a program', on: () => O.turnProgram(r) });
|
|
67
68
|
// an initiative in a program can move out of it, or to another one (feedback batch 11 item 2, canvas LpA1More, LpA2Other; pm/prog-move.js)
|
|
68
69
|
const mv = r.id && O.moveItems ? O.moveItems(r) : [];
|
|
69
|
-
|
|
70
|
+
// split it into a new initiative, or merge it into another, above the program moves (batch 11 item 14, canvas XsmA1Menu; pm/split-merge.js)
|
|
71
|
+
const sm = r.id && O.smItems ? O.smItems(r) : [];
|
|
72
|
+
if (sm.length || mv.length) more.push({ sep: true }, ...sm, ...mv);
|
|
70
73
|
if ((O.M() || {}).jira) more.push({ sep: true }, { label: 'Read Jira again', on: () => O.refreshJira() });
|
|
71
74
|
more.push({ sep: true });
|
|
72
75
|
if (r.id) more.push({ label: 'Copy link', on: () => copyText(new URL(O.pageHref(r), location.href).href, 'Link copied.') });
|
|
@@ -84,7 +87,7 @@ function iniText(r) {
|
|
|
84
87
|
}
|
|
85
88
|
function iniBody(r) {
|
|
86
89
|
const md = (v) => ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'][+v.slice(5, 7) - 1] + ' ' + +v.slice(8, 10);
|
|
87
|
-
return viewHtml(viewOf(r), { add: !!(r.id && O.addTask), adding: adding === r.key, addHint: adding === r.key && addDates ? md(addDates.start) + ' to ' + md(addDates.due) : '', openTask: !!O.openTask, quick: !!(O.setTask && O.setDates), tail: VW.czSections(boardSections(r), { key: 'board' }) });
|
|
90
|
+
return viewHtml(viewOf(r), { add: !!(r.id && O.addTask), adding: adding === r.key, addHint: adding === r.key && addDates ? md(addDates.start) + ' to ' + md(addDates.due) : '', openTask: !!O.openTask, quick: !!(O.setTask && O.setDates), hold: !!O.hold, tail: VW.czSections(boardSections(r), { key: 'board' }) });
|
|
88
91
|
}
|
|
89
92
|
/** Presses inside the shown item: the view's own (pm/ini-view.js), a ticket's drill-in, the PRD-change question. A [data-doc] goes to the page's handler. */
|
|
90
93
|
function wire(body, key) {
|
|
@@ -100,10 +103,14 @@ function wire(body, key) {
|
|
|
100
103
|
dates: (uid, patch) => { const r = O.rowOf(key); if (r && O.setDates) O.setDates(r, uid, patch); },
|
|
101
104
|
// the ◇ in the status picker (batch 11 item 3): a task made a milestone, or made a plain task again, with Undo
|
|
102
105
|
milestone: (uid, on) => { const r = O.rowOf(key); if (r && O.setDates) O.setDates(r, uid, { milestone: !!on }); },
|
|
106
|
+
// the trash in the status picker (batch 11 item 16): Delete, with Undo in the toast
|
|
107
|
+
...(O.removeTask ? { remove: (uid) => { const r = O.rowOf(key); if (r) O.removeTask(r, uid); } } : {}),
|
|
103
108
|
openTicket: (tk) => { const r = O.rowOf(key), k = r && ((r.track && r.track.tickets) || []).find((x) => x.key === tk); if (k) openTicket(r, k); },
|
|
104
109
|
// a task's title opens the one task editor (task-card.js) as a drill-in: ← comes back to the initiative (batch 9 item 5a)
|
|
105
110
|
openTask: (uid) => { const r = O.rowOf(key), k = r && (r.tasks || []).find((x) => x.uid === uid); if (k && O.openTask) { VW.drill(); O.openTask(r, k); } },
|
|
106
|
-
add: () => { adding = key; redraw(); const f = body.querySelector('#ivAddTask'); if (f) f.focus(); },
|
|
111
|
+
add: (b, dates) => { adding = key; if (dates && dates.start) addDates = dates; redraw(); const f = body.querySelector('#ivAddTask'); if (f) f.focus(); },
|
|
112
|
+
// the stage card's ⏸ or calendar on a hold (batch 11 item 21): the Board's own hold menu (bd-acts.js)
|
|
113
|
+
hold: (i, b) => { const r = O.rowOf(key); if (r && O.hold) O.hold(r, i, b); },
|
|
107
114
|
addCancel: () => { adding = null; addTo = ''; addDates = null; redraw(); },
|
|
108
115
|
addTask: async (title, inp) => { const r = O.rowOf(key); if (!r || !O.addTask) return; inp.disabled = true; const ok = await O.addTask(r, title, addTo, addDates); inp.disabled = false; if (ok) { inp.value = ''; inp.focus(); } },
|
|
109
116
|
primary: (act, b) => {
|
|
@@ -114,6 +121,9 @@ function wire(body, key) {
|
|
|
114
121
|
else if (act === 'page' && r.id) location.assign(O.pageHref(r));
|
|
115
122
|
},
|
|
116
123
|
program: (id, b) => { if (O.openProgram) O.openProgram(id, b); },
|
|
124
|
+
// Claude's split or merge card (batch 11 item 14): ✕ Not now, ✎ Change it first, ✓ as suggested; the merged summary's link opens the one that stays
|
|
125
|
+
sm: (act, b) => { const r = O.rowOf(key); if (r && O.smPress) O.smPress(r, act, b); },
|
|
126
|
+
openIni: (id) => { if (O.openIniId) O.openIniId(id); },
|
|
117
127
|
doc: (path) => O.viewDoc(path),
|
|
118
128
|
redraw,
|
|
119
129
|
});
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
* mergeBoards(list) All products: one Board model from every product's model, each row keeping its own product
|
|
12
12
|
* bandHtml(g, st, o) the stage track's program row: tile, title, products, your count, its spread, its next milestones
|
|
13
13
|
* prodHtml(g, o) · subHtml(name) a product group's head row (tile, name, goal dots, chevron) and a program's product sub-row
|
|
14
|
+
* prodCell(g) the head's fold button alone (the timeline's product lane, batch 11 item 17)
|
|
14
15
|
* goalsFrom(fn) · goalsHtml(name) the goal dots of a product head, from Home's source (pm/home-list.js goalsOf); fn(name) gives its rows
|
|
15
16
|
*
|
|
16
17
|
* A program has no stage of its own (PM, 2026-10-23): the band shows only what its initiatives say. With one product picked, the program shows
|
|
@@ -167,8 +168,12 @@ export function bandHtml(g, st, o) {
|
|
|
167
168
|
}
|
|
168
169
|
/** A product group's head row (PgBoard .prd): the tile, the name and the fold chevron; folded, the count of its initiatives. */
|
|
169
170
|
export function prodHtml(g, cls = 'bt-prd') {
|
|
171
|
+
return `<div class="${cls}${folded(g.key) ? ' closed' : ''}" role="row">${prodCell(g)}</div>`;
|
|
172
|
+
}
|
|
173
|
+
/** The fold button of a product head alone: the timeline's product lane (batch 11 item 17, PlmA1Board) puts it in the name cell, its track beside it. */
|
|
174
|
+
export function prodCell(g) {
|
|
170
175
|
const open = !folded(g.key), gl = open ? goalsHtml(g.name) : '';
|
|
171
|
-
return `<
|
|
176
|
+
return `<button type="button" class="bd-prdb" data-fold="${esc(g.key)}" aria-expanded="${open}" aria-label="${esc(g.name)}, ${g.rows.length} ${plural(g.rows.length, 'initiative', 'initiatives')}. ${open ? 'Fold' : 'Show'}">${tileHtml(g.name)}<span>${esc(g.name)}</span>${gl}${open ? '' : `<span class="n">${g.rows.length}</span>`}${SV(open ? CHEV_D : CHEV_R)}</button>`;
|
|
172
177
|
}
|
|
173
178
|
/** The goal dots of a product's head (PgBoard .gd), from the same source as Home's product header (pm/home-list.js goalsOf): one per KR or
|
|
174
179
|
* budget its open initiatives anchor to, green on track, amber at risk. With no goal anchored, nothing is drawn. The page sets the rows. */
|
|
@@ -298,6 +298,15 @@ const iso = (d) => d.getFullYear() + '-' + String(d.getMonth() + 1).padStart(2,
|
|
|
298
298
|
const lastMs = (r) => { const S = (r.wfStages || []).filter((x) => x && x.milestone); return S.length ? String(S[S.length - 1].key).toLowerCase() : 'evaluate'; };
|
|
299
299
|
/** The ◆ stage a milestone task sits in, by name, or ''. */
|
|
300
300
|
const msStage = (r, m) => { if (!m.sec) return ''; const st = (r.wfStages || []).find((x) => x.key === m.sec); return st ? (st.milestone ? st.name : '') : /^(deliver|evaluate)$/i.test(m.sec) ? m.sec.replace(/^./, (c) => c.toUpperCase()) : ''; };
|
|
301
|
+
/** The milestone task the bar's end ◇ stands for, or null. The end ◇ is the workflow's last ◆ stage (Evaluate on Product feature): the latest
|
|
302
|
+
* milestone task in that stage IS it, else one on the end's own day; it takes that task's name and done, and is not drawn twice. A task in an
|
|
303
|
+
* earlier ◆ stage keeps its own ◇. M: the row's dated milestones. */
|
|
304
|
+
function endTask(r, M) {
|
|
305
|
+
const e = day(r.end); if (!e) return null;
|
|
306
|
+
const last = lastMs(r), inLast = M.filter((m) => m.sec && m.sec.toLowerCase() === last);
|
|
307
|
+
const end = inLast.length ? inLast[inLast.length - 1] : M.find((m) => +day(m.date) === +e) || null;
|
|
308
|
+
return end ? { ...end, stage: msStage(r, end) } : null;
|
|
309
|
+
}
|
|
301
310
|
/** One ◇ per milestone task on the row (feedback batch 11 item 3; canvas XmlA1Board, XmlA4Hover, XmlA7Spans): at its due date, hollow while open,
|
|
302
311
|
* filled grey when done, an orange outline and an orange date when late. Quarter and Half put a short date under each ◇, Year and 2 yr cut the
|
|
303
312
|
* date to fit, 5 yr and a phone none. ◇s closer than about 40 px merge into one counted ◇ that lists them under it. The latest milestone task in
|
|
@@ -305,15 +314,7 @@ const msStage = (r, m) => { if (!m.sec) return ''; const st = (r.wfStages || [])
|
|
|
305
314
|
function taskMarks(r, X, now, phone, pxPct, ms) {
|
|
306
315
|
const M = (r.milestones || []).filter((m) => day(m.date));
|
|
307
316
|
if (!M.length) return { html: '', end: null };
|
|
308
|
-
|
|
309
|
-
// one on the end's own day; it takes that task's name and done, and is not drawn twice. A task in an earlier ◆ stage keeps its own ◇
|
|
310
|
-
const e = day(r.end), last = lastMs(r);
|
|
311
|
-
let end = null;
|
|
312
|
-
if (e) {
|
|
313
|
-
const inLast = M.filter((m) => m.sec && m.sec.toLowerCase() === last);
|
|
314
|
-
end = inLast.length ? inLast[inLast.length - 1] : M.find((m) => +day(m.date) === +e) || null;
|
|
315
|
-
if (end) end = { ...end, stage: msStage(r, end) };
|
|
316
|
-
}
|
|
317
|
+
const end = endTask(r, M);
|
|
317
318
|
const L = M.filter((m) => !end || m.id !== end.id).map((m) => ({ ...m, late: msLate(m, now), stage: msStage(r, m) }))
|
|
318
319
|
.filter((m) => { const x = X(day(m.date)); return x > 0 && x < 100; });
|
|
319
320
|
const C = mergeClose(L, Math.max(1, ms.reach || 7));
|
|
@@ -333,6 +334,52 @@ function taskMarks(r, X, now, phone, pxPct, ms) {
|
|
|
333
334
|
return { html, end };
|
|
334
335
|
}
|
|
335
336
|
|
|
337
|
+
/* ── the product lane (feedback batch 11 item 17; canvas PlmA1Board, PlmA2Folded, PlmA3Phone) ──
|
|
338
|
+
* A product's head row on the timeline carries every milestone of its initiatives: each row's milestone tasks and each row's end ◇ (the
|
|
339
|
+
* committed Deliver or Evaluate date, as qBar draws it). Derived, nothing stored. The same ◇ as the rows: open, filled when done, orange when
|
|
340
|
+
* late. Close ◇s merge into one counted ◇ (the rows' reach, about 40 px) with the date range under it; pressing it lists them, each line opening
|
|
341
|
+
* its initiative. A thin line runs from the first start to the last end. A phone draws the ◇s alone; a tap on the lane lists them in a sheet. */
|
|
342
|
+
/** A product's milestones, by date: [{ id, name, date, done, late, row }]. */
|
|
343
|
+
export function laneMilestones(rows, now) {
|
|
344
|
+
const out = [];
|
|
345
|
+
for (const r of rows || []) {
|
|
346
|
+
const M = (r.milestones || []).filter((m) => day(m.date)), s = day(r.start), e = day(r.end), et = endTask(r, M);
|
|
347
|
+
for (const m of M) if (!et || m.id !== et.id) out.push({ id: m.id, name: m.name, date: m.date, done: !!m.done, late: msLate(m, now), row: r });
|
|
348
|
+
if (!s || !e) continue;
|
|
349
|
+
const ob = openBack(r, now), late = (r.over && now > e) || (ob && ob > e) || (et && msLate(et, now));
|
|
350
|
+
out.push({ id: et ? et.id : '', name: et ? et.name : r.track && r.track.k >= 6 ? 'Evaluate' : 'Deliver', date: iso(e), done: !!(et && et.done), late: !!late, row: r });
|
|
351
|
+
}
|
|
352
|
+
return out.sort((a, b) => day(a.date) - day(b.date));
|
|
353
|
+
}
|
|
354
|
+
/** The lines a lane's list or sheet shows, as data on its ◇ or its track: name, initiative, date and tone. */
|
|
355
|
+
const laneData = (L) => esc(JSON.stringify(L.map((m) => ({ k: m.row.key, n: m.name, t: m.row.title, d: String(m.date).slice(0, 10), s: m.late ? 'late' : m.done ? 'dn' : '' }))));
|
|
356
|
+
/** The lane's ◇s: one per milestone, close ones merged into a counted ◇ (a button on a desktop, a mark on a phone, where the lane's tap lists
|
|
357
|
+
* them); Quarter and Half put the date under each, Year and 2 yr cut it to fit, 5 yr and a phone none (XmlA7Spans). */
|
|
358
|
+
function laneMarks(L, X, phone, pxPct, ms) {
|
|
359
|
+
const C = mergeClose(L.filter((m) => { const x = X(day(m.date)); return x > 0 && x < 100; }), Math.max(1, ms.reach || 7));
|
|
360
|
+
const sp = ms.sp || 'quarter', dates = !phone && sp !== 'y5', cut = sp === 'year' || sp === 'y2';
|
|
361
|
+
const xs = C.map((c) => X(day(c.date))), room = (i) => (pxPct ? Math.min(i ? xs[i] - xs[i - 1] : 1e3, i < xs.length - 1 ? xs[i + 1] - xs[i] : 1e3) * pxPct - 6 : 0);
|
|
362
|
+
const fmtD = (d) => (sp === 'y2' ? my(d) : md(d));
|
|
363
|
+
const words = (m) => m.name + ' · ' + m.row.title + ' · ' + md(day(m.date)) + (m.late ? ' · late' : m.done ? ' · done' : '');
|
|
364
|
+
return C.map((c, i) => {
|
|
365
|
+
const x = P(xs[i]), tone = c.late ? ' late' : c.done ? ' dn' : '', one = c.items[0];
|
|
366
|
+
const mark = c.n < 2 ? `<span class="tg-tm${tone}" style="left:${x}" role="img" aria-label="${esc('Milestone ' + words(one))}" title="${esc(words(one))}"></span>`
|
|
367
|
+
: phone ? `<span class="tg-tmc${tone}" style="left:${x}" aria-hidden="true"><b>${c.n}</b></span>`
|
|
368
|
+
: `<button type="button" class="tg-tmc${tone}" data-ms-lane="${laneData(c.items)}" style="left:${x}" aria-haspopup="menu" aria-label="${esc(c.n + ' milestones, ' + c.range + ': ' + c.items.map((m) => m.name + ', ' + m.row.title).join('; '))}" title="${esc(c.items.map(words).join('\n'))}"><b aria-hidden="true">${c.n}</b></button>`;
|
|
369
|
+
if (!dates) return mark;
|
|
370
|
+
const label = c.n > 1 ? c.range : fmtD(day(one.date)), w = cut && room(i) > 0 ? `;max-width:${Math.max(18, Math.round(room(i)))}px` : '';
|
|
371
|
+
return mark + `<span class="tg-tml${c.late ? ' late' : ''}" style="left:${x}${w}">${esc(label)}</span>`;
|
|
372
|
+
}).join('');
|
|
373
|
+
}
|
|
374
|
+
/** The product's head row on the timeline: the name cell (tile, name, goal dots, count when folded, the fold) and the lane. Open or folded it
|
|
375
|
+
* looks the same: folded, it is the product's summary. */
|
|
376
|
+
function laneRow(g, X, W, ov, o, ms, pxPct, now) {
|
|
377
|
+
const sp = progSpan(g), br = sp && sp.hi > W.from && sp.lo < W.to ? progLine(g, sp, X, now) : '';
|
|
378
|
+
const L = laneMilestones(g.rows, now), marks = laneMarks(L, X, o.phone, pxPct, ms), shut = o.folded(g.key) ? ' closed' : '';
|
|
379
|
+
if (o.phone) return `<div class="tgq-r tg-lane${shut}" data-lane="${esc(g.key)}"><div class="tgq-n tg-lnn">${o.prodCell(g)}</div><div class="tg-p"${L.length ? ` data-lane-ms="${laneData(L)}" data-lane-name="${esc(g.name)}"` : ''}>${ov}${br}${marks}</div></div>`;
|
|
380
|
+
return `<div class="tg-r tg-lane${shut}" role="row" data-lane="${esc(g.key)}"><div class="tg-n tg-lnn" role="rowheader">${o.prodCell(g)}</div><div class="tg-p" role="cell">${ov}${br}${marks}</div></div>`;
|
|
381
|
+
}
|
|
382
|
+
|
|
336
383
|
/** A row's milestones: its release's sign-off (◆ at the release date), "Push tickets" where drafted tickets wait on your Commit (today), and
|
|
337
384
|
* "after <initiative>" at the plan start where a dependency is not done. Each one only from a record. */
|
|
338
385
|
function marks(r, X, now, phone) {
|
|
@@ -410,22 +457,29 @@ function scaled(rows, M, o) {
|
|
|
410
457
|
// were missing under it); a product group keeps only the dated ones, and the foot names the rest
|
|
411
458
|
// by key, not by identity: By product copies a program's row ({ ...r, inProgram }), and that copy is never in `list` (batch 11 item 12: a
|
|
412
459
|
// program's initiatives were missing from their product on the timeline)
|
|
460
|
+
// By product, a program's undated initiative keeps its "No dates" row under its product too (batch 11 item 19: they disappeared once grouped by product)
|
|
413
461
|
const onList = new Set(list.map((r) => r.key));
|
|
414
|
-
|
|
462
|
+
// a timeline reads in time (batch 11 item 22): each group's rows by start, then end; undated ones last. The health dot still says late or at risk
|
|
463
|
+
const at = (r) => { const x = extentOf(r, now); return x ? [+x.a, +x.b] : [Infinity, Infinity]; };
|
|
464
|
+
const byTime = (L) => L.map((r) => [at(r), r]).sort((p, q) => p[0][0] - q[0][0] || p[0][1] - q[0][1]).map((x) => x[1]);
|
|
465
|
+
list.splice(0, list.length, ...byTime(list));
|
|
466
|
+
const G = o.groups ? o.groups.map((g) => (g.kind === 'program' ? { ...g, products: g.products.filter((x) => x.rows.length).map((x) => ({ ...x, rows: byTime(x.rows) })) } : { ...g, rows: byTime(g.rows.filter((r) => onList.has(r.key) || r.inProgram)) })).filter((g) => g.rows.length || g.kind === 'program') : null;
|
|
415
467
|
const empty = '<p class="tg-empty">No initiative on screen has a date on record.</p>';
|
|
416
468
|
const ext = (r) => { const x = extentOf(r, now); return x ? ` data-a="${X(x.a).toFixed(3)}" data-b="${X(x.b).toFixed(3)}"` : ''; };
|
|
469
|
+
// a product's head carries its lane from Quarter on (batch 11 item 17); Sprint on a phone, and a page that gives no head cell, keep the plain head
|
|
470
|
+
const lane = (g) => (o.prodCell && sp !== 'sprint' ? laneRow(g, X, W, ov, o, msO, pxPct, now) : o.prodHtml(g));
|
|
417
471
|
if (o.phone) {
|
|
418
472
|
// TsCPhone: each row carries its name above its bar; the name stays at the left while you swipe
|
|
419
473
|
const one = (r) => `<div class="tgq-r${o.sel === r.key ? ' sel' : ''}" data-row="${esc(r.key)}"><button type="button" class="tgq-n ini2" data-key="${esc(r.key)}" aria-label="${esc(r.title + ', ' + o.status(r).text)}"><i class="cz-dot ${toneOf(r, now)}" aria-hidden="true"></i><b>${esc(r.title)}</b></button><div class="tg-p"${ext(r)}>${ov}${dated(r) ? qBar(r, X, now, true, fmt, pxPct, msO) + edgeTabs(r, X, now, true) : ND}</div></div>`;
|
|
420
474
|
const body = G ? G.map((g) => {
|
|
421
|
-
if (g.kind !== 'program') return
|
|
475
|
+
if (g.kind !== 'program') return lane(g) + (o.folded(g.key) ? '' : g.rows.map(one).join(''));
|
|
422
476
|
const st = o.progState(g.program), s2 = progSpan(g);
|
|
423
477
|
const br = s2 ? progLine(g, s2, X, now) : '';
|
|
424
478
|
return `<div class="tgq-r tg-pg" data-prow="${esc(g.program.id)}"><div class="tgq-n tg-pgn">${progName(g, st, o)}</div><div class="tg-p">${ov}${br}${progMarks(g, st, X, W, reach, long ? my : null, true)}</div></div>` + (o.folded(g.key) ? '' : g.products.map((x) => x.rows.map(one).join('')).join(''));
|
|
425
479
|
}).join('') : list.map(one).join('');
|
|
426
|
-
const
|
|
480
|
+
const top = `<div class="tgq-h"><div class="tg-p">${ticks}${pill}</div></div>`;
|
|
427
481
|
const below = none.length ? `<div class="tg-none"><span>${none.length} ${none.length === 1 ? 'has' : 'have'} no dates</span>${askBtn}</div>` : '';
|
|
428
|
-
return { html: `<div class="tg tg-s tgq" ${attrs}><div class="tg-scw"><div class="tg-sc" tabindex="0" role="group" aria-label="Timeline" style="${style}"><div class="tg-in">${
|
|
482
|
+
return { html: `<div class="tg tg-s tgq" ${attrs}><div class="tg-scw"><div class="tg-sc" tabindex="0" role="group" aria-label="Timeline" style="${style}"><div class="tg-in">${top}<div class="tg-body">${body || empty}</div></div></div>${back}<i class="tg-fade l" aria-hidden="true"></i><i class="tg-fade r" aria-hidden="true"></i></div></div>${below}`, none };
|
|
429
483
|
}
|
|
430
484
|
const head = `<div class="tg-r tg-h"><div class="tg-n"><b>Initiative</b>${back}</div><div class="tg-p">${ticks}${pill}</div></div>`;
|
|
431
485
|
// one line per initiative (PgTimeline): its status dot and its name; the owner and the step stay in the row's title for a pointer and a reader
|
|
@@ -433,8 +487,8 @@ function scaled(rows, M, o) {
|
|
|
433
487
|
return `<div class="tg-r${cls || ''}${o.sel === r.key ? ' sel' : ''}" data-row="${esc(r.key)}"><button type="button" class="tg-n ini2" data-key="${esc(r.key)}" title="${esc(sub)}" aria-label="${esc(r.title + ', ' + sub)}"><i class="cz-dot ${toneOf(r, now)}${toneOf(r, now) === 'you' ? ' m-info' : toneOf(r, now) === 'late' || toneOf(r, now) === 'risk' ? ' m-warn' : ''}" aria-hidden="true"></i><b>${r.inProgram && o.memberIcon ? o.memberIcon(r.inProgram) : ''}${esc(r.title)}</b></button><div class="tg-p"${ext(r)}>${ov}${dated(r) ? qBar(r, X, now, false, fmt, pxPct, msO) + edgeTabs(r, X, now, false) : ND}</div></div>`; };
|
|
434
488
|
// programs first, then the product (PgTimeline): the program's row brackets its initiatives' bars and draws its milestones as diamonds
|
|
435
489
|
const body = G ? G.map((g) => {
|
|
436
|
-
if (g.kind !== 'program') return
|
|
437
|
-
const
|
|
490
|
+
if (g.kind !== 'program') return lane(g) + (o.folded(g.key) ? '' : g.rows.map((r) => one(r, ' tg-gr')).join(''));
|
|
491
|
+
const lp = g.products[g.products.length - 1], last = lp ? lp.rows[lp.rows.length - 1] : null;
|
|
438
492
|
return progRow(g, o.progState(g.program), X, W, ov, o, reach, long ? my : null, pxPct, now) + (o.folded(g.key) ? '' : g.products.map((x) => (g.products.length > 1 ? o.subHtml(x.name) : '') + x.rows.map((r) => one(r, ' tg-kid' + (r === last ? ' last' : ''))).join('')).join(''));
|
|
439
493
|
}).join('') : list.map((r) => one(r)).join('');
|
|
440
494
|
// the sprint band and the release keep their labels under the axis on Quarter, where a week is wide enough to read them
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* · Documents (BdDocs): the board's core documents and the documents its initiatives link (PRD, rubric, evaluation, release notes), with
|
|
9
9
|
* kind chips, health, when it changed and who changed it (GET /api/board-docs), and a row opens the document's panel.
|
|
10
10
|
* Nothing here invents a value: what no record holds is shown as "—" or not drawn. */
|
|
11
|
+
import { nameHtml } from './split-merge.js'; // Claude suggests a split or a merge: the purple dot after the name (batch 11 item 14)
|
|
11
12
|
import { esc } from './premium-shell.js';
|
|
12
13
|
import * as WF from './bd-wf.js';
|
|
13
14
|
import { nextHtml } from './bd-next.js';
|
|
@@ -81,7 +82,7 @@ function listRow(r, pg) {
|
|
|
81
82
|
const p = pg ? progOf(r) : null, prod = pg ? r.product || A.product() : '';
|
|
82
83
|
const pcells = pg ? `<span role="cell" class="bd-pt">${A.tileHtml(prod, 'bd-ti s')}<span class="bd-ell">${esc(prod)}</span></span><span role="cell" class="bd-pt">${p ? A.progTile('bd-pti s') + `<span class="bd-ell">${esc(p.title)}</span>` : ''}</span>` : '';
|
|
83
84
|
return `<div class="bd-lt${sel ? ' sel' : ''}${r.acts && r.acts.life === 'hold' ? ' held' : ''}" role="row" data-row="${esc(r.key)}">`
|
|
84
|
-
+ `<button type="button" class="bd-ltn ini2" data-key="${esc(r.key)}" role="rowheader" aria-haspopup="dialog"><b>${
|
|
85
|
+
+ `<button type="button" class="bd-ltn ini2" data-key="${esc(r.key)}" role="rowheader" aria-haspopup="dialog"><b>${nameHtml(r)}</b></button>${pcells}`
|
|
85
86
|
+ `<span role="cell" class="bd-wfn">${WF.wfIcon(WF.wfOf(r), 18)}<span class="bd-ell">${esc(WF.wfOf(r).name)}</span></span><span role="cell">${(r.track || {}).ms ? '<i class="cz-ms" aria-hidden="true"></i>' : ''}${esc(stepText(r, true))}</span><span role="cell">${catPill(r)}</span>`
|
|
86
87
|
+ `<span role="cell" class="cs s-${s.tone}"><i class="cz-dot ${s.tone} ${s.mo || ''}"></i>${esc(s.text)}</span>`
|
|
87
88
|
+ `<span role="cell">${avatar(r.owner)}</span><span role="cell" class="bd-nxc">${nextHtml(r, { self: M().board.self, due: false })}</span>`
|
|
@@ -258,7 +259,7 @@ export function stagesHtml(L, o = {}) {
|
|
|
258
259
|
function phoneRow(r) {
|
|
259
260
|
const s = statusLine(r), t = r.track || {}, w = WF.stageOfRow(r);
|
|
260
261
|
const sub = [(w && w.name) || t.label || r.stage, t.you ? t.you.replace(/^Your /, 'your ') : s.tone !== 'ok' && s.tone !== 'q' ? s.text.toLowerCase() : '', r.owner].filter(Boolean).join(' · ');
|
|
261
|
-
return `<button type="button" class="bd-lrow ini2${A.sel && A.sel() === r.key ? ' sel' : ''}" data-key="${esc(r.key)}" aria-haspopup="dialog"><i class="cz-dot ${s.tone} ${s.mo || ''}"></i><span class="tx"><span class="t">${
|
|
262
|
+
return `<button type="button" class="bd-lrow ini2${A.sel && A.sel() === r.key ? ' sel' : ''}" data-key="${esc(r.key)}" aria-haspopup="dialog"><i class="cz-dot ${s.tone} ${s.mo || ''}"></i><span class="tx"><span class="t">${nameHtml(r)}</span><span class="s${t.you ? '' : ' q'}">${esc(sub)}</span></span>${t.you && t.days != null ? `<span class="r">${t.days}d</span>` : ''}${many() ? WF.wfIcon(WF.wfOf(r), 18) : ''}</button>`;
|
|
262
263
|
}
|
|
263
264
|
export function phoneListHtml(L) {
|
|
264
265
|
const you = L.filter((r) => r.track && r.track.you), bad = L.filter((r) => !you.includes(r) && needOf(r) <= 3), rest = L.filter((r) => !you.includes(r) && !bad.includes(r));
|
|
@@ -1299,6 +1299,16 @@ body.bd-spick .bd-hd .bd-tools { margin-left: auto; }
|
|
|
1299
1299
|
.tg-msp.sh .gr { display: block; width: 36px; height: 4px; margin: 0 auto 10px; border-radius: 2px; background: var(--cz-hair); }
|
|
1300
1300
|
.tg-msp.sh .h { display: block; padding: 4px 12px 8px; font-size: 16px; font-weight: 800; color: var(--cz-ink); }
|
|
1301
1301
|
.tgq-r .tg-tm, .tgq-r .tg-tmc { top: 50%; }
|
|
1302
|
+
/* the product lane (batch 11 item 17; PlmA1Board, PlmA2Folded, PlmA3Phone): a product's head row carries every milestone of its initiatives,
|
|
1303
|
+
* the rows' ◇ rolled up, over a thin grey line from the first start to the last end. The name cell keeps the fold button; the lane is the track. */
|
|
1304
|
+
.tg-lane, .tg-s .tg-lane > .tg-n { background: var(--bd-row); }
|
|
1305
|
+
.tg-q .tg-body > .tg-lane { min-height: 56px; }
|
|
1306
|
+
.tg-lnn { flex-direction: row; align-items: center; }
|
|
1307
|
+
.tg-lnn .bd-prdb { min-width: 0; overflow: hidden; }
|
|
1308
|
+
.tg-lane .tg-span { background: var(--bd-plan); }
|
|
1309
|
+
.tgq-n.tg-lnn { display: flex; width: var(--vw, 100%); padding: 4px 10px 2px; cursor: default; }
|
|
1310
|
+
.tg-lnp .o small { display: block; font-size: 12px; font-weight: 500; color: var(--cz-ink3); overflow: hidden; text-overflow: ellipsis; }
|
|
1311
|
+
.tg-msp.sh { max-height: 70vh; overflow-y: auto; }
|
|
1302
1312
|
/* planned versus actual (batch 11 item 8; canvas PvaAC4Board): the saved plan's thin line with end caps under the bar, the slip after the end
|
|
1303
1313
|
* date (+14d orange, −15d grey), an initiative with drafts only drawn dashed, the legend's Plan and Draft keys. Milestone date labels drop
|
|
1304
1314
|
* under the plan line (+13 px). Dashed blue stays the Jira forecast; dotted stays a hold. */
|
|
@@ -36,10 +36,11 @@ import * as L from './home-list.js';
|
|
|
36
36
|
import * as TD from './home-today.js';
|
|
37
37
|
import * as YD from './home-day.js'; // Your day in the Viewer (XvAPhDay)
|
|
38
38
|
import { canDictate, dictate } from './home-dictate.js';
|
|
39
|
-
import { mountIni, iniList, iniOverview, iniPage } from './home-ini.js'; // the initiative's page, its stage move, Tasks and Core documents (premium-uncovered-features, HbC)
|
|
39
|
+
import { mountIni, iniList, iniOverview, iniPage, iniAddTask } from './home-ini.js'; // the initiative's page, its stage move, Tasks and Core documents (premium-uncovered-features, HbC)
|
|
40
40
|
import * as MEN from './home-mentions.js'; // @Mentions, the permanent row at the top of Home and its Viewer (Viewer kit, XvANew)
|
|
41
41
|
import { mountRecRow, clockOf as recClock } from './home-rec-row.js';
|
|
42
42
|
import { mountSesName } from './home-ses-name.js'; // session names A: tap the session's name to rename it (canvas XmsNames)
|
|
43
|
+
import * as SM from './split-merge.js'; // split one initiative in two, or merge two: Claude suggests, the PM approves (batch 11 item 14)
|
|
43
44
|
import * as PM from './prog-move.js'; // move an initiative out of its program, or to another (canvas LpA1More, LpA2Other, LpA4Phone)
|
|
44
45
|
import * as PO from './prog-order.js'; // a program's order on Home: the grip, hold-then-drag on a phone, ✦ Claude's order from the dates (canvas RoAPhone)
|
|
45
46
|
import { initiativeRename, taskRename } from './rename-press.js'; // tap the title to rename (canvas RnATask, RnASaved) // the pinned recording row above it (XvARecHome)
|
|
@@ -241,7 +242,7 @@ function rowHtml(r, o = {}) {
|
|
|
241
242
|
const kids = r.kids && S.kids.has(r.id) ? `<div class="hm-kids" role="group" aria-label="In ${esc(r.name)}">${r.kids.map((k) => rowHtml(k, { kid: true })).join('') || '<p class="hm-none">Nothing here now.</p>'}</div>` : '';
|
|
242
243
|
return `<div class="hm-r${sel ? ' sel' : ''}${o.kid ? ' kid' : ''} st-${esc(r.state)}" data-id="${esc(r.id)}">`
|
|
243
244
|
+ `<button type="button" class="hm-rm" data-hm-sel="${esc(r.id)}"${sel ? ' aria-current="true"' : ''}><i class="hm-dot ${dotCls(r.state)}" aria-hidden="true"></i>${tileHtml(r)}`
|
|
244
|
-
+ `<span class="hm-rt"><b>${esc(r.name)}</b><em>${esc(r.hint || '')}</em></span></button>${chip}${end}</div>${kids}`;
|
|
245
|
+
+ `<span class="hm-rt"><b>${r.kind === 'ini' ? SM.nameHtml(r.board, r.name) : esc(r.name)}</b><em>${esc(r.hint || '')}</em></span></button>${chip}${end}</div>${kids}`;
|
|
245
246
|
}
|
|
246
247
|
/* ── the one list (premium-uncovered-features: HmMyWork, HmProducts, HmDay, HmMic, HmReview, HmPhone) ── */
|
|
247
248
|
const NOW = () => S.D.now || Date.now();
|
|
@@ -322,7 +323,9 @@ function imRowOf(id) {
|
|
|
322
323
|
return { id, key: 'board:' + id, title: M.title || id, lane: M.lane || null, track: { k, key: k >= 0 ? STEPS[k].key : null, label: stage },
|
|
323
324
|
tasks: ((M.tasks && M.tasks.rows) || []).filter((x) => x.pmos && x.uid).map((x) => ({ uid: x.uid, title: x.title, status: x.state || 'To do', start: x.start || '', end: x.end || '', owner: x.owner || '' })) };
|
|
324
325
|
}
|
|
325
|
-
|
|
326
|
+
// an archived one opens too, from its link: a merged initiative's page says where its work went (batch 11 item 14, XsmA7Closed)
|
|
327
|
+
const goneRowOf = (id) => ((((S.D.board || {}).initiatives || {}).gone || {}).archived || []).find((r) => r.id === id) || null;
|
|
328
|
+
function iniRowOf(id) { return H.boardRows(S.D).find((r) => r.id === id) || (otherIni(id) || {}).row || goneRowOf(id); }
|
|
326
329
|
/** An initiative of another product Home reads (D.others): its row, and the workspace and board it is read from. Null for the board's own. */
|
|
327
330
|
function otherIni(id) {
|
|
328
331
|
if (!id || id === 'product' || H.boardRows(S.D).some((r) => r.id === id)) return null;
|
|
@@ -704,7 +707,8 @@ function overviewAsk(id) {
|
|
|
704
707
|
}
|
|
705
708
|
/** Turn into a program (P7), from the page's ⋯: a charter named after the initiative, which joins it; then the program opens here. */
|
|
706
709
|
async function turnProgram(id) {
|
|
707
|
-
|
|
710
|
+
// the initiative's own workspace, never the board's: its member line must sit beside it, or Home keeps it under its product (batch 11 item 18)
|
|
711
|
+
const res = await pmPost('/api/programs/turn', { ws: (otherIni(id) || {}).ws || boardWs() || null, initiative: id, title: iniTitle(id) }).catch(() => null);
|
|
708
712
|
if (!res || !res.ok || !res.program) { toast((res && res.error) || 'The program was not made. Try again.'); return; }
|
|
709
713
|
toast('Now a program · ' + iniTitle(id) + '.');
|
|
710
714
|
await load(); goProgram(res.program.id);
|
|
@@ -719,6 +723,20 @@ function moveItems(id, openList) {
|
|
|
719
723
|
stateOf: (p) => (((S.M && S.M.groups) || []).find((g) => g.kind === 'program' && g.program.id === p.id) || {}).st || null,
|
|
720
724
|
reload: async () => { await load(); if (S.ini === id && VW.isOpen()) iniPage(); } });
|
|
721
725
|
}
|
|
726
|
+
/** Split or merge (pm/split-merge.js; canvas XsmA1Menu, XsmA1Suggest): the context of one initiative on Home. Only this board's rows: a
|
|
727
|
+
* merge stays on one board. After the write Home reads again and opens the one the PM lands on. openList is home-ini.js's menu. */
|
|
728
|
+
function smCtx(id, openList) {
|
|
729
|
+
const row = iniRowOf(id) || { id }, B = S.D.board || {}, ws = row.ws || (B.board || {}).ws || '';
|
|
730
|
+
return { row, rows: () => H.boardRows(S.D), ws, board: row.boardId || (B.board || {}).id || '', product: H.productName(S.D), program: programOf(S.D.programs || [], ws, id), pmPost,
|
|
731
|
+
say: (m, undo) => (undo ? toastUndo(m, undo) : toast(m)), openList: openList || (() => {}),
|
|
732
|
+
reload: async () => { await load(); if (S.ini && VW.isOpen()) iniPage(); },
|
|
733
|
+
openIni: async (to) => { for (let i = 0; i < 8 && !iniRowOf(to); i++) { await new Promise((ok) => setTimeout(ok, 900)); await load(); } if (iniRowOf(to)) goIni(to); } };
|
|
734
|
+
}
|
|
735
|
+
function smItems(id, openList) {
|
|
736
|
+
const B = S.D.board || {};
|
|
737
|
+
if ((B.board || {}).self || otherIni(id)) return [];
|
|
738
|
+
return SM.menuItems(smCtx(id, openList));
|
|
739
|
+
}
|
|
722
740
|
/** A program's conversation (?ask=program:<id>, a program task's row): Claude with the program as its scope. task names the open row. */
|
|
723
741
|
function programTarget(id, task) {
|
|
724
742
|
const pr = (S.D.programs || []).find((p) => p && p.id === id) || { id, title: (P.get('label') || '').slice(0, 80) || id };
|
|
@@ -883,14 +901,13 @@ function openReviewVw() {
|
|
|
883
901
|
},
|
|
884
902
|
}));
|
|
885
903
|
}
|
|
886
|
-
/* New → A task: the PM names the initiative first. An initiative's task is added in its Tasks
|
|
904
|
+
/* New → A task: the PM names the initiative first. An initiative's task is added in its page's Tasks field, the cursor in it (XtaA4NewTask);
|
|
887
905
|
* "Not in an initiative" opens the capture box in the list, on the PM's own list (POST /api/pm-items/add). The box is not on Home otherwise. */
|
|
888
906
|
async function addTaskIn(id) {
|
|
889
907
|
if (!id) { S.cap = true; drawList(); const i = $('#hmCap'); if (i) i.focus(); return; }
|
|
890
908
|
await goIni(id);
|
|
891
909
|
if (S.ini !== id) return;
|
|
892
|
-
|
|
893
|
-
setTimeout(() => { const n = document.querySelector('#czViewer #ovTask'); if (n) n.focus(); }, 0);
|
|
910
|
+
iniAddTask();
|
|
894
911
|
}
|
|
895
912
|
async function capture(text) {
|
|
896
913
|
const line = String(text || '').trim(); if (!line) return false;
|
|
@@ -1513,7 +1530,7 @@ function cta() {
|
|
|
1513
1530
|
mountIni({ S, VW, pmGet, pmPost, toast, rowOf: (id) => iniRowOf(id), renameIni: (id, pre) => iniRenameOf(id, pre), renameTask: (t) => taskRenameOf(t), load: () => load(), loadIni: () => loadIni(), openFile: (f) => openFile(f), iniTitle: (id) => iniTitle(id), drawList: () => drawList(), wait: MORE.WAIT,
|
|
1514
1531
|
// the initiative's page (HbCDesk): its card, its header and its ⋯
|
|
1515
1532
|
openBoardTask: (t) => openBoardTask(t),
|
|
1516
|
-
cardHtml: (id, o) => cardHtml(id, o), kindOf: (id) => kindOf(id), cta: () => cta(), overviewAsk: (id) => overviewAsk(id), newIn: (id) => newIn(id), addPerson: () => addPerson(), turnProgram: (id) => turnProgram(id), moveItems: (id, openList) => moveItems(id, openList), talk: () => talk(), view: (id) => iniViewOf(id), head: (id) => (S.H = headOf(id)), goProgram: (id) => goProgram(id),
|
|
1533
|
+
cardHtml: (id, o) => cardHtml(id, o), kindOf: (id) => kindOf(id), cta: () => cta(), overviewAsk: (id) => overviewAsk(id), newIn: (id) => newIn(id), addPerson: () => addPerson(), turnProgram: (id) => turnProgram(id), moveItems: (id, openList) => moveItems(id, openList), smItems: (id, openList) => smItems(id, openList), smPress: (id, act) => SM.press(smCtx(id), act), goIni: (id) => goIni(id), talk: () => talk(), view: (id) => iniViewOf(id), head: (id) => (S.H = headOf(id)), goProgram: (id) => goProgram(id),
|
|
1517
1534
|
foldCard: () => { S.cardFold = !S.cardFold; store.set('pmos.home.cardfold', S.cardFold ? '1' : null); } });
|
|
1518
1535
|
/* The program panel in Home's Viewer (HbCProg): Home's board model and programs; an initiative of it opens here, with ← back to the program.
|
|
1519
1536
|
* Read on the first program press, never at start: the panel's modules load premium-shell.js, whose start reads ?session= for the old dialog. */
|