create-pmos 0.434.0 → 0.435.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/changelog.json +12 -0
- package/workspace/fixtures/ready-reports.js +145 -0
- package/workspace/guide/index.md +1 -0
- package/workspace/guide/ready-made-dashboards.md +62 -0
- package/workspace/lib/board-premium.js +1 -1
- package/workspace/lib/intel-report.js +36 -5
- package/workspace/lib/ready-reports.js +616 -0
- package/workspace/lib/report-dashboards.js +5 -0
- package/workspace/lib/report-setups.js +16 -7
- package/workspace/lib/route-modules.js +1 -0
- package/workspace/lib/routes-board-premium.js +5 -0
- package/workspace/lib/routes-boards.js +1 -1
- package/workspace/lib/routes-ready-reports.js +455 -0
- package/workspace/lib/routes-report-setups.js +4 -3
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/program-charter-test.js +11 -7
- package/workspace/program-panel-test.js +1 -1
- package/workspace/public/pm/bd-ini-panel.js +23 -6
- package/workspace/public/pm/bd-prog-panel.js +58 -10
- package/workspace/public/pm/cozy-viewer.js +2 -2
- package/workspace/public/pm/cozy-vw-rp.css +13 -0
- package/workspace/public/pm/dash-view.css +111 -0
- package/workspace/public/pm/dash-view.js +261 -0
- package/workspace/public/pm/home-app.js +26 -0
- package/workspace/public/pm/home-data.js +3 -2
- package/workspace/public/pm/home-ini.js +19 -1
- package/workspace/public/pm/premium-insights.js +10 -2
- package/workspace/public/pm/premium-report-read.js +36 -5
- package/workspace/public/pm/ready-lib.css +29 -0
- package/workspace/public/pm/ready-lib.js +62 -0
- package/workspace/ready-dash-ui-test.js +227 -0
- package/workspace/server.js +2 -0
- package/workspace/test-lists/batch17-ready-reports.json +9 -0
- package/workspace/test-lists/ready-reports-ui.json +6 -0
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
/* pm/dash-view.js — the ready-made Dashboard view of a program, a product or an initiative (batch 17 item 1, design A+; canvas In development,
|
|
2
|
+
* band "Ready-made dashboards and reports": PbH1Header, PbA1–PbA3, PbA5, PbA7, PbS1, PbS2, PbG2, PbG3, PbG6–PbG10).
|
|
3
|
+
*
|
|
4
|
+
* The program panel (bd-prog-panel.js), the initiative view (bd-ini-panel.js on the Board, home-ini.js on Home) and the product page (home-app.js)
|
|
5
|
+
* draw the same markup in the Viewer's shell. The model is the server's: GET /api/ready-reports/dashboard?ws&scope&from (lib/ready-reports.js).
|
|
6
|
+
* This file only draws it and wires its presses; it reads nothing on its own except that one route (readDash).
|
|
7
|
+
*
|
|
8
|
+
* readDash(ws, scope, from) → the dashboard, or null when it could not be read (the host then shows Work and offers no toggle)
|
|
9
|
+
* viewOf(page, opens) 'dash' | 'work': the PM's last choice on this page wins; else the server's opening view (read → Dashboard, act → Work)
|
|
10
|
+
* keepView(page, v) remembers the PM's choice per page, in this browser
|
|
11
|
+
* togglePress(v) the one header icon (PbH1): a gauge from Work, a list from Dashboard, aria-pressed
|
|
12
|
+
* dashHtml(d, o) the body: ✦ line · Goal(s) · the stage block · Guardrails · Needs you · Reports · Done. Zero is silence: an empty
|
|
13
|
+
* block is not drawn. o: { mdHtml (the goal Claude drafted, pm/metric-drafts.js, for "No goal yet"), talk (the
|
|
14
|
+
* phone's "Message Claude about …" line) }. A body 720 px or wider lays the blocks in two columns (PbA7).
|
|
15
|
+
* wireDash(body, h) the presses, once per body. h: { ws, scope, toast(text), reload(), openReport(row), editNeeds(n), milestones(),
|
|
16
|
+
* mdPress(btn) }. Every write is one press, then the dashboard is read again (h.reload).
|
|
17
|
+
*
|
|
18
|
+
* Adler: the M face leads the ✦ line in the mood the line already has (handled, or honest when it warns); one Adler per screen, never inside
|
|
19
|
+
* a row. Icon-only presses carry their words in aria-label and title. */
|
|
20
|
+
import { pmPost } from './http.js';
|
|
21
|
+
import { adler } from './cozy-adler.js';
|
|
22
|
+
|
|
23
|
+
const CSS = new URL('./dash-view.css', import.meta.url).href;
|
|
24
|
+
if (typeof document !== 'undefined' && document.head && !document.querySelector(`link[href="${CSS}"]`)) {
|
|
25
|
+
const l = document.createElement('link'); l.rel = 'stylesheet'; l.href = CSS; document.head.appendChild(l);
|
|
26
|
+
}
|
|
27
|
+
const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]));
|
|
28
|
+
const SV = (d, w = 18, sw = 1.8) => `<svg aria-hidden="true" width="${w}" height="${w}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="${sw}" stroke-linecap="round" stroke-linejoin="round"><path d="${d}"/></svg>`;
|
|
29
|
+
export const I = {
|
|
30
|
+
gauge: 'M4.5 17a8 8 0 1 1 15 0M12 13l3.5-4M12 13h.01',
|
|
31
|
+
list: 'M9 6h11M9 12h11M9 18h11M4.5 6h.01M4.5 12h.01M4.5 18h.01',
|
|
32
|
+
spark: 'M12 3l1.8 4.7L18.5 9.5l-4.7 1.8L12 16l-1.8-4.7L5.5 9.5l4.7-1.8z', warn: 'M12 4l9 16H3zM12 10v4M12 17h.01',
|
|
33
|
+
rep: 'M6 3h9l4 4v14H6zM14 3v5h5M9 18v-3M12 18v-6M15 18v-4', dia: 'M12 4l8 8-8 8-8-8z', chk: 'M5 12l5 5 9-10', lock: 'M6 11h12v9H6zM8.5 11V8a3.5 3.5 0 0 1 7 0v3',
|
|
34
|
+
chart: 'M4 18l5-6 4 3 7-8', next: 'M10 7l5 5-5 5', down: 'M7 10l5 5 5-5', x: 'M6 6l12 12M18 6L6 18', pen: 'M4 20h4L19 9l-4-4L4 16zM13.5 6.5l4 4',
|
|
35
|
+
send: 'M4 12l16-8-6 16-3-7z', flag: 'M5 21V4h11l-2 4 2 4H5', pause: 'M9 6v12M15 6v12', clock: 'M12 7v5l3 2M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0-18',
|
|
36
|
+
again: 'M4 12a8 8 0 0 1 14-5.3L20 9M20 4v5h-5M20 12a8 8 0 0 1-14 5.3L4 15M4 20v-5h5', plug: 'M9 3v5M15 3v5M7 8h10v4a5 5 0 0 1-10 0zM12 17v4',
|
|
37
|
+
cal: 'M4 5h16v15H4zM8 3v4M16 3v4M4 10h16', target: 'M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0-18M12 7a5 5 0 1 0 0 10a5 5 0 1 0 0-10M12 11a1 1 0 1 0 0 2a1 1 0 1 0 0-2',
|
|
38
|
+
people: 'M9 11a3.5 3.5 0 1 0 0-7a3.5 3.5 0 1 0 0 7M2.5 20a6.5 6.5 0 0 1 13 0M16 4.5a3.5 3.5 0 0 1 0 6.5M18 14a6 6 0 0 1 3.5 6',
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/* ── which view opens ── */
|
|
42
|
+
const PREF = 'pmos.dash.view:';
|
|
43
|
+
const get = (k) => { try { return localStorage.getItem(k); } catch { return null; } };
|
|
44
|
+
const set = (k, v) => { try { localStorage.setItem(k, v); } catch { /* a private window */ } };
|
|
45
|
+
/** The PM's last choice on this page (a program, an initiative) wins; with none, the server's opening view: Dashboard when the PM came to
|
|
46
|
+
* read (Intelligence, a report, a notification), Work when they came to act (a Board row, a Home task). */
|
|
47
|
+
export function viewOf(page, opens) { const v = get(PREF + page); return v === 'dash' || v === 'work' ? v : opens === 'dashboard' ? 'dash' : 'work'; }
|
|
48
|
+
export const keepView = (page, v) => set(PREF + page, v === 'dash' ? 'dash' : 'work');
|
|
49
|
+
/** The one toggle icon in the charter's old place (PbH1): it shows where it takes you; pressed while the Dashboard is shown. */
|
|
50
|
+
export const togglePress = (v) => ({ act: 'dash', label: v === 'dash' ? 'Show the work' : 'Show the dashboard', icon: v === 'dash' ? I.list : I.gauge, pressed: v === 'dash' });
|
|
51
|
+
|
|
52
|
+
/** GET /api/ready-reports/dashboard. null when the route is missing or refused, so the host never draws a toggle to nothing. */
|
|
53
|
+
export async function readDash(ws, scope, from) {
|
|
54
|
+
const u = '/api/ready-reports/dashboard?' + new URLSearchParams(Object.entries({ ws: ws || '', scope, from: from || '' }).filter(([, v]) => v)).toString();
|
|
55
|
+
try { const r = await fetch(u, { credentials: 'same-origin' }); if (r.status !== 200) return null; const j = await r.json(); return j && j.ok !== false && (j.dashboard || j.scope) ? (j.dashboard || j) : null; } catch { return null; }
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/* ── the parts ── */
|
|
59
|
+
const DOT = { ahead: 'ok', on: 'ok', ok: 'ok', done: 'ok', behind: 'risk', risk: 'risk', late: 'late', off: 'late', none: 'q', first: 'q', q: 'q' };
|
|
60
|
+
const dot = (d, label) => `<span class="db-dot ${DOT[d] || 'q'}"${label ? ` role="img" aria-label="${esc(label)}"` : ' aria-hidden="true"'}></span>`;
|
|
61
|
+
const who = (o) => { const n = String((o && (o.name || o)) || '').trim(); if (!n) return ''; const w = n.split(/\s+/); return `<span class="db-who" title="${esc(n)}" aria-label="${esc('Owner ' + n)}">${esc((w.length > 1 ? w[0][0] + w[1][0] : n[0]).toUpperCase())}</span>`; };
|
|
62
|
+
const tag = (p) => (p && p.tag ? `<span class="db-tag" title="${esc(p.name || p.tag)}">${esc(p.tag)}</span>` : '');
|
|
63
|
+
const ib = (act, label, icon, o = {}) => `<button type="button" class="db-ib${o.solid ? ' solid' : ''}" data-db="${esc(act)}"${o.k ? ` data-k="${esc(o.k)}"` : ''} aria-label="${esc(label)}" title="${esc(label)}"${o.off ? ' disabled' : ''}>${SV(icon, 17, o.solid ? 2.2 : 1.8)}</button>`;
|
|
64
|
+
const sec = (title, inner, cls = '', tail = '') => `<section class="db-b${cls ? ' ' + cls : ''}" aria-label="${esc(title)}">${tail ? `<div class="db-hr"><h4 class="db-h">${esc(title)}</h4>${tail}</div>` : `<h4 class="db-h">${esc(title)}</h4>`}${inner}</section>`;
|
|
65
|
+
const STATE_DOT = { ahead: 'ahead', on: 'on', behind: 'behind', late: 'late' };
|
|
66
|
+
|
|
67
|
+
/** The ✦ line (PbA1 top): what Claude handled, the lead in bold and the rest quiet. A warning (a stale source, a heads-up) is the honest face. */
|
|
68
|
+
function handledHtml(h) {
|
|
69
|
+
if (!h || !(h.lead || h.rest)) return '';
|
|
70
|
+
const warn = h.tone === 'warn';
|
|
71
|
+
return `<div class="db-hd${warn ? ' warn' : ''}" role="status"><span class="db-face">${adler(warn ? 'honest' : 'handled', 36, { label: false, id: 'db' })}</span>`
|
|
72
|
+
+ `<p><b>${esc(h.lead || '')}</b>${h.rest ? ' ' + esc(h.rest) : ''}</p>${h.act ? ib('handled', h.act.label || 'Keep both', I.chk, { solid: true, k: h.act.act || 'keep' }) : ''}</div>`;
|
|
73
|
+
}
|
|
74
|
+
/** Goal(s): the Claude-runs-the-OKRs goal row (a press opens the goal's Viewer); never a second goal list. The product page folds them to one
|
|
75
|
+
* summary row of dots (PbA3). With no goal yet, the goal Claude drafted (pm/metric-drafts.js) under a hollow "No goal yet". */
|
|
76
|
+
function goalsHtml(d, o) {
|
|
77
|
+
const G = d.goals || [];
|
|
78
|
+
// the product page keeps its way into the metrics review (o.metrics): one icon at the Goals block's head
|
|
79
|
+
const mx = d.level === 'product' && o.metrics ? `<button type="button" class="db-ib" data-db="metrics" aria-label="Open the metrics review" title="Metrics review">${SV(I.chart, 18)}</button>` : '';
|
|
80
|
+
if (!G.length && mx) return `<section class="db-b" aria-label="Goals"><div class="db-card"><div class="db-gh"><span class="db-rt"><b>Goals</b><small>No goal yet</small></span>${mx}</div>${d.drafts && d.drafts.goal && o.mdHtml ? o.mdHtml : ''}</div></section>`;
|
|
81
|
+
if (!G.length) return d.drafts && d.drafts.goal && o.mdHtml ? sec('Goal', `<div class="db-card"><p class="db-none">${dot('none')}No goal yet</p>${o.mdHtml}</div>`) : '';
|
|
82
|
+
const row = (g) => `<button type="button" class="db-row" data-db="goal" data-k="${esc(g.id)}"${g.ws || (g.product && g.product.ws) ? ` data-ws="${esc(g.ws || g.product.ws)}"` : ''}>${dot(g.dot, g.dot === 'none' ? 'No reading yet' : g.dot === 'behind' ? 'Behind its line' : g.dot === 'ahead' ? 'Ahead of its line' : 'On its line')}`
|
|
83
|
+
+ `<span class="db-rt"><b>${esc(g.title)}</b>${g.sub || g.product ? `<small>${tag(g.product)}${esc(g.sub || '')}</small>` : ''}</span>${who(g.owner)}</button>`;
|
|
84
|
+
if (d.level === 'product') {
|
|
85
|
+
const behind = G.filter((g) => DOT[g.dot] === 'risk' || DOT[g.dot] === 'late'), on = G.length - behind.length;
|
|
86
|
+
const line = [on ? on + ' on ' + (on === 1 ? 'its' : 'their') + ' line' : '', behind.length ? behind.map((g) => g.short || g.title).slice(0, 2).join(behind.length > 2 ? ', ' : ' and ') + (behind.length > 2 ? ' and ' + (behind.length - 2) + ' more' : '') + (behind.length === 1 ? ' is behind' : ' are behind') : ''].filter(Boolean).join(' · ');
|
|
87
|
+
const open = !!(o.open && o.open.has('goals'));
|
|
88
|
+
return `<section class="db-b" aria-label="Goals"><div class="db-card"><div class="db-gh"><button type="button" class="db-sum" data-db="fold" data-k="goals" aria-expanded="${open}"><span class="db-rt"><b>Goals</b><small>${esc(line)}</small></span>`
|
|
89
|
+
+ `<span class="db-dots" aria-hidden="true">${G.slice(0, 6).map((g) => dot(g.dot)).join('')}</span>${SV(open ? I.down : I.next, 16)}</button>${mx}</div>${open ? `<div class="db-list">${G.map(row).join('')}</div>` : ''}</div></section>`;
|
|
90
|
+
}
|
|
91
|
+
return sec(G.length === 1 ? 'Goal' : 'Goals', `<div class="db-card db-list">${G.map(row).join('')}</div>`);
|
|
92
|
+
}
|
|
93
|
+
/** The promise date Claude drafted from the usual stage times, marked a guess (PbA5): ✕ ✎ ✓. */
|
|
94
|
+
function promiseHtml(p) {
|
|
95
|
+
return `<div class="db-draft"><span class="db-dic">${SV(I.cal, 16)}</span><span class="db-rt"><b>Promise ${esc(p.date || '')}</b>${p.sub ? `<small>${esc(p.sub)}</small>` : ''}</span>`
|
|
96
|
+
+ `<div class="db-acts">${ib('promise', 'Not now', I.x, { k: 'drop' })}${ib('promise-edit', 'Change the date', I.pen)}${ib('promise', 'Keep this promise date', I.chk, { solid: true, k: 'keep' })}</div></div>`;
|
|
97
|
+
}
|
|
98
|
+
/** The stage block, by where the work is in its lifecycle. */
|
|
99
|
+
function stageHtml(d, o = {}) {
|
|
100
|
+
const S = d.stage, stale = d.heldBy && /jira/i.test(d.heldBy.source || '');
|
|
101
|
+
if (!S) return d.drafts && d.drafts.promise ? sec('Ships', `<div class="db-card"><p class="db-none">${dot('none')}No promise date yet</p>${promiseHtml(d.drafts.promise)}</div>`) : '';
|
|
102
|
+
if (S.kind === 'ready') { // PbS1: the exit checklist of the stage, who owes what, the day against the usual
|
|
103
|
+
const L = S.items || [], open = L.filter((x) => !x.done), done = L.filter((x) => x.done);
|
|
104
|
+
const shown = [...done.slice(-2), ...open], early = done.length - Math.min(2, done.length);
|
|
105
|
+
const item = (x) => `<li class="db-ck${x.done ? ' on' : ''}"><span class="db-box" aria-hidden="true">${x.done ? SV(I.chk, 13, 3) : ''}</span><span class="db-rt">${esc(x.text)}</span>${x.who || x.when ? `<small class="db-r">${esc([x.who, x.when].filter(Boolean).join(' · '))}</small>` : ''}</li>`;
|
|
106
|
+
return sec('Ready for build', `<div class="db-card"><div class="db-top"><b class="db-big">${esc(S.done)} of ${esc(S.total)}</b>${S.day ? `<small>day ${esc(S.day)}${S.usual ? ' · ' + esc(S.stage || 'this stage') + ' usually takes ' + esc(S.usual) : ''}</small>` : ''}</div>`
|
|
107
|
+
+ `<ul class="db-cks" aria-label="${esc(S.done + ' of ' + S.total + ' done')}">${shown.map(item).join('')}</ul>${early > 0 ? `<p class="db-more">${early} done earlier</p>` : ''}</div>`);
|
|
108
|
+
}
|
|
109
|
+
if (S.kind === 'ships') { // PbA1: the forecast range against the promise, the stages, Jira; PbG9 one date, no range before 3 weeks of tickets
|
|
110
|
+
const range = S.lo && S.hi && S.lo !== S.hi ? S.lo + ' to ' + S.hi : S.lo || S.promised || '';
|
|
111
|
+
const right = stale ? 'as of ' + (d.heldBy.since || '') : S.promised && range !== S.promised ? 'promised ' + S.promised : S.promised ? 'on its promise' : '';
|
|
112
|
+
const steps = (S.steps || []).length ? `<div class="db-steps" role="img" aria-label="${esc((S.steps || []).map((x) => x.name + ' ' + (x.state || '')).join(', '))}">${S.steps.map((x) => `<span class="db-st ${esc(x.state || 'next')}"><i></i><small>${esc(x.name)}${x.state === 'now' && S.today ? ' · ' + esc(S.today) : ''}</small></span>`).join('')}</div>` : '';
|
|
113
|
+
const j = S.jira ? [S.jira.total ? 'Jira · ' + S.jira.done + ' of ' + S.jira.total + ' tickets done' : '', S.jira.at ? 'read ' + S.jira.at : '', S.note || ''].filter(Boolean).join(' · ') : S.note || '';
|
|
114
|
+
const why = stale ? `<p class="db-meta">${esc(d.heldBy.why || 'The source could not be read.')}</p><div class="db-acts">${ib('reread', 'Read it again', I.again, { k: d.heldBy.source })}${ib('reconnect', 'Connect again', I.plug, { solid: true, k: d.heldBy.source })}</div>` : '';
|
|
115
|
+
return sec('Ships', `<div class="db-card"><div class="db-top">${dot(stale ? 'none' : S.dot)}<b class="db-big">${esc(range)}</b>${right ? `<small>${esc(right)}</small>` : ''}</div>${stale ? '' : steps}${!stale && j ? `<p class="db-meta">${esc(j)}</p>` : ''}${why}</div>`);
|
|
116
|
+
}
|
|
117
|
+
if (S.kind === 'milestones') { // PbA2, PbG10: the track, then one row per milestone with its product's tile
|
|
118
|
+
const M = S.items || [];
|
|
119
|
+
const track = M.length > 1 && !M.some((m) => m.product) ? `<div class="db-trk" aria-hidden="true">${M.map((m) => `<i class="${esc(DOT[m.dot] || 'q')}${m.done ? ' done' : ''}"></i>`).join('')}</div>` : '';
|
|
120
|
+
const row = (m) => `<div class="db-ms">${m.product ? tag(m.product) : dot(m.done ? 'done' : m.dot)}<span class="db-rt">${esc(m.name)}</span><small class="db-r">${esc(m.when || '')}</small></div>`;
|
|
121
|
+
return sec('Milestones', `<div class="db-card">${track}${M.map(row).join('')}${S.note ? `<p class="db-meta">${esc(S.note)}</p>` : ''}</div>`, '', ib('milestones', 'Edit the milestones in the charter', I.pen));
|
|
122
|
+
}
|
|
123
|
+
if (S.kind === 'did-it-work') { // PbS2: the reading against the promise, day N of the window; PbG7 a closed program lists each goal's landing
|
|
124
|
+
if (Array.isArray(S.items)) return sec('Did it work?', `<div class="db-card db-list">${S.items.map((g) => `<div class="db-row">${dot(g.dot)}<span class="db-rt"><b>${esc(g.title)}</b>${g.sub ? `<small>${esc(g.sub)}</small>` : ''}</span>${who(g.owner)}</div>`).join('')}</div>`);
|
|
125
|
+
const pct = S.day && S.window ? Math.max(0, Math.min(100, Math.round(S.day / S.window * 100))) : null;
|
|
126
|
+
return sec('Did it work?', `<div class="db-card"><div class="db-top">${dot(S.dot)}<b class="db-big">${esc(S.head || '')}</b>${S.day && S.window ? `<small>day ${esc(S.day)} of ${esc(S.window)}</small>` : ''}</div>`
|
|
127
|
+
+ (pct !== null ? `<div class="db-win" role="img" aria-label="${esc('Day ' + S.day + ' of ' + S.window)}"><i style="width:${pct}%"></i></div>` : '')
|
|
128
|
+
+ `${S.promise ? `<p class="db-meta">${esc(S.promise)}</p>` : ''}${S.note ? `<p class="db-p">${esc(S.note)}</p>` : ''}</div>`);
|
|
129
|
+
}
|
|
130
|
+
if (S.kind === 'ships-next') { // PbA3: the product's initiatives, late first, the next 2, the rest folded
|
|
131
|
+
const L = S.items || [], open = !!(o.open && o.open.has('ships'));
|
|
132
|
+
const row = (x) => `<div class="db-row">${dot(x.dot)}<span class="db-rt"><b>${esc(x.name)}</b><small>${esc([x.lo && x.hi && x.lo !== x.hi ? x.lo + '–' + x.hi : x.when || x.lo || '', x.promised && x.promised !== x.when ? 'promised ' + x.promised : x.promised ? 'on its date' : ''].filter(Boolean).join(' · '))}</small></span>${who(x.owner)}</div>`;
|
|
133
|
+
// "3 more" folds the rest; the server's words lead ("3 more, all on their dates"); with no rows to show it is one quiet line, never a dead fold
|
|
134
|
+
const mr = S.more && S.more.count ? S.more.items || S.more.rows || [] : [], mt = S.more ? S.more.text || S.more.count + ' more' : '';
|
|
135
|
+
const more = !S.more || !S.more.count ? '' : !mr.length ? `<p class="db-more">${esc(mt)}</p>`
|
|
136
|
+
: `<button type="button" class="db-fold" data-db="fold" data-k="ships" aria-expanded="${open}"><span class="db-rt"><b>${esc(mt)}</b>${S.more.sub ? `<small>${esc(S.more.sub)}</small>` : ''}</span>${SV(I.down, 16)}</button>${open ? mr.map(row).join('') : ''}`;
|
|
137
|
+
return L.length ? sec('Ships next', `<div class="db-card db-list">${L.map(row).join('')}${more}</div>`) : '';
|
|
138
|
+
}
|
|
139
|
+
if (S.kind === 'on-hold') return sec('On hold', `<div class="db-card"><p class="db-none">${SV(I.pause, 15)}On hold${S.since ? ' since ' + esc(S.since) : ''}. Its reports are paused.</p></div>`);
|
|
140
|
+
return '';
|
|
141
|
+
}
|
|
142
|
+
const guardHtml = (d) => ((d.guardrails || []).length ? sec('Guardrails', `<div class="db-card db-list">${d.guardrails.map((g) => `<div class="db-row">${dot(g.dot)}<span class="db-rt"><b>${esc(g.title)}</b>${g.sub ? `<small>${esc(g.sub)}</small>` : ''}</span>${who(g.owner)}</div>`).join('')}</div>`) : '');
|
|
143
|
+
/** Needs you: one decision with Claude's pick (PbA1): ✕ drops it, ✎ opens it to change, ✓ keeps the pick. */
|
|
144
|
+
function needsHtml(d) {
|
|
145
|
+
const n = d.needs; if (!n || !n.q) return '';
|
|
146
|
+
return sec('Needs you', `<div class="db-card db-need"><div class="db-nq">${SV(I.flag, 16)}<span class="db-rt"><b>${esc(n.q)}</b>${n.sub ? `<small>${esc(n.sub)}</small>` : ''}${n.pick ? `<span class="db-pick">✦ My pick: ${esc(n.pick)}</span>` : ''}</span></div>`
|
|
147
|
+
+ `<div class="db-acts">${ib('needs', 'Not now', I.x, { k: 'drop', off: !n.drop })}${ib('needs-edit', 'Change it first', I.pen)}${ib('needs', 'Keep my pick' + (n.pick ? ': ' + n.pick : ''), I.chk, { solid: true, k: 'keep', off: !n.keep })}</div></div>`);
|
|
148
|
+
}
|
|
149
|
+
/* ── Reports ── */
|
|
150
|
+
const KIND_ICON = { weekly: I.rep, checkpoint: I.dia, 'did-it-work': I.chk, 'heads-up': I.warn, frozen: I.lock, metrics: I.chart };
|
|
151
|
+
const iconOf = (r) => (r.state === 'frozen' ? I.lock : KIND_ICON[r.kind] || I.rep);
|
|
152
|
+
const rid = (r) => r.id || r.kind;
|
|
153
|
+
/** One report row: drafted ones open the one report Viewer; a held one (PbG2) and a late one (PbG8) carry their own presses. */
|
|
154
|
+
function repRow(r) {
|
|
155
|
+
if (r.state === 'held') return `<div class="db-held" data-rk="${esc(rid(r))}"><span class="db-dic q">${SV(I.pause, 16)}</span><span class="db-rt"><b>${esc(r.name)} held</b>${r.sub ? `<small>${esc(r.sub)}</small>` : ''}</span>`
|
|
156
|
+
+ `<div class="db-acts">${ib('hold', 'Skip this one', I.x, { k: rid(r) + '|skip' })}${ib('hold', 'Send it now with a note', I.send, { k: rid(r) + '|send-note' })}${ib('hold', 'Wait until it reads again', I.clock, { solid: true, k: rid(r) + '|wait' })}</div></div>`;
|
|
157
|
+
const open = r.path ? ` data-db="report" data-k="${esc(rid(r))}"` : '';
|
|
158
|
+
const head = `<${r.path ? 'button type="button"' : 'div'} class="db-rep"${open}><span class="db-dic">${SV(iconOf(r), 16)}</span><span class="db-rt"><b>${esc(r.name)}</b>${r.sub ? `<small>${esc(r.sub)}</small>` : ''}</span>${r.path ? SV(I.next, 16) : ''}</${r.path ? 'button' : 'div'}>`;
|
|
159
|
+
if (r.state === 'late') return `<div class="db-late">${head}<div class="db-acts">${ib('hold', 'Skip this week', I.x, { k: rid(r) + '|skip' })}${ib('send', 'Send it now', I.send, { solid: true, k: rid(r) })}</div></div>`;
|
|
160
|
+
return head;
|
|
161
|
+
}
|
|
162
|
+
/** The heads-up Claude drafts at once when a health budget breaks or a date slips badly (PbG3): its title, what it says, to whom, ✕ ✎ ➤. */
|
|
163
|
+
function headsUpHtml(r) {
|
|
164
|
+
return sec('Heads-up · draft', `<div class="db-card db-hu"><b class="db-hut">${esc(r.title || r.name)}</b>${r.sub ? `<p class="db-meta">${esc(r.sub)}</p>` : ''}`
|
|
165
|
+
+ `<div class="db-chips">${r.audience ? `<span class="db-chip">${SV(I.people, 14)}${esc(r.audience)}</span>` : ''}${r.channel ? `<span class="db-chip">${SV(I.send, 14)}${esc(r.channel)}</span>` : ''}</div>`
|
|
166
|
+
+ `<div class="db-acts">${ib('hold', 'Not now', I.x, { k: rid(r) + '|skip' })}${r.path ? ib('report', 'Change it first', I.pen, { k: rid(r) }) : ''}${ib('send', 'Send the heads-up', I.send, { solid: true, k: rid(r) })}</div></div>`);
|
|
167
|
+
}
|
|
168
|
+
function reportsHtml(d, o) {
|
|
169
|
+
const L = (d.reports || []).filter((r) => r.kind !== 'heads-up');
|
|
170
|
+
const hu = (d.reports || []).filter((r) => r.kind === 'heads-up' && r.state !== 'sent').map(headsUpHtml).join('');
|
|
171
|
+
if (!L.length) return hu;
|
|
172
|
+
const first = L.filter((r) => /^(held|late|drafted)$/.test(r.state));
|
|
173
|
+
const lead = first.length ? first : L.slice(0, 1), rest = L.filter((r) => !lead.includes(r));
|
|
174
|
+
const open = !!(o.open && o.open.has('reports'));
|
|
175
|
+
const more = rest.length ? `<button type="button" class="db-fold" data-db="fold" data-k="reports" aria-expanded="${open}"><span class="db-rt"><b>${rest.length} more</b><small>${esc(rest.map((r) => [r.name, r.sub].filter(Boolean).join(' · ')).join(' · '))}</small></span>${SV(I.down, 16)}</button>${open ? rest.map(repRow).join('') : ''}` : '';
|
|
176
|
+
return hu + sec(d.level === 'product' ? 'This week' : 'Reports', `<div class="db-card db-reps">${lead.map(repRow).join('')}${more}</div>`);
|
|
177
|
+
}
|
|
178
|
+
/** Send by itself (PbG6): offered after 4 issues sent unchanged; calm weeks only. Off by default. */
|
|
179
|
+
function trustHtml(d) {
|
|
180
|
+
const t = d.trust; if (!t) return '';
|
|
181
|
+
return `<div class="db-card db-trust"><div class="db-top"><span class="db-rt"><b>Send by itself</b><small>Only weeks where everything is on its line</small></span></div>`
|
|
182
|
+
+ `<div class="db-acts">${ib('trust', 'Not now', I.x, { k: 'off' })}${ib('trust', 'Send it by itself in calm weeks', I.chk, { solid: true, k: 'on' })}</div></div>`;
|
|
183
|
+
}
|
|
184
|
+
const doneHtml = (d, o) => { const x = d.done; if (!x || !x.text) return ''; const open = !!(o.open && o.open.has('done')); return `<div class="db-card db-done"><button type="button" class="db-fold" data-db="fold" data-k="done" aria-expanded="${open}"><span class="db-rt"><b>${esc(x.title || 'Done this week')}</b><small>${esc(x.text)}</small></span>${SV(I.down, 16)}</button>${open && x.more ? `<p class="db-p">${esc(x.more)}</p>` : ''}</div>`; };
|
|
185
|
+
|
|
186
|
+
/** The whole Dashboard body. Blocks in the design's order; each draws only when it has something. */
|
|
187
|
+
export function dashHtml(d, o = {}) {
|
|
188
|
+
if (!d) return '<p class="db-wait" role="status">Reading the dashboard.</p>';
|
|
189
|
+
const grid = [goalsHtml(d, o), stageHtml(d, o), guardHtml(d), needsHtml(d), reportsHtml(d, o)].filter(Boolean);
|
|
190
|
+
const note = d.note ? `<p class="db-note">${esc(d.note)}</p>` : '';
|
|
191
|
+
return `<div class="db" data-level="${esc(d.level || '')}">${handledHtml(d.handled)}${trustHtml(d)}<div class="db-grid">${grid.join('')}</div>${doneHtml(d, o)}${note}${o.talk || ''}</div>`;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/* ── the presses ── */
|
|
195
|
+
const post = (u, b) => Promise.resolve(pmPost(u, b)).catch(() => null);
|
|
196
|
+
/** Wires one body. The host keeps h.d() the dashboard on screen, h.open the folds (a Set), and redraws through h.redraw(). */
|
|
197
|
+
export function wireDash(body, h) {
|
|
198
|
+
body.addEventListener('click', async (e) => {
|
|
199
|
+
const b = e.target.closest('[data-db]'); if (!b || b.disabled || !body.contains(b)) return;
|
|
200
|
+
const d = h.d && h.d(); if (!d) return;
|
|
201
|
+
const a = b.dataset.db, k = b.dataset.k || '', base = { ws: h.ws || undefined, scope: d.scope };
|
|
202
|
+
const done = async (r, ok) => { if (!r || r.ok === false) { b.disabled = false; h.toast((r && r.error) || 'Nothing was changed. The server did not say why.'); return; } if (ok) h.toast(ok); await h.reload(); };
|
|
203
|
+
if (a === 'fold') { if (h.open.has(k)) h.open.delete(k); else h.open.add(k); h.redraw(); return; }
|
|
204
|
+
// the goal's own Viewer: Intelligence's goal detail (?goal=), until the one goal Viewer of "Claude runs the OKRs" lands
|
|
205
|
+
if (a === 'goal') { if (h.goal) h.goal(k, b); else location.assign('/premium-intelligence.html?' + new URLSearchParams({ ...(b.dataset.ws || h.ws ? { ws: b.dataset.ws || h.ws } : {}), goal: k }).toString()); return; }
|
|
206
|
+
if (a === 'milestones') { if (h.milestones) h.milestones(); return; }
|
|
207
|
+
if (a === 'metrics') { if (h.metrics) h.metrics(); return; }
|
|
208
|
+
if (a === 'needs-edit') { if (h.editNeeds) h.editNeeds(d.needs, b); return; }
|
|
209
|
+
if (a === 'promise-edit') { if (h.editPromise) h.editPromise(d.drafts && d.drafts.promise, b); return; }
|
|
210
|
+
const row = (id) => (d.reports || []).find((r) => rid(r) === id);
|
|
211
|
+
if (a === 'report') { const r = row(k); if (r && h.openReport) h.openReport(r, d); return; }
|
|
212
|
+
b.disabled = true;
|
|
213
|
+
if (a === 'needs') {
|
|
214
|
+
const n = d.needs || {}, w = { ws: h.ws || undefined, board: h.board || undefined, initiative: n.ini || undefined };
|
|
215
|
+
if (k === 'keep') return done(await post('/api/proposals/keep', { ...w, ids: (n.keep && n.keep.ids) || [] }), 'Kept your pick.');
|
|
216
|
+
return done(await post('/api/proposals/drop', { ...w, sig: n.drop && n.drop.sig }), 'Not now. It stays in Claude proposes.');
|
|
217
|
+
}
|
|
218
|
+
if (a === 'promise') { const p = (d.drafts && d.drafts.promise) || {}; return done(await post('/api/ready-reports/promise', { ...base, act: k, date: p.date }), k === 'keep' ? 'Kept. Reports say it is a guess until Jira has tickets.' : 'Not now.'); }
|
|
219
|
+
if (a === 'hold') { const [id, act] = k.split('|'), r = row(id) || {}; return done(await post('/api/ready-reports/hold', { ...base, kind: r.kind, act }), act === 'wait' ? 'It waits. It goes by itself once the source reads, if nothing changed.' : act === 'send-note' ? 'Sent, with the date of the last reading written on it.' : 'Skipped. The next issue covers both weeks.'); }
|
|
220
|
+
// ➤ is the report's Issue press (POST /api/report/issue): PMOS never sends outward; issuing freezes the bytes the PM sends from their mail
|
|
221
|
+
if (a === 'send') { const r = row(k) || {}; if (!r.cadence || !r.slot || !r.sha) { b.disabled = false; if (h.openReport && (r.path || r.desk)) h.openReport(r, d); return; } return done(await post('/api/report/issue', { ws: h.ws || undefined, cadence: r.cadence, slot: r.slot, sha: r.sha }), 'Issued. It is frozen as sent.'); }
|
|
222
|
+
if (a === 'trust') { const r = (d.reports || []).find((x) => x.id === (d.trust && d.trust.reportId)) || (d.reports || [])[0] || {}; return done(await post('/api/ready-reports/trust', { ...base, kind: r.kind || 'weekly', on: k === 'on' }), k === 'on' ? 'Calm weeks get ready by themselves. You still issue each one, and a miss or a decision waits for you.' : 'Not now. Each week waits for you to approve it.'); }
|
|
223
|
+
if (a === 'reread') return done(await post('/api/sources/refresh', { ws: h.ws || undefined, source: k || 'jira' }), 'Reading it again. The dashboard shows it when the read lands.');
|
|
224
|
+
// Connect again: Sources in the Viewer (pm/cozy-sources.js), where a source that is off or failing is connected; ← comes back
|
|
225
|
+
if (a === 'reconnect') { b.disabled = false; if (h.reconnect) { h.reconnect(k); return; } const V = await import('./cozy-viewer.js'); V.drill(); (await import('./cozy-sources.js')).openSources(); return; }
|
|
226
|
+
if (a === 'handled') return done(await post('/api/ready-reports/picks', { ws: h.ws || undefined, scope: d.scope }), 'Kept.');
|
|
227
|
+
b.disabled = false;
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/** One host's Dashboard state, for a view that already draws its work in the Viewer (the initiative view on the Board and on Home).
|
|
232
|
+
* o: { page ('initiative:<id>'), scope, ws, board (each a value or a function), vid (the Viewer item's id), VW, redraw(), toast(t), openReport(row), editNeeds(n), mdHtml() }
|
|
233
|
+
* → { presses(), shows(), html(work), read(via), toggle(), wire(body) } */
|
|
234
|
+
export function dashHost(o) {
|
|
235
|
+
const x = { view: 'work', d: null, read: false, open: new Set() };
|
|
236
|
+
const W = () => (typeof o.ws === 'function' ? o.ws() : o.ws) || '', B = () => (typeof o.board === 'function' ? o.board() : o.board) || '';
|
|
237
|
+
const presses = () => (x.d ? [togglePress(x.view)] : []);
|
|
238
|
+
const shows = () => x.view === 'dash' && !!x.d;
|
|
239
|
+
// the body is drawn again only when it shows the dashboard, before or after: a read that lands on the Work view only adds the header icon,
|
|
240
|
+
// so the focus (a stage picker, a task being typed) stays where the PM left it
|
|
241
|
+
const sync = (drew) => { const c = o.VW.current && o.VW.current(); if (c && c.id === o.vid) { o.VW.setPresses(o.vid, presses()); if (drew || shows()) o.redraw(); } };
|
|
242
|
+
async function read(via) {
|
|
243
|
+
const was = shows();
|
|
244
|
+
const d = await readDash(W(), o.scope, via);
|
|
245
|
+
if (!d) { x.d = null; if (x.view === 'dash') x.view = 'work'; } else { const first = !x.read; x.d = d; if (first) x.view = viewOf(o.page, d.opens); }
|
|
246
|
+
x.read = true; sync(was);
|
|
247
|
+
}
|
|
248
|
+
function toggle() {
|
|
249
|
+
if (!x.d) return;
|
|
250
|
+
x.view = x.view === 'dash' ? 'work' : 'dash'; keepView(o.page, x.view); sync(true);
|
|
251
|
+
const t = document.querySelector('#czViewer [data-cz-vw-p="dash"]'); if (t) t.focus();
|
|
252
|
+
}
|
|
253
|
+
const html = (work) => (shows() ? dashHtml(x.d, { open: x.open, mdHtml: o.mdHtml ? o.mdHtml() : '' }) : work());
|
|
254
|
+
function wire(body) {
|
|
255
|
+
if (body.dataset.dbWired === o.page) return; body.dataset.dbWired = o.page;
|
|
256
|
+
// ✎ on Needs you: the work shows (this once, not kept as the PM's choice) and Claude proposes opens on the decision (pm/ini-props.js)
|
|
257
|
+
const editNeeds = o.editNeeds || (() => { x.view = 'work'; sync(); setTimeout(() => { const c = document.querySelector('#czViewer [data-cz-vw="chip"]'); if (c) c.click(); }, 0); });
|
|
258
|
+
wireDash(body, { d: () => { const c = o.VW.current && o.VW.current(); return shows() && c && c.id === o.vid ? x.d : null; }, open: x.open, get ws() { return W(); }, get board() { return B(); }, toast: o.toast, redraw: o.redraw, reload: () => read(), openReport: o.openReport, editNeeds });
|
|
259
|
+
}
|
|
260
|
+
return { presses, shows, html, read, toggle, wire, state: x };
|
|
261
|
+
}
|
|
@@ -52,6 +52,7 @@ import * as PO from './prog-order.js'; // a program's order on Home: the grip,
|
|
|
52
52
|
import * as IMP from './home-impact.js'; // Your impact: the weekly check in Home's own chat (batch 16 item 7, GmP1Ledger)
|
|
53
53
|
import * as LPV from './loose-props.js'; // Claude's clean-up of "Not in an initiative": the ✦ on its header and the Viewer (batch 13 item 3)
|
|
54
54
|
import * as IM from './impact.js'; // Your impact (batch 16 item 7): Adler's sprout on the greeting, the week in the Viewer, the Friday chapter
|
|
55
|
+
import * as DB from './dash-view.js'; // the product page is the product's Dashboard (batch 17 item 1, canvas PbA3, PbG6, PbG8)
|
|
55
56
|
import { initiativeRename, taskRename } from './rename-press.js'; // tap the title to rename (canvas RnATask, RnASaved) // the pinned recording row above it (XvARecHome)
|
|
56
57
|
|
|
57
58
|
const $ = (s, r = document) => r.querySelector(s);
|
|
@@ -830,6 +831,7 @@ function openProductPage() {
|
|
|
830
831
|
+ `<section class="hi-pg" aria-label="This week"><div class="hi-pgh"><b>This week</b></div>${row('update', I.doc, 'Weekly update', sent ? 'Sent this week' : 'Ready to send')}${row('metrics', I.chart, 'Metrics review', 'With Strategist')}</section>`
|
|
831
832
|
+ (isPhone() ? `<button type="button" class="hi-talk" data-hp="talk">Message Claude about ${esc(name)}</button>` : '') + '</div>';
|
|
832
833
|
fillGoals(b, boardWs());
|
|
834
|
+
productDash(b, boardWs() || '', 'product', name);
|
|
833
835
|
b.onclick = (e) => {
|
|
834
836
|
const t = e.target.closest('[data-hp]'); if (!t) return;
|
|
835
837
|
if (t.dataset.hp === 'update') { VW.drill(); openTarget(updateTarget()); openUpdateViewer(); }
|
|
@@ -838,6 +840,29 @@ function openProductPage() {
|
|
|
838
840
|
};
|
|
839
841
|
} });
|
|
840
842
|
}
|
|
843
|
+
/** The product page as the product's Dashboard (batch 17 item 1, PbA3): the ✦ line, Goals folded to their dots, Ships next, This week's
|
|
844
|
+
* reports. It has no toggle: the page already is the dashboard. Until GET /api/ready-reports/dashboard answers (or when it cannot), the page
|
|
845
|
+
* keeps the Goals and This week it drew before. */
|
|
846
|
+
const PDASH = new Map(); // ws → { d, open }
|
|
847
|
+
function productDash(b, ws, vid, name) {
|
|
848
|
+
const x = PDASH.get(ws) || { d: null, open: new Set() }; PDASH.set(ws, x);
|
|
849
|
+
const paint = () => {
|
|
850
|
+
const c = VW.current(); if (!x.d || !b.isConnected || !c || c.id !== vid) return;
|
|
851
|
+
b.innerHTML = DB.dashHtml(x.d, { open: x.open, metrics: true, talk: isPhone() ? `<button type="button" class="hi-talk" data-hp="talk">Message Claude about ${esc(name)}</button>` : '' });
|
|
852
|
+
};
|
|
853
|
+
if (b.dataset.dbWired !== ws) {
|
|
854
|
+
b.dataset.dbWired = ws;
|
|
855
|
+
DB.wireDash(b, { d: () => x.d, open: x.open, ws, toast, redraw: paint,
|
|
856
|
+
// the metrics review, as the page offered before it was the dashboard: here for the board's product, in its own Home for another
|
|
857
|
+
metrics: () => { if (vid === 'product') { VW.drill(); openMetrics(); } else window.open('/premium.html?ws=' + encodeURIComponent(ws) + '&ini=product&view=metrics', '_blank', 'noopener'); }, reload: async () => { const d = await DB.readDash(ws, 'product', 'read'); if (d) x.d = d; paint(); },
|
|
858
|
+
openReport: async (row) => {
|
|
859
|
+
// Home's own weekly update (desk: true, 1-A) opens its update flow, not a document
|
|
860
|
+
if (row.desk) { if (vid === 'product') { VW.drill(); openTarget(updateTarget()); openUpdateViewer(); } else window.open('/premium.html?ws=' + encodeURIComponent(ws) + '&ini=product', '_blank', 'noopener'); return; }
|
|
861
|
+
if (!row.path) return; VW.drill(); (await import('./premium-report-read.js')).openReportView(row.path, { ws, name: row.name, cuts: true }); } });
|
|
862
|
+
}
|
|
863
|
+
paint();
|
|
864
|
+
DB.readDash(ws, 'product', 'read').then((d) => { if (d) { x.d = d; paint(); } });
|
|
865
|
+
}
|
|
841
866
|
/** A phone: the page's "Message Claude about …" closes the sheet and opens the chat full screen; its ← goes back to the list (HbCPhone). */
|
|
842
867
|
function talk() { S.phoneChat = true; VW.close(); drawList(); chat.focus(); }
|
|
843
868
|
/** "Overview with Claude" on the initiative's card: the ask is typed into the chat box, for the PM to send or change. */
|
|
@@ -983,6 +1008,7 @@ function goOtherProduct(g) {
|
|
|
983
1008
|
b.innerHTML = `<div class="hi-v hi-page">${goalsBlock(ws)}`
|
|
984
1009
|
+ `<section class="hi-pg" aria-label="This week"><div class="hi-pgh"><b>This week</b></div><div class="hm-r hi-r"><a class="hm-rm" href="${esc(own)}" target="_blank" rel="noopener"><span class="hm-tile">${SVG(I.doc, 14)}</span><span class="hm-rt"><b>Weekly update and metrics review</b><em class="q">In ${esc(name)}'s own Home, in a new tab</em></span></a></div></section>`
|
|
985
1010
|
+ (isPhone() ? `<button type="button" class="hi-talk" data-hp="talk">Message Claude about ${esc(name)}</button>` : '') + '</div>';
|
|
1011
|
+
productDash(b, ws, 'product:' + ws, name);
|
|
986
1012
|
// a phone has no chat beside the page: its own chat is one press away, as on the board's own product (Wawan, 2026-10-25)
|
|
987
1013
|
fillGoals(b, ws);
|
|
988
1014
|
b.onclick = (e) => { const t = e.target.closest('[data-hp="talk"]'); if (t) talk(); };
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* homeLists(D) the Home list: Needs you (top 3 + "N more"), Initiatives (the product first) and Loose, each row with its kids
|
|
6
6
|
* iniLayout(D, id) one initiative as a layout of Home: its card's groups (Needs you, Sessions, Stakeholders, Meetings, Routines, Files,
|
|
7
7
|
* Finished sessions) and the Elsewhere line
|
|
8
|
-
* productCard(D) the product's card: "This week", the KRs and the budget on track or at risk, Then, the next routine, the CTA
|
|
8
|
+
* productCard(D) the product's card (every anchor from D.board.anchorRows when sent): "This week", the KRs and the budget on track or at risk, Then, the next routine, the CTA
|
|
9
9
|
* weeklyUpdate(D) the weekly update the Viewer shows and Send turns into a mail draft: On track, At risk, Needs a decision
|
|
10
10
|
* streamOf(conv, o) the chat's stream: day dividers, "New since you left", "N earlier messages", messages, Worked-for folds
|
|
11
11
|
* meetLineOf(P) the meeting line: the current or next meeting, +N for the rest of the day
|
|
@@ -153,7 +153,8 @@ export function productName(D) {
|
|
|
153
153
|
}
|
|
154
154
|
/** The product's KRs and budgets this week: one item per anchor, on track when none of its initiatives is late or at risk. */
|
|
155
155
|
export function productCard(D, now = Date.now()) {
|
|
156
|
-
|
|
156
|
+
// every open initiative's anchor when the board sends them (anchorRows, batch 17), so the count matches the product's dashboard; else the rows listed
|
|
157
|
+
const rows = D.board && Array.isArray(D.board.anchorRows) ? D.board.anchorRows : boardRows(D).filter(OPEN);
|
|
157
158
|
const by = new Map();
|
|
158
159
|
for (const r of rows) { const a = anchorOf(r); if (!by.has(a)) by.set(a, []); by.get(a).push(r); }
|
|
159
160
|
const items = [...by.entries()].filter(([a]) => a !== 'No anchor').map(([a, L]) => {
|
|
@@ -32,6 +32,7 @@ import { iniMore, iniText, pageHref, stagePick, deleteSaid, DELETE_MS } from './
|
|
|
32
32
|
import * as SC from './home-stage-card.js';
|
|
33
33
|
import { viewHtml, wireView } from './ini-view.js'; // the one initiative view, the Board's panel's own renderer
|
|
34
34
|
import { ensureCss as ensureStepsCss } from './cozy-steps.js'; // stage card D: the card's last node and the move sheet's words // D99: the initiative's own workflow (Change picker, switch, Won't do, Archive)
|
|
35
|
+
import * as DB from './dash-view.js'; // the ready-made Dashboard view (batch 17 item 1)
|
|
35
36
|
|
|
36
37
|
const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]));
|
|
37
38
|
const SVG = (d, w = 16, sw = 1.8) => `<svg aria-hidden="true" width="${w}" height="${w}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="${sw}" stroke-linecap="round" stroke-linejoin="round"><path d="${d}"/></svg>`;
|
|
@@ -47,6 +48,18 @@ const X = { ctx: null, L: new Map(), reading: new Set(), tried: new Set(), view:
|
|
|
47
48
|
const curM = () => { const S = X.ctx && X.ctx.S; return S && S.ini && S.ini !== 'product' && S.IMid === S.ini ? S.IM : null; };
|
|
48
49
|
const wsOf = (M) => (M && M.board && M.board.ws) || undefined;
|
|
49
50
|
const bw = (M) => ({ ws: M.board.ws, board: M.board.id });
|
|
51
|
+
/* ── the Dashboard view (batch 17 item 1, pm/dash-view.js; canvas PbH1Header): one header icon on the page switches Work and Dashboard ── */
|
|
52
|
+
const DASH = new Map(); // initiative id → its Dashboard host
|
|
53
|
+
function dashFor(id) {
|
|
54
|
+
if (!id || id === 'product' || !X.ctx) return null;
|
|
55
|
+
if (!DASH.has(id)) {
|
|
56
|
+
const wsOf = () => { const M = curM(); return (M && M.board.ws) || (rowOf(id) || {}).ws || ''; };
|
|
57
|
+
DASH.set(id, DB.dashHost({ page: 'initiative:' + id, scope: 'initiative:' + id, ws: wsOf, board: () => { const M = curM(); return (M && M.board.id) || (rowOf(id) || {}).boardId || ''; },
|
|
58
|
+
vid: 'ov:' + id, VW: X.ctx.VW, redraw: () => { if (BODY) BODY.__pg = null; redrawView(); }, toast: (t) => X.ctx.toast(t),
|
|
59
|
+
openReport: async (row) => { if (!row.path) return; X.ctx.VW.drill(); (await import('./premium-report-read.js')).openReportView(row.path, { ws: wsOf(), name: row.name, cuts: true }); } }));
|
|
60
|
+
}
|
|
61
|
+
return DASH.get(id);
|
|
62
|
+
}
|
|
50
63
|
async function readL(id, M, force) {
|
|
51
64
|
if (!force && (X.L.has(id) || X.reading.has(id))) return;
|
|
52
65
|
X.reading.add(id);
|
|
@@ -426,9 +439,13 @@ export function iniPage() {
|
|
|
426
439
|
const VW = X.ctx.VW;
|
|
427
440
|
let rename = X.ctx.renameIni ? X.ctx.renameIni(id, '') : null;
|
|
428
441
|
if (rename) rename = { ...rename, value: X.ctx.iniTitle(id) };
|
|
442
|
+
const dh = dashFor(id);
|
|
429
443
|
BODY = VW.open({ id: 'ov:' + id, kind: X.ctx.kindOf(id), title: X.ctx.iniTitle(id), icon: 'goal', more: () => pageMore(id), rename,
|
|
430
444
|
discuss: () => X.ctx.newIn(id), discussHome: true, // the one view (OvViewers): Discuss starts a new session about it, where + New session was
|
|
431
|
-
|
|
445
|
+
presses: dh ? dh.presses() : null, onPress: (a) => { if (a === 'dash' && dh) dh.toggle(); },
|
|
446
|
+
render: (b) => { X.view = 'page'; BODY = b; ADDING = null; draw(b); wire(b, id); wirePage(b, id); if (dh) dh.wire(b); } });
|
|
447
|
+
// came to read (?view=dashboard: a report, Intelligence, a notification) or to act (a Home task): which view opens first
|
|
448
|
+
if (dh) dh.read(new URLSearchParams(location.search).get('view') === 'dashboard' ? 'read' : 'act');
|
|
432
449
|
WF.pmosNotice(wfUi(), id); // WfTriage: "Set to Tender from the BRD · Undo", once
|
|
433
450
|
if (!curM()) { X.failed = null; X.ctx.loadIni().then(() => { if (S.ini !== id) return; if (!curM()) X.failed = id; redrawView(); }); }
|
|
434
451
|
return true;
|
|
@@ -497,6 +514,7 @@ function draw(b) {
|
|
|
497
514
|
if (!M) { b.__pg = null; b.innerHTML = `<div class="hi-v"><p class="hi-small" role="status">${X.failed === id ? 'The initiative could not be read.' : 'Reading the initiative.'}</p></div>`; return; }
|
|
498
515
|
const v = X.view;
|
|
499
516
|
if (v !== 'page') b.__pg = null;
|
|
517
|
+
if (v === 'page' && dashFor(id) && dashFor(id).shows()) { b.__pg = null; b.innerHTML = dashFor(id).html(() => ''); return; }
|
|
500
518
|
if (v === 'page') { const h = pageHtml(id, M); if (b.__pg !== h || !b.firstChild) { b.__pg = h; b.innerHTML = h; } return; }
|
|
501
519
|
// Documents is shell A (XvADocs): no tabs, the summary card and folding groups straight in the body
|
|
502
520
|
if (v === 'docs') { b.innerHTML = docsView(id, M) + '<p class="hi-small" role="status" id="ovMsg"></p>'; return; }
|
|
@@ -36,6 +36,7 @@ import { mountNav } from './cozy-nav.js';
|
|
|
36
36
|
import { mountLivePill } from './cozy-live-pill.js';
|
|
37
37
|
import * as IM from './impact.js'; // Your impact's ✦ line (batch 16 item 7): a key result your work moved
|
|
38
38
|
import * as AD from './cozy-adler.js'; // Adler in Claude's ✦ line only, never in a chart (batch 16 item 2, canvas AdH3, AdM3)
|
|
39
|
+
import * as RL from './ready-lib.js'; // the ready-made reports of every program, product and initiative (batch 17 item 1, PbA6, PbG4)
|
|
39
40
|
import * as RI from './premium-report-intel.js'; // a report made from Intelligence (batch 15 item 4): the header icon, the ✦ proposals, the draft panel
|
|
40
41
|
import * as OK from './okr-list.js'; // Claude runs the OKRs (batch 16 item 6, 6-B): the goal list, its drafts, the ✦ line, ⋯ › Metrics, the notify choice
|
|
41
42
|
|
|
@@ -570,6 +571,7 @@ document.addEventListener('keydown', (e) => {
|
|
|
570
571
|
let libBack = null;
|
|
571
572
|
function openLib() {
|
|
572
573
|
if (!$('#side').hidden) closeSide();
|
|
574
|
+
LIB.read = false;
|
|
573
575
|
libBack = document.activeElement; $('#libSide').hidden = false; document.body.classList.add('ins-sideon'); drawList(); $('#libSide').focus({ preventScroll: true });
|
|
574
576
|
}
|
|
575
577
|
function closeLib(focus) {
|
|
@@ -1455,8 +1457,14 @@ function drawList() {
|
|
|
1455
1457
|
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>`
|
|
1456
1458
|
: !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>' : '';
|
|
1457
1459
|
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>`;
|
|
1458
|
-
$('#repBody').innerHTML = `${oneNote()}<div id="listRows" aria-label="Dashboards and reports">${fbox}${empty}${table}${dashBlock}</div>`;
|
|
1459
|
-
}
|
|
1460
|
+
$('#repBody').innerHTML = `${oneNote()}<div id="readyLib">${RL.libHtml(LIB.L, { open: LIB.open, yours: true })}</div><div id="listRows" aria-label="Dashboards and reports">${fbox}${empty}${table}${dashBlock}</div>`;
|
|
1461
|
+
if (!LIB.read && M.board && M.board.ws) { LIB.read = true; RL.readLib(M.board.ws).then((L) => { LIB.L = L; if (!$('#libSide').hidden) drawLib(); }); }
|
|
1462
|
+
}
|
|
1463
|
+
/* the ready-made group before Yours (batch 17 item 1, PbA6): read once per open of the panel, again after a switch */
|
|
1464
|
+
const LIB = { L: null, read: false, open: new Set() };
|
|
1465
|
+
const drawLib = () => { const el = $('#readyLib'); if (el) el.innerHTML = RL.libHtml(LIB.L, { open: LIB.open, yours: true }); };
|
|
1466
|
+
RL.wireLib($('#repBody'), { get ws() { return M && M.board ? M.board.ws : ''; }, open: LIB.open, toast: (t) => toast(t), redraw: drawLib,
|
|
1467
|
+
reload: async () => { LIB.L = await RL.readLib(M.board.ws); drawLib(); } });
|
|
1460
1468
|
$('#repBody').addEventListener('click', async (e) => {
|
|
1461
1469
|
const d = e.target.closest('[data-d]'); if (d) { setView(d.dataset.d); return; }
|
|
1462
1470
|
const fx = e.target.closest('[data-fx]');
|
|
@@ -32,7 +32,8 @@
|
|
|
32
32
|
* thumbnails; Undo and Redo dim when there is nothing to take back or do again. premium-vw-slides.js draws it in the card.
|
|
33
33
|
*
|
|
34
34
|
* openReport(row, hand) row = a Reports card document { cadence, slot, date, path, state, archived }; hand = { ws, name, cycles, onIssue, onChange }
|
|
35
|
-
* openReportView(ref, o) ref = a report path reports/<cadence>/<date>.md or a row; the window.czViews entry (premium-vw-open.js)
|
|
35
|
+
* openReportView(ref, o) ref = a report path reports/<cadence>/<date>.md or a row; the window.czViews entry (premium-vw-open.js).
|
|
36
|
+
* o.cuts: a ready-made report (batch 17 item 1, PbG5): Sponsors · 1 minute | Team · full over the same numbers
|
|
36
37
|
* wordsOf(md, fallback) the document as { title, sections: [{ h, lines }] } (pure)
|
|
37
38
|
* slideHtml(lines) a section's lines as html (pure) · splitRender(html) · slideCard(s, mini) · fit(root) · schedLabel(setup) (pure)
|
|
38
39
|
*
|
|
@@ -67,6 +68,7 @@ const P = {
|
|
|
67
68
|
page: '<path d="M6 3h9l4 4v14H6zM14 3v5h5"/>', print: '<path d="M7 9V4h10v5M7 17H5v-6h14v6h-2M8 14h8v6H8z"/>', hist: '<path d="M3 12a9 9 0 1 0 3-6.7L3 8M3 3v5h5M12 7v5l3 2"/>',
|
|
68
69
|
warn: '<path d="M12 4l9 16H3zM12 10v4M12 17h.01"/>', bin: '<path d="M5 7h14M10 7V4h4v3M7 7l1 13h8l1-13"/>', box: '<path d="M4 5h16v4H4zM5 9v10h14V9M10 13h4"/>', lock: '<rect x="5" y="11" width="14" height="10" rx="2"/><path d="M8 11V8a4 4 0 0 1 8 0v3"/>',
|
|
69
70
|
redo2: '<path d="M20 11a8 8 0 1 0-2.3 5.7M20 4v7h-7"/>', undo: '<path d="M9 14 4 9l5-5M4 9h11a5 5 0 0 1 0 10h-3"/>', redo: '<path d="m15 14 5-5-5-5M20 9H9a5 5 0 0 0 0 10h3"/>',
|
|
71
|
+
people: '<path d="M9 11a3.5 3.5 0 1 0 0-7a3.5 3.5 0 1 0 0 7M2.5 20a6.5 6.5 0 0 1 13 0M16 4.5a3.5 3.5 0 0 1 0 6.5M18 14a6 6 0 0 1 3.5 6"/>', list: '<path d="M9 6h11M9 12h11M9 18h11M4.5 6h.01M4.5 12h.01M4.5 18h.01"/>',
|
|
70
72
|
plus: '<path d="M12 5v14M5 12h14"/>', dl: '<path d="M12 4v11M7 10l5 5 5-5M5 20h14"/>', live: '<path d="M3 17l5-5 4 4 8-8M16 8h4v4"/>', layout: '<rect x="4" y="4" width="16" height="16" rx="2"/><path d="M4 10h16M10 10v10"/>',
|
|
71
73
|
theme: '<path d="M12 3a9 9 0 1 0 0 18c1 0 1.5-.8 1.5-1.6 0-1-.8-1.4-.8-2.4 0-1 .8-1.6 1.8-1.6H17a4 4 0 0 0 4-4c0-4.6-4-8.4-9-8.4z"/><circle cx="7.5" cy="11" r="1"/><circle cx="10.5" cy="7.5" r="1"/><circle cx="15" cy="7.5" r="1"/>',
|
|
72
74
|
};
|
|
@@ -345,9 +347,37 @@ function sumHtml() {
|
|
|
345
347
|
primary: { act: S.primary.r, label: S.primary.label, icon: PRI_ICON[S.primary.r] || 'back', disabled: R.busy } });
|
|
346
348
|
}
|
|
347
349
|
/** The bar (OvReport): Slides | Document | Live page, then Edit (a draft), Present, Share (when it is not the primary) and Download. */
|
|
350
|
+
/* ── the two cuts of one ready-made report (batch 17 item 1, canvas PbG5): Sponsors (1 minute) and Team (full), the same numbers. The team cut
|
|
351
|
+
* is the document as drafted; the sponsors cut is read from it (GET /api/ready-reports/cut). Under the switch, each section of the team cut,
|
|
352
|
+
* ticked when the sponsors read it too, else "Team only". The team cut is the one that is edited. */
|
|
353
|
+
function cutsHtml() {
|
|
354
|
+
const C = R.cuts; if (!C || R.edit) return '';
|
|
355
|
+
const b = (k, icon, l) => `<button type="button" data-r="cut|${k}" aria-pressed="${C.on === k}">${icon}<span>${l}</span></button>`;
|
|
356
|
+
const seg = `<div class="rp-seg vz-cuts" role="group" aria-label="Who reads it">${b('sponsors', ic('people', 15), 'Sponsors · 1 minute')}${b('team', ic('list', 15), 'Team · full')}</div>`;
|
|
357
|
+
let list = '';
|
|
358
|
+
if (C.on === 'sponsors' && C.teamW && R.W) {
|
|
359
|
+
const has = new Set(R.W.sections.map((x) => String(x.h).toLowerCase()));
|
|
360
|
+
// the lead before the first heading (wordsOf's "Summary") is the answer and its 3 points, as the design names it
|
|
361
|
+
list = `<p class="vz-lab">Sponsors read</p><ul class="vz-cutl">${C.teamW.sections.filter((x) => x.h).map((x) => { const on = has.has(String(x.h).toLowerCase()); return `<li class="${on ? 'on' : ''}"><span class="vz-cb" aria-hidden="true">${on ? ic('check', 12) : ''}</span><span><b>${esc(x.h === 'Summary' ? 'The answer and 3 points' : x.h)}</b>${on ? '' : '<small>Team only</small>'}</span></li>`; }).join('')}</ul><p class="vz-note">Same numbers in both.</p>`;
|
|
362
|
+
}
|
|
363
|
+
return `<div class="vz-cut">${seg}${C.err ? `<p class="vz-msg" role="status">${esc(C.err)}</p>` : ''}${list}</div>`;
|
|
364
|
+
}
|
|
365
|
+
async function cutTo(k) {
|
|
366
|
+
const C = R.cuts, me = R; if (!C || C.on === k) return;
|
|
367
|
+
if (k === 'team') { C.on = 'team'; if (C.team != null) { R.text = C.team; R.W = wordsOf(R.text, R.name); } return draw(); }
|
|
368
|
+
if (C.sponsors == null) {
|
|
369
|
+
const j = await Promise.resolve(pmGet('/api/ready-reports/cut?' + q({ ws: R.ws, path: R.row.path, cut: 'sponsors' }))).catch(() => null);
|
|
370
|
+
if (R !== me) return;
|
|
371
|
+
if (!j || !j.ok || typeof j.markdown !== 'string') { C.err = (j && j.error) || 'The sponsors cut could not be read. The team cut is shown.'; return draw(); }
|
|
372
|
+
C.sponsors = j.markdown;
|
|
373
|
+
}
|
|
374
|
+
C.err = ''; C.team = C.team == null ? R.text : C.team; C.teamW = wordsOf(C.team, R.name); C.on = 'sponsors';
|
|
375
|
+
R.text = C.sponsors; R.W = wordsOf(R.text, R.name); R.i = 0;
|
|
376
|
+
draw();
|
|
377
|
+
}
|
|
348
378
|
function barHtml() {
|
|
349
379
|
return rpBarHtml({ view: R.view, views: [['deck', 'Slides'], ['doc', 'Document'], ['live', 'Live page']], tools: [
|
|
350
|
-
R.issued ? null : { act: 'edit', label: 'Edit', icon: 'pen' }, { act: 'present', label: 'Present', icon: 'present' },
|
|
380
|
+
R.issued || (R.cuts && R.cuts.on === 'sponsors') ? null : { act: 'edit', label: 'Edit', icon: 'pen' }, { act: 'present', label: 'Present', icon: 'present' },
|
|
351
381
|
R.issued && !R.archived ? null : { act: 'share', label: 'Share', icon: 'share', exp: R.pop === 'share', pop: 'dialog' },
|
|
352
382
|
{ act: 'dlm', label: 'Download', icon: 'dl', exp: R.pop === 'dl' }] });
|
|
353
383
|
}
|
|
@@ -397,7 +427,7 @@ function bodyHtml() {
|
|
|
397
427
|
}
|
|
398
428
|
const view = R.err ? `<p class="vz-msg" data-tone="bad" role="alert">The document could not be read: ${esc(R.err)}</p>` : !R.W ? '<p class="vz-empty" role="status">Reading the report.</p>'
|
|
399
429
|
: R.view === 'deck' ? deckHtml() : R.view === 'live' ? liveView() : pageHtml();
|
|
400
|
-
return `<div class="vz-rpb">${R.conf ? confHtml() : R.W ? sumHtml() : ''}${R.msg ? `<p class="vz-msg" role="status" data-tone="${R.msg.tone || ''}">${esc(R.msg.text)}</p>` : ''}${R.W && !R.err ? barHtml() : ''}${view}${R.W && !R.err ? foldsHtml() : ''}${askHtml()}</div>`;
|
|
430
|
+
return `<div class="vz-rpb">${R.conf ? confHtml() : R.W ? sumHtml() : ''}${R.W && !R.err ? cutsHtml() : ''}${R.msg ? `<p class="vz-msg" role="status" data-tone="${R.msg.tone || ''}">${esc(R.msg.text)}</p>` : ''}${R.W && !R.err ? barHtml() : ''}${view}${R.W && !R.err ? foldsHtml() : ''}${askHtml()}</div>`;
|
|
401
431
|
}
|
|
402
432
|
const tipText = (i, n) => `Slide ${i + 1} of ${n}. Click an item to change it; double-click text to type.`;
|
|
403
433
|
/** The editor's slide and its undo history changed: the tip and the dimmed Undo and Redo follow it. */
|
|
@@ -472,6 +502,7 @@ export function fit(root) { root.querySelectorAll('.vz-fr').forEach((c) => { if
|
|
|
472
502
|
const say = (text, tone) => { R.msg = { text, tone }; draw(); };
|
|
473
503
|
async function act([k, v], t) {
|
|
474
504
|
if (k === 'pop') { R.pop = v || null; return draw(); }
|
|
505
|
+
if (k === 'cut') return cutTo(v);
|
|
475
506
|
if (k === 'bf') return briefAct(v, t.dataset.r.split('|').slice(2).join('|'));
|
|
476
507
|
if (k === 'lv') return liveAct(v, t.dataset.r.split('|').slice(2).join('|'));
|
|
477
508
|
if (k === 'dlm') { R.pop = R.pop === 'dl' ? null : 'dl'; return draw(); }
|
|
@@ -859,7 +890,7 @@ export async function openReport(row, hand = {}) {
|
|
|
859
890
|
if (R) present(false);
|
|
860
891
|
const me = R = { row, ws: hand.ws || '', id: c.cadence, name: hand.name || row.name || c.cadence || 'Report', audience: hand.audience || '', issued: row.state === 'issued', archived: !!row.archived,
|
|
861
892
|
text: '', err: '', W: null, view: 'deck', BF: null, bfRaw: null, bfMsg: '', LV: null, blank: false, i: 0, cyc: null, setup: undefined, pop: null, conf: false, checks: null, issueErr: '', busy: false, ask: '', askErr: '', edit: false, msg: null,
|
|
862
|
-
sch: schedPick(null), schErr: '', shr: null, shares: null, more: [], hand, cycles: (hand.cycles || []).slice(), onIssue: hand.onIssue || null, onChange: hand.onChange || null, vid: 'report:' + row.path };
|
|
893
|
+
sch: schedPick(null), schErr: '', shr: null, shares: null, more: [], hand, cuts: hand.cuts ? { on: 'team', team: null, sponsors: null, err: '' } : null, cycles: (hand.cycles || []).slice(), onIssue: hand.onIssue || null, onChange: hand.onChange || null, vid: 'report:' + row.path };
|
|
863
894
|
const head = me.head = () => ({ id: me.vid, kind: 'Report' + (me.audience ? ' · ' + me.audience : ''), title: me.name, icon: me.view === 'doc' ? 'doc' : 'report', full: true, url: viewUrl(row, me.ws), more: me.more,
|
|
864
895
|
render: (b) => { syncMore(); b.innerHTML = panelHtml(); wire(b); }, onClose: () => { if (R === me && !me.reopen) { present(false); R = null; } } });
|
|
865
896
|
vOpen(head());
|
|
@@ -886,7 +917,7 @@ async function watchFile(me) {
|
|
|
886
917
|
while (R === me) {
|
|
887
918
|
await new Promise((ok) => setTimeout(ok, CHECK_MS));
|
|
888
919
|
if (R !== me) return;
|
|
889
|
-
if (document.hidden || me.edit || me.busy || me.pop) continue;
|
|
920
|
+
if (document.hidden || me.edit || me.busy || me.pop || (me.cuts && me.cuts.on === 'sponsors')) continue; // the sponsors cut is read from the file, not the file
|
|
890
921
|
const h = await stamp();
|
|
891
922
|
if (R !== me || !h) continue;
|
|
892
923
|
if (seen && h !== seen) { await reread(); if (R === me && !me.edit && !me.pop) draw(); }
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/* pm/ready-lib.css — the ready-made reports in Reports and dashboards (pm/ready-lib.js; canvas PbA6Library, PbG4Overlap). Token vars only, over
|
|
2
|
+
* pm/cozy.css; every class starts with rl-. */
|
|
3
|
+
.rl { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
|
|
4
|
+
.rl-lead { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--cz-bluebg); border: 1px solid color-mix(in srgb, var(--cz-blueink) 18%, transparent); }
|
|
5
|
+
.rl-lead p { margin: 0; flex: 1; min-width: 0; font-size: var(--fs-4); line-height: 1.45; color: var(--cz-ink2); }
|
|
6
|
+
.rl-lead b { color: var(--cz-ink); font-weight: 800; }
|
|
7
|
+
.rl-sp { flex: none; color: var(--cz-blueink); margin-top: 3px; display: inline-flex; }
|
|
8
|
+
.rl-ok { all: unset; box-sizing: border-box; cursor: pointer; flex: none; width: 44px; height: 44px; border-radius: 999px; background: var(--cz-blue); color: var(--cz-onsolid); display: inline-flex; align-items: center; justify-content: center; }
|
|
9
|
+
.rl-ok[disabled] { opacity: .45; cursor: default; }
|
|
10
|
+
.rl-h { margin: 6px 0 0; font-size: var(--fs-4); font-weight: 800; color: var(--cz-ink); }
|
|
11
|
+
.rl-h span { font-weight: 700; color: var(--cz-ink3); }
|
|
12
|
+
.rl-card { background: var(--cz-card); border: 1px solid var(--cz-hair); border-radius: 16px; padding: 2px 14px; display: flex; flex-direction: column; }
|
|
13
|
+
.rl-row { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; padding: 10px 0; width: 100%; }
|
|
14
|
+
.rl-card > * + * { border-top: 1px solid var(--cz-hair); }
|
|
15
|
+
.rl-fold { cursor: pointer; }
|
|
16
|
+
.rl-fold > svg { flex: none; color: var(--cz-ink3); }
|
|
17
|
+
.rl-fold[aria-expanded="true"] > svg { transform: rotate(180deg); }
|
|
18
|
+
.rl-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
|
|
19
|
+
.rl-t b { font-size: var(--fs-4); font-weight: 800; }
|
|
20
|
+
.rl-t small { font-size: var(--fs-2); line-height: 1.4; color: var(--cz-ink3); }
|
|
21
|
+
.rl-pk { color: var(--cz-blueink); }
|
|
22
|
+
.rl-av { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--cz-bluebg); color: var(--cz-blueink); display: inline-flex; align-items: center; justify-content: center; }
|
|
23
|
+
.rl-sw { all: unset; box-sizing: border-box; cursor: pointer; flex: none; width: 44px; height: 26px; border-radius: 999px; background: var(--cz-well2, var(--cz-hair)); position: relative; }
|
|
24
|
+
.rl-sw i { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--cz-card); box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: left .15s ease; }
|
|
25
|
+
.rl-sw.on { background: var(--cz-blue); }
|
|
26
|
+
.rl-sw.on i { left: 21px; }
|
|
27
|
+
.rl-sw[disabled] { opacity: .45; cursor: default; }
|
|
28
|
+
.rl-sw:focus-visible, .rl-ok:focus-visible, .rl-fold:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; }
|
|
29
|
+
@media (prefers-reduced-motion: reduce) { .rl-sw i { transition: none; } }
|