create-pmos 0.419.0 → 0.421.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +25 -30
- package/payload/KIT-VERSION +1 -1
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/scripts/lane-defs.js +14 -1
- package/payload/scripts/workflow-state.js +2 -2
- package/payload/state/discoveries.md +1 -1
- package/workspace/briefing-premium-board-test.js +9 -13
- package/workspace/changelog.json +24 -0
- package/workspace/fixtures/report-api/draft.json +2 -1
- package/workspace/guide/briefing-premium.md +1 -1
- package/workspace/guide/home.md +3 -0
- package/workspace/home-other-product-test.js +18 -0
- package/workspace/home-rows-test.js +14 -0
- package/workspace/lib/board-premium.js +13 -3
- package/workspace/lib/brief.js +5 -0
- package/workspace/lib/briefing-premium-agent.js +8 -0
- package/workspace/lib/engine/lane-defs.js +14 -1
- package/workspace/lib/engine/workflow-state.js +2 -2
- package/workspace/lib/first-input.js +13 -6
- package/workspace/lib/hold-spans.js +64 -0
- package/workspace/lib/mention-store.js +49 -13
- package/workspace/lib/plan-tree.js +1 -1
- package/workspace/lib/report-draft.js +6 -0
- package/workspace/lib/routes-boards.js +22 -6
- package/workspace/lib/source-reads.js +5 -0
- package/workspace/lib/transcript-read.js +29 -1
- package/workspace/lib/vendor/scripts/lane-defs.js +14 -1
- package/workspace/lib/vendor/scripts/workflow-state.js +2 -2
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-viewer-test.js +1 -1
- package/workspace/public/pm/bd-acts.js +49 -1
- package/workspace/public/pm/bd-ini-panel.js +15 -8
- package/workspace/public/pm/bd-next.js +119 -0
- package/workspace/public/pm/bd-prog.js +1 -1
- package/workspace/public/pm/bd-span.js +120 -22
- package/workspace/public/pm/bd-views.js +7 -5
- package/workspace/public/pm/cozy-board.css +54 -9
- package/workspace/public/pm/cozy-live-pill.js +1 -1
- package/workspace/public/pm/cozy-nav.js +1 -1
- package/workspace/public/pm/cozy-steps.js +1 -1
- package/workspace/public/pm/cozy-today.css +9 -0
- package/workspace/public/pm/cozy-viewer.js +7 -3
- package/workspace/public/pm/cozy-xv.js +1 -1
- package/workspace/public/pm/cozy.css +10 -0
- package/workspace/public/pm/home-app.js +39 -13
- package/workspace/public/pm/home-ask.js +7 -0
- package/workspace/public/pm/home-ini.js +44 -13
- package/workspace/public/pm/home-line.js +1 -1
- package/workspace/public/pm/home-list.js +22 -2
- package/workspace/public/pm/home-mentions.js +1 -1
- package/workspace/public/pm/home-today.js +13 -2
- package/workspace/public/pm/ini-tasks.js +363 -0
- package/workspace/public/pm/ini-view-model.js +19 -11
- package/workspace/public/pm/ini-view.css +160 -0
- package/workspace/public/pm/ini-view.js +40 -9
- package/workspace/public/pm/premium-board.js +54 -17
- package/workspace/public/pm/premium-insights.js +1 -1
- package/workspace/public/pm/premium-mtg-present.js +2 -2
- package/workspace/public/pm/premium-report-read.js +1 -1
- package/workspace/public/pm/premium-report-tab.js +1 -1
- package/workspace/public/pm/premium-viewer.js +3 -3
- package/workspace/public/pm/premium-vw-mtg.js +3 -1
- package/workspace/public/pm/premium-vw-open.js +1 -1
- package/workspace/public/pm/premium-vw-slides.js +1 -1
- package/workspace/public/pm/prog-order.js +1 -1
- package/workspace/public/pm/task-card.js +6 -0
- package/workspace/public/pm/tk-send.js +1 -1
- package/workspace/server.js +26 -2
- package/workspace/skills/day-check.skill +2 -2
- package/workspace/skills/morning-brief.skill +1 -1
- package/workspace/skills/sources-read.skill +8 -4
- package/workspace/task-press-test.js +120 -0
- package/workspace/task-views-test.js +245 -0
- package/workspace/test-lists/task-press.json +6 -0
- package/workspace/test-lists/task-views.json +6 -0
- package/workspace/test-lists/timeline-holds.json +6 -0
- package/workspace/timeline-holds-test.js +199 -0
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
/* timeline-holds-test.js — holds as gaps on the Board timeline (feedback batch 9 item 8; canvas XtiA1Desk, XtiA2Hold, XtiA4Long, XtiA3Phone, XtiAHard,
|
|
4
|
+
* XtiAGrill). Serves the real page from the real server; GET /api/board-premium answers a board built by lib/board-premium.js from rows that carry
|
|
5
|
+
* the holds and the plain gaps lib/routes-boards.js gives (lib/hold-spans.js folds them; hold-spans.test.js checks the fold). The page's clock is
|
|
6
|
+
* the fixture's (17 Oct 2026). POST /api/lifecycle is answered here and its bodies are kept, so a press is checked by what it would write.
|
|
7
|
+
* A the bar breaks: a dotted gap, ⏸ where it stopped, the return date where it starts; the done part skips the gap; a plain gap just breaks
|
|
8
|
+
* L the legend's "On hold" key only while a hold is drawn
|
|
9
|
+
* P the ⏸ press: how long, why, the dates; Resume now writes active; the date icon opens a date field that writes on-hold with the new date
|
|
10
|
+
* H hard cases: no return date (dotted to today, the rest faded, the date field open), passed (late colour), two holds, return after Deliver
|
|
11
|
+
* E the edge tab ahead names the return date · N a hold narrower than 8 px closes up (5 yr) · G the program line is dotted where all members wait
|
|
12
|
+
* M the phone keeps the ⏸ only
|
|
13
|
+
* SHOTS_8=<dir>: the timeline at 1440 and 390, light and dark, and the ⏸ menu, 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: 'timeline-holds' });
|
|
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} timeline-holds 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 held = (from, back, reason) => ({ status: 'on hold', stopped: { state: 'on-hold', reason: reason || '', at: from + 'T09:00:00.000Z', back: back || null } });
|
|
36
|
+
const ROWS = [
|
|
37
|
+
F.row('email-otp', 'Email OTP (passwordless login)', { stage: 'Build', start: '2026-07-01', end: '2027-06-15', progress: 30, holds: [{ from: '2026-10-12', to: null, back: '2027-03-01', reason: 'Waits on the SMS vendor contract' }], ...held('2026-10-12', '2027-03-01', 'Waits on the SMS vendor contract') }),
|
|
38
|
+
F.row('passkey', 'Passkey sign-in', { owner: 'Lee', start: '2026-08-15', end: '2027-02-10', progress: 45 }),
|
|
39
|
+
F.row('recovery-codes', 'Recovery codes', { owner: 'Dara', start: '2026-09-01', end: '2027-03-20', progress: 40, gaps: [{ from: '2026-10-20', to: '2027-01-10' }] }),
|
|
40
|
+
F.row('no-return', 'On hold, no return date', { start: '2026-06-01', end: '2027-04-01', progress: 20, holds: [{ from: '2026-09-01', to: null, back: null, reason: '' }], ...held('2026-09-01', null) }),
|
|
41
|
+
F.row('passed', 'Return date passed', { start: '2026-05-01', end: '2027-02-01', progress: 30, holds: [{ from: '2026-08-10', to: null, back: '2026-10-05', reason: 'Waits on budget' }], ...held('2026-08-10', '2026-10-05', 'Waits on budget') }),
|
|
42
|
+
F.row('two-holds', 'Resumed, two holds', { start: '2026-03-01', end: '2027-03-01', progress: 40, holds: [{ from: '2026-04-01', to: '2026-05-01', back: null, reason: '' }, { from: '2026-06-10', to: '2026-07-01', back: null, reason: '' }] }),
|
|
43
|
+
F.row('after-deliver', 'Return after Deliver', { start: '2026-07-01', end: '2027-03-01', progress: 25, holds: [{ from: '2026-09-15', to: null, back: '2027-05-01', reason: '' }], ...held('2026-09-15', '2027-05-01') }),
|
|
44
|
+
];
|
|
45
|
+
|
|
46
|
+
(async () => {
|
|
47
|
+
const exe = findBrowser();
|
|
48
|
+
if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the suite cannot run'); return finish(1); }
|
|
49
|
+
let chromium;
|
|
50
|
+
try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
|
|
51
|
+
srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
|
|
52
|
+
await T.waitForServer(BASE);
|
|
53
|
+
browser = await chromium.launch({ executablePath: exe });
|
|
54
|
+
|
|
55
|
+
/** The Board on the timeline. o: { w, h, rows, span, dark } */
|
|
56
|
+
const open = async (o = {}) => {
|
|
57
|
+
const ctx = await browser.newContext({ viewport: { width: o.w || 1440, height: o.h || 900 }, colorScheme: o.dark ? 'dark' : 'light' });
|
|
58
|
+
const page = await ctx.newPage();
|
|
59
|
+
const errors = [], posts = [];
|
|
60
|
+
page.on('pageerror', (e) => errors.push(String((e && e.stack) || e)));
|
|
61
|
+
await page.clock.setFixedTime(new Date(F.NOW));
|
|
62
|
+
const rows = (o.rows || ROWS).map((r) => ({ ...r }));
|
|
63
|
+
await page.route('**/api/board-premium*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model: BP.build(F.facts({ rows, total: rows.length, columns: [] })), as_of: Date.now() }) }));
|
|
64
|
+
await page.route('**/api/programs', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, programs: [] }) }));
|
|
65
|
+
await page.route('**/api/board-trail*', (r) => r.fulfill({ status: 500, contentType: 'application/json', body: JSON.stringify({ ok: false, error: 'not in this check' }) }));
|
|
66
|
+
await page.route('**/api/lifecycle', (r) => { posts.push(JSON.parse(r.request().postData() || '{}')); r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true }) }); });
|
|
67
|
+
await page.addInitScript(([s]) => { try { if (!sessionStorage.getItem('set')) { sessionStorage.setItem('set', '1'); for (const [k, v] of Object.entries(s)) localStorage.setItem(k, v); } } catch { /* none */ } }, [{ 'pmos.board.view': 'time', 'pmos.board.pview': 'time', 'pmos.board.span': o.span || 'year' }]);
|
|
68
|
+
await page.goto(BASE + '/premium-board.html?ws=w1&board=w1');
|
|
69
|
+
await page.waitForSelector('#ibBody [data-row]', { timeout: 15000 });
|
|
70
|
+
await page.waitForTimeout(500);
|
|
71
|
+
return { ctx, page, errors, posts };
|
|
72
|
+
};
|
|
73
|
+
const shots = process.env.SHOTS_8;
|
|
74
|
+
const shot = async (p, name) => { if (shots) await p.screenshot({ path: path.join(shots, name + '.png') }); };
|
|
75
|
+
/** One row's timeline marks, read in the page. */
|
|
76
|
+
const rowOf = (p, title) => p.evaluate((t) => {
|
|
77
|
+
const r = [...document.querySelectorAll('#ibBody [data-row]')].find((x) => x.querySelector('b') && x.querySelector('b').textContent === t); if (!r) return null;
|
|
78
|
+
const pc = (el) => parseFloat(el.style.left);
|
|
79
|
+
return {
|
|
80
|
+
bars: [...r.querySelectorAll('.tg-bar')].map((b) => ({ l: pc(b), w: parseFloat(b.style.width), cls: b.className, done: parseFloat(b.querySelector('b').style.width) })),
|
|
81
|
+
gaps: [...r.querySelectorAll('.tg-gap')].map((g) => ({ l: pc(g), w: parseFloat(g.style.width), cls: g.className })),
|
|
82
|
+
pz: [...r.querySelectorAll('.tg-pz')].map((b) => ({ cls: b.className, label: b.getAttribute('aria-label') })),
|
|
83
|
+
hl: [...r.querySelectorAll('.tg-hl')].map((x) => x.className + '|' + x.textContent),
|
|
84
|
+
end: (r.querySelector('.tg-end') || {}).className || '', lab: [...r.querySelectorAll('.tg-lab')].map((x) => x.textContent),
|
|
85
|
+
tabs: [...r.querySelectorAll('.tg-edge')].map((b) => b.dataset.edge + ':' + b.textContent.trim()),
|
|
86
|
+
};
|
|
87
|
+
}, title);
|
|
88
|
+
|
|
89
|
+
/* A L P H E — desktop, Year */
|
|
90
|
+
{
|
|
91
|
+
const { ctx, page: p, errors, posts } = await open();
|
|
92
|
+
const otp = await rowOf(p, 'Email OTP (passwordless login)');
|
|
93
|
+
ok('A a hold breaks the bar: two pieces with square inner ends, a dotted gap between them, one ⏸ with the hold in its name', otp && otp.bars.length === 2 && /xr/.test(otp.bars[0].cls) && /xl/.test(otp.bars[1].cls) && otp.gaps.length === 1 && otp.pz.length === 1
|
|
94
|
+
&& /^On hold, Oct 12 to Mar 1, 2027, waits on the SMS vendor contract\. Open the hold$/.test(otp.pz[0].label), JSON.stringify(otp));
|
|
95
|
+
ok('A the gap runs from the hold to the return date, where the bar starts again under the return date', otp && Math.abs(otp.gaps[0].l - (otp.bars[0].l + otp.bars[0].w)) < 0.2 && Math.abs(otp.bars[1].l - (otp.gaps[0].l + otp.gaps[0].w)) < 0.2 && otp.hl.join() === 'tg-hl|Mar 1', JSON.stringify(otp));
|
|
96
|
+
ok('A the done part fills the pieces in order and skips the gap: the first piece fills before the second starts', otp && otp.bars[0].done > 0 && (otp.bars[0].done === 100 || otp.bars[1].done === 0), JSON.stringify(otp && otp.bars));
|
|
97
|
+
const rc = await rowOf(p, 'Recovery codes');
|
|
98
|
+
ok('A a plain gap of 4 weeks or more in the dated work just breaks the bar: no dotted line, no ⏸, no label', rc && rc.bars.length === 2 && !rc.gaps.length && !rc.pz.length && !rc.hl.length, JSON.stringify(rc));
|
|
99
|
+
const pk = await rowOf(p, 'Passkey sign-in');
|
|
100
|
+
ok('A a row with no hold and no gap keeps one whole bar', pk && pk.bars.length === 1 && !/x[lr]/.test(pk.bars[0].cls), JSON.stringify(pk));
|
|
101
|
+
const lg = await p.evaluate(() => (document.querySelector('#bdChipset .tg-lgd') || {}).textContent || '');
|
|
102
|
+
ok('L the legend names "On hold" while a hold is drawn', /Planned\s*On hold/.test(lg), lg);
|
|
103
|
+
|
|
104
|
+
const nr = await rowOf(p, 'On hold, no return date');
|
|
105
|
+
ok('H no return date: dotted to today, "no return date" at today, the rest of the plan faded', nr && nr.gaps.length === 1 && nr.hl.join() === 'tg-hl|no return date' && nr.bars.length === 2 && /fd/.test(nr.bars[1].cls) && !/fd/.test(nr.bars[0].cls)
|
|
106
|
+
&& /^On hold since Sep 1, no return date\. Set a return date$/.test(nr.pz[0].label), JSON.stringify(nr));
|
|
107
|
+
const ps = await rowOf(p, 'Return date passed');
|
|
108
|
+
ok('H the return date passed: the dotted line runs on to today in the late colour, and the date says how long ago', ps && /late/.test(ps.gaps[0].cls) && /late/.test(ps.pz[0].cls) && ps.hl.join() === 'tg-hl late|Oct 5 · 12 days ago', JSON.stringify(ps));
|
|
109
|
+
const tw = await rowOf(p, 'Resumed, two holds');
|
|
110
|
+
ok('H a resumed hold stays a gap: two holds draw two gaps and three pieces; no return date label on a past hold', tw && tw.gaps.length === 2 && tw.bars.length === 3 && !tw.hl.length && tw.pz.every((x) => /^Was on hold/.test(x.label)), JSON.stringify(tw));
|
|
111
|
+
const ad = await rowOf(p, 'Return after Deliver');
|
|
112
|
+
ok('H the return date falls after Deliver: the ◇ turns amber and says so, and no date moves', ad && /late/.test(ad.end) && ad.lab.join() === 'Mar 1 · Deliver is before the return, May 1' && ad.bars.length === 1, JSON.stringify(ad));
|
|
113
|
+
ok('E the edge tab ahead of a held row names its return date', otp && otp.tabs.includes('r:Mar ’27') && ad.tabs.includes('r:May ’27'), JSON.stringify([otp && otp.tabs, ad && ad.tabs]));
|
|
114
|
+
await shot(p, 'timeline-holds-1440');
|
|
115
|
+
|
|
116
|
+
// P the ⏸ press (XtiA2Hold)
|
|
117
|
+
await p.click('#ibBody [data-row="board:email-otp"] .tg-pz');
|
|
118
|
+
const pop = await p.evaluate(() => { const h = document.querySelector('#bdPop'); return { open: !h.hidden, cls: h.className, h4: (h.querySelector('h4') || {}).textContent, p: (h.querySelector('p') || {}).textContent, btns: [...h.querySelectorAll('.acts button')].map((b) => b.getAttribute('aria-label') + ':' + (b.textContent.trim() === '')) }; });
|
|
119
|
+
ok('P ⏸ opens the floating menu by the button: how long, the dates, why; two icon buttons, resume and change the date', pop.open && /bd-hold/.test(pop.cls) && pop.h4 === 'On hold · 4½ months' && pop.p === 'Oct 12 to Mar 1, 2027. Waits on the SMS vendor contract.' && pop.btns.join() === 'Resume now:true,Change the return date:true', JSON.stringify(pop));
|
|
120
|
+
await shot(p, 'timeline-holds-menu-1440');
|
|
121
|
+
await p.click('#bdPop [data-holdgo="date"]');
|
|
122
|
+
const field = await p.evaluate(() => { const f = document.querySelector('#bdPop input[type="date"]'); return f ? { v: f.value, focus: document.activeElement === f } : null; });
|
|
123
|
+
ok('P the date icon opens a date field with the return date in it', field && field.v === '2027-03-01' && field.focus, JSON.stringify(field));
|
|
124
|
+
await p.fill('#bdPop input[type="date"]', '2027-04-15'); await p.waitForTimeout(400);
|
|
125
|
+
ok('P a new date writes the on-hold line the ⋯ menu writes, with the new return date and the same reason', posts.length === 1 && posts[0].initiative_id === 'email-otp' && posts[0].state === 'on-hold' && posts[0].back === '2027-04-15' && posts[0].reason === 'Waits on the SMS vendor contract', JSON.stringify(posts));
|
|
126
|
+
await p.click('#ibBody [data-row="board:email-otp"] .tg-pz'); await p.click('#bdPop [data-holdgo="resume"]'); await p.waitForTimeout(400);
|
|
127
|
+
ok('P Resume now writes active', posts.length === 2 && posts[1].state === 'active' && posts[1].initiative_id === 'email-otp', JSON.stringify(posts));
|
|
128
|
+
await p.click('#ibBody [data-row="board:no-return"] .tg-pz');
|
|
129
|
+
const nd = await p.evaluate(() => { const h = document.querySelector('#bdPop'); return { h4: (h.querySelector('h4') || {}).textContent, field: !!h.querySelector('input[type="date"]'), focus: document.activeElement && document.activeElement.type === 'date' }; });
|
|
130
|
+
ok('H with no return date the ⏸ press opens with the date field ready', nd.field && nd.focus && /^On hold · /.test(nd.h4), JSON.stringify(nd));
|
|
131
|
+
await p.keyboard.press('Escape');
|
|
132
|
+
await p.click('#ibBody [data-row="board:two-holds"] .tg-pz');
|
|
133
|
+
const past = await p.evaluate(() => { const h = document.querySelector('#bdPop'); return { h4: (h.querySelector('h4') || {}).textContent, acts: h.querySelectorAll('.acts button').length }; });
|
|
134
|
+
ok('P a past hold reads how long it ran, with nothing to press', past.h4 === 'Was on hold · 4 weeks' && past.acts === 0, JSON.stringify(past));
|
|
135
|
+
await p.keyboard.press('Escape');
|
|
136
|
+
ok('the timeline threw nothing', !errors.length, errors.join('\n'));
|
|
137
|
+
await ctx.close();
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/* L with no hold on screen the legend says nothing about holds */
|
|
141
|
+
{
|
|
142
|
+
const { ctx, page: p } = await open({ rows: ROWS.filter((r) => !r.holds) });
|
|
143
|
+
const lg = await p.evaluate(() => (document.querySelector('#bdChipset .tg-lgd') || {}).textContent || '');
|
|
144
|
+
ok('L with no hold drawn, no "On hold" in the legend (zero is silence)', /Planned/.test(lg) && !/On hold/.test(lg), lg);
|
|
145
|
+
await ctx.close();
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/* N G — through the engine: 5 yr closes up a short past hold; the program line is dotted where every member waits */
|
|
149
|
+
{
|
|
150
|
+
const { ctx, page: p } = await open();
|
|
151
|
+
const r = await p.evaluate(async () => {
|
|
152
|
+
const S = await import('/pm/bd-span.js'), now = new Date(2026, 9, 17);
|
|
153
|
+
const a = { key: 'board:a', id: 'a', title: 'Short hold', start: '2026-01-01', end: '2027-06-01', holds: [{ from: '2026-05-01', to: '2026-05-10', back: null, reason: '' }], track: { key: 'build' } };
|
|
154
|
+
const b = { key: 'board:b', id: 'b', title: 'Held one', start: '2026-07-01', end: '2027-06-01', holds: [{ from: '2026-10-01', to: null, back: '2027-02-01', reason: '' }], track: { key: 'build' } };
|
|
155
|
+
const c = { key: 'board:c', id: 'c', title: 'Held two', start: '2026-08-01', end: '2027-05-01', holds: [{ from: '2026-11-01', to: null, back: '2027-03-01', reason: '' }], track: { key: 'build' } };
|
|
156
|
+
const d = document.createElement('div');
|
|
157
|
+
d.innerHTML = S.timelineHtml([a], { jira: null }, 'y5', { now, trackPx: 1100 }).html;
|
|
158
|
+
const five = { bars: d.querySelectorAll('.tg-bar').length, gaps: d.querySelectorAll('.tg-gap').length };
|
|
159
|
+
d.innerHTML = S.timelineHtml([a], { jira: null }, 'quarter', { now, trackPx: 1100 }).html;
|
|
160
|
+
const quarter = { bars: d.querySelectorAll('.tg-bar').length, gaps: d.querySelectorAll('.tg-gap').length };
|
|
161
|
+
const groups = [{ kind: 'program', key: 'p', program: { id: 'p', title: 'IDPF Feature Expansion', products: [] }, products: [{ name: 'IDPF', rows: [b, c] }], rows: [b, c] }];
|
|
162
|
+
d.innerHTML = S.timelineHtml([b, c], { jira: null }, 'year', { now, groups, trackPx: 1100 }).html;
|
|
163
|
+
const spans = [...d.querySelectorAll('.tg-pg .tg-span')].map((x) => x.className);
|
|
164
|
+
const groups2 = [{ ...groups[0], products: [{ name: 'IDPF', rows: [a, b] }], rows: [a, b] }];
|
|
165
|
+
d.innerHTML = S.timelineHtml([a, b], { jira: null }, 'year', { now, groups: groups2, trackPx: 1100 }).html;
|
|
166
|
+
const solid = [...d.querySelectorAll('.tg-pg .tg-span')].map((x) => x.className);
|
|
167
|
+
// batch 10 item 3 (Email OTP): a hold with no return date, then no dated work until the Build tasks in March. The rest of the bar
|
|
168
|
+
// starts where those tasks start, not today.
|
|
169
|
+
const e = { key: 'board:e', id: 'e', title: 'Email OTP', start: '2026-06-25', end: '2027-06-09', holds: [{ from: '2026-09-15', to: null, back: null, reason: '' }], gaps: [{ from: '2026-09-10', to: '2027-03-18' }], track: { key: 'build' } };
|
|
170
|
+
d.innerHTML = S.timelineHtml([e], { jira: null }, 'year', { now, trackPx: 1100 }).html;
|
|
171
|
+
const eb = [...d.querySelectorAll('.tg-bar')].map((x) => parseFloat(x.style.left)), eg = d.querySelectorAll('.tg-gap').length;
|
|
172
|
+
d.innerHTML = S.timelineHtml([{ ...e, gaps: [] }], { jira: null }, 'year', { now, trackPx: 1100 }).html;
|
|
173
|
+
const nb = [...d.querySelectorAll('.tg-bar')].map((x) => parseFloat(x.style.left));
|
|
174
|
+
return { five, quarter, spans, solid, eb, eg, nb };
|
|
175
|
+
});
|
|
176
|
+
ok('N2 a hold with no return date, then a plain gap: the rest of the bar starts at the next dated work, later than today', r.eb.length === 2 && r.eg === 1 && r.nb.length === 2 && r.eb[1] > r.nb[1] + 5, JSON.stringify({ eb: r.eb, nb: r.nb, eg: r.eg }));
|
|
177
|
+
ok('N on 5 yr a nine-day past hold is narrower than 8 px and closes up: one whole bar; on Quarter it is a gap', r.five.bars === 1 && r.five.gaps === 0 && r.quarter.gaps === 1 && r.quarter.bars === 2, JSON.stringify(r));
|
|
178
|
+
ok('G the program line is dotted where every member is on hold, solid where one still works', r.spans.join('|') === 'tg-span|tg-span ho|tg-span' && r.solid.every((x) => x === 'tg-span'), JSON.stringify(r));
|
|
179
|
+
await ctx.close();
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/* M the phone: ⏸ only, no dates beside it */
|
|
183
|
+
{
|
|
184
|
+
const { ctx, page: p, errors } = await open({ w: 390, h: 844 });
|
|
185
|
+
const m = await p.evaluate(() => ({ pz: document.querySelectorAll('#ibBody .tg-pz').length, hl: document.querySelectorAll('#ibBody .tg-hl').length, scroll: document.documentElement.scrollWidth <= innerWidth + 1 }));
|
|
186
|
+
ok('M the phone keeps the ⏸ in each gap and no date beside it, with no sideways page scroll', m.pz >= 4 && m.hl === 0 && m.scroll, JSON.stringify(m));
|
|
187
|
+
await shot(p, 'timeline-holds-390');
|
|
188
|
+
await p.click('#ibBody [data-row="board:email-otp"] .tg-pz');
|
|
189
|
+
const sh = await p.evaluate(() => { const h = document.querySelector('#bdPop'); return { sheet: h.classList.contains('sheet'), h4: (h.querySelector('h4') || {}).textContent }; });
|
|
190
|
+
ok('M on a phone the ⏸ press opens the same menu as a sheet', sh.sheet && sh.h4 === 'On hold · 4½ months', JSON.stringify(sh));
|
|
191
|
+
await shot(p, 'timeline-holds-menu-390');
|
|
192
|
+
ok('the phone timeline threw nothing', !errors.length, errors.join('\n'));
|
|
193
|
+
await ctx.close();
|
|
194
|
+
}
|
|
195
|
+
if (shots) {
|
|
196
|
+
for (const [w, h, n] of [[1440, 900, 'timeline-holds-1440-dark'], [390, 844, 'timeline-holds-390-dark']]) { const { ctx, page: p } = await open({ w, h, dark: true }); await shot(p, n); await ctx.close(); }
|
|
197
|
+
}
|
|
198
|
+
return finish();
|
|
199
|
+
})();
|