create-pmos 0.692.0 → 0.693.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 +9 -3
- 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 +8 -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 +1 -1
- 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/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 +2 -2
- 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/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/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/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
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.693.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.693.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@anthropic-ai/sdk": "^1.3.0",
|
package/workspace/package.json
CHANGED
|
@@ -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();
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* Since premium-agreed-design /premium-chat.html opens Home: the list, the chat, and the Viewer — one cozy card (#czViewer) that shows one
|
|
6
6
|
* item at a time, so the old tab strip, its "+N" fold and the head's Viewer pill are gone; the chat's "Open the Viewer" button (#hmReopen)
|
|
7
7
|
* brings back what was closed. On a phone the chat is the page and the Viewer covers it.
|
|
8
|
-
* V1 at 1280
|
|
9
|
-
*
|
|
8
|
+
* V1 at 1280 Today opens the conversation in the popup; a file press opens the Viewer beside a chat of at least 360 px (home-page-retire:
|
|
9
|
+
* Home's desk page with its list is gone)
|
|
10
10
|
* V2 the Viewer shows the file only, with its name as the title
|
|
11
11
|
* V3 a closed Viewer leaves the chat's "Open the Viewer" button, which opens the last item again
|
|
12
12
|
* V4 in a full-screen dialog on another page, a folded viewer unfolds when something opens in it
|
|
@@ -61,32 +61,26 @@ const look = () => {
|
|
|
61
61
|
await p.route('**/api/briefing-premium/thread**', (r) => r.fulfill({ json: { ok: true, turns: [], session: 's-vw' } }));
|
|
62
62
|
await p.route('**/api/sessions/conversation**', (r) => r.fulfill({ json: { ok: true, state: 'conv', turn: 'user', messages: ANSWER } }));
|
|
63
63
|
await p.goto(chat + '&about=work:viewer-test');
|
|
64
|
-
await until(() => p.evaluate(() => /\/
|
|
64
|
+
await until(() => p.evaluate(() => /\/today\.html$/.test(location.pathname) && document.querySelectorAll('#hmLog .fpath').length >= 2), 12000);
|
|
65
65
|
await sleep(300);
|
|
66
66
|
return { p, ctx, errs };
|
|
67
67
|
};
|
|
68
68
|
const many = (p) => p.evaluate(async () => { const v = await import('/pm/premium-viewer.js'); for (const n of ['funnel-export.csv', 'support-tickets.md', 'pricing-notes.md', 'a-longer-quarterly-plan.md']) v.vwOpen({ id: 'x:' + n, title: n, html: '<article class="paper doc"><p>' + n + '</p></article>' }); });
|
|
69
69
|
const closeVw = (p) => p.click('#czViewer [data-cz-vw="close"], #czViewer [data-cz-vw="back"]'); // shell A: × on a desk, ← on a phone
|
|
70
70
|
|
|
71
|
+
// at 1280 the chat is the popup's (home-page-retire): its work side shows what opens; ✕ closes the popup, so V1's close and V3's
|
|
72
|
+
// "Open the Viewer" button are phone checks now (Home's desk page with its list is gone)
|
|
71
73
|
{ const { p, ctx, errs } = await open(1280);
|
|
72
74
|
const s0 = await p.evaluate(look);
|
|
73
|
-
|
|
75
|
+
const popChat = await p.evaluate(() => !!document.querySelector('.cz-pop:not([hidden]) #hmChat'));
|
|
76
|
+
ok('V1 at 1280 /premium-chat.html opens Today with the conversation in the popup, no file open yet', popChat && s0.conv >= 360 && !/\.md$/.test(s0.title || ''), JSON.stringify(s0));
|
|
74
77
|
await p.click('#hmLog .fpath >> nth=0');
|
|
75
|
-
const s1 = await until(async () => { const v = await p.evaluate(look); return !v.shut && v.title ? v : null; }) || await p.evaluate(look);
|
|
76
|
-
ok('V1 a file press opens the Viewer beside a conversation of at least 360 px
|
|
78
|
+
const s1 = await until(async () => { const v = await p.evaluate(look); return !v.shut && /signup-drop\.md/.test(v.title || '') ? v : null; }) || await p.evaluate(look);
|
|
79
|
+
ok('V1 a file press opens the Viewer beside a conversation of at least 360 px', !s1.shut && s1.out > 300 && s1.conv >= 360, JSON.stringify(s1));
|
|
77
80
|
ok('V2 the Viewer shows only the file, with its name as the title, and no tab strip', /signup-drop\.md/.test(s1.title) && !s1.strip, JSON.stringify(s1));
|
|
78
|
-
await
|
|
79
|
-
const s2 = await until(async () => { const v = await p.evaluate(look); return v.shut ? v : null; }) || await p.evaluate(look);
|
|
80
|
-
ok('V1 closing the Viewer gives the conversation its width and the list stays', s2.shut && s2.out === 0 && s2.conv > 700 && s2.list, JSON.stringify(s2));
|
|
81
|
-
await p.click('#hmLog .fpath >> nth=0'); await p.click('#hmLog .fpath >> nth=1'); await sleep(300);
|
|
81
|
+
await p.click('#hmLog .fpath >> nth=1'); await sleep(300);
|
|
82
82
|
const sb = await until(async () => { const v = await p.evaluate(look); return /signup-fix\.md/.test(v.title || '') ? v : null; }) || await p.evaluate(look);
|
|
83
83
|
ok('V6 a second file replaces the first in the one Viewer card', /signup-fix\.md/.test(sb.title || '') && !sb.strip && await p.evaluate(() => document.querySelectorAll('#czViewer').length === 1), JSON.stringify(sb));
|
|
84
|
-
await closeVw(p);
|
|
85
|
-
const s3 = await until(async () => { const v = await p.evaluate(look); return v.shut && v.reopen ? v : null; }) || await p.evaluate(look);
|
|
86
|
-
ok('V3 the close leaves the chat\'s "Open the Viewer" button', s3.shut && s3.reopen, JSON.stringify(s3));
|
|
87
|
-
await p.click('#hmReopen');
|
|
88
|
-
const s4 = await until(async () => { const v = await p.evaluate(look); return !v.shut ? v : null; }) || await p.evaluate(look);
|
|
89
|
-
ok('V3 the button opens the last item again', !s4.shut && /signup-fix\.md/.test(s4.title || '') && !s4.reopen, JSON.stringify(s4));
|
|
90
84
|
if (shots) await p.screenshot({ path: `${shots}/chat-viewer-1280-light.png` });
|
|
91
85
|
await many(p); await sleep(400);
|
|
92
86
|
const s5 = await p.evaluate(look);
|
|
@@ -96,8 +96,13 @@ const BODY = '## Purpose\n\nWhy this board exists.\n\n## Scope\n\nWhat it covers
|
|
|
96
96
|
const unfold = (p, sel) => p.evaluate((q) => { const n = document.querySelector(q); const f = n && !n.offsetParent && n.closest('.czs-sec') && n.closest('.czs-sec').querySelector('[data-czs-fold]'); if (f) f.click(); }, sel);
|
|
97
97
|
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
|
|
98
98
|
// the initiative's page (canvas HbC): its list row opens it again when the Viewer shows something else
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
// on a desktop Today opens the initiative's page by itself (home-page-retire: Home's list is gone); on a phone its list row opens it
|
|
100
|
+
const ovOpen = async (p) => { await until(() => p.evaluate(() => !!document.querySelector('#czViewer:not([hidden]) [data-hi-v="page"]') || !!(document.querySelector('#hmList [data-hm-sel^="i:"][aria-current="true"]') || {}).offsetParent), 60000);
|
|
101
|
+
// the Viewer shows something else: the list row on a phone, ← (the trail) on a desktop
|
|
102
|
+
for (let i = 0; i < 4 && !(await p.$('#czViewer:not([hidden]) [data-hi-v="page"]')); i++) {
|
|
103
|
+
if (await p.evaluate(() => !!(document.querySelector('#hmList [data-hm-sel^="i:"][aria-current="true"]') || {}).offsetParent)) { await p.click('#hmList [data-hm-sel^="i:"][aria-current="true"]'); break; }
|
|
104
|
+
await p.click('#czViewer:not([hidden]) [data-cz-vw="back"]'); await sleep(600);
|
|
105
|
+
}
|
|
101
106
|
await until(() => p.evaluate(() => !!document.querySelector('#czViewer [data-hi-v="page"] .iv')), 60000); // the page holds the Tasks (batch 11 item 20)
|
|
102
107
|
// the Overview opens on Tasks; the core documents are its Documents view (premium-uncovered-features, canvas InDocs)
|
|
103
108
|
if (await until(() => p.evaluate(() => !!document.querySelector('#czViewer:not([hidden]) [data-hi-v]')), 30000)) await (async (pg) => { if (await pg.$('#czViewer [data-hi-view="docs"]')) await pg.click('#czViewer [data-hi-view="docs"]'); else await viaMore(pg, 'Documents'); })(p); };
|
|
@@ -55,12 +55,15 @@ const json = (r, body, status = 200) => r.fulfill({ status, contentType: 'applic
|
|
|
55
55
|
await page.waitForFunction(() => !!window.czViewer, null, { timeout: 15000 });
|
|
56
56
|
await page.evaluate((it) => window.czViewer.open({ ...it, discuss: true, html: '<p>The item</p>' }), item);
|
|
57
57
|
await page.click('#czViewer [data-cz-vw="discuss"]');
|
|
58
|
-
await page.waitForURL(/\/
|
|
58
|
+
await page.waitForURL(/\/today\.html\?/, { timeout: 15000 }); // Home's address opens Today (home-page-retire)
|
|
59
59
|
return new URL(page.url());
|
|
60
60
|
};
|
|
61
|
+
// on a desktop the popup's chat names the item (home-page-retire)
|
|
61
62
|
const state = () => page.evaluate(() => ({
|
|
62
63
|
vw: !!document.querySelector('#czViewer:not([hidden])'), vwTitle: ((document.querySelector('#czViewer .cz-vw-hd') || {}).textContent || '').replace(/\s+/g, ' ').trim(),
|
|
63
|
-
top: document.querySelector('#hmTopTitle').textContent, url: location.search,
|
|
64
|
+
top: (document.querySelector('.cz-pop:not([hidden]) .cz-pop-t span') || document.querySelector('#hmTopTitle')).textContent, url: location.search,
|
|
65
|
+
pop: !!document.querySelector('.cz-pop:not([hidden]) #hmChat'), cx: ((document.querySelector('.cz-pop-cx') || {}).textContent || ''),
|
|
66
|
+
log: ((document.querySelector('#hmLog') || {}).textContent || '').replace(/\s+/g, ' ').trim().slice(0, 160), ph: (document.querySelector('#hmIn') || {}).placeholder || '',
|
|
64
67
|
}));
|
|
65
68
|
|
|
66
69
|
let u = await discussFrom({ kind: 'Initiative', id: 'usage-billing', title: 'Usage-based billing' });
|
|
@@ -77,14 +80,15 @@ const json = (r, body, status = 200) => r.fulfill({ status, contentType: 'applic
|
|
|
77
80
|
u = await discussFrom({ kind: 'Person', id: 'ana', title: 'Ana Lim' });
|
|
78
81
|
ok('D1 a kind Home has no key for is a chat key: about=chat:<id>', u.searchParams.get('about') === 'chat:ana', u.search);
|
|
79
82
|
await sleep(2500); s = await state();
|
|
80
|
-
ok('D4 a kind Home has no view for is the chat alone, named by its label', s.top === 'Ana Lim' && !s.vw
|
|
83
|
+
ok('D4 a kind Home has no view for is the chat alone, named by its label', s.top === 'Ana Lim' && (!s.vw || (s.pop && /All sessions/.test(s.vwTitle))), // the popup's work side holds the session list (home-page-retire)
|
|
84
|
+
JSON.stringify(s));
|
|
81
85
|
// bug 2026-10-24: the Board's program panel Discuss named board:program:<id>, which Home sent as a Board row it does not have
|
|
82
86
|
// ("that row is not on the page"); it lands on the program's own conversation, the one its tasks open
|
|
83
87
|
await ctx.route(/\/api\/programs(\?.*)?$/, (r) => json(r, { ok: true, programs: [{ id: 'project-ascent', title: 'Project Ascent', members: [], tasks: [], milestones: [] }] }));
|
|
84
88
|
u = await discussFrom({ kind: 'Program', id: 'program:project-ascent', title: 'Project Ascent' });
|
|
85
89
|
ok('D6 a program\'s Discuss names it: about=board:program:<id>', u.searchParams.get('about') === 'board:program:project-ascent', u.search);
|
|
86
|
-
s = await until(async () => { const v = await page.evaluate(() => { const c = document.querySelector('[data-hm-scope]'); return { top: document.querySelector('#hmTopTitle').textContent, scope: c ? c.textContent.trim() : '' }; }); return /Project Ascent/.test(v.scope) ? v : null; }, 15000)
|
|
87
|
-
|| await page.evaluate(() => ({ top: document.querySelector('#hmTopTitle').textContent, scope: ((document.querySelector('[data-hm-scope]') || {}).textContent || '').trim() }));
|
|
90
|
+
s = await until(async () => { const v = await page.evaluate(() => { const c = document.querySelector('[data-hm-scope]'); return { top: (document.querySelector('.cz-pop:not([hidden]) .cz-pop-t span') || document.querySelector('#hmTopTitle')).textContent, scope: c ? c.textContent.trim() : '' }; }); return /Project Ascent/.test(v.scope) ? v : null; }, 15000)
|
|
91
|
+
|| await page.evaluate(() => ({ top: (document.querySelector('.cz-pop:not([hidden]) .cz-pop-t span') || document.querySelector('#hmTopTitle')).textContent, scope: ((document.querySelector('[data-hm-scope]') || {}).textContent || '').trim() }));
|
|
88
92
|
ok('D6 a program lands on its own conversation: the chat goes in the program, not All work', s.top === 'Project Ascent' && s.scope === 'In: Project Ascent', JSON.stringify(s));
|
|
89
93
|
ok('D5 no page error', errors.length === 0, errors.join(' | '));
|
|
90
94
|
finish();
|
|
@@ -87,8 +87,10 @@ const SHOTS = process.env.PMOS_SHOTS || '', TAG = process.env.PMOS_SHOTS_TAG ||
|
|
|
87
87
|
return r.fulfill({ status: 200, contentType: f.kind === 'markdown' ? 'text/markdown' : 'text/plain', headers: { 'X-Doc-Kind': f.kind }, body: f.text });
|
|
88
88
|
});
|
|
89
89
|
// premium-agreed-design: a chat is Home's own (?about= names the conversation, as a list row does) and a file opens in the Viewer card
|
|
90
|
-
|
|
91
|
-
await
|
|
90
|
+
// on a desktop the chat opens in the popup (home-page-retire): wait until its box shows
|
|
91
|
+
await page.goto(BASE + '/today.html?about=work:html-test&theme=' + theme);
|
|
92
|
+
await until(() => page.evaluate(() => { const t = document.querySelector('#hmFoot textarea'); return !!document.querySelector('#hmLog') && !!t && t.getClientRects().length > 0; }), 15000);
|
|
93
|
+
await sleep(400);
|
|
92
94
|
return { ctx, page, errors, out };
|
|
93
95
|
};
|
|
94
96
|
const press = (page, file) => page.evaluate((f) => {
|
|
@@ -135,7 +137,9 @@ const SHOTS = process.env.PMOS_SHOTS || '', TAG = process.env.PMOS_SHOTS_TAG ||
|
|
|
135
137
|
const fr = await frameOf(page);
|
|
136
138
|
if (fr) await until(() => fr.evaluate(() => document.querySelectorAll('.row').length === 6), 6000);
|
|
137
139
|
else await sleep(1500);
|
|
138
|
-
|
|
140
|
+
// the frame sizes itself once its document is in (slower on a loaded runner): wait for that, up to 8 s
|
|
141
|
+
const look = () => page.evaluate(() => { const f = document.querySelector('#czViewer .obody.vw iframe'), r = f && f.getBoundingClientRect(); const pe = f && f.parentElement, ps = pe && getComputedStyle(pe), b = pe && { width: pe.clientWidth - parseFloat(ps.paddingLeft) - parseFloat(ps.paddingRight) }; return r ? { w: Math.round(r.width), h: Math.round(r.height), col: Math.round(b.width), sx: document.documentElement.scrollWidth - innerWidth } : null; });
|
|
142
|
+
const geo = await until(async () => { const g = await look(); return g && g.w >= 300 && g.h >= 400 ? g : null; }, 8000) || await look();
|
|
139
143
|
// re-pointed for premium-agreed-design: on a desktop Home the Viewer sits in the docked chat's column (about 330 px at 1280), so the frame
|
|
140
144
|
// must fill its file card's content box and keep a readable 300 px, rather than a fixed 500 px that only the old full-width dialog had
|
|
141
145
|
ok(`H1 at ${w} ${theme} the frame fills the viewer's width and has room to read`, geo && geo.w >= 300 && geo.w >= geo.col - 2 && geo.h >= 400 && geo.sx <= 0, JSON.stringify(geo));
|
|
@@ -58,18 +58,18 @@ const json = (r, body, status = 200) => r.fulfill({ status, contentType: 'applic
|
|
|
58
58
|
await page.route('**/api/sessions/conversation**', (r) => json(r, { ok: true, state: 'conv', turn: 'user', messages: [{ role: 'user', text: 'The meter double counts', at: Date.now() - 60000 }] }));
|
|
59
59
|
await page.route('**/api/session/initiative', (r) => { posts.push(JSON.parse(r.request().postData() || '{}')); return json(r, { ok: true }); });
|
|
60
60
|
};
|
|
61
|
+
// Home's list is gone (home-desk-layout-delete): a session opens from its address, as the live list, a link or a search opens it
|
|
61
62
|
const openSession = async (page, name) => {
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
await
|
|
63
|
+
const s = SESSIONS.find((x) => x.name === name); if (!s) return false;
|
|
64
|
+
await page.goto(BASE + '/today.html?theme=light&session=' + s.id);
|
|
65
|
+
return !!(await until(() => page.evaluate(() => !!document.querySelector('#hmChat #hmIn')), 10000)) && (await sleep(600), true);
|
|
65
66
|
};
|
|
66
67
|
const chip = (page) => page.evaluate(() => { const s = document.querySelector('#hmSug'); return s && !s.hidden ? s.textContent.replace(/\s+/g, ' ').trim() : ''; });
|
|
67
68
|
|
|
68
69
|
const posts = [];
|
|
69
70
|
let page = await ctx.newPage(); await setup(page, posts);
|
|
70
|
-
await page.goto(BASE + '/premium.html?theme=light');
|
|
71
71
|
const opened = await openSession(page, 'Fix the usage meter on billing');
|
|
72
|
-
ok('L1 the loose session opens from
|
|
72
|
+
ok('L1 the loose session opens from its address', opened);
|
|
73
73
|
ok('L1 the chip names the matching initiative, once, with Link it', /^Looks like Usage-based billing\s*Link it$/.test(await until(() => chip(page))), await chip(page));
|
|
74
74
|
await openSession(page, 'Lunch plans for Friday');
|
|
75
75
|
ok('L2 a loose chat that matches no initiative shows no chip', (await chip(page)) === '');
|
|
@@ -79,20 +79,16 @@ const json = (r, body, status = 200) => r.fulfill({ status, contentType: 'applic
|
|
|
79
79
|
await page.close();
|
|
80
80
|
|
|
81
81
|
page = await ctx.newPage(); await setup(page, posts);
|
|
82
|
-
await page.goto(BASE + '/premium.html?theme=light');
|
|
83
82
|
await openSession(page, 'Fix the usage meter on billing');
|
|
84
83
|
await until(() => chip(page));
|
|
85
84
|
await page.click('#hmSug [data-hm-sug="x"]');
|
|
86
85
|
ok('L4 × hides the chip', (await chip(page)) === '');
|
|
87
|
-
await
|
|
86
|
+
await openSession(page, 'Fix the usage meter on billing'); await sleep(800);
|
|
88
87
|
ok('L4 a dismissed guess stays hidden for that chat after a reload', (await chip(page)) === '');
|
|
89
88
|
await page.close(); await ctx.close();
|
|
90
89
|
|
|
91
90
|
const pctx = await browser.newContext({ viewport: { width: 390, height: 844 }, hasTouch: true });
|
|
92
91
|
page = await pctx.newPage(); await setup(page, []);
|
|
93
|
-
await page.goto(BASE + '/premium.html?theme=light');
|
|
94
|
-
const loose = await until(async () => page.$('#hmList button:has-text("Not in an initiative")'), 10000); // the phone folds loose chats into one row
|
|
95
|
-
if (loose) { await loose.click(); await sleep(500); }
|
|
96
92
|
const popen = await openSession(page, 'Fix the usage meter on billing');
|
|
97
93
|
if (process.env.LS_DEBUG) { console.log('phone open', popen); await page.screenshot({ path: process.env.LS_DEBUG }); }
|
|
98
94
|
const sz = await until(() => page.evaluate(() => { const b = document.querySelector('#hmSug:not([hidden]) [data-hm-sug="link"]'); if (!b) return null; const r = b.getBoundingClientRect(); return r.width && { w: r.width, h: r.height }; }));
|
|
@@ -63,7 +63,7 @@ const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'applicati
|
|
|
63
63
|
if (u.searchParams.get('view') === 'week' && week) return json(r, week);
|
|
64
64
|
return json(r, { ok: true, view: u.searchParams.get('view') || 'quarter', cells: [], gantt: [], no_plan: 0, strategy: [], today: DATE });
|
|
65
65
|
});
|
|
66
|
-
await p.goto(`${F.BASE}/
|
|
66
|
+
await p.goto(`${F.BASE}/today.html?ws=${encodeURIComponent(ws)}`);
|
|
67
67
|
if (width < 641) {
|
|
68
68
|
await until(() => p.evaluate(() => !!document.querySelector('#hmList')));
|
|
69
69
|
// testing fixes: the card is no longer in the phone's list. It is the greeting's detail, in the Viewer: the greeting opens it,
|
|
@@ -137,7 +137,7 @@ const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'applicati
|
|
|
137
137
|
await wait(p, /Starts/);
|
|
138
138
|
await p.click('#phoneCard [data-pha="phopen"]');
|
|
139
139
|
await sleep(800);
|
|
140
|
-
ok('O2 when the calendar does not list it, the meeting still opens from the day\'s record, never in the old dialog and never the console', await p.evaluate(() => !document.querySelector('#dlg.on') && !!document.querySelector('#czViewer:not([hidden])') && /\/
|
|
140
|
+
ok('O2 when the calendar does not list it, the meeting still opens from the day\'s record, never in the old dialog and never the console', await p.evaluate(() => !document.querySelector('#dlg.on') && !!document.querySelector('#czViewer:not([hidden])') && /\/today\.html$/.test(location.pathname)));
|
|
141
141
|
await p.__ctx.close();
|
|
142
142
|
|
|
143
143
|
/* D: Done and Undo, on a real item */
|
|
@@ -98,7 +98,7 @@ const SHOTS = process.env.PMOS_SHOTS || '';
|
|
|
98
98
|
});
|
|
99
99
|
await page.route('**/api/doc/export*', (r) => r.fulfill({ status: 200, contentType: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', headers: { 'Content-Disposition': 'attachment; filename="2026-10-19.docx"' }, body: 'PK' }));
|
|
100
100
|
// premium-agreed-design: a chat is Home's own (?about= names the conversation) and a file it names opens in the Viewer card
|
|
101
|
-
await page.goto(BASE + '/
|
|
101
|
+
await page.goto(BASE + '/today.html?about=work:download-test&theme=' + theme);
|
|
102
102
|
await until(() => page.evaluate(() => !!document.querySelector('#hmLog') && !!document.querySelector('#hmFoot textarea')), 15000);
|
|
103
103
|
return { ctx, page, errors, asked };
|
|
104
104
|
};
|
|
@@ -62,7 +62,7 @@ const SHOTS = process.env.PMOS_SHOTS || '';
|
|
|
62
62
|
await page.route('**/api/doc/locate*', json({ ok: true, ws: 'w0', rel: HTMLF, abs: '/Users/pm/pmos/' + HTMLF, name: '2026-10-19.html', mtime: 1, size: REPORT.length }));
|
|
63
63
|
await page.route('**/api/doc?*', (r) => r.fulfill({ status: 200, contentType: 'text/plain', headers: { 'X-Doc-Kind': 'html' }, body: REPORT }));
|
|
64
64
|
// premium-agreed-design: the session's conversation is Home's chat (?session= names it) and the file it names opens in the Viewer card
|
|
65
|
-
await page.goto(BASE + '/
|
|
65
|
+
await page.goto(BASE + '/today.html?session=s-flicker&theme=' + theme);
|
|
66
66
|
const fp = await until(() => page.$('#hmLog button.fpath[data-file]'), 15000);
|
|
67
67
|
if (fp) await fp.evaluate((b) => b.click()); // on a phone the dialog opens on the Detail side, so the press goes through the button's own handler
|
|
68
68
|
return { ctx, page, errors, conv };
|
|
@@ -126,7 +126,7 @@ const SHOTS = process.env.PMOS_SHOTS || '';
|
|
|
126
126
|
ok('K3 the copy is under a sandbox CSP and holds the document\'s words', view.status === 200 && /^sandbox[;\s]/.test(view.headers['content-security-policy'] || '') && /default-src 'none'/.test(view.headers['content-security-policy']) && /Download and share a file from the viewer/.test(view.text), view.headers['content-security-policy']);
|
|
127
127
|
const file = await req(SBASE + S + '/file', { headers: C });
|
|
128
128
|
ok('K3 Download gives the file\'s own text as an attachment', file.status === 200 && /attachment; filename="premium-viewer-share-prd\.md"/.test(file.headers['content-disposition'] || '') && file.text === fs.readFileSync(path.join(REPO, PRD), 'utf8'));
|
|
129
|
-
ok('K3 any other path is 404, including the workspace API', (await req(SBASE + '/')).status === 404 && (await req(SBASE + '/api/shares')).status === 404 && (await req(SBASE + '/s/short')).status === 404 && (await req(SBASE + '/
|
|
129
|
+
ok('K3 any other path is 404, including the workspace API', (await req(SBASE + '/')).status === 404 && (await req(SBASE + '/api/shares')).status === 404 && (await req(SBASE + '/s/short')).status === 404 && (await req(SBASE + '/today.html')).status === 404);
|
|
130
130
|
for (let i = 0; i < 5; i++) await form('wrong-' + i);
|
|
131
131
|
const locked = await form(PASS);
|
|
132
132
|
ok('K3 five wrong tries lock the link, even for the right password', locked.status === 429 && /15 minutes/.test(locked.text), locked.status);
|
|
@@ -152,7 +152,7 @@ const SHOTS = process.env.PMOS_SHOTS || '';
|
|
|
152
152
|
page.on('pageerror', (e) => errors.push(String((e && e.message) || e)));
|
|
153
153
|
await page.route('**/api/brief-page*', (r) => r.fulfill({ contentType: 'application/json', body: '{"ok":false,"error":"off in this suite"}' }));
|
|
154
154
|
// premium-agreed-design: a chat is Home's own (?about= names the conversation) and a file it names opens in the Viewer card
|
|
155
|
-
await page.goto(BASE + '/
|
|
155
|
+
await page.goto(BASE + '/today.html?about=work:share-test&theme=' + theme);
|
|
156
156
|
await until(() => page.evaluate(() => !!document.querySelector('#hmLog') && !!document.querySelector('#hmFoot textarea')), 15000);
|
|
157
157
|
await page.evaluate((f) => { const b = document.createElement('button'); b.type = 'button'; b.className = 'fpath'; b.dataset.file = f; b.textContent = f; document.querySelector('#hmLog').append(b); b.click(); }, PRD);
|
|
158
158
|
await until(() => page.$('#czViewer:not([hidden]) .obody.vw [data-fsh]'), 10000);
|
|
@@ -45,7 +45,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
|
45
45
|
const S = { errors: [] };
|
|
46
46
|
page.on('pageerror', (e) => S.errors.push(String((e && e.message) || e)));
|
|
47
47
|
await page.route('**/api/briefing-premium*', (r) => r.fulfill({ status: 200, contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model: B.build(F.facts()), as_of: Date.now() }) }));
|
|
48
|
-
await page.goto(BASE + '/
|
|
48
|
+
await page.goto(BASE + '/today.html?theme=' + theme);
|
|
49
49
|
await until(() => page.evaluate(() => document.querySelectorAll('#hmList .hm-r').length > 0 && !!window.czViewer), 20000);
|
|
50
50
|
await page.evaluate(() => import('/pm/premium-viewer.js'));
|
|
51
51
|
S.up = await until(() => page.evaluate(() => !!window.__premiumViewer && !!window.czViewer), 10000);
|
|
@@ -146,7 +146,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
|
146
146
|
await E.ctx.close();
|
|
147
147
|
|
|
148
148
|
/* C9 on Home, the Viewer widens for the week */
|
|
149
|
-
const G = await F.open(browser, BASE, '/
|
|
149
|
+
const G = await F.open(browser, BASE, '/today.html', { w: 1520, h: 900 }); // the rail of places takes 80 px of Home's desk (six-place navigation): at 1520 the side beside the chat is as wide as it was at 1440
|
|
150
150
|
await until(() => G.page.evaluate(() => !!(window.czViews && window.czViews.openCalendar)), 15000);
|
|
151
151
|
await G.page.evaluate(() => window.czViews.openCalendar());
|
|
152
152
|
await until(() => G.page.evaluate(() => !!document.querySelector('#czViewer .vzc-dy')), 15000);
|