create-pmos 0.573.0 → 0.575.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.
@@ -25,7 +25,7 @@
25
25
  * WRITES (each a press): Record, Pause, Resume, Stop and Highlight through the page's recorder (premium-meeting.js recCore); POST
26
26
  * /api/notes/save (Your notes), /api/notes/private, /api/notes/speaker (naming a speaker), /api/notes/series-member, /api/notes/link or
27
27
  * /api/calendar-links (About), /api/viewer-meeting/agenda|capture|work-item, /api/plan-items (Make task), /api/meeting-material (Add material,
28
- * Remove), /api/meeting-material/file (Upload a file), /api/meeting-focus/topic (Change topic), /api/meeting-points (Confirm, Not right),
28
+ * Remove), /api/meeting-material/file (Upload a file), /api/meeting-focus/topic (Not this one) and /api/meeting-focus/agenda (Undo the merge) through pm/agenda-live.js, /api/meeting-points (Confirm, Not right),
29
29
  * /api/meeting-points/edit (a correction, and what PMOS learns from it).
30
30
  *
31
31
  * meetModel(D, now) → the view model (pure; for the unit suite)
@@ -36,6 +36,7 @@
36
36
  import * as IM from './impact.js'; // Your impact's meeting moment (batch 16 item 7)
37
37
  import { open as vOpen, current as vCur, back as vBack, czSummary, czSections, wide as vWide } from './cozy-viewer.js';
38
38
  import { pmGet, pmPost, pressFetch } from './http.js';
39
+ import { agendaHtml as mergedAgendaHtml, nowSummary, ensureCss as agendaCss, press as agendaPress } from './agenda-live.js'; // the agenda in 3 to 5 topics (live-agenda-topics)
39
40
  import { ownTab, bring, tabUrl } from './rec-tab-core.js';
40
41
  import { noteSheet, aboutChoices, aboutBody, aboutNow } from './premium-vw-meet.js';
41
42
  import { weekView, noteOfRow, sameMeeting, recordable, prevOf, taskEvent, linkBody, mmss, focusView, replayModel, RECORD_LINE, FOCUS_LINE, STOP_LINE, CONSENT_LINE, recCore } from './premium-meeting.js';
@@ -214,7 +215,9 @@ export function meetModel(D, now = Date.now()) {
214
215
  return { n: t.n || i + 1, text: t.text, k, used, plan, fill: plan ? Math.min(1, used / plan) : t.state === 'done' ? 1 : 0,
215
216
  say: t.state === 'plan' ? (plan ? plan + ' min' : 'planned') : plan ? used + ' of ' + plan : used + ' min' };
216
217
  });
217
- const focus = { now: cur >= 0 ? topics[cur].text : '', nowLine: topics.length ? (cur >= 0 ? 'Now · topic ' + (cur + 1) + ' of ' + topics.length : plural(topics.length, 'topic') + ' planned') : 'No topics yet',
218
+ // the agenda in 3 to 5 topics (lib/agenda-topics.js liveModel): one model with the recording tab's To cover
219
+ const A = F && F.agenda && Array.isArray(F.agenda.topics) && F.agenda.topics.length ? F.agenda : null;
220
+ const focus = { model: A, nowText: nowSummary(A), now: cur >= 0 ? topics[cur].text : '', nowLine: topics.length ? (cur >= 0 ? 'Now · topic ' + (cur + 1) + ' of ' + topics.length : plural(topics.length, 'topic') + ' planned') : 'No topics yet',
218
221
  gist: fv && fv.state === 'ok' ? fv.gist : '', topics: topics.map((t) => ({ text: t.text, now: t.state === 'now' })), agenda: fAgenda,
219
222
  agendaSub: ag.total ? ag.total + ' min' : '', material: mats, error: fv && fv.state !== 'ok' ? fv.reason : '' };
220
223
  /* after */
@@ -336,7 +339,7 @@ export function summaryHtml(m, ui = {}) {
336
339
  // a recording in its own tab (rec-tab-core.js) is live, not stale: this page shows it, and its one press brings that tab forward
337
340
  const away = m.liveK === 'stale' && ownTab();
338
341
  const line = m.liveK === 'rec' || away ? 'Recording · ' + mmss(m.liveMs || 0) : m.liveK === 'paused' ? 'Paused at ' + mmss(m.liveMs || 0) : 'Recording, but not on this page';
339
- const now = Fo.now ? 'Now on: ' + Fo.now + (Fo.topics.length > 1 ? ', topic ' + (Fo.topics.findIndex((t) => t.now) + 1) + ' of ' + Fo.topics.length + '.' : '.')
342
+ const now = Fo.nowText ? 'Now on: ' + Fo.nowText + '.' : Fo.now ? 'Now on: ' + Fo.now + (Fo.topics.length > 1 ? ', topic ' + (Fo.topics.findIndex((t) => t.now) + 1) + ' of ' + Fo.topics.length + '.' : '.')
340
343
  : Fo.error ? 'Focus could not read this meeting: ' + String(Fo.error).replace(/\.$/, '') + '.' : ''; // honest: a refused read says why
341
344
  const text = m.liveK === 'paused' ? 'Nothing is kept while paused. ' + now : m.liveK === 'stale' && !away ? 'Nothing is kept until you resume here. ' + now : now;
342
345
  const acts = away ? roundBtn('rectab', 'Go to the recording tab', 'tab', 'dark') : m.liveK === 'rec' ? roundBtn('stop', 'Stop the recording', 'stop', 'red') + roundBtn('hl', 'Highlight the last 30 seconds', 'star') + roundBtn('pause', 'Pause', 'pause')
@@ -384,11 +387,11 @@ function caughtHtml(m) {
384
387
  if (L.topics.length) h.push(weightBar('vz-stretch', L.topics.map((t) => ({ w: +t.flex || 1, attrs: ` data-k="${t.k}"` }))));
385
388
  return h.join('') || '<p class="vz-empty">What was said shows here while the note records.</p>';
386
389
  }
387
- function liveAgendaHtml(m, ui) {
390
+ /** The live Agenda: the 3 to 5 topics (pm/agenda-live.js) when the read has them. No Change topic: PMOS follows the talk, the PM says Not this one. */
391
+ function liveAgendaHtml(m) {
388
392
  const Fo = m.focus;
389
- const change = Fo.topics.length ? `<div class="vzm-r"><span class="vzm-grow"></span><button type="button" class="vzm-btn vzm-soft" data-a="topic" aria-expanded="${ui.pop === 'topic'}">Change topic</button></div>`
390
- + (ui.pop === 'topic' ? `<div class="vzm-topics" role="group" aria-label="Make it the topic">${Fo.topics.map((t, i) => `<button type="button" class="vzm-chip${t.now ? ' on' : ''}" data-a="topicgo" data-i="${i}"${t.now ? ' aria-current="true"' : ''}>${esc(t.text)}</button>`).join('')}</div>` : '') : '';
391
- return change + (Fo.agenda.length ? Fo.agenda.map((a) => `<div class="vzm-ag" data-k="${a.k}"><span>${a.k === 'now' || a.k === 'late' ? `<b>${a.n} ${esc(a.text)}</b>` : esc(a.n + ' ' + a.text)}</span>${fillBar(a.fill, a.k)}<small>${esc(a.say)}</small></div>`).join('') : '<p class="vz-empty">The invite lists no topics yet.</p>');
393
+ if (Fo.model) return mergedAgendaHtml(Fo.model);
394
+ return (Fo.agenda.length ? Fo.agenda.map((a) => `<div class="vzm-ag" data-k="${a.k}"><span>${a.k === 'now' || a.k === 'late' ? `<b>${a.n} ${esc(a.text)}</b>` : esc(a.n + ' ' + a.text)}</span>${fillBar(a.fill, a.k)}<small>${esc(a.say)}</small></div>`).join('') : '<p class="vz-empty">The invite lists no topics yet.</p>');
392
395
  }
393
396
  function transcriptHtml(m, ui, lines, seek) {
394
397
  const W = m.notes && m.notes.replay ? m.notes.replay.W : null; // the word fixes (MvF) show in the transcript too
@@ -441,7 +444,8 @@ export function sectionsOf(m, ui = {}) {
441
444
  const lastT = P.prev.length ? { id: 'last', title: 'Last time', count: P.prev[0].date, html: prevHtml(P) } : null;
442
445
  if (m.mk === 'prep') {
443
446
  return [
444
- { id: 'agenda', title: 'Agenda', count: P.agendaSub, open: true, html: agendaHtml(P) },
447
+ // a merged invite shows its topics before the meeting too, with Undo; else the lines with their minutes to change
448
+ Fo.model && Fo.model.merge ? { id: 'agenda', title: 'Agenda', count: Fo.model.sub, open: true, html: mergedAgendaHtml(Fo.model) } : { id: 'agenda', title: 'Agenda', count: P.agendaSub, open: true, html: agendaHtml(P) },
445
449
  P.matters.length ? { id: 'matters', title: 'What matters today', count: P.matters.length, html: tagRows(P.matters) } : null,
446
450
  { id: 'ready', title: 'To be ready', count: P.ready.filter((r) => !r.ok).length || '', html: readyHtml(P) },
447
451
  mat, lastT,
@@ -453,7 +457,7 @@ export function sectionsOf(m, ui = {}) {
453
457
  { id: 'caught', title: 'Caught so far', count: L.caught === 'nothing yet' ? '' : L.caught.replace(/, /g, ' · '), html: caughtHtml(m) },
454
458
  mat,
455
459
  L.hl.length ? { id: 'hl', title: 'Highlights', count: L.hl.length, html: hlHtml(L) } : null,
456
- { id: 'agenda', title: 'Agenda', count: L.nowSub, html: liveAgendaHtml(m, ui) },
460
+ { id: 'agenda', title: 'Agenda', count: Fo.model ? Fo.model.sub : L.nowSub, html: liveAgendaHtml(m) },
457
461
  { id: 'tr', title: 'Transcript', count: L.total ? 'live · ' + plural(L.total, 'line') : '', html: transcriptHtml(m, ui, N.lines, false) },
458
462
  ];
459
463
  }
@@ -576,6 +580,7 @@ export async function openMeeting(ref, o = {}) {
576
580
  me.vid = id;
577
581
  vOpen({ id, kind: 'Meeting', title: R.title || 'Meeting', icon: CLOCK_ICON, url: meetingUrl({ ...R, ws: me.ws }), render: draw0, onClose: () => closed(me) });
578
582
  widen('mtg');
583
+ agendaCss();
579
584
  await load(me);
580
585
  if (MT !== me) return;
581
586
  if (o.about) await openAbout(me);
@@ -777,6 +782,11 @@ function tick(me) {
777
782
 
778
783
  /* the presses */
779
784
  async function press(me, e) {
785
+ if (e.target.closest('[data-ag]')) { // Undo the merge, Not this one (pm/agenda-live.js)
786
+ const r = await agendaPress(e.target, me.model && me.model.focus.model, { ws: me.ws });
787
+ if (r) { say(me, r.ok ? r.said : 'Not changed: ' + r.error, r.ok ? '' : 'bad'); return load(me, true); }
788
+ return;
789
+ }
780
790
  const pa = e.target.closest('[data-czs-act]'); // the summary's one primary
781
791
  const t = pa || e.target.closest('[data-a]');
782
792
  if (me.ui.wpop && !e.target.closest('.vzr-wpop')) { me.ui.wpop = null; repaint(me); if (!t || t.dataset.a === 'psel') return; } // a press outside the word fix closes it
@@ -784,7 +794,7 @@ async function press(me, e) {
784
794
  if (!t) { if (me.ui.pop && !e.target.closest('.vzm-pop')) { me.ui.pop = ''; repaint(me); } return; }
785
795
  if (t.disabled) return;
786
796
  const a = pa ? pa.dataset.czsAct : t.dataset.a, ui = me.ui, m = me.model, C = rec();
787
- if (ui.pop && !t.closest('.vzm-pop') && !['addmat', 'm-about', 'topic'].includes(a)) ui.pop = '';
797
+ if (ui.pop && !t.closest('.vzm-pop') && !['addmat', 'm-about'].includes(a)) ui.pop = '';
788
798
  switch (a) {
789
799
  case 'popx': ui.pop = ''; return repaint(me);
790
800
  case 'askno': ui.ask = null; return repaint(me);
@@ -823,8 +833,6 @@ async function press(me, e) {
823
833
  case 'present': return presentIt(me, +t.dataset.i);
824
834
  case 'addmat': if (ui.pop === 'mat') { ui.pop = ''; return repaint(me); } return openMat(me);
825
835
  case 'matadd': { const P = me.mat; const it = P && (P.q ? P.found : P.sug)[+t.dataset.i]; if (it) return addMat(me, it.url && !it.ref ? { url: it.url, title: it.title } : { kind: it.kind, ref: it.ref, title: it.title, ...(it.ws ? { ws: it.ws } : {}) }); return; }
826
- case 'topic': ui.pop = ui.pop === 'topic' ? '' : 'topic'; return repaint(me);
827
- case 'topicgo': return changeTopic(me, m.focus.topics[+t.dataset.i]);
828
836
  case 'maketask': return makeTask(me, +t.dataset.i);
829
837
  case 'makewi': return makeWorkItem(me, +t.dataset.i);
830
838
  case 'madeundo': { const md = ui.made[+t.dataset.i]; delete ui.made[+t.dataset.i]; repaint(me); if (md && md.undo) await md.undo(); return; }
@@ -1099,15 +1107,6 @@ async function setMin(me, i, v) {
1099
1107
  if (!r || !r.ok) say(me, 'The minutes were not saved: ' + ((r && r.error) || 'no answer'), 'bad');
1100
1108
  return load(me, true);
1101
1109
  }
1102
- /** Change topic (Focus): the topic now, for this meeting (POST /api/meeting-focus/topic). */
1103
- async function changeTopic(me, tp) {
1104
- me.ui.pop = '';
1105
- const ev = me.row ? me.row.id : me.n && me.n.meeting && me.n.meeting.event_id;
1106
- if (!tp || !ev) { say(me, 'The topic can be changed on a calendar meeting only.', 'bad'); return; }
1107
- const r = await pmPost('/api/meeting-focus/topic', { event: ev, date: me.fq ? me.fq.date : '', action: 'set', topic: tp.text });
1108
- say(me, r && r.ok ? 'The topic now is “' + clip(tp.text, 60) + '”.' : 'Not changed: ' + ((r && r.error) || 'no answer'), r && r.ok ? '' : 'bad');
1109
- return load(me, true);
1110
- }
1111
1110
  /** Make task: the step goes into the first stage of the note's initiative (POST /api/plan-items); the made line has Undo, which withdraws it. */
1112
1111
  async function makeTask(me, i, quiet) {
1113
1112
  const S = me.D.S, step = S && S.actions[i]; if (!step) return { ok: false };
@@ -0,0 +1,61 @@
1
+ /* pm/vv-settle.js — puts the phone's fixed layer back in place (batch 30 item 2, initiative phone-chat-touch-layout).
2
+ *
3
+ * On iOS WebKit the layer that holds position:fixed and position:sticky boxes can be left out of place after the soft keyboard closes,
4
+ * and stays there while the PM scrolls by touch: on Home's phone chat the top bar went off the screen and the composer stood in the
5
+ * middle of it with messages under it (Wawan's iPhone, 2026-11-16). A one-pixel scroll and back makes WebKit place the layer again;
6
+ * anywhere else it is a no-op. premium-shell.js does the same on the Board (2026-10-20); Home does not load premium-shell.js.
7
+ *
8
+ * settleFixed(win) nudges. drifted(v) is the pure check: the visual viewport is offset with no keyboard up and no zoom.
9
+ * wireSettle(win) settles after an input loses focus, when the keyboard closes, and when a scroll ends with the viewport drifted. */
10
+ export const EDITABLE = 'input,textarea,select,[contenteditable="true"],[contenteditable=""]';
11
+ const KB_ROOM = 150; // the visual viewport this much shorter than the layout viewport: the keyboard is up (cozy-live-pill.js uses the same)
12
+
13
+ /** v: { offsetTop, height, scale, layoutH, typing }. True when the fixed layer is likely out of place and a settle is due. */
14
+ export function drifted(v) {
15
+ if (!v || v.typing) return false;
16
+ if (v.scale && Math.abs(v.scale - 1) > 0.01) return false; // a pinch zoom offsets the viewport on purpose
17
+ if (v.layoutH && v.height && v.layoutH - v.height > KB_ROOM) return false; // the keyboard is up: the offset keeps the box in view
18
+ return Math.abs(v.offsetTop || 0) > 0.5;
19
+ }
20
+
21
+ let busy = false;
22
+ export function settleFixed(win = window) {
23
+ if (busy) return; busy = true;
24
+ try { const y = win.scrollY, d = y > 0 ? -1 : 1; win.scrollTo(win.scrollX, y + d); win.scrollTo(win.scrollX, y); }
25
+ finally { win.setTimeout(() => { busy = false; }, 0); } // the nudge's own scroll events do not start another settle
26
+ }
27
+
28
+ /** Wires the settles once per window. Returns { check } (a settle when drifted), for the caller and the tests. */
29
+ export function wireSettle(win = window) {
30
+ if (win.__czSettle) return win.__czSettle;
31
+ const doc = win.document, vv = win.visualViewport || null;
32
+ const typing = () => { const a = doc.activeElement; return !!(a && a.matches && a.matches(EDITABLE)); };
33
+ const state = () => ({ offsetTop: vv ? vv.offsetTop : 0, height: vv ? vv.height : 0, scale: vv ? vv.scale : 1, layoutH: doc.documentElement.clientHeight, typing: typing() });
34
+ // armed by the PM's own touch (or the page coming back): one settle per gesture, so a nudge that does not help cannot repeat forever
35
+ let armed = true;
36
+ const arm = () => { armed = true; };
37
+ const check = () => { if (armed && !busy && drifted(state())) { armed = false; settleFixed(win); } };
38
+ doc.addEventListener('focusout', (e) => {
39
+ if (!e.target || !e.target.matches || !e.target.matches(EDITABLE)) return;
40
+ win.setTimeout(() => settleFixed(win), 60); win.setTimeout(() => settleFixed(win), 400); // the keyboard closes over ~300 ms
41
+ });
42
+ if (vv) {
43
+ let kb = false;
44
+ vv.addEventListener('resize', () => {
45
+ const shut = state().layoutH - vv.height <= KB_ROOM;
46
+ if (kb && shut) settleFixed(win);
47
+ kb = !shut;
48
+ });
49
+ vv.addEventListener('scroll', () => { if (!kb) idle(); });
50
+ }
51
+ // a scroll's end: no scroll event for 160 ms (scrollend where there is one), or the finger lifts
52
+ let t = 0;
53
+ const idle = () => { win.clearTimeout(t); t = win.setTimeout(check, 160); };
54
+ win.addEventListener('scroll', idle, { passive: true });
55
+ win.addEventListener('scrollend', check, { passive: true });
56
+ win.addEventListener('touchend', idle, { passive: true });
57
+ win.addEventListener('touchstart', arm, { passive: true });
58
+ win.addEventListener('pageshow', () => { arm(); check(); });
59
+ win.__czSettle = { check };
60
+ return win.__czSettle;
61
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "_comment": "Batch 30 item 3, initiative live-agenda-topics: a meeting's agenda as 3 to 5 topics. The merge (rules and the AI answer) on the 26-line sample and real invite shapes, Undo, lines added in the meeting, the one live model, the routes, and the html the Viewer's Agenda and the recording tab's To cover both draw (lib/agenda-topics.js, public/pm/agenda-live.js).",
3
+ "modules": [
4
+ "agenda-topics.test.js"
5
+ ],
6
+ "seconds": { "agenda-topics.test.js": 2 }
7
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "_comment": "Batch 30 item 2, initiative phone-chat-touch-layout: the phone's fixed layer settles after the keyboard and touch scrolls (pm/vv-settle.js). Pure check and a fake window.",
3
+ "modules": [
4
+ "vv-settle.test.js"
5
+ ]
6
+ }