create-pmos 0.692.0 → 0.694.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 +22 -16
- 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/adler-moments-test.js +3 -35
- package/workspace/adler-seasons-test.js +1 -1
- package/workspace/briefing-premium-adddoc-test.js +1 -1
- package/workspace/briefing-premium-board-test.js +1 -1
- package/workspace/briefing-premium-doc-edit-test.js +1 -1
- package/workspace/briefing-premium-work-test.js +2 -2
- package/workspace/changelog.json +21 -2
- package/workspace/chat-asks-test.js +1 -1
- package/workspace/core-docs-workflow-test.js +1 -1
- package/workspace/ev-everywhere-test.js +3 -14
- package/workspace/guide/home.md +2 -2
- package/workspace/guide/layout.md +2 -2
- package/workspace/guide/settings-and-switches.md +0 -1
- package/workspace/impact-screens-test.js +2 -47
- package/workspace/ini-workflow-test.js +1 -1
- package/workspace/lib/board-grill.js +17 -24
- package/workspace/lib/discovery-questions.js +36 -0
- package/workspace/lib/routes-board-grill.js +31 -3
- package/workspace/live-pill-round-test.js +6 -18
- package/workspace/milestone-suggest-test.js +4 -28
- package/workspace/news-viewers-test.js +3 -29
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-board-actions-test.js +3 -3
- package/workspace/premium-briefing-depth-test.js +4 -4
- package/workspace/premium-chat-attach-test.js +3 -2
- package/workspace/premium-chat-chart-tab-test.js +8 -7
- package/workspace/premium-chat-context-test.js +3 -1
- package/workspace/premium-chat-goal-view-test.js +3 -1
- package/workspace/premium-chat-line-test.js +8 -6
- package/workspace/premium-chat-report-tab-test.js +13 -5
- package/workspace/premium-chat-term-test.js +2 -2
- package/workspace/premium-chat-viewer-test.js +10 -16
- package/workspace/premium-core-doc-issue-test.js +7 -2
- package/workspace/premium-discuss-landing-test.js +9 -5
- package/workspace/premium-html-viewer-test.js +7 -3
- package/workspace/premium-link-suggest-test.js +6 -10
- package/workspace/premium-phone-card-test.js +2 -2
- package/workspace/premium-viewer-download-test.js +1 -1
- package/workspace/premium-viewer-flicker-test.js +1 -1
- package/workspace/premium-viewer-share-test.js +2 -2
- package/workspace/premium-viewer-test.js +1 -1
- package/workspace/premium-vw-cal-test.js +1 -1
- package/workspace/premium-vw-copy-test.js +3 -3
- package/workspace/premium-vw-doc-test.js +1 -1
- package/workspace/premium-vw-item-test.js +1 -1
- package/workspace/premium-work-depth-test.js +2 -2
- package/workspace/program-charter-test.js +1 -12
- package/workspace/program-leave-test.js +2 -2
- package/workspace/program-order-test.js +3 -65
- package/workspace/project-onboard-flow-test.js +5 -5
- package/workspace/public/pm/bd-asks.js +6 -5
- package/workspace/public/pm/cozy-home.css +0 -6
- package/workspace/public/pm/cozy-panels.js +2 -6
- package/workspace/public/pm/cozy-popup.css +1 -0
- package/workspace/public/pm/cozy-popup.js +15 -2
- package/workspace/public/pm/cozy-today-page.css +1 -1
- package/workspace/public/pm/cozy-today.css +0 -14
- package/workspace/public/pm/cozy-viewer.js +14 -38
- package/workspace/public/pm/goal-chat.js +2 -2
- package/workspace/public/pm/home-app.js +8 -67
- package/workspace/public/pm/home-chat.js +1 -1
- package/workspace/public/pm/home-ses-name.js +3 -2
- package/workspace/public/pm/home-today.js +4 -18
- package/workspace/public/pm/ini-view-model.js +2 -2
- package/workspace/public/pm/premium-board.js +1 -1
- package/workspace/public/premium-intelligence.html +1 -1
- package/workspace/public/premium-viewer.html +1 -1
- package/workspace/public/premium-workflows.html +1 -1
- package/workspace/ready-dash-ui-test.js +1 -1
- package/workspace/rename-test.js +2 -2
- package/workspace/server.js +11 -12
- package/workspace/session-names-test.js +34 -56
- package/workspace/sort-order-test.js +2 -71
- package/workspace/split-merge-ui-test.js +1 -1
- package/workspace/stage-card-tasks-test.js +1 -1
- package/workspace/stage-card-test.js +1 -1
- package/workspace/task-card-test.js +1 -1
- package/workspace/task-press-test.js +1 -1
- package/workspace/task-views-test.js +1 -1
- package/workspace/test-lists/adler-seasons-art.json +3 -6
- package/workspace/test-lists/batch18-asks.json +1 -1
- package/workspace/test-lists/briefing-premium.json +1 -11
- package/workspace/test-lists/discovery-three-questions.json +5 -0
- package/workspace/test-lists/premium-agreed-viewer.json +1 -1
- package/workspace/test-run.js +0 -2
- package/workspace/test-timings.json +0 -4
- package/workspace/tk-tasks-test.js +3 -17
- package/workspace/viewer-trail-test.js +2 -2
- package/workspace/workflows-setup-test.js +4 -2
- package/workspace/adler-seasons-art-test.js +0 -116
- package/workspace/briefing-premium-initiative-test.js +0 -289
- package/workspace/briefing-premium-products-test.js +0 -209
- package/workspace/briefing-premium-sources-test.js +0 -250
- package/workspace/briefing-premium-test.js +0 -282
- package/workspace/home-other-product-test.js +0 -197
- package/workspace/home-pill-test.js +0 -138
- package/workspace/home-railcard-test.js +0 -196
- package/workspace/home-rows-test.js +0 -389
- package/workspace/panels-test.js +0 -454
- package/workspace/public/premium.html +0 -48
- package/workspace/test-lists/batch18-panels.json +0 -9
- package/workspace/test-lists/home-railcard.json +0 -9
- package/workspace/test-lists/home-sessions-pill.json +0 -6
- package/workspace/test-lists/viewer-home-rows.json +0 -9
|
@@ -5,15 +5,40 @@
|
|
|
5
5
|
* GET /api/board-grill?ws=<id>&ids=<id,id,…> → { ok, items: { [id]: summary } } only the initiatives with a line in the file
|
|
6
6
|
* POST /api/board-grill/start { ws, id, why?, links?: [{ url, label? }] } the New initiative panel's Why and links
|
|
7
7
|
* POST /api/board-grill/file { ws, id, name, type?, data } one file (base64, at most 4 MB) kept under <state>/material/<id>/
|
|
8
|
-
* POST /api/board-grill/answer { ws, id, q, answer } one answer; an empty answer clears it
|
|
8
|
+
* POST /api/board-grill/answer { ws, id, q, answer } one answer; an empty answer clears it. The answer also
|
|
9
|
+
* becomes the Experiment's evidence or kill condition
|
|
10
|
+
* (lib/discovery-questions.js): the line the earlier answer
|
|
11
|
+
* wrote is undone, the new one is set as the PM's, and a
|
|
12
|
+
* kill condition is mirrored onto the record's `kill:` line
|
|
9
13
|
* POST /api/board-grill/later { ws, id } keep the open questions as the next step
|
|
10
14
|
* lib/board-grill.js holds the rules. FILE MODE ONLY: <state>/triage-answers.jsonl, append-only. Every POST is a page press
|
|
11
|
-
* (pm-guard requirePagePress). Nothing is sent anywhere. */
|
|
15
|
+
* (pm-guard requirePagePress). Nothing is sent anywhere. The answer route also writes the repository's artefact ledger and the record. */
|
|
12
16
|
const fs = require('fs');
|
|
13
17
|
const path = require('path');
|
|
14
18
|
const guard = require('./pm-guard.js');
|
|
15
19
|
const pmItems = require('./pm-items.js');
|
|
16
20
|
const G = require('./board-grill.js');
|
|
21
|
+
const DQ = require('./discovery-questions.js');
|
|
22
|
+
const A = require('./artefacts.js');
|
|
23
|
+
|
|
24
|
+
/** An answer into the Experiment artefact: undo the line the earlier answer to the same question wrote, then set the new one (none for
|
|
25
|
+
* "Not sure yet" or an empty answer). → { ref, error? }. Never throws: the answer is kept in triage-answers.jsonl either way. */
|
|
26
|
+
function toArtefact(root, id, q, answer, prevRef, actor) {
|
|
27
|
+
let f;
|
|
28
|
+
try { f = A.file(A.dirOf(root)); } catch (e) { return { ref: null, error: String((e && e.message) || e) }; }
|
|
29
|
+
const mirror = require('./artefact-mirror.js');
|
|
30
|
+
if (prevRef) {
|
|
31
|
+
const u = A.undo(f, { ref: prevRef }, actor);
|
|
32
|
+
if (u.ok) mirror.after(root, u.line, f);
|
|
33
|
+
}
|
|
34
|
+
const want = DQ.lineOf(q, answer);
|
|
35
|
+
if (!want) return { ref: null };
|
|
36
|
+
const r = A.set(f, { scope: 'experiment:' + id, ...want }, actor);
|
|
37
|
+
if (!r.ok) { console.warn(`${DQ.TAG} ${id} ${q}: the answer was kept, but not as ${want.field}: ${r.error}`); return { ref: null, error: r.error }; }
|
|
38
|
+
mirror.after(root, r.line, f);
|
|
39
|
+
console.log(`${DQ.TAG} ${id} ${q} → experiment.${want.field}`);
|
|
40
|
+
return { ref: r.line.id };
|
|
41
|
+
}
|
|
17
42
|
|
|
18
43
|
const ID_RE = /^[a-z0-9][\w.-]{0,80}$/i;
|
|
19
44
|
const MAX_FILE = 4 * 1024 * 1024;
|
|
@@ -80,7 +105,10 @@ module.exports = {
|
|
|
80
105
|
pmItems.appendEvent(f, { kind: 'file', initiative: b.id, name, type: str(b.type, 80), size: buf.length, path: path.relative(w.root, path.join(dir, name)).split(path.sep).join('/') }, now);
|
|
81
106
|
} else if (p === '/api/board-grill/answer') {
|
|
82
107
|
if (!G.QUESTIONS.some((x) => x.key === b.q)) return bad('q must name a question');
|
|
83
|
-
|
|
108
|
+
const answer = str(b.answer, 500), prev = G.fold(read(f), b.id);
|
|
109
|
+
const a = prev.answers[b.q] === answer && (prev.refs[b.q] || !DQ.lineOf(b.q, answer)) ? { ref: prev.refs[b.q] || null } // the same answer again writes no new line
|
|
110
|
+
: toArtefact(w.root, b.id, b.q, answer, prev.refs[b.q], g.actor);
|
|
111
|
+
pmItems.appendEvent(f, { kind: 'answer', initiative: b.id, q: b.q, answer, ...(a.ref ? { ref: a.ref } : {}) }, now);
|
|
84
112
|
} else if (p === '/api/board-grill/later') {
|
|
85
113
|
pmItems.appendEvent(f, { kind: 'later', initiative: b.id }, now);
|
|
86
114
|
} else return bad('no such route', 404);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
|
-
/* live-pill-round-test.js — the Live pill as a round number
|
|
3
|
+
/* live-pill-round-test.js — the Live pill as a round number and the panel divider's look (feedback batch 18 item 15,
|
|
4
4
|
* slice 15-B; canvas TbT1Split, TbT4Off, TbT9Divider; brief next18/briefs/15-arrange-panels-build.md rules 9 to 11). The real pages from the
|
|
5
5
|
* real server; GET /api/live is answered by the suite, so the pill's state is the suite's.
|
|
6
6
|
* L1 nothing live: no pill · L2 the pill is a 44 px round button stacked above the menu button, with the number of live items and no marks
|
|
7
7
|
* L3 Claude asks: blue with a glow · L4 with the panels engine a press goes to czPanels.slideOver(item) · L6 false from it: today's open
|
|
8
8
|
* L5 the open menu hides the pill · V1 the first divider wears the sprout, the others only the handle · V2 the day's charm replaces the
|
|
9
|
-
* sprout, fitted to its box · V3 Settings > Adler > Off: the handle only
|
|
10
|
-
* F2 a phone: no
|
|
9
|
+
* sprout, fitted to its box · V3 Settings > Adler > Off: the handle only
|
|
10
|
+
* F2 a phone: no round pill, Live now in the ⋯ menu · every page: no page error (Home's list fold went with Home's page, home-desk-layout-delete)
|
|
11
11
|
* PMOS_SHOTS=<dir> also saves the screenshots. */
|
|
12
12
|
const path = require('path');
|
|
13
13
|
const { classicBoard } = require('./lib/classic-board'); // these checks are about the four Board views, not Work (work-one-view)
|
|
@@ -75,7 +75,7 @@ const ASKS = () => RUNNING().concat([{ id: 'b', name: 'Redistribute plan items',
|
|
|
75
75
|
}));
|
|
76
76
|
ok('L2 the pill shows the number of live items and no marks', l2 && l2.text === '2' && l2.marks === 0 && !l2.asks, JSON.stringify(l2));
|
|
77
77
|
// with the popup's chat (cozy-popup.js sets window.czOpenChat) the rail's chat icon holds the sessions, so the round button gives way
|
|
78
|
-
// (cozy-ev.css cz-chatpop); it comes back only while a panel is put away (panels
|
|
78
|
+
// (cozy-ev.css cz-chatpop); it comes back only while a panel is put away (cozy-panels.js)
|
|
79
79
|
ok('L2 beside the rail\'s chat icon it gives way to the popup\'s chat; without it, a 44 px round button stacked above the chat icon on its centre line', l2 && (l2.chatpop ? l2.w === 0 && l2.h === 0 : l2.w === 44 && l2.h === 44 && l2.round === '50%' && l2.above && l2.centred), JSON.stringify(l2));
|
|
80
80
|
ok('L2 its name still says what it holds and its key', l2 && /^What you work on now: 2 running\. Open \(Ctrl J\)$/.test(l2.label), l2 && l2.label);
|
|
81
81
|
await shot(page, 'pill-running');
|
|
@@ -150,18 +150,9 @@ const ASKS = () => RUNNING().concat([{ id: 'b', name: 'Redistribute plan items',
|
|
|
150
150
|
await page.evaluate(() => { window.czPanels = { slideOver: () => false, list: () => [] }; });
|
|
151
151
|
if (l2 && l2.chatpop) await page.keyboard.press('Control+j'); else await page.click('#czLive');
|
|
152
152
|
await until(() => page.$('#czLiveList a[data-lv="s:b"]'));
|
|
153
|
-
await Promise.all([page.waitForURL(/
|
|
154
|
-
ok('L6 czPanels.slideOver(item) gives false (it did nothing): the row opens as today', /
|
|
153
|
+
await Promise.all([page.waitForURL(/today\.html\?session=b/, { timeout: 15000 }).catch(() => null), page.click('#czLiveList a[data-lv="s:b"]')]);
|
|
154
|
+
ok('L6 czPanels.slideOver(item) gives false (it did nothing): the row opens as today (Today, home-page-retire)', /today\.html\?session=b/.test(page.url()), page.url());
|
|
155
155
|
|
|
156
|
-
/* F1 */
|
|
157
|
-
await page.goto(BASE + '/premium.html');
|
|
158
|
-
const f1 = await until(() => page.evaluate(() => { const b = document.querySelector('#hmList .hm-hd [data-hm-fold]'); return b ? { label: b.getAttribute('aria-label'), title: b.title, text: b.textContent.trim(), svg: !!b.querySelector('svg') } : null; }), 30000);
|
|
159
|
-
ok('F1 the list head has an icon-only fold, named and with a tooltip', f1 && f1.label === 'Fold the list to the rail' && f1.title === f1.label && !f1.text && f1.svg, JSON.stringify(f1));
|
|
160
|
-
await shot(page, 'home-fold');
|
|
161
|
-
await page.click('#hmList .hm-hd [data-hm-fold]');
|
|
162
|
-
ok('F1 with no Viewer open, the press folds the list away', await until(() => page.evaluate(() => document.body.classList.contains('hm-folded') && getComputedStyle(document.querySelector('#hmList')).display === 'none')));
|
|
163
|
-
await page.click('#hmUnfold');
|
|
164
|
-
ok('F1 the button at the top left brings it back', await until(() => page.evaluate(() => !document.body.classList.contains('hm-folded') && !!document.querySelector('#hmList .hm-hd [data-hm-fold]'))));
|
|
165
156
|
ok('every page: no page error', errors.length === 0, errors.join(' | '));
|
|
166
157
|
|
|
167
158
|
/* F2 */
|
|
@@ -177,9 +168,6 @@ const ASKS = () => RUNNING().concat([{ id: 'b', name: 'Redistribute plan items',
|
|
|
177
168
|
ok('F2 a phone: the ⋯ menu says Live now 3', lv === 'Live now3' || /Live now\s*3/.test(lv || ''), JSON.stringify(lv));
|
|
178
169
|
await ph.click('#czFab');
|
|
179
170
|
await shot(ph, 'phone-pill');
|
|
180
|
-
await ph.goto(BASE + '/premium.html');
|
|
181
|
-
await until(() => ph.evaluate(() => !!document.querySelector('#hmList .hm-hd')), 30000);
|
|
182
|
-
ok('F2 a phone has no rail, so no fold', await ph.evaluate(() => !document.querySelector('[data-hm-fold]')));
|
|
183
171
|
await pctx.close();
|
|
184
172
|
await finish();
|
|
185
173
|
})();
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
|
-
/* milestone-suggest-test.js — Claude's milestone suggestions on the program panel
|
|
4
|
-
* canvas XmsgB, sticky xmsgRules). Serves the real Board
|
|
3
|
+
/* milestone-suggest-test.js — Claude's milestone suggestions on the program panel and the charter (feedback batch 4 item 6, option B;
|
|
4
|
+
* canvas XmsgB, sticky xmsgRules). Serves the real Board page from the real server; Project Ascent comes from fixtures/program-ascent.js
|
|
5
5
|
* with a `review` added the way GET /api/programs answers it, and the program writes are captured, not written.
|
|
6
6
|
* F a program with no milestones: Claude's first suggestions take the place of "Add the first milestone", each with why and its source; ✓ ✎ ✕
|
|
7
7
|
* are icon-only; keep all · W later changes lead Waits on you; ✓ keeps, ✕ drops · C the pencil opens the charter with the change filled in;
|
|
8
8
|
* Save writes it and answers the suggestion; last checked and Check now · Z nothing to suggest, nothing shows · K the ◆ dates are reported once
|
|
9
|
-
* · M Home's program card
|
|
9
|
+
* · H on a phone (M, Home's program card, went with Home's list: home-desk-layout-delete). PMOS_SHOTS=<dir> also saves the screenshots the frames are compared with. */
|
|
10
10
|
const path = require('path');
|
|
11
11
|
const { besidePage } = require('./lib/beside-page'); // these checks read the full page beside the page; in the popup work shows its three parts (nav slice 3)
|
|
12
12
|
const { classicBoard } = require('./lib/classic-board'); // these checks are about the four Board views, not Work (work-one-view)
|
|
@@ -61,7 +61,7 @@ const withReview = (open, o = {}) => F.programs().map((p) => ({ ...p, ...(o.empt
|
|
|
61
61
|
if (SHOTS) fs.mkdirSync(SHOTS, { recursive: true });
|
|
62
62
|
const shot = async (p, name) => { if (SHOTS) await p.screenshot({ path: path.join(SHOTS, name + '.png') }); };
|
|
63
63
|
|
|
64
|
-
const open = async ({ w = 1440, h = 900, programs = withReview(CHANGES), dark = false
|
|
64
|
+
const open = async ({ w = 1440, h = 900, programs = withReview(CHANGES), dark = false } = {}) => {
|
|
65
65
|
const c = await browser.newContext({ viewport: { width: w, height: h }, colorScheme: dark ? 'dark' : 'light' });
|
|
66
66
|
const page = await c.newPage();
|
|
67
67
|
const errors = [], posts = [];
|
|
@@ -74,7 +74,6 @@ const withReview = (open, o = {}) => F.programs().map((p) => ({ ...p, ...(o.empt
|
|
|
74
74
|
await page.route('**/api/boards/items*', (r) => json(r, { ok: true, items: A.ITEMS[wsOf(r)] || [] }));
|
|
75
75
|
await page.route('**/api/programs/*', (r) => { const rq = r.request(); posts.push({ path: new URL(rq.url()).pathname, body: JSON.parse(rq.postData() || '{}') }); r.fulfill({ contentType: 'application/json', body: '{"ok":true}' }); });
|
|
76
76
|
await page.route('**/api/board-trail*', (r) => r.fulfill({ status: 500, contentType: 'application/json', body: '{"ok":false,"error":"not in this check"}' }));
|
|
77
|
-
if (home) { await page.goto(BASE + '/premium.html?ws=idpf'); return { page, ctx: c, errors, posts }; }
|
|
78
77
|
await page.goto(BASE + '/premium-board.html?ws=idpf&program=' + programs[0].id);
|
|
79
78
|
await until(() => page.evaluate(() => { const v = document.querySelector('#czViewer'); return !!v && !v.hidden && !!v.querySelector('.pp-vw .pv'); }));
|
|
80
79
|
await until(() => page.evaluate(() => !/reading its board/.test((document.querySelector('#czViewer [data-czs-id="tree"]') || {}).textContent || '')), 6000);
|
|
@@ -146,25 +145,6 @@ const withReview = (open, o = {}) => F.programs().map((p) => ({ ...p, ...(o.empt
|
|
|
146
145
|
ok('Z nothing to suggest: no suggestion row anywhere on the panel', await Z.page.evaluate(() => !document.querySelector('#czViewer .msg-r, #czViewer .msg-box')));
|
|
147
146
|
await Z.ctx.close();
|
|
148
147
|
|
|
149
|
-
/* ── M: Home's Your move ── */
|
|
150
|
-
const M = await open({ home: true });
|
|
151
|
-
// the program's milestone changes lead its card on Home (batch 14 item 4)
|
|
152
|
-
await until(() => M.page.evaluate(() => !!document.querySelector('[data-hm-prog]')), 10000);
|
|
153
|
-
const hm = await until(() => M.page.evaluate(() => { const b = document.querySelector('[data-hm-sel="ms:project-ascent"]'); return b ? [...b.querySelectorAll('b, em')].map((x) => x.textContent.trim()).join(' · ') : null; }), 10000);
|
|
154
|
-
ok('M Home\'s program card has one line for its milestone changes, first', hm === '3 milestone changes · Pilot live to Dec 2', String(hm));
|
|
155
|
-
if (hm) {
|
|
156
|
-
await M.page.click('[data-hm-sel="ms:project-ascent"]');
|
|
157
|
-
ok('M a tap opens the program, where the changes lead its proposals', !!(await until(() => M.page.evaluate(() => { const b = document.querySelector('#czViewer [data-pv="props"]'); if (b && b.getAttribute('aria-expanded') !== 'true') b.click(); return !!document.querySelector('#czViewer .pv-props .msg-r'); }), 8000)));
|
|
158
|
-
}
|
|
159
|
-
// batch 16: on a desktop the greeting opens Your day in the Viewer, as on a phone; the calendar is under ⋯
|
|
160
|
-
if (await M.page.$('[data-hm-day]')) {
|
|
161
|
-
await M.page.click('[data-hm-day]');
|
|
162
|
-
const vw = await until(() => M.page.evaluate(() => { const v = document.querySelector('#czViewer'); const t = v && !v.hidden ? v.textContent.replace(/\s+/g, ' ') : ''; return /Your day/.test(t) ? t : null; }), 8000);
|
|
163
|
-
ok('D on a desktop the greeting opens Your day in the Viewer, as on a phone', !!vw, String(vw).slice(0, 200));
|
|
164
|
-
}
|
|
165
|
-
ok('0 no page error on Home', M.errors.length === 0, M.errors.join(' | '));
|
|
166
|
-
await M.ctx.close();
|
|
167
|
-
|
|
168
148
|
/* ── H: a phone ── */
|
|
169
149
|
const S = await open({ w: 390, h: 844 });
|
|
170
150
|
await S.page.click('#czViewer [data-pv="props"]');
|
|
@@ -181,10 +161,6 @@ const withReview = (open, o = {}) => F.programs().map((p) => ({ ...p, ...(o.empt
|
|
|
181
161
|
await shot(K.page, 'XmsgB-asks-built-dark'); await K.ctx.close();
|
|
182
162
|
const K2 = await open({ dark: true, w: 390, h: 844, programs: withReview(FIRST, { empty: true }) });
|
|
183
163
|
await shot(K2.page, 'XmsgB-first-phone-dark'); await K2.ctx.close();
|
|
184
|
-
const K3 = await open({ w: 390, h: 844, home: true });
|
|
185
|
-
if (await until(() => K3.page.$('[data-hm-day]'), 8000)) { await until(() => K3.page.evaluate(() => !!document.querySelector('[data-hm-prog]')), 8000); await K3.page.click('[data-hm-day]'); }
|
|
186
|
-
await until(() => K3.page.$('[data-hm-sel="ms:project-ascent"]'), 8000);
|
|
187
|
-
await shot(K3.page, 'XmsgB-home-phone'); await K3.ctx.close();
|
|
188
164
|
}
|
|
189
165
|
finish();
|
|
190
166
|
})();
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* development OvA5Overlap, OvA6Given, OvA7Drafted). A real server on a scratch repository (c3-scan-fixture.js). The real Home runs at
|
|
5
5
|
* 390 and 1440 wide; GET /api/news-for-you, /api/boards/initiative and /api/phone-day are answered in the browser, so each Viewer has
|
|
6
6
|
* one overlap note, one task given to the PM and one finished draft. The POSTs are caught and answered, never sent.
|
|
7
|
-
* O the overlap note · G a task given to you · F the Finished Viewer from Your day
|
|
7
|
+
* O the overlap note · G a task given to you · D dark and desk widths (F, the Finished Viewer from Your day, went with Home's list:
|
|
8
|
+
* home-desk-layout-delete)
|
|
8
9
|
* Set NEWS_VIEWER_SHOTS=<dir> to save screenshots. */
|
|
9
10
|
const fs = require('fs');
|
|
10
11
|
const path = require('path');
|
|
@@ -65,7 +66,7 @@ const ROWS = { 'psle-article-paywall-lock': { title: 'PSLE Article Paywall Lock'
|
|
|
65
66
|
if (route === '/api/news-for-you/seen' && fin) for (const f of fin) if (b && b.ids && b.ids.includes(f.key)) f.seen = true;
|
|
66
67
|
return fail[route] ? json(r, { ok: false, error: fail[route] }, 409) : json(r, { ok: true }); });
|
|
67
68
|
}
|
|
68
|
-
await p.goto(`${F.BASE}/
|
|
69
|
+
await p.goto(`${F.BASE}/today.html?ws=${encodeURIComponent(ws)}`);
|
|
69
70
|
await until(() => p.evaluate(() => !!document.querySelector('#hmList')));
|
|
70
71
|
return { p, ctx, posts, errs };
|
|
71
72
|
}
|
|
@@ -143,33 +144,6 @@ const ROWS = { 'psle-article-paywall-lock': { title: 'PSLE Article Paywall Lock'
|
|
|
143
144
|
ok('G7 no page error', !errs.length, errs.join(' | '));
|
|
144
145
|
await ctx.close();
|
|
145
146
|
}
|
|
146
|
-
/* F — the Finished Viewer from Your day's Drafted for you */
|
|
147
|
-
{
|
|
148
|
-
const fin = [{ id: 't-0123456789ab', key: 'fin:today:t-0123456789ab', title: 'Project Ascent status summary', summary: 'Where the tender stands, and what the TC decides.', body: '## Where the tender stands\nTwo of three vendors cleared the security review.\n\n## What the TC decides\nVendor B on cost, or vendor A on support.', at: new Date(new Date().setHours(8, 10, 0, 0)).toISOString(), status: 'done', link: null, seen: false }];
|
|
149
|
-
const { p, ctx, posts, errs } = await page({ items: [], fin });
|
|
150
|
-
// Home reads the day with the list: Your day opens once that read is in
|
|
151
|
-
await until(() => fin.read);
|
|
152
|
-
await sleep(800);
|
|
153
|
-
await p.click('[data-hm-day]');
|
|
154
|
-
await until(() => p.evaluate(() => !!document.querySelector('#czViewer [data-yd="fin"]')));
|
|
155
|
-
// Good morning says "N drafted for you" once: its line opens the fold (batch 27 item 10)
|
|
156
|
-
await p.click('#czViewer [data-yd="gm-fold"][data-fold="drafts"]');
|
|
157
|
-
await p.click('#czViewer [data-yd="fin"]');
|
|
158
|
-
await until(() => p.evaluate(() => /Project Ascent status summary/.test((document.querySelector('#czVwTitle') || {}).textContent || '')));
|
|
159
|
-
const t = await vwText(p);
|
|
160
|
-
ok('F1 the finished row opens the draft to read: Finished, nothing sent, the text as a document', /Finished · this morning/.test(t) && /Nothing is sent/.test(t) && await p.evaluate(() => /Two of three vendors/.test((document.querySelector('#czViewer article.hv-doc') || {}).textContent || '')), t.slice(0, 300));
|
|
161
|
-
const pri = await p.evaluate(() => [...document.querySelectorAll('#czViewer .czs-pri')].map((b) => b.textContent));
|
|
162
|
-
ok('F2 ONE primary, "Done with it"; the chat icon "Change it in chat" is in the header; no bare "Open it"', pri.join('|') === 'Done with it' && await p.evaluate(() => !!document.querySelector('#czViewer [data-cz-vw-p="chat"][aria-label="Change it in chat"]')) && !/Open it$/.test(t), pri);
|
|
163
|
-
await shot(p, 'finished-390');
|
|
164
|
-
await p.click('#czViewer .czs-pri');
|
|
165
|
-
await until(() => posts.some((x) => x.path === '/api/news-for-you/seen'));
|
|
166
|
-
const seen = posts.find((x) => x.path === '/api/news-for-you/seen');
|
|
167
|
-
const gone = await until(() => p.evaluate(() => { const c = document.querySelector('#czViewer'); return c && /Your day/.test(document.querySelector('#czVwTitle').textContent) && !c.querySelector('[data-yd="fin"]'); }));
|
|
168
|
-
if (!gone) console.log(await p.evaluate(() => document.querySelector('#czVwTitle').textContent + ' | ' + !!document.querySelector('#czViewer [data-yd="fin"]')));
|
|
169
|
-
ok('F3 Done with it marks the draft seen and it leaves Drafted for you', seen && seen.body.ids[0] === fin[0].key && gone, JSON.stringify(seen));
|
|
170
|
-
ok('F4 no page error', !errs.length, errs.join(' | '));
|
|
171
|
-
await ctx.close();
|
|
172
|
-
}
|
|
173
147
|
/* D — dark and desk */
|
|
174
148
|
{
|
|
175
149
|
const { p, ctx, errs } = await page({ width: 1440, scheme: 'dark' });
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.694.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pmos-workspace",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.694.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@anthropic-ai/sdk": "^1.3.0",
|
package/workspace/package.json
CHANGED
|
@@ -121,7 +121,7 @@ const everyPart = async (pg) => { await pg.waitForSelector('#czViewer .pw-ph', {
|
|
|
121
121
|
await p.click('#czViewer form[data-form="new2"] [type="submit"]');
|
|
122
122
|
ok('T3 Accept records the accept line and a new initiative, and says so', !!(await toastIs(/accepted in/)) && lines('boards.jsonl').some((l) => l.kind === 'ask-accept' && l.ask === a1.body.ask.id), JSON.stringify(lines('boards.jsonl').map((l) => l.kind)));
|
|
123
123
|
const g0 = await until(() => lines('triage-answers.jsonl').find((l) => l.kind === 'start'));
|
|
124
|
-
ok('T3 the Why and the link start its first questions (BdGrill): one start line, and the questions open in the same panel', !!g0 && /Finance wants a CSV/.test(g0.why) && g0.links.length === 1 && !!(await until(() => p.evaluate(() => !!document.querySelector('#czViewer .bd-qc.on') && /questions?
|
|
124
|
+
ok('T3 the Why and the link start its first questions (BdGrill): one start line, and the questions open in the same panel', !!g0 && /Finance wants a CSV/.test(g0.why) && g0.links.length === 1 && !!(await until(() => p.evaluate(() => !!document.querySelector('#czViewer .bd-qc.on') && /questions? to start discovery/.test(document.querySelector('#czViewer').textContent)))), JSON.stringify(g0));
|
|
125
125
|
await p.click('#czViewer .bd-qc.on [data-qchip]'); await p.click('#czViewer [data-grill="next"]');
|
|
126
126
|
ok('T3 an answer is kept per question', await until(() => lines('triage-answers.jsonl').some((l) => l.kind === 'answer' && l.answer)));
|
|
127
127
|
await p.click('#czViewer [data-grill="later"]');
|
|
@@ -206,8 +206,8 @@ const everyPart = async (pg) => { await pg.waitForSelector('#czViewer .pw-ph', {
|
|
|
206
206
|
const I = await open('/premium-initiative.html?id=pa-one&ws=' + encodeURIComponent(B.ws) + '&board=' + encodeURIComponent(B.id));
|
|
207
207
|
const ip = I.page;
|
|
208
208
|
const viaMore = async (pg, label) => { const it = (l) => `#czViewer .cz-vw-menu [role="menuitem"]:has(> span:first-child:text-is("${l}"))`, more = async () => { await pg.click('#czViewer:not([hidden]) [data-cz-vw="more"]'); await until(() => pg.evaluate(() => !!document.querySelector('#czViewer .cz-vw-menu'))); }, view = (v) => until(() => pg.evaluate((x) => !!document.querySelector(`#czViewer:not([hidden]) [data-hi-v="${x}"]`), v)); if ((await pg.$('#czViewer:not([hidden]) [data-hi-v="page"]')) && (await pg.$('#czViewer:not([hidden]) [data-iv-docs]')) && !['Split into a new initiative', 'Merge into', 'Program', 'Open on the Board', 'Copy', 'The record', 'Delete'].includes(label)) { await pg.click('#czViewer:not([hidden]) [data-iv-docs]'); await view('docs'); if (label === 'Documents') return; } await more(); for (let i = 0; i < 20 && !(await pg.$(it(label))) && !(await pg.$(it('Stage'))); i++) { await pg.keyboard.press('Escape'); await pg.waitForTimeout(250); await more(); } if (!(await pg.$(it(label))) && (await pg.$(it('Stage')))) { await pg.click(it('Stage')); await view('stage'); if (label === 'Stage') return; await more(); } await pg.click(it(label)); }; // batch 16 item 5c: the page's ⋯ is short; Documents opens from its fold, and the Documents view's ⋯ holds Stage, whose ⋯ holds Documents, Open the full record and Sprint
|
|
209
|
-
const landed = await until(() => ip.evaluate(() => { const q = new URLSearchParams(location.search); return location.pathname === '/
|
|
210
|
-
ok('I0 the expand link lands on
|
|
209
|
+
const landed = await until(() => ip.evaluate(() => { const q = new URLSearchParams(location.search); return location.pathname === '/today.html' && q.get('ini') === 'pa-one' && !!q.get('ws') && !!q.get('board') && !!document.querySelector('#czViewer .iv-mc'); }), 60000);
|
|
210
|
+
ok('I0 the expand link lands on Today with the initiative open, ws and board kept', !!landed, await ip.evaluate(() => location.href));
|
|
211
211
|
// the page holds the Tasks (batch 11 item 20)
|
|
212
212
|
await until(() => ip.evaluate(() => !!document.querySelector('#czViewer:not([hidden]) [data-hi-v]')), 60000);
|
|
213
213
|
/* X the one initiative ⋯ (batch 14 item 5, pm/ini-more.js): Home's page and the Board's panel list the same items in the same order; only
|
|
@@ -103,7 +103,7 @@ const GANTT = [
|
|
|
103
103
|
await p.evaluate(() => import('/pm/cozy-news.js').then((M) => M.openNews({})));
|
|
104
104
|
await until(newsUp, 30000);
|
|
105
105
|
};
|
|
106
|
-
await p.goto(`${F.BASE}/
|
|
106
|
+
await p.goto(`${F.BASE}/today.html?ws=${encodeURIComponent(ws)}`);
|
|
107
107
|
await until(() => p.evaluate(() => document.querySelectorAll('#hmList .hm-g').length > 0), 30000);
|
|
108
108
|
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
|
|
109
109
|
await openCard();
|
|
@@ -347,13 +347,13 @@ const GANTT = [
|
|
|
347
347
|
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 });
|
|
348
348
|
const TODAY = [tm('a', -90, 'past', []), tm('b', 20, 'next', []), tm('c', 120, 'later', [{ id: 'x1', title: 'Send the deck', due: null }]), tm('d', 200, 'later', [])];
|
|
349
349
|
await p.route('**/api/brief-page*', async (r) => { const res = await r.fetch(); const b = await res.json(); json(r, { ...b, today: TODAY }); });
|
|
350
|
-
await p.goto(`${F.BASE}/
|
|
350
|
+
await p.goto(`${F.BASE}/today.html?ws=${encodeURIComponent(ws)}`);
|
|
351
351
|
await openCard();
|
|
352
352
|
ok('PR1 New for you draws no meetings ring, even with meetings left today', await p.evaluate(() => !document.querySelector('#czViewer #prep, #czViewer .ar-prep')));
|
|
353
353
|
await p.unroute('**/api/brief-page*');
|
|
354
354
|
|
|
355
355
|
/* L: floors */
|
|
356
|
-
await p.goto(`${F.BASE}/
|
|
356
|
+
await p.goto(`${F.BASE}/today.html?ws=${encodeURIComponent(ws)}`);
|
|
357
357
|
await openCard();
|
|
358
358
|
await p.setViewportSize({ width: 390, height: 844 }); await sleep(300);
|
|
359
359
|
await shot('card-390-light');
|
|
@@ -385,7 +385,7 @@ const GANTT = [
|
|
|
385
385
|
prop(P5, tI, 'move', { to: 'Build' }, 'the plan is agreed', Date.now() - 30000);
|
|
386
386
|
for (const [w, h, dark] of [[1280, 900, true], [390, 844, false], [390, 844, true]]) {
|
|
387
387
|
await p.emulateMedia({ colorScheme: dark ? 'dark' : 'light' }); await p.setViewportSize({ width: w, height: h });
|
|
388
|
-
await p.goto(`${F.BASE}/
|
|
388
|
+
await p.goto(`${F.BASE}/today.html?ws=${encodeURIComponent(ws)}`);
|
|
389
389
|
await openCard();
|
|
390
390
|
await open('prop'); await until(() => p.$('#czViewer .cz-vw-body .pc-bar')); await sleep(800);
|
|
391
391
|
if (w === 390) {
|
|
@@ -53,7 +53,8 @@ const filesIn = () => { const d = path.join(T.STATE_DIR, 'chat-files'); const ou
|
|
|
53
53
|
await page.route('**/api/sessions/conversation**', (r) => r.fulfill({ json: { ok: true, state: 'conv', turn: 'user', messages: st.messages } }));
|
|
54
54
|
await page.route('**/api/sessions', (r) => r.fulfill({ json: { ok: true, sessions: [{ id: 's-term', name: 'A terminal session', origin: '', shown: 'quiet' }] } }));
|
|
55
55
|
await page.goto(BASE + url, { waitUntil: 'domcontentloaded' });
|
|
56
|
-
|
|
56
|
+
// on a desktop the chat the address names opens in the popup (home-page-retire): wait until the box shows, not only exists
|
|
57
|
+
await page.waitForFunction(() => { const i = document.querySelector('#hmIn'); return !!i && i.getClientRects().length > 0; }, null, { timeout: 15000 });
|
|
57
58
|
return { page, ctx, errors, asks, st };
|
|
58
59
|
};
|
|
59
60
|
const chips = (page) => page.$$eval('#hmFiles .hm-att', (xs) => xs.map((x) => ({ name: x.querySelector('b').textContent, meta: (x.querySelector('em') || {}).textContent || '' })));
|
|
@@ -117,7 +118,7 @@ const filesIn = () => { const d = path.join(T.STATE_DIR, 'chat-files'); const ou
|
|
|
117
118
|
ok('B1-B7 no page errors', errors.length === 0, errors.join(' | '));
|
|
118
119
|
await ctx.close();
|
|
119
120
|
/* B8 */
|
|
120
|
-
({ page, ctx, errors } = await open({ url: '/
|
|
121
|
+
({ page, ctx, errors } = await open({ url: '/today.html?session=s-term' }));
|
|
121
122
|
await until(async () => page.evaluate(() => /A terminal session/.test((document.querySelector('#hmChat') || {}).textContent || '')), 6000);
|
|
122
123
|
ok('B8 a terminal session with no conversation key cannot attach: no Attach a file and no file picker', (await page.$('#hmFoot [data-hm-file]')) === null && (await page.$('#hmFile')) === null);
|
|
123
124
|
ok('B8 no page errors', errors.length === 0, errors.join(' | '));
|
|
@@ -82,9 +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
|
-
//
|
|
86
|
-
//
|
|
87
|
-
await p.goto(BASE + url + (
|
|
85
|
+
// /premium-chat.html opens Today (home-page-retire): the address names the conversation, which opens in the popup's chat on a desktop
|
|
86
|
+
// and as the page on a phone (HmPhone2)
|
|
87
|
+
await p.goto(BASE + url + (url === '/premium-chat.html' ? '?about=chat:charts' : ''));
|
|
88
88
|
await until(() => p.evaluate(() => !!document.querySelector('#hmLog [data-report-open]')));
|
|
89
89
|
await sleep(500);
|
|
90
90
|
return { p, ctx, errs };
|
|
@@ -95,7 +95,8 @@ const look = () => {
|
|
|
95
95
|
ok('C1 the chart block is a chip under PMOS\'s words', /Partners activating/.test(s0.chip || '') && /New chart/.test(s0.chip || ''), JSON.stringify(s0));
|
|
96
96
|
await p.click('#hmLog [data-report-open]');
|
|
97
97
|
const s1 = await until(async () => { const v = await p.evaluate(look); return v.pane && v.tiles.length ? v : null; }) || await p.evaluate(look);
|
|
98
|
-
|
|
98
|
+
// in the popup (home-page-retire) the Viewer has no kind line, and the chart's look is the popup's: the checks name the chart, not its layout
|
|
99
|
+
ok('C1 the Chart view draws the measure from its five readings, as proposed', /New chart/.test(s1.pane || '') && /Are partners activating\?/.test(s1.pane || '') && /20%24%30%28%33%/.test(s1.pane || '') && !(await p.$('#czViewer .rt, #czViewer .obody, #czViewer .mt1')), JSON.stringify(s1));
|
|
99
100
|
if (shots) await p.screenshot({ path: `${shots}/chart-1280.png` });
|
|
100
101
|
await p.click('#czViewer [data-ct="form|line"]');
|
|
101
102
|
const s2 = await until(async () => { const v = await p.evaluate(look); return v.form === 'Line' ? v : null; }) || await p.evaluate(look);
|
|
@@ -114,7 +115,7 @@ const look = () => {
|
|
|
114
115
|
{ const { p, ctx, errs } = await open(1280, [ASK('a dashboard for the partner review'), { role: 'assistant', text: 'Here it is.\n\n' + block(DASH) }]);
|
|
115
116
|
await p.click('#hmLog [data-report-open]');
|
|
116
117
|
const s1 = await until(async () => { const v = await p.evaluate(look); return v.pane && v.tiles.length ? v : null; }) || await p.evaluate(look);
|
|
117
|
-
ok('C3 the Dashboard tab draws two charts in order and names the measure with no series', s1.
|
|
118
|
+
ok('C3 the Dashboard tab draws two charts in order and names the measure with no series', s1.tiles.length === 2 && /Partner growth/.test(s1.title) && /Lonely/.test(s1.pane || '') && /fewer than two readings/.test(s1.pane || ''), JSON.stringify(s1));
|
|
118
119
|
if (shots) await p.screenshot({ path: `${shots}/dashboard-1280.png` });
|
|
119
120
|
await p.click('#czViewer [data-ct="save"]');
|
|
120
121
|
await until(async () => { const v = await p.evaluate(look); return v.pane && /Saved\./.test(v.pane) ? v : null; });
|
|
@@ -132,10 +133,10 @@ const look = () => {
|
|
|
132
133
|
await until(() => p.evaluate(() => /premium\.html\?/.test((document.querySelector('#askWhy') || {}).href || '')));
|
|
133
134
|
const hasStudio = await p.evaluate(() => !!document.querySelector('.stu, #studio') || [...document.scripts].some((s) => /premium-studio/.test(s.src)));
|
|
134
135
|
const href = await p.evaluate(() => document.querySelector('#askWhy').href);
|
|
135
|
-
await Promise.all([p.waitForURL(/\/
|
|
136
|
+
await Promise.all([p.waitForURL(/\/today\.html\?/), p.click('#askWhy')]);
|
|
136
137
|
const u1 = new URL(p.url());
|
|
137
138
|
const s2 = await until(async () => { const v = await p.evaluate(look); return v.say ? v : null; }) || await p.evaluate(look);
|
|
138
|
-
ok('I1 Insights has no Studio; Ask why opens Home\'s chat about Insights', !hasStudio && u1.pathname === '/
|
|
139
|
+
ok('I1 Insights has no Studio; Ask why opens Home\'s chat about Insights', !hasStudio && u1.pathname === '/today.html' && u1.searchParams.get('ask') === 'insights' && /ask=insights/.test(href), JSON.stringify([href, u1.search]));
|
|
139
140
|
ok('I1 the question waits in the box, not sent', /^Why/.test(s2.say) && asked === 0, JSON.stringify([s2.say, asked]));
|
|
140
141
|
ok('F1 no page error (Insights to Home)', !errs.length, errs.join(' | '));
|
|
141
142
|
await ctx.close(); }
|
|
@@ -65,7 +65,9 @@ const second = (k) => [
|
|
|
65
65
|
return { p, ctx, errs, conv };
|
|
66
66
|
};
|
|
67
67
|
const look = () => {
|
|
68
|
-
|
|
68
|
+
// on a desktop the chat is the popup's (home-page-retire), whose work side holds the session list until an item opens there
|
|
69
|
+
const vw0 = document.querySelector('#czViewer:not([hidden])'), peek = document.querySelector('#hmPeek');
|
|
70
|
+
const vw = vw0 && /^All sessions$/.test(((vw0.querySelector('#czVwTitle') || {}).textContent || '').trim()) ? null : vw0;
|
|
69
71
|
const title = vw ? ((vw.querySelector('#czVwTitle') || {}).textContent || '').trim() : '';
|
|
70
72
|
return { tab: vw ? 'out' : 'chat', shut: !vw, layer: false, out: vw ? Math.round(vw.getBoundingClientRect().width) : 0,
|
|
71
73
|
tabs: vw && title ? [title] : [],
|
|
@@ -83,8 +83,10 @@ const look = () => {
|
|
|
83
83
|
await p.click('#hmLog .pl-dv [data-goal-open]');
|
|
84
84
|
const s1 = await until(async () => { const v = await p.evaluate(look); return !v.shut && v.pane ? v : null; }) || await p.evaluate(look);
|
|
85
85
|
ok('G1 the chip opens a Goal tab with the goal, its done points and why it stopped', /Goal/.test(s1.on || '') && /Stopped/.test(s1.pane || '') && /0 of 3 done points met/.test(s1.pane || '') && /Totals match GA4/.test(s1.pane || '') && /You stopped it/.test(s1.pane || ''), JSON.stringify(s1));
|
|
86
|
-
await p.click('#czViewer [data-cz-vw="close"]'); await until(() => p.evaluate(() => !document.querySelector('#czViewer:not([hidden])')));
|
|
87
86
|
st.goal = goalOf('started', { met: [DRAFT.done[0]] });
|
|
87
|
+
// in the popup (home-page-retire) ✕ closes the popup with its chat: the chat opens again from its address, as the PM would
|
|
88
|
+
if (await p.$('#czViewer [data-cz-vw="close"]')) { await p.click('#czViewer [data-cz-vw="close"]'); await until(() => p.evaluate(() => !document.querySelector('#czViewer:not([hidden])'))); }
|
|
89
|
+
else { await p.goto(chat + '&about=work:goal-test'); await until(() => p.evaluate(() => !!document.querySelector('#hmLog .hm-a, #hmLog .hm-u'))); await sleep(400); }
|
|
88
90
|
const s1b = await until(async () => { const v = await p.evaluate(look); return v.line ? v : null; }) || await p.evaluate(look);
|
|
89
91
|
ok('G2 a goal at work is the line at the top, and opens nothing by itself', /Each drop has a reason label/.test(s1b.line || '') && /1 of 3 done/.test(s1b.line || '') && s1b.shut && !s1b.chip, JSON.stringify(s1b));
|
|
90
92
|
await p.click('#hmPl [data-pl="toggle"]');
|
|
@@ -150,7 +150,8 @@ const look = () => {
|
|
|
150
150
|
const s0 = await until(async () => { const v = await p.evaluate(look); return v.divider ? v : null; }) || await p.evaluate(look);
|
|
151
151
|
ok('P5 a goal that is done: no line; "Goal done" sits over PMOS\'s result', !s0.line && /Goal done/.test(s0.divider || '') && /The draft is ready for Dita/.test(s0.dividerNext || ''), JSON.stringify(s0));
|
|
152
152
|
await p.click('#hmLog .pl-dv [data-goal-open]');
|
|
153
|
-
|
|
153
|
+
// on a desktop the chat is the popup's (home-page-retire), whose work side lists the sessions until the goal opens there
|
|
154
|
+
const s1 = await until(async () => { const v = await p.evaluate(look); return v.vw && /points met/.test(v.vw) ? v : null; }) || await p.evaluate(look);
|
|
154
155
|
ok('P5 a tap opens the points, with the note that PMOS checked them itself', /4 of 4 done points met/.test(s1.vw || '') && /PMOS checked its own points/.test(s1.vw || ''), JSON.stringify(s1));
|
|
155
156
|
st.goal = goal('stopped', { reason: 'deadline', at: ago(0.2) });
|
|
156
157
|
const s2 = await until(async () => { const v = await p.evaluate(look); return /Goal stopped/.test(v.divider || '') ? v : null; }) || await p.evaluate(look);
|
|
@@ -171,14 +172,15 @@ const look = () => {
|
|
|
171
172
|
{ const st = { goal: goal('started'), conv: { turn: 'tool', messages: BASE } };
|
|
172
173
|
const { p, ctx, errs } = await open(1360, st); // slice 1: the rail of places takes 80 px; at 1280 the Viewer floats over the chat line instead of sitting beside it
|
|
173
174
|
const s0 = await until(async () => { const v = await p.evaluate(look); return v.line ? v : null; }) || await p.evaluate(look);
|
|
174
|
-
|
|
175
|
+
const steps = (v) => /round 2 of 12/.test(v.vw || ''); // the popup's work side lists the sessions until the steps open there (home-page-retire)
|
|
176
|
+
ok('P9 a desktop: the same line over the popup\'s chat, opening nothing by itself', /1 of 4 done/.test(s0.line || '') && !steps(s0), JSON.stringify(s0));
|
|
175
177
|
await p.click('#hmPl [data-pl="toggle"]');
|
|
176
|
-
const s1 = await until(async () => { const v = await p.evaluate(look); return v
|
|
178
|
+
const s1 = await until(async () => { const v = await p.evaluate(look); return steps(v) && /\bon\b/.test(v.cls) ? v : null; }) || await p.evaluate(look);
|
|
177
179
|
ok('P9 a tap opens the steps in the Viewer (the goal, the round, every point, Now) and the line stays tinted', /round 2 of 12/.test(s1.vw || '') && /Ready for Dita's review/.test(s1.vw || '') && /Now/.test(s1.vw || '') && !s1.open && /\bon\b/.test(s1.cls), JSON.stringify(s1));
|
|
178
180
|
if (shots) await p.screenshot({ path: `${shots}/line-1280-viewer.png` });
|
|
179
181
|
await p.click('#hmPl [data-pl="toggle"]');
|
|
180
|
-
const s2 = await until(async () => { const v = await p.evaluate(look); return !v
|
|
181
|
-
ok('P9 a second tap closes the
|
|
182
|
+
const s2 = await until(async () => { const v = await p.evaluate(look); return !steps(v) ? v : null; }) || await p.evaluate(look);
|
|
183
|
+
ok('P9 a second tap closes the steps and the tint goes', !steps(s2) && !/\bon\b/.test(s2.cls), JSON.stringify(s2));
|
|
182
184
|
ok('F1 (1280) no page error and no sideways scroll', !errs.length && !s2.wide, errs.join(' | '));
|
|
183
185
|
await ctx.close(); }
|
|
184
186
|
|
|
@@ -187,7 +189,7 @@ const look = () => {
|
|
|
187
189
|
{ id: 'ring-a', name: 'Weekly update draft', agent: 'claude', state: 'running', shown: 'working', created: ago(10), hx: { title: 'Weekly update draft' }, progress: { done: 3, n: 5 } },
|
|
188
190
|
{ id: 'ring-b', name: 'Checkout drop-off', agent: 'claude', state: 'running', shown: 'working', created: ago(9), hx: { title: 'Checkout drop-off' }, progress: null },
|
|
189
191
|
] };
|
|
190
|
-
const { p, ctx, errs } = await open(390, st, `${F.BASE}/
|
|
192
|
+
const { p, ctx, errs } = await open(390, st, `${F.BASE}/today.html?ws=${encodeURIComponent(F.ws)}`);
|
|
191
193
|
await until(() => p.evaluate(() => !!document.querySelector('#hmList [data-hm-pg="loose"]')));
|
|
192
194
|
await p.evaluate(() => { const g = document.querySelector('#hmList [data-hm-pg="loose"]'); if (g && g.getAttribute('aria-expanded') !== 'true') g.click(); });
|
|
193
195
|
const rows = await until(() => p.evaluate(() => { const a = [...document.querySelectorAll('#hmList .hm-r')].find((r) => /Weekly update draft/.test(r.textContent)), b = [...document.querySelectorAll('#hmList .hm-r')].find((r) => /Checkout drop-off/.test(r.textContent)); return a && b ? { a: a.innerHTML, at: a.textContent, b: b.innerHTML } : null; })) || {};
|
|
@@ -45,8 +45,10 @@ const ANSWER = { role: 'assistant', text: 'Signups from the lightbox rose to 1,2
|
|
|
45
45
|
* card ([data-rt="askyes"]). */
|
|
46
46
|
const look = () => {
|
|
47
47
|
const vw = document.querySelector('#czViewer:not([hidden])'), pane = vw ? vw.querySelector('.vz[data-vw^="report:"]') : null;
|
|
48
|
-
return { shut: !pane,
|
|
49
|
-
|
|
48
|
+
return { shut: !pane, inPop: !!(vw && vw.closest('.cz-pop')), // the popup's Viewer has no kind line (home-page-retire)
|
|
49
|
+
title: vw ? ((vw.querySelector('.cz-vw-title') || {}).textContent || '') : '', reader: !!(vw && vw.querySelector('.vz-rp0')), review: vw && vw.querySelector('.rf-rv') ? vw.querySelector('.rf-rv').textContent : null,
|
|
50
|
+
// in the popup (home-page-retire) the work side's quiet presses go into ⋯ (board 20): the template and chat presses are there
|
|
51
|
+
tpl: !!(vw && ((vw.querySelector('[data-cz-vw-p="template"]') && vw.querySelector('[data-cz-vw-p="chat"]')) || (vw.closest('.cz-pop') && vw.querySelector('[data-cz-vw="more"]')))), layer: false, chip: (document.querySelector('#hmLog [data-report-open]') || {}).textContent || null,
|
|
50
52
|
json: /pmos-report|"kind"/.test((document.querySelector('#hmLog') || {}).textContent || ''), user: [...document.querySelectorAll('#hmLog .hm-u .hm-bub')].map((u) => u.textContent.trim()),
|
|
51
53
|
tabs: pane ? [(vw.querySelector('.cz-vw-kind') || {}).textContent || ''] : [], pane: pane ? pane.textContent.replace(/\s+/g, ' ').trim() : null,
|
|
52
54
|
secs: pane ? (pane.querySelector('.vz-dkt') ? pane.querySelectorAll('.vz-dkt button').length - 1 : pane.querySelectorAll('.vz-secs li').length) : 0,
|
|
@@ -56,6 +58,12 @@ const look = () => {
|
|
|
56
58
|
wide: document.documentElement.scrollWidth > innerWidth + 1 };
|
|
57
59
|
};
|
|
58
60
|
|
|
61
|
+
/** A header press of the Viewer: in the popup it is an item of ⋯ (board 20), elsewhere its own icon. */
|
|
62
|
+
const press = async (p, act, label) => {
|
|
63
|
+
if (await p.$(`#czViewer [data-cz-vw-p="${act}"]`)) return p.click(`#czViewer [data-cz-vw-p="${act}"]`);
|
|
64
|
+
await p.click('#czViewer [data-cz-vw="more"]');
|
|
65
|
+
await p.click(`[data-cz-vw-mi]:has-text("${label}")`);
|
|
66
|
+
};
|
|
59
67
|
(async () => {
|
|
60
68
|
const exe = findBrowser();
|
|
61
69
|
if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the suite cannot run'); return finish(1); }
|
|
@@ -84,7 +92,7 @@ const look = () => {
|
|
|
84
92
|
ok('R1 opening the chat opens no tab by itself', s0.tabs.length === 0, JSON.stringify(s0));
|
|
85
93
|
await p.click('#hmLog [data-report-open]');
|
|
86
94
|
const s1 = await until(async () => { const v = await p.evaluate(look); return v.pane ? v : null; }) || await p.evaluate(look);
|
|
87
|
-
ok('R3 a new report asks its questions first (RfH4): Waits on your answers, PMOS\'s picks filled in (Slides, Growth leads, Once), the standard look, its sources, Nothing goes out and Draft it', /Report · Growth leads/.test(s1.tabs.join(' ')) && /Social login weekly/.test(s1.title)
|
|
95
|
+
ok('R3 a new report asks its questions first (RfH4): Waits on your answers, PMOS\'s picks filled in (Slides, Growth leads, Once), the standard look, its sources, Nothing goes out and Draft it', (/Report · Growth leads/.test(s1.tabs.join(' ')) || s1.inPop) && /Social login weekly/.test(s1.title)
|
|
88
96
|
&& /Waits on your answers/.test(s1.pane || '') && /my pick/.test(s1.pane || '') && /Standard PMOS look/.test(s1.pane || '') && /GA4/.test(s1.pane || '') && /Nothing goes out/.test(s1.pane || '')
|
|
89
97
|
&& await p.evaluate(() => document.querySelector('#czViewer [data-rt="fmt|google-slides"]').getAttribute('aria-checked') === 'true' && document.querySelector('#czViewer [data-rt="rep|0"]').getAttribute('aria-checked') === 'true' && document.querySelector('#czViewer input[data-rt="aud"]').value === 'Growth leads' && !!document.querySelector('#czViewer [data-rt="draftit"]:not([disabled])'))
|
|
90
98
|
&& !/Customer service|Follow a sample deck/.test(s1.pane || '') && !(await p.$('#czViewer .rt, #czViewer .obody, #dlg:not([hidden])')), JSON.stringify(s1));
|
|
@@ -101,10 +109,10 @@ const look = () => {
|
|
|
101
109
|
ok('R4 the report\'s current state opens: its first draft in the reader, PMOS\'s review under it (RfH2), the template icon in the header', s3.reader && /I read it as your readers would/.test(s3.review || '') && s3.tpl, JSON.stringify(s3).slice(0, 600));
|
|
102
110
|
if (shots) await p.screenshot({ path: `${shots}/draft-1280-light.png` });
|
|
103
111
|
// the chat icon (Wawan, 2026-11-02): the report's own conversation opens in Home's chat, the report stays beside it
|
|
104
|
-
await p
|
|
112
|
+
await press(p, 'chat', 'Talk to PMOS about this report');
|
|
105
113
|
const ch = await until(() => p.evaluate(() => { const i = document.getElementById('hmIn'); return i && i.placeholder === 'Change the report' ? { ph: i.placeholder, log: (document.getElementById('hmLog') || {}).textContent || '', reader: !!document.querySelector('#czViewer .vz-slide, #czViewer .vz-rp0') } : null; }), 8000);
|
|
106
114
|
ok('R4 the chat icon opens the report\'s own conversation beside it: PMOS asks what to change, the report stays open', !!ch && /Tell me what to change in/.test(ch.log) && ch.reader, JSON.stringify(ch));
|
|
107
|
-
await p
|
|
115
|
+
await press(p, 'template', 'Template: format, readers, look, sources');
|
|
108
116
|
await until(() => p.evaluate(() => !!document.querySelector('#czViewer .vz[data-panel="template"] [data-rt="fmt|google-doc"]')));
|
|
109
117
|
await p.click('#czViewer [data-rt="fmt|google-doc"]');
|
|
110
118
|
const t1 = await until(() => p.evaluate(() => { const v = document.querySelector('#czViewer .vz[data-panel="template"]'); return v && /changed, not saved yet/.test(v.textContent) ? v.textContent.replace(/\s+/g, ' ') : null; }));
|
|
@@ -63,8 +63,8 @@ const pressTerm = async (p) => { await p.click('#hmAdd'); await p.click('#hmTerm
|
|
|
63
63
|
r.fulfill({ json: { ok: true, id: 'sess-7', cols: 60, rows: 12, gen: 0, end: RAW.length, reset: true, data: RAW } }); });
|
|
64
64
|
let pops = 0; ctx.on('page', () => { pops++; });
|
|
65
65
|
await pressTerm(p);
|
|
66
|
-
const v = await until(() => p.evaluate(() => { const w = document.querySelector('#czViewer:not([hidden])'); return w && /working/.test(w.textContent) && w.querySelector('.hv-xt[role="log"]') ? (w.querySelector('.cz-vw-kind') || {}).textContent : null; })); // the read-only view: sess-7 is routed, not running, so the live attach finds nothing
|
|
67
|
-
ok('O1 pressing it shows that same session\'s terminal in the Viewer (read only when the socket has no live session to attach); no tab opens and nothing links to the console', v === 'Terminal · read only' && read === 'sess-7' && pops === 0
|
|
66
|
+
const v = await until(() => p.evaluate(() => { const w = document.querySelector('#czViewer:not([hidden])'); return w && /working/.test(w.textContent) && w.querySelector('.hv-xt[role="log"]') ? ((w.querySelector('.cz-vw-kind') || {}).textContent || (w.closest('.cz-pop') ? 'pop:' + ((w.querySelector('.cz-vw-hd') || {}).textContent || '').replace(/\s+/g, ' ').trim() : null)) : null; })); // the popup has no kind line (home-page-retire): its header names it // the read-only view: sess-7 is routed, not running, so the live attach finds nothing
|
|
67
|
+
ok('O1 pressing it shows that same session\'s terminal in the Viewer (read only when the socket has no live session to attach); no tab opens and nothing links to the console', (v === 'Terminal · read only' || /^pop:.*Read only/.test(v || '')) && read === 'sess-7' && pops === 0
|
|
68
68
|
&& !(await p.evaluate(() => [...document.querySelectorAll('a[href]')].some((a) => /console/.test(a.getAttribute('href'))))), JSON.stringify([v, read, pops]));
|
|
69
69
|
const lines = () => p.evaluate(() => [...document.querySelectorAll('#czViewer .xterm-rows > div')].map((d) => d.textContent.replace(/\u00a0/g, ' ').trimEnd()).filter(Boolean));
|
|
70
70
|
const l1 = await until(async () => { const l = await lines(); return l.includes('next') ? l : null; }, 9000) || await lines();
|