create-pmos 0.361.0 → 0.363.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 (43) hide show
  1. package/package.json +40 -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 +4 -4
  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 +3 -3
  11. package/workspace/briefing-premium-insights-test.js +1 -1
  12. package/workspace/briefing-premium-test.js +26 -11
  13. package/workspace/briefing-premium-work-test.js +1 -1
  14. package/workspace/changelog.json +39 -0
  15. package/workspace/guide/briefing-premium.md +26 -21
  16. package/workspace/lib/board-premium.js +8 -3
  17. package/workspace/lib/engine/boards.js +5 -3
  18. package/workspace/lib/proactive.js +21 -3
  19. package/workspace/lib/routes-board-premium.js +1 -1
  20. package/workspace/lib/routes-boards.js +15 -1
  21. package/workspace/package-lock.json +2 -2
  22. package/workspace/package.json +1 -1
  23. package/workspace/premium-studio-test.js +6 -6
  24. package/workspace/premium-vw-item-test.js +2 -2
  25. package/workspace/premium-vw-jira-test.js +22 -6
  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 +3 -3
  30. package/workspace/public/pm/premium-meeting.js +28 -29
  31. package/workspace/public/pm/premium-shell.js +44 -21
  32. package/workspace/public/pm/premium-vw-jira-model.js +8 -5
  33. package/workspace/public/pm/premium-vw-jira.css +9 -0
  34. package/workspace/public/pm/premium-vw-jira.js +21 -9
  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.css +28 -4
  38. package/workspace/public/premium-board.html +1 -0
  39. package/workspace/public/premium-initiative.html +1 -0
  40. package/workspace/public/premium-insights.html +1 -0
  41. package/workspace/public/premium-work.html +2 -1
  42. package/workspace/public/premium.html +2 -1
  43. package/workspace/server.js +13 -2
@@ -28,21 +28,18 @@ export function flip() {
28
28
  theme(next); store.set(THEME_KEY, next); tbTheme();
29
29
  }
30
30
  { const t = new URLSearchParams(location.search).get('theme') || store.get(THEME_KEY); theme(t); }
31
- /* ── the top bar (initiative premium-topbar): where you are and Chat on the left; the Sources chip, the bell and one menu on the right.
32
- * The menu holds what left the bar: Search, Sessions, Console, Theme, Settings, and on Board how an initiative opens. Every item keeps
31
+ /* ── the top bar (initiative premium-topbar): where you are on the left; the Sources chip, the bell and one menu on the right. Chat is
32
+ * the rail's middle place (premium-chat-rail). The menu holds what left the bar: Search, Console, Theme, Settings, and on Board how an initiative opens. Every item keeps
33
33
  * the id the pages and the code below wire, so a press does what it did as a round button. ── */
34
- export const CHAT = '<svg class="i" viewBox="0 0 24 24"><path d="M4 5h16v11h-9l-5 4v-4H4z"/><path d="M12 7.6l.8 1.9 1.9.8-1.9.8-.8 1.9-.8-1.9-1.9-.8 1.9-.8z"/></svg>';
35
34
  const MORE = '<svg class="i" viewBox="0 0 24 24"><circle cx="6" cy="12" r="1.3"/><circle cx="12" cy="12" r="1.3"/><circle cx="18" cy="12" r="1.3"/></svg>';
36
35
  const TH = [['light', 'Light'], ['dark', 'Dark'], ['auto', 'Auto']];
37
36
  function tbMount() {
38
37
  const t = $('.tools-top'); if (!t || $('#tbMore')) return;
39
- const pc = $('#pgChat'); if (pc) pc.innerHTML = CHAT;
40
38
  t.insertAdjacentHTML('beforeend', `<button type="button" class="schip" id="srcChip" aria-haspopup="dialog" title="When each source was last read"><i class="sdot" id="srcDot" aria-hidden="true"></i>Sources</button>`
41
39
  + `<span class="mwrap" id="tbMore"><button type="button" class="glass round" id="moreBtn" aria-haspopup="menu" aria-expanded="false" aria-controls="moreMenu" aria-label="More" title="More">${MORE}<i class="mdot" id="moreDot" hidden></i></button>`
42
40
  + '<div class="crmenu tbmenu" id="moreMenu" role="menu" aria-label="More" hidden>'
43
41
  + '<button role="menuitem" id="pvSearch" aria-haspopup="dialog">Search<em>Ctrl K</em></button>'
44
42
  + '<button role="menuitem" id="srcItem" class="tbm-src" aria-haspopup="dialog">Sources</button>'
45
- + '<button role="menuitem" id="sessBtn" aria-haspopup="dialog" aria-label="Sessions">Sessions<em id="sessBdg" hidden></em></button>'
46
43
  + '<a role="menuitem" id="toConsole" href="/console.html" aria-label="Open the console">Console</a>'
47
44
  + '<div class="tbrow" id="modeRow" hidden><span>Open initiatives</span></div>'
48
45
  + `<div class="tbrow" role="group" aria-label="Theme"><span>Theme</span><span class="tbseg" id="tbTheme">${TH.map(([k, w]) => `<button role="menuitemradio" data-th="${k}" aria-checked="false">${w}</button>`).join('')}</span></div>`
@@ -74,7 +71,6 @@ function tbMount() {
74
71
  e.preventDefault(); L[(i + (e.key === 'ArrowDown' ? 1 : L.length - 1) + (i < 0 ? 1 : 0)) % L.length].focus();
75
72
  });
76
73
  $('#srcChip').onclick = () => openSources(); $('#srcItem').onclick = () => openSources();
77
- if (pc) pc.onclick = () => { if (PAGE_CHAT) PAGE_CHAT(); };
78
74
  tbReadSrc();
79
75
  setInterval(() => { if (!document.hidden) tbReadSrc(); }, 300000);
80
76
  }
@@ -83,7 +79,7 @@ function tbTheme() {
83
79
  $$('#tbTheme [data-th]').forEach((b) => b.setAttribute('aria-checked', String(b.dataset.th === cur)));
84
80
  }
85
81
  let PAGE_CHAT = null;
86
- /** The page's Chat press: fn opens the page's conversation (the Briefing and My work), the board's or the initiative's, or the Studio. */
82
+ /** The rail's Chat press: fn opens the page's conversation (the Briefing and My work), the board's or the initiative's, or the Studio. */
87
83
  export function onPageChat(fn) { PAGE_CHAT = fn; }
88
84
 
89
85
  /* ── Sources: when each source was last read, and a Refresh for each (GET /api/sources, POST /api/sources/refresh, as Data freshness) ──
@@ -206,12 +202,20 @@ export function openDlg(o) {
206
202
  $('#oMain').innerHTML = o.pane || `<article class="paper doc">${o.html}</article>`; $('#oLab').textContent = o.label || 'Detail'; vwReset(); // extra viewer tabs belong to the dialog that opened them
207
203
  $('#dBody').innerHTML = `<div class="stream" role="log">${o.stream || turnA(ptx(o.say))}</div><form class="askbar" id="askF"><div class="slashm" id="slashM" role="listbox" aria-label="Commands" hidden></div>${padMarkup()}<textarea id="askIn" rows="1" placeholder="Message Claude, or type /" maxlength="8000" autocomplete="off" enterkeyhint="send" aria-label="A message for Claude" aria-controls="slashM"></textarea><button type="submit" data-act="ask" id="askGo" aria-label="Send to Claude" title="Send to Claude"><svg class="i" viewBox="0 0 24 24"><path d="M5 12h14M13 6l6 6-6 6"/></svg></button></form><div class="askfoot"><p class="fine2" id="askNote">${CHAT_NOTE}</p>${padChipMarkup()}</div>`;
208
204
  mountPad({ key: S.key, ws: new URLSearchParams(location.search).get('ws'), input: $('#askIn') });
205
+ $('#dlg').classList.toggle('cmp', !!o.compact); $('#dlg').classList.remove('shrunk'); // compact: a short head on a phone that shrinks as the detail scrolls
209
206
  $('#dlg').classList.remove('full'); setMode('split'); setTab('out'); // on a phone the dialog opens on the Detail tab and the Detail / Conversation switch brings the conversation, as the mockup draws it
210
207
  $('#veil').classList.add('on'); $('#dlg').classList.add('on');
211
208
  $$('#dGrid .pane').forEach((p) => { p.scrollTop = 0; });
212
209
  railOnOpen(o);
213
210
  setTimeout(() => $('#dlg').focus(), 60);
214
211
  }
212
+ /* A compact dialog on a phone: once the detail scrolls, the head keeps only the title and the tools, so the detail gets the screen.
213
+ * It shrinks only when the detail is much taller than its pane, so the smaller head cannot end the scroll and grow back. */
214
+ $('#dOut').addEventListener('scroll', () => {
215
+ const g = $('#dlg'), p = $('#dOut'); if (!g.classList.contains('cmp') || innerWidth >= 1000) return;
216
+ if (p.scrollTop > 48 && p.scrollHeight - p.clientHeight > 200) g.classList.add('shrunk');
217
+ else if (p.scrollTop < 8) g.classList.remove('shrunk');
218
+ }, { passive: true });
215
219
  export function closeDlg() {
216
220
  clearTimeout(threadTimer); S.key = null; flushPad(); railOnClose();
217
221
  park();
@@ -496,11 +500,18 @@ function mountRecChip(here) {
496
500
  export function wireRail(here) {
497
501
  mountRecChip(here);
498
502
  const rail = $('.rail');
499
- rail.style.setProperty('--pi', String(['brief', 'work', 'init', 'rep'].indexOf(here)));
500
- $$('.rail [data-go]').forEach((b) => { b.onclick = () => { if (b.dataset.go !== here) location.assign(GO[b.dataset.go]); }; });
503
+ // premium-chat-rail: five places with Chat in the middle. The phone bar slides by whole places (--pi); the desktop rail's Chat is taller, so
504
+ // the indicator there is placed at the current place's own top (--py).
505
+ const cur = $(`.rail [data-go="${here}"]`), all = $$('.rail .pl');
506
+ rail.style.setProperty('--pi', String(all.indexOf(cur)));
507
+ const place = () => { if (cur) rail.style.setProperty('--py', (cur.offsetTop - all[0].offsetTop) + 'px'); };
508
+ place(); addEventListener('resize', place);
509
+ $$('.rail [data-go]').forEach((b) => { b.onclick = () => { if (b.dataset.go === 'chat') { railChat(); return; } if (b.dataset.go !== here) location.assign(GO[b.dataset.go]); }; });
501
510
  }
511
+ /** The rail's Chat: the page's own conversation (its Sessions chip and full screen reach the other sessions); with none, the session list. */
512
+ function railChat() { if (PAGE_CHAT) PAGE_CHAT(); else openSessions(); }
502
513
 
503
- /* ── the crumb: where you are, a menu to switch board or initiative, and Chat, which opens the read-only agent ──────────────────── */
514
+ /* ── the crumb: where you are and a menu to switch board or initiative. Its Chat moved to the rail (premium-chat-rail); o.ask is the rail's press ── */
504
515
  export function crumbHtml(o) {
505
516
  const chev = (id, label, show) => `<button id="${id}" class="cri" aria-haspopup="menu" aria-expanded="false" aria-label="${esc(label)}"${show ? '' : ' hidden'}>${CHEV}</button>`;
506
517
  const menu = '<div id="crMenu" class="crmenu" role="menu" hidden></div>';
@@ -508,9 +519,9 @@ export function crumbHtml(o) {
508
519
  const left = o.ini
509
520
  ? `<button id="crBoard" class="glass round crback" aria-label="Back to ${esc(o.board)}" title="Back to ${esc(o.board)}"><svg class="i" viewBox="0 0 24 24"><path d="m14 6-6 6 6 6"/></svg></button><nav class="crumb" aria-label="Where you are"><span id="crIni" aria-current="page">${esc(o.ini)}</span>${chev('crSw2', 'Switch initiative', o.siblings && o.siblings.length > 1)}${menu}</nav>`
510
521
  : `<nav class="crumb" aria-label="Where you are">${o.page ? `<span class="crpg">${esc(o.page)}</span>` : ''}<button id="crBoard" aria-current="page" disabled>${esc(o.board)}</button>${chev('crSw', 'Switch board', o.boards && o.boards.length > 1)}${menu}</nav>`;
511
- return `<div class="where">${left}<button id="crAsk" class="round tbchat" aria-haspopup="dialog" aria-label="${esc(o.ask)}" title="${esc(o.ask)}">${CHAT}</button></div>`;
522
+ return `<div class="where">${left}</div>`;
512
523
  }
513
- /** o: { boards: [{ws,id,name}], board: id, siblings: [{id,title}], ini: id, goBoard(ws, id), goIni(id), ask() }. Escape and a click outside close the menu; the arrows move in it. */
524
+ /** o: { boards: [{ws,id,name}], board: id, siblings: [{id,title}], ini: id, goBoard(ws, id), goIni(id), ask() — the rail's Chat }. Escape and a click outside close the menu; the arrows move in it. */
514
525
  export function wireCrumb(o) {
515
526
  const menu = $('#crMenu'); if (!menu) return;
516
527
  const close = () => { menu.hidden = true; $$('#crSw,#crSw2').forEach((b) => b.setAttribute('aria-expanded', 'false')); };
@@ -536,7 +547,7 @@ export function wireCrumb(o) {
536
547
  if (e.key === 'Escape') { const k = menu.dataset.k === 'b' ? b1 : b2; close(); if (k) k.focus(); }
537
548
  if (e.key === 'ArrowDown' || e.key === 'ArrowUp') { e.preventDefault(); const L = $$('button', menu), i = L.indexOf(document.activeElement); L[(i + (e.key === 'ArrowDown' ? 1 : L.length - 1)) % L.length].focus(); }
538
549
  });
539
- $('#crAsk').onclick = () => o.ask && o.ask();
550
+ if (o.ask) onPageChat(o.ask);
540
551
  }
541
552
 
542
553
  /* ── Add a document: the dialog the Board and the initiative page share (initiative briefing-premium-adddoc) ──────────────────────────────────
@@ -720,6 +731,8 @@ addEventListener('keydown', (e) => {
720
731
  pvMount();
721
732
  /* ── Settings: the two things that cannot be defaulted (initiative premium-settings) ────────────────────────────────────────────────────
722
733
  * Workspaces: GET /api/workspaces · POST /api/workspaces, /api/workspaces/forget. Connectors: GET and POST /api/proactive/settings {briefSources}.
734
+ * The GET also lists every connector the Claude session has (server.js sessionConnectors); one that backs no brief source is a row
735
+ * of its own, off until pressed ({connectors}), and says that nothing in PMOS reads it on its own yet; sessions use it either way.
723
736
  * Each press saves what the console's section saves, and nothing else. Every other setting runs on a default and stays in the console. */
724
737
  const SRC = { calendar: 'Calendar', wispr: 'Wispr Flow', mail: 'Mail', slack: 'Slack', jira: 'Jira', confluence: 'Confluence', github: 'GitHub', drive: 'Google Drive', figma: 'Figma', website: 'Your websites' };
725
738
 
@@ -830,18 +843,19 @@ async function updWaitRestart(from, log, say) {
830
843
  }
831
844
 
832
845
  export async function openSettings() {
833
- const M = { ws: null, src: null, err: '', busy: false };
846
+ const M = { ws: null, src: null, conn: [], con: {}, err: '', busy: false };
834
847
  const U = { phase: null, say: '', checking: false, open: new Set(), shut: new Set(), full: new Set() };
835
848
  const draw = () => {
836
849
  const w = M.ws, s = M.src;
837
850
  const wsRows = w === null ? '<p class="note">Reading the repositories.</p>' : w.length ? w.map((x) => `<div class="sr"><span class="sn"><b>${esc(x.label || x.name || x.id)}</b><em>${esc(x.root || '')}${x.home ? ' · home' : ''}</em></span>${x.home ? '' : `<button type="button" class="cta alt" data-rm="${esc(x.id)}">Remove</button>`}</div>`).join('') : '<p class="note">No repository is registered yet.</p>';
838
851
  const srcRows = s === null ? '<p class="note">Reading the sources.</p>' : Object.keys(SRC).filter((k) => k in s).map((k) => `<div class="sr"><span class="sn"><b>${esc(SRC[k])}</b><em>${s[k] ? 'The Briefing reads it' : 'The Briefing does not read it'}</em></span><button type="button" class="fchip" role="switch" aria-checked="${s[k]}" aria-label="${esc(SRC[k])}: the Briefing reads it" data-src="${esc(k)}">${s[k] ? 'On' : 'Off'}</button></div>`).join('');
852
+ const connRows = s === null ? '' : M.conn.filter((c) => !c.source).map((c) => { const on = M.con[c.name] === true; return `<div class="sr"><span class="sn"><b>${esc(c.label)}</b><em>${on ? 'On for a reader to come. Your sessions can use it now' : 'Your sessions can use it. Nothing in PMOS reads it on its own yet'}</em></span><button type="button" class="fchip" role="switch" aria-checked="${on}" aria-label="${esc(c.label)}: on" data-conn="${esc(c.name)}">${on ? 'On' : 'Off'}</button></div>`; }).join('');
839
853
  $('#oMain').innerHTML = `<article class="paper doc"><div class="addf">
840
854
  <div data-upd-block><span class="label">Updates</span>${updBlock(U)}</div>
841
855
  <div data-whats-new><span class="label">What's new</span>${updWhatsNew(U)}</div>
842
856
  <div><span class="label">Workspaces</span><p class="note" style="margin:0 0 8px">A workspace is one repository PMOS works in. Removing one forgets the address only; the folder is not deleted.</p>${wsRows}
843
857
  <div class="two" style="margin-top:10px"><label><input id="stP" maxlength="500" placeholder="Folder path of a repository" aria-label="Folder path of a repository"></label><button type="button" class="cta" id="stAdd">Add repository</button></div></div>
844
- <div><span class="label">Connectors</span><p class="note" style="margin:0 0 8px">Which sources the Briefing reads. PMOS keeps no passwords or keys; your Claude session reaches each tool through its own connectors.</p>${srcRows}</div>
858
+ <div><span class="label">Connectors</span><p class="note" style="margin:0 0 8px">Every connector your Claude session has. Your sessions can use all of them; a switch chooses only what PMOS reads on its own, such as the sources of the Briefing. PMOS keeps no passwords or keys.</p>${srcRows}${connRows}</div>
845
859
  <p class="note" id="stM" role="status" style="margin:0;min-height:1.2em">${esc(M.err)}</p>
846
860
  <p class="note" style="margin:0">Everything else runs on a default. <a href="/console.html?tab=settings">More settings in the console</a>.</p></div></article>`;
847
861
  };
@@ -850,6 +864,7 @@ export async function openSettings() {
850
864
  const load = async () => {
851
865
  const [w, p] = await Promise.all([pmGet('/api/workspaces'), pmGet('/api/proactive/settings'), updRead()]);
852
866
  M.ws = w && Array.isArray(w.workspaces) ? w.workspaces : []; M.src = p && p.ok && p.settings ? { ...p.settings.briefSources } : {};
867
+ M.con = p && p.ok && p.settings ? { ...p.settings.connectors } : {}; M.conn = p && p.connectors && Array.isArray(p.connectors.list) ? p.connectors.list : [];
853
868
  if (!w || !Array.isArray(w.workspaces)) M.err = 'The repositories could not be read.'; else if (!p || !p.ok) M.err = 'The sources could not be read.';
854
869
  draw();
855
870
  };
@@ -881,7 +896,7 @@ export async function openSettings() {
881
896
  }
882
897
  return;
883
898
  }
884
- const rm = e.target.closest('[data-rm]'), sw = e.target.closest('[data-src]');
899
+ const rm = e.target.closest('[data-rm]'), sw = e.target.closest('[data-src]'), cn = e.target.closest('[data-conn]');
885
900
  M.err = '';
886
901
  if (rm) {
887
902
  const x = M.ws.find((y) => y.id === rm.dataset.rm); if (!x) return;
@@ -893,6 +908,11 @@ export async function openSettings() {
893
908
  M.busy = true; const r = await pmPost('/api/proactive/settings', { briefSources: { [k]: on } }); M.busy = false;
894
909
  if (r && r.ok) { M.src[k] = on; toast((on ? 'The Briefing now reads ' : 'The Briefing no longer reads ') + SRC[k] + '.'); } else M.err = (r && r.error) || 'Not saved.';
895
910
  draw();
911
+ } else if (cn) {
912
+ const k = cn.dataset.conn, on = M.con[k] !== true, c = M.conn.find((x) => x.name === k);
913
+ M.busy = true; const r = await pmPost('/api/proactive/settings', { connectors: { [k]: on } }); M.busy = false;
914
+ if (r && r.ok) { M.con[k] = on; toast((c ? c.label : k) + (on ? ' is on. Nothing in PMOS reads it on its own yet.' : ' is off.')); } else M.err = (r && r.error) || 'Not saved.';
915
+ draw();
896
916
  } else if (e.target.closest('#stAdd')) {
897
917
  const root = ($('#stP').value || '').trim(); if (!root) { M.err = 'Paste the folder path of a repository.'; draw(); return; }
898
918
  M.busy = true; const r = await pmPost('/api/workspaces', { root, focus: false }); M.busy = false;
@@ -1058,16 +1078,19 @@ $('#oMain').addEventListener('click', async (e) => {
1058
1078
  cardDraw(r);
1059
1079
  }
1060
1080
  });
1061
- function sessBadge(n) { const b = $('#sessBdg'); if (!b) return; b.textContent = String(n || ''); b.hidden = !n; const a = $('#sessBtn'); if (a) a.setAttribute('aria-label', 'Sessions, ' + (n ? n + ' need you' : 'none need you')); }
1081
+ /* The rail's Chat carries the count the ⋯ menu's Sessions used to: a dot when a session is Ready or Maybe blocked (premium-chat-rail C5). */
1082
+ function sessBadge(n) {
1083
+ const a = $('.rail [data-go="chat"]'); if (!a) return;
1084
+ const d = $('.cdot', a); if (d) d.hidden = !n;
1085
+ a.setAttribute('aria-label', n ? 'Chat, ' + n + (n === 1 ? ' session needs you' : ' sessions need you') : 'Chat');
1086
+ }
1062
1087
  {
1063
- const b = $('#sessBtn');
1064
- if (b) {
1065
- b.onclick = () => openSessions();
1088
+ if ($('.rail [data-go="chat"]')) {
1066
1089
  const poll = async () => { if (document.hidden || railShowing()) return; const s = await pmGet('/api/sessions').catch(() => null); if (s && Array.isArray(s.sessions)) { R.rows = s.sessions; sessBadge(menuCount(R.rows)); } };
1067
1090
  poll(); setInterval(poll, BADGE_POLL);
1068
1091
  }
1069
1092
  }
1070
- /** The ⋯ menu's Sessions: the chat panel, full screen with the list (the list itself on a phone), on the session that needs you most. */
1093
+ /** The session list on its own (the rail's Chat on a page with no conversation): the chat panel, full screen with the list (the list itself on a phone), on the session that needs you most. */
1071
1094
  export async function openSessions() {
1072
1095
  openDlg({ eye: 'Sessions', title: 'Sessions', say: 'Pick a session from the list.', stream: turnA(ptx('Pick a session from the list. A dot shows its state: Ready, Running or Maybe blocked.')), noteKey: null, sessions: true, pane: '<article class="paper doc"><p class="note">Pick a session from the list.</p></article>', label: 'Session' });
1073
1096
  $('#askF').hidden = true;
@@ -66,9 +66,9 @@ export function ticketModel(view, ref, sprints = null) {
66
66
  sprint: sp && sp.name ? { name: sp.name, state: sp.state || '', dates: [day(sp.start), day(sp.end)].filter(Boolean).join(' – ') } : null,
67
67
  flagged, reason: flagged ? (j && j.reason) || (hit && hit.issue.reason) || 'Flagged in Jira' : '',
68
68
  stale: !!(j && j.stale), sections, subtasks: sub, links, epic, prd: view && view.prd ? String(view.prd) : '',
69
- initiative: view && view.title ? view.title : '', url: safeUrl(j && j.url),
69
+ initiative: view && view.title ? view.title : '', url: safeUrl(j && j.url) || safeUrl(hit && hit.issue.url),
70
70
  readAt: (view && view.checkedAt) || (sprints && sprints.readAt) || null,
71
- draftOnly: !t, readingOnly: !!t && !!t.key && !j,
71
+ draftOnly: !t, noDraft: !view, readingOnly: !!t && !!t.key && !j,
72
72
  };
73
73
  }
74
74
 
@@ -88,7 +88,10 @@ export function sprintModel(sprints, name, { today } = {}) {
88
88
  const all = Array.isArray(sprints.sprints) ? sprints.sprints : [];
89
89
  const sp = (name && all.find((s) => s.name === name)) || all[0];
90
90
  if (!sp) return { ok: false, why: 'Jira was read, but none of this board\'s tickets is in a sprint.' };
91
- const goal = sp.goal && typeof sp.goal === 'object' ? str(sp.goal.text) : str(sp.jiraGoal);
91
+ // The goal is always the one the Jira status check wrote from the sprint's tickets, as the console's Sprints tab draws it
92
+ // (c3-ib-sprints.js goalBlock): Jira's own sprint goal is often empty or too broad, so it is shown only as a reference.
93
+ const goal = sp.goal && typeof sp.goal === 'object' ? str(sp.goal.text) : '';
94
+ const jiraGoal = (sp.goal && typeof sp.goal === 'object' ? str(sp.goal.jira) : '') || str(sp.jiraGoal);
92
95
  const pts = sp.points && Number.isFinite(sp.points.committed) ? { done: sp.points.done, committed: sp.points.committed, unestimated: sp.points.unestimated || 0 } : null;
93
96
  const pace = sp.pace || null;
94
97
  let left = '';
@@ -98,11 +101,11 @@ export function sprintModel(sprints, name, { today } = {}) {
98
101
  if (Number.isFinite(a) && Number.isFinite(b)) { const d = Math.round((a - b) / 864e5); left = d < 0 ? 'ended ' + plural(-d, 'day', 'days') + ' ago' : d === 0 ? 'ends today' : plural(d, 'day', 'days') + ' left'; }
99
102
  }
100
103
  const cards = (sp.issues || []).map((i) => ({ key: i.key, title: i.summary || i.key, status: i.status || CAT[i.category] || '', cat: CAT[i.category] ? i.category : 'todo',
101
- points: typeof i.points === 'number' ? i.points : null, initiative: i.initiative || null, flagged: !!i.flagged, reason: i.flagged ? i.reason || 'Flagged in Jira' : '' }));
104
+ points: typeof i.points === 'number' ? i.points : null, initiative: i.initiative || null, url: safeUrl(i.url), flagged: !!i.flagged, reason: i.flagged ? i.reason || 'Flagged in Jira' : '' }));
102
105
  const cols = COLS.map(([cat, label]) => ({ cat, label, cards: cards.filter((c) => c.cat === cat) }));
103
106
  const other = cards.filter((c) => !c.initiative).length;
104
107
  return {
105
- ok: true, name: sp.name, state: sp.state || '', dates: [day(sp.start), day(sp.end)].filter(Boolean).join(' – '), goal, left, points: pts,
108
+ ok: true, name: sp.name, state: sp.state || '', dates: [day(sp.start), day(sp.end)].filter(Boolean).join(' – '), goal, jiraGoal, summary: str(sp.summary), left, points: pts,
106
109
  counts: { todo: cols[0].cards.length, doing: cols[1].cards.length, done: cols[2].cards.length }, total: cards.length, cols, other,
107
110
  readAt: sprints.readAt || null, sprints: sprintList(sprints),
108
111
  };
@@ -56,6 +56,15 @@
56
56
  .jsh h3{margin:0;font-size:var(--fs-4);font-weight:600;color:var(--ink)}
57
57
  .jsh p{margin:2px 0 0;font-size:var(--fs-2);color:var(--ink-3)}
58
58
  .jsh>div{min-width:0}
59
+ .jpastb{border-style:dashed!important}
60
+ .jpastb[aria-expanded="true"]{border-style:solid!important;background:var(--well)!important}
61
+ .jpast[hidden]{display:none}
62
+ .jgoal{display:grid;gap:4px;background:var(--card-solid);border:1px solid var(--hair);border-radius:8px;padding:12px 16px;box-shadow:var(--card-shadow);min-width:0;overflow-wrap:anywhere}
63
+ .jgoal .jlab{margin:0;font:600 var(--fs-1) var(--mono);letter-spacing:.07em;text-transform:uppercase;color:var(--ink-3)}
64
+ .jgoal b{font-size:var(--fs-3);font-weight:600;line-height:1.45;color:var(--ink)}
65
+ .jgoal p{margin:0;font-size:var(--fs-2);line-height:1.5;color:var(--ink-2)}
66
+ .jgoal .jgref{color:var(--ink-3)}
67
+ .jsh .jgoal{flex-basis:100%;background:none;border:0;border-top:1px solid var(--hair);border-radius:0;box-shadow:none;padding:10px 0 0}
59
68
  .jcap{display:flex;align-items:center;gap:8px;font-size:var(--fs-2);color:var(--ink-3)}
60
69
  .jcap i{display:block;width:90px;height:6px;border-radius:6px;background:var(--well);overflow:hidden;position:relative}
61
70
  .jcap i::after{content:"";position:absolute;inset:0;width:var(--bd-w,0);background:var(--ok);border-radius:6px}
@@ -43,7 +43,7 @@ function ticketHtml(m) {
43
43
  ? `<button type="button" data-jt="${esc(l.ref)}">${LINK}<span class="jk">${esc(l.key || l.ref)}</span><b>${esc(l.title)}</b></button>`
44
44
  : `<span class="jlx">${LINK}<span class="jk">${esc(l.ref)}</span></span>`}</div>`).join('')}${m.prd ? `<div class="jln"><em>from</em><span class="jlx">${DOC}<b>${esc(m.prd)}</b></span></div>` : ''}</div>` : '';
45
45
  const body = m.sections.length ? m.sections.map((s) => `<h3>${esc(s.name)}</h3><div class="jmd">${md(s.text)}</div>`).join('')
46
- : `<p class="jnote">${m.draftOnly ? 'This ticket is not in the initiative\'s ticket draft, so PMOS holds no text for it. Its title, status and points come from the sprint read.' : 'The ticket draft holds no text for this ticket.'}</p>`;
46
+ : `<p class="jnote">${m.noDraft ? 'This ticket is on no initiative of this board, so PMOS holds no text for it. Its title, status and points come from the sprint read.' : m.draftOnly ? 'This ticket is not in the initiative\'s ticket draft, so PMOS holds no text for it. Its title, status and points come from the sprint read.' : 'The ticket draft holds no text for this ticket.'}</p>`;
47
47
  return `<div class="jv">${bar('ticket', m)}<article class="jtk">
48
48
  <div class="jbc">${m.epic ? `<span class="jk">${esc(m.epic.key)}</span>${m.epic.title ? ` ${esc(m.epic.title)}` : ''} <span aria-hidden="true">/</span> ` : m.initiative ? `${esc(m.initiative)} <span aria-hidden="true">/</span> ` : ''}<span class="jk">${esc(m.key || m.id)}</span></div>
49
49
  <h1>${esc(m.title)}</h1>
@@ -74,34 +74,46 @@ export async function openTicket(o) {
74
74
  }
75
75
 
76
76
  /* ── the sprint ─────────────────────────────────────────────────────────────────────────────────────────── */
77
- function sprintHtml(m) {
77
+ function sprintHtml(m, past) {
78
78
  if (!m.ok) return empty(m.why);
79
- const pick = m.sprints.length > 1 ? `<div class="jseg" role="group" aria-label="Sprint">${m.sprints.map((s) => `<button type="button" data-sp="${esc(s.name)}" aria-pressed="${s.name === m.name}">${esc(s.name)}${s.state ? `<small>${esc(s.state)}</small>` : ''}</button>`).join('')}</div>` : '';
79
+ // The active and next sprints are one press away; the closed ones fold behind "Past sprints" (Wawan 2026-10-21, as the console keeps
80
+ // closed sprints out of its page) and open by themselves only when a closed sprint is the one shown.
81
+ const spBtn = (s) => `<button type="button" data-sp="${esc(s.name)}" aria-pressed="${s.name === m.name}">${esc(s.name)}${s.state ? `<small>${esc(s.state)}</small>` : ''}</button>`;
82
+ const now = m.sprints.filter((s) => s.state !== 'closed'), done = m.sprints.filter((s) => s.state === 'closed');
83
+ const open = past || done.some((s) => s.name === m.name);
84
+ const pick = m.sprints.length > 1 ? `<div class="jseg" role="group" aria-label="Sprint">${now.map(spBtn).join('')}${done.length ? `<button type="button" class="jpastb" data-jpast aria-expanded="${open}" aria-controls="jpast">Past sprints<small>${done.length}</small></button>` : ''}</div>`
85
+ + (done.length ? `<div class="jseg jpast" id="jpast" role="group" aria-label="Past sprints"${open ? '' : ' hidden'}>${done.map(spBtn).join('')}</div>` : '') : '';
80
86
  const pts = m.points ? `<span class="jcap"><i data-pct="${m.points.committed ? Math.round(m.points.done / m.points.committed * 100) : 0}"></i>${m.points.done} of ${m.points.committed} points done</span>`
81
87
  : `<span class="jcap">${m.counts.done} of ${m.total} done · no points on record</span>`;
88
+ const jira = m.jiraGoal ? `<p class="jgref">In Jira: “${esc(m.jiraGoal)}”</p>` : '';
89
+ const goal = m.goal ? `<div class="jgoal" data-goal="tickets"><p class="jlab">Sprint goal · from the tickets</p><b>${esc(m.goal)}</b>${m.summary ? `<p>${esc(m.summary)}</p>` : ''}${jira}</div>`
90
+ : `<div class="jgoal" data-goal="missing"><p class="jlab">Sprint goal</p><p>No goal yet. The Jira status check writes one from the tickets at its next check.</p>${jira}</div>`;
82
91
  const card = (c) => {
83
92
  const inner = `<b>${esc(c.title)}</b>${c.flagged ? `<span class="jrk">${FLAG}${esc(c.reason)}</span>` : ''}<span class="jft"><span class="jk">${esc(c.key)}</span>${c.status && c.status !== m.cols.find((x) => x.cat === c.cat).label ? `<span class="jsx">${esc(c.status)}</span>` : ''}<span class="gap"></span>${c.points != null ? `<span class="jpts">${esc(c.points)}</span>` : ''}</span>`;
84
- return c.initiative ? `<button type="button" class="jcrd${c.flagged ? ' risk' : ''}" data-k="${esc(c.key)}" data-ini="${esc(c.initiative)}" aria-label="${esc(c.key)}: ${esc(c.title)}. Open the ticket">${inner}</button>`
85
- : `<div class="jcrd off${c.flagged ? ' risk' : ''}" title="Not a ticket of this board">${inner}</div>`;
93
+ return `<button type="button" class="jcrd${c.flagged ? ' risk' : ''}" data-k="${esc(c.key)}" data-ini="${esc(c.initiative || '')}" aria-label="${esc(c.key)}: ${esc(c.title)}. Open the ticket">${inner}</button>`;
86
94
  };
87
95
  return `<div class="jv">${bar(m.name, m)}${pick}
88
- <div class="jsh"><div><h3>${esc(m.name)}${m.dates ? ` · ${esc(m.dates)}` : ''}</h3><p>${[m.goal ? 'Goal: ' + m.goal : 'No sprint goal on record', m.left || m.state].filter(Boolean).map(esc).join(' · ')}</p></div><span class="gap"></span>${pts}</div>
96
+ <div class="jsh"><div><h3>${esc(m.name)}${m.dates ? ` · ${esc(m.dates)}` : ''}</h3>${m.left || m.state ? `<p>${esc(m.left || m.state)}</p>` : ''}</div><span class="gap"></span>${pts}${goal}</div>
89
97
  <div class="jbrd">${m.cols.map((c) => `<section class="jcol" aria-label="${esc(c.label)}, ${c.cards.length}"><div class="jcolh"><span>${esc(c.label)}</span><span>${c.cards.length}</span></div>${c.cards.map(card).join('') || '<p class="jnone">None</p>'}</section>`).join('')}</div>
90
- <p class="jnote">Read-only: Jira owns each ticket's status and sprint, so move a ticket in Jira.${m.other ? ` ${m.other} ${m.other === 1 ? 'ticket is' : 'tickets are'} in this sprint but on no initiative of this board, so ${m.other === 1 ? 'it has' : 'they have'} no ticket here.` : ''} Tickets with no sprint are in the backlog. <button type="button" class="jbtn" data-jbl>Open the backlog</button></p></div>`;
98
+ <p class="jnote">Read-only: Jira owns each ticket's status and sprint, so move a ticket in Jira. Tickets with no sprint are in the backlog. <button type="button" class="jbtn" data-jbl>Open the backlog</button></p></div>`;
91
99
  }
92
100
 
93
101
  /** The board's sprints as a board by status in one tab; name picks a sprint (default: the active one). */
94
102
  export async function openSprint(o) {
95
103
  const { ws, board } = o || {};
96
104
  let name = (o && o.name) || '';
105
+ let past = false; // the Past sprints fold, open or shut, kept across a redraw of the tab
97
106
  vwStyle('jira');
98
107
  const draw = async (el) => {
99
108
  el.innerHTML = '<div class="jv"><p class="jnote">Reading the sprint</p></div>';
100
109
  const sprints = await getJson('/api/boards/sprints', { ws, board });
101
110
  const m = sprintModel(sprints, name, { today: new Date().toISOString() });
102
- el.innerHTML = sprintHtml(m); bars(el);
111
+ el.innerHTML = sprintHtml(m, past); bars(el);
103
112
  el.querySelectorAll('[data-sp]').forEach((b) => { b.onclick = () => { name = b.dataset.sp; draw(el); }; });
104
- el.querySelectorAll('.jcrd[data-k]').forEach((b) => { b.onclick = () => openTicket({ ws, board, initiative: b.dataset.ini, ref: b.dataset.k }); });
113
+ const pb = el.querySelector('[data-jpast]'), pl = el.querySelector('#jpast');
114
+ if (pb && pl) pb.onclick = () => { pl.hidden = !pl.hidden; past = !pl.hidden; pb.setAttribute('aria-expanded', String(past)); };
115
+ // every ticket opens its tab: one on no initiative of the board shows what the sprint read holds (title, status, points, its Jira link)
116
+ el.querySelectorAll('.jcrd[data-k]').forEach((b) => { b.onclick = () => openTicket({ ws, board, initiative: b.dataset.ini || null, ref: b.dataset.k }); });
105
117
  const bl = el.querySelector('[data-jbl]'); if (bl) bl.onclick = () => openBacklog({ ws, board }); // the tickets in no sprint (premium-viewer R9)
106
118
  const re = el.querySelector('[data-jre]'); if (re) re.onclick = async () => { await draw(el); toast('Read the cached Jira reading again. A Jira check reads Jira itself.'); };
107
119
  };
@@ -18,11 +18,31 @@
18
18
  .vm .vm-ib .i{width:16px;height:16px}
19
19
  .vm .vm-lk{min-height:36px;padding:0 8px;border-radius:6px;font-size:var(--fs-2);font-weight:500;color:var(--ink-3);text-decoration:underline;text-underline-offset:3px}
20
20
  @media (hover:hover){.vm .vm-lk:hover{color:var(--ink)}}
21
- .vm .vm-ph{display:flex;gap:6px;flex-wrap:wrap;margin:18px 0 14px;padding:4px;border-radius:6px;background:var(--well);width:max-content;max-width:100%}
22
- .vm .vm-ph button{min-height:36px;padding:0 16px;border-radius:6px;font-size:var(--fs-2);font-weight:600;color:var(--ink-2)}
23
- .vm .vm-ph button[aria-pressed="true"]{background:var(--solid);color:var(--on-solid)}
24
- .vm .vm-ph button:focus-visible,.vm .vm-ib:focus-visible,.vm .vm-lk:focus-visible{outline:2px solid var(--ember);outline-offset:2px}
25
- .vm .vm-body[hidden]{display:none}
21
+ .vm .vm-sh:focus-visible,.vm .vm-menu>summary:focus-visible,.vm .vm-mn button:focus-visible,.vm .vm-ib:focus-visible,.vm .vm-lk:focus-visible{outline:2px solid var(--ember);outline-offset:2px}
22
+ /* the parts as one scroll: each part a fold with a plain head (no Before, During and After switch) */
23
+ .vm .vm-part{margin:14px 0 0;border-top:1px solid var(--hair)}
24
+ .vm .vm-part>summary.vm-sh{list-style:none;display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:48px;cursor:pointer;font-size:var(--fs-3);font-weight:600;color:var(--ink);border-radius:6px}
25
+ .vm .vm-part>summary::-webkit-details-marker{display:none}
26
+ .vm .vm-part>summary::after{content:"";flex:none;width:8px;height:8px;margin:0 6px 4px 0;border-right:1.6px solid var(--ink-3);border-bottom:1.6px solid var(--ink-3);transform:rotate(45deg);transition:transform .2s}
27
+ .vm .vm-part[open]>summary::after{margin-bottom:-4px;transform:rotate(-135deg)}
28
+ .vm .vm-part[open]{padding-bottom:6px}
29
+ /* the head: the state chip and the people folded to a count */
30
+ .vm .vm-st2{margin-top:2px}
31
+ .vm .vm-ppb{display:inline-flex;align-items:center;gap:6px}
32
+ .vm .vm-ppb .i{width:15px;height:15px}
33
+ .vm .vm-ppl{margin:8px 0 2px}
34
+ .vm .vm-ppl[hidden]{display:none}
35
+ /* More: Focus, the link and the explanations behind one menu */
36
+ .vm .vm-menu{position:relative}
37
+ .vm .vm-menu>summary{list-style:none;cursor:pointer}
38
+ .vm .vm-menu>summary::-webkit-details-marker{display:none}
39
+ .vm .vm-mn{position:absolute;z-index:6;top:calc(100% + 6px);left:0;min-width:250px;display:flex;flex-direction:column;gap:2px;padding:6px;border-radius:8px;background:var(--card-solid,var(--card));box-shadow:inset 0 0 0 1px var(--hair),0 18px 40px -18px rgba(20,24,60,.45)}
40
+ .vm .vm-mn button{display:flex;align-items:center;gap:10px;min-height:44px;padding:0 12px;border-radius:6px;text-align:left;font-size:var(--fs-3);color:var(--ink)}
41
+ .vm .vm-mn button .i{width:16px;height:16px;color:var(--ink-3)}
42
+ @media (hover:hover){.vm .vm-mn button:hover{background:var(--well)}}
43
+ .vm .acts2>.why{flex:1 1 100%}
44
+ .vm .acts2>.why p{margin:0 0 6px}
45
+ .vm .acts2>.why[hidden]{display:none}
26
46
  .vm .vm-bx{background:var(--card-solid,var(--card));border:1px solid var(--hair);border-radius:8px;box-shadow:var(--card-shadow);padding:14px 18px;margin:0 0 12px;font-size:var(--fs-3);line-height:1.5}
27
47
  .vm .vm-cap{display:flex;align-items:center;gap:8px;font:600 var(--fs-1) var(--mono);letter-spacing:.08em;text-transform:uppercase;color:var(--ink-3);padding:0 0 10px;margin:0 0 6px;border-bottom:1px solid var(--hair)}
28
48
  .vm .vm-cap .i{width:14px;height:14px}
@@ -77,9 +97,9 @@
77
97
  .vm .vm-fold{margin-top:14px;border-top:1px solid var(--hair);padding-top:10px}
78
98
  .vm .vm-fold summary{cursor:pointer;min-height:36px;display:flex;align-items:center;font-size:var(--fs-2);font-weight:600;color:var(--ink-2)}
79
99
  @media (max-width:700px){
80
- .vm .vm-ph button,.vm .vm-ib,.vm .vm-lk,.vm .vm-pill,.vm .vm-fold summary{min-height:44px}
100
+ .vm .vm-ib,.vm .vm-lk,.vm .vm-pill,.vm .vm-fold summary{min-height:44px}
81
101
  .vm .vm-ib{width:44px;height:44px}
82
- .vm .vm-ph{width:100%}.vm .vm-ph button{flex:1}
102
+
83
103
  .vm .vm-tb thead{display:none}
84
104
  .vm .vm-tb tr{display:grid;grid-template-columns:1fr auto;gap:2px 10px;padding:8px 0;border-bottom:1px solid var(--hair)}
85
105
  .vm .vm-tb td{border:0;padding:0}
@@ -130,15 +130,35 @@ export function wireStage(k, el, S, ctx) { const w = STAGES[k] && STAGES[k].wire
130
130
  const ICP = { cal: '<rect x="4" y="5" width="16" height="15" rx="3"/><path d="M4 10h16M9 3v4M15 3v4"/>', lay: '<rect x="4" y="4" width="16" height="16" rx="3"/><path d="M4 10h16M10 10v10"/>', notes: '<path d="M7 3h7l4 4v14H7zM14 3v4h4M10 12h5M10 16h4"/>', prev: '<path d="M15 6l-6 6 6 6"/>', next: '<path d="M9 6l6 6-6 6"/>', check: '<path d="M5 12.5l4.5 4.5L19 7.5"/>', 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"/>', plus: '<path d="M12 5v14M5 12h14"/>', todo: '<circle cx="12" cy="12" r="8"/>' };
131
131
  const ic = (k) => `<svg class="i" viewBox="0 0 24 24">${ICP[k]}</svg>`;
132
132
 
133
- /** The Before, During and After switch. */
134
- export const phaseHtml = (on, esc) => `<div class="vm-ph" role="group" aria-label="Meeting stage">${PHASES.map(([k, l]) => `<button type="button" data-ph="${k}" aria-pressed="${on === k}">${esc(l)}</button>`).join('')}</div>`;
133
+ /** The parts as one scroll, with no Before, During and After switch (PM, 2026-10-20). The part that fits the meeting's state comes
134
+ * first and open; the others follow, folded. `html` is { before, during, after }; a part with no html is left out. `open` is
135
+ * { part: true | false } for the parts the PM opened or closed. */
136
+ export const PART_LABEL = { before: 'Prep and material', during: 'Transcript and live notes', after: 'Notes and next steps' };
137
+ export function partsHtml(first, html, open, esc) {
138
+ const order = [first, ...PHASES.map(([k]) => k).filter((k) => k !== first)];
139
+ return order.filter((k) => html[k]).map((k) => {
140
+ const on = open && typeof open[k] === 'boolean' ? open[k] : k === first;
141
+ return `<details class="vm-body vm-part" data-part="${k}" data-o="${on ? 1 : 0}"${on ? ' open' : ''}><summary class="vm-sh">${esc(PART_LABEL[k])}</summary>${html[k]}</details>`;
142
+ }).join('');
143
+ }
144
+ /** Before a redraw: a part the PM opened or folded (its state differs from how it was drawn) keeps that state. `root` holds the parts. */
145
+ export function partKeep(root, open) {
146
+ if (root) root.querySelectorAll('details.vm-part').forEach((x) => { if (x.open !== (x.dataset.o === '1')) open[x.dataset.part] = x.open; });
147
+ }
148
+ /** Keeps a part's fold open or closed across a redraw: call it from the pane's click with the event. True when the click was on a part's head. */
149
+ export function partToggle(e, open) {
150
+ const sm = e.target.closest('summary.vm-sh'), d = sm && sm.parentElement;
151
+ if (!d || !d.dataset.part) return false;
152
+ open[d.dataset.part] = !d.open;
153
+ return true;
154
+ }
135
155
 
136
- /** The series line: the meeting before, "Title · N of M", the meeting after, and Not part of this series. */
137
- export function seriesHtml(S, esc) {
156
+ /** The series line: the meeting before, "Title · N of M", the meeting after, and Not part of this series (left out with opts.noOut, when a menu holds it). */
157
+ export function seriesHtml(S, esc, opts = {}) {
138
158
  if (!S) return '';
139
159
  if (S.series) {
140
160
  const s = S.series, go = (x, k, label) => `<button type="button" class="vm-ib" data-vm="${k}"${x ? ` data-id="${esc(x.id)}" title="${esc(label + ', ' + x.day)}"` : ' disabled'} aria-label="${esc(label)}">${ic(k)}</button>`;
141
- return `<div class="vm-ser">${go(s.prev, 'prev', 'The meeting before')}<span>${ic('notes')}${esc(s.title)} · ${s.pos} of ${s.count}</span>${go(s.next, 'next', 'The meeting after')}<button type="button" class="vm-lk" data-vm="serout">Not part of this series</button></div>`;
161
+ return `<div class="vm-ser">${go(s.prev, 'prev', 'The meeting before')}<span>${ic('notes')}${esc(s.title)} · ${s.pos} of ${s.count}</span>${go(s.next, 'next', 'The meeting after')}${opts.noOut ? '' : '<button type="button" class="vm-lk" data-vm="serout">Not part of this series</button>'}</div>`;
142
162
  }
143
163
  if (S.seriesOff) return `<div class="vm-ser"><span>${ic('notes')}Taken out of its series</span><button type="button" class="vm-lk" data-vm="serback">Put it back</button></div>`;
144
164
  return '';
@@ -269,20 +289,20 @@ export const vmStyle = () => { if (typeof document !== 'undefined') vwStyle('mee
269
289
  * series line open it. deps: { pmGet, pmPost, esc, toast, task(sheet, step) → Promise<{ ok, text }>, changed?() after a write } */
270
290
  export async function openNoteTab(d, id) {
271
291
  vmStyle();
272
- const st = { id, note: null, sheet: null, error: '', phase: 'after', tasked: new Set(), say: '', about: false, choices: null };
292
+ const st = { id, note: null, sheet: null, error: '', phase: 'after', open: {}, tasked: new Set(), say: '', about: false, choices: null };
273
293
  const ctx = () => ({ esc: d.esc, tasked: st.tasked, replayBtn: false, where: 'tab', id: st.id, reread: () => read(st.id) });
274
294
  const html = () => {
275
295
  const S = st.sheet;
276
296
  if (!S) return `<article class="paper doc mtg vm"><p class="note" role="status">${st.error ? 'The note could not be read: ' + d.esc(st.error) : 'Reading the note.'}</p></article>`;
277
- const part = (k) => `<div class="vm-body" data-part="${k}"${st.phase === k ? '' : ' hidden'}>${stageHtml(k, S, ctx())}</div>`;
278
- return `<article class="paper doc mtg vm"><p class="note mtg-status" role="status"${st.say ? '' : ' hidden'}>${d.esc(st.say)}</p><div class="mh2"><div><h3 class="d1">${d.esc(S.title)}</h3><p class="mt">${d.esc([S.day, S.minutes ? S.minutes + ' min' : ''].filter(Boolean).join(' · '))}</p></div></div>${linksHtml(S, d.esc, { change: true, open: st.about })}${st.about ? aboutPickHtml(st.choices, aboutNow(st.note), d.esc) : ''}${seriesHtml(S, d.esc)}${phaseHtml(st.phase, d.esc)}${PHASES.map(([k]) => part(k)).join('')}</article>`;
297
+ const parts = Object.fromEntries(PHASES.map(([k]) => [k, stageHtml(k, S, ctx())]));
298
+ return `<article class="paper doc mtg vm"><p class="note mtg-status" role="status"${st.say ? '' : ' hidden'}>${d.esc(st.say)}</p><div class="mh2"><div><h3 class="d1">${d.esc(S.title)}</h3><p class="mt">${d.esc([S.day, S.minutes ? S.minutes + ' min' : ''].filter(Boolean).join(' · '))}</p></div></div>${linksHtml(S, d.esc, { change: true, open: st.about })}${st.about ? aboutPickHtml(st.choices, aboutNow(st.note), d.esc) : ''}${seriesHtml(S, d.esc)}${partsHtml(st.phase, parts, st.open, d.esc)}</article>`;
279
299
  };
280
300
  let el = null;
281
301
  const wireParts = () => { if (!el || !st.sheet) return; for (const [k] of PHASES) wireStage(k, el.querySelector(`.vm-body[data-part="${k}"]`), st.sheet, ctx()); };
282
- const paint = () => { if (el && el.isConnected) { el.innerHTML = html(); wireParts(); } };
302
+ const paint = () => { if (el && el.isConnected) { partKeep(el, st.open); el.innerHTML = html(); wireParts(); } };
283
303
  async function read(noteId) {
284
304
  const fresh = noteId !== st.id || !st.sheet;
285
- st.id = noteId; if (fresh) { st.sheet = null; st.tasked = new Set(); st.about = false; } st.error = ''; st.say = ''; paint();
305
+ st.id = noteId; if (fresh) { st.sheet = null; st.tasked = new Set(); st.about = false; st.open = {}; } st.error = ''; st.say = ''; paint();
286
306
  const one = await d.pmGet('/api/notes/one?id=' + encodeURIComponent(noteId));
287
307
  if (st.id !== noteId) return;
288
308
  const was = st.sheet;
@@ -303,13 +323,8 @@ export async function openNoteTab(d, id) {
303
323
  function wire(pane) {
304
324
  el = pane;
305
325
  pane.onclick = async (e) => {
326
+ if (partToggle(e, st.open)) return;
306
327
  const b = e.target.closest('button'); if (!b || !st.sheet) return;
307
- if (b.dataset.ph) {
308
- st.phase = b.dataset.ph;
309
- el.querySelectorAll('.vm-ph [data-ph]').forEach((x) => x.setAttribute('aria-pressed', String(x === b)));
310
- el.querySelectorAll('.vm-body[data-part]').forEach((x) => { x.hidden = x.dataset.part !== st.phase; });
311
- return;
312
- }
313
328
  if ((b.dataset.vm === 'prev' || b.dataset.vm === 'next') && b.dataset.id) return read(b.dataset.id);
314
329
  if (b.dataset.vm === 'nabout') {
315
330
  st.about = !st.about; paint();
@@ -396,7 +396,7 @@ a.round{color:inherit;text-decoration:none}
396
396
  @media (max-width:700px){.ch{position:relative;top:0}
397
397
  .fchip,.seg2 button,.dlg .seg button,.dx2,.seg button{min-height:44px}
398
398
  .dx2,.round,.fbtn{min-width:44px;min-height:44px}}
399
- .rail .ind{transform:translateY(calc(var(--pi,0)*72px));transition:transform .55s var(--spring)}
399
+ .rail .ind{transform:translateY(var(--py,calc(var(--pi,0)*72px)));transition:transform .55s var(--spring)}
400
400
  .stage[hidden]{display:none}
401
401
  .mv2{display:flex;gap:6px;flex-wrap:wrap;align-items:center;font-size:var(--fs-2);color:var(--ink-3)}
402
402
  .mv2 .seg2{margin-left:2px}
@@ -453,7 +453,7 @@ a.round{color:inherit;text-decoration:none}
453
453
  .cols2>div{display:grid;gap:24px;min-width:0}
454
454
  @media (max-width:1000px){.cols2{grid-template-columns:minmax(0,1fr)}}
455
455
  @media (max-width:999px){.rail{left:50%;top:auto;bottom:max(12px,env(safe-area-inset-bottom,0px));transform:translateX(-50%);width:min(400px,calc(100% - 32px));display:flex;border-radius:28px;padding:6px}
456
- .rail .ind{top:6px;bottom:6px;height:auto;left:6px;width:calc((100% - 12px)/4)}
456
+ .rail .ind{top:6px;bottom:6px;height:auto;left:6px;width:calc((100% - 12px)/5)}
457
457
  .pl{flex:1;height:56px}
458
458
  .stage{padding-block-end:120px}
459
459
  .snap{display:none}
@@ -2112,8 +2112,6 @@ button.wl-row[aria-pressed="true"] .wl-tog{background:var(--solid);color:var(--o
2112
2112
  .top{flex-wrap:nowrap}
2113
2113
  .where{display:flex;align-items:center;gap:10px;min-width:0}
2114
2114
  .where .crumb{max-width:none;min-width:0}
2115
- .tbchat{flex:none;background:var(--solid);color:var(--on-solid);border:0;box-shadow:0 10px 30px -10px rgba(20,22,31,.45)}
2116
- .tbchat svg{width:19px;height:19px}
2117
2115
  #crBoard.crback{flex:none;width:44px;height:44px;padding:0;border-radius:50%;display:grid;place-items:center;background:var(--card);border:1px solid var(--hair);color:var(--ink);cursor:pointer}
2118
2116
  #crBoard.crback:hover{text-decoration:none;background:var(--well)}
2119
2117
  #crBoard.crback svg{width:20px;height:20px}
@@ -2501,3 +2499,29 @@ button.wl-row[aria-pressed="true"] .wl-tog{background:var(--solid);color:var(--o
2501
2499
  .askbar .spad-f .cta{width:auto;height:34px;min-height:34px;padding:0 14px;border-radius:var(--r-chip);display:inline-flex;font-size:var(--fs-2);background:var(--card);color:var(--ink)}
2502
2500
  .askbar .spad-f .cta:disabled{opacity:.5;cursor:not-allowed}
2503
2501
  @media (max-width:700px){.spad-h span{display:none}.askbar .spad textarea{font-size:var(--fs-4)}.padt{min-height:44px}}
2502
+ /* a compact dialog (the meeting detail) on a phone: a short head, and once the detail scrolls only the title and the tools stay (PM, 2026-10-20) */
2503
+ @media (max-width:999px){.dlg.cmp #dEye{display:none}
2504
+ .dlg.cmp .dhead{align-items:center}
2505
+ .dlg.cmp #dTitle{margin-top:0;font-size:var(--fs-4);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
2506
+ .dlg.cmp .dsub{margin-top:2px;font-size:var(--fs-2);line-height:1.35}
2507
+ .dlg.cmp .dtabs{margin-top:10px}
2508
+ .dlg.cmp .dgrid{margin-top:8px}
2509
+ .dlg.cmp.shrunk .dsub,.dlg.cmp.shrunk .dtabs{display:none}
2510
+ .dlg.cmp.shrunk .dgrid{margin-top:4px}}
2511
+
2512
+ /* ── premium-chat-rail: Chat is the rail's middle place, a solid round button bigger than the others. On a phone it rises above the bar. ── */
2513
+ .pl.pchat{height:96px;color:var(--ink)}
2514
+ .pchat .orb{position:relative;width:60px;height:60px;border-radius:50%;display:grid;place-items:center;background:var(--solid);color:var(--on-solid);box-shadow:0 12px 28px -10px rgba(20,22,31,.55),0 0 0 4px color-mix(in oklab,var(--solid) 14%,transparent);transition:transform .35s var(--spring)}
2515
+ .pchat .orb svg{width:26px;height:26px}
2516
+ .pl.pchat:hover svg{transform:none}
2517
+ .pl.pchat:hover .orb{transform:translateY(-2px)}
2518
+ .pchat .cdot{position:absolute;top:2px;right:2px;width:12px;height:12px;border-radius:50%;background:var(--ember);box-shadow:0 0 0 2px var(--card-solid)}
2519
+ .pchat .cdot[hidden]{display:none}
2520
+ .pl.pchat:focus-visible{outline:none}
2521
+ .pl.pchat:focus-visible .orb{outline:2px solid var(--ink);outline-offset:3px}
2522
+ @media (max-width:999px){
2523
+ .pl.pchat{height:56px;align-content:end;padding-bottom:6px}
2524
+ .pchat .orb{position:absolute;left:50%;top:-30px;transform:translateX(-50%);width:60px;height:60px;box-shadow:0 10px 24px -8px rgba(0,0,0,.6),0 0 0 5px var(--card-solid)}
2525
+ .pl.pchat:hover .orb{transform:translateX(-50%)}
2526
+ }
2527
+ @media (prefers-reduced-motion:reduce){.pchat .orb{transition:none}}
@@ -15,6 +15,7 @@
15
15
  <i class="ind"></i>
16
16
  <button class="pl" data-go="brief"><svg class="i" viewBox="0 0 24 24"><circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M2 12h2M20 12h2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"/></svg>Briefing</button>
17
17
  <button class="pl" data-go="work"><svg class="i" viewBox="0 0 24 24"><rect x="4" y="4" width="16" height="16" rx="3"/><path d="m8.5 12 2.5 2.5 4.5-5"/></svg>My work</button>
18
+ <button class="pl pchat" data-go="chat" aria-haspopup="dialog" aria-label="Chat" title="Chat"><span class="orb"><svg class="i" viewBox="0 0 24 24"><path d="M4 5h16v11h-9l-5 4v-4H4z"/><path d="M12 7.6l.8 1.9 1.9.8-1.9.8-.8 1.9-.8-1.9-1.9-.8 1.9-.8z"/></svg><i class="cdot" hidden></i></span>Chat</button>
18
19
  <button class="pl" data-go="init" aria-current="page"><svg class="i" viewBox="0 0 24 24"><path d="M12 3 3 8l9 5 9-5z"/><path d="m3 13 9 5 9-5"/></svg>Board</button>
19
20
  <button class="pl" data-go="rep"><svg class="i" viewBox="0 0 24 24"><path d="M4 20V10M10 20V4M16 20v-8M22 20H2"/></svg>Insights</button>
20
21
  </nav>
@@ -15,6 +15,7 @@
15
15
  <i class="ind"></i>
16
16
  <button class="pl" data-go="brief"><svg class="i" viewBox="0 0 24 24"><circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M2 12h2M20 12h2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"/></svg>Briefing</button>
17
17
  <button class="pl" data-go="work"><svg class="i" viewBox="0 0 24 24"><rect x="4" y="4" width="16" height="16" rx="3"/><path d="m8.5 12 2.5 2.5 4.5-5"/></svg>My work</button>
18
+ <button class="pl pchat" data-go="chat" aria-haspopup="dialog" aria-label="Chat" title="Chat"><span class="orb"><svg class="i" viewBox="0 0 24 24"><path d="M4 5h16v11h-9l-5 4v-4H4z"/><path d="M12 7.6l.8 1.9 1.9.8-1.9.8-.8 1.9-.8-1.9-1.9-.8 1.9-.8z"/></svg><i class="cdot" hidden></i></span>Chat</button>
18
19
  <button class="pl" data-go="init" aria-current="page"><svg class="i" viewBox="0 0 24 24"><path d="M12 3 3 8l9 5 9-5z"/><path d="m3 13 9 5 9-5"/></svg>Board</button>
19
20
  <button class="pl" data-go="rep"><svg class="i" viewBox="0 0 24 24"><path d="M4 20V10M10 20V4M16 20v-8M22 20H2"/></svg>Insights</button>
20
21
  </nav>
@@ -16,6 +16,7 @@
16
16
  <i class="ind"></i>
17
17
  <button class="pl" data-go="brief"><svg class="i" viewBox="0 0 24 24"><circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M2 12h2M20 12h2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"/></svg>Briefing</button>
18
18
  <button class="pl" data-go="work"><svg class="i" viewBox="0 0 24 24"><rect x="4" y="4" width="16" height="16" rx="3"/><path d="m8.5 12 2.5 2.5 4.5-5"/></svg>My work</button>
19
+ <button class="pl pchat" data-go="chat" aria-haspopup="dialog" aria-label="Chat" title="Chat"><span class="orb"><svg class="i" viewBox="0 0 24 24"><path d="M4 5h16v11h-9l-5 4v-4H4z"/><path d="M12 7.6l.8 1.9 1.9.8-1.9.8-.8 1.9-.8-1.9-1.9-.8 1.9-.8z"/></svg><i class="cdot" hidden></i></span>Chat</button>
19
20
  <button class="pl" data-go="init"><svg class="i" viewBox="0 0 24 24"><path d="M12 3 3 8l9 5 9-5z"/><path d="m3 13 9 5 9-5"/></svg>Board</button>
20
21
  <button class="pl" data-go="rep" aria-current="page"><svg class="i" viewBox="0 0 24 24"><path d="M4 20V10M10 20V4M16 20v-8M22 20H2"/></svg>Insights</button>
21
22
  </nav>
@@ -15,6 +15,7 @@
15
15
  <i class="ind"></i>
16
16
  <button class="pl" data-go="brief"><svg class="i" viewBox="0 0 24 24"><circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M2 12h2M20 12h2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"/></svg>Briefing</button>
17
17
  <button class="pl" data-go="work" aria-current="page"><svg class="i" viewBox="0 0 24 24"><rect x="4" y="4" width="16" height="16" rx="3"/><path d="m8.5 12 2.5 2.5 4.5-5"/></svg>My work</button>
18
+ <button class="pl pchat" data-go="chat" aria-haspopup="dialog" aria-label="Chat" title="Chat"><span class="orb"><svg class="i" viewBox="0 0 24 24"><path d="M4 5h16v11h-9l-5 4v-4H4z"/><path d="M12 7.6l.8 1.9 1.9.8-1.9.8-.8 1.9-.8-1.9-1.9-.8 1.9-.8z"/></svg><i class="cdot" hidden></i></span>Chat</button>
18
19
  <button class="pl" data-go="init"><svg class="i" viewBox="0 0 24 24"><path d="M12 3 3 8l9 5 9-5z"/><path d="m3 13 9 5 9-5"/></svg>Board</button>
19
20
  <button class="pl" data-go="rep"><svg class="i" viewBox="0 0 24 24"><path d="M4 20V10M10 20V4M16 20v-8M22 20H2"/></svg>Insights</button>
20
21
  </nav>
@@ -32,7 +33,7 @@
32
33
  <div class="toast glass" id="toast" role="status"></div>
33
34
  <main class="stage" id="stage">
34
35
  <header class="top rise" style="--d:0">
35
- <h1 class="vh">My work</h1><div class="where"><span class="glass name" aria-hidden="true">My work</span><button class="round tbchat" id="pgChat" aria-haspopup="dialog" aria-label="Ask about this page" title="Ask about this page"></button></div>
36
+ <h1 class="vh">My work</h1><div class="where"><span class="glass name" aria-hidden="true">My work</span></div>
36
37
  <div class="tools tools-top"><span class="vh" id="snap">Reading your list</span></div>
37
38
  </header>
38
39
  <section class="hero">