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
|
@@ -12,16 +12,21 @@
|
|
|
12
12
|
* paused it is paused (nothing is kept until it resumes)
|
|
13
13
|
* startedAt ms when this stretch of the meeting clock started, so a page can tick it: elapsed = elapsedMs + (Date.now() - readAt)
|
|
14
14
|
* elapsedMs the meeting time heard so far, at readAt
|
|
15
|
-
* href
|
|
16
|
-
* here this page holds the recorder (premium-meeting.js sets window.__premiumHolding)
|
|
15
|
+
* href the recording tab (/premium-rec.html?note=<id>, rec-tab-core.js): a press on a snippet brings it forward
|
|
16
|
+
* here this page holds the recorder (premium-meeting.js sets window.__premiumHolding), or is the recording tab
|
|
17
|
+
* silent the recording tab hears the microphone but not the meeting ("Not hearing the meeting")
|
|
18
|
+
* The recording tab also sends its state over a BroadcastChannel (rec-tab-core.js post) on each change and every 5 s: a page reads again
|
|
19
|
+
* at once, so its snippet never runs a stale clock. The channel carries state only.
|
|
17
20
|
* The answer comes from the notes the server keeps, so a page that did not start the recording still knows of it. Nothing is written. */
|
|
18
21
|
import { pmGet } from './http.js';
|
|
22
|
+
import { tabUrl, isTab, listen } from './rec-tab-core.js';
|
|
19
23
|
|
|
20
24
|
export const EVENT = 'cz:recording';
|
|
21
|
-
const OFF = Object.freeze({ on: false, paused: false, id: '', title: '', startedAt: 0, elapsedMs: 0, readAt: 0, href: '', here: false });
|
|
25
|
+
const OFF = Object.freeze({ on: false, paused: false, id: '', title: '', startedAt: 0, elapsedMs: 0, readAt: 0, href: '', here: false, silent: false });
|
|
26
|
+
let heard = { id: '', silent: false };
|
|
22
27
|
let last = null, lastAt = 0, inflight = null, timer = null;
|
|
23
28
|
const subs = new Set();
|
|
24
|
-
const same = (a, b) => !!a && !!b && a.on === b.on && a.paused === b.paused && a.id === b.id && a.title === b.title;
|
|
29
|
+
const same = (a, b) => !!a && !!b && a.on === b.on && a.paused === b.paused && a.id === b.id && a.title === b.title && a.silent === b.silent;
|
|
25
30
|
|
|
26
31
|
/** The State of the note list (pure). rows: GET /api/notes .notes */
|
|
27
32
|
export function stateOf(rows, now = Date.now(), holding = null) {
|
|
@@ -30,7 +35,8 @@ export function stateOf(rows, now = Date.now(), holding = null) {
|
|
|
30
35
|
const n = live.find((x) => x.state === 'recording') || live[0];
|
|
31
36
|
const el = Math.max(0, Number(n.meeting_ms) || 0);
|
|
32
37
|
return { on: true, paused: n.state === 'paused', id: String(n.id), title: String((n.meeting && n.meeting.title) || n.title || 'Meeting'), startedAt: n.state === 'recording' ? now - el : 0,
|
|
33
|
-
elapsedMs: el, readAt: now, href:
|
|
38
|
+
elapsedMs: el, readAt: now, href: tabUrl(String(n.id), { ws: n.ws || '' }), here: !!(holding && holding.id === n.id) || isTab(),
|
|
39
|
+
silent: heard.id === String(n.id) && heard.silent && n.state === 'recording' };
|
|
34
40
|
}
|
|
35
41
|
|
|
36
42
|
export async function recState({ fresh = false } = {}) {
|
|
@@ -60,4 +66,6 @@ export function onRecording(fn) {
|
|
|
60
66
|
/** A recording was started, paused, resumed or stopped on this page: read again now. */
|
|
61
67
|
export function announce() { return recState({ fresh: true }); }
|
|
62
68
|
|
|
69
|
+
if (typeof window !== 'undefined' && !isTab()) listen((d) => { heard = { id: d.id, silent: !!d.silent }; recState({ fresh: true }); });
|
|
70
|
+
|
|
63
71
|
if (typeof window !== 'undefined') window.czRecording = { state: recState, on: onRecording, EVENT };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/* pm/rec-tab-core.js — a recording runs in its own tab (batch 12 item 1; canvas Ready for development, XrtA1Tab … XrtA6States).
|
|
2
|
+
*
|
|
3
|
+
* The recording tab (/premium-rec.html, rec-tab.js) holds the recorder and never navigates away, so opening Home, Board, Insights or a
|
|
4
|
+
* chat in another tab never pauses the meeting. Every other page shows only a snippet (the Live pill's first row, Home's pinned row): a
|
|
5
|
+
* press brings the recording tab forward. Only the recording tab controls the meeting; the channel below carries its state, never a press.
|
|
6
|
+
*
|
|
7
|
+
* TAB, MAIN the window names: the recording tab, and the PMOS tab its links open in
|
|
8
|
+
* tabUrl(id, { ws, go }) the recording tab's address for one note; go: start listening when it opens
|
|
9
|
+
* isTab() this page is the recording tab
|
|
10
|
+
* ownTab() a Record pressed on this page records in the recording tab (not on a phone, not in the recording tab;
|
|
11
|
+
* a browser under automation only when the suite asks with window.__pmRecOwnTab)
|
|
12
|
+
* openTab(url) → T | null the recording tab, opened or brought forward. Call it first in the press, before any await, so the
|
|
13
|
+
* browser lets it open. A tab that is already open keeps its page; url is loaded only into a new one.
|
|
14
|
+
* goTab(T, url) load url into that tab (a note was made after the press)
|
|
15
|
+
* bring(url) → bool a snippet's press: the recording tab forward (opened at url when it was closed)
|
|
16
|
+
* post(state) · listen(fn) the recording tab's state to every other PMOS tab: { id, state, title, elapsedMs, silent, at }
|
|
17
|
+
* clockOf(ms) · modeOf(row, held, screen) · endOf(note) · marksOf(note, frames, len) the recording tab's pure half
|
|
18
|
+
*/
|
|
19
|
+
export const TAB = 'pmos-rec';
|
|
20
|
+
export const MAIN = 'pmos-main';
|
|
21
|
+
const CHANNEL = 'pmos-rec';
|
|
22
|
+
|
|
23
|
+
export const tabUrl = (id, { ws = '', go = false } = {}) => '/premium-rec.html?note=' + encodeURIComponent(id) + (ws ? '&ws=' + encodeURIComponent(ws) : '') + (go ? '&go=1' : '');
|
|
24
|
+
export const isTab = () => typeof location !== 'undefined' && /^\/premium-rec(\.html)?$/.test(location.pathname);
|
|
25
|
+
const phone = () => typeof matchMedia === 'function' && matchMedia('(max-width: 760px)').matches;
|
|
26
|
+
export function ownTab() {
|
|
27
|
+
if (typeof window === 'undefined' || isTab()) return false;
|
|
28
|
+
if (typeof navigator !== 'undefined' && navigator.webdriver === true && window.__pmRecOwnTab !== true) return false;
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** T = { win, blank, here }: here is true on a phone, where the recording view opens in this same tab. */
|
|
33
|
+
export function openTab(url) {
|
|
34
|
+
if (phone()) { if (url) location.href = url; return { win: window, blank: true, here: true }; }
|
|
35
|
+
let win = null;
|
|
36
|
+
try { win = window.open('', TAB); } catch { win = null; }
|
|
37
|
+
if (!win) return null;
|
|
38
|
+
let blank = false;
|
|
39
|
+
try { blank = !win.location.href || win.location.href === 'about:blank'; } catch { blank = false; }
|
|
40
|
+
if (url && blank) win.location.href = url;
|
|
41
|
+
try { win.focus(); } catch { /* the browser keeps the focus */ }
|
|
42
|
+
return { win, blank, here: false };
|
|
43
|
+
}
|
|
44
|
+
export function goTab(T, url) {
|
|
45
|
+
if (!T || !T.win) return;
|
|
46
|
+
try { T.win.location.href = url; T.win.focus(); } catch { /* the tab was closed */ }
|
|
47
|
+
}
|
|
48
|
+
/** Close a tab opened for a note that was then not made. */
|
|
49
|
+
export function dropTab(T) { if (T && T.blank && !T.here) { try { T.win.close(); } catch { /* gone */ } } }
|
|
50
|
+
export function bring(url) { const T = openTab(url); return !!T; }
|
|
51
|
+
|
|
52
|
+
/* ── the recording tab's pure half (cozy-rec-tab.js draws from these) ─────────────────────────────────────── */
|
|
53
|
+
const pad = (n) => String(n).padStart(2, '0');
|
|
54
|
+
const clip = (s, n) => { const t = String(s == null ? '' : s).replace(/\s+/g, ' ').trim(); return t.length > n ? t.slice(0, n - 1).trimEnd() + '…' : t; };
|
|
55
|
+
/** The meeting clock: 12:40, then 1:02:40 past the hour. */
|
|
56
|
+
export const clockOf = (ms) => { const s = Math.max(0, Math.floor((Number(ms) || 0) / 1000)), h = Math.floor(s / 3600), m = Math.floor((s % 3600) / 60); return h ? h + ':' + pad(m) + ':' + pad(s % 60) : m + ':' + pad(s % 60); };
|
|
57
|
+
/** What the tab is in now (pure): 'stopped' | 'paused' | 'screen' | 'room' | 'idle'. row: the note's list row; held: this tab listens to it;
|
|
58
|
+
* scr: the recorder's picture ({ shared }). */
|
|
59
|
+
export function modeOf(row, held, scr) {
|
|
60
|
+
if (!row) return 'idle';
|
|
61
|
+
if (row.state === 'ended') return 'stopped';
|
|
62
|
+
if (row.state === 'paused') return 'paused';
|
|
63
|
+
if (row.state === 'recording' && held) return scr && scr.shared ? 'screen' : 'room';
|
|
64
|
+
return 'idle';
|
|
65
|
+
}
|
|
66
|
+
/** The meeting's calendar end in ms, or null (an untitled note has none). */
|
|
67
|
+
export const endOf = (note) => { const e = note && note.meeting && note.meeting.end; const t = e && /T\d{2}:\d{2}/.test(e) ? Date.parse(e) : NaN; return Number.isFinite(t) ? t : null; };
|
|
68
|
+
/** The marks on the meeting-so-far line (pure): one per highlight, at its meeting time. → [{ t, x (0..1), text, shot }] */
|
|
69
|
+
export function marksOf(note, frames, len) {
|
|
70
|
+
if (!note || !(len > 0)) return [];
|
|
71
|
+
const from = Date.parse(note.recorded_from || '') || 0;
|
|
72
|
+
const shots = (Array.isArray(frames) ? frames : []).map((f) => f.t).filter(Number.isFinite).sort((a, b) => a - b);
|
|
73
|
+
const near = (t) => { let best = null; for (const s of shots) { if (s <= t + 15000) best = s; else break; } return best; };
|
|
74
|
+
return (note.highlights || []).map((h) => {
|
|
75
|
+
const t = Number.isFinite(h.t) ? h.t : Number.isFinite(h.timestamp) && from ? h.timestamp - from : null;
|
|
76
|
+
return t == null ? null : { t, x: Math.min(1, Math.max(0, t / len)), text: clip(h.text || h.label || '', 140), shot: near(t) };
|
|
77
|
+
}).filter(Boolean);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
let ch = null;
|
|
82
|
+
const channel = () => { if (!ch && typeof BroadcastChannel === 'function') { try { ch = new BroadcastChannel(CHANNEL); } catch { ch = null; } } return ch; };
|
|
83
|
+
export function post(state) { const c = channel(); if (c) { try { c.postMessage({ ...state, at: Date.now() }); } catch { /* closed */ } } }
|
|
84
|
+
export function listen(fn) {
|
|
85
|
+
const c = channel(); if (!c) return () => {};
|
|
86
|
+
const on = (e) => { const d = e && e.data; if (d && typeof d.id === 'string') { try { fn(d); } catch { /* the listener's own */ } } };
|
|
87
|
+
c.addEventListener('message', on);
|
|
88
|
+
return () => c.removeEventListener('message', on);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/* every other PMOS page is the tab the recording tab's links open in */
|
|
92
|
+
if (typeof window !== 'undefined' && !isTab() && !window.name) { try { window.name = MAIN; } catch { /* read-only */ } }
|
|
@@ -748,6 +748,7 @@ async function startAudio(ctx, n, want, plan = null) {
|
|
|
748
748
|
const shared = opened.find(([kind, s]) => kind === 'meeting' && s.screenTrack);
|
|
749
749
|
if (shared && a.cap) {
|
|
750
750
|
const track = shared[1].screenTrack;
|
|
751
|
+
a.screenTrack = track;
|
|
751
752
|
a.screen = startScreen({ track, id: a.id, cap: a.cap, clock: () => Date.now() - a.started, post: (b) => pmPost('/api/notes/screen', b), surface: shared[1].screenSurface || null });
|
|
752
753
|
// the PM stops sharing the picture only: the sound goes on, and the shots stop
|
|
753
754
|
track.addEventListener('ended', () => { if (a.screen) a.screen.stop(); });
|
|
@@ -1982,6 +1983,14 @@ export async function listenNow(ctx, id) {
|
|
|
1982
1983
|
} finally { starting = false; ctx.setState({}); }
|
|
1983
1984
|
}
|
|
1984
1985
|
|
|
1986
|
+
/** What the recording tab draws (rec-tab.js): the shared picture while it is live (null: none, or the share was stopped), whether a
|
|
1987
|
+
* picture was shared at all, whether the screenshots are paused, and whether the meeting's sound is silent while the microphone is heard. */
|
|
1988
|
+
export function liveScreen() {
|
|
1989
|
+
const a = audio, t = a && a.state === 'on' ? a.screenTrack || null : null;
|
|
1990
|
+
return { track: t && t.readyState === 'live' ? t : null, shared: !!t, paused: !!(a && a.screen && a.screen.paused), silent: !!(banner && banner.silent) };
|
|
1991
|
+
}
|
|
1992
|
+
/** Pause or keep the screenshots of the shared picture; the sound goes on. False when nothing is shared. */
|
|
1993
|
+
export function pauseShots(on) { if (!audio || !audio.screen) return false; audio.screen.setPaused(!!on); return true; }
|
|
1985
1994
|
/** The note that is listening now, or null. */
|
|
1986
1995
|
export const listeningId = () => (audio && audio.id) || (speech && speech.mode === 'record' && (speech.state === 'on' || speech.state === 'checking') ? speech.id : null);
|
|
1987
1996
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="pmos-nonce" content="" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
7
|
+
<title>Audience · PMOS</title>
|
|
8
|
+
<!-- The audience tab (batch 12 item 1, S3; canvas XrtA9Present): what the call sees while the PM presents from the recording tab. It shows
|
|
9
|
+
the stage only. The recording tab's presenter (pm/cozy-rec-present.js) says what to show over BroadcastChannel('pmos-present');
|
|
10
|
+
this page reads the material itself and draws it (pm/cozy-aud.js). It has no controls and writes nothing. -->
|
|
11
|
+
<link rel="preload" href="/vendor/nunito-var.woff2" as="font" type="font/woff2" crossorigin />
|
|
12
|
+
<link rel="stylesheet" href="/pm/cozy.css" />
|
|
13
|
+
<link rel="stylesheet" href="/pm/premium-vw-slides.css" />
|
|
14
|
+
<link rel="stylesheet" href="/pm/cozy-mtg-present.css" />
|
|
15
|
+
<link rel="stylesheet" href="/pm/cozy-aud.css" />
|
|
16
|
+
</head>
|
|
17
|
+
<body class="cz vzx-audw">
|
|
18
|
+
<main class="vzx-aud" id="aud" data-kind="" aria-live="polite"></main>
|
|
19
|
+
<div class="vzx-ft" id="audFt"><span></span><span></span></div>
|
|
20
|
+
<script type="module" src="/pm/cozy-aud.js"></script>
|
|
21
|
+
</body>
|
|
22
|
+
</html>
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
sends the question to Home. -->
|
|
12
12
|
<link rel="preload" href="/vendor/nunito-var.woff2" as="font" type="font/woff2" crossorigin />
|
|
13
13
|
<link rel="stylesheet" href="/pm/cozy.css" />
|
|
14
|
+
<link rel="stylesheet" href="/pm/cozy-pick.css" />
|
|
14
15
|
<link rel="stylesheet" href="/pm/cozy-board.css" />
|
|
15
16
|
<link rel="stylesheet" href="/pm/cozy-panel.css" />
|
|
16
17
|
</head>
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
and GET /api/board-metrics-premium for the Delivery trends tiles, whose one press sets a target (POST /api/board-metric-targets/save). -->
|
|
13
13
|
<link rel="preload" href="/vendor/nunito-var.woff2" as="font" type="font/woff2" crossorigin />
|
|
14
14
|
<link rel="stylesheet" href="/pm/cozy.css" />
|
|
15
|
+
<link rel="stylesheet" href="/pm/cozy-pick.css" />
|
|
15
16
|
<link rel="stylesheet" href="/pm/cozy-insights.css" />
|
|
16
17
|
</head>
|
|
17
18
|
<body class="cz">
|
|
@@ -22,7 +23,7 @@
|
|
|
22
23
|
<main class="cz-panel ins stage" id="stage">
|
|
23
24
|
<h1 class="vh">Insights</h1>
|
|
24
25
|
<div class="ins-bar" id="insBar">
|
|
25
|
-
<span class="ins-mw ins-pkw"
|
|
26
|
+
<span class="ins-mw ins-pkw" id="prodHost"></span>
|
|
26
27
|
<span class="ins-ttl" aria-hidden="true">Insights</span>
|
|
27
28
|
<div class="cz-tabs ins-tabs" role="tablist" aria-label="Insights">
|
|
28
29
|
<button type="button" role="tab" class="cz-tab" id="tabGoals" data-tab="goals" aria-controls="pGoals" aria-selected="true">Goals <span class="n" id="nGoals"></span></button>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="pmos-nonce" content="" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
|
|
7
|
+
<title>PMOS · Recording</title>
|
|
8
|
+
<!-- The recording tab (batch 12 item 1): ?note=<id>[&ws=][&go=1]. It holds the recorder and never navigates away, so its links open
|
|
9
|
+
in the other PMOS tab (named pmos-main by rec-tab-core.js). pm/cozy-rec-tab.js draws it. -->
|
|
10
|
+
<base target="pmos-main" />
|
|
11
|
+
<link rel="preload" href="/vendor/nunito-var.woff2" as="font" type="font/woff2" crossorigin />
|
|
12
|
+
<link rel="stylesheet" href="/pm/cozy.css" />
|
|
13
|
+
<link rel="stylesheet" href="/pm/cozy-rec-tab.css" />
|
|
14
|
+
</head>
|
|
15
|
+
<body class="cz rt-page">
|
|
16
|
+
<main class="rt" id="rt" data-mode="idle">
|
|
17
|
+
<div class="rt-main">
|
|
18
|
+
<header class="rt-hd"><span class="rt-dot" aria-hidden="true"></span><b class="rt-clock" id="rtClock">0:00</b><h1 class="rt-title" id="rtTitle">Meeting</h1><span class="rt-past" id="rtPast" hidden></span></header>
|
|
19
|
+
<p class="rt-alert" id="rtAlert" role="alert" hidden></p>
|
|
20
|
+
<section class="rt-stage" id="rtStage" aria-label="The meeting"></section>
|
|
21
|
+
<div class="rt-line" id="rtLine" hidden></div>
|
|
22
|
+
<p class="rt-msg" id="rtMsg" role="status" hidden></p>
|
|
23
|
+
<nav class="rt-bar" id="rtBar" aria-label="Recording controls" hidden></nav>
|
|
24
|
+
</div>
|
|
25
|
+
<aside class="rt-side" id="rtSide" hidden></aside>
|
|
26
|
+
<div class="rt-ask" id="rtAsk" hidden></div>
|
|
27
|
+
</main>
|
|
28
|
+
<script type="module" src="/pm/cozy-rec-tab.js"></script>
|
|
29
|
+
</body>
|
|
30
|
+
</html>
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
<link rel="apple-touch-icon" href="/icons/apple-touch-icon.png" />
|
|
19
19
|
<link rel="preload" href="/vendor/nunito-var.woff2" as="font" type="font/woff2" crossorigin />
|
|
20
20
|
<link rel="stylesheet" href="/pm/cozy.css" />
|
|
21
|
+
<link rel="stylesheet" href="/pm/cozy-pick.css" />
|
|
21
22
|
<link rel="stylesheet" href="/pm/cozy-home.css" />
|
|
22
23
|
<link rel="stylesheet" href="/pm/cozy-today.css" />
|
|
23
24
|
<link rel="stylesheet" href="/pm/cozy-panel.css" />
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
/* rec-present-test.js — Present in the recording tab (batch 12 item 1, S3; canvas XrtA8Pick, XrtA9Present, XrtA9Window; rules 9 and 10).
|
|
4
|
+
* Serves the real recording tab (/premium-rec.html, S1's shell, which mounts pm/cozy-rec-present.js into its stage, side and bar) and the
|
|
5
|
+
* real audience tab (/premium-aud.html) from the real server. The notes and the calendar are the Viewer suites' stand-ins
|
|
6
|
+
* (fixtures/premium-viewer-fixtures.js); the meeting's material, its documents and the find are answered here; the shared window is a
|
|
7
|
+
* canvas stream with a window's label. The other page of P8 is a small page of the same origin that makes the call a deck's Present makes
|
|
8
|
+
* (premium-report-read.js presentIt → cozy-rec-bridge.js presentInRecording).
|
|
9
|
+
* P1 the Present button and the picker · P2 a deck: the audience tab, They see this, Next, Notes, the page turns · P3 a document by
|
|
10
|
+
* section, notes from the prep · P4 live material · P5 a window · P6 Stop presenting · P7 Find in PMOS · P8 a deck's Present on another
|
|
11
|
+
* page while recording (rule 10)
|
|
12
|
+
* Every wait polls the page; no fixed sleep stands in for a state. */
|
|
13
|
+
const path = require('path');
|
|
14
|
+
const { spawn } = require('child_process');
|
|
15
|
+
const { findBrowser } = require('./lib/find-browser');
|
|
16
|
+
const T = require('./test-run').configure({ name: 'rec-present' });
|
|
17
|
+
const F = require('./fixtures/premium-viewer-fixtures.js');
|
|
18
|
+
|
|
19
|
+
const BASE = T.BASE;
|
|
20
|
+
const results = [];
|
|
21
|
+
const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + String(extra).slice(0, 500) : ''}`); };
|
|
22
|
+
const SHOTS = process.env.RXP_SHOTS || ''; // a folder: the suite also keeps a picture of each state there, for the PM's review
|
|
23
|
+
const shot = async (pg, name) => { if (SHOTS) await pg.screenshot({ path: path.join(SHOTS, name + '.png') }).catch(() => {}); };
|
|
24
|
+
const until = async (fn, ms = 8000) => { const t0 = Date.now(); for (;;) { let v = false; try { v = await fn(); } catch { v = false; } if (v) return v; if (Date.now() - t0 > ms) return false; await new Promise((r) => setTimeout(r, 80)); } };
|
|
25
|
+
let srv = null; let browser = null;
|
|
26
|
+
const finish = async (code) => {
|
|
27
|
+
if (browser) await browser.close().catch(() => {});
|
|
28
|
+
if (srv) { try { srv.kill('SIGKILL'); } catch { /* gone */ } }
|
|
29
|
+
T.killTmux();
|
|
30
|
+
const bad = results.filter((x) => !x.cond).length;
|
|
31
|
+
console.log(`\n${results.length - bad}/${results.length} rec-present assertions passed`);
|
|
32
|
+
process.exit(code !== undefined ? code : (bad ? 1 : 0));
|
|
33
|
+
};
|
|
34
|
+
process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
35
|
+
|
|
36
|
+
const DECK = ['# Release deck', '', 'Faster search, saved views, a print view for steering.', '', '## Saved views move in their own work-item', '', 'V.3 on Nov 4', '',
|
|
37
|
+
'## Who owns the print view', '', 'Ana or Bima', ''].join('\n');
|
|
38
|
+
const DOC = ['# Viewer sync PRD', '', 'The summary.', '', '## Goals', '', 'Saved views in V.3.', '', '## Print view', '', 'Steering wants a print view.', ''].join('\n');
|
|
39
|
+
const MATERIAL = [
|
|
40
|
+
{ id: 'm1', kind: 'pmos-deck', ref: 'reports/release-deck.md', title: 'Release deck', ws: 'w1', present: true },
|
|
41
|
+
{ id: 'm2', kind: 'pmos-doc', ref: 'planning/prd/viewer-sync.md', title: 'Viewer sync PRD', ws: 'w1' },
|
|
42
|
+
{ id: 'm3', kind: 'slides', url: 'https://docs.google.com/presentation/d/abcdefghijk/edit', title: 'Roadmap slides' },
|
|
43
|
+
];
|
|
44
|
+
const BRIEF = { prep: '- Ask Ana about the print view before the next slide\n- PSLE-212 is the one still in progress on the Jira board', last: { actions: [{ text: 'the export format', owner: 'Ana', due: 'Oct 24' }] } };
|
|
45
|
+
|
|
46
|
+
/* another PMOS page with a deck's Present (premium-report-read.js presentIt makes the same call) */
|
|
47
|
+
const OTHER = `<!doctype html><html><head><meta charset="utf-8"></head><body><button id="pres" aria-label="Present">P</button>
|
|
48
|
+
<script type="module">
|
|
49
|
+
const B = await import('/pm/cozy-rec-bridge.js');
|
|
50
|
+
window.__took = null;
|
|
51
|
+
document.getElementById('pres').onclick = () => { window.__took = B.presentInRecording({ kind: 'pmos-deck', ref: 'reports/release-deck.md', title: 'Release deck', ws: 'w1' }); };
|
|
52
|
+
window.__rec = () => !!B.recordingNow();
|
|
53
|
+
window.__ready = true;
|
|
54
|
+
</script></body></html>`;
|
|
55
|
+
|
|
56
|
+
(async () => {
|
|
57
|
+
const exe = findBrowser();
|
|
58
|
+
if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the suite cannot run'); return finish(1); }
|
|
59
|
+
let chromium;
|
|
60
|
+
try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
|
|
61
|
+
srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
|
|
62
|
+
await T.waitForServer(BASE);
|
|
63
|
+
browser = await chromium.launch({ executablePath: exe });
|
|
64
|
+
const ctx = await browser.newContext({ viewport: { width: 1440, height: 900 } });
|
|
65
|
+
const posts = [];
|
|
66
|
+
const errors = [];
|
|
67
|
+
const W = F.world();
|
|
68
|
+
const FS = await F.install(ctx, { noLive: true });
|
|
69
|
+
FS.store.n2 = { ...W.LIVE_NOTE, state: 'paused' }; // the tab opens with go=1 and listens, as after Record on another page
|
|
70
|
+
FS.rows = FS.rows.filter((x) => x.id !== 'n2'); FS.rows.push({ ...W.ROWS[2], state: 'paused' });
|
|
71
|
+
await ctx.addInitScript(F.RECORDER);
|
|
72
|
+
await ctx.addInitScript(() => { // the recording tab records in place under automation unless asked; its recorder's picture is a canvas
|
|
73
|
+
window.__pmRecOwnTab = true;
|
|
74
|
+
const wire = () => { const R = window.__premiumRecorder; if (!R) return; R.screen = () => window.__rtScr || { track: null, shared: false, paused: false, silent: false }; R.shots = () => true; };
|
|
75
|
+
wire(); document.addEventListener('DOMContentLoaded', wire);
|
|
76
|
+
window.__rtShare = () => { const c = document.createElement('canvas'); c.width = 320; c.height = 180; c.getContext('2d').fillRect(0, 0, 320, 180); window.__rtScr = { track: c.captureStream(5).getVideoTracks()[0], shared: true, paused: false, silent: false }; };
|
|
77
|
+
});
|
|
78
|
+
await ctx.route('**/api/meeting-focus?*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ 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 },
|
|
79
|
+
note: { id: 'n2', state: 'recording' }, brief: BRIEF, material: MATERIAL, topics: [], runs: [], captured: {}, tail: [] }) }));
|
|
80
|
+
await ctx.route('**/other-page.html', (r) => r.fulfill({ contentType: 'text/html', body: OTHER }));
|
|
81
|
+
await ctx.route('**/api/doc?**', (r) => { const u = new URL(r.request().url()); const p = u.searchParams.get('path'); return r.fulfill({ contentType: 'text/markdown', body: p === 'reports/release-deck.md' ? DECK : DOC }); });
|
|
82
|
+
await ctx.route('**/api/meeting-material/suggest?**', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, suggested: [], found: /print/i.test(new URL(r.request().url()).searchParams.get('q') || '') ? [{ kind: 'pmos-doc', ref: 'planning/prd/print.md', title: 'Print view brief', meta: 'Documents · Mon 26 Oct', ws: 'w1' }] : [] }) }));
|
|
83
|
+
await ctx.route('**/api/meeting-material', (r) => { posts.push(r.request().postDataJSON()); return r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, items: [] }) }); });
|
|
84
|
+
await ctx.route('https://docs.google.com/**', (r) => r.fulfill({ contentType: 'text/html', body: '<title>Roadmap slides - Google Slides</title><p>Google Slides</p>' }));
|
|
85
|
+
await ctx.addInitScript(() => {
|
|
86
|
+
/* the share picker: a canvas stream that says it is a Jira window */
|
|
87
|
+
if (navigator.mediaDevices) navigator.mediaDevices.getDisplayMedia = async () => {
|
|
88
|
+
const c = document.createElement('canvas'); c.width = 320; c.height = 180; const g = c.getContext('2d');
|
|
89
|
+
let k = 0; setInterval(() => { g.fillStyle = k++ % 2 ? '#3355aa' : '#ddeeff'; g.fillRect(0, 0, 320, 180); }, 200);
|
|
90
|
+
const s = c.captureStream(10); const t = s.getVideoTracks()[0];
|
|
91
|
+
Object.defineProperty(t, 'label', { value: 'PSLE board - Jira - Google Chrome' });
|
|
92
|
+
t.getSettings = () => ({ displaySurface: 'window' });
|
|
93
|
+
window.__shared = t; return s;
|
|
94
|
+
};
|
|
95
|
+
});
|
|
96
|
+
const p = await ctx.newPage();
|
|
97
|
+
p.on('pageerror', (e) => errors.push(String(e)));
|
|
98
|
+
await p.goto(BASE + '/premium-rec.html?note=n2&go=1'); // go=1: the tab listens, as after Record on another page
|
|
99
|
+
await until(() => p.evaluate(() => document.getElementById('rtTitle').textContent === 'Design crit' && !!document.querySelector('#rtBar [data-rxp="present"]')), 15000);
|
|
100
|
+
await p.evaluate(() => window.__rtShare());
|
|
101
|
+
await until(() => p.evaluate(() => document.getElementById('rt').dataset.mode === 'screen'), 12000);
|
|
102
|
+
const text = () => p.evaluate(() => document.getElementById('rtStage').innerText);
|
|
103
|
+
const onAud = async () => { for (const q of ctx.pages()) if (/\/premium-aud\.html/.test(q.url())) return q; return null; };
|
|
104
|
+
|
|
105
|
+
/* P1 the button and the picker */
|
|
106
|
+
ok('P1 Present sits in the bar\'s present slot, an icon with a name', await p.evaluate(() => { const b = document.querySelector('#rtBar [data-slot="present"] [data-rxp="present"]'); return !!b && b.getAttribute('aria-label') === 'Present' && !b.textContent.trim(); }));
|
|
107
|
+
await p.click('[data-rxp="present"]');
|
|
108
|
+
ok('P1 the picker opens above the button: From the prep, Find in PMOS, File or link, a tab, a window or your screen', await until(async () => { const t = await p.evaluate(() => (document.querySelector('.rxp-pop') || {}).innerText || ''); return /From the prep/.test(t) && /Find in PMOS/.test(t) && /File or link/.test(t) && /A tab, a window or your screen/.test(t); }));
|
|
109
|
+
ok('P1 the picker sits above the bar', await p.evaluate(() => document.querySelector('.rxp-pop').getBoundingClientRect().bottom <= document.querySelector('[data-rxp="present"]').getBoundingClientRect().top));
|
|
110
|
+
ok('P1 each prep item says its kind and size once it is read', await until(async () => { const t = await p.evaluate(() => document.querySelector('.rxp-pop').innerText); return /Slides · 3 slides/.test(t) && /Document · 3 sections/.test(t) && /Google Slides/.test(t); }), await p.evaluate(() => document.querySelector('.rxp-pop').innerText));
|
|
111
|
+
await shot(p, 'present-picker');
|
|
112
|
+
await p.keyboard.press('Escape');
|
|
113
|
+
ok('P1 Esc closes the picker and gives the focus back', await until(() => p.evaluate(() => !document.querySelector('.rxp-pop') && document.activeElement && document.activeElement.dataset.rxp === 'present')));
|
|
114
|
+
|
|
115
|
+
/* P2 a deck */
|
|
116
|
+
await p.click('[data-rxp="present"]');
|
|
117
|
+
await until(() => p.$('.rxp-pop [data-rxp="mat"]'));
|
|
118
|
+
const audP = ctx.waitForEvent('page', { timeout: 8000 }).catch(() => null);
|
|
119
|
+
await p.click('.rxp-pop [data-rxp="mat"][data-i="0"]');
|
|
120
|
+
const aud = await audP;
|
|
121
|
+
ok('P2 the deck opens a clean audience tab', !!aud && await until(async () => /\/premium-aud\.html/.test(aud.url())), aud && aud.url());
|
|
122
|
+
ok('P2 the stage becomes the presenter: They see this, 1 of 3, time on this slide', await until(async () => { const t = await text(); return /They see this/.test(t) && /1 of 3/.test(t) && /\d:\d\d on this slide/.test(t); }), await text());
|
|
123
|
+
ok('P2 the shared screen is put away while presenting, not removed', await p.evaluate(() => { const o = document.querySelector('#rtStage > .rt-own'); return o.hidden && getComputedStyle(o).display === 'none'; }));
|
|
124
|
+
ok('P2 Next shows the next slide drawn small, and the slide they see is drawn', await until(() => p.evaluate(() => !!document.querySelector('[data-rxp-slide="next"] .sl-it') && !!document.querySelector('[data-rxp-slide="cur"] .sl-it'))));
|
|
125
|
+
ok('P2 with no speaker notes, the notes are Claude\'s points from the prep', /From the prep/.test(await text()) && /Ask Ana about the print view/.test(await text()));
|
|
126
|
+
ok('P2 the audience tab draws the same slide and says 1 / 3', await until(async () => aud && (await aud.evaluate(() => !!document.querySelector('#aud .vzx-box .sl-it') && document.getElementById('audFt').innerText.includes('1 / 3')))), aud && await aud.evaluate(() => document.body.innerHTML.slice(0, 300)));
|
|
127
|
+
ok('P2 the audience tab is named after the material', aud && await until(async () => (await aud.title()) === 'Release deck · audience'));
|
|
128
|
+
ok('P2 the audience tab has no controls', aud && await aud.evaluate(() => !document.querySelector('button, input, a')));
|
|
129
|
+
ok('P2 once the audience tab says hello, the open-it icon goes', await until(() => p.evaluate(() => !document.querySelector('[data-rxp="aud"]'))));
|
|
130
|
+
await p.click('[data-rxp="next"]');
|
|
131
|
+
ok('P2 Next turns the page here: 2 of 3, Previous now works', await until(async () => /2 of 3/.test(await text()) && await p.evaluate(() => !document.querySelector('[data-rxp="prev"]').disabled)));
|
|
132
|
+
ok('P2 the page turn reaches the audience tab', await until(async () => (await aud.evaluate(() => document.getElementById('audFt').innerText)).includes('2 / 3')));
|
|
133
|
+
await p.keyboard.press('ArrowRight');
|
|
134
|
+
ok('P2 the right arrow turns the page too; the last slide has no Next', await until(async () => /3 of 3/.test(await text()) && await p.evaluate(() => document.querySelector('[data-rxp="next"]').disabled)));
|
|
135
|
+
await shot(p, 'present-deck'); await shot(aud, 'audience-deck');
|
|
136
|
+
ok('P2 the time on this slide starts again on a new slide', /0:0\d on this slide/.test(await text()), await text());
|
|
137
|
+
ok('P2 the Present button shows it presents', await p.evaluate(() => document.querySelector('[data-rxp="present"]').classList.contains('on')));
|
|
138
|
+
|
|
139
|
+
/* P3 a document moves by section */
|
|
140
|
+
await p.click('[data-rxp="present"]');
|
|
141
|
+
await until(() => p.$('.rxp-pop [data-rxp="mat"][data-i="1"]'));
|
|
142
|
+
ok('P3 while presenting, the picker also has Stop presenting', /Stop presenting/.test(await p.evaluate(() => document.querySelector('.rxp-pop').innerText)));
|
|
143
|
+
await p.click('.rxp-pop [data-rxp="mat"][data-i="1"]');
|
|
144
|
+
ok('P3 a document: 1 of 3 sections, the section they see, Next is the next section\'s name', await until(async () => { const t = await text(); return /1 of 3/.test(t) && /on this section/.test(t) && /Goals/.test(t) && /The summary/.test(t); }), await text());
|
|
145
|
+
ok('P3 the audience tab follows to the document\'s section', await until(async () => (await aud.evaluate(() => document.querySelector('#aud .aud-sec') && document.getElementById('aud').innerText)) && /The summary/.test(await aud.evaluate(() => document.getElementById('aud').innerText))));
|
|
146
|
+
await p.click('[data-rxp="next"]');
|
|
147
|
+
await shot(p, 'present-doc');
|
|
148
|
+
ok('P3 Next moves the audience tab to the next section', await until(async () => /Saved views in V\.3/.test(await aud.evaluate(() => document.getElementById('aud').innerText))));
|
|
149
|
+
|
|
150
|
+
/* P4 live material */
|
|
151
|
+
await p.click('[data-rxp="present"]');
|
|
152
|
+
await until(() => p.$('.rxp-pop [data-rxp="mat"][data-i="2"]'));
|
|
153
|
+
await p.click('.rxp-pop [data-rxp="mat"][data-i="2"]');
|
|
154
|
+
ok('P4 a Google Slides deck opens live in the audience tab', await until(async () => ctx.pages().some((q) => /docs\.google\.com\/presentation/.test(q.url()))), ctx.pages().map((q) => q.url()).join(' '));
|
|
155
|
+
ok('P4 the stage says so honestly, with no Previous or Next', await until(async () => /live in the audience tab/.test(await text()) && !(await p.$('[data-rxp="next"]'))));
|
|
156
|
+
|
|
157
|
+
/* P5 a tab, a window or the screen */
|
|
158
|
+
await p.click('[data-rxp="present"]');
|
|
159
|
+
await until(() => p.$('.rxp-pop [data-rxp="screen"]'));
|
|
160
|
+
await p.click('.rxp-pop [data-rxp="screen"]');
|
|
161
|
+
ok('P5 a window: They see this · your Jira window, live', await until(async () => /They see this · your Jira window/.test(await text()) && await p.evaluate(() => { const v = document.querySelector('[data-rxp-video]'); return !!v && !!v.srcObject; })), await text());
|
|
162
|
+
ok('P5 Claude\'s points for this screen, from the prep', /For this screen/.test(await text()) && /PSLE-212/.test(await text()));
|
|
163
|
+
ok('P5 no Previous or Next: the PM moves through it in that window', !(await p.$('[data-rxp="next"]')) && /on this screen/.test(await text()));
|
|
164
|
+
ok('P5 a shot is kept when the picture changes', await until(() => p.evaluate(() => document.querySelectorAll('.rxp-shots img').length >= 1), 12000));
|
|
165
|
+
await shot(p, 'present-window');
|
|
166
|
+
await p.evaluate(() => window.__shared.stop());
|
|
167
|
+
await p.evaluate(() => window.__shared.dispatchEvent(new Event('ended')));
|
|
168
|
+
ok('P5 when the share ends, presenting ends and the stage comes back', await until(() => p.evaluate(() => !document.querySelector('.rxp') && !document.querySelector('#rtStage > .rt-own').hidden)));
|
|
169
|
+
|
|
170
|
+
/* P6 Stop presenting */
|
|
171
|
+
await p.click('[data-rxp="present"]');
|
|
172
|
+
await until(() => p.$('.rxp-pop [data-rxp="mat"]'));
|
|
173
|
+
const aud2P = ctx.waitForEvent('page', { timeout: 4000 }).catch(() => null);
|
|
174
|
+
await p.click('.rxp-pop [data-rxp="mat"][data-i="0"]');
|
|
175
|
+
await aud2P;
|
|
176
|
+
await until(async () => /1 of 3/.test(await text()));
|
|
177
|
+
await p.click('[data-rxp="present"]');
|
|
178
|
+
await until(() => p.$('.rxp-pop [data-rxp="stop"]'));
|
|
179
|
+
await p.click('.rxp-pop [data-rxp="stop"]');
|
|
180
|
+
ok('P6 Stop presenting gives the stage back to the shared screen', await until(() => p.evaluate(() => !document.querySelector('.rxp') && !document.querySelector('#rtStage > .rt-own').hidden && !document.querySelector('[data-rxp="present"]').classList.contains('on'))));
|
|
181
|
+
ok('P6 the audience tab closes itself', await until(async () => !(await onAud())), ctx.pages().map((q) => q.url()).join(' '));
|
|
182
|
+
|
|
183
|
+
/* P7 Find in PMOS */
|
|
184
|
+
await p.click('[data-rxp="present"]');
|
|
185
|
+
await until(() => p.$('.rxp-pop [data-rxp="find"]'));
|
|
186
|
+
await p.click('.rxp-pop [data-rxp="find"]');
|
|
187
|
+
await until(() => p.$('.rxp-pop [data-rxp="q"]'));
|
|
188
|
+
await p.keyboard.type('print');
|
|
189
|
+
ok('P7 Find in PMOS lists what PMOS holds', await until(async () => /Print view brief/.test(await p.evaluate(() => document.querySelector('.rxp-pop').innerText))));
|
|
190
|
+
await p.click('.rxp-pop [data-rxp="found"]');
|
|
191
|
+
ok('P7 a found document presents', await until(async () => /They see this/.test(await text()) && /on this section/.test(await text())));
|
|
192
|
+
await p.click('[data-rxp="present"]'); await until(() => p.$('.rxp-pop [data-rxp="stop"]')); await p.click('.rxp-pop [data-rxp="stop"]');
|
|
193
|
+
await until(() => p.evaluate(() => !document.querySelector('.rxp')));
|
|
194
|
+
|
|
195
|
+
/* P7 File or link: a pasted link is kept with the meeting, then presented */
|
|
196
|
+
await p.click('[data-rxp="present"]');
|
|
197
|
+
await until(() => p.$('.rxp-pop [data-rxp="link"]'));
|
|
198
|
+
await p.click('.rxp-pop [data-rxp="link"]');
|
|
199
|
+
ok('P7 File or link: a link box and an Upload icon', await until(() => p.evaluate(() => !!document.querySelector('.rxp-pop [data-rxp="url"]') && document.querySelector('.rxp-pop [data-rxp="upload"]').getAttribute('aria-label') === 'Upload a file')));
|
|
200
|
+
await p.fill('.rxp-pop [data-rxp="url"]', 'http://example.com/x');
|
|
201
|
+
await p.press('.rxp-pop [data-rxp="url"]', 'Enter');
|
|
202
|
+
ok('P7 only an https link is taken', await until(async () => /Only an https link/.test(await p.evaluate(() => document.querySelector('.rxp-pop').innerText))));
|
|
203
|
+
await p.fill('.rxp-pop [data-rxp="url"]', 'https://docs.google.com/document/d/abcdefghijk/edit');
|
|
204
|
+
await p.press('.rxp-pop [data-rxp="url"]', 'Enter');
|
|
205
|
+
ok('P7 the link is added to this meeting\'s material', await until(() => posts.some((x) => x && x.op === 'add' && x.event && x.event.id === 'ev-live' && x.item && /docs\.google\.com\/document/.test(x.item.url))), JSON.stringify(posts));
|
|
206
|
+
ok('P7 and presented live', await until(async () => /live in the audience tab/.test(await text())));
|
|
207
|
+
await p.click('[data-rxp="present"]'); await until(() => p.$('.rxp-pop [data-rxp="stop"]')); await p.click('.rxp-pop [data-rxp="stop"]');
|
|
208
|
+
await until(() => p.evaluate(() => !document.querySelector('.rxp')));
|
|
209
|
+
|
|
210
|
+
/* P8 rule 10: a deck's Present on another page, while the meeting records */
|
|
211
|
+
const o = await ctx.newPage();
|
|
212
|
+
o.on('pageerror', (e) => errors.push(String(e)));
|
|
213
|
+
await o.goto(BASE + '/other-page.html');
|
|
214
|
+
await until(() => o.evaluate(() => window.__ready === true));
|
|
215
|
+
ok('P8 another page hears that the meeting records', await until(() => o.evaluate(() => window.__rec())));
|
|
216
|
+
const aud3P = ctx.waitForEvent('page', { timeout: 6000 }).catch(() => null);
|
|
217
|
+
await o.click('#pres');
|
|
218
|
+
ok('P8 the deck\'s Present goes to the recording tab', await until(() => o.evaluate(() => window.__took === true)));
|
|
219
|
+
const aud3 = await aud3P;
|
|
220
|
+
ok('P8 the audience tab opens in that press', !!aud3 && await until(async () => /\/premium-aud\.html/.test(aud3.url())));
|
|
221
|
+
ok('P8 the recording tab shows the presenter view of that deck', await until(async () => /They see this/.test(await text()) && /1 of 3/.test(await text())), await text());
|
|
222
|
+
ok('P8 the audience tab draws its first slide', await until(async () => aud3 && (await aud3.evaluate(() => !!document.querySelector('#aud .vzx-box .sl-it')))));
|
|
223
|
+
await p.close();
|
|
224
|
+
ok('P8 with no recording heard, Present on a deck works as before', await until(async () => !(await o.evaluate(() => window.__rec())), 15000) && await o.evaluate(async () => { const B = await import('/pm/cozy-rec-bridge.js'); return B.presentInRecording({ kind: 'pmos-deck', ref: 'a.md', title: 'A' }) === false; }));
|
|
225
|
+
|
|
226
|
+
ok('no page error', errors.length === 0, errors.join(' | '));
|
|
227
|
+
await ctx.close();
|
|
228
|
+
return finish();
|
|
229
|
+
})().catch((e) => { console.error(e); finish(1); });
|
package/workspace/server.js
CHANGED
|
@@ -6633,11 +6633,19 @@ async function handleRequest(req, res) {
|
|
|
6633
6633
|
res.writeHead(302, { Location: '/premium.html' + url.search, 'Cache-Control': 'no-store' });
|
|
6634
6634
|
return res.end();
|
|
6635
6635
|
}
|
|
6636
|
+
// The audience tab (batch 12 item 1, S3): what the call sees while the PM presents from the recording tab. It makes no press.
|
|
6637
|
+
if (p === '/premium-aud' || p === '/premium-aud.html') {
|
|
6638
|
+
return fs.readFile(path.join(PUB, 'premium-aud.html'), 'utf8', (err, html) => {
|
|
6639
|
+
if (err) { res.writeHead(404); res.end('not found'); return; }
|
|
6640
|
+
res.writeHead(200, { 'Content-Type': TYPES['.html'], 'Cache-Control': 'no-cache, no-store' });
|
|
6641
|
+
res.end(withBuild(html));
|
|
6642
|
+
});
|
|
6643
|
+
}
|
|
6636
6644
|
if (p === '/welcome' || p === '/welcome.html') {
|
|
6637
6645
|
res.writeHead(302, { Location: '/premium-welcome.html' + url.search, 'Cache-Control': 'no-store' });
|
|
6638
6646
|
return res.end();
|
|
6639
6647
|
}
|
|
6640
|
-
const PAGES = { '/': 'premium.html', '/index.html': 'premium.html', '/premium': 'premium.html', '/premium.html': 'premium.html', '/premium-board': 'premium-board.html', '/premium-board.html': 'premium-board.html', '/premium-insights': 'premium-insights.html', '/premium-insights.html': 'premium-insights.html', '/premium-welcome': 'premium-welcome.html', '/premium-welcome.html': 'premium-welcome.html', '/premium-viewer': 'premium-viewer.html', '/premium-viewer.html': 'premium-viewer.html', '/premium-workflows': 'premium-workflows.html', '/premium-workflows.html': 'premium-workflows.html' };
|
|
6648
|
+
const PAGES = { '/': 'premium.html', '/index.html': 'premium.html', '/premium': 'premium.html', '/premium.html': 'premium.html', '/premium-board': 'premium-board.html', '/premium-board.html': 'premium-board.html', '/premium-insights': 'premium-insights.html', '/premium-insights.html': 'premium-insights.html', '/premium-welcome': 'premium-welcome.html', '/premium-welcome.html': 'premium-welcome.html', '/premium-viewer': 'premium-viewer.html', '/premium-viewer.html': 'premium-viewer.html', '/premium-rec': 'premium-rec.html', '/premium-rec.html': 'premium-rec.html', '/premium-workflows': 'premium-workflows.html', '/premium-workflows.html': 'premium-workflows.html' };
|
|
6641
6649
|
const page = capture ? 'capture.html' : Object.prototype.hasOwnProperty.call(PAGES, p) ? PAGES[p] : null;
|
|
6642
6650
|
if (page) {
|
|
6643
6651
|
// pm-os-absorb Run 2 (R25, X11): the per-launch nonce goes into the base meta line, nowhere else. no-store, so a
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "Batch 12 item 1, slice S2: the recording tab's Now panel and live transcript. The unit suite covers the screen text and Raise now items in the meeting companion (lib/meeting-focus.js), POST /api/meeting-focus/raise, and the panel's pure model and markup (public/pm/cozy-rec-now.js); the browser suite mounts the panel in the real recording tab (room, shared screen, ask Claude, transcript, phone).",
|
|
3
|
+
"modules": ["rec-now.test.js"],
|
|
4
|
+
"panels": ["premium-rec-now-test.js"],
|
|
5
|
+
"seconds": { "rec-now.test.js": 2, "premium-rec-now-test.js": 25 }
|
|
6
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "Batch 12 item 1, S3: Present in the recording tab (the presenter view, the audience tab, a shared window, a deck's Present while recording).",
|
|
3
|
+
"panels": [
|
|
4
|
+
"rec-present-test.js"
|
|
5
|
+
],
|
|
6
|
+
"modules": [
|
|
7
|
+
"rec-present.test.js"
|
|
8
|
+
],
|
|
9
|
+
"seconds": {
|
|
10
|
+
"rec-present-test.js": 60,
|
|
11
|
+
"rec-present.test.js": 1
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "Batch 12 item 1, slice S1: a meeting records in its own tab (premium-rec.html); every other page shows a snippet.",
|
|
3
|
+
"panels": [
|
|
4
|
+
"premium-rec-tab-test.js"
|
|
5
|
+
],
|
|
6
|
+
"modules": [
|
|
7
|
+
"rec-tab.test.js"
|
|
8
|
+
],
|
|
9
|
+
"seconds": {
|
|
10
|
+
"premium-rec-tab-test.js": 60,
|
|
11
|
+
"rec-tab.test.js": 1
|
|
12
|
+
}
|
|
13
|
+
}
|