create-pmos 0.398.0 → 0.399.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/briefing-premium-adddoc-test.js +18 -14
- package/workspace/briefing-premium-board-test.js +80 -48
- package/workspace/briefing-premium-calendar-2-test.js +36 -36
- package/workspace/briefing-premium-calendar-3-test.js +39 -39
- package/workspace/briefing-premium-calendar-test.js +23 -24
- package/workspace/briefing-premium-doc-edit-test.js +6 -2
- package/workspace/briefing-premium-initiative-test.js +38 -16
- package/workspace/briefing-premium-insights-test.js +114 -37
- package/workspace/briefing-premium-metrics-test.js +6 -4
- package/workspace/briefing-premium-products-test.js +10 -7
- package/workspace/briefing-premium-sources-test.js +25 -22
- package/workspace/briefing-premium-test.js +46 -42
- package/workspace/briefing-premium-work-test.js +9 -9
- package/workspace/changelog.json +12 -0
- package/workspace/ev-everywhere-test.js +210 -0
- package/workspace/fixtures/premium-viewer-fixtures.js +11 -6
- package/workspace/guide/home.md +39 -18
- package/workspace/guide/index.md +1 -1
- package/workspace/lib/board-grill.js +63 -0
- package/workspace/lib/board-premium.js +36 -5
- package/workspace/lib/initiative-layout.js +77 -0
- package/workspace/lib/insights-premium.js +3 -2
- package/workspace/lib/insights-records.js +21 -7
- package/workspace/lib/meeting-points.js +52 -0
- package/workspace/lib/news-for-you.js +88 -0
- package/workspace/lib/notes-series.js +29 -6
- package/workspace/lib/report-confirm.js +48 -0
- package/workspace/lib/route-modules.js +8 -0
- package/workspace/lib/routes-board-docs.js +46 -0
- package/workspace/lib/routes-board-grill.js +90 -0
- package/workspace/lib/routes-home-review.js +108 -0
- package/workspace/lib/routes-initiative-layout.js +57 -0
- package/workspace/lib/routes-insights-premium.js +4 -1
- package/workspace/lib/routes-insights-records.js +8 -4
- package/workspace/lib/routes-meeting-points.js +37 -0
- package/workspace/lib/routes-news.js +57 -0
- package/workspace/lib/routes-notes.js +2 -1
- package/workspace/lib/routes-report-confirm.js +31 -0
- package/workspace/lib/routes-search.js +38 -0
- package/workspace/lib/search-index.js +176 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-board-actions-test.js +86 -50
- package/workspace/premium-briefing-depth-test.js +55 -54
- package/workspace/premium-chat-chart-tab-test.js +4 -2
- package/workspace/premium-chat-report-tab-test.js +16 -2
- package/workspace/premium-core-doc-issue-test.js +15 -13
- package/workspace/premium-phone-card-test.js +5 -3
- package/workspace/premium-report-read-test.js +55 -18
- package/workspace/premium-vw-backlog-test.js +2 -2
- package/workspace/premium-vw-cal-test.js +50 -35
- package/workspace/premium-vw-doc-test.js +9 -3
- package/workspace/premium-vw-item-test.js +1 -1
- package/workspace/premium-vw-jira-test.js +2 -2
- package/workspace/premium-vw-meet-test.js +37 -40
- package/workspace/premium-vw-notes-test.js +21 -19
- package/workspace/premium-vw-rec-test.js +11 -12
- package/workspace/premium-welcome-test.js +3 -3
- package/workspace/premium-work-depth-test.js +3 -3
- package/workspace/public/pm/bd-acts.js +303 -225
- package/workspace/public/pm/bd-asks.js +261 -0
- package/workspace/public/pm/bd-pop.js +59 -0
- package/workspace/public/pm/bd-span.js +49 -13
- package/workspace/public/pm/bd-views.js +169 -0
- package/workspace/public/pm/cozy-board.css +301 -0
- package/workspace/public/pm/cozy-ev.css +228 -0
- package/workspace/public/pm/cozy-evmodel.js +106 -0
- package/workspace/public/pm/cozy-evui.js +47 -0
- package/workspace/public/pm/cozy-insights.css +148 -10
- package/workspace/public/pm/cozy-nav.js +103 -39
- package/workspace/public/pm/cozy-news.js +140 -0
- package/workspace/public/pm/cozy-search.js +203 -0
- package/workspace/public/pm/cozy-settings.js +198 -0
- package/workspace/public/pm/cozy-sources.js +89 -0
- package/workspace/public/pm/cozy-today.css +217 -0
- package/workspace/public/pm/cozy-viewer.js +1 -0
- package/workspace/public/pm/cozy-vw-mtg.css +350 -0
- package/workspace/public/pm/cozy-vw-rp.css +152 -0
- package/workspace/public/pm/home-adddoc.js +5 -5
- package/workspace/public/pm/home-app.js +329 -55
- package/workspace/public/pm/home-around.js +24 -126
- package/workspace/public/pm/home-chat.js +67 -14
- package/workspace/public/pm/home-data.js +6 -6
- package/workspace/public/pm/home-dictate.js +54 -0
- package/workspace/public/pm/home-draft.js +6 -6
- package/workspace/public/pm/home-ini-model.js +190 -0
- package/workspace/public/pm/home-ini.css +171 -0
- package/workspace/public/pm/home-ini.js +456 -0
- package/workspace/public/pm/home-list.js +276 -0
- package/workspace/public/pm/home-more.js +17 -134
- package/workspace/public/pm/home-phone-card.js +4 -4
- package/workspace/public/pm/home-review.js +104 -0
- package/workspace/public/pm/home-task.js +67 -0
- package/workspace/public/pm/home-today.js +144 -0
- package/workspace/public/pm/home-work.js +54 -26
- package/workspace/public/pm/premium-board.js +163 -39
- package/workspace/public/pm/premium-chart-tab.js +4 -5
- package/workspace/public/pm/premium-first.js +5 -7
- package/workspace/public/pm/premium-insights.js +499 -202
- package/workspace/public/pm/premium-mtg-present.js +138 -0
- package/workspace/public/pm/premium-mtg-replay.js +142 -0
- package/workspace/public/pm/premium-report-read.js +216 -52
- package/workspace/public/pm/premium-report-tab.js +44 -19
- package/workspace/public/pm/premium-shell.js +7 -7
- package/workspace/public/pm/premium-vw-cal.js +150 -60
- package/workspace/public/pm/premium-vw-mtg.js +488 -261
- package/workspace/public/pm/premium-vw-notes.js +61 -0
- package/workspace/public/pm/rp-parts.js +269 -0
- package/workspace/public/premium-board.html +4 -3
- package/workspace/public/premium-insights.html +10 -10
- package/workspace/public/premium.html +3 -1
- package/workspace/r/m1.png +0 -0
- package/workspace/r/m2.png +0 -0
- package/workspace/r/m3.png +0 -0
- package/workspace/r/nl.png +0 -0
- package/workspace/test-lists/initiative-layout.json +9 -0
- package/workspace/test-lists/premium-uncovered-meetings.json +9 -0
- package/workspace/test-lists/premium-uncovered-reports.json +9 -0
- package/workspace/test-lists/uf-everywhere.json +15 -0
- package/workspace/test-lists/uf-home.json +9 -0
- package/workspace/test-lists/uncovered-board.json +9 -0
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
3
|
/* premium-briefing-depth-test.js — Around you (initiative premium-briefing-depth; planning/prd/premium-briefing-depth-prd.md R1 to R9).
|
|
4
|
-
* Re-pointed by premium-agreed-design: the Briefing card and its dialogs are gone
|
|
5
|
-
*
|
|
4
|
+
* Re-pointed by premium-agreed-design: the Briefing card and its dialogs are gone. Re-pointed again by premium-uncovered-features (canvas
|
|
5
|
+
* HmAround): Around you is gone too. New for you (cozy-news.js, from the place menu) holds the mentions, the digests and the prep line, and
|
|
6
|
+
* its "Where the rest went" rows open the old views (home-around.js), each with Back to New for you. Data freshness is Sources (cozy-sources.js).
|
|
7
|
+
* The row summaries of the old card are gone with it; each view's own line (.ar-say) carries the count.
|
|
6
8
|
* A real server on a scratch repository (c3-scan-fixture.js: PMOS_DRIVER=off, so no agent
|
|
7
9
|
* ever runs), with a driver ledger, a scan ledger and a brief of today that this suite seeds with the writers the product uses. The real page
|
|
8
10
|
* presses the real routes. Only two presses are answered in the browser, because they start an agent: scan/now and sources/refresh. The
|
|
@@ -92,37 +94,35 @@ const GANTT = [
|
|
|
92
94
|
await p.route('**/api/scan/now', (r) => json(r, { ok: true, scan: 'scan-00000000ff' }));
|
|
93
95
|
await p.route('**/api/sources/refresh', (r) => json(r, { ok: true, started: 'session' }));
|
|
94
96
|
await p.route('**/api/sources/refresh-all', (r) => json(r, { ok: true, joined: false, started: ['calendar'], already: [], failed: [], all: { started_at: new Date().toISOString(), reads: ['calendar'], derived: ['brief'], phase: 'read', done: false, steps: [{ id: 'calendar', label: 'Calendar', step: 'read', state: 'running' }, { id: 'brief', label: 'Morning briefing', step: 'derived', state: 'waiting' }] } }));
|
|
95
|
-
/*
|
|
97
|
+
/* New for you: the place menu, then New for you; it reads what is new and names where the rest went */
|
|
98
|
+
const REST = ['pulse', 'rep', 'prop', 'scan'];
|
|
96
99
|
const openCard = async () => {
|
|
97
|
-
await until(() => p.$('#czFab')); await p.click('#czFab'); await p.click('[data-cz-
|
|
98
|
-
await p.
|
|
99
|
-
await until(() => p.evaluate(() => !!document.querySelector('#czViewer:not([hidden]) #aroundBody')));
|
|
100
|
-
await until(() => p.evaluate(() => document.querySelector('#aroundCap') && document.querySelector('#aroundCap').textContent !== 'Reading' && !/Reading…/.test(document.querySelector('#aroundBody').textContent)), 30000);
|
|
100
|
+
await until(() => p.$('#czFab')); await p.click('#czFab'); await p.click('#czMenu [data-cz-news]');
|
|
101
|
+
await until(() => p.evaluate(() => !!document.querySelector('#czViewer:not([hidden]) .ev-news [data-ev-rest]') && !document.querySelector('#czViewer .ev-news .ev-skelrow')), 30000);
|
|
101
102
|
};
|
|
102
103
|
await p.goto(`${F.BASE}/premium.html?ws=${encodeURIComponent(ws)}`);
|
|
103
104
|
await until(() => p.evaluate(() => document.querySelectorAll('#hmList .hm-g').length > 0), 30000);
|
|
104
105
|
posts.length = 0; // Home's own writes on load (its chat marks a conversation seen) are not Around you's; R8 counts from the card's opening
|
|
105
106
|
await openCard();
|
|
106
|
-
const
|
|
107
|
+
const say = () => p.evaluate(() => (document.querySelector('#czViewer .ar-say') || {}).textContent || '');
|
|
107
108
|
const body = () => p.evaluate(() => (document.querySelector('#czViewer .cz-vw-body .bd-a') || {}).textContent || '');
|
|
108
|
-
|
|
109
|
-
const
|
|
109
|
+
// a view opens from its "Where the rest went" row when New for you names it; mentions are New for you's own rows, so their full view opens directly
|
|
110
|
+
const open = async (k) => {
|
|
111
|
+
const sel = `#czViewer .ev-news [data-ev-rest="${k}"]`; // p.click finds the row again if New for you redraws it between the look and the press
|
|
112
|
+
if (REST.includes(k) && await p.$(sel)) await p.click(sel); else await p.evaluate((x) => import('/pm/home-around.js').then((M) => M.openAround(x)), k);
|
|
113
|
+
await until(() => p.evaluate((x) => !!document.querySelector(`#czViewer .bd-a[data-bd-view="${x}"] *`), k));
|
|
114
|
+
};
|
|
115
|
+
const close = async () => { await p.click('#czViewer [data-bda="back"]'); await until(() => p.evaluate(() => !!document.querySelector('#czViewer .ev-news [data-ev-rest]'))); };
|
|
110
116
|
const click = async (sel) => { await until(() => p.$(sel)); await p.click(sel); };
|
|
111
117
|
const shotDir = process.env.BRIEFING_DEPTH_SHOTS;
|
|
112
118
|
const shot = async (n) => { if (shotDir) { await sleep(700); fs.mkdirSync(shotDir, { recursive: true }); await p.screenshot({ path: path.join(shotDir, n + '.png') }); } };
|
|
113
119
|
|
|
114
|
-
/* R: the card */
|
|
115
|
-
const R0 = await
|
|
116
|
-
ok('R1 the
|
|
117
|
-
ok('
|
|
118
|
-
ok('
|
|
119
|
-
ok('
|
|
120
|
-
ok('R5 the scan row counts the waiting proposals', /^Horizon scan: \d+ proposals? waits? for you|^Horizon scan: \d+ proposals wait for you/.test(R0.scan.t) && /^\d+$/.test(R0.scan.m), JSON.stringify(R0.scan));
|
|
121
|
-
ok('R6 the freshness row says it is not live', /not live/.test(R0.src.s) && !/up to date/i.test(R0.src.t + R0.src.s), JSON.stringify(R0.src));
|
|
122
|
-
const cap = await p.evaluate(() => document.querySelector('#aroundCap').textContent);
|
|
123
|
-
ok('R7 the caption counts the rows that wait', /^\d+ to look at$/.test(cap), cap);
|
|
124
|
-
ok('R8 opening Around you wrote nothing', posts.length === 0, JSON.stringify(posts));
|
|
125
|
-
ok('R9 Around you is marked Waiting for design', /Waiting for design/.test(await p.textContent('#czViewer')));
|
|
120
|
+
/* R: New for you, in place of the card */
|
|
121
|
+
const R0 = await p.evaluate(() => ({ rest: [...document.querySelectorAll('#czViewer .ev-news [data-ev-rest]')].map((b) => b.dataset.evRest), list: !!document.querySelector('#aroundBody, #aroundCap'), text: document.querySelector('#czViewer').textContent }));
|
|
122
|
+
ok('R1 New for you names where the rest of Around you went, one row each, and draws no Around you list', R0.rest.join() === REST.join() && !R0.list, JSON.stringify(R0.rest));
|
|
123
|
+
ok('R3 the mentions that wait are New for you\'s own rows', /Dana/.test(R0.text) && /Mentions/.test(R0.text), R0.text.slice(0, 300));
|
|
124
|
+
ok('R8 opening New for you wrote nothing', posts.length === 0, JSON.stringify(posts));
|
|
125
|
+
ok('R9 New for you is drawn to its design: no Waiting for design marker', !/Waiting for design/.test(R0.text));
|
|
126
126
|
await shot('card-1280-light');
|
|
127
127
|
|
|
128
128
|
/* A: agent proposals */
|
|
@@ -165,8 +165,9 @@ const GANTT = [
|
|
|
165
165
|
const open1 = (await (await fetch(`${F.BASE}/api/driver/open?target_kind=initiative&ws=${ws}`)).json()).targets || {};
|
|
166
166
|
ok('A9 the ledger no longer lists the three as open', !Object.values(open1).flat().some((x) => [P1, P2, P3].includes(x.id)), JSON.stringify(open1));
|
|
167
167
|
await close();
|
|
168
|
-
await
|
|
169
|
-
ok('A10 the
|
|
168
|
+
await open('prop');
|
|
169
|
+
ok('A10 the view now says no proposal waits', await until(() => say().then((t) => /^No proposal waits for you/.test(t))), await say());
|
|
170
|
+
await close();
|
|
170
171
|
|
|
171
172
|
/* M: mentions */
|
|
172
173
|
await open('men');
|
|
@@ -193,8 +194,8 @@ const GANTT = [
|
|
|
193
194
|
await click(`.bd-it[data-id="${M2}"] [data-bda="munread"]`);
|
|
194
195
|
await until(() => posts.filter((x) => x.path === '/api/mentions/read').length === 2);
|
|
195
196
|
ok('M8 Mark unread posts read:false', posts.filter((x) => x.path === '/api/mentions/read')[1].body.read === false);
|
|
197
|
+
ok('M9 the view names who waits again after Mark unread', await until(() => say().then((t) => /Dana in Slack and Priya in Jira are waiting/.test(t))), await say());
|
|
196
198
|
await close();
|
|
197
|
-
ok('M9 the row names who waits again after Mark unread', await until(() => rows().then((r) => /Dana in Slack and Priya in Jira are waiting/.test(r.men.t))), JSON.stringify((await rows()).men));
|
|
198
199
|
|
|
199
200
|
/* P: portfolio pulse */
|
|
200
201
|
await open('pulse');
|
|
@@ -246,37 +247,38 @@ const GANTT = [
|
|
|
246
247
|
} else ok('S9 Scan now is off and says why', /switched off|cannot start|left/.test(await body()), await body());
|
|
247
248
|
await close();
|
|
248
249
|
|
|
249
|
-
/* F: data freshness */
|
|
250
|
-
await
|
|
251
|
-
|
|
252
|
-
const
|
|
253
|
-
|
|
250
|
+
/* F: data freshness is Sources now (cozy-sources.js); the old view's key opens it */
|
|
251
|
+
await p.evaluate(() => import('/pm/home-around.js').then((M) => M.openAround('src')));
|
|
252
|
+
await until(() => p.evaluate(() => document.querySelectorAll('#czViewer .ev-src .ev-trow[data-src]').length > 0), 20000);
|
|
253
|
+
const ft = await p.evaluate(() => document.querySelector('#czViewer .ev-src').textContent);
|
|
254
|
+
const srcRows = await p.evaluate(() => document.querySelectorAll('#czViewer .ev-src .ev-trow[data-src]').length);
|
|
255
|
+
ok('F1 Sources lists the workspace\'s sources with when each was last read, and says it never posts', srcRows >= 3 && /Last read/.test(ft) && /never posts to them/.test(ft) && !/up to date/i.test(ft), ft);
|
|
254
256
|
await shot('src-1280-light');
|
|
255
|
-
const one = await p.evaluate(() => { const b = document.querySelector('#czViewer .
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
257
|
+
const one = await p.evaluate(() => { const b = document.querySelector('#czViewer .ev-src [data-ev-read]'); return b ? b.dataset.evRead : null; });
|
|
258
|
+
if (one) {
|
|
259
|
+
await click(`#czViewer .ev-src [data-ev-read="${one}"]`);
|
|
260
|
+
await until(() => posts.some((x) => x.path === '/api/sources/refresh'));
|
|
261
|
+
const rf = posts.filter((x) => x.path === '/api/sources/refresh');
|
|
262
|
+
ok('F2 Read again posts one sources/refresh for that source', rf.length === 1 && rf[0].body.source === one && rf[0].body.ws === ws, JSON.stringify(rf));
|
|
263
|
+
ok('F3 it says what it started', await until(() => p.evaluate(() => /agent session started|Reading it again/.test(document.querySelector('#czViewer .ev-src').textContent))));
|
|
264
|
+
} else ok('F2 no source is behind, so no row offers Read again', !/Read again/.test(ft.replace(/Read all again/g, '')), ft);
|
|
265
|
+
const all = await p.evaluate(() => { const b = document.querySelector('#czViewer .ev-src [data-ev-all]'); return b ? b.disabled : null; });
|
|
263
266
|
if (all === false) {
|
|
264
267
|
const n1 = posts.filter((x) => x.path === '/api/sources/refresh').length;
|
|
265
|
-
await click('#czViewer .
|
|
268
|
+
await click('#czViewer .ev-src [data-ev-all]');
|
|
266
269
|
await until(() => posts.some((x) => x.path === '/api/sources/refresh-all'));
|
|
267
270
|
const made = posts.filter((x) => x.path === '/api/sources/refresh-all');
|
|
268
|
-
ok('F4
|
|
269
|
-
} else ok('F4
|
|
270
|
-
await
|
|
271
|
+
ok('F4 Read all again posts one ordered run (the sources, then the Briefing), and no refresh of each source', made.length === 1 && made[0].body.ws === ws && posts.filter((x) => x.path === '/api/sources/refresh').length === n1, JSON.stringify(made));
|
|
272
|
+
} else ok('F4 Read all again is off while a run is going', all === true, String(all));
|
|
273
|
+
await p.keyboard.press('Escape'); await until(() => p.evaluate(() => !document.querySelector('#czViewer:not([hidden])')));
|
|
271
274
|
|
|
272
275
|
/* E: a source that fails is named, never shown empty */
|
|
273
276
|
ganttFail = true;
|
|
274
277
|
await p.evaluate(() => { document.dispatchEvent(new Event('visibilitychange')); });
|
|
275
278
|
await p.reload();
|
|
276
279
|
await openCard();
|
|
277
|
-
const RE = await rows();
|
|
278
|
-
ok('E1 a pulse that cannot be read says so, and does not read "nothing"', /^Portfolio pulse (could not be read|cannot be read|did not answer|failed)|could not be read/.test(RE.pulse.t) && !/nothing to compare/.test(RE.pulse.t), JSON.stringify(RE.pulse));
|
|
279
280
|
await open('pulse');
|
|
281
|
+
ok('E1 a pulse that cannot be read says so, and does not read "nothing"', /could not be read/.test(await say()) && !/nothing to compare/.test(await body()), await say());
|
|
280
282
|
ok('E2 its dialog names the failure', /could not be read|Portfolio pulse/.test(await body()) && await p.evaluate(() => !!document.querySelector('#czViewer .cz-vw-body .nodef.err')), await body());
|
|
281
283
|
await close();
|
|
282
284
|
ganttFail = false;
|
|
@@ -289,9 +291,8 @@ const GANTT = [
|
|
|
289
291
|
repReply = { ok: true, ws, setups: [], asks: [], findings: FIND, finder: { cadence: 'daily', sources: {}, last_run: null, next_run: null } };
|
|
290
292
|
await p.reload();
|
|
291
293
|
await openCard();
|
|
292
|
-
const RG = await rows();
|
|
293
|
-
ok('G1 two findings make the row say so, with the count', /^2 reports found in your work/.test(RG.rep.t) && RG.rep.m === '2', JSON.stringify(RG.rep));
|
|
294
294
|
await open('rep');
|
|
295
|
+
ok('G1 two findings make the view say so, with the count', /^2 reports were found in your work/.test(await say()), await say());
|
|
295
296
|
const gb = await body();
|
|
296
297
|
ok('G2 the dialog shows each finding with its why, its evidence and its confidence word', /Weekly status/.test(gb) && /every Friday for six weeks/.test(gb) && /Mail: Weekly status, 6 times/.test(gb) && /Calendar: Friday review/.test(gb) && /Likely/.test(gb) && /Not sure/.test(gb), gb);
|
|
297
298
|
ok('G3 the buttons say what they record before they are pressed', /PMOS drafts only\. Nothing is sent\./.test(gb) && /will not raise it again/.test(gb) && !/Change first/.test(await p.evaluate(() => [...document.querySelectorAll('#czViewer .cz-vw-body .bd-a button')].map((b) => b.textContent).join('|'))), gb);
|
|
@@ -310,9 +311,8 @@ const GANTT = [
|
|
|
310
311
|
repFail = true;
|
|
311
312
|
await p.reload();
|
|
312
313
|
await openCard();
|
|
313
|
-
const R1f = await rows();
|
|
314
|
-
ok('G7 one finding is named in the row', /^Report found: Quarterly review/.test(R1f.rep.t), JSON.stringify(R1f.rep));
|
|
315
314
|
await open('rep');
|
|
315
|
+
ok('G7 one finding is named in the view', /^1 report was found/.test(await say()) && /Quarterly review/.test(await body()), await say());
|
|
316
316
|
await click('#czViewer .cz-vw-body [data-bda="rset"]');
|
|
317
317
|
ok('G8 a refused press shows the reason and keeps the finding', await until(async () => /no longer open/.test(await body()) && await p.evaluate(() => !!document.querySelector('#czViewer .cz-vw-body .nodef.err') && !!document.querySelector('#czViewer .cz-vw-body [data-bda="rset"]'))), await body());
|
|
318
318
|
await close();
|
|
@@ -320,12 +320,13 @@ const GANTT = [
|
|
|
320
320
|
repReply = { ok: true, ws, setups: [], asks: [], findings: [], finder: { cadence: 'off', sources: {}, last_run: null, next_run: null } };
|
|
321
321
|
await p.reload();
|
|
322
322
|
await openCard();
|
|
323
|
-
|
|
324
|
-
ok('G9 with none found
|
|
323
|
+
await open('rep');
|
|
324
|
+
ok('G9 with none found, the view says no report waits', /^No report waits for you/.test(await say()), await say());
|
|
325
|
+
await close();
|
|
325
326
|
repReply = null;
|
|
326
327
|
|
|
327
328
|
/* W: the POST allow-list */
|
|
328
|
-
const allowed = new Set(['/api/mentions/read', '/api/pm-items/add', '/api/driver/keep', '/api/driver/return', '/api/driver/drop', '/api/scan/proposal', '/api/scan/now', '/api/scan/stop', '/api/sources/refresh', '/api/sources/refresh-all', '/api/report-setups/setup', '/api/report-setups/dismiss', '/api/briefing-premium/seen']); // seen: an opened popup's record (popup context slice 11, R1)
|
|
329
|
+
const allowed = new Set(['/api/mentions/read', '/api/pm-items/add', '/api/driver/keep', '/api/driver/return', '/api/driver/drop', '/api/scan/proposal', '/api/scan/now', '/api/scan/stop', '/api/sources/refresh', '/api/sources/refresh-all', '/api/report-setups/setup', '/api/report-setups/dismiss', '/api/briefing-premium/seen', '/api/news-for-you/seen']); // news-for-you/seen: closing New for you marks what it showed seen // seen: an opened popup's record (popup context slice 11, R1)
|
|
329
330
|
const strays = posts.filter((x) => !allowed.has(x.path) && !/^\/api\/home-desk\//.test(x.path)); // /api/home-desk/*: Home's own chat (a conversation seen), not Around you
|
|
330
331
|
ok('W1 every POST is one of the existing routes in the PRD', posts.length > 0 && strays.length === 0, JSON.stringify(strays));
|
|
331
332
|
const fields = { '/api/driver/keep': ['ws', 'proposal'], '/api/driver/return': ['ws', 'proposal', 'note'], '/api/driver/drop': ['ws', 'proposal'], '/api/mentions/read': ['id', 'read'], '/api/pm-items/add': ['line'], '/api/scan/proposal': ['ws', 'id', 'action', 'why'], '/api/scan/now': ['ws'], '/api/sources/refresh': ['ws', 'source'], '/api/sources/refresh-all': ['ws'], '/api/report-setups/setup': ['ws', 'finding'], '/api/report-setups/dismiss': ['ws', 'finding', 'name'] };
|
|
@@ -334,7 +335,7 @@ const GANTT = [
|
|
|
334
335
|
ok('W3 every GET the card made is a console route in the PRD', gets.filter((g) => !['/api/briefing-premium', '/api/brief-page', '/api/driver/open', '/api/calendar-views', '/api/scan/portfolio', '/api/report-setups', '/api/sources', '/api/pm-items', '/api/workspaces', '/api/products', '/api/state'].includes(g) && /around|depth|bd-/.test(g)).length === 0);
|
|
335
336
|
|
|
336
337
|
/* the Scan now status on the scan row, from the server's own manual count */
|
|
337
|
-
ok('RS1 the scan
|
|
338
|
+
ok('RS1 the scan view says how many manual scans are left, or why Scan now is off', /\d+ of \d+ manual scans left today|switched off|cannot start/.test(st), st);
|
|
338
339
|
|
|
339
340
|
/* P: the prep ring over Today, counted from the meetings the brief page holds */
|
|
340
341
|
const tm = (id, m, state, before) => ({ id, title: 'Meeting ' + id, start: iso(m), end: iso(m + 30), minutes: 30, people: [], initiative: null, prepared: false, before, state });
|
|
@@ -359,7 +360,7 @@ const GANTT = [
|
|
|
359
360
|
await shot('card-390-light');
|
|
360
361
|
const side = await p.evaluate(() => document.documentElement.scrollWidth - innerWidth);
|
|
361
362
|
ok('L1 at 390 wide the page does not scroll sideways', side <= 0, String(side));
|
|
362
|
-
const small = await p.evaluate(() => [...document.querySelectorAll('#
|
|
363
|
+
const small = await p.evaluate(() => [...document.querySelectorAll('#czViewer .ev-news [data-ev-rest]')].filter((b) => b.getBoundingClientRect().height < 44).map((b) => b.dataset.evRest));
|
|
363
364
|
ok('L2 every row is 44 px tall at least', small.length === 0, small.join());
|
|
364
365
|
await open('men');
|
|
365
366
|
const wide = await p.evaluate(() => { const d = document.querySelector('#czViewer .cz-vw-body'); return [document.documentElement.scrollWidth - innerWidth, d.scrollWidth - d.clientWidth]; });
|
|
@@ -374,7 +375,7 @@ const GANTT = [
|
|
|
374
375
|
await close().catch(() => {});
|
|
375
376
|
const raw = await p.evaluate(() => { const c = getComputedStyle(document.querySelector('#czViewer')); return [c.backgroundColor, getComputedStyle(document.body).backgroundColor]; });
|
|
376
377
|
ok('L4 in the dark theme the card has a background of its own', raw[0] !== 'rgba(0, 0, 0, 0)' && raw[0] !== raw[1] || raw[0] !== '', raw.join());
|
|
377
|
-
const focus = await p.evaluate(() => { const b = document.querySelector('#
|
|
378
|
+
const focus = await p.evaluate(() => { const b = document.querySelector('#czViewer .ev-news [data-ev-rest]'); b.focus(); const c = getComputedStyle(b); return [c.outlineStyle, c.outlineWidth, c.boxShadow]; });
|
|
378
379
|
ok('L5 a row shows a focus ring', focus[0] !== 'none' || focus[2] !== 'none', focus.join());
|
|
379
380
|
/* K: the simple Agent proposals dialog at 390, light and dark, and with the phone keyboard open */
|
|
380
381
|
const P4 = 'p-bbbbbbbb04', P5 = 'p-bbbbbbbb05';
|
|
@@ -56,7 +56,7 @@ const DASH = { kind: 'dashboard', proposal: { name: 'Partner growth', purpose: '
|
|
|
56
56
|
|
|
57
57
|
/* premium-agreed-design: Home's chat (home-chat.js) draws the chip; a chart or dashboard opens in the Viewer card (cozy-viewer.js), whose kind line names it.
|
|
58
58
|
* A chart is the design's metrics view (Main.dc.html viewer "metrics": stat tiles, then the readings with the newest in ember); its forms, Save and
|
|
59
|
-
* Delete are
|
|
59
|
+
* Delete are its setup block, and a confirm asks in the card ([data-ct="askyes"]). */
|
|
60
60
|
const look = () => {
|
|
61
61
|
const vw = document.querySelector('#czViewer:not([hidden])');
|
|
62
62
|
const pane = vw ? vw.querySelector('.vz[data-vw^="chart:"], .vz[data-vw^="dashboard:"]') : null;
|
|
@@ -82,7 +82,9 @@ const look = () => {
|
|
|
82
82
|
const p = await ctx.newPage(); const errs = []; p.on('pageerror', (e) => errs.push(String(e)));
|
|
83
83
|
await p.route('**/api/briefing-premium/thread?**', (r) => r.fulfill({ json: { ok: true, turns: [], session: 's-ch', goal: null } }));
|
|
84
84
|
await p.route('**/api/sessions/conversation?**', (r) => r.fulfill({ json: { ok: true, state: 'conv', turn: 'pm', messages } }));
|
|
85
|
-
|
|
85
|
+
// premium-agreed-design: /premium-chat.html opens Home, whose chat is docked on a desktop; on a phone the list is the page (premium-uncovered-features
|
|
86
|
+
// HmPhone), so the address names the conversation and it opens as the page (HmPhone2)
|
|
87
|
+
await p.goto(BASE + url + (width < 761 && url === '/premium-chat.html' ? '?about=chat:charts' : ''));
|
|
86
88
|
await until(() => p.evaluate(() => !!document.querySelector('#hmLog [data-report-open]')));
|
|
87
89
|
await sleep(500);
|
|
88
90
|
return { p, ctx, errs };
|
|
@@ -39,7 +39,8 @@ const ANSWER = { role: 'assistant', text: 'Signups from the lightbox rose to 1,2
|
|
|
39
39
|
|
|
40
40
|
/* premium-agreed-design: Home's chat is #hmLog; a report opens in the Viewer card (#czViewer), which covers the chat page on a phone. A new
|
|
41
41
|
* report is the design's slide deck (Main.dc.html viewer "deck"): one slide, Slide n of N, the thumbnails (the title slide, then the seven sections);
|
|
42
|
-
* its setup and a set-up template
|
|
42
|
+
* its setup and a set-up template show At a glance as the Brief draws it (premium-uncovered-features, canvas RpBrief). A confirm asks in the
|
|
43
|
+
* card ([data-rt="askyes"]). */
|
|
43
44
|
const look = () => {
|
|
44
45
|
const vw = document.querySelector('#czViewer:not([hidden])'), pane = vw ? vw.querySelector('.vz[data-vw^="report:"]') : null;
|
|
45
46
|
return { shut: !pane, layer: false, chip: (document.querySelector('#hmLog [data-report-open]') || {}).textContent || null,
|
|
@@ -79,7 +80,7 @@ const look = () => {
|
|
|
79
80
|
ok('R1 opening the chat opens no tab by itself', s0.tabs.length === 0, JSON.stringify(s0));
|
|
80
81
|
await p.click('#hmLog [data-report-open]');
|
|
81
82
|
const s1 = await until(async () => { const v = await p.evaluate(look); return v.pane ? v : null; }) || await p.evaluate(look);
|
|
82
|
-
ok('R3 the new report is the design\'s slide deck: name, audience, format, a title slide and seven section slides, Schedule Off', /Slide deck/.test(s1.tabs.join(' ')) && /Social login weekly/.test(s1.pane || '') && /
|
|
83
|
+
ok('R3 the new report is the design\'s slide deck: name, audience, format, a title slide and seven section slides, Schedule Off', /Slide deck/.test(s1.tabs.join(' ')) && /Social login weekly/.test(s1.pane || '') && /Read byGrowth leads/.test(s1.pane || '') && /FormatGoogle Slides/.test(s1.pane || '') && !/Waiting for design/.test(s1.pane || '')
|
|
83
84
|
&& s1.secs === 7 && s1.slide === 'Slide 1 of 8' && s1.sched === 'Off · runs once' && /Set it up/.test(s1.pane || '') && !(await p.$('#czViewer .rt, #czViewer .obody, #dlg:not([hidden])')), JSON.stringify(s1));
|
|
84
85
|
await p.click('#czViewer [data-rt="sl|1"]');
|
|
85
86
|
ok('R3 next shows the second slide, a section of the report', /Slide 2 of 8/.test((await p.evaluate(look)).slide || '') && /Headline/.test(await p.textContent('#czViewer .vz-dks')));
|
|
@@ -99,6 +100,19 @@ const look = () => {
|
|
|
99
100
|
const s4 = await until(async () => { const v = await p.evaluate(look); return v.sched && /Every two weeks/.test(v.sched) ? v : null; }) || await p.evaluate(look);
|
|
100
101
|
const changed = RS.fold(ledger()).setups.get(setup && setup.id);
|
|
101
102
|
ok('R5 the Schedule chip changes a template through the route and resumes it', !!changed && changed.status === 'active' && changed.schedule.cadence === 'bi-weekly' && /Every two weeks/.test(s4.sched || ''), JSON.stringify([s4.sched, changed]));
|
|
103
|
+
/* R8 the look conversation's card (canvas RpDesign): D1 is the saved look, D2 a new one; Design previews D2 beside the current look */
|
|
104
|
+
const RDS = require('./lib/report-design.js');
|
|
105
|
+
const look1 = '<style>.pmos-slide{background:#fff}</style><section class="pmos-slide" data-title="Headline"><h2>Light, long</h2></section>';
|
|
106
|
+
const look2 = '<style>.pmos-slide{background:#14213D;color:#F3F5F9}</style><section class="pmos-slide" data-title="Headline"><h2>Dark, short</h2></section>';
|
|
107
|
+
const v1 = RDS.writeVersion(F.team, setup.id, look1, { turn: 'Light, long' }), v2 = RDS.writeVersion(F.team, setup.id, look2, { turn: 'Like the Sept leadership deck' });
|
|
108
|
+
RDS.append(F.team, setup.id, { ev: 'accept', n: 1, rules: { same: ['Dark slides'], changes: [], learned: [] } });
|
|
109
|
+
await p.click('#czViewer [data-rt="view|design"]');
|
|
110
|
+
const d1 = await until(() => p.evaluate(() => { const v = document.querySelector('#czViewer .vz[data-vw^="report:"]'); return v && /Previewing new look/.test(v.textContent) ? { t: v.textContent, pair: v.querySelectorAll('.rp-pair .rp-thumb').length, use: !!v.querySelector('[data-rt="d-accept"]'), keep: !!v.querySelector('[data-rt="d-keep"]') } : null; }), 10000);
|
|
111
|
+
ok('R8 Design is the look conversation (RpDesign): Previewing new look, Current beside New look, Use it and Keep current', v1.ok && v2.ok && d1 && d1.pair === 2 && d1.use && d1.keep && /New look/.test(d1.t) && /Current/.test(d1.t), JSON.stringify(d1));
|
|
112
|
+
if (shots) await p.screenshot({ path: `${shots}/design-1280-light.png` });
|
|
113
|
+
await p.click('#czViewer [data-rt="d-accept"]');
|
|
114
|
+
ok('R8 Use it saves the new look; the card says the next cycle follows it', await until(() => p.evaluate(() => /Using the new look \(D2\)/.test((document.querySelector('#czViewer .vz[data-vw^="report:"]') || {}).textContent || '') && /Saved look/.test(document.querySelector('#czViewer .vz[data-vw^="report:"]').textContent)), 10000) && (RDS.fold(RDS.readEvents(F.team, setup.id)).saved || {}).version === 2, await p.evaluate(() => ((document.querySelector('#czViewer .vz[data-vw^="report:"]') || {}).textContent || '').slice(0, 600)));
|
|
115
|
+
await p.click('#czViewer [data-rt="view|structure"]');
|
|
102
116
|
await p.click('#czViewer [data-rt^="discard|"]');
|
|
103
117
|
await p.click('#czViewer [data-rt="askyes"]');
|
|
104
118
|
const s5 = await until(async () => { const v = await p.evaluate(look); return v.pane && /The draft is discarded/.test(v.pane) ? v : null; }) || await p.evaluate(look);
|
|
@@ -87,16 +87,16 @@ const BODY = '## Purpose\n\nWhy this board exists.\n\n## Scope\n\nWhat it covers
|
|
|
87
87
|
const H = await T.pressHeaders(BASE);
|
|
88
88
|
const nonce = H['x-pmos-nonce'];
|
|
89
89
|
|
|
90
|
-
/* B the Board reader (premium-
|
|
91
|
-
|
|
90
|
+
/* B the Board reader (premium-uncovered-features, BdDocs: the Documents tab is a table; a row's title opens the document in the side panel,
|
|
91
|
+
with its health, edit log, the file's text and the Issue it bar) */
|
|
92
92
|
const bToast = (p, re) => until(() => p.evaluate((s) => { const t = document.querySelector('#bdToast'); return t && !t.hidden && new RegExp(s).test(t.textContent) ? t.textContent : null; }, re.source));
|
|
93
93
|
const P = await open('/premium-board.html'), p = P.page;
|
|
94
94
|
await until(() => p.evaluate(() => document.querySelectorAll('#ibBody .ini2').length > 0), 60000);
|
|
95
95
|
await p.click('#tabDocs');
|
|
96
|
-
ok('B1 a board document
|
|
97
|
-
ok('B1
|
|
98
|
-
await p.click(`#docBody [data-
|
|
99
|
-
ok('B2 the reader shows the file\'s text and path,
|
|
96
|
+
ok('B1 a board document is a row whose title opens the reader', await until(() => p.evaluate((k) => !!document.querySelector(`#docBody [data-opendoc="core:${k}"]`), bkey), 60000));
|
|
97
|
+
ok('B1 every document row has a title that opens it', await p.evaluate(() => [...document.querySelectorAll('#docBody .bd-dt[data-docrow]')].every((r) => !!r.querySelector('[data-opendoc]'))));
|
|
98
|
+
await p.click(`#docBody [data-opendoc="core:${bkey}"]`);
|
|
99
|
+
ok('B2 the reader shows the file\'s text and path, and the bar says nothing is sent', await until(() => p.evaluate((pt) => { const o = document.querySelector('#peek'); return !o.hidden && /Why this board exists/.test(o.textContent) && o.textContent.includes(pt) && !!o.querySelector('[data-issue-bar="draft"]') && /Nothing is sent/.test(o.querySelector('[data-issue-bar]').textContent) && !!o.querySelector('[data-act="issue"]'); }, d1.path)), await p.evaluate(() => document.querySelector('#peek').textContent));
|
|
100
100
|
ok('B2 no old dialog opens', await p.evaluate(() => !!!document.querySelector('#dlg.on')));
|
|
101
101
|
const n0 = ledger().filter((l) => l.ev === 'issue').length;
|
|
102
102
|
await p.click('#peek [data-act="issue"]');
|
|
@@ -106,18 +106,20 @@ const BODY = '## Purpose\n\nWhy this board exists.\n\n## Scope\n\nWhat it covers
|
|
|
106
106
|
const il = ledger().filter((l) => l.ev === 'issue');
|
|
107
107
|
ok('B5 the ledger has one new issue line for that draft, written by the PM', il.length === n0 + 1 && il[il.length - 1].slot === d1.slot && il[il.length - 1].scope === bscope && /pm/.test(String(il[il.length - 1].by)), JSON.stringify(il));
|
|
108
108
|
ok('B5 the file now says state: issued', /^state: issued$/m.test(fs.readFileSync(path.join(team, d1.path), 'utf8')));
|
|
109
|
-
ok('B6 the reader says it is issued, the Issue it press is gone, and the row reads Up to date', await until(() => p.evaluate(() => { const o = document.querySelector('#peek'); return !o.hidden && !!o.querySelector('[data-issue-bar="done"]') && !o.querySelector('[data-act="issue"]'); }), 30000) && await until(() => p.evaluate((k) => { const r = document.querySelector(`#docBody [data-
|
|
109
|
+
ok('B6 the reader says it is issued, the Issue it press is gone, and the row reads Up to date', await until(() => p.evaluate(() => { const o = document.querySelector('#peek'); return !o.hidden && !!o.querySelector('[data-issue-bar="done"]') && !o.querySelector('[data-act="issue"]'); }), 30000) && await until(() => p.evaluate((k) => { const r = document.querySelector(`#docBody [data-docrow="core:${k}"]`); return r && /Up to date/.test(r.textContent); }, bkey), 30000), await p.evaluate(() => document.querySelector('#peek').textContent + ' // ' + document.querySelector('#docBody').textContent));
|
|
110
110
|
await p.screenshot({ path: path.join(R.base, 'board-issued.png') });
|
|
111
111
|
await P.ctx.close();
|
|
112
112
|
|
|
113
|
-
/* I the initiative: a layout inside Home (premium-agreed-design). The Board's expand link lands there; the card's Overview lists the core documents,
|
|
113
|
+
/* I the initiative: a layout inside Home (premium-agreed-design). The Board's expand link lands there; the card's Overview lists the core documents (its Documents view),
|
|
114
114
|
and a draft opens a minimal reader in the Viewer (Waiting for design) with the Issue it bar, Read and Edit */
|
|
115
|
-
const ovOpen = async (p) => { await until(() => p.evaluate(() => !!document.querySelector('.hm-card [data-hm-ov]')), 60000); await p.click('.hm-card [data-hm-ov]');
|
|
115
|
+
const ovOpen = async (p) => { await until(() => p.evaluate(() => !!document.querySelector('.hm-card [data-hm-ov]')), 60000); await p.click('.hm-card [data-hm-ov]');
|
|
116
|
+
// the Overview opens on Tasks; the core documents are its Documents view (premium-uncovered-features, canvas InDocs)
|
|
117
|
+
if (await until(() => p.evaluate(() => !!document.querySelector('#czViewer [data-hi-view="docs"]')), 30000)) await p.click('#czViewer [data-hi-view="docs"]'); };
|
|
116
118
|
const I = await open('/premium-initiative.html' + iq), ip = I.page;
|
|
117
119
|
await ovOpen(ip);
|
|
118
120
|
await until(() => ip.evaluate((k) => !!document.querySelector(`#czViewer [data-ov-dread="${k}"]`), ikey), 60000);
|
|
119
121
|
await ip.click(`#czViewer [data-ov-dread="${ikey}"]`);
|
|
120
|
-
ok('I1 the reader of a draft has the Issue it bar above the text
|
|
122
|
+
ok('I1 the reader of a draft has the Issue it bar above the text', await until(() => ip.evaluate(() => { const o = document.querySelector('#czViewer:not([hidden])'); const b = o && o.querySelector('[data-issue-bar="draft"]'); const t = o && o.querySelector('.dsbody'); return !!b && !!t && /Nothing is sent/.test(b.textContent) && /Why this board exists/.test(t.textContent) && !!(b.compareDocumentPosition(t) & Node.DOCUMENT_POSITION_FOLLOWING); }), 30000));
|
|
121
123
|
ok('I1 no old dialog opens', await ip.evaluate(() => { const d = document.querySelector('#dlg'); return !d || !d.classList.contains('on'); }));
|
|
122
124
|
await ip.click('#czViewer [data-ds="edit"]');
|
|
123
125
|
await until(() => ip.evaluate(() => !!document.querySelector('#czViewer [data-ds-host] .cfb[contenteditable="true"]')), 30000);
|
|
@@ -145,7 +147,7 @@ const BODY = '## Purpose\n\nWhy this board exists.\n\n## Scope\n\nWhat it covers
|
|
|
145
147
|
await until(() => jp.evaluate(() => !!document.querySelector('#czViewer [data-ds="issue"]')));
|
|
146
148
|
await jp.click('#czViewer [data-ds="issue"]');
|
|
147
149
|
const issued = !!(await toastIs(jp, /Issued\. Nothing was sent to anyone/)) && await until(() => jp.evaluate(() => !!document.querySelector('#czViewer [data-issue-bar="done"]') && !document.querySelector('#czViewer [data-ds="issue"]')));
|
|
148
|
-
await sleep(1500); await jp
|
|
150
|
+
await sleep(1500); await ovOpen(jp);
|
|
149
151
|
ok('I4 Issue it works from the reader: the toast, the issued bar, and the Overview row reads Up to date', issued && await until(() => jp.evaluate((k) => /Up to date/.test((document.querySelector(`#czViewer [data-ov-doc="${k}"]`) || {}).textContent || ''), k3), 30000));
|
|
150
152
|
ok('I4 the file says state: issued and the ledger has its issue line', /^state: issued$/m.test(fs.readFileSync(path.join(team, d3.path), 'utf8')) && ledger().some((l) => l.ev === 'issue' && l.slot === d3.slot && l.scope === iscope));
|
|
151
153
|
await jp.screenshot({ path: path.join(R.base, 'ini-issued.png') });
|
|
@@ -170,8 +172,8 @@ const BODY = '## Purpose\n\nWhy this board exists.\n\n## Scope\n\nWhat it covers
|
|
|
170
172
|
const S = await open('/premium-board.html', { w, h, theme });
|
|
171
173
|
await until(() => S.page.evaluate(() => document.querySelectorAll('#ibBody .ini2').length > 0), 60000);
|
|
172
174
|
await S.page.click(w <= 720 ? '#chDocs' : '#tabDocs');
|
|
173
|
-
await until(() => S.page.evaluate((k) => !!document.querySelector(`#docBody [data-
|
|
174
|
-
await S.page.click(`#docBody [data-
|
|
175
|
+
await until(() => S.page.evaluate((k) => !!document.querySelector(`#docBody [data-opendoc="core:${k}"]`), k4), 60000);
|
|
176
|
+
await S.page.click(`#docBody [data-opendoc="core:${k4}"]`);
|
|
175
177
|
await until(() => S.page.evaluate(() => !!document.querySelector('#peek [data-act="issue"]')));
|
|
176
178
|
const f = await S.page.evaluate(() => ({ wide: document.documentElement.scrollWidth > innerWidth + 1, small: [...document.querySelectorAll('#peek [data-act="issue"]')].filter((b) => b.getBoundingClientRect().height < (innerWidth <= 720 ? 44 : 34)).map((b) => b.textContent) }));
|
|
177
179
|
ok(`F1 ${w} px ${theme}: no sideways scroll and the bar's button is 44 px on a phone`, !f.wide && !f.small.length, JSON.stringify(f));
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
* because they need a clock and a day of meetings. Done and Reopen press the real routes on real items.
|
|
7
7
|
* M the eight moments · O Open the meeting · D Done and Undo · X a refused press · E a read that fails · W desktop width and the POST allow-list · L floors
|
|
8
8
|
* premium-agreed-design: the Agreed design has no place for the card, so Home keeps it usable at the top of the phone's "N need you" sheet
|
|
9
|
-
* (home-phone-card.js)
|
|
9
|
+
* (home-phone-card.js); premium-uncovered-features made it the Today card at the top of the phone's list (canvas HmPhone, HmPhone2), with
|
|
10
|
+
* no "Waiting for design" marker and no sheet to open. Open the meeting opens it in the cozy Viewer from the
|
|
10
11
|
* day's own record (Home's meeting line does the same), so O2 now checks that it never falls back to the old dialog.
|
|
11
12
|
* Set PHONE_CARD_SHOTS=<dir> to save screenshots of each moment at 390 wide, light and dark. */
|
|
12
13
|
const fs = require('fs');
|
|
@@ -63,7 +64,7 @@ const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'applicati
|
|
|
63
64
|
return json(r, { ok: true, view: u.searchParams.get('view') || 'quarter', cells: [], gantt: [], no_plan: 0, strategy: [], today: DATE });
|
|
64
65
|
});
|
|
65
66
|
await p.goto(`${F.BASE}/premium.html?ws=${encodeURIComponent(ws)}`);
|
|
66
|
-
if (width < 641)
|
|
67
|
+
if (width < 641) await until(() => p.evaluate(() => !!document.querySelector('#hmList'))); // the card is the Today card at the top of the phone's list (canvas HmPhone)
|
|
67
68
|
p.__posts = posts; p.__gets = gets; p.__errs = errs; p.__ctx = ctx;
|
|
68
69
|
if (shotDir && name) p.__shot = async (suffix) => { await sleep(700); fs.mkdirSync(shotDir, { recursive: true }); await p.screenshot({ path: path.join(shotDir, `${name}-${suffix}.png`) }); };
|
|
69
70
|
return p;
|
|
@@ -161,7 +162,8 @@ const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'applicati
|
|
|
161
162
|
p = await scene({ time: at(18, 0), today: [A], width: 1280 });
|
|
162
163
|
await sleep(1500);
|
|
163
164
|
ok('W1 at 1280 wide the card is not shown', (await card(p)) === null);
|
|
164
|
-
|
|
165
|
+
// premium-uncovered-features: Home reads /api/phone-day once at every width for the end-of-day Today card (canvas HmDay); the phone card never reads it at 1280
|
|
166
|
+
ok('W2 at 1280 wide only Home\'s own read asks for phone-day, once', p.__gets.filter((g) => g === '/api/phone-day').length <= 1, p.__gets.join());
|
|
165
167
|
ok('W3 nothing is written on load', p.__posts.length === 0, JSON.stringify(p.__posts));
|
|
166
168
|
await p.__ctx.close();
|
|
167
169
|
|
|
@@ -5,8 +5,10 @@
|
|
|
5
5
|
* one report (one issued); /premium-viewer.html?open=report&path=... opens the cycle in the czViewer card, and the real page presses the real routes:
|
|
6
6
|
* O opening · B the bar · C the cycles · D the deck · G the page · K the Brief · N Present · W download · X print · E edit · I issued
|
|
7
7
|
* P the writes · F floors · S issue · A archive
|
|
8
|
-
*
|
|
9
|
-
*
|
|
8
|
+
* premium-uncovered-features (workstream reports) draws the parts the Agreed mockup left out: Report | Brief (RpBrief), the cycle menu in groups,
|
|
9
|
+
* the lock line and the ask card (RpStates), Document as paper pages (RpDoc), Live page (RpLive), Present and the phone (RpPhone):
|
|
10
|
+
* L the live page · Y Start the next cycle
|
|
11
|
+
* Set READ_SHOTS=<dir> to save screenshots at 1280 and 390 wide. */
|
|
10
12
|
const fs = require('fs');
|
|
11
13
|
const os = require('os');
|
|
12
14
|
const path = require('path');
|
|
@@ -81,8 +83,9 @@ const iss = issues.appendFromCli(dir, [{ ev: 'issued', cadence: CAD, slot: '2026
|
|
|
81
83
|
ok('O2 the card has no conversation, no tabs and no old reader', await p.evaluate(() => !document.querySelector('#dlg, .stream, #vTabs, #rdSlide, #rdIn')));
|
|
82
84
|
ok('O3 the header names the report, and the cycle chip says Draft and its date', await p.evaluate(() => document.querySelector('#czViewer .cz-vw-kind').textContent === 'Report' && document.querySelector('#czViewer .cz-vw-title').textContent === 'Partner review, 12 Oct') && /Draft · Oct 12/.test(await chipT()), await chipT());
|
|
83
85
|
await until(() => has('[data-r="sched"]'));
|
|
84
|
-
ok('B1 the
|
|
85
|
-
ok('B1
|
|
86
|
+
ok('B1 the tabs are Report and Brief (RpBrief), Report open', await p.evaluate(() => [...document.querySelectorAll('#czViewer .rp-tabs [role="tab"]')].map((b) => b.dataset.r + ':' + b.getAttribute('aria-selected')).join()) === 'tab|report:true,tab|brief:false');
|
|
87
|
+
ok('B1 the chips are the cycle and the schedule', await p.evaluate(() => [...document.querySelectorAll('#czViewer .vz-rpc > button')].map((b) => b.dataset.r).join()) === 'cycm,sched');
|
|
88
|
+
ok('B1 one toolbar: Slides | Document | Live page, Edit, Present, Share, Download, Issue and More', await tools() === 'view|deck,view|doc,view|live,edit,present,share,dlm,issue,more', await tools());
|
|
86
89
|
const bar = await p.evaluate(() => { const L = [...document.querySelectorAll('#czViewer .vz-tb > *')].filter((x) => x.offsetWidth && x.offsetHeight && !x.classList.contains('vz-sp')), c = L.map((x) => { const r = x.getBoundingClientRect(); return r.top + r.height / 2; }); return { spread: Math.round(Math.max(...c) - Math.min(...c)), unnamed: [...document.querySelectorAll('#czViewer .vz-tb .vz-ib')].filter((b) => !b.getAttribute('aria-label') || !b.title).length }; });
|
|
87
90
|
ok('B1 the bar is one row, and each icon button is named by its label and tooltip', bar.spread <= 6 && bar.unnamed === 0, JSON.stringify(bar));
|
|
88
91
|
await shot('reader-bar-1280');
|
|
@@ -90,7 +93,8 @@ const iss = issues.appendFromCli(dir, [{ ev: 'issued', cadence: CAD, slot: '2026
|
|
|
90
93
|
/* C: the cycle chip lists this report's cycles */
|
|
91
94
|
await tap('[data-r="cycm"]');
|
|
92
95
|
const cm = await p.evaluate(() => [...document.querySelectorAll('#czViewer [data-r^="cyc|"]')].map((b) => b.textContent));
|
|
93
|
-
|
|
96
|
+
const cg = await p.evaluate(() => [...document.querySelectorAll('#czViewer .vz-pop-cyc .vz-lab')].map((b) => b.textContent).join());
|
|
97
|
+
ok('C1 the cycle menu groups the cycles under Draft and Issued (RpStates), with no placeholder', cm.join('|') === 'Oct 12draft|Oct 5issued' && cg === 'Draft,Issued' && !(await has('[data-cz-placeholder]')), JSON.stringify(cm) + ' ' + cg);
|
|
94
98
|
await tap('[data-r="cycm"]');
|
|
95
99
|
|
|
96
100
|
/* D: the deck */
|
|
@@ -106,27 +110,50 @@ const iss = issues.appendFromCli(dir, [{ ev: 'issued', cadence: CAD, slot: '2026
|
|
|
106
110
|
ok('D5 a thumbnail goes to its slide', await counter() === '5 of 5' && await bigTitle() === 'Sources' && await p.evaluate(() => document.querySelector('#czViewer [data-r="next"]').disabled));
|
|
107
111
|
await shot('reader-deck-1280');
|
|
108
112
|
|
|
109
|
-
/* G: the
|
|
113
|
+
/* G: the document, as paper (RpDoc) */
|
|
110
114
|
await tap('[data-r="view|doc"]');
|
|
111
|
-
const heads = await p.evaluate(() => [...document.querySelectorAll('#czViewer .
|
|
112
|
-
ok('G1
|
|
115
|
+
const heads = await p.evaluate(() => [...document.querySelectorAll('#czViewer .rp-pg h2')].map((h) => h.textContent));
|
|
116
|
+
ok('G1 Document is paper: the title, the headline as In one minute, numbered sections as written', heads.join() === '1 · Initiatives,2 · Needs your call' && await p.evaluate(() => document.querySelector('#czViewer .rp-pg h1').textContent === 'Partner review, 12 Oct' && /33%/.test(document.querySelector('#czViewer .rp-minute').textContent)), heads.join());
|
|
117
|
+
ok('G2 the sources are the footnote line, the bar says Page 1 of 1 and Draft, and offers Download as PDF or Word', await p.evaluate(() => /krm-a/.test(document.querySelector('#czViewer .rp-fn').textContent) && /Page 1 of 1/.test(document.querySelector('#czViewer [data-rp-page]').textContent) && document.querySelector('#czViewer .rp-paperbar .rp-pill').textContent === 'Draft' && !!document.querySelector('#czViewer [data-r="dlm"]')));
|
|
118
|
+
await shot('reader-doc-1280');
|
|
119
|
+
await tap('[data-r="dlm"]');
|
|
120
|
+
ok('G3 Download offers PDF and Word, Word from report-export', await p.evaluate(() => { const a = document.querySelector('#czViewer .vz-pop-dl [data-r="dl|docx"]'); return !!document.querySelector('#czViewer .vz-pop-dl [data-r="pdf"]') && a && /fmt=docx/.test(a.getAttribute('href')); }));
|
|
121
|
+
await tap('[data-r="dlm"]');
|
|
122
|
+
|
|
123
|
+
/* L: the live page (RpLive): the numbers Insights reads */
|
|
124
|
+
await tap('[data-r="view|live"]');
|
|
125
|
+
await until(() => has('.rp-live .rp-kps, .rp-live .rp-empty'));
|
|
126
|
+
const lv = await p.evaluate(() => ({ tiles: [...document.querySelectorAll('#czViewer .rp-kp > span:first-child')].map((x) => x.textContent), first: (document.querySelector('#czViewer .rp-kp b') || {}).textContent, pts: document.querySelectorAll('#czViewer .rp-pt').length }));
|
|
127
|
+
ok('L1 Live page: the goal tile with its latest reading, then Goals on track, Shipped and At risk', lv.tiles.join() === 'Partner activation,Goals on track,Shipped,At risk' && lv.first === '33%', JSON.stringify(lv));
|
|
128
|
+
await tap('[data-r="lv|range|q"]');
|
|
129
|
+
ok('L2 the range Q draws the three readings, and a point names its value', await p.evaluate(() => document.querySelectorAll('#czViewer .rp-pt').length === 3) && await p.evaluate(() => /33%/.test(document.querySelectorAll('#czViewer .rp-pt')[2].getAttribute('aria-label'))));
|
|
130
|
+
await tap('[data-r="lv|pt|2"]');
|
|
131
|
+
ok('L3 pressing a point opens its popover with Open in Insights', await p.evaluate(() => /1 Oct · 33%/.test((document.querySelector('#czViewer .rp-pop') || {}).textContent || '')));
|
|
132
|
+
await shot('reader-live-1280');
|
|
113
133
|
await tap('[data-r="view|deck"]');
|
|
114
134
|
|
|
115
135
|
/* B2 the schedule; K the Brief */
|
|
116
136
|
await tap('[data-r="sched"]');
|
|
117
137
|
ok('B2 a report with no template says Not scheduled; its popover offers the cadences, the weekdays and the time, and says a template is saved', /Not scheduled/.test(await p.textContent(V + '[data-r="sched"]')) && await p.evaluate(() => document.querySelectorAll('#czViewer [data-r^="scad|"]').length === 4 && document.querySelectorAll('#czViewer [data-r^="sday|"]').length === 5 && !!document.querySelector('#czViewer [data-r="stime"]')) && /saves its sections and look as a template/.test(await p.textContent(V + '.vz-pop')));
|
|
118
138
|
await tap('[data-r="pop|"]');
|
|
119
|
-
await tap('[data-r="brief"]');
|
|
120
|
-
|
|
121
|
-
await
|
|
139
|
+
await tap('[data-r="tab|brief"]');
|
|
140
|
+
await until(() => has('.rp-brief'));
|
|
141
|
+
const bf = await p.evaluate(() => ({ dt: [...document.querySelectorAll('#czViewer .rp-kv dt')].map((x) => x.textContent).join(), chips: [...document.querySelectorAll('#czViewer .rp-kv .rp-chip')].map((x) => x.textContent).join(), lbl: [...document.querySelectorAll('#czViewer .rp-brief .rp-lbl')].map((x) => x.textContent).join(), text: document.querySelector('#czViewer .rp-brief').textContent, tb: !!document.querySelector('#czViewer .vz-tb') }));
|
|
142
|
+
ok('K1 Brief (RpBrief): At a glance For, Read by, Goes out, Built from (the sources the report names), Please confirm, Why it looks like this', bf.dt === 'For,Read by,Goes out,Built from' && bf.chips === 'KR metric record krm-a' && bf.lbl === 'At a glance,Please confirm,Why it looks like this' && !bf.tb, JSON.stringify(bf));
|
|
143
|
+
ok('K2 every check passed, so nothing waits; no look is saved, so it says the standard look; no placeholder', /Nothing to confirm/.test(bf.text) && /standard PMOS look/.test(bf.text) && !(await has('[data-cz-placeholder]')));
|
|
144
|
+
await shot('reader-brief-1280');
|
|
145
|
+
await tap('[data-r="tab|report"]');
|
|
122
146
|
|
|
123
147
|
/* N: Present */
|
|
124
148
|
await tap('[data-r="go|0"]');
|
|
125
149
|
await tap('[data-r="present"]');
|
|
126
150
|
await until(() => p.$('#vzPres'));
|
|
127
|
-
ok('N1 Present shows the current slide over the whole page,
|
|
151
|
+
ok('N1 Present shows the current slide over the whole page, its numbered strip, Stop presenting and the key hint', await p.evaluate(() => { const e = document.querySelector('#vzPres'), r = e.getBoundingClientRect(); return r.width >= innerWidth - 1 && r.height >= innerHeight - 1 && !!e.querySelector('.vz-title') && e.querySelectorAll('.rp-tb').length === 5 && !!e.querySelector('[data-r="end"]') && /B to blank/.test(e.textContent) && !e.querySelector('[data-cz-placeholder]'); }));
|
|
152
|
+
await shot('reader-present-1280');
|
|
128
153
|
await p.keyboard.press('ArrowRight');
|
|
129
|
-
ok('N2 the arrow keys move while presenting', await until(() => p.evaluate(() => /^2 of 5$/.test(document.querySelector('#vzPres .
|
|
154
|
+
ok('N2 the arrow keys move while presenting', await until(() => p.evaluate(() => /^Slide 2 of 5$/.test(document.querySelector('#vzPres .rp-prh [aria-live]').textContent))));
|
|
155
|
+
await p.keyboard.press('b');
|
|
156
|
+
ok('N2 B blanks the screen, and B again shows the slide', await until(() => p.evaluate(() => !!document.querySelector('#vzPres .rp-blank'))) && (await p.keyboard.press('b'), await until(() => p.evaluate(() => !document.querySelector('#vzPres .rp-blank')))));
|
|
130
157
|
await p.keyboard.press('Escape');
|
|
131
158
|
ok('N3 Escape stops presenting and the card stays open on that slide', await until(() => p.evaluate(() => !document.querySelector('#vzPres'))) && await counter() === '2 of 5');
|
|
132
159
|
|
|
@@ -155,14 +182,14 @@ const iss = issues.appendFromCli(dir, [{ ev: 'issued', cadence: CAD, slot: '2026
|
|
|
155
182
|
ok('E1 Edit on Page mounts the page editor in the card, marked Waiting for design', await until(() => p.evaluate(() => { const h = document.querySelector('#czViewer [data-vz-ed]'); return h && h.dataset.mounted && h.children.length > 0 && !!document.querySelector('#czViewer [data-cz-placeholder="Page editor"]'); }), 15000));
|
|
156
183
|
ok('E2 while editing the cycle chip says Editing the Oct 12 draft, and the bar keeps Slides | Page and Cancel', /Editing the Oct 12 draft/.test(await chipT()) && await tools() === 'view|deck,view|doc,edcancel', await tools());
|
|
157
184
|
await tap('[data-r="edcancel"]');
|
|
158
|
-
ok('E3 Cancel brings the report back', await until(() => p.evaluate(() => !!document.querySelector('#czViewer .
|
|
185
|
+
ok('E3 Cancel brings the report back', await until(() => p.evaluate(() => !!document.querySelector('#czViewer .rp-pg') && !document.querySelector('#czViewer [data-vz-ed]'))));
|
|
159
186
|
await tap('[data-r="view|deck"]');
|
|
160
187
|
|
|
161
188
|
/* I: an issued cycle is frozen; the cycle chip opens it */
|
|
162
189
|
await tap('[data-r="cycm"]');
|
|
163
190
|
await tap(`[data-r="cyc|${pOld}"]`);
|
|
164
191
|
await until(async () => /Issued · Oct 5/.test(await chipT()) && !!(await p.$(V + '.vz-slide')));
|
|
165
|
-
ok('I1 the cycle menu opens the issued cycle: no Edit and no Issue,
|
|
192
|
+
ok('I1 the cycle menu opens the issued cycle: no Edit and no Issue, and the lock line with Start the next cycle (RpStates)', !(await has('[data-r="edit"]')) && !(await has('[data-r="issue"]')) && /Issued, so it stays as sent/.test(await p.evaluate(() => (document.querySelector('#czViewer .rp-lock') || {}).textContent || '')) && await has('.rp-lock [data-r="nextcyc"]'), await chipT());
|
|
166
193
|
ok('I2 an issued cycle still reads as a deck', await counter() === '1 of 3', await counter());
|
|
167
194
|
|
|
168
195
|
/* P: the writes */
|
|
@@ -175,8 +202,9 @@ const iss = issues.appendFromCli(dir, [{ ev: 'issued', cadence: CAD, slot: '2026
|
|
|
175
202
|
await until(() => p.evaluate(() => !document.querySelectorAll('#czViewer .vz-tb .vz-dko')[0].getClientRects().length));
|
|
176
203
|
const fl = await p.evaluate(() => ({ over: document.documentElement.scrollWidth - innerWidth, desk: [...document.querySelectorAll('#czViewer .vz-tb .vz-dko')].filter((b) => b.getClientRects().length).length, shown: [...document.querySelectorAll('#czViewer .vz-tb > button, #czViewer .vz-tb .vz-sg button')].filter((b) => b.getClientRects().length).map((b) => b.dataset.r).join() }));
|
|
177
204
|
ok('F1 at 390 px: no sideways scroll; the bar keeps Slides | Page, Issue and More', fl.over <= 0 && fl.desk === 0 && fl.shown === 'view|deck,view|doc,issue,more', JSON.stringify(fl));
|
|
205
|
+
ok('F1 at 390 px (RpPhone): Report | Brief, "Slide 1 of 5 · swipe for the next", no thumbnails, and a full-width Present', await p.evaluate(() => { const v = (s) => { const e = document.querySelector('#czViewer ' + s); return !!e && e.getClientRects().length > 0; }; const pr = document.querySelector('#czViewer .rp-present'); return v('.rp-tabs') && /Slide 1 of 5 · swipe for the next/.test(document.querySelector('#czViewer .rp-swipe').textContent) && v('.rp-swipe') && !v('.vz-thumbs') && pr && pr.getBoundingClientRect().width > 300; }));
|
|
178
206
|
await tap('[data-r="more"]');
|
|
179
|
-
ok('F2 at 390 px More also holds Edit, Present
|
|
207
|
+
ok('F2 at 390 px More also holds Edit, Present and Share', await p.evaluate(() => ['edit', 'present', 'share'].every((k) => { const b = document.querySelector('#czViewer .vz-pop .vz-pho [data-r="' + k + '"]'); return b && b.getClientRects().length; })));
|
|
180
208
|
await tap('[data-r="more"]');
|
|
181
209
|
await shot('reader-deck-390');
|
|
182
210
|
await p.setViewportSize({ width: 1280, height: 900 });
|
|
@@ -194,11 +222,20 @@ const iss = issues.appendFromCli(dir, [{ ev: 'issued', cadence: CAD, slot: '2026
|
|
|
194
222
|
/* A: an issued cycle archives from More, after one confirm, and comes back */
|
|
195
223
|
const b2 = posts.length;
|
|
196
224
|
await tap('[data-r="more"]'); await tap('[data-r="archive"]');
|
|
197
|
-
ok('A1 Archive first asks
|
|
225
|
+
ok('A1 Archive first asks in the card at the foot (RpStates), and posts nothing', await until(() => p.evaluate(() => /^Archive Oct 12\?/.test((document.querySelector('#czViewer .rp-ask[role="alertdialog"]') || {}).textContent || ''))) && posts.length === b2);
|
|
226
|
+
await shot('reader-archive-ask-1280');
|
|
198
227
|
await tap('[data-r="askok"]');
|
|
199
228
|
ok('A2 Archive posts the archive route and the chip says Archived', await until(async () => /Archived · Oct 12/.test(await chipT()), 8000) && posts.slice(b2).join() === '/api/report-documents/archive', posts.slice(b2).join());
|
|
200
|
-
await tap('[data-r="
|
|
229
|
+
await tap('[data-r="cycm"]');
|
|
230
|
+
ok('A3 the cycle menu lists it under Archived with Bring back', await p.evaluate(() => [...document.querySelectorAll('#czViewer .vz-pop-cyc .vz-lab')].map((b) => b.textContent).join() === 'Issued,Archived' && !!document.querySelector('#czViewer .vz-pop-cyc [data-r^="unarch|"]')));
|
|
231
|
+
await tap('[data-r^="unarch|"]');
|
|
201
232
|
ok('A3 Bring back undoes it', await until(async () => /Issued · Oct 12/.test(await chipT()), 8000));
|
|
233
|
+
|
|
234
|
+
/* Y: Start the next cycle drafts a new cycle of the same report and opens it */
|
|
235
|
+
const b3 = posts.length;
|
|
236
|
+
await tap('[data-r="nextcyc"]');
|
|
237
|
+
/* the scratch repository holds no initiative records, so the drafter refuses: the panel says why and stays on the issued cycle */
|
|
238
|
+
ok('Y1 Start the next cycle posts the report route once; when the drafter refuses, the panel says why', await until(() => p.evaluate(() => /The next cycle was not started: .*initiative records/.test((document.querySelector('#czViewer .vz-msg') || {}).textContent || '')), 15000) && posts.slice(b3).join() === '/api/report/draft' && /Issued · Oct 12/.test(await chipT()), posts.slice(b3).join() + ' ' + await chipT() + ' ' + await p.evaluate(() => (document.querySelector('#czViewer .vz-msg') || {}).textContent || ''));
|
|
202
239
|
ok('F3 no page error', errs.length === 0, errs.join(' | '));
|
|
203
240
|
return finish();
|
|
204
241
|
})().catch((e) => { console.error(e); finish(1); });
|