create-pmos 0.397.0 → 0.399.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +25 -25
- package/payload/KIT-VERSION +2 -2
- 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/payload/state/log.md +1 -1
- package/workspace/briefing-premium-adddoc-test.js +105 -52
- package/workspace/briefing-premium-board-test.js +284 -128
- package/workspace/briefing-premium-calendar-2-test.js +135 -198
- package/workspace/briefing-premium-calendar-3-test.js +143 -418
- package/workspace/briefing-premium-calendar-test.js +85 -196
- package/workspace/briefing-premium-doc-edit-test.js +99 -83
- package/workspace/briefing-premium-initiative-test.js +175 -290
- package/workspace/briefing-premium-insights-test.js +414 -219
- package/workspace/briefing-premium-metrics-test.js +55 -97
- package/workspace/briefing-premium-products-test.js +44 -28
- package/workspace/briefing-premium-sources-test.js +70 -49
- package/workspace/briefing-premium-test.js +155 -648
- package/workspace/briefing-premium-work-test.js +88 -283
- package/workspace/changelog.json +24 -0
- package/workspace/ev-everywhere-test.js +210 -0
- package/workspace/fixtures/board-premium-trail.js +32 -0
- package/workspace/fixtures/premium-viewer-fixtures.js +187 -0
- package/workspace/guide/briefing-premium.md +3 -1
- package/workspace/guide/home.md +68 -0
- package/workspace/guide/index.md +1 -0
- package/workspace/lib/agent-roles.js +71 -0
- package/workspace/lib/board-grill.js +63 -0
- package/workspace/lib/board-premium.js +121 -24
- package/workspace/lib/board-trail.js +223 -0
- package/workspace/lib/home-work-item.js +58 -0
- package/workspace/lib/initiative-layout.js +77 -0
- package/workspace/lib/insights-goals.js +196 -0
- package/workspace/lib/insights-premium.js +64 -15
- package/workspace/lib/insights-records.js +115 -0
- package/workspace/lib/jira-tickets.js +1 -1
- package/workspace/lib/meeting-points.js +52 -0
- package/workspace/lib/news-for-you.js +88 -0
- package/workspace/lib/notes-series.js +29 -6
- package/workspace/lib/report-confirm.js +48 -0
- package/workspace/lib/route-modules.js +12 -0
- package/workspace/lib/routes-board-docs.js +46 -0
- package/workspace/lib/routes-board-grill.js +90 -0
- package/workspace/lib/routes-board-trail.js +33 -0
- package/workspace/lib/routes-home-desk.js +176 -0
- package/workspace/lib/routes-home-review.js +108 -0
- package/workspace/lib/routes-initiative-layout.js +57 -0
- package/workspace/lib/routes-insights-premium.js +16 -4
- package/workspace/lib/routes-insights-records.js +133 -0
- package/workspace/lib/routes-meeting-points.js +37 -0
- package/workspace/lib/routes-news.js +57 -0
- package/workspace/lib/routes-notes.js +3 -1
- package/workspace/lib/routes-report-confirm.js +31 -0
- package/workspace/lib/routes-search.js +38 -0
- package/workspace/lib/routes-viewer.js +108 -0
- package/workspace/lib/search-index.js +176 -0
- package/workspace/lib/transcript-steps.js +123 -0
- package/workspace/lib/viewer-meeting.js +205 -0
- package/workspace/lib/viewer-report.js +89 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-board-actions-test.js +128 -82
- package/workspace/premium-briefing-depth-test.js +104 -90
- package/workspace/premium-chat-attach-test.js +54 -63
- package/workspace/premium-chat-chart-tab-test.js +37 -37
- package/workspace/premium-chat-context-test.js +19 -18
- package/workspace/premium-chat-goal-view-test.js +23 -23
- package/workspace/premium-chat-notes-test.js +26 -31
- package/workspace/premium-chat-report-tab-test.js +46 -28
- package/workspace/premium-chat-term-test.js +16 -16
- package/workspace/premium-chat-viewer-test.js +60 -59
- package/workspace/premium-core-doc-issue-test.js +52 -43
- package/workspace/premium-html-viewer-test.js +14 -17
- package/workspace/premium-phone-card-test.js +10 -3
- package/workspace/premium-phone-room-test.js +41 -35
- package/workspace/premium-report-read-test.js +152 -197
- package/workspace/premium-viewer-download-test.js +19 -22
- package/workspace/premium-viewer-flicker-test.js +11 -16
- package/workspace/premium-viewer-share-test.js +6 -9
- package/workspace/premium-viewer-test.js +41 -60
- package/workspace/premium-vw-backlog-test.js +53 -33
- package/workspace/premium-vw-cal-test.js +97 -128
- package/workspace/premium-vw-copy-test.js +17 -33
- package/workspace/premium-vw-doc-test.js +17 -10
- package/workspace/premium-vw-item-test.js +50 -49
- package/workspace/premium-vw-jira-test.js +53 -27
- package/workspace/premium-vw-meet-test.js +115 -187
- package/workspace/premium-vw-notes-test.js +88 -109
- package/workspace/premium-vw-rec-test.js +71 -194
- package/workspace/premium-vw-slides-test.js +46 -50
- package/workspace/premium-welcome-test.js +3 -2
- package/workspace/premium-work-depth-test.js +61 -53
- package/workspace/public/pm/bd-acts.js +383 -0
- package/workspace/public/pm/bd-asks.js +261 -0
- package/workspace/public/pm/bd-pop.js +59 -0
- package/workspace/public/pm/bd-span.js +222 -82
- package/workspace/public/pm/bd-stages.js +25 -11
- package/workspace/public/pm/bd-views.js +169 -0
- package/workspace/public/pm/c3-doc-sheet.js +1 -1
- package/workspace/public/pm/c3-md.js +3 -395
- package/workspace/public/pm/c3-phone-detail.js +1 -1
- package/workspace/public/pm/c3-phone-model.js +3 -68
- package/workspace/public/pm/chat-term.js +3 -3
- package/workspace/public/pm/cozy-board.css +798 -230
- package/workspace/public/pm/cozy-ev.css +228 -0
- package/workspace/public/pm/cozy-evmodel.js +106 -0
- package/workspace/public/pm/cozy-evui.js +47 -0
- package/workspace/public/pm/cozy-home.css +570 -142
- package/workspace/public/pm/cozy-home.js +5 -3
- package/workspace/public/pm/cozy-insights.css +437 -170
- package/workspace/public/pm/cozy-md.js +396 -0
- package/workspace/public/pm/cozy-nav.js +104 -29
- package/workspace/public/pm/cozy-news.js +140 -0
- package/workspace/public/pm/cozy-placeholder.js +26 -0
- package/workspace/public/pm/cozy-search.js +203 -0
- package/workspace/public/pm/cozy-settings.js +198 -0
- package/workspace/public/pm/cozy-sources.js +89 -0
- package/workspace/public/pm/cozy-today.css +217 -0
- package/workspace/public/pm/cozy-viewer.css +3 -3
- package/workspace/public/pm/cozy-viewer.js +145 -0
- package/workspace/public/pm/cozy-vw-mtg.css +350 -0
- package/workspace/public/pm/cozy-vw-rp.css +152 -0
- package/workspace/public/pm/cozy-vw.css +485 -0
- package/workspace/public/pm/cozy.css +83 -1
- package/workspace/public/pm/home-adddoc.js +48 -0
- package/workspace/public/pm/home-app.js +1179 -0
- package/workspace/public/pm/home-around.js +413 -0
- package/workspace/public/pm/home-chat.js +512 -0
- package/workspace/public/pm/home-data.js +312 -0
- package/workspace/public/pm/home-dictate.js +54 -0
- package/workspace/public/pm/home-draft.js +68 -0
- package/workspace/public/pm/home-ini-model.js +190 -0
- package/workspace/public/pm/home-ini.css +171 -0
- package/workspace/public/pm/home-ini.js +456 -0
- package/workspace/public/pm/home-list.js +276 -0
- package/workspace/public/pm/home-more.js +132 -0
- package/workspace/public/pm/home-phone-card.js +109 -0
- package/workspace/public/pm/home-review.js +104 -0
- package/workspace/public/pm/home-task.js +67 -0
- package/workspace/public/pm/home-today.js +144 -0
- package/workspace/public/pm/home-work.js +547 -0
- package/workspace/public/pm/phone-moment.js +69 -0
- package/workspace/public/pm/pm-work-view.js +1 -1
- package/workspace/public/pm/premium-attach.js +4 -0
- package/workspace/public/pm/premium-board.js +548 -395
- package/workspace/public/pm/premium-chart-tab.js +109 -62
- package/workspace/public/pm/premium-deck.js +3 -3
- package/workspace/public/pm/premium-first.js +23 -21
- package/workspace/public/pm/premium-insights.js +1102 -581
- package/workspace/public/pm/premium-meeting.js +61 -549
- package/workspace/public/pm/premium-mtg-present.js +138 -0
- package/workspace/public/pm/premium-mtg-replay.js +142 -0
- package/workspace/public/pm/premium-notes.js +1 -1
- package/workspace/public/pm/premium-report-frame.css +20 -0
- package/workspace/public/pm/premium-report-read.js +669 -476
- package/workspace/public/pm/premium-report-tab.js +116 -67
- package/workspace/public/pm/premium-shell.js +76 -123
- package/workspace/public/pm/premium-viewer.js +22 -1
- package/workspace/public/pm/premium-vw-cal.js +277 -48
- package/workspace/public/pm/premium-vw-doc.css +6 -0
- package/workspace/public/pm/premium-vw-doc.js +40 -2
- package/workspace/public/pm/premium-vw-file.js +2 -2
- package/workspace/public/pm/premium-vw-meet.js +6 -83
- package/workspace/public/pm/premium-vw-mtg.js +958 -0
- package/workspace/public/pm/premium-vw-notes.js +116 -68
- package/workspace/public/pm/premium-vw-open.js +35 -0
- package/workspace/public/pm/premium-vw-page.js +16 -0
- package/workspace/public/pm/premium-vw-rec.js +11 -218
- package/workspace/public/pm/premium-vw-slides.css +5 -0
- package/workspace/public/pm/premium-vw-slides.js +44 -8
- package/workspace/public/pm/rp-parts.js +269 -0
- package/workspace/public/pm/term-view.js +22 -0
- package/workspace/public/premium-board.html +29 -70
- package/workspace/public/premium-initiative.html +8 -48
- package/workspace/public/premium-insights.html +26 -64
- package/workspace/public/premium-viewer.html +20 -0
- package/workspace/public/premium.html +18 -107
- package/workspace/r/m1.png +0 -0
- package/workspace/r/m2.png +0 -0
- package/workspace/r/m3.png +0 -0
- package/workspace/r/nl.png +0 -0
- package/workspace/server.js +18 -3
- package/workspace/test-files.json +1 -0
- package/workspace/test-lists/home-libs.json +9 -0
- package/workspace/test-lists/initiative-layout.json +9 -0
- package/workspace/test-lists/premium-report-read.json +1 -1
- package/workspace/test-lists/premium-uncovered-meetings.json +9 -0
- package/workspace/test-lists/premium-uncovered-reports.json +9 -0
- package/workspace/test-lists/premium-vw-agreed.json +9 -0
- package/workspace/test-lists/premium-vw-notes.json +1 -1
- package/workspace/test-lists/uf-everywhere.json +15 -0
- package/workspace/test-lists/uf-home.json +9 -0
- package/workspace/test-lists/uncovered-board.json +9 -0
- package/workspace/public/pm/premium-work.js +0 -729
- package/workspace/public/pm/premium.js +0 -1146
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
/* premium-core-doc-issue-test.js — Issue it on a core document draft, on the premium Board and the premium initiative page (initiative premium-core-doc-issue;
|
|
4
4
|
* planning/prd/premium-core-doc-issue-prd.md I1 to I7). A real server on a scratch `team` repository, never the PMOS checkout. The drafts are written by the
|
|
5
5
|
* core-docs writer (lib/core-docs.js writeDraft), so the pages read what the agent's run would leave. The real pages press the real route:
|
|
6
|
-
* R reading (slot and path) · B the Board reader and Issue it · I the initiative
|
|
6
|
+
* R reading (slot and path) · B the Board reader and Issue it · I the initiative (a layout in Home since premium-agreed-design: its Overview, the draft
|
|
7
|
+
* reader in the Viewer), unsaved edits and a refusal · P the POST allow-list · F floors */
|
|
7
8
|
const fs = require('fs');
|
|
8
9
|
const path = require('path');
|
|
9
10
|
const { spawn } = require('child_process');
|
|
@@ -34,7 +35,7 @@ const finish = async (code) => {
|
|
|
34
35
|
process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
35
36
|
|
|
36
37
|
const ledger = () => { const f = CD.ledgerFile(team); return fs.existsSync(f) ? fs.readFileSync(f, 'utf8').split('\n').filter(Boolean).map((x) => JSON.parse(x)) : []; };
|
|
37
|
-
const ALLOWED = /^\/api\/(?:core-docs\/issue|briefing-premium\/note|doc-health\/check)$/;
|
|
38
|
+
const ALLOWED = /^\/api\/(?:core-docs\/issue|briefing-premium\/note|briefing-premium\/seen|doc-health\/check)$/; // seen: Home records what it showed, not a press
|
|
38
39
|
const BODY = '## Purpose\n\nWhy this board exists.\n\n## Scope\n\nWhat it covers.\n';
|
|
39
40
|
|
|
40
41
|
(async () => {
|
|
@@ -81,66 +82,73 @@ const BODY = '## Purpose\n\nWhy this board exists.\n\n## Scope\n\nWhat it covers
|
|
|
81
82
|
if (theme === 'dark') await page.evaluate(() => { document.documentElement.dataset.theme = 'dark'; });
|
|
82
83
|
return { ctx, page, errors, posts };
|
|
83
84
|
};
|
|
84
|
-
const dlgOn = async (p) => { const v = await until(() => p.evaluate(() => document.querySelector('#dlg
|
|
85
|
+
const dlgOn = async (p) => { const v = await until(() => p.evaluate(() => !!document.querySelector('#dlg.on'))); await sleep(800); return v; };
|
|
85
86
|
const toastIs = (p, re) => until(() => p.evaluate((s) => { const t = document.querySelector('#toast'); return t.classList.contains('on') && new RegExp(s).test(t.textContent) ? t.textContent : null; }, re.source));
|
|
86
87
|
const H = await T.pressHeaders(BASE);
|
|
87
88
|
const nonce = H['x-pmos-nonce'];
|
|
88
89
|
|
|
89
|
-
/* B the Board reader
|
|
90
|
+
/* B the Board reader (premium-uncovered-features, BdDocs: the Documents tab is a table; a row's title opens the document in the side panel,
|
|
91
|
+
with its health, edit log, the file's text and the Issue it bar) */
|
|
92
|
+
const bToast = (p, re) => until(() => p.evaluate((s) => { const t = document.querySelector('#bdToast'); return t && !t.hidden && new RegExp(s).test(t.textContent) ? t.textContent : null; }, re.source));
|
|
90
93
|
const P = await open('/premium-board.html'), p = P.page;
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
await p.
|
|
95
|
-
|
|
96
|
-
ok('B2 the
|
|
97
|
-
ok('B2
|
|
94
|
+
await until(() => p.evaluate(() => document.querySelectorAll('#ibBody .ini2').length > 0), 60000);
|
|
95
|
+
await p.click('#tabDocs');
|
|
96
|
+
ok('B1 a board document is a row whose title opens the reader', await until(() => p.evaluate((k) => !!document.querySelector(`#docBody [data-opendoc="core:${k}"]`), bkey), 60000));
|
|
97
|
+
ok('B1 every document row has a title that opens it', await p.evaluate(() => [...document.querySelectorAll('#docBody .bd-dt[data-docrow]')].every((r) => !!r.querySelector('[data-opendoc]'))));
|
|
98
|
+
await p.click(`#docBody [data-opendoc="core:${bkey}"]`);
|
|
99
|
+
ok('B2 the reader shows the file\'s text and path, and the bar says nothing is sent', await until(() => p.evaluate((pt) => { const o = document.querySelector('#peek'); return !o.hidden && /Why this board exists/.test(o.textContent) && o.textContent.includes(pt) && !!o.querySelector('[data-issue-bar="draft"]') && /Nothing is sent/.test(o.querySelector('[data-issue-bar]').textContent) && !!o.querySelector('[data-act="issue"]'); }, d1.path)), await p.evaluate(() => document.querySelector('#peek').textContent));
|
|
100
|
+
ok('B2 no old dialog opens', await p.evaluate(() => !!!document.querySelector('#dlg.on')));
|
|
98
101
|
const n0 = ledger().filter((l) => l.ev === 'issue').length;
|
|
99
|
-
await p.click('[data-
|
|
100
|
-
ok('B3 Issue it says it sent nothing', !!(await
|
|
102
|
+
await p.click('#peek [data-act="issue"]');
|
|
103
|
+
ok('B3 Issue it says it sent nothing', !!(await bToast(p, /Issued\. Nothing was sent to anyone/)));
|
|
101
104
|
const sent = P.posts.filter((x) => x.path === '/api/core-docs/issue');
|
|
102
105
|
ok('B4 it posted the workspace, the scope, the key and the slot, and nothing else, with the launch nonce', sent.length === 1 && Object.keys(sent[0].body).sort().join() === 'key,scope,slot,ws' && sent[0].body.scope === bscope && sent[0].body.key === bkey && sent[0].body.slot === d1.slot && sent[0].body.ws === B.ws && sent[0].headers['x-pmos-nonce'] === nonce && !!nonce, JSON.stringify(sent));
|
|
103
106
|
const il = ledger().filter((l) => l.ev === 'issue');
|
|
104
107
|
ok('B5 the ledger has one new issue line for that draft, written by the PM', il.length === n0 + 1 && il[il.length - 1].slot === d1.slot && il[il.length - 1].scope === bscope && /pm/.test(String(il[il.length - 1].by)), JSON.stringify(il));
|
|
105
108
|
ok('B5 the file now says state: issued', /^state: issued$/m.test(fs.readFileSync(path.join(team, d1.path), 'utf8')));
|
|
106
|
-
ok('B6 the reader says it is issued, the Issue it press is gone, and the row reads Up to date', await until(() => p.evaluate(() => { const o = document.querySelector('#
|
|
109
|
+
ok('B6 the reader says it is issued, the Issue it press is gone, and the row reads Up to date', await until(() => p.evaluate(() => { const o = document.querySelector('#peek'); return !o.hidden && !!o.querySelector('[data-issue-bar="done"]') && !o.querySelector('[data-act="issue"]'); }), 30000) && await until(() => p.evaluate((k) => { const r = document.querySelector(`#docBody [data-docrow="core:${k}"]`); return r && /Up to date/.test(r.textContent); }, bkey), 30000), await p.evaluate(() => document.querySelector('#peek').textContent + ' // ' + document.querySelector('#docBody').textContent));
|
|
107
110
|
await p.screenshot({ path: path.join(R.base, 'board-issued.png') });
|
|
108
111
|
await P.ctx.close();
|
|
109
112
|
|
|
110
|
-
/* I the initiative
|
|
113
|
+
/* I the initiative: a layout inside Home (premium-agreed-design). The Board's expand link lands there; the card's Overview lists the core documents (its Documents view),
|
|
114
|
+
and a draft opens a minimal reader in the Viewer (Waiting for design) with the Issue it bar, Read and Edit */
|
|
115
|
+
const ovOpen = async (p) => { await until(() => p.evaluate(() => !!document.querySelector('.hm-card [data-hm-ov]')), 60000); await p.click('.hm-card [data-hm-ov]');
|
|
116
|
+
// the Overview opens on Tasks; the core documents are its Documents view (premium-uncovered-features, canvas InDocs)
|
|
117
|
+
if (await until(() => p.evaluate(() => !!document.querySelector('#czViewer [data-hi-view="docs"]')), 30000)) await p.click('#czViewer [data-hi-view="docs"]'); };
|
|
111
118
|
const I = await open('/premium-initiative.html' + iq), ip = I.page;
|
|
112
|
-
await
|
|
113
|
-
await ip.
|
|
114
|
-
|
|
115
|
-
await ip.
|
|
116
|
-
|
|
117
|
-
await ip.
|
|
118
|
-
await ip.
|
|
119
|
-
await
|
|
120
|
-
const nI = I.posts.length;
|
|
121
|
-
await ip.click('[data-ds="issue"]');
|
|
122
|
-
ok('I2 Issue it with unsaved edits posts nothing and says to save or cancel first', await until(() => ip.evaluate(() => /unsaved changes.*Save or cancel/.test((document.querySelector('#dsErr') || {}).textContent || ''))) && I.posts.length === nI);
|
|
119
|
+
await ovOpen(ip);
|
|
120
|
+
await until(() => ip.evaluate((k) => !!document.querySelector(`#czViewer [data-ov-dread="${k}"]`), ikey), 60000);
|
|
121
|
+
await ip.click(`#czViewer [data-ov-dread="${ikey}"]`);
|
|
122
|
+
ok('I1 the reader of a draft has the Issue it bar above the text', await until(() => ip.evaluate(() => { const o = document.querySelector('#czViewer:not([hidden])'); const b = o && o.querySelector('[data-issue-bar="draft"]'); const t = o && o.querySelector('.dsbody'); return !!b && !!t && /Nothing is sent/.test(b.textContent) && /Why this board exists/.test(t.textContent) && !!(b.compareDocumentPosition(t) & Node.DOCUMENT_POSITION_FOLLOWING); }), 30000));
|
|
123
|
+
ok('I1 no old dialog opens', await ip.evaluate(() => { const d = document.querySelector('#dlg'); return !d || !d.classList.contains('on'); }));
|
|
124
|
+
await ip.click('#czViewer [data-ds="edit"]');
|
|
125
|
+
await until(() => ip.evaluate(() => !!document.querySelector('#czViewer [data-ds-host] .cfb[contenteditable="true"]')), 30000);
|
|
126
|
+
await ip.click('#czViewer [data-ds-host] .cfb'); await ip.keyboard.press('Control+End'); await ip.keyboard.type(' Unsaved line.');
|
|
127
|
+
const nI = I.posts.filter((x) => x.path === '/api/core-docs/issue').length;
|
|
128
|
+
await ip.click('#czViewer [data-ds="issue"]');
|
|
129
|
+
ok('I2 Issue it with unsaved edits posts nothing and says to save or cancel first', await until(() => ip.evaluate(() => /unsaved changes.*Save or cancel/.test((document.querySelector('#czViewer #dsErr') || {}).textContent || ''))) && I.posts.filter((x) => x.path === '/api/core-docs/issue').length === nI);
|
|
123
130
|
ok('I2 the ledger has no issue line for that draft yet', !ledger().some((l) => l.ev === 'issue' && l.slot === d2.slot && l.scope === iscope));
|
|
124
|
-
await ip.click('#
|
|
125
|
-
await ip.
|
|
126
|
-
await until(() => ip.evaluate(() => !!document.querySelector('[data-ds="issue"]')));
|
|
131
|
+
await ip.click('#czViewer [data-vd="cancel"]');
|
|
132
|
+
await until(() => ip.evaluate(() => !!document.querySelector('#czViewer [data-ds="issue"]') && !!document.querySelector('#czViewer .dsbody')));
|
|
127
133
|
/* a refusal: someone else issues the same draft first (the console, a second tab) */
|
|
128
134
|
const raced = await fetch(BASE + '/api/core-docs/issue', { method: 'POST', headers: H, body: JSON.stringify({ ws: B.ws, scope: iscope, key: ikey, slot: d2.slot }) });
|
|
129
135
|
ok('I3 setup the draft is issued behind the page\'s back', raced.status === 200);
|
|
130
|
-
await ip.click('[data-ds="issue"]');
|
|
131
|
-
ok('I3 a refused press shows the server\'s words and the
|
|
136
|
+
await ip.click('#czViewer [data-ds="issue"]');
|
|
137
|
+
ok('I3 a refused press shows the server\'s words and the reader changes nothing else', await until(() => ip.evaluate(() => /already/.test((document.querySelector('#czViewer #dsErr') || {}).textContent || '') && !!document.querySelector('#czViewer [data-issue-bar="draft"]'))));
|
|
132
138
|
ok('I3 the refusal wrote no second issue line', ledger().filter((l) => l.ev === 'issue' && l.slot === d2.slot && l.scope === iscope).length === 1);
|
|
133
|
-
await ip.click('#dlg [data-act="close"], #dClose').catch(() => {});
|
|
134
139
|
await I.ctx.close();
|
|
135
140
|
|
|
136
141
|
/* I4 a fresh page: press Issue it on the third draft */
|
|
137
142
|
const J = await open('/premium-initiative.html' + iq), jp = J.page;
|
|
138
143
|
const k3 = d3.path.split('/').slice(-2)[0];
|
|
139
|
-
await
|
|
140
|
-
await jp.
|
|
141
|
-
await
|
|
142
|
-
await jp.
|
|
143
|
-
|
|
144
|
+
await ovOpen(jp);
|
|
145
|
+
await until(() => jp.evaluate((k) => !!document.querySelector(`#czViewer [data-ov-dread="${k}"]`), k3), 60000);
|
|
146
|
+
await jp.click(`#czViewer [data-ov-dread="${k3}"]`);
|
|
147
|
+
await until(() => jp.evaluate(() => !!document.querySelector('#czViewer [data-ds="issue"]')));
|
|
148
|
+
await jp.click('#czViewer [data-ds="issue"]');
|
|
149
|
+
const issued = !!(await toastIs(jp, /Issued\. Nothing was sent to anyone/)) && await until(() => jp.evaluate(() => !!document.querySelector('#czViewer [data-issue-bar="done"]') && !document.querySelector('#czViewer [data-ds="issue"]')));
|
|
150
|
+
await sleep(1500); await ovOpen(jp);
|
|
151
|
+
ok('I4 Issue it works from the reader: the toast, the issued bar, and the Overview row reads Up to date', issued && await until(() => jp.evaluate((k) => /Up to date/.test((document.querySelector(`#czViewer [data-ov-doc="${k}"]`) || {}).textContent || ''), k3), 30000));
|
|
144
152
|
ok('I4 the file says state: issued and the ledger has its issue line', /^state: issued$/m.test(fs.readFileSync(path.join(team, d3.path), 'utf8')) && ledger().some((l) => l.ev === 'issue' && l.slot === d3.slot && l.scope === iscope));
|
|
145
153
|
await jp.screenshot({ path: path.join(R.base, 'ini-issued.png') });
|
|
146
154
|
|
|
@@ -162,12 +170,13 @@ const BODY = '## Purpose\n\nWhy this board exists.\n\n## Scope\n\nWhat it covers
|
|
|
162
170
|
const k4 = d4.path.split('/').slice(-2)[0];
|
|
163
171
|
for (const [w, h, theme] of [[390, 844, 'light'], [390, 844, 'dark'], [1280, 900, 'dark']]) {
|
|
164
172
|
const S = await open('/premium-board.html', { w, h, theme });
|
|
165
|
-
await until(() => S.page.evaluate((
|
|
166
|
-
await S.page.click(
|
|
167
|
-
await S.page.
|
|
168
|
-
await
|
|
169
|
-
|
|
170
|
-
|
|
173
|
+
await until(() => S.page.evaluate(() => document.querySelectorAll('#ibBody .ini2').length > 0), 60000);
|
|
174
|
+
await S.page.click(w <= 720 ? '#chDocs' : '#tabDocs');
|
|
175
|
+
await until(() => S.page.evaluate((k) => !!document.querySelector(`#docBody [data-opendoc="core:${k}"]`), k4), 60000);
|
|
176
|
+
await S.page.click(`#docBody [data-opendoc="core:${k4}"]`);
|
|
177
|
+
await until(() => S.page.evaluate(() => !!document.querySelector('#peek [data-act="issue"]')));
|
|
178
|
+
const f = await S.page.evaluate(() => ({ wide: document.documentElement.scrollWidth > innerWidth + 1, small: [...document.querySelectorAll('#peek [data-act="issue"]')].filter((b) => b.getBoundingClientRect().height < (innerWidth <= 720 ? 44 : 34)).map((b) => b.textContent) }));
|
|
179
|
+
ok(`F1 ${w} px ${theme}: no sideways scroll and the bar's button is 44 px on a phone`, !f.wide && !f.small.length, JSON.stringify(f));
|
|
171
180
|
await S.page.screenshot({ path: path.join(R.base, `bar-${w}-${theme}.png`) });
|
|
172
181
|
await S.ctx.close();
|
|
173
182
|
}
|
|
@@ -78,26 +78,23 @@ const SHOTS = process.env.PMOS_SHOTS || '', TAG = process.env.PMOS_SHOTS_TAG ||
|
|
|
78
78
|
const f = FILES[new URL(r.request().url()).searchParams.get('path')];
|
|
79
79
|
return r.fulfill({ status: 200, contentType: f.kind === 'markdown' ? 'text/markdown' : 'text/plain', headers: { 'X-Doc-Kind': f.kind }, body: f.text });
|
|
80
80
|
});
|
|
81
|
-
|
|
82
|
-
await
|
|
83
|
-
await page.evaluate(
|
|
84
|
-
const S = await import('/pm/premium-shell.js');
|
|
85
|
-
S.openDlg({ eye: 'Your item', title: 'Check GA Lightbox', say: 'The report is now an HTML file in the repo.', noteKey: null, pane: '<article class="paper doc"><p>Item record</p></article>', label: 'Item record' });
|
|
86
|
-
});
|
|
81
|
+
// 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
|
|
82
|
+
await page.goto(BASE + '/premium.html?about=work:html-test&theme=' + theme);
|
|
83
|
+
await until(() => page.evaluate(() => !!document.querySelector('#hmLog') && !!document.querySelector('#hmFoot textarea')), 15000);
|
|
87
84
|
return { ctx, page, errors, out };
|
|
88
85
|
};
|
|
89
86
|
const press = (page, file) => page.evaluate((f) => {
|
|
90
87
|
const b = document.createElement('button'); b.type = 'button'; b.className = 'fpath'; b.dataset.file = f; b.textContent = f;
|
|
91
|
-
document.querySelector('#
|
|
88
|
+
document.querySelector('#hmLog').append(b); b.click();
|
|
92
89
|
}, file);
|
|
93
90
|
const HTMLF = 'pmos/state/reports/lightbox-password-conversion/2026-10-19.html';
|
|
94
|
-
const frameOf = async (page) => { const h = await until(() => page.$('#
|
|
91
|
+
const frameOf = async (page) => { const h = await until(() => page.$('#czViewer .obody.vw iframe.vwframe'), 8000); return h ? h.contentFrame() : null; };
|
|
95
92
|
|
|
96
93
|
if (TAG === 'after') {
|
|
97
94
|
const { page, errors, out, ctx } = await open();
|
|
98
95
|
await press(page, HTMLF);
|
|
99
96
|
const fr = await frameOf(page);
|
|
100
|
-
ok('H1 the .html file opens as a frame, not as code', !!fr && !(await page.$('#
|
|
97
|
+
ok('H1 the .html file opens as a frame, not as code', !!fr && !(await page.$('#czViewer .obody.vw .cb')));
|
|
101
98
|
const st = fr && await until(() => fr.evaluate(() => (document.body && document.body.dataset.net ? { mode: document.compatMode, title: document.title, rows: document.querySelectorAll('.row').length, m: document.body.dataset.mode, parent: document.body.dataset.parent, store: document.body.dataset.store, net: document.body.dataset.net, h1: (document.querySelector('h1') || {}).textContent } : null)), 8000);
|
|
102
99
|
ok('H1 the page renders in standards mode with its own title and bars', st && st.mode === 'CSS1Compat' && st.h1 === 'Password Conversion Funnel' && st.rows === 6 && st.m === 'events', JSON.stringify(st));
|
|
103
100
|
// the press goes through the page's own handler; a click by coordinates can land on the viewer while it is still laying out
|
|
@@ -107,19 +104,19 @@ const SHOTS = process.env.PMOS_SHOTS || '', TAG = process.env.PMOS_SHOTS_TAG ||
|
|
|
107
104
|
ok('H1 the page\'s own script runs: its toggle redraws the bars', after === '1,310 · 100%', after || why);
|
|
108
105
|
ok('H2 the page cannot read the app, its storage or the network', st && st.parent === 'blocked' && st.store === 'blocked' && st.net === 'blocked', JSON.stringify(st));
|
|
109
106
|
ok('H2 nothing leaves the machine: the CSP refuses the remote font', out.length === 0, out.join(' '));
|
|
110
|
-
const bar = await page.evaluate(() => [...document.querySelectorAll('#
|
|
107
|
+
const bar = await page.evaluate(() => [...document.querySelectorAll('#czViewer .obody.vw [data-fv]')].map((b) => b.textContent + ':' + b.getAttribute('aria-pressed')).join());
|
|
111
108
|
ok('H3 the bar offers Page and Source, Page pressed', bar === 'Page:true,Source:false', bar);
|
|
112
|
-
await page.click('#
|
|
113
|
-
const src = await until(() => page.evaluate(() => { const p = document.querySelector('#
|
|
109
|
+
await page.click('#czViewer .obody.vw [data-fv="source"]');
|
|
110
|
+
const src = await until(() => page.evaluate(() => { const p = document.querySelector('#czViewer .obody.vw .cb pre'); return p ? { head: p.textContent.slice(0, 15), frame: !!document.querySelector('#czViewer .obody.vw iframe') } : null; }), 4000);
|
|
114
111
|
ok('H3 Source shows the file\'s text', src && src.head === '<!doctype html>' && !src.frame, JSON.stringify(src));
|
|
115
|
-
await page.click('#
|
|
112
|
+
await page.click('#czViewer .obody.vw [data-fv="page"]');
|
|
116
113
|
ok('H3 Page brings the page back', !!(await frameOf(page)));
|
|
117
114
|
await press(page, 'pmos/state/reports/lightbox-password-conversion/2026-10-19.md');
|
|
118
|
-
const md = await until(() => page.evaluate(() => { const p = document.querySelector('#
|
|
115
|
+
const md = await until(() => page.evaluate(() => { const p = document.querySelector('#czViewer:not([hidden]) .obody.vw .cfb'); return p && p.querySelector('strong') ? p.innerHTML : null; }), 6000);
|
|
119
116
|
ok('H4 a markdown file still opens as a page', md && /<strong>sign-up<\/strong>/.test(md), md);
|
|
120
117
|
await press(page, 'workspace/lib/a.js');
|
|
121
|
-
const js = await until(() => page.evaluate(() => { const p = document.querySelector('#
|
|
122
|
-
ok('H4 a plain text file still opens as code, with no Page and Source bar', js === 'js:const a = 1;\n' && !(await page.$('#
|
|
118
|
+
const js = await until(() => page.evaluate(() => { const p = document.querySelector('#czViewer:not([hidden]) .obody.vw .cb'); return p ? p.dataset.lang + ':' + p.querySelector('pre').textContent : null; }), 6000);
|
|
119
|
+
ok('H4 a plain text file still opens as code, with no Page and Source bar', js === 'js:const a = 1;\n' && !(await page.$('#czViewer:not([hidden]) .obody.vw [data-fv]')), js);
|
|
123
120
|
ok('H4 no page errors', errors.length === 0, errors.join(' | '));
|
|
124
121
|
await ctx.close();
|
|
125
122
|
}
|
|
@@ -130,7 +127,7 @@ const SHOTS = process.env.PMOS_SHOTS || '', TAG = process.env.PMOS_SHOTS_TAG ||
|
|
|
130
127
|
const fr = await frameOf(page);
|
|
131
128
|
if (fr) await until(() => fr.evaluate(() => document.querySelectorAll('.row').length === 6), 6000);
|
|
132
129
|
else await sleep(1500);
|
|
133
|
-
const geo = await page.evaluate(() => { const f = document.querySelector('#
|
|
130
|
+
const geo = await 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; });
|
|
134
131
|
// 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
|
|
135
132
|
// 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
|
|
136
133
|
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));
|
|
@@ -5,6 +5,10 @@
|
|
|
5
5
|
* with the clock set to each moment of the day; /api/brief-page, /api/phone-day and the week of the calendar are answered in the browser,
|
|
6
6
|
* because they need a clock and a day of meetings. Done and Reopen press the real routes on real items.
|
|
7
7
|
* M the eight moments · O Open the meeting · D Done and Undo · X a refused press · E a read that fails · W desktop width and the POST allow-list · L floors
|
|
8
|
+
* premium-agreed-design: the Agreed design has no place for the card, so Home keeps it usable at the top of the phone's "N need you" sheet
|
|
9
|
+
* (home-phone-card.js); premium-uncovered-features made it the Today card at the top of the phone's list (canvas HmPhone, HmPhone2), with
|
|
10
|
+
* no "Waiting for design" marker and no sheet to open. Open the meeting opens it in the cozy Viewer from the
|
|
11
|
+
* day's own record (Home's meeting line does the same), so O2 now checks that it never falls back to the old dialog.
|
|
8
12
|
* Set PHONE_CARD_SHOTS=<dir> to save screenshots of each moment at 390 wide, light and dark. */
|
|
9
13
|
const fs = require('fs');
|
|
10
14
|
const path = require('path');
|
|
@@ -60,6 +64,7 @@ const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'applicati
|
|
|
60
64
|
return json(r, { ok: true, view: u.searchParams.get('view') || 'quarter', cells: [], gantt: [], no_plan: 0, strategy: [], today: DATE });
|
|
61
65
|
});
|
|
62
66
|
await p.goto(`${F.BASE}/premium.html?ws=${encodeURIComponent(ws)}`);
|
|
67
|
+
if (width < 641) await until(() => p.evaluate(() => !!document.querySelector('#hmList'))); // the card is the Today card at the top of the phone's list (canvas HmPhone)
|
|
63
68
|
p.__posts = posts; p.__gets = gets; p.__errs = errs; p.__ctx = ctx;
|
|
64
69
|
if (shotDir && name) p.__shot = async (suffix) => { await sleep(700); fs.mkdirSync(shotDir, { recursive: true }); await p.screenshot({ path: path.join(shotDir, `${name}-${suffix}.png`) }); };
|
|
65
70
|
return p;
|
|
@@ -116,12 +121,13 @@ const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'applicati
|
|
|
116
121
|
p = await scene({ time: at(10, 20), today: [A], week: hit });
|
|
117
122
|
await wait(p, /Under way/);
|
|
118
123
|
await p.click('#phoneCard [data-pha="phopen"]');
|
|
119
|
-
ok('O1 Open the meeting opens the meeting
|
|
124
|
+
ok('O1 Open the meeting opens the meeting in the Viewer', await until(() => p.evaluate(() => { const v = document.querySelector('#czViewer:not([hidden])'); return !!v && /Partner sync/.test(v.textContent); })));
|
|
120
125
|
await p.__ctx.close();
|
|
121
126
|
p = await scene({ time: at(10, 20), today: [A], week: { ok: true, range: { start: DATE, end: DATE }, cells: [], context: {} } });
|
|
122
127
|
await wait(p, /Under way/);
|
|
123
128
|
await p.click('#phoneCard [data-pha="phopen"]');
|
|
124
|
-
|
|
129
|
+
await sleep(800);
|
|
130
|
+
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])') && /\/premium\.html$/.test(location.pathname)));
|
|
125
131
|
await p.__ctx.close();
|
|
126
132
|
|
|
127
133
|
/* D: Done and Undo, on a real item */
|
|
@@ -156,7 +162,8 @@ const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'applicati
|
|
|
156
162
|
p = await scene({ time: at(18, 0), today: [A], width: 1280 });
|
|
157
163
|
await sleep(1500);
|
|
158
164
|
ok('W1 at 1280 wide the card is not shown', (await card(p)) === null);
|
|
159
|
-
|
|
165
|
+
// premium-uncovered-features: Home reads /api/phone-day once at every width for the end-of-day Today card (canvas HmDay); the phone card never reads it at 1280
|
|
166
|
+
ok('W2 at 1280 wide only Home\'s own read asks for phone-day, once', p.__gets.filter((g) => g === '/api/phone-day').length <= 1, p.__gets.join());
|
|
160
167
|
ok('W3 nothing is written on load', p.__posts.length === 0, JSON.stringify(p.__posts));
|
|
161
168
|
await p.__ctx.close();
|
|
162
169
|
|
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
/* premium-phone-room-test.js — Focus on a phone (Wawan, 2026-10-21: the scroll area is too small; then "UI broken. Better to have manual CTA to
|
|
4
4
|
* Focus" after the automatic hiding misdrew the page with the keyboard up). A real server on a scratch repository (c3-scan-fixture.js); the
|
|
5
5
|
* conversation is filled in the page.
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
6
|
+
* premium-agreed-design: /premium-chat.html opens Home, and on a phone the chat IS the page under a top bar (no popup, so no Focus button
|
|
7
|
+
* is needed: the conversation already has the screen). The suite keeps the complaint's measure: the conversation's room.
|
|
8
|
+
* P1 at rest the chat is the page: top bar, conversation, composer, and nothing modal over it · P2 scrolling and typing hide nothing
|
|
9
|
+
* P3 the conversation gets the screen below the top bar, more than the old Focus mode's 680 px floor allows for a page with a composer
|
|
10
|
+
* P4 no Focus button and no old dialog · P5 a chat dialog opened from script on another page (Insights still has one) still takes the
|
|
11
|
+
* screen with Focus · P6 a desktop shows no Focus button
|
|
10
12
|
* Set PHONE_ROOM_SHOTS=<dir> to save the chat at 390 wide, light and dark, at rest and in focus. */
|
|
11
13
|
const { findBrowser } = require('./lib/find-browser');
|
|
12
14
|
require('./test-run').configure({ name: 'premium-phone-room' });
|
|
@@ -26,13 +28,20 @@ const finish = async (code) => {
|
|
|
26
28
|
};
|
|
27
29
|
process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
28
30
|
|
|
29
|
-
/* the page's own state: the
|
|
31
|
+
/* the page's own state on Home: the top bar, the conversation's visible room, the composer */
|
|
30
32
|
const look = () => {
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
+
const top = document.querySelector('#hmTop').getBoundingClientRect(), log = document.querySelector('#hmLog'), lr = log.getBoundingClientRect(), foot = document.querySelector('#hmFoot').getBoundingClientRect();
|
|
34
|
+
const vis = Math.max(0, Math.min(lr.bottom, foot.top, innerHeight) - Math.max(lr.top, top.bottom));
|
|
35
|
+
return { topShown: getComputedStyle(document.querySelector('#hmTop')).display !== 'none' && top.bottom > 0, topTop: Math.round(top.top), room: Math.round(vis), footIn: foot.bottom <= innerHeight + 1 && foot.top >= 0,
|
|
36
|
+
modal: !!document.querySelector('[aria-modal="true"]:not([hidden]):not([inert])'), dlg: !!document.querySelector('#dlg'), btn: !!document.querySelector('#dFocus'), vh: innerHeight, wide: document.documentElement.scrollWidth > innerWidth + 1 };
|
|
37
|
+
};
|
|
38
|
+
const MSGS = [{ role: 'user', text: 'Why did sign-ups drop?', at: '2026-10-21T08:00:00Z' }].concat(Array.from({ length: 14 }, (_, i) => ({ role: i % 2 ? 'user' : 'assistant', text: 'A line of the conversation about the sign-up drop reasons and the counts. '.repeat(3), at: '2026-10-21T08:0' + (i % 10) + ':10Z' })));
|
|
39
|
+
const hand = (dy) => { const b = document.querySelector('#hmLog'); b.dispatchEvent(new WheelEvent('wheel', { deltaY: dy })); b.scrollTop += dy; window.scrollBy(0, dy); };
|
|
40
|
+
const dlgLook = () => {
|
|
41
|
+
const g = document.querySelector('#dlg'), f = document.querySelector('#dFocus');
|
|
42
|
+
return { focus: g.classList.contains('focus'), dfocus: document.body.classList.contains('dfocus'), tabs: getComputedStyle(document.querySelector('#dTabs')).display !== 'none', dlgTop: Math.round(g.getBoundingClientRect().top), dlgH: Math.round(g.getBoundingClientRect().height), vh: innerHeight, btn: !!f };
|
|
33
43
|
};
|
|
34
44
|
const fill = () => { const s = document.querySelector('#dBody .stream'); let h = ''; for (let i = 0; i < 14; i++) h += `<div class="turn"><p>${'A line of the conversation about the sign-up drop reasons and the counts. '.repeat(3)}</p></div>`; s.insertAdjacentHTML('beforeend', h); };
|
|
35
|
-
const hand = (dy) => { const b = document.querySelector('#dBody'); b.dispatchEvent(new WheelEvent('wheel', { deltaY: dy })); b.scrollTop += dy; };
|
|
36
45
|
|
|
37
46
|
(async () => {
|
|
38
47
|
const exe = findBrowser();
|
|
@@ -46,44 +55,41 @@ const hand = (dy) => { const b = document.querySelector('#dBody'); b.dispatchEve
|
|
|
46
55
|
const open = async (width, scheme = 'light', height = 844) => {
|
|
47
56
|
const ctx = await browser.newContext({ viewport: { width, height }, colorScheme: scheme, hasTouch: true });
|
|
48
57
|
const p = await ctx.newPage(); const errs = []; p.on('pageerror', (e) => errs.push(String(e)));
|
|
49
|
-
await p.
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
await p.evaluate(
|
|
58
|
+
await p.route('**/api/briefing-premium/thread**', (r) => r.fulfill({ json: { ok: true, turns: [], session: 's-room' } }));
|
|
59
|
+
await p.route('**/api/sessions/conversation**', (r) => r.fulfill({ json: { ok: true, state: 'conv', turn: 'user', messages: MSGS } }));
|
|
60
|
+
await p.goto(chat + '&about=work:room-test');
|
|
61
|
+
await until(() => p.evaluate(() => /\/premium\.html$/.test(location.pathname) && document.querySelectorAll('#hmLog .hm-a, #hmLog .hm-u').length >= 10), 12000);
|
|
62
|
+
await sleep(300);
|
|
53
63
|
return { p, ctx, errs };
|
|
54
64
|
};
|
|
55
65
|
|
|
56
66
|
{ const { p, ctx, errs } = await open(390);
|
|
57
|
-
await until(() => p.evaluate(() => { const g = document.querySelector('#dlg'); return g.getBoundingClientRect().top < innerHeight && !g.getAnimations().some((a) => a.playState === 'running'); })); // the popup's entrance has finished
|
|
58
|
-
await sleep(300);
|
|
59
67
|
const s0 = await p.evaluate(look);
|
|
60
|
-
ok('P1 on a phone /premium-chat.html opens Home
|
|
61
|
-
await p.evaluate(hand, 300); await sleep(400); await p.evaluate(hand, -100); await p.focus('#
|
|
68
|
+
ok('P1 on a phone /premium-chat.html opens Home with the chat as the page: the top bar, the conversation and the composer, nothing modal over it', s0.topShown && s0.footIn && !s0.modal && s0.room > 0, JSON.stringify(s0));
|
|
69
|
+
await p.evaluate(hand, 300); await sleep(400); await p.evaluate(hand, -100); await p.focus('#hmIn'); await sleep(500);
|
|
62
70
|
const s1 = await p.evaluate(look);
|
|
63
|
-
ok('P2 scrolling and typing hide nothing by themselves',
|
|
64
|
-
await p.evaluate(() => document.querySelector('#
|
|
71
|
+
ok('P2 scrolling and typing hide nothing by themselves: the top bar and the composer stay', s1.topShown && s1.footIn && s1.topTop === s0.topTop, JSON.stringify(s1));
|
|
72
|
+
await p.evaluate(() => document.querySelector('#hmIn').blur());
|
|
73
|
+
ok('P3 the conversation gets the screen below the top bar: at least 560 px of the 844 px screen (516 px in the old popup at rest)', s0.room >= 560, JSON.stringify(s0));
|
|
65
74
|
if (shots) await p.screenshot({ path: `${shots}/chat-rest-390-light.png` });
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
ok('P3 Focus hides the switch and gives the dialog the whole screen; a popup leaves the page\'s rail class alone', s2.focus && !s2.tabs && !s2.dfocus && s2.pressed === 'true' && s2.dlgTop === 0 && s2.dlgH >= s2.vh - 2, JSON.stringify(s2));
|
|
69
|
-
ok('P3b in focus the conversation gets at least 680 px of the 844 px screen (516 px before)', s2.room >= 680, JSON.stringify(s2));
|
|
70
|
-
if (shots) await p.screenshot({ path: `${shots}/chat-focus-390-light.png` });
|
|
71
|
-
await p.click('#dFocus');
|
|
72
|
-
const s3 = await until(async () => { const v = await p.evaluate(look); return !v.focus && v.dlgTop === s0.dlgTop && v.dlgH === s0.dlgH ? v : null; }) || await p.evaluate(look);
|
|
73
|
-
ok('P4 a second press gives the screen back: the switch shows and the dialog has its popup size again', !s3.focus && !s3.dfocus && s3.tabs && s3.dlgH === s0.dlgH && s3.dlgTop === s0.dlgTop && s3.pressed === 'false', JSON.stringify(s3));
|
|
74
|
-
ok('P4b no page error', errs.length === 0, errs.join(' | '));
|
|
75
|
+
ok('P4 no Focus button and no old dialog on Home', !s0.btn && !s0.dlg, JSON.stringify(s0));
|
|
76
|
+
ok('P4b no page error and no sideways scroll', errs.length === 0 && !s1.wide, errs.join(' | '));
|
|
75
77
|
await ctx.close(); }
|
|
76
78
|
|
|
77
|
-
if (shots) { const { p, ctx } = await open(390, 'dark'); await p.screenshot({ path: `${shots}/chat-rest-390-dark.png` }); await
|
|
79
|
+
if (shots) { const { p, ctx } = await open(390, 'dark'); await p.screenshot({ path: `${shots}/chat-rest-390-dark.png` }); await ctx.close(); }
|
|
78
80
|
|
|
79
81
|
{ const ctx = await browser.newContext({ viewport: { width: 390, height: 844 }, hasTouch: true }); const p = await ctx.newPage();
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
await p.
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
await p.evaluate(
|
|
86
|
-
|
|
82
|
+
// re-pointed (insights fix): Insights has no old dialog now (Agreed design); an item opened on another page goes to the Viewer card,
|
|
83
|
+
// which on a phone takes the whole screen by itself, so there is no Focus button to press
|
|
84
|
+
await p.goto(`${F.BASE}/premium-insights.html?ws=${encodeURIComponent(F.ws)}`); await until(() => p.evaluate(() => !!window.czViewer));
|
|
85
|
+
const vwLook = () => { const v = document.querySelector('#czViewer'); const r = v && !v.hidden ? v.getBoundingClientRect() : null;
|
|
86
|
+
return { dlg: !!document.querySelector('#dlg'), dfocus: !!document.querySelector('#dFocus'), shown: !!r, top: r ? Math.round(r.top) : null, left: r ? Math.round(r.left) : null, w: r ? Math.round(r.width) : 0, h: r ? Math.round(r.height) : 0, vw: innerWidth, vh: innerHeight, title: v ? (v.querySelector('.cz-vw-title') || {}).textContent : '' }; };
|
|
87
|
+
await p.evaluate(() => window.czViewer.open({ kind: 'Goal', title: 'Check the sign-up funnel', html: '<p>detail</p>', id: 'work:x' }));
|
|
88
|
+
const d = await until(async () => { const v = await p.evaluate(vwLook); return v.shown && v.top === 0 && v.h >= v.vh - 2 ? v : null; }) || await p.evaluate(vwLook);
|
|
89
|
+
ok('P5 an item opened on another page gets the whole phone screen, with no old dialog and no Focus button', !d.dlg && !d.dfocus && d.shown && d.top === 0 && d.left === 0 && d.w >= d.vw - 2 && d.h >= d.vh - 2, JSON.stringify(d));
|
|
90
|
+
await p.evaluate(() => { window.czViewer.close(); window.czViewer.open({ kind: 'Goal', title: 'Another', html: '<p>x</p>', id: 'work:y' }); });
|
|
91
|
+
const d2 = await p.evaluate(vwLook);
|
|
92
|
+
ok('P5b the next item opens on its own, in place of the one before', d2.shown && d2.title === 'Another' && d2.h >= d2.vh - 2, JSON.stringify(d2));
|
|
87
93
|
await ctx.close(); }
|
|
88
94
|
|
|
89
95
|
{ const { p, ctx } = await open(1280);
|