create-pmos 0.328.0 → 0.329.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.
@@ -8,10 +8,13 @@
8
8
  * fold(lines) → { [board]: [{ id, board, name, purpose, charts, main, at }] } PURE
9
9
  * list(root, board) → the dashboards of one board, the main one first, then in the order they were made
10
10
  * save(root, input, actor, { now, known }) → { ok: true, dashboard, dashboards } | { ok: false, status, error }
11
+ * pinned(root, board) → the id of the board's pinned dashboard ('all' for All measures, or a saved id) | null
12
+ * pin(root, input, actor, { now }) → { ok: true, pinned } | { ok: false, status, error } input = { board, id: 'all' | saved id | null }
11
13
  *
12
14
  * THE LEDGER. Lines { v: 1, ev: save | remove, id, board, name, purpose, charts, main, actor, at }. `board` is the board's id in the workspace whose
13
15
  * state folder holds the file. `charts` is an ordered list of KR metric ids. The fold keeps the last save of each id and drops an id once it is removed.
14
- * One dashboard per board is main: the latest save that says main wins, and the others read as not main. The file is never rewritten. A torn line, or one
16
+ * One dashboard per board is main (the pinned one, initiative insights-one-list L4): the latest save that says main, or the latest `pin` line, wins, and the
17
+ * others read as not main. A `pin` line { v, ev: 'pin', board, id, actor, at } names 'all' (All measures), a saved id, or null (nothing pinned). The file is never rewritten. A torn line, or one
15
18
  * without an id and a board, is skipped. This store is the premium page's own: the console's dashboard layouts (lib/report-dashboards.js) are not touched.
16
19
  */
17
20
  const fs = require('fs');
@@ -39,7 +42,7 @@ function readLines(file) {
39
42
  const out = [];
40
43
  for (const raw of text.split('\n')) {
41
44
  if (!raw.trim()) continue;
42
- try { const l = JSON.parse(raw); if (isObj(l) && (l.ev === 'save' || l.ev === 'remove') && typeof l.id === 'string' && typeof l.board === 'string') out.push(l); } catch { /* a torn line is skipped */ }
45
+ try { const l = JSON.parse(raw); if (isObj(l) && typeof l.board === 'string' && (((l.ev === 'save' || l.ev === 'remove') && typeof l.id === 'string') || (l.ev === 'pin' && (l.id === null || typeof l.id === 'string')))) out.push(l); } catch { /* a torn line is skipped */ }
43
46
  }
44
47
  return out;
45
48
  }
@@ -73,11 +76,13 @@ function check(input) {
73
76
 
74
77
  /** Every board's dashboards after the ledger's lines, in order. PURE. The main one of a board is the last one saved with main; a later save of that
75
78
  * same dashboard without main, or its removal, leaves the board with none. */
76
- function fold(lines) {
79
+ function fold(lines) { return walk(lines).out; }
80
+ function walk(lines) {
77
81
  const byId = new Map(); // id → dashboard; `first` keeps the order they were first made
78
82
  const mainOf = new Map(); // board → id
79
83
  let made = 0;
80
84
  for (const l of lines || []) {
85
+ if (l.ev === 'pin') { if (l.id === null) mainOf.delete(l.board); else mainOf.set(l.board, l.id); continue; }
81
86
  const prev = byId.get(l.id);
82
87
  if (prev && prev.board !== l.board) continue; // an id never moves between boards
83
88
  if (l.ev === 'remove') { byId.delete(l.id); if (mainOf.get(l.board) === l.id) mainOf.delete(l.board); continue; }
@@ -91,10 +96,25 @@ function fold(lines) {
91
96
  .sort((a, z) => (z.main - a.main) || (a.first - z.first))
92
97
  .map(({ id, board, name, purpose, charts, main, at }) => ({ id, board, name, purpose, charts, main, at }));
93
98
  }
94
- return out;
99
+ return { out, mainOf };
95
100
  }
96
101
 
97
102
  const list = (root, board) => fold(readLines(ledgerFile(root)))[board] || [];
103
+ const pinned = (root, board) => walk(readLines(ledgerFile(root))).mainOf.get(board) || null;
104
+
105
+ /** Pin a dashboard to the top of Insights, or unpin (id null). 'all' is All measures; any other id must be a saved dashboard of the board. */
106
+ function pin(root, input, actor, { now } = {}) {
107
+ const i = isObj(input) ? input : {};
108
+ const board = typeof i.board === 'string' ? i.board : '';
109
+ if (!ID_RE.test(board)) return refuse(400, 'Name the board the dashboard belongs to.');
110
+ const id = i.id == null || i.id === '' ? null : i.id;
111
+ if (id !== null && (typeof id !== 'string' || !ID_RE.test(id))) return refuse(400, 'That dashboard id is not valid.');
112
+ if (id !== null && id !== 'all' && !list(root, board).some((d) => d.id === id)) return refuse(404, 'That dashboard is not on this board.');
113
+ const file = ledgerFile(root), t = now == null ? Date.now() : now;
114
+ fs.mkdirSync(path.dirname(file), { recursive: true });
115
+ fs.appendFileSync(file, JSON.stringify({ v: 1, ev: 'pin', board, id, actor: actor || null, at: new Date(t).toISOString() }) + '\n');
116
+ return { ok: true, pinned: pinned(root, board) };
117
+ }
98
118
 
99
119
  /** THE SINGLE WRITER of premium-dashboards.jsonl. `v`, `id` (for a new one) and `at` are set here.
100
120
  * known = { charts: Set of KR metric ids of the workspace } — a chart outside it is refused. */
@@ -124,4 +144,4 @@ function save(root, input, actor, { now, known } = {}) {
124
144
  return { ok: true, dashboard: v.remove ? null : after.find((d) => d.id === line.id) || null, dashboards: after };
125
145
  }
126
146
 
127
- module.exports = { NAME_MAX, PURPOSE_MAX, CHARTS_MAX, ADVISED_MAX, ledgerFile, readLines, check, fold, list, save };
147
+ module.exports = { NAME_MAX, PURPOSE_MAX, CHARTS_MAX, ADVISED_MAX, ledgerFile, readLines, check, fold, list, pinned, pin, save };
@@ -8,7 +8,8 @@
8
8
  * premium-studio-chart adds the board's saved charts (lib/premium-charts.js list).
9
9
  * briefing-premium-reports adds the board's saved dashboards (lib/premium-dashboards.js list) and the workspace's GET /api/report-setups answer
10
10
  * (setups, findings, asks). That GET is the console's own read: like the console, it may move old dashboard schedules into recurring reports once
11
- * per repository. This route itself writes nothing. The page's presses post to /api/report-setups/* and /api/premium-dashboards/save. */
11
+ * per repository. insights-one-list adds the pinned dashboard (lib/premium-dashboards.js pinned) and the opening sentence of each report file, read here
12
+ * from the workspace's repository. This route itself writes nothing. The page's presses post to /api/report-setups/* and /api/premium-dashboards/save. */
12
13
  const Insights = require('./insights-premium.js');
13
14
  const boards = require('./routes-boards.js');
14
15
  const strategy = require('./routes-c3-strategy.js');
@@ -26,6 +27,19 @@ async function via(mod, pathAndQuery, req, ctx) {
26
27
  const handled = await mod.handle({ method: 'GET', headers: (req && req.headers) || {} }, {}, u, c);
27
28
  return handled === false ? { status: 404, body: null } : out;
28
29
  }
30
+ /** The opening sentence of each listed report file (insights-one-list L6), read from the workspace's repository. A file that cannot be read has none. */
31
+ const LEADS_MAX = 60;
32
+ function leadsOf(ctx, ws, list) {
33
+ const out = {};
34
+ let root = null;
35
+ try { root = require('path').resolve(ctx.getWs(ws).root); } catch { return out; }
36
+ for (const r of list.slice().sort((a, b) => String(b.slot).localeCompare(String(a.slot))).slice(0, LEADS_MAX)) {
37
+ const rel = String(r.path || '');
38
+ if (!rel || rel.includes('..') || require('path').isAbsolute(rel)) continue;
39
+ try { out[rel] = Insights.leadOf(require('fs').readFileSync(require('path').join(root, rel), 'utf8').slice(0, 20000)); } catch { /* an unreadable file has no lead */ }
40
+ }
41
+ return out;
42
+ }
29
43
  const qs = (o) => '?' + Object.entries(o).filter(([, v]) => v != null && v !== '').map(([k, v]) => k + '=' + encodeURIComponent(v)).join('&');
30
44
 
31
45
  module.exports = {
@@ -49,16 +63,17 @@ module.exports = {
49
63
  } catch (e) { return fail('the KR metric records could not be read: ' + ((e && e.message) || e)); }
50
64
  const reportsOk = !!(rp.body && rp.body.ok !== false);
51
65
  const missing = reportsOk ? [] : ['reports'];
52
- let saved = [], mine = [];
53
- if (pick && pick.id) { try { saved = PD.list(require('path').resolve(ctx.getWs(pick.ws).root), pick.id); } catch { missing.push('dashboards'); } }
66
+ let saved = [], mine = [], pinned = null;
67
+ if (pick && pick.id) { try { const root = require('path').resolve(ctx.getWs(pick.ws).root); saved = PD.list(root, pick.id); pinned = PD.pinned(root, pick.id); } catch { missing.push('dashboards'); } }
54
68
  if (pick && pick.id) { try { mine = require('./premium-charts.js').list(require('path').resolve(ctx.getWs(pick.ws).root), pick.id); } catch { missing.push('saved charts'); } }
55
69
  const su = await via(setups, '/api/report-setups' + q, req, ctx).catch(() => ({ status: 500, body: null }));
56
70
  const setupsOk = su.status === 200 && !!su.body && Array.isArray(su.body.setups);
57
71
  if (!setupsOk) missing.push('report setups');
72
+ const leads = reportsOk ? leadsOf(ctx, ws, rp.body.reports || []) : {};
58
73
  const model = Insights.build({
59
74
  now: Date.now(), board: pick ? { ws: pick.ws, id: pick.id, name: pick.name } : { ws, id: null, name: 'Insights' }, boards: all.map((x) => ({ ws: x.ws, id: x.id, name: x.name })),
60
75
  outcomes, reports: reportsOk ? rp.body.reports || [] : [], reportsOk, missing, saved, mine,
61
- setups: setupsOk ? su.body : null,
76
+ setups: setupsOk ? su.body : null, pinned, leads,
62
77
  });
63
78
  ctx.json(res, { ok: true, state: 'ready', model, as_of: Date.now() });
64
79
  return true;
@@ -4,6 +4,9 @@
4
4
  * POST /api/premium-dashboards/save { ws, board, id?, name, purpose, charts, main, remove? } → { ok, dashboard, dashboards }
5
5
  * one `save` or `remove` line in <state>/premium-dashboards.jsonl (lib/premium-dashboards.js, the one writer)
6
6
  *
7
+ * POST /api/premium-dashboards/pin { ws, board, id: 'all' | saved id | null } → { ok, pinned } (initiative insights-one-list L4)
8
+ * one `pin` line in the same ledger: the dashboard shown at the top of Insights, and nowhere else
9
+ *
7
10
  * The page reads the dashboards through GET /api/insights-premium, so this module has no GET.
8
11
  *
9
12
  * WHO WRITES. The POST refuses a request that carries an agent session header (403), as routes-custom-docs.js does, and passes pm-guard
@@ -33,7 +36,8 @@ function krIds(ctx, ws) {
33
36
 
34
37
  async function handle(req, res, url, ctx) {
35
38
  const send = (r) => { ctx.json(res, r.body, r.status); return true; };
36
- if (url.pathname !== '/api/premium-dashboards/save') return send(bad(404, 'no such premium-dashboards route'));
39
+ const isPin = url.pathname === '/api/premium-dashboards/pin';
40
+ if (url.pathname !== '/api/premium-dashboards/save' && !isPin) return send(bad(404, 'no such premium-dashboards route'));
37
41
  if (req.method !== 'POST') return send(bad(405, 'POST only'));
38
42
  const read = await ctx.readJson(req);
39
43
  if (!read.ok) return send(bad(400, 'the body is not JSON'));
@@ -43,6 +47,13 @@ async function handle(req, res, url, ctx) {
43
47
  if (!g.ok) return send(bad(g.status, g.error));
44
48
  const w = wsOf(ctx, text(body.ws));
45
49
  if (!w) return send(bad(404, 'no such workspace'));
50
+ if (isPin) {
51
+ const ids = boardIds(ctx, w);
52
+ if (!ids) return send(bad(503, 'The boards could not be read. Try again in a moment.'));
53
+ if (!ids.has(text(body.board))) return send(bad(404, 'no such board in this workspace'));
54
+ const r = PD.pin(w.root, body, g.actor, { now: Date.now() });
55
+ return send(r.ok ? { status: 200, body: { ok: true, pinned: r.pinned } } : bad(r.status, r.error));
56
+ }
46
57
  const c = PD.check(body);
47
58
  if (!c.ok) return send(bad(c.status, c.error));
48
59
  const ids = boardIds(ctx, w);
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.328.0",
3
+ "version": "0.329.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.328.0",
9
+ "version": "0.329.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@xterm/addon-fit": "^0.11.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.328.0",
3
+ "version": "0.329.0",
4
4
  "private": true,
5
5
  "description": "PMOS Terminal Workspace — local companion hosting real PTYs beside the library and gates (D62)",
6
6
  "license": "MIT",
@@ -96,8 +96,10 @@ fs.writeFileSync(path.join(base, 'q3-deck.png'), PNG);
96
96
  const bigTitle = () => p.evaluate(() => { const h = document.querySelector('#rdSlide h3'); return h ? h.textContent : (document.querySelector('#rdSlide iframe') ? 'frame' : ''); });
97
97
  const say = async (t) => { await p.fill('#rdIn', t); await p.press('#rdIn', 'Enter'); };
98
98
  await p.goto(BASE + '/premium-insights.html');
99
- await until(() => p.evaluate(() => document.querySelectorAll('#repDocs [data-rep]').length === 2));
100
- const rowSel = (slot) => `#repDocs [data-rep="rep:${CAD}:${slot}"]`;
99
+ await until(() => p.evaluate(() => !!document.querySelector('#listSeg [data-f="rep"]')));
100
+ await p.click('#listSeg [data-f="rep"]'); // the one list (insights-one-list L5): the Reports filter holds the report files
101
+ await until(() => p.evaluate(() => document.querySelectorAll('#listRows [data-rep]').length === 2));
102
+ const rowSel = (slot) => `#listRows [data-rep="rep:${CAD}:${slot}"]`;
101
103
 
102
104
  /* O: a document row opens the reader on the page */
103
105
  await tap(rowSel('2026-10-12'));
@@ -64,7 +64,7 @@ const model = async () => (await (await fetch(BASE + '/api/insights-premium')).j
64
64
  const pv = () => p.evaluate(() => { const t = document.querySelector('#stPv .mt1'); return t ? { cls: t.className, title: t.querySelector('.mlab').firstChild.textContent, val: (t.querySelector('.mval') || {}).textContent, bars: [...t.querySelectorAll('.bw i')].map((i) => parseFloat(i.style.height)), foot: (t.querySelector('.mfoot') || {}).textContent || '' } : null; });
65
65
  const checksTxt = () => p.evaluate(() => (document.querySelector('#stCk .suckb b') || {}).textContent || '');
66
66
  const tap = (sel) => p.$eval(sel, (b) => b.click());
67
- const open = async (sel) => { await p.click(sel); await until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('on') && !!document.querySelector('#oMain .stu'))); await sleep(300); };
67
+ const open = async (sel) => { if (sel === '#pdNew' || sel === '#repNew') await p.click('#listNew'); await p.click(sel); await until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('on') && !!document.querySelector('#oMain .stu'))); await sleep(300); };
68
68
  const mode = () => p.evaluate(() => (document.querySelector('#oMain .stmd [aria-pressed="true"]') || {}).textContent || '');
69
69
 
70
70
  /* O: New chart opens the Studio in Chart mode */
@@ -136,8 +136,8 @@ const model = async () => (await (await fetch(BASE + '/api/insights-premium')).j
136
136
  await tap('#oMain [data-st="save"]');
137
137
  await until(async () => (await model()).dashboards.some((d) => d.saved && d.name === 'Weekly'));
138
138
  // the Studio has closed and the page has drawn the new dashboard; Your charts is under All measures
139
- await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on') && !!document.querySelector('#dashTabs [data-d="all"]')));
140
- await p.$eval('#dashTabs [data-d="all"]', (b) => b.click());
139
+ await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on') && document.querySelector('#hDash').textContent === 'Weekly' && !!document.querySelector('#repBody [data-d="all"]')));
140
+ await p.$eval('#repBody [data-d="all"]', (b) => b.click());
141
141
  await until(() => p.evaluate((id) => !!document.querySelector(`#dashBody [data-ced="${id}"]`), cid));
142
142
  await p.$eval(`#dashBody [data-ced="${cid}"]`, (b) => b.click());
143
143
  await until(async () => await mode() === 'Chart');
@@ -100,7 +100,7 @@ const model = async () => (await (await fetch(BASE + '/api/insights-premium')).j
100
100
  const cta = () => p.evaluate(() => { const b = document.querySelector('#stFt [data-st="save"]'); return b ? b.textContent + (b.disabled ? ':off' : ':on') : ''; });
101
101
 
102
102
  /* O: New report opens the Studio in Report mode */
103
- await p.click('#repNew');
103
+ await p.click('#listNew'); await p.click('#repNew');
104
104
  await until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('on') && !!document.querySelector('#oMain .stu')));
105
105
  ok('O1 New report opens the Studio in Report mode, with the brief of the mockup', await mode() === 'Report' && await chipv('title') === bname + ' weekly report' && await chipv('purpose') === 'Not set'
106
106
  && await chipv('aud') === 'The team' && await chipv('out') === 'Google Doc' && await chipv('sched') === 'Weekly, Mondays at 09:00' && await chipv('from') === 'Your work' && await chipv('secs') === '7', [await mode(), await chipv('title'), await chipv('sched')].join());
@@ -60,7 +60,7 @@ const saved = async () => { const j = await (await fetch(BASE + '/api/insights-p
60
60
  const tiles = () => p.evaluate(() => [...document.querySelectorAll('#stPv .mch .mlab')].map((e) => e.firstChild.textContent));
61
61
  const checksTxt = () => p.evaluate(() => (document.querySelector('#stCk .suckb b') || {}).textContent || '');
62
62
  const tap = (sel) => p.$eval(sel, (b) => b.click());
63
- const open = async (sel) => { await p.click(sel); await until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('on') && !!document.querySelector('#oMain .stu'))); await sleep(300); };
63
+ const open = async (sel) => { if (sel === '#pdNew' || sel === '#repNew') await p.click('#listNew'); await p.click(sel); await until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('on') && !!document.querySelector('#oMain .stu'))); await sleep(300); };
64
64
  const shut = async () => { for (let i = 0; i < 2 && await p.evaluate(() => document.querySelector('#dlg').classList.contains('on')); i++) { await p.keyboard.press('Escape'); await sleep(150); } };
65
65
 
66
66
  /* O0: the bar's Chat button opens the Studio on the dashboard shown (premium-topbar: the Studio is this page's chat) */
@@ -135,7 +135,7 @@ const saved = async () => { const j = await (await fetch(BASE + '/api/insights-p
135
135
 
136
136
  /* S: save, read back, edit, remove */
137
137
  await tap('#oMain [data-st="save"]');
138
- ok('S1 Save closes the Studio and the page draws the saved dashboard as the main one', await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on') && [...document.querySelectorAll('#dashTabs button')].some((b) => b.textContent === 'Partner review · Main' && b.getAttribute('aria-pressed') === 'true'))));
138
+ ok('S1 Save closes the Studio and the page draws the saved dashboard as the main one', await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on') && document.querySelector('#hDash').textContent === 'Partner review' && document.querySelector('#dashTag').textContent === 'Pinned')));
139
139
  let S = await saved();
140
140
  ok('S2 the ledger holds the name, purpose, order and Main', S.length === 1 && S[0].name === 'Partner review' && S[0].purpose === 'the Monday partner review' && S[0].charts.join() === 'krm-a,krm-t' && S[0].main, JSON.stringify(S));
141
141
  await open('#pdEdit');
@@ -166,10 +166,10 @@ const saved = async () => { const j = await (await fetch(BASE + '/api/insights-p
166
166
  for (const theme of ['light', 'dark']) {
167
167
  const c2 = await browser.newContext({ viewport: { width: 390, height: 844 }, colorScheme: theme }), q = await c2.newPage();
168
168
  await q.goto(BASE + '/premium-insights.html');
169
- await until(() => q.evaluate(() => !!document.querySelector('#pdNew')));
169
+ await until(() => q.evaluate(() => !!document.querySelector('#crAsk') && !!document.querySelector('#listRows .dmr')));
170
170
  const pill = await q.evaluate(() => { const b = document.querySelector('#crAsk'), r = b.getBoundingClientRect(); return { txt: b.textContent.trim(), w: r.width, h: r.height, right: r.right, vw: innerWidth, vis: !!b.offsetParent }; });
171
171
  ok(`F0 at 390 px (${theme}) the Chat button shows, fits the width and is 44 px`, pill.vis && pill.right <= pill.vw && Math.round(pill.h) >= 44 && Math.round(pill.w) >= 44, JSON.stringify(pill));
172
- await q.click('#pdNew'); await until(() => q.evaluate(() => !!document.querySelector('#oMain .stu'))); await sleep(400);
172
+ await q.click('#listNew'); await q.click('#pdNew'); await until(() => q.evaluate(() => !!document.querySelector('#oMain .stu'))); await sleep(400);
173
173
  // measured once the dialog has finished opening: its rise animation scales the targets while it runs
174
174
  const measure = () => q.evaluate(() => {
175
175
  const sm = [...document.querySelectorAll('#oMain .stu button')].filter((b) => b.offsetParent).filter((b) => { const r = b.getBoundingClientRect(); return r.height < 44 || r.width < 44; }).map((b) => (b.dataset.st || b.textContent) + ':' + Math.round(b.getBoundingClientRect().width) + 'x' + Math.round(b.getBoundingClientRect().height));
@@ -74,8 +74,10 @@ const disk = () => fs.readFileSync(path.join(dir, pNew), 'utf8');
74
74
  const st = () => p.evaluate((pth) => { const S = window.__premiumSlides && window.__premiumSlides.state(pth); return S ? { i: S.i, n: S.deck.slides.length, theme: S.deck.theme, dirty: S.dirty, ro: S.ro, sel: S.sel, msg: S.msg, slides: JSON.parse(JSON.stringify(S.deck.slides)) } : null; }, pNew);
75
75
  const openReader = async (slot) => {
76
76
  await p.goto(BASE + '/premium-insights.html');
77
- await until(() => p.evaluate(() => document.querySelectorAll('#repDocs [data-rep]').length === 2));
78
- await tap(`#repDocs [data-rep="rep:${CAD}:${slot}"]`);
77
+ await until(() => p.evaluate(() => !!document.querySelector('#listSeg [data-f="rep"]')));
78
+ await tap('#listSeg [data-f="rep"]'); // the one list (insights-one-list L5): the Reports filter holds the report files
79
+ await until(() => p.evaluate(() => document.querySelectorAll('#listRows [data-rep]').length === 2));
80
+ await tap(`#listRows [data-rep="rep:${CAD}:${slot}"]`);
79
81
  return until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('on') && !!document.querySelector('#rdSlide')));
80
82
  };
81
83
  const openEditor = async () => {
@@ -238,8 +240,10 @@ const disk = () => fs.readFileSync(path.join(dir, pNew), 'utf8');
238
240
  const c2 = await browser.newContext({ viewport: { width: 390, height: 844 }, hasTouch: true, isMobile: true, colorScheme: 'dark' }), q = await c2.newPage(), e2 = [];
239
241
  q.on('pageerror', (e) => e2.push(String(e)));
240
242
  await q.goto(BASE + '/premium-insights.html?theme=dark');
241
- await until(() => q.evaluate(() => document.querySelectorAll('#repDocs [data-rep]').length === 2));
242
- await q.$eval(`#repDocs [data-rep="rep:${CAD}:2026-10-12"]`, (x) => x.click());
243
+ await until(() => q.evaluate(() => !!document.querySelector('#listSeg [data-f="rep"]')));
244
+ await q.$eval('#listSeg [data-f="rep"]', (x) => x.click());
245
+ await until(() => q.evaluate(() => document.querySelectorAll('#listRows [data-rep]').length === 2));
246
+ await q.$eval(`#listRows [data-rep="rep:${CAD}:2026-10-12"]`, (x) => x.click());
243
247
  await until(() => q.evaluate(() => document.querySelector('#dlg').classList.contains('on') && !!document.querySelector('#rdSlide')));
244
248
  await q.$eval('#oMain [data-rr="rm"]', (x) => x.click()); await q.$eval('#oMain [data-rr="slides"]', (x) => x.click());
245
249
  await until(() => q.evaluate(() => !!document.querySelector('#dOut .obody.vw:not([hidden]) .sl .sl-stage .sl-cv')));
@@ -165,3 +165,55 @@ button.nfr:hover,button.nfr:focus-visible{background:color-mix(in oklab,var(--in
165
165
  .pdev{margin:0 0 12px;padding-left:18px;display:grid;gap:4px}
166
166
  .pdev small{color:var(--ink-3)}
167
167
  .dplist button[role="switch"]{min-height:44px;width:100%}
168
+ /* insights-one-list: the insight first, the pinned dashboard on top, one paged list of dashboards and reports */
169
+ .ins-hero{margin-top:28px;display:grid;gap:10px;max-width:72ch}
170
+ .ins-hero .brief.ihead{margin:0;max-width:none}
171
+ .ieye{display:flex;align-items:center;gap:6px;margin:0;font:600 var(--fs-1) var(--mono);letter-spacing:.08em;text-transform:uppercase;color:var(--ember-ink)}
172
+ .ieye svg.i{width:14px;height:14px}
173
+ .ins-hero.calm .ieye{color:var(--ink-3)}
174
+ .ins-hero .ihead{margin:0;font-size:var(--fs-6);line-height:1.15;font-weight:600;letter-spacing:-.03em;color:var(--ink);text-wrap:balance}
175
+ .iwhy{margin:0;font-size:var(--fs-4);line-height:1.5;color:var(--ink-2)}
176
+ .iwhy:empty,.imore:empty,.iact:empty,.inote:empty{display:none}
177
+ .imore{list-style:none;margin:0;padding:0;display:grid;gap:2px}
178
+ .imr{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;min-height:44px;padding:8px 10px;margin:0 -10px;border-radius:14px;text-align:left;font-size:var(--fs-3);color:var(--ink-2)}
179
+ .imr:hover,.imr:focus-visible{background:color-mix(in oklab,var(--ink) 6%,transparent);color:var(--ink)}
180
+ .imr svg.i{width:16px;height:16px;flex:none}
181
+ .iact{display:flex;gap:10px;flex-wrap:wrap;margin-top:4px}
182
+ .iact .dmcta{min-height:44px}
183
+ .inote{margin:0}
184
+ @media (max-width:700px){.ihead{font-size:var(--fs-5)}}
185
+ .ptag{font:600 var(--fs-1) var(--mono);font-style:normal;letter-spacing:.08em;text-transform:uppercase;color:var(--ink-3);border:1px solid var(--hair);border-radius:6px;padding:2px 7px}
186
+ .ptag.on{color:var(--on-solid);background:var(--solid);border-color:transparent}
187
+ .ptag:empty{display:none}
188
+ .pdcard .ch small{margin-left:auto}
189
+ .pdbar .dmcta svg.i{width:16px;height:16px;margin-right:4px}
190
+ .nfd .nft b{font-weight:600}
191
+ .nfd li.stall .nfdot,.nfd li.miss .nfdot{background:var(--ember)}
192
+ .nfd li.course .nfdot{background:var(--ok)}
193
+ .lbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:12px 0 0}
194
+ .lbar .nask{flex:1 1 260px;margin:0}
195
+ .lbar .dmcta{min-height:44px}
196
+ .newm{position:relative}
197
+ .lmenu{position:absolute;top:50px;left:0;z-index:5;display:grid;min-width:180px;padding:6px;border-radius:16px;background:var(--card-solid,var(--card));border:1px solid var(--hair);box-shadow:var(--card-shadow)}
198
+ .lmenu button{min-height:44px;padding:0 12px;border-radius:10px;text-align:left;font-weight:600}
199
+ .lmenu button:hover,.lmenu button:focus-visible{background:var(--well)}
200
+ #cRep .mhint{margin:10px 0 0 4px}
201
+ #listRows{margin-top:10px}
202
+ .dmi.c-Dash{background:color-mix(in oklab,var(--ember) 16%,transparent);color:var(--ember-ink)}
203
+ .nil{display:flex;gap:6px;align-items:flex-start;font-size:var(--fs-3);line-height:1.45;color:var(--ink)}
204
+ .nil svg.i{width:14px;height:14px;margin-top:3px;flex:none;color:var(--ember-ink)}
205
+ .nil.q span{color:var(--ink-2)}
206
+ .dmm .t{text-transform:uppercase;letter-spacing:.06em;font-size:var(--fs-1)}
207
+ .npin{width:44px;height:44px;margin-right:6px;border-radius:12px;display:grid;place-items:center;color:var(--ink-3);border:1px solid transparent}
208
+ .npin:hover{border-color:var(--hair);color:var(--ink)}
209
+ .npin[aria-pressed="true"]{background:var(--solid);color:var(--on-solid)}
210
+ .npin[aria-pressed="true"] svg{fill:currentColor}
211
+ .npin svg.i{width:18px;height:18px}
212
+ .lpager{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-top:12px}
213
+ .lpager .note{margin:0}
214
+ .lpager .pg{display:flex;gap:6px;flex-wrap:wrap}
215
+ .lpager .pg button{min-width:44px;height:44px;display:grid;place-items:center;border-radius:12px;border:1px solid var(--hair);font:500 var(--fs-2) var(--mono)}
216
+ .lpager .pg button[aria-current="page"]{background:var(--solid);color:var(--on-solid);border-color:transparent}
217
+ .lpager .pg button:disabled{opacity:.35;cursor:default}
218
+ .lmenu[hidden]{display:none}
219
+ #listRows .dmr{grid-template-columns:minmax(0,1fr) auto}