create-pmos 0.424.0 → 0.425.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 +13 -13
- 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-programs-test.js +41 -26
- package/workspace/briefing-premium-board-test.js +7 -4
- package/workspace/briefing-premium-insights-test.js +31 -15
- package/workspace/briefing-premium-products-test.js +46 -43
- package/workspace/changelog.json +12 -0
- package/workspace/guide/briefing-premium.md +3 -2
- 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 +2 -2
- package/workspace/lib/briefing-premium-products.js +18 -4
- package/workspace/lib/meeting-focus.js +64 -14
- package/workspace/lib/routes-briefing-premium.js +19 -0
- package/workspace/lib/routes-meeting-focus.js +28 -6
- package/workspace/lib/settings-store.js +2 -1
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-briefing-depth-test.js +1 -1
- package/workspace/premium-rec-now-test.js +153 -0
- package/workspace/premium-rec-tab-test.js +167 -0
- package/workspace/public/pm/cozy-aud.css +9 -0
- package/workspace/public/pm/cozy-aud.js +80 -0
- 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/home-app.js +37 -22
- package/workspace/public/pm/home-list.js +17 -10
- package/workspace/public/pm/home-more.js +2 -31
- package/workspace/public/pm/home-today.js +4 -4
- package/workspace/public/pm/live-model.js +1 -1
- package/workspace/public/pm/premium-board.js +56 -25
- 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/view-notes.js +9 -0
- package/workspace/public/premium-aud.html +22 -0
- package/workspace/public/premium-board.html +1 -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 +9 -1
- 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
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
* keys and swipe on the rows (GET /api/my-work-premium; the /api/pm-items, /api/pm-jobs and /api/my-work presses)
|
|
9
9
|
* openAround(key?) home-around.js: Around you is gone (premium-uncovered-features, HmAround); its views stay, opened from New for you
|
|
10
10
|
* openEndOfDay() GET /api/phone-day: what finished today, the recap and tomorrow's meetings
|
|
11
|
-
* openProducts() which products Home reads (GET /api/briefing-premium products, POST /api/settings ws.briefing.include)
|
|
12
11
|
* openSearch(go) the designed Search (pm/cozy-search.js, E1): the repository and every worktree
|
|
13
12
|
* openInbox(go) New for you (pm/cozy-news.js, E2), which replaces the agents' results
|
|
14
13
|
* openRecorder() a note recorded now with no calendar event (the Viewer's newNote, else POST /api/notes/new)
|
|
@@ -32,7 +31,7 @@ function card(o, draw) {
|
|
|
32
31
|
}
|
|
33
32
|
|
|
34
33
|
export const moreItems = [
|
|
35
|
-
['eod', 'End of the day', 'cal'], ['cal', 'Calendar', 'cal'], ['rec', 'Record a note', 'mic'],
|
|
34
|
+
['eod', 'End of the day', 'cal'], ['cal', 'Calendar', 'cal'], ['rec', 'Record a note', 'mic'],
|
|
36
35
|
];
|
|
37
36
|
|
|
38
37
|
/** The ⋯ list itself in the Viewer, for a page with no menu of its own: items are [label, open]. */
|
|
@@ -86,35 +85,7 @@ export function openEndOfDay() {
|
|
|
86
85
|
return body;
|
|
87
86
|
}
|
|
88
87
|
|
|
89
|
-
/* ── Products ── */
|
|
90
|
-
export function openProducts() {
|
|
91
|
-
const M = { P: null, head: '', msg: '' };
|
|
92
|
-
const one = new URLSearchParams(location.search).get('ws'); // Home narrowed to one workspace (?ws=): a way back to the picked products
|
|
93
|
-
const draw = (b) => {
|
|
94
|
-
const P = M.P, on = P ? P.available.filter((x) => x.on).length : 0;
|
|
95
|
-
b.innerHTML = WAIT + (M.head ? `<p class="hx-n" id="hxSnap">${esc(M.head)}</p>` : '')
|
|
96
|
-
+ (one ? '<p class="hx-n">Home shows one workspace now. <a id="pickAll" href="/premium.html">All picked products</a></p>' : '')
|
|
97
|
-
+ (!P ? '<p class="hx-n">Reading the products.</p>' : !P.available.length ? '<p class="hx-n">No product workspace is registered.</p>'
|
|
98
|
-
: sec('Home reads', `<p class="hx-n" id="hxCount">Products ${on} of ${P.available.length}</p>` + P.available.map((x) => row(x.name, x.home ? 'home' : '', `<button type="button" class="hx-sw" role="switch" aria-checked="${!!x.on}" aria-label="${esc(x.name)}${x.home ? ' (home)' : ''}" data-ws="${esc(x.ws)}">${x.on ? 'On' : 'Off'}</button>`)).join('') + btn('Back to the default', 'data-reset="1"')))
|
|
99
|
-
+ `<p class="hx-n" role="status">${esc(M.msg)}</p>`;
|
|
100
|
-
};
|
|
101
|
-
const body = card({ id: 'products', kind: 'Products', title: 'Which products Home reads', icon: 'chart' }, draw);
|
|
102
|
-
const read = async () => {
|
|
103
|
-
const r = await pmGet('/api/briefing-premium');
|
|
104
|
-
M.P = r && r.ok && r.model ? r.model.products || { available: [] } : { available: [] };
|
|
105
|
-
M.head = r && r.ok && r.model && r.model.header ? r.model.header.text : ''; // what is read and what is not, from the records
|
|
106
|
-
if (body.isConnected) draw(body);
|
|
107
|
-
};
|
|
108
|
-
body.onclick = async (e) => {
|
|
109
|
-
const t = e.target.closest('button'); if (!t || !M.P) return;
|
|
110
|
-
const on = M.P.available.filter((x) => x.on).map((x) => x.ws);
|
|
111
|
-
const r = await pmPost('/api/settings', t.dataset.reset ? { key: 'ws.briefing.include', reset: true } : { key: 'ws.briefing.include', value: on.includes(t.dataset.ws) ? on.filter((x) => x !== t.dataset.ws) : on.concat(t.dataset.ws) });
|
|
112
|
-
M.msg = r && r.ok ? 'Saved. Home reads the products you picked.' : (r && r.error) || 'Not saved.';
|
|
113
|
-
read(); window.dispatchEvent(new CustomEvent('hm:reload'));
|
|
114
|
-
};
|
|
115
|
-
read();
|
|
116
|
-
return body;
|
|
117
|
-
}
|
|
88
|
+
/* ── Products ── gone (batch 12 item 5): the product chip on Home, Board and Insights is the one picker (pm/cozy-pick.js) */
|
|
118
89
|
|
|
119
90
|
/* ── Search ── the designed palette (pm/cozy-search.js); go is the page's own opener for an initiative ({ ini }), a session ({ ses }) or a file ({ doc }) */
|
|
120
91
|
export function openSearch(go) { return import('./cozy-search.js').then((M) => M.openSearch({ go })); }
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
import { STEPS } from './premium-initiative-head.js';
|
|
14
14
|
import { whenOf } from './home-list.js';
|
|
15
|
+
import { chipHtml } from './cozy-pick.js'; // the one product picker Home, Board and Insights share (batch 12 item 5)
|
|
15
16
|
import { ringHtml } from './home-line.js';
|
|
16
17
|
import { gripHtml, sugHtml } from './prog-order.js'; // a program's order: the grip and ✦ (canvas RoADrag, RoAPhone)
|
|
17
18
|
|
|
@@ -241,13 +242,12 @@ export function todayHtml(T, o) {
|
|
|
241
242
|
const MONTH = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
|
|
242
243
|
const WEEKDAY = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
|
|
243
244
|
const MOMENT = new Set(['rec', 'soon', 'live', 'eod', 'review']);
|
|
244
|
-
/** M is homeList(); T todayCard(); o: { sel, ses (the initiative row whose pill is open), pOpen, restOpen, pin, avHtml, ready, err,
|
|
245
|
+
/** M is homeList(); T todayCard(); o: { sel, ses (the initiative row whose pill is open), pOpen, restOpen, pin, avHtml, ready, err, pick (GET /api/briefing-premium/products), tones, review, phone, day (Your day is open) } */
|
|
245
246
|
export function listHtml(M, T, o) {
|
|
246
|
-
const many = M.products.length > 1;
|
|
247
|
-
const picked = o.product ? M.products.find((p) => p.key === o.product) : null;
|
|
248
247
|
const flt = M.filter !== 'today' ? M.filters.find((f) => f.key === M.filter) : null;
|
|
249
248
|
const head = `<div class="hm-hd hv-bar"><button type="button" class="hv-hi" data-hm-day aria-expanded="${!!o.day}" aria-label="${esc(M.word || 'Today')}. Open your day"><b>${esc(M.word || 'Today')}</b>${svg(P.chevD, 18)}</button>`
|
|
250
|
-
|
|
249
|
+
// the product chip, always (it is also the way to add one): the ticked products' tiles, or All (canvas XhpA2States)
|
|
250
|
+
+ (o.pick ? chipHtml(o.pick, { id: 'hmPick', attrs: 'data-hm-pick', label: 'Products on Home', tones: o.tones }) : '')
|
|
251
251
|
+ (o.phone ? '' : `<button type="button" class="ut-ib hv-ib${flt ? ' on' : ''}" data-hm-flt aria-haspopup="menu" aria-label="Show: Today, Kept or Done${flt ? '. Now ' + esc(flt.label) : ''}" title="Show: Today, Kept or Done">${svg(P.filter, 18)}</button>`)
|
|
252
252
|
+ `<button type="button" class="ut-ib hv-ib" data-hm-new aria-haspopup="menu" aria-label="New" title="New">${svg(P.plus, 20)}</button></div>`
|
|
253
253
|
+ (M.yours ? `<p class="hv-sub">${M.yours} ${M.yours === 1 ? 'is' : 'are'} yours</p>` : '');
|
|
@@ -64,7 +64,7 @@ export function liveItems(sessions, o = {}) {
|
|
|
64
64
|
const out = [];
|
|
65
65
|
const rec = o.rec;
|
|
66
66
|
if (rec && rec.on && !rec.here) {
|
|
67
|
-
out.push({ id: 'rec:' + rec.id, kind: 'rec', mark: 'rec', name: rec.title || 'Meeting', sub: 'Meeting', time: clock(elapsed(rec, now)), at: now, href: rec.href || '/premium.html', paused: !!rec.paused, open: false });
|
|
67
|
+
out.push({ id: 'rec:' + rec.id, kind: 'rec', mark: 'rec', name: rec.title || 'Meeting', sub: rec.silent ? 'Not hearing the meeting' : 'Meeting', time: clock(elapsed(rec, now)), at: now, href: rec.href || '/premium.html', paused: !!rec.paused, open: false });
|
|
68
68
|
}
|
|
69
69
|
const rows = [];
|
|
70
70
|
for (const s of Array.isArray(sessions) ? sessions : []) {
|
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
* Where no record holds a value for an initiative, the element says so: nothing is invented. */
|
|
20
20
|
import { pmPost } from './http.js';
|
|
21
21
|
import { followDoc } from './doc-follow.js';
|
|
22
|
-
import { $, $$, esc, store,
|
|
22
|
+
import { $, $$, esc, store, chatAbout, setPageGaps } from './premium-shell.js';
|
|
23
|
+
import * as PK from './cozy-pick.js'; // the one product picker Home, Board and Insights share (batch 12 item 5)
|
|
23
24
|
import { mountNav } from './cozy-nav.js';
|
|
24
25
|
import { mountLivePill } from './cozy-live-pill.js';
|
|
25
26
|
import { stepsHelpHtml } from './bd-stages.js';
|
|
@@ -58,9 +59,14 @@ const F = { chips: new Set(), q: '', owners: new Set(), cats: new Set(), sprints
|
|
|
58
59
|
let GR = {}; // the first questions still open per initiative (GET /api/board-grill?ids=): { [id]: { open, total, later } }
|
|
59
60
|
let PGS = []; // the programs (GET /api/programs): every view groups the rows a program holds under it (PgBoard)
|
|
60
61
|
let XR = {}; // the other products' rows a program here holds, read once (GET /api/board-premium?ws=): { [ws]: { name, rows } }
|
|
61
|
-
// the
|
|
62
|
-
|
|
63
|
-
const
|
|
62
|
+
// the boards shown: the one product pick Home and Insights share (batch 12 item 5, saved, never in the address), read at the first load
|
|
63
|
+
// (resolvePick). A link with ?ws=&board= (or the older ?all=1, ?pick=<ws>|<board>) is a one-off view: it shows that and leaves the pick alone.
|
|
64
|
+
const Q0 = new URLSearchParams(location.search);
|
|
65
|
+
let PICK = Q0.getAll('pick').filter((x) => /\|/.test(x));
|
|
66
|
+
let ALL = Q0.get('all') === '1' || PICK.length > 1; // All products, or several: their boards on one page (PgBoard)
|
|
67
|
+
const DEEP = ALL || PICK.length > 0 || Q0.has('ws') || Q0.has('board');
|
|
68
|
+
let ONE = null; // the one ticked product's board, 'ws|id', when the pick holds one
|
|
69
|
+
let PKP = null, picked = false; // the saved pick (GET /api/briefing-premium/products), and whether it has been turned into boards
|
|
64
70
|
let byProduct = store.get(GROUPING_KEY) === 'product'; // the grouping: programs first (default) or By product (PgBoardProduct)
|
|
65
71
|
let DM = {}; // the documents' history (GET /api/board-docs): { [path]: { changed, by, log } }
|
|
66
72
|
let peek = null; // what the Viewer shows for the Board: { kind: 'ini', key } an initiative or its ticket, { kind: 'acts' } an acts panel
|
|
@@ -138,27 +144,50 @@ function say(msg, undo) {
|
|
|
138
144
|
clearTimeout(toastT); toastT = setTimeout(() => { t.hidden = true; }, undo ? 10000 : 5000);
|
|
139
145
|
}
|
|
140
146
|
|
|
147
|
+
/* ── the product chip (batch 12 item 5, canvas XhpA5Pages): the same chip and list as Home's; it replaces "pmos-idpf +1" ── */
|
|
148
|
+
/** The pick as this page shows it: the saved one, or for a one-off link the products on screen. */
|
|
149
|
+
function shownPick() {
|
|
150
|
+
if (!PKP) return null;
|
|
151
|
+
if (!DEEP) return PKP;
|
|
152
|
+
const ws = new Set(M.board.all ? (M.board.products || []).map((p) => p.ws) : [M.board.ws]);
|
|
153
|
+
return { ...PKP, products: PKP.products.map((p) => ({ ...p, on: ws.has(p.ws) })) };
|
|
154
|
+
}
|
|
155
|
+
function drawPick() {
|
|
156
|
+
const P = shownPick(), host = $('#crumbHost'); if (!host) return;
|
|
157
|
+
host.innerHTML = P ? PK.chipHtml(P, { id: 'bdPick', label: 'Products' }) : `<span class="crpg">${esc(M.board.name || 'Board')}</span>`;
|
|
158
|
+
const chip = $('#bdPick'); if (!chip) return;
|
|
159
|
+
// a product's line: its open initiatives on this page (zero is silence)
|
|
160
|
+
const lines = (ws) => { const rows = (M.initiatives.list.rows || []).filter((r) => (M.board.all ? r.ws === ws : M.board.ws === ws)); return rows.length ? rows.length + (rows.length === 1 ? ' initiative' : ' initiatives') : ''; };
|
|
161
|
+
chip.onclick = (e) => { e.stopPropagation(); PK.openPicker(chip, { P: shownPick(), label: 'Products', lines, note: 'One pick for Home, Board and Insights: unticking a product here also takes it off Home.', onApply: async (on) => { const r = await PK.savePick(on); if (!r.ok) say(r.error); } }); };
|
|
162
|
+
}
|
|
163
|
+
// a saved pick (this chip, or Settings): the Board opens on the ticked products, without a one-off link's ws or board
|
|
164
|
+
addEventListener('pp:changed', () => { const q = new URLSearchParams(location.search); ['ws', 'board', 'all', 'pick'].forEach((k) => q.delete(k)); const s = q.toString(); location.assign(location.pathname + (s ? '?' + s : '')); });
|
|
165
|
+
/** Turn the saved pick into the boards to read: every product's board (All), several (PICK), one (ONE) or the default board. false while the
|
|
166
|
+
* default board is still being read (its switcher lists the boards). A one-off link keeps its own. */
|
|
167
|
+
async function resolvePick() {
|
|
168
|
+
if (picked) return true;
|
|
169
|
+
if (!PKP) PKP = await PK.readPick();
|
|
170
|
+
if (DEEP || !PKP) { picked = true; return true; }
|
|
171
|
+
const h = await readBoard('');
|
|
172
|
+
if (h.r && h.r.state === 'reading') return false;
|
|
173
|
+
picked = true;
|
|
174
|
+
const sw = (h.r && h.r.ok && h.r.model && h.r.model.board.switcher) || null;
|
|
175
|
+
if (!sw) return true; // one board: nothing to pick between
|
|
176
|
+
const on = new Set(PKP.products.filter((p) => p.on).map((p) => p.ws)), keys = sw.filter((b) => on.has(b.ws)).map((b) => b.ws + '|' + b.id);
|
|
177
|
+
if (!keys.length) return true;
|
|
178
|
+
if (keys.length === sw.length) { ALL = true; PICK = []; return true; }
|
|
179
|
+
if (keys.length === 1) { ONE = keys[0]; return true; }
|
|
180
|
+
PICK = keys; ALL = true;
|
|
181
|
+
return true;
|
|
182
|
+
}
|
|
183
|
+
|
|
141
184
|
/* ── the toolbar: picker, chips ───────────────────────────────────────────────────────────────────────────────────── */
|
|
142
185
|
let crumbed = false;
|
|
143
186
|
function drawHead() {
|
|
144
187
|
if (!crumbed) {
|
|
145
188
|
crumbed = true;
|
|
146
|
-
|
|
147
|
-
const list = M.board.switcher || [], boards = list.length > 1 ? [{ ws: '*', id: '*', name: 'All products' }, ...list] : list;
|
|
148
|
-
// the button says it once: All products, the one product, or the first product and "+N" (several)
|
|
189
|
+
drawPick();
|
|
149
190
|
const names = (M.board.products || []).map((p) => p.name), some = ALL && PICK.length > 1;
|
|
150
|
-
const label = some ? esc(names[0] || 'Products') + ' <b>+' + (names.length - 1) + '</b>' : esc(M.board.name || 'Board');
|
|
151
|
-
$('#crumbHost').innerHTML = crumbHtml({ page: '', board: M.board.name || 'Board', boards });
|
|
152
|
-
$('#crBoard').innerHTML = label;
|
|
153
|
-
// several products can be ticked (batch 11 item 7); the pick goes into the address, so a reload keeps it
|
|
154
|
-
const picked = !ALL ? [M.board.ws + '|' + M.board.id] : (M.board.products || []).map((p) => p.ws + '|' + p.id);
|
|
155
|
-
const goBoard = (ws, id) => location.assign(id === '*' ? '/premium-board.html?all=1' : '/premium-board.html?ws=' + encodeURIComponent(ws) + '&board=' + encodeURIComponent(id));
|
|
156
|
-
wireCrumb({ boards, board: ALL ? '*' : M.board.id, goBoard, picked: list.length > 1 ? picked : null, goPicked: (keys) => {
|
|
157
|
-
if (keys.length === list.length) return goBoard('*', '*');
|
|
158
|
-
if (keys.length === 1) { const [ws, id] = keys[0].split('|'); return goBoard(ws, id); }
|
|
159
|
-
location.assign('/premium-board.html?' + keys.map((k) => 'pick=' + encodeURIComponent(k)).join('&'));
|
|
160
|
-
} });
|
|
161
|
-
$('#crBoard').setAttribute('aria-label', 'Product: ' + (some ? names.join(', ') : M.board.name || 'Board'));
|
|
162
191
|
chatAbout('board:this-board', some ? 'the ' + names.join(', ') + ' boards' : ALL ? 'all products' : M.board.name ? 'the ' + M.board.name + ' board' : 'this board');
|
|
163
192
|
}
|
|
164
193
|
$('#snap').textContent = M.header.text;
|
|
@@ -881,15 +910,17 @@ async function readAll(q) {
|
|
|
881
910
|
return { r: { ok: true, model, stale: got.some((g) => g.r && g.r.stale) || h.r.stale }, status: 200 };
|
|
882
911
|
}
|
|
883
912
|
async function load() {
|
|
884
|
-
|
|
885
|
-
const
|
|
886
|
-
clearInterval(readTimer);
|
|
887
|
-
if (r && r.state === 'reading') {
|
|
913
|
+
// while the board is read (the pick's default board, then the picked ones) the page says so and shows no row instead of a guess
|
|
914
|
+
const reading = () => {
|
|
888
915
|
const t0 = Date.now(), tick = () => { const s = 'Reading the board · ' + Math.round((Date.now() - t0) / 1000) + ' s so far'; $('#snap').textContent = s; if (!M) $('#ibBody').innerHTML = `<p class="bd-msg"><b>${esc(s)}</b> The board derives each initiative from its records. This page shows nothing until it has read, rather than guess.</p>`; };
|
|
889
916
|
tick(); readTimer = setInterval(tick, 1000);
|
|
890
917
|
setTimeout(load, 3000);
|
|
891
|
-
|
|
892
|
-
}
|
|
918
|
+
};
|
|
919
|
+
if (!(await resolvePick())) { clearInterval(readTimer); reading(); return; }
|
|
920
|
+
const p = new URLSearchParams(location.search), [pw, pb] = PICK.length > 1 ? PICK[0].split('|') : ONE ? ONE.split('|') : [p.get('ws'), p.get('board')], q = [pw ? 'ws=' + encodeURIComponent(pw) : '', pb ? 'board=' + encodeURIComponent(pb) : ''].filter(Boolean).join('&');
|
|
921
|
+
const { r, status } = ALL ? await readAll(q) : await readBoard(q);
|
|
922
|
+
clearInterval(readTimer);
|
|
923
|
+
if (r && r.state === 'reading') { reading(); return; }
|
|
893
924
|
if (!r || !r.ok) {
|
|
894
925
|
$('#snap').textContent = 'The board could not be read';
|
|
895
926
|
if (!M) $('#ibBody').innerHTML = `<p class="bd-msg err" role="alert"><b>The board could not be read</b>, so this page shows nothing rather than guess.${r && r.error ? ' The reason: ' + esc(r.error) : status ? ' The server answered ' + status + '.' : ' The server did not answer.'}</p>`;
|
|
@@ -16,13 +16,15 @@
|
|
|
16
16
|
* POST /api/insights-records/tile. A tile goes amber only after two readings past its target. "Delivery trends" is also a view.
|
|
17
17
|
* IsLibrary Found in your work as cards (Set it up, Not a report with Undo), the reports as Report · Next · Status, and a report's setup in the
|
|
18
18
|
* Viewer card (Setup, Issues, Brief); a request from Home with Set it up, Change it and Cancel. New report hands off to Home.
|
|
19
|
-
* IsMenus the product
|
|
19
|
+
* IsMenus the product chip (the one pick Home and Board share, batch 12 item 5: one ticked = that product; several = Portfolio, their
|
|
20
|
+
* goals rolled up and grouped by product), the Dashboard menu, Find (goals,
|
|
20
21
|
* reports and dashboards), Filter (status, owner, kind), ⋯ (Sources, Export, About) and the empty trend of a goal with one reading.
|
|
21
22
|
* IsPhone the goal detail full screen with Readings, Moved by and Dashboards; a report setup as a sheet.
|
|
22
23
|
* window.czViewer is feature-detected, with this page's side panel as the fallback. A report file opens in the report reader
|
|
23
24
|
* (pm/premium-report-read.js), the report panel in the Viewer card. The page has no #dlg. */
|
|
24
25
|
import { $, $$, esc, toast, wireRail, setPageGaps } from './premium-shell.js';
|
|
25
26
|
import { pmPost } from './http.js';
|
|
27
|
+
import * as PK from './cozy-pick.js'; // the one product picker Home, Board and Insights share (batch 12 item 5)
|
|
26
28
|
import { openReport } from './premium-report-read.js';
|
|
27
29
|
import { mountNav } from './cozy-nav.js';
|
|
28
30
|
import { mountLivePill } from './cozy-live-pill.js';
|
|
@@ -34,7 +36,11 @@ let tab = 'goals';
|
|
|
34
36
|
let per = null; // the period { key, label, name, from, to }
|
|
35
37
|
let find = '';
|
|
36
38
|
let filt = { status: [], owner: [], kind: [] }; // the Filter (IsMenus): each group holds the chips that are on
|
|
37
|
-
let PF = null; // Portfolio (IsMenus): { goals, charts, products } rolled up from
|
|
39
|
+
let PF = null; // Portfolio (IsMenus): { goals, charts, products } rolled up from the ticked products' models, or null
|
|
40
|
+
// the products shown: the one saved pick (GET /api/briefing-premium/products). A link with ?ws= or ?board= is a one-off view of that product.
|
|
41
|
+
const DEEP = new URLSearchParams(location.search).has('ws') || new URLSearchParams(location.search).has('board');
|
|
42
|
+
let PKP = null;
|
|
43
|
+
const pickedWs = () => (PKP && !DEEP ? PKP.products.filter((p) => p.on).sort((a, b) => (b.primary ? 1 : 0) - (a.primary ? 1 : 0)).map((p) => p.ws) : []); // the default workspace first
|
|
38
44
|
let loadedAt = 0;
|
|
39
45
|
let selecting = false; let picked = []; // New dashboard: the goals picked in the table, in order
|
|
40
46
|
wireRail('rep');
|
|
@@ -72,7 +78,7 @@ const closeViewer = () => { if (window.czViewer && typeof window.czViewer.close
|
|
|
72
78
|
// The Viewer floats over the page (XvAInsight); the page does not move for it.
|
|
73
79
|
|
|
74
80
|
/* ── small menus: one open at a time, Escape and an outside press close it ─────────────────────────────────────────────────────── */
|
|
75
|
-
const MENUS = [['#
|
|
81
|
+
const MENUS = [['#viewChip', '#viewMenu'], ['#perChip', '#perMenu'], ['#filtB', '#filtMenu'], ['#newB', '#newMenu'], ['#moreB', '#moreMenu']];
|
|
76
82
|
function menu(btn, box, open) { $(box).hidden = !open; $(btn).setAttribute('aria-expanded', String(open)); }
|
|
77
83
|
function closeMenus(except) { for (const [b, m] of MENUS) if (m !== except && !$(m).hidden) menu(b, m, false); const cm = $('#chMenu'); if (cm) cm.hidden = true; if (!$('#findRow').hidden) closeFind(false); }
|
|
78
84
|
for (const [b, m] of MENUS) {
|
|
@@ -156,12 +162,7 @@ const curDash = () => M.dashboards.find((d) => d.id === dash) || M.dashboards[0]
|
|
|
156
162
|
const dashName = (D) => (D.id === 'all' ? 'All goals' : D.name);
|
|
157
163
|
const nGoals = (k) => k + (k === 1 ? ' goal' : ' goals');
|
|
158
164
|
function drawBar() {
|
|
159
|
-
|
|
160
|
-
const boards = M.board.switcher || [];
|
|
161
|
-
/* the product picker: each product with its goal count, then Portfolio, which rolls every product's goals up */
|
|
162
|
-
$('#prodMenu').innerHTML = '<p class="ins-mh">Product</p>' + (boards.length ? boards.map((b) => `<button type="button" role="menuitemradio" aria-checked="${!PF && b.id === M.board.id && b.ws === M.board.ws}" data-ws="${esc(b.ws)}" data-board="${esc(b.id)}">${esc(b.name)}<span class="k">${b.goals != null ? esc(nGoals(b.goals)) : ''}</span></button>`).join('')
|
|
163
|
-
: '<p class="note ins-mnote">One product is registered.</p>')
|
|
164
|
-
+ (boards.length > 1 ? `<div class="ins-hr"></div><button type="button" role="menuitemradio" aria-checked="${!!PF}" data-portfolio>Portfolio · all products</button><p class="note ins-mnote">Portfolio rolls goals up across products.</p>` : '');
|
|
165
|
+
drawPick();
|
|
165
166
|
$('#nGoals').textContent = String(dash === TRENDS ? 0 : goalsShown().length);
|
|
166
167
|
$('#nOutcomes').textContent = String(outcomesShown().length);
|
|
167
168
|
const D = curDash();
|
|
@@ -172,12 +173,22 @@ function drawBar() {
|
|
|
172
173
|
+ `<div class="ins-hr"></div><button type="button" role="menuitem" data-newdash>${SV(I.plus)}New dashboard</button>`;
|
|
173
174
|
drawPeriod(); drawFilter();
|
|
174
175
|
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
if (
|
|
179
|
-
|
|
180
|
-
}
|
|
176
|
+
/* the product chip (canvas XhpA5Pages): the same chip and list as Home's. It replaces the one-product menu and "Portfolio · all products" */
|
|
177
|
+
function shownPick() {
|
|
178
|
+
if (!PKP) return null;
|
|
179
|
+
if (!DEEP) return PKP;
|
|
180
|
+
return { ...PKP, products: PKP.products.map((p) => ({ ...p, on: p.ws === M.board.ws })) }; // a one-off link: the product on screen
|
|
181
|
+
}
|
|
182
|
+
function drawPick() {
|
|
183
|
+
const P = shownPick(), host = $('#prodHost');
|
|
184
|
+
host.innerHTML = P ? PK.chipHtml(P, { id: 'prodPick', label: 'Products' }) : `<span class="ins-ttl">${esc(M.board.name || 'Insights')}</span>`;
|
|
185
|
+
const chip = $('#prodPick'); if (!chip) return;
|
|
186
|
+
// a product's line: its goals, from what this page read (zero is silence)
|
|
187
|
+
const lines = (ws) => { const n = PF ? PF.goals.filter((g) => g.ws === ws).length : ws === M.board.ws ? M.goals.length : 0; return n ? nGoals(n) : ''; };
|
|
188
|
+
chip.onclick = (e) => { e.stopPropagation(); closeMenus(); PK.openPicker(chip, { P: shownPick(), label: 'Products', lines, note: 'One pick for Home, Board and Insights: unticking a product here also takes it off Home.', onApply: async (on) => { const r = await PK.savePick(on); if (!r.ok) toast(r.error); } }); };
|
|
189
|
+
}
|
|
190
|
+
// a saved pick (this chip, or Settings): Insights opens on the ticked products, without a one-off link's ws or board
|
|
191
|
+
addEventListener('pp:changed', () => { const q = new URLSearchParams(location.search); ['ws', 'board'].forEach((k) => q.delete(k)); const s = q.toString(); location.assign(location.pathname + (s ? '?' + s : '')); });
|
|
181
192
|
$('#viewMenu').addEventListener('click', (e) => {
|
|
182
193
|
if (e.target.closest('[data-newdash]')) { closeMenus(); openNewDash(); return; }
|
|
183
194
|
const b = e.target.closest('[data-view]'); if (!b) return; closeMenus(); setView(b.dataset.view);
|
|
@@ -200,11 +211,12 @@ $('.ins-tabs').addEventListener('keydown', (e) => {
|
|
|
200
211
|
});
|
|
201
212
|
function setView(id) { dash = id; setTab('goals'); redraw(); }
|
|
202
213
|
|
|
203
|
-
/* Portfolio: the goals of
|
|
204
|
-
* product keeps its own workspace, so a reading added to it goes there. Budgets, Outcomes and Library stay
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
214
|
+
/* Portfolio: the goals of the ticked products (several ticked, batch 12 item 5), each product's model read once through GET /api/insights-premium,
|
|
215
|
+
* grouped by product. A goal of another product keeps its own workspace, so a reading added to it goes there. Budgets, Outcomes and Library stay
|
|
216
|
+
* the first ticked product's, and say so (oneNote). */
|
|
217
|
+
async function openPortfolio(only = pickedWs(), keepTab = false) {
|
|
218
|
+
const seen = new Set([M.board.ws]), others = (M.board.switcher || []).filter((b) => (!only.length || only.includes(b.ws)) && !seen.has(b.ws) && seen.add(b.ws));
|
|
219
|
+
toast('Reading the goals of the products you picked.');
|
|
208
220
|
const got = await Promise.all(others.map(async (b) => { try { const r = await (await fetch('/api/insights-premium?ws=' + encodeURIComponent(b.ws) + '&board=' + encodeURIComponent(b.id), { credentials: 'same-origin' })).json(); return r && r.ok ? r.model : null; } catch { return null; } }));
|
|
209
221
|
const goals = M.goals.map((g) => Object.assign({}, g, { prod: M.board.name, ws: M.board.ws, rid: g.id })), charts = {}, products = [M.board.name], unread = [];
|
|
210
222
|
got.forEach((m, i) => {
|
|
@@ -214,9 +226,11 @@ async function openPortfolio() {
|
|
|
214
226
|
for (const g of m.goals || []) goals.push(Object.assign({}, g, { id: m.board.ws + '~' + g.id, rid: g.id, key: g.key ? m.board.ws + '~' + g.key : null, prod: m.board.name || others[i].name, ws: m.board.ws, moves: g.moves || [] }));
|
|
215
227
|
});
|
|
216
228
|
PF = { goals, charts, products, unread };
|
|
217
|
-
dash = 'all'; setTab('goals'); redraw();
|
|
229
|
+
dash = 'all'; if (!keepTab) setTab('goals'); redraw();
|
|
218
230
|
if (unread.length) toast('Not read: ' + unread.join(', ') + '. Their goals are not in Portfolio.');
|
|
219
231
|
}
|
|
232
|
+
/** With several products ticked, Outcomes and Library are still read one product at a time: say which (principle 7, honest state). */
|
|
233
|
+
const oneNote = () => (PF ? `<p class="note ins-onenote">Shows ${esc(M.board.name || 'the first product')} only: this tab reads one product at a time.</p>` : '');
|
|
220
234
|
const allGoals = () => (PF ? PF.goals : M.goals);
|
|
221
235
|
const goalById = (id) => allGoals().find((x) => x.id === id) || null;
|
|
222
236
|
const goalWs = (g) => (g && g.ws) || M.board.ws;
|
|
@@ -849,7 +863,7 @@ function drawOutcomes() {
|
|
|
849
863
|
: (need.length ? `<b>${esc(need[0].title)} needs your verdict${dueOf(need[0]) !== null ? ' by ' + esc(md(dueOf(need[0]))) : ''}.</b> ` : '') + esc('Of ' + P.length + (P.length === 1 ? ' promise ' : ' promises ') + (per.said || 'in these dates') + ', ' + met + (met === 1 ? ' is' : ' are') + ' met, ' + part + (part === 1 ? ' is' : ' are') + ' partly met and ' + win + (win === 1 ? ' is' : ' are') + ' still in their window.');
|
|
850
864
|
const head = '<div class="ins-tr ins-th ins-ocols" role="row"><div role="columnheader">Shipped initiative</div><div role="columnheader">What it promised · and what happened so far</div><div role="columnheader">Guardrail and overlap</div><div role="columnheader">Window</div><div role="columnheader">Verdict</div></div>';
|
|
851
865
|
const groups = Object.keys(OUT_G).map((k) => { const G = L.filter((r) => r.group === k); return G.length ? `<div class="ins-grp" role="row"><span role="cell">${k === 'decided' ? 'Decided ' + esc(per.said || 'in these dates') : OUT_G[k]}</span> <span class="q">${G.length}</span></div>` + G.map(outRow).join('') : ''; }).join('');
|
|
852
|
-
$('#outTbl').innerHTML = head + (groups || '<div class="ins-empty">Nothing to judge yet.</div>');
|
|
866
|
+
$('#outTbl').innerHTML = oneNote() + head + (groups || '<div class="ins-empty">Nothing to judge yet.</div>');
|
|
853
867
|
}
|
|
854
868
|
$('#outTbl').addEventListener('click', (e) => { const b = e.target.closest('[data-verdict]'); if (b) openVerdict((M.outcomes || []).find((r) => r.id === b.dataset.verdict)); });
|
|
855
869
|
|
|
@@ -1197,7 +1211,7 @@ function drawList() {
|
|
|
1197
1211
|
const table = nRep ? `<div class="ins-rtbl" id="repAsks"><div class="ins-rl ins-rlh" role="presentation"><span>Report</span><span>Next</span><span>Status</span></div><div role="list">${reps.map(repRowHtml).join('')}${asks.map(askRowHtml).join('')}</div></div>`
|
|
1198
1212
|
: !empty ? '<div class="ins-empty"><b>No report is set up and no report file is on record.</b> Reports are made in Home.</div>' : '';
|
|
1199
1213
|
const dashBlock = `<div class="ins-sec"><h3>Dashboards</h3><span class="q">${dashes.length} · a dashboard is a saved view of Goals</span></div><div class="ins-dgrid" role="list">${dashes.map(dashCard).join('')}</div>`;
|
|
1200
|
-
$('#repBody').innerHTML =
|
|
1214
|
+
$('#repBody').innerHTML = `${oneNote()}<div id="listRows" aria-label="Dashboards and reports">${fbox}${empty}${table}${dashBlock}</div>`;
|
|
1201
1215
|
}
|
|
1202
1216
|
$('#repBody').addEventListener('click', async (e) => {
|
|
1203
1217
|
const d = e.target.closest('[data-d]'); if (d) { setView(d.dataset.d); return; }
|
|
@@ -1343,7 +1357,10 @@ function draw() {
|
|
|
1343
1357
|
redraw();
|
|
1344
1358
|
}
|
|
1345
1359
|
async function load() {
|
|
1346
|
-
|
|
1360
|
+
if (!PKP) PKP = await PK.readPick();
|
|
1361
|
+
// the pick: one ticked = that product; several = the first one read, then Portfolio of them all
|
|
1362
|
+
const p = new URLSearchParams(location.search), on = pickedWs(), pw = DEEP ? p.get('ws') : on[0] || null;
|
|
1363
|
+
const q = [pw ? 'ws=' + encodeURIComponent(pw) : '', DEEP && p.get('board') ? 'board=' + encodeURIComponent(p.get('board')) : ''].filter(Boolean).join('&');
|
|
1347
1364
|
let r = null, status = 0;
|
|
1348
1365
|
try { const res = await fetch('/api/insights-premium' + (q ? '?' + q : ''), { credentials: 'same-origin' }); status = res.status; r = await res.json(); } catch { r = null; }
|
|
1349
1366
|
if (!r || !r.ok) {
|
|
@@ -1353,6 +1370,7 @@ async function load() {
|
|
|
1353
1370
|
return;
|
|
1354
1371
|
}
|
|
1355
1372
|
const first = !M; M = r.model; loadedAt = Date.now(); draw(); if (first || !BM) bmLoad();
|
|
1373
|
+
if (on.length > 1 && first) await openPortfolio(on, true);
|
|
1356
1374
|
// A shared goal link (?goal=<id>, from "Copy link" in the goal's ⋯) opens that goal once, after the first read.
|
|
1357
1375
|
if (first) { const gid = new URLSearchParams(location.search).get('goal'); if (gid && allGoals().some((g) => g.id === gid)) openGoalDetail(gid); }
|
|
1358
1376
|
}
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
* window.__premiumRec, and mountMeeting(d): the controller Home mounts. It draws nothing: every meeting opens in the Viewer card
|
|
7
7
|
* (premium-vw-mtg.js openMeeting). */
|
|
8
8
|
|
|
9
|
+
import { ownTab, openTab, goTab, dropTab, tabUrl, post } from './rec-tab-core.js';
|
|
10
|
+
|
|
9
11
|
const pad = (n) => String(n).padStart(2, '0');
|
|
10
12
|
const clip = (s, n) => { const t = String(s == null ? '' : s).replace(/\s+/g, ' ').trim(); return t.length > n ? t.slice(0, n - 1).trimEnd() + '…' : t; };
|
|
11
13
|
const DOW = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
@@ -359,6 +361,7 @@ export function recCore(d) {
|
|
|
359
361
|
R = {
|
|
360
362
|
listen: (id) => V.listenNow(ctx, id), pause: () => V.pauseListening(ctx), listening: () => V.listeningId(), started: () => V.liveStarted(), banner: () => V.takeBanner(),
|
|
361
363
|
highlight: (id) => V.highlightNow(ctx, id), highlighting: () => V.highlightBusy(),
|
|
364
|
+
screen: () => V.liveScreen(), shots: (on) => V.pauseShots(on),
|
|
362
365
|
async stop(id) {
|
|
363
366
|
const one = await d.pmGet('/api/notes/one?id=' + encodeURIComponent(id)), note = one && one.ok ? one.note : null;
|
|
364
367
|
const { discardable } = await import('./note-dock.js');
|
|
@@ -368,22 +371,28 @@ export function recCore(d) {
|
|
|
368
371
|
};
|
|
369
372
|
return R;
|
|
370
373
|
}
|
|
374
|
+
/* not the recording tab: the recording tab listens (rec-tab-core.js), and the press there gives the share its permission */
|
|
375
|
+
async function inTab(T, id) { goTab(T, tabUrl(id, { ws: (d.ws ? d.ws() : '') || '', go: true })); await readNotes(); return { ok: true, tab: true }; }
|
|
371
376
|
const setHold = (id) => { HOLD = id ? { id } : null; window.__premiumHolding = HOLD; bump(); };
|
|
372
377
|
const started = () => { const r = window.__premiumRecorder || R; return r ? r.started() : null; };
|
|
373
378
|
const C = {
|
|
374
379
|
async record(row) {
|
|
375
380
|
const blocking = liveRows(NR).find((n) => n.state === 'recording' && !sameMeeting(n.meeting, row));
|
|
381
|
+
// the next meeting while one records in its own tab: that tab comes forward and asks once, "Stop X and record Y?"
|
|
382
|
+
if (blocking && !HOLD && ownTab() && openTab(tabUrl(String(blocking.id), { ws: (d.ws ? d.ws() : '') || '' }))) { post({ id: String(blocking.id), switchTo: { title: clip(row && row.title, 120), body: noteBody(row) } }); return { ok: false, tab: true, error: clip(blocking.title, 60) + ' is recording. Its tab asks whether to switch.' }; }
|
|
376
383
|
if (blocking || HOLD) return { ok: false, error: (blocking ? clip(blocking.title, 60) : 'A meeting') + ' is recording. Pause or stop it first.' };
|
|
384
|
+
const T = ownTab() ? openTab(null) : null; // before the first await, so the browser lets the tab open
|
|
377
385
|
const made = await d.pmPost('/api/notes/new', noteBody(row));
|
|
378
|
-
if (!made || made.ok !== true) return { ok: false, error: (made && made.error) || 'The note was not made.' };
|
|
379
|
-
return C.resume(made.note.id);
|
|
386
|
+
if (!made || made.ok !== true) { dropTab(T); return { ok: false, error: (made && made.error) || 'The note was not made.' }; }
|
|
387
|
+
return T ? inTab(T, made.note.id) : C.resume(made.note.id);
|
|
380
388
|
},
|
|
381
389
|
/** New meeting: an untitled note with no calendar event, listened to at once (the console's recordNew). */
|
|
382
390
|
async fresh() {
|
|
383
391
|
if (HOLD || liveRows(NR).some((n) => n.state === 'recording')) return { ok: false, error: 'A meeting is recording. Pause or stop it first.' };
|
|
392
|
+
const T = ownTab() ? openTab(null) : null;
|
|
384
393
|
const made = await d.pmPost('/api/notes/new', { title: '' });
|
|
385
|
-
if (!made || made.ok !== true) return { ok: false, error: (made && made.error) || 'The note was not made.' };
|
|
386
|
-
const res = await
|
|
394
|
+
if (!made || made.ok !== true) { dropTab(T); return { ok: false, error: (made && made.error) || 'The note was not made.' }; }
|
|
395
|
+
const res = T ? await inTab(T, made.note.id) : await C.resume(made.note.id); return { ...res, id: made.note.id };
|
|
387
396
|
},
|
|
388
397
|
/** Highlight: the last 30 seconds and the next ones, made into a highlight from the transcript when the window closes. */
|
|
389
398
|
async highlight() {
|
|
@@ -392,6 +401,7 @@ export function recCore(d) {
|
|
|
392
401
|
return ok === false ? { ok: false, error: 'The highlight was not started.' } : { ok: true };
|
|
393
402
|
},
|
|
394
403
|
async resume(id) {
|
|
404
|
+
if (ownTab()) { const T = openTab(null); if (T) return inTab(T, id); }
|
|
395
405
|
const rec = await recorder(); const ok = await rec.listen(id);
|
|
396
406
|
await readNotes();
|
|
397
407
|
if (!ok) return { ok: false, error: (await rec.banner()) || 'The meeting could not be heard.' };
|
|
@@ -408,6 +418,9 @@ export function recCore(d) {
|
|
|
408
418
|
},
|
|
409
419
|
refresh: readNotes, notes: () => NR, note: (id) => NR.find((n) => n.id === id) || null, started, holding: () => HOLD,
|
|
410
420
|
highlighting: () => { const r = window.__premiumRecorder || R; return r && r.highlighting ? r.highlighting() : null; },
|
|
421
|
+
/** The recording tab's picture: { track, shared, paused, silent } (view-notes.js liveScreen); shots(on) pauses or keeps the screenshots. */
|
|
422
|
+
screen: () => { const r = window.__premiumRecorder || R; return r && r.screen ? r.screen() : { track: null, shared: false, paused: false, silent: false }; },
|
|
423
|
+
shots: (on) => { const r = window.__premiumRecorder || R; return !!(r && r.shots && r.shots(on)); },
|
|
411
424
|
};
|
|
412
425
|
window.__pmRecCore = C;
|
|
413
426
|
window.__premiumRec = { pause: C.pause, resume: C.resume, stop: C.stop, record: C.record, fresh: C.fresh, highlight: C.highlight, today: async () => [],
|
|
@@ -30,7 +30,8 @@
|
|
|
30
30
|
* presentModel(S, now) → the view model (pure) presentHtml(V) → the presenter (pure) audienceFoot(V) → text (pure)
|
|
31
31
|
* openAudience() → the window (call it inside the press, before anything is awaited, so the browser allows it)
|
|
32
32
|
* presentMaterial({ mats, start, ws, meeting, getMeeting, onKeep, onAddLink, onEnd, app, win }) → { ok, end, go, at, cur, blank }
|
|
33
|
-
* previewMaterial(body, item, { ws, at, onAt, onPresent }) → draws the material for the PM only (XvAMaterialPreview)
|
|
33
|
+
* previewMaterial(body, item, { ws, at, onAt, onPresent }) → draws the material for the PM only (XvAMaterialPreview)
|
|
34
|
+
* place(root), fit(box, slot) a drawn slide's items and its scale (the recording tab's presenter and audience tab draw slides too) */
|
|
34
35
|
import * as D from './premium-deck.js';
|
|
35
36
|
import { parseMd, toDom } from './cozy-md.js';
|
|
36
37
|
|
|
@@ -199,10 +200,10 @@ function copySheets(doc, again) {
|
|
|
199
200
|
st.textContent = text.join('\n'); st.dataset.full = got.size === want.length ? '1' : '';
|
|
200
201
|
if (got.size < want.length && again) for (const l of document.querySelectorAll('link[rel="stylesheet"]')) if (!l.sheet && want.some((x) => l.href.split('?')[0].endsWith(x))) l.addEventListener('load', again, { once: true });
|
|
201
202
|
}
|
|
202
|
-
function place(root) {
|
|
203
|
+
export function place(root) {
|
|
203
204
|
root.querySelectorAll('.sl-it[data-g]').forEach((n) => { const [x, y, w, h] = n.dataset.g.split(','); n.style.setProperty('--bd-x', x + 'px'); n.style.setProperty('--bd-y', y + 'px'); n.style.setProperty('--bd-w', w + 'px'); n.style.setProperty('--bd-h', h + 'px'); });
|
|
204
205
|
}
|
|
205
|
-
function fit(box, slot) { const k = Math.max(0.03, Math.min(slot.clientWidth / D.W, slot.clientHeight / D.H)); box.style.setProperty('--bd-k', String(k)); }
|
|
206
|
+
export function fit(box, slot) { const k = Math.max(0.03, Math.min(slot.clientWidth / D.W, slot.clientHeight / D.H)); box.style.setProperty('--bd-k', String(k)); }
|
|
206
207
|
|
|
207
208
|
/** Opens the audience window. Call it in the press itself (before an await), so the browser counts it as the PM's own. */
|
|
208
209
|
export function openAudience() {
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
import { pmGet, pmPost } from './http.js';
|
|
51
51
|
import { open as vOpen, current as vCur, czSections } from './cozy-viewer.js';
|
|
52
52
|
import * as MP from './premium-mtg-present.js'; // the one presenter window for every kind (canvas note xvPresent)
|
|
53
|
+
import { presentInRecording } from './cozy-rec-bridge.js'; // while a meeting records, the recording tab presents it (rule 10)
|
|
53
54
|
import { placeholderHtml } from './cozy-placeholder.js';
|
|
54
55
|
import './premium-vw-open.js'; // registers window.czViews
|
|
55
56
|
import { cycleGroups, cycleName, briefModel, briefGlanceHtml, briefConfirmHtml, briefWhyHtml, briefLooksHtml, paperModel, paperHtml, liveModel, liveHtml, presentHtml, dayMon, reportSummary,
|
|
@@ -805,6 +806,7 @@ function printIt() {
|
|
|
805
806
|
function presentIt() {
|
|
806
807
|
const me = R;
|
|
807
808
|
if (R.cyc || !R.W || R.err) return present(true);
|
|
809
|
+
if (presentInRecording({ kind: R.view === 'deck' ? 'pmos-deck' : 'report', ref: R.row.path, title: R.name, ws: R.ws })) return;
|
|
808
810
|
if (typeof MP.presentMaterial === 'function') {
|
|
809
811
|
const win = typeof MP.openAudience === 'function' ? MP.openAudience() : null;
|
|
810
812
|
const mat = { kind: R.view === 'deck' ? 'pmos-deck' : 'report', ref: R.row.path, title: R.name, ws: R.ws };
|
|
@@ -35,11 +35,13 @@
|
|
|
35
35
|
* openMeeting(ref, { ws }) → opens the card. ref: a note id, { note }, { event, date }, a calendar week row or a brief-page today row. */
|
|
36
36
|
import { open as vOpen, current as vCur, back as vBack, czSummary, czSections } from './cozy-viewer.js';
|
|
37
37
|
import { pmGet, pmPost, pressFetch } from './http.js';
|
|
38
|
+
import { ownTab, bring, tabUrl } from './rec-tab-core.js';
|
|
38
39
|
import { noteSheet, aboutChoices, aboutBody, aboutNow } from './premium-vw-meet.js';
|
|
39
40
|
import { weekView, noteOfRow, sameMeeting, recordable, prevOf, taskEvent, linkBody, mmss, focusView, replayModel, RECORD_LINE, FOCUS_LINE, STOP_LINE, CONSENT_LINE, recCore } from './premium-meeting.js';
|
|
40
41
|
import { APPS, recall, remember } from './listen-sources.js';
|
|
41
42
|
import { replayView, playerHtml, partHtml, keptHtml, phoneHtml, editHtml, mentions, phraseOf as phraseOfPage } from './premium-mtg-replay.js';
|
|
42
43
|
import { announce } from './rec-state.js';
|
|
44
|
+
import { presentInRecording } from './cozy-rec-bridge.js'; // while a meeting records, Present goes to the recording tab (batch 12 item 1, rule 10)
|
|
43
45
|
|
|
44
46
|
const esc = (s) => String(s == null ? '' : s).replace(/[&<>"]/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"' }[c]));
|
|
45
47
|
const clip = (s, n) => { const t = String(s == null ? '' : s).replace(/\s+/g, ' ').trim(); return t.length > n ? t.slice(0, n - 1) + '…' : t; };
|
|
@@ -68,6 +70,8 @@ const MENU = {
|
|
|
68
70
|
fresh: ['New meeting', 'Start an untitled note now'],
|
|
69
71
|
why: ['What Record and Focus do', 'Audio and notes stay on this machine'],
|
|
70
72
|
};
|
|
73
|
+
/** Record and Resume on a page that is not the recording tab: the meeting opens in its own tab, where one press shares it. */
|
|
74
|
+
const TAB_LINE = 'The meeting opens in its own tab. Share it there to start.';
|
|
71
75
|
export const EMPTY_LIVE = 'Press Record when the meeting starts. PMOS listens to your microphone and the meeting sound, and keeps both on this machine.';
|
|
72
76
|
export const EMPTY_NOTES = 'The summary, decisions and next steps are written when you stop recording.';
|
|
73
77
|
export const LIVE_FOOT = 'Transcribed on this machine. Audio and notes stay here.';
|
|
@@ -291,7 +295,7 @@ const SV = { link: '<path d="M10 14a4 4 0 0 0 6 0l3-3a4 4 0 0 0-6-6l-1 1M14 10a4
|
|
|
291
295
|
prod: '<path d="M5 20V11M12 20V5M19 20v-6"/>', ticket: '<path d="M4 7h16v4a2 2 0 0 0 0 4v4H4v-4a2 2 0 0 0 0-4z"/>', warn: '<path d="M12 4l9 16H3zM12 10v4M12 17v.01"/>',
|
|
292
296
|
rec: '<circle cx="12" cy="12" r="5"/>', 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"/>',
|
|
293
297
|
img: '<path d="M4 4.5h16v15H4zM9 10a1.6 1.6 0 1 0 0-.01M20 16l-5-5-8 8"/>', up: '<path d="M12 16V4M7 9l5-5 5 5M5 20h14"/>',
|
|
294
|
-
present: '<path d="M3 4h18v12H3zM10 8.5l4 2.5-4 2.5zM8 20h8M12 16v4"/>' };
|
|
298
|
+
tab: '<path d="M14 4h6v6M20 4l-8 8M18 14v6H4V6h6"/>', present: '<path d="M3 4h18v12H3zM10 8.5l4 2.5-4 2.5zM8 20h8M12 16v4"/>' };
|
|
295
299
|
const svg = (k, w, extra) => `<svg aria-hidden="true" width="${w}" height="${w}" viewBox="0 0 24 24"${extra || ''}>${SV[k]}</svg>`;
|
|
296
300
|
/* bars split by weight (live topics): an SVG, so each length is an attribute and not an inline style */
|
|
297
301
|
function weightBar(cls, parts) {
|
|
@@ -326,13 +330,15 @@ export function summaryHtml(m, ui = {}) {
|
|
|
326
330
|
}
|
|
327
331
|
if (m.mk === 'live') {
|
|
328
332
|
const L = m.live, Fo = m.focus;
|
|
329
|
-
|
|
333
|
+
// a recording in its own tab (rec-tab-core.js) is live, not stale: this page shows it, and its one press brings that tab forward
|
|
334
|
+
const away = m.liveK === 'stale' && ownTab();
|
|
335
|
+
const line = m.liveK === 'rec' || away ? 'Recording · ' + mmss(m.liveMs || 0) : m.liveK === 'paused' ? 'Paused at ' + mmss(m.liveMs || 0) : 'Recording, but not on this page';
|
|
330
336
|
const now = Fo.now ? 'Now on: ' + Fo.now + (Fo.topics.length > 1 ? ', topic ' + (Fo.topics.findIndex((t) => t.now) + 1) + ' of ' + Fo.topics.length + '.' : '.')
|
|
331
337
|
: Fo.error ? 'Focus could not read this meeting: ' + String(Fo.error).replace(/\.$/, '') + '.' : ''; // honest: a refused read says why
|
|
332
|
-
const text = m.liveK === 'paused' ? 'Nothing is kept while paused. ' + now : m.liveK === 'stale' ? 'Nothing is kept until you resume here. ' + now : now;
|
|
333
|
-
const acts = m.liveK === 'rec' ? roundBtn('stop', 'Stop the recording', 'stop', 'red') + roundBtn('hl', 'Highlight the last 30 seconds', 'star') + roundBtn('pause', 'Pause', 'pause')
|
|
338
|
+
const text = m.liveK === 'paused' ? 'Nothing is kept while paused. ' + now : m.liveK === 'stale' && !away ? 'Nothing is kept until you resume here. ' + now : now;
|
|
339
|
+
const acts = away ? roundBtn('rectab', 'Go to the recording tab', 'tab', 'dark') : m.liveK === 'rec' ? roundBtn('stop', 'Stop the recording', 'stop', 'red') + roundBtn('hl', 'Highlight the last 30 seconds', 'star') + roundBtn('pause', 'Pause', 'pause')
|
|
334
340
|
: roundBtn('resume', 'Resume', 'play', 'dark') + roundBtn('stop', 'Stop the recording', 'stop', 'red');
|
|
335
|
-
return czSummary({ line, tone: m.liveK === 'rec' ? 'live' : 'warn', text: text.trim(), extra: metaLine([L.app + ' · microphone and meeting', m.people.length ? plural(m.people.length, 'person', 'people') : '']) + `<div class="vzm-acts">${acts}</div>` });
|
|
341
|
+
return czSummary({ line, tone: m.liveK === 'rec' || away ? 'live' : 'warn', text: text.trim(), extra: metaLine([L.app + ' · microphone and meeting', m.people.length ? plural(m.people.length, 'person', 'people') : '']) + `<div class="vzm-acts">${acts}</div>` });
|
|
336
342
|
}
|
|
337
343
|
const N = m.notes, V = N.replay;
|
|
338
344
|
const text = N.summary || (m.private ? 'This note is private: only what you typed is kept.' : 'No summary was written for this meeting.');
|
|
@@ -715,10 +721,11 @@ async function press(me, e) {
|
|
|
715
721
|
case 'recgo': {
|
|
716
722
|
ui.ask = null; t.disabled = true;
|
|
717
723
|
const res = me.n && !me.row ? await C.resume(me.n.id) : await C.record(me.row);
|
|
718
|
-
say(me, res.ok ? 'Recording. Notes are being taken on this machine. Let people know.' : res.error, res.ok ? '' : 'bad');
|
|
724
|
+
say(me, res.ok ? (res.tab ? TAB_LINE : 'Recording. Notes are being taken on this machine. Let people know.') : res.error, res.ok ? '' : 'bad');
|
|
719
725
|
announce(); return load(me);
|
|
720
726
|
}
|
|
721
|
-
case 'resume': { t.disabled = true; const res = await C.resume(me.n.id); say(me, res.ok ? 'Listening again.' : res.error, res.ok ? '' : 'bad'); announce(); return load(me); }
|
|
727
|
+
case 'resume': { t.disabled = true; const res = await C.resume(me.n.id); say(me, res.ok ? (res.tab ? TAB_LINE : 'Listening again.') : res.error, res.ok ? '' : 'bad'); announce(); return load(me); }
|
|
728
|
+
case 'rectab': if (me.n) bring(tabUrl(me.n.id, { ws: me.ws || '' })); return;
|
|
722
729
|
case 'pause': { ui.ask = null; t.disabled = true; const res = await C.pause(); say(me, res.ok ? 'Paused. You can resume within 1 hour.' : res.error, res.ok ? '' : 'bad'); announce(); return load(me); }
|
|
723
730
|
case 'stop': ui.ask = 'stop'; return repaint(me);
|
|
724
731
|
case 'stopgo': { ui.ask = null; t.disabled = true; const res = await C.stop(me.n.id); say(me, res.ok ? (res.discarded ? 'Nothing was recorded, so the note was deleted.' : 'Stopped. The final notes are written now.') : res.error, res.ok ? '' : 'bad'); announce(); return load(me); }
|
|
@@ -988,6 +995,7 @@ function meetingNow(me) {
|
|
|
988
995
|
const matId = (x) => x.id || x.mkind + '|' + (x.ref || x.url || x.title);
|
|
989
996
|
async function presentIt(me, i, at) {
|
|
990
997
|
const all = (me.model && me.model.material) || [], x = all[i]; if (!x || !x.present) return;
|
|
998
|
+
if (presentInRecording({ ...x, kind: x.mkind || x.kind, ws: x.ws || me.ws })) return; // while a meeting records, the recording tab presents it (rule 10)
|
|
991
999
|
const win = audience(); // before anything is awaited
|
|
992
1000
|
const M = await import('./premium-mtg-present.js');
|
|
993
1001
|
const list = all.filter((y) => y.present), start = list.indexOf(x);
|