create-pmos 0.362.0 → 0.364.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 (48) hide show
  1. package/package.json +35 -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/briefing-premium-board-test.js +6 -6
  7. package/workspace/briefing-premium-calendar-2-test.js +3 -3
  8. package/workspace/briefing-premium-calendar-3-test.js +6 -5
  9. package/workspace/briefing-premium-calendar-test.js +3 -2
  10. package/workspace/briefing-premium-initiative-test.js +6 -5
  11. package/workspace/briefing-premium-insights-test.js +1 -1
  12. package/workspace/briefing-premium-test.js +65 -58
  13. package/workspace/briefing-premium-work-test.js +1 -1
  14. package/workspace/changelog.json +34 -0
  15. package/workspace/guide/briefing-premium.md +23 -19
  16. package/workspace/guide/data-freshness.md +15 -1
  17. package/workspace/lib/briefing-premium-agent.js +3 -1
  18. package/workspace/lib/freshness.js +17 -1
  19. package/workspace/lib/pmos-verbs.js +3 -0
  20. package/workspace/lib/source-cli.js +85 -0
  21. package/workspace/lib/source-reads.js +200 -0
  22. package/workspace/package-lock.json +2 -2
  23. package/workspace/package.json +1 -1
  24. package/workspace/premium-studio-test.js +8 -8
  25. package/workspace/premium-vw-item-test.js +3 -3
  26. package/workspace/premium-vw-meet-test.js +32 -21
  27. package/workspace/premium-vw-notes-test.js +5 -5
  28. package/workspace/premium-vw-rec-test.js +1 -1
  29. package/workspace/public/pm/premium-board.js +4 -3
  30. package/workspace/public/pm/premium-chat.js +9 -0
  31. package/workspace/public/pm/premium-initiative.js +4 -3
  32. package/workspace/public/pm/premium-insights.js +2 -2
  33. package/workspace/public/pm/premium-meeting.js +28 -29
  34. package/workspace/public/pm/premium-shell.js +55 -28
  35. package/workspace/public/pm/premium-vw-meet.css +27 -7
  36. package/workspace/public/pm/premium-vw-meet.js +31 -16
  37. package/workspace/public/pm/premium-work.js +2 -2
  38. package/workspace/public/pm/premium.css +34 -4
  39. package/workspace/public/pm/premium.js +2 -2
  40. package/workspace/public/premium-board.html +1 -0
  41. package/workspace/public/premium-chat.html +39 -0
  42. package/workspace/public/premium-initiative.html +1 -0
  43. package/workspace/public/premium-insights.html +1 -0
  44. package/workspace/public/premium-work.html +2 -1
  45. package/workspace/public/premium.html +2 -1
  46. package/workspace/server.js +4 -2
  47. package/workspace/skills/sources-read.skill +54 -0
  48. package/workspace/test-lists/briefing-source-flow.json +5 -0
@@ -63,11 +63,11 @@ const saved = async () => { const j = await (await fetch(BASE + '/api/insights-p
63
63
  const open = async (sel) => { if (sel === '#pdNew' || sel === '#repNew') await p.click('#listNew'); await p.click(sel); await until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('on') && !!document.querySelector('#oMain .stu'))); await sleep(300); };
64
64
  const shut = async () => { for (let i = 0; i < 2 && await p.evaluate(() => document.querySelector('#dlg').classList.contains('on')); i++) { await p.keyboard.press('Escape'); await sleep(150); } };
65
65
 
66
- /* O0: the bar's Chat button opens the Studio on the dashboard shown (premium-topbar: the Studio is this page's chat) */
67
- ok('O0 the bar has the Chat button, no label, named for the Studio (premium-topbar)', await p.evaluate(() => { const b = document.querySelector('#crAsk'); return !!b && b.textContent.trim() === '' && !!b.querySelector('svg') && b.getAttribute('aria-label') === 'Open the Insight Studio'; }));
68
- await open('#crAsk');
69
- ok('O0b Chat opens the Studio', await p.evaluate(() => /^Insight Studio · /.test(document.querySelector('#dEye').textContent)));
70
- await shut();
66
+ /* O0: Chat is the rail's middle place and goes to the Chat page (premium-chat-page); the Studio opens from the page's own buttons */
67
+ ok('O0 the bar has no chat button; Chat is the rail\'s middle place (premium-chat-rail)', await p.evaluate(() => !document.querySelector('#crAsk') && !!document.querySelector('.rail [data-go="chat"] svg')));
68
+ await p.click('.rail [data-go="chat"]'); await until(() => p.evaluate(() => /premium-chat\.html/.test(location.pathname) && document.querySelector('#dlg').classList.contains('on')), 10000);
69
+ ok('O0b Chat goes to the Chat page, on the PM\'s own chat', await p.evaluate(() => document.querySelector('#dTitle').textContent === 'Chat'), p.url());
70
+ await p.goBack(); await until(() => p.evaluate(() => !!document.querySelector('#listRows .dmr')), 20000);
71
71
  /* O: New dashboard opens the Studio */
72
72
  await open('#pdNew');
73
73
  const o = await p.evaluate(() => ({ eye: document.querySelector('#dEye').textContent, full: document.querySelector('#dlg').classList.contains('full'), lib: [...document.querySelectorAll('#stLb .stli b')].map((b) => b.textContent), agent: getComputedStyle(document.querySelector('#askF')).display === 'none', own: !!document.querySelector('#stF') }));
@@ -166,9 +166,9 @@ const saved = async () => { const j = await (await fetch(BASE + '/api/insights-p
166
166
  for (const theme of ['light', 'dark']) {
167
167
  const c2 = await browser.newContext({ viewport: { width: 390, height: 844 }, colorScheme: theme }), q = await c2.newPage();
168
168
  await q.goto(BASE + '/premium-insights.html');
169
- await until(() => q.evaluate(() => !!document.querySelector('#crAsk') && !!document.querySelector('#listRows .dmr')));
170
- const pill = await q.evaluate(() => { const b = document.querySelector('#crAsk'), r = b.getBoundingClientRect(); return { txt: b.textContent.trim(), w: r.width, h: r.height, right: r.right, vw: innerWidth, vis: !!b.offsetParent }; });
171
- ok(`F0 at 390 px (${theme}) the Chat button shows, fits the width and is 44 px`, pill.vis && pill.right <= pill.vw && Math.round(pill.h) >= 44 && Math.round(pill.w) >= 44, JSON.stringify(pill));
169
+ await until(() => q.evaluate(() => !!document.querySelector('.rail [data-go="chat"]') && !!document.querySelector('#listRows .dmr')));
170
+ const pill = await q.evaluate(() => { const b = document.querySelector('.rail [data-go="chat"] .orb'), r = b.getBoundingClientRect(); return { txt: b.textContent.trim(), w: r.width, h: r.height, right: r.right, vw: innerWidth, vis: !!b.offsetParent }; });
171
+ ok(`F0 at 390 px (${theme}) the rail's Chat shows, fits the width and is 44 px`, pill.vis && pill.right <= pill.vw && Math.round(pill.h) >= 44 && Math.round(pill.w) >= 44, JSON.stringify(pill));
172
172
  await q.click('#listNew'); await q.click('#pdNew'); await until(() => q.evaluate(() => !!document.querySelector('#oMain .stu'))); await sleep(400);
173
173
  // measured once the dialog has finished opening: its rise animation scales the targets while it runs
174
174
  const measure = () => q.evaluate(() => {
@@ -78,9 +78,9 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
78
78
  s = await st(page);
79
79
  ok('R9 the initiative link brings the open initiative tab forward, not a second one', s.on === INI && s.ids.length === 2, JSON.stringify(s));
80
80
  await page.keyboard.press('Escape'); await until(() => page.evaluate(() => !document.querySelector('#dlg').classList.contains('on')));
81
- await page.click('#crAsk'); await until(() => page.evaluate(() => document.querySelector('#dlg').classList.contains('on')));
81
+ await page.locator('#cIniTk .tkq', { hasText: 'UAT with five partners' }).click(); await until(() => page.evaluate(() => document.querySelector('#dlg').classList.contains('on')));
82
82
  s = await st(page);
83
- ok('R9 a new dialog starts with no extra tab; the initiative\'s own dialog offers Open the full record', s.ids.length === 0 && await page.evaluate(() => /Open the full record/.test((document.querySelector('#oMain [data-vwopen]') || {}).textContent || '')), JSON.stringify(s));
83
+ ok('R9 a new dialog starts with no extra tab; the task\'s own dialog offers Open the initiative', s.ids.length === 0 && await page.evaluate(() => /Open the initiative/.test((document.querySelector('#oMain [data-vwopen]') || {}).textContent || '')), JSON.stringify(s));
84
84
  ok('R9 no page error', S.errors.length === 0, S.errors.join(' | '));
85
85
  await ctx.close();
86
86
  }
@@ -88,7 +88,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
88
88
  /* R6 a route that is reading, then fails */
89
89
  {
90
90
  const { page, ctx, S } = await open({ answer: (n) => (n === 1 ? { status: 200, body: { ok: true, state: 'ready', model: MODEL } } : n <= 3 ? { status: 202, body: { ok: true, state: 'reading' } } : { status: 500, body: { ok: false, state: 'error', error: 'the board could not be read' } }) });
91
- await page.click('#crAsk'); await until(() => page.evaluate(() => document.querySelector('#dlg').classList.contains('on')));
91
+ await page.locator('#cIniTk .tkq').first().click(); await until(() => page.evaluate(() => document.querySelector('#dlg').classList.contains('on')));
92
92
  await page.evaluate(() => window.__premiumWorkItem.openWorkItem({ kind: 'initiative', id: 'other-two', title: 'Other' }));
93
93
  ok('R6 while the route reads, the tab says so', await until(async () => /Reading the initiative/.test(await paneTxt(page, 'item:ini:other-two')), 3000));
94
94
  ok('R6 a failed read says what failed and invents nothing', await until(async () => /could not be read: the board could not be read/.test(await paneTxt(page, 'item:ini:other-two')), 8000), await paneTxt(page, 'item:ini:other-two'));
@@ -3,7 +3,8 @@
3
3
  /* premium-vw-meet-test.js — the meeting detail laid out as the console's note sheet (initiative premium-viewer, R3, slice S3; planning/prd/premium-viewer-prd.md).
4
4
  * Serves the real Briefing from the real server. The Briefing model, the calendar, the notes and the note (GET /api/notes/one) are answered by stand-ins,
5
5
  * so each press can be read off the request the page sent. The routes' own behaviour is in their own suites; the pure half is in premium-vw-meet.test.js.
6
- * S1 stage · S2 head · S3 After · S4 Make task · S5 Before (with the prep brief) · S6 During · S7 series membership · S8 no note · S9 writes · S10 floors
6
+ * The detail is one scroll: the part that fits the meeting's state comes first and open, the others folded (no Before, During and After switch, PM 2026-10-20).
7
+ * S1 parts · S2 head · S3 After · S4 Make task · S5 Before (with the prep brief) · S6 During · S7 series membership · S8 no note · S9 writes · S10 floors
7
8
  * Every wait polls the page; no fixed sleep stands in for a state. */
8
9
  const path = require('path');
9
10
  const { spawn } = require('child_process');
@@ -96,27 +97,31 @@ const PNG = Buffer.from('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR
96
97
  S.up = await until(() => page.evaluate(() => document.querySelectorAll('#rank .rr').length > 0 && document.querySelectorAll('#tl .ev').length > 0), 20000);
97
98
  await until(() => page.evaluate(() => document.querySelectorAll('#wkStrip [data-day]').length === 5));
98
99
  await page.evaluate(() => { const r = [...document.querySelectorAll('#tl .ev')].find((e) => e.querySelector('b').textContent === 'Weekly sync'); r.click(); });
99
- S.dlg = await until(() => page.evaluate(() => document.querySelector('#dlg').classList.contains('on') && !!document.querySelector('#oMain .vm-ph')));
100
+ S.dlg = await until(() => page.evaluate(() => document.querySelector('#dlg').classList.contains('on') && !!document.querySelector('#oMain .vm-part')));
100
101
  SESS.push(S);
101
102
  return Object.assign(S, { ctx, page });
102
103
  };
103
- const part = (p, k) => p.evaluate((x) => { const e = document.querySelector(`#oMain .vm-body[data-part="${x}"]`); return e ? { shown: !e.hidden, text: e.textContent } : null; }, k);
104
- const stage = async (p, k) => { await p.click(`#oMain [data-ph="${k}"]`); await until(async () => ((await part(p, k)) || {}).shown); };
104
+ const part = (p, k) => p.evaluate((x) => { const e = document.querySelector(`#oMain .vm-body[data-part="${x}"]`); return e ? { shown: e.open, text: e.textContent } : null; }, k);
105
+ const stage = async (p, k) => { if (!((await part(p, k)) || {}).shown) await p.click(`#oMain .vm-body[data-part="${k}"] > summary`); await until(async () => ((await part(p, k)) || {}).shown); };
106
+ const more = async (p) => { if (!(await p.evaluate(() => document.querySelector('#oMain .vm-menu').open))) await p.click('#oMain .vm-menu > summary'); };
105
107
 
106
108
  const A = await open();
107
- ok('0 the meeting dialog opens with Before, During and After', A.up && A.dlg);
109
+ ok('0 the meeting dialog opens with its parts in one scroll', A.up && A.dlg);
108
110
  if (!A.up || !A.dlg) return finish(1);
109
111
  const p = A.page;
110
112
 
111
113
  /* S1 the stage */
112
- const st = await until(() => p.evaluate(() => { const b = [...document.querySelectorAll('#oMain .vm-ph [data-ph]')]; return b.length === 3 && b.find((x) => x.getAttribute('aria-pressed') === 'true') && /migration check/.test(document.querySelector('#oMain').textContent) ? b.map((x) => x.dataset.ph + ':' + x.getAttribute('aria-pressed')).join() : null; }));
113
- ok('S1 a meeting with notes opens on After, and only one stage is pressed', st === 'before:false,during:false,after:true', String(st));
114
+ const st = await until(() => p.evaluate(() => { const b = [...document.querySelectorAll('#oMain .vm-part')]; return b.length === 3 && /migration check/.test(document.querySelector('#oMain').textContent) ? b.map((x) => x.dataset.part + ':' + x.open).join() : null; }));
115
+ ok('S1 a meeting with notes shows Notes first and open, and the other parts folded', st === 'after:true,before:false,during:false', String(st));
116
+ ok('S1 there is no Before, During and After switch', await p.evaluate(() => !document.querySelector('#oMain [data-ph], #oMain .vm-ph')));
114
117
  ok('S1 the note was read from GET /api/notes/one for the meeting\'s note', A.oneGets[0] === 'n1', JSON.stringify(A.oneGets));
115
118
 
116
119
  /* S2 the head */
117
- const head = await p.evaluate(() => ({ lines: [...document.querySelectorAll('#oMain .vm-ln')].map((x) => x.textContent), ser: (document.querySelector('#oMain .vm-ser') || {}).textContent || '', prev: (document.querySelector('#oMain [data-vm="prev"]') || {}).dataset, next: !!document.querySelector('#oMain [data-vm="next"][data-id="n2"]'), sel: !!document.querySelector('#mtgSel') }));
118
- ok('S2 the head says when the meeting is and what it is about, with Change', head.lines.length >= 2 && head.lines.some((l) => / to /.test(l)) && head.lines.some((l) => /Not linked yet|It is about/.test(l)) && head.sel, JSON.stringify(head.lines));
119
- ok('S2 the series line says N of M and pages to the meeting before and after', /Weekly sync · 2 of 3/.test(head.ser) && head.prev && head.prev.id === 'n0' && head.next && /Not part of this series/.test(head.ser), head.ser);
120
+ const head = await p.evaluate(() => ({ sub: document.querySelector('#dSub').textContent, ppl: (document.querySelector('#oMain [data-vm="ppl"]') || {}).textContent || '', pplHidden: document.querySelector('#oMain .vm-ppl').hidden, about: !!document.querySelector('#oMain .vm-menu [data-vm="about"]'), lines: [...document.querySelectorAll('#oMain .vm-ln')].map((x) => x.textContent), ser: (document.querySelector('#oMain .vm-ser') || {}).textContent || '', prev: (document.querySelector('#oMain [data-vm="prev"]') || {}).dataset, next: !!document.querySelector('#oMain [data-vm="next"][data-id="n2"]'), sel: !!document.querySelector('#mtgSel') }));
121
+ ok('S2 the dialog head says when the meeting is; the detail says its state and folds its people to a count, with Change in More', / to /.test(head.sub) && head.lines.some((l) => /Done/.test(l)) && /^2 people$/.test(head.ppl.trim()) && head.pplHidden && head.about && head.sel, JSON.stringify(head));
122
+ await p.click('#oMain [data-vm="ppl"]');
123
+ ok('S2 the people count opens the names', await until(() => p.evaluate(() => !document.querySelector('#oMain .vm-ppl').hidden && /Dara/.test(document.querySelector('#oMain .vm-ppl').textContent) && /Sam/.test(document.querySelector('#oMain .vm-ppl').textContent))));
124
+ ok('S2 the series line says N of M and pages to the meeting before and after; Not part of this series is in More', /Weekly sync · 2 of 3/.test(head.ser) && head.prev && head.prev.id === 'n0' && head.next && !/Not part of this series/.test(head.ser) && await p.evaluate(() => !!document.querySelector('#oMain .vm-menu [data-vm="serout"]')), head.ser);
120
125
 
121
126
  /* S3 After */
122
127
  const af = (await part(p, 'after')).text;
@@ -143,16 +148,19 @@ const PNG = Buffer.from('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR
143
148
  const prep = await until(() => p.evaluate(() => { const b = document.querySelector('#oMain .vm-body[data-part="before"] [data-vm-prep]'); return b ? b.textContent : ''; }));
144
149
  ok('S5 Before opens with the meeting prep the console card shows: In short and What matters today; the note already carries in the meeting before', /In short/.test(prep) && /Agree what blocks the release/.test(prep) && /What matters today/.test(prep) && /Ship the SSO spike/.test(prep) && !/Since the last one/.test(prep), String(prep).slice(0, 200));
145
150
  ok('S5 Before keeps Prepared for you and Material', /Prepared for you/.test(bf) && /Material/.test(bf) && await p.evaluate(() => !!document.querySelector('#mmAdd') && !!document.querySelector('#mmAdd').offsetParent));
146
- ok('S1 pressing a stage shows it, hides the others and moves the pressed state', await p.evaluate(() => document.querySelector('#oMain [data-ph="before"]').getAttribute('aria-pressed') === 'true' && document.querySelector('#oMain .vm-body[data-part="after"]').hidden));
151
+ ok('S1 opening a part keeps the others as they were, and a redraw keeps what was opened', await p.evaluate(() => document.querySelector('#oMain .vm-body[data-part="before"]').open && document.querySelector('#oMain .vm-body[data-part="after"]').open));
147
152
 
148
153
  /* S6 During */
149
154
  await stage(p, 'during');
150
155
  const du = (await part(p, 'during')).text;
151
156
  ok('S6 During lists the transcript with times and the speakers the note names', /01:01/.test(du) && /Dara/.test(du) && /The migration check status is not started\./.test(du) && /You/.test(du), du.slice(0, 200));
152
- ok('S6 the Record and Focus presses stay in the head on every stage', await p.evaluate(() => !!document.querySelector('#oMain [data-m3="focus"]').offsetParent));
157
+ await more(p);
158
+ ok('S6 Focus and What Record and Focus do are in the More menu', await p.evaluate(() => !!document.querySelector('#oMain .vm-menu [data-m3="focus"]').offsetParent && !!document.querySelector('#oMain .vm-menu [data-m3="why"]').offsetParent));
159
+ await p.click('#oMain .vm-menu [data-m3="why"]');
160
+ ok('S6 What Record and Focus do opens both explanations and closes the menu', await until(() => p.evaluate(() => { const w = document.querySelector('#oMain .acts2 > .why'); return w && !w.hidden && /microphone/.test(w.textContent) && /every 3 seconds/.test(w.textContent) && !document.querySelector('#oMain .vm-menu').open; })));
153
161
 
154
162
  /* S7 series membership */
155
- await p.click('#oMain [data-vm="serout"]');
163
+ await more(p); await p.click('#oMain .vm-menu [data-vm="serout"]');
156
164
  await until(() => A.memberPosts.length === 1);
157
165
  ok('S7 Not part of this series posts the note with key off', A.memberPosts[0].id === 'n1' && A.memberPosts[0].key === 'off', JSON.stringify(A.memberPosts));
158
166
  ok('S7 the note is read again and the line offers Put it back', await until(() => p.evaluate(() => /Taken out of its series/.test(document.querySelector('#oMain').textContent) && !!document.querySelector('#oMain [data-vm="serback"]'))));
@@ -162,8 +170,8 @@ const PNG = Buffer.from('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR
162
170
  /* S2 a meeting of the series opens beside this one as a viewer tab (the frame, premium-viewer S1) */
163
171
  await until(() => p.evaluate(() => !!document.querySelector('#oMain [data-vm="prev"][data-id="n0"]')));
164
172
  await p.click('#oMain [data-vm="prev"]');
165
- const tab = await until(() => p.evaluate(() => { const t = document.querySelector('#vTabs'), pane = document.querySelector('#dOut .obody.vw[data-vw="meet-note"]'); return t && !t.hidden && pane && !pane.hidden && /Since the last one/.test(pane.textContent) ? { tabs: [...t.querySelectorAll('.vtab')].map((x) => x.textContent.trim()), main: document.querySelector('#oMain').hidden, ph: [...pane.querySelectorAll('[data-ph]')].length } : null; }));
166
- ok('S2 the meeting before opens as a viewer tab beside the meeting, with its own Before, During and After', tab && tab.tabs.length === 2 && tab.main && tab.ph === 3 && A.oneGets.includes('n0'), JSON.stringify([tab, A.oneGets]));
173
+ const tab = await until(() => p.evaluate(() => { const t = document.querySelector('#vTabs'), pane = document.querySelector('#dOut .obody.vw[data-vw="meet-note"]'); return t && !t.hidden && pane && !pane.hidden && /Since the last one/.test(pane.textContent) ? { tabs: [...t.querySelectorAll('.vtab')].map((x) => x.textContent.trim()), main: document.querySelector('#oMain').hidden, ph: [...pane.querySelectorAll('.vm-part')].length } : null; }));
174
+ ok('S2 the meeting before opens as a viewer tab beside the meeting, with its own parts in one scroll', tab && tab.tabs.length === 2 && tab.main && tab.ph === 3 && A.oneGets.includes('n0'), JSON.stringify([tab, A.oneGets]));
167
175
  await p.click('#dOut .obody.vw[data-vw="meet-note"] [data-vm="next"]');
168
176
  ok('S2 paging in the tab reads the next meeting into the same tab', await until(() => A.oneGets.includes('n2')) && await p.evaluate(() => document.querySelectorAll('#vTabs .vtab').length === 2));
169
177
  await p.click('#vTabs .vx');
@@ -171,8 +179,8 @@ const PNG = Buffer.from('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR
171
179
 
172
180
  /* S8 a meeting with no note */
173
181
  const Z = await open({ notes: [], note: null });
174
- const zst = await until(() => Z.page.evaluate(() => { const b = document.querySelector('#oMain [data-ph="before"]'); return b && b.getAttribute('aria-pressed') === 'true' && /No notes for this meeting\./.test(document.querySelector('#oMain').textContent); }));
175
- ok('S8 with no note the detail opens on Before and After says there are no notes', zst);
182
+ const zst = await until(() => Z.page.evaluate(() => { const b = document.querySelector('#oMain .vm-part'); return b && b.dataset.part === 'before' && b.open && /No notes for this meeting\./.test(document.querySelector('#oMain').textContent); }));
183
+ ok('S8 with no note the detail shows Prep first and open, and the Notes part says there are no notes', zst);
176
184
  ok('S8 with no note During says nothing was transcribed, and no note was asked for', /Nothing was transcribed/.test((await part(Z.page, 'during')).text) && Z.oneGets.length === 0 && !(await Z.page.evaluate(() => !!document.querySelector('#oMain .vm-ser'))));
177
185
 
178
186
  /* S9 writes */
@@ -199,13 +207,16 @@ const PNG = Buffer.from('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR
199
207
  /* measure once the meeting stylesheet has loaded and the dialog's presses are live, not on the first unstyled frame */
200
208
  await until(() => P.page.evaluate(() => document.querySelector('#oMain').dataset.ready === 'meeting' && [...document.styleSheets].some((x) => /premium-vw-meet\.css/.test(x.href || '') && x.cssRules.length > 0)));
201
209
  const fl = () => P.page.evaluate(() => ({ scroll: document.documentElement.scrollWidth <= innerWidth + 1 && document.querySelector('#oMain').scrollWidth <= document.querySelector('#oMain').clientWidth + 1,
202
- btn: [...document.querySelectorAll('#oMain .vm-ph button, #oMain .vm-ib, #oMain .vm-lk, #oMain .mtg-task')].filter((b) => b.getClientRects().length).map((b) => Math.round(Math.min(b.getBoundingClientRect().width, b.getBoundingClientRect().height))) }));
210
+ btn: [...document.querySelectorAll('#oMain .vm-sh, #oMain .vm-menu > summary, #oMain .vm-ib, #oMain .vm-lk, #oMain .mtg-task')].filter((b) => b.getClientRects().length).map((b) => Math.round(Math.min(b.getBoundingClientRect().width, b.getBoundingClientRect().height))) }));
203
211
  const f0 = await fl();
204
212
  if (shotDir) await P.page.screenshot({ path: path.join(shotDir, `after-390-${th}.png`) });
205
- await P.page.click('#oMain [data-ph="before"]'); const f1 = await fl();
213
+ await stage(P.page, 'before'); const f1 = await fl();
206
214
  ok(`S10 at 390 px (${th}) the detail has no sideways scroll and every press is at least 44 px`, f0.scroll && f1.scroll && f0.btn.length > 3 && [...f0.btn, ...f1.btn].every((n) => n >= 44), JSON.stringify([f0, f1]));
207
- const contrast = await P.page.evaluate(() => { const b = document.querySelector('#oMain .vm-ph [aria-pressed="true"]'); const c = getComputedStyle(b); return c.color !== c.backgroundColor; });
208
- ok(`S10 (${th}) the pressed stage is drawn apart from its label`, contrast);
215
+ const head = () => P.page.evaluate(() => ({ shrunk: document.querySelector('#dlg').classList.contains('shrunk'), cmp: document.querySelector('#dlg').classList.contains('cmp'), tabs: getComputedStyle(document.querySelector('#dTabs')).display }));
216
+ const scrollTo = (y) => P.page.evaluate((v) => { document.querySelector('#dOut').scrollTop = v; }, y);
217
+ await scrollTo(400); const s1 = await until(async () => { const h = await head(); return h.shrunk && h.tabs === 'none' ? h : null; });
218
+ await scrollTo(0); const s0 = await until(async () => { const h = await head(); return !h.shrunk && h.tabs !== 'none' ? h : null; });
219
+ ok(`S10 (${th}) on a phone the head shrinks to the title once the detail scrolls, and grows back at the top`, s1 && s0 && s1.cmp, JSON.stringify([s1, s0, await head()]));
209
220
  await P.ctx.close();
210
221
  }
211
222
  ok('S9 no page error in any run', SESS.every((x) => x.errors.length === 0), JSON.stringify(SESS.map((x) => x.errors).filter((e) => e.length)));
@@ -100,11 +100,11 @@ const NOTE = { id: 'n3', title: 'Call with a partner', state: 'ended', meeting:
100
100
  /* N5 the note tab */
101
101
  await until(() => p.evaluate(() => !!document.querySelector('[data-vn-note="n3"]')));
102
102
  await p.click('[data-vn-note="n3"]');
103
- const tab = await until(() => p.evaluate(() => { const t = document.querySelector('#vTabs'), pane = document.querySelector('#dOut .obody.vw[data-vw="meet-note"]'); return t && !t.hidden && pane && !pane.hidden && /Price SSO in the team plan/.test(pane.textContent) ? { tabs: [...t.querySelectorAll('.vtab')].map((x) => x.textContent.trim()), ph: [...pane.querySelectorAll('.vm-ph [data-ph]')].map((b) => b.dataset.ph + ':' + b.getAttribute('aria-pressed')).join(), text: pane.textContent } : null; }));
104
- ok('N5 a note opens as a viewer tab beside the list, on After', tab && tab.tabs.length === 2 && /Notes/.test(tab.tabs[0]) && /Call with a partner/.test(tab.tabs[1]) && tab.ph === 'before:false,during:false,after:true', JSON.stringify(tab && { tabs: tab.tabs, ph: tab.ph }));
103
+ const tab = await until(() => p.evaluate(() => { const t = document.querySelector('#vTabs'), pane = document.querySelector('#dOut .obody.vw[data-vw="meet-note"]'); return t && !t.hidden && pane && !pane.hidden && /Price SSO in the team plan/.test(pane.textContent) ? { tabs: [...t.querySelectorAll('.vtab')].map((x) => x.textContent.trim()), ph: [...pane.querySelectorAll('.vm-part')].map((b) => b.dataset.part + ':' + b.open).join(), text: pane.textContent } : null; }));
104
+ ok('N5 a note opens as a viewer tab beside the list, with Notes first and open', tab && tab.tabs.length === 2 && /Notes/.test(tab.tabs[0]) && /Call with a partner/.test(tab.tabs[1]) && /^after:true,before:false/.test(tab.ph), JSON.stringify(tab && { tabs: tab.tabs, ph: tab.ph }));
105
105
  ok('N5 the tab has the summary, the Decision and Why table and the next step table from the note', tab && /The partner wants SSO first\./.test(tab.text) && /Two partners asked\./.test(tab.text) && /Send the SSO plan/.test(tab.text) && /Ana/.test(tab.text) && /No meeting/.test(tab.text));
106
- await p.click('#dOut .obody.vw[data-vw="meet-note"] [data-ph="before"]');
107
- ok('N5 Before says the note has no calendar event', await until(() => p.evaluate(() => { const b = document.querySelector('#dOut .obody.vw[data-vw="meet-note"] .vm-body[data-part="before"]'); return b && !b.hidden && /not linked to a calendar event/.test(b.textContent); })));
106
+ await p.click('#dOut .obody.vw[data-vw="meet-note"] .vm-body[data-part="before"] > summary');
107
+ ok('N5 Prep says the note has no calendar event', await until(() => p.evaluate(() => { const b = document.querySelector('#dOut .obody.vw[data-vw="meet-note"] .vm-body[data-part="before"]'); return b && b.open && /not linked to a calendar event/.test(b.textContent); })));
108
108
  await p.click('#vTabs .vtab[data-vw="main"]');
109
109
  await p.click('[data-vn-series="wk"]');
110
110
  ok('N5 pressing a series opens its newest note, which says N of M', await until(() => p.evaluate(() => /Weekly sync · 2 of 2/.test((document.querySelector('#dOut .obody.vw[data-vw="meet-note"] .vm-ser') || {}).textContent || ''))) && A.oneGets.includes('n1'));
@@ -145,7 +145,7 @@ const NOTE = { id: 'n3', title: 'Call with a partner', state: 'ended', meeting:
145
145
  await P.page.click('[data-vn-fold="wk"]');
146
146
  const fl = () => P.page.evaluate(() => { const pane = [...document.querySelectorAll('#oMain, #dOut .obody.vw')].find((x) => !x.hidden) || document.querySelector('#oMain');
147
147
  return { scroll: document.documentElement.scrollWidth <= innerWidth + 1 && pane.scrollWidth <= pane.clientWidth + 1,
148
- btn: [...pane.querySelectorAll('.vn-o, .vn-x, .vn-q, .vm-ph button, .vm-lk')].filter((b) => b.getClientRects().length).map((b) => Math.round(Math.min(b.getBoundingClientRect().width, b.getBoundingClientRect().height))) }; });
148
+ btn: [...pane.querySelectorAll('.vn-o, .vn-x, .vn-q, .vm-sh, .vm-lk')].filter((b) => b.getClientRects().length).map((b) => Math.round(Math.min(b.getBoundingClientRect().width, b.getBoundingClientRect().height))) }; });
149
149
  const f0 = await fl();
150
150
  if (w === 390) ok(`N8 at 390 px (${th}) the Calendar card header keeps one line and Notes sits under the day`, await P.page.evaluate(() => { const h = document.querySelector('#todayCard .ch'), r = (e) => e.getBoundingClientRect(); const bs = [...h.querySelectorAll('button')].filter((b) => b.getClientRects().length); return !document.querySelector('#vnOpen').getClientRects().length && bs.every((b) => Math.abs(r(b).top - r(bs[0]).top) < 4) && r(document.querySelector('#vnOpenFoot')).height >= 44; }));
151
151
  if (shotDir) await P.page.screenshot({ path: path.join(shotDir, `list-${w}-${th}.png`) });
@@ -149,7 +149,7 @@ const RECORDER = () => {
149
149
  ok('R3 Cancel keeps the note as it was', await until(() => p.evaluate(() => !document.querySelector('#dOut .vcf'))) && A.privPosts.length === 0);
150
150
 
151
151
  await p.evaluate(() => document.querySelector('#vTabs .vtab').click());
152
- const dur = await until(() => p.evaluate(() => { const b = document.querySelector('#oMain .vm-body[data-part="during"]'); return b && !b.hidden && b.querySelector('[data-rv-stage] .rvh') ? b.textContent : ''; }));
152
+ const dur = await until(() => p.evaluate(() => { const b = document.querySelector('#oMain .vm-body[data-part="during"]'); return b && b.open && b.querySelector('[data-rv-stage] .rvh') ? b.textContent : ''; }));
153
153
  ok('R3 the meeting detail opens on During, and During is the live capture: Recording, Highlight, Pause, Stop and your notes', /Recording/.test(dur) && /Highlight/.test(dur) && /Pause/.test(dur) && /Stop/.test(dur) && /Your notes/.test(dur) && await p.evaluate(() => !document.querySelector('#oMain .rvt')), dur.slice(0, 200));
154
154
  ok('R3 the During stage and the Live notes tab each label their own notes box', await p.evaluate(() => { const ids = [...document.querySelectorAll('#dOut [data-rv-mine]')].map((t) => t.id); return ids.length === 2 && ids[0] !== ids[1] && ids.every((i) => !!document.querySelector(`label[for="${i}"]`)); }));
155
155
 
@@ -6,7 +6,7 @@
6
6
  import { openWorkItem, recordPress } from './premium-vw-item.js';
7
7
  import { pmPost } from './http.js';
8
8
  import { openBacklog } from './premium-vw-backlog.js';
9
- import { $, $$, esc, openDlg, closeDlg, toast, loadThread, onScroll, wireRail, logHtml, turnA, ptx, pillOf, CHECK, AI, store, crumbHtml, wireCrumb, kv, H, openAddDoc, setPageGaps } from './premium-shell.js';
9
+ import { $, $$, esc, openDlg, closeDlg, toast, loadThread, onScroll, wireRail, logHtml, turnA, ptx, pillOf, CHECK, AI, store, crumbHtml, wireCrumb, chatAbout, kv, H, openAddDoc, setPageGaps } from './premium-shell.js';
10
10
  import { issueBody } from './premium-doc-edit.js';
11
11
  import { mountDocSheet } from './premium-doc-sheet.js';
12
12
  import * as MT from './premium-metric-tiles.js';
@@ -33,8 +33,9 @@ function drawHead() {
33
33
  if (!crumbed) {
34
34
  crumbed = true;
35
35
  const boards = M.board.switcher || [];
36
- $('#crumbHost').innerHTML = crumbHtml({ page: 'Board', board: M.board.name || 'Board', boards, ask: 'Ask about this board' });
37
- wireCrumb({ boards, board: M.board.id, goBoard: (ws, id) => location.assign('/premium-board.html?ws=' + encodeURIComponent(ws) + '&board=' + encodeURIComponent(id)), ask: () => openRow(rowOf('board:this-board')) });
36
+ $('#crumbHost').innerHTML = crumbHtml({ page: 'Board', board: M.board.name || 'Board', boards });
37
+ wireCrumb({ boards, board: M.board.id, goBoard: (ws, id) => location.assign('/premium-board.html?ws=' + encodeURIComponent(ws) + '&board=' + encodeURIComponent(id)) });
38
+ chatAbout('board:this-board', M.board.name ? 'the ' + M.board.name + ' board' : 'this board');
38
39
  }
39
40
  $('#snap').textContent = M.header.text;
40
41
  setPageGaps(((M.header && M.header.missing) || []).length);
@@ -0,0 +1,9 @@
1
+ /* pm/premium-chat.js — the Chat page (initiative premium-chat-page). The rail's middle place: the session list, the conversation and the viewer
2
+ * as a page of their own. ?about=<key>&label=<name> is the page the PM came from (the rail's Chat carries it); without it, the PM's own chat. */
3
+ import { wireRail, openChatPage } from './premium-shell.js';
4
+
5
+ wireRail('chat');
6
+ const q = new URLSearchParams(location.search);
7
+ // a conversation key as the ask route takes it (lib/briefing-premium-agent.js KEY_RE); anything else is the PM's own chat
8
+ const about = /^(decision|blocked|waited|src|ev|work|board|init|doc|ins):[A-Za-z0-9][A-Za-z0-9._:-]{0,100}$/.test(q.get('about') || '') ? q.get('about') : null;
9
+ openChatPage(about || 'chat:main', about ? (q.get('label') || '').slice(0, 80) : '');
@@ -6,7 +6,7 @@
6
6
  * premium-board-actions, pm/premium-acts.js): move to the next stage or back, hold, cancel, archive, resume, reopen and restore, each with Undo. Nothing here issues a document. */
7
7
  import { pmPost } from './http.js';
8
8
  import { mountDocSheet } from './premium-doc-sheet.js';
9
- import { $, $$, esc, openDlg, closeDlg, setMode, toast, loadThread, onScroll, wireRail, logHtml, turnA, ptx, pillOf, kv, H2, CHECK, CHEV, crumbHtml, wireCrumb, AI, openAddDoc, setPageGaps } from './premium-shell.js';
9
+ import { $, $$, esc, openDlg, closeDlg, setMode, toast, loadThread, onScroll, wireRail, logHtml, turnA, ptx, pillOf, kv, H2, CHECK, CHEV, crumbHtml, wireCrumb, chatAbout, AI, openAddDoc, setPageGaps } from './premium-shell.js';
10
10
  import { barHtml, onBar, closeMenu } from './premium-acts.js';
11
11
  import { openWorkItem, recordPress } from './premium-vw-item.js';
12
12
  import { openTicket } from './premium-vw-jira.js';
@@ -256,11 +256,12 @@ let crumbed = false;
256
256
  function draw() {
257
257
  if (!crumbed) {
258
258
  crumbed = true;
259
- $('#crumbHost').innerHTML = crumbHtml({ board: M.board.name || 'Board', boards: M.boards, ini: M.crumbTitle, siblings: M.siblings, ask: 'Ask about this initiative' });
259
+ $('#crumbHost').innerHTML = crumbHtml({ board: M.board.name || 'Board', boards: M.boards, ini: M.crumbTitle, siblings: M.siblings });
260
260
  const q = (id) => '?id=' + encodeURIComponent(id) + (M.board.ws ? '&ws=' + encodeURIComponent(M.board.ws) + '&board=' + encodeURIComponent(M.board.id) : '');
261
261
  wireCrumb({ boards: M.boards, board: M.board.id, siblings: M.siblings, ini: M.id,
262
262
  goBoard: (ws, id) => location.assign('/premium-board.html' + (ws ? '?ws=' + encodeURIComponent(ws) + '&board=' + encodeURIComponent(id) : '')),
263
- goIni: (id) => location.assign('/premium-initiative.html' + q(id)), ask: () => openAsk('') });
263
+ goIni: (id) => location.assign('/premium-initiative.html' + q(id)) });
264
+ if (M.rows[0]) chatAbout(M.rows[0].key, M.crumbTitle || M.rows[0].title);
264
265
  }
265
266
  $('#iH1').textContent = M.title; document.title = 'PMOS · ' + M.title;
266
267
  $('#snap').textContent = M.header.text;
@@ -33,8 +33,8 @@ function drawHead() {
33
33
  if (!crumbed) {
34
34
  crumbed = true;
35
35
  const boards = M.board.switcher || [];
36
- $('#crumbHost').innerHTML = crumbHtml({ page: 'Insights', board: M.board.name || 'Insights', boards, ask: 'Open the Insight Studio' });
37
- wireCrumb({ boards, board: M.board.id, goBoard: (ws, id) => location.assign('/premium-insights.html?ws=' + encodeURIComponent(ws) + '&board=' + encodeURIComponent(id)), ask: () => { const D = curDash(); if (D && D.saved) openDashEdit(D); else if (M.charts.length) openDashEdit(null); else openReportEdit(null); } }); // the mockup's Studio pill: the saved dashboard shown, else a new dashboard, else a report when no measure has a series
36
+ $('#crumbHost').innerHTML = crumbHtml({ page: 'Insights', board: M.board.name || 'Insights', boards });
37
+ wireCrumb({ boards, board: M.board.id, goBoard: (ws, id) => location.assign('/premium-insights.html?ws=' + encodeURIComponent(ws) + '&board=' + encodeURIComponent(id)) });
38
38
  }
39
39
  $('#snap').textContent = M.header.text;
40
40
  setPageGaps(((M.header && M.header.missing) || []).length);
@@ -3,9 +3,10 @@
3
3
  * GET /api/meeting-material/suggest. The writes are "Link it" (POST /api/calendar-links), Add and Remove material (POST /api/meeting-material) and Make task
4
4
  * (POST /api/plan-items). Every word is a field of a record: the pure half (weekView, meetingView, the body builders) takes the routes' answers and returns what the page
5
5
  * draws or sends, so a test reads it without a DOM. Recording and Focus are slice 3.
6
- * The dialog's detail is laid out as the console's note sheet (initiative premium-viewer, S3): a head with Before, During and After, what the meeting is about and its
7
- * series line; the parts that come from the meeting's note (GET /api/notes/one) are drawn by premium-vw-meet.js. */
8
- import { noteSheet, phaseOf, phaseHtml, seriesHtml, stageHtml, wireStage, PHASES, notesTablesHtml, openNoteTab, vmStyle } from './premium-vw-meet.js';
6
+ * The dialog's detail is one scroll (PM, 2026-10-20: no Before, During and After switch): a short head with the meeting's state, its people folded to a count,
7
+ * what it is about, its series line, Record and one More menu (Focus, Change what it is about, What Record and Focus do). Then the part that fits the meeting's
8
+ * state, open, and the other parts folded. The parts that come from the meeting's note (GET /api/notes/one) are drawn by premium-vw-meet.js. */
9
+ import { noteSheet, phaseOf, partsHtml, partToggle, partKeep, seriesHtml, stageHtml, wireStage, PHASES, notesTablesHtml, openNoteTab, vmStyle } from './premium-vw-meet.js';
9
10
 
10
11
  const pad = (n) => String(n).padStart(2, '0');
11
12
  const clip = (s, n) => { const t = String(s == null ? '' : s).replace(/\s+/g, ' ').trim(); return t.length > n ? t.slice(0, n - 1).trimEnd() + '…' : t; };
@@ -499,18 +500,21 @@ export function mountMeeting(d) {
499
500
  if (st.mode === 'recording') h = `<div class="m3-row"><span class="m3-dot" aria-hidden="true"></span><b>Recording</b><span class="note" id="m3Clk">${esc(clockText())}</span>${b('pause', 'Pause')}${b('stop', 'Stop')}</div>`;
500
501
  else if (st.mode === 'stale') h = `<div class="m3-row"><b>Marked recording</b>${b('resume', 'Resume')}${b('stop', 'Stop')}</div><p class="note">The server holds this meeting as recording, but this page is not capturing audio. Resume starts listening again.</p>`;
501
502
  else if (st.mode === 'paused') h = `<div class="m3-row"><b>Paused</b>${n && n.resume_until ? `<span class="note">Open until ${esc(hhmm(n.resume_until))}</span>` : ''}${b('resume', 'Resume')}${b('stop', 'Stop')}</div><p class="note">${esc(RESUME_LINE)}</p>`;
502
- else if (st.mode === 'ended') h = '<p class="note">The recording of this meeting has ended. A stopped meeting cannot be recorded again.</p>';
503
- else if (recordable(row)) h = `<button class="addb pri" data-m3="rec" title="${esc(RECORD_LINE)}">${ic('mic')}Record</button><button class="whyb" data-m3="why" aria-expanded="false">What Record does</button><p class="note why" hidden>${esc(RECORD_LINE)}</p>`;
503
+ else if (recordable(row) && st.mode !== 'ended') h = `<button class="addb pri" data-m3="rec" title="${esc(RECORD_LINE)}">${ic('mic')}Record</button>`; // an ended note shows Done in the head and no Record
504
504
  return h + msg;
505
505
  }
506
- const actsHtml = (row, ui) => `<div class="acts2"><button class="addb" data-m3="focus" title="${esc(FOCUS_LINE)}">${ic('scale')}Focus</button><div id="m3Rec" class="m3r">${recBarHtml(row, ui)}</div><button class="whyb" data-m3="why" aria-expanded="false">What Focus reads</button><p class="note why" hidden>${esc(FOCUS_LINE)}</p></div>`;
506
+ /* Record up front; Focus, the link and the explanations behind one More menu */
507
+ const actsHtml = (row, ui, aboutNow, S) => `<div class="acts2"><div id="m3Rec" class="m3r">${recBarHtml(row, ui)}</div><details class="vm-menu"><summary class="addb" aria-label="More for this meeting" title="More for this meeting">${ic('dots')}More</summary><div class="vm-mn">`
508
+ + `<button type="button" data-m3="focus" title="${esc(FOCUS_LINE)}">${ic('scale')}Focus</button><button type="button" data-vm="about" aria-expanded="${!!ui.about}">${ic('link')}${aboutNow ? 'Change what it is about' : 'Choose what it is about'}</button>${S && S.series ? `<button type="button" data-vm="serout">${ic('x')}Not part of this series</button>` : ''}<button type="button" data-m3="why" aria-expanded="false">${ic('info')}What Record and Focus do</button></div></details>`
509
+ + `<div class="note why" hidden><p>${esc(RECORD_LINE)}</p><p>${esc(FOCUS_LINE)}</p></div></div>`;
507
510
 
508
511
  /* the dialog */
509
512
  const sec = (label, body) => `<div class="mtg-sec"><span class="label">${esc(label)}</span>${body}</div>`;
510
513
  const IC = { spark: '<path d="M12 3l1.8 4.7L18.5 9.5l-4.7 1.8L12 16l-1.8-4.7L5.5 9.5l4.7-1.8z"/>', clock: '<circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2"/>', scale: '<path d="M12 4v16M6 20h12M5 8h14M5 8l-2 6a3 3 0 0 0 4 0zM19 8l-2 6a3 3 0 0 0 4 0z"/>', doc: '<path d="M7 3h7l4 4v14H7zM14 3v4h4"/>', user: '<circle cx="12" cy="8" r="4"/><path d="M4 21c1-4 4-6 8-6s7 2 8 6"/>', link: '<path d="M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1"/>', mic: '<rect x="9" y="3" width="6" height="11" rx="3"/><path d="M5 11a7 7 0 0 0 14 0M12 18v3"/>',
511
514
  dec: '<path d="M6 4v8a4 4 0 0 0 4 4h9"/><path d="M15 12l4 4-4 4"/>', task: '<rect x="3" y="4" width="7" height="7" rx="1.5"/><path d="M4.8 7.6l1.4 1.3 2.3-2.6M14 7.5h7M14 17.5h7"/><rect x="3" y="14" width="7" height="7" rx="1.5"/>',
512
515
  undo: '<path d="M9 14L4 9l5-5"/><path d="M4 9h11a5 5 0 0 1 0 10h-3"/>', play: '<path d="M7 5l12 7-12 7z"/>', pause: '<path d="M9 5v14M15 5v14"/>', lock: '<rect x="5" y="11" width="14" height="10" rx="2"/><path d="M8 11V8a4 4 0 0 1 8 0v3"/>',
513
- xp: '<rect x="3" y="4" width="18" height="16" rx="2"/><path d="M9 10l3 3 3-3"/>', search: '<circle cx="11" cy="11" r="6.5"/><path d="M16 16l4 4"/>', back: '<path d="M15 6l-6 6 6 6"/>', plus: '<path d="M12 5v14M5 12h14"/>', x: '<path d="M6 6l12 12M18 6 6 18"/>', check: '<path d="M5 12.5l4.5 4.5L19 7.5"/>' };
516
+ xp: '<rect x="3" y="4" width="18" height="16" rx="2"/><path d="M9 10l3 3 3-3"/>', search: '<circle cx="11" cy="11" r="6.5"/><path d="M16 16l4 4"/>', back: '<path d="M15 6l-6 6 6 6"/>', plus: '<path d="M12 5v14M5 12h14"/>', x: '<path d="M6 6l12 12M18 6 6 18"/>', check: '<path d="M5 12.5l4.5 4.5L19 7.5"/>',
517
+ dots: '<circle cx="5" cy="12" r="1.4"/><circle cx="12" cy="12" r="1.4"/><circle cx="19" cy="12" r="1.4"/>', info: '<circle cx="12" cy="12" r="9"/><path d="M12 11v5M12 8v.01"/>' };
514
518
  const ic = (n) => `<svg class="i" viewBox="0 0 24 24">${IC[n]}</svg>`;
515
519
  const secH = (t, tag, extra) => `<h4 class="sh">${esc(t)}${tag ? ` <small>${esc(tag)}</small>` : ''}${extra || ''}</h4>`;
516
520
  const pickLi = (it, key, on) => `<li class="mtg-pick"><span>${esc(clip(it.title, 120))}<em>${esc([it.kind, it.meta].filter(Boolean).join(' · '))}</em></span>${on ? '<span class="mtg-on">Picked</span>' : `<button class="mtg-b" data-pick="${esc(key)}">Pick</button>`}</li>`;
@@ -523,7 +527,7 @@ export function mountMeeting(d) {
523
527
  <p class="note" id="mtgMsg" role="status">The link applies to every occurrence of “${esc(r.title)}”. The calendar itself is never written.</p>`;
524
528
  const n = v.notes;
525
529
  const person = (nm) => `<span class="pp"><i class="av2">${esc(String(nm).trim().charAt(0).toUpperCase())}</i>${esc(clip(nm, 40))}</span>`;
526
- const prow = (x) => `<div class="prow"><span class="pi${x.ok ? '' : ' w'}">${ic(x.ic)}</span><div><b>${esc(x.l)}</b><div class="pv">${x.about && aboutNow ? '<span>It is about <b>' + esc(aboutNow) + '</b>.</span>' : x.people ? x.people.map(person).join('') : x.chips && x.chips.length ? x.chips.map((c) => `<span class="chp sm">${ic('doc')}${esc(c)}</span>`).join('') : '<span>' + esc(x.text) + '</span>'}</div></div>${x.ok ? '<span class="chp ok sm"><i></i>Ready</span>' : '<span class="chp warn sm"><i></i>Not yet</span>'}</div>`;
530
+ const prow = (x) => `<div class="prow"><span class="pi${x.ok ? '' : ' w'}">${ic(x.ic)}</span><div><b>${esc(x.l)}</b><div class="pv">${x.about && aboutNow ? '<span>It is about <b>' + esc(aboutNow) + '</b>.</span>' : x.people ? x.people.slice(0, 2).map(person).join('') + (x.people.length > 2 ? `<span class="mut">and ${x.people.length - 2} more</span>` : '') : x.chips && x.chips.length ? x.chips.map((c) => `<span class="chp sm">${ic('doc')}${esc(c)}</span>`).join('') : '<span>' + esc(x.text) + '</span>'}</div></div>${x.ok ? '<span class="chp ok sm"><i></i>Ready</span>' : '<span class="chp warn sm"><i></i>Not yet</span>'}</div>`;
527
531
  const ready = v.prepReady;
528
532
  const prep = secH('Prepared for you', ready === v.prep.length ? 'all ready' : ready + ' of ' + v.prep.length + ' ready') + `<div class="prows">${v.prep.map(prow).join('')}</div>`;
529
533
  const mats = v.materialLine ? `<p class="mut">${esc(v.materialLine)}</p>` : `<div class="mats">${v.material.map((m) => `<div class="mat"><span class="kd">${esc(m.kind || 'link')}</span><div><b>${esc(m.title)}</b><small>${esc([m.topic, 'for ' + m.scope].filter(Boolean).join(' · '))}</small></div><span class="mb">${m.preview ? `<button class="ib2 mtg-pv" data-mpv="${m.n}" aria-label="Preview ${esc(m.title)}" title="Preview in the viewer">${ic('doc')}</button>` : ''}${m.removable ? `<button class="ib2 mtg-rm" data-rm="${m.n}" aria-label="Remove ${esc(m.title)}" title="${esc(m.line)}">${ic('x')}</button>` : ''}</span></div>`).join('')}</div>`;
@@ -536,16 +540,14 @@ export function mountMeeting(d) {
536
540
  const after = S ? stageHtml('after', S, sx)
537
541
  : secH('Notes', v.notesLine ? '' : 'from the meeting note') + (v.notesLine ? `<p class="mut">${esc(v.notesLine)}</p>` : (n.title ? `<p><b>${esc(n.title)}</b></p>` : '') + notesTablesHtml(n, esc, task) + ((n.decisions.length + n.actions.length + n.questions.length) ? '' : '<p class="mut">The note holds no decisions, next steps or questions yet.</p>'))
538
542
  + (v.replay ? secH('Replay', 'kept on this machine') + `<p>A recording is kept: ${v.replay.minutes ? v.replay.minutes + ' min, ' : ''}${v.replay.keyPoints} key ${v.replay.keyPoints === 1 ? 'point' : 'points'}.</p><div class="mtg-foot"><button class="addb pri" data-m3="replay">Replay</button><span class="note">Plays the note’s audio kept on this machine, with the transcript and the key points.</span></div>` : '');
539
- const chips = statusChips(r, note).map((c) => `<span class="chp${c.kind ? ' ' + c.kind : ''}"><i></i>${esc(c.text)}</span>`).join('');
543
+ const chips = statusChips(r, note).map((c) => `<span class="chp sm${c.kind ? ' ' + c.kind : ''}"><i></i>${esc(c.text)}</span>`).join('');
540
544
  const status = ui.status ? `<p class="note mtg-status" id="mtgStatus" role="status">${esc(ui.status.text)}${ui.status.undo ? ' <button class="mtg-b" id="mtgUndo">Undo</button>' : ''}</p>` : '<p class="note mtg-status" id="mtgStatus" role="status" hidden></p>';
541
- const when = esc(r.day) + ' · ' + esc(r.time) + (r.end && hasTime(r.end) ? ' to ' + esc(hhmm(r.end)) : '') + (r.len ? ' · ' + esc(r.len) : '');
542
- const hdr = `<div class="mh2"><div><h3 class="d1">${esc(r.title)}</h3>${v.people.length ? `<p class="mt">With ${esc(v.people.join(', '))}</p>` : ''}</div><div class="chs">${chips}</div></div>`;
543
- const lines = `<div class="vm-ln">${ic('clock')}<span>${when}</span></div><div class="vm-ln">${ic('link')}${aboutNow ? `<span>It is about <b>${esc(aboutNow)}</b>.${lv && lv.why ? ' ' + esc(lv.why) + '.' : ''}</span>` : `<span class="mut">${r.past ? 'The calendar answer holds no link for an earlier meeting.' : 'Not linked yet.'}</span>`}<button type="button" class="vm-lk" data-vm="about" aria-expanded="${!!ui.about}">${aboutNow ? 'Change' : 'Link it'}</button></div><div class="vm-about"${ui.about ? '' : ' hidden'}>${link}</div>`;
544
- const ph = ui.phase || 'before', part = (k, html) => `<div class="vm-body" data-part="${k}"${ph === k ? '' : ' hidden'}>${html}</div>`;
545
- return `<article class="paper doc mtg vm">${status}${hdr}${lines}${seriesHtml(S, esc)}${actsHtml(r, ui)}${phaseHtml(ph, esc)}`
546
- + part('before', stageHtml('before', S, sx) + [prep, mat, prev, tops].join(''))
547
- + part('during', stageHtml('during', S, sx))
548
- + part('after', after) + '</article>';
545
+ /* the dialog's own head already says the title, day, time and length: the detail adds the state, the people folded to a count, and what it is about */
546
+ const ppl = v.people.length ? `<button type="button" class="vm-lk vm-ppb" data-vm="ppl" aria-expanded="${!!ui.ppl}">${ic('user')}${v.people.length} ${v.people.length === 1 ? 'person' : 'people'}</button>` : '';
547
+ const lines = `<div class="vm-ln vm-st2">${chips}${ppl}</div>${ppl ? `<div class="pv vm-ppl"${ui.ppl ? '' : ' hidden'}>${v.people.map(person).join('')}</div>` : ''}`
548
+ + (aboutNow ? `<div class="vm-ln">${ic('link')}<span>It is about <b>${esc(aboutNow)}</b>.${lv && lv.why ? ' ' + esc(lv.why) + '.' : ''}</span></div>` : '') + `<div class="vm-about"${ui.about ? '' : ' hidden'}>${link}</div>`;
549
+ const parts = { before: stageHtml('before', S, sx) + [prep, mat, prev, tops].join(''), during: stageHtml('during', S, sx), after };
550
+ return `<article class="paper doc mtg vm">${status}${lines}${seriesHtml(S, esc, { noOut: true })}${actsHtml(r, ui, aboutNow, S)}${partsHtml(ui.phase || 'before', parts, ui.open, esc)}</article>`;
549
551
  }
550
552
  function sheetHtml(row) {
551
553
  return `<article class="paper doc mtg mtg-sheet"><button class="mtg-b" id="mmBack">Back to the meeting</button>
@@ -573,12 +575,13 @@ export function mountMeeting(d) {
573
575
  delete $('#oMain').dataset.ready;
574
576
  { const g = document.getElementById('dlg'); if (g) g.classList.remove('rpw'); } // a Replay left open when the dialog closed
575
577
  let replay = null, material = null, extra = { prev: [], topics: [] }, boards = W ? W.boards : [], inis = W ? W.initiatives : [], saved = '';
576
- const ui = { view: 'detail', status: null, tasked: new Set(), phase: 'before', picked: false }, SH = { sug: null, found: [], pick: null, scope: 'meeting', q: '', link: '', token: 0, topics: [], topic: null };
578
+ const ui = { view: 'detail', status: null, tasked: new Set(), phase: 'before', open: {} }, SH = { sug: null, found: [], pick: null, scope: 'meeting', q: '', link: '', token: 0, topics: [], topic: null };
577
579
  let stT = null, findT = null, undoFn = null;
578
580
  const view = () => meetingView(row, replay, material, extra);
579
581
  const say = (text, undo) => { clearTimeout(stT); undoFn = undo || null; ui.status = { text, undo: undo || null }; if (ui.view === 'detail') { paint(); stT = setTimeout(() => { ui.status = null; if (ui.view === 'detail') paint(); }, 9000); } else d.toast(text); };
580
582
  const paint = () => {
581
583
  const pane = $('#dOut'), top = pane ? pane.scrollTop : 0, same = ui.last === ui.view; ui.last = ui.view;
584
+ if (ui.view === 'detail') partKeep($('#oMain'), ui.open); // a part opened or folded before the presses were live stays so
582
585
  $('#oMain').innerHTML = ({ add: () => sheetHtml(row), focus: focusHtml, replay: replayHtml }[ui.view] || (() => detailHtml(view(), boards, inis, saved, ui)))();
583
586
  if (ui.view === 'add') paintSheet();
584
587
  else if (ui.view === 'detail') { const S = view().sheet, sx = { esc, tasked: { has: (i) => ui.tasked.has(i) }, replayBtn: !!view().replay, where: 'meeting', id: S ? S.id : null, brief: extra.brief || null, reread: async () => { await readSheet(); paint(); } }; for (const [k] of PHASES) wireStage(k, $(`#oMain .vm-body[data-part="${k}"]`), S, sx); }
@@ -756,7 +759,7 @@ export function mountMeeting(d) {
756
759
  if (res.ok && ui.view === 'detail') d.toast('Recording started.');
757
760
  };
758
761
  switch (act) {
759
- case 'why': { const n = t.nextElementSibling, on = n && n.hidden; if (n) { n.hidden = !on; t.setAttribute('aria-expanded', String(on)); } return; }
762
+ case 'why': { const n = $('#oMain .acts2 > .why'), on = n && n.hidden; if (n) { n.hidden = !on; t.setAttribute('aria-expanded', String(on)); } return; }
760
763
  case 'rec': if (!consented.has(k)) { ui.ask = 'consent'; paintRec(); const g = $('#m3Rec [data-m3="go"]'); if (g) g.focus(); return; } return started('rec');
761
764
  case 'go': consented.add(k); return started('rec');
762
765
  case 'no': ui.ask = null; paintRec(); { const b = $('#m3Rec [data-m3="rec"]'); if (b) b.focus(); } return;
@@ -806,15 +809,14 @@ export function mountMeeting(d) {
806
809
  const one = nt ? await d.pmGet('/api/notes/one?id=' + encodeURIComponent(nt.id)) : null;
807
810
  extra = { ...extra, sheet: noteSheet(one) };
808
811
  }
809
- /* The stage the head opens on, until the PM picks one: During while the note records, After once there are notes, else Before. */
812
+ /* The part that comes first and open: Recording while the note records, Notes once there are notes, else Prep. */
810
813
  function pickPhase() {
811
- if (ui.picked) return;
812
814
  const v = view(), n = v.notes, nt = noteOfRow(NR, row);
813
815
  ui.phase = phaseOf({ noteState: nt && nt.state, hasNotes: !!(v.sheet && v.sheet.overview) || !!v.replay || !!(n && n.decisions.length + n.actions.length + n.questions.length) });
814
816
  }
815
817
  const matPath = () => '/api/meeting-material?event=' + encodeURIComponent(row.id) + '&title=' + encodeURIComponent(row.title) + (row.series ? '&series=' + encodeURIComponent(row.series) : '') + '&date=' + row.day;
816
818
  vmStyle();
817
- d.openDlg({ eye: 'Calendar · real data', title: row.title, sub: [row.day, row.time, row.len, row.who && row.who.length ? row.who.join(', ') : ''].filter(Boolean).join(' · '), noteKey: via === 'today' ? 'ev:meeting:' + Date.parse(row.at) : null,
819
+ d.openDlg({ eye: 'Calendar · real data', title: row.title, sub: [dayLabel(row.day), row.end && hasTime(row.end) ? row.time + ' to ' + hhmm(row.end) : [row.time, row.len].filter(Boolean).join(' · ')].filter(Boolean).join(' · '), compact: true, noteKey: via === 'today' ? 'ev:meeting:' + Date.parse(row.at) : null,
818
820
  stream: d.turnA(d.ptx('This meeting is in the calendar PMOS holds. Its notes, material and recording appear here only if PMOS holds them.')), pane: detailHtml(meetingView(row, null, null), boards, inis, '', ui), label: 'Meeting' });
819
821
  if (via !== 'today') $('#askF').hidden = true;
820
822
  const [rp, mt] = await Promise.all([d.pmGet('/api/meeting-replay?event=' + encodeURIComponent(row.id) + '&date=' + row.day), d.pmGet(matPath())]);
@@ -878,10 +880,12 @@ export function mountMeeting(d) {
878
880
  findT = setTimeout(async () => { const r = await d.pmGet('/api/meeting-material/suggest?' + suggestQuery(row, { q: SH.q, ws: d.ws() })); if (my !== SH.token || ui.view !== 'add') return; SH.foundBusy = false; SH.found = r && r.ok && Array.isArray(r.found) ? r.found : []; paintSheet(); }, 220);
879
881
  }
880
882
  };
881
- $('#oMain').dataset.ready = 'meeting'; // the dialog's answers are read and its presses are live (the Before / During / After switch holds from here)
883
+ $('#oMain').dataset.ready = 'meeting'; // the dialog's answers are read and its presses are live
882
884
  $('#oMain').onchange = (e) => { if (e.target.id === 'mtgSel') $('#mtgLink').disabled = !e.target.value; };
883
885
  $('#oMain').onclick = async (e) => {
886
+ if (ui.view === 'detail' && partToggle(e, ui.open)) return;
884
887
  const t = e.target.closest('button'); if (!t) return;
888
+ { const mn = t.closest('.vm-menu'); if (mn) mn.open = false; } // a press in the More menu closes it
885
889
  if (t.dataset.m3) return m3Press(t.dataset.m3, t);
886
890
  if (t.dataset.rp && repM && RP) { // the Replay's own presses: a mark on the track, the conversation tabs, the key points link and Confirm all
887
891
  const k = t.dataset.rp;
@@ -891,12 +895,7 @@ export function mountMeeting(d) {
891
895
  if (k === 'confirm') return confirmAll(t);
892
896
  return;
893
897
  }
894
- if (t.dataset.ph) {
895
- ui.phase = t.dataset.ph; ui.picked = true;
896
- $$('#oMain .vm-ph [data-ph]').forEach((b) => b.setAttribute('aria-pressed', String(b === t)));
897
- $$('#oMain .vm-body[data-part]').forEach((x) => { x.hidden = x.dataset.part !== ui.phase; });
898
- return;
899
- }
898
+ if (t.dataset.vm === 'ppl') { ui.ppl = !ui.ppl; t.setAttribute('aria-expanded', String(ui.ppl)); const x = $('#oMain .vm-ppl'); if (x) x.hidden = !ui.ppl; return; }
900
899
  if ((t.dataset.vm === 'prev' || t.dataset.vm === 'next') && t.dataset.id) return openNoteTab({ pmGet: d.pmGet, pmPost: d.pmPost, esc, toast: d.toast, task: planTask }, t.dataset.id);
901
900
  if (t.dataset.vm === 'about') { ui.about = !ui.about; t.setAttribute('aria-expanded', String(ui.about)); const x = $('#oMain .vm-about'); if (x) x.hidden = !ui.about; if (ui.about) $('#mtgSel').focus(); return; }
902
901
  if (t.dataset.vm === 'serout') return member('off');