create-pmos 0.362.0 → 0.363.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +18 -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/briefing-premium-board-test.js +3 -3
- package/workspace/briefing-premium-calendar-2-test.js +3 -3
- package/workspace/briefing-premium-calendar-3-test.js +6 -5
- package/workspace/briefing-premium-calendar-test.js +3 -2
- package/workspace/briefing-premium-initiative-test.js +3 -3
- package/workspace/briefing-premium-insights-test.js +1 -1
- package/workspace/briefing-premium-test.js +14 -10
- package/workspace/briefing-premium-work-test.js +1 -1
- package/workspace/changelog.json +17 -0
- package/workspace/guide/briefing-premium.md +22 -18
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-studio-test.js +6 -6
- package/workspace/premium-vw-item-test.js +2 -2
- package/workspace/premium-vw-meet-test.js +32 -21
- package/workspace/premium-vw-notes-test.js +5 -5
- package/workspace/premium-vw-rec-test.js +1 -1
- package/workspace/public/pm/premium-meeting.js +28 -29
- package/workspace/public/pm/premium-shell.js +32 -18
- package/workspace/public/pm/premium-vw-meet.css +27 -7
- package/workspace/public/pm/premium-vw-meet.js +31 -16
- package/workspace/public/pm/premium.css +28 -4
- package/workspace/public/premium-board.html +1 -0
- package/workspace/public/premium-initiative.html +1 -0
- package/workspace/public/premium-insights.html +1 -0
- package/workspace/public/premium-work.html +2 -1
- package/workspace/public/premium.html +2 -1
|
@@ -78,7 +78,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
|
78
78
|
s = await st(page);
|
|
79
79
|
ok('R9 the initiative link brings the open initiative tab forward, not a second one', s.on === INI && s.ids.length === 2, JSON.stringify(s));
|
|
80
80
|
await page.keyboard.press('Escape'); await until(() => page.evaluate(() => !document.querySelector('#dlg').classList.contains('on')));
|
|
81
|
-
await page.click('
|
|
81
|
+
await page.click('.rail [data-go="chat"]'); await until(() => page.evaluate(() => document.querySelector('#dlg').classList.contains('on')));
|
|
82
82
|
s = await st(page);
|
|
83
83
|
ok('R9 a new dialog starts with no extra tab; the initiative\'s own dialog offers Open the full record', s.ids.length === 0 && await page.evaluate(() => /Open the full record/.test((document.querySelector('#oMain [data-vwopen]') || {}).textContent || '')), JSON.stringify(s));
|
|
84
84
|
ok('R9 no page error', S.errors.length === 0, S.errors.join(' | '));
|
|
@@ -88,7 +88,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
|
88
88
|
/* R6 a route that is reading, then fails */
|
|
89
89
|
{
|
|
90
90
|
const { page, ctx, S } = await open({ answer: (n) => (n === 1 ? { status: 200, body: { ok: true, state: 'ready', model: MODEL } } : n <= 3 ? { status: 202, body: { ok: true, state: 'reading' } } : { status: 500, body: { ok: false, state: 'error', error: 'the board could not be read' } }) });
|
|
91
|
-
await page.click('
|
|
91
|
+
await page.click('.rail [data-go="chat"]'); await until(() => page.evaluate(() => document.querySelector('#dlg').classList.contains('on')));
|
|
92
92
|
await page.evaluate(() => window.__premiumWorkItem.openWorkItem({ kind: 'initiative', id: 'other-two', title: 'Other' }));
|
|
93
93
|
ok('R6 while the route reads, the tab says so', await until(async () => /Reading the initiative/.test(await paneTxt(page, 'item:ini:other-two')), 3000));
|
|
94
94
|
ok('R6 a failed read says what failed and invents nothing', await until(async () => /could not be read: the board could not be read/.test(await paneTxt(page, 'item:ini:other-two')), 8000), await paneTxt(page, 'item:ini:other-two'));
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
/* premium-vw-meet-test.js — the meeting detail laid out as the console's note sheet (initiative premium-viewer, R3, slice S3; planning/prd/premium-viewer-prd.md).
|
|
4
4
|
* Serves the real Briefing from the real server. The Briefing model, the calendar, the notes and the note (GET /api/notes/one) are answered by stand-ins,
|
|
5
5
|
* so each press can be read off the request the page sent. The routes' own behaviour is in their own suites; the pure half is in premium-vw-meet.test.js.
|
|
6
|
-
*
|
|
6
|
+
* The detail is one scroll: the part that fits the meeting's state comes first and open, the others folded (no Before, During and After switch, PM 2026-10-20).
|
|
7
|
+
* S1 parts · S2 head · S3 After · S4 Make task · S5 Before (with the prep brief) · S6 During · S7 series membership · S8 no note · S9 writes · S10 floors
|
|
7
8
|
* Every wait polls the page; no fixed sleep stands in for a state. */
|
|
8
9
|
const path = require('path');
|
|
9
10
|
const { spawn } = require('child_process');
|
|
@@ -96,27 +97,31 @@ const PNG = Buffer.from('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR
|
|
|
96
97
|
S.up = await until(() => page.evaluate(() => document.querySelectorAll('#rank .rr').length > 0 && document.querySelectorAll('#tl .ev').length > 0), 20000);
|
|
97
98
|
await until(() => page.evaluate(() => document.querySelectorAll('#wkStrip [data-day]').length === 5));
|
|
98
99
|
await page.evaluate(() => { const r = [...document.querySelectorAll('#tl .ev')].find((e) => e.querySelector('b').textContent === 'Weekly sync'); r.click(); });
|
|
99
|
-
S.dlg = await until(() => page.evaluate(() => document.querySelector('#dlg').classList.contains('on') && !!document.querySelector('#oMain .vm-
|
|
100
|
+
S.dlg = await until(() => page.evaluate(() => document.querySelector('#dlg').classList.contains('on') && !!document.querySelector('#oMain .vm-part')));
|
|
100
101
|
SESS.push(S);
|
|
101
102
|
return Object.assign(S, { ctx, page });
|
|
102
103
|
};
|
|
103
|
-
const part = (p, k) => p.evaluate((x) => { const e = document.querySelector(`#oMain .vm-body[data-part="${x}"]`); return e ? { shown:
|
|
104
|
-
const stage = async (p, k) => { await p.click(`#oMain [data-
|
|
104
|
+
const part = (p, k) => p.evaluate((x) => { const e = document.querySelector(`#oMain .vm-body[data-part="${x}"]`); return e ? { shown: e.open, text: e.textContent } : null; }, k);
|
|
105
|
+
const stage = async (p, k) => { if (!((await part(p, k)) || {}).shown) await p.click(`#oMain .vm-body[data-part="${k}"] > summary`); await until(async () => ((await part(p, k)) || {}).shown); };
|
|
106
|
+
const more = async (p) => { if (!(await p.evaluate(() => document.querySelector('#oMain .vm-menu').open))) await p.click('#oMain .vm-menu > summary'); };
|
|
105
107
|
|
|
106
108
|
const A = await open();
|
|
107
|
-
ok('0 the meeting dialog opens with
|
|
109
|
+
ok('0 the meeting dialog opens with its parts in one scroll', A.up && A.dlg);
|
|
108
110
|
if (!A.up || !A.dlg) return finish(1);
|
|
109
111
|
const p = A.page;
|
|
110
112
|
|
|
111
113
|
/* S1 the stage */
|
|
112
|
-
const st = await until(() => p.evaluate(() => { const b = [...document.querySelectorAll('#oMain .vm-
|
|
113
|
-
ok('S1 a meeting with notes
|
|
114
|
+
const st = await until(() => p.evaluate(() => { const b = [...document.querySelectorAll('#oMain .vm-part')]; return b.length === 3 && /migration check/.test(document.querySelector('#oMain').textContent) ? b.map((x) => x.dataset.part + ':' + x.open).join() : null; }));
|
|
115
|
+
ok('S1 a meeting with notes shows Notes first and open, and the other parts folded', st === 'after:true,before:false,during:false', String(st));
|
|
116
|
+
ok('S1 there is no Before, During and After switch', await p.evaluate(() => !document.querySelector('#oMain [data-ph], #oMain .vm-ph')));
|
|
114
117
|
ok('S1 the note was read from GET /api/notes/one for the meeting\'s note', A.oneGets[0] === 'n1', JSON.stringify(A.oneGets));
|
|
115
118
|
|
|
116
119
|
/* S2 the head */
|
|
117
|
-
const head = await p.evaluate(() => ({ lines: [...document.querySelectorAll('#oMain .vm-ln')].map((x) => x.textContent), ser: (document.querySelector('#oMain .vm-ser') || {}).textContent || '', prev: (document.querySelector('#oMain [data-vm="prev"]') || {}).dataset, next: !!document.querySelector('#oMain [data-vm="next"][data-id="n2"]'), sel: !!document.querySelector('#mtgSel') }));
|
|
118
|
-
ok('S2 the head says when the meeting is and
|
|
119
|
-
|
|
120
|
+
const head = await p.evaluate(() => ({ sub: document.querySelector('#dSub').textContent, ppl: (document.querySelector('#oMain [data-vm="ppl"]') || {}).textContent || '', pplHidden: document.querySelector('#oMain .vm-ppl').hidden, about: !!document.querySelector('#oMain .vm-menu [data-vm="about"]'), lines: [...document.querySelectorAll('#oMain .vm-ln')].map((x) => x.textContent), ser: (document.querySelector('#oMain .vm-ser') || {}).textContent || '', prev: (document.querySelector('#oMain [data-vm="prev"]') || {}).dataset, next: !!document.querySelector('#oMain [data-vm="next"][data-id="n2"]'), sel: !!document.querySelector('#mtgSel') }));
|
|
121
|
+
ok('S2 the dialog head says when the meeting is; the detail says its state and folds its people to a count, with Change in More', / to /.test(head.sub) && head.lines.some((l) => /Done/.test(l)) && /^2 people$/.test(head.ppl.trim()) && head.pplHidden && head.about && head.sel, JSON.stringify(head));
|
|
122
|
+
await p.click('#oMain [data-vm="ppl"]');
|
|
123
|
+
ok('S2 the people count opens the names', await until(() => p.evaluate(() => !document.querySelector('#oMain .vm-ppl').hidden && /Dara/.test(document.querySelector('#oMain .vm-ppl').textContent) && /Sam/.test(document.querySelector('#oMain .vm-ppl').textContent))));
|
|
124
|
+
ok('S2 the series line says N of M and pages to the meeting before and after; Not part of this series is in More', /Weekly sync · 2 of 3/.test(head.ser) && head.prev && head.prev.id === 'n0' && head.next && !/Not part of this series/.test(head.ser) && await p.evaluate(() => !!document.querySelector('#oMain .vm-menu [data-vm="serout"]')), head.ser);
|
|
120
125
|
|
|
121
126
|
/* S3 After */
|
|
122
127
|
const af = (await part(p, 'after')).text;
|
|
@@ -143,16 +148,19 @@ const PNG = Buffer.from('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR
|
|
|
143
148
|
const prep = await until(() => p.evaluate(() => { const b = document.querySelector('#oMain .vm-body[data-part="before"] [data-vm-prep]'); return b ? b.textContent : ''; }));
|
|
144
149
|
ok('S5 Before opens with the meeting prep the console card shows: In short and What matters today; the note already carries in the meeting before', /In short/.test(prep) && /Agree what blocks the release/.test(prep) && /What matters today/.test(prep) && /Ship the SSO spike/.test(prep) && !/Since the last one/.test(prep), String(prep).slice(0, 200));
|
|
145
150
|
ok('S5 Before keeps Prepared for you and Material', /Prepared for you/.test(bf) && /Material/.test(bf) && await p.evaluate(() => !!document.querySelector('#mmAdd') && !!document.querySelector('#mmAdd').offsetParent));
|
|
146
|
-
ok('S1
|
|
151
|
+
ok('S1 opening a part keeps the others as they were, and a redraw keeps what was opened', await p.evaluate(() => document.querySelector('#oMain .vm-body[data-part="before"]').open && document.querySelector('#oMain .vm-body[data-part="after"]').open));
|
|
147
152
|
|
|
148
153
|
/* S6 During */
|
|
149
154
|
await stage(p, 'during');
|
|
150
155
|
const du = (await part(p, 'during')).text;
|
|
151
156
|
ok('S6 During lists the transcript with times and the speakers the note names', /01:01/.test(du) && /Dara/.test(du) && /The migration check status is not started\./.test(du) && /You/.test(du), du.slice(0, 200));
|
|
152
|
-
|
|
157
|
+
await more(p);
|
|
158
|
+
ok('S6 Focus and What Record and Focus do are in the More menu', await p.evaluate(() => !!document.querySelector('#oMain .vm-menu [data-m3="focus"]').offsetParent && !!document.querySelector('#oMain .vm-menu [data-m3="why"]').offsetParent));
|
|
159
|
+
await p.click('#oMain .vm-menu [data-m3="why"]');
|
|
160
|
+
ok('S6 What Record and Focus do opens both explanations and closes the menu', await until(() => p.evaluate(() => { const w = document.querySelector('#oMain .acts2 > .why'); return w && !w.hidden && /microphone/.test(w.textContent) && /every 3 seconds/.test(w.textContent) && !document.querySelector('#oMain .vm-menu').open; })));
|
|
153
161
|
|
|
154
162
|
/* S7 series membership */
|
|
155
|
-
await p.click('#oMain [data-vm="serout"]');
|
|
163
|
+
await more(p); await p.click('#oMain .vm-menu [data-vm="serout"]');
|
|
156
164
|
await until(() => A.memberPosts.length === 1);
|
|
157
165
|
ok('S7 Not part of this series posts the note with key off', A.memberPosts[0].id === 'n1' && A.memberPosts[0].key === 'off', JSON.stringify(A.memberPosts));
|
|
158
166
|
ok('S7 the note is read again and the line offers Put it back', await until(() => p.evaluate(() => /Taken out of its series/.test(document.querySelector('#oMain').textContent) && !!document.querySelector('#oMain [data-vm="serback"]'))));
|
|
@@ -162,8 +170,8 @@ const PNG = Buffer.from('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR
|
|
|
162
170
|
/* S2 a meeting of the series opens beside this one as a viewer tab (the frame, premium-viewer S1) */
|
|
163
171
|
await until(() => p.evaluate(() => !!document.querySelector('#oMain [data-vm="prev"][data-id="n0"]')));
|
|
164
172
|
await p.click('#oMain [data-vm="prev"]');
|
|
165
|
-
const tab = await until(() => p.evaluate(() => { const t = document.querySelector('#vTabs'), pane = document.querySelector('#dOut .obody.vw[data-vw="meet-note"]'); return t && !t.hidden && pane && !pane.hidden && /Since the last one/.test(pane.textContent) ? { tabs: [...t.querySelectorAll('.vtab')].map((x) => x.textContent.trim()), main: document.querySelector('#oMain').hidden, ph: [...pane.querySelectorAll('
|
|
166
|
-
ok('S2 the meeting before opens as a viewer tab beside the meeting, with its own
|
|
173
|
+
const tab = await until(() => p.evaluate(() => { const t = document.querySelector('#vTabs'), pane = document.querySelector('#dOut .obody.vw[data-vw="meet-note"]'); return t && !t.hidden && pane && !pane.hidden && /Since the last one/.test(pane.textContent) ? { tabs: [...t.querySelectorAll('.vtab')].map((x) => x.textContent.trim()), main: document.querySelector('#oMain').hidden, ph: [...pane.querySelectorAll('.vm-part')].length } : null; }));
|
|
174
|
+
ok('S2 the meeting before opens as a viewer tab beside the meeting, with its own parts in one scroll', tab && tab.tabs.length === 2 && tab.main && tab.ph === 3 && A.oneGets.includes('n0'), JSON.stringify([tab, A.oneGets]));
|
|
167
175
|
await p.click('#dOut .obody.vw[data-vw="meet-note"] [data-vm="next"]');
|
|
168
176
|
ok('S2 paging in the tab reads the next meeting into the same tab', await until(() => A.oneGets.includes('n2')) && await p.evaluate(() => document.querySelectorAll('#vTabs .vtab').length === 2));
|
|
169
177
|
await p.click('#vTabs .vx');
|
|
@@ -171,8 +179,8 @@ const PNG = Buffer.from('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR
|
|
|
171
179
|
|
|
172
180
|
/* S8 a meeting with no note */
|
|
173
181
|
const Z = await open({ notes: [], note: null });
|
|
174
|
-
const zst = await until(() => Z.page.evaluate(() => { const b = document.querySelector('#oMain
|
|
175
|
-
ok('S8 with no note the detail
|
|
182
|
+
const zst = await until(() => Z.page.evaluate(() => { const b = document.querySelector('#oMain .vm-part'); return b && b.dataset.part === 'before' && b.open && /No notes for this meeting\./.test(document.querySelector('#oMain').textContent); }));
|
|
183
|
+
ok('S8 with no note the detail shows Prep first and open, and the Notes part says there are no notes', zst);
|
|
176
184
|
ok('S8 with no note During says nothing was transcribed, and no note was asked for', /Nothing was transcribed/.test((await part(Z.page, 'during')).text) && Z.oneGets.length === 0 && !(await Z.page.evaluate(() => !!document.querySelector('#oMain .vm-ser'))));
|
|
177
185
|
|
|
178
186
|
/* S9 writes */
|
|
@@ -199,13 +207,16 @@ const PNG = Buffer.from('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR
|
|
|
199
207
|
/* measure once the meeting stylesheet has loaded and the dialog's presses are live, not on the first unstyled frame */
|
|
200
208
|
await until(() => P.page.evaluate(() => document.querySelector('#oMain').dataset.ready === 'meeting' && [...document.styleSheets].some((x) => /premium-vw-meet\.css/.test(x.href || '') && x.cssRules.length > 0)));
|
|
201
209
|
const fl = () => P.page.evaluate(() => ({ scroll: document.documentElement.scrollWidth <= innerWidth + 1 && document.querySelector('#oMain').scrollWidth <= document.querySelector('#oMain').clientWidth + 1,
|
|
202
|
-
btn: [...document.querySelectorAll('#oMain .vm-
|
|
210
|
+
btn: [...document.querySelectorAll('#oMain .vm-sh, #oMain .vm-menu > summary, #oMain .vm-ib, #oMain .vm-lk, #oMain .mtg-task')].filter((b) => b.getClientRects().length).map((b) => Math.round(Math.min(b.getBoundingClientRect().width, b.getBoundingClientRect().height))) }));
|
|
203
211
|
const f0 = await fl();
|
|
204
212
|
if (shotDir) await P.page.screenshot({ path: path.join(shotDir, `after-390-${th}.png`) });
|
|
205
|
-
await P.page
|
|
213
|
+
await stage(P.page, 'before'); const f1 = await fl();
|
|
206
214
|
ok(`S10 at 390 px (${th}) the detail has no sideways scroll and every press is at least 44 px`, f0.scroll && f1.scroll && f0.btn.length > 3 && [...f0.btn, ...f1.btn].every((n) => n >= 44), JSON.stringify([f0, f1]));
|
|
207
|
-
const
|
|
208
|
-
|
|
215
|
+
const head = () => P.page.evaluate(() => ({ shrunk: document.querySelector('#dlg').classList.contains('shrunk'), cmp: document.querySelector('#dlg').classList.contains('cmp'), tabs: getComputedStyle(document.querySelector('#dTabs')).display }));
|
|
216
|
+
const scrollTo = (y) => P.page.evaluate((v) => { document.querySelector('#dOut').scrollTop = v; }, y);
|
|
217
|
+
await scrollTo(400); const s1 = await until(async () => { const h = await head(); return h.shrunk && h.tabs === 'none' ? h : null; });
|
|
218
|
+
await scrollTo(0); const s0 = await until(async () => { const h = await head(); return !h.shrunk && h.tabs !== 'none' ? h : null; });
|
|
219
|
+
ok(`S10 (${th}) on a phone the head shrinks to the title once the detail scrolls, and grows back at the top`, s1 && s0 && s1.cmp, JSON.stringify([s1, s0, await head()]));
|
|
209
220
|
await P.ctx.close();
|
|
210
221
|
}
|
|
211
222
|
ok('S9 no page error in any run', SESS.every((x) => x.errors.length === 0), JSON.stringify(SESS.map((x) => x.errors).filter((e) => e.length)));
|
|
@@ -100,11 +100,11 @@ const NOTE = { id: 'n3', title: 'Call with a partner', state: 'ended', meeting:
|
|
|
100
100
|
/* N5 the note tab */
|
|
101
101
|
await until(() => p.evaluate(() => !!document.querySelector('[data-vn-note="n3"]')));
|
|
102
102
|
await p.click('[data-vn-note="n3"]');
|
|
103
|
-
const tab = await until(() => p.evaluate(() => { const t = document.querySelector('#vTabs'), pane = document.querySelector('#dOut .obody.vw[data-vw="meet-note"]'); return t && !t.hidden && pane && !pane.hidden && /Price SSO in the team plan/.test(pane.textContent) ? { tabs: [...t.querySelectorAll('.vtab')].map((x) => x.textContent.trim()), ph: [...pane.querySelectorAll('.vm-
|
|
104
|
-
ok('N5 a note opens as a viewer tab beside the list,
|
|
103
|
+
const tab = await until(() => p.evaluate(() => { const t = document.querySelector('#vTabs'), pane = document.querySelector('#dOut .obody.vw[data-vw="meet-note"]'); return t && !t.hidden && pane && !pane.hidden && /Price SSO in the team plan/.test(pane.textContent) ? { tabs: [...t.querySelectorAll('.vtab')].map((x) => x.textContent.trim()), ph: [...pane.querySelectorAll('.vm-part')].map((b) => b.dataset.part + ':' + b.open).join(), text: pane.textContent } : null; }));
|
|
104
|
+
ok('N5 a note opens as a viewer tab beside the list, with Notes first and open', tab && tab.tabs.length === 2 && /Notes/.test(tab.tabs[0]) && /Call with a partner/.test(tab.tabs[1]) && /^after:true,before:false/.test(tab.ph), JSON.stringify(tab && { tabs: tab.tabs, ph: tab.ph }));
|
|
105
105
|
ok('N5 the tab has the summary, the Decision and Why table and the next step table from the note', tab && /The partner wants SSO first\./.test(tab.text) && /Two partners asked\./.test(tab.text) && /Send the SSO plan/.test(tab.text) && /Ana/.test(tab.text) && /No meeting/.test(tab.text));
|
|
106
|
-
await p.click('#dOut .obody.vw[data-vw="meet-note"] [data-
|
|
107
|
-
ok('N5
|
|
106
|
+
await p.click('#dOut .obody.vw[data-vw="meet-note"] .vm-body[data-part="before"] > summary');
|
|
107
|
+
ok('N5 Prep says the note has no calendar event', await until(() => p.evaluate(() => { const b = document.querySelector('#dOut .obody.vw[data-vw="meet-note"] .vm-body[data-part="before"]'); return b && b.open && /not linked to a calendar event/.test(b.textContent); })));
|
|
108
108
|
await p.click('#vTabs .vtab[data-vw="main"]');
|
|
109
109
|
await p.click('[data-vn-series="wk"]');
|
|
110
110
|
ok('N5 pressing a series opens its newest note, which says N of M', await until(() => p.evaluate(() => /Weekly sync · 2 of 2/.test((document.querySelector('#dOut .obody.vw[data-vw="meet-note"] .vm-ser') || {}).textContent || ''))) && A.oneGets.includes('n1'));
|
|
@@ -145,7 +145,7 @@ const NOTE = { id: 'n3', title: 'Call with a partner', state: 'ended', meeting:
|
|
|
145
145
|
await P.page.click('[data-vn-fold="wk"]');
|
|
146
146
|
const fl = () => P.page.evaluate(() => { const pane = [...document.querySelectorAll('#oMain, #dOut .obody.vw')].find((x) => !x.hidden) || document.querySelector('#oMain');
|
|
147
147
|
return { scroll: document.documentElement.scrollWidth <= innerWidth + 1 && pane.scrollWidth <= pane.clientWidth + 1,
|
|
148
|
-
btn: [...pane.querySelectorAll('.vn-o, .vn-x, .vn-q, .vm-
|
|
148
|
+
btn: [...pane.querySelectorAll('.vn-o, .vn-x, .vn-q, .vm-sh, .vm-lk')].filter((b) => b.getClientRects().length).map((b) => Math.round(Math.min(b.getBoundingClientRect().width, b.getBoundingClientRect().height))) }; });
|
|
149
149
|
const f0 = await fl();
|
|
150
150
|
if (w === 390) ok(`N8 at 390 px (${th}) the Calendar card header keeps one line and Notes sits under the day`, await P.page.evaluate(() => { const h = document.querySelector('#todayCard .ch'), r = (e) => e.getBoundingClientRect(); const bs = [...h.querySelectorAll('button')].filter((b) => b.getClientRects().length); return !document.querySelector('#vnOpen').getClientRects().length && bs.every((b) => Math.abs(r(b).top - r(bs[0]).top) < 4) && r(document.querySelector('#vnOpenFoot')).height >= 44; }));
|
|
151
151
|
if (shotDir) await P.page.screenshot({ path: path.join(shotDir, `list-${w}-${th}.png`) });
|
|
@@ -149,7 +149,7 @@ const RECORDER = () => {
|
|
|
149
149
|
ok('R3 Cancel keeps the note as it was', await until(() => p.evaluate(() => !document.querySelector('#dOut .vcf'))) && A.privPosts.length === 0);
|
|
150
150
|
|
|
151
151
|
await p.evaluate(() => document.querySelector('#vTabs .vtab').click());
|
|
152
|
-
const dur = await until(() => p.evaluate(() => { const b = document.querySelector('#oMain .vm-body[data-part="during"]'); return b &&
|
|
152
|
+
const dur = await until(() => p.evaluate(() => { const b = document.querySelector('#oMain .vm-body[data-part="during"]'); return b && b.open && b.querySelector('[data-rv-stage] .rvh') ? b.textContent : ''; }));
|
|
153
153
|
ok('R3 the meeting detail opens on During, and During is the live capture: Recording, Highlight, Pause, Stop and your notes', /Recording/.test(dur) && /Highlight/.test(dur) && /Pause/.test(dur) && /Stop/.test(dur) && /Your notes/.test(dur) && await p.evaluate(() => !document.querySelector('#oMain .rvt')), dur.slice(0, 200));
|
|
154
154
|
ok('R3 the During stage and the Live notes tab each label their own notes box', await p.evaluate(() => { const ids = [...document.querySelectorAll('#dOut [data-rv-mine]')].map((t) => t.id); return ids.length === 2 && ids[0] !== ids[1] && ids.every((i) => !!document.querySelector(`label[for="${i}"]`)); }));
|
|
155
155
|
|
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
* GET /api/meeting-material/suggest. The writes are "Link it" (POST /api/calendar-links), Add and Remove material (POST /api/meeting-material) and Make task
|
|
4
4
|
* (POST /api/plan-items). Every word is a field of a record: the pure half (weekView, meetingView, the body builders) takes the routes' answers and returns what the page
|
|
5
5
|
* draws or sends, so a test reads it without a DOM. Recording and Focus are slice 3.
|
|
6
|
-
* The dialog's detail is
|
|
7
|
-
* series line
|
|
8
|
-
|
|
6
|
+
* The dialog's detail is one scroll (PM, 2026-10-20: no Before, During and After switch): a short head with the meeting's state, its people folded to a count,
|
|
7
|
+
* what it is about, its series line, Record and one More menu (Focus, Change what it is about, What Record and Focus do). Then the part that fits the meeting's
|
|
8
|
+
* state, open, and the other parts folded. The parts that come from the meeting's note (GET /api/notes/one) are drawn by premium-vw-meet.js. */
|
|
9
|
+
import { noteSheet, phaseOf, partsHtml, partToggle, partKeep, seriesHtml, stageHtml, wireStage, PHASES, notesTablesHtml, openNoteTab, vmStyle } from './premium-vw-meet.js';
|
|
9
10
|
|
|
10
11
|
const pad = (n) => String(n).padStart(2, '0');
|
|
11
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; };
|
|
@@ -499,18 +500,21 @@ export function mountMeeting(d) {
|
|
|
499
500
|
if (st.mode === 'recording') h = `<div class="m3-row"><span class="m3-dot" aria-hidden="true"></span><b>Recording</b><span class="note" id="m3Clk">${esc(clockText())}</span>${b('pause', 'Pause')}${b('stop', 'Stop')}</div>`;
|
|
500
501
|
else if (st.mode === 'stale') h = `<div class="m3-row"><b>Marked recording</b>${b('resume', 'Resume')}${b('stop', 'Stop')}</div><p class="note">The server holds this meeting as recording, but this page is not capturing audio. Resume starts listening again.</p>`;
|
|
501
502
|
else if (st.mode === 'paused') h = `<div class="m3-row"><b>Paused</b>${n && n.resume_until ? `<span class="note">Open until ${esc(hhmm(n.resume_until))}</span>` : ''}${b('resume', 'Resume')}${b('stop', 'Stop')}</div><p class="note">${esc(RESUME_LINE)}</p>`;
|
|
502
|
-
else if (st.mode
|
|
503
|
-
else if (recordable(row)) h = `<button class="addb pri" data-m3="rec" title="${esc(RECORD_LINE)}">${ic('mic')}Record</button><button class="whyb" data-m3="why" aria-expanded="false">What Record does</button><p class="note why" hidden>${esc(RECORD_LINE)}</p>`;
|
|
503
|
+
else if (recordable(row) && st.mode !== 'ended') h = `<button class="addb pri" data-m3="rec" title="${esc(RECORD_LINE)}">${ic('mic')}Record</button>`; // an ended note shows Done in the head and no Record
|
|
504
504
|
return h + msg;
|
|
505
505
|
}
|
|
506
|
-
|
|
506
|
+
/* Record up front; Focus, the link and the explanations behind one More menu */
|
|
507
|
+
const actsHtml = (row, ui, aboutNow, S) => `<div class="acts2"><div id="m3Rec" class="m3r">${recBarHtml(row, ui)}</div><details class="vm-menu"><summary class="addb" aria-label="More for this meeting" title="More for this meeting">${ic('dots')}More</summary><div class="vm-mn">`
|
|
508
|
+
+ `<button type="button" data-m3="focus" title="${esc(FOCUS_LINE)}">${ic('scale')}Focus</button><button type="button" data-vm="about" aria-expanded="${!!ui.about}">${ic('link')}${aboutNow ? 'Change what it is about' : 'Choose what it is about'}</button>${S && S.series ? `<button type="button" data-vm="serout">${ic('x')}Not part of this series</button>` : ''}<button type="button" data-m3="why" aria-expanded="false">${ic('info')}What Record and Focus do</button></div></details>`
|
|
509
|
+
+ `<div class="note why" hidden><p>${esc(RECORD_LINE)}</p><p>${esc(FOCUS_LINE)}</p></div></div>`;
|
|
507
510
|
|
|
508
511
|
/* the dialog */
|
|
509
512
|
const sec = (label, body) => `<div class="mtg-sec"><span class="label">${esc(label)}</span>${body}</div>`;
|
|
510
513
|
const IC = { spark: '<path d="M12 3l1.8 4.7L18.5 9.5l-4.7 1.8L12 16l-1.8-4.7L5.5 9.5l4.7-1.8z"/>', clock: '<circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2"/>', scale: '<path d="M12 4v16M6 20h12M5 8h14M5 8l-2 6a3 3 0 0 0 4 0zM19 8l-2 6a3 3 0 0 0 4 0z"/>', doc: '<path d="M7 3h7l4 4v14H7zM14 3v4h4"/>', user: '<circle cx="12" cy="8" r="4"/><path d="M4 21c1-4 4-6 8-6s7 2 8 6"/>', link: '<path d="M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1"/>', mic: '<rect x="9" y="3" width="6" height="11" rx="3"/><path d="M5 11a7 7 0 0 0 14 0M12 18v3"/>',
|
|
511
514
|
dec: '<path d="M6 4v8a4 4 0 0 0 4 4h9"/><path d="M15 12l4 4-4 4"/>', task: '<rect x="3" y="4" width="7" height="7" rx="1.5"/><path d="M4.8 7.6l1.4 1.3 2.3-2.6M14 7.5h7M14 17.5h7"/><rect x="3" y="14" width="7" height="7" rx="1.5"/>',
|
|
512
515
|
undo: '<path d="M9 14L4 9l5-5"/><path d="M4 9h11a5 5 0 0 1 0 10h-3"/>', play: '<path d="M7 5l12 7-12 7z"/>', pause: '<path d="M9 5v14M15 5v14"/>', lock: '<rect x="5" y="11" width="14" height="10" rx="2"/><path d="M8 11V8a4 4 0 0 1 8 0v3"/>',
|
|
513
|
-
xp: '<rect x="3" y="4" width="18" height="16" rx="2"/><path d="M9 10l3 3 3-3"/>', search: '<circle cx="11" cy="11" r="6.5"/><path d="M16 16l4 4"/>', back: '<path d="M15 6l-6 6 6 6"/>', plus: '<path d="M12 5v14M5 12h14"/>', x: '<path d="M6 6l12 12M18 6 6 18"/>', check: '<path d="M5 12.5l4.5 4.5L19 7.5"/>'
|
|
516
|
+
xp: '<rect x="3" y="4" width="18" height="16" rx="2"/><path d="M9 10l3 3 3-3"/>', search: '<circle cx="11" cy="11" r="6.5"/><path d="M16 16l4 4"/>', back: '<path d="M15 6l-6 6 6 6"/>', plus: '<path d="M12 5v14M5 12h14"/>', x: '<path d="M6 6l12 12M18 6 6 18"/>', check: '<path d="M5 12.5l4.5 4.5L19 7.5"/>',
|
|
517
|
+
dots: '<circle cx="5" cy="12" r="1.4"/><circle cx="12" cy="12" r="1.4"/><circle cx="19" cy="12" r="1.4"/>', info: '<circle cx="12" cy="12" r="9"/><path d="M12 11v5M12 8v.01"/>' };
|
|
514
518
|
const ic = (n) => `<svg class="i" viewBox="0 0 24 24">${IC[n]}</svg>`;
|
|
515
519
|
const secH = (t, tag, extra) => `<h4 class="sh">${esc(t)}${tag ? ` <small>${esc(tag)}</small>` : ''}${extra || ''}</h4>`;
|
|
516
520
|
const pickLi = (it, key, on) => `<li class="mtg-pick"><span>${esc(clip(it.title, 120))}<em>${esc([it.kind, it.meta].filter(Boolean).join(' · '))}</em></span>${on ? '<span class="mtg-on">Picked</span>' : `<button class="mtg-b" data-pick="${esc(key)}">Pick</button>`}</li>`;
|
|
@@ -523,7 +527,7 @@ export function mountMeeting(d) {
|
|
|
523
527
|
<p class="note" id="mtgMsg" role="status">The link applies to every occurrence of “${esc(r.title)}”. The calendar itself is never written.</p>`;
|
|
524
528
|
const n = v.notes;
|
|
525
529
|
const person = (nm) => `<span class="pp"><i class="av2">${esc(String(nm).trim().charAt(0).toUpperCase())}</i>${esc(clip(nm, 40))}</span>`;
|
|
526
|
-
const prow = (x) => `<div class="prow"><span class="pi${x.ok ? '' : ' w'}">${ic(x.ic)}</span><div><b>${esc(x.l)}</b><div class="pv">${x.about && aboutNow ? '<span>It is about <b>' + esc(aboutNow) + '</b>.</span>' : x.people ? x.people.map(person).join('') : x.chips && x.chips.length ? x.chips.map((c) => `<span class="chp sm">${ic('doc')}${esc(c)}</span>`).join('') : '<span>' + esc(x.text) + '</span>'}</div></div>${x.ok ? '<span class="chp ok sm"><i></i>Ready</span>' : '<span class="chp warn sm"><i></i>Not yet</span>'}</div>`;
|
|
530
|
+
const prow = (x) => `<div class="prow"><span class="pi${x.ok ? '' : ' w'}">${ic(x.ic)}</span><div><b>${esc(x.l)}</b><div class="pv">${x.about && aboutNow ? '<span>It is about <b>' + esc(aboutNow) + '</b>.</span>' : x.people ? x.people.slice(0, 2).map(person).join('') + (x.people.length > 2 ? `<span class="mut">and ${x.people.length - 2} more</span>` : '') : x.chips && x.chips.length ? x.chips.map((c) => `<span class="chp sm">${ic('doc')}${esc(c)}</span>`).join('') : '<span>' + esc(x.text) + '</span>'}</div></div>${x.ok ? '<span class="chp ok sm"><i></i>Ready</span>' : '<span class="chp warn sm"><i></i>Not yet</span>'}</div>`;
|
|
527
531
|
const ready = v.prepReady;
|
|
528
532
|
const prep = secH('Prepared for you', ready === v.prep.length ? 'all ready' : ready + ' of ' + v.prep.length + ' ready') + `<div class="prows">${v.prep.map(prow).join('')}</div>`;
|
|
529
533
|
const mats = v.materialLine ? `<p class="mut">${esc(v.materialLine)}</p>` : `<div class="mats">${v.material.map((m) => `<div class="mat"><span class="kd">${esc(m.kind || 'link')}</span><div><b>${esc(m.title)}</b><small>${esc([m.topic, 'for ' + m.scope].filter(Boolean).join(' · '))}</small></div><span class="mb">${m.preview ? `<button class="ib2 mtg-pv" data-mpv="${m.n}" aria-label="Preview ${esc(m.title)}" title="Preview in the viewer">${ic('doc')}</button>` : ''}${m.removable ? `<button class="ib2 mtg-rm" data-rm="${m.n}" aria-label="Remove ${esc(m.title)}" title="${esc(m.line)}">${ic('x')}</button>` : ''}</span></div>`).join('')}</div>`;
|
|
@@ -536,16 +540,14 @@ export function mountMeeting(d) {
|
|
|
536
540
|
const after = S ? stageHtml('after', S, sx)
|
|
537
541
|
: secH('Notes', v.notesLine ? '' : 'from the meeting note') + (v.notesLine ? `<p class="mut">${esc(v.notesLine)}</p>` : (n.title ? `<p><b>${esc(n.title)}</b></p>` : '') + notesTablesHtml(n, esc, task) + ((n.decisions.length + n.actions.length + n.questions.length) ? '' : '<p class="mut">The note holds no decisions, next steps or questions yet.</p>'))
|
|
538
542
|
+ (v.replay ? secH('Replay', 'kept on this machine') + `<p>A recording is kept: ${v.replay.minutes ? v.replay.minutes + ' min, ' : ''}${v.replay.keyPoints} key ${v.replay.keyPoints === 1 ? 'point' : 'points'}.</p><div class="mtg-foot"><button class="addb pri" data-m3="replay">Replay</button><span class="note">Plays the note’s audio kept on this machine, with the transcript and the key points.</span></div>` : '');
|
|
539
|
-
const chips = statusChips(r, note).map((c) => `<span class="chp${c.kind ? ' ' + c.kind : ''}"><i></i>${esc(c.text)}</span>`).join('');
|
|
543
|
+
const chips = statusChips(r, note).map((c) => `<span class="chp sm${c.kind ? ' ' + c.kind : ''}"><i></i>${esc(c.text)}</span>`).join('');
|
|
540
544
|
const status = ui.status ? `<p class="note mtg-status" id="mtgStatus" role="status">${esc(ui.status.text)}${ui.status.undo ? ' <button class="mtg-b" id="mtgUndo">Undo</button>' : ''}</p>` : '<p class="note mtg-status" id="mtgStatus" role="status" hidden></p>';
|
|
541
|
-
|
|
542
|
-
const
|
|
543
|
-
const lines = `<div class="vm-ln
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
+ part('during', stageHtml('during', S, sx))
|
|
548
|
-
+ part('after', after) + '</article>';
|
|
545
|
+
/* the dialog's own head already says the title, day, time and length: the detail adds the state, the people folded to a count, and what it is about */
|
|
546
|
+
const ppl = v.people.length ? `<button type="button" class="vm-lk vm-ppb" data-vm="ppl" aria-expanded="${!!ui.ppl}">${ic('user')}${v.people.length} ${v.people.length === 1 ? 'person' : 'people'}</button>` : '';
|
|
547
|
+
const lines = `<div class="vm-ln vm-st2">${chips}${ppl}</div>${ppl ? `<div class="pv vm-ppl"${ui.ppl ? '' : ' hidden'}>${v.people.map(person).join('')}</div>` : ''}`
|
|
548
|
+
+ (aboutNow ? `<div class="vm-ln">${ic('link')}<span>It is about <b>${esc(aboutNow)}</b>.${lv && lv.why ? ' ' + esc(lv.why) + '.' : ''}</span></div>` : '') + `<div class="vm-about"${ui.about ? '' : ' hidden'}>${link}</div>`;
|
|
549
|
+
const parts = { before: stageHtml('before', S, sx) + [prep, mat, prev, tops].join(''), during: stageHtml('during', S, sx), after };
|
|
550
|
+
return `<article class="paper doc mtg vm">${status}${lines}${seriesHtml(S, esc, { noOut: true })}${actsHtml(r, ui, aboutNow, S)}${partsHtml(ui.phase || 'before', parts, ui.open, esc)}</article>`;
|
|
549
551
|
}
|
|
550
552
|
function sheetHtml(row) {
|
|
551
553
|
return `<article class="paper doc mtg mtg-sheet"><button class="mtg-b" id="mmBack">Back to the meeting</button>
|
|
@@ -573,12 +575,13 @@ export function mountMeeting(d) {
|
|
|
573
575
|
delete $('#oMain').dataset.ready;
|
|
574
576
|
{ const g = document.getElementById('dlg'); if (g) g.classList.remove('rpw'); } // a Replay left open when the dialog closed
|
|
575
577
|
let replay = null, material = null, extra = { prev: [], topics: [] }, boards = W ? W.boards : [], inis = W ? W.initiatives : [], saved = '';
|
|
576
|
-
const ui = { view: 'detail', status: null, tasked: new Set(), phase: 'before',
|
|
578
|
+
const ui = { view: 'detail', status: null, tasked: new Set(), phase: 'before', open: {} }, SH = { sug: null, found: [], pick: null, scope: 'meeting', q: '', link: '', token: 0, topics: [], topic: null };
|
|
577
579
|
let stT = null, findT = null, undoFn = null;
|
|
578
580
|
const view = () => meetingView(row, replay, material, extra);
|
|
579
581
|
const say = (text, undo) => { clearTimeout(stT); undoFn = undo || null; ui.status = { text, undo: undo || null }; if (ui.view === 'detail') { paint(); stT = setTimeout(() => { ui.status = null; if (ui.view === 'detail') paint(); }, 9000); } else d.toast(text); };
|
|
580
582
|
const paint = () => {
|
|
581
583
|
const pane = $('#dOut'), top = pane ? pane.scrollTop : 0, same = ui.last === ui.view; ui.last = ui.view;
|
|
584
|
+
if (ui.view === 'detail') partKeep($('#oMain'), ui.open); // a part opened or folded before the presses were live stays so
|
|
582
585
|
$('#oMain').innerHTML = ({ add: () => sheetHtml(row), focus: focusHtml, replay: replayHtml }[ui.view] || (() => detailHtml(view(), boards, inis, saved, ui)))();
|
|
583
586
|
if (ui.view === 'add') paintSheet();
|
|
584
587
|
else if (ui.view === 'detail') { const S = view().sheet, sx = { esc, tasked: { has: (i) => ui.tasked.has(i) }, replayBtn: !!view().replay, where: 'meeting', id: S ? S.id : null, brief: extra.brief || null, reread: async () => { await readSheet(); paint(); } }; for (const [k] of PHASES) wireStage(k, $(`#oMain .vm-body[data-part="${k}"]`), S, sx); }
|
|
@@ -756,7 +759,7 @@ export function mountMeeting(d) {
|
|
|
756
759
|
if (res.ok && ui.view === 'detail') d.toast('Recording started.');
|
|
757
760
|
};
|
|
758
761
|
switch (act) {
|
|
759
|
-
case 'why': { const n =
|
|
762
|
+
case 'why': { const n = $('#oMain .acts2 > .why'), on = n && n.hidden; if (n) { n.hidden = !on; t.setAttribute('aria-expanded', String(on)); } return; }
|
|
760
763
|
case 'rec': if (!consented.has(k)) { ui.ask = 'consent'; paintRec(); const g = $('#m3Rec [data-m3="go"]'); if (g) g.focus(); return; } return started('rec');
|
|
761
764
|
case 'go': consented.add(k); return started('rec');
|
|
762
765
|
case 'no': ui.ask = null; paintRec(); { const b = $('#m3Rec [data-m3="rec"]'); if (b) b.focus(); } return;
|
|
@@ -806,15 +809,14 @@ export function mountMeeting(d) {
|
|
|
806
809
|
const one = nt ? await d.pmGet('/api/notes/one?id=' + encodeURIComponent(nt.id)) : null;
|
|
807
810
|
extra = { ...extra, sheet: noteSheet(one) };
|
|
808
811
|
}
|
|
809
|
-
/* The
|
|
812
|
+
/* The part that comes first and open: Recording while the note records, Notes once there are notes, else Prep. */
|
|
810
813
|
function pickPhase() {
|
|
811
|
-
if (ui.picked) return;
|
|
812
814
|
const v = view(), n = v.notes, nt = noteOfRow(NR, row);
|
|
813
815
|
ui.phase = phaseOf({ noteState: nt && nt.state, hasNotes: !!(v.sheet && v.sheet.overview) || !!v.replay || !!(n && n.decisions.length + n.actions.length + n.questions.length) });
|
|
814
816
|
}
|
|
815
817
|
const matPath = () => '/api/meeting-material?event=' + encodeURIComponent(row.id) + '&title=' + encodeURIComponent(row.title) + (row.series ? '&series=' + encodeURIComponent(row.series) : '') + '&date=' + row.day;
|
|
816
818
|
vmStyle();
|
|
817
|
-
d.openDlg({ eye: 'Calendar · real data', title: row.title, sub: [row.day, row.
|
|
819
|
+
d.openDlg({ eye: 'Calendar · real data', title: row.title, sub: [dayLabel(row.day), row.end && hasTime(row.end) ? row.time + ' to ' + hhmm(row.end) : [row.time, row.len].filter(Boolean).join(' · ')].filter(Boolean).join(' · '), compact: true, noteKey: via === 'today' ? 'ev:meeting:' + Date.parse(row.at) : null,
|
|
818
820
|
stream: d.turnA(d.ptx('This meeting is in the calendar PMOS holds. Its notes, material and recording appear here only if PMOS holds them.')), pane: detailHtml(meetingView(row, null, null), boards, inis, '', ui), label: 'Meeting' });
|
|
819
821
|
if (via !== 'today') $('#askF').hidden = true;
|
|
820
822
|
const [rp, mt] = await Promise.all([d.pmGet('/api/meeting-replay?event=' + encodeURIComponent(row.id) + '&date=' + row.day), d.pmGet(matPath())]);
|
|
@@ -878,10 +880,12 @@ export function mountMeeting(d) {
|
|
|
878
880
|
findT = setTimeout(async () => { const r = await d.pmGet('/api/meeting-material/suggest?' + suggestQuery(row, { q: SH.q, ws: d.ws() })); if (my !== SH.token || ui.view !== 'add') return; SH.foundBusy = false; SH.found = r && r.ok && Array.isArray(r.found) ? r.found : []; paintSheet(); }, 220);
|
|
879
881
|
}
|
|
880
882
|
};
|
|
881
|
-
$('#oMain').dataset.ready = 'meeting'; // the dialog's answers are read and its presses are live
|
|
883
|
+
$('#oMain').dataset.ready = 'meeting'; // the dialog's answers are read and its presses are live
|
|
882
884
|
$('#oMain').onchange = (e) => { if (e.target.id === 'mtgSel') $('#mtgLink').disabled = !e.target.value; };
|
|
883
885
|
$('#oMain').onclick = async (e) => {
|
|
886
|
+
if (ui.view === 'detail' && partToggle(e, ui.open)) return;
|
|
884
887
|
const t = e.target.closest('button'); if (!t) return;
|
|
888
|
+
{ const mn = t.closest('.vm-menu'); if (mn) mn.open = false; } // a press in the More menu closes it
|
|
885
889
|
if (t.dataset.m3) return m3Press(t.dataset.m3, t);
|
|
886
890
|
if (t.dataset.rp && repM && RP) { // the Replay's own presses: a mark on the track, the conversation tabs, the key points link and Confirm all
|
|
887
891
|
const k = t.dataset.rp;
|
|
@@ -891,12 +895,7 @@ export function mountMeeting(d) {
|
|
|
891
895
|
if (k === 'confirm') return confirmAll(t);
|
|
892
896
|
return;
|
|
893
897
|
}
|
|
894
|
-
if (t.dataset.
|
|
895
|
-
ui.phase = t.dataset.ph; ui.picked = true;
|
|
896
|
-
$$('#oMain .vm-ph [data-ph]').forEach((b) => b.setAttribute('aria-pressed', String(b === t)));
|
|
897
|
-
$$('#oMain .vm-body[data-part]').forEach((x) => { x.hidden = x.dataset.part !== ui.phase; });
|
|
898
|
-
return;
|
|
899
|
-
}
|
|
898
|
+
if (t.dataset.vm === 'ppl') { ui.ppl = !ui.ppl; t.setAttribute('aria-expanded', String(ui.ppl)); const x = $('#oMain .vm-ppl'); if (x) x.hidden = !ui.ppl; return; }
|
|
900
899
|
if ((t.dataset.vm === 'prev' || t.dataset.vm === 'next') && t.dataset.id) return openNoteTab({ pmGet: d.pmGet, pmPost: d.pmPost, esc, toast: d.toast, task: planTask }, t.dataset.id);
|
|
901
900
|
if (t.dataset.vm === 'about') { ui.about = !ui.about; t.setAttribute('aria-expanded', String(ui.about)); const x = $('#oMain .vm-about'); if (x) x.hidden = !ui.about; if (ui.about) $('#mtgSel').focus(); return; }
|
|
902
901
|
if (t.dataset.vm === 'serout') return member('off');
|
|
@@ -28,21 +28,18 @@ export function flip() {
|
|
|
28
28
|
theme(next); store.set(THEME_KEY, next); tbTheme();
|
|
29
29
|
}
|
|
30
30
|
{ const t = new URLSearchParams(location.search).get('theme') || store.get(THEME_KEY); theme(t); }
|
|
31
|
-
/* ── the top bar (initiative premium-topbar): where you are
|
|
32
|
-
* The menu holds what left the bar: Search,
|
|
31
|
+
/* ── the top bar (initiative premium-topbar): where you are on the left; the Sources chip, the bell and one menu on the right. Chat is
|
|
32
|
+
* the rail's middle place (premium-chat-rail). The menu holds what left the bar: Search, Console, Theme, Settings, and on Board how an initiative opens. Every item keeps
|
|
33
33
|
* the id the pages and the code below wire, so a press does what it did as a round button. ── */
|
|
34
|
-
export const CHAT = '<svg class="i" viewBox="0 0 24 24"><path d="M4 5h16v11h-9l-5 4v-4H4z"/><path d="M12 7.6l.8 1.9 1.9.8-1.9.8-.8 1.9-.8-1.9-1.9-.8 1.9-.8z"/></svg>';
|
|
35
34
|
const MORE = '<svg class="i" viewBox="0 0 24 24"><circle cx="6" cy="12" r="1.3"/><circle cx="12" cy="12" r="1.3"/><circle cx="18" cy="12" r="1.3"/></svg>';
|
|
36
35
|
const TH = [['light', 'Light'], ['dark', 'Dark'], ['auto', 'Auto']];
|
|
37
36
|
function tbMount() {
|
|
38
37
|
const t = $('.tools-top'); if (!t || $('#tbMore')) return;
|
|
39
|
-
const pc = $('#pgChat'); if (pc) pc.innerHTML = CHAT;
|
|
40
38
|
t.insertAdjacentHTML('beforeend', `<button type="button" class="schip" id="srcChip" aria-haspopup="dialog" title="When each source was last read"><i class="sdot" id="srcDot" aria-hidden="true"></i>Sources</button>`
|
|
41
39
|
+ `<span class="mwrap" id="tbMore"><button type="button" class="glass round" id="moreBtn" aria-haspopup="menu" aria-expanded="false" aria-controls="moreMenu" aria-label="More" title="More">${MORE}<i class="mdot" id="moreDot" hidden></i></button>`
|
|
42
40
|
+ '<div class="crmenu tbmenu" id="moreMenu" role="menu" aria-label="More" hidden>'
|
|
43
41
|
+ '<button role="menuitem" id="pvSearch" aria-haspopup="dialog">Search<em>Ctrl K</em></button>'
|
|
44
42
|
+ '<button role="menuitem" id="srcItem" class="tbm-src" aria-haspopup="dialog">Sources</button>'
|
|
45
|
-
+ '<button role="menuitem" id="sessBtn" aria-haspopup="dialog" aria-label="Sessions">Sessions<em id="sessBdg" hidden></em></button>'
|
|
46
43
|
+ '<a role="menuitem" id="toConsole" href="/console.html" aria-label="Open the console">Console</a>'
|
|
47
44
|
+ '<div class="tbrow" id="modeRow" hidden><span>Open initiatives</span></div>'
|
|
48
45
|
+ `<div class="tbrow" role="group" aria-label="Theme"><span>Theme</span><span class="tbseg" id="tbTheme">${TH.map(([k, w]) => `<button role="menuitemradio" data-th="${k}" aria-checked="false">${w}</button>`).join('')}</span></div>`
|
|
@@ -74,7 +71,6 @@ function tbMount() {
|
|
|
74
71
|
e.preventDefault(); L[(i + (e.key === 'ArrowDown' ? 1 : L.length - 1) + (i < 0 ? 1 : 0)) % L.length].focus();
|
|
75
72
|
});
|
|
76
73
|
$('#srcChip').onclick = () => openSources(); $('#srcItem').onclick = () => openSources();
|
|
77
|
-
if (pc) pc.onclick = () => { if (PAGE_CHAT) PAGE_CHAT(); };
|
|
78
74
|
tbReadSrc();
|
|
79
75
|
setInterval(() => { if (!document.hidden) tbReadSrc(); }, 300000);
|
|
80
76
|
}
|
|
@@ -83,7 +79,7 @@ function tbTheme() {
|
|
|
83
79
|
$$('#tbTheme [data-th]').forEach((b) => b.setAttribute('aria-checked', String(b.dataset.th === cur)));
|
|
84
80
|
}
|
|
85
81
|
let PAGE_CHAT = null;
|
|
86
|
-
/** The
|
|
82
|
+
/** The rail's Chat press: fn opens the page's conversation (the Briefing and My work), the board's or the initiative's, or the Studio. */
|
|
87
83
|
export function onPageChat(fn) { PAGE_CHAT = fn; }
|
|
88
84
|
|
|
89
85
|
/* ── Sources: when each source was last read, and a Refresh for each (GET /api/sources, POST /api/sources/refresh, as Data freshness) ──
|
|
@@ -206,12 +202,20 @@ export function openDlg(o) {
|
|
|
206
202
|
$('#oMain').innerHTML = o.pane || `<article class="paper doc">${o.html}</article>`; $('#oLab').textContent = o.label || 'Detail'; vwReset(); // extra viewer tabs belong to the dialog that opened them
|
|
207
203
|
$('#dBody').innerHTML = `<div class="stream" role="log">${o.stream || turnA(ptx(o.say))}</div><form class="askbar" id="askF"><div class="slashm" id="slashM" role="listbox" aria-label="Commands" hidden></div>${padMarkup()}<textarea id="askIn" rows="1" placeholder="Message Claude, or type /" maxlength="8000" autocomplete="off" enterkeyhint="send" aria-label="A message for Claude" aria-controls="slashM"></textarea><button type="submit" data-act="ask" id="askGo" aria-label="Send to Claude" title="Send to Claude"><svg class="i" viewBox="0 0 24 24"><path d="M5 12h14M13 6l6 6-6 6"/></svg></button></form><div class="askfoot"><p class="fine2" id="askNote">${CHAT_NOTE}</p>${padChipMarkup()}</div>`;
|
|
208
204
|
mountPad({ key: S.key, ws: new URLSearchParams(location.search).get('ws'), input: $('#askIn') });
|
|
205
|
+
$('#dlg').classList.toggle('cmp', !!o.compact); $('#dlg').classList.remove('shrunk'); // compact: a short head on a phone that shrinks as the detail scrolls
|
|
209
206
|
$('#dlg').classList.remove('full'); setMode('split'); setTab('out'); // on a phone the dialog opens on the Detail tab and the Detail / Conversation switch brings the conversation, as the mockup draws it
|
|
210
207
|
$('#veil').classList.add('on'); $('#dlg').classList.add('on');
|
|
211
208
|
$$('#dGrid .pane').forEach((p) => { p.scrollTop = 0; });
|
|
212
209
|
railOnOpen(o);
|
|
213
210
|
setTimeout(() => $('#dlg').focus(), 60);
|
|
214
211
|
}
|
|
212
|
+
/* A compact dialog on a phone: once the detail scrolls, the head keeps only the title and the tools, so the detail gets the screen.
|
|
213
|
+
* It shrinks only when the detail is much taller than its pane, so the smaller head cannot end the scroll and grow back. */
|
|
214
|
+
$('#dOut').addEventListener('scroll', () => {
|
|
215
|
+
const g = $('#dlg'), p = $('#dOut'); if (!g.classList.contains('cmp') || innerWidth >= 1000) return;
|
|
216
|
+
if (p.scrollTop > 48 && p.scrollHeight - p.clientHeight > 200) g.classList.add('shrunk');
|
|
217
|
+
else if (p.scrollTop < 8) g.classList.remove('shrunk');
|
|
218
|
+
}, { passive: true });
|
|
215
219
|
export function closeDlg() {
|
|
216
220
|
clearTimeout(threadTimer); S.key = null; flushPad(); railOnClose();
|
|
217
221
|
park();
|
|
@@ -496,11 +500,18 @@ function mountRecChip(here) {
|
|
|
496
500
|
export function wireRail(here) {
|
|
497
501
|
mountRecChip(here);
|
|
498
502
|
const rail = $('.rail');
|
|
499
|
-
rail.
|
|
500
|
-
|
|
503
|
+
// premium-chat-rail: five places with Chat in the middle. The phone bar slides by whole places (--pi); the desktop rail's Chat is taller, so
|
|
504
|
+
// the indicator there is placed at the current place's own top (--py).
|
|
505
|
+
const cur = $(`.rail [data-go="${here}"]`), all = $$('.rail .pl');
|
|
506
|
+
rail.style.setProperty('--pi', String(all.indexOf(cur)));
|
|
507
|
+
const place = () => { if (cur) rail.style.setProperty('--py', (cur.offsetTop - all[0].offsetTop) + 'px'); };
|
|
508
|
+
place(); addEventListener('resize', place);
|
|
509
|
+
$$('.rail [data-go]').forEach((b) => { b.onclick = () => { if (b.dataset.go === 'chat') { railChat(); return; } if (b.dataset.go !== here) location.assign(GO[b.dataset.go]); }; });
|
|
501
510
|
}
|
|
511
|
+
/** The rail's Chat: the page's own conversation (its Sessions chip and full screen reach the other sessions); with none, the session list. */
|
|
512
|
+
function railChat() { if (PAGE_CHAT) PAGE_CHAT(); else openSessions(); }
|
|
502
513
|
|
|
503
|
-
/* ── the crumb: where you are
|
|
514
|
+
/* ── the crumb: where you are and a menu to switch board or initiative. Its Chat moved to the rail (premium-chat-rail); o.ask is the rail's press ── */
|
|
504
515
|
export function crumbHtml(o) {
|
|
505
516
|
const chev = (id, label, show) => `<button id="${id}" class="cri" aria-haspopup="menu" aria-expanded="false" aria-label="${esc(label)}"${show ? '' : ' hidden'}>${CHEV}</button>`;
|
|
506
517
|
const menu = '<div id="crMenu" class="crmenu" role="menu" hidden></div>';
|
|
@@ -508,9 +519,9 @@ export function crumbHtml(o) {
|
|
|
508
519
|
const left = o.ini
|
|
509
520
|
? `<button id="crBoard" class="glass round crback" aria-label="Back to ${esc(o.board)}" title="Back to ${esc(o.board)}"><svg class="i" viewBox="0 0 24 24"><path d="m14 6-6 6 6 6"/></svg></button><nav class="crumb" aria-label="Where you are"><span id="crIni" aria-current="page">${esc(o.ini)}</span>${chev('crSw2', 'Switch initiative', o.siblings && o.siblings.length > 1)}${menu}</nav>`
|
|
510
521
|
: `<nav class="crumb" aria-label="Where you are">${o.page ? `<span class="crpg">${esc(o.page)}</span>` : ''}<button id="crBoard" aria-current="page" disabled>${esc(o.board)}</button>${chev('crSw', 'Switch board', o.boards && o.boards.length > 1)}${menu}</nav>`;
|
|
511
|
-
return `<div class="where">${left}
|
|
522
|
+
return `<div class="where">${left}</div>`;
|
|
512
523
|
}
|
|
513
|
-
/** o: { boards: [{ws,id,name}], board: id, siblings: [{id,title}], ini: id, goBoard(ws, id), goIni(id), ask() }. Escape and a click outside close the menu; the arrows move in it. */
|
|
524
|
+
/** o: { boards: [{ws,id,name}], board: id, siblings: [{id,title}], ini: id, goBoard(ws, id), goIni(id), ask() — the rail's Chat }. Escape and a click outside close the menu; the arrows move in it. */
|
|
514
525
|
export function wireCrumb(o) {
|
|
515
526
|
const menu = $('#crMenu'); if (!menu) return;
|
|
516
527
|
const close = () => { menu.hidden = true; $$('#crSw,#crSw2').forEach((b) => b.setAttribute('aria-expanded', 'false')); };
|
|
@@ -536,7 +547,7 @@ export function wireCrumb(o) {
|
|
|
536
547
|
if (e.key === 'Escape') { const k = menu.dataset.k === 'b' ? b1 : b2; close(); if (k) k.focus(); }
|
|
537
548
|
if (e.key === 'ArrowDown' || e.key === 'ArrowUp') { e.preventDefault(); const L = $$('button', menu), i = L.indexOf(document.activeElement); L[(i + (e.key === 'ArrowDown' ? 1 : L.length - 1)) % L.length].focus(); }
|
|
538
549
|
});
|
|
539
|
-
|
|
550
|
+
if (o.ask) onPageChat(o.ask);
|
|
540
551
|
}
|
|
541
552
|
|
|
542
553
|
/* ── Add a document: the dialog the Board and the initiative page share (initiative briefing-premium-adddoc) ──────────────────────────────────
|
|
@@ -1067,16 +1078,19 @@ $('#oMain').addEventListener('click', async (e) => {
|
|
|
1067
1078
|
cardDraw(r);
|
|
1068
1079
|
}
|
|
1069
1080
|
});
|
|
1070
|
-
|
|
1081
|
+
/* The rail's Chat carries the count the ⋯ menu's Sessions used to: a dot when a session is Ready or Maybe blocked (premium-chat-rail C5). */
|
|
1082
|
+
function sessBadge(n) {
|
|
1083
|
+
const a = $('.rail [data-go="chat"]'); if (!a) return;
|
|
1084
|
+
const d = $('.cdot', a); if (d) d.hidden = !n;
|
|
1085
|
+
a.setAttribute('aria-label', n ? 'Chat, ' + n + (n === 1 ? ' session needs you' : ' sessions need you') : 'Chat');
|
|
1086
|
+
}
|
|
1071
1087
|
{
|
|
1072
|
-
|
|
1073
|
-
if (b) {
|
|
1074
|
-
b.onclick = () => openSessions();
|
|
1088
|
+
if ($('.rail [data-go="chat"]')) {
|
|
1075
1089
|
const poll = async () => { if (document.hidden || railShowing()) return; const s = await pmGet('/api/sessions').catch(() => null); if (s && Array.isArray(s.sessions)) { R.rows = s.sessions; sessBadge(menuCount(R.rows)); } };
|
|
1076
1090
|
poll(); setInterval(poll, BADGE_POLL);
|
|
1077
1091
|
}
|
|
1078
1092
|
}
|
|
1079
|
-
/** The
|
|
1093
|
+
/** The session list on its own (the rail's Chat on a page with no conversation): the chat panel, full screen with the list (the list itself on a phone), on the session that needs you most. */
|
|
1080
1094
|
export async function openSessions() {
|
|
1081
1095
|
openDlg({ eye: 'Sessions', title: 'Sessions', say: 'Pick a session from the list.', stream: turnA(ptx('Pick a session from the list. A dot shows its state: Ready, Running or Maybe blocked.')), noteKey: null, sessions: true, pane: '<article class="paper doc"><p class="note">Pick a session from the list.</p></article>', label: 'Session' });
|
|
1082
1096
|
$('#askF').hidden = true;
|
|
@@ -18,11 +18,31 @@
|
|
|
18
18
|
.vm .vm-ib .i{width:16px;height:16px}
|
|
19
19
|
.vm .vm-lk{min-height:36px;padding:0 8px;border-radius:6px;font-size:var(--fs-2);font-weight:500;color:var(--ink-3);text-decoration:underline;text-underline-offset:3px}
|
|
20
20
|
@media (hover:hover){.vm .vm-lk:hover{color:var(--ink)}}
|
|
21
|
-
.vm .vm-
|
|
22
|
-
|
|
23
|
-
.vm .vm-
|
|
24
|
-
.vm .vm-
|
|
25
|
-
.vm .vm-
|
|
21
|
+
.vm .vm-sh:focus-visible,.vm .vm-menu>summary:focus-visible,.vm .vm-mn button:focus-visible,.vm .vm-ib:focus-visible,.vm .vm-lk:focus-visible{outline:2px solid var(--ember);outline-offset:2px}
|
|
22
|
+
/* the parts as one scroll: each part a fold with a plain head (no Before, During and After switch) */
|
|
23
|
+
.vm .vm-part{margin:14px 0 0;border-top:1px solid var(--hair)}
|
|
24
|
+
.vm .vm-part>summary.vm-sh{list-style:none;display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:48px;cursor:pointer;font-size:var(--fs-3);font-weight:600;color:var(--ink);border-radius:6px}
|
|
25
|
+
.vm .vm-part>summary::-webkit-details-marker{display:none}
|
|
26
|
+
.vm .vm-part>summary::after{content:"";flex:none;width:8px;height:8px;margin:0 6px 4px 0;border-right:1.6px solid var(--ink-3);border-bottom:1.6px solid var(--ink-3);transform:rotate(45deg);transition:transform .2s}
|
|
27
|
+
.vm .vm-part[open]>summary::after{margin-bottom:-4px;transform:rotate(-135deg)}
|
|
28
|
+
.vm .vm-part[open]{padding-bottom:6px}
|
|
29
|
+
/* the head: the state chip and the people folded to a count */
|
|
30
|
+
.vm .vm-st2{margin-top:2px}
|
|
31
|
+
.vm .vm-ppb{display:inline-flex;align-items:center;gap:6px}
|
|
32
|
+
.vm .vm-ppb .i{width:15px;height:15px}
|
|
33
|
+
.vm .vm-ppl{margin:8px 0 2px}
|
|
34
|
+
.vm .vm-ppl[hidden]{display:none}
|
|
35
|
+
/* More: Focus, the link and the explanations behind one menu */
|
|
36
|
+
.vm .vm-menu{position:relative}
|
|
37
|
+
.vm .vm-menu>summary{list-style:none;cursor:pointer}
|
|
38
|
+
.vm .vm-menu>summary::-webkit-details-marker{display:none}
|
|
39
|
+
.vm .vm-mn{position:absolute;z-index:6;top:calc(100% + 6px);left:0;min-width:250px;display:flex;flex-direction:column;gap:2px;padding:6px;border-radius:8px;background:var(--card-solid,var(--card));box-shadow:inset 0 0 0 1px var(--hair),0 18px 40px -18px rgba(20,24,60,.45)}
|
|
40
|
+
.vm .vm-mn button{display:flex;align-items:center;gap:10px;min-height:44px;padding:0 12px;border-radius:6px;text-align:left;font-size:var(--fs-3);color:var(--ink)}
|
|
41
|
+
.vm .vm-mn button .i{width:16px;height:16px;color:var(--ink-3)}
|
|
42
|
+
@media (hover:hover){.vm .vm-mn button:hover{background:var(--well)}}
|
|
43
|
+
.vm .acts2>.why{flex:1 1 100%}
|
|
44
|
+
.vm .acts2>.why p{margin:0 0 6px}
|
|
45
|
+
.vm .acts2>.why[hidden]{display:none}
|
|
26
46
|
.vm .vm-bx{background:var(--card-solid,var(--card));border:1px solid var(--hair);border-radius:8px;box-shadow:var(--card-shadow);padding:14px 18px;margin:0 0 12px;font-size:var(--fs-3);line-height:1.5}
|
|
27
47
|
.vm .vm-cap{display:flex;align-items:center;gap:8px;font:600 var(--fs-1) var(--mono);letter-spacing:.08em;text-transform:uppercase;color:var(--ink-3);padding:0 0 10px;margin:0 0 6px;border-bottom:1px solid var(--hair)}
|
|
28
48
|
.vm .vm-cap .i{width:14px;height:14px}
|
|
@@ -77,9 +97,9 @@
|
|
|
77
97
|
.vm .vm-fold{margin-top:14px;border-top:1px solid var(--hair);padding-top:10px}
|
|
78
98
|
.vm .vm-fold summary{cursor:pointer;min-height:36px;display:flex;align-items:center;font-size:var(--fs-2);font-weight:600;color:var(--ink-2)}
|
|
79
99
|
@media (max-width:700px){
|
|
80
|
-
.vm .vm-
|
|
100
|
+
.vm .vm-ib,.vm .vm-lk,.vm .vm-pill,.vm .vm-fold summary{min-height:44px}
|
|
81
101
|
.vm .vm-ib{width:44px;height:44px}
|
|
82
|
-
|
|
102
|
+
|
|
83
103
|
.vm .vm-tb thead{display:none}
|
|
84
104
|
.vm .vm-tb tr{display:grid;grid-template-columns:1fr auto;gap:2px 10px;padding:8px 0;border-bottom:1px solid var(--hair)}
|
|
85
105
|
.vm .vm-tb td{border:0;padding:0}
|