create-pmos 0.442.0 → 0.444.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 (81) 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/briefing-premium-board-test.js +8 -2
  7. package/workspace/briefing-premium-insights-test.js +40 -38
  8. package/workspace/briefing-premium-test.js +2 -1
  9. package/workspace/changelog.json +24 -0
  10. package/workspace/goals-clear-ui-test.js +263 -0
  11. package/workspace/guide/home.md +12 -2
  12. package/workspace/guide/metric-drafts.md +8 -2
  13. package/workspace/home-railcard-test.js +193 -0
  14. package/workspace/intel-report-ui-test.js +1 -1
  15. package/workspace/intelligence-gaps-ui-test.js +16 -14
  16. package/workspace/lib/board-premium.js +1 -1
  17. package/workspace/lib/engine/boards.js +9 -2
  18. package/workspace/lib/engine/records/index.js +9 -2
  19. package/workspace/lib/initiative-layout.js +3 -1
  20. package/workspace/lib/insights-premium.js +22 -1
  21. package/workspace/lib/metric-drafts.js +37 -10
  22. package/workspace/lib/metric-read-runs.js +20 -13
  23. package/workspace/lib/metric-reads.js +208 -23
  24. package/workspace/lib/metrics-cli.js +62 -5
  25. package/workspace/lib/routes-boards.js +40 -1
  26. package/workspace/lib/routes-goal-status.js +89 -6
  27. package/workspace/lib/routes-insights-premium.js +1 -1
  28. package/workspace/lib/routes-metric-drafts.js +26 -3
  29. package/workspace/live-pill-round-test.js +178 -0
  30. package/workspace/metric-drafts-ui-test.js +5 -2
  31. package/workspace/okr-goals-ui-test.js +27 -23
  32. package/workspace/package-lock.json +2 -2
  33. package/workspace/package.json +1 -1
  34. package/workspace/panels-test.js +231 -0
  35. package/workspace/premium-board-actions-test.js +2 -2
  36. package/workspace/premium-rec-tab-test.js +2 -1
  37. package/workspace/premium-vw-item-test.js +10 -2
  38. package/workspace/premium-vw-jira-test.js +3 -0
  39. package/workspace/public/pm/bd-ini-panel.js +3 -2
  40. package/workspace/public/pm/cozy-adler.js +21 -0
  41. package/workspace/public/pm/cozy-divider.css +32 -0
  42. package/workspace/public/pm/cozy-divider.js +45 -0
  43. package/workspace/public/pm/cozy-insights.css +96 -0
  44. package/workspace/public/pm/cozy-live-pill.css +16 -17
  45. package/workspace/public/pm/cozy-live-pill.js +28 -17
  46. package/workspace/public/pm/cozy-panels.css +59 -0
  47. package/workspace/public/pm/cozy-panels.js +524 -0
  48. package/workspace/public/pm/cozy-today.css +15 -0
  49. package/workspace/public/pm/cozy-viewer.js +173 -69
  50. package/workspace/public/pm/cozy-vw-shell.css +4 -0
  51. package/workspace/public/pm/goals-clear.js +265 -0
  52. package/workspace/public/pm/home-app.js +73 -14
  53. package/workspace/public/pm/home-ini.js +9 -3
  54. package/workspace/public/pm/home-today.js +55 -12
  55. package/workspace/public/pm/ini-edit.js +401 -0
  56. package/workspace/public/pm/ini-groups.js +14 -8
  57. package/workspace/public/pm/ini-tasks.js +84 -26
  58. package/workspace/public/pm/ini-versions.js +18 -4
  59. package/workspace/public/pm/ini-view-model.js +45 -18
  60. package/workspace/public/pm/ini-view.css +117 -5
  61. package/workspace/public/pm/ini-view.js +51 -17
  62. package/workspace/public/pm/metric-drafts.js +4 -1
  63. package/workspace/public/pm/mission.js +11 -7
  64. package/workspace/public/pm/premium-board.js +8 -6
  65. package/workspace/public/pm/premium-insights.js +375 -59
  66. package/workspace/public/pm/task-card.css +2 -0
  67. package/workspace/public/pm/task-card.js +4 -1
  68. package/workspace/server.js +6 -2
  69. package/workspace/skills/metric-read.skill +7 -5
  70. package/workspace/stage-card-tasks-test.js +396 -0
  71. package/workspace/stage-card-test.js +12 -4
  72. package/workspace/task-delete-test.js +9 -1
  73. package/workspace/task-milestones-test.js +3 -3
  74. package/workspace/task-press-test.js +12 -4
  75. package/workspace/task-views-test.js +198 -5
  76. package/workspace/test-lists/batch18-live-pill-round.json +10 -0
  77. package/workspace/test-lists/batch18-panels.json +9 -0
  78. package/workspace/test-lists/goals-clear.json +15 -0
  79. package/workspace/test-lists/home-railcard.json +9 -0
  80. package/workspace/test-lists/stage-card-tasks.json +6 -0
  81. package/workspace/tk-tasks-test.js +2 -2
@@ -0,0 +1,231 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+ /* panels-test.js — panels side by side on Home, like a tablet (feedback batch 18 item 15, build 15-A; canvas TbT1Split … TbT9Divider;
4
+ * public/pm/cozy-panels.js, cozy-viewer.js several Viewers, home-app.js mountPanels).
5
+ * Serves the real page from the real server; GET /api/briefing-premium answers the fixture model (as home-railcard-test.js does).
6
+ * N1 an initiative opens as today's split: the chat, one divider (a separator), the Viewer; ⧉ before × on both headers, no ⤢ on Home
7
+ * N2 a drag of the divider near the middle snaps it at ½; double-click resets it; ← and → move it 24 px
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
+ * N4 ⧉ opens Full screen, Split, Slide over (44 px icons, the current one checked); Split brings the chat back beside
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 half shows the blue drop zone; on the drop it opens in a Viewer of its own beside (TbT6TwoViewers):
12
+ * two Viewers side by side at 1440, the chat slides over; a third replaces the Viewer used least recently
13
+ * N7 at 1920 the chat and two Viewers sit side by side with two dividers (TbT8Wide)
14
+ * N8 the initiative reopens with its last panels (the chat put away is remembered across a reload)
15
+ * N9 Present in a recording slides the chat away; Stop brings it back
16
+ * N10 a phone keeps today's one panel: no divider, no ⧉; dark uses the tokens; no page error anywhere
17
+ * Screenshots go to PMOS_SHOTS when it is set. Every wait polls the page. */
18
+ const fs = require('fs');
19
+ const path = require('path');
20
+ const { spawn } = require('child_process');
21
+ const { findBrowser } = require('./lib/find-browser');
22
+ const T = require('./test-run').configure({ name: 'panels' });
23
+ const B = require('./lib/briefing-premium.js');
24
+ const F = require('./fixtures/briefing-premium-facts.js');
25
+ const BP = require('./lib/board-premium.js');
26
+ const BF = require('./fixtures/board-premium-facts.js');
27
+
28
+ const BASE = T.BASE;
29
+ const SHOTS = process.env.PMOS_SHOTS || '';
30
+ const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
31
+ const until = async (fn, ms = 10000, step = 100) => { const t0 = Date.now(); for (;;) { let v; try { v = await fn(); } catch { v = null; } if (v) return v; if (Date.now() - t0 > ms) return v; await sleep(step); } };
32
+ const results = [];
33
+ const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + String(extra).slice(0, 600) : ''}`); };
34
+ let srv = null; let browser = null;
35
+ const finish = async (code) => {
36
+ if (browser) await browser.close().catch(() => {});
37
+ if (srv) { try { srv.kill('SIGKILL'); } catch { /* gone */ } }
38
+ T.killTmux();
39
+ const bad = results.filter((x) => !x.cond).length;
40
+ console.log(`\n${results.length - bad}/${results.length} panels assertions passed`);
41
+ process.exit(code !== undefined ? code : (bad ? 1 : 0));
42
+ };
43
+ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
44
+
45
+ (async () => {
46
+ const exe = findBrowser();
47
+ if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the panels suite cannot run'); return finish(1); }
48
+ let chromium;
49
+ try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed — the panels suite cannot run'); return finish(1); }
50
+ srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
51
+ await T.waitForServer(BASE);
52
+ browser = await chromium.launch({ executablePath: exe });
53
+
54
+ const open = async ({ w = 1440, h = 900, dark = false, ctx = null, q = '' } = {}) => {
55
+ ctx = ctx || await browser.newContext({ viewport: { width: w, height: h }, colorScheme: dark ? 'dark' : 'light' });
56
+ const page = await ctx.newPage();
57
+ const errors = [];
58
+ page.on('pageerror', (e) => errors.push(String((e && e.message) || e)));
59
+ const json = (r, b) => r.fulfill({ status: 200, contentType: 'application/json', body: JSON.stringify(b) });
60
+ 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
+ await page.route(/\/api\/briefing-premium(\?.*)?$/, (r) => json(r, { ok: true, state: 'ready', model: B.buildMany(F.programFacts()), as_of: Date.now() }));
62
+ await page.route('**/api/programs', (r) => json(r, { ok: true, programs: F.programs() }));
63
+ await page.goto(BASE + '/premium.html' + q);
64
+ const up = await until(() => page.evaluate(() => !!window.czPanels && document.querySelectorAll('#hmList .hv-r.ini .hm-rm').length > 2), 20000);
65
+ const close = async () => { await ctx.unrouteAll({ behavior: 'ignoreErrors' }).catch(() => {}); await ctx.close().catch(() => {}); };
66
+ return { ctx, page, errors, up, close };
67
+ };
68
+ const shot = async (page, name) => { if (!SHOTS) return; await sleep(400); fs.mkdirSync(SHOTS, { recursive: true }); await page.screenshot({ path: path.join(SHOTS, name + '.png') }); };
69
+ /** what the page shows: each panel's box and mode, the dividers, the rail */
70
+ const lay = (page) => page.evaluate(() => {
71
+ 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' }; };
72
+ const P = window.czPanels.list();
73
+ return {
74
+ panels: P.map((p) => ({ ...p, box: box(p.id === 'chat' ? document.getElementById('hmChat') : document.querySelector(`[data-cz-panel="${p.id}"]`)) })),
75
+ divs: [...document.querySelectorAll('.cz-pn-div')].map((d) => ({ ...box(d), role: d.getAttribute('role'), first: d.dataset.k === '0' })),
76
+ rail: window.czViewer.railOn(), list: Math.round(document.getElementById('hmList').getBoundingClientRect().width),
77
+ };
78
+ });
79
+ const P = (l, id) => l.panels.find((p) => p.id === id) || null;
80
+ const rows = (page) => page.evaluate(() => [...document.querySelectorAll('#hmList .hv-r.ini .hm-rm[data-hm-sel]')].map((b) => b.dataset.hmSel));
81
+ /** drag from the centre of a selector's element to (x, y) in steps, as a mouse does */
82
+ const drag = async (page, from, x, y, { hold } = {}) => {
83
+ const r = typeof from === 'string' ? await page.evaluate((s) => { const b = document.querySelector(s).getBoundingClientRect(); return { x: b.left + b.width / 2, y: b.top + b.height / 2 }; }, from) : from;
84
+ await page.mouse.move(r.x, r.y); await page.mouse.down();
85
+ for (let i = 1; i <= 12; i++) { await page.mouse.move(r.x + (x - r.x) * i / 12, r.y + (y - r.y) * i / 12); await sleep(16); }
86
+ if (hold) await hold();
87
+ await page.mouse.up();
88
+ };
89
+ const divAt = (page, k = 0) => page.evaluate((i) => { const d = document.querySelectorAll('.cz-pn-div')[i]; const r = d.getBoundingClientRect(); return { x: r.left + r.width / 2, y: r.top + r.height / 2 }; }, k);
90
+
91
+ /* ── 1440: the split, the divider, ⧉, slide over ── */
92
+ const A = await open();
93
+ ok('0 Home draws its rows and window.czPanels', !!A.up);
94
+ const R = await rows(A.page);
95
+ await A.page.click(`#hmList .hm-rm[data-hm-sel="${R[0]}"]`);
96
+ const l1 = await until(() => lay(A.page).then((l) => (P(l, 'v0') && P(l, 'v0').box.shown && l.divs.length === 1 ? l : null)));
97
+ ok('N1 today\'s split: the chat, one divider (a separator), the Viewer', !!l1 && P(l1, 'chat').mode === 'split' && P(l1, 'v0').mode === 'split' && l1.divs[0].role === 'separator'
98
+ && P(l1, 'chat').box.r <= l1.divs[0].l + 12 && l1.divs[0].r <= P(l1, 'v0').box.l + 12, JSON.stringify(l1));
99
+ const heads = await A.page.evaluate(() => ({ vw: [...document.querySelectorAll('#czViewer .cz-vw-hd [data-cz-vw]')].map((b) => b.dataset.czVw), chat: [...document.querySelectorAll('#hmChat .cz-pn-ct button')].map((b) => b.getAttribute('aria-label')) }));
100
+ ok('N1 ⧉ before × on the Viewer\'s header and on the chat; no ⤢ on Home', heads.vw.slice(-2).join() === 'place,close' && !heads.vw.includes('wide') && heads.chat.join('|') === 'Arrange the chat|Put the chat away', JSON.stringify(heads));
101
+ await shot(A.page, 'n1-split-1440');
102
+
103
+ // N2 the divider: near the middle it snaps at ½ of the row
104
+ const d0 = await divAt(A.page);
105
+ const mid = (P(l1, 'chat').box.l + P(l1, 'v0').box.r) / 2;
106
+ await drag(A.page, d0, mid + 9, d0.y);
107
+ const l2 = await until(() => lay(A.page).then((l) => { const c = P(l, 'chat').box, v = P(l, 'v0').box; return Math.abs(c.w - v.w) <= 4 ? l : null; }), 3000);
108
+ ok('N2 a drag near the middle snaps the divider at ½ (the chat and the Viewer as wide)', !!l2, JSON.stringify(l2 && [P(l2, 'chat').box, P(l2, 'v0').box]));
109
+ await A.page.focus('.cz-pn-div');
110
+ const w0 = (await lay(A.page)).panels.find((p) => p.id === 'v0').box.w;
111
+ await A.page.keyboard.press('ArrowLeft');
112
+ const w1 = await until(() => lay(A.page).then((l) => { const w = P(l, 'v0').box.w; return w !== w0 ? w : null; }), 3000);
113
+ ok('N2 ← moves the divider 24 px (the Viewer grows)', w1 === w0 + 24, JSON.stringify([w0, w1]));
114
+ { const d = await divAt(A.page); await A.page.mouse.dblclick(d.x, d.y); } // the divider is 0 wide: its hit area is 20 px around it
115
+ const l2b = await until(() => lay(A.page).then((l) => (Math.abs(P(l, 'chat').box.w - P(l, 'v0').box.w) <= 30 ? l : null)), 3000);
116
+ ok('N2 double-click resets it to about ½', !!l2b, JSON.stringify(l2b && [P(l2b, 'chat').box, P(l2b, 'v0').box]));
117
+
118
+ // N3 to the left edge: the chat slides away, the Viewer is whole, the list folds to a rail
119
+ const d1 = await divAt(A.page);
120
+ await drag(A.page, d1, P(l1, 'chat').box.l + 30, d1.y);
121
+ const l3 = await until(() => lay(A.page).then((l) => (P(l, 'chat').mode === 'away' ? l : null)), 3000);
122
+ ok('N3 a drag to the left edge slides the chat away; the Viewer is whole; the list folds to a rail; no divider', !!l3 && !P(l3, 'chat').box.shown && P(l3, 'v0').full && l3.rail && l3.divs.length === 0 && P(l3, 'v0').box.w > 1100, JSON.stringify(l3));
123
+ await shot(A.page, 'n3-full-1440');
124
+
125
+ // N4 ⧉: three icons, Full checked; Split brings the chat back beside
126
+ await A.page.click('#czViewer [data-cz-vw="place"]');
127
+ const m4 = await until(() => A.page.evaluate(() => { const m = document.querySelector('.cz-pn-menu'); if (!m) return null; return [...m.querySelectorAll('button')].map((b) => ({ n: b.getAttribute('aria-label'), on: b.getAttribute('aria-checked'), w: Math.round(b.getBoundingClientRect().width), h: Math.round(b.getBoundingClientRect().height), text: b.textContent.trim() })); }));
128
+ ok('N4 ⧉ opens Full screen, Split, Slide over: icons only, 44 px, Full screen checked', !!m4 && m4.map((b) => b.n).join('|') === 'Full screen|Split|Slide over' && m4.every((b) => b.w === 44 && b.h === 44 && !b.text) && m4[0].on === 'true', JSON.stringify(m4));
129
+ await shot(A.page, 'n4-menu-1440');
130
+ await A.page.click('.cz-pn-menu [data-cz-pn-place="split"]');
131
+ const l4 = await until(() => lay(A.page).then((l) => (P(l, 'chat').mode === 'split' && P(l, 'chat').box.shown ? l : null)), 3000);
132
+ ok('N4 Split brings the chat back beside the Viewer, with its divider', !!l4 && l4.divs.length === 1 && !P(l4, 'v0').full, JSON.stringify(l4));
133
+
134
+ // N5 slide over: the chat floats over the right side; a drag off the right edge puts it away; slideOver() brings it back
135
+ await A.page.click('#hmChat .cz-pn-ct [data-cz-pn-chat="place"]');
136
+ await until(() => A.page.$('.cz-pn-menu'));
137
+ await A.page.click('.cz-pn-menu [data-cz-pn-place="over"]');
138
+ const l5 = await until(() => lay(A.page).then((l) => (P(l, 'chat').mode === 'over' ? l : null)), 3000);
139
+ const vw5 = await A.page.evaluate(() => innerWidth);
140
+ ok('N5 Slide over: the chat floats 400 px wide at the right, over a whole Viewer, with a grab bar', !!l5 && P(l5, 'chat').box.w === 400 && vw5 - P(l5, 'chat').box.r < 40 && P(l5, 'v0').full
141
+ && await A.page.evaluate(() => !!document.querySelector('#hmChat.cz-pn-over > .cz-pn-grab')), JSON.stringify(l5));
142
+ await shot(A.page, 'n5-over-1440');
143
+ const g = await A.page.evaluate(() => { const r = document.querySelector('#hmChat > .cz-pn-grab').getBoundingClientRect(); return { x: r.left + r.width / 2, y: r.top + r.height / 2 }; });
144
+ await drag(A.page, g, g.x + 200, g.y);
145
+ const l5b = await until(() => lay(A.page).then((l) => (P(l, 'chat').mode === 'away' ? l : null)), 3000);
146
+ ok('N5 a drag off the right edge puts it away; czPanels.away() names it; nothing else opens', !!l5b && !P(l5b, 'chat').box.shown && await A.page.evaluate(() => window.czPanels.away() === 'chat'), JSON.stringify(l5b));
147
+ ok('N5 czPanels.slideOver() brings it back over', await A.page.evaluate(() => window.czPanels.slideOver()) && !!(await until(() => lay(A.page).then((l) => (P(l, 'chat').mode === 'over' && P(l, 'chat').box.shown ? l : null)), 3000)));
148
+ await A.page.evaluate(() => window.czPanels.place('chat', 'split'));
149
+
150
+ // N6 open beside: drag a list row to the right half
151
+ await until(() => lay(A.page).then((l) => (l.divs.length === 1 && !l.rail ? l : null)), 3000);
152
+ const v0r = (await lay(A.page)).panels.find((p) => p.id === 'v0').box;
153
+ let zone = null;
154
+ await A.page.click('#czViewer .cz-vw-hd'); // the Viewer is the panel used last: the chat gives way
155
+ 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 over the right half shows the blue drop zone on that half', !!zone && zone.side === 'right' && zone.w > 200, JSON.stringify(zone));
157
+ 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
+ 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
+ const t6 = await A.page.evaluate(() => [...document.querySelectorAll('.cz-vw:not([hidden]) .cz-vw-title')].map((h) => h.textContent));
160
+ 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));
161
+ await shot(A.page, 'n6-two-viewers-1440');
162
+ // a third row: it replaces the Viewer used least recently (v0, as v1 was used last)
163
+ await A.page.click('#czViewer2 .cz-vw-hd', { position: { x: 30, y: 20 } });
164
+ await A.page.evaluate(() => window.czPanels.putAway());
165
+ await A.page.click('[data-cz-vw-rail="show"]'); // two Viewers fold the list to a rail; its list button brings the rows back
166
+ await until(() => lay(A.page).then((l) => (!l.rail ? l : null)), 3000);
167
+ const v1r = (await lay(A.page)).panels.find((p) => p.id === 'v1').box;
168
+ await drag(A.page, `#hmList .hm-rm[data-hm-sel="${R[2]}"]`, v1r.r - 60, 450);
169
+ 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) : [];
171
+ 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
+ ok('0 no page error at 1440', A.errors.length === 0, A.errors.join(' | '));
173
+ await A.close();
174
+
175
+ /* ── 1920: three side by side ── */
176
+ const W = await open({ w: 1920, h: 1080 });
177
+ await W.page.click(`#hmList .hm-rm[data-hm-sel="${R[0]}"]`);
178
+ await until(() => lay(W.page).then((l) => (P(l, 'v0') && P(l, 'v0').box.shown ? l : null)));
179
+ const v0w = (await lay(W.page)).panels.find((p) => p.id === 'v0').box;
180
+ await drag(W.page, `#hmList .hm-rm[data-hm-sel="${R[1]}"]`, v0w.r - 60, 500);
181
+ const l7 = await until(() => lay(W.page).then((l) => (P(l, 'v1') && P(l, 'v1').box.shown && l.divs.length === 2 ? l : null)), 6000);
182
+ ok('N7 at 1920 the chat and two Viewers sit side by side with two dividers; only the first is first', !!l7 && P(l7, 'chat').mode === 'split' && P(l7, 'chat').box.r < P(l7, 'v0').box.l && P(l7, 'v0').box.r < P(l7, 'v1').box.l && l7.divs.filter((d) => d.first).length === 1, JSON.stringify(l7 || await lay(W.page)));
183
+ await shot(W.page, 'n7-three-1920');
184
+ ok('0 no page error at 1920', W.errors.length === 0, W.errors.join(' | '));
185
+ await W.close();
186
+
187
+ /* ── remembered per initiative: the chat put away comes back put away after a reload ── */
188
+ const ctx8 = await browser.newContext({ viewport: { width: 1440, height: 900 } });
189
+ const M = await open({ ctx: ctx8 });
190
+ await M.page.click(`#hmList .hm-rm[data-hm-sel="${R[0]}"]`);
191
+ await until(() => lay(M.page).then((l) => (P(l, 'v0') && P(l, 'v0').box.shown ? l : null)));
192
+ await M.page.evaluate(() => window.czPanels.place('v0', 'full'));
193
+ await until(() => lay(M.page).then((l) => (P(l, 'chat').mode === 'away' ? l : null)), 3000);
194
+ const ini = await M.page.evaluate(() => new URL(location.href).searchParams.get('ini'));
195
+ const kept = await M.page.evaluate((id) => { try { return JSON.parse(localStorage.getItem('cz-pn:' + id)); } catch { return null; } }, ini);
196
+ ok('N8 the initiative\'s panels are kept in localStorage (cz-pn:<initiative id>)', !!ini && !!kept && kept.chat === 'away', JSON.stringify([ini, kept]));
197
+ await M.page.close();
198
+ const M2 = await open({ ctx: ctx8, q: '?ini=' + encodeURIComponent(ini || '') });
199
+ const l8 = await until(() => lay(M2.page).then((l) => (P(l, 'v0') && P(l, 'v0').box.shown && P(l, 'chat').mode === 'away' ? l : null)), 8000);
200
+ ok('N8 reopening the initiative restores its panels (the Viewer whole, the chat put away)', !!l8, JSON.stringify(await lay(M2.page)));
201
+
202
+ /* ── Present: the chat slides away while a recording presents, and comes back on Stop ── */
203
+ await M2.page.evaluate(() => window.czPanels.place('chat', 'split'));
204
+ await until(() => lay(M2.page).then((l) => (P(l, 'chat').mode === 'split' ? l : null)), 3000);
205
+ await M2.page.evaluate(() => { const c = new BroadcastChannel('pmos-present'); c.postMessage({ t: 'show', show: { mat: { title: 'Award recommendation' } } }); c.close(); });
206
+ ok('N9 Present in a recording slides the chat away by itself', !!(await until(() => lay(M2.page).then((l) => (P(l, 'chat').mode === 'away' ? l : null)), 3000)));
207
+ await M2.page.evaluate(() => { const c = new BroadcastChannel('pmos-present'); c.postMessage({ t: 'off' }); c.close(); });
208
+ ok('N9 Stop brings it back beside', !!(await until(() => lay(M2.page).then((l) => (P(l, 'chat').mode === 'split' && P(l, 'chat').box.shown ? l : null)), 3000)));
209
+ ok('0 no page error when restoring', M.errors.length === 0 && M2.errors.length === 0, [...M.errors, ...M2.errors].join(' | '));
210
+ await M2.close();
211
+
212
+ /* ── a phone keeps one panel; dark uses the tokens ── */
213
+ const Ph = await open({ w: 390, h: 844 });
214
+ await Ph.page.evaluate(() => { const b = document.querySelector('#hmList .hv-r.ini .hm-rm'); if (b) b.click(); });
215
+ await until(() => Ph.page.evaluate(() => !!document.querySelector('#czViewer:not([hidden])')));
216
+ const ph = await Ph.page.evaluate(() => ({ divs: [...document.querySelectorAll('.cz-pn-div')].filter((d) => d.getBoundingClientRect().width > 0 || getComputedStyle(d).display !== 'none').length, place: !!document.querySelector('#czViewer [data-cz-vw="place"]'), ct: !!document.querySelector('#hmChat .cz-pn-ct'), wide: document.documentElement.scrollWidth <= innerWidth + 1 }));
217
+ ok('N10 a phone keeps today\'s one panel: no divider, no ⧉, no page scroll sideways', ph.divs === 0 && !ph.place && !ph.ct && ph.wide, JSON.stringify(ph));
218
+ ok('0 no page error on a phone', Ph.errors.length === 0, Ph.errors.join(' | '));
219
+ await Ph.close();
220
+ const Dk = await open({ dark: true });
221
+ await Dk.page.click(`#hmList .hm-rm[data-hm-sel="${R[0]}"]`);
222
+ await until(() => lay(Dk.page).then((l) => (l.divs.length === 1 ? l : null)));
223
+ await Dk.page.click('#czViewer [data-cz-vw="place"]');
224
+ await until(() => Dk.page.$('.cz-pn-menu'));
225
+ const dk = await Dk.page.evaluate(() => ({ menu: getComputedStyle(document.querySelector('.cz-pn-menu')).backgroundColor, body: getComputedStyle(document.body).backgroundColor }));
226
+ ok('N10 dark: the ⧉ menu takes the dark card colour from the tokens', /rgb\((\d+), (\d+), (\d+)\)/.test(dk.menu) && dk.menu.match(/\d+/g).slice(0, 3).every((n) => +n < 90), JSON.stringify(dk));
227
+ await shot(Dk.page, 'n10-dark-1440');
228
+ ok('0 no page error in dark', Dk.errors.length === 0, Dk.errors.join(' | '));
229
+ await Dk.close();
230
+ finish();
231
+ })();
@@ -239,8 +239,8 @@ const ALLOWED = /^\/api\/(?:boards\/(?:asks\/(?:add|accept|decline)|move|archive
239
239
  await ip.click('#czViewer [data-cz-vw="back"]'); // ← from Stage: the initiative's page again (canvas HbCDrill)
240
240
  // the card (stage card D): its last node, the next stage, opens the move popover with Move now and Back; Back always asks for a reason,
241
241
  // and the move line carries it (InStage)
242
- const openNext = async () => { if (!(await ip.evaluate(() => !!document.querySelector('.iv-sc [data-iv-next]')))) await ip.click('.iv-sc [data-iv-mi]'); // the next stage sits under the picture until it is the main step (XvpE2Stages)
243
- await until(() => ip.evaluate(() => !!document.querySelector('.iv-sc [data-iv-next]')), 30000); await ip.click('.iv-sc [data-iv-next]'); return until(() => ip.evaluate(() => !!document.querySelector('.hi-pop [data-hi-goback]'))); };
242
+ const openNext = async () => { if (!(await ip.evaluate(() => { const n = document.querySelector('.iv-sc [data-iv-next]'); return !!(n && n.offsetParent); }))) await ip.click('.iv-sc [data-iv-mi]'); // the next stage sits under the picture until it is the main step (XvpE2Stages)
243
+ await until(() => ip.evaluate(() => { const n = document.querySelector('.iv-sc [data-iv-next]'); return !!(n && n.offsetParent); }), 30000); await ip.click('.iv-sc [data-iv-next]'); return until(() => ip.evaluate(() => !!document.querySelector('.hi-pop [data-hi-goback]'))); };
244
244
  const back = await openNext();
245
245
  ok('I4 the card\'s next stage opens Move to the next stage now and Back', back && await ip.evaluate(() => /^Move to .+ now$/.test(((document.querySelector('.hi-pop [data-hi-go]') || {}).textContent || '').trim())));
246
246
  if (back) {
@@ -102,7 +102,8 @@ async function context(o = {}) {
102
102
  await walk('/premium-insights.html');
103
103
  await walk('/premium-board.html');
104
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));
105
+ // batch 18 item 15 (TbT1Split): the pill is a round number with a red corner dot; the running clock is in its tooltip and the list
106
+ ok('T2 Board\'s Live pill shows the red corner dot, and the running clock in its tooltip', await until(() => p.evaluate(() => { const l = document.getElementById('czLive'); return !!l && !l.hidden && l.classList.contains('recp') && !!l.querySelector('.lv-rd:not(.paused)') && /^\d+$/.test(l.textContent.trim()) && /Recording \d+:\d{2}/.test(l.title); }), 15000));
106
107
  await p.$eval('#czLive', (b) => b.click());
107
108
  await until(() => p.$('#czLiveList [data-lv^="rec:"]'));
108
109
  const row = await p.evaluate(() => { const a = document.querySelector('#czLiveList [data-lv^="rec:"]'); return { href: a.getAttribute('href'), btns: a.querySelectorAll('button').length }; });
@@ -52,7 +52,15 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
52
52
  return { page, ctx, S };
53
53
  };
54
54
  const viaMore = async (pg, label) => { const it = (l) => `#czViewer .cz-vw-menu [role="menuitem"]:has(> span:first-child:text-is("${l}"))`, more = async () => { await pg.click('#czViewer:not([hidden]) [data-cz-vw="more"]'); await until(() => pg.evaluate(() => !!document.querySelector('#czViewer .cz-vw-menu'))); }, view = (v) => until(() => pg.evaluate((x) => !!document.querySelector(`#czViewer:not([hidden]) [data-hi-v="${x}"]`), v)); if ((await pg.$('#czViewer:not([hidden]) [data-hi-v="page"]')) && (await pg.$('#czViewer:not([hidden]) [data-iv-docs]')) && !['Split into a new initiative', 'Merge into', 'Program', 'Open on the Board', 'Copy', 'The record', 'Delete'].includes(label)) { await pg.click('#czViewer:not([hidden]) [data-iv-docs]'); await view('docs'); if (label === 'Documents') return; } await more(); for (let i = 0; i < 20 && !(await pg.$(it(label))) && !(await pg.$(it('Stage'))); i++) { await pg.keyboard.press('Escape'); await pg.waitForTimeout(250); await more(); } if (!(await pg.$(it(label))) && (await pg.$(it('Stage')))) { await pg.click(it('Stage')); await view('stage'); if (label === 'Stage') return; await more(); } await pg.click(it(label)); }; // batch 16 item 5c: the page's ⋯ is short; Documents opens from its fold, and the Documents view's ⋯ holds Stage, whose ⋯ holds Documents, Open the full record and Sprint
55
- const overview = async (page) => { await (async (g) => { const P = '#czViewer:not([hidden]) [data-hi-v="page"]', r = '#hmList [data-hm-sel^="i:"][aria-current="true"]'; for (let i = 0; i < 4 && !(await g.$(P)) && (await g.$('#czViewer:not([hidden]) [data-cz-vw="back"]')); i++) { await g.click('#czViewer [data-cz-vw="back"]'); await g.waitForTimeout(150); } if (await g.$(P)) return; if (await g.$(r)) await g.click(r); else await g.reload(); await g.waitForSelector(P + ' .iv', { timeout: 30000 }); })(page); /* ← back to the initiative's page, else its row, else the address again (an initiative the list does not show) */ /* the page holds the Tasks (batch 11 item 20) */ return until(() => page.evaluate(() => !!document.querySelector('#czViewer [data-cz-vw="more"]') && !!document.querySelector('#czViewer [data-iv-task="t1"]'))); };
55
+ // batch 18 item 16: with quick changes on, a title press opens the row in place; the task card is under its ⋯ (Open the task card)
56
+ const openCard = async (pg, uid, V = '#czViewer') => {
57
+ if (await pg.$(`${V} [data-iv-task="${uid}"]`)) return pg.click(`${V} [data-iv-task="${uid}"]`);
58
+ await pg.click(`${V} [data-iv-edit="${uid}"]`);
59
+ await pg.click(`${V} .iv-ed[data-iv-open="${uid}"] [data-iv-more]`);
60
+ await pg.waitForSelector('.tkc.ivq [data-ive-card]', { timeout: 8000 });
61
+ return pg.click('.tkc.ivq [data-ive-card]');
62
+ };
63
+ const overview = async (page) => { await (async (g) => { const P = '#czViewer:not([hidden]) [data-hi-v="page"]', r = '#hmList [data-hm-sel^="i:"][aria-current="true"]'; for (let i = 0; i < 4 && !(await g.$(P)) && (await g.$('#czViewer:not([hidden]) [data-cz-vw="back"]')); i++) { await g.click('#czViewer [data-cz-vw="back"]'); await g.waitForTimeout(150); } if (await g.$(P)) return; if (await g.$(r)) await g.click(r); else await g.reload(); await g.waitForSelector(P + ' .iv', { timeout: 30000 }); })(page); /* ← back to the initiative's page, else its row, else the address again (an initiative the list does not show) */ /* the page holds the Tasks (batch 11 item 20) */ return until(() => page.evaluate(() => !!document.querySelector('#czViewer [data-cz-vw="more"]') && !!document.querySelector('#czViewer :is([data-iv-task="t1"], [data-iv-edit="t1"])'))); };
56
64
  const cur = (page) => page.evaluate(() => { const p = document.querySelector('#czViewer:not([hidden]) .obody.vw'); return { on: p ? p.dataset.vw : null, title: (document.querySelector('#czVwTitle') || {}).textContent || '', n: document.querySelectorAll('#czViewer .obody.vw').length }; });
57
65
  const paneTxt = (page, id) => page.evaluate((k) => { const p = document.querySelector(`#czViewer .obody.vw[data-vw="${CSS.escape(k)}"]`); return p ? p.textContent.replace(/\s+/g, ' ') : ''; }, id);
58
66
  const INI = 'item:ini:self-serve-v2';
@@ -79,7 +87,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
79
87
  await page.click(`#czViewer .obody.vw[data-vw="${TK}"] [data-tkc="ini"]`);
80
88
  s = await cur(page);
81
89
  ok('R9 the initiative link brings the record back, not a second one', await until(async () => (await cur(page)).on === INI) && (await cur(page)).n === 1, JSON.stringify(s));
82
- ok('R9 the task press in the Overview opens the same task view', await overview(page) && await page.click('#czViewer [data-iv-task="t1"]').then(() => until(async () => (await cur(page)).on === TK && /Oct 20 → 27/.test(await paneTxt(page, TK)))), JSON.stringify(await cur(page)));
90
+ ok('R9 the task press in the Overview opens the same task view', await overview(page) && await openCard(page, 't1').then(() => until(async () => (await cur(page)).on === TK && /Oct 20 → 27/.test(await paneTxt(page, TK)))), JSON.stringify(await cur(page)));
83
91
  ok('R9 the old dialog never opens', await page.evaluate(() => { const d = document.querySelector('#dlg'); return !d || !d.classList.contains('on'); }));
84
92
  ok('R9 no page error', S.errors.length === 0, S.errors.join(' | '));
85
93
  await ctx.close();
@@ -181,6 +181,9 @@ const TICKETS = {
181
181
  {
182
182
  const I = await open();
183
183
  // batch 11 item 20: the page's Tasks draw the stage's Jira tickets; a ticket press opens its ticket in the Viewer (the old All tasks panel is gone)
184
+ // batch 18 item 16: a ticket row's title opens the row in place; its Open the ticket sits there, after the dates
185
+ await I.page.waitForSelector('#czViewer [data-iv-ticket="PMOS-142"], #czViewer [data-iv-edit="PMOS-142"]');
186
+ if (!(await I.page.$('#czViewer [data-iv-ticket="PMOS-142"]'))) await I.page.click('#czViewer [data-iv-edit="PMOS-142"]');
184
187
  await I.page.click('#czViewer [data-iv-ticket="PMOS-142"]');
185
188
  ok('I2 a Jira ticket in the page\'s Tasks opens its ticket in the Viewer', !!(await until(async () => /^jira:PMOS-142$/.test(String(await curId(I.page))))), JSON.stringify(await curId(I.page)));
186
189
  await I.page.goto(BASE + '/premium-initiative.html?id=self-serve-v2&ws=w1&board=w1');
@@ -50,7 +50,7 @@ const jiraAt = () => { const J = (O.M() && O.M().jira) || {}; return J.readAt ?
50
50
  /** The view's model for a row: the same function Home's page calls, with what only the Board's model holds (its eight steps, its day). */
51
51
  export function viewOf(r) {
52
52
  const M = O.M() || {}, p = O.programOf ? O.programOf(r) : null, u = O.usual ? O.usual(r.track || {}) : null;
53
- return iniView(rowFor(r), { steps: M.steps || [], today: M.today, usual: u, grill: r.id ? O.grill(r.id) : null, program: p ? { id: p.id, title: p.title } : null, jiraAt: jiraAt() });
53
+ return iniView(rowFor(r), { steps: M.steps || [], today: M.today, usual: u, grill: r.id ? O.grill(r.id) : null, program: p ? { id: p.id, title: p.title } : null, jiraAt: jiraAt(), jiraReadAt: ((M.jira || {}).readAt) || '' });
54
54
  }
55
55
  function draftedHtml(d, g) {
56
56
  return d.slice(0, 8).map((x) => lr({ mk: x.waiting ? 'you' : '', title: (x.id ? `<em>${esc(x.id)}</em> ` : '') + esc(x.summary || ''), sub: 'not in Jira' })).join('')
@@ -204,7 +204,8 @@ function wire(body, key) {
204
204
  // the stage card's ⏸ or calendar on a hold (batch 11 item 21): the Board's own hold menu (bd-acts.js)
205
205
  hold: (i, b) => { const r = O.rowOf(key); if (r && O.hold) O.hold(r, i, b); },
206
206
  addCancel: () => { adding = null; addTo = ''; addDates = null; redraw(); },
207
- addTask: async (title, inp) => { const r = O.rowOf(key); if (!r || !O.addTask) return; inp.disabled = true; const ok = await O.addTask(r, title, addTo, addDates); inp.disabled = false; if (ok) { inp.value = ''; inp.focus(); } },
207
+ // opt (batch 18 item 16): the + on a stage, with the dates its field picked
208
+ addTask: async (title, inp, opt) => { const r = O.rowOf(key); if (!r || !O.addTask) return; inp.disabled = true; const ok = await O.addTask(r, title, opt ? opt.section : addTo, opt ? (opt.start || opt.due ? opt : null) : addDates, opt ? opt.name : ''); inp.disabled = false; if (ok && !opt) { inp.value = ''; inp.focus(); } },
208
209
  primary: (act, b) => {
209
210
  const r = O.rowOf(key); if (!r) return;
210
211
  if (act === 'grill') O.grillOpen(r, b);
@@ -397,6 +397,27 @@ export const CHARM_KEYS = Object.freeze(Object.keys(CH));
397
397
  /** The words for a charm ("Deepavali"), or '' for a key PMOS does not draw. */
398
398
  export const charmName = (key) => (CH[key] ? CH[key].name : '');
399
399
 
400
+ /** The charm on its own, with no Adler (batch 18 item 15, TbT9Divider: the day's charm on the panel divider): the held charm, else the one at
401
+ * his feet, else the head charm, else the neck charm, in figure coordinates. The svg carries data-ad-fit: the page fits its viewBox to the
402
+ * drawing (fitCharm). '' for a key PMOS does not draw. */
403
+ export function charmIcon(key, colors = null, px = 26) {
404
+ const ch = CH[key]; if (!ch) return '';
405
+ addCss();
406
+ const part = ch.held || ch.feet || ch.head || ch.neck; if (!part) return '';
407
+ const box = ch.held ? '76 166 54 62' : '0 0 200 252';
408
+ return `<svg class="ad-svg ad-charm" width="${px}" height="${px}" viewBox="${box}" data-ad-fit aria-hidden="true">${part(colors)}</svg>`;
409
+ }
410
+ /** Fits a charmIcon's viewBox to what it draws, once it is in the page (getBBox needs layout). */
411
+ export function fitCharm(svg) {
412
+ if (!svg || !svg.hasAttribute('data-ad-fit') || typeof svg.getBBox !== 'function') return;
413
+ try {
414
+ const b = svg.getBBox(); if (!b.width || !b.height) return;
415
+ const s = Math.max(b.width, b.height), pad = s * 0.06;
416
+ svg.setAttribute('viewBox', [b.x + b.width / 2 - s / 2 - pad, b.y + b.height / 2 - s / 2 - pad, s + 2 * pad, s + 2 * pad].map((v) => Math.round(v * 10) / 10).join(' '));
417
+ svg.removeAttribute('data-ad-fit');
418
+ } catch { /* not laid out yet: the default box stays */ }
419
+ }
420
+
400
421
  /* What he wears on the figure: a held charm goes in his paws only when they are free (handled, resting); in a raised-paw mood it rests at his
401
422
  * feet instead, unless the charm already has one there. The headphones win over a head charm: they mean a meeting is recording. */
402
423
  function wear(m, prop, c) {
@@ -0,0 +1,32 @@
1
+ /* pm/cozy-divider.css — how the panel divider looks (batch 18 item 15, canvas TbT9Divider), drawn by pm/cozy-divider.js inside the
2
+ * engine's .cz-pn-div (pm/cozy-panels.js). The engine sets the divider's place, size and cursor; this sheet draws the handle and what sits
3
+ * on it, inside the engine's centred .cz-pn-in. Token vars from cozy.css only. Motion: the leaves open on hover and the sprout leans while dragging, nothing else. */
4
+ .cz-dv-hd { position: absolute; left: 50%; top: 50%; width: 10px; height: 60px; margin: -30px 0 0 -5px; box-sizing: border-box; border-radius: 5px;
5
+ background: var(--cz-card); box-shadow: 0 2px 8px -2px rgba(42,46,53,.28), 0 0 0 1px var(--cz-hair); display: flex; flex-direction: column;
6
+ align-items: center; justify-content: center; gap: 4px; pointer-events: none; transition: background .15s, box-shadow .15s; }
7
+ .cz-dv-hd b { display: block; width: 3px; height: 3px; border-radius: 50%; background: var(--cz-ink3); }
8
+ .cz-pn-div.hov .cz-dv-hd, .cz-pn-div.drag .cz-dv-hd, .cz-pn-div:focus-visible .cz-dv-hd { background: var(--cz-bluebg); box-shadow: 0 0 0 1.5px var(--cz-blue), 0 4px 12px -4px color-mix(in srgb, var(--cz-blue) 50%, transparent); }
9
+ .cz-pn-div.hov .cz-dv-hd b, .cz-pn-div.drag .cz-dv-hd b, .cz-pn-div:focus-visible .cz-dv-hd b { background: var(--cz-blueink); }
10
+ .cz-pn-div:focus-visible { outline: none; }
11
+ /* the blue line while dragging is the engine's (.cz-pn-div::after in cozy-panels.css); its ::before is the hit area */
12
+
13
+ /* on top of the first divider: Adler's sprout, or the day's charm */
14
+ .cz-dv-top { position: absolute; left: 50%; top: 50%; width: 26px; height: 31px; margin: -64px 0 0 -13px; display: flex; align-items: flex-end; justify-content: center; pointer-events: none; }
15
+ .cz-dv-top:empty { display: none; }
16
+ .cz-dv-sp { width: 22px; height: 26px; overflow: visible; transform-origin: 50% 100%; transition: transform .25s ease-out; }
17
+ .cz-dv-st { fill: none; stroke: var(--ad-h1); stroke-width: 2; stroke-linecap: round; }
18
+ .cz-dv-lf { stroke: none; transform-origin: 11px 14px; transition: transform .25s ease-out; }
19
+ .cz-dv-lf.l1 { fill: var(--ad-leaf2); }
20
+ .cz-dv-lf.l2 { fill: var(--ad-l0); }
21
+ .cz-pn-div.hov .cz-dv-lf.l1 { transform: rotate(-10deg); }
22
+ .cz-pn-div.hov .cz-dv-lf.l2 { transform: rotate(10deg); }
23
+ .cz-pn-div.drag .cz-dv-sp { transform: rotate(-14deg); }
24
+ .cz-dv-ch { display: inline-flex; }
25
+ .cz-dv-ch svg { width: 26px; height: 26px; overflow: hidden; }
26
+ .cz-dv-ch .env-glow { display: none; } /* the charm's glow is for his scene; on the divider it is the shape only */
27
+ @media (prefers-reduced-motion: reduce) {
28
+ .cz-dv-hd, .cz-dv-sp, .cz-dv-lf { transition: none; }
29
+ .cz-pn-div.hov .cz-dv-lf, .cz-pn-div.drag .cz-dv-sp { transform: none; }
30
+ }
31
+ html.ad-still .cz-dv-sp, html.ad-still .cz-dv-lf { transition: none; }
32
+ html.ad-still .cz-pn-div.hov .cz-dv-lf, html.ad-still .cz-pn-div.drag .cz-dv-sp { transform: none; }
@@ -0,0 +1,45 @@
1
+ /* pm/cozy-divider.js — how the panel divider looks (feedback batch 18 item 15, slice 15-B; canvas frame TbT9Divider; brief
2
+ * next18/briefs/15-arrange-panels-build.md rule 11). The panels engine (15-A, pm/cozy-panels.js) owns the divider element (.cz-pn-div,
3
+ * role=separator): its drag, its snaps, its keys and its double-click. This module draws only what is inside it.
4
+ *
5
+ * dividerHtml({ first }) the inside of one divider: a soft handle with 3 dots; on the first divider only, Adler's sprout on top, or
6
+ * the day's charm (cozy-adler.js dress(), from the calendar in cozy-seasons.js). Never his face, so the screen
7
+ * keeps one Adler. Settings > Adler > Off: the handle only.
8
+ * States, from classes the engine toggles: at rest · .hov (the handle turns blue, the leaves open) · .drag (a blue line, the sprout leans
9
+ * with the drag). Reduced motion or Settings > Adler > Motion: Still: no leaf or lean motion. Colours are tokens only (cozy-divider.css). */
10
+ import { dress, prefs, charmIcon, fitCharm } from './cozy-adler.js';
11
+
12
+ const SHEET = new URL('./cozy-divider.css', import.meta.url).href;
13
+ // the sprout: the same stem and two leaves as Adler's, alone (TbT9Divider)
14
+ const SPROUT = '<svg class="cz-dv-sp" viewBox="0 0 22 26" width="22" height="26" aria-hidden="true"><path class="cz-dv-st" d="M11 25V13"/>'
15
+ + '<path class="cz-dv-lf l1" d="M11 15C6 15 3 11 3 6c5 0 8 4 8 9z"/><path class="cz-dv-lf l2" d="M11 12c0-5 3-9 8-9 0 5-3 9-8 9z"/></svg>';
16
+
17
+ function addCss() {
18
+ if (typeof document === 'undefined' || !document.head) return;
19
+ if (!document.querySelector(`link[href="${SHEET}"]`)) { const l = document.createElement('link'); l.rel = 'stylesheet'; l.href = SHEET; document.head.appendChild(l); }
20
+ }
21
+ /** What sits on top of the first divider: '' (Adler is off), the day's charm (Full only), or the sprout. */
22
+ export function topHtml(o = {}) {
23
+ const P = { ...prefs(), ...(o.prefs || {}) };
24
+ if (P['adler.amount'] === 'off') return '';
25
+ const d = o.dress !== undefined ? o.dress : dress();
26
+ const c = d && P['adler.amount'] === 'full' ? charmIcon(d.key, d.colors || null, 26) : '';
27
+ return c ? `<span class="cz-dv-ch" data-charm="${d.key}">${c}</span>` : SPROUT;
28
+ }
29
+ /** The inside of one divider. o.first: the divider beside the chat, the only one with the sprout or the charm. */
30
+ export function dividerHtml(o = {}) {
31
+ addCss();
32
+ if (o.first) fitSoon();
33
+ return '<span class="cz-dv-hd" aria-hidden="true"><b></b><b></b><b></b></span>' + (o.first ? `<span class="cz-dv-top" aria-hidden="true">${topHtml(o)}</span>` : '');
34
+ }
35
+
36
+ // the charm's drawing is in Adler's figure coordinates: once it is in the page, its box is fitted to what it draws
37
+ let fitting = false;
38
+ function fitSoon() {
39
+ if (fitting || typeof document === 'undefined' || typeof requestAnimationFrame !== 'function') return;
40
+ fitting = true;
41
+ requestAnimationFrame(() => { fitting = false; document.querySelectorAll('.cz-dv-top svg[data-ad-fit]').forEach(fitCharm); });
42
+ }
43
+ // the day's charm arrives after the first paint (loadDress), and Settings > Adler can change: every first divider follows
44
+ function redraw() { document.querySelectorAll('.cz-dv-top').forEach((n) => { n.innerHTML = topHtml(); }); fitSoon(); }
45
+ if (typeof document !== 'undefined' && document.addEventListener) { document.addEventListener('adler:dressed', redraw); document.addEventListener('adler:prefs', redraw); }
@@ -768,3 +768,99 @@ body.ins-trv #goalTbl { border: 0; background: none; border-radius: 0; overflow:
768
768
  .okr-pld .okr-dot { margin-top: 0; width: 8px; height: 8px; }
769
769
  @media (prefers-reduced-motion: reduce) { .okr-dot.m-crit::after { animation: none; } }
770
770
  textarea.ins-dri { height: auto; padding: 6px 8px; font-weight: 500; resize: vertical; }
771
+ /* ── goals made clear (batch 18 item 11, 11-B; frames Gc*): the drafts table, the check panel, first readings, failed and held ── */
772
+ .ins-dr .gc-tbl + .okr-card { margin-top: 12px; }
773
+ .gc-tbl { border: 1px solid var(--cz-hair); border-radius: 18px; overflow: hidden; background: var(--cz-card); }
774
+ .gc-th, .gc-tr { display: grid; grid-template-columns: minmax(150px, 1.25fr) minmax(170px, 1.9fr) minmax(70px, .6fr) minmax(90px, .75fr) minmax(120px, .95fr) 84px; gap: 14px; align-items: center; padding: 0 14px 0 16px; }
775
+ .gc-th { background: var(--cz-well); min-height: 38px; font-size: var(--fs-2); font-weight: 800; color: var(--cz-ink2); }
776
+ .gc-th .note { font-weight: 600; color: var(--cz-ink3); }
777
+ .gc-grp { padding: 8px 16px; background: var(--cz-well); border-top: 1px solid var(--cz-hair); font-size: var(--fs-2); }
778
+ .gc-grp b { font-weight: 800; color: var(--cz-ink2); }
779
+ .gc-grp .note { color: var(--cz-ink3); }
780
+ .gc-tr { border-top: 1px solid var(--cz-hair); min-height: 60px; padding-top: 8px; padding-bottom: 8px; cursor: pointer; }
781
+ .gc-tr:hover { background: var(--cz-well); }
782
+ .gc-tr.sel, .gc-tr.sel:hover { background: var(--cz-bluebg); }
783
+ .gc-tr:focus-visible { outline: 2px solid var(--cz-blueink); outline-offset: -2px; }
784
+ .gc-nm { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
785
+ .gc-nm b { font-size: var(--fs-3); font-weight: 800; line-height: 1.25; }
786
+ .gc-type { font-size: var(--fs-1); font-weight: 700; color: var(--cz-ink2); background: var(--cz-well2); border-radius: 8px; padding: 1px 7px; }
787
+ .gc-hw { font-size: var(--fs-2); color: var(--cz-ink2); line-height: 1.4; min-width: 0; }
788
+ .gc-now b { font-size: var(--fs-4); font-weight: 800; }
789
+ .gc-tg b { font-size: var(--fs-3); font-weight: 800; }
790
+ .gc-from { display: flex; flex-direction: column; gap: 1px; font-size: var(--fs-2); min-width: 0; }
791
+ .gc-src { display: inline-flex; align-items: center; gap: 6px; }
792
+ .gc-src b { font-weight: 700; }
793
+ .gc-src .cz-dot { width: 7px; height: 7px; }
794
+ .gc-from .note { color: var(--cz-ink2); font-weight: 600; }
795
+ .gc-acts { display: flex; gap: 4px; justify-content: flex-end; }
796
+ .gc-acts .cz-ib svg, .gc-panel svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
797
+ @media (max-width: 760px) {
798
+ .gc-th { display: none; }
799
+ .gc-tr { grid-template-columns: 1fr auto; grid-template-areas: "nm now" "hw hw" "tg from" "acts acts"; gap: 6px 12px; padding: 12px 14px; }
800
+ .gc-nm { grid-area: nm; } .gc-hw { grid-area: hw; } .gc-now { grid-area: now; text-align: right; } .gc-tg { grid-area: tg; } .gc-from { grid-area: from; text-align: right; align-items: flex-end; } .gc-acts { grid-area: acts; }
801
+ .gc-tg::before { content: 'Target '; font-size: var(--fs-2); color: var(--cz-ink3); }
802
+ }
803
+ /* the check panel and the key result's part of the goal Viewer */
804
+ .gc-panel { display: flex; flex-direction: column; gap: 12px; }
805
+ .gc-kr { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 10px; }
806
+ .gc-box { background: var(--cz-well); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
807
+ .gc-k { font-size: var(--fs-2); font-weight: 800; color: var(--cz-ink2); }
808
+ .gc-what { margin: 0; font-size: var(--fs-3); font-weight: 700; line-height: 1.45; color: var(--cz-ink); }
809
+ .gc-big { margin: 2px 0 0; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
810
+ .gc-big b { font-size: var(--fs-6); font-weight: 800; letter-spacing: -.01em; }
811
+ .gc-frac { display: flex; flex-direction: column; font-size: var(--fs-3); }
812
+ .gc-frac > div { display: flex; gap: 8px; align-items: baseline; padding: 3px 0; }
813
+ .gc-frac b { font-weight: 800; min-width: 3ch; }
814
+ .gc-frac .n { border-bottom: 1.5px solid var(--cz-ink3); }
815
+ .gc-frac .r { font-weight: 800; }
816
+ .gc-sec { display: flex; flex-direction: column; gap: 6px; }
817
+ .gc-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; font-size: var(--fs-3); }
818
+ .gc-checks li { display: flex; gap: 8px; align-items: flex-start; }
819
+ .gc-checks li svg { flex: none; margin-top: 2px; width: 16px; height: 16px; padding: 1px; border-radius: 50%; box-sizing: border-box; }
820
+ .gc-checks li.ok svg { color: var(--cz-ok); background: var(--cz-okbg); }
821
+ .gc-checks li.warn svg { color: var(--cz-risk); }
822
+ .gc-cmp { display: flex; align-items: center; gap: 8px; border: 1px solid var(--cz-hair); border-radius: 14px; padding: 6px 6px 6px 14px; background: var(--cz-card); }
823
+ .gc-cmp input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; font-size: var(--fs-3); color: var(--cz-ink); outline: none; }
824
+ .gc-line, .gc-fl { margin: 0; font-size: var(--fs-3); color: var(--cz-ink2); line-height: 1.45; }
825
+ .gc-line b { color: var(--cz-ink); font-weight: 800; margin-right: 4px; }
826
+ .gc-fl b { color: var(--cz-ink); }
827
+ .gc-q { background: var(--cz-well); border-radius: 16px; padding: 10px 14px; }
828
+ .gc-q summary { cursor: pointer; font-size: var(--fs-3); list-style: none; }
829
+ .gc-q summary::-webkit-details-marker { display: none; }
830
+ .gc-q summary b { font-weight: 800; }
831
+ .gc-q pre { margin: 8px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--cz-card); font-family: var(--cz-mono); font-size: var(--fs-2); white-space: pre-wrap; word-break: break-word; }
832
+ .gc-foot { display: flex; align-items: center; gap: 4px; }
833
+ .gc-sp { flex: 1; }
834
+ .gc-msg:empty { display: none; }
835
+ .gc-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
836
+ .gc-card { background: var(--cz-well); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
837
+ .gc-card b { font-size: var(--fs-6); font-weight: 800; }
838
+ .gc-say { margin: 0; font-size: var(--fs-3); line-height: 1.5; }
839
+ .gc-sg { display: flex; flex-wrap: wrap; gap: 8px 10px; background: var(--cz-well); border-radius: 16px; padding: 12px 14px; }
840
+ .gc-sg .sp { color: var(--cz-blueink); display: inline-flex; margin-top: 2px; }
841
+ .gc-sg p { flex: 1; margin: 0; font-size: var(--fs-3); line-height: 1.45; min-width: 0; }
842
+ .gc-sg .acts { display: flex; gap: 4px; width: 100%; justify-content: flex-end; }
843
+ .gc-warnbox { background: var(--cz-riskbg); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-3); }
844
+ .gc-warnbox > b:first-child { color: var(--cz-risk); font-size: var(--fs-2); font-weight: 800; }
845
+ .gc-warnbox p { margin: 0; line-height: 1.45; }
846
+ .gc-fix { display: flex; align-items: center; gap: 10px; }
847
+ .gc-fix > b { flex: 1; font-weight: 800; }
848
+ .gc-fix .acts { display: flex; gap: 4px; }
849
+ .gc-file { display: flex; justify-content: flex-end; }
850
+ .gc-wait { border: 1.5px dashed var(--cz-hair); border-color: var(--cz-dot-q); border-radius: 14px; min-height: 120px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 14px; font-size: var(--fs-3); color: var(--cz-ink2); }
851
+ .gc-ed { display: flex; flex-direction: column; gap: 10px; }
852
+ .ins-dr.gc-on { border: 0; padding: 0; background: none; gap: 12px; }
853
+
854
+ /* ── batch 18 item 11 gap: the goals dashboard (Iq8Overview with GcJ2FirstMonday): the first readings, a failed or held reading, the drafts under a row ── */
855
+ .ins-dot1 { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--cz-dot-q); }
856
+ .ins-row .val .ins-warn { margin-top: 4px; color: var(--cz-late); font-weight: 700; }
857
+ .ins-row .pace > span { font-size: var(--fs-2); color: var(--cz-ink2); }
858
+ .ins-row.crit .nm .okr-dot { flex: none; } /* a broken limit: the one red, pulsing dot (cozy.css m-crit) */
859
+ .ins-drr { border-top: 0; padding: 0 16px 4px 0; }
860
+ .ins-drr .okr-dr { margin-left: 16px; }
861
+ .ins-nsc .gc-wait { flex: 1; }
862
+ .ins-nsn { margin-left: auto; }
863
+ .ins-nsd .okr-dr { margin: 6px 0 0; }
864
+ .ins-inr .nm small { display: block; font-weight: 700; color: var(--cz-late); margin-top: 2px; }
865
+ #goalTbl[hidden] { display: none !important; }
866
+ @media (max-width: 720px) { .ins-cards > .okr-dr { margin: -2px 0 4px 12px; } .ins-nsn { margin-left: 0; } }
@@ -1,17 +1,20 @@
1
- /* pm/cozy-live-pill.css — the Live pill beside the floating menu and its list (canvas XrrABoard, XrrAPhone, XrrAGrill), drawn by
2
- * pm/cozy-live-pill.js inside #czNav, so it follows the menu button and hides with it. Token vars from cozy.css only. Motion: one info
1
+ /* pm/cozy-live-pill.css — the Live pill above the floating menu and its list (canvas XrrABoard, XrrAPhone, XrrAGrill), drawn by
2
+ * pm/cozy-live-pill.js inside #czNav, so it follows the menu button and hides with it. Round since batch 18 item 15 (TbT1Split). Token vars from cozy.css only. Motion: one info
3
3
  * ripple when a mark changes while the list is open; the recording clock is the only other thing that changes. */
4
- .cz-live { position: absolute; left: 68px; bottom: 8px; height: 40px; padding: 0 14px 0 12px; border-radius: 999px; border: 0; background: var(--cz-card); box-shadow: var(--cz-float); display: inline-flex; align-items: center; gap: 10px; font: 800 var(--fs-3) var(--cz-sans); color: var(--cz-ink); white-space: nowrap; cursor: pointer; z-index: 1; }
4
+ /* closed: one 44 px round button stacked above the menu button (TbT1Split): the number of live items, blue with a soft glow when Claude
5
+ asks, a red corner dot while a meeting records (batch 18 item 15). The menu button is 56 px, so the pill sits on its centre line. */
6
+ .cz-live { position: absolute; left: 6px; bottom: 68px; width: 44px; height: 44px; padding: 0; border-radius: 50%; border: 0; background: var(--cz-card); box-shadow: var(--cz-float), inset 0 0 0 1.5px var(--cz-hair); display: inline-flex; align-items: center; justify-content: center; font: 800 var(--fs-3) var(--cz-sans); color: var(--cz-ink); font-variant-numeric: tabular-nums; cursor: pointer; z-index: 1; transition: background .2s, color .2s, box-shadow .2s; }
5
7
  .cz-live[hidden] { display: none; }
8
+ .cz-live.asks { background: var(--cz-blueink); color: var(--cz-onsolid); box-shadow: var(--cz-float), 0 0 0 4px color-mix(in srgb, var(--cz-blue) 22%, transparent); }
6
9
  .cz-live.open { box-shadow: var(--cz-float), 0 0 0 2px color-mix(in srgb, var(--cz-blue) 30%, var(--cz-card)); }
7
- .cz-live.recp { box-shadow: var(--cz-float), 0 0 0 1.5px color-mix(in srgb, var(--cz-dot-red) 35%, var(--cz-card)); }
8
10
  .cz-live:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; }
9
11
  .lv-row:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: -2px; }
10
- .cz-live .lv-g { display: inline-flex; align-items: center; gap: 6px; }
11
- .cz-live .lv-ad { display: inline-flex; align-items: center; } /* Adler with headphones while the meeting records (AdM1) */
12
- .cz-live .lv-ad .ad-sp { animation: none; }
13
- .cz-live .lv-sp { width: 1px; height: 16px; background: var(--cz-hair); }
14
- .cz-live .lv-ms { display: inline-flex; align-items: center; gap: 6px; }
12
+ .cz-live .lv-rd { position: absolute; top: 1px; right: 1px; width: 11px; height: 11px; border-radius: 50%; background: var(--cz-dot-red); box-shadow: 0 0 0 2px var(--cz-card); }
13
+ .cz-live .lv-rd.paused { background: var(--cz-dot-q); }
14
+ .lv-row .lv-ad { display: inline-flex; align-items: center; flex: none; margin-right: 6px; } /* Adler with headphones while the meeting records (AdM1) */
15
+ .lv-row .lv-ad .ad-sp { animation: none; }
16
+ @media (prefers-reduced-motion: reduce) { .cz-live { transition: none; } }
17
+ .cz-fabw:has(> .cz-fabm:not([hidden])) .cz-live { visibility: hidden; } /* the open menu takes the place above the menu button */
15
18
 
16
19
  /* one mark per item: blue asks you, ring running, amber stopped, check finished, red recording (grey while paused) */
17
20
  .lv-m { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 9px; height: 9px; border-radius: 50%; box-sizing: border-box; flex: none; background: var(--cz-blue); }
@@ -40,15 +43,11 @@
40
43
  .lv-tm.rec { color: var(--cz-red); }
41
44
  .lv-tm.stop { color: var(--cz-late); }
42
45
 
43
- /* Home on a desktop (batch 18 item 6): beside the menu button the pill reached into the chat card and covered its +, whenever the list
44
- is narrow or folded; it sits above the menu button instead, and its list opens above it */
45
- @media (min-width: 761px) {
46
- body.cz-home .cz-live { left: 8px; bottom: 68px; }
47
- body.cz-home .lv-tray { bottom: 116px; }
48
- }
49
- /* a phone: the menu button is bottom right, so the pill sits to its left, and the list is a short sheet */
46
+ /* the list opens above the pill */
47
+ @media (min-width: 761px) { .lv-tray { bottom: 120px; } }
48
+ /* a phone: the menu button is bottom right, so the pill stacks above it there, and the list is a short sheet */
50
49
  @media (max-width: 760px) {
51
- .cz-live { left: auto; right: 68px; }
50
+ .cz-live { left: auto; right: 6px; }
52
51
  .lv-scrim { position: fixed; inset: 0; background: rgba(42,46,53,.18); z-index: 0; }
53
52
  .lv-tray.sheet { position: fixed; left: 0; right: 0; bottom: 0; width: auto; padding: 18px 8px 28px; border-radius: 26px 26px 0 0; border: 0; }
54
53
  .lv-tray.sheet::before { content: ''; position: absolute; top: 8px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 3px; background: var(--cz-well2); }