create-pmos 0.444.0 → 0.445.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 +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/adler-moments-test.js +8 -0
- package/workspace/adler-seasons-art-test.js +3 -0
- package/workspace/board-columns-test.js +168 -0
- package/workspace/board-programs-test.js +1 -1
- package/workspace/briefing-premium-board-test.js +83 -6
- package/workspace/briefing-premium-insights-test.js +43 -0
- package/workspace/calm-timeline-test.js +3 -1
- package/workspace/changelog.json +12 -0
- package/workspace/guide/jira.md +13 -1
- package/workspace/guide/ready-made-dashboards.md +2 -2
- package/workspace/lib/board-fold.js +33 -5
- package/workspace/lib/console-state.js +5 -1
- package/workspace/lib/factory-join.js +46 -14
- package/workspace/lib/freshness.js +14 -1
- package/workspace/lib/initiative-rows.js +38 -4
- package/workspace/lib/issues.js +8 -1
- package/workspace/lib/jira-cli.js +18 -2
- package/workspace/lib/jira-moves.js +119 -0
- package/workspace/lib/jira-tickets.js +23 -4
- package/workspace/lib/notes.js +4 -2
- package/workspace/lib/offloop.js +75 -29
- package/workspace/lib/page-build.js +97 -0
- package/workspace/lib/plan-items.js +24 -3
- package/workspace/lib/plan-tree.js +62 -9
- package/workspace/lib/ready-reports.js +22 -8
- package/workspace/lib/refresh.js +14 -2
- package/workspace/lib/routes-board-premium.js +9 -1
- package/workspace/lib/routes-boards.js +74 -15
- package/workspace/lib/routes-brief-page.js +3 -1
- package/workspace/lib/routes-calendar-import.js +13 -1
- package/workspace/lib/routes-ready-reports.js +28 -5
- package/workspace/lib/task-links.js +12 -1
- package/workspace/lib/workflows-store.js +14 -3
- package/workspace/milestone-pins-test.js +1 -1
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/panels-test.js +150 -6
- package/workspace/program-panel-test.js +6 -6
- package/workspace/public/pm/bd-cols.js +149 -0
- package/workspace/public/pm/bd-pane.js +41 -0
- package/workspace/public/pm/bd-span.js +29 -11
- package/workspace/public/pm/cozy-board.css +45 -0
- package/workspace/public/pm/cozy-insights.css +8 -0
- package/workspace/public/pm/cozy-live-pill.css +1 -0
- package/workspace/public/pm/cozy-live-pill.js +10 -1
- package/workspace/public/pm/cozy-panels.css +24 -3
- package/workspace/public/pm/cozy-panels.js +275 -108
- package/workspace/public/pm/cozy-viewer.js +3 -1
- package/workspace/public/pm/dash-view.js +5 -2
- package/workspace/public/pm/home-app.js +8 -8
- package/workspace/public/pm/ini-edit.js +5 -1
- package/workspace/public/pm/ini-tasks.js +134 -29
- package/workspace/public/pm/ini-view-model.js +4 -3
- package/workspace/public/pm/ini-view.css +74 -25
- package/workspace/public/pm/ini-view.js +4 -4
- package/workspace/public/pm/ini-wf-model.js +9 -0
- package/workspace/public/pm/ini-wf.js +14 -9
- package/workspace/public/pm/ins-pane.js +55 -0
- package/workspace/public/pm/jira-move.js +50 -0
- package/workspace/public/pm/live-model.js +3 -2
- package/workspace/public/pm/pn-narrow.js +76 -0
- package/workspace/public/pm/premium-board.js +77 -26
- package/workspace/public/pm/premium-insights.js +7 -1
- package/workspace/public/premium-board.html +2 -0
- package/workspace/ready-dash-ui-test.js +4 -4
- package/workspace/server.js +71 -20
- package/workspace/skills/jira-move.skill +35 -0
- package/workspace/stage-card-tasks-test.js +1 -0
- package/workspace/task-links-test.js +1 -0
- package/workspace/task-plans-test.js +1 -1
- package/workspace/task-views-test.js +161 -12
- package/workspace/test-lists/board-columns.json +5 -0
- package/workspace/test-lists/jira-moves.json +11 -0
- package/workspace/test-lists/page-speed-fold.json +5 -0
- package/workspace/test-lists/page-speed-reads.json +5 -0
- package/workspace/timeline-holds-test.js +1 -1
package/workspace/panels-test.js
CHANGED
|
@@ -8,12 +8,18 @@
|
|
|
8
8
|
* N3 a drag of the divider to the left edge slides the chat away: the Viewer is whole and the list folds to a rail
|
|
9
9
|
* N4 ⧉ opens Full screen, Split, Slide over (44 px icons, the current one checked); Split brings the chat back beside
|
|
10
10
|
* N5 Slide over floats the chat over the right side (400 px, a grab bar); a drag off the right edge puts it away; slideOver() brings it back
|
|
11
|
-
* N6 a list row dragged to the right
|
|
11
|
+
* N6 a list row dragged to the far right edge shows the blue drop zone; on the drop it opens in a Viewer of its own beside (TbT6TwoViewers):
|
|
12
12
|
* two Viewers side by side at 1440, the chat slides over; a third replaces the Viewer used least recently
|
|
13
13
|
* N7 at 1920 the chat and two Viewers sit side by side with two dividers (TbT8Wide)
|
|
14
14
|
* N8 the initiative reopens with its last panels (the chat put away is remembered across a reload)
|
|
15
15
|
* N9 Present in a recording slides the chat away; Stop brings it back
|
|
16
16
|
* N10 a phone keeps today's one panel: no divider, no ⧉; dark uses the tokens; no page error anywhere
|
|
17
|
+
* Board and Intelligence (panels on Board and Intelligence, P-A; canvas BiB1Split … BiB9DropOn, BiI1Split … BiI4Wide): the page is the first panel
|
|
18
|
+
* P1 a row opens a split (no float), the Viewer no wider than fit() leaves; ⧉ in place of ⤢ P2 the snap at ½ makes the page narrow
|
|
19
|
+
* (cz-pn-narrow); only the share is kept P3 ⧉ Slide over, put away, the Live pill brings it back P4 ⌘/Ctrl-click opens beside (slides
|
|
20
|
+
* over at 1440), the active edge, a plain click replaces the Viewer used last P5 a drop on a Viewer replaces it P6 the divider to the
|
|
21
|
+
* left edge: full screen; Split brings the page back; to the right edge: the Viewer closes P7 a reload reopens nothing; the share holds;
|
|
22
|
+
* Home resets it P8 1920: a drop at the far edge opens beside, three panels P9 Intelligence: split, ⌘-click P10 a phone as today
|
|
17
23
|
* Screenshots go to PMOS_SHOTS when it is set. Every wait polls the page. */
|
|
18
24
|
const fs = require('fs');
|
|
19
25
|
const path = require('path');
|
|
@@ -24,6 +30,8 @@ const B = require('./lib/briefing-premium.js');
|
|
|
24
30
|
const F = require('./fixtures/briefing-premium-facts.js');
|
|
25
31
|
const BP = require('./lib/board-premium.js');
|
|
26
32
|
const BF = require('./fixtures/board-premium-facts.js');
|
|
33
|
+
const IP = require('./lib/insights-premium.js');
|
|
34
|
+
const IF = require('./fixtures/insights-premium-facts.js');
|
|
27
35
|
|
|
28
36
|
const BASE = T.BASE;
|
|
29
37
|
const SHOTS = process.env.PMOS_SHOTS || '';
|
|
@@ -51,7 +59,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
|
51
59
|
await T.waitForServer(BASE);
|
|
52
60
|
browser = await chromium.launch({ executablePath: exe });
|
|
53
61
|
|
|
54
|
-
const open = async ({ w = 1440, h = 900, dark = false, ctx = null, q = '' } = {}) => {
|
|
62
|
+
const open = async ({ w = 1440, h = 900, dark = false, ctx = null, q = '', at = '/premium.html', ready = () => !!window.czPanels && document.querySelectorAll('#hmList .hv-r.ini .hm-rm').length > 2 } = {}) => {
|
|
55
63
|
ctx = ctx || await browser.newContext({ viewport: { width: w, height: h }, colorScheme: dark ? 'dark' : 'light' });
|
|
56
64
|
const page = await ctx.newPage();
|
|
57
65
|
const errors = [];
|
|
@@ -60,8 +68,10 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
|
60
68
|
await page.route(/\/api\/board-premium(\?.*)?$/, (r) => { const ws = new URL(r.request().url()).searchParams.get('ws') || 'idpf'; return json(r, { ok: true, state: 'ready', model: BP.build(BF.programFacts(ws)), as_of: Date.now() }); });
|
|
61
69
|
await page.route(/\/api\/briefing-premium(\?.*)?$/, (r) => json(r, { ok: true, state: 'ready', model: B.buildMany(F.programFacts()), as_of: Date.now() }));
|
|
62
70
|
await page.route('**/api/programs', (r) => json(r, { ok: true, programs: F.programs() }));
|
|
63
|
-
await page.
|
|
64
|
-
|
|
71
|
+
await page.route('**/api/insights-premium*', (r) => json(r, { ok: true, state: 'ready', model: IP.build(IF.facts({ pinned: 'all' })), as_of: 1 }));
|
|
72
|
+
await page.route('**/api/board-metrics-premium*', (r) => json(r, { ok: true, state: 'ready', model: { tiles: [] } }));
|
|
73
|
+
await page.goto(BASE + at + q);
|
|
74
|
+
const up = await until(() => page.evaluate(ready), 20000);
|
|
65
75
|
const close = async () => { await ctx.unrouteAll({ behavior: 'ignoreErrors' }).catch(() => {}); await ctx.close().catch(() => {}); };
|
|
66
76
|
return { ctx, page, errors, up, close };
|
|
67
77
|
};
|
|
@@ -153,11 +163,16 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
|
153
163
|
let zone = null;
|
|
154
164
|
await A.page.click('#czViewer .cz-vw-hd'); // the Viewer is the panel used last: the chat gives way
|
|
155
165
|
await drag(A.page, `#hmList .hm-rm[data-hm-sel="${R[1]}"]`, v0r.r - 60, 450, { hold: async () => { zone = await A.page.evaluate(() => { const z = document.querySelector('.cz-pn-drop:not([hidden])'); if (!z) return null; const r = z.getBoundingClientRect(); return { side: z.dataset.side, l: Math.round(r.left), w: Math.round(r.width), bg: getComputedStyle(z).backgroundColor }; }); await shot(A.page, 'n6-drag-1440'); } });
|
|
156
|
-
ok('N6 dragging a row
|
|
166
|
+
ok('N6 dragging a row to the far right edge shows the blue drop zone there (open beside)', !!zone && zone.side === 'right' && zone.w >= 100 && zone.l + zone.w >= v0r.r - 2, JSON.stringify(zone));
|
|
157
167
|
const l6 = await until(() => lay(A.page).then((l) => (P(l, 'v1') && P(l, 'v1').box.shown && P(l, 'v0').box.shown ? l : null)), 6000);
|
|
158
168
|
ok('N6 on the drop the row opens in a second Viewer on the right; at 1440 the two Viewers sit side by side and the chat slides over', !!l6 && P(l6, 'v1').box.l > P(l6, 'v0').box.l && P(l6, 'chat').mode === 'over' && l6.divs.length === 1, JSON.stringify(l6));
|
|
159
169
|
const t6 = await A.page.evaluate(() => [...document.querySelectorAll('.cz-vw:not([hidden]) .cz-vw-title')].map((h) => h.textContent));
|
|
160
170
|
ok('N6 each Viewer shows its own item; czViewer.current() is the one opened last', t6.length === 2 && t6[0] !== t6[1] && await A.page.evaluate((t) => window.czViewer.current().title === t, t6[1]), JSON.stringify(t6));
|
|
171
|
+
const act6 = await A.page.evaluate(() => [...document.querySelectorAll('.cz-vw:not([hidden])')].map((v) => ({ id: v.id, on: v.classList.contains('cz-pn-active'), sh: getComputedStyle(v).boxShadow })));
|
|
172
|
+
ok('N6 with two Viewers the one a plain click replaces (used last) has the thin blue edge; the other has none', act6.length === 2 && act6.filter((v) => v.on).length === 1 && act6.find((v) => v.on).id === 'czViewer2' && /2px/.test(act6.find((v) => v.on).sh), JSON.stringify(act6));
|
|
173
|
+
{ const r = await A.page.evaluate(() => { const b = document.querySelector('#czViewer .cz-vw-body').getBoundingClientRect(); return { x: b.left + 60, y: b.top + 80 }; }); await A.page.mouse.move(r.x, r.y); await A.page.mouse.wheel(0, 40); }
|
|
174
|
+
ok('N6 a scroll in the other Viewer moves the edge to it', !!(await until(() => A.page.evaluate(() => document.querySelector('#czViewer').classList.contains('cz-pn-active') && !document.querySelector('#czViewer2').classList.contains('cz-pn-active')), 3000)));
|
|
175
|
+
await A.page.click('#czViewer2 .cz-vw-hd', { position: { x: 30, y: 20 } });
|
|
161
176
|
await shot(A.page, 'n6-two-viewers-1440');
|
|
162
177
|
// a third row: it replaces the Viewer used least recently (v0, as v1 was used last)
|
|
163
178
|
await A.page.click('#czViewer2 .cz-vw-hd', { position: { x: 30, y: 20 } });
|
|
@@ -167,7 +182,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
|
167
182
|
const v1r = (await lay(A.page)).panels.find((p) => p.id === 'v1').box;
|
|
168
183
|
await drag(A.page, `#hmList .hm-rm[data-hm-sel="${R[2]}"]`, v1r.r - 60, 450);
|
|
169
184
|
const l6c = await until(() => lay(A.page).then((l) => { const t = l.panels.filter((p) => p.kind === 'viewer' && p.box.shown); return t.length === 2 && t.some((p) => p.title !== t6[0] && p.title !== t6[1]) ? l : null; }), 6000);
|
|
170
|
-
const t6c = l6c ? l6c.panels.filter((p) => p.kind === 'viewer').map((p) => p.title) : [];
|
|
185
|
+
const t6c = l6c ? l6c.panels.filter((p) => p.kind === 'viewer' && p.box.shown).map((p) => p.title) : []; // the one giving way closes a moment later
|
|
171
186
|
ok('N6 a third Viewer at 1440 replaces the one used least recently (still two side by side)', !!l6c && !t6c.includes(t6[0]) && t6c.includes(t6[1]), JSON.stringify([t6c, await lay(A.page)]));
|
|
172
187
|
ok('0 no page error at 1440', A.errors.length === 0, A.errors.join(' | '));
|
|
173
188
|
await A.close();
|
|
@@ -227,5 +242,134 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
|
227
242
|
await shot(Dk.page, 'n10-dark-1440');
|
|
228
243
|
ok('0 no page error in dark', Dk.errors.length === 0, Dk.errors.join(' | '));
|
|
229
244
|
await Dk.close();
|
|
245
|
+
|
|
246
|
+
/* ── Board and Intelligence: the page is the first panel (BiB1Split … BiB9DropOn, BiI1Split … BiI4Wide) ── */
|
|
247
|
+
const boardReady = () => !!window.czPanels && document.querySelectorAll('.ini2[data-key]:not(.bd-bc)').length > 2;
|
|
248
|
+
const pl = (page) => page.evaluate(() => {
|
|
249
|
+
const box = (el) => { if (!el) return null; const r = el.getBoundingClientRect(); return { l: Math.round(r.left), r: Math.round(r.right), w: Math.round(r.width), shown: r.width > 0 && getComputedStyle(el).display !== 'none' }; };
|
|
250
|
+
const P = window.czPanels.list(), pg = document.getElementById('stage');
|
|
251
|
+
return {
|
|
252
|
+
panels: P.map((p) => ({ ...p, box: box(p.id === 'page' ? pg : document.querySelector(`[data-cz-panel="${p.id}"]`)) })),
|
|
253
|
+
divs: [...document.querySelectorAll('.cz-pn-div')].map((d) => ({ ...box(d), first: d.dataset.k === '0', sprout: !!d.querySelector('.cz-dv-top') })),
|
|
254
|
+
narrow: pg.classList.contains('cz-pn-narrow'), float: !!document.querySelector('.cz-vw.cz-vw-float'),
|
|
255
|
+
active: [...document.querySelectorAll('.cz-vw.cz-pn-active')].map((v) => v.dataset.czPanel), ww: innerWidth,
|
|
256
|
+
};
|
|
257
|
+
});
|
|
258
|
+
const keys = (page) => page.evaluate(() => [...document.querySelectorAll('.ini2[data-key]:not(.bd-bc)')].map((b) => b.dataset.key));
|
|
259
|
+
const nm = (k) => `.ini2[data-key="${k}"]:not(.bd-bc)`;
|
|
260
|
+
const ctxB = await browser.newContext({ viewport: { width: 1440, height: 900 } });
|
|
261
|
+
const Bd = await open({ ctx: ctxB, at: '/premium-board.html', ready: boardReady });
|
|
262
|
+
ok('P0 the Board draws its rows and window.czPanels; the page is the one panel', !!Bd.up && (await pl(Bd.page)).panels.map((p) => p.id + ':' + p.mode).join() === 'page:split');
|
|
263
|
+
const K = await keys(Bd.page);
|
|
264
|
+
await Bd.page.click(nm(K[0]));
|
|
265
|
+
const b1 = await until(() => pl(Bd.page).then((l) => (P(l, 'v0') && P(l, 'v0').box.shown && l.divs.length === 1 ? l : null)));
|
|
266
|
+
ok('P1 a row opens a split: the page, one divider with the sprout, the Viewer; nothing floats over the page', !!b1 && !b1.float && P(b1, 'page').box.r <= b1.divs[0].l + 12 && b1.divs[0].r <= P(b1, 'v0').box.l + 12 && b1.divs[0].sprout, JSON.stringify(b1));
|
|
267
|
+
ok('P1 the Viewer opens no wider than leaves the page its view whole (fit 880 at 1440: the Viewer 506 px, under 560); the page is not narrow', !!b1 && P(b1, 'page').box.w >= 878 && Math.abs(P(b1, 'v0').box.w - 506) <= 4 && !b1.narrow, JSON.stringify(b1 && [P(b1, 'page').box, P(b1, 'v0').box]));
|
|
268
|
+
const bh = await Bd.page.evaluate(() => [...document.querySelectorAll('#czViewer .cz-vw-hd [data-cz-vw]')].map((b) => b.dataset.czVw));
|
|
269
|
+
ok('P1 ⧉ before × on the Viewer\'s header, in place of ⤢', bh.slice(-2).join() === 'place,close' && !bh.includes('wide'), JSON.stringify(bh));
|
|
270
|
+
await shot(Bd.page, 'p1-board-split-1440');
|
|
271
|
+
// the divider near the middle snaps at ½: the page goes to its narrow form; only the share is kept
|
|
272
|
+
{ const d = await divAt(Bd.page); await drag(Bd.page, d, (16 + 1424) / 2 + 8, d.y); }
|
|
273
|
+
const b2 = await until(() => pl(Bd.page).then((l) => (Math.abs(P(l, 'page').box.w - P(l, 'v0').box.w) <= 4 ? l : null)), 3000);
|
|
274
|
+
const keptB = await Bd.page.evaluate(() => { try { return JSON.parse(localStorage.getItem('cz-pn:board')); } catch { return null; } });
|
|
275
|
+
ok('P2 a drag near the middle snaps the divider at ½; the page panel is narrower than fit() and gets cz-pn-narrow', !!b2 && b2.narrow, JSON.stringify(b2 && [P(b2, 'page').box, P(b2, 'v0').box, b2.narrow]));
|
|
276
|
+
ok('P2 only the divider share is kept (cz-pn:board), not the kind\'s width', !!keptB && keptB.v === 2 && Math.abs(keptB.share - 0.5) < 0.02 && !Object.keys(await Bd.page.evaluate(() => ({ ...localStorage }))).some((k) => /^cz-vw-w:/.test(k)), JSON.stringify(keptB));
|
|
277
|
+
await shot(Bd.page, 'p2-board-half-1440');
|
|
278
|
+
// ⧉: slide over floats the Viewer over the whole page; a drag off the right edge puts it away; the Live pill brings it back
|
|
279
|
+
await Bd.page.click('#czViewer [data-cz-vw="place"]');
|
|
280
|
+
await until(() => Bd.page.$('.cz-pn-menu'));
|
|
281
|
+
const m3 = await Bd.page.evaluate(() => [...document.querySelectorAll('.cz-pn-menu button')].map((b) => b.getAttribute('aria-label') + (b.getAttribute('aria-checked') === 'true' ? '*' : '')).join('|'));
|
|
282
|
+
ok('P3 ⧉ opens Full screen, Split, Slide over; Split is checked', m3 === 'Full screen|Split*|Slide over', m3);
|
|
283
|
+
await Bd.page.click('.cz-pn-menu [data-cz-pn-place="over"]');
|
|
284
|
+
const b3 = await until(() => pl(Bd.page).then((l) => (P(l, 'v0').mode === 'over' ? l : null)), 3000);
|
|
285
|
+
ok('P3 Slide over: the Viewer floats 560 px at the right with a grab bar; the page is whole again, with no divider', !!b3 && P(b3, 'v0').box.w === 560 && P(b3, 'page').box.w > 1300 && b3.divs.length === 0 && !b3.narrow
|
|
286
|
+
&& await Bd.page.evaluate(() => !!document.querySelector('#czViewer.cz-pn-over > .cz-pn-grab')), JSON.stringify(b3));
|
|
287
|
+
await shot(Bd.page, 'p3-board-over-1440');
|
|
288
|
+
{ const g = await Bd.page.evaluate(() => { const r = document.querySelector('#czViewer > .cz-pn-grab').getBoundingClientRect(); return { x: r.left + r.width / 2, y: r.top + r.height / 2 }; }); await drag(Bd.page, g, g.x + 200, g.y); }
|
|
289
|
+
const b3b = await until(() => pl(Bd.page).then((l) => (P(l, 'v0').mode === 'away' && !P(l, 'v0').box.shown ? l : null)), 3000);
|
|
290
|
+
ok('P3 a drag off the right edge puts it away', !!b3b, JSON.stringify(await pl(Bd.page)));
|
|
291
|
+
await Bd.page.click('#czLive');
|
|
292
|
+
const lvRow = await until(() => Bd.page.$('#czLiveList a[data-lv="pn:v0"]'), 3000);
|
|
293
|
+
ok('P3 the Live pill lists the Viewer put away', !!lvRow);
|
|
294
|
+
if (lvRow) await Bd.page.click('#czLiveList a[data-lv="pn:v0"]');
|
|
295
|
+
ok('P3 its row brings it back over', !!(await until(() => pl(Bd.page).then((l) => (P(l, 'v0').mode === 'over' && P(l, 'v0').box.shown ? l : null)), 3000)));
|
|
296
|
+
await Bd.page.evaluate(() => window.czPanels.place('v0', 'split'));
|
|
297
|
+
await until(() => pl(Bd.page).then((l) => (l.divs.length === 1 ? l : null)), 3000);
|
|
298
|
+
// ⌘/Ctrl-click: on a laptop the second item slides over; the edge marks the active one; a press in the other moves it
|
|
299
|
+
await Bd.page.click(nm(K[1]), { modifiers: ['Control'] });
|
|
300
|
+
const b4 = await until(() => pl(Bd.page).then((l) => (P(l, 'v1') && P(l, 'v1').box.shown ? l : null)), 4000);
|
|
301
|
+
ok('P4 ⌘/Ctrl-click on a row opens it beside: at 1440 it slides over, the split under it stays', !!b4 && P(b4, 'v1').mode === 'over' && P(b4, 'v0').mode === 'split' && P(b4, 'v0').box.shown, JSON.stringify(b4));
|
|
302
|
+
ok('P4 two Viewers: the one a plain click replaces has the blue edge', !!b4 && b4.active.join() === 'v1', JSON.stringify(b4 && b4.active));
|
|
303
|
+
await Bd.page.evaluate(() => window.czPanels.putAway());
|
|
304
|
+
await Bd.page.click('#czViewer .cz-vw-body', { position: { x: 30, y: 30 } }).catch(() => {});
|
|
305
|
+
await Bd.page.click(nm(K[2]));
|
|
306
|
+
const b4b = await until(() => Bd.page.evaluate(() => document.querySelector('#czViewer .cz-vw-title').textContent), 3000);
|
|
307
|
+
ok('P4 a plain click replaces the Viewer used last', !!b4b && (await Bd.page.evaluate(() => window.czViewer.current().title)) === b4b, b4b);
|
|
308
|
+
// a drop on a Viewer replaces that Viewer
|
|
309
|
+
const v0b = (await pl(Bd.page)).panels.find((p) => p.id === 'v0').box;
|
|
310
|
+
let z5 = null;
|
|
311
|
+
const t0 = await Bd.page.evaluate(() => document.querySelector('#czViewer .cz-vw-title').textContent);
|
|
312
|
+
await drag(Bd.page, nm(K[0]), v0b.l + 120, 400, { hold: async () => { z5 = await Bd.page.evaluate(() => { const z = document.querySelector('.cz-pn-drop:not([hidden])'); if (!z) return null; const r = z.getBoundingClientRect(); return { on: z.dataset.on, l: Math.round(r.left), w: Math.round(r.width) }; }); await shot(Bd.page, 'p5-board-drop-on-1440'); } });
|
|
313
|
+
ok('P5 a row dragged onto a Viewer turns that Viewer blue (the zone is its box)', !!z5 && z5.on === 'v0' && Math.abs(z5.l - v0b.l) <= 2 && Math.abs(z5.w - v0b.w) <= 2, JSON.stringify([z5, v0b]));
|
|
314
|
+
const b5 = await until(() => Bd.page.evaluate((t) => { const x = document.querySelector('#czViewer .cz-vw-title').textContent; return x !== t ? x : null; }, t0), 4000);
|
|
315
|
+
ok('P5 the drop replaces that Viewer; no new panel opens', !!b5 && (await pl(Bd.page)).panels.filter((p) => p.kind === 'viewer' && p.box.shown).length === 1, JSON.stringify([t0, b5]));
|
|
316
|
+
// to the right edge the divider closes the Viewer; to the left edge the Viewer takes the screen, and the page never closes
|
|
317
|
+
{ const d = await divAt(Bd.page); await drag(Bd.page, d, 16 + 30, d.y); }
|
|
318
|
+
const b6 = await until(() => pl(Bd.page).then((l) => (P(l, 'v0').full ? l : null)), 3000);
|
|
319
|
+
ok('P6 a drag of the divider to the left edge makes the Viewer full screen; the page is hidden, not closed', !!b6 && P(b6, 'v0').box.w > 1300 && !P(b6, 'page').box.shown && b6.panels.some((p) => p.id === 'page'), JSON.stringify(b6));
|
|
320
|
+
await Bd.page.evaluate(() => window.czPanels.place('v0', 'split'));
|
|
321
|
+
const b6b = await until(() => pl(Bd.page).then((l) => (P(l, 'page').box.shown && l.divs.length === 1 ? l : null)), 3000);
|
|
322
|
+
ok('P6 Split brings the page back first', !!b6b && P(b6b, 'page').box.l < P(b6b, 'v0').box.l, JSON.stringify(b6b));
|
|
323
|
+
{ const d = await divAt(Bd.page); await drag(Bd.page, d, 1440 - 30, d.y); }
|
|
324
|
+
const b6c = await until(() => pl(Bd.page).then((l) => (!l.panels.some((p) => p.kind === 'viewer') ? l : null)), 3000);
|
|
325
|
+
ok('P6 a drag to the right edge closes the Viewer; the page is whole', !!b6c && P(b6c, 'page').box.w > 1300 && b6c.divs.length === 0, JSON.stringify(b6c || await pl(Bd.page)));
|
|
326
|
+
ok('0 no page error on the Board', Bd.errors.length === 0, Bd.errors.join(' | '));
|
|
327
|
+
await Bd.page.close();
|
|
328
|
+
// a reload opens nothing by itself; the next Viewer opens at the kept share
|
|
329
|
+
const Bd2 = await open({ ctx: ctxB, at: '/premium-board.html', ready: boardReady });
|
|
330
|
+
await sleep(600);
|
|
331
|
+
ok('P7 after a reload no Viewer reopens by itself', (await pl(Bd2.page)).panels.length === 1);
|
|
332
|
+
await Bd2.page.click(nm(K[0]));
|
|
333
|
+
const b7 = await until(() => pl(Bd2.page).then((l) => (P(l, 'v0') && P(l, 'v0').box.shown ? l : null)), 4000);
|
|
334
|
+
ok('P7 the next Viewer opens at the kept share (½)', !!b7 && Math.abs(P(b7, 'page').box.w - P(b7, 'v0').box.w) <= 4, JSON.stringify(b7));
|
|
335
|
+
await Bd2.page.focus('.cz-pn-div'); await Bd2.page.keyboard.press('Home');
|
|
336
|
+
const b7b = await until(() => Bd2.page.evaluate(() => { try { return JSON.parse(localStorage.getItem('cz-pn:board')); } catch { return null; } }), 2000);
|
|
337
|
+
ok('P7 Home on the divider resets it to ½', !!b7b && Math.abs(b7b.share - 0.5) < 0.01, JSON.stringify(b7b));
|
|
338
|
+
await Bd2.close();
|
|
339
|
+
// 1920: the page and two Viewers side by side; a drop at the far edge opens beside
|
|
340
|
+
const Bw = await open({ w: 1920, h: 1080, at: '/premium-board.html', ready: boardReady });
|
|
341
|
+
await Bw.page.click(nm(K[0]));
|
|
342
|
+
await until(() => pl(Bw.page).then((l) => (P(l, 'v0') && P(l, 'v0').box.shown ? l : null)));
|
|
343
|
+
let z8 = null;
|
|
344
|
+
await drag(Bw.page, nm(K[1]), 1920 - 40, 500, { hold: async () => { z8 = await Bw.page.evaluate(() => { const z = document.querySelector('.cz-pn-drop:not([hidden])'); return z ? z.dataset.side : null; }); } });
|
|
345
|
+
const b8 = await until(() => pl(Bw.page).then((l) => (P(l, 'v1') && P(l, 'v1').box.shown && l.divs.length === 2 ? l : null)), 5000);
|
|
346
|
+
ok('P8 at 1920 a drop at the far edge opens beside: the page and two Viewers, two dividers, the sprout on the first only', z8 === 'right' && !!b8 && P(b8, 'page').box.r < P(b8, 'v0').box.l && P(b8, 'v0').box.r < P(b8, 'v1').box.l && b8.divs.filter((d) => d.sprout).length === 1, JSON.stringify([z8, b8 || await pl(Bw.page)]));
|
|
347
|
+
ok('P8 the edge marks the Viewer opened last', !!b8 && b8.active.join() === 'v1', JSON.stringify(b8 && b8.active));
|
|
348
|
+
await shot(Bw.page, 'p8-board-three-1920');
|
|
349
|
+
ok('0 no page error on the Board at 1920', Bw.errors.length === 0, Bw.errors.join(' | '));
|
|
350
|
+
await Bw.close();
|
|
351
|
+
// Intelligence: a goal row opens a split; ⌘-click opens beside
|
|
352
|
+
const In = await open({ at: '/premium-intelligence.html', ready: () => !!window.czPanels && document.querySelectorAll('#goalTbl .ins-row[data-goal]').length > 1 });
|
|
353
|
+
ok('P9 Intelligence draws its goal rows and window.czPanels', !!In.up);
|
|
354
|
+
const G = await In.page.evaluate(() => [...document.querySelectorAll('#goalTbl .ins-row[data-goal]')].map((r) => r.dataset.goal));
|
|
355
|
+
await In.page.click(`#goalTbl .ins-row[data-goal="${G[0]}"]`);
|
|
356
|
+
const i1 = await until(() => pl(In.page).then((l) => (P(l, 'v0') && P(l, 'v0').box.shown && l.divs.length === 1 ? l : null)), 5000);
|
|
357
|
+
ok('P9 a goal opens a split on Intelligence: the page keeps 880 px, nothing floats over it', !!i1 && !i1.float && P(i1, 'page').box.w >= 878 && !i1.narrow, JSON.stringify(i1));
|
|
358
|
+
await shot(In.page, 'p9-intel-split-1440');
|
|
359
|
+
await In.page.click(`#goalTbl .ins-row[data-goal="${G[1]}"]`, { modifiers: ['Control'] });
|
|
360
|
+
const i2 = await until(() => pl(In.page).then((l) => (P(l, 'v1') && P(l, 'v1').box.shown ? l : null)), 4000);
|
|
361
|
+
ok('P9 ⌘/Ctrl-click on a goal row opens it beside (slides over at 1440)', !!i2 && P(i2, 'v1').mode === 'over', JSON.stringify(i2));
|
|
362
|
+
ok('0 no page error on Intelligence', In.errors.length === 0, In.errors.join(' | '));
|
|
363
|
+
await In.close();
|
|
364
|
+
// a phone: the page as today
|
|
365
|
+
for (const [at, ready, row] of [['/premium-board.html', boardReady, '.ini2[data-key]:not(.bd-bc)'], ['/premium-intelligence.html', () => !!window.czPanels && document.querySelectorAll('[data-goal]').length > 1, '#goalCards .ins-card[data-goal]']]) {
|
|
366
|
+
const Q = await open({ w: 390, h: 844, at, ready });
|
|
367
|
+
await Q.page.evaluate((s) => { const b = document.querySelector(s); if (b) b.click(); }, row);
|
|
368
|
+
await until(() => Q.page.evaluate(() => !!document.querySelector('#czViewer:not([hidden])')), 5000);
|
|
369
|
+
const q = await Q.page.evaluate(() => ({ divs: [...document.querySelectorAll('.cz-pn-div')].filter((d) => getComputedStyle(d).display !== 'none').length, place: !!document.querySelector('#czViewer [data-cz-vw="place"]'), narrow: document.getElementById('stage').classList.contains('cz-pn-narrow'), full: Math.round(document.querySelector('#czViewer').getBoundingClientRect().width) === innerWidth, flex: getComputedStyle(document.body).display, side: document.documentElement.scrollWidth <= innerWidth + 1 }));
|
|
370
|
+
ok(`P10 a phone keeps ${at} as today: the Viewer covers the screen, no divider, no ⧉, no cz-pn-narrow, no sideways scroll`, q.divs === 0 && !q.place && !q.narrow && q.full && q.flex !== 'flex' && q.side, JSON.stringify(q));
|
|
371
|
+
ok('0 no page error on a phone ' + at, Q.errors.length === 0, Q.errors.join(' | '));
|
|
372
|
+
await Q.close();
|
|
373
|
+
}
|
|
230
374
|
finish();
|
|
231
375
|
})();
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* P open on ?program=, the shell's header, no chat box · G goals per half, each KR's name and whether it is met · M the track and the
|
|
8
8
|
* Milestones row · W waits on you, in Home · T the initiatives per product, another product read from its board · K every task by level,
|
|
9
9
|
* and the sort card after Turn into a program · F folds kept · O the Board's program row opens it, an initiative opens the Board's
|
|
10
|
-
* initiative in the same shell · X task done and a program check · V
|
|
10
|
+
* initiative in the same shell · X task done and a program check · V opens beside the page, the divider · S full screen on a phone. Per product the
|
|
11
11
|
* KRs (GET /api/boards/anchors), the Insights goals (GET /api/insights-premium) and the PMOS tasks (GET /api/boards/items) answer from
|
|
12
12
|
* fixtures/program-ascent.js. */
|
|
13
13
|
const path = require('path');
|
|
@@ -71,8 +71,8 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
|
71
71
|
await sleep(1500); // the other product's board and the program reads land after the program opened: none of them opens it again
|
|
72
72
|
ok('P ?program=<id> sends bd:program once: one path opens the program', await p.evaluate(() => window.__bdp) === 1, String(await p.evaluate(() => window.__bdp)));
|
|
73
73
|
const hd = await p.evaluate(() => { const v = document.querySelector('#czViewer'); const r = v.getBoundingClientRect(); return { t: v.querySelector('.cz-vw-title').textContent, kind: (v.querySelector('.cz-vw-kind') || {}).textContent, meta: (v.querySelector('.czs-meta') || {}).textContent, tools: [...v.querySelectorAll('.cz-vw-head [data-cz-vw], [data-cz-vw]')].filter((b) => b.closest('#czViewer') && !b.classList.contains('cz-vw-grip')).map((b) => b.getAttribute('aria-label')), input: v.querySelectorAll('.cz-vw-body input, .cz-vw-body textarea').length, tabs: v.querySelectorAll('.pp-tab, [role="tab"]').length, w: Math.round(r.width), right: Math.round(innerWidth - r.right), sel: !!document.querySelector('#ibBody [data-prow="project-ascent"].sel') }; });
|
|
74
|
-
ok('P the shell\'s header names it once ("title · goal"), with Discuss in chat, the Dashboard toggle once the dashboard reads (it took the charter icon\'s place, batch 17 PbH1Header; the charter stays in ⋯ and on the Milestones pencil), ⋯, Open wide and Close; the summary says the owner and the span; there is no chat box and no tab', hd.t === 'Project Ascent · CIAM migration' && hd.kind === 'Program' && hd.meta === 'Wawan · Sep 2026 to Jun 2028' && /^Discuss in chat\|(Show the dashboard\|)?More\|
|
|
75
|
-
ok('V the program
|
|
74
|
+
ok('P the shell\'s header names it once ("title · goal"), with Discuss in chat, the Dashboard toggle once the dashboard reads (it took the charter icon\'s place, batch 17 PbH1Header; the charter stays in ⋯ and on the Milestones pencil), ⋯, ⧉ Arrange (in place of Open wide, panels on Board and Intelligence) and Close; the summary says the owner and the span; there is no chat box and no tab', hd.t === 'Project Ascent · CIAM migration' && hd.kind === 'Program' && hd.meta === 'Wawan · Sep 2026 to Jun 2028' && /^Discuss in chat\|(Show the dashboard\|)?More\|Arrange\|Close the viewer$/.test([...new Set(hd.tools)].join('|')) && hd.input === 0 && hd.tabs === 0, JSON.stringify(hd));
|
|
75
|
+
ok('V the program opens beside the page, at the right edge, no wider than leaves the Board its 880 px (506 at 1440), and its band row on the Board is selected', hd.w === 506 && hd.right < 40 && hd.sel && await p.evaluate(() => !document.querySelector('#czViewer.cz-vw-float') && !!document.querySelector('.cz-pn-div')), JSON.stringify(hd));
|
|
76
76
|
const sm = await p.evaluate(() => ({ line: (document.querySelector('#czViewer .czs-line') || {}).textContent, pri: (document.querySelector('#czViewer .czs-pri') || {}).textContent || '' }));
|
|
77
77
|
ok('P the summary line is the next milestone (Waits on you counts itself in its row, said once); no primary while every task has a level', /^Next: Pilot live/.test(sm.line) && sm.pri === '', JSON.stringify(sm));
|
|
78
78
|
const g = await p.evaluate(() => ({ per: document.querySelector('#czViewer .pp-per').textContent.trim(), krs: [...document.querySelectorAll('#czViewer .pp-goal .pp-kr:not(.ghost) b')].map((b) => b.textContent) }));
|
|
@@ -125,10 +125,10 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
|
125
125
|
await until(() => p.evaluate(() => document.querySelector('#czViewer').hidden));
|
|
126
126
|
await p.click('#ibBody [data-prog="project-ascent"]');
|
|
127
127
|
ok('O the Board\'s program row opens the program (bd:program)', await shown(p));
|
|
128
|
-
await p.focus('
|
|
128
|
+
await p.focus('.cz-pn-div');
|
|
129
129
|
await p.keyboard.press('ArrowLeft');
|
|
130
|
-
const gw = await p.evaluate(() => { const r = document.querySelector('#czViewer').getBoundingClientRect(); let kept = null; try { kept = localStorage.getItem('cz-
|
|
131
|
-
ok('V the
|
|
130
|
+
const gw = await p.evaluate(() => { const r = document.querySelector('#czViewer').getBoundingClientRect(); let kept = null; try { kept = JSON.parse(localStorage.getItem('cz-pn:board')); } catch { /* none */ } return { w: Math.round(r.width), kept }; });
|
|
131
|
+
ok('V the divider beside the page widens it 24 px, and the Board keeps the share (not a width per kind)', gw.w === 530 && !!gw.kept && gw.kept.v === 2, JSON.stringify(gw));
|
|
132
132
|
await p.keyboard.press('Escape');
|
|
133
133
|
ok('P Escape closes the Viewer', await until(() => p.evaluate(() => document.querySelector('#czViewer').hidden)));
|
|
134
134
|
ok('0 no page error on desktop', D.errors.length === 0, D.errors.join(' | '));
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/* pm/bd-cols.js — the columns of the Board's timeline (batch 19 item 5, Board Track; canvas StsA8Board, StsA9BoardDark, sticky stsBoard).
|
|
2
|
+
* · The columns come from the Board List, plus Start and Next milestone. Initiative always shows. On by default: Stage, Status, Start and
|
|
3
|
+
* Next milestone. Off by default: Workflow, Category, Owner, Next step and Jira key. The choice is remembered in this browser
|
|
4
|
+
* (localStorage pmos.board.tlcols), as the view is.
|
|
5
|
+
* · Status is empty on track (zero is silence); at risk an amber dot, late an orange dot, on hold a grey dot. With Status shown, the dot
|
|
6
|
+
* before the name goes (say it once).
|
|
7
|
+
* · Next milestone: ◇, the milestone's name and its date; a missed one is orange with "+Nd". With this column shown, the bar's end has no
|
|
8
|
+
* label (the ◇ keeps its hover). With it off, the bar's end names the milestone as before.
|
|
9
|
+
* · A press on a column title sorts by it, as in the List; the rows otherwise read in time.
|
|
10
|
+
* · On a narrow Board the columns drop from right to left until the timeline keeps MIN_TRACK px. A phone has no columns (StsA3Phone).
|
|
11
|
+
* Pure markup and state; pm/bd-span.js draws with it, pm/premium-board.js wires the menu and the sort. */
|
|
12
|
+
import { esc, store } from './premium-shell.js';
|
|
13
|
+
import { stageOfRow, wfOf, wfIcon, catOfRow, catLabel, CAT_ORDER } from './bd-wf.js';
|
|
14
|
+
import { offTone, md, dy } from './bd-span.js';
|
|
15
|
+
|
|
16
|
+
/** Every column in its place, left to right: key, title, width in px. Initiative takes what the others leave of its 250 px. */
|
|
17
|
+
export const COLS = [
|
|
18
|
+
{ k: 'title', n: 'Initiative', w: 250 },
|
|
19
|
+
{ k: 'stage', n: 'Stage', w: 100 },
|
|
20
|
+
{ k: 'status', n: 'Status', w: 92 },
|
|
21
|
+
{ k: 'start', n: 'Start', w: 72 },
|
|
22
|
+
{ k: 'ms', n: 'Next milestone', w: 210 },
|
|
23
|
+
{ k: 'wf', n: 'Workflow', w: 150 },
|
|
24
|
+
{ k: 'cat', n: 'Category', w: 110 },
|
|
25
|
+
{ k: 'owner', n: 'Owner', w: 130 },
|
|
26
|
+
{ k: 'next', n: 'Next step', w: 220 },
|
|
27
|
+
{ k: 'jira', n: 'Jira key', w: 100 },
|
|
28
|
+
];
|
|
29
|
+
export const DEFAULT = ['stage', 'status', 'start', 'ms'];
|
|
30
|
+
export const KEY = 'pmos.board.tlcols';
|
|
31
|
+
/** The timeline keeps at least this much room beside the columns; below it the last column drops. */
|
|
32
|
+
export const MIN_TRACK = 420;
|
|
33
|
+
const byK = Object.fromEntries(COLS.map((c) => [c.k, c]));
|
|
34
|
+
|
|
35
|
+
/** The columns this person picked, in column order (Initiative first). */
|
|
36
|
+
export function chosen() {
|
|
37
|
+
let v = null; try { v = JSON.parse(store.get(KEY) || 'null'); } catch { v = null; }
|
|
38
|
+
const on = new Set(Array.isArray(v) ? v.filter((k) => byK[k] && k !== 'title') : DEFAULT);
|
|
39
|
+
return COLS.filter((c) => c.k === 'title' || on.has(c.k)).map((c) => c.k);
|
|
40
|
+
}
|
|
41
|
+
export function setOn(k, on) {
|
|
42
|
+
if (!byK[k] || k === 'title') return;
|
|
43
|
+
const s = new Set(chosen().filter((x) => x !== 'title'));
|
|
44
|
+
if (on) s.add(k); else s.delete(k);
|
|
45
|
+
store.set(KEY, JSON.stringify(COLS.filter((c) => s.has(c.k)).map((c) => c.k)));
|
|
46
|
+
}
|
|
47
|
+
/** The columns that fit a Board `width` px wide: the picked ones less the rightmost until the timeline keeps MIN_TRACK. */
|
|
48
|
+
export function fit(keys, width) {
|
|
49
|
+
const out = keys.slice();
|
|
50
|
+
while (out.length > 1 && out.reduce((n, k) => n + byK[k].w, 0) > width - MIN_TRACK) out.pop();
|
|
51
|
+
return out;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
let sortBy = null; // null: in time (the timeline's own order) until a column title is pressed
|
|
55
|
+
export const sorted = () => sortBy;
|
|
56
|
+
export function setSort(k) { sortBy = byK[k] ? k : null; }
|
|
57
|
+
|
|
58
|
+
const midnight = (d) => new Date(d.getFullYear(), d.getMonth(), d.getDate());
|
|
59
|
+
const day = (v) => { const m = /^(\d{4})-(\d{2})-(\d{2})/.exec(String(v || '')); return m ? new Date(+m[1], +m[2] - 1, +m[3]) : null; };
|
|
60
|
+
/** A row's next milestone: the earliest milestone not done (a missed one first, it is the earliest), else the end the row stands for
|
|
61
|
+
* (Deliver, or Evaluate past it). → { name, d, late, over } or null. over: days past the date. */
|
|
62
|
+
export function nextMs(r, now = new Date()) {
|
|
63
|
+
const t = midnight(now);
|
|
64
|
+
const M = (r.milestones || []).filter((m) => !m.done && day(m.date)).sort((a, b) => day(a.date) - day(b.date));
|
|
65
|
+
let x = M.length ? { name: M[0].name, d: day(M[0].date) } : null;
|
|
66
|
+
const k = r.track ? r.track.k : -1;
|
|
67
|
+
if (!x && day(r.end) && k < 8 && !(r.track && r.track.prog && r.track.prog.total > 0 && r.track.prog.done >= r.track.prog.total)) x = { name: k >= 6 ? 'Evaluate' : 'Deliver', d: day(r.end) };
|
|
68
|
+
if (!x) return null;
|
|
69
|
+
const over = Math.round((t - x.d) / 864e5);
|
|
70
|
+
return { ...x, late: over > 0, over: Math.max(0, over) };
|
|
71
|
+
}
|
|
72
|
+
const STATUS = { late: 'Late', risk: 'At risk', q: 'On hold' };
|
|
73
|
+
const nextText = (r) => { const t = r.track || {}; if (typeof t.next === 'string') return t.next; if (t.next && t.next.text) return t.next.text; const l = (t.line || [])[0]; return l ? l.text || '' : ''; };
|
|
74
|
+
const stageName = (r) => { const s = stageOfRow(r); return (s && s.name) || (r.track && r.track.label) || r.stage || ''; };
|
|
75
|
+
|
|
76
|
+
/** One cell's markup (never a <b>: the name is the row's only one). o: { now, avatar(name) } */
|
|
77
|
+
function cell(r, k, o) {
|
|
78
|
+
const now = o.now;
|
|
79
|
+
if (k === 'stage') return `<span class="tg-c">${esc(stageName(r))}</span>`;
|
|
80
|
+
if (k === 'status') { const t = offTone(r, now); return t ? `<span class="tg-c tg-cst ${t}"><i class="cz-dot ${t}" aria-hidden="true"></i>${STATUS[t]}</span>` : '<span class="tg-c"></span>'; }
|
|
81
|
+
if (k === 'start') { const d = day(r.start); return `<span class="tg-c">${d ? esc(dy(d, now)) : ''}</span>`; }
|
|
82
|
+
if (k === 'ms') {
|
|
83
|
+
const m = nextMs(r, now);
|
|
84
|
+
if (!m) return '<span class="tg-c"></span>';
|
|
85
|
+
return `<span class="tg-c tg-cms${m.late ? ' late' : ''}"><i class="msd" aria-hidden="true"></i><span><em>${esc(m.name)}</em><small>${esc(dy(m.d, now))}${m.late ? ` +${m.over}d` : ''}</small></span></span>`;
|
|
86
|
+
}
|
|
87
|
+
if (k === 'wf') { const w = wfOf(r); return `<span class="tg-c tg-cwf">${wfIcon(w, 16)}<span>${esc(w.name)}</span></span>`; }
|
|
88
|
+
if (k === 'cat') { const c = catOfRow(r); return `<span class="tg-c">${c ? esc(catLabel(c)) : ''}</span>`; }
|
|
89
|
+
if (k === 'owner') return `<span class="tg-c tg-cow">${r.owner ? (o.avatar ? o.avatar(r.owner) : '') + `<span>${esc(r.owner)}</span>` : ''}</span>`;
|
|
90
|
+
if (k === 'next') return `<span class="tg-c">${esc(nextText(r))}</span>`;
|
|
91
|
+
if (k === 'jira') return `<span class="tg-c tg-cjk">${esc((r.epics || [])[0] || '')}</span>`;
|
|
92
|
+
return '<span class="tg-c"></span>';
|
|
93
|
+
}
|
|
94
|
+
/** The words a reader hears for a row's cells: "Build, Late, starts Oct 6, next Checkout to 100% Oct 26, 3 days late". */
|
|
95
|
+
function words(r, keys, now) {
|
|
96
|
+
return keys.map((k) => {
|
|
97
|
+
if (k === 'stage') return stageName(r);
|
|
98
|
+
if (k === 'status') { const t = offTone(r, now); return t ? STATUS[t] : ''; }
|
|
99
|
+
if (k === 'start') return day(r.start) ? 'starts ' + md(day(r.start)) : '';
|
|
100
|
+
if (k === 'ms') { const m = nextMs(r, now); return m ? 'next ' + m.name + ' ' + md(m.d) + (m.late ? ', ' + m.over + (m.over === 1 ? ' day' : ' days') + ' late' : '') : ''; }
|
|
101
|
+
if (k === 'wf') return wfOf(r).name;
|
|
102
|
+
if (k === 'cat') { const c = catOfRow(r); return c ? catLabel(c) : ''; }
|
|
103
|
+
if (k === 'owner') return r.owner || '';
|
|
104
|
+
if (k === 'next') return nextText(r);
|
|
105
|
+
if (k === 'jira') return (r.epics || [])[0] || '';
|
|
106
|
+
return '';
|
|
107
|
+
}).filter(Boolean).join(', ');
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const tone = (r, now) => ({ late: 0, risk: 1, q: 2 })[offTone(r, now)] ?? 3;
|
|
111
|
+
const str = (v) => String(v || '~');
|
|
112
|
+
const SORTS = {
|
|
113
|
+
title: (a, b) => String(a.title).localeCompare(String(b.title)),
|
|
114
|
+
stage: (a, b) => ((stageOfRow(a) || { n: 99 }).n - (stageOfRow(b) || { n: 99 }).n) || str(stageName(a)).localeCompare(str(stageName(b))),
|
|
115
|
+
status: (a, b, now) => tone(a, now) - tone(b, now),
|
|
116
|
+
start: (a, b) => str(a.start).localeCompare(str(b.start)),
|
|
117
|
+
ms: (a, b, now) => { const x = nextMs(a, now), y = nextMs(b, now); return (x ? +x.d : Infinity) - (y ? +y.d : Infinity) || 0; },
|
|
118
|
+
wf: (a, b) => String(wfOf(a).name).localeCompare(String(wfOf(b).name)),
|
|
119
|
+
cat: (a, b) => (CAT_ORDER[catOfRow(a)] ?? 9) - (CAT_ORDER[catOfRow(b)] ?? 9),
|
|
120
|
+
owner: (a, b) => str(a.owner).localeCompare(str(b.owner)),
|
|
121
|
+
next: (a, b) => str(nextText(a)).localeCompare(str(nextText(b))),
|
|
122
|
+
jira: (a, b) => str((a.epics || [])[0]).localeCompare(str((b.epics || [])[0])),
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
const SORT_ICON = '<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 5v14M6 13l6 6 6-6"/></svg>';
|
|
126
|
+
/** The columns a timeline draws at a Board `width` px wide, or null with no column beside Initiative (the timeline then draws as before).
|
|
127
|
+
* → { keys, nw, tpl, head(back), cells(r), label(r), order, msOn, statusOn } */
|
|
128
|
+
export function colsFor(width, o = {}) {
|
|
129
|
+
const now = o.now || new Date(), keys = fit(o.keys || chosen(), width);
|
|
130
|
+
if (keys.length < 2) return null;
|
|
131
|
+
const nw = keys.reduce((n, k) => n + byK[k].w, 0), by = sortBy && keys.includes(sortBy) ? sortBy : null;
|
|
132
|
+
const tpl = keys.map((k, i) => (i ? byK[k].w + 'px' : 'minmax(0,1fr)')).join(' ');
|
|
133
|
+
const hd = (k) => { const on = by === k; return `<button type="button" class="tg-chd${on ? ' on' : ''}" data-tsort="${k}" aria-sort="${on ? 'ascending' : 'none'}" title="Sort by ${esc(byK[k].n.toLowerCase())}">${esc(byK[k].n)}${on ? SORT_ICON : ''}</button>`; };
|
|
134
|
+
return {
|
|
135
|
+
keys, nw, tpl, msOn: keys.includes('ms'), statusOn: keys.includes('status'),
|
|
136
|
+
head: (back) => `<span class="tg-c0">${hd('title')}${back || ''}</span>${keys.slice(1).map(hd).join('')}`,
|
|
137
|
+
cells: (r) => keys.slice(1).map((k) => cell(r, k, { now, avatar: o.avatar })).join(''),
|
|
138
|
+
label: (r) => words(r, keys.slice(1), now),
|
|
139
|
+
order: by ? (a, b) => SORTS[by](a, b, now) || String(a.title).localeCompare(String(b.title)) : null,
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/** The Columns menu (StsA8Board's sheet): one check box per column, two to a line; Initiative is always on. */
|
|
144
|
+
export function menuHtml() {
|
|
145
|
+
const on = new Set(chosen());
|
|
146
|
+
return `<span class="bd-cmh" id="bdColsH">Columns</span><span class="bd-cmg">${COLS.map((c) => (c.k === 'title'
|
|
147
|
+
? `<label class="bd-cmi"><input type="checkbox" checked disabled>${esc(c.n)}<small>always</small></label>`
|
|
148
|
+
: `<label class="bd-cmi"><input type="checkbox" data-tcol="${c.k}"${on.has(c.k) ? ' checked' : ''}>${esc(c.n)}</label>`)).join('')}</span>`;
|
|
149
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/* pm/bd-pane.js — the Board as the first panel (panels on Board and Intelligence, P-B; canvas In development BiB1Split to BiB9DropOn, sticky
|
|
2
|
+
* "What to build" items 0, 3 and 5). What the panels engine (cozy-panels.js mountPanels) needs from the Board, and the open row's mark.
|
|
3
|
+
* SOURCES the rows that open beside: a drag on the row's name or ⌘/Ctrl-click. The grip still reorders (it is not the name). By stage cards
|
|
4
|
+
* are not here: a drag there moves the stage, so they open beside with ⌘/Ctrl-click only (wire()).
|
|
5
|
+
* fit() the px the Board's desktop view needs to be whole: the stage track, the timeline and By stage about 880, the List 360. It
|
|
6
|
+
* measures the desktop's view, not the narrow form's, so the form does not flip back and forth.
|
|
7
|
+
* openKeys(list, rows, vidOf) the rows an open Viewer shows (each initiative, with several Viewers), for the blue mark. */
|
|
8
|
+
import { panels } from './cozy-viewer.js';
|
|
9
|
+
|
|
10
|
+
export const SOURCES = '#ibBody .ini2[data-key]:not(.bd-bc)';
|
|
11
|
+
export const CARDS = '#ibBody .bd-bc[data-key]';
|
|
12
|
+
const NEED = { track: 880, time: 880, stages: 880, list: 360 };
|
|
13
|
+
export const fit = () => NEED[(document.getElementById('stage') || { dataset: {} }).dataset.bdDesk] || 880;
|
|
14
|
+
|
|
15
|
+
export function openKeys(list, rows, vidOf) {
|
|
16
|
+
const ids = new Set((list || []).filter((p) => p.open && p.item && p.item.kind === 'Initiative').map((p) => p.item.id));
|
|
17
|
+
return (rows || []).filter((r) => ids.has(vidOf(r))).map((r) => r.key);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** Open a row in a Viewer of its own: the engine's openBeside, or (before it is mounted) the Viewer's next open goes beside and the row is
|
|
21
|
+
* pressed as a plain click. */
|
|
22
|
+
export function openBeside(el) {
|
|
23
|
+
const P = window.czPanels;
|
|
24
|
+
if (P && typeof P.openBeside === 'function' && P.openBeside(el) !== false) return true; // false: the engine did nothing (a phone, not mounted)
|
|
25
|
+
if (panels && panels.beside) panels.beside();
|
|
26
|
+
el.click();
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
const besidePress = (e) => e.metaKey || e.ctrlKey || e.button === 1;
|
|
30
|
+
let wired = false;
|
|
31
|
+
/** ⌘/Ctrl-click and middle-click on a By stage card open it beside; a plain click and the drag stay the page's. Not on a phone. */
|
|
32
|
+
export function wire() {
|
|
33
|
+
if (wired) return; wired = true;
|
|
34
|
+
const on = (e) => {
|
|
35
|
+
if (innerWidth <= 760 || !besidePress(e)) return;
|
|
36
|
+
const c = e.target.closest && e.target.closest(CARDS); if (!c) return;
|
|
37
|
+
e.preventDefault(); e.stopPropagation(); openBeside(c);
|
|
38
|
+
};
|
|
39
|
+
document.addEventListener('click', on, true);
|
|
40
|
+
document.addEventListener('auxclick', on, true);
|
|
41
|
+
}
|
|
@@ -34,7 +34,10 @@
|
|
|
34
34
|
* orange late), the dashed Jira forecast, Today. The dotted hold, ⏸, the amber tint, the blue ◆ and the hatched out-of-window band are gone.
|
|
35
35
|
* Only the milestones the Filter shows are drawn (pm/bd-pins.js: the pinned ones, by default the last); every ◇ presses (data-ms-pick).
|
|
36
36
|
* · Group rows draw nothing while open; folded, the roll-up line, the counted ◇s, the end date and one dot per initiative off track.
|
|
37
|
-
* · A row's dot shows only off track (late, at risk, on hold). Names wrap to two lines. One tint (programs); quarter grid lines only.
|
|
37
|
+
* · A row's dot shows only off track (late, at risk, on hold). Names wrap to two lines. One tint (programs); quarter grid lines only.
|
|
38
|
+
* Columns and bars (batch 19 item 5, Board Track; StsA8Board, StsA9BoardDark): a desktop shows columns beside the names (o.cols, pm/bd-cols.js),
|
|
39
|
+
* Status carries the dot and Next milestone the end's words; the bars are 20 px, now blue to the end of this week while under way, and a late
|
|
40
|
+
* row draws an orange line from its end to Today. */
|
|
38
41
|
import { esc } from './premium-shell.js';
|
|
39
42
|
import { mergeClose } from './program-model.js';
|
|
40
43
|
import { stagesOfRow } from './bd-wf.js';
|
|
@@ -100,7 +103,7 @@ const msLate = (m, now) => !m.done && day(m.date) && day(m.date) < new Date(now.
|
|
|
100
103
|
export const anyMsLate = (r, now) => !!(now && (r.milestones || []).some((m) => msLate(m, now)));
|
|
101
104
|
const toneOf = (r, now) => (r.late || anyMsLate(r, now) ? 'late' : r.status === 'at risk' ? 'risk' : r.track && r.track.you ? 'you' : r.status === 'on track' ? 'ok' : 'q');
|
|
102
105
|
/** A row's dot (batch 13 item 4): only off track. 'late' | 'risk' | 'q' (on hold) | null. */
|
|
103
|
-
const offTone = (r, now) => { const t = toneOf(r, now); return t === 'late' || t === 'risk' ? t : r.status === 'on hold' ? 'q' : null; };
|
|
106
|
+
export const offTone = (r, now) => { const t = toneOf(r, now); return t === 'late' || t === 'risk' ? t : r.status === 'on hold' ? 'q' : null; };
|
|
104
107
|
const dotHtml = (r, now) => { const t = offTone(r, now); return t ? `<i class="cz-dot ${t}${t === 'q' ? '' : ' m-warn'}" aria-hidden="true"></i>` : ''; };
|
|
105
108
|
const dated = (r) => day(r.start) || day(r.end) || (r.track && day(r.track.forecast)) || (r.draft && day(r.draft.start));
|
|
106
109
|
/** Done work leaves no edge tab (TsCGrill 5): the initiative is past Deliver, or every part it counts is done. */
|
|
@@ -204,6 +207,8 @@ function qBar(r, X, now, phone, fmt, pxPct, ms = {}) {
|
|
|
204
207
|
out += g.html; clash = g.clash;
|
|
205
208
|
const over = r.over && now > e, late = fc && fc > e, hover = [];
|
|
206
209
|
if (over) hover.push(r.overDays + ' ' + (r.overDays === 1 ? 'day' : 'days') + ' over');
|
|
210
|
+
// a late initiative (batch 19 item 5): a thin orange line from the day after its end to Today, ending in a dot; the bar keeps its fill
|
|
211
|
+
if (over) out += `<span class="tg-late" style="left:${P(X(e))};width:${P(Math.max(0, X(now) - X(e)))}" aria-hidden="true"></span>`;
|
|
207
212
|
if (late) { out += `<span class="tg-fc" style="left:${P(X(e))};width:${P(X(fc) - X(e))}" title="Jira forecast ${esc(md(fc))}"></span>`; hover.push('Jira forecast ' + md(fc)); }
|
|
208
213
|
if (clash) hover.push(clash);
|
|
209
214
|
const sw = slipWords(r, e); if (sw) hover.push(sw);
|
|
@@ -213,14 +218,15 @@ function qBar(r, X, now, phone, fmt, pxPct, ms = {}) {
|
|
|
213
218
|
const ed = et ? day(et.date) : e; if (+ed !== +e) hover.push('Initiative ends ' + dy(e, now));
|
|
214
219
|
const name = landsOf(r, et), eTitle = name + ' · ' + md(ed) + (et && et.stage ? ' · ◆ ' + et.stage : '') + (et && et.done ? ' · done' : isLate ? ' · late' : '');
|
|
215
220
|
out += `<button type="button" class="tg-end${et && et.done ? ' dn' : ''}${isLate ? ' late' : ''}" data-ms-pick="${esc(r.key)}" data-ms-id="${esc(et ? et.id : '')}" style="left:${P(X(ed))}" aria-haspopup="dialog" aria-label="${esc(eTitle + '. Milestones of ' + r.title)}" title="${esc(eTitle + (clash ? '. ' + clash : ''))}"></button>`;
|
|
216
|
-
|
|
221
|
+
// with the Next milestone column on, the column names it and the bar's end has no label (StsA8Board); the ◇ keeps the words as its hover
|
|
222
|
+
if (!ms.noLabel) out += endLabel(Math.max(X(e), X(ed), over ? X(now) : 0, late ? X(fc) : 0), name, ed, isLate ? 'late' : risk, now, pxPct, hover, slipHtml(r));
|
|
217
223
|
} else if (fc) {
|
|
218
224
|
out += `<span class="tg-fc solo" style="left:${P(X(fc))};width:12px;margin-left:-12px" title="Jira forecast ${esc(md(fc))}"></span>` + endLabel(X(fc), 'Jira forecast', fc, '', now, pxPct, [], '');
|
|
219
225
|
} else if (r.draft && day(r.draft.start)) {
|
|
220
226
|
out += draftBar(r, X, phone, fmt, now, pxPct);
|
|
221
227
|
} else {
|
|
222
228
|
const d = s || e;
|
|
223
|
-
out += `<button type="button" class="tg-end" data-ms-pick="${esc(r.key)}" data-ms-id="" style="left:${P(X(d))}" aria-haspopup="dialog" aria-label="${esc((s ? 'Starts ' : 'Ends ') + md(d) + '. Milestones of ' + r.title)}" title="${s ? 'Starts' : 'Ends'} ${esc(md(d))}"></button>` + (e ? endLabel(X(d), landsOf(r, et), d, risk, now, pxPct, [], '') : '');
|
|
229
|
+
out += `<button type="button" class="tg-end" data-ms-pick="${esc(r.key)}" data-ms-id="" style="left:${P(X(d))}" aria-haspopup="dialog" aria-label="${esc((s ? 'Starts ' : 'Ends ') + md(d) + '. Milestones of ' + r.title)}" title="${s ? 'Starts' : 'Ends'} ${esc(md(d))}"></button>` + (e && !ms.noLabel ? endLabel(X(d), landsOf(r, et), d, risk, now, pxPct, [], '') : '');
|
|
224
230
|
}
|
|
225
231
|
return out + planMarks(r, X, phone, fmt);
|
|
226
232
|
}
|
|
@@ -292,11 +298,16 @@ function gapsHtml(r, X, now, phone, fmt, pxPct, s, e, tone, note = '', lands = n
|
|
|
292
298
|
if (at < e) pieces.push([at, e, faded]);
|
|
293
299
|
const days = (p) => Math.max(0, (p[1] - p[0]) / 86400000), total = pieces.reduce((n, p) => n + days(p), 0);
|
|
294
300
|
let left = (doneOf(r) / 100) * total;
|
|
301
|
+
// now is blue (batch 19 item 5, StsA8Board): from where the done part ends to the end of this week, while the work is under way
|
|
302
|
+
let doneAt = s; { let l = left; for (const p of pieces) { const d = days(p); if (l <= d) { doneAt = new Date(+p[0] + l * 864e5); break; } l -= d; doneAt = p[1]; } }
|
|
303
|
+
const t0 = new Date(now.getFullYear(), now.getMonth(), now.getDate()), nowTo = addDays(t0, 7);
|
|
304
|
+
const live = s <= t0 && !isDone(r) && doneOf(r) < 100;
|
|
305
|
+
const nowIn = (p) => { if (!live) return ''; const a = doneAt > p[0] ? doneAt : p[0], b = nowTo < p[1] ? nowTo : p[1]; if (b <= a) return ''; const w = +p[1] - +p[0] || 1; return `<i class="nw" style="left:${(((a - p[0]) / w) * 100).toFixed(1)}%;width:${(((b - a) / w) * 100).toFixed(1)}%"></i>`; };
|
|
295
306
|
const hold = (H.length ? '. ' + H.map((x) => holdWords(x, now)).join('. ') : '') + (dropped.length ? '. ' + dropped.join('. ') : '') + (note ? '. ' + note : '');
|
|
296
307
|
let html = pieces.map((p, i) => {
|
|
297
308
|
const d = days(p), f = d ? Math.max(0, Math.min(1, left / d)) : 0; left -= d;
|
|
298
309
|
const xl = i > 0 || p[0] > s ? ' xl' : '', xr = i < pieces.length - 1 || p[1] < e ? ' xr' : '';
|
|
299
|
-
return `<span class="tg-bar${xl}${xr}${p[2] ? ' fd' : ''}" data-key="${esc(r.key)}" style="left:${P(X(p[0]))};width:${P(Math.max(0.15, X(p[1]) - X(p[0])))}" title="${esc('PMOS plan ' + md(s) + ' to ' + md(e) + hold)}"><b style="width:${(f * 100).toFixed(1)}%"></b
|
|
310
|
+
return `<span class="tg-bar${xl}${xr}${p[2] ? ' fd' : ''}" data-key="${esc(r.key)}" style="left:${P(X(p[0]))};width:${P(Math.max(0.15, X(p[1]) - X(p[0])))}" title="${esc('PMOS plan ' + md(s) + ' to ' + md(e) + hold)}"><b style="width:${(f * 100).toFixed(1)}%"></b>${nowIn(p)}</span>`;
|
|
300
311
|
}).join('');
|
|
301
312
|
// each plain gap: the hairline, one press (a 24 px area) with its words; a phone draws the line alone and its row sheet says it
|
|
302
313
|
plain.forEach(([a, b], gi) => {
|
|
@@ -464,7 +475,7 @@ function edgeTabs(r, X, now, phone) {
|
|
|
464
475
|
* (extra: { plan, draft }; batch 11 item 8), one hairline key for a gap or a hold while one is drawn and Skipped while a » is (extra: { gap, skip };
|
|
465
476
|
* batch 13 item 4 folds the hold into the gap's hairline), the Jira forecast, Milestone, today. `prog` is kept for the callers: a program draws
|
|
466
477
|
* no ◇ of its own while open. */
|
|
467
|
-
export const legendHtml = (prog, hold, extra = {}) => `<span class="tg-lgd" role="group" aria-label="Legend"><span><i class="k dn"></i>Done in Jira</span><span><i class="k pl"></i>To do</span>${extra.plan ? '<span><i class="k pln"></i>Plan</span>' : ''}${extra.draft ? '<span><i class="k drf"></i>Draft</span>' : ''}${hold || extra.gap ? `<span><i class="k ng"></i>${hold && extra.gap ? 'Gap or hold' : hold ? 'On hold' : 'No activity'}</span>` : ''}${extra.skip ? `<span><i class="k sk">${SV(SKIP)}</i>Skipped</span>` : ''}<span><i class="k fc"></i>Jira forecast</span><span><i class="k dlv"></i>Milestone</span><span><i class="k td"></i>Today</span></span>`;
|
|
478
|
+
export const legendHtml = (prog, hold, extra = {}) => `<span class="tg-lgd" role="group" aria-label="Legend"><span><i class="k dn"></i>Done in Jira</span><span><i class="k nw"></i>Now</span><span><i class="k pl"></i>To do</span>${extra.plan ? '<span><i class="k pln"></i>Plan</span>' : ''}${extra.draft ? '<span><i class="k drf"></i>Draft</span>' : ''}${hold || extra.gap ? `<span><i class="k ng"></i>${hold && extra.gap ? 'Gap or hold' : hold ? 'On hold' : 'No activity'}</span>` : ''}${extra.skip ? `<span><i class="k sk">${SV(SKIP)}</i>Skipped</span>` : ''}<span><i class="k fc"></i>Jira forecast</span><span><i class="k dlv"></i>Milestone</span><span><i class="k td"></i>Today</span></span>`;
|
|
468
479
|
|
|
469
480
|
/** The dates on record a window must hold: every shown row's plan and forecast, the programs' spans and milestones, the release. */
|
|
470
481
|
function datesOf(list, M, o) {
|
|
@@ -483,7 +494,9 @@ function scaled(rows, M, o) {
|
|
|
483
494
|
// one screen shows W.cols columns; the track is as many screens wide as the window holds (pm/bd-scroll.js measures it again on screen)
|
|
484
495
|
const days = (W.to - W.from) / 86400000, viewDays = W.fixed ? days : W.cols * COL_DAYS[W.unit];
|
|
485
496
|
const ratio = days / viewDays, tpx = Math.max(200, o.trackPx || (o.phone ? 340 : 1100)), pxDay = tpx / viewDays;
|
|
486
|
-
|
|
497
|
+
// the columns beside the names (batch 19 item 5, StsA8Board): a desktop only; o.cols from pm/bd-cols.js colsFor, or null
|
|
498
|
+
const C = !o.phone && o.cols ? o.cols : null;
|
|
499
|
+
const msO = { sp, reach: Math.max(1, Math.round(40 / pxDay)), mode: o.msMode || 'pinned', noLabel: !!(C && C.msOn) }; // a row's milestone ◇s closer than ~40 px merge (batch 11 item 3); the Filter's milestones (batch 13 item 4)
|
|
487
500
|
const ov = overlay(W, X, now, sprint, rel), pxPct = (tpx * (W.fixed ? 1 : ratio)) / 100;
|
|
488
501
|
const ra = rel && day(rel.iso), sa = sprint && day(sprint.start), sb = sprint && day(sprint.end);
|
|
489
502
|
// an undated program member's track says so beside today, where the view opens
|
|
@@ -508,7 +521,8 @@ function scaled(rows, M, o) {
|
|
|
508
521
|
const footNone = none.filter((r) => !shownNd.has(r.key));
|
|
509
522
|
// 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
|
|
510
523
|
const at = (r) => { const x = extentOf(r, now); return x ? [+x.a, +x.b] : [Infinity, Infinity]; };
|
|
511
|
-
|
|
524
|
+
// a pressed column title sorts each group by that column instead (StsA8Board, as in the List)
|
|
525
|
+
const byTime = (L) => (C && C.order ? L.slice().sort(C.order) : 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]));
|
|
512
526
|
list.splice(0, list.length, ...byTime(list));
|
|
513
527
|
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(keepOf(g.rows)) })).filter((g) => g.rows.length || g.kind === 'program') : null;
|
|
514
528
|
const empty = '<p class="tg-empty">No initiative on screen has a date on record.</p>';
|
|
@@ -529,11 +543,14 @@ function scaled(rows, M, o) {
|
|
|
529
543
|
const lanePh = o.lane ? o.lane({ W, X, rows: list, groups: G, now, phone: true, pxPct }) || '' : '';
|
|
530
544
|
return { html: lanePh + `<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 };
|
|
531
545
|
}
|
|
532
|
-
const head = `<div class="tg-r tg-h"><div class="tg-n"
|
|
546
|
+
const head = `<div class="tg-r tg-h"><div class="tg-n">${C ? C.head(back) : `<b>Initiative</b>${back}`}</div><div class="tg-p">${ticks}${pill}</div></div>`;
|
|
533
547
|
// 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
|
|
534
548
|
const one = (r, cls) => { const s = o.status(r), sub = [r.owner, r.track ? r.track.label : r.stage, s.text].filter(Boolean).join(' · ');
|
|
535
549
|
// the dot keeps its place while it is silent, so every name starts at the same line (XcalmA1Desk)
|
|
536
|
-
|
|
550
|
+
const dot = dotHtml(r, now) || '<i class="tg-nodot" aria-hidden="true"></i>', nm = `<b>${r.inProgram && o.memberIcon ? o.memberIcon(r.inProgram) : ''}${esc(r.title)}</b>`;
|
|
551
|
+
// with columns, the Status cell carries the dot and the name has none (say it once)
|
|
552
|
+
const inner = C ? `<span class="tg-c0">${C.statusOn ? '' : dot}${nm}</span>${C.cells(r)}` : dot + nm, lab = C ? [r.title, C.label(r)].filter(Boolean).join(', ') : r.title + ', ' + sub;
|
|
553
|
+
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(lab)}">${inner}</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>`; };
|
|
537
554
|
// programs first, then the product (PgTimeline): the program's row brackets its initiatives' bars and draws its milestones as diamonds
|
|
538
555
|
const body = G ? G.map((g) => {
|
|
539
556
|
if (g.kind !== 'program') return lane(g) + (o.folded(g.key) ? '' : g.rows.map((r) => one(r, ' tg-gr')).join(''));
|
|
@@ -546,7 +563,8 @@ function scaled(rows, M, o) {
|
|
|
546
563
|
const foot = none.length ? `<div class="tg-ft">${footNone.length ? `<span class="tg-none"><b>${footNone.length} ${footNone.length === 1 ? 'has' : 'have'} no dates:</b> <span>${esc(footNone.slice(0, 4).map((r) => r.title).join(', '))}${footNone.length > 4 ? ' and ' + (footNone.length - 4) + ' more' : ''}</span>${askBtn}</span>` : `<span class="tg-none">${askBtn}</span>`}</div>` : '';
|
|
547
564
|
// the Deliveries lane (batch 13 item 4, XcalmA6Lane): one row under the axis, a list per column (o.lane draws it; none: nothing)
|
|
548
565
|
const laneH = o.lane ? o.lane({ W, X, rows: list, groups: G, now, phone: false, pxPct }) || '' : '';
|
|
549
|
-
|
|
566
|
+
// the columns' width is the name column's (--nw: the sticky block, the left fade and the Deliveries fold all read it)
|
|
567
|
+
return { html: `<div class="tg tg-q tg-s${C ? ' tg-cols' : ''}" ${attrs}${C ? ` style="--nw:${C.nw}px;--cg:${C.tpl}"` : ''}><div class="tg-scw"><div class="tg-sc" tabindex="0" role="group" aria-label="Timeline" style="${style}"><div class="tg-in">${head}${laneH}<div class="tg-body">${body || empty}</div>${axis}</div></div><i class="tg-fade l" aria-hidden="true"></i><i class="tg-fade r" aria-hidden="true"></i></div>${foot}</div>`, none };
|
|
550
568
|
}
|
|
551
569
|
|
|
552
570
|
/** A program's row (PgTimeline .r.pg): its tile and title. Open, its track is empty: its initiatives' rows say it (batch 13 item 4, PlmA1 is
|