create-pmos 0.262.0 → 0.264.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.
@@ -0,0 +1,169 @@
1
+ /* pm/premium-meeting.js — Calendar in the premium Briefing's Today card (initiative briefing-premium-calendar, slice 1).
2
+ * The Today / This week switch, the week list and the meeting dialog. Reads GET /api/calendar-views?view=week, GET /api/meeting-replay and GET /api/meeting-material.
3
+ * The one write is "Link it", through POST /api/calendar-links. Every word is a field of a record: the pure half (weekView, meetingView) takes the routes' answers and
4
+ * returns what the page draws, so a test reads it without a DOM. Recording, Focus and material changes are later slices. */
5
+
6
+ const pad = (n) => String(n).padStart(2, '0');
7
+ 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; };
8
+ const DOW = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
9
+ const dayLabel = (key) => { const [y, m, d] = key.split('-').map(Number); const wd = (new Date(Date.UTC(y, m - 1, d)).getUTCDay() + 6) % 7; return `${DOW[wd]} ${d} ${MON[m - 1]}`; };
10
+ const hasTime = (s) => typeof s === 'string' && /T\d{2}:\d{2}/.test(s);
11
+ const hhmm = (s) => (hasTime(s) ? s.slice(11, 16) : 'All day');
12
+ const minutesBetween = (a, b) => (hasTime(a) && hasTime(b) ? Math.round((Date.parse(b) - Date.parse(a)) / 60000) : null);
13
+ const lengthText = (m) => (m == null || m <= 0 ? '' : m < 60 ? m + ' min' : m % 60 ? Math.floor(m / 60) + ' h ' + (m % 60) + ' min' : m / 60 + ' h');
14
+
15
+ /** What a meeting is about, in words, from the calendar answer's `context[id].level`. A past meeting carries no level in the answer, so it says nothing. */
16
+ export function aboutOf(level) {
17
+ if (!level || !level.kind) return '';
18
+ if (['portfolio'].includes(level.kind)) return 'Portfolio';
19
+ return (level.kind === 'board' ? 'Board: ' : 'Initiative: ') + clip(level.name || level.id || '', 60);
20
+ }
21
+
22
+ /** The week as the card draws it. `r` is the answer of GET /api/calendar-views?view=week, or { ok:false, error }. `today` is 'YYYY-MM-DD'. */
23
+ export function weekView(r, today) {
24
+ if (!r || r.ok !== true) return { state: 'error', reason: clip((r && r.error) || 'The calendar did not answer.', 160), days: [], total: 0, caption: 'Calendar not read' };
25
+ const cells = Array.isArray(r.cells) ? r.cells : [], ctx = r.context && typeof r.context === 'object' ? r.context : {};
26
+ const days = cells.map((c) => {
27
+ const rows = (c.events || []).filter((e) => e && e.title).slice().sort((a, b) => String(a.at).localeCompare(String(b.at))).map((e) => {
28
+ const mins = minutesBetween(e.at, e.end), who = Array.isArray(e.attendees) ? e.attendees.filter(Boolean) : [], level = (ctx[e.id] || {}).level;
29
+ return {
30
+ id: e.id, series: e.series || null, title: clip(e.title, 120), at: e.at, end: e.end || null, time: hhmm(e.at), len: lengthText(mins), who,
31
+ sub: [lengthText(mins), who.length ? 'with ' + who.join(', ') : ''].filter(Boolean).join(' · '),
32
+ about: aboutOf(level), level: level || null, past: c.end < today, day: c.key,
33
+ };
34
+ });
35
+ return { key: c.key, label: dayLabel(c.key), today: c.key === today, past: c.end < today, rows };
36
+ });
37
+ const total = days.reduce((s, d) => s + d.rows.length, 0), range = r.range || {};
38
+ const span = range.start && range.end ? `${Number(range.start.slice(8))}–${Number(range.end.slice(8))} ${MON[Number(range.end.slice(5, 7)) - 1]}` : '';
39
+ return { state: 'ok', days, total, caption: total ? `${total} ${total === 1 ? 'meeting' : 'meetings'}${span ? ' · ' + span : ''}` : 'No meetings this week',
40
+ boards: Array.isArray(r.link_boards) ? r.link_boards.map((b) => ({ ws: b.ws, id: b.id, name: b.name })) : [],
41
+ initiatives: (Array.isArray(r.gantt) ? r.gantt : []).filter((g) => g && g.id).slice(0, 60).map((g) => ({ id: g.id, name: clip(g.title || g.id, 70) })) };
42
+ }
43
+
44
+ /** The meeting dialog's sections. `row` is a weekView row; `replay` is { state:'none'|'ok'|'error', body }; `material` is { state, items }. Nothing here is invented. */
45
+ export function meetingView(row, replay, material) {
46
+ const rep = replay && replay.state === 'ok' ? replay.body : null;
47
+ const people = row.who && row.who.length ? row.who : (rep && rep.meeting && Array.isArray(rep.meeting.attendees) ? rep.meeting.attendees : []);
48
+ const keys = rep && Array.isArray(rep.keys) ? rep.keys : [];
49
+ const pick = (k) => keys.filter((x) => x.k === k).map((x) => ({ text: clip(x.text, 240), owner: x.owner || '', due: x.due || '', open: x.state === 'open' || x.state === 'owner' }));
50
+ const notes = rep ? { title: clip((rep.note && rep.note.title) || '', 120), decisions: pick('decision'), actions: pick('action'), questions: pick('question') } : null;
51
+ const heard = rep && Number(rep.length_ms) > 0 ? Math.round(rep.length_ms / 60000) : 0;
52
+ return {
53
+ people,
54
+ notes, notesState: replay ? replay.state : 'none',
55
+ notesLine: !replay ? 'Reading the notes.' : replay.state === 'error' ? 'The notes could not be read: ' + clip(replay.error, 120) : replay.state === 'none' ? 'No notes for this meeting.' : '',
56
+ replay: rep && (rep.audio || heard) ? { minutes: heard, keyPoints: keys.length, lines: Array.isArray(rep.lines) ? rep.lines.length : 0 } : null,
57
+ material: material && material.state === 'ok' ? (material.items || []).map((i) => ({ title: clip(i.title || i.ref || i.url, 120), kind: i.kind || '', scope: i.scope === 'series' ? 'every meeting of this series' : 'this meeting' })) : null,
58
+ materialLine: !material ? 'Reading the material.' : material.state === 'error' ? 'The material could not be read: ' + clip(material.error, 120) : (material.items || []).length ? '' : 'No material is linked to this meeting.',
59
+ row,
60
+ };
61
+ }
62
+
63
+ /** The body of POST /api/calendar-links for a choice made in the dialog: 'portfolio', 'none', 'board|<ws>|<id>' or 'initiative|<id>'. */
64
+ export function linkBody(row, choice, boards) {
65
+ const event = { title: row.title, ...(row.series ? { series: row.series } : {}) };
66
+ if (['portfolio', 'none'].includes(choice)) return { event, kind: choice };
67
+ const [k, a, b] = String(choice).split('|');
68
+ if (k === 'board') { const bd = (boards || []).find((x) => x.id === b && String(x.ws) === a); return { event, kind: 'board', ws: a, board: b, ...(bd ? { title: bd.name } : {}) }; }
69
+ if (k === 'initiative') return { event, kind: 'initiative', initiative: a };
70
+ return null;
71
+ }
72
+
73
+ /* ── the page half ─────────────────────────────────────────────────────────────────────────────────────── */
74
+
75
+ /** deps: { $, $$, esc, openDlg, toast, pmGet, pmPost, turnA, ptx, kv, H, wsq(), ws() }. Returns { mode, draw, openToday }. */
76
+ export function mountMeeting(d) {
77
+ const { $, $$, esc } = d;
78
+ let mode = 'today', W = null, seq = 0, busy = false;
79
+ const today = () => { const t = new Date(); return `${t.getFullYear()}-${pad(t.getMonth() + 1)}-${pad(t.getDate())}`; };
80
+ const wsq = (first) => { const w = d.ws(); return w ? (first ? '?' : '&') + 'ws=' + encodeURIComponent(w) : ''; };
81
+ const ICON = '<rect x="4" y="5" width="16" height="15" rx="3"/><path d="M4 10h16M9 3v4M15 3v4"/>';
82
+
83
+ async function readWeek() {
84
+ const n = ++seq; busy = true;
85
+ const res = await d.pmGet('/api/calendar-views?view=week&date=' + today() + wsq());
86
+ if (n !== seq) return;
87
+ busy = false; W = weekView(res, today());
88
+ }
89
+ const rowHtml = (r, k) => `<button class="ev src-meeting${r.past ? ' wkpast' : ''}" data-w="${esc(k)}" aria-haspopup="dialog"><time>${esc(r.time)}</time><span class="gl-t"><svg class="i" viewBox="0 0 24 24">${ICON}</svg></span><span><b>${esc(r.title)}</b><span class="d">${esc([r.sub, r.about].filter(Boolean).join(' · ') || 'No other people listed')}</span></span></button>`;
90
+ function draw() {
91
+ const card = $('#todayCard');
92
+ $$('#rng button').forEach((b) => b.setAttribute('aria-pressed', b.dataset.r === mode));
93
+ card.classList.toggle('wkm', mode === 'week'); $('#rcap').hidden = mode !== 'week';
94
+ if (mode !== 'week') return false;
95
+ $('#tl').setAttribute('aria-label', 'This week. Use the up and down arrow keys to move between rows.');
96
+ if (!W) { $('#todayCap').textContent = $('#rcap').textContent = 'Reading the calendar'; $('#tl').innerHTML = '<div class="empty">Reading the calendar PMOS holds.</div>'; return true; }
97
+ $('#todayCap').textContent = $('#rcap').textContent = W.caption;
98
+ if (W.state === 'error') { $('#tl').innerHTML = `<div class="empty" role="status">Calendar not read. ${esc(W.reason)}</div>`; return true; }
99
+ $('#tl').innerHTML = W.days.map((x) => `<div class="wkd${x.today ? ' now' : ''}">${esc(x.label)}${x.today ? ' · today' : ''}<em>${x.rows.length ? x.rows.length + (x.rows.length === 1 ? ' meeting' : ' meetings') : ''}</em></div>${x.rows.length ? x.rows.map((r, i) => rowHtml(r, x.key + '|' + i)).join('') : '<div class="empty">No meetings.</div>'}`).join('');
100
+ $$('#tl .ev').forEach((e, i) => { e.tabIndex = i ? -1 : 0; });
101
+ return true;
102
+ }
103
+ const rowOf = (k) => { const [day, i] = k.split('|'); const x = W && W.days.find((y) => y.key === day); return x ? x.rows[+i] : null; };
104
+
105
+ async function setMode(m, redraw) {
106
+ mode = m;
107
+ if (m === 'week') { $('#tl').setAttribute('aria-busy', 'true'); draw(); await readWeek(); $('#tl').removeAttribute('aria-busy'); }
108
+ redraw();
109
+ }
110
+
111
+ /* the dialog */
112
+ const sec = (label, body) => `<div class="mtg-sec"><span class="label">${esc(label)}</span>${body}</div>`;
113
+ const items = (L) => `<ul class="mtg-l">${L.map((x) => `<li>${esc(x.text)}${x.owner || x.due ? `<em>${esc([x.owner, x.due].filter(Boolean).join(' · '))}</em>` : ''}</li>`).join('')}</ul>`;
114
+ function paneHtml(v, boards, inis, saved) {
115
+ const r = v.row, lv = r.level;
116
+ const aboutNow = lv ? aboutOf(lv) : saved || '';
117
+ const opts = [['', aboutNow ? 'Change what it is about' : 'Choose what it is about'], ['portfolio', 'Portfolio']].concat(boards.map((b) => ['board|' + b.ws + '|' + b.id, 'Board: ' + b.name]), inis.map((i) => ['initiative|' + i.id, 'Initiative: ' + i.name]), [['none', 'Remove the link']]);
118
+ const about = `<p>${aboutNow ? 'It is about <b>' + esc(aboutNow) + '</b>.' + (lv && lv.why ? ' ' + esc(lv.why) + '.' : '') : (r.past ? 'The calendar answer holds no link for an earlier meeting.' : 'Not linked to anything yet.')}</p>
119
+ <div class="mtg-link"><select id="mtgSel" aria-label="What this meeting is about">${opts.map(([val, t]) => `<option value="${esc(val)}">${esc(t)}</option>`).join('')}</select><button class="cta" id="mtgLink" disabled>Link it</button></div>
120
+ <p class="note" id="mtgMsg" role="status">The link applies to every occurrence of “${esc(r.title)}”. The calendar itself is never written.</p>`;
121
+ const n = v.notes;
122
+ const notes = v.notesLine ? `<p class="note">${esc(v.notesLine)}</p>` : [n.title ? `<p><b>${esc(n.title)}</b></p>` : '',
123
+ n.decisions.length ? `<h4 class="mtg-h">Decisions ${n.decisions.length}</h4>${items(n.decisions)}` : '', n.actions.length ? `<h4 class="mtg-h">Next steps ${n.actions.length}</h4>${items(n.actions)}` : '',
124
+ n.questions.length ? `<h4 class="mtg-h">Open questions ${n.questions.length}</h4>${items(n.questions)}` : '', (n.decisions.length + n.actions.length + n.questions.length) ? '' : '<p class="note">The note holds no decisions, next steps or questions yet.</p>'].join('');
125
+ const mat = v.materialLine ? `<p class="note">${esc(v.materialLine)}</p>` : `<ul class="mtg-l">${v.material.map((m) => `<li>${esc(m.title)}<em>${esc([m.kind, 'for ' + m.scope].filter(Boolean).join(' · '))}</em></li>`).join('')}</ul>`;
126
+ const rep = v.replay ? `<p>A recording is kept: ${v.replay.minutes ? v.replay.minutes + ' min, ' : ''}${v.replay.keyPoints} key ${v.replay.keyPoints === 1 ? 'point' : 'points'}.</p><p class="note">Replay opens in the console for now.</p>` : '';
127
+ return `<article class="paper doc mtg">${d.kv([['When', r.day + ' · ' + r.time + (r.len ? ' · ' + r.len : '')], ['People', v.people.join(', ') || 'The calendar lists no other people.']])}${sec('What it is about', about)}${sec('Notes', notes)}${sec('Material', mat)}${rep ? sec('Replay', rep) : ''}</article>`;
128
+ }
129
+
130
+ async function openRow(row, via) {
131
+ let replay = null, material = null, boards = W ? W.boards : [], inis = W ? W.initiatives : [], saved = '';
132
+ const paint = () => { $('#oMain').innerHTML = paneHtml(meetingView(row, replay, material), boards, inis, saved); };
133
+ d.openDlg({ eye: 'Calendar · real data', title: row.title, sub: [row.day, row.time, row.len].filter(Boolean).join(' · '), noteKey: via === 'today' ? 'ev:meeting:' + Date.parse(row.at) : null,
134
+ 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: paneHtml(meetingView(row, null, null), boards, inis, ''), label: 'Meeting' });
135
+ if (via !== 'today') $('#askF').hidden = true;
136
+ const [rp, mt] = await Promise.all([d.pmGet('/api/meeting-replay?event=' + encodeURIComponent(row.id) + '&date=' + row.day), d.pmGet('/api/meeting-material?event=' + encodeURIComponent(row.id) + '&title=' + encodeURIComponent(row.title) + (row.series ? '&series=' + encodeURIComponent(row.series) : '') + '&date=' + row.day)]);
137
+ if ($('#dTitle').textContent !== row.title) return;
138
+ replay = rp && rp.ok === true ? { state: 'ok', body: rp } : rp && rp.status === 404 ? { state: 'none' } : { state: 'error', error: (rp && rp.error) || 'no answer' };
139
+ material = mt && mt.ok === true ? { state: 'ok', items: mt.items || [] } : { state: 'error', error: (mt && mt.error) || 'no answer' };
140
+ paint();
141
+ const sel = () => $('#mtgSel');
142
+ $('#oMain').onchange = (e) => { if (e.target.id === 'mtgSel') $('#mtgLink').disabled = !e.target.value; };
143
+ $('#oMain').onclick = async (e) => {
144
+ if (!e.target.closest('#mtgLink')) return;
145
+ const body = linkBody(row, sel().value, boards);
146
+ if (!body) return;
147
+ const go = $('#mtgLink'); go.disabled = true;
148
+ const res = await d.pmPost('/api/calendar-links', body);
149
+ if (!res || res.ok !== true) { go.disabled = false; $('#mtgMsg').textContent = (res && res.error) || 'The link could not be saved.'; return; }
150
+ saved = body.kind === 'none' ? '' : sel().selectedOptions[0].textContent;
151
+ d.toast(body.kind === 'none' ? 'The link is removed for every occurrence of this meeting.' : 'Linked. It applies to every occurrence of this meeting.');
152
+ await readWeek(); paint(); if (mode === 'week') draw();
153
+ $('#oMain').onchange = (ev) => { if (ev.target.id === 'mtgSel') $('#mtgLink').disabled = !ev.target.value; };
154
+ };
155
+ }
156
+
157
+ /** A Today row: the week answer says which calendar event it is. With no match the page keeps the plain dialog. */
158
+ async function openToday(e) {
159
+ if (!W || W.state !== 'ok') await readWeek();
160
+ const hit = W && W.state === 'ok' ? W.days.flatMap((x) => x.rows).find((r) => Date.parse(r.at) === e.at && r.title === clip(e.title, 120)) : null;
161
+ if (!hit) return false;
162
+ await openRow(hit, 'today');
163
+ return true;
164
+ }
165
+
166
+ $('#rng').addEventListener('click', (e) => { const b = e.target.closest('button'); if (b && b.dataset.r !== mode && d.redraw) setMode(b.dataset.r, d.redraw); });
167
+ $('#tl').addEventListener('click', (e) => { const b = e.target.closest('.ev[data-w]'); if (!b) return; e.stopImmediatePropagation(); const r = rowOf(b.dataset.w); if (r) openRow(r, 'week'); }, true);
168
+ return { mode: () => mode, draw, openToday, busy: () => busy };
169
+ }
@@ -1287,3 +1287,26 @@ button.dsn:hover{box-shadow:inset 0 0 0 1.5px rgb(79,109,245)}
1287
1287
  .sr button{min-height:44px;min-width:64px;flex:none}
1288
1288
  .sr .fchip[aria-checked="true"]{background:var(--solid);color:var(--on-solid)}
1289
1289
  @media (max-width:600px){.pkmenu{left:0;right:auto}} /* three round header buttons leave the picker too far left for a right-aligned menu (initiative premium-settings) */
1290
+
1291
+ /* ── Today / This week and the meeting dialog (initiative briefing-premium-calendar) ─────────────────────────────────── */
1292
+ #rng{margin-left:4px;flex:none;overflow:visible;max-width:none}
1293
+ #rng button{min-height:44px;min-width:44px}
1294
+ #rng button[aria-pressed="true"]{background:var(--solid);color:var(--on-solid)}
1295
+ #todayCard .ch h2{flex:none;margin:0}
1296
+ #todayCard .ch small{display:none}
1297
+ #todayCard .ch .fbtn{margin-left:auto}
1298
+ #todayCard.wkm .fbtn,#todayCard.wkm #todayOpts{display:none}
1299
+ .rcap{font-size:var(--t-small);color:var(--ink-3);margin-top:2px}
1300
+ .wkd{font:600 var(--t-micro) var(--mono);letter-spacing:.08em;text-transform:uppercase;color:var(--ink-3);padding:14px 0 6px;display:flex;gap:10px;align-items:center}
1301
+ .wkd.now{color:var(--ember-ink)}.wkd.now::before{content:"";width:8px;height:8px;border-radius:50%;background:var(--ember)}
1302
+ .wkd em{font-style:normal;margin-left:auto;letter-spacing:0;text-transform:none;font-weight:500}
1303
+ .ev.wkpast{opacity:.55}
1304
+ .mtg-sec{margin-top:20px}.mtg-sec>.label{display:block;margin-bottom:8px}
1305
+ .mtg-sec p{margin:0 0 8px;color:var(--ink-2);line-height:1.55}
1306
+ .mtg-h{font:600 var(--t-micro) var(--mono);letter-spacing:.08em;text-transform:uppercase;color:var(--ink-3);margin:14px 0 6px}
1307
+ .mtg-l{margin:0;padding:0;list-style:none;display:grid;gap:6px}
1308
+ .mtg-l li{padding:8px 0;border-top:1px solid var(--hair)}.mtg-l li:first-child{border-top:0}
1309
+ .mtg-l em{display:block;font-style:normal;font-size:var(--t-small);color:var(--ink-3)}
1310
+ .mtg-link{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin:10px 0 8px}
1311
+ .mtg-link select{flex:1 1 220px;min-width:0;min-height:44px;border-radius:18px;border:1px solid var(--hair);background:var(--well);padding:0 14px;font:inherit;color:inherit}
1312
+ @media (max-width:700px){#todayCard .ch{flex-wrap:wrap;row-gap:8px}}
@@ -2,7 +2,8 @@
2
2
  * lib/briefing-premium.js builds: the hero, "What you need to do", Today, the dock and the standard dialog. The read is one GET; the only writes are the PM's own presses (slice 2, below). A row clears when the repository's record changes, so there is nothing to press to clear it.
3
3
  * Slice 2 (initiative briefing-premium-writes): the buttons that record the PM's own calls post to /api/briefing-premium/{decide,put-off,return}.
4
4
  * Slice 3: the reply box asks a read-only agent. A control with nothing honest to write stays disabled and says why. */
5
- import { pmPost } from './http.js';
5
+ import { pmPost, pmGet } from './http.js';
6
+ import { mountMeeting } from './premium-meeting.js';
6
7
  import { $, $$, esc, store, THEME_KEY, RM, AI, S, theme, toast, kv, H, openDlg, closeDlg, setTab, setMode, CHECK, CHEV, ptx, turnA, turnU, H1, H2, P1, UL, logHtml, loadThread, onScroll, wireRail } from './premium-shell.js';
7
8
  const ICON = {
8
9
  meeting: '<rect x="4" y="5" width="16" height="15" rx="3"/><path d="M4 10h16M9 3v4M15 3v4"/>',
@@ -16,6 +17,7 @@ const on = new Set(Object.keys(SRC));
16
17
  const pinned = new Set();
17
18
 
18
19
  wireRail('brief');
20
+ const week = mountMeeting({ $, $$, esc, openDlg, toast, pmGet, pmPost, turnA, ptx, kv, H, ws: () => new URLSearchParams(location.search).get('ws'), redraw: () => drawTl() });
19
21
 
20
22
  /* ── a day's baseline, kept on this device, so "N of M done" counts rows that cleared since the page first read today ────── */
21
23
  const dayKey = () => { const d = new Date(); return d.getFullYear() + '-' + String(d.getMonth() + 1).padStart(2, '0') + '-' + String(d.getDate()).padStart(2, '0'); };
@@ -74,6 +76,7 @@ function drawChips() {
74
76
  $('#srcChips').innerHTML = Object.entries(SRC).filter(([k]) => k !== 'digest' || M.today.counts.digest).map(([k, n]) => `<button class="fchip" data-k="${k}" aria-pressed="${on.has(k)}">${n}<em>${M.today.counts[k] || 0}</em></button>`).join('');
75
77
  }
76
78
  function drawTl() {
79
+ if (week.draw()) return;
77
80
  const T = M.today, all = ALL(), ahead = T.ahead.filter((e) => on.has(e.kind)), early = T.earlier.filter((e) => on.has(e.kind));
78
81
  $('#todayCap').textContent = `${early.length} earlier · ${ahead.length} ahead`;
79
82
  $('#tl').innerHTML = `<div class="grp">Ahead</div>${ahead.length ? ahead.map((e) => evHtml(e, all.indexOf(e))).join('') : '<div class="empty">Nothing ahead in these sources.</div>'}<div class="nowl">${esc(T.now.t)} · ${esc(T.now.label)}</div><div class="grp" style="padding-top:6px">Earlier today</div><div class="early">${early.length ? early.map((e) => evHtml(e, all.indexOf(e))).join('') : `<div class="empty">${esc(T.note || 'Nothing yet in these sources.')}</div>`}</div>`;
@@ -89,7 +92,12 @@ $('#tl').addEventListener('keydown', (e) => {
89
92
  const j = e.key === 'ArrowDown' ? Math.min(L.length - 1, i + 1) : e.key === 'ArrowUp' ? Math.max(0, i - 1) : e.key === 'Home' ? 0 : L.length - 1;
90
93
  L.forEach((x) => { x.tabIndex = -1; }); L[j].tabIndex = 0; L[j].focus();
91
94
  });
92
- $('#tl').addEventListener('click', (e) => { const b = e.target.closest('.ev'); if (b) openEvent(ALL()[+b.dataset.i]); });
95
+ $('#tl').addEventListener('click', async (e) => {
96
+ const b = e.target.closest('.ev'); if (!b || b.dataset.w) return;
97
+ const ev = ALL()[+b.dataset.i];
98
+ if (ev && ev.kind === 'meeting' && await week.openToday(ev)) return; // the calendar answer knows this meeting: the full meeting dialog
99
+ openEvent(ev);
100
+ });
93
101
  document.addEventListener('click', (e) => {
94
102
  const fb = e.target.closest('.fbtn');
95
103
  if (fb) { const o = $('#' + fb.dataset.opts), v = !o.classList.contains('on'); o.classList.toggle('on', v); o.inert = !v; fb.setAttribute('aria-expanded', v); }
@@ -45,6 +45,7 @@
45
45
  <section class="card rise" style="--d:5" id="cDash" aria-labelledby="hDash">
46
46
  <div class="ch"><span class="ic"><svg class="i" viewBox="0 0 24 24"><path d="M4 20V10M10 20V4M16 20v-8M22 20H2"/></svg></span><h2 id="hDash">Dashboards</h2><small id="dashCap"></small></div>
47
47
  <div class="seg" id="dashTabs" role="group" aria-label="Dashboard" hidden><i class="pill"></i></div>
48
+ <div class="nact pdbar" id="dashBar" hidden></div>
48
49
  <div id="dashBody"></div>
49
50
  </section>
50
51
  </div>
@@ -55,7 +56,7 @@
55
56
  </section>
56
57
  </aside>
57
58
  </div>
58
- <p class="foot" id="foot">Charts read the KR metric records of this workspace and never invent a number. Left out: the Insight Studio (making your own chart, dashboard or report by conversation), run-based charts such as corrections per 100 runs (they belong to the Board's Metrics card), and any measure no record holds. This page presses nothing and sends nothing.</p>
59
+ <p class="foot" id="foot">Charts read the KR metric records of this workspace and never invent a number. A press here records only what it says: a dashboard in the workspace's state folder, a report setup, request or dismissal in the report ledger. Left out: the Insight Studio (making a chart or a report by conversation), the report deck, present and print, run-based charts such as corrections per 100 runs (they belong to the Board's Metrics card), and any measure no record holds. Nothing is sent from this page.</p>
59
60
  </main>
60
61
  <noscript>This page needs JavaScript.</noscript>
61
62
  <script type="module" src="/pm/premium-insights.js"></script>
@@ -57,7 +57,8 @@
57
57
  </div>
58
58
  <div>
59
59
  <section class="card rise" id="todayCard" style="--d:7" aria-labelledby="hToday">
60
- <div class="ch"><span class="ic"><svg class="i" viewBox="0 0 24 24"><circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2"/></svg></span><h2 id="hToday">Today</h2><small id="todayCap"></small><button class="fbtn" data-opts="todayOpts" aria-expanded="false" aria-controls="todayOpts" aria-label="Filter sources"><svg class="i" viewBox="0 0 24 24"><path d="M4 7h9M17 7h3M4 17h3M11 17h9"/><circle cx="15" cy="7" r="2"/><circle cx="9" cy="17" r="2"/></svg></button></div>
60
+ <div class="ch"><span class="ic"><svg class="i" viewBox="0 0 24 24"><circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2"/></svg></span><h2 id="hToday">Today</h2><div class="seg" id="rng" role="group" aria-label="Range"><button type="button" data-r="today" aria-pressed="true">Today</button><button type="button" data-r="week" aria-pressed="false">This week</button></div><small id="todayCap"></small><button class="fbtn" data-opts="todayOpts" aria-expanded="false" aria-controls="todayOpts" aria-label="Filter sources"><svg class="i" viewBox="0 0 24 24"><path d="M4 7h9M17 7h3M4 17h3M11 17h9"/><circle cx="15" cy="7" r="2"/><circle cx="9" cy="17" r="2"/></svg></button></div>
61
+ <p class="rcap" id="rcap" hidden></p>
61
62
  <div class="opts" id="todayOpts" inert><div><div class="chips" id="srcChips" role="group" aria-label="Sources"></div></div></div>
62
63
  <div class="tl" id="tl" role="group" aria-label="Today. Use the up and down arrow keys to move between rows."></div>
63
64
  </section>
@@ -43,7 +43,9 @@
43
43
  "briefing-premium-insights.test.js",
44
44
  "briefing-premium-initiative.test.js",
45
45
  "briefing-premium-adddoc.test.js",
46
+ "briefing-premium-reports.test.js",
46
47
  "briefing-premium-doc-edit.test.js",
48
+ "briefing-premium-calendar.test.js",
47
49
  "briefing-premium-products.test.js",
48
50
  "briefing-premium-sources.test.js",
49
51
  "briefing-premium-metrics.test.js",
@@ -208,7 +210,9 @@
208
210
  "briefing-premium-insights.test.js": 1,
209
211
  "briefing-premium-initiative.test.js": 1,
210
212
  "briefing-premium-adddoc.test.js": 1,
213
+ "briefing-premium-reports.test.js": 1,
211
214
  "briefing-premium-doc-edit.test.js": 1,
215
+ "briefing-premium-calendar.test.js": 1,
212
216
  "briefing-premium-products.test.js": 1,
213
217
  "briefing-premium-sources.test.js": 1,
214
218
  "briefing-premium-metrics.test.js": 1,
@@ -8,6 +8,7 @@
8
8
  "briefing-premium-initiative-test.js",
9
9
  "briefing-premium-adddoc-test.js",
10
10
  "briefing-premium-doc-edit-test.js",
11
+ "briefing-premium-calendar-test.js",
11
12
  "briefing-premium-products-test.js",
12
13
  "briefing-premium-sources-test.js",
13
14
  "briefing-premium-metrics-test.js",
@@ -21,6 +22,7 @@
21
22
  "briefing-premium-initiative-test.js": 120,
22
23
  "briefing-premium-adddoc-test.js": 120,
23
24
  "briefing-premium-doc-edit-test.js": 90,
25
+ "briefing-premium-calendar-test.js": 90,
24
26
  "briefing-premium-products-test.js": 90,
25
27
  "briefing-premium-sources-test.js": 90,
26
28
  "briefing-premium-metrics-test.js": 120,