create-pmos 0.424.0 → 0.425.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +13 -13
- package/payload/KIT-VERSION +1 -1
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/state/discoveries.md +1 -1
- package/workspace/board-programs-test.js +41 -26
- package/workspace/briefing-premium-board-test.js +7 -4
- package/workspace/briefing-premium-insights-test.js +31 -15
- package/workspace/briefing-premium-products-test.js +46 -43
- package/workspace/changelog.json +12 -0
- package/workspace/guide/briefing-premium.md +3 -2
- package/workspace/guide/home.md +2 -2
- package/workspace/guide/index.md +1 -0
- package/workspace/guide/notes.md +39 -1
- package/workspace/guide/present-in-a-meeting.md +57 -0
- package/workspace/guide/programs.md +2 -2
- package/workspace/lib/briefing-premium-products.js +18 -4
- package/workspace/lib/meeting-focus.js +64 -14
- package/workspace/lib/routes-briefing-premium.js +19 -0
- package/workspace/lib/routes-meeting-focus.js +28 -6
- package/workspace/lib/settings-store.js +2 -1
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-briefing-depth-test.js +1 -1
- package/workspace/premium-rec-now-test.js +153 -0
- package/workspace/premium-rec-tab-test.js +167 -0
- package/workspace/public/pm/cozy-aud.css +9 -0
- package/workspace/public/pm/cozy-aud.js +80 -0
- package/workspace/public/pm/cozy-live-pill.js +3 -0
- package/workspace/public/pm/cozy-pick.css +41 -0
- package/workspace/public/pm/cozy-pick.js +134 -0
- package/workspace/public/pm/cozy-rec-bridge.js +32 -0
- package/workspace/public/pm/cozy-rec-now.css +104 -0
- package/workspace/public/pm/cozy-rec-now.js +330 -0
- package/workspace/public/pm/cozy-rec-present.css +69 -0
- package/workspace/public/pm/cozy-rec-present.js +467 -0
- package/workspace/public/pm/cozy-rec-tab.css +90 -0
- package/workspace/public/pm/cozy-rec-tab.js +219 -0
- package/workspace/public/pm/cozy-settings.js +8 -2
- package/workspace/public/pm/home-app.js +37 -22
- package/workspace/public/pm/home-list.js +17 -10
- package/workspace/public/pm/home-more.js +2 -31
- package/workspace/public/pm/home-today.js +4 -4
- package/workspace/public/pm/live-model.js +1 -1
- package/workspace/public/pm/premium-board.js +56 -25
- package/workspace/public/pm/premium-insights.js +42 -24
- package/workspace/public/pm/premium-meeting.js +17 -4
- package/workspace/public/pm/premium-mtg-present.js +4 -3
- package/workspace/public/pm/premium-report-read.js +2 -0
- package/workspace/public/pm/premium-vw-mtg.js +15 -7
- package/workspace/public/pm/rec-state.js +13 -5
- package/workspace/public/pm/rec-tab-core.js +92 -0
- package/workspace/public/pm/view-notes.js +9 -0
- package/workspace/public/premium-aud.html +22 -0
- package/workspace/public/premium-board.html +1 -0
- package/workspace/public/premium-insights.html +2 -1
- package/workspace/public/premium-rec.html +30 -0
- package/workspace/public/premium.html +1 -0
- package/workspace/rec-present-test.js +229 -0
- package/workspace/server.js +9 -1
- package/workspace/test-lists/rec-now.json +6 -0
- package/workspace/test-lists/rec-present.json +13 -0
- package/workspace/test-lists/recording-tab.json +13 -0
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
/* premium-rec-now-test.js — the recording tab's Now panel and live transcript (batch 12 item 1, slice S2; canvas XrtA1Tab side, XrtA7Room,
|
|
4
|
+
* XrtA7Transcript, XrtA5PhoneRec). Serves the real /premium-rec.html from the real server; the notes and the meeting are answered by stand-ins
|
|
5
|
+
* (fixtures/premium-viewer-fixtures.js, plus GET /api/meeting-focus with Raise now items and a question here) for the whole browser context.
|
|
6
|
+
* The tab opens with go=1 and starts the stand-in recorder on note n2 itself, so it holds the recorder and is in the room; window.__rtShare gives it a picture.
|
|
7
|
+
* N1 in the room: the topic now big, chips, Raise now, the counts line · N2 ✓ on a prompt · N3 a note is kept · N4 a question and its answer, kept with +
|
|
8
|
+
* N5 the live transcript card · N6 a shared screen: the panel moves to the side card, which the bar can hide · N7 a phone
|
|
9
|
+
* Every wait polls the page; no fixed sleep stands in for a state. */
|
|
10
|
+
const path = require('path');
|
|
11
|
+
const { spawn } = require('child_process');
|
|
12
|
+
const { findBrowser } = require('./lib/find-browser');
|
|
13
|
+
const T = require('./test-run').configure({ name: 'premium-rec-now' });
|
|
14
|
+
const F = require('./fixtures/premium-viewer-fixtures.js');
|
|
15
|
+
|
|
16
|
+
const BASE = T.BASE, until = F.until;
|
|
17
|
+
const results = [];
|
|
18
|
+
const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + String(extra).slice(0, 500) : ''}`); };
|
|
19
|
+
let srv = null; let browser = null;
|
|
20
|
+
const finish = async (code) => {
|
|
21
|
+
if (browser) await browser.close().catch(() => {});
|
|
22
|
+
if (srv) { try { srv.kill('SIGKILL'); } catch { /* gone */ } }
|
|
23
|
+
T.killTmux();
|
|
24
|
+
const bad = results.filter((x) => !x.cond).length;
|
|
25
|
+
console.log(`\n${results.length - bad}/${results.length} premium-rec-now assertions passed`);
|
|
26
|
+
process.exit(code !== undefined ? code : (bad ? 1 : 0));
|
|
27
|
+
};
|
|
28
|
+
process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
29
|
+
|
|
30
|
+
/* the stand-in recorder's picture, as premium-rec-tab-test.js gives it */
|
|
31
|
+
const SCREEN = () => {
|
|
32
|
+
window.__pmRecOwnTab = true;
|
|
33
|
+
const wire = () => { const R = window.__premiumRecorder; if (R) R.screen = () => window.__rtScr || { track: null, shared: false, paused: false, silent: false }; };
|
|
34
|
+
wire(); document.addEventListener('DOMContentLoaded', wire);
|
|
35
|
+
window.__rtShare = () => {
|
|
36
|
+
const c = document.createElement('canvas'); c.width = 320; c.height = 180;
|
|
37
|
+
c.getContext('2d').fillRect(0, 0, 320, 180);
|
|
38
|
+
window.__rtScr = { track: c.captureStream(5).getVideoTracks()[0], shared: true, paused: false, silent: false };
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
async function context(o = {}) {
|
|
43
|
+
const ctx = await browser.newContext({ viewport: { width: o.w || 1280, height: o.h || 860 } });
|
|
44
|
+
const S = await F.install(ctx, {});
|
|
45
|
+
// the recording tab starts listening itself (go=1), so its page holds the recorder: the note waits idle until then
|
|
46
|
+
S.store.n2.state = 'idle'; for (const r of S.rows) if (r.id === 'n2') r.state = 'idle';
|
|
47
|
+
const W = F.world();
|
|
48
|
+
const M = { raise: [{ id: 'r1', kind: 'check', text: 'Issue colour: the slide says grey, Ana said blue.', from: 'the screen' }, { id: 'r2', kind: 'follow-up', text: 'Ana owes the tablet frames.', from: 'Oct 15' }], asks: [], notes: [], focusReads: 0 };
|
|
49
|
+
const json = (r, b) => r.fulfill({ status: 200, contentType: 'application/json', body: JSON.stringify(b) });
|
|
50
|
+
// registered after the fixtures, so these answer first
|
|
51
|
+
await ctx.route('**/api/meeting-focus?*', (r) => {
|
|
52
|
+
M.focusReads++;
|
|
53
|
+
return json(r, { ok: true, now_ms: Date.now(), event: { id: 'ev-live', title: 'Design crit', at: W.LIVE_NOTE.meeting.start, end: W.LIVE_NOTE.meeting.end },
|
|
54
|
+
note: { id: 'n2', state: 'recording' }, topics: [{ id: 't1', text: 'One toolbar row', state: 'discussed' }, { id: 't2', text: 'The Issue button', state: 'now' }, { id: 't3', text: 'Phone layout', state: 'notyet' }],
|
|
55
|
+
runs: [{ topic: 't1', from_min: 0, to_min: 6 }, { topic: 't2', from_min: 6, to_min: null }], captured: { decisions: [{ text: 'a' }], actions: [{ text: 'b' }, { text: 'c' }], questions: [] },
|
|
56
|
+
raise: M.raise, asks: M.asks, notes: M.notes, tail: [] });
|
|
57
|
+
});
|
|
58
|
+
await ctx.route('**/api/meeting-focus/raise', (r) => { const b = JSON.parse(r.request().postData() || '{}'); S.posts.push({ path: '/api/meeting-focus/raise', body: b }); M.raise = M.raise.filter((x) => x.id !== b.id); return json(r, { ok: true }); });
|
|
59
|
+
await ctx.route('**/api/meeting-focus/ask', (r) => { const b = JSON.parse(r.request().postData() || '{}'); S.posts.push({ path: '/api/meeting-focus/ask', body: b }); M.asks.push({ id: 'fa1', question: b.question, state: 'working' }); return json(r, { ok: true, id: 'fa1', state: 'working' }); });
|
|
60
|
+
const errors = [];
|
|
61
|
+
ctx.on('page', (pg) => pg.on('pageerror', (e) => errors.push(String((e && e.message) || e))));
|
|
62
|
+
await ctx.addInitScript(F.RECORDER);
|
|
63
|
+
await ctx.addInitScript(SCREEN);
|
|
64
|
+
return { ctx, S, M, errors };
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
(async () => {
|
|
68
|
+
const exe = findBrowser();
|
|
69
|
+
if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the suite cannot run'); return finish(1); }
|
|
70
|
+
let chromium;
|
|
71
|
+
try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
|
|
72
|
+
srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
|
|
73
|
+
await T.waitForServer(BASE);
|
|
74
|
+
browser = await chromium.launch({ executablePath: exe });
|
|
75
|
+
const posted = (S, pth) => S.posts.filter((x) => x.path === pth);
|
|
76
|
+
// REC_NOW_SHOTS=<dir> keeps a picture of each state for the design review
|
|
77
|
+
const shot = async (pg, name) => { if (process.env.REC_NOW_SHOTS) await pg.screenshot({ path: path.join(process.env.REC_NOW_SHOTS, name + '.png') }); };
|
|
78
|
+
|
|
79
|
+
/* N1 in the room */
|
|
80
|
+
const A = await context();
|
|
81
|
+
const p = await A.ctx.newPage();
|
|
82
|
+
await p.goto(BASE + '/premium-rec.html?note=n2&go=1');
|
|
83
|
+
ok('N1 in the room the Now panel fills the light page; the side card stays hidden', await until(() => p.evaluate(() => document.getElementById('rt').dataset.mode === 'room' && !!document.querySelector('#rtStage .rn.rn-room h1') && document.getElementById('rtSide').hidden), 15000),
|
|
84
|
+
await p.evaluate(() => document.getElementById('rt').dataset.mode));
|
|
85
|
+
const room = await p.evaluate(() => ({ now: document.querySelector('.rn-now').innerText, chips: [...document.querySelectorAll('.rn-stp span')].map((s) => s.textContent.trim()), raise: [...document.querySelectorAll('.rn-rq')].map((r) => r.innerText), counts: (document.querySelector('.rn-cgl') || {}).textContent }));
|
|
86
|
+
ok('N1 the topic now is big, with minutes on it and minutes left', /^Now\s+The Issue button\s+\d+ min on it · \d+ min left$/.test(room.now.trim()), room.now);
|
|
87
|
+
ok('N1 chips for the done topic and Next', JSON.stringify(room.chips) === JSON.stringify(['One toolbar row', 'Next: Phone layout']), JSON.stringify(room.chips));
|
|
88
|
+
ok('N1 Raise now: the two prompts with where they came from', room.raise.length === 2 && /Check · from the screen/.test(room.raise[0]) && /Follow-up · from Oct 15/.test(room.raise[1]), JSON.stringify(room.raise));
|
|
89
|
+
ok('N1 one quiet counts line', room.counts === '1 decision · 2 next steps · 1 highlight', room.counts);
|
|
90
|
+
const icons = await p.evaluate(() => [...document.querySelectorAll('#rtBar [data-slot="now"] button')].map((b) => [b.getAttribute('aria-label'), getComputedStyle(b).display === 'none', b.textContent.trim()]));
|
|
91
|
+
ok('N1 the bar holds the transcript icon; the side-panel toggle is hidden in the room; both icon only', icons.length === 2 && icons.some((x) => x[0] === 'Live transcript' && !x[1]) && icons.some((x) => /side panel/.test(x[0]) && x[1]) && icons.every((x) => x[2] === ''), JSON.stringify(icons));
|
|
92
|
+
ok('N1 every button in the panel is icon only with a label', await p.evaluate(() => [...document.querySelectorAll('.rn button')].every((b) => b.getAttribute('aria-label') && !b.textContent.trim())));
|
|
93
|
+
|
|
94
|
+
await shot(p, 'room-1280');
|
|
95
|
+
/* N2 ✓ on a prompt */
|
|
96
|
+
await p.$eval('.rn-rq[data-raise="r1"] [data-rn="raised"]', (b) => b.click());
|
|
97
|
+
ok('N2 ✓ tells the server it was raised, and the prompt goes away', await until(() => posted(A.S, '/api/meeting-focus/raise').some((x) => x.body.id === 'r1' && x.body.action === 'raised' && x.body.note === 'n2') && p.evaluate(() => !document.querySelector('[data-raise="r1"]') && !!document.querySelector('[data-raise="r2"]'))));
|
|
98
|
+
|
|
99
|
+
/* N3 a note */
|
|
100
|
+
await p.fill('.rn-mine textarea', 'Ana sends the frames Friday');
|
|
101
|
+
ok('N3 a line with no question mark is a note', await p.$eval('.rn-send', (b) => b.getAttribute('aria-label')) === 'Keep the note');
|
|
102
|
+
await p.press('.rn-mine textarea', 'Enter');
|
|
103
|
+
ok('N3 Enter keeps it as a line of the note, after what was there, and empties the box', await until(() => posted(A.S, '/api/notes/save').some((x) => x.body.id === 'n2' && /Ask Ana for the tablet frames\.\nAna sends the frames Friday$/.test(x.body.body)) && p.$eval('.rn-mine textarea', (t) => t.value === '')),
|
|
104
|
+
JSON.stringify(posted(A.S, '/api/notes/save')));
|
|
105
|
+
|
|
106
|
+
/* N4 a question */
|
|
107
|
+
await p.fill('.rn-mine textarea', 'Did Ana give a date?');
|
|
108
|
+
ok('N4 a line that ends with ? asks Claude', await p.$eval('.rn-send', (b) => b.getAttribute('aria-label')) === 'Ask Claude');
|
|
109
|
+
await p.press('.rn-mine textarea', 'Enter');
|
|
110
|
+
ok('N4 the question goes to Claude with the note, and shows at once with Claude at work', await until(() => posted(A.S, '/api/meeting-focus/ask').some((x) => x.body.question === 'Did Ana give a date?' && x.body.note === 'n2') && p.evaluate(() => /Did Ana give a date\?/.test(document.querySelector('.rn-chx .q').textContent) && !!document.querySelector('.rn-chx [aria-label="Claude is answering"]'))));
|
|
111
|
+
A.M.asks[0].state = 'answered';
|
|
112
|
+
A.M.notes.push({ ask: 'fa1', cat: 'Answer', body: 'Yes: Friday (she said it at 4:05).', from: ['talk', 'last'], show: 'now' });
|
|
113
|
+
ok('N4 the answer arrives above the box with its source, without waiting for the tab\'s 15 s read', await until(() => p.evaluate(() => { const a = document.querySelector('.rn-chx .ca'); return !!a && /Yes: Friday/.test(a.textContent) && /From the talk and last time/.test(a.textContent); }), 10000));
|
|
114
|
+
await shot(p, 'room-answer-1280');
|
|
115
|
+
await p.$eval('.rn-chx [data-rn="keep"]', (b) => b.click());
|
|
116
|
+
ok('N4 + keeps the answer as a note', await until(() => posted(A.S, '/api/notes/save').some((x) => /Yes: Friday \(she said it at 4:05\)\.$/.test(x.body.body)) && p.evaluate(() => !!document.querySelector('.rn-chx [aria-label="Kept as a note"]'))));
|
|
117
|
+
|
|
118
|
+
/* N5 the transcript */
|
|
119
|
+
ok('N5 the live transcript is closed by default', await p.evaluate(() => document.querySelector('.rn-trp').hidden));
|
|
120
|
+
await p.$eval('.rn-tbtn', (b) => b.click());
|
|
121
|
+
const tr = await until(() => p.evaluate(() => { const c = document.querySelector('.rn-trp'); return !c.hidden && c.querySelectorAll('.l').length ? { after: c.previousElementSibling && c.previousElementSibling.id, lines: [...c.querySelectorAll('.l')].map((l) => l.innerText.replace(/\s+/g, ' ')), hl: !!c.querySelector('[aria-label="Your highlight"]'), w: Math.round(c.getBoundingClientRect().width), pressed: document.querySelector('.rn-tbtn').getAttribute('aria-pressed') } : null; }));
|
|
122
|
+
ok('N5 the icon opens a 420px card right after the side card, with times, speakers and the highlight', !!tr && tr.after === 'rtSide' && tr.w === 420 && tr.lines.length === 3 && /^5:00 Ana The report panel/.test(tr.lines[0]) && /^7:00 You And Issue/.test(tr.lines[1]) && tr.hl && tr.pressed === 'true', JSON.stringify(tr));
|
|
123
|
+
await shot(p, 'room-transcript-1280');
|
|
124
|
+
await p.$eval('.rn-trp [data-rn="tclose"]', (b) => b.click());
|
|
125
|
+
ok('N5 Close closes it', await until(() => p.evaluate(() => document.querySelector('.rn-trp').hidden && document.querySelector('.rn-tbtn').getAttribute('aria-pressed') === 'false')));
|
|
126
|
+
|
|
127
|
+
/* N6 a shared screen */
|
|
128
|
+
await p.evaluate(() => window.__rtShare());
|
|
129
|
+
ok('N6 with a screen the panel moves into the side card, with To cover and the minutes left', await until(() => p.evaluate(() => document.getElementById('rt').dataset.mode === 'screen' && !document.getElementById('rtSide').hidden && !!document.querySelector('#rtSide .rn.rn-side')
|
|
130
|
+
&& /^To cover\d+ min left$/.test(document.querySelector('#rtSide .rn-sec h5').textContent) && !!document.querySelector('#rtSide .rn-ai.now[aria-current="true"]')), 12000));
|
|
131
|
+
await shot(p, 'screen-side-1280');
|
|
132
|
+
await p.$eval('.rn-tbtn', (b) => b.click()); await shot(p, 'screen-transcript-1280'); await p.$eval('.rn-tbtn', (b) => b.click());
|
|
133
|
+
if (process.env.REC_NOW_SHOTS) { await p.evaluate(() => document.documentElement.setAttribute('data-theme', 'dark')); await shot(p, 'screen-side-1280-dark'); await p.evaluate(() => document.documentElement.removeAttribute('data-theme')); }
|
|
134
|
+
await p.$eval('.rn-sbtn', (b) => b.click());
|
|
135
|
+
ok('N6 the side-panel icon hides the side card, and says how to show it', await until(() => p.evaluate(() => document.getElementById('rtSide').hidden && document.querySelector('.rn-sbtn').getAttribute('aria-label') === 'Show the side panel')));
|
|
136
|
+
await p.$eval('.rn-sbtn', (b) => b.click());
|
|
137
|
+
ok('N6 and shows it again', await until(() => p.evaluate(() => !document.getElementById('rtSide').hidden)));
|
|
138
|
+
ok('N6 no page error', A.errors.length === 0, A.errors.join(' | '));
|
|
139
|
+
await A.ctx.close();
|
|
140
|
+
|
|
141
|
+
/* N7 a phone */
|
|
142
|
+
const B = await context({ w: 390, h: 844 });
|
|
143
|
+
const q = await B.ctx.newPage();
|
|
144
|
+
await q.goto(BASE + '/premium-rec.html?note=n2&go=1');
|
|
145
|
+
await until(() => q.evaluate(() => !!document.querySelector('.rn-room h1')), 15000);
|
|
146
|
+
await shot(q, 'room-390');
|
|
147
|
+
await q.$eval('.rn-tbtn', (b) => b.click());
|
|
148
|
+
const fl = await until(() => q.evaluate(() => { const c = document.querySelector('.rn-trp'); return c && !c.hidden ? { over: document.documentElement.scrollWidth - innerWidth, w: Math.round(c.getBoundingClientRect().width) } : null; }));
|
|
149
|
+
ok('N7 on a phone the panel has no sideways scroll, and the transcript is a sheet the full width', !!fl && fl.over <= 0 && fl.w === 390, JSON.stringify(fl));
|
|
150
|
+
ok('N7 no page error', B.errors.length === 0, B.errors.join(' | '));
|
|
151
|
+
await B.ctx.close();
|
|
152
|
+
finish();
|
|
153
|
+
})();
|
|
@@ -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¬e=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
|
+
})();
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/* pm/cozy-aud.css — the audience tab (premium-aud.html, cozy-aud.js; batch 12 item 1, S3). The stage rules are cozy-mtg-present.css's
|
|
2
|
+
* .vzx-aud; these add what that window did not have: a PDF page, one document section at a time, and the quiet wait line. */
|
|
3
|
+
.vzx-aud .aud-pdf { width: 100%; height: 100%; border: 0; background: var(--cz-c-ffffff); }
|
|
4
|
+
.vzx-aud .aud-sec { width: 100%; height: 100%; overflow: auto; padding: 56px 8vw; background: var(--cz-c-ffffff); color: var(--cz-c-2a2e35); }
|
|
5
|
+
.vzx-aud .aud-sec .vzx-page { margin: 0 auto; font-size: 24px; }
|
|
6
|
+
.vzx-aud .aud-sec .vzx-page h1, .vzx-aud .aud-sec .vzx-page h2, .vzx-aud .aud-sec .vzx-page h3 { font-size: 32px; }
|
|
7
|
+
.vzx-aud .aud-wait { font-size: 15px; color: var(--cz-c-9aa1ab); }
|
|
8
|
+
.vzx-aud .aud-img { max-width: 100%; max-height: 100%; display: block; }
|
|
9
|
+
body.cz.vzx-audw { min-height: 100vh; background: var(--cz-c-17191c); } /* the cozy page ground is light; the audience tab is dark to its edge */
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/* pm/cozy-aud.js — the audience tab (premium-aud.html; batch 12 item 1, S3, canvas XrtA9Present).
|
|
2
|
+
*
|
|
3
|
+
* The call sees this tab: the PM shares it in Meet, Zoom or Teams (in the room, drags it to the projector). It shows the stage only, with
|
|
4
|
+
* a quiet line under it (the meeting, then "3 / 6"). The recording tab's presenter (cozy-rec-present.js) says what to show over
|
|
5
|
+
* BroadcastChannel('pmos-present'):
|
|
6
|
+
* presenter → here { t: 'show', show: { mat: { id, kind, title, src, ws, url, host }, at, pages, meeting } } draw it
|
|
7
|
+
* { t: 'ping' } say hello again
|
|
8
|
+
* { t: 'off' } presenting ended: close
|
|
9
|
+
* here → presenter { t: 'hello' } on load and on each ping; { t: 'bye' } when the tab goes
|
|
10
|
+
* It reads the material itself (a PMOS deck or document from GET /api/doc, an uploaded file from GET /api/meeting-material/file), so the
|
|
11
|
+
* channel carries only what to show and where. A live page (a Google Doc, Slides or Sheet, a website) is opened in this tab itself, and the
|
|
12
|
+
* presenter then cannot reach it until the PM presents PMOS material again. It has no controls and writes nothing.
|
|
13
|
+
*
|
|
14
|
+
* audFoot(show) → { left, right } (pure) drawShow(doc, show, cache) → draws (used by the suite through the page) */
|
|
15
|
+
import * as D from './premium-deck.js';
|
|
16
|
+
import * as MP from './premium-mtg-present.js';
|
|
17
|
+
import { toDom } from './cozy-md.js';
|
|
18
|
+
|
|
19
|
+
export const CHANNEL = 'pmos-present';
|
|
20
|
+
const esc = (s) => String(s == null ? '' : s).replace(/[&<>"]/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"' }[c]));
|
|
21
|
+
|
|
22
|
+
/** The quiet line: the meeting on the left, where it is on the right ("3 / 6", "page 3"). */
|
|
23
|
+
export function audFoot(show) {
|
|
24
|
+
const m = (show && show.mat) || {}, at = (show && show.at) || 0, n = (show && show.pages) || 0;
|
|
25
|
+
const steps = m.kind === 'slides' || m.kind === 'doc' || m.kind === 'pdf';
|
|
26
|
+
return { left: (show && show.meeting) || '', right: !steps ? m.title || '' : n ? (at + 1) + ' / ' + n : 'page ' + (at + 1) };
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const cache = new Map();
|
|
30
|
+
async function read(m) {
|
|
31
|
+
const k = m.kind + '|' + (m.ws || '') + '|' + m.src;
|
|
32
|
+
if (!cache.has(k)) cache.set(k, MP.readDoc(m.ws, m.src).then((t) => (m.kind === 'slides' ? { deck: D.parseDeck(t, m.title) } : { doc: MP.docSections(t, m.title) })).catch((x) => ({ error: String((x && x.message) || x) })));
|
|
33
|
+
return cache.get(k);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
let slideHtml = null, cur = null, seq = 0;
|
|
37
|
+
const host = () => document.getElementById('aud');
|
|
38
|
+
async function draw(show) {
|
|
39
|
+
cur = show; const my = ++seq;
|
|
40
|
+
const m = (show && show.mat) || null, el = host(); if (!el) return;
|
|
41
|
+
document.title = m ? m.title + ' · audience' : 'Audience · PMOS';
|
|
42
|
+
const f = audFoot(show), ft = document.getElementById('audFt');
|
|
43
|
+
if (ft) ft.innerHTML = m ? `<span>${esc(f.left)}</span><span>${esc(f.right)}</span>` : '';
|
|
44
|
+
el.dataset.kind = m ? m.kind : '';
|
|
45
|
+
if (!m) { el.innerHTML = '<p class="aud-wait">Waiting for the presenter.</p>'; return; }
|
|
46
|
+
if (m.kind === 'live') { if (m.url && /^https:/.test(m.url)) location.href = m.url; return; }
|
|
47
|
+
if (m.kind === 'image') { el.innerHTML = `<img class="aud-img" alt="${esc(m.title)}" src="${esc(m.url)}">`; return; }
|
|
48
|
+
if (m.kind === 'pdf') { el.innerHTML = `<iframe class="aud-pdf" title="${esc(m.title)}" src="${esc(m.url + '#page=' + (show.at + 1) + '&toolbar=0&navpanes=0&view=Fit')}"></iframe>`; return; }
|
|
49
|
+
if (m.kind !== 'slides' && m.kind !== 'doc') { el.innerHTML = ''; return; }
|
|
50
|
+
const L = await read(m);
|
|
51
|
+
if (my !== seq) return;
|
|
52
|
+
if (L.error) { el.innerHTML = ''; return; }
|
|
53
|
+
if (L.deck) {
|
|
54
|
+
if (!slideHtml) ({ slideHtml } = await import('./premium-vw-slides.js'));
|
|
55
|
+
if (my !== seq) return;
|
|
56
|
+
const s = L.deck.slides[Math.min(show.at, L.deck.slides.length - 1)];
|
|
57
|
+
el.innerHTML = '<div class="vzx-slot"><div class="vzx-box"></div></div>';
|
|
58
|
+
const b = el.querySelector('.vzx-box');
|
|
59
|
+
if (s) { b.innerHTML = slideHtml(s, L.deck.theme, m.ws, false); b.style.setProperty('--bd-k', String(Math.max(0.05, Math.min(innerWidth / D.W, (innerHeight - 48) / D.H)))); MP.place(b); }
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const sec = L.doc.sections[Math.min(show.at, L.doc.sections.length - 1)];
|
|
63
|
+
el.innerHTML = '<div class="aud-sec"></div>';
|
|
64
|
+
if (sec) { const page = document.createElement('div'); page.className = 'vzx-page'; page.append(...toDom(sec.blocks, document)); el.firstChild.append(page); }
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (typeof BroadcastChannel === 'function' && typeof document !== 'undefined' && document.getElementById('aud')) {
|
|
68
|
+
const ch = new BroadcastChannel(CHANNEL);
|
|
69
|
+
ch.onmessage = (e) => {
|
|
70
|
+
const d = e.data || {};
|
|
71
|
+
if (d.t === 'show' && d.show) draw(d.show);
|
|
72
|
+
else if (d.t === 'ping') ch.postMessage({ t: 'hello' });
|
|
73
|
+
else if (d.t === 'off') { draw(null); try { window.close(); } catch { /* a tab the PM opened stays, waiting */ } }
|
|
74
|
+
};
|
|
75
|
+
addEventListener('pagehide', () => { try { ch.postMessage({ t: 'bye' }); } catch { /* closed */ } });
|
|
76
|
+
addEventListener('resize', () => { if (cur) draw(cur); });
|
|
77
|
+
draw(null);
|
|
78
|
+
ch.postMessage({ t: 'hello' });
|
|
79
|
+
window.__pmosAud = { cur: () => cur };
|
|
80
|
+
}
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
* Reads GET /api/live every 10 s while the page is shown, and on the cz:live event (Home sends it after the PM opens or answers a
|
|
16
16
|
* session); the recording comes from pm/rec-state.js. Nothing is written. */
|
|
17
17
|
import { onRecording } from './rec-state.js';
|
|
18
|
+
import { ownTab, bring } from './rec-tab-core.js';
|
|
18
19
|
import { liveItems, keepOrder, pillLabel, rowLabel, clock, elapsed } from './live-model.js';
|
|
19
20
|
|
|
20
21
|
const esc = (v) => String(v == null ? '' : v).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c]);
|
|
@@ -49,6 +50,8 @@ export function mountLivePill(doc = document, opts = {}) {
|
|
|
49
50
|
const items = () => liveItems(L.sessions, { rec: L.rec, titles: L.titles, open: opts.open ? opts.open() : null });
|
|
50
51
|
function go(a, e) {
|
|
51
52
|
const x = L.shown.find((i) => i.id === a.dataset.lv);
|
|
53
|
+
// the recording: its snippet only shows; a press brings the recording tab forward (rec-tab-core.js), where the meeting is controlled
|
|
54
|
+
if (x && x.kind === 'rec' && !(e && (e.metaKey || e.ctrlKey || e.shiftKey)) && ownTab() && bring(x.href)) { if (e) e.preventDefault(); set(false); return; }
|
|
52
55
|
if (x && opts.go && !(e && (e.metaKey || e.ctrlKey || e.shiftKey)) && opts.go(x)) { if (e) e.preventDefault(); set(false); return; }
|
|
53
56
|
set(false); // the link is followed
|
|
54
57
|
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/* pm/cozy-pick.css — the one product picker on Home, Board and Insights (pm/cozy-pick.js; canvas XhpA1Desk, XhpA2States, XhpA3Phone, XhpA4Dark).
|
|
2
|
+
* The chip: the ticked products' tiles, overlapped (+N past 3), or All; open, a blue tint. The list: All products, every product (tile, name,
|
|
3
|
+
* one quiet line, a tick box), Add a product; on a phone the same list as a bottom sheet. The tiles' tints are Home's group tiles (.hv-tl). */
|
|
4
|
+
.ppk-chip { display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 8px 0 5px; border-radius: 999px; border: 0; background: var(--cz-card); color: var(--cz-ink2); box-shadow: 0 0 0 1px var(--cz-hair); font-family: var(--cz-sans); cursor: pointer; flex: none; }
|
|
5
|
+
.ppk-chip.open { background: var(--cz-bluebg); color: var(--cz-blueink); box-shadow: 0 0 0 2px var(--cz-c-b6c6dc); }
|
|
6
|
+
.ppk-chip > svg { flex: none; }
|
|
7
|
+
.ppk-all { font-size: 13.5px; font-weight: 800; padding-left: 7px; }
|
|
8
|
+
.ppk-stk { display: inline-flex; }
|
|
9
|
+
.ppk-t { width: 24px; height: 24px; border-radius: 8px; font-size: 10px; font-weight: 800; font-style: normal; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px var(--cz-card); }
|
|
10
|
+
.ppk-t + .ppk-t { margin-left: -6px; }
|
|
11
|
+
.ppk-t, .ppk-tl { background: var(--cz-bluebg); color: var(--cz-blueink); }
|
|
12
|
+
.ppk-t.t1, .ppk-tl.t1 { background: color-mix(in srgb, var(--cz-c-7a5a2e) 13%, var(--cz-card)); color: var(--cz-c-7a5a2e); }
|
|
13
|
+
.ppk-t.t2, .ppk-tl.t2, .ppk-t.ppk-n { background: var(--cz-well2); color: var(--cz-ink3); }
|
|
14
|
+
.cz.dark .ppk-t.t1, html.dark .cz .ppk-t.t1, :root[data-theme="dark"] .cz .ppk-t.t1, .cz.dark .ppk-tl.t1, html.dark .cz .ppk-tl.t1, :root[data-theme="dark"] .cz .ppk-tl.t1 { color: color-mix(in srgb, var(--cz-c-7a5a2e) 40%, var(--cz-ink)); }
|
|
15
|
+
|
|
16
|
+
.ppk-menu { position: fixed; z-index: 96; box-sizing: border-box; width: min(348px, calc(100vw - 24px)); max-height: calc(100vh - 120px); overflow: auto; padding: 6px; display: flex; flex-direction: column; border-radius: 18px; background: var(--cz-card); box-shadow: 0 24px 50px -20px rgba(42,46,53,.4), 0 0 0 1px var(--cz-hair); font-family: var(--cz-sans); }
|
|
17
|
+
.ppk-mi { display: flex; align-items: center; gap: 12px; min-height: 54px; width: 100%; padding: 6px 10px; border: 0; border-radius: 12px; background: none; color: var(--cz-ink); font: inherit; text-align: left; cursor: pointer; box-sizing: border-box; }
|
|
18
|
+
.ppk-mi:hover, .ppk-mi:focus-visible { background: var(--cz-well); }
|
|
19
|
+
.ppk-nm { flex: 1; min-width: 0; display: flex; flex-direction: column; }
|
|
20
|
+
.ppk-nm b { font-size: 15px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
21
|
+
.ppk-nm em { font-style: normal; font-size: 12.5px; font-weight: 600; color: var(--cz-ink3); }
|
|
22
|
+
.ppk-tl { width: 36px; height: 36px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; flex: none; }
|
|
23
|
+
.ppk-pl { width: 36px; height: 36px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; color: var(--cz-ink2); background: var(--cz-well); flex: none; }
|
|
24
|
+
.ppk-tk { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--cz-c-a9aeb6); box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; flex: none; color: var(--cz-onsolid); }
|
|
25
|
+
.ppk-tk.on { background: var(--cz-blueink); border-color: var(--cz-blueink); color: var(--cz-card); }
|
|
26
|
+
.ppk-tk.part { background: var(--cz-bluebg); border-color: var(--cz-c-b6c6dc); color: var(--cz-blueink); }
|
|
27
|
+
.ppk-sep { height: 1px; background: var(--cz-hair); margin: 4px 8px; flex: none; }
|
|
28
|
+
.ppk-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; }
|
|
29
|
+
.ppk-scrim { position: fixed; inset: 0; z-index: 95; background: rgba(42,46,53,.32); }
|
|
30
|
+
|
|
31
|
+
/* the phone: the chip keeps its 34 px pill inside a 44 px target (a clear border), and the list is a sheet at the bottom (XhpA3Phone) */
|
|
32
|
+
@media (max-width: 760px) {
|
|
33
|
+
.ppk-chip { height: 44px; border: 5px solid transparent; background-clip: padding-box; box-shadow: inset 0 0 0 1px var(--cz-hair); padding: 0 8px 0 5px; }
|
|
34
|
+
.ppk-chip.open { box-shadow: inset 0 0 0 2px var(--cz-c-b6c6dc); }
|
|
35
|
+
}
|
|
36
|
+
.ppk-menu.sheet { left: 0; right: 0; bottom: 0; top: auto; width: auto; max-height: 80vh; border-radius: 28px 28px 0 0; padding: 22px 12px 28px; }
|
|
37
|
+
.ppk-menu.sheet::before { content: ''; position: absolute; top: 8px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 999px; background: var(--cz-c-d9dce1); }
|
|
38
|
+
.ppk-menu.sheet .ppk-mi { min-height: 58px; }
|
|
39
|
+
.ppk-menu.sheet .ppk-tk { width: 24px; height: 24px; border-radius: 8px; }
|
|
40
|
+
@media (prefers-reduced-motion: no-preference) { .ppk-menu.sheet { animation: ppk-up .18s ease-out; } }
|
|
41
|
+
@keyframes ppk-up { from { transform: translateY(24px); opacity: .6; } }
|