create-pmos 0.269.0 → 0.271.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 +1 -1
- 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/briefing-premium-calendar-2-test.js +2 -2
- package/workspace/briefing-premium-calendar-3-test.js +360 -0
- package/workspace/briefing-premium-calendar-test.js +2 -2
- package/workspace/guide/briefing-premium.md +13 -2
- package/workspace/lib/insights-premium.js +26 -5
- package/workspace/lib/premium-charts.js +129 -0
- package/workspace/lib/route-modules.js +1 -0
- package/workspace/lib/routes-insights-premium.js +4 -2
- package/workspace/lib/routes-premium-charts.js +46 -0
- package/workspace/lib/routes-premium-dashboards.js +3 -2
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-studio-chart-test.js +193 -0
- package/workspace/public/pm/premium-insights.js +71 -12
- package/workspace/public/pm/premium-meeting.js +375 -16
- package/workspace/public/pm/premium-shell.js +36 -0
- package/workspace/public/pm/premium-studio.js +224 -45
- package/workspace/public/pm/premium.css +66 -0
- package/workspace/public/pm/premium.js +1 -0
- package/workspace/test-files.json +2 -0
- package/workspace/test-lists/briefing-premium.json +2 -0
- package/workspace/test-lists/premium-studio-chart.json +13 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.271.0",
|
|
4
4
|
"description": "Scaffold the PMOS portable kit — run the PMOS product-management workflow (initiative → lane-fit spec → contract → build → three gates, with work-type lanes for features, research, maintenance, incidents, and content) entirely inside your own repo, with all state as git-versioned files. Includes `workflow-sweep`, which audits the state every board derives from and separates real defects from work you simply have not done. `create-pmos workspace` also installs + launches the local Terminal Workspace GUI. No database, no network, no telemetry.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
package/payload/KIT-VERSION
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Reference
|
|
3
3
|
title: "Eval calibration log"
|
|
4
4
|
description: "Append-only record of every PM override of an evaluator verdict."
|
|
5
|
-
generated: {by: process:create-pmos, at: "2026-10-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-18T13:12:06Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Reference
|
|
3
3
|
title: "Health budgets"
|
|
4
4
|
description: "Closed registry of health-budget anchors (D59), edited only by the PM."
|
|
5
|
-
generated: {by: process:create-pmos, at: "2026-10-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-18T13:12:06Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Reference
|
|
3
3
|
title: "Discoveries and friction log"
|
|
4
4
|
description: "Append-only record of what runs discovered and where the process rubbed."
|
|
5
|
-
generated: {by: process:create-pmos, at: "2026-10-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-18T13:12:06Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -160,7 +160,7 @@ const SUGGEST = { ok: true, suggested: [{ kind: 'pmos-doc', ref: 'planning/prd/p
|
|
|
160
160
|
await until(() => A.matPosts.length === nRm + 2);
|
|
161
161
|
ok('M2 Undo adds the same item back at the same scope', A.matPosts[nRm + 1].op === 'add' && A.matPosts[nRm + 1].scope === 'meeting' && A.matPosts[nRm + 1].item.url === 'https://x.example/road', JSON.stringify(A.matPosts[nRm + 1]));
|
|
162
162
|
ok('M2 the row is back and the status says so', await until(() => p.evaluate(() => /Put back\./.test(document.querySelector('#mtgStatus').textContent) && /Roadmap/.test(document.querySelector('#oMain').textContent))));
|
|
163
|
-
ok('M6 nothing else was written by the material work', A.planPosts.length === 0 && ![...A.reqs].some((r) =>
|
|
163
|
+
ok('M6 nothing else was written by the material work', A.planPosts.length === 0 && ![...A.reqs].some((r) => /POST \/api\/(notes|meeting-focus|calendar-links)/.test(r)));
|
|
164
164
|
ok('M6 no page error so far', A.errors.length === 0, JSON.stringify(A.errors));
|
|
165
165
|
|
|
166
166
|
/* M5 refusals */
|
|
@@ -203,7 +203,7 @@ const SUGGEST = { ok: true, suggested: [{ kind: 'pmos-doc', ref: 'planning/prd/p
|
|
|
203
203
|
const all = [].concat(A.reqs, D.reqs, N.reqs, NI.reqs, NS.reqs, NR.reqs);
|
|
204
204
|
const posts = [...new Set(all.filter((r) => /^POST /.test(r)))].sort();
|
|
205
205
|
ok('M6 the only writes the page sent are the material and the plan items', posts.join() === 'POST /api/meeting-material,POST /api/plan-items', posts.join());
|
|
206
|
-
ok('M6 no recording, Focus, note or calendar write was sent', !all.some((r) =>
|
|
206
|
+
ok('M6 no recording, Focus, note or calendar write was sent', !all.some((r) => /POST \/api\/(notes|meeting-focus|calendar)/.test(r)));
|
|
207
207
|
ok('M6 no page error', [A, D, N, NI, NS, NR].every((x) => x.errors.length === 0), JSON.stringify([A, D, N, NI, NS, NR].map((x) => x.errors)));
|
|
208
208
|
|
|
209
209
|
/* M7 floors and fidelity */
|
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
/* briefing-premium-calendar-3-test.js — recording, the chip, Focus and Replay in the premium meeting dialog (initiative briefing-premium-calendar, slice 3;
|
|
4
|
+
* planning/prd/briefing-premium-calendar-3-prd.md R1 to R11). Serves the real pages from the real server. The Briefing model, the calendar, the notes, Focus and the replay
|
|
5
|
+
* are answered by stand-ins, so each press can be read off the request the page sent; the recorder is a stand-in that makes the same requests the console's recorder makes
|
|
6
|
+
* (record, pause, stop) and opens no microphone. The routes' own behaviour is in their own suites.
|
|
7
|
+
* R1 record · R2 honest state · R3 chip · R4 leaving · R5 Focus · R6 honest Focus · R7 Replay · R8 Topic · R9 row mark · R10 writes · R11 floors and fidelity
|
|
8
|
+
* Every wait polls the page; no fixed sleep stands in for a state. */
|
|
9
|
+
const fs = require('fs');
|
|
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: 'briefing-premium-calendar-3' });
|
|
14
|
+
const B = require('./lib/briefing-premium.js');
|
|
15
|
+
const F = require('./fixtures/briefing-premium-facts.js');
|
|
16
|
+
|
|
17
|
+
const BASE = T.BASE;
|
|
18
|
+
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
19
|
+
const until = async (fn, ms = 10000, step = 100) => { const t0 = Date.now(); for (;;) { const v = await fn(); if (v) return v; if (Date.now() - t0 > ms) return v; await sleep(step); } };
|
|
20
|
+
const results = [];
|
|
21
|
+
const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + extra : ''}`); };
|
|
22
|
+
let srv = null; let browser = null;
|
|
23
|
+
const finish = async (code) => {
|
|
24
|
+
if (browser) await browser.close().catch(() => {});
|
|
25
|
+
if (srv) { try { srv.kill('SIGKILL'); } catch { /* gone */ } }
|
|
26
|
+
T.killTmux();
|
|
27
|
+
const bad = results.filter((x) => !x.cond).length;
|
|
28
|
+
console.log(`\n${results.length - bad}/${results.length} briefing-premium-calendar-3 assertions passed`);
|
|
29
|
+
process.exit(code !== undefined ? code : (bad ? 1 : 0));
|
|
30
|
+
};
|
|
31
|
+
process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
32
|
+
|
|
33
|
+
const pad = (n) => String(n).padStart(2, '0');
|
|
34
|
+
const dayKey = (d) => `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`;
|
|
35
|
+
const iso = (d) => { const off = -d.getTimezoneOffset(), a = Math.abs(off); return `${dayKey(d)}T${pad(d.getHours())}:${pad(d.getMinutes())}:00${off >= 0 ? '+' : '-'}${pad(Math.floor(a / 60))}:${pad(a % 60)}`; };
|
|
36
|
+
const NOW = new Date();
|
|
37
|
+
const midnight = new Date(NOW.getFullYear(), NOW.getMonth(), NOW.getDate());
|
|
38
|
+
const monday = () => { const d = new Date(midnight); d.setDate(d.getDate() - ((d.getDay() + 6) % 7)); return d; };
|
|
39
|
+
/* "Live review" is under way now (it starts at most 10 minutes ago, never before midnight); "Retro" ended long ago when the day allows, so it cannot be recorded. */
|
|
40
|
+
const START = new Date(Math.max(midnight.getTime(), NOW.getTime() - 10 * 60000)), END = new Date(START.getTime() + 60 * 60000);
|
|
41
|
+
const weekAnswer = () => {
|
|
42
|
+
const m = monday(), cells = [];
|
|
43
|
+
for (let i = 0; i < 7; i++) { const d = new Date(m.getFullYear(), m.getMonth(), m.getDate() + i); cells.push({ key: dayKey(d), start: dayKey(d), end: dayKey(d), events: [] }); }
|
|
44
|
+
const put = (d, e) => cells.find((c) => c.key === dayKey(d)).events.push(e);
|
|
45
|
+
put(START, { id: 'ev-live', at: iso(START), end: iso(END), title: 'Live review', attendees: ['Priya', 'Dara'] });
|
|
46
|
+
const other = new Date(midnight); other.setDate(other.getDate() + (NOW.getDay() === 0 ? -2 : 1)); other.setHours(9, 30, 0, 0);
|
|
47
|
+
if (cells.some((c) => c.key === dayKey(other))) put(other, { id: 'ev-standup', at: iso(other), end: iso(new Date(other.getTime() + 30 * 60000)), title: 'Standup', attendees: [] });
|
|
48
|
+
return { ok: true, view: 'week', range: { start: cells[0].key, end: cells[6].key }, cells, events_source: 'calendar-memory', today: dayKey(NOW), context: {}, link_boards: [], gantt: [] };
|
|
49
|
+
};
|
|
50
|
+
const REPLAY = { ok: true, note: { id: 'n1', title: 'Live review notes' }, meeting: { title: 'Live review', attendees: ['Priya', 'Dara'] }, audio: null, length_ms: 300000,
|
|
51
|
+
lines: [{ i: 0, t: 1000, who: 'Dara', text: 'Welcome everyone' }, { i: 1, t: 61000, who: 'Priya', text: 'We plan eight people' }, { i: 2, t: 130000, who: 'Dara', text: 'Next the risks' }],
|
|
52
|
+
keys: [{ k: 'decision', text: 'Plan with eight people', t: 61000, state: 'draft' }, { k: 'action', text: 'Priya confirms the owner', t: null, owner: 'Priya', state: 'owner' }, { k: 'question', text: 'Who signs off?', t: 200000, state: 'open' }],
|
|
53
|
+
topics: [{ id: 'capacity', text: 'Capacity', n: 1 }, { id: 'risks', text: 'Risks', n: 2 }], runs: [{ topic: 'capacity', n: 1, from_ms: 0, to_ms: 100000 }, { topic: 'risks', n: 2, from_ms: 100000, to_ms: 300000 }],
|
|
54
|
+
shots: [{ t: 120000, w: 10, h: 10, why: 'A slide with the plan' }] };
|
|
55
|
+
const FOCUS = () => ({ ok: true, now_ms: Date.now(), date: dayKey(NOW), talk: false, event: { id: 'ev-live', title: 'Live review', at: iso(START), end: iso(END), attendees: ['Priya', 'Dara'] },
|
|
56
|
+
note: { id: 'n1', title: 'Live review', state: 'recording', lines: 3 }, topics: [{ id: 'capacity', text: 'Capacity', state: 'discussed', minutes: 4 }, { id: 'risks', text: 'Risks', state: 'now', minutes: 2 }, { id: 'launch', text: 'Launch date', state: 'notyet', minutes: 0 }],
|
|
57
|
+
current: 'risks', runs: [{ topic: 'capacity', from_min: 0, to_min: 4 }, { topic: 'risks', from_min: 4, to_min: null }], gist: 'The room is weighing the risks to the date.',
|
|
58
|
+
chips: [{ label: 'Premium UX', sub: 'in progress' }], tail: [{ who: 'Dara', text: 'Welcome everyone' }, { who: 'Priya', text: 'We plan eight people' }, { who: 'Dara', text: 'Next the risks' }],
|
|
59
|
+
captured: { decisions: [{ text: 'Plan with eight people' }], actions: [{ text: 'Priya confirms the owner' }], questions: [] }, material: [{ title: 'Capacity sheet', kind: 'doc', topic: 'Capacity' }], notes: [], asks: [], companion: { on: true, running: false, started: false, reason: 'new lines', error: null } });
|
|
60
|
+
const WAV = (() => { const rate = 8000, n = rate * 4, b = Buffer.alloc(44 + n * 2); b.write('RIFF', 0); b.writeUInt32LE(36 + n * 2, 4); b.write('WAVEfmt ', 8); b.writeUInt32LE(16, 16); b.writeUInt16LE(1, 20); b.writeUInt16LE(1, 22); b.writeUInt32LE(rate, 24); b.writeUInt32LE(rate * 2, 28); b.writeUInt16LE(2, 32); b.writeUInt16LE(16, 34); b.write('data', 36); b.writeUInt32LE(n * 2, 40); return b; })();
|
|
61
|
+
const MOCKUP = fs.readFileSync(path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'briefing-artifact.html'), 'utf8');
|
|
62
|
+
|
|
63
|
+
/* the stand-in recorder: the console's recorder makes these same requests; this one opens no microphone */
|
|
64
|
+
const RECORDER = () => {
|
|
65
|
+
window.__premiumRecorder = {
|
|
66
|
+
_id: null, _started: null, _banner: null,
|
|
67
|
+
async listen(id) {
|
|
68
|
+
const r = await fetch('/api/notes/record', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ id }) }).then((x) => x.json());
|
|
69
|
+
if (!r.ok) { this._banner = r.error; return false; }
|
|
70
|
+
this._id = id; this._started = Date.now() - 65000; return true;
|
|
71
|
+
},
|
|
72
|
+
async pause() { await fetch('/api/notes/pause', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ id: this._id }) }); this._id = null; },
|
|
73
|
+
async stop(id) { await fetch('/api/notes/stop', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ id }) }); this._id = null; return { discarded: false }; },
|
|
74
|
+
listening() { return this._id; }, started() { return this._started; }, banner() { const b = this._banner; this._banner = null; return b; },
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
(async () => {
|
|
79
|
+
const exe = findBrowser();
|
|
80
|
+
if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the suite cannot run'); return finish(1); }
|
|
81
|
+
let chromium;
|
|
82
|
+
try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
|
|
83
|
+
srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
|
|
84
|
+
await T.waitForServer(BASE);
|
|
85
|
+
browser = await chromium.launch({ executablePath: exe, args: ['--autoplay-policy=no-user-gesture-required'] });
|
|
86
|
+
|
|
87
|
+
const facts = () => { const f = F.facts(); f.meetings = [{ start: START.getTime(), end: END.getTime(), title: 'Live review', with: 'Priya, Dara', initiative: null }]; return f; };
|
|
88
|
+
const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'application/json', body: JSON.stringify(b) });
|
|
89
|
+
/* opts: notes (the note rows the server holds), newStatus (the answer of POST /api/notes/new), recordError, focus (the Focus answer or a function), replay, audio, topics (the material topics) */
|
|
90
|
+
const SESS = [];
|
|
91
|
+
const open = async ({ w = 1280, h = 900, theme = 'light', notes = [], newError = null, recordError = null, focus = FOCUS, replay = REPLAY, topics = [], audio = false, url = '/premium.html', openDialog = true, stub = true } = {}) => {
|
|
92
|
+
const ctx = await browser.newContext({ viewport: { width: w, height: h } });
|
|
93
|
+
const page = await ctx.newPage();
|
|
94
|
+
const S = { errors: [], reqs: [], notes: notes.map((n) => ({ ...n })), newPosts: [], recPosts: [], pausePosts: [], stopPosts: [], topicPosts: [], matPosts: [], focusGets: 0, dialogs: [], pauseSeen: [], newError, recordError };
|
|
95
|
+
page.on('pageerror', (e) => S.errors.push(String((e && e.message) || e)));
|
|
96
|
+
ctx.on('request', (r) => { if (r.method() === 'POST' && /\/api\/notes\/pause$/.test(r.url())) S.pauseSeen.push(JSON.parse(r.postData() || '{}')); });
|
|
97
|
+
page.on('dialog', (d) => { S.dialogs.push(d.type()); if (S.leave) d.accept(); else d.dismiss(); });
|
|
98
|
+
page.on('request', (r) => { if (r.url().startsWith(BASE)) S.reqs.push(r.method() + ' ' + new URL(r.url()).pathname); });
|
|
99
|
+
const noteBy = (id) => S.notes.find((n) => n.id === id);
|
|
100
|
+
await page.route('**/api/briefing-premium*', (r) => json(r, { ok: true, state: 'ready', model: B.build(facts()), as_of: Date.now() }));
|
|
101
|
+
await page.route('**/api/calendar-views*', (r) => json(r, weekAnswer()));
|
|
102
|
+
await page.route('**/api/meeting-replay*', (r) => json(r, S.replay || replay));
|
|
103
|
+
await page.route('**/api/meeting-material/suggest*', (r) => json(r, { ok: true, suggested: [{ kind: 'link', url: 'https://x.example/road', title: 'Roadmap', meta: 'link' }], found: [] }));
|
|
104
|
+
await page.route('**/api/meeting-material*', (r) => {
|
|
105
|
+
const req = r.request(), u = new URL(req.url());
|
|
106
|
+
if (req.method() === 'POST') { S.matPosts.push(JSON.parse(req.postData() || '{}')); return json(r, { ok: true, items: [] }); }
|
|
107
|
+
return json(r, { ok: true, key: 'k', items: [], ...(u.searchParams.get('topics') ? { topics: topics.map((t, i) => ({ id: 't' + i, text: t })) } : {}) });
|
|
108
|
+
});
|
|
109
|
+
await page.route('**/api/notes/recording*', (r) => r.fulfill({ status: 200, contentType: 'audio/wav', body: WAV }));
|
|
110
|
+
await page.route('**/api/notes/screen*', (r) => r.fulfill({ status: 200, contentType: 'image/png', body: Buffer.from('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==', 'base64') }));
|
|
111
|
+
await page.route('**/api/notes/one*', (r) => json(r, { ok: true, note: { id: 'n1', body: 'text', transcript: [{ text: 'x' }], sessions: [{}] } }));
|
|
112
|
+
await page.route('**/api/notes/new', (r) => {
|
|
113
|
+
const b = JSON.parse(r.request().postData() || '{}'); S.newPosts.push(b);
|
|
114
|
+
if (S.newError) return json(r, { ok: false, error: S.newError }, 409);
|
|
115
|
+
let n = S.notes.find((x) => x.meeting && x.meeting.event_id === b.meeting.event_id);
|
|
116
|
+
if (!n) { n = { id: 'n1', title: b.meeting.title, state: 'idle', updated_at: new Date().toISOString(), meeting: { kind: 'event', event_id: b.meeting.event_id, start: b.meeting.start, title: b.meeting.title } }; S.notes.push(n); }
|
|
117
|
+
return json(r, { ok: true, note: n, reused: false });
|
|
118
|
+
});
|
|
119
|
+
await page.route('**/api/notes/record', (r) => { const b = JSON.parse(r.request().postData() || '{}'); S.recPosts.push(b); if (S.recordError) return json(r, { ok: false, error: S.recordError }, 409); noteBy(b.id).state = 'recording'; return json(r, { ok: true, recorded_from: new Date().toISOString() }); });
|
|
120
|
+
await page.route('**/api/notes/pause', (r) => { const b = JSON.parse(r.request().postData() || '{}'); S.pausePosts.push(b); const n = noteBy(b.id); if (n) { n.state = 'paused'; n.resume_until = new Date(Date.now() + 3600000).toISOString(); } return json(r, { ok: true }); });
|
|
121
|
+
await page.route('**/api/notes/stop', (r) => { const b = JSON.parse(r.request().postData() || '{}'); S.stopPosts.push(b); const n = noteBy(b.id); if (n) n.state = 'ended'; return json(r, { ok: true }); });
|
|
122
|
+
await page.route(/\/api\/notes$/, (r) => json(r, { ok: true, notes: S.notes }));
|
|
123
|
+
await page.route('**/api/meeting-focus/topic', (r) => { S.topicPosts.push(JSON.parse(r.request().postData() || '{}')); return json(r, { ok: true }); });
|
|
124
|
+
await page.route(/\/api\/meeting-focus(\?|$)/, (r) => { S.focusGets++; const a = typeof focus === 'function' ? focus() : focus; return json(r, a, a.ok === false ? 404 : 200); });
|
|
125
|
+
await page.route('**/api/calendar-links', (r) => json(r, { ok: true }));
|
|
126
|
+
if (stub) await page.addInitScript(RECORDER);
|
|
127
|
+
if (audio) S.replay = { ...REPLAY, audio: { url: '/api/notes/recording?id=n1', ms: 4000 }, length_ms: 4000, lines: [{ i: 0, t: 500, who: 'Dara', text: 'Welcome' }, { i: 1, t: 2500, who: 'Priya', text: 'Plan' }], keys: [{ k: 'decision', text: 'Plan', t: 2500, state: 'draft' }], runs: [{ topic: 'capacity', n: 1, from_ms: 0, to_ms: 2000 }, { topic: 'risks', n: 2, from_ms: 2000, to_ms: 4000 }], shots: [] };
|
|
128
|
+
await page.goto(BASE + url + (url.includes('?') ? '&' : '?') + 'theme=' + theme);
|
|
129
|
+
if (url === '/premium.html' && openDialog) {
|
|
130
|
+
S.up = await until(() => page.evaluate(() => document.querySelectorAll('#rank .rr').length > 0), 20000);
|
|
131
|
+
await page.click('#rng [data-r=week]');
|
|
132
|
+
await until(() => page.evaluate(() => !document.querySelector('#tl').hasAttribute('aria-busy') && !!document.querySelector('#tl .wkd')));
|
|
133
|
+
await page.evaluate(() => { const r = [...document.querySelectorAll('#tl .ev')].find((e) => e.querySelector('b').textContent === 'Live review'); r.click(); });
|
|
134
|
+
S.dlg = await until(() => page.evaluate(() => document.querySelector('#dlg').classList.contains('on') && !!document.querySelector('#m3Rec')));
|
|
135
|
+
}
|
|
136
|
+
SESS.push(S); S.url = url;
|
|
137
|
+
return Object.assign(S, { ctx, page });
|
|
138
|
+
};
|
|
139
|
+
const text = (p) => p.evaluate(() => document.querySelector('#oMain').textContent);
|
|
140
|
+
const rec = (p) => p.evaluate(() => document.querySelector('#m3Rec') ? document.querySelector('#m3Rec').textContent : '');
|
|
141
|
+
const press = async (p, act) => { await p.click(`#oMain [data-m3="${act}"]`); };
|
|
142
|
+
const chip = (p) => p.evaluate(() => { const c = document.querySelector('#recChip'); return c && !c.hidden ? c.textContent : null; });
|
|
143
|
+
|
|
144
|
+
const A = await open();
|
|
145
|
+
ok('0 the dialog opens on a meeting under way with the Record row', A.up && A.dlg);
|
|
146
|
+
if (!A.up || !A.dlg) return finish(1);
|
|
147
|
+
const p = A.page;
|
|
148
|
+
|
|
149
|
+
/* R1 R2 record */
|
|
150
|
+
const t0 = await text(p);
|
|
151
|
+
ok('R1 a meeting under way has Record, and says what the press does', /Record/.test(await rec(p)) && /microphone/.test(await rec(p)) && /this machine/.test(await rec(p)));
|
|
152
|
+
ok('R5 the Detail view says what Focus reads before any read, and none was made', /every 3 seconds/.test(t0) && /sends nothing/.test(t0) && A.focusGets === 0);
|
|
153
|
+
ok('R1 nothing was sent to the notes routes before a press', !A.reqs.some((r) => /^POST \/api\/notes/.test(r)), A.reqs.join());
|
|
154
|
+
await press(p, 'rec');
|
|
155
|
+
ok('R1 the first press asks for consent in plain words and sends nothing', await until(() => p.evaluate(() => /Tell everyone first/.test(document.querySelector('#m3Rec').textContent))) && A.newPosts.length === 0 && A.recPosts.length === 0);
|
|
156
|
+
await press(p, 'no');
|
|
157
|
+
ok('R1 Not yet closes the ask and sends nothing', await until(() => p.evaluate(() => !/Tell everyone first/.test(document.querySelector('#m3Rec').textContent))) && A.newPosts.length === 0);
|
|
158
|
+
await press(p, 'rec'); await press(p, 'go');
|
|
159
|
+
ok('R1 "I told them, start" makes the note for the calendar event, then listens on it', await until(() => A.recPosts.length === 1) && A.newPosts.length === 1 && A.newPosts[0].meeting.event_id === 'ev-live' && A.newPosts[0].meeting.title === 'Live review' && A.recPosts[0].id === 'n1', JSON.stringify([A.newPosts, A.recPosts]));
|
|
160
|
+
ok('R2 the row now says Recording with the clock, Pause and Stop, from the recorder and the note', await until(() => p.evaluate(() => /Recording/.test(document.querySelector('#m3Rec').textContent) && /1:0\d/.test(document.querySelector('#m3Clk').textContent) && !!document.querySelector('[data-m3="pause"]') && !!document.querySelector('[data-m3="stop"]'))), await rec(p));
|
|
161
|
+
ok('R3 the chip says Recording with the title, and has Open and Stop', await until(async () => /Recording Live review/.test((await chip(p)) || '')) && await p.evaluate(() => !!document.querySelector('#recChip [data-r="open"]') && !!document.querySelector('#recChip [data-r="stop"]') && !!document.querySelector('#recChip [data-r="pause"]')), String(await chip(p)));
|
|
162
|
+
ok('R9 the meeting\'s row carries a Recording mark', await until(() => p.evaluate(() => !!document.querySelector('#tl .ev .m3-mark') && /Recording/.test(document.querySelector('#tl .m3-mark').textContent))));
|
|
163
|
+
await press(p, 'pause');
|
|
164
|
+
ok('R2 Pause pauses through the route and the row says Paused with Resume and Stop', await until(() => A.pausePosts.length === 1) && await until(() => p.evaluate(() => /Paused/.test(document.querySelector('#m3Rec').textContent) && !!document.querySelector('[data-m3="resume"]'))) && A.pausePosts[0].id === 'n1');
|
|
165
|
+
ok('R3 the chip follows: Paused with Resume', await until(async () => /Paused Live review/.test((await chip(p)) || '')) && await p.evaluate(() => !!document.querySelector('#recChip [data-r="resume"]')));
|
|
166
|
+
await press(p, 'resume');
|
|
167
|
+
ok('R2 Resume listens again on the same note, without asking for consent twice', await until(() => A.recPosts.length === 2) && A.newPosts.length === 1 && !(await rec(p)).includes('Tell everyone first') && await until(() => p.evaluate(() => /Recording/.test(document.querySelector('#m3Rec').textContent))));
|
|
168
|
+
await press(p, 'stop');
|
|
169
|
+
const stopAsk = await until(() => p.evaluate(() => /for good/.test(document.querySelector('#m3Rec').textContent) ? document.querySelector('#m3Rec').textContent : ''));
|
|
170
|
+
ok('R1 Stop asks first, says a stopped meeting cannot be resumed, and offers Pause instead', /cannot be resumed/.test(stopAsk) && /Pause instead/.test(stopAsk) && A.stopPosts.length === 0, stopAsk);
|
|
171
|
+
await press(p, 'stopno');
|
|
172
|
+
ok('R1 Cancel on the ask stops nothing', A.stopPosts.length === 0 && /Recording/.test(await rec(p)));
|
|
173
|
+
await press(p, 'stop'); await press(p, 'stopgo');
|
|
174
|
+
ok('R1 Stop for good ends the meeting through the route, and the row says it ended', await until(() => A.stopPosts.length === 1) && await until(() => p.evaluate(() => /cannot be recorded again/.test(document.querySelector('#m3Rec').textContent))), await rec(p));
|
|
175
|
+
ok('R3 the chip is gone once no note records', await until(async () => (await chip(p)) === null));
|
|
176
|
+
ok('R10 the notes writes sent were new, record, pause, record, stop and nothing else', A.reqs.filter((r) => /^POST \/api\/notes/.test(r)).join() === 'POST /api/notes/new,POST /api/notes/record,POST /api/notes/pause,POST /api/notes/record,POST /api/notes/stop', A.reqs.filter((r) => /^POST/.test(r)).join());
|
|
177
|
+
await A.ctx.close();
|
|
178
|
+
|
|
179
|
+
/* R2 refusals and one at a time */
|
|
180
|
+
const Rf = await open({ newError: 'a page press is required' });
|
|
181
|
+
await press(Rf.page, 'rec'); await press(Rf.page, 'go');
|
|
182
|
+
ok('R2 a refused note shows the server\'s reason and records nothing', await until(() => Rf.page.evaluate(() => /a page press is required/.test(document.querySelector('#m3Rec').textContent))) && Rf.recPosts.length === 0 && !(await chip(Rf.page)));
|
|
183
|
+
await Rf.ctx.close();
|
|
184
|
+
const Re = await open({ recordError: 'the note ended already' });
|
|
185
|
+
await press(Re.page, 'rec'); await press(Re.page, 'go');
|
|
186
|
+
ok('R2 a refused listen shows the reason, holds nothing and shows no chip', await until(() => Re.page.evaluate(() => /the note ended already/.test(document.querySelector('#m3Rec').textContent))) && !(await chip(Re.page)) && /Record/.test(await rec(Re.page)));
|
|
187
|
+
await Re.ctx.close();
|
|
188
|
+
const other = { id: 'n9', title: 'Design crit', state: 'recording', updated_at: new Date().toISOString(), meeting: { kind: 'event', event_id: 'ev-x', start: iso(START), title: 'Design crit' } };
|
|
189
|
+
const Ob = await open({ notes: [other] });
|
|
190
|
+
await press(Ob.page, 'rec'); await press(Ob.page, 'go');
|
|
191
|
+
ok('R2 only one meeting records at a time: the second says which one', await until(() => Ob.page.evaluate(() => /Design crit is recording\. Pause or stop it first/.test(document.querySelector('#m3Rec').textContent))) && Ob.recPosts.length === 0 && Ob.newPosts.length === 0);
|
|
192
|
+
ok('R3 the chip names the meeting the server holds, and says this page is not capturing audio', /Design crit is marked recording, but this page is not capturing audio/.test(String(await chip(Ob.page))), String(await chip(Ob.page)));
|
|
193
|
+
await Ob.ctx.close();
|
|
194
|
+
const Ne = await open();
|
|
195
|
+
const so = await Ne.page.evaluate(() => { const r = [...document.querySelectorAll('#tl .ev')].find((e) => e.querySelector('b').textContent === 'Standup'); return !!r; });
|
|
196
|
+
if (so) {
|
|
197
|
+
await Ne.page.evaluate(() => { [...document.querySelectorAll('#tl .ev')].find((e) => e.querySelector('b').textContent === 'Standup').click(); });
|
|
198
|
+
await until(() => Ne.page.evaluate(() => document.querySelector('#dTitle').textContent === 'Standup' && !!document.querySelector('#m3Rec')));
|
|
199
|
+
ok('R1 a meeting of another day has no Record, only Focus', !/Record/.test(await rec(Ne.page)) && await Ne.page.evaluate(() => !!document.querySelector('[data-m3="focus"]')));
|
|
200
|
+
} else ok('R1 (no other-day meeting in this week: skipped)', true);
|
|
201
|
+
await Ne.ctx.close();
|
|
202
|
+
|
|
203
|
+
/* R4 leaving the Briefing */
|
|
204
|
+
const Lv = await open();
|
|
205
|
+
await press(Lv.page, 'rec'); await press(Lv.page, 'go'); await until(() => Lv.recPosts.length === 1);
|
|
206
|
+
await until(async () => /Recording/.test((await chip(Lv.page)) || ''));
|
|
207
|
+
Lv.leave = false;
|
|
208
|
+
await Lv.page.goto(BASE + '/premium-work.html').catch(() => {});
|
|
209
|
+
ok('R4 leaving the Briefing while it records makes the browser ask first, and staying pauses nothing', Lv.dialogs.includes('beforeunload') && Lv.pausePosts.length === 0 && /premium\.html/.test(Lv.page.url()), Lv.dialogs.join() + ' ' + Lv.page.url());
|
|
210
|
+
Lv.leave = true;
|
|
211
|
+
await Lv.page.goto(BASE + '/premium-work.html');
|
|
212
|
+
ok('R4 leaving anyway sends the pause for that note (a request that leaves with the page)', await until(() => Lv.pauseSeen.length >= 1) && Lv.pauseSeen[0].id === 'n1', JSON.stringify(Lv.pauseSeen));
|
|
213
|
+
if (!Lv.pausePosts.length) { const n = Lv.notes.find((x) => x.id === 'n1'); n.state = 'paused'; n.resume_until = new Date(Date.now() + 3600000).toISOString(); } // the stand-in could not answer a request sent as the page left
|
|
214
|
+
await Lv.page.reload();
|
|
215
|
+
ok('R3 the next page shows the chip as Paused, with Open and Stop and no Resume', await until(async () => /Paused Live review/.test((await chip(Lv.page)) || '')) && await Lv.page.evaluate(() => !!document.querySelector('#recChip [data-r="open"]') && !!document.querySelector('#recChip [data-r="stop"]') && !document.querySelector('#recChip [data-r="resume"]')));
|
|
216
|
+
await Lv.page.click('#recChip [data-r="stop"]');
|
|
217
|
+
ok('R3 Stop on another page asks first and says what it does', await until(() => Lv.page.evaluate(() => /Stop “Live review” for good\?.*cannot be resumed/.test(document.querySelector('#recChip').textContent))) && Lv.stopPosts.length === 0);
|
|
218
|
+
await Lv.page.click('#recChip [data-r="stopgo"]');
|
|
219
|
+
ok('R3 Stop for good there ends the meeting through POST /api/notes/stop and the chip goes', await until(() => Lv.stopPosts.length === 1) && await until(async () => (await chip(Lv.page)) === null));
|
|
220
|
+
await Lv.ctx.close();
|
|
221
|
+
|
|
222
|
+
/* R3 the chip on every premium page, and Open */
|
|
223
|
+
const paused = { id: 'n1', title: 'Live review', state: 'paused', resume_until: new Date(Date.now() + 3000000).toISOString(), updated_at: new Date().toISOString(), meeting: { kind: 'event', event_id: 'ev-live', start: iso(START), title: 'Live review' } };
|
|
224
|
+
for (const [name, url] of [['Briefing', '/premium.html'], ['My work', '/premium-work.html'], ['Board', '/premium-board.html'], ['Initiative', '/premium-initiative.html?id=none'], ['Insights', '/premium-insights.html']]) {
|
|
225
|
+
const C = await open({ notes: [paused], url, openDialog: false });
|
|
226
|
+
ok(`R3 the ${name} page shows the chip for a paused meeting`, await until(async () => /Paused Live review/.test((await chip(C.page)) || ''), 15000), String(await chip(C.page)));
|
|
227
|
+
if (url === '/premium-work.html') {
|
|
228
|
+
await C.page.click('#recChip [data-r="open"]');
|
|
229
|
+
await until(() => /premium\.html\?meeting=n1|premium\.html/.test(C.page.url()));
|
|
230
|
+
const opened = await until(() => C.page.evaluate(() => document.querySelector('#dlg').classList.contains('on') && document.querySelector('#dTitle').textContent === 'Live review'), 20000);
|
|
231
|
+
ok('R3 Open on another page goes to the Briefing and opens that meeting\'s dialog', opened && !/meeting=/.test(C.page.url()), C.page.url());
|
|
232
|
+
}
|
|
233
|
+
await C.ctx.close();
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/* R5 R6 Focus */
|
|
237
|
+
const Fc = await open({ notes: [{ ...paused, state: 'recording' }] });
|
|
238
|
+
await press(Fc.page, 'focus');
|
|
239
|
+
const fv = await until(() => Fc.page.evaluate(() => /Risks/.test(document.querySelector('#oMain').textContent) ? document.querySelector('#oMain').textContent : ''));
|
|
240
|
+
ok('R5 Focus shows the state, the topic now, the sentence, the lines, the topics, the material and the counts as the answer holds them', /Leave focus/.test(fv) && /Live review/.test(fv) && /Now/.test(fv) && /The room is weighing the risks to the date\./.test(fv) && /Welcome everyone/.test(fv) && /Launch date/.test(fv) && /Capacity sheet/.test(fv) && /Captured so far/.test(fv) && /Premium UX/.test(fv), fv.slice(0, 400));
|
|
241
|
+
ok('R5 the topic bar draws a stretch for each topic that was talked about', await Fc.page.evaluate(() => document.querySelectorAll('#oMain .m3-trk .m3-stc').length === 2 && document.querySelectorAll('#oMain .m3-trk .m3-stc.on').length === 1));
|
|
242
|
+
const g0 = Fc.focusGets;
|
|
243
|
+
ok('R5 Focus reads again every 3 seconds while it is open', await until(() => Fc.focusGets >= g0 + 2, 9000), String(Fc.focusGets - g0));
|
|
244
|
+
await Fc.page.click('#oMain [data-m3="chg"]');
|
|
245
|
+
ok('R5 Change lists the topics and says it records one correction', await Fc.page.evaluate(() => document.querySelectorAll('#oMain [data-m3="topic"]').length === 3 && /records one correction/.test(document.querySelector('#oMain').textContent)));
|
|
246
|
+
await Fc.page.click('#oMain [data-m3="topic"][data-n="3"]');
|
|
247
|
+
ok('R5 a topic press posts one set for that topic on this meeting', await until(() => Fc.topicPosts.length === 1) && JSON.stringify(Fc.topicPosts[0]) === JSON.stringify({ event: 'ev-live', date: dayKey(START), action: 'set', topic: 'Launch date' }), JSON.stringify(Fc.topicPosts));
|
|
248
|
+
await press(Fc.page, 'unfocus');
|
|
249
|
+
await until(() => Fc.page.evaluate(() => !!document.querySelector('#m3Rec') && !document.querySelector('.m3-fh')));
|
|
250
|
+
const g1 = Fc.focusGets; await sleep(4200);
|
|
251
|
+
ok('R5 leaving Focus stops the reads', Fc.focusGets === g1, `${g1} -> ${Fc.focusGets}`);
|
|
252
|
+
await Fc.ctx.close();
|
|
253
|
+
const Fe = await open({ focus: () => ({ ok: false, error: 'no such meeting on the calendar' }) });
|
|
254
|
+
await press(Fe.page, 'focus');
|
|
255
|
+
ok('R6 a refused read says why and shows nothing else', await until(() => Fe.page.evaluate(() => /Focus could not read this meeting: no such meeting on the calendar/.test(document.querySelector('#oMain').textContent))) && await Fe.page.evaluate(() => !document.querySelector('#oMain .m3-now') && !document.querySelector('#oMain .m3-tops')));
|
|
256
|
+
await Fe.ctx.close();
|
|
257
|
+
const Fb = await open({ focus: () => ({ ok: true, now_ms: Date.now(), event: { title: 'Live review', at: iso(START), end: iso(END) }, note: null, companion: { on: false } }) });
|
|
258
|
+
await press(Fb.page, 'focus');
|
|
259
|
+
const bt = await until(() => Fb.page.evaluate(() => /Leave focus/.test(document.querySelector('#oMain').textContent) && /companion is off/.test(document.querySelector('#oMain').textContent) ? document.querySelector('#oMain').textContent : ''));
|
|
260
|
+
ok('R6 an answer with nothing in it draws no topic, sentence, chip, line or count, and says the companion is off', /No topic is current yet/.test(bt) && /The meeting has no topics yet/.test(bt) && /The transcript starts when you record/.test(bt) && !/Captured so far/.test(bt) && await Fb.page.evaluate(() => !document.querySelector('#oMain .m3-say') && !document.querySelector('#oMain .m3-chp')), bt.slice(0, 300));
|
|
261
|
+
await Fb.ctx.close();
|
|
262
|
+
|
|
263
|
+
/* R7 Replay, on the page's own clock */
|
|
264
|
+
const Rp = await open();
|
|
265
|
+
const hasBtn = await until(() => Rp.page.evaluate(() => !!document.querySelector('[data-m3="replay"]')));
|
|
266
|
+
ok('R7 the Replay part has a Replay press when a recording is held', hasBtn);
|
|
267
|
+
await press(Rp.page, 'replay');
|
|
268
|
+
const rv = await until(() => Rp.page.evaluate(() => /Key points/.test(document.querySelector('#oMain').textContent) ? document.querySelector('#oMain').textContent : ''));
|
|
269
|
+
ok('R7 Replay shows the topic track, the key points, the transcript and says there is no audio', /0:00 \/ 5:00/.test(rv) && /Plan with eight people/.test(rv) && /We plan eight people/.test(rv) && /No audio is kept/.test(rv) && await Rp.page.evaluate(() => document.querySelectorAll('#oMain .m3-trk button.m3-stc').length === 2 && document.querySelectorAll('#oMain .m3-trk .m3-mk').length === 2), rv.slice(0, 200));
|
|
270
|
+
ok('R7 a key point with no time has no play press', await Rp.page.evaluate(() => { const r = [...document.querySelectorAll('#oMain .m3-kp0')]; return r.length === 1 && /Priya confirms the owner/.test(r[0].textContent) && !r[0].matches('button'); }));
|
|
271
|
+
await Rp.page.click('#oMain .m3-kps button');
|
|
272
|
+
ok('R7 a key point plays from its time and marks the line', await until(() => Rp.page.evaluate(() => /Pause/.test(document.querySelector('#rpPlay').textContent) && /^1:0\d \/ 5:00/.test(document.querySelector('#rpPos').textContent) && !!document.querySelector('#rl1.cur'))), await Rp.page.evaluate(() => document.querySelector('#rpPos').textContent));
|
|
273
|
+
ok('R7 the playhead keeps time on its own clock', await until(() => Rp.page.evaluate(() => /^1:0[2-9] \/ 5:00/.test(document.querySelector('#rpPos').textContent)), 5000));
|
|
274
|
+
await Rp.page.click('#oMain [data-m3="spd"][data-v="2"]'); await Rp.page.click('#oMain [data-m3="seek"][data-t="100000"]');
|
|
275
|
+
ok('R7 a stretch plays from its start and the topic follows the position', await until(() => Rp.page.evaluate(() => /Risks/.test(document.querySelector('#rpTopic').textContent) && !!document.querySelector('.m3-stc.on'))));
|
|
276
|
+
await Rp.page.click('#oMain [data-m3="seek"][data-t="130000"]');
|
|
277
|
+
ok('R7 a shot is shown only from the time it was kept, with its reason', await until(() => Rp.page.evaluate(() => !!document.querySelector('#rpShot img') && /A slide with the plan/.test(document.querySelector('#rpShot').textContent))));
|
|
278
|
+
await Rp.page.click('#oMain [data-m3="back10"]');
|
|
279
|
+
ok('R7 Back 10 s moves the playhead back', await Rp.page.evaluate(() => { const m = /^(\d+):(\d+)/.exec(document.querySelector('#rpPos').textContent); return m && (+m[1] * 60 + +m[2]) < 135; }));
|
|
280
|
+
await Rp.page.click('#oMain [data-m3="play"]');
|
|
281
|
+
ok('R7 Pause stops the playhead', await until(() => Rp.page.evaluate(() => document.querySelector('#rpPlay').textContent === 'Play')));
|
|
282
|
+
const gets = Rp.reqs.filter((r) => /meeting-replay/.test(r)).length;
|
|
283
|
+
await press(Rp.page, 'unreplay');
|
|
284
|
+
ok('R7 Back to the meeting returns to the Detail view and focus lands on Replay', await until(() => Rp.page.evaluate(() => !!document.querySelector('#m3Rec') && document.activeElement && document.activeElement.dataset.m3 === 'replay')));
|
|
285
|
+
await Rp.ctx.close();
|
|
286
|
+
/* R7 Replay, with audio */
|
|
287
|
+
const Ra = await open({ audio: true });
|
|
288
|
+
await press(Ra.page, 'replay');
|
|
289
|
+
await until(() => Ra.page.evaluate(() => /Plays the note’s audio/.test(document.querySelector('#oMain').textContent)));
|
|
290
|
+
await Ra.page.click('#rpPlay');
|
|
291
|
+
ok('R7 with audio the playhead follows the audio element', await until(() => Ra.page.evaluate(() => /^0:0[1-9] \/ 0:04/.test(document.querySelector('#rpPos').textContent)), 6000) && Ra.reqs.some((r) => /GET \/api\/notes\/recording/.test(r)), await Ra.page.evaluate(() => document.querySelector('#rpPos').textContent));
|
|
292
|
+
ok('R7 at the end it stops by itself', await until(() => Ra.page.evaluate(() => document.querySelector('#rpPlay').textContent === 'Play' && /^0:04/.test(document.querySelector('#rpPos').textContent)), 8000), await Ra.page.evaluate(() => document.querySelector('#rpPos').textContent));
|
|
293
|
+
await Ra.ctx.close();
|
|
294
|
+
|
|
295
|
+
/* R8 Topic on material */
|
|
296
|
+
const Tp = await open({ topics: ['Capacity', 'Risks'] });
|
|
297
|
+
await Tp.page.click('#mmAdd'); await until(() => Tp.page.evaluate(() => /Roadmap/.test(document.querySelector('#mmSug').textContent)));
|
|
298
|
+
await Tp.page.click('#mmSug [data-pick]');
|
|
299
|
+
ok('R8 the sheet offers a Topic choice from the route\'s topics, and the line names the topic when one is chosen', await until(() => Tp.page.evaluate(() => document.querySelectorAll('[data-topic]').length === 3)));
|
|
300
|
+
await Tp.page.click('[data-topic="2"]');
|
|
301
|
+
ok('R8 choosing a topic updates the line before the press', await until(() => Tp.page.evaluate(() => /under the topic “Risks”/.test(document.querySelector('#mmLine').textContent))));
|
|
302
|
+
await Tp.page.click('#mmDo');
|
|
303
|
+
ok('R8 Add posts the topic with the item', await until(() => Tp.matPosts.length === 1) && Tp.matPosts[0].topic === 'Risks', JSON.stringify(Tp.matPosts));
|
|
304
|
+
await Tp.ctx.close();
|
|
305
|
+
const Tn = await open();
|
|
306
|
+
await Tn.page.click('#mmAdd'); await until(() => Tn.page.evaluate(() => /Roadmap/.test(document.querySelector('#mmSug').textContent)));
|
|
307
|
+
await Tn.page.click('#mmSug [data-pick]');
|
|
308
|
+
ok('R8 with no topics the Topic choice is not drawn and no topic is sent', await Tn.page.evaluate(() => document.querySelectorAll('[data-topic]').length === 0));
|
|
309
|
+
await Tn.page.click('#mmDo'); await until(() => Tn.matPosts.length === 1);
|
|
310
|
+
ok('R8 an item added with no topic carries none', !('topic' in Tn.matPosts[0]));
|
|
311
|
+
await Tn.ctx.close();
|
|
312
|
+
|
|
313
|
+
/* R10 the guard: the real server refuses these writes from anything but this launch's page */
|
|
314
|
+
for (const [pth, body] of [['/api/notes/new', { meeting: { kind: 'event', title: 'x', start: iso(START) } }], ['/api/notes/record', { id: 'n-nothing' }], ['/api/notes/pause', { id: 'n-nothing' }], ['/api/notes/stop', { id: 'n-nothing' }], ['/api/meeting-focus/topic', { event: 'ev', action: 'set', topic: 'x' }]]) {
|
|
315
|
+
const res = await fetch(BASE + pth, { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify(body) });
|
|
316
|
+
ok(`R10 ${pth} without the launch nonce is refused`, res.status === 403, String(res.status));
|
|
317
|
+
}
|
|
318
|
+
ok('R10 no page error on the Briefing in any run', SESS.filter((x) => x.url === '/premium.html').every((x) => x.errors.length === 0), JSON.stringify(SESS.map((x) => x.errors).filter((e) => e.length)));
|
|
319
|
+
|
|
320
|
+
/* R11 floors and fidelity */
|
|
321
|
+
const live = { id: 'n1', title: 'Live review', state: 'recording', updated_at: new Date().toISOString(), meeting: { kind: 'event', event_id: 'ev-live', start: iso(START), title: 'Live review' } };
|
|
322
|
+
const shotDir = process.env.PMOS_SHOTS || '';
|
|
323
|
+
for (const [w, h] of [[1280, 900], [390, 844]]) for (const th of ['light', 'dark']) {
|
|
324
|
+
const P = await open({ w, h, theme: th, notes: [live] });
|
|
325
|
+
await until(async () => /marked recording/.test((await chip(P.page)) || ''));
|
|
326
|
+
const fl = async (label) => P.page.evaluate(() => ({ scroll: document.documentElement.scrollWidth <= innerWidth + 1 && document.querySelector('#oMain').scrollWidth <= document.querySelector('#oMain').clientWidth + 1,
|
|
327
|
+
btn: [...document.querySelectorAll('#dlg [data-m3], #recChip button, #dlg .mtg-b, #dlg .cta')].filter((b) => b.offsetParent).map((b) => Math.min(b.getBoundingClientRect().width, b.getBoundingClientRect().height)) }));
|
|
328
|
+
const settled = async () => (await until(async () => { const r = await fl(); return r.btn.every((n) => n >= 43.5) ? r : null; }, 3000)) || fl();
|
|
329
|
+
const f0 = await settled();
|
|
330
|
+
if (shotDir) await P.page.screenshot({ path: path.join(shotDir, `detail-${w}-${th}.png`) });
|
|
331
|
+
await press(P.page, 'focus'); await until(() => P.page.evaluate(() => /Risks/.test(document.querySelector('#oMain').textContent)));
|
|
332
|
+
await P.page.click('#oMain [data-m3="chg"]');
|
|
333
|
+
const f1 = await settled();
|
|
334
|
+
if (shotDir) await P.page.screenshot({ path: path.join(shotDir, `focus-${w}-${th}.png`) });
|
|
335
|
+
await press(P.page, 'unfocus'); await press(P.page, 'replay'); await until(() => P.page.evaluate(() => /Key points/.test(document.querySelector('#oMain').textContent)));
|
|
336
|
+
await P.page.click('#oMain [data-m3="seek"][data-t="130000"]'); await until(() => P.page.evaluate(() => !!document.querySelector('#rpShot img')));
|
|
337
|
+
const f2 = await settled();
|
|
338
|
+
if (shotDir) await P.page.screenshot({ path: path.join(shotDir, `replay-${w}-${th}.png`) });
|
|
339
|
+
ok(`R11 at ${w} px (${th}) the detail, Focus and Replay have no sideways scroll and every press is at least 44 px`, f0.scroll && f1.scroll && f2.scroll && [f0, f1, f2].every((f) => f.btn.length && f.btn.every((n) => n >= 43.5)), JSON.stringify([f0, f1, f2]).slice(0, 400));
|
|
340
|
+
await P.ctx.close();
|
|
341
|
+
}
|
|
342
|
+
const mk = await browser.newContext({ viewport: { width: 1280, height: 900 } }); const mp = await mk.newPage();
|
|
343
|
+
await mp.setContent(MOCKUP); await mp.waitForTimeout(500);
|
|
344
|
+
const chipCss = (pg) => pg.evaluate(() => { const c = document.querySelector('.recchip, #recChip'); if (!c) return null; const k = getComputedStyle(c); const b = c.querySelector('button'); const bs = b ? getComputedStyle(b) : null; return [k.position, k.borderRadius, k.fontSize, k.fontWeight, k.display, bs && bs.borderRadius, bs && bs.fontWeight].join('|'); });
|
|
345
|
+
const chipM = await mp.evaluate(() => { const c = document.querySelector('#recChip'); c.hidden = false; c.innerHTML = '<i></i><span>Recording x</span><button>Open</button><button>Stop</button>'; const k = getComputedStyle(c), b = getComputedStyle(c.querySelector('button')); return [k.position, k.borderRadius, k.fontSize, k.fontWeight, k.display, b.borderRadius, b.fontWeight].join('|'); });
|
|
346
|
+
const Fx = await open({ notes: [live] }); await until(async () => /marked recording/.test((await chip(Fx.page)) || ''));
|
|
347
|
+
const chipP = await chipCss(Fx.page);
|
|
348
|
+
ok('R11 fidelity: the chip keeps the mockup\'s position, pill radius, type and button radius', chipM && chipP && chipM === chipP, chipM + ' vs ' + chipP);
|
|
349
|
+
const trkM = await mp.evaluate(() => { const d = document.createElement('div'); d.innerHTML = '<div class="trk2"><button class="stc on">1</button></div>'; document.body.appendChild(d); const c = getComputedStyle(d.querySelector('.stc')); return [c.borderRadius, c.fontWeight, c.fontSize].join('|'); });
|
|
350
|
+
await press(Fx.page, 'focus'); await until(() => Fx.page.evaluate(() => !!document.querySelector('.m3-stc')));
|
|
351
|
+
const trkP = await Fx.page.evaluate(() => { const c = getComputedStyle(document.querySelector('.m3-stc')); return [c.borderRadius, c.fontWeight, c.fontSize].join('|'); });
|
|
352
|
+
ok('R11 fidelity: a topic stretch keeps the mockup\'s radius, weight and size', trkM === trkP, trkM + ' vs ' + trkP);
|
|
353
|
+
const consM = await mp.evaluate(() => { const d = document.createElement('div'); d.innerHTML = '<div class="cons"></div>'; document.body.appendChild(d); const c = getComputedStyle(d.firstChild); return [c.borderRadius, c.display].join('|'); });
|
|
354
|
+
await press(Fx.page, 'unfocus'); await press(Fx.page, 'stop');
|
|
355
|
+
const consP = await Fx.page.evaluate(() => { const c = getComputedStyle(document.querySelector('.m3-cons')); return [c.borderRadius, c.display].join('|'); });
|
|
356
|
+
ok('R11 fidelity: the ask card keeps the mockup\'s radius and layout', consM === consP, consM + ' vs ' + consP);
|
|
357
|
+
await Fx.ctx.close(); await mk.close();
|
|
358
|
+
|
|
359
|
+
return finish();
|
|
360
|
+
})().catch((e) => { console.error(e); finish(1); });
|
|
@@ -154,7 +154,7 @@ const MOCKUP = fs.readFileSync(path.join(__dirname, '..', 'prototype', 'premium-
|
|
|
154
154
|
await R.page.evaluate(() => { [...document.querySelectorAll('#tl .ev')].find((e) => e.querySelector('b').textContent === 'Sprint planning').click(); });
|
|
155
155
|
const rd = await until(() => R.page.evaluate(() => /Decisions/.test(document.querySelector('#oMain').textContent) ? document.querySelector('#oMain').textContent : null));
|
|
156
156
|
ok('C6 the note\'s decisions, next steps and questions are listed as the note holds them', rd && /Plan the sprint with eight people/.test(rd) && /Sam confirms the data fix owner/.test(rd) && /Sam · Tue/.test(rd) && /Does a release eat the capacity\?/.test(rd) && /Sprint planning notes/.test(rd), String(rd).slice(0, 300));
|
|
157
|
-
ok('C8 a kept recording is summarised, and Replay opens in the
|
|
157
|
+
ok('C8 a kept recording is summarised, and Replay opens in the dialog', rd && /A recording is kept: 25 min, 3 key points/.test(rd) && /Replay/.test(rd) && !/Replay opens in the console/.test(rd));
|
|
158
158
|
ok('C6 the replay answer\'s people are used only when the calendar lists none', rd && /Dara, Priya, Sam/.test(rd));
|
|
159
159
|
|
|
160
160
|
/* C4 a Today row opens the same dialog when the calendar answer knows the meeting */
|
|
@@ -169,7 +169,7 @@ const MOCKUP = fs.readFileSync(path.join(__dirname, '..', 'prototype', 'premium-
|
|
|
169
169
|
/* C9 */
|
|
170
170
|
const allPosts = [].concat(A.reqs, R.reqs, Tt.reqs).filter((r) => /^POST /.test(r));
|
|
171
171
|
ok('C9 the only write the page sent is the link', allPosts.length === 1 && allPosts[0] === 'POST /api/calendar-links', JSON.stringify(allPosts));
|
|
172
|
-
ok('C9 no recording, Focus or material
|
|
172
|
+
ok('C9 no recording, Focus or material write was sent', ![].concat(A.reqs, R.reqs, Tt.reqs).some((r) => /POST \/api\/(notes|meeting-focus|meeting-material)/.test(r)));
|
|
173
173
|
ok('C9 no page error', [A, E, Z, R, Tt, Mg].every((x) => x.errors.length === 0), JSON.stringify([A, E, Z, R, Tt, Mg].map((x) => x.errors)));
|
|
174
174
|
|
|
175
175
|
/* C10 floors and fidelity */
|
|
@@ -94,7 +94,17 @@ When the meeting is not linked, the dialog has a **Link it** press. You choose t
|
|
|
94
94
|
|
|
95
95
|
In **Notes**, each next step has **Make task** when the note is linked to an initiative. It adds the step to the first stage of that initiative's breakdown, with its owner and due day when the step names them, and the status says where it went. **Undo** withdraws the task. A note with no initiative explains that it must be linked first, and writes nothing. Both writes need the page's launch nonce, so an agent session is refused. A refused write shows its reason and changes nothing on screen.
|
|
96
96
|
|
|
97
|
-
|
|
97
|
+
**Record.** A meeting of today that ended less than 10 minutes ago, or has not started, has a **Record** press in the dialog. Before the first press, the dialog says "Tell everyone first" and what the press does: it makes the meeting's note, or uses the one it has, and starts to listen to your microphone and the sound of the meeting. The audio and the notes stay on this machine. The console's own sheet asks where the meeting's sound comes from. While it records, the dialog shows the clock, **Pause** and **Stop**. A paused meeting stays open for one hour and has **Resume**. **Stop** asks first, because a stopped meeting cannot be resumed, and offers **Pause instead**. A refusal shows the reason and changes nothing. What the dialog shows comes from the recorder and from the notes the server holds, not from the last press. Only one meeting records at a time. A row in Today or in the week shows **Recording** or **Paused** when its note is in that state.
|
|
98
|
+
|
|
99
|
+
**The recording chip.** While a note records or is paused, every premium page shows a chip at the bottom left with its name, **Open** (the meeting's dialog on the Briefing) and **Stop**. On the Briefing it also has **Pause** and **Resume**. The browser can capture audio only while the Briefing is open, because each premium page is its own page. If you leave the Briefing while it records, the browser asks first. If you leave anyway, the meeting is paused, so the record does not say "recording" for audio that nobody captures. The chip on the next page says "Paused", and **Open** takes you back to resume. A note that the server marks as recording, while the Briefing holds no recorder, shows "marked recording, but this page is not capturing audio".
|
|
100
|
+
|
|
101
|
+
**Focus.** The dialog has a **Focus** press. Focus shows the meeting as it is now: the state (starts in, recording, paused, ended), a bar of the stretches by topic, the topic now (or the first topic before the start), the last lines of the talk with who said them, the topics, the material and the counts of decisions, next steps and questions. It reads the meeting every 3 seconds while it is open and stops when you leave it. While the note records, PMOS's companion, a read-only Claude run that sends nothing, may read the last minutes of the talk at most every 40 seconds and writes its own notes. The dialog says this before the first read. **Change** lists the topics. A press records one correction on the meeting through the console's route. If the companion is off, has not answered or has failed, Focus says so and shows only the talk. It shows no topic, line or count that the record does not hold.
|
|
102
|
+
|
|
103
|
+
**Replay.** When a recording is kept, the Replay part has a **Replay** press. The player plays the note's audio, with Back 10 s and 1x, 1.5x or 2x. It shows a bar of the stretches by topic with a mark for each decision, next step and question, the topic being talked about, the key points and the transcript. A press on a stretch, a key point or a line plays from there, and the current line is marked. A key point with no time has no play press. If no audio was kept, the playhead keeps its own clock. A screen shot is shown only when the recording holds one for that time.
|
|
104
|
+
|
|
105
|
+
In the **Add material** sheet, a **Topic** choice ties the item to one of the meeting's topics, so Focus can bring it up. It appears only when the meeting has topics.
|
|
106
|
+
|
|
107
|
+
Not built in premium: translation, Present and the slides stage, Ask PMOS quietly, Park and Add topic, the phone companion and the Meet extension view. The console keeps them.
|
|
98
108
|
|
|
99
109
|
## The dock
|
|
100
110
|
|
|
@@ -193,6 +203,7 @@ Insights is the fourth place on the rail, at `/premium-insights.html`. It reads
|
|
|
193
203
|
- **Charts.** One chart for each KR metric that holds at least two readings. The line runs through the readings at their dates, so a month with no reading is a gap and not a zero. The dashed line is the metric's target. The chip is the record's own line status: on its line, behind it, or well behind it. Pressing a chart, or its Details link, opens the metric's record in the dialog with the read-only agent beside it.
|
|
194
204
|
- **Dashboards.** The switch lists All measures first, then your saved dashboards (the main one first, marked Main), then the pillars the metrics name. A saved dashboard draws its charts in the order you saved them. A chart whose record is gone, or that has fewer than two readings, is listed in its place with the reason and is not drawn.
|
|
195
205
|
- **Make or edit a dashboard.** **New dashboard**, or **Edit** on a saved one, opens the **Insight Studio**, a wide dialog. On the right, the brief shows the Name, Purpose, Charts and Main dashboard; press a chip to change it. **Library** lists the board's measures and saved dashboards to add. The preview draws the dashboard as the page will, and lists a measure with no series as not drawn. The checks (a name, a purpose, a chart, six or fewer, no repeat, a main dashboard on the board) say what fails, with a one-press fix. On the left you can say it instead: "add Partner activation", "remove …", "move … first", "call it …", "it is for …", "make it the main dashboard", "undo" or "start a new one". A turn changes the draft only. **Undo** steps back one change. **Save the dashboard** records it; **Remove the dashboard** asks once more and then removes it. In a chart's dialog, **On your dashboards** has a switch for each saved dashboard, which adds the chart to it or takes it off.
|
|
206
|
+
- **Make your own chart.** **New chart**, or **Edit** on one of your charts, opens the Insight Studio in **Chart** mode; the switch at the top moves between Chart and Dashboard, and each keeps its own draft. The brief shows the Question, Measure, Form (line, bars, number or meter), Range (all readings or the last few) and Target; **More** adds the Title, Better when, Note and Add to (a dashboard). The Studio suggests a form from the question and says why. The checks (a question, a target, enough readings, a form that fits the question, one scale) say what fails, with a one-press fix. You can say it instead: "show it as bars", "last 4 readings", "target 35", "lower is better", "call it …", "note: …", "add it to Weekly", or a question. A pie is declined, with the reason. **Save the chart** records it in the workspace's state folder, and adds it to the dashboard you named. Your charts are listed under **All measures**, and a dashboard can hold them beside the measures. **Remove the chart** asks once more; a dashboard that held it then says it was removed.
|
|
196
207
|
- **What stands out.** Up to three plain sentences taken from the series: behind its line for three readings in a row, behind and still moving away from the target, closing in, slipped, reached its target, or a large one-step move. There is no forecast and no cause.
|
|
197
208
|
- **No series recorded.** A KR metric with one reading or none is listed with the reason and is not drawn.
|
|
198
209
|
- **Ask PMOS to set up a report.** Type what the report is for and press **Ask**. A background run proposes a report and does nothing else. The request is listed as Working, then Ready to review. A ready request opens with its proposal: **Set it up**, **Change it** (say what to change; the run revises it), or **Cancel**.
|
|
@@ -200,4 +211,4 @@ Insights is the fourth place on the rail, at `/premium-insights.html`. It reads
|
|
|
200
211
|
- **Set up.** Your recurring reports, with their schedule and next draft. A report opens with **Draft it now** (for a report drawn from your work) and **Pause** or **Resume**.
|
|
201
212
|
- **Documents.** The report files of the workspace, with cadence, slot and whether each is a draft or issued. Pressing one opens the console's Reports tab, where it is read, edited or issued. Nothing is sent from this page.
|
|
202
213
|
|
|
203
|
-
Not built: the Insight Studio's
|
|
214
|
+
Not built: the Insight Studio's Report mode, a second measure next to a chart, bar highlights, the report deck, present and print, tile sizes and free layout, the finder's settings, run-based charts such as corrections per 100 runs (they belong to the Board's Metrics card), and any measure no record holds. The console's own dashboards are separate and unchanged. KR metric records belong to a workspace, so every board of a workspace shows the same charts.
|
|
@@ -69,6 +69,22 @@ function chartOf(o) {
|
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
+
/** A chart the PM saved in the Insight Studio (premium-studio-chart C2): its measure's readings, the latest `range` of them, against the saved target.
|
|
73
|
+
* null when the measure is gone or has fewer than two readings in range. Every value is still a reading of the record. */
|
|
74
|
+
function mineOf(m, outcomes) {
|
|
75
|
+
const o = outcomes.find((x) => x.id === m.measure);
|
|
76
|
+
if (!o) return null;
|
|
77
|
+
const rs = (o.readings || []).filter((x) => x && fin(x.v) && isoDay(x.at) !== null);
|
|
78
|
+
const c = chartOf(Object.assign({}, o, { readings: m.range ? rs.slice(-m.range) : rs, target: m.target }));
|
|
79
|
+
if (!c) return null;
|
|
80
|
+
const dir = m.better === 'lower' ? -1 : 1, good = c.step ? c.step * dir > 0 : null;
|
|
81
|
+
return Object.assign(c, {
|
|
82
|
+
key: 'mine:' + m.id, id: m.id, measure: o.id, measureTitle: clip(o.name, 120), title: clip(m.title, 60), question: m.question || '', form: m.form, range: m.range,
|
|
83
|
+
better: m.better, note: m.note || '', mine: true, dir, good, all: rs.length,
|
|
84
|
+
sub: [clip(o.name, 120), (m.range ? 'last ' + c.pts.length : c.pts.length) + ' readings'].join(' · '),
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
|
|
72
88
|
/** Up to three plain sentences about what stands out, from the series alone. No forecast and no cause. */
|
|
73
89
|
function findingsOf(charts) {
|
|
74
90
|
const out = [];
|
|
@@ -103,12 +119,14 @@ function reportRows(reports) {
|
|
|
103
119
|
|
|
104
120
|
/** The board's saved dashboards (briefing-premium-reports D3/D5), main first as the ledger folds them. A chart id that has no record, or no series, stays
|
|
105
121
|
* in `charts` and is listed in `gone` with the reason, so the page can say so in its place. `checks` are the two advisory checks, never a refusal. */
|
|
106
|
-
function savedOf(saved, outcomes, charts) {
|
|
122
|
+
function savedOf(saved, outcomes, charts, mine) {
|
|
107
123
|
return (saved || []).map((d) => {
|
|
108
124
|
const ids = Array.isArray(d.charts) ? d.charts : [];
|
|
109
125
|
const L = ids.map((id) => charts.find((c) => c.id === id)).filter(Boolean);
|
|
110
126
|
const gone = ids.filter((id) => !charts.some((c) => c.id === id)).map((id) => {
|
|
111
|
-
const o = outcomes.find((x) => x.id === id);
|
|
127
|
+
const o = outcomes.find((x) => x.id === id), m = (mine || []).find((x) => x.id === id);
|
|
128
|
+
if (m) return { id, title: clip(m.title, 60), why: 'Its measure has fewer than two readings in its range, so it has no chart.' };
|
|
129
|
+
if (/^pc-/.test(id)) return { id, title: id, why: 'This saved chart was removed.' };
|
|
112
130
|
return { id, title: o ? clip(o.name, 120) : id, why: o ? 'This measure has fewer than two readings, so it has no chart.' : 'No KR metric record is called ' + id + ' any more.' };
|
|
113
131
|
});
|
|
114
132
|
const checks = [];
|
|
@@ -155,6 +173,9 @@ function build(facts) {
|
|
|
155
173
|
const f = facts || {};
|
|
156
174
|
const outcomes = f.outcomes || [], missing = (f.missing || []).slice();
|
|
157
175
|
const charts = outcomes.map(chartOf).filter(Boolean);
|
|
176
|
+
const mineAll = f.mine || [], mine = mineAll.map((m) => mineOf(m, outcomes)).filter(Boolean);
|
|
177
|
+
const mineGone = mineAll.filter((m) => !mine.some((c) => c.id === m.id)).map((m) => ({ id: m.id, title: clip(m.title, 60), measure: m.measure,
|
|
178
|
+
why: outcomes.some((o) => o.id === m.measure) ? 'Its measure has fewer than two readings in its range, so it has no chart.' : 'No KR metric record is called ' + m.measure + ' any more.' }));
|
|
158
179
|
const noSeries = outcomes.filter((o) => !chartOf(o)).map((o) => ({
|
|
159
180
|
key: 'nos:' + o.id, title: clip(o.name, 120), pillar: o.pillar || '',
|
|
160
181
|
why: (o.readings || []).length === 1 ? 'Only one reading is recorded.' : (o.readings || []).length === 0 ? (o.reason && /reading/i.test(o.reason) ? o.reason : 'No reading is recorded yet.') : 'Its readings do not form a series.',
|
|
@@ -162,7 +183,7 @@ function build(facts) {
|
|
|
162
183
|
const pillars = [...new Set(charts.map((c) => c.pillar).filter(Boolean))];
|
|
163
184
|
const offOf = (L) => L.filter((c) => c.off).length;
|
|
164
185
|
const dash = (id, name, L) => ({ id, name, keys: L.map((c) => c.key), total: L.length, off: offOf(L), chip: !L.length ? '' : offOf(L) ? offOf(L) + ' off its line' : 'On their lines' });
|
|
165
|
-
const dashboards = [dash('all', 'All measures', charts)].concat(savedOf(f.saved, outcomes, charts), pillars.length > 1 ? pillars.map((p) => dash('p:' + p, p, charts.filter((c) => c.pillar === p))) : []);
|
|
186
|
+
const dashboards = [dash('all', 'All measures', charts)].concat(savedOf(f.saved, outcomes, charts.concat(mine), mineAll), pillars.length > 1 ? pillars.map((p) => dash('p:' + p, p, charts.filter((c) => c.pillar === p))) : []);
|
|
166
187
|
const findings = findingsOf(charts);
|
|
167
188
|
const rep = reportRows(f.reports);
|
|
168
189
|
const off = offOf(charts);
|
|
@@ -170,7 +191,7 @@ function build(facts) {
|
|
|
170
191
|
const model = {
|
|
171
192
|
header: { text: (f.pending ? 'Reading the records · ' : '') + 'Real data' + (missing.length ? ' · not read: ' + missing.join(', ') : '') },
|
|
172
193
|
board: { ws: board.ws || null, id: board.id || null, name: board.name || 'Insights', switcher: (f.boards || []).map((b) => ({ ws: b.ws, id: b.id, name: b.name })) },
|
|
173
|
-
charts, noSeries, dashboards, rows: charts,
|
|
194
|
+
charts, mine, mineGone, mineSaved: mineAll, noSeries, dashboards, rows: charts,
|
|
174
195
|
findings: findings.length ? findings : [{ kind: 'calm', key: null, text: charts.length ? (charts.some((c) => c.target !== null) ? 'Nothing stands out. No measure moved much, and none is far behind its line.' : 'Nothing stands out. No measure here has a target, so the series can only be described.') : '' }],
|
|
175
196
|
calm: !findings.length && charts.length > 0,
|
|
176
197
|
reports: Object.assign({ rows: rep, ok: f.reportsOk !== false, counts: { draft: rep.filter((r) => r.state === 'draft').length, issued: rep.filter((r) => r.state === 'issued').length }, missing: f.reportsOk === false }, setupsOf(f.setups, f.now)),
|
|
@@ -183,4 +204,4 @@ function build(facts) {
|
|
|
183
204
|
return model;
|
|
184
205
|
}
|
|
185
206
|
|
|
186
|
-
module.exports = { build, peekModel, chartOf, findingsOf, shortDate, num };
|
|
207
|
+
module.exports = { build, peekModel, chartOf, mineOf, findingsOf, shortDate, num };
|