create-pmos 0.436.0 → 0.438.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 +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 +121 -0
- package/workspace/briefing-premium-board-test.js +2 -1
- package/workspace/changelog.json +24 -0
- package/workspace/guide/adler.md +12 -1
- package/workspace/guide/briefing-premium.md +1 -1
- package/workspace/guide/home.md +22 -10
- package/workspace/home-rows-test.js +204 -115
- package/workspace/lib/mention-cli.js +45 -21
- package/workspace/lib/mention-store.js +196 -27
- package/workspace/lib/news-for-you.js +8 -16
- package/workspace/lib/routes-mentions.js +7 -2
- package/workspace/lib/routes-news.js +5 -11
- package/workspace/lib/source-reads.js +1 -1
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-briefing-depth-test.js +2 -2
- package/workspace/premium-chat-context-test.js +20 -0
- package/workspace/public/pm/bd-asks.js +5 -2
- package/workspace/public/pm/bd-deliveries.js +11 -2
- package/workspace/public/pm/cozy-adler.css +7 -1
- package/workspace/public/pm/cozy-adler.js +17 -0
- package/workspace/public/pm/cozy-board.css +5 -0
- package/workspace/public/pm/cozy-ev.css +8 -0
- package/workspace/public/pm/cozy-home-rows.css +88 -62
- package/workspace/public/pm/cozy-home.css +7 -0
- package/workspace/public/pm/cozy-live-pill.css +2 -0
- package/workspace/public/pm/cozy-live-pill.js +6 -3
- package/workspace/public/pm/cozy-nav.js +18 -5
- package/workspace/public/pm/cozy-news.js +8 -27
- package/workspace/public/pm/cozy-pull.js +62 -0
- package/workspace/public/pm/cozy-rec-tab.css +2 -0
- package/workspace/public/pm/cozy-rec-tab.js +18 -1
- package/workspace/public/pm/cozy-settings.js +14 -5
- package/workspace/public/pm/cozy-steps.css +3 -0
- package/workspace/public/pm/cozy-steps.js +5 -4
- package/workspace/public/pm/cozy-today.css +5 -0
- package/workspace/public/pm/home-app.js +33 -2
- package/workspace/public/pm/home-day.js +43 -11
- package/workspace/public/pm/home-mentions.js +339 -194
- package/workspace/public/pm/home-review.js +9 -1
- package/workspace/public/pm/home-stage-card.js +9 -3
- package/workspace/public/pm/impact.css +1 -0
- package/workspace/public/pm/impact.js +5 -2
- package/workspace/public/pm/ini-tasks.js +19 -3
- package/workspace/public/pm/premium-board.js +12 -4
- package/workspace/public/pm/premium-shell.js +12 -4
- package/workspace/public/pm/premium-vw-ctx.js +16 -2
- package/workspace/public/pm/premium-vw-doc-model.js +11 -0
- package/workspace/public/pm/premium-vw-doc.css +2 -0
- package/workspace/public/pm/premium-vw-doc.js +8 -2
- package/workspace/public/pm/premium.css +14 -0
- package/workspace/public/pm/program-charter.js +2 -1
- package/workspace/public/pm/session-rail.js +12 -5
- package/workspace/public/premium-rec.html +1 -1
- package/workspace/skills/morning-brief.skill +2 -1
- package/workspace/skills/sources-read.skill +1 -0
- package/workspace/task-views-test.js +10 -1
- package/workspace/test-lists/adler-followups.json +9 -0
- package/workspace/test-lists/batch17-adler-moments.json +13 -0
|
@@ -1,21 +1,25 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
|
-
/* home-rows-test.js — the two rows at the top of Home and the Mentions Viewer (
|
|
4
|
-
*
|
|
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
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
|
|
7
|
-
* M1 @Mentions is the first row of the list with a badge: how many
|
|
8
|
-
*
|
|
6
|
+
* GET /api/mentions answers the fixture (lib/mention-store.js's conversations), and GET /api/notes says whether a meeting records.
|
|
7
|
+
* M1 @Mentions is the first row of the list with a badge: how many conversations wait (Your move); a new ask since the PM last looked
|
|
8
|
+
* adds one line under the name; with none waiting the row stays, quiet, with no badge
|
|
9
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
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
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, ↻
|
|
19
23
|
* R1 a recording pins a row above @Mentions with its title and a ticking clock; paused is quieter and still; none: no row
|
|
20
24
|
* F a phone (390 px): the rows, and the Viewer full screen; no page error anywhere
|
|
21
25
|
* Screenshots (1440x900, 390x844) go to PMOS_SHOTS when it is set. Every wait polls the page. */
|
|
@@ -49,21 +53,27 @@ const ago = (min) => new Date(Date.now() - min * 60000).toISOString();
|
|
|
49
53
|
const D = 24 * 60;
|
|
50
54
|
const SOD = new Date().setHours(0, 0, 0, 0);
|
|
51
55
|
const today = (min) => new Date(Math.max(SOD + 60000, Date.now() - min * 60000)).toISOString(); // today, whatever the clock says
|
|
52
|
-
const
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
],
|
|
62
|
-
|
|
63
|
-
{
|
|
64
|
-
|
|
65
|
-
{
|
|
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.' }),
|
|
66
75
|
] });
|
|
76
|
+
const recentOf = (m) => ({ ...m, recent: [...m.toread, ...m.answered] });
|
|
67
77
|
|
|
68
78
|
(async () => {
|
|
69
79
|
const exe = findBrowser();
|
|
@@ -74,12 +84,12 @@ const MENTIONS = (ini) => ({ ok: true, count: 4, gaps: [], as_of: ago(30), waiti
|
|
|
74
84
|
await T.waitForServer(BASE);
|
|
75
85
|
browser = await chromium.launch({ executablePath: exe });
|
|
76
86
|
|
|
77
|
-
// the fixture's first initiative, so a
|
|
87
|
+
// the fixture's first initiative, so a conversation names one Home shows
|
|
78
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);
|
|
79
89
|
const INI = (((board && board.initiatives && board.initiatives.list && board.initiatives.list.rows) || []).find((r) => r && r.id) || {}).id || '';
|
|
80
|
-
ok('0 the board has an initiative for a
|
|
90
|
+
ok('0 the board has an initiative for a conversation to name', !!INI);
|
|
81
91
|
|
|
82
|
-
const open = async ({ w = 1440, h = 900, mentions = MENTIONS(INI), rec = null, seen = null } = {}) => {
|
|
92
|
+
const open = async ({ w = 1440, h = 900, mentions = recentOf(MENTIONS(INI)), rec = null, seen = null } = {}) => {
|
|
83
93
|
const ctx = await browser.newContext({ viewport: { width: w, height: h }, hasTouch: w < 500 });
|
|
84
94
|
const page = await ctx.newPage();
|
|
85
95
|
const errors = [], posts = [];
|
|
@@ -97,141 +107,194 @@ const MENTIONS = (ini) => ({ ok: true, count: 4, gaps: [], as_of: ago(30), waiti
|
|
|
97
107
|
await page.route('**/api/pm-items/add', json({ ok: true, item: { id: 'item-x' } }));
|
|
98
108
|
await page.route('**/api/boards/tasks/add', json({ ok: true, item: { uid: 'task-abc' } }));
|
|
99
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 */ } });
|
|
100
111
|
if (seen != null) await page.addInitScript((t) => { try { localStorage.setItem('cz-men-seen', String(t)); } catch { /* none */ } }, seen);
|
|
101
112
|
await page.goto(BASE + '/premium.html');
|
|
102
113
|
const up = await until(() => page.evaluate(() => !!document.querySelector('#hmList [data-hr-mentions]')), 20000);
|
|
103
114
|
const close = async () => { await ctx.unrouteAll({ behavior: 'ignoreErrors' }).catch(() => {}); await ctx.close().catch(() => {}); };
|
|
104
115
|
return { ctx, page, errors, posts, up, notes, men, close };
|
|
105
116
|
};
|
|
106
|
-
const shot = async (page, name) => { if (!SHOTS) return; fs.mkdirSync(SHOTS, { recursive: true }); await page.screenshot({ path: path.join(SHOTS, name + '.png') }); };
|
|
107
|
-
const vw = (page) => page.evaluate(() => { const v = document.querySelector('#czViewer:not([hidden])'); return v ? { title: (v.querySelector('#czVwTitle') || {}).textContent || '', text: v.textContent, back: !!v.querySelector('[data-cz-vw="back"]') } : null; });
|
|
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
|
+
});
|
|
108
140
|
|
|
109
141
|
/* M1, M2 */
|
|
110
|
-
const A = await open({ seen: Date.now() - 60 * 60000 });
|
|
142
|
+
const A = await open({ seen: Date.now() - 6 * 60 * 60000 });
|
|
111
143
|
ok('0 the page draws the list with the Mentions row', !!A.up);
|
|
112
144
|
if (!A.up) return finish(1);
|
|
113
145
|
const p = A.page;
|
|
114
146
|
const top = await until(() => p.evaluate(() => { const b = document.querySelector('#hmList .hv-body'); const f = b && b.firstElementChild; const r = f && f.querySelector('[data-hr-mentions]'); return r && r.querySelector('.hr-bd') ? { first: f.className, bd: r.querySelector('.hr-bd').textContent, sub: (r.querySelector('.hr-sub') || {}).textContent || '', aria: r.getAttribute('aria-label') } : null; }));
|
|
115
|
-
ok('M1 @Mentions is the first row of the list, with the badge
|
|
116
|
-
ok('M1 an ask newer than the last look adds one line under the name', !!top && /^(
|
|
147
|
+
ok('M1 @Mentions is the first row of the list, with the badge 3 (Your move)', !!top && /hr-men-card/.test(top.first) && top.bd === '3' && top.aria === 'Mentions, 3 wait on your reply', JSON.stringify(top));
|
|
148
|
+
ok('M1 an ask newer than the last look adds one line under the name', !!top && /^(Jason|Maya and Dion) asks you something$/.test(top.sub), JSON.stringify(top));
|
|
117
149
|
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:"]')));
|
|
118
150
|
await shot(p, 'home-1440');
|
|
119
151
|
|
|
120
152
|
/* M3 */
|
|
121
153
|
await p.click('#hmList [data-hr-mentions]');
|
|
122
|
-
const L1 = await until(() =>
|
|
123
|
-
ok('M3 the row opens the Mentions Viewer', !!L1, JSON.stringify(L1));
|
|
124
|
-
|
|
125
|
-
ok('M3
|
|
126
|
-
|
|
127
|
-
ok('M3
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
ok('M3
|
|
131
|
-
|
|
132
|
-
ok('M3
|
|
133
|
-
ok('M3
|
|
134
|
-
await
|
|
135
|
-
await p.click('#czViewer [data-czs-fold="recent"]');
|
|
136
|
-
const rl = await until(() => p.evaluate(() => { const s = document.querySelector('#czViewer [data-czs-id="recent"] .czs-body'); return s && !s.hidden ? { days: [...s.querySelectorAll('.hr-day')].map((d) => d.textContent), rows: [...s.querySelectorAll('.hr-mi')].map((b) => ({ id: b.dataset.hrMi, dot: !b.querySelector('.hr-mdot').classList.contains('read'), sub: b.querySelector('.hr-mw > span').textContent.trim(), tick: !!b.querySelector('.hr-mw > span svg'), r: b.querySelector('.hr-age').textContent })) } : null; }));
|
|
137
|
-
ok('M3 Last 7 days opens by real day: Today, then Yesterday with its date', !!rl && rl.days[0] === 'Today' && /^Yesterday, (Sun|Mon|Tue|Wed|Thu|Fri|Sat) \d{1,2} [A-Z][a-z]{2}$/.test(rl.days[1]), JSON.stringify(rl));
|
|
138
|
-
ok('M3 a dot only on the unopened FYI; @channel says it is not counted; a reply says You replied, with the tick icon', !!rl && rl.rows.map((x) => x.dot).join() === 'true,false,false,false' && /Not counted as an ask$/.test(rl.rows[2].sub) && rl.rows[3].sub === 'You replied in the thread' && rl.rows[3].tick && /^\d+ (min|h)$/.test(rl.rows[0].r) && /^[A-Z][a-z]{2}$/.test(rl.rows[2].r), JSON.stringify(rl));
|
|
139
|
-
await shot(p, 'mentions-recent-1440');
|
|
154
|
+
const L1 = await until(() => listOf(p).then((l) => (l && l.move.length ? l : null)));
|
|
155
|
+
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));
|
|
156
|
+
ok('M3 Adler opens on who waits and what Claude 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]));
|
|
157
|
+
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]));
|
|
158
|
+
const mv = L1 ? L1.move : [];
|
|
159
|
+
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));
|
|
160
|
+
function mx(x) { return x.pl + x.n; }
|
|
161
|
+
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));
|
|
162
|
+
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]));
|
|
163
|
+
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]));
|
|
164
|
+
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]));
|
|
165
|
+
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));
|
|
166
|
+
ok('M3 the Mentions row is the selected row', await p.evaluate(() => !!document.querySelector('#hmList .hr-men.sel')));
|
|
140
167
|
|
|
141
|
-
/* M4 */
|
|
142
|
-
await p.
|
|
143
|
-
|
|
144
|
-
ok('M4
|
|
145
|
-
|
|
146
|
-
ok('M4
|
|
147
|
-
ok('M4
|
|
148
|
-
ok('M4
|
|
149
|
-
|
|
150
|
-
await
|
|
168
|
+
/* M4: side by side */
|
|
169
|
+
const C1 = await until(() => convOf(p).then((c) => (c && c.ak ? c : null)));
|
|
170
|
+
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));
|
|
171
|
+
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));
|
|
172
|
+
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 Claude|Copy it and open Slack. PMOS never posts.', JSON.stringify(C1 && [C1.four, C1.right]));
|
|
173
|
+
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));
|
|
174
|
+
ok('M4 Claude 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));
|
|
175
|
+
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]));
|
|
176
|
+
await shot(p, 'mentions-1440');
|
|
177
|
+
await p.click('#czViewer [data-mn-row="aaaaaaaaaaa2"] [data-mn="open"]');
|
|
178
|
+
const C2 = await until(() => convOf(p).then((c) => (c && /^Maya Tan and Dion Lee/.test(c.head) ? c : null)));
|
|
179
|
+
ok('M4 a press on a row shows that conversation beside the list; no draft: ✎ "Write it with Claude" only', !!C2 && C2.right.join('|') === 'Write it with Claude' && !C2.stands.length && !C2.watch.length, JSON.stringify(C2));
|
|
180
|
+
await p.click('#czViewer [data-mn-row="aaaaaaaaaaa1"] [data-mn="open"]');
|
|
181
|
+
await until(() => convOf(p).then((c) => (c && /^Samuel/.test(c.head) ? c : null)));
|
|
151
182
|
|
|
152
183
|
/* M5 */
|
|
153
184
|
A.posts.length = 0;
|
|
154
|
-
await p.click('#czViewer [data-
|
|
185
|
+
await p.click('#czViewer [data-mn-conv] [data-mn="answered"]');
|
|
155
186
|
const m5 = await until(() => A.posts.find((x) => x.path === '/api/mentions/act'));
|
|
156
|
-
ok('M5 Mark answered posts the mark
|
|
157
|
-
const back5 = await until(() => vw(p).then((v) => (v && v.title === 'Mentions' ? v : null)));
|
|
158
|
-
ok('M5 …and goes back to the list', !!back5);
|
|
187
|
+
ok('M5 Mark answered posts the mark under the conversation\'s id', !!m5 && m5.body.id === 'aaaaaaaaaaa1' && m5.body.act === 'answered', JSON.stringify(m5));
|
|
159
188
|
const t5 = await until(() => p.evaluate(() => { const t = document.querySelector('#toast.on'); return t && t.querySelector('.undo') ? t.textContent : null; }));
|
|
160
|
-
ok('M5 the toast says what was done, with Undo', !!t5 && /^Marked answered:
|
|
189
|
+
ok('M5 the toast says what was done, with Undo', !!t5 && /^Marked answered: Samuel’s ask/.test(t5), String(t5));
|
|
161
190
|
await p.click('#toast .undo');
|
|
162
191
|
const u5 = await until(() => A.posts.find((x) => x.path === '/api/mentions/act' && x.body.act === 'undo'));
|
|
163
|
-
ok('M5 Undo posts undo for the same
|
|
164
|
-
await p.click('#czViewer [data-hr-mi="aaaaaaaaaaa1"]');
|
|
165
|
-
await until(() => vw(p).then((v) => (v && /^Dita/.test(v.title) ? v : null)));
|
|
192
|
+
ok('M5 Undo posts undo for the same conversation', !!u5 && u5.body.id === 'aaaaaaaaaaa1', JSON.stringify(u5));
|
|
166
193
|
A.posts.length = 0;
|
|
167
|
-
await p.click('#czViewer [data-
|
|
194
|
+
await p.click('#czViewer [data-mn-conv] [data-mn="task"]');
|
|
168
195
|
const tk = await until(() => (A.posts.find((x) => x.path === '/api/mentions/act' && x.body.act === 'task') ? A.posts : null));
|
|
169
196
|
const add = (tk || []).find((x) => x.path === '/api/boards/tasks/add'), mk = (tk || []).find((x) => x.path === '/api/mentions/act');
|
|
170
|
-
ok('M5 Make it a task adds "Reply to
|
|
171
|
-
const t6 = await until(() => p.evaluate(() => { const t = document.querySelector('#toast.on'); return t && /^Task added to /.test(t.textContent) ? t.textContent : null; }));
|
|
172
|
-
ok('M5 the toast says where the task went, with Undo', !!t6 && /: Reply to Dita/.test(t6), String(t6));
|
|
173
|
-
await p.click('#czViewer [data-hr-mi="aaaaaaaaaaa1"]').catch(() => {});
|
|
174
|
-
await until(() => vw(p).then((v) => (v && /^Dita/.test(v.title) ? v : null)));
|
|
197
|
+
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));
|
|
175
198
|
A.posts.length = 0;
|
|
176
|
-
await p.click('#czViewer [data-
|
|
199
|
+
await p.click('#czViewer [data-mn-conv] [data-mn="send"]');
|
|
177
200
|
const sd = await until(() => A.posts.find((x) => x.path === '/api/mentions/act' && x.body.act === 'drafted'));
|
|
178
|
-
ok('M5 send records the
|
|
201
|
+
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));
|
|
179
202
|
const t7 = await until(() => p.evaluate(() => { const t = document.querySelector('#toast.on'); return t && /Paste it in Slack/.test(t.textContent) ? t.textContent : null; }));
|
|
180
203
|
ok('M5 the toast says to paste it in Slack', !!t7, String(t7));
|
|
204
|
+
A.posts.length = 0;
|
|
205
|
+
await p.click('#czViewer [data-mn-conv] [data-mn="watch"]');
|
|
206
|
+
const wt = await until(() => A.posts.find((x) => x.path === '/api/mentions/act' && x.body.act === 'watch'));
|
|
207
|
+
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));
|
|
181
208
|
|
|
182
209
|
/* M6 */
|
|
183
|
-
await
|
|
184
|
-
await p.
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
210
|
+
await p.click('#czViewer [data-mn-conv] [data-mn="pen"]');
|
|
211
|
+
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; }));
|
|
212
|
+
ok('M6 the pencil opens the chat "Reply to Samuel" and the Viewer stays beside it', !!ch && ch.vw, JSON.stringify(ch));
|
|
213
|
+
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.';
|
|
214
|
+
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);
|
|
215
|
+
ok('M6 a reply Claude saves shows while the conversation is open', !!nd);
|
|
216
|
+
|
|
217
|
+
/* T: To read */
|
|
218
|
+
await p.click('#czViewer .czs-sec[data-czs-id="toread"] [data-czs-fold]');
|
|
219
|
+
const R1 = await until(() => listOf(p).then((l) => (l && l.read.length ? l : null)));
|
|
220
|
+
const rd = R1 ? R1.read : [];
|
|
221
|
+
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));
|
|
222
|
+
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]));
|
|
223
|
+
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]));
|
|
224
|
+
await shot(p, 'mentions-toread-1440');
|
|
225
|
+
A.posts.length = 0;
|
|
226
|
+
await p.click('#czViewer [data-mn="all-read"]');
|
|
227
|
+
const ar = await until(() => A.posts.find((x) => x.path === '/api/mentions/act' && Array.isArray(x.body.ids)));
|
|
228
|
+
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));
|
|
229
|
+
A.posts.length = 0;
|
|
230
|
+
await p.click('#czViewer [data-mn-row="aaaaaaaaaab1"] [data-mn="open"]');
|
|
231
|
+
const rd1 = await until(() => A.posts.find((x) => x.path === '/api/mentions/act' && x.body.act === 'read' && x.body.id === 'aaaaaaaaaab1'));
|
|
232
|
+
const C3 = await until(() => convOf(p).then((c) => (c && /^Erik van Helvoort/.test(c.head) ? c : null)));
|
|
233
|
+
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));
|
|
191
234
|
ok('M no page error', !A.errors.length, A.errors.join(' | '));
|
|
192
235
|
await A.close();
|
|
193
236
|
|
|
194
|
-
/* E:
|
|
237
|
+
/* E: a heavy day, 30+ days, the edges */
|
|
195
238
|
const many = MENTIONS(INI);
|
|
196
|
-
many.waiting = [
|
|
197
|
-
.concat(Array.from({ length: 6 }, (_, i) => (
|
|
198
|
-
many.
|
|
199
|
-
|
|
239
|
+
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.' })]
|
|
240
|
+
.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) * 60), last: ago((6 - i) * 60), gist: 'Ask ' + i, draft: i < 3 ? 'Yes.' : undefined })));
|
|
241
|
+
many.count = 7;
|
|
242
|
+
many.gaps = [{ kind: 'source', source: 'mail', state: 'never' }, { kind: 'stale', upto: ago(26 * 60) }];
|
|
243
|
+
const E = await open({ w: 390, h: 844, mentions: recentOf(many) });
|
|
200
244
|
await E.page.click('#hmList [data-hr-mentions]');
|
|
201
|
-
const e1 = await until(() => E.page.
|
|
202
|
-
ok('E
|
|
203
|
-
ok('E
|
|
204
|
-
ok('E
|
|
205
|
-
|
|
245
|
+
const e1 = await until(() => listOf(E.page).then((l) => (l && l.move.length ? l : null)));
|
|
246
|
+
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]));
|
|
247
|
+
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]]));
|
|
248
|
+
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));
|
|
249
|
+
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));
|
|
250
|
+
await shot(E.page, 'mentions-busy-390');
|
|
206
251
|
E.posts.length = 0;
|
|
207
|
-
await E.page.click('#czViewer [data-
|
|
252
|
+
await E.page.click('#czViewer [data-mn="ck-yes"]');
|
|
208
253
|
const ey = await until(() => E.posts.find((x) => x.path === '/api/mentions/act'));
|
|
209
254
|
ok('E ✓ on the 30-day question marks it answered', !!ey && ey.body.id === 'aaaaaaaaaac0' && ey.body.act === 'answered', JSON.stringify(ey));
|
|
210
|
-
await E.page.click('#czViewer
|
|
211
|
-
ok('E
|
|
255
|
+
await E.page.click('#czViewer [data-mn="more-move"]');
|
|
256
|
+
ok('E "N more" shows every waiting conversation', await until(() => E.page.evaluate(() => document.querySelectorAll('#czViewer [data-czs-id="move"] .mn-row').length === 7)));
|
|
257
|
+
await E.page.click('#czViewer [data-mn="go"]');
|
|
258
|
+
const eg = await until(() => vw(E.page).then((v) => (v && v.title === 'Budi Santoso' ? v : null)));
|
|
259
|
+
ok('E the button opens the oldest conversation (a phone drills in)', !!eg && eg.back, JSON.stringify(eg));
|
|
212
260
|
// the read fails: the last list stays, with its time, never "nobody"
|
|
213
261
|
E.men.fail = true;
|
|
214
|
-
await E.page.click('#czViewer [data-cz-vw="
|
|
262
|
+
await E.page.click('#czViewer [data-cz-vw="back"]');
|
|
263
|
+
await E.page.click('#czViewer [data-cz-vw="back"]').catch(() => {});
|
|
264
|
+
await until(() => E.page.evaluate(() => !document.querySelector('#czViewer:not([hidden])')));
|
|
215
265
|
await E.page.click('#hmList [data-hr-mentions]');
|
|
216
|
-
const e4 = await until(() => E.page.
|
|
217
|
-
ok('E a failed read keeps the last list, says when it is from, with
|
|
266
|
+
const e4 = await until(() => listOf(E.page).then((l) => (l && /couldn’t refresh/.test(l.open) ? l : null)));
|
|
267
|
+
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]));
|
|
218
268
|
ok('E no page error', !E.errors.length, E.errors.join(' | '));
|
|
219
269
|
await E.close();
|
|
220
270
|
|
|
221
|
-
|
|
222
|
-
calm.
|
|
223
|
-
const Z = await open({ mentions: calm });
|
|
271
|
+
// nothing waits: the line opens on what is handled; Your move is not drawn; a watch shows in the line
|
|
272
|
+
const calm = MENTIONS(INI); calm.waiting = []; calm.count = 0; calm.watching = [{ id: 'aaaaaaaaaaa1', who: 'Samuel Chandra', what: 'Samuel’s tag' }];
|
|
273
|
+
const Z = await open({ mentions: recentOf(calm) });
|
|
224
274
|
const z = await until(() => Z.page.evaluate(() => { const r = document.querySelector('#hmList [data-hr-mentions]'); return r ? { t: r.textContent.replace(/\s+/g, ' ').trim(), n: !!r.querySelector('.hr-bd'), aria: r.getAttribute('aria-label') } : null; }));
|
|
225
275
|
ok('M1 with nothing waiting the row stays, quiet, with no badge', !!z && /^@ ?Mentions$/.test(z.t) && !z.n && z.aria === 'Mentions', JSON.stringify(z));
|
|
226
276
|
await Z.page.click('#hmList [data-hr-mentions]');
|
|
227
|
-
const z1 = await until(() => Z.page.
|
|
228
|
-
ok('E nothing waits:
|
|
277
|
+
const z1 = await until(() => listOf(Z.page).then((l) => (l && l.open ? l : null)));
|
|
278
|
+
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]));
|
|
279
|
+
await shot(Z.page, 'mentions-calm-1440');
|
|
229
280
|
await Z.close();
|
|
230
|
-
const
|
|
281
|
+
const quiet = MENTIONS(INI); quiet.waiting = []; quiet.toread = []; quiet.count = 0; quiet.gaps = [{ kind: 'source', source: 'mail', state: 'never' }]; quiet.sources = ['slack', 'jira'];
|
|
282
|
+
const Q = await open({ mentions: recentOf(quiet) });
|
|
283
|
+
await Q.page.click('#hmList [data-hr-mentions]');
|
|
284
|
+
const q1 = await until(() => listOf(Q.page).then((l) => (l && l.open ? l : null)));
|
|
285
|
+
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]));
|
|
286
|
+
await Q.close();
|
|
287
|
+
const some = MENTIONS(INI); some.waiting = []; some.count = 0; some.gaps = [{ kind: 'source', source: 'mail', state: 'never' }]; some.sources = ['slack', 'jira'];
|
|
288
|
+
const S2 = await open({ mentions: recentOf(some) });
|
|
289
|
+
await S2.page.click('#hmList [data-hr-mentions]');
|
|
290
|
+
const s1 = await until(() => listOf(S2.page).then((l) => (l && l.open ? l : null)));
|
|
291
|
+
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));
|
|
292
|
+
await S2.close();
|
|
293
|
+
const none = { ok: true, count: 0, waiting: [], toread: [], answered: [], recent: [], gaps: [], watching: [], landed: [], sources: [] };
|
|
231
294
|
const N = await open({ mentions: none });
|
|
232
295
|
await N.page.click('#hmList [data-hr-mentions]');
|
|
233
|
-
const n1 = await until(() => N.page.
|
|
234
|
-
ok('E nobody in 7 days: one quiet line and nothing else', !!n1 && n1.
|
|
296
|
+
const n1 = await until(() => listOf(N.page).then((l) => (l && l.open ? l : null)));
|
|
297
|
+
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));
|
|
235
298
|
await N.close();
|
|
236
299
|
|
|
237
300
|
/* R1 */
|
|
@@ -261,6 +324,7 @@ const MENTIONS = (ini) => ({ ok: true, count: 4, gaps: [], as_of: ago(30), waiti
|
|
|
261
324
|
const W = await open({ w: 2000, h: 1000 });
|
|
262
325
|
await W.page.click('#hmList [data-hr-mentions]');
|
|
263
326
|
await until(() => vw(W.page));
|
|
327
|
+
await W.page.evaluate(() => window.czViewer.wide(false)); // Mentions opens wide on a desktop; this checks the width rule itself
|
|
264
328
|
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) })); };
|
|
265
329
|
const w0 = await lay(600);
|
|
266
330
|
ok('W at a narrow width the list shows', !w0.rail && w0.list > 200, JSON.stringify(w0));
|
|
@@ -280,12 +344,37 @@ const MENTIONS = (ini) => ({ ok: true, count: 4, gaps: [], as_of: ago(30), waiti
|
|
|
280
344
|
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"]') }; }));
|
|
281
345
|
ok('F the Mentions Viewer is full screen on a phone, with ←', !!pv && pv.w >= 380 && pv.back, JSON.stringify(pv));
|
|
282
346
|
await shot(P.page, 'mentions-390');
|
|
283
|
-
await P.page.
|
|
284
|
-
|
|
285
|
-
|
|
347
|
+
const pl = await until(() => listOf(P.page).then((l) => (l && l.move.length ? l : null)));
|
|
348
|
+
ok('F on a phone the list is one column, no conversation beside it', !!pl && !pl.split, JSON.stringify(pl && pl.split));
|
|
349
|
+
const pm = pl ? pl.move : [];
|
|
350
|
+
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 Claude|Copy it and open Slack. PMOS never posts.', JSON.stringify(pm[0]));
|
|
351
|
+
ok('F no draft: why, in one line, and ✎ "Write it with Claude" 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 Claude', JSON.stringify(pm[1]));
|
|
352
|
+
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]));
|
|
353
|
+
await P.page.click('#czViewer [data-mn-row="aaaaaaaaaaa1"] [data-mn="open"]');
|
|
354
|
+
const pc = await until(() => vw(P.page).then((v) => (v && v.title === 'Samuel Chandra' ? v : null)));
|
|
355
|
+
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));
|
|
356
|
+
const pcv = await convOf(P.page);
|
|
357
|
+
ok('F the messages start folded on a phone', !!pcv && pcv.msgsOpen === 'false', JSON.stringify(pcv && pcv.msgsOpen));
|
|
358
|
+
await shot(P.page, 'mention-one-390');
|
|
286
359
|
const sx = await P.page.evaluate(() => document.documentElement.scrollWidth <= innerWidth + 1);
|
|
287
360
|
ok('F no sideways scroll at 390 px', sx);
|
|
288
361
|
ok('F no page error', !P.errors.length, P.errors.join(' | '));
|
|
289
362
|
await P.close();
|
|
363
|
+
/* Y (batch 17 item 6): Your day's opening card names the oldest ask in Your move; its icon opens that conversation in Mentions */
|
|
364
|
+
{ const Q = await open();
|
|
365
|
+
await Q.page.click('#hmList [data-hm-day]');
|
|
366
|
+
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);
|
|
367
|
+
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));
|
|
368
|
+
await shot(Q.page, 'day-ask-1440');
|
|
369
|
+
await Q.page.click('#czViewer .yd-ask [data-yd="ask"]');
|
|
370
|
+
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; });
|
|
371
|
+
ok('Y its icon opens Mentions on that conversation', !!yc, JSON.stringify(yc));
|
|
372
|
+
ok('Y no page error', !Q.errors.length, Q.errors.join(' | '));
|
|
373
|
+
await Q.close();
|
|
374
|
+
const E = await open({ mentions: { ...recentOf(MENTIONS(INI)), waiting: [], count: 0 } });
|
|
375
|
+
await E.page.click('#hmList [data-hm-day]');
|
|
376
|
+
await until(() => E.page.evaluate(() => !!document.querySelector('#czViewer .yd-open')), 15000);
|
|
377
|
+
ok('Y nothing waits: no ask under the opening line', await E.page.evaluate(() => !document.querySelector('#czViewer .yd-ask')));
|
|
378
|
+
await E.close(); }
|
|
290
379
|
return finish();
|
|
291
380
|
})();
|