create-pmos 0.424.0 → 0.426.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.
Files changed (110) hide show
  1. package/package.json +25 -25
  2. package/payload/KIT-VERSION +1 -1
  3. package/payload/planning/evals/eval-calibration.md +1 -1
  4. package/payload/planning/okrs/health-budgets.md +1 -1
  5. package/payload/state/discoveries.md +1 -1
  6. package/workspace/board-deliveries-test.js +153 -0
  7. package/workspace/board-programs-test.js +60 -36
  8. package/workspace/board-shot.js +4 -3
  9. package/workspace/briefing-premium-board-test.js +9 -6
  10. package/workspace/briefing-premium-insights-test.js +31 -15
  11. package/workspace/briefing-premium-products-test.js +46 -43
  12. package/workspace/calm-timeline-test.js +190 -0
  13. package/workspace/changelog.json +24 -0
  14. package/workspace/ev-everywhere-test.js +3 -1
  15. package/workspace/guide/briefing-premium.md +3 -2
  16. package/workspace/guide/claude-proposes.md +16 -1
  17. package/workspace/guide/home.md +2 -2
  18. package/workspace/guide/index.md +1 -0
  19. package/workspace/guide/notes.md +39 -1
  20. package/workspace/guide/present-in-a-meeting.md +57 -0
  21. package/workspace/guide/programs.md +4 -3
  22. package/workspace/lib/board-premium.js +3 -1
  23. package/workspace/lib/briefing-premium-products.js +18 -4
  24. package/workspace/lib/chat-file-locate.js +40 -2
  25. package/workspace/lib/engine/boards.js +8 -2
  26. package/workspace/lib/idle-close.js +60 -0
  27. package/workspace/lib/loose-proposals.js +302 -0
  28. package/workspace/lib/meeting-focus.js +64 -14
  29. package/workspace/lib/my-work-premium.js +1 -1
  30. package/workspace/lib/proposal-runs.js +77 -2
  31. package/workspace/lib/propose-cli.js +42 -1
  32. package/workspace/lib/route-modules.js +1 -0
  33. package/workspace/lib/routes-boards.js +16 -4
  34. package/workspace/lib/routes-brief-page.js +9 -1
  35. package/workspace/lib/routes-briefing-premium.js +19 -0
  36. package/workspace/lib/routes-loose.js +210 -0
  37. package/workspace/lib/routes-meeting-focus.js +28 -6
  38. package/workspace/lib/routes-pm-items.js +27 -17
  39. package/workspace/lib/settings-store.js +2 -1
  40. package/workspace/lib/task-cli.js +18 -11
  41. package/workspace/milestone-pins-test.js +170 -0
  42. package/workspace/package-lock.json +2 -2
  43. package/workspace/package.json +1 -1
  44. package/workspace/premium-board-actions-test.js +2 -1
  45. package/workspace/premium-briefing-depth-test.js +2 -2
  46. package/workspace/premium-chat-term-test.js +13 -2
  47. package/workspace/premium-core-doc-issue-test.js +1 -1
  48. package/workspace/premium-rec-now-test.js +153 -0
  49. package/workspace/premium-rec-tab-test.js +167 -0
  50. package/workspace/product-lane-test.js +30 -17
  51. package/workspace/public/pm/bd-acts.js +6 -3
  52. package/workspace/public/pm/bd-deliveries.js +218 -0
  53. package/workspace/public/pm/bd-pin-card.css +16 -0
  54. package/workspace/public/pm/bd-pin-card.js +80 -0
  55. package/workspace/public/pm/bd-pins.js +33 -0
  56. package/workspace/public/pm/bd-pop.js +2 -0
  57. package/workspace/public/pm/bd-prog.js +5 -4
  58. package/workspace/public/pm/bd-span.js +140 -102
  59. package/workspace/public/pm/cozy-aud.css +9 -0
  60. package/workspace/public/pm/cozy-aud.js +80 -0
  61. package/workspace/public/pm/cozy-board.css +73 -11
  62. package/workspace/public/pm/cozy-home.css +16 -1
  63. package/workspace/public/pm/cozy-live-pill.js +3 -0
  64. package/workspace/public/pm/cozy-pick.css +41 -0
  65. package/workspace/public/pm/cozy-pick.js +134 -0
  66. package/workspace/public/pm/cozy-rec-bridge.js +32 -0
  67. package/workspace/public/pm/cozy-rec-now.css +104 -0
  68. package/workspace/public/pm/cozy-rec-now.js +330 -0
  69. package/workspace/public/pm/cozy-rec-present.css +69 -0
  70. package/workspace/public/pm/cozy-rec-present.js +467 -0
  71. package/workspace/public/pm/cozy-rec-tab.css +90 -0
  72. package/workspace/public/pm/cozy-rec-tab.js +219 -0
  73. package/workspace/public/pm/cozy-settings.js +8 -2
  74. package/workspace/public/pm/cozy-today.css +4 -0
  75. package/workspace/public/pm/home-app.js +51 -22
  76. package/workspace/public/pm/home-data.js +5 -3
  77. package/workspace/public/pm/home-list.js +63 -15
  78. package/workspace/public/pm/home-more.js +2 -31
  79. package/workspace/public/pm/home-today.js +19 -9
  80. package/workspace/public/pm/ini-tasks.js +4 -1
  81. package/workspace/public/pm/live-model.js +1 -1
  82. package/workspace/public/pm/loose-props.css +54 -0
  83. package/workspace/public/pm/loose-props.js +262 -0
  84. package/workspace/public/pm/premium-board.js +65 -30
  85. package/workspace/public/pm/premium-insights.js +42 -24
  86. package/workspace/public/pm/premium-meeting.js +17 -4
  87. package/workspace/public/pm/premium-mtg-present.js +4 -3
  88. package/workspace/public/pm/premium-report-read.js +2 -0
  89. package/workspace/public/pm/premium-vw-mtg.js +15 -7
  90. package/workspace/public/pm/rec-state.js +13 -5
  91. package/workspace/public/pm/rec-tab-core.js +92 -0
  92. package/workspace/public/pm/term-view.js +81 -10
  93. package/workspace/public/pm/view-notes.js +9 -0
  94. package/workspace/public/premium-aud.html +22 -0
  95. package/workspace/public/premium-board.html +2 -0
  96. package/workspace/public/premium-insights.html +2 -1
  97. package/workspace/public/premium-rec.html +30 -0
  98. package/workspace/public/premium.html +1 -0
  99. package/workspace/rec-present-test.js +229 -0
  100. package/workspace/server.js +116 -7
  101. package/workspace/skills/loose-propose.skill +39 -0
  102. package/workspace/task-milestones-test.js +15 -6
  103. package/workspace/test-lists/board-deliveries.json +13 -0
  104. package/workspace/test-lists/calm-timeline.json +5 -0
  105. package/workspace/test-lists/loose-props.json +9 -0
  106. package/workspace/test-lists/milestone-pins.json +6 -0
  107. package/workspace/test-lists/rec-now.json +6 -0
  108. package/workspace/test-lists/rec-present.json +13 -0
  109. package/workspace/test-lists/recording-tab.json +13 -0
  110. package/workspace/timeline-holds-test.js +44 -42
@@ -0,0 +1,167 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+ /* premium-rec-tab-test.js — a meeting records in its own tab (batch 12 item 1, slice S1; canvas In development, XrtA1Tab, XrtA7Room,
4
+ * XrtA2Board, XrtA6States). Serves the real /premium-viewer.html, /premium-rec.html and /premium-board.html from the real server; the notes
5
+ * and the calendar are answered by stand-ins (fixtures/premium-viewer-fixtures.js) for the whole browser context, so the recording tab
6
+ * reads what the Viewer wrote. The recorder is the stand-in that makes the console's requests and opens no microphone; its picture is
7
+ * a canvas stream. The suite asks for the recording tab with window.__pmRecOwnTab (a browser under automation records in place otherwise).
8
+ * T1 Record opens the recording tab, which listens · T2 other pages never pause it: their snippet, and its press brings the tab forward
9
+ * T3 the tab: room, a shared screen, sharing stopped, not hearing the meeting, past the end, highlight marks · T4 the next meeting asks
10
+ * T5 Pause, Resume, Stop · T6 a phone
11
+ * Every wait polls the page; no fixed sleep stands in for a state. */
12
+ const path = require('path');
13
+ const { spawn } = require('child_process');
14
+ const { findBrowser } = require('./lib/find-browser');
15
+ const T = require('./test-run').configure({ name: 'premium-rec-tab' });
16
+ const F = require('./fixtures/premium-viewer-fixtures.js');
17
+
18
+ const BASE = T.BASE, until = F.until;
19
+ const results = [];
20
+ const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + String(extra).slice(0, 500) : ''}`); };
21
+ let srv = null; let browser = null;
22
+ const finish = async (code) => {
23
+ if (browser) await browser.close().catch(() => {});
24
+ if (srv) { try { srv.kill('SIGKILL'); } catch { /* gone */ } }
25
+ T.killTmux();
26
+ const bad = results.filter((x) => !x.cond).length;
27
+ console.log(`\n${results.length - bad}/${results.length} premium-rec-tab assertions passed`);
28
+ process.exit(code !== undefined ? code : (bad ? 1 : 0));
29
+ };
30
+ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
31
+
32
+ /* the stand-in recorder's picture: a canvas stream, shared or not, its screenshots paused or not, the meeting heard or not */
33
+ const SCREEN = () => {
34
+ window.__pmRecOwnTab = true;
35
+ const wire = () => {
36
+ const R = window.__premiumRecorder; if (!R) return;
37
+ R.screen = () => window.__rtScr || { track: null, shared: false, paused: false, silent: false };
38
+ R.shots = (on) => { if (!window.__rtScr) return false; window.__rtScr.paused = !!on; return true; };
39
+ };
40
+ wire(); document.addEventListener('DOMContentLoaded', wire);
41
+ window.__rtShare = () => {
42
+ const c = document.createElement('canvas'); c.width = 320; c.height = 180;
43
+ const g = c.getContext('2d'); g.fillStyle = '#2346a0'; g.fillRect(0, 0, 320, 180);
44
+ const track = c.captureStream(5).getVideoTracks()[0];
45
+ window.__rtScr = { track, shared: true, paused: false, silent: false };
46
+ return track.id;
47
+ };
48
+ };
49
+
50
+ async function context(o = {}) {
51
+ const ctx = await browser.newContext({ viewport: { width: o.w || 1280, height: o.h || 860 } });
52
+ const S = await F.install(ctx, { noLive: true });
53
+ await ctx.addInitScript(F.RECORDER);
54
+ await ctx.addInitScript(SCREEN);
55
+ const errors = [];
56
+ ctx.on('page', (pg) => pg.on('pageerror', (e) => errors.push(String((e && e.message) || e))));
57
+ return { ctx, S, errors };
58
+ }
59
+
60
+ (async () => {
61
+ const exe = findBrowser();
62
+ if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the suite cannot run'); return finish(1); }
63
+ let chromium;
64
+ try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
65
+ srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
66
+ await T.waitForServer(BASE);
67
+ browser = await chromium.launch({ executablePath: exe });
68
+ const W = F.world();
69
+ const posted = (S, pth) => S.posts.filter((x) => x.path === pth);
70
+
71
+ /* T1 Record on a meeting in the Viewer opens the recording tab, and the tab listens */
72
+ const A = await context();
73
+ const p = await A.ctx.newPage();
74
+ p.on('pageerror', (e) => A.errors.push(String((e && e.message) || e)));
75
+ await p.goto(BASE + '/premium-viewer.html?open=meeting&event=ev-live&date=' + F.dayKey(W.LIVE));
76
+ await until(() => p.evaluate(() => !!document.querySelector('#czViewer .czs-sum [data-a="record"]')), 15000);
77
+ await p.$eval('#czViewer [data-a="record"]', (b) => b.click());
78
+ await until(() => p.$('#czViewer [data-a="recgo"]'));
79
+ const [tab] = await Promise.all([A.ctx.waitForEvent('page'), p.$eval('#czViewer [data-a="recgo"]', (b) => b.click())]);
80
+ ok('T1 Record opens a new tab named for the recording', await until(() => tab.evaluate(() => window.name === 'pmos-rec')));
81
+ await until(() => /premium-rec\.html/.test(tab.url()), 10000);
82
+ ok('T1 the note is made once, by the press, and the tab opens on it', posted(A.S, '/api/notes/new').length === 1 && /premium-rec\.html\?note=new1/.test(tab.url()), tab.url());
83
+ ok('T1 the recording tab listens (POST /api/notes/record), and drops go=1 so a reload does not start again', await until(() => posted(A.S, '/api/notes/record').length === 1 && !/go=1/.test(tab.url()), 12000), tab.url());
84
+ ok('T1 the Viewer says where it went', await until(async () => /opens in its own tab/.test(await p.evaluate(() => document.querySelector('#czViewer').innerText))));
85
+ ok('T1 in the room (no screen) the tab is the light page: no dark stage, no picture', await until(() => tab.evaluate(() => document.getElementById('rt').dataset.mode === 'room' && !document.querySelector('.rt-scr'))), await tab.evaluate(() => document.getElementById('rt').dataset.mode));
86
+ ok('T1 the header is the clock and the title; the browser tab says the clock', await until(() => tab.evaluate(() => /^\d+:\d{2}$/.test(document.getElementById('rtClock').textContent) && document.getElementById('rtTitle').textContent === 'Design crit' && /^\d+:\d{2} · Design crit$/.test(document.title))));
87
+ const bar = await tab.evaluate(() => [...document.querySelectorAll('#rtBar > .rt-b')].map((b) => [b.getAttribute('aria-label'), b.textContent.trim()]));
88
+ ok('T1 the bar is icon only: Highlight, Pause, then the red Stop (no screenshots toggle in the room)', JSON.stringify(bar.map((x) => x[0])) === JSON.stringify(['Highlight the last 30 seconds', 'Pause', 'Stop the recording']) && bar.every((x) => x[1] === ''), JSON.stringify(bar));
89
+ ok('T1 the slots for the Now panel and Present are in the bar', await tab.evaluate(() => !!document.querySelector('#rtBar [data-slot="now"]') && !!document.querySelector('#rtBar [data-slot="present"]')));
90
+ ok('T1 links in the recording tab open in the other PMOS tab', await tab.evaluate(() => document.querySelector('base').target === 'pmos-main') && await p.evaluate(() => window.name === 'pmos-main'));
91
+
92
+ /* T2 other pages: nothing pauses; the snippet only shows, and its press brings the recording tab forward */
93
+ await tab.evaluate(() => { window.__stay = 1; });
94
+ await p.reload();
95
+ ok('T2 the Viewer shows it live in its own tab: one press, Go to the recording tab, and no Pause or Stop here', await until(() => p.evaluate(() => !!document.querySelector('#czViewer .czs-sum [data-a="rectab"]') && !document.querySelector('#czViewer .czs-sum [data-a="pause"], #czViewer .czs-sum [data-a="stop"]')), 15000), await p.evaluate(() => (document.querySelector('#czViewer .czs-sum') || {}).innerText || ''));
96
+ const pagesBefore = A.ctx.pages().length;
97
+ await p.click('#czViewer [data-a="rectab"]'); // a real press: the browser lets a press open or find a tab
98
+ ok('T2 the press brings the same tab forward: no new tab, and the recording tab was not reloaded', await until(() => tab.evaluate(() => window.__stay === 1)) && A.ctx.pages().length === pagesBefore);
99
+ // the PM moves by PMOS's own links (a page's navigation keeps the tab's link to the recording tab, as the menu does), not by the address bar
100
+ const walk = async (u) => { await Promise.all([p.waitForURL('**' + u, { waitUntil: 'load' }), p.evaluate((x) => { location.assign(x); }, u)]); await until(() => p.evaluate(() => !!window.czRecording), 15000); };
101
+ await walk('/premium-board.html');
102
+ await walk('/premium-insights.html');
103
+ await walk('/premium-board.html');
104
+ ok('T2 moving between Board, Insights and Board in the other tab never pauses the meeting', posted(A.S, '/api/notes/pause').length === 0 && await tab.evaluate(() => document.getElementById('rt').dataset.mode === 'room' && window.__stay === 1));
105
+ ok('T2 Board\'s Live pill leads with the red dot and the running clock', await until(() => p.evaluate(() => { const l = document.getElementById('czLive'); return !!l && !l.hidden && l.classList.contains('recp') && /\d+:\d{2}/.test(l.textContent); }), 15000));
106
+ await p.$eval('#czLive', (b) => b.click());
107
+ await until(() => p.$('#czLiveList [data-lv^="rec:"]'));
108
+ const row = await p.evaluate(() => { const a = document.querySelector('#czLiveList [data-lv^="rec:"]'); return { href: a.getAttribute('href'), btns: a.querySelectorAll('button').length }; });
109
+ ok('T2 the snippet is the pill\'s first row: it points at the recording tab and holds no control', row.href === '/premium-rec.html?note=new1' && row.btns === 0, JSON.stringify(row));
110
+ await p.click('#czLiveList [data-lv^="rec:"]');
111
+ await p.waitForTimeout(500); // a link that was followed would be loading by now
112
+ ok('T2 pressing it brings the recording tab forward; Board stays where it is', await until(() => tab.evaluate(() => window.__stay === 1)) && /premium-board\.html/.test(p.url()) && await p.evaluate(() => !!window.czRecording) && A.ctx.pages().length === pagesBefore, p.url());
113
+
114
+ /* T3 the tab's states */
115
+ await tab.evaluate(() => window.__rtShare());
116
+ ok('T3 a shared screen: the dark stage shows the picture live', await until(() => tab.evaluate(() => document.getElementById('rt').dataset.mode === 'screen' && !!document.querySelector('.rt-scr video') && document.querySelector('.rt-scr video').srcObject.getVideoTracks()[0].id === window.__rtScr.track.id)));
117
+ ok('T3 with a screen the bar adds Pause the screenshots', await until(() => tab.evaluate(() => !!document.querySelector('#rtBar [data-a="shots"]'))));
118
+ await tab.$eval('#rtBar [data-a="shots"]', (b) => b.click());
119
+ ok('T3 pressing it pauses the screenshots and says how to keep them again', await until(() => tab.evaluate(() => window.__rtScr.paused === true && document.querySelector('#rtBar [data-a="shots"]').getAttribute('aria-label') === 'Keep screenshots again')));
120
+ await tab.evaluate(() => { window.__rtScr.track.stop(); window.__rtScr.track = null; });
121
+ ok('T3 the share ends: Sharing stopped, with Share again, and the sound goes on', await until(() => tab.evaluate(() => /Sharing stopped/.test(document.querySelector('.rt-scr.off').textContent) && !!document.querySelector('.rt-scr.off [data-a="share"]'))));
122
+ await tab.evaluate(() => { window.__rtScr.silent = true; });
123
+ ok('T3 not hearing the meeting: an amber line with Share again', await until(() => tab.evaluate(() => { const a = document.getElementById('rtAlert'); return !a.hidden && /Not hearing the meeting/.test(a.textContent) && !!a.querySelector('[data-a="share"]'); })));
124
+ // wait for the state, not a moment: the page's recording state says silent (the heartbeat landed and the notes were read again), then the open list shows it
125
+ ok('T3 every other page learns it from the recording tab\'s heartbeat', await until(() => p.evaluate(() => window.czRecording.state().then((s) => s.on && s.silent === true)), 20000));
126
+ ok('T3 every other page says it too, on the snippet', await until(async () => { await p.evaluate(() => { const l = document.getElementById('czLive'); if (l && l.getAttribute('aria-expanded') !== 'true') l.click(); }); return p.evaluate(() => /Not hearing the meeting/.test((document.querySelector('#czLiveList [data-lv^="rec:"]') || {}).textContent || '')); }, 20000));
127
+ await tab.evaluate(() => { window.__rtScr.silent = false; });
128
+ const n = A.S.store.new1;
129
+ n.recorded_from = new Date(Date.now() - 40 * 60000).toISOString();
130
+ n.meeting = { ...(n.meeting || {}), kind: 'event', title: 'Design crit', end: new Date(Date.now() - 60000).toISOString() };
131
+ n.highlights = [{ t: 5 * 60000, text: 'Issue is the blue button.' }];
132
+ ok('T3 past the calendar end: the clock turns amber with Past HH:MM end', await until(() => tab.evaluate(() => document.getElementById('rt').classList.contains('late') && /^Past \d{2}:\d{2} end$/.test(document.getElementById('rtPast').textContent)), 12000));
133
+ ok('T3 a highlight is a mark on the meeting-so-far line; its card says the moment', await until(() => tab.evaluate(() => { const b = document.querySelector('#rtLine .rt-star'); return !!b && /Highlight at 5:00: Issue is the blue button\./.test(b.getAttribute('aria-label')) && /5:00/.test(document.querySelector('#rtLine .rt-hv').textContent); }), 12000));
134
+ await tab.$eval('#rtBar [data-a="hl"]', (b) => b.click());
135
+ ok('T3 Highlight starts the recorder\'s highlight', await until(() => tab.evaluate(() => window.__premiumRecorder._hl === 1)));
136
+
137
+ /* T4 the next meeting while this one records: the recording tab asks once */
138
+ await p.evaluate(() => new BroadcastChannel('pmos-rec').postMessage({ id: 'new1', switchTo: { title: 'Rail review', body: { title: 'Rail review' } }, at: Date.now() }));
139
+ ok('T4 the recording tab asks: Stop Design crit and record Rail review?', await until(() => tab.evaluate(() => /Stop Design crit and record Rail review\?/.test(document.getElementById('rtAsk').textContent))));
140
+ await tab.$eval('#rtAsk [data-a="askno"]', (b) => b.click());
141
+ ok('T4 Keep recording closes the question, and nothing is stopped', await until(() => tab.evaluate(() => document.getElementById('rtAsk').hidden)) && posted(A.S, '/api/notes/stop').length === 0);
142
+
143
+ /* T5 Pause, Resume, Stop */
144
+ await tab.$eval('#rtBar [data-a="pause"]', (b) => b.click());
145
+ ok('T5 Pause pauses the recorder, and the tab says Paused with Resume', await until(() => posted(A.S, '/api/notes/pause').length === 1 && tab.evaluate(() => document.getElementById('rt').dataset.mode === 'paused' && !!document.querySelector('#rtBar [data-a="resume"]') && /Paused/.test(document.title))));
146
+ await tab.$eval('#rtBar [data-a="resume"]', (b) => b.click());
147
+ ok('T5 Resume listens again in this tab', await until(() => posted(A.S, '/api/notes/record').length === 2 && tab.evaluate(() => ['room', 'screen'].includes(document.getElementById('rt').dataset.mode))));
148
+ await until(() => tab.$('#rtBar [data-a="stop"]'));
149
+ await tab.$eval('#rtBar [data-a="stop"]', (b) => b.click());
150
+ ok('T5 Stop asks first, with the one labelled confirm', await until(() => tab.evaluate(() => /Stop the recording\?/.test(document.getElementById('rtAsk').textContent) && !!document.querySelector('#rtAsk [data-a="stopgo"]'))));
151
+ await tab.$eval('#rtAsk [data-a="stopgo"]', (b) => b.click());
152
+ ok('T5 Stop stops the recorder, and the tab then shows the meeting\'s notes', await until(() => posted(A.S, '/api/notes/stop').length === 1 && /premium-viewer\.html\?open=meeting&note=new1/.test(tab.url()), 15000), tab.url());
153
+ ok('T5 no page error', A.errors.length === 0, A.errors.join(' | '));
154
+ await A.ctx.close();
155
+
156
+ /* T6 a phone: no sideways scroll, and the bar fits */
157
+ const B = await context({ w: 390, h: 844 });
158
+ B.S.store.n2 = { ...W.LIVE_NOTE }; B.S.rows.push({ ...W.ROWS[2] });
159
+ const q = await B.ctx.newPage();
160
+ await q.addInitScript(() => { window.__premiumHolding = { id: 'n2' }; });
161
+ await q.goto(BASE + '/premium-rec.html?note=n2');
162
+ await until(() => q.evaluate(() => !!document.getElementById('rtTitle') && document.getElementById('rtTitle').textContent === 'Design crit'), 12000);
163
+ const fl = await q.evaluate(() => ({ over: document.documentElement.scrollWidth - innerWidth }));
164
+ ok('T6 on a phone the recording view has no sideways scroll', fl.over <= 0, JSON.stringify(fl));
165
+ await B.ctx.close();
166
+ finish();
167
+ })();
@@ -3,13 +3,16 @@
3
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
4
  * PlmA1Board, PlmA2Folded, PlmA3Phone, sticky plmRules). Serves the real page from the real server; GET /api/board-premium answers All products,
5
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
6
+ * Since the calmer timeline (feedback batch 13 item 4, XcalmA2Folded) the lane is the roll-up of a FOLDED product; open, the head row draws
7
+ * nothing (its rows say it), and no ◇ carries a date under it.
8
+ * O open, the head row is plain: the name and the fold, an empty track, no goal dots
9
+ * L folded, the lane: the product's head row carries every milestone of its initiatives (the ◇ tasks and each row's end ◇), the same ◇ (filled
10
+ * done, orange late), close ones merged into a counted ◇, a thin line from the first start to the last end, the last end as its one label
8
11
  * H hover on a single ◇ names the milestone and its initiative
9
12
  * 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
+ * F folded, the head shows one dot per initiative off track, no count
14
+ * S no span puts a date under a ◇
15
+ * Q the phone: ◇ only; a tap on the folded lane opens a sheet with the product's milestones in date order
13
16
  * SHOTS_17=<dir>: the Board, the counted ◇'s list, folded and the phone sheet, into <dir>. */
14
17
  const path = require('path');
15
18
  const { spawn } = require('child_process');
@@ -97,20 +100,30 @@ function model() {
97
100
  tm: [...r.querySelectorAll('.tg-tm')].map((x) => x.className + '|' + x.getAttribute('title')),
98
101
  tmc: [...r.querySelectorAll('.tg-tmc')].map((x) => x.className + '|' + x.textContent),
99
102
  tml: [...r.querySelectorAll('.tg-tml')].map((x) => x.textContent),
103
+ endl: [...r.querySelectorAll('.tg-endl')].map((x) => x.textContent), dots: [...r.querySelectorAll('.tg-offd .cz-dot')].map((x) => x.className), gd: r.querySelectorAll('.bd-gd').length,
100
104
  };
101
105
  }, key);
102
106
 
103
- /* L H P — desktop, Year */
107
+ /* O — open, desktop, Year */
104
108
  {
105
109
  const { ctx, page: p, errors } = await open();
106
110
  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));
111
+ ok('O open, each product\'s head row is plain: its name cell with the fold, an empty track, no goal dots (batch 13 item 4)', a && b && /pmos-scarlet/.test(a.name) && !a.span && !b.span && !a.tm.length && !a.tmc.length && !a.endl.length && !a.gd, JSON.stringify({ a, b }));
112
+ ok('the open Board threw nothing', !errors.length, errors.join('\n'));
113
+ await ctx.close();
114
+ }
115
+
116
+ /* L H P — folded, desktop, Year */
117
+ {
118
+ const { ctx, page: p, errors } = await open({ fold: ['p:pmos-scarlet', 'p:pmos-idpf'] });
119
+ const a = await laneOf(p, 'p:pmos-scarlet'), b = await laneOf(p, 'p:pmos-idpf');
120
+ ok('L folded, each product\'s head row is a lane: its name cell with the fold, its track with a thin line and its last end', a && b && /pmos-scarlet/.test(a.name) && a.span >= 1 && b.span >= 1 && a.endl.join() === 'Mar ’27', JSON.stringify({ a, b }));
121
+ ok('L the lane rolls up the ◇ tasks and each end ◇ of its initiatives; Dec 11 and Dec 18 merge into one counted ◇; no date under a ◇',
122
+ 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.length, JSON.stringify(a));
110
123
  ok('L the same ◇: late is orange, the Evaluate task IS the end ◇ (said once), a plain end ◇ is named Deliver',
111
124
  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
125
  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));
126
+ 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.tm.length === 2 && b.tm.every((x) => /Apr 30|Jun 30/.test(x)), JSON.stringify(b));
114
127
  const lg = await p.evaluate(() => (document.querySelector('.tg-lgd') || {}).textContent || '');
115
128
  ok('L the legend gets no new entry', !/lane|product/i.test(lg), lg);
116
129
  await shot(p, 'lane-board-1440');
@@ -120,7 +133,7 @@ function model() {
120
133
  await shot(p, 'lane-list-1440');
121
134
  await p.click('.tg-msp [data-ms-ini="board:passkey"]');
122
135
  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')));
136
+ ok('P a line opens its initiative', await p.evaluate(() => !document.querySelector('.tg-msp') && (!!document.querySelector('#ibBody [data-row="board:passkey"].sel') || /Passkey sign-in/.test((document.querySelector('.cz-vw-title') || {}).textContent || ''))));
124
137
  ok('the Board threw nothing', !errors.length, errors.join('\n'));
125
138
  await ctx.close();
126
139
  }
@@ -130,18 +143,18 @@ function model() {
130
143
  const { ctx, page: p } = await open({ fold: ['p:pmos-scarlet', 'p:pmos-idpf'] });
131
144
  const a = await laneOf(p, 'p:pmos-scarlet');
132
145
  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 }));
146
+ ok('F folded, the head shows one dot per initiative off track (Passkey\'s late milestone) and no count', a && a.n === '' && a.dots.length === 1 && /late/.test(a.dots[0]) && rows === 0, JSON.stringify({ a, rows }));
134
147
  await shot(p, 'lane-folded-1440');
135
148
  await ctx.close();
136
149
  }
137
150
 
138
151
  /* S — Quarter and 5 yr */
139
152
  {
140
- const { ctx, page: p } = await open({ span: 'quarter' });
153
+ const { ctx, page: p } = await open({ span: 'quarter', fold: ['p:pmos-scarlet'] });
141
154
  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));
155
+ ok('S Quarter puts no date under a ◇: the hover says it (batch 13 item 4)', a && !a.tml.length && (a.tm.length + a.tmc.length) >= 1, JSON.stringify(a));
143
156
  await ctx.close();
144
- const { ctx: c5, page: p5 } = await open({ span: 'y5' });
157
+ const { ctx: c5, page: p5 } = await open({ span: 'y5', fold: ['p:pmos-scarlet'] });
145
158
  const a5 = await laneOf(p5, 'p:pmos-scarlet');
146
159
  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
160
  await c5.close();
@@ -149,13 +162,13 @@ function model() {
149
162
 
150
163
  /* Q — the phone */
151
164
  {
152
- const { ctx, page: p, errors } = await open({ w: 390, h: 844, phone: true });
165
+ const { ctx, page: p, errors } = await open({ w: 390, h: 844, phone: true, fold: ['p:pmos-scarlet'] });
153
166
  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
167
  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
168
  await p.evaluate(() => { const t = document.querySelector('#ibBody .tgq-r.tg-lane[data-lane="p:pmos-scarlet"] > .tg-p'); t.click(); });
156
169
  await p.waitForTimeout(200);
157
170
  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',
171
+ ok('Q a tap on the folded lane opens a sheet with the product\'s milestones in date order',
159
172
  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
173
  await shot(p, 'lane-phone-390');
161
174
  ok('the phone threw nothing', !errors.length, errors.join('\n'));
@@ -7,7 +7,7 @@
7
7
  * Each one is done at once, with Undo in the toast, which writes the opposite line through the same route.
8
8
  * Cancelled and archived the side panel: All, On hold, Cancelled, Archived, each with Resume, Reopen or Restore
9
9
  * Find, Filter (BdFilter) Find: a jump list of the initiatives and the Jira work-items on this Board. Filter: owner, workflow, category, sprint, applied as
10
- * the PM picks; the "Showing" bar above the view lists what is on (the page's filter state F)
10
+ * the PM picks, and on the timeline which milestones it draws (pm/bd-pin-card.js); the "Showing" bar above the view lists what is on (the page's filter state F)
11
11
  * Sprints and releases (BdSprint) the chip's popover: the Jira sprints, the releases, the backlog; a release opens its panel (work-items done, days
12
12
  * left, the initiatives it carries, your sign-off, the backlog preview). Sprint moves are proposals that go to Home.
13
13
  * A metric's trend (BdPanel) a chip's popover: the count week by week where the records allow it, "Show only …" and Insights
@@ -23,6 +23,7 @@ import * as Pop from './bd-pop.js';
23
23
  import * as V from './bd-views.js';
24
24
  import * as Asks from './bd-asks.js';
25
25
  import * as WF from './bd-wf.js';
26
+ import * as Pins from './bd-pin-card.js';
26
27
  import { holdSpans, holdWords, holdRange, md } from './bd-span.js';
27
28
 
28
29
  const SV = (d) => `<svg viewBox="0 0 24 24" aria-hidden="true"><path d="${d}"/></svg>`;
@@ -42,7 +43,7 @@ const plural = (n, a, b) => (n === 1 ? a : b);
42
43
  const cap = (s) => (s ? s.charAt(0).toUpperCase() + s.slice(1) : '');
43
44
 
44
45
  let A = null; // the page: { M(), load(), say(msg, undo?), panel(html, from, cls), close(), redraw(), F, rowOf(key), statusOf(r), openIni(r), openTicket(ini, tk), askHref(r, q), pageHref(r), trail(r), docMeta(path, ws), loadDocMeta([{ path, ws }]), viewDoc(path) }
45
- export function init(api) { A = api; }
46
+ export function init(api) { A = api; Pins.init(api); }
46
47
  const M = () => A.M();
47
48
  const post = (p, body) => pmPost(p, { ws: M().board.ws, ...body });
48
49
  const errOf = (r) => (r && r.error) || 'Nothing was recorded. The server did not say why.';
@@ -204,6 +205,7 @@ function filterHtml() {
204
205
  return grp + `<p class="bd-mlbl">Owner</p><div class="bd-fg">${owners.map((o) => chip('owners', o, (o === 'No owner' ? '' : V.avatar(o, 'xs')) + esc(o))).join('')}</div>`
205
206
  + (W.list.length > 1 ? `<p class="bd-mlbl">Workflow</p><div class="bd-fg" role="radiogroup" aria-label="Workflow">${W.list.map((w) => { const on = WF.narrowed(W.list) && W.cur.id === w.id; return `<button type="button" class="bd-chip${on ? ' on' : ''}" role="radio" aria-checked="${on}" data-fwf="${esc(w.id)}">${WF.wfIcon(w, 16)}${esc(w.name)}</button>`; }).join('')}</div>` : '')
206
207
  + (cats.length ? `<p class="bd-mlbl">Category</p><div class="bd-fg">${cats.map((k) => chip('cats', k, esc(WF.catLabel(k)))).join('')}</div>` : '')
208
+ + (A.timeline && A.timeline() ? Pins.filterGroup() : '') // which milestones the timeline draws (batch 13 item 4, XcalmA5Milestones)
207
209
  + (sprints.length && (!A.sprintFilter || A.sprintFilter()) ? `<p class="bd-mlbl">Sprint</p><div class="bd-fg">${sprints.map((s) => chip('sprints', s.name, esc(s.name + (s.now ? ' · now' : '')))).join('')}${chip('sprints', 'Backlog')}</div>` : '')
208
210
  + `<div class="bd-arow bd-ffoot"><button type="button" class="bd-btn sm ghost" data-fclear>Clear</button><span class="bd-amut bd-push">Applies as you pick</span></div>`;
209
211
  }
@@ -410,7 +412,8 @@ document.addEventListener('click', async (e) => {
410
412
  const fl = t.closest('[data-flt]'); if (fl && Pop.isOpen() && Pop.el().contains(fl)) { const S = A.F[fl.dataset.flt], v = fl.dataset.v; if (S.has(v)) S.delete(v); else S.add(v); Pop.redraw(filterHtml()); A.redraw(); return; }
411
413
  const fg = t.closest('[data-fgrp]'); if (fg && Pop.isOpen() && Pop.el().contains(fg)) { A.setGrouping(fg.dataset.fgrp === 'product'); Pop.redraw(filterHtml()); return; }
412
414
  const fw = t.closest('[data-fwf]'); if (fw && Pop.isOpen() && Pop.el().contains(fw)) { WF.setPick(fw.getAttribute('aria-checked') === 'true' ? '' : fw.dataset.fwf); Pop.redraw(filterHtml()); A.redraw(); return; }
413
- if (t.closest('[data-fclear]')) { A.F.owners.clear(); A.F.cats.clear(); A.F.sprints.clear(); WF.setPick(''); Pop.redraw(filterHtml()); A.redraw(); return; }
415
+ const mm = t.closest('[data-msmode]'); if (mm && Pop.isOpen() && Pop.el().contains(mm)) { Pins.pickMode(mm); Pop.redraw(filterHtml()); A.redraw(); const b = Pop.el().querySelector(`[data-msmode="${mm.dataset.msmode}"]`); if (b) b.focus(); return; }
416
+ if (t.closest('[data-fclear]')) { A.F.owners.clear(); A.F.cats.clear(); A.F.sprints.clear(); WF.setPick(''); Pins.pickMode({ dataset: { msmode: 'pinned' } }); Pop.redraw(filterHtml()); A.redraw(); return; }
414
417
  const sp = t.closest('[data-sprint]'); if (sp) { const S = A.F.sprints, v = sp.dataset.sprint; if (S.has(v)) S.delete(v); else { S.clear(); S.add(v); } Pop.close(false); A.say(S.has(v) ? 'Showing the initiatives with work in ' + v + '.' : 'Showing every sprint.'); A.redraw(); return; }
415
418
  const rl = t.closest('[data-rel]'); if (rl) { Pop.close(false); openRelease(+rl.dataset.rel, $('#chSprint')); return; }
416
419
  if (t.closest('[data-backlog]')) { Pop.close(false); openRelease(-1, $('#chSprint'), 'backlog'); return; }
@@ -0,0 +1,218 @@
1
+ /* pm/bd-deliveries.js — the Deliveries lane on the Board timeline (feedback batch 13 item 4, calmer timeline A6: XcalmA6Lane, XcalmA6Grill,
2
+ * XcalmA6Fold, XcalmA6Phone). One row under the axis says what lands when: a list per column, the date then the name.
3
+ * · A column is a week on Sprint, a month on Quarter and Half, a quarter on Year, a half on 2 yr and a year on 5 yr.
4
+ * · An entry is a milestone the timeline draws (pm/bd-pins.js shownMs: Pinned, All or None), else the row's committed end named as the row
5
+ * names it (the end milestone's name, else Deliver or Evaluate), else "≈" and the Jira forecast. A program's own milestone has the program icon.
6
+ * Drafts are not in the lane: it shows Live only.
7
+ * · Missed (the date passed, not done) is orange and on top. Done folds away; a past column says "✓ N delivered". Due today says "Today". At risk
8
+ * or slipped is amber, and the hover says the planned date. On hold is grey, with "?" when no return date is set. Same day: off track first, then A–Z.
9
+ * · At most 4 per column, then "+N more" (the list of that column). At 5 yr a busy column shows its count only. The current column has a faint wash.
10
+ * · Hover an entry: its row gets a faint wash and its ◇ a ring (a folded group: the group row). Press opens the initiative (data-key, as the row name).
11
+ * · The lane folds to one line, "Next · Nov 2 MAGW on auth-service · 13 more this year · 1 missed", remembered per person.
12
+ * · A phone shows the next 3 above the rows (missed first), with "All".
13
+ * · Nothing to show (Filter = None, nothing pinned): no lane at all.
14
+ * Pure apart from the remembered fold and wire(), which hooks the hover and the fold onto the Board's body. */
15
+ import { shownMs, msMode } from './bd-pins.js';
16
+ const TICK = '<svg aria-hidden="true" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12l5 5 9-10"/></svg>'; // the delivered mark, drawn (conformance R28-13: no glyph controls)
17
+
18
+ const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
19
+ const WD = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
20
+ const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
21
+ 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; };
22
+ const md = (d) => MON[d.getMonth()] + ' ' + d.getDate();
23
+ const iso = (d) => d.getFullYear() + '-' + String(d.getMonth() + 1).padStart(2, '0') + '-' + String(d.getDate()).padStart(2, '0');
24
+ const midnight = (d) => new Date(d.getFullYear(), d.getMonth(), d.getDate());
25
+ const SV = (d) => `<svg viewBox="0 0 24 24" aria-hidden="true"><path d="${d}"/></svg>`;
26
+ const FLAG = 'M5 21V4M5 4h11l-2 4 2 4H5', PROG = 'M12 3l9 5-9 5-9-5zM3 13l9 5 9-5M3 17.5l9 5 9-5', CHD = 'M7 10l5 5 5-5', CHR = 'M9 6l6 6-6 6';
27
+ const P = (x) => x.toFixed(2) + '%';
28
+ const MAX = 4;
29
+
30
+ /** The lane's column for each span (XcalmA6Grill 1): w week, m month, q quarter, h half, y year. */
31
+ export const COL_UNIT = { sprint: 'w', quarter: 'm', half: 'm', year: 'q', y2: 'h', y5: 'y' };
32
+ const colStart = (u, d) => (u === 'w' ? new Date(d.getFullYear(), d.getMonth(), d.getDate() - ((d.getDay() + 6) % 7))
33
+ : u === 'm' ? new Date(d.getFullYear(), d.getMonth(), 1) : u === 'q' ? new Date(d.getFullYear(), d.getMonth() - (d.getMonth() % 3), 1)
34
+ : u === 'h' ? new Date(d.getFullYear(), d.getMonth() < 6 ? 0 : 6, 1) : new Date(d.getFullYear(), 0, 1));
35
+ const colNext = (u, d) => (u === 'w' ? new Date(d.getFullYear(), d.getMonth(), d.getDate() + 7) : new Date(d.getFullYear(), d.getMonth() + ({ m: 1, q: 3, h: 6 }[u] || 12), 1));
36
+ /** The lane's columns over the window: [{ a, b }], the first and last cut to the window. */
37
+ export function columnsOf(W, span) {
38
+ const u = COL_UNIT[span] || 'm', out = [];
39
+ for (let a = colStart(u, W.from); a < W.to; a = colNext(u, a)) { const b = colNext(u, a); out.push({ a: a < W.from ? W.from : a, b: b > W.to ? W.to : b }); }
40
+ return out;
41
+ }
42
+
43
+ /** The fold, remembered per person. */
44
+ const FOLD_KEY = 'pmos.board.dlFold';
45
+ let FOLD = null;
46
+ export function folded() {
47
+ if (FOLD === null) { let v = null; try { v = localStorage.getItem(FOLD_KEY); } catch { v = null; } FOLD = v === '1'; }
48
+ return FOLD;
49
+ }
50
+ export function setFolded(on) {
51
+ FOLD = !!on;
52
+ try { localStorage.setItem(FOLD_KEY, FOLD ? '1' : '0'); } catch { /* no storage: the fold lasts until the reload */ }
53
+ }
54
+
55
+ const openHold = (r) => (Array.isArray(r.holds) ? r.holds : []).find((h) => h && day(h.from) && !day(h.to)) || null;
56
+ const endName = (r) => (r.track && r.track.k >= 6 ? 'Evaluate' : 'Deliver');
57
+ /** The slip in words: "+1 wk", "+3d". */
58
+ const slipWords = (n) => (n >= 7 ? '+' + Math.round(n / 7) + ' wk' : '+' + n + 'd');
59
+
60
+ /** What lands when: every entry the lane lists, by date. o: { rows, groups, now, progState, mode }. An entry:
61
+ * { key, id, name, date, done, late, risk, hold, back, fc, prog, row, grp, planned, slip } — key: the initiative row (press opens it); prog: the program. */
62
+ export function entriesOf(o) {
63
+ const mode = o.mode || msMode();
64
+ if (mode === 'none') return [];
65
+ const now = midnight(o.now || new Date()), out = [], grp = {};
66
+ for (const g of o.groups || []) {
67
+ if (g.kind === 'program') for (const x of g.products || []) for (const r of x.rows || []) grp[r.key] = 'p:' + g.program.id;
68
+ else for (const r of g.rows || []) grp[r.key] = 'l:' + g.key;
69
+ }
70
+ for (const r of o.rows || []) {
71
+ const s = day(r.start), e = day(r.end), fc = r.track && day(r.track.forecast);
72
+ if (!s && !e && r.draft) continue; // a draft or a proposal is not Live (XcalmA6Grill 9)
73
+ const h = openHold(r), back = h ? day(h.back) : null;
74
+ const base = { key: r.key, row: r, grp: grp[r.key] || '', hold: !!h, back };
75
+ const slip = r.plan && r.plan.slip > 0 ? r.plan.slip : 0;
76
+ const atEnd = (d) => !!(e && +d === +e);
77
+ const one = (id, name, d, done, isEnd) => {
78
+ const late = !done && !h && (d < now || (isEnd && r.over && now > e));
79
+ const risk = !done && !late && !h && isEnd && (r.status === 'at risk' || slip > 0);
80
+ const planned = isEnd && slip ? new Date(d.getFullYear(), d.getMonth(), d.getDate() - slip) : null;
81
+ out.push({ ...base, id, name, date: d, done: !!done, late, risk, fc: false, planned, slip: isEnd ? slip : 0 });
82
+ };
83
+ const dated = (r.milestones || []).filter((m) => m && day(m.date));
84
+ if (dated.length) { for (const m of shownMs(r, mode)) one(m.id, m.name, day(m.date), m.done, atEnd(day(m.date))); continue; }
85
+ if (e) { one('', endName(r), e, !!(r.track && (r.track.k >= 6 && endName(r) === 'Deliver')), true); continue; }
86
+ // only Jira has a date (XcalmA6Grill 8): "≈" and the forecast; PMOS never presents a forecast as a commitment
87
+ if (fc) out.push({ ...base, id: '', name: r.title, date: fc, done: false, late: false, risk: false, fc: true, planned: null, slip: 0 });
88
+ }
89
+ // a program's own milestone (XcalmA6Grill 10): the program icon; it opens the program
90
+ for (const g of o.groups || []) {
91
+ if (g.kind !== 'program' || !o.progState) continue;
92
+ const st = o.progState(g.program) || {};
93
+ for (const m of st.milestones || []) {
94
+ const d = day(m.date); if (!d) continue;
95
+ const first = (o.rows || []).find((r) => (m.waits || []).includes(r.id));
96
+ out.push({ key: first ? first.key : '', id: m.id, name: m.name, date: d, done: !!m.done, late: !!m.late, risk: !m.done && !m.late && !!m.risk, hold: false, back: null, fc: false,
97
+ prog: g.program, from: m.titles || [], row: first || null, grp: 'p:' + g.program.id, planned: null, slip: 0 });
98
+ }
99
+ }
100
+ return out.sort(byDate);
101
+ }
102
+ /** By date; the same day: off track first, then A–Z (XcalmA6Grill 11). */
103
+ const offTrack = (x) => (x.late ? 0 : x.risk || x.hold ? 1 : 2);
104
+ const byDate = (p, q) => p.date - q.date || offTrack(p) - offTrack(q) || String(p.name).localeCompare(String(q.name));
105
+ /** Missed first (orange, on top: XcalmA6Grill 4), then by date. */
106
+ const missedFirst = (p, q) => (q.late - p.late) || byDate(p, q);
107
+
108
+ /** An entry's date words: "Today", "≈ Oct 26", "Mar 1?" for a hold with no return date. */
109
+ const dateWords = (x, now) => (x.fc ? '≈ ' : '') + (+x.date === +midnight(now) ? 'Today' : md(x.date)) + (x.hold && !x.back ? '?' : '');
110
+ const toneOf = (x) => (x.done ? 'dn' : x.late ? 'late' : x.hold ? 'hold' : x.risk ? 'risk' : x.fc ? 'fc' : '');
111
+ /** An entry's hover (XcalmA6Lane): what, when; its state; where it comes from. */
112
+ export function hoverOf(x, now) {
113
+ const head = x.name + ' · ' + WD[x.date.getDay()] + ' ' + md(x.date) + (x.date.getFullYear() !== midnight(now).getFullYear() ? ', ' + x.date.getFullYear() : '');
114
+ const state = x.done ? 'Delivered' : x.late ? 'Missed · due ' + md(x.date) : x.hold ? 'On hold' + (x.back ? ', back ' + md(x.back) : ', no return date')
115
+ : x.fc ? 'Jira forecast · not a commitment' : x.risk ? 'At risk' + (x.planned ? ' · planned ' + md(x.planned) + ' (' + slipWords(x.slip) + ')' : '') : '';
116
+ const from = x.prog ? 'Program milestone · ' + x.prog.title + (x.from && x.from.length ? ' · from ' + x.from.join(', ') : '')
117
+ : [x.row && x.row.title, x.row && x.row.product].filter(Boolean).join(' · ') + ' · press to open';
118
+ return [head, state, from].filter(Boolean).join('\n');
119
+ }
120
+ /** The lines of a list (pm/premium-board.js lanePop): name, initiative, date and tone. */
121
+ const listData = (L) => esc(JSON.stringify(L.map((x) => ({ k: x.key, n: x.name, t: x.prog ? x.prog.title : x.row ? x.row.title : '', d: iso(x.date), s: x.late ? 'late' : x.done ? 'dn' : '' }))));
122
+ const attrs = (x) => (x.prog ? ` data-prog="${esc(x.prog.id)}" data-dl-prog="${esc(x.prog.id)}"` : ` data-key="${esc(x.key)}" data-dl-row="${esc(x.key)}"`)
123
+ + (x.id ? ` data-dl-ms="${esc(x.id)}"` : '') + (x.grp ? ` data-dl-grp="${esc(x.grp)}"` : '');
124
+ function entryHtml(x, now) {
125
+ const t = toneOf(x), tip = hoverOf(x, now);
126
+ return `<button type="button" class="dl-e${t ? ' ' + t : ''}"${attrs(x)} title="${esc(tip)}" aria-label="${esc(tip.replace(/\n/g, '. '))}"><small>${esc(dateWords(x, now))}</small><b>${x.prog ? `<i class="dl-pg">${SV(PROG)}</i>` : ''}<span>${esc(x.name)}</span></b></button>`;
127
+ }
128
+
129
+ /** One column's list (XcalmA6Grill 2, 3, 4). */
130
+ function columnHtml(c, E, now, X, span) {
131
+ const today = midnight(now), past = c.b <= today, cur = c.a <= today && today < c.b;
132
+ const L = E.filter((x) => x.date >= c.a && x.date < c.b);
133
+ const done = L.filter((x) => x.done), show = L.filter((x) => !x.done).sort(missedFirst);
134
+ const w = `width:${P(Math.max(0, X(c.b) - X(c.a)))}`, cls = 'dl-c' + (cur ? ' now' : '');
135
+ let html = '';
136
+ if (span === 'y5' && show.length > MAX) {
137
+ html = `<button type="button" class="dl-more n" data-ms-lane="${listData(L)}" aria-haspopup="menu">${show.length} deliveries</button>`;
138
+ } else {
139
+ html = show.slice(0, MAX).map((x) => entryHtml(x, now)).join('');
140
+ if (show.length > MAX) html += `<button type="button" class="dl-more" data-ms-lane="${listData(L)}" aria-haspopup="menu">+${show.length - MAX} more</button>`;
141
+ }
142
+ // done folds away; a past column says how many landed (XcalmA6Grill 3)
143
+ if (past && done.length) html += `<button type="button" class="dl-dn" data-ms-lane="${listData(done)}" aria-haspopup="menu" aria-label="${done.length} delivered. List them">${TICK} ${done.length} delivered</button>`;
144
+ return `<div class="${cls}" style="${w}">${html}</div>`;
145
+ }
146
+
147
+ /** The folded line (XcalmA6Fold): "Next · Nov 2 MAGW on auth-service · 13 more this year · 1 missed". */
148
+ export function foldWords(E, now) {
149
+ const today = midnight(now), open = E.filter((x) => !x.done && !x.late && x.date >= today), missed = E.filter((x) => x.late).length;
150
+ const next = open[0] || null, more = open.filter((x) => x !== next && x.date.getFullYear() === today.getFullYear()).length;
151
+ const done = E.filter((x) => x.done).length;
152
+ return { next, more, missed, done };
153
+ }
154
+ function foldHtml(E, now) {
155
+ const f = foldWords(E, now), parts = [];
156
+ if (f.more) parts.push(`${f.more} more this year`);
157
+ if (f.missed) parts.push(`<span class="late">${f.missed} missed</span>`);
158
+ const next = f.next ? `<span class="dl-fx">Next</span><button type="button" class="dl-fn"${attrs(f.next)} title="${esc(hoverOf(f.next, now))}"><small class="${toneOf(f.next)}">${esc(dateWords(f.next, now))}</small> ${f.next.prog ? `<i class="dl-pg">${SV(PROG)}</i>` : ''}${esc(f.next.name)}</button>` : '';
159
+ const rest = parts.length ? `<span class="dl-fr">${next ? '· ' : ''}${parts.join(' · ')}</span>` : '';
160
+ const none = !next && !parts.length ? `<span class="dl-fr">${f.done ? TICK + ' ' + f.done + ' delivered' : 'Nothing ahead'}</span>` : '';
161
+ return `<div class="dl-fold">${next}${rest}${none}</div>`;
162
+ }
163
+
164
+ /** The phone's card (XcalmA6Phone): "Next deliveries · N missed", the next 3 (missed first), and All (the list by date). */
165
+ function phoneHtml(E, now) {
166
+ const today = midnight(now), missed = E.filter((x) => x.late), ahead = E.filter((x) => !x.done && !x.late && x.date >= today);
167
+ const L = missed.concat(ahead).slice(0, 3);
168
+ if (!L.length) return '';
169
+ const all = E.filter((x) => !x.done);
170
+ const line = (x) => `<button type="button" class="dl-pl"${attrs(x)} aria-label="${esc(hoverOf(x, now).replace(/\n/g, '. '))}"><small class="${toneOf(x)}">${esc(dateWords(x, now))}</small><b>${x.prog ? `<i class="dl-pg">${SV(PROG)}</i>` : ''}<span>${esc(x.name)}</span></b></button>`;
171
+ return `<section class="dl-ph" aria-label="Next deliveries"><div class="dl-phh"><b>Next deliveries</b>${missed.length ? `<span class="late">· ${missed.length} missed</span>` : ''}<button type="button" class="dl-all" data-ms-lane="${listData(all)}" data-lane-name="Deliveries" aria-haspopup="dialog" aria-label="All deliveries">All</button></div>${L.map(line).join('')}</section>`;
172
+ }
173
+
174
+ /** The lane: the hook pm/bd-span.js calls ({ W, X, rows, groups, now, phone }), with o: { span, progState, mode }. '' when nothing lands. */
175
+ export function laneHtml(c, o = {}) {
176
+ const now = c.now || new Date();
177
+ const E = entriesOf({ rows: c.rows, groups: c.groups, now, progState: o.progState, mode: o.mode })
178
+ .filter((x) => x.date >= c.W.from && x.date < c.W.to);
179
+ if (!E.length) return '';
180
+ if (c.phone) return phoneHtml(E, now);
181
+ const shut = folded();
182
+ const name = `<div class="tg-n dl-n"><span class="dl-ic">${SV(FLAG)}</span><span class="dl-t"><b>Deliveries</b>${shut ? '' : '<small>What lands when</small>'}</span><button type="button" class="dl-fb" data-dl-fold aria-expanded="${!shut}" aria-label="${shut ? 'Open the Deliveries lane' : 'Fold the Deliveries lane to one line'}">${SV(shut ? CHR : CHD)}</button></div>`;
183
+ const body = shut ? foldHtml(E, now) : columnsOf(c.W, o.span).map((col) => columnHtml(col, E, now, c.X, o.span)).join('');
184
+ return `<div class="tg-r tg-dl${shut ? ' shut' : ''}" role="region" aria-label="Deliveries, what lands when">${name}<div class="tg-p dl-p">${body}</div></div>`;
185
+ }
186
+
187
+ /** Hover links the row (XcalmA6Grill 13): the row gets a faint wash and its ◇ a ring; a folded group's row instead. The fold toggles and redraws. */
188
+ export function wire(root, o) {
189
+ if (!root || root.__dl) return;
190
+ root.__dl = true;
191
+ const lit = [];
192
+ const clear = () => { while (lit.length) lit.pop().classList.remove('dl-hl', 'dl-ring'); };
193
+ const on = (el, cls) => { if (el) { el.classList.add(cls); lit.push(el); } };
194
+ const q = (s) => { try { return root.querySelector(s); } catch { return null; } };
195
+ const cs = (v) => (typeof CSS !== 'undefined' && CSS.escape ? CSS.escape(v) : String(v).replace(/["\\]/g, '\\$&'));
196
+ const light = (e) => {
197
+ const x = e.target.closest && e.target.closest('[data-dl-row], [data-dl-prog]'); clear(); if (!x) return;
198
+ const row = x.dataset.dlRow ? q(`.tg-r[data-row="${cs(x.dataset.dlRow)}"], .tgq-r[data-row="${cs(x.dataset.dlRow)}"]`) : null;
199
+ if (row) {
200
+ on(row, 'dl-hl');
201
+ const ms = x.dataset.dlMs ? row.querySelector(`[data-ms-id="${cs(x.dataset.dlMs)}"]`) : null;
202
+ on(ms || row.querySelector('.tg-end'), 'dl-ring');
203
+ return;
204
+ }
205
+ const g = x.dataset.dlProg ? 'p:' + x.dataset.dlProg : x.dataset.dlGrp || '';
206
+ const gr = g.startsWith('p:') ? q(`[data-prow="${cs(g.slice(2))}"]`) : g.startsWith('l:') ? q(`[data-lane="${cs(g.slice(2))}"]`) : null;
207
+ if (gr) { on(gr, 'dl-hl'); const d = gr.querySelectorAll('.tg-pdm, .tg-tmc, .tg-tm'); on(d[d.length - 1], 'dl-ring'); }
208
+ };
209
+ root.addEventListener('mouseover', light);
210
+ root.addEventListener('focusin', light);
211
+ root.addEventListener('mouseleave', clear);
212
+ root.addEventListener('focusout', clear);
213
+ root.addEventListener('click', (e) => {
214
+ if (!e.target.closest('[data-dl-fold]')) return;
215
+ setFolded(!folded()); clear(); o.redraw();
216
+ const b = root.querySelector('[data-dl-fold]'); if (b) b.focus({ preventScroll: true });
217
+ });
218
+ }
@@ -0,0 +1,16 @@
1
+ /* pm/bd-pin-card.css — the ◇ card on the Board timeline (feedback batch 13 item 4, XcalmA5Milestones): the initiative's milestones with a pin each.
2
+ * The card is a pm/bd-pop.js popover; the Filter's "Milestones on the timeline" group uses the Filter's own chips. */
3
+ .bd-pp.bd-pc { padding: 12px 12px 6px; }
4
+ .bd-pc-h { margin: 0; font: 800 13.5px/1.3 var(--cz-sans); color: var(--cz-ink); }
5
+ .bd-pc-sub { margin: 2px 0 6px; font-size: 12px; font-weight: 600; }
6
+ .bd-pc-r { display: flex; align-items: center; gap: 10px; min-height: 44px; border-top: 1px solid var(--cz-hair); }
7
+ .bd-pc-r .tg-tm-i { margin-left: 4px; }
8
+ .bd-pc-n { flex: 1; min-width: 0; font: 700 13px/1.25 var(--cz-sans); color: var(--cz-ink2); overflow-wrap: anywhere; }
9
+ .bd-pc-r.on .bd-pc-n { color: var(--cz-ink); }
10
+ .bd-pc-n small { display: block; font-size: 11.5px; font-weight: 600; color: var(--cz-ink3); }
11
+ .bd-pc-n small.late { color: var(--cz-late); }
12
+ .bd-pc-pin { all: unset; flex: none; width: 32px; height: 32px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; color: var(--cz-ink3); cursor: pointer; }
13
+ .bd-pc-pin svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
14
+ .bd-pc-pin:hover { background: var(--cz-well); }
15
+ .bd-pc-pin.on { color: var(--cz-blue); background: var(--cz-bluebg); }
16
+ .bd-pc-pin:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; }