create-pmos 0.435.0 → 0.437.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.
Files changed (34) hide show
  1. package/package.json +25 -25
  2. package/payload/KIT-VERSION +1 -1
  3. package/payload/planning/evals/eval-calibration.md +1 -1
  4. package/payload/planning/okrs/health-budgets.md +1 -1
  5. package/payload/state/discoveries.md +1 -1
  6. package/workspace/changelog.json +24 -0
  7. package/workspace/guide/home.md +22 -11
  8. package/workspace/guide/initiative-boards.md +1 -1
  9. package/workspace/home-rows-test.js +188 -115
  10. package/workspace/lib/engine/boards.js +1 -1
  11. package/workspace/lib/mention-cli.js +45 -21
  12. package/workspace/lib/mention-store.js +196 -27
  13. package/workspace/lib/news-for-you.js +8 -16
  14. package/workspace/lib/routes-boards.js +2 -1
  15. package/workspace/lib/routes-mentions.js +7 -2
  16. package/workspace/lib/routes-news.js +5 -11
  17. package/workspace/lib/source-reads.js +1 -1
  18. package/workspace/package-lock.json +2 -2
  19. package/workspace/package.json +1 -1
  20. package/workspace/premium-briefing-depth-test.js +2 -2
  21. package/workspace/public/pm/cozy-home-rows.css +88 -62
  22. package/workspace/public/pm/cozy-news.js +8 -27
  23. package/workspace/public/pm/home-day.js +4 -6
  24. package/workspace/public/pm/home-mentions.js +327 -193
  25. package/workspace/public/pm/home-task.js +4 -2
  26. package/workspace/public/pm/ini-tasks.js +34 -6
  27. package/workspace/public/pm/ini-view.css +4 -0
  28. package/workspace/public/pm/premium-vw-item.js +2 -0
  29. package/workspace/public/pm/task-card.css +1 -0
  30. package/workspace/public/pm/task-card.js +8 -3
  31. package/workspace/skills/morning-brief.skill +2 -1
  32. package/workspace/skills/sources-read.skill +1 -0
  33. package/workspace/task-delete-test.js +31 -0
  34. package/workspace/task-views-test.js +16 -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 (agreed A+; canvas XmsMentionsGrill, XmsDeskList, XmsDeskOne,
4
- * XmsDeskRefine, XvARecHome; public/pm/home-mentions.js, home-rec-row.js).
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 shape), and GET /api/notes says whether a meeting records.
7
- * M1 @Mentions is the first row of the list with a badge: how many asks wait (reading does not clear it); a new ask since the PM last
8
- * looked adds one line under the name; with none waiting the row stays, quiet, with no badge
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: the summary (N wait, oldest X in amber, who asks what, one round Reply press), Waiting on you open (oldest
11
- * first, the age the only signal, amber after 2 days, a count for a second ask, "Your draft is ready" for a drafted reply), Last 7 days
12
- * folded, by real day, an FYI dot only on an unopened FYI, @channel not counted; what PMOS could not read said once at the end
13
- * M4 one mention: waiting and its age in amber, what is asked, its place; four icons with names (no menu); What I found; Proposed reply
14
- * with pencil and send; the messages folded at the bottom
15
- * M5 Mark answered posts the mark, goes back to the list, and the toast has Undo, which posts undo; Make it a task adds the task on the
16
- * mention's initiative and says where; send records the draft as waiting to be sent (PMOS posts nothing)
17
- * M6 the pencil opens the chat "Reply to <name>" beside the Viewer, and a reply Claude saves shows in the Viewer while it is open
18
- * E a 30+ day ask asks once; 6+ waiting shows the oldest 5 and Show all; nothing waiting; nobody in 7 days; a failed read keeps the list
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 yday = (h) => new Date(SOD - h * 3600e3).toISOString(); // yesterday, h hours before midnight
53
- const MENTIONS = (ini) => ({ ok: true, count: 4, gaps: [], as_of: ago(30), waiting: [
54
- { id: 'aaaaaaaaaaa1', source: 'slack', who: 'Dita', where: '#product', text: 'Can v2.4 ship without the phone rail? Need an answer before Fri.', ask: 'if v2.4 can ship without the phone rail', waiting: true,
55
- since: ago(9 * D), last: ago(9 * D), count: 1, link: 'https://slack.example/1', initiative: ini, about: 'Dita asks if v2.4 can ship without the phone rail. She needs it before Fri.',
56
- found: [{ label: 'PRD v3', text: 'keeps the phone rail out of v2.4.' }, { text: 'You haven’t decided this anywhere I can see.' }], draft: 'Hi Dita, yes: v2.4 ships without the phone rail.',
57
- thread: [{ who: 'Bima', at: ago(9 * D + 10), text: 'QA found 2 more bugs.' }, { who: 'Dita', at: ago(9 * D), text: 'Can v2.4 ship without the phone rail? Need an answer before Fri.' }] },
58
- { id: 'aaaaaaaaaaa2', source: 'jira', who: 'Arif', where: 'SLV-144', text: 'Which IdP do we keep for the pilot?', ask: 'which IdP the pilot keeps', waiting: true, since: ago(3 * D), last: today(30), count: 2 },
59
- { id: 'aaaaaaaaaaa3', source: 'mail', who: 'Rudi', where: 'RFP date', text: 'Can you confirm the RFP date?', waiting: true, since: ago(D + 60), last: ago(D + 60), count: 1, drafted: 'Mail', draft: 'Yes, 4 Nov.' },
60
- { id: 'aaaaaaaaaaa4', source: 'confluence', who: 'Maya', where: 'PRD v3', text: 'Is the SSO cut-over in scope for Ascent?', ask: 'about SSO scope', waiting: true, since: ago(120), last: ago(120), count: 1 },
61
- ], recent: [
62
- { id: 'aaaaaaaaaab1', source: 'slack', who: 'Joko', where: '#ascent', text: 'FYI @Wawan the vendor deck is in the drive.', fyi: true, read: false, last: today(40) },
63
- { id: 'aaaaaaaaaab2', source: 'confluence', who: 'Lina', where: 'Pilot plan', text: 'Thanks @Wawan, the risks table is updated.', fyi: true, read: true, last: today(180) },
64
- { id: 'aaaaaaaaaab3', source: 'slack', who: 'Ops bot', where: '#ascent', text: 'Deploy window moves to 22:00.', fyi: true, broadcast: true, read: true, last: yday(2) },
65
- { id: 'aaaaaaaaaab4', source: 'slack', who: 'Dani', where: '#product', text: 'Is the beta list final?', status: 'replied', last: yday(3) },
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 mention names one Home shows
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 mention to name', !!INI);
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 4 (the asks that wait)', !!top && /hr-men-card/.test(top.first) && top.bd === '4' && top.aria === 'Mentions, 4 wait on your reply', JSON.stringify(top));
116
- ok('M1 an ask newer than the last look adds one line under the name', !!top && /^(Arif asks which IdP the pilot keeps|Maya asks about SSO scope)$/.test(top.sub), JSON.stringify(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(() => vw(p).then((v) => (v && v.title === 'Mentions' && /wait on your reply/.test(v.text) ? v : null)));
123
- ok('M3 the row opens the Mentions Viewer', !!L1, JSON.stringify(L1));
124
- const sum = await p.evaluate(() => { const v = document.querySelector('#czViewer'); const s = v.querySelector('.hr-sum'); return { line: (s.querySelector('.czs-line') || {}).textContent || '', old: !!s.querySelector('.hr-old'), text: (s.querySelector('.czs-p') || {}).textContent || '', words: [...s.querySelectorAll('button')].map((b) => b.textContent.trim()), round: (s.querySelector('.hr-rp') || {}).getAttribute ? s.querySelector('.hr-rp').getAttribute('aria-label') : '', secs: [...v.querySelectorAll('.czs-sec')].map((x) => [x.querySelector('.czs-row b').textContent, (x.querySelector('.czs-n') || {}).textContent || '', x.querySelector('.czs-row').getAttribute('aria-expanded')]), sel: !!document.querySelector('#hmList .hr-men.sel'), menu: !!v.querySelector('[data-cz-vw="more"]') }; });
125
- ok('M3 the summary: 4 wait, oldest 9 days in amber, who asks what', /4 wait on your reply\s*oldest 9 days/.test(sum.line) && sum.old && /^Dita asks if v2\.4 can ship without the phone rail\. Arif asks which IdP the pilot keeps, and asked again today\. And 2 more\.$/.test(sum.text), JSON.stringify(sum));
126
- ok('M3 the one press is the round Reply icon (no word button), and no ⋯ menu ("Mark all read" is gone)', sum.round === 'Reply to Dita' && sum.words.join('') === '' && !sum.menu, JSON.stringify(sum));
127
- ok('M3 Waiting on you is open with 4; Last 7 days is folded with 4', JSON.stringify(sum.secs) === JSON.stringify([['Waiting on you', '4', 'true'], ['Last 7 days', '4', 'false']]), JSON.stringify(sum.secs));
128
- ok('M3 the Mentions row is the selected row', sum.sel);
129
- const wl = await p.evaluate(() => [...document.querySelectorAll('#czViewer [data-czs-id="waiting"] .hr-mi')].map((b) => ({ id: b.dataset.hrMi, head: b.querySelector('.hr-mw b').textContent, sub: b.querySelector('.hr-mw > span').textContent, age: b.querySelector('.hr-age').textContent, late: b.querySelector('.hr-age').classList.contains('late'), dot: !!b.querySelector('.hr-mdot') })));
130
- ok('M3 Waiting is oldest first, the age the only signal (no dot), amber from 2 days', wl.map((x) => x.id).join() === 'aaaaaaaaaaa1,aaaaaaaaaaa2,aaaaaaaaaaa3,aaaaaaaaaaa4' && wl.map((x) => x.age).join() === '9 days,3 days,1 day,2 h'
131
- && wl.map((x) => x.late).join() === 'true,true,false,false' && wl.every((x) => !x.dot), JSON.stringify(wl));
132
- ok('M3 a second ask in one thread is one row with its count and "a follow-up today"', /^Arif · SLV-144 comment2$/.test(wl[1].head) && /and a follow-up today$/.test(wl[1].sub), JSON.stringify(wl[1]));
133
- ok('M3 a drafted reply stays waiting and says where to send it', wl[2].sub === 'Your draft is ready. Send it from Mail to clear this.', JSON.stringify(wl[2]));
134
- await shot(p, 'mentions-1440');
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.click('#czViewer [data-hr-mi="aaaaaaaaaaa1"]');
143
- const D1 = await until(() => vw(p).then((v) => (v && /^Dita/.test(v.title) ? v : null)));
144
- ok('M4 a mention drills in, titled who and where, with ←', !!D1 && D1.title === 'Dita · #product' && D1.back, JSON.stringify(D1));
145
- const one = await p.evaluate(() => { const v = document.querySelector('#czViewer'); return { line: (v.querySelector('.czs-line') || {}).textContent || '', warn: !!v.querySelector('.czs-line.warn'), p: (v.querySelector('.hr-one .czs-p') || {}).textContent || '', icons: [...v.querySelectorAll('.hr-acts button')].map((b) => b.getAttribute('aria-label') + '|' + b.getAttribute('title') + '|' + b.textContent.trim()), found: [...v.querySelectorAll('.hr-found li')].map((x) => x.textContent), draft: (v.querySelector('[data-hr-draft]') || {}).textContent || '', racts: [...v.querySelectorAll('.hr-racts button')].map((b) => b.getAttribute('aria-label')), secs: [...v.querySelectorAll('.czs-sec')].map((x) => [x.querySelector('.czs-row b').textContent, x.querySelector('.czs-row').getAttribute('aria-expanded')]), menu: !!v.querySelector('[data-cz-vw="more"]') }; });
146
- ok('M4 waiting on you · 9 days in amber, with what is asked and by when', /^Waiting on you · 9 days$/.test(one.line) && one.warn && /needs it before Fri/.test(one.p), JSON.stringify(one));
147
- ok('M4 four icons, each named, no word, no ⋯ menu', one.icons.join(';') === 'Mark answered|Mark answered|;Remind me tomorrow|Remind me tomorrow|;Make it a task|Make it a task|;Not an ask|Not an ask|' && !one.menu, JSON.stringify(one.icons));
148
- ok('M4 What I found lists the brief\'s findings; Proposed reply shows the draft with pencil and send', one.found.join('|') === 'PRD v3 keeps the phone rail out of v2.4.|You haven’t decided this anywhere I can see.' && one.draft === 'Hi Dita, yes: v2.4 ships without the phone rail.' && one.racts.join('|') === 'Change it with Claude|Copy it and open Slack', JSON.stringify(one));
149
- ok('M4 the source messages are folded at the bottom', JSON.stringify(one.secs) === JSON.stringify([['Dita’s message', 'false']]), JSON.stringify(one.secs));
150
- await shot(p, 'mention-one-1440');
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-hr-one="answered"]');
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 for that mention', !!m5 && m5.body.id === 'aaaaaaaaaaa1' && m5.body.act === 'answered', JSON.stringify(m5));
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: Dita’s ask/.test(t5), String(t5));
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 mention', !!u5 && u5.body.id === 'aaaaaaaaaaa1', JSON.stringify(u5));
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-hr-one="task"]');
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 Dita" on the mention\'s initiative, then marks it', !!add && add.body.title === 'Reply to Dita' && add.body.initiative === INI && !!mk && mk.body.task.id === 'task-abc' && mk.body.task.kind === 'board', JSON.stringify(tk));
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-hr-one="send"]');
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 draft as waiting to be sent in Slack (PMOS posts nothing)', !!sd && sd.body.to === 'Slack' && !A.posts.some((x) => /slack\.example/.test(x.path)), JSON.stringify(A.posts));
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 until(() => vw(p).then((v) => (v && /^Dita/.test(v.title) ? v : null)));
184
- await p.click('#czViewer [data-hr-one="pen"]');
185
- const ch = await until(() => p.evaluate(() => { const v = document.querySelector('#czViewer:not([hidden])'); const t = [...document.querySelectorAll('h1,h2,h3,.hc-t,.hm-ct,[data-chat-title]')].map((x) => x.textContent).join('|'); return v && /Reply to Dita/.test(document.body.textContent) ? { vw: !!v, t } : null; }));
186
- ok('M6 the pencil opens the chat "Reply to Dita" and the Viewer stays beside it', !!ch && ch.vw, JSON.stringify(ch));
187
- A.men.cur = JSON.parse(JSON.stringify(A.men.cur)); A.men.cur.waiting[0].draft = 'Hi Dita, yes: v2.4 ships without the rail; it lands in v2.5.';
188
- const nd = await until(() => p.evaluate(() => (document.querySelector('#czViewer [data-hr-draft]') || {}).textContent === 'Hi Dita, yes: v2.4 ships without the rail; it lands in v2.5.'), 14000, 300);
189
- ok('M6 a reply Claude saves shows in the Viewer while the mention is open', !!nd);
190
- await shot(p, 'mention-refine-1440');
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: 30+ days, many, nothing waits, nobody, failure, gaps */
237
+ /* E: a heavy day, 30+ days, the edges */
195
238
  const many = MENTIONS(INI);
196
- many.waiting = [{ id: 'aaaaaaaaaac0', source: 'mail', who: 'Budi', where: 'Q4 budget', text: 'Budget sign-off for Q4', waiting: true, since: ago(34 * D), last: ago(34 * D), count: 1, check: true }]
197
- .concat(Array.from({ length: 6 }, (_, i) => ({ id: 'aaaaaaaaaac' + (i + 1), source: 'slack', who: 'P' + i, where: '#ascent', text: 'Ask ' + i, waiting: true, since: ago((6 - i) * 60), last: ago((6 - i) * 60), count: 1 })));
198
- many.gaps = [{ kind: 'source', source: 'slack', state: 'never' }, { kind: 'stale', upto: ago(26 * 60) }];
199
- const E = await open({ mentions: many });
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.evaluate(() => { const v = document.querySelector('#czViewer'); const w = v && v.querySelector('[data-czs-id="waiting"]'); return w ? { rows: w.querySelectorAll('.hr-mi').length, all: (w.querySelector('.hr-all') || {}).textContent || '', ck: (w.querySelector('.hr-ck') || {}).textContent || '', sum: (v.querySelector('.hr-sum .czs-p') || {}).textContent, gaps: [...v.querySelectorAll('.hr-gap')].map((g) => g.textContent + '|' + g.querySelector('button').getAttribute('aria-label')) } : null; }));
202
- ok('E 6+ waiting: the oldest 5, then Show all 7; the summary names the pattern', !!e1 && e1.rows === 5 && e1.all === 'Show all 7' && /^Most are from #ascent\. Budi’s ask has waited 34 days\.$/.test(e1.sum), JSON.stringify(e1));
203
- ok('E a 30+ day ask asks once: "Did you answer this already?"', !!e1 && e1.ck === 'Did you answer this already?', JSON.stringify(e1));
204
- ok('E what PMOS could not read is said once at the end, each with its next action', !!e1 && e1.gaps.length === 2 && /^Slack isn’t connected, so Slack mentions are missing\.\|Connect Slack$/.test(e1.gaps[0]) && /^Today’s check hasn’t run yet\. Mentions are up to \d\d:\d\d (yesterday|on .+)\.\|Check now$/.test(e1.gaps[1]), JSON.stringify(e1));
205
- await shot(E.page, 'mentions-edges-1440');
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-hr-ck="yes"]');
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 .hr-all');
211
- ok('E Show all shows every waiting ask', await until(() => E.page.evaluate(() => document.querySelectorAll('#czViewer [data-czs-id="waiting"] .hr-mi').length === 7)));
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="close"]').catch(() => {});
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.evaluate(() => { const v = document.querySelector('#czViewer'); const s = v && v.querySelector('.hr-sum'); return s && /Couldn’t refresh/.test(s.textContent) ? { t: s.textContent, rows: v.querySelectorAll('[data-czs-id="waiting"] .hr-mi').length, retry: !!s.querySelector('[data-hr-act="retry"]') } : null; }));
217
- ok('E a failed read keeps the last list, says when it is from, with Try again', !!e4 && /Showing the list from \d\d:\d\d\. The workspace didn’t answer\./.test(e4.t) && e4.rows > 0 && e4.retry && !/Nobody/.test(e4.t), JSON.stringify(e4));
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
- const calm = MENTIONS(INI); calm.waiting = []; calm.count = 0;
222
- calm.recent = calm.recent.concat([{ id: 'aaaaaaaaaad1', source: 'slack', who: 'Sari', where: 'DM', text: 'Join the call?', status: 'answered', last: ago(D * 2) }]);
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.evaluate(() => { const v = document.querySelector('#czViewer'); const s = v && v.querySelector('.hr-sum'); return s && /Nothing waits/.test(s.textContent) ? { t: s.textContent, btn: s.querySelectorAll('button').length, secs: [...v.querySelectorAll('.czs-sec .czs-row b')].map((b) => b.textContent) } : null; }));
228
- ok('E nothing waits: a calm summary, no button, Last 7 days only', !!z1 && /^Nothing waits on youYou answered all 2 asks this week\. 2 FYIs from today are under Last 7 days\.$/.test(z1.t) && z1.btn === 0 && z1.secs.join() === 'Last 7 days', JSON.stringify(z1));
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 none = { ok: true, count: 0, waiting: [], recent: [], gaps: [] };
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.evaluate(() => { const v = document.querySelector('#czViewer'); const s = v && v.querySelector('.hr-sum'); return s && /Nobody/.test(s.textContent) ? { t: s.textContent, secs: v.querySelectorAll('.czs-sec').length } : null; }));
234
- ok('E nobody in 7 days: one quiet line and nothing else', !!n1 && n1.t === 'Nobody mentioned you in the last 7 days.' && n1.secs === 0, JSON.stringify(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,9 +344,18 @@ 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.click('#czViewer [data-hr-mi="aaaaaaaaaaa1"]');
284
- await until(() => vw(P.page).then((v) => (v && /^Dita/.test(v.title) ? v : null)));
285
- await shot(P.page, 'mention-slack-390');
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(' | '));
@@ -366,7 +366,7 @@ function fold(events) {
366
366
  suggestNo.set(e.id, { kind: e.of === 'merge' ? 'merge' : 'split', fp: e.fp, at: e.at || null });
367
367
  }
368
368
  }
369
- return { boards, moves, assigns, asks, stages, iniWorkflows, tasks, sections, milestones, pins, ticketNotes, ticketDates, epics, archives, deleted, notDup, iniWf, ends, judged, autoOver, ticketMoves, smOps, smUndone, suggestNo, events: list };
369
+ return { boards, moves, assigns, asks, stages, iniWorkflows, tasks, removed, sections, milestones, pins, ticketNotes, ticketDates, epics, archives, deleted, notDup, iniWf, ends, judged, autoOver, ticketMoves, smOps, smUndone, suggestNo, events: list };
370
370
  }
371
371
 
372
372
  /** The stages an initiative runs on a board: its own workflow when one is recorded, else the board's. */