create-pmos 0.691.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 +20 -14
- 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 +19 -0
- 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/cli.md +3 -1
- 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/lib/board-premium.js +10 -2
- package/workspace/lib/initiative-cli.js +31 -4
- package/workspace/lib/initiative-origin.js +131 -0
- package/workspace/lib/initiative-writer.js +35 -2
- package/workspace/lib/routes-boards.js +4 -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/bd-work.js +24 -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-lists/who-raised-each-idea.json +5 -0
- 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,389 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
'use strict';
|
|
3
|
-
/* home-rows-test.js — the two rows at the top of Home and the Mentions Viewer ("Mentions, calm", batch 16 item 12; canvas MnA1Calm,
|
|
4
|
-
* MnA2Waits, MnA3Thread, MnA4Desk, MnA5Busy, MnA6Edges, MnGrill; XvARecHome; public/pm/home-mentions.js, home-rec-row.js).
|
|
5
|
-
* Serves the real page from the real server. GET /api/briefing-premium answers the fixture model (as briefing-premium-test.js does),
|
|
6
|
-
* GET /api/mentions answers the fixture (lib/mention-store.js's conversations), and GET /api/notes says whether a meeting records.
|
|
7
|
-
* M1 the list has no Mentions row (chief-of-staff C3): a reply owed is a row in Your move, and Mentions opens from there, from Your day's
|
|
8
|
-
* This week, or by the hm:mentions event (used here)
|
|
9
|
-
* M2 no mention is a row under an initiative or under Not in an initiative any more (say it once)
|
|
10
|
-
* M3 the row opens Mentions, wide on a desktop: Adler's opening line (who waits, what Claude drafted, whose needs the PM); Your move open,
|
|
11
|
-
* To read closed while Your move has items, Answered this week closed with a stack of faces; one row per conversation (first names,
|
|
12
|
-
* "Maya and Dion", the place, the message count, the gist; no day); the age amber after 2 days; a drafted reply with ✎ and send only;
|
|
13
|
-
* "I can’t draft this one" with ✎ "Write it with Claude" only; "Sent from Slack? I’ll see it at the next read."; the read line at the end
|
|
14
|
-
* M4 side by side (MnA4): the conversation shows the ask first with its reply and the four one-tap acts, Where it stands, the offer to
|
|
15
|
-
* watch, and the messages; ↗ to the source
|
|
16
|
-
* M5 Mark answered posts the mark under the conversation's id and the toast has Undo, which posts undo; Make it a task adds the task on
|
|
17
|
-
* the conversation's initiative; send records the draft as sent there (PMOS posts nothing); ✓ on the watch posts watch
|
|
18
|
-
* M6 the pencil opens the chat "Reply to <name>" beside the Viewer, and a reply Claude saves shows while the conversation is open
|
|
19
|
-
* T To read: a blue dot only on an unopened FYI; the latest message in quotes while no gist exists; "New since your reply"; @channel
|
|
20
|
-
* has no dot; ✓✓ marks all read at once; opening an FYI marks it read
|
|
21
|
-
* E a heavy day: 3 then "N more", the honest line and one button that starts on the oldest; a 30+ day ask asks once; a quiet week;
|
|
22
|
-
* nothing waits (in the sources that were read); a watch in the opening line; a failed read keeps the list, says from when, ↻
|
|
23
|
-
* R1 a recording pins a row at the top with its title and a ticking clock; paused is quieter and still; none: no row
|
|
24
|
-
* F a phone (390 px): the rows, and the Viewer full screen; no page error anywhere
|
|
25
|
-
* Screenshots (1440x900, 390x844) go to PMOS_SHOTS when it is set. Every wait polls the page. */
|
|
26
|
-
const fs = require('fs');
|
|
27
|
-
const path = require('path');
|
|
28
|
-
const { spawn } = require('child_process');
|
|
29
|
-
const { findBrowser } = require('./lib/find-browser');
|
|
30
|
-
const T = require('./test-run').configure({ name: 'home-rows' });
|
|
31
|
-
const B = require('./lib/briefing-premium.js');
|
|
32
|
-
const F = require('./fixtures/briefing-premium-facts.js');
|
|
33
|
-
|
|
34
|
-
const BASE = T.BASE;
|
|
35
|
-
const SHOTS = process.env.PMOS_SHOTS || '';
|
|
36
|
-
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
37
|
-
const until = async (fn, ms = 10000, step = 100) => { const t0 = Date.now(); for (;;) { let v; try { v = await fn(); } catch { v = null; } if (v) return v; if (Date.now() - t0 > ms) return v; await sleep(step); } };
|
|
38
|
-
const results = [];
|
|
39
|
-
const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + String(extra).slice(0, 600) : ''}`); };
|
|
40
|
-
let srv = null; let browser = null;
|
|
41
|
-
const finish = async (code) => {
|
|
42
|
-
if (browser) await browser.close().catch(() => {});
|
|
43
|
-
if (srv) { try { srv.kill('SIGKILL'); } catch { /* gone */ } }
|
|
44
|
-
T.killTmux();
|
|
45
|
-
const bad = results.filter((x) => !x.cond).length;
|
|
46
|
-
console.log(`\n${results.length - bad}/${results.length} home-rows assertions passed`);
|
|
47
|
-
process.exit(code !== undefined ? code : (bad ? 1 : 0));
|
|
48
|
-
};
|
|
49
|
-
process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
50
|
-
const MODEL = B.build(F.facts());
|
|
51
|
-
|
|
52
|
-
const ago = (min) => new Date(Date.now() - min * 60000).toISOString();
|
|
53
|
-
const D = 24 * 60;
|
|
54
|
-
const SOD = new Date().setHours(0, 0, 0, 0);
|
|
55
|
-
const today = (min) => new Date(Math.max(SOD + 60000, Date.now() - min * 60000)).toISOString(); // today, whatever the clock says
|
|
56
|
-
const WD = /\b(Mon|Tue|Wed|Thu|Fri|Sat|Sun|Today|Yesterday)\b/;
|
|
57
|
-
const conv = (id, x) => ({ id, members: [id], source: 'slack', messages: 1, read: true, fyi: false, waiting: false, count: 0, ...x });
|
|
58
|
-
const MENTIONS = (ini) => ({ ok: true, count: 3, gaps: [], as_of: ago(30), sources: ['slack', 'mail', 'jira'], watching: [], landed: [], waiting: [
|
|
59
|
-
conv('aaaaaaaaaaa1', { who: 'Samuel Chandra', people: ['Samuel Chandra'], where: '#tech-team-cem', waiting: true, count: 1, since: ago(2 * D + 60), last: ago(2 * D + 60), first: ago(3 * D), messages: 3,
|
|
60
|
-
ask: 'Which build goes to UAT, 2.4.1 or 2.4.2?', gist: 'Asks which build goes to UAT, 2.4.1 or 2.4.2, before he tags it.', text: 'Which one for UAT?', link: 'https://acme.slack.com/archives/C01/p1', initiative: ini,
|
|
61
|
-
draft: '2.4.2, please. It has the login fix the ST team asked for.',
|
|
62
|
-
stands: { settled: ['UAT keyword agreed: PSLE Companion 2027.', 'Release notes reviewed.'], open: ['The tag waits on your answer above.'] },
|
|
63
|
-
offer: { what: 'Samuel’s tag', text: 'I’ll watch for the tag and nudge Samuel at 09:00 if it’s still missing.' },
|
|
64
|
-
thread: [{ who: 'Samuel Chandra', at: ago(3 * D), text: 'The UAT keyword is PSLE Companion 2027.' }, { who: 'Wawan', at: ago(3 * D - 30), text: 'Confirmed, go ahead.', me: true }, { who: 'Samuel Chandra', at: ago(2 * D + 60), text: 'Which one for UAT?' }] }),
|
|
65
|
-
conv('aaaaaaaaaaa2', { who: 'Maya Tan', people: ['Maya Tan', 'Dion Lee'], where: '#idpf-launch', waiting: true, count: 1, since: ago(5 * 60), last: ago(4 * 60), messages: 5,
|
|
66
|
-
gist: 'Ask for the launch budget cap before Thursday’s review.', text: 'Cap?', nodraft: 'The cap isn’t in the PRD or the last review.' }),
|
|
67
|
-
conv('aaaaaaaaaaa3', { who: 'Jason Wu', people: ['Jason Wu'], where: 'DM', via: 'dm', waiting: true, count: 1, since: ago(3 * 60), last: ago(3 * 60), gist: 'Wanted the iView scope for Friday.', draft: 'Scope is the 3 screens.', drafted: 'Slack' }),
|
|
68
|
-
], toread: [
|
|
69
|
-
conv('aaaaaaaaaab1', { source: 'mail', who: 'Erik van Helvoort', people: ['Erik van Helvoort'], where: 'Ticker news', fyi: true, read: false, last: today(40), text: 'Long thread on ticker news for the iView screens (SPH). You are copied.' }),
|
|
70
|
-
conv('aaaaaaaaaab2', { source: 'confluence', who: 'Lina Ong', people: ['Lina Ong'], where: 'Pilot plan', status: 'replied', since_reply: true, read: false, last: today(90), messages: 4, gist: 'Updated the risks table after your reply.' }),
|
|
71
|
-
conv('aaaaaaaaaab3', { who: 'Rina Sari', people: ['Rina Sari'], where: '#all', fyi: true, broadcast: true, read: true, last: today(200), text: '@channel townhall at 3' }),
|
|
72
|
-
], answered: [
|
|
73
|
-
conv('aaaaaaaaaac8', { who: 'Dani Putra', people: ['Dani Putra'], where: '#product', status: 'replied', last: ago(D), gist: 'Asked if the beta list is final.' }),
|
|
74
|
-
conv('aaaaaaaaaac9', { who: 'Sari Dewi', people: ['Sari Dewi'], where: 'DM', status: 'answered', last: ago(2 * D), gist: 'Asked you to join the call.' }),
|
|
75
|
-
] });
|
|
76
|
-
const recentOf = (m) => ({ ...m, recent: [...m.toread, ...m.answered] });
|
|
77
|
-
|
|
78
|
-
(async () => {
|
|
79
|
-
const exe = findBrowser();
|
|
80
|
-
if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the home-rows suite cannot run'); return finish(1); }
|
|
81
|
-
let chromium;
|
|
82
|
-
try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed — the home-rows suite cannot run'); return finish(1); }
|
|
83
|
-
srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
|
|
84
|
-
await T.waitForServer(BASE);
|
|
85
|
-
browser = await chromium.launch({ executablePath: exe });
|
|
86
|
-
|
|
87
|
-
// the fixture's first initiative, so a conversation names one Home shows
|
|
88
|
-
const board = await until(async () => { const r = await fetch(BASE + '/api/board-premium').then((x) => x.json()).catch(() => null); return r && r.ok && r.model ? r.model : null; }, 20000, 500);
|
|
89
|
-
const INI = (((board && board.initiatives && board.initiatives.list && board.initiatives.list.rows) || []).find((r) => r && r.id) || {}).id || '';
|
|
90
|
-
ok('0 the board has an initiative for a conversation to name', !!INI);
|
|
91
|
-
|
|
92
|
-
const open = async ({ w = 1440, h = 900, mentions = recentOf(MENTIONS(INI)), rec = null, seen = null } = {}) => {
|
|
93
|
-
const ctx = await browser.newContext({ viewport: { width: w, height: h }, hasTouch: w < 500 });
|
|
94
|
-
const page = await ctx.newPage();
|
|
95
|
-
const errors = [], posts = [];
|
|
96
|
-
page.on('pageerror', (e) => errors.push(String((e && e.message) || e)));
|
|
97
|
-
page.on('request', (r) => { if (r.method() === 'POST' && r.url().startsWith(BASE)) posts.push({ path: new URL(r.url()).pathname, body: (() => { try { return JSON.parse(r.postData() || 'null'); } catch { return null; } })() }); });
|
|
98
|
-
const json = (body, status = 200) => (r) => r.fulfill({ status, contentType: 'application/json', body: JSON.stringify(body) });
|
|
99
|
-
await page.route(/\/api\/briefing-premium(\?.*)?$/, json({ ok: true, state: 'ready', model: MODEL, as_of: Date.now() }));
|
|
100
|
-
const men = { cur: mentions, fail: false };
|
|
101
|
-
await page.route(/\/api\/mentions(\?.*)?$/, (r) => (men.fail ? r.fulfill({ status: 500, contentType: 'application/json', body: JSON.stringify({ ok: false, error: 'down' }) })
|
|
102
|
-
: r.fulfill({ status: 200, contentType: 'application/json', body: JSON.stringify(men.cur) })));
|
|
103
|
-
const notes = { cur: rec };
|
|
104
|
-
await page.route(/\/api\/notes(\?.*)?$/, (r) => r.fulfill({ status: 200, contentType: 'application/json', body: JSON.stringify({ ok: true, notes: notes.cur ? [notes.cur] : [] }) }));
|
|
105
|
-
await page.route('**/api/mentions/read', json({ ok: true }));
|
|
106
|
-
await page.route('**/api/mentions/act', json({ ok: true, mark: {} }));
|
|
107
|
-
await page.route('**/api/pm-items/add', json({ ok: true, item: { id: 'item-x' } }));
|
|
108
|
-
await page.route('**/api/boards/tasks/add', json({ ok: true, item: { uid: 'task-abc' } }));
|
|
109
|
-
await page.route('**/api/boards/tasks/undo-add', json({ ok: true }));
|
|
110
|
-
await page.addInitScript(() => { try { for (const k of Object.keys(localStorage)) if (/^cz-vw-fold:mentions|^cz-men-heard/.test(k)) localStorage.removeItem(k); } catch { /* none */ } });
|
|
111
|
-
if (seen != null) await page.addInitScript((t) => { try { localStorage.setItem('cz-men-seen', String(t)); } catch { /* none */ } }, seen);
|
|
112
|
-
await page.goto(BASE + '/premium.html');
|
|
113
|
-
const up = await until(() => page.evaluate(() => !!document.querySelector('#hmList [data-hm-day]')), 20000);
|
|
114
|
-
const close = async () => { await ctx.unrouteAll({ behavior: 'ignoreErrors' }).catch(() => {}); await ctx.close().catch(() => {}); };
|
|
115
|
-
return { ctx, page, errors, posts, up, notes, men, close };
|
|
116
|
-
};
|
|
117
|
-
const shot = async (page, name) => { if (!SHOTS) return; await sleep(400); fs.mkdirSync(SHOTS, { recursive: true }); await page.screenshot({ path: path.join(SHOTS, name + '.png') }); };
|
|
118
|
-
const vw = (page) => page.evaluate(() => { const v = document.querySelector('#czViewer:not([hidden])'); return v ? { title: (v.querySelector('#czVwTitle') || {}).textContent || '', sub: (v.querySelector('.cz-vw-sub') || {}).textContent || '', text: v.textContent, back: !!v.querySelector('[data-cz-vw="back"]') } : null; });
|
|
119
|
-
const listOf = (page) => page.evaluate(() => {
|
|
120
|
-
const v = document.querySelector('#czViewer'); if (!v) return null;
|
|
121
|
-
const oc = v.querySelector('.mn-open-card');
|
|
122
|
-
const rows = (id) => [...v.querySelectorAll(`.czs-sec[data-czs-id="${id}"] .mn-row`)].map((r) => ({ id: r.dataset.mnRow, nm: r.querySelector('.mn-nm').textContent, pl: r.querySelector('.mn-pl').textContent,
|
|
123
|
-
n: (r.querySelector('.mn-n') || {}).textContent || '', age: (r.querySelector('.mn-age') || {}).textContent || '', late: !!r.querySelector('.mn-age.late'), dot: !!r.querySelector('.mn-dot'),
|
|
124
|
-
gist: r.querySelector('.mn-gist').textContent, extra: [...r.querySelectorAll(':scope > .mn-dr, :scope > .mn-sent')].map((x) => x.textContent).join('|'), tag: (r.querySelector('.mn-tag') || {}).textContent || '',
|
|
125
|
-
btns: [...r.querySelectorAll(':scope > .mn-acts button')].map((b) => b.getAttribute('aria-label')) }));
|
|
126
|
-
return { open: oc ? oc.querySelector('p').textContent : '', face: !!(oc && oc.querySelector('.ad-svg, .ad-dot')), go: oc ? [...oc.querySelectorAll('button')].map((b) => b.getAttribute('aria-label')) : [],
|
|
127
|
-
secs: [...v.querySelectorAll('.mn-col:first-child .czs-sec, .mn-vb > .czs-secs > .czs-sec')].filter((x) => !x.closest('[data-mn-conv]')).map((x) => [x.querySelector('.czs-row b').textContent, (x.querySelector('.czs-n') || {}).textContent || '', x.querySelector('.czs-row').getAttribute('aria-expanded')]),
|
|
128
|
-
move: rows('move'), read: rows('toread'), done: rows('answered'), stack: v.querySelectorAll('.czs-sec[data-czs-id="answered"] .mn-stk i').length,
|
|
129
|
-
all: !!v.querySelector('[data-mn="all-read"]'), more: [...v.querySelectorAll('.mn-more')].map((b) => b.textContent), foot: (v.querySelector('.mn-foot') || {}).textContent || '',
|
|
130
|
-
gaps: [...v.querySelectorAll('.mn-gap')].map((g) => g.textContent + '|' + g.querySelector('button').getAttribute('aria-label')), split: !!v.querySelector('.mn-split'), ck: (v.querySelector('.hr-ck') || {}).textContent || '' };
|
|
131
|
-
});
|
|
132
|
-
const convOf = (page) => page.evaluate(() => {
|
|
133
|
-
const v = document.querySelector('#czViewer'); const c = v && (v.querySelector('[data-mn-conv]') || v.querySelector('.cz-vw-body')); if (!c) return null;
|
|
134
|
-
const a = c.querySelector('.mn-ask');
|
|
135
|
-
return { head: (c.querySelector('.mn-cht') || {}).textContent || '', out: !!c.querySelector('[data-mn="src"]'), ak: a ? a.querySelector('.mn-ak').textContent : '', aq: a ? a.querySelector('.mn-aq').textContent : '',
|
|
136
|
-
draft: (c.querySelector('[data-mn-draft]') || {}).textContent || '', four: [...c.querySelectorAll('.mn-four button')].map((b) => b.getAttribute('aria-label')), right: [...c.querySelectorAll('.mn-acts.sp > span:last-child button')].map((b) => b.getAttribute('aria-label')),
|
|
137
|
-
stands: [...c.querySelectorAll('.mn-st li')].map((l) => (l.classList.contains('open') ? 'open:' : 'ok:') + l.textContent), watch: c.querySelector('.mn-watch') ? [c.querySelector('.mn-watch p').textContent, ...[...c.querySelectorAll('.mn-watch button')].map((b) => b.getAttribute('aria-label'))] : [],
|
|
138
|
-
msgs: [...c.querySelectorAll('.mn-msg')].map((m) => (m.classList.contains('me') ? 'me:' : '') + m.textContent), msgsOpen: (c.querySelector('.czs-sec[data-czs-id="msgs"] .czs-row') || { getAttribute: () => '' }).getAttribute('aria-expanded'), days: [...c.querySelectorAll('.mn-day')].map((d) => d.textContent) };
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
/* M1, M2 */
|
|
142
|
-
const A = await open({ seen: Date.now() - 6 * 60 * 60000 });
|
|
143
|
-
ok('0 the page draws the list', !!A.up);
|
|
144
|
-
if (!A.up) return finish(1);
|
|
145
|
-
const p = A.page;
|
|
146
|
-
ok('M1 the list has no Mentions row (chief-of-staff C3): a reply owed is a row in Your move', await p.evaluate(() => !document.querySelector('#hmList [data-hr-mentions]')));
|
|
147
|
-
ok('M2 no mention is a row under an initiative or under Not in an initiative', await p.evaluate(() => !document.querySelector('#hmList [data-id^="men:"]')));
|
|
148
|
-
await shot(p, 'home-1440');
|
|
149
|
-
|
|
150
|
-
/* M3 */
|
|
151
|
-
await p.evaluate(() => dispatchEvent(new Event('hm:mentions'))); // chief-of-staff C3: no Mentions row on the list
|
|
152
|
-
// batch 20 item 6: a wide Viewer no longer folds the list by itself; at 1440 the PM folds it to give Mentions the room to sit side by side
|
|
153
|
-
await until(() => p.evaluate(() => !!document.querySelector('#czViewer:not([hidden])')));
|
|
154
|
-
await p.click('#hmList .hm-hd [data-hm-fold]');
|
|
155
|
-
// wait for the fold to land too: the list draws before the split, and a slow runner read it in between (CI, batch 20)
|
|
156
|
-
const L1 = (await until(() => listOf(p).then((l) => (l && l.move.length && l.split ? l : null)))) || (await listOf(p));
|
|
157
|
-
ok('M3 the row opens the Mentions Viewer, wide on a desktop, the list and the conversation side by side', !!L1 && L1.split, JSON.stringify(L1 && L1.secs));
|
|
158
|
-
ok('M3 Adler opens on who waits and what PMOS drafted, plainly; no button on a light day', !!L1 && L1.face && L1.open === 'Four people wait on you. I drafted one reply; Maya and Dion’s needs you.' && !L1.go.length, JSON.stringify(L1 && [L1.open, L1.go]));
|
|
159
|
-
ok('M3 Your move open with 3; To read closed with 3; Answered this week closed with 2 and a stack of faces', !!L1 && JSON.stringify(L1.secs) === JSON.stringify([['Your move', '3', 'true'], ['To read', '3', 'false'], ['Answered this week', '2', 'false']]) && L1.stack === 2, JSON.stringify(L1 && [L1.secs, L1.stack]));
|
|
160
|
-
const mv = L1 ? L1.move : [];
|
|
161
|
-
ok('M3 one row per conversation, oldest first: first names, "Maya and Dion", the place, the message count', mv.map((x) => x.nm + mx(x)).join(';') === 'Samuel· #tech-team-cem3;Maya and Dion· #idpf-launch5;Jason· DM', JSON.stringify(mv));
|
|
162
|
-
function mx(x) { return x.pl + x.n; }
|
|
163
|
-
ok('M3 the age only on Your move, amber after 2 days; no day on any row', mv.map((x) => x.age + (x.late ? '!' : '')).join() === '2 days!,5 h,3 h' && ![...mv, ...(L1 ? L1.read : []), ...(L1 ? L1.done : [])].some((x) => WD.test(x.nm + x.pl + x.age + x.n)), JSON.stringify(mv));
|
|
164
|
-
ok('M3 the gist is the row\'s line', !!mv[0] && mv[0].gist === 'Asks which build goes to UAT, 2.4.1 or 2.4.2, before he tags it.', JSON.stringify(mv[0]));
|
|
165
|
-
ok('M3 side by side, a row says "Reply drafted" and the reply shows once, beside the list', !!mv[0] && mv[0].tag.trim() === 'Reply drafted' && !mv[0].extra && !mv[0].btns.length, JSON.stringify(mv[0]));
|
|
166
|
-
ok('M3 side by side, after send: the row says "Sent from Slack? I’ll see it at the next read."', !!mv[2] && /Sent from Slack\? I’ll see it at the next read\./.test(mv[2].tag), JSON.stringify(mv[2]));
|
|
167
|
-
ok('M3 the read line at the end says what was read and when', !!L1 && /^Slack, email and Jira read at \d\d:\d\d\.$/.test(L1.foot) && !L1.gaps.length, JSON.stringify(L1 && L1.foot));
|
|
168
|
-
|
|
169
|
-
/* M4: side by side */
|
|
170
|
-
const C1 = await until(() => convOf(p).then((c) => (c && c.ak ? c : null)));
|
|
171
|
-
ok('M4 the oldest conversation shows beside the list: full name, place, messages since when, ↗', !!C1 && /^Samuel Chandra#tech-team-cem · 3 messages since (Mon|Tue|Wed|Thu|Fri|Sat|Sun)$/.test(C1.head) && C1.out, JSON.stringify(C1 && C1.head));
|
|
172
|
-
ok('M4 the ask first: "Asks you · 2 days", the ask, the drafted reply', !!C1 && C1.ak === 'Asks you · 2 days' && C1.aq === 'Which build goes to UAT, 2.4.1 or 2.4.2?' && C1.draft === '2.4.2, please. It has the login fix the ST team asked for.', JSON.stringify(C1));
|
|
173
|
-
ok('M4 four one-tap acts, then ✎ and send', !!C1 && C1.four.join('|') === 'Mark answered|Remind me at 09:00|Make it a task|Not an ask' && C1.right.join('|') === 'Change it with PMOS|Copy it and open Slack. PMOS never posts.', JSON.stringify(C1 && [C1.four, C1.right]));
|
|
174
|
-
ok('M4 Where it stands: what is settled, then what is open', !!C1 && C1.stands.join('|') === 'ok:UAT keyword agreed: PSLE Companion 2027.|ok:Release notes reviewed.|open:The tag waits on your answer above.', JSON.stringify(C1 && C1.stands));
|
|
175
|
-
ok('M4 PMOS offers to watch the dated promise, ✓ ×', !!C1 && C1.watch.join('|') === 'I’ll watch for the tag and nudge Samuel at 09:00 if it’s still missing.|No, don’t watch|Yes, watch for it', JSON.stringify(C1 && C1.watch));
|
|
176
|
-
ok('M4 the messages last, open on the desktop, by day, the PM\'s on the right', !!C1 && C1.msgsOpen === 'true' && C1.msgs.join('|') === 'The UAT keyword is PSLE Companion 2027.|me:Confirmed, go ahead.|Which one for UAT?' && C1.days.length >= 1, JSON.stringify(C1 && [C1.msgs, C1.days]));
|
|
177
|
-
await shot(p, 'mentions-1440');
|
|
178
|
-
await p.click('#czViewer [data-mn-row="aaaaaaaaaaa2"] [data-mn="open"]');
|
|
179
|
-
const C2 = await until(() => convOf(p).then((c) => (c && /^Maya Tan and Dion Lee/.test(c.head) ? c : null)));
|
|
180
|
-
ok('M4 a press on a row shows that conversation beside the list; no draft: ✎ "Write it with PMOS" only', !!C2 && C2.right.join('|') === 'Write it with PMOS' && !C2.stands.length && !C2.watch.length, JSON.stringify(C2));
|
|
181
|
-
await p.click('#czViewer [data-mn-row="aaaaaaaaaaa1"] [data-mn="open"]');
|
|
182
|
-
await until(() => convOf(p).then((c) => (c && /^Samuel/.test(c.head) ? c : null)));
|
|
183
|
-
|
|
184
|
-
/* M5 */
|
|
185
|
-
A.posts.length = 0;
|
|
186
|
-
await p.click('#czViewer [data-mn-conv] [data-mn="answered"]');
|
|
187
|
-
const m5 = await until(() => A.posts.find((x) => x.path === '/api/mentions/act'));
|
|
188
|
-
ok('M5 Mark answered posts the mark under the conversation\'s id', !!m5 && m5.body.id === 'aaaaaaaaaaa1' && m5.body.act === 'answered', JSON.stringify(m5));
|
|
189
|
-
const t5 = await until(() => p.evaluate(() => { const t = document.querySelector('#toast.on'); return t && t.querySelector('.undo') ? t.textContent : null; }));
|
|
190
|
-
ok('M5 the toast says what was done, with Undo', !!t5 && /^Marked answered: Samuel’s ask/.test(t5), String(t5));
|
|
191
|
-
await p.click('#toast .undo');
|
|
192
|
-
const u5 = await until(() => A.posts.find((x) => x.path === '/api/mentions/act' && x.body.act === 'undo'));
|
|
193
|
-
ok('M5 Undo posts undo for the same conversation', !!u5 && u5.body.id === 'aaaaaaaaaaa1', JSON.stringify(u5));
|
|
194
|
-
A.posts.length = 0;
|
|
195
|
-
await p.click('#czViewer [data-mn-conv] [data-mn="task"]');
|
|
196
|
-
const tk = await until(() => (A.posts.find((x) => x.path === '/api/mentions/act' && x.body.act === 'task') ? A.posts : null));
|
|
197
|
-
const add = (tk || []).find((x) => x.path === '/api/boards/tasks/add'), mk = (tk || []).find((x) => x.path === '/api/mentions/act');
|
|
198
|
-
ok('M5 Make it a task adds "Reply to Samuel" on the conversation\'s initiative, then marks it', !!add && add.body.title === 'Reply to Samuel' && add.body.initiative === INI && !!mk && mk.body.task.id === 'task-abc' && mk.body.task.kind === 'board', JSON.stringify(tk));
|
|
199
|
-
A.posts.length = 0;
|
|
200
|
-
await p.click('#czViewer [data-mn-conv] [data-mn="send"]');
|
|
201
|
-
const sd = await until(() => A.posts.find((x) => x.path === '/api/mentions/act' && x.body.act === 'drafted'));
|
|
202
|
-
ok('M5 send records the reply as sent in Slack (PMOS posts nothing)', !!sd && sd.body.to === 'Slack' && !A.posts.some((x) => /slack\.com/.test(x.path)), JSON.stringify(A.posts));
|
|
203
|
-
const t7 = await until(() => p.evaluate(() => { const t = document.querySelector('#toast.on'); return t && /Paste it in Slack/.test(t.textContent) ? t.textContent : null; }));
|
|
204
|
-
ok('M5 the toast says to paste it in Slack', !!t7, String(t7));
|
|
205
|
-
A.posts.length = 0;
|
|
206
|
-
await p.click('#czViewer [data-mn-conv] [data-mn="watch"]');
|
|
207
|
-
const wt = await until(() => A.posts.find((x) => x.path === '/api/mentions/act' && x.body.act === 'watch'));
|
|
208
|
-
ok('M5 ✓ on the offer posts watch, with Undo in the toast', !!wt && wt.body.id === 'aaaaaaaaaaa1' && !!(await until(() => p.evaluate(() => /I’ll watch for Samuel’s tag/.test((document.querySelector('#toast.on') || {}).textContent || '')))), JSON.stringify(wt));
|
|
209
|
-
|
|
210
|
-
/* M6 */
|
|
211
|
-
await p.click('#czViewer [data-mn-conv] [data-mn="pen"]');
|
|
212
|
-
const ch = await until(() => p.evaluate(() => { const v = document.querySelector('#czViewer:not([hidden])'); return v && /Reply to Samuel/.test(document.body.textContent) ? { vw: !!v } : null; }));
|
|
213
|
-
ok('M6 the pencil opens the chat "Reply to Samuel" and the Viewer stays beside it', !!ch && ch.vw, JSON.stringify(ch));
|
|
214
|
-
A.men.cur = JSON.parse(JSON.stringify(A.men.cur)); A.men.cur.waiting[0].draft = '2.4.2, please. It has the login fix.';
|
|
215
|
-
const nd = await until(() => p.evaluate(() => (document.querySelector('#czViewer [data-mn-conv] [data-mn-draft]') || {}).textContent === '2.4.2, please. It has the login fix.'), 14000, 300);
|
|
216
|
-
ok('M6 a reply PMOS saves shows while the conversation is open', !!nd);
|
|
217
|
-
|
|
218
|
-
/* T: To read */
|
|
219
|
-
await p.click('#czViewer .czs-sec[data-czs-id="toread"] [data-czs-fold]');
|
|
220
|
-
const R1 = await until(() => listOf(p).then((l) => (l && l.read.length ? l : null)));
|
|
221
|
-
const rd = R1 ? R1.read : [];
|
|
222
|
-
ok('T a blue dot only on an unopened FYI; @channel has no dot; ✓✓ is there', rd.map((x) => x.dot).join() === 'true,true,false' && R1.all, JSON.stringify(rd));
|
|
223
|
-
ok('T no gist yet: the real latest message, in quotes', !!rd[0] && rd[0].gist === '“Long thread on ticker news for the iView screens (SPH). You are copied.”' && rd[0].pl === '· email', JSON.stringify(rd[0]));
|
|
224
|
-
ok('T a conversation that came back after the PM answered says "New since your reply"', !!rd[1] && /^New since your reply\. Updated the risks table/.test(rd[1].gist), JSON.stringify(rd[1]));
|
|
225
|
-
await shot(p, 'mentions-toread-1440');
|
|
226
|
-
A.posts.length = 0;
|
|
227
|
-
await p.click('#czViewer [data-mn="all-read"]');
|
|
228
|
-
const ar = await until(() => A.posts.find((x) => x.path === '/api/mentions/act' && Array.isArray(x.body.ids)));
|
|
229
|
-
ok('T ✓✓ marks every unopened To read conversation read at once', !!ar && ar.body.act === 'read' && ar.body.ids.join() === 'aaaaaaaaaab1,aaaaaaaaaab2', JSON.stringify(ar));
|
|
230
|
-
A.posts.length = 0;
|
|
231
|
-
await p.click('#czViewer [data-mn-row="aaaaaaaaaab1"] [data-mn="open"]');
|
|
232
|
-
const rd1 = await until(() => A.posts.find((x) => x.path === '/api/mentions/act' && x.body.act === 'read' && x.body.id === 'aaaaaaaaaab1'));
|
|
233
|
-
const C3 = await until(() => convOf(p).then((c) => (c && /^Erik van Helvoort/.test(c.head) ? c : null)));
|
|
234
|
-
ok('T opening an FYI marks it read and shows it calmly, with no acts', !!rd1 && !!C3 && C3.ak === 'For your information' && !C3.four.length, JSON.stringify(C3));
|
|
235
|
-
ok('M no page error', !A.errors.length, A.errors.join(' | '));
|
|
236
|
-
await A.close();
|
|
237
|
-
|
|
238
|
-
/* E: a heavy day, 30+ days, the edges */
|
|
239
|
-
// The six asks stay inside today: an hour apart, or closer just after midnight (CI ran 00:10 UTC and "newest today" became yesterday's).
|
|
240
|
-
const TODAY_STEP = Math.max(1, Math.min(60, Math.floor((Date.now() - new Date().setHours(0, 0, 0, 0)) / 60000 / 7)));
|
|
241
|
-
const many = MENTIONS(INI);
|
|
242
|
-
many.waiting = [conv('aaaaaaaaaac0', { source: 'mail', who: 'Budi Santoso', people: ['Budi Santoso'], where: 'Q4 budget', waiting: true, count: 1, since: ago(34 * D), last: ago(34 * D), check: true, gist: 'Budget sign-off for Q4.', draft: 'Signed.' })]
|
|
243
|
-
.concat(Array.from({ length: 6 }, (_, i) => conv('aaaaaaaaaac' + (i + 1), { who: 'Person' + i + ' X', people: ['Person' + i + ' X'], where: '#ascent', waiting: true, count: 1, since: ago((6 - i) * TODAY_STEP), last: ago((6 - i) * TODAY_STEP), gist: 'Ask ' + i, draft: i < 3 ? 'Yes.' : undefined })));
|
|
244
|
-
many.count = 7;
|
|
245
|
-
many.gaps = [{ kind: 'source', source: 'mail', state: 'never' }, { kind: 'stale', upto: ago(26 * 60) }];
|
|
246
|
-
const E = await open({ w: 390, h: 844, mentions: recentOf(many) });
|
|
247
|
-
await E.page.evaluate(() => dispatchEvent(new Event('hm:mentions'))); // chief-of-staff C3: no Mentions row on the list
|
|
248
|
-
const e1 = await until(() => listOf(E.page).then((l) => (l && l.move.length ? l : null)));
|
|
249
|
-
ok('E a heavy day: the line says it plainly and offers one button that starts on the oldest', !!e1 && e1.open === 'Seven people wait on you, and Budi’s has waited 34 days. I drafted four, so the first few are quick. Want me to start you on Budi’s?' && e1.go.join() === 'Start on Budi’s', JSON.stringify(e1 && [e1.open, e1.go]));
|
|
250
|
-
ok('E 3 shown, then "4 more, newest today"; a compact "Reply drafted" on the row', !!e1 && e1.move.length === 3 && e1.more[0] === '4 more, newest today' && e1.move[0].tag.trim() === 'Reply drafted' && !e1.move[0].extra, JSON.stringify(e1 && [e1.more, e1.move[0]]));
|
|
251
|
-
ok('E a 30+ day ask asks once: "Did you answer this already?"', !!e1 && e1.ck === 'Did you answer this already?', JSON.stringify(e1 && e1.ck));
|
|
252
|
-
ok('E a missing source and a late read: one line each at the end, with Connect and Read now', !!e1 && e1.gaps.length === 2 && /^Email isn’t connected, so email mentions are missing\.\|Connect Email$/.test(e1.gaps[0]) && /^Last read \d\d:\d\d (yesterday|on .+)\. Today’s read hasn’t run\.\|Read now$/.test(e1.gaps[1]) && !e1.foot, JSON.stringify(e1 && e1.gaps));
|
|
253
|
-
await shot(E.page, 'mentions-busy-390');
|
|
254
|
-
E.posts.length = 0;
|
|
255
|
-
await E.page.click('#czViewer [data-mn="ck-yes"]');
|
|
256
|
-
const ey = await until(() => E.posts.find((x) => x.path === '/api/mentions/act'));
|
|
257
|
-
ok('E ✓ on the 30-day question marks it answered', !!ey && ey.body.id === 'aaaaaaaaaac0' && ey.body.act === 'answered', JSON.stringify(ey));
|
|
258
|
-
await E.page.click('#czViewer [data-mn="more-move"]');
|
|
259
|
-
ok('E "N more" shows every waiting conversation', await until(() => E.page.evaluate(() => document.querySelectorAll('#czViewer [data-czs-id="move"] .mn-row').length === 7)));
|
|
260
|
-
await E.page.click('#czViewer [data-mn="go"]');
|
|
261
|
-
const eg = await until(() => vw(E.page).then((v) => (v && v.title === 'Budi Santoso' ? v : null)));
|
|
262
|
-
ok('E the button opens the oldest conversation (a phone drills in)', !!eg && eg.back, JSON.stringify(eg));
|
|
263
|
-
// the read fails: the last list stays, with its time, never "nobody"
|
|
264
|
-
E.men.fail = true;
|
|
265
|
-
await E.page.click('#czViewer [data-cz-vw="back"]');
|
|
266
|
-
await E.page.click('#czViewer [data-cz-vw="back"]').catch(() => {});
|
|
267
|
-
await until(() => E.page.evaluate(() => !document.querySelector('#czViewer:not([hidden])')));
|
|
268
|
-
await E.page.evaluate(() => dispatchEvent(new Event('hm:mentions'))); // chief-of-staff C3: no Mentions row on the list
|
|
269
|
-
const e4 = await until(() => listOf(E.page).then((l) => (l && /couldn’t refresh/.test(l.open) ? l : null)));
|
|
270
|
-
ok('E a failed read keeps the last list, says when it is from, with ↻', !!e4 && /^I couldn’t refresh Mentions\. This is the list from \d\d:\d\d\.$/.test(e4.open) && e4.move.length > 0 && e4.go.join() === 'Try again', JSON.stringify(e4 && [e4.open, e4.go]));
|
|
271
|
-
ok('E no page error', !E.errors.length, E.errors.join(' | '));
|
|
272
|
-
await E.close();
|
|
273
|
-
|
|
274
|
-
// nothing waits: the line opens on what is handled; Your move is not drawn; a watch shows in the line
|
|
275
|
-
const calm = MENTIONS(INI); calm.waiting = []; calm.count = 0; calm.watching = [{ id: 'aaaaaaaaaaa1', who: 'Samuel Chandra', what: 'Samuel’s tag' }];
|
|
276
|
-
const Z = await open({ mentions: recentOf(calm) });
|
|
277
|
-
await Z.page.evaluate(() => dispatchEvent(new Event('hm:mentions'))); // chief-of-staff C3: no Mentions row on the list
|
|
278
|
-
const z1 = await until(() => listOf(Z.page).then((l) => (l && l.open ? l : null)));
|
|
279
|
-
ok('E nothing waits: "Nothing waits on you", the asks answered, the watch; To read open, no Your move', !!z1 && z1.open === 'Nothing waits on you. You answered all 2 asks this week. I’m watching for Samuel’s tag and will tell you when it lands.' && z1.secs.map((x) => x[0] + ':' + x[2]).join() === 'To read:true,Answered this week:false' && !z1.go.length, JSON.stringify(z1 && [z1.open, z1.secs]));
|
|
280
|
-
await shot(Z.page, 'mentions-calm-1440');
|
|
281
|
-
await Z.close();
|
|
282
|
-
const quiet = MENTIONS(INI); quiet.waiting = []; quiet.toread = []; quiet.count = 0; quiet.gaps = [{ kind: 'source', source: 'mail', state: 'never' }]; quiet.sources = ['slack', 'jira'];
|
|
283
|
-
const Q = await open({ mentions: recentOf(quiet) });
|
|
284
|
-
await Q.page.evaluate(() => dispatchEvent(new Event('hm:mentions'))); // chief-of-staff C3: no Mentions row on the list
|
|
285
|
-
const q1 = await until(() => listOf(Q.page).then((l) => (l && l.open ? l : null)));
|
|
286
|
-
ok('E a quiet week: one line and only the Answered fold', !!q1 && /^A quiet week\. Nobody has mentioned you since (yesterday|this morning|[A-Z][a-z]+day), so nothing waits\.$/.test(q1.open) && q1.secs.map((x) => x[0]).join() === 'Answered this week', JSON.stringify(q1 && [q1.open, q1.secs]));
|
|
287
|
-
await Q.close();
|
|
288
|
-
const some = MENTIONS(INI); some.waiting = []; some.count = 0; some.gaps = [{ kind: 'source', source: 'mail', state: 'never' }]; some.sources = ['slack', 'jira'];
|
|
289
|
-
const S2 = await open({ mentions: recentOf(some) });
|
|
290
|
-
await S2.page.evaluate(() => dispatchEvent(new Event('hm:mentions'))); // chief-of-staff C3: no Mentions row on the list
|
|
291
|
-
const s1 = await until(() => listOf(S2.page).then((l) => (l && l.open ? l : null)));
|
|
292
|
-
ok('E a source is missing: "Nothing waits on you in Slack or Jira."', !!s1 && /^Nothing waits on you in Slack or Jira\./.test(s1.open), JSON.stringify(s1 && s1.open));
|
|
293
|
-
await S2.close();
|
|
294
|
-
const none = { ok: true, count: 0, waiting: [], toread: [], answered: [], recent: [], gaps: [], watching: [], landed: [], sources: [] };
|
|
295
|
-
const N = await open({ mentions: none });
|
|
296
|
-
await N.page.evaluate(() => dispatchEvent(new Event('hm:mentions'))); // chief-of-staff C3: no Mentions row on the list
|
|
297
|
-
const n1 = await until(() => listOf(N.page).then((l) => (l && l.open ? l : null)));
|
|
298
|
-
ok('E nobody in 7 days: one quiet line and nothing else', !!n1 && n1.open === 'A quiet week. Nobody has mentioned you in the last 7 days.' && n1.secs.length === 0, JSON.stringify(n1));
|
|
299
|
-
await N.close();
|
|
300
|
-
|
|
301
|
-
/* R1 */
|
|
302
|
-
const note = { id: 'n-rec-1', state: 'recording', title: 'Viewer sync', meeting_ms: (12 * 60 + 40) * 1000 };
|
|
303
|
-
const R = await open({ rec: note });
|
|
304
|
-
const r1 = await until(() => R.page.evaluate(() => { const b = document.querySelector('#hmList .hv-body'); const f = b && b.firstElementChild; return f && /hr-rec-card/.test(f.className) ? { t: f.textContent.replace(/\s+/g, ' ').trim(), next: (f.nextElementSibling || {}).className || '', paused: f.classList.contains('paused') } : null; }), 15000);
|
|
305
|
-
ok('R1 a recording pins a row at the top: its title and Recording · 12:4x', !!r1 && /^Viewer sync ?Recording · 12:4\d$/.test(r1.t) && !r1.paused, JSON.stringify(r1));
|
|
306
|
-
ok('R1 the Today card does not say the recording again (say it once)', await R.page.evaluate(() => !/not on the calendar/.test((document.querySelector('#hmList') || {}).textContent || '')));
|
|
307
|
-
const c0 = await R.page.textContent('#hmList [data-hr-clock]');
|
|
308
|
-
const c1 = await until(async () => { const t = await R.page.textContent('#hmList [data-hr-clock]'); return t !== c0 ? t : null; }, 4000);
|
|
309
|
-
ok('R1 the clock ticks', !!c1, c0 + ' → ' + c1);
|
|
310
|
-
await shot(R.page, 'rec-1440');
|
|
311
|
-
await R.page.evaluate(() => dispatchEvent(new Event('hm:mentions'))); // chief-of-staff C3: no Mentions row on the list
|
|
312
|
-
await until(() => vw(R.page));
|
|
313
|
-
ok('R1 the row stays while another item is open', await R.page.evaluate(() => !!document.querySelector('#hmList .hr-rec-card')));
|
|
314
|
-
R.notes.cur = { ...note, state: 'paused' };
|
|
315
|
-
// the page reads the notes again within 10 s (rec-state.js, or Home's own notes while that is not on the page)
|
|
316
|
-
const r2 = await until(() => R.page.evaluate(() => { const f = document.querySelector('#hmList .hr-rec-card'); return f && f.classList.contains('paused') ? f.textContent.replace(/\s+/g, ' ').trim() : null; }), 16000, 500);
|
|
317
|
-
ok('R1 paused: "Paused · 12:40", quieter', !!r2 && /Paused · 12:40$/.test(r2), String(r2));
|
|
318
|
-
const s0 = await R.page.textContent('#hmList [data-hr-clock]'); await sleep(1300);
|
|
319
|
-
ok('R1 a paused clock stands still', s0 === await R.page.textContent('#hmList [data-hr-clock]'));
|
|
320
|
-
await shot(R.page, 'rec-paused-1440');
|
|
321
|
-
ok('R no page error', !R.errors.length, R.errors.join(' | '));
|
|
322
|
-
await R.close();
|
|
323
|
-
|
|
324
|
-
/* W (batch 9 item 6): widening the Viewer folds the list before it narrows the chat */
|
|
325
|
-
const W = await open({ w: 2000, h: 1000 });
|
|
326
|
-
await W.page.evaluate(() => dispatchEvent(new Event('hm:mentions'))); // chief-of-staff C3: no Mentions row on the list
|
|
327
|
-
await until(() => vw(W.page));
|
|
328
|
-
await W.page.evaluate(() => window.czViewer.wide(false)); // Mentions opens wide on a desktop; this checks the width rule itself
|
|
329
|
-
const lay = async (px) => { await W.page.evaluate((x) => window.czViewer.setWidth(x, false), px); return W.page.evaluate(() => ({ rail: window.czViewer.railOn(), list: Math.round(document.getElementById('hmList').getBoundingClientRect().width), chat: Math.round(document.getElementById('hmChat').getBoundingClientRect().width) })); };
|
|
330
|
-
const w0 = await lay(600);
|
|
331
|
-
ok('W at a narrow width the list shows', !w0.rail && w0.list > 200, JSON.stringify(w0));
|
|
332
|
-
const w1 = await lay(1600);
|
|
333
|
-
ok('W a wider Viewer never folds the list (batch 20 item 6): it stops where the chat keeps its room', !w1.rail && w1.list > 200 && w1.chat >= 350, JSON.stringify(w1));
|
|
334
|
-
await W.page.click('#hmList .hm-hd [data-hm-fold]');
|
|
335
|
-
const w2 = await until(() => W.page.evaluate(() => window.czViewer.railOn() && Math.round(document.getElementById('hmList').getBoundingClientRect().width) < 100));
|
|
336
|
-
ok('W only the list\'s own fold folds it, to the rail', !!w2);
|
|
337
|
-
const w3 = await lay(600);
|
|
338
|
-
ok('W a narrower Viewer leaves the folded list folded', w3.rail && w3.list < 100, JSON.stringify(w3));
|
|
339
|
-
await W.page.click('[data-cz-vw-rail="show"]');
|
|
340
|
-
const w4 = await until(() => W.page.evaluate(() => !window.czViewer.railOn() && Math.round(document.getElementById('hmList').getBoundingClientRect().width) > 200));
|
|
341
|
-
ok('W the rail\'s list button unfolds it', !!w4);
|
|
342
|
-
ok('W no page error', !W.errors.length, W.errors.join(' | '));
|
|
343
|
-
await W.close();
|
|
344
|
-
|
|
345
|
-
/* F */
|
|
346
|
-
const P = await open({ w: 390, h: 844, rec: note });
|
|
347
|
-
const ph = await until(() => P.page.evaluate(() => !!document.querySelector('#hmList .hr-rec-card')), 15000);
|
|
348
|
-
ok('F on a phone the recording row shows', !!ph);
|
|
349
|
-
await shot(P.page, 'home-390');
|
|
350
|
-
await P.page.evaluate(() => dispatchEvent(new Event('hm:mentions'))); // chief-of-staff C3: no Mentions row on the list
|
|
351
|
-
const pv = await until(() => P.page.evaluate(() => { const v = document.querySelector('#czViewer:not([hidden])'); if (!v) return null; const r = v.getBoundingClientRect(); return { w: Math.round(r.width), back: !!v.querySelector('[data-cz-vw="back"]') }; }));
|
|
352
|
-
ok('F the Mentions Viewer is full screen on a phone, with ←', !!pv && pv.w >= 380 && pv.back, JSON.stringify(pv));
|
|
353
|
-
await shot(P.page, 'mentions-390');
|
|
354
|
-
const pl = await until(() => listOf(P.page).then((l) => (l && l.move.length ? l : null)));
|
|
355
|
-
ok('F on a phone the list is one column, no conversation beside it', !!pl && !pl.split, JSON.stringify(pl && pl.split));
|
|
356
|
-
const pm = pl ? pl.move : [];
|
|
357
|
-
ok('F a calm day on a phone: a drafted reply shows on its row with ✎ and send only', !!pm[0] && /I drafted your reply2\.4\.2, please/.test(pm[0].extra) && pm[0].btns.join('|') === 'Change it with PMOS|Copy it and open Slack. PMOS never posts.', JSON.stringify(pm[0]));
|
|
358
|
-
ok('F no draft: why, in one line, and ✎ "Write it with PMOS" is the only button', !!pm[1] && pm[1].extra === 'I can’t draft this oneThe cap isn’t in the PRD or the last review.' && pm[1].btns.join('|') === 'Write it with PMOS', JSON.stringify(pm[1]));
|
|
359
|
-
ok('F after send: "Sent from Slack? I’ll see it at the next read."', !!pm[2] && pm[2].extra === 'Sent from Slack? I’ll see it at the next read.' && !pm[2].btns.length, JSON.stringify(pm[2]));
|
|
360
|
-
await P.page.click('#czViewer [data-mn-row="aaaaaaaaaaa1"] [data-mn="open"]');
|
|
361
|
-
const pc = await until(() => vw(P.page).then((v) => (v && v.title === 'Samuel Chandra' ? v : null)));
|
|
362
|
-
ok('F a row drills in: the full name, "#tech-team-cem · 3 messages since …", ↗, ←', !!pc && /^#tech-team-cem · 3 messages since (Mon|Tue|Wed|Thu|Fri|Sat|Sun)$/.test(pc.sub) && pc.back && await P.page.evaluate(() => !!document.querySelector('#czViewer [data-cz-vw-p="src"]')), JSON.stringify(pc));
|
|
363
|
-
const pcv = await convOf(P.page);
|
|
364
|
-
ok('F the messages start folded on a phone', !!pcv && pcv.msgsOpen === 'false', JSON.stringify(pcv && pcv.msgsOpen));
|
|
365
|
-
await shot(P.page, 'mention-one-390');
|
|
366
|
-
const sx = await P.page.evaluate(() => document.documentElement.scrollWidth <= innerWidth + 1);
|
|
367
|
-
ok('F no sideways scroll at 390 px', sx);
|
|
368
|
-
ok('F no page error', !P.errors.length, P.errors.join(' | '));
|
|
369
|
-
await P.close();
|
|
370
|
-
/* Y (batch 17 item 6): Your day's opening card names the oldest ask in Your move; its icon opens that conversation in Mentions */
|
|
371
|
-
{ const Q = await open();
|
|
372
|
-
await Q.page.click('#hmList [data-hm-day]');
|
|
373
|
-
await until(() => Q.page.evaluate(() => !!document.querySelector('#czViewer:not([hidden])')));
|
|
374
|
-
await Q.page.click('#hmList .hm-hd [data-hm-fold]'); // batch 20 item 6: the PM folds the list, so Mentions has the room to sit side by side at 1440
|
|
375
|
-
const ya = await until(() => Q.page.evaluate(() => { const a = document.querySelector('#czViewer .yd-open .yd-ask'); return a ? { id: a.dataset.id, b: a.querySelector('b').textContent, em: a.querySelector('em').textContent, btn: (a.querySelector('[data-yd="ask"]') || {}).getAttribute?.('aria-label') } : null; }), 15000);
|
|
376
|
-
ok('Y Your day names the oldest ask: who, where, how many more, the gist', !!ya && ya.id === 'aaaaaaaaaaa1' && ya.b === 'Samuel asked you in #tech-team-cem · 2 more' && /before he tags it/.test(ya.em) && ya.btn === 'Open in Mentions', JSON.stringify(ya));
|
|
377
|
-
await shot(Q.page, 'day-ask-1440');
|
|
378
|
-
await Q.page.click('#czViewer .yd-ask [data-yd="ask"]');
|
|
379
|
-
const yc = await until(async () => { const c = await convOf(Q.page); const v = await vw(Q.page); return v && v.title === 'Mentions' && c && /Samuel Chandra/.test(c.head) ? { t: v.title, head: c.head } : null; });
|
|
380
|
-
ok('Y its icon opens Mentions on that conversation', !!yc, JSON.stringify(yc));
|
|
381
|
-
ok('Y no page error', !Q.errors.length, Q.errors.join(' | '));
|
|
382
|
-
await Q.close();
|
|
383
|
-
const E = await open({ mentions: { ...recentOf(MENTIONS(INI)), waiting: [], count: 0 } });
|
|
384
|
-
await E.page.click('#hmList [data-hm-day]');
|
|
385
|
-
await until(() => E.page.evaluate(() => !!document.querySelector('#czViewer .yd-open')), 15000);
|
|
386
|
-
ok('Y nothing waits: no ask under the opening line', await E.page.evaluate(() => !document.querySelector('#czViewer .yd-ask')));
|
|
387
|
-
await E.close(); }
|
|
388
|
-
return finish();
|
|
389
|
-
})();
|