create-pmos 0.424.0 → 0.426.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.
- package/package.json +25 -25
- package/payload/KIT-VERSION +1 -1
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/state/discoveries.md +1 -1
- package/workspace/board-deliveries-test.js +153 -0
- package/workspace/board-programs-test.js +60 -36
- package/workspace/board-shot.js +4 -3
- package/workspace/briefing-premium-board-test.js +9 -6
- package/workspace/briefing-premium-insights-test.js +31 -15
- package/workspace/briefing-premium-products-test.js +46 -43
- package/workspace/calm-timeline-test.js +190 -0
- package/workspace/changelog.json +24 -0
- package/workspace/ev-everywhere-test.js +3 -1
- package/workspace/guide/briefing-premium.md +3 -2
- package/workspace/guide/claude-proposes.md +16 -1
- package/workspace/guide/home.md +2 -2
- package/workspace/guide/index.md +1 -0
- package/workspace/guide/notes.md +39 -1
- package/workspace/guide/present-in-a-meeting.md +57 -0
- package/workspace/guide/programs.md +4 -3
- package/workspace/lib/board-premium.js +3 -1
- package/workspace/lib/briefing-premium-products.js +18 -4
- package/workspace/lib/chat-file-locate.js +40 -2
- package/workspace/lib/engine/boards.js +8 -2
- package/workspace/lib/idle-close.js +60 -0
- package/workspace/lib/loose-proposals.js +302 -0
- package/workspace/lib/meeting-focus.js +64 -14
- package/workspace/lib/my-work-premium.js +1 -1
- package/workspace/lib/proposal-runs.js +77 -2
- package/workspace/lib/propose-cli.js +42 -1
- package/workspace/lib/route-modules.js +1 -0
- package/workspace/lib/routes-boards.js +16 -4
- package/workspace/lib/routes-brief-page.js +9 -1
- package/workspace/lib/routes-briefing-premium.js +19 -0
- package/workspace/lib/routes-loose.js +210 -0
- package/workspace/lib/routes-meeting-focus.js +28 -6
- package/workspace/lib/routes-pm-items.js +27 -17
- package/workspace/lib/settings-store.js +2 -1
- package/workspace/lib/task-cli.js +18 -11
- package/workspace/milestone-pins-test.js +170 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-board-actions-test.js +2 -1
- package/workspace/premium-briefing-depth-test.js +2 -2
- package/workspace/premium-chat-term-test.js +13 -2
- package/workspace/premium-core-doc-issue-test.js +1 -1
- package/workspace/premium-rec-now-test.js +153 -0
- package/workspace/premium-rec-tab-test.js +167 -0
- package/workspace/product-lane-test.js +30 -17
- package/workspace/public/pm/bd-acts.js +6 -3
- package/workspace/public/pm/bd-deliveries.js +218 -0
- package/workspace/public/pm/bd-pin-card.css +16 -0
- package/workspace/public/pm/bd-pin-card.js +80 -0
- package/workspace/public/pm/bd-pins.js +33 -0
- package/workspace/public/pm/bd-pop.js +2 -0
- package/workspace/public/pm/bd-prog.js +5 -4
- package/workspace/public/pm/bd-span.js +140 -102
- package/workspace/public/pm/cozy-aud.css +9 -0
- package/workspace/public/pm/cozy-aud.js +80 -0
- package/workspace/public/pm/cozy-board.css +73 -11
- package/workspace/public/pm/cozy-home.css +16 -1
- package/workspace/public/pm/cozy-live-pill.js +3 -0
- package/workspace/public/pm/cozy-pick.css +41 -0
- package/workspace/public/pm/cozy-pick.js +134 -0
- package/workspace/public/pm/cozy-rec-bridge.js +32 -0
- package/workspace/public/pm/cozy-rec-now.css +104 -0
- package/workspace/public/pm/cozy-rec-now.js +330 -0
- package/workspace/public/pm/cozy-rec-present.css +69 -0
- package/workspace/public/pm/cozy-rec-present.js +467 -0
- package/workspace/public/pm/cozy-rec-tab.css +90 -0
- package/workspace/public/pm/cozy-rec-tab.js +219 -0
- package/workspace/public/pm/cozy-settings.js +8 -2
- package/workspace/public/pm/cozy-today.css +4 -0
- package/workspace/public/pm/home-app.js +51 -22
- package/workspace/public/pm/home-data.js +5 -3
- package/workspace/public/pm/home-list.js +63 -15
- package/workspace/public/pm/home-more.js +2 -31
- package/workspace/public/pm/home-today.js +19 -9
- package/workspace/public/pm/ini-tasks.js +4 -1
- package/workspace/public/pm/live-model.js +1 -1
- package/workspace/public/pm/loose-props.css +54 -0
- package/workspace/public/pm/loose-props.js +262 -0
- package/workspace/public/pm/premium-board.js +65 -30
- package/workspace/public/pm/premium-insights.js +42 -24
- package/workspace/public/pm/premium-meeting.js +17 -4
- package/workspace/public/pm/premium-mtg-present.js +4 -3
- package/workspace/public/pm/premium-report-read.js +2 -0
- package/workspace/public/pm/premium-vw-mtg.js +15 -7
- package/workspace/public/pm/rec-state.js +13 -5
- package/workspace/public/pm/rec-tab-core.js +92 -0
- package/workspace/public/pm/term-view.js +81 -10
- package/workspace/public/pm/view-notes.js +9 -0
- package/workspace/public/premium-aud.html +22 -0
- package/workspace/public/premium-board.html +2 -0
- package/workspace/public/premium-insights.html +2 -1
- package/workspace/public/premium-rec.html +30 -0
- package/workspace/public/premium.html +1 -0
- package/workspace/rec-present-test.js +229 -0
- package/workspace/server.js +116 -7
- package/workspace/skills/loose-propose.skill +39 -0
- package/workspace/task-milestones-test.js +15 -6
- package/workspace/test-lists/board-deliveries.json +13 -0
- package/workspace/test-lists/calm-timeline.json +5 -0
- package/workspace/test-lists/loose-props.json +9 -0
- package/workspace/test-lists/milestone-pins.json +6 -0
- package/workspace/test-lists/rec-now.json +6 -0
- package/workspace/test-lists/rec-present.json +13 -0
- package/workspace/test-lists/recording-tab.json +13 -0
- package/workspace/timeline-holds-test.js +44 -42
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
/* pm/cozy-rec-tab.js — the recording tab, /premium-rec.html?note=<id>&ws=<ws>[&go=1] (batch 12 item 1, slice S1; canvas In development,
|
|
2
|
+
* XrtA1Tab, XrtA7Room, XrtA6States, XrtA5PhoneRec).
|
|
3
|
+
*
|
|
4
|
+
* A meeting records in its own tab, named 'pmos-rec' (rec-tab-core.js). The tab holds the recorder (premium-meeting.js recCore) and
|
|
5
|
+
* never navigates away: its links open in the other PMOS tab, so Home, Board, Insights or a chat never pause the meeting. Only this tab
|
|
6
|
+
* controls the meeting; every other page shows a snippet, and a press on it brings this tab forward.
|
|
7
|
+
*
|
|
8
|
+
* Drawn here:
|
|
9
|
+
* header red dot, the meeting clock, the title; amber "Past 10:30 end" once the calendar end has passed. The tab's title is the clock.
|
|
10
|
+
* stage with a shared screen, a dark stage with the picture live; "Sharing stopped" with Share again when it ends. In the room
|
|
11
|
+
* (microphone only) there is no dark stage: the light page, which slice S2 (cozy-rec-now.js) fills. Paused and not yet
|
|
12
|
+
* started each say so, with the one press that goes on.
|
|
13
|
+
* line the meeting so far, with a mark for each highlight; hover or focus a mark for the moment: its time, the line, the shot.
|
|
14
|
+
* bar icon only: Highlight, Pause or Resume, Pause the screenshots (only with a screen), the slots, and the red Stop.
|
|
15
|
+
* alert amber "Not hearing the meeting" with Share again, when the microphone is heard and the meeting is not.
|
|
16
|
+
* ask Stop asks first. Record on the next meeting, pressed on another page, asks here once: "Stop X and record Y?".
|
|
17
|
+
* Stop ends the meeting, and the tab then shows its notes (the Viewer, /premium-viewer.html?open=meeting).
|
|
18
|
+
*
|
|
19
|
+
* Slots: S2 and S3 load here if their files exist (a missing file is ignored):
|
|
20
|
+
* cozy-rec-now.js mountNow({ stage, side, bar }, ctx) ctx = { ws, note(), mode(), on(evt, fn), focus(), event, rec }
|
|
21
|
+
* cozy-rec-present.js mountPresent({ stage, side, bar }, ctx) ctx = { ws, note: { id, title }, event, focus() }
|
|
22
|
+
* bar holds [data-slot="now"] and [data-slot="present"] for their buttons.
|
|
23
|
+
* Reads: GET /api/notes (recCore), /api/notes/one, /api/meeting-focus. Writes only through the recorder's presses. */
|
|
24
|
+
import { pmGet, pmPost } from './http.js';
|
|
25
|
+
import { recCore, STOP_LINE } from './premium-meeting.js';
|
|
26
|
+
import { post, listen, tabUrl, clockOf, modeOf, endOf, marksOf } from './rec-tab-core.js';
|
|
27
|
+
|
|
28
|
+
const q = new URLSearchParams(location.search);
|
|
29
|
+
const ID = q.get('note') || '', WS = q.get('ws') || '';
|
|
30
|
+
const C = recCore({ pmGet, pmPost, ws: () => WS || null });
|
|
31
|
+
const $ = (id) => document.getElementById(id);
|
|
32
|
+
const esc = (v) => String(v == null ? '' : v).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c]);
|
|
33
|
+
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; };
|
|
34
|
+
const pad = (n) => String(n).padStart(2, '0');
|
|
35
|
+
const wall = (ms) => { const d = new Date(ms); return pad(d.getHours()) + ':' + pad(d.getMinutes()); };
|
|
36
|
+
|
|
37
|
+
const P = { star: '<path d="M12 3.8l2.5 5.2 5.7.8-4.1 4 1 5.7L12 16.8l-5.1 2.7 1-5.7-4.1-4 5.7-.8z"/>', pause: '<path d="M9 6v12M15 6v12"/>', play: '<path d="M8 5v14l11-7z"/>',
|
|
38
|
+
stop: '<rect x="7" y="7" width="10" height="10" rx="2"/>', eyeoff: '<path d="M3 3l18 18M10.6 6.1A9.8 9.8 0 0 1 12 6c5 0 9 6 9 6a15 15 0 0 1-3 3.5M6.6 6.7C4.3 8.2 3 12 3 12s4 6 9 6a8.6 8.6 0 0 0 4.3-1.1M9.9 9.9a3 3 0 0 0 4.2 4.2"/>',
|
|
39
|
+
eye: '<path d="M3 12s4-6 9-6 9 6 9 6-4 6-9 6-9-6-9-6z"/><circle cx="12" cy="12" r="3"/>', share: '<rect x="3" y="4" width="18" height="12" rx="2"/><path d="M12 13V7M9 10l3-3 3 3M8 20h8"/>',
|
|
40
|
+
rec: '<circle cx="12" cy="12" r="6"/>' };
|
|
41
|
+
const svg = (k, w = 18) => `<svg aria-hidden="true" width="${w}" height="${w}" viewBox="0 0 24 24">${P[k]}</svg>`;
|
|
42
|
+
const btn = (a, label, icon, cls = '') => `<button type="button" class="rt-b${cls ? ' ' + cls : ''}" data-a="${a}" aria-label="${esc(label)}" title="${esc(label)}">${svg(icon, a === 'stop' ? 20 : 18)}</button>`;
|
|
43
|
+
|
|
44
|
+
const S = { row: null, one: null, focus: null, readAt: Date.now(), mode: 'idle', ask: null, msg: '', busy: false, video: null, on: { note: new Set(), mode: new Set(), tick: new Set() } };
|
|
45
|
+
const fire = (k, v) => { for (const fn of S.on[k]) { try { fn(v); } catch { /* the slot's own */ } } };
|
|
46
|
+
const note = () => (S.one && S.one.note) || null;
|
|
47
|
+
const title = () => clip((S.row && ((S.row.meeting && S.row.meeting.title) || S.row.title)) || (note() && note().title) || 'Meeting', 120);
|
|
48
|
+
const held = () => { const h = C.holding(); return !!(h && h.id === ID); };
|
|
49
|
+
const elapsed = () => { const r = S.row; if (!r) return 0; const ms = Number(r.meeting_ms) || 0; return r.state === 'recording' ? ms + Math.max(0, Date.now() - S.readAt) : ms; };
|
|
50
|
+
const eventOf = () => { const n = note(); const m = n && n.meeting; return m && m.kind === 'event' ? { id: m.event_id || '', title: m.title || '', series: (n.series && n.series.key) || '', date: m.start ? String(m.start).slice(0, 10) : '' } : null; };
|
|
51
|
+
|
|
52
|
+
/* ── drawing ───────────────────────────────────────────────────────────────────────────────────────────── */
|
|
53
|
+
function drawHead() {
|
|
54
|
+
const t = title(), past = endOf(note());
|
|
55
|
+
$('rtTitle').textContent = t;
|
|
56
|
+
const late = past && S.mode !== 'stopped' && Date.now() > past;
|
|
57
|
+
$('rt').classList.toggle('late', !!late);
|
|
58
|
+
$('rtPast').hidden = !late; if (late) $('rtPast').textContent = 'Past ' + wall(past) + ' end';
|
|
59
|
+
tick();
|
|
60
|
+
}
|
|
61
|
+
function tick() {
|
|
62
|
+
const c = clockOf(elapsed());
|
|
63
|
+
$('rtClock').textContent = c;
|
|
64
|
+
document.title = (S.mode === 'paused' ? 'Paused · ' : '') + c + ' · ' + title();
|
|
65
|
+
fire('tick', elapsed());
|
|
66
|
+
}
|
|
67
|
+
function drawBar() {
|
|
68
|
+
const bar = $('rtBar'), keep = { now: bar.querySelector('[data-slot="now"]'), present: bar.querySelector('[data-slot="present"]') };
|
|
69
|
+
const live = S.mode === 'screen' || S.mode === 'room', scr = C.screen();
|
|
70
|
+
const parts = [];
|
|
71
|
+
if (live) parts.push(btn('hl', 'Highlight the last 30 seconds', 'star'), btn('pause', 'Pause', 'pause'));
|
|
72
|
+
else if (S.mode === 'paused') parts.push(btn('resume', 'Resume', 'play', 'dark'));
|
|
73
|
+
if (S.mode === 'screen') parts.push(scr.paused ? btn('shots', 'Keep screenshots again', 'eye', 'on') : btn('shots', 'Pause the screenshots (the sound goes on)', 'eyeoff'));
|
|
74
|
+
bar.innerHTML = parts.join('');
|
|
75
|
+
for (const k of ['now', 'present']) { const s = keep[k] || Object.assign(document.createElement('span'), { className: 'rt-slot' }); s.dataset.slot = k; bar.appendChild(s); }
|
|
76
|
+
if (live || S.mode === 'paused') bar.insertAdjacentHTML('beforeend', btn('stop', 'Stop the recording', 'stop', 'red'));
|
|
77
|
+
bar.hidden = !(live || S.mode === 'paused');
|
|
78
|
+
}
|
|
79
|
+
function drawStage() {
|
|
80
|
+
const st = $('rtStage');
|
|
81
|
+
const mine = st.querySelector(':scope > .rt-own');
|
|
82
|
+
const own = mine || Object.assign(document.createElement('div'), { className: 'rt-own' });
|
|
83
|
+
if (!mine) st.prepend(own);
|
|
84
|
+
$('rt').dataset.mode = S.mode;
|
|
85
|
+
const scr = C.screen();
|
|
86
|
+
if (S.mode === 'screen') {
|
|
87
|
+
if (scr.track) {
|
|
88
|
+
if (!S.video || S.video.dataset.track !== scr.track.id) {
|
|
89
|
+
own.innerHTML = '<div class="rt-scr"><video muted playsinline autoplay aria-label="The shared screen, live"></video></div>';
|
|
90
|
+
S.video = own.querySelector('video'); S.video.dataset.track = scr.track.id;
|
|
91
|
+
try { S.video.srcObject = new MediaStream([scr.track]); S.video.play().catch(() => {}); } catch { /* no picture */ }
|
|
92
|
+
}
|
|
93
|
+
} else { S.video = null; own.innerHTML = `<div class="rt-scr off"><p>Sharing stopped</p>${btn('share', 'Share again', 'share', 'dark')}</div>`; }
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
S.video = null;
|
|
97
|
+
if (S.mode === 'room') { own.innerHTML = ''; return; }
|
|
98
|
+
if (S.mode === 'paused') {
|
|
99
|
+
const left = S.row && S.row.resume_until ? Math.max(1, Math.ceil((Date.parse(S.row.resume_until) - Date.now()) / 60000)) : null;
|
|
100
|
+
own.innerHTML = `<div class="rt-wait"><h2>Paused</h2><p>Nothing is kept until you resume${left ? '. ' + left + (left === 1 ? ' minute' : ' minutes') + ' left to resume' : ''}.</p></div>`; return;
|
|
101
|
+
}
|
|
102
|
+
if (S.mode === 'idle') { own.innerHTML = `<div class="rt-wait"><h2>${esc(title())}</h2><p>${esc(S.msg || (S.row && S.row.state === 'recording' ? 'Recording in another tab.' : 'Not recording yet.'))}</p>${S.row && S.row.state !== 'recording' ? btn('start', 'Start recording', 'rec', 'red big') : ''}</div>`; return; }
|
|
103
|
+
own.innerHTML = '<div class="rt-wait"><h2>Stopped</h2><p>The notes are being written.</p></div>';
|
|
104
|
+
}
|
|
105
|
+
function drawLine() {
|
|
106
|
+
const line = $('rtLine');
|
|
107
|
+
const len = Math.max(elapsed(), endOf(note()) && note().recorded_from ? endOf(note()) - Date.parse(note().recorded_from) : 0, 1);
|
|
108
|
+
const marks = marksOf(note(), S.one && S.one.screen && S.one.screen.frames, len);
|
|
109
|
+
const now = Math.min(1, elapsed() / len);
|
|
110
|
+
line.hidden = !(S.mode === 'screen' || S.mode === 'room' || S.mode === 'paused');
|
|
111
|
+
line.style.setProperty('--rt-now', (now * 100).toFixed(2) + '%');
|
|
112
|
+
line.innerHTML = '<span class="rt-track" aria-hidden="true"></span><span class="rt-nowmark" aria-hidden="true"></span>' + marks.map((m) => `<span class="rt-mk" style="--rt-x:${(m.x * 100).toFixed(2)}%">`
|
|
113
|
+
+ `<button type="button" class="rt-star" aria-label="Highlight at ${esc(clockOf(m.t))}${m.text ? ': ' + esc(m.text) : ''}">${svg('star', 12)}</button>`
|
|
114
|
+
+ `<span class="rt-hv" role="tooltip"><b>${esc(clockOf(m.t))}</b>${m.text ? `<span>${esc(m.text)}</span>` : ''}${m.shot != null ? `<img alt="" loading="lazy" src="/api/notes/screen?id=${encodeURIComponent(ID)}&t=${m.shot}">` : ''}</span></span>`).join('');
|
|
115
|
+
}
|
|
116
|
+
function drawAlert() {
|
|
117
|
+
const scr = C.screen(), a = $('rtAlert');
|
|
118
|
+
const silent = (S.mode === 'screen' || S.mode === 'room') && scr.silent;
|
|
119
|
+
a.hidden = !silent;
|
|
120
|
+
if (silent) a.innerHTML = `<span>Not hearing the meeting</span>${btn('share', 'Share the meeting again', 'share')}`;
|
|
121
|
+
}
|
|
122
|
+
function drawAsk() {
|
|
123
|
+
const k = $('rtAsk');
|
|
124
|
+
if (!S.ask) { k.hidden = true; k.innerHTML = ''; return; }
|
|
125
|
+
k.hidden = false;
|
|
126
|
+
k.innerHTML = S.ask.kind === 'stop'
|
|
127
|
+
? `<div class="rt-askc" role="alertdialog" aria-label="Stop the recording?"><b>Stop the recording?</b><p>${esc(STOP_LINE)}</p><div class="rt-acts"><button type="button" class="rt-t" data-a="askno">Keep recording</button><button type="button" class="rt-t red" data-a="stopgo">Stop</button></div></div>`
|
|
128
|
+
: `<div class="rt-askc" role="alertdialog" aria-label="Switch meetings?"><b>Stop ${esc(title())} and record ${esc(S.ask.title)}?</b><div class="rt-acts"><button type="button" class="rt-t" data-a="askno">Keep recording</button><button type="button" class="rt-t blue" data-a="switchgo">Switch</button></div></div>`;
|
|
129
|
+
const f = k.querySelector('[data-a="askno"]'); if (f) f.focus();
|
|
130
|
+
}
|
|
131
|
+
function draw() {
|
|
132
|
+
const m = modeOf(S.row, held(), C.screen());
|
|
133
|
+
if (m !== S.mode) { S.mode = m; fire('mode', m); }
|
|
134
|
+
if (S.mode === 'stopped' && !S.ask) { location.replace('/premium-viewer.html?open=meeting¬e=' + encodeURIComponent(ID) + (WS ? '&ws=' + encodeURIComponent(WS) : '')); return; }
|
|
135
|
+
drawHead(); drawStage(); drawBar(); drawLine(); drawAlert();
|
|
136
|
+
const say = $('rtMsg'); say.textContent = S.msg && S.mode !== 'idle' ? S.msg : ''; say.hidden = !say.textContent;
|
|
137
|
+
beat();
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/* ── the state other tabs read ─────────────────────────────────────────────────────────────────────────── */
|
|
141
|
+
let lastBeat = '';
|
|
142
|
+
function beat(force) {
|
|
143
|
+
const st = S.mode === 'paused' ? 'paused' : S.mode === 'screen' || S.mode === 'room' ? 'recording' : S.mode === 'stopped' ? 'ended' : 'idle';
|
|
144
|
+
const b = { id: ID, state: st, title: title(), elapsedMs: elapsed(), silent: !!C.screen().silent };
|
|
145
|
+
const key = b.state + '|' + b.title + '|' + b.silent;
|
|
146
|
+
if (force || key !== lastBeat) { lastBeat = key; post(b); }
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/* ── reading ───────────────────────────────────────────────────────────────────────────────────────────── */
|
|
150
|
+
async function read() {
|
|
151
|
+
const [rows, one] = await Promise.all([C.refresh(), pmGet('/api/notes/one?id=' + encodeURIComponent(ID))]);
|
|
152
|
+
S.readAt = Date.now();
|
|
153
|
+
S.row = (rows || []).find((n) => n.id === ID) || (one && one.ok && one.note ? { ...one.note, id: ID } : null);
|
|
154
|
+
if (one && one.ok) S.one = one;
|
|
155
|
+
fire('note', S.one);
|
|
156
|
+
draw();
|
|
157
|
+
}
|
|
158
|
+
async function readFocus() {
|
|
159
|
+
const e = eventOf(), qs = e && e.id ? 'event=' + encodeURIComponent(e.id) + '&date=' + encodeURIComponent(e.date) : 'note=' + encodeURIComponent(ID);
|
|
160
|
+
const F = await pmGet('/api/meeting-focus?' + qs + (WS ? '&ws=' + encodeURIComponent(WS) : ''));
|
|
161
|
+
S.focus = F && F.ok !== false ? F : S.focus;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/* ── the presses ───────────────────────────────────────────────────────────────────────────────────────── */
|
|
165
|
+
async function act(a, t) {
|
|
166
|
+
if (S.busy && a !== 'askno') return;
|
|
167
|
+
const run = async (fn) => { S.busy = true; if (t) t.disabled = true; try { await fn(); } finally { S.busy = false; await read(); } };
|
|
168
|
+
switch (a) {
|
|
169
|
+
case 'hl': { const r = await C.highlight(); S.msg = r.ok ? 'Keeping the last 30 seconds and the next ones as a highlight.' : r.error; return draw(); }
|
|
170
|
+
case 'pause': return run(async () => { const r = await C.pause(); S.msg = r.ok ? '' : r.error; });
|
|
171
|
+
case 'resume': case 'start': return run(async () => { const r = await C.resume(ID); S.msg = r.ok ? '' : r.error; });
|
|
172
|
+
case 'share': return run(async () => { await C.pause(); const r = await C.resume(ID); S.msg = r.ok ? '' : r.error; });
|
|
173
|
+
case 'shots': { C.shots(!C.screen().paused); return draw(); }
|
|
174
|
+
case 'stop': S.ask = { kind: 'stop' }; return drawAsk();
|
|
175
|
+
case 'askno': S.ask = null; drawAsk(); return draw();
|
|
176
|
+
case 'stopgo': S.ask = null; drawAsk(); return run(async () => { const r = await C.stop(ID); S.msg = r.ok ? '' : r.error; });
|
|
177
|
+
case 'switchgo': {
|
|
178
|
+
const to = S.ask && S.ask.body; S.ask = null; drawAsk();
|
|
179
|
+
return run(async () => {
|
|
180
|
+
const r = await C.stop(ID); if (!r.ok) { S.msg = r.error; return; }
|
|
181
|
+
const made = await pmPost('/api/notes/new', to);
|
|
182
|
+
if (made && made.ok) location.replace(tabUrl(made.note.id, { ws: WS, go: true }));
|
|
183
|
+
else S.msg = (made && made.error) || 'The next meeting\'s note was not made.';
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
default:
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
document.addEventListener('click', (e) => { const t = e.target.closest('[data-a]'); if (t && !t.disabled && t.closest('#rt')) act(t.dataset.a, t); });
|
|
190
|
+
document.addEventListener('keydown', (e) => { if (e.key === 'Escape' && S.ask) { S.ask = null; drawAsk(); } });
|
|
191
|
+
|
|
192
|
+
/* Record on the next meeting, pressed on another page while this one records: ask here once (rec-tab-core.js asks over the channel) */
|
|
193
|
+
listen((d) => { if (d.id === ID && d.switchTo && d.switchTo.body) { S.ask = { kind: 'switch', title: clip(d.switchTo.title || 'the next meeting', 80), body: d.switchTo.body }; drawAsk(); } });
|
|
194
|
+
|
|
195
|
+
/* ── the slots: S2 (Now panel) and S3 (Present) mount here when their files are on the page ─────────────────── */
|
|
196
|
+
const slots = () => ({ stage: $('rtStage'), side: $('rtSide'), bar: $('rtBar') });
|
|
197
|
+
function mountSlots() {
|
|
198
|
+
drawBar();
|
|
199
|
+
import('./cozy-rec-now.js').then((M) => M.mountNow && M.mountNow(slots(), { ws: WS, note: () => S.one, mode: () => S.mode, on: (k, fn) => { if (S.on[k]) { S.on[k].add(fn); return () => S.on[k].delete(fn); } return () => {}; },
|
|
200
|
+
focus: () => S.focus, event: eventOf(), rec: C })).catch(() => {});
|
|
201
|
+
import('./cozy-rec-present.js').then((M) => M.mountPresent && M.mountPresent(slots(), { ws: WS, note: { id: ID, title: title() }, event: eventOf(), focus: () => S.focus })).catch(() => {});
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
if (!ID) { $('rtTitle').textContent = 'No meeting'; $('rtMsg').textContent = 'This tab names no meeting. Open a meeting and press Record.'; $('rtMsg').hidden = false; }
|
|
205
|
+
else {
|
|
206
|
+
window.addEventListener('premium-rec', () => { if (!S.busy) draw(); });
|
|
207
|
+
addEventListener('pagehide', () => post({ id: ID, state: 'paused', title: title(), elapsedMs: elapsed(), silent: false }));
|
|
208
|
+
read().then(async () => {
|
|
209
|
+
await readFocus(); mountSlots();
|
|
210
|
+
// opened by Record on another page: listen now; the Listen sheet's press here gives the share its permission
|
|
211
|
+
if (q.get('go') === '1') {
|
|
212
|
+
history.replaceState(null, '', tabUrl(ID, { ws: WS }));
|
|
213
|
+
if (S.row && S.row.state !== 'recording' && S.row.state !== 'ended') act('start');
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
setInterval(() => { if (!S.busy) { tick(); drawAlert(); drawLine(); beat(); } }, 1000); // beat(): a change (Not hearing the meeting) reaches the snippets within a second
|
|
217
|
+
setInterval(() => { if (!S.busy) read(); beat(true); }, 5000);
|
|
218
|
+
setInterval(readFocus, 15000);
|
|
219
|
+
}
|
|
@@ -46,7 +46,7 @@ function general() {
|
|
|
46
46
|
const upd = ready() ? `<div class="ev-card ev-upd"><span class="ev-pill y">Update</span><p><b>PMOS ${esc(latest())} is ready.</b> <span class="ev-mut">${esc(firstLine())}</span></p><button type="button" class="ev-btn sm" data-ev-go="whatsnew">What's new</button><button type="button" class="ev-btn sm dark" data-ev-upd="update">${appBehind() ? 'Restart to update' : 'Update'}</button></div>` : '';
|
|
47
47
|
return trow('Theme', 'Auto follows your computer', seg('Theme', 'theme', theme, [['light', 'Light'], ['dark', 'Dark'], ['auto', 'Auto']]))
|
|
48
48
|
+ trow('Viewer opens as', 'A column beside the chat, or a popup over it', seg('Viewer opens as', 'viewer', vw, [['column', 'Column'], ['popup', 'Popup']]))
|
|
49
|
-
+ trow('Product', 'Which products Home, Board and Insights read', `<button type="button" class="ev-pick" data-ev-products aria-haspopup="
|
|
49
|
+
+ trow('Product', 'Which products Home, Board and Insights read', `<button type="button" class="ev-pick" data-ev-products aria-haspopup="menu">${esc(pname)} ${svg(ICON.down, 14)}</button>`)
|
|
50
50
|
+ trow('Your day', 'When the end-of-day card shows', `<label class="ev-vh" for="evDay">Your day ends at</label><select id="evDay" class="ev-inp" data-ev-day>${hours.map((h) => `<option value="${h}"${h === end ? ' selected' : ''}>${pad(h)}:00</option>`).join('')}</select>`)
|
|
51
51
|
+ trow('Agents write to Jira', 'Only after you press Commit. Never on their own.', '<span class="ev-pill ok">Fixed</span>')
|
|
52
52
|
+ upd;
|
|
@@ -122,7 +122,13 @@ async function press(e) {
|
|
|
122
122
|
if (t.dataset.evGo) { T.sec = t.dataset.evGo; draw(); return; }
|
|
123
123
|
if (t.dataset.evSeg === 'theme') { const M = await import('./cozy-nav.js'); M.setTheme(t.dataset.v); draw(); return; }
|
|
124
124
|
if (t.dataset.evSeg === 'viewer') { store.set(VIEWER_KEY, t.dataset.v); document.body.classList.toggle('ev-vw-popup', t.dataset.v === 'popup'); draw(); return; }
|
|
125
|
-
|
|
125
|
+
// the one product pick (batch 12 item 5): the same list as the chip on Home, Board and Insights, under this row
|
|
126
|
+
if ('evProducts' in t.dataset) {
|
|
127
|
+
const PP = await import('./cozy-pick.js'), P = await PP.readPick();
|
|
128
|
+
if (!P) { T.msg = 'The products could not be read.'; draw(); return; }
|
|
129
|
+
PP.openPicker(t, { P, label: 'Products', onApply: async (on) => { const r = await PP.savePick(on); if (!r.ok) { T.msg = r.error; draw(); return; } T.prods = r.products; draw(); } });
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
126
132
|
if (T.busy) return;
|
|
127
133
|
T.busy = true; T.msg = '';
|
|
128
134
|
try {
|
|
@@ -380,6 +380,10 @@ body.cz-home .hv-r.two .hm-rt b { font-size: 15px; }
|
|
|
380
380
|
.hv-tk .hv-mt { margin-left: 2px; }
|
|
381
381
|
.hv-spp { position: absolute; z-index: 20; top: calc(100% - 4px); right: 8px; width: min(340px, calc(100% - 16px)); background: var(--cz-card); border-radius: 18px; padding: 6px; box-shadow: 0 24px 50px -20px rgba(42,46,53,.4), 0 0 0 1px var(--cz-hair); box-sizing: border-box; }
|
|
382
382
|
.hv-spp .hv-r::before, .hv-sps .hv-r::before { display: none; }
|
|
383
|
+
/* batch 13 item 7 (canvas XcsA1Pill): a session idle and safe to close, light blue with the ✦ in its line and one ✓ */
|
|
384
|
+
.hv-spp .hv-r.safe, .hv-sps .hv-r.safe { background: var(--cz-bluebg); border-radius: 14px; }
|
|
385
|
+
.hv-r .hm-sv { font-style: normal; color: var(--cz-blueink); margin-right: 4px; }
|
|
386
|
+
.hv-r .hm-cls { color: var(--cz-blueink); background: var(--cz-card); align-self: center; flex: none; }
|
|
383
387
|
.hv-spf { display: flex; padding: 2px 2px 0; margin-top: 4px; border-top: 1px solid var(--cz-hair); }
|
|
384
388
|
body.cz-home .hv-r.sp-on { background: var(--cz-well2); z-index: 5; }
|
|
385
389
|
body.cz-home .hv-r.sp-on + .hv-r::before { display: none; }
|
|
@@ -16,11 +16,13 @@
|
|
|
16
16
|
* press (pmPost). Nothing here opens the old dialog or links to the console. */
|
|
17
17
|
import { mountNav } from './cozy-nav.js';
|
|
18
18
|
import { mountLivePill } from './cozy-live-pill.js';
|
|
19
|
+
import { ownTab, bring, tabUrl } from './rec-tab-core.js';
|
|
19
20
|
import * as VW from './cozy-viewer.js';
|
|
20
21
|
import { pmGet, pmPost, pmHeaders } from './http.js';
|
|
21
22
|
import * as H from './home-data.js';
|
|
22
23
|
import { mountChat, avHtml } from './home-chat.js';
|
|
23
24
|
import * as MORE from './home-more.js';
|
|
25
|
+
import * as PP from './cozy-pick.js'; // the one product picker Home, Board and Insights share (batch 12 item 5)
|
|
24
26
|
import { headModel, STEPS } from './premium-initiative-head.js';
|
|
25
27
|
import * as SC from './home-stage-card.js'; // the initiative's stage card D
|
|
26
28
|
import * as WFM from './ini-wf-model.js'; // D99: the workflow an initiative runs (kind line, usual days)
|
|
@@ -43,6 +45,7 @@ import { mountSesName } from './home-ses-name.js'; // session names A: tap the
|
|
|
43
45
|
import * as SM from './split-merge.js'; // split one initiative in two, or merge two: Claude suggests, the PM approves (batch 11 item 14)
|
|
44
46
|
import * as PM from './prog-move.js'; // move an initiative out of its program, or to another (canvas LpA1More, LpA2Other, LpA4Phone)
|
|
45
47
|
import * as PO from './prog-order.js'; // a program's order on Home: the grip, hold-then-drag on a phone, ✦ Claude's order from the dates (canvas RoAPhone)
|
|
48
|
+
import * as LPV from './loose-props.js'; // Claude's clean-up of "Not in an initiative": the ✦ on its header and the Viewer (batch 13 item 3)
|
|
46
49
|
import { initiativeRename, taskRename } from './rename-press.js'; // tap the title to rename (canvas RnATask, RnASaved) // the pinned recording row above it (XvARecHome)
|
|
47
50
|
|
|
48
51
|
const $ = (s, r = document) => r.querySelector(s);
|
|
@@ -93,8 +96,9 @@ const S = {
|
|
|
93
96
|
iniWs: {}, // another product's initiative found by a read (loadIni), by id: the workspace it was found in
|
|
94
97
|
doneOpen: false, stepsMore: false, sheet: false, rec: {}, pin: new Set(JSON.parse(store.get('pmos.home.pin') || '[]')),
|
|
95
98
|
cardFold: store.get('pmos.home.cardfold') === '1', // the card's checklist folded to one line (AgInitSpec), kept in this browser
|
|
96
|
-
// the one list (premium-uncovered-features): the filter,
|
|
97
|
-
|
|
99
|
+
// the one list (premium-uncovered-features): the filter, which groups and initiatives are open, kept in this browser. The products shown are
|
|
100
|
+
// the one saved pick (S.D.pick, GET /api/briefing-premium/products), never kept here (batch 12 item 5)
|
|
101
|
+
filter: 'today', kidsOff: new Set(), rest: new Set(), cap: false, day: false, ses: null,
|
|
98
102
|
pg: (() => { try { return JSON.parse(store.get('pmos.home.pg') || '{}') || {}; } catch { return {}; } })(),
|
|
99
103
|
eodHidden: store.get('pmos.home.eod') === L.dayOf(), phoneChat: false,
|
|
100
104
|
};
|
|
@@ -110,6 +114,14 @@ function toastUndo(msg, undo) {
|
|
|
110
114
|
el.querySelector('.undo').onclick = async () => { el.classList.remove('on', 'act'); const r = await undo(); if (r && r.ok === false) toast(r.error || 'It could not be undone.'); };
|
|
111
115
|
clearTimeout(toast.t); toast.t = setTimeout(() => el.classList.remove('on', 'act'), 8000);
|
|
112
116
|
}
|
|
117
|
+
/** What Claude's clean-up needs from Home (pm/loose-props.js): the toast with Undo, a fresh read, the product a new initiative starts in,
|
|
118
|
+
* the rows the group shows, and today. */
|
|
119
|
+
const lpHost = {
|
|
120
|
+
toast: (m, undo) => (undo ? toastUndo(m, undo) : toast(m)), reload: () => load(), redraw: () => drawList(),
|
|
121
|
+
where: () => ({ ws: boardWs(), board: boardId() }),
|
|
122
|
+
total: () => { const g = S.M && S.M.groups.find((x) => x.kind === 'loose'); return g ? g.n : 0; },
|
|
123
|
+
today: () => L.dayOf(),
|
|
124
|
+
};
|
|
113
125
|
/** A rename landed (or its Undo did): every place that names it reads the new name now, and the server's read follows. */
|
|
114
126
|
function renamedHere(kind, id, title) {
|
|
115
127
|
if (kind === 'task') for (const t of ((S.D.items && S.D.items.items) || [])) { if (t && t.uid === id) t.title = title; }
|
|
@@ -144,10 +156,10 @@ async function getRetry(path, tries = 20) {
|
|
|
144
156
|
return { ok: false, error: 'still reading' };
|
|
145
157
|
}
|
|
146
158
|
async function load() {
|
|
147
|
-
const [brief, board, ses, desk, today, sch, work, day, rev, progs] = await Promise.all([
|
|
159
|
+
const [brief, board, ses, desk, today, sch, work, day, rev, progs, , pick] = await Promise.all([
|
|
148
160
|
getRetry('/api/briefing-premium' + wsQ()), getRetry('/api/board-premium' + wsQ() + boardQ(WS ? '&' : '?')), pmGet('/api/sessions'), pmGet('/api/home-desk' + wsQ()),
|
|
149
161
|
pmGet('/api/brief-page' + wsQ()), pmGet('/api/schedules' + wsQ()), pmGet('/api/my-work-premium' + wsQ()), pmGet('/api/phone-day'), pmGet('/api/home-review' + wsQ()),
|
|
150
|
-
pmGet('/api/programs'), MEN.load(menCtx()),
|
|
162
|
+
pmGet('/api/programs'), MEN.load(menCtx()), PP.readPick(),
|
|
151
163
|
]);
|
|
152
164
|
const D = S.D;
|
|
153
165
|
D.brief = brief && brief.ok && brief.model ? brief.model : null;
|
|
@@ -160,6 +172,8 @@ async function load() {
|
|
|
160
172
|
D.phoneDay = day && day.ok ? day : null; // what finished today, the recap and tomorrow (the end-of-day card, the Done filter)
|
|
161
173
|
D.review = rev && rev.ok ? rev : null; // this week's review (GET /api/home-review)
|
|
162
174
|
D.programs = progs && progs.ok ? progs.programs : []; // programs above initiatives, across products (GET /api/programs)
|
|
175
|
+
D.pick = pick || D.pick || null; // the one product pick (the chip): which products are on Home and read
|
|
176
|
+
if (D.pick && WS) D.pick = { ...D.pick, products: D.pick.products.map((p) => ({ ...p, on: p.ws === WS })) }; // ?ws= is a one-off view of that product
|
|
163
177
|
D.now = Date.now();
|
|
164
178
|
D.err = [brief, board].filter((x) => !x || !x.ok).map((x) => (x && x.error) || 'the server did not answer');
|
|
165
179
|
const rows = H.boardRows(D);
|
|
@@ -180,6 +194,8 @@ async function load() {
|
|
|
180
194
|
const others = await Promise.all(otherProducts(D).map((a) => getRetry('/api/board-premium?ws=' + encodeURIComponent(a.ws), 4).then((r) => (r && r.ok && r.model ? { ws: a.ws, name: a.name, model: r.model } : null))));
|
|
181
195
|
const got = others.filter(Boolean);
|
|
182
196
|
if (got.length || D.others.length) { D.others = got; drawList(); }
|
|
197
|
+
// what "Not in an initiative" shows goes to the server, so Claude's clean-up reads the same rows; the ✦ comes back (batch 13 item 3)
|
|
198
|
+
if (S.M && S.filter === 'today') LPV.sync(S.M, S.D, lpHost).catch(() => {});
|
|
183
199
|
// an initiative of another product opened before its board was read (a link, a quick press): read it again from its own board
|
|
184
200
|
if (S.ini && !S.IM && otherIni(S.ini)) goIni(S.ini, { page: VW.isOpen() });
|
|
185
201
|
}
|
|
@@ -264,14 +280,15 @@ function todayModel() {
|
|
|
264
280
|
return T;
|
|
265
281
|
}
|
|
266
282
|
function homeListHtml() {
|
|
267
|
-
const M = L.homeList(S.D, { now: NOW(), filter: S.filter
|
|
283
|
+
const M = L.homeList(S.D, { now: NOW(), filter: S.filter });
|
|
268
284
|
S.M = M;
|
|
285
|
+
const lg = M.groups.find((g) => g.kind === 'loose'); if (lg) lg.chip = LPV.chipOf();
|
|
269
286
|
const R = L.reviewModel(S.D, NOW());
|
|
270
287
|
// a group is open until the PM folds it; another product starts folded; "Not in an initiative" starts folded on a phone (HvAC, HvACDesk)
|
|
271
|
-
const pOpen = (g) => (g.key in S.pg ? !!S.pg[g.key] : g.kind === 'loose' ? !isPhone() : g.kind === 'program' || g.primary || M.products.length === 1
|
|
288
|
+
const pOpen = (g) => (g.key in S.pg ? !!S.pg[g.key] : g.kind === 'loose' ? !isPhone() : g.kind === 'program' || g.primary || M.products.length === 1);
|
|
272
289
|
return TD.listHtml(M, todayModel(), {
|
|
273
290
|
sel: S.sel || (S.ini && S.ini !== 'product' ? 'i:' + S.ini : null), selHead: S.head, ses: S.ses, pOpen, restOpen: (k) => S.rest.has(k), cap: S.cap, pin: S.pin, avHtml, ready: S.ready, err: S.D.err.length ? S.D.err[0] : '',
|
|
274
|
-
|
|
291
|
+
pick: S.D.pick, tones: pickTones(), review: R, mic: canDictate(), phone: isPhone(), day: S.day, top: S.ready ? RECROW.html() + MEN.rowHtml(S.D, { sel: S.sel }) : '',
|
|
275
292
|
});
|
|
276
293
|
}
|
|
277
294
|
/** Your day (XvAPhDay, was the HvAOpen sheet): "Good morning" opens it in the Viewer, shell A. Full screen on a phone, beside the chat on a
|
|
@@ -927,19 +944,28 @@ async function checkRow(id) {
|
|
|
927
944
|
toast('Done.');
|
|
928
945
|
await load();
|
|
929
946
|
}
|
|
930
|
-
/* the
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
const
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
947
|
+
/* the product picker (batch 12 item 5, canvas XhpA1Desk): the one list Home, Board and Insights share (pm/cozy-pick.js). Every registered
|
|
948
|
+
* product with its tile, name and one quiet line; the ticks apply when the list closes, and are saved for every page */
|
|
949
|
+
function pickTones() {
|
|
950
|
+
const P = S.D.pick; if (!P) return null;
|
|
951
|
+
// the tints Home's groups use: the board's own product first, then the registered order (home-list.js productsOf)
|
|
952
|
+
const own = ((S.D.board && S.D.board.board) || {}).ws || '';
|
|
953
|
+
return PP.tonesOf(P.products.map((p) => ({ ...p, primary: own ? p.ws === own : p.primary })));
|
|
954
|
+
}
|
|
955
|
+
function pickLine(ws) {
|
|
956
|
+
const M = S.M; if (!M) return '';
|
|
957
|
+
const p = M.products.find((x) => x.ws === ws); if (!p) return '';
|
|
958
|
+
const g = M.groups.find((x) => x.product && x.product.key === p.key);
|
|
959
|
+
const n = g ? g.count : ((p.model && p.model.initiatives && p.model.initiatives.list && p.model.initiatives.list.rows) || []).filter(H.OPEN).length;
|
|
960
|
+
// zero is silence: a part that is zero is left out
|
|
961
|
+
return [n ? n + (n === 1 ? ' initiative' : ' initiatives') : '', p.goals && p.goals.n ? p.goals.ok + ' of ' + p.goals.n + ' goals' : ''].filter(Boolean).join(' · ');
|
|
962
|
+
}
|
|
963
|
+
function pickProduct(chip) {
|
|
964
|
+
if (!S.D.pick) return;
|
|
965
|
+
PP.openPicker(chip, { P: S.D.pick, label: 'Products on Home', tones: pickTones(), lines: pickLine, onApply: async (on) => { const r = await PP.savePick(on); if (!r.ok) toast(r.error); } });
|
|
966
|
+
}
|
|
967
|
+
// a saved pick (from this chip or Settings): Home shows and reads the ticked products
|
|
968
|
+
addEventListener('pp:changed', (e) => { if (WS) { location.assign('/premium.html'); return; } S.D.pick = e.detail; drawList(); toast('Saved. Home, Board and Insights show the products you picked.'); load(); });
|
|
943
969
|
|
|
944
970
|
/* ── the Viewer: needs rows, the weekly update, the overview, files, people, routines ── */
|
|
945
971
|
let lastViewer = null;
|
|
@@ -1396,7 +1422,7 @@ document.addEventListener('keydown', (e) => { if (e.key === 'Escape' && !menuEl.
|
|
|
1396
1422
|
function moreMenu(anchor) {
|
|
1397
1423
|
const go = {
|
|
1398
1424
|
around: () => MORE.openAround(), inbox: () => MORE.openInbox(searchGo), eod: () => MORE.openEndOfDay(), cal: () => openCalendar(),
|
|
1399
|
-
rec: () => MORE.openRecorder(), search: () => MORE.openSearch(searchGo),
|
|
1425
|
+
rec: () => MORE.openRecorder(), search: () => MORE.openSearch(searchGo), sources: () => MORE.openSources(), settings: () => MORE.openSettings(),
|
|
1400
1426
|
};
|
|
1401
1427
|
menu(anchor, MORE.moreItems.map(([k, l]) => ({ label: l, go: go[k] })), 'Waiting for design');
|
|
1402
1428
|
}
|
|
@@ -1443,6 +1469,8 @@ $('#hmList').onclick = (e) => { // delegated: every press on the list is a <bu
|
|
|
1443
1469
|
if (b.getAttribute('aria-expanded') === 'true') { S.kids.delete(d.hmKids); S.kidsOff.add(d.hmKids); } else { S.kids.add(d.hmKids); S.kidsOff.delete(d.hmKids); }
|
|
1444
1470
|
keepKids(); drawList(); const f = $(`#hmList [data-hm-kids="${CSS.escape(d.hmKids)}"]`); if (f) f.focus(); return;
|
|
1445
1471
|
}
|
|
1472
|
+
if ('lpOpen' in d) { LPV.open(lpHost); return; }
|
|
1473
|
+
if (d.hmClose) { LPV.closeOne(lpHost, d.hmClose); return; } // the pill menu's ✓: close a session Claude says is idle and safe (batch 13 item 7)
|
|
1446
1474
|
if (d.hmPg) { const open = b.getAttribute('aria-expanded') === 'true'; S.pg[d.hmPg] = !open; store.set('pmos.home.pg', JSON.stringify(S.pg)); drawList(); const f = $(`#hmList [data-hm-pg="${CSS.escape(d.hmPg)}"]`); if (f) f.focus(); return; }
|
|
1447
1475
|
if ('hmProd' in d) { goIni('product'); return; }
|
|
1448
1476
|
if (d.hmRest) { if (S.rest.has(d.hmRest)) S.rest.delete(d.hmRest); else S.rest.add(d.hmRest); keepKids(); drawList(); return; }
|
|
@@ -1460,7 +1488,8 @@ $('#hmList').onclick = (e) => { // delegated: every press on the list is a <bu
|
|
|
1460
1488
|
if ('hmMeet' in d) { const m = H.meetLineOf(S.D.today); if (m) openMeeting(m.meeting); return; }
|
|
1461
1489
|
if ('hmCal' in d) { openCalendar(); return; }
|
|
1462
1490
|
if ('hmRec' in d) { MORE.openRecorder().then(() => drawList()); return; }
|
|
1463
|
-
|
|
1491
|
+
// the pinned row is a snippet: a press brings the recording tab forward (rec-tab-core.js); where it cannot open, the meeting opens here
|
|
1492
|
+
if (d.hmRecopen) { if (!(ownTab() && bring(tabUrl(d.hmRecopen, { ws: WS || '' })))) openMeeting({ note: d.hmRecopen }); return; }
|
|
1464
1493
|
};
|
|
1465
1494
|
$('#hmList').addEventListener('keydown', (e) => { if (e.key === 'Escape' && e.target.id === 'hmCap' && S.cap) { e.stopPropagation(); S.cap = false; drawList(); } else if (e.key === 'Escape' && S.day) { e.stopPropagation(); day(false); } });
|
|
1466
1495
|
/** Open (id) or close (null) the list behind an initiative's pill (batch 12 item 6). Closing gives the focus back to the pill, unless the
|
|
@@ -72,7 +72,8 @@ export function sessionRow(s, roles) {
|
|
|
72
72
|
// a chat's tmux name carries a 'chat: ' prefix (lib/briefing-premium-agent.js); the row shows its title only (testing fixes)
|
|
73
73
|
const name = nameOf(s);
|
|
74
74
|
return { id: 's:' + s.id, kind: 'session', sid: s.id, key: keyOfSession(s), ini: iniOfSession(s), name, state: st, initial: role.initial, role,
|
|
75
|
-
hint: role.name, icon: 'chat', created: s.created || '', prog: s.progress && s.progress.n > 0 ? s.progress : null
|
|
75
|
+
hint: role.name, icon: 'chat', created: s.created || '', prog: s.progress && s.progress.n > 0 ? s.progress : null,
|
|
76
|
+
...(s.close_ok && st === 'quiet' ? { close: s.close_ok } : {}) }; // idle 30 min: { safe, say } (batch 13 item 7, lib/idle-close.js) // the state is the dot beside the row, not a word (testing fixes)
|
|
76
77
|
}
|
|
77
78
|
/** The sessions as Home reads them. A session PMOS started (a skill, a background job) reads 'needs' as soon as its prompt is done:
|
|
78
79
|
* its turn ending asks nothing of the PM, so it is a finished run, quiet, and never a row that waits on the PM (testing fixes).
|
|
@@ -117,8 +118,9 @@ export const UPDATE_KEY = 'chat:weekly-update';
|
|
|
117
118
|
/* ── initiatives ── */
|
|
118
119
|
export const boardRows = (D) => (D.board && D.board.initiatives && D.board.initiatives.list && D.board.initiatives.list.rows) || (D.board && D.board.rows) || [];
|
|
119
120
|
export const live = (s) => s.shown !== 'exited' && s.state !== 'exited';
|
|
120
|
-
/** A session Home lists: a live one, or a chat that rests until its next message.
|
|
121
|
-
|
|
121
|
+
/** A session Home lists: a live one, or a chat that rests until its next message. One the PM put away or finished from the clean-up
|
|
122
|
+
* (batch 13 item 3: s.away) is not listed until the PM's next message in it; Search still finds it. */
|
|
123
|
+
export const listed = (s) => (live(s) || resting(s)) && !(s && s.away);
|
|
122
124
|
/** The kids of one initiative: its needs, its live sessions and today's meetings about it, the loudest first. */
|
|
123
125
|
export function kidsOf(D, id) {
|
|
124
126
|
const needs = needsOf(D).filter((r) => r.ini === id && !r.needSession);
|