create-pmos 0.434.0 → 0.436.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.
Files changed (51) hide show
  1. package/package.json +25 -25
  2. package/payload/KIT-VERSION +1 -1
  3. package/payload/planning/evals/eval-calibration.md +1 -1
  4. package/payload/planning/okrs/health-budgets.md +1 -1
  5. package/payload/state/discoveries.md +1 -1
  6. package/workspace/changelog.json +24 -0
  7. package/workspace/fixtures/ready-reports.js +145 -0
  8. package/workspace/guide/home.md +1 -1
  9. package/workspace/guide/index.md +1 -0
  10. package/workspace/guide/initiative-boards.md +1 -1
  11. package/workspace/guide/ready-made-dashboards.md +62 -0
  12. package/workspace/lib/board-premium.js +1 -1
  13. package/workspace/lib/engine/boards.js +1 -1
  14. package/workspace/lib/intel-report.js +36 -5
  15. package/workspace/lib/ready-reports.js +616 -0
  16. package/workspace/lib/report-dashboards.js +5 -0
  17. package/workspace/lib/report-setups.js +16 -7
  18. package/workspace/lib/route-modules.js +1 -0
  19. package/workspace/lib/routes-board-premium.js +5 -0
  20. package/workspace/lib/routes-boards.js +3 -2
  21. package/workspace/lib/routes-ready-reports.js +455 -0
  22. package/workspace/lib/routes-report-setups.js +4 -3
  23. package/workspace/package-lock.json +2 -2
  24. package/workspace/package.json +1 -1
  25. package/workspace/program-charter-test.js +11 -7
  26. package/workspace/program-panel-test.js +1 -1
  27. package/workspace/public/pm/bd-ini-panel.js +23 -6
  28. package/workspace/public/pm/bd-prog-panel.js +58 -10
  29. package/workspace/public/pm/cozy-viewer.js +2 -2
  30. package/workspace/public/pm/cozy-vw-rp.css +13 -0
  31. package/workspace/public/pm/dash-view.css +111 -0
  32. package/workspace/public/pm/dash-view.js +261 -0
  33. package/workspace/public/pm/home-app.js +26 -0
  34. package/workspace/public/pm/home-data.js +3 -2
  35. package/workspace/public/pm/home-ini.js +19 -1
  36. package/workspace/public/pm/home-task.js +4 -2
  37. package/workspace/public/pm/ini-tasks.js +34 -6
  38. package/workspace/public/pm/ini-view.css +4 -0
  39. package/workspace/public/pm/premium-insights.js +10 -2
  40. package/workspace/public/pm/premium-report-read.js +36 -5
  41. package/workspace/public/pm/premium-vw-item.js +2 -0
  42. package/workspace/public/pm/ready-lib.css +29 -0
  43. package/workspace/public/pm/ready-lib.js +62 -0
  44. package/workspace/public/pm/task-card.css +1 -0
  45. package/workspace/public/pm/task-card.js +8 -3
  46. package/workspace/ready-dash-ui-test.js +227 -0
  47. package/workspace/server.js +2 -0
  48. package/workspace/task-delete-test.js +31 -0
  49. package/workspace/task-views-test.js +16 -0
  50. package/workspace/test-lists/batch17-ready-reports.json +9 -0
  51. package/workspace/test-lists/ready-reports-ui.json +6 -0
@@ -151,7 +151,7 @@ function setupOut(s, now, docsOf, idx, root, draft) {
151
151
  if (s.status === 'active') { try { const n = RS.nextDraftAt(s.schedule, s.last_run, now); next = n ? n.toISOString() : null; } catch { next = null; } }
152
152
  return {
153
153
  id: s.id, name: s.name, purpose: s.purpose, audience: s.audience, source: s.source, output: s.output, schedule: s.schedule, label: RS.scheduleLabel(s.schedule),
154
- ...(IR.isIntelligence(s.source) ? { scope: IR.scopeOf(s.source), storyline: s.storyline || {} } : {}),
154
+ ...(IR.isIntelligence(s.source) ? { scope: IR.scopeOf(s.source), storyline: s.storyline || {} } : {}), ...(s.ready ? { ready: s.ready } : {}),
155
155
  next_draft: next, last_issued: issued, status: s.status, cycles: mine.length,
156
156
  copy: copyOf(latest ? linkFor(idx, latest.path, s.output) : null, docSync.copyKindOf(s.output)),
157
157
  structure: structureOf(root, s.id),
@@ -240,6 +240,7 @@ async function tick(ctx, now = new Date()) {
240
240
  try { st = RS.stateOf(w.root); } catch { continue; }
241
241
  for (const s of st.setups.values()) {
242
242
  if (s.status !== 'active' || !(String(s.source).startsWith('dashboard:') || IR.isIntelligence(s.source))) continue;
243
+ if (s.ready) continue; // a ready-made report is drafted by lib/routes-ready-reports.js tick (its moments, quiet weeks and holds)
243
244
  const sched = RS.scheduleOf(s);
244
245
  if (!logic.isDue(sched, now)) continue;
245
246
  const slotAt = logic.lastSlot(sched, now);
@@ -515,7 +516,7 @@ async function intelModel(req, ctx, ws, board) {
515
516
  /** Draft one issue of a report from Intelligence at `slot` (lib/intel-report.js documentOf). The issue number counts the documents before it; the issue
516
517
  * before it (the latest issued one) gives Actions from issue N and Since issue N. A document already at the slot is the answer and is not overwritten.
517
518
  * → { ok, slot, path } | { ok: false, existing?, error } */
518
- async function draftIntelligence(ctx, w, s, slot, { model, now = new Date() } = {}) {
519
+ async function draftIntelligence(ctx, w, s, slot, { model, now = new Date(), ready = null } = {}) {
519
520
  const rel = RD.draftPath(path.resolve(w.root), s.id, slot);
520
521
  try { if (fs.statSync(path.join(path.resolve(w.root), rel)).isFile()) return { ok: false, existing: true, slot, path: rel, error: 'drafted already' }; } catch { /* not there yet */ }
521
522
  const m = model || await intelModel(null, ctx, w.id, null);
@@ -524,7 +525,7 @@ async function draftIntelligence(ctx, w, s, slot, { model, now = new Date() } =
524
525
  const before = mine.filter((x) => x.issued).pop() || null;
525
526
  let prior = null;
526
527
  if (before) { try { prior = fs.readFileSync(path.join(path.resolve(w.root), before.path), 'utf8'); } catch { prior = null; } }
527
- const md = IR.documentOf(m, s, { slot, now, issue: mine.length + 1, prior });
528
+ const md = IR.documentOf(m, s, { slot, now, issue: mine.length + 1, prior, ...(ready ? { ready } : {}) });
528
529
  const r = RS.writeDocument(w.root, s, slot, md, { now });
529
530
  return r.ok ? { ok: true, slot, path: r.path } : { ok: false, status: r.status, error: r.error };
530
531
  }
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.434.0",
3
+ "version": "0.436.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.434.0",
9
+ "version": "0.436.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.434.0",
3
+ "version": "0.436.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",
@@ -70,11 +70,15 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
70
70
  const setVal = (p, sel, v) => p.evaluate(([s, x]) => { const i = document.querySelector(s); i.value = x; i.dispatchEvent(new Event('input', { bubbles: true })); }, [sel, v]);
71
71
  const rowsOf = (p) => p.evaluate(() => [...document.querySelectorAll('#czViewer .pc-ln[data-m]')].map((r) => ({ id: r.dataset.m, name: r.querySelector('[data-f="name"]').value, day: r.querySelector('.pc-fd span').textContent, when: (r.querySelector('.pc-wch span:not(.sq):not(.bx)') || r.querySelector('.pc-via, .pc-mini') || {}).textContent || '', draft: r.classList.contains('sug') })));
72
72
 
73
+ // into the charter by the Milestones pencil: the section is opened first when it is folded
74
+ const toCharter = async (p) => { await p.evaluate(() => { const b = document.querySelector('#czViewer [data-czs-fold="ms"]'); if (b && b.getAttribute('aria-expanded') !== 'true') b.click(); }); await p.click('#czViewer [data-czs-id="ms"] [data-pp="edit"]'); };
75
+
73
76
  /* ── desktop: the ways in, the fields, Save ── */
74
77
  const D = await open();
75
78
  const p = D.page;
76
79
  const ph = await head(p);
77
- ok('W the program\'s header holds the charter icon beside Discuss, and ⋯ no longer repeats it', ph.tools.includes('Open the charter') && ph.tools.indexOf('Open the charter') === ph.tools.indexOf('Discuss in chat') + 1, JSON.stringify(ph.tools));
80
+ // batch 17 PbH1Header: the Dashboard toggle took the charter icon's place; the charter is reached from the Milestones pencil and Documents
81
+ ok('W the program\'s header holds no charter icon (the Dashboard toggle has its place)', !ph.tools.includes('Open the charter'), JSON.stringify(ph.tools));
78
82
  await p.click('#czViewer [data-cz-vw="more"]');
79
83
  ok('W ⋯ holds no "Open the charter"', !(await p.evaluate(() => [...document.querySelectorAll('.cz-vw-menu button')].some((b) => /charter/i.test(b.textContent)))));
80
84
  await p.keyboard.press('Escape');
@@ -111,8 +115,8 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
111
115
  await p.click('#czViewer [data-pc="discard"]');
112
116
  ok('L Discard goes back to the program and writes nothing', await until(() => p.evaluate(() => /^Viewer: Program/.test(document.querySelector('#czViewer').getAttribute('aria-label')))) && !D.posts.some((x) => x.path === '/api/programs/save'));
113
117
 
114
- // S: the charter icon in the header; a change saved resends every field and keeps the ids
115
- await p.click('#czViewer [data-cz-vw-p="charter"]');
118
+ // S: the Milestones pencil (the header's charter icon gave its place to the Dashboard toggle, batch 17); a change saved resends every field and keeps the ids
119
+ await toCharter(p);
116
120
  await charterShown(p);
117
121
  await setVal(p, '#czViewer .pc-dt[data-f="date"][data-m="pilot-live"]', '2026-11-25');
118
122
  await p.click('#czViewer [data-pc="del"][data-m="support-ready"]');
@@ -154,7 +158,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
154
158
  await p.click('#czViewer [data-cz-vw="back"]');
155
159
  await until(() => p.evaluate(() => !!document.querySelector('#czViewer .pc-ask')));
156
160
  await p.click('#czViewer [data-pc="discard"]');
157
- await p.click('#czViewer [data-cz-vw-p="charter"]');
161
+ await toCharter(p);
158
162
  await charterShown(p);
159
163
  await p.click('#czViewer button.pc-ln.dn');
160
164
  const dn = await p.evaluate(() => [...document.querySelectorAll('#czViewer .pc-ln.dn2')].map((r) => r.querySelector('[data-f="name"]').value + ':' + ((r.querySelector('.pc-mini, .pc-via') || {}).textContent || '')));
@@ -203,7 +207,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
203
207
  /* ── an initiative that left the program ── */
204
208
  const gone = F.programs().map((x, i) => (i === 0 ? { ...x, milestones: x.milestones.map((m) => (m.id === 'pilot-users' ? { ...m, waits: ['partner-sso'] } : m)) } : x));
205
209
  const G = await open({ programs: gone });
206
- await G.page.click('#czViewer [data-cz-vw-p="charter"]');
210
+ await toCharter(G.page);
207
211
  await charterShown(G.page);
208
212
  const gw = await G.page.evaluate(() => ({ warn: (document.querySelector('#czViewer .pc-lnw:has([data-m="pilot-users"]) .pc-warn') || {}).textContent || '', amber: !!document.querySelector('#czViewer .pc-wch.gone[data-m="pilot-users"]') }));
209
213
  await setVal(G.page, '#czViewer [data-f="goal"]', 'x');
@@ -212,7 +216,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
212
216
 
213
217
  /* ── phone ── */
214
218
  const S = await open({ w: 390, h: 844 });
215
- await S.page.click('#czViewer [data-cz-vw-p="charter"]');
219
+ await toCharter(S.page);
216
220
  await charterShown(S.page);
217
221
  await setVal(S.page, '#czViewer [data-f="goal"]', 'One sign-in for every product on CIAM');
218
222
  await S.page.click('#czViewer [data-pc="pick"][data-m="pilot-live"]');
@@ -229,7 +233,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
229
233
  if (prog) await prog.click();
230
234
  const hp = await until(() => M.page.evaluate(() => { const v = document.querySelector('#czViewer'); if (!v || v.hidden || !v.querySelector('.pp-vw .czs-sum')) return null; return { tile: getComputedStyle(v.querySelector('.cz-vw-tile')).backgroundColor, prog: getComputedStyle(document.body).getPropertyValue('--pp-prog').trim() }; }));
231
235
  ok('M on Home the program heading opens the program panel with its own purple (cozy-panel.css is on Home)', !!hp && !!hp.prog && !/rgba\(0, 0, 0, 0\)|transparent/.test(hp.tile), JSON.stringify(hp));
232
- if (hp) { await M.page.click('#czViewer [data-cz-vw-p="charter"]'); }
236
+ if (hp) await toCharter(M.page);
233
237
  ok('M the charter opens from the panel on Home too', !!hp && !!(await charterShown(M.page)));
234
238
  ok('0 no page error on Home', M.errors.length === 0, M.errors.join(' | '));
235
239
  await M.ctx.close();
@@ -71,7 +71,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
71
71
  await sleep(1500); // the other product's board and the program reads land after the program opened: none of them opens it again
72
72
  ok('P ?program=<id> sends bd:program once: one path opens the program', await p.evaluate(() => window.__bdp) === 1, String(await p.evaluate(() => window.__bdp)));
73
73
  const hd = await p.evaluate(() => { const v = document.querySelector('#czViewer'); const r = v.getBoundingClientRect(); return { t: v.querySelector('.cz-vw-title').textContent, kind: (v.querySelector('.cz-vw-kind') || {}).textContent, meta: (v.querySelector('.czs-meta') || {}).textContent, tools: [...v.querySelectorAll('.cz-vw-head [data-cz-vw], [data-cz-vw]')].filter((b) => b.closest('#czViewer') && !b.classList.contains('cz-vw-grip')).map((b) => b.getAttribute('aria-label')), input: v.querySelectorAll('.cz-vw-body input, .cz-vw-body textarea').length, tabs: v.querySelectorAll('.pp-tab, [role="tab"]').length, w: Math.round(r.width), right: Math.round(innerWidth - r.right), sel: !!document.querySelector('#ibBody [data-prow="project-ascent"].sel') }; });
74
- ok('P the shell\'s header names it once ("title · goal"), with Discuss in chat, the charter icon, ⋯, Open wide and Close; the summary says the owner and the span; there is no chat box and no tab', hd.t === 'Project Ascent · CIAM migration' && hd.kind === 'Program' && hd.meta === 'Wawan · Sep 2026 to Jun 2028' && [...new Set(hd.tools)].join('|') === 'Discuss in chat|Open the charter|More|Open wide|Close the viewer' && hd.input === 0 && hd.tabs === 0, JSON.stringify(hd));
74
+ ok('P the shell\'s header names it once ("title · goal"), with Discuss in chat, the Dashboard toggle once the dashboard reads (it took the charter icon\'s place, batch 17 PbH1Header; the charter stays in ⋯ and on the Milestones pencil), ⋯, Open wide and Close; the summary says the owner and the span; there is no chat box and no tab', hd.t === 'Project Ascent · CIAM migration' && hd.kind === 'Program' && hd.meta === 'Wawan · Sep 2026 to Jun 2028' && /^Discuss in chat\|(Show the dashboard\|)?More\|Open wide\|Close the viewer$/.test([...new Set(hd.tools)].join('|')) && hd.input === 0 && hd.tabs === 0, JSON.stringify(hd));
75
75
  ok('V the program floats at 560 px over the page\'s right edge, and its band row on the Board is selected', hd.w === 560 && hd.right < 40 && hd.sel, JSON.stringify(hd));
76
76
  const sm = await p.evaluate(() => ({ line: (document.querySelector('#czViewer .czs-line') || {}).textContent, pri: (document.querySelector('#czViewer .czs-pri') || {}).textContent || '' }));
77
77
  ok('P the summary line is the next milestone (Waits on you counts itself in its row, said once); no primary while every task has a level', /^Next: Pilot live/.test(sm.line) && sm.pri === '', JSON.stringify(sm));
@@ -17,9 +17,10 @@
17
17
  * refresh() draws the shown item again after a new read, in place · close() · shown() → the key of the initiative shown, or null
18
18
  *
19
19
  * What has no place on the view is under ⋯: the ONE initiative menu (pm/ini-more.js, feedback batch 14 item 5; seven entries since batch 16
20
- * item 5c), the same words and order as Home's initiative page, with Delete last (5d). The rest sits on the thing it changes: the stage chip's
21
- * picker moves the stage with the row menu's own presses (moreAct(r, k, btn), bd-acts.js); Change workflow, Won't do and Archive are Home's
22
- * (ini-wf.js). Discuss in chat takes the question to Home. */
20
+ * item 5c), the same words and order as Home's initiative page, with Delete last (5d). One header icon switches the view to its Dashboard and
21
+ * back (pm/dash-view.js, PbH1Header): the PM's last choice per initiative wins; a Board row is a press to act, so Work opens first until then.
22
+ * The rest sits on the thing it changes: the stage chip's picker moves the stage with the row menu's own presses (moreAct(r, k, btn), bd-acts.js);
23
+ * Change workflow, Won't do and Archive are Home's (ini-wf.js). Discuss in chat takes the question to Home. */
23
24
  import * as IM from './impact.js'; // Your impact (batch 16 item 7): who made a delivered milestone happen
24
25
  import * as VW from './cozy-viewer.js';
25
26
  import { esc } from './premium-shell.js';
@@ -29,6 +30,7 @@ import { rowFor } from './ini-versions.js'; // planned versus actual (batch 11
29
30
  import { viewHtml, wireView } from './ini-view.js';
30
31
  import * as TV from './tk-view.js';
31
32
  import { pmGet, pmPost } from './http.js';
33
+ import * as DB from './dash-view.js'; // the ready-made Dashboard view (batch 17 item 1, canvas PbH1Header, PbA1, PbS1, PbS2, PbG2, PbG9)
32
34
  import * as MD from './home-ini-model.js'; // the stage move's rules, as Home reads them (Moves on by itself, Move back a stage)
33
35
  import * as WF from './ini-wf.js'; // D99: Change workflow, Won't do, Back to Triage, Archive, the same popovers as Home's
34
36
  import { openPop, closePop, undoToast, ensureCss as ensurePopCss } from './hi-pop.js';
@@ -166,7 +168,20 @@ function stageChip(btn, r) {
166
168
  archive: id && !self && !a.archived ? () => WF.archive(wfUi(), id) : null,
167
169
  });
168
170
  }
171
+ const DASH = new Map(); // the row's key → its Dashboard host (pm/dash-view.js dashHost)
172
+ function dashFor(r) {
173
+ if (!r || !r.id) return null;
174
+ if (!DASH.has(r.key)) {
175
+ const M = O.M() || {}, B = M.board || {}, vid = vidOf(r);
176
+ DASH.set(r.key, DB.dashHost({ page: 'initiative:' + r.id, scope: 'initiative:' + r.id, ws: r.ws || B.ws || '', board: r.boardId || B.id || '', vid, VW,
177
+ redraw: () => refresh(true), toast: (t) => (O.toast ? O.toast(t) : null),
178
+ openReport: async (row) => { if (!row.path) return; VW.drill(); (await import('./premium-report-read.js')).openReportView(row.path, { ws: r.ws || B.ws || '', name: row.name, cuts: true }); } }));
179
+ }
180
+ return DASH.get(r.key);
181
+ }
169
182
  function iniBody(r) {
183
+ const h = dashFor(r);
184
+ if (h && h.shows()) return h.html(() => '');
170
185
  const md = (v) => ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'][+v.slice(5, 7) - 1] + ' ' + +v.slice(8, 10);
171
186
  const self = !!((O.M() || {}).board || {}).self, M = O.M() || {};
172
187
  // what left the ⋯ for the thing it changes (batch 16 item 5c): the workflow chip, the dashed +, the stage chip, the dates chip, Jira's ↻
@@ -232,10 +247,12 @@ export function openIni(r, from, o = {}) {
232
247
  adding = o.addTo != null ? r.key : null; addTo = o.addTo || ''; addDates = o.addDates || null;
233
248
  // a row with no record id has no chat of its own: its question goes to the board's chat
234
249
  readLay(r); // Moves on by itself shows once the layout record is read
250
+ { const h = dashFor(r); if (h) h.read(o.via || 'act'); } // a Board row is a press to act (PbH1Header); a link to read passes via 'read'
235
251
  // the same tile as Home's initiative page; no "Open in full": the header's expand already opens it wide (batch 14 item 5)
236
252
  VW.open({ kind: 'Initiative', title: r.title, icon: 'goal', id: vidOf(r),
237
253
  discuss: r.id ? true : () => location.assign(O.askHref(r, '')), more: () => iniMore(O.rowOf(r.key) || r), rename: O.rename ? O.rename(r) : null,
238
- render: (body) => { const x = O.rowOf(r.key) || r; cur = { key: x.key, tk: null }; O.onShow(x.key, from); body.innerHTML = iniBody(x); wire(body, x.key); if (adding === x.key) { const f = body.querySelector('#ivAddTask'); if (f && document.activeElement !== f) f.focus(); } },
254
+ presses: dashFor(r) ? dashFor(r).presses() : null, onPress: (a) => { const h = dashFor(O.rowOf(r.key) || r); if (a === 'dash' && h) h.toggle(); },
255
+ render: (body) => { const x = O.rowOf(r.key) || r; cur = { key: x.key, tk: null }; O.onShow(x.key, from); body.innerHTML = iniBody(x); wire(body, x.key); { const h = dashFor(x); if (h) h.wire(body); } if (adding === x.key) { const f = body.querySelector('#ivAddTask'); if (f && document.activeElement !== f) f.focus(); } },
239
256
  onClose: () => { if (cur && cur.key === r.key && !cur.tk) { cur = null; O.onHide(); } } });
240
257
  }
241
258
 
@@ -262,10 +279,10 @@ export function openTicket(r, k, from) {
262
279
  }
263
280
 
264
281
  /** The shown item drawn again from the new read, in place. A row that left the Board closes it. */
265
- export function refresh() {
282
+ export function refresh(force) {
266
283
  if (!cur || !VW.isOpen()) return;
267
284
  const r = O.rowOf(cur.key); if (!r || !r.track) { close(); return; }
268
- const b = VW.body(); if (!b || (document.activeElement && b.contains(document.activeElement))) return;
285
+ const b = VW.body(); if (!b || (!force && document.activeElement && b.contains(document.activeElement))) return;
269
286
  if (cur.tk) return; // the ticket Viewer reads its own records (tk-view.js); Read Jira again opens it fresh
270
287
  const top = b.scrollTop;
271
288
  b.innerHTML = iniBody(r);
@@ -10,10 +10,14 @@
10
10
  * that event through pm/bd-prog.js openProgram, the one path that opens it.
11
11
  *
12
12
  * What it shows, each part only when a record holds something for it:
13
- * · the shell's header: the program icon, "title · goal" once, Discuss in chat (the question goes to Home), the charter, ⋯ and Close. ⋯
13
+ * · the shell's header: the program icon, "title · goal" once, Discuss in chat (the question goes to Home), the Dashboard toggle, ⋯ and Close. ⋯
14
14
  * holds, in the shell's order: add an initiative, move one in, copy link, copy as text, and archive (red, last, with a confirmation)
15
- * · the charter (pm/program-charter.js, canvas MsB*): the one editor of the program's fields and milestones. Ways in: its icon in the
16
- * header, the pencil on the Milestones row, and "Add the first milestone" where the track would be
15
+ * · the charter (pm/program-charter.js, canvas MsB*): the one editor of the program's fields and milestones. Ways in: the pencil on the
16
+ * Milestones row (and on the Dashboard's Milestones block), and "Add the first milestone" where the track would be. Its header icon gave
17
+ * its place to the Dashboard toggle (batch 17 item 1, PbH1Header: two icons left the title 66 px at 390 px)
18
+ * · the Dashboard (pm/dash-view.js, GET /api/ready-reports/dashboard scope program:<id>): one toggle icon, a gauge from Work and a list from
19
+ * the Dashboard. The PM's last choice per program wins; with none, the Dashboard opens when they came to read (?view=dashboard: a
20
+ * report, Intelligence, a notification) and Work when they came to act (a Board row). No toggle until the dashboard is read
17
21
  * · Claude's milestone suggestions (pm/ms-suggest.js, canvas XmsgB): with no milestone yet, they take the place of "Add the first milestone";
18
22
  * later changes lead Waits on you. ✓ keeps one (the charter is written at once), the pencil opens the charter with it filled in, ✕ drops it
19
23
  * · the summary card: the next milestone, else what waits on you; the owner and the span; one primary, "Review the suggested homes", only
@@ -38,6 +42,7 @@ import { programRename } from './rename-press.js';
38
42
  import { openCharter as charterForm, renamed as charterRenamed } from './program-charter.js';
39
43
  import * as MSG from './ms-suggest.js';
40
44
  import * as MD from './metric-drafts.js'; // the goal Claude drafts when the charter has none (batch 15 item 1, canvas Iq9Program)
45
+ import * as DB from './dash-view.js'; // the ready-made Dashboard view (batch 17 item 1, canvas PbH1Header, PbA2, PbA7, PbG3, PbG7, PbG10)
41
46
 
42
47
  const SV = (d, w) => `<svg viewBox="0 0 24 24" width="${w || 18}" height="${w || 18}" aria-hidden="true"><path d="${d}"/></svg>`;
43
48
  const I = {
@@ -56,6 +61,7 @@ let O = null; // mount's options
56
61
  let cur = null; // { id, from } the program shown and the element it was opened from
57
62
  let period = null; // the year half the goals show (null: the current one)
58
63
  let adding = false; // the add-a-task line of "On the program" is open
64
+ const DASH = new Map(); // program id → { view: 'dash' | 'work', d: the dashboard | null, read: bool, open: Set of folds }
59
65
  const fold = new Set((() => { try { return JSON.parse(store.get(FOLD_KEY) || '[]'); } catch { return []; } })());
60
66
  const keepFold = () => store.set(FOLD_KEY, JSON.stringify([...fold].slice(-200)));
61
67
  const AWAY = new Map(); // the boards of the other products: ws → { name, board, rows } | 'reading'
@@ -370,7 +376,7 @@ function draw(keepFocus) {
370
376
  const f = keepFocus && document.activeElement && b.contains(document.activeElement) ? document.activeElement : null;
371
377
  const sel = f ? (f.dataset.pp ? `[data-pp="${f.dataset.pp}"]` + (f.dataset.fold ? `[data-fold="${CSS.escape(f.dataset.fold)}"]` : '') + (f.dataset.key ? `[data-key="${CSS.escape(f.dataset.key)}"]` : '') + (f.dataset.ms ? `[data-ms="${CSS.escape(f.dataset.ms)}"]` : '') : f.dataset.czsFold ? `[data-czs-fold="${CSS.escape(f.dataset.czsFold)}"]` : null) : null;
372
378
  const top = b.scrollTop;
373
- b.innerHTML = bodyHtml(p);
379
+ b.innerHTML = viewHtml(p);
374
380
  b.scrollTop = top;
375
381
  const again = sel && b.querySelector(sel); if (again) again.focus();
376
382
  }
@@ -407,10 +413,35 @@ function textOf(p) {
407
413
  return lines.join('\n');
408
414
  }
409
415
  const titleOf = (p) => p.title + (p.goal ? ' · ' + p.goal : '');
410
- function openPanel(id, from) {
416
+ /* ── the Dashboard view (batch 17 item 1) ── */
417
+ const dashOf = (id) => { if (!DASH.has(id)) DASH.set(id, { view: 'work', d: null, read: false, open: new Set() }); return DASH.get(id); };
418
+ const showsDash = (id) => { const x = dashOf(id); return x.view === 'dash' && !!x.d; };
419
+ /** The body: the Dashboard when it is chosen and read, else the work. */
420
+ function viewHtml(p) {
421
+ if (!showsDash(p.id)) return bodyHtml(p);
422
+ const x = dashOf(p.id), talk = O && O.talk && O.talk() ? `<button type="button" class="hi-talk" data-pp="talk">Message Claude about ${esc(p.title)}</button>` : '';
423
+ return DB.dashHtml(x.d, { open: x.open, mdHtml: MD.progHtml(p, p.home || board().ws || ''), talk });
424
+ }
425
+ const dashPresses = (id) => { const x = dashOf(id); return x.d ? [DB.togglePress(x.view)] : []; };
426
+ /** Reads the program's dashboard (again); the toggle shows once it is read. via: 'read' | 'act', how the PM arrived. */
427
+ async function readDash(p, via) {
428
+ const x = dashOf(p.id);
429
+ const d = await DB.readDash(p.home || board().ws || '', 'program:' + p.id, via);
430
+ if (!d) { x.d = null; if (x.view === 'dash') x.view = 'work'; } else { const first = !x.read; x.d = d; if (first) x.view = DB.viewOf('program:' + p.id, d.opens); }
431
+ x.read = true;
432
+ if (cur && cur.id === p.id && shownHere()) { VW.setPresses('program:' + p.id, dashPresses(p.id)); draw(true); }
433
+ }
434
+ function toggleDash(p) {
435
+ const x = dashOf(p.id); if (!x.d) return;
436
+ x.view = x.view === 'dash' ? 'work' : 'dash'; DB.keepView('program:' + p.id, x.view);
437
+ VW.setPresses('program:' + p.id, dashPresses(p.id)); draw();
438
+ const t = document.querySelector('#czViewer [data-cz-vw-p="dash"]'); if (t) t.focus();
439
+ }
440
+ function openPanel(id, from, via) {
411
441
  if (!O || !O.M() || !progOf(id)) return false;
412
442
  const p = progOf(id);
413
443
  adding = false; period = null; O._perOpen = false;
444
+ readDash(p, via || '');
414
445
  // tap the title to rename (canvas RnAProg): the field holds the name only; the goal stays as it is
415
446
  const rename = programRename({ pmPost, program: p, onSaved: async (o) => {
416
447
  await O.reload(); VW.retitle('program:' + id, titleOf(progOf(id) || { ...p, title: o.title }));
@@ -420,14 +451,22 @@ function openPanel(id, from) {
420
451
  rename.value = p.title;
421
452
  VW.open({ kind: 'Program', title: titleOf(p), icon: I.prog, id: 'program:' + id,
422
453
  discuss: true, more: moreOf(p), rename,
423
- // the charter's icon beside Discuss (canvas MsB0Entry): the one way to its fields, so ⋯ no longer repeats it
424
- presses: [{ act: 'charter', label: 'Open the charter', icon: 'doc' }], onPress: (a) => { const q = progOf(id); if (a === 'charter' && q) openCharter(q); },
454
+ // one Dashboard toggle in the charter's old place (PbH1Header); the charter keeps the Milestones pencil and "Add the first milestone"
455
+ presses: dashPresses(id), onPress: (a) => { const q = progOf(id); if (a === 'dash' && q) toggleDash(q); },
425
456
  render: (body) => {
426
457
  { const q = progOf(id); if (q && VW.current() && VW.current().title !== titleOf(q)) VW.retitle('program:' + id, titleOf(q)); } // a rename in the charter, on ←
427
458
  cur = { id, from: from && !(VW.body() && VW.body().contains(from)) ? from : (cur && cur.id === id && cur.from) || null };
428
459
  body.classList.add('pp-vw');
429
- const q = progOf(id); if (q) { readAway(q); readMore(q); readDrafts(q); body.innerHTML = bodyHtml(q); }
430
- body.onclick = (e) => { const d = e.target.closest('[data-md]'); if (d && body.contains(d) && !d.disabled) { MD.press(d, { redraw: () => draw(), toast: (t) => O.say(t) }); return; } const m = e.target.closest('[data-ms-act]'); if (m && body.contains(m) && !m.disabled) { suggestPress(m); return; } const b = e.target.closest('[data-pp]'); if (b && body.contains(b)) press(b); };
460
+ const q = progOf(id); if (q) { readAway(q); readMore(q); readDrafts(q); body.innerHTML = viewHtml(q); }
461
+ if (!body.dataset.dbWired) { // the Dashboard's own presses, once per body (pm/dash-view.js)
462
+ body.dataset.dbWired = '1';
463
+ DB.wireDash(body, { d: () => cur && dashOf(cur.id).d, get open() { return cur ? dashOf(cur.id).open : new Set(); }, ws: (progOf(id) || {}).home || board().ws || '', board: board().id || '',
464
+ toast: (t) => O.say(t), redraw: () => draw(true), reload: async () => { const q2 = cur && progOf(cur.id); if (q2) await readDash(q2); },
465
+ milestones: () => { const q2 = cur && progOf(cur.id); if (q2) openCharter(q2, 'milestones'); },
466
+ openReport: (r) => openReport(r, (progOf(id) || {}).home || board().ws || ''),
467
+ editNeeds: (n) => { if (n && n.ini) { if (O.drill) VW.drill(); else VW.close(); O.openIni(n.ini); } } });
468
+ }
469
+ body.onclick = (e) => { if (cur && showsDash(cur.id) && e.target.closest('[data-db]')) return; const d = e.target.closest('[data-md]'); if (d && body.contains(d) && !d.disabled) { MD.press(d, { redraw: () => draw(), toast: (t) => O.say(t) }); return; } const m = e.target.closest('[data-ms-act]'); if (m && body.contains(m) && !m.disabled) { suggestPress(m); return; } const b = e.target.closest('[data-pp]'); if (b && body.contains(b)) press(b); };
431
470
  body.onsubmit = submit;
432
471
  document.querySelectorAll('#ibBody [data-prow]').forEach((x) => x.classList.toggle('sel', x.dataset.prow === id));
433
472
  },
@@ -511,7 +550,8 @@ export function mount(o) {
511
550
  O = o;
512
551
  document.addEventListener('click', popPress);
513
552
  // a program row of the Board, and ?program=<id> once the Board has unfolded and scrolled to it, send bd:program (pm/bd-prog.js openProgram)
514
- document.addEventListener('bd:program', (e) => { const d = e.detail || {}; if (d.id) openPanel(String(d.id), d.from || document.activeElement); });
553
+ // came to read (a report, Intelligence, a notification: ?view=dashboard) or to act (a Board row): which view opens first (PbH1Header)
554
+ document.addEventListener('bd:program', (e) => { const d = e.detail || {}; if (d.id) openPanel(String(d.id), d.from || document.activeElement, d.via || (new URLSearchParams(location.search).get('view') === 'dashboard' ? 'read' : 'act')); });
515
555
  // the period menu is a layer inside the panel: Escape closes it first, then the shell closes the panel
516
556
  window.addEventListener('keydown', (e) => {
517
557
  if (e.key !== 'Escape' || !cur || !O._perOpen) return;
@@ -525,3 +565,11 @@ export function mount(o) {
525
565
  if (cur && shownHere()) document.querySelectorAll('#ibBody [data-prow]').forEach((x) => x.classList.toggle('sel', x.dataset.prow === cur.id));
526
566
  }).observe(body, { childList: true });
527
567
  }
568
+
569
+ /** A report row of the Dashboard opens in the one report Viewer (pm/premium-report-read.js), with its Sponsors and Team cuts; ← comes back. */
570
+ async function openReport(r, ws) {
571
+ if (!r || !r.path) return;
572
+ VW.drill();
573
+ const m = await import('./premium-report-read.js');
574
+ m.openReportView(r.path, { ws, name: r.name, cuts: true });
575
+ }
@@ -36,7 +36,7 @@
36
36
  * sub one quiet line under the title: what the item is when the title is its parent's name (a program's "Charter", canvas MsBCharter)
37
37
  * chip { n, label, on(button) }: the blue ✦ with its count right after the title (what Claude proposes on an initiative, batch 12
38
38
  * items 2, 3 and 4, canvas In development PiA0/TpA1). Hidden at zero. setChip(id, chip) changes it while the item is shown.
39
- * presses [{ act, label, icon, text?, solid? }]: the item's own presses before ⋯ (a program's charter icon, canvas MsB0Entry; the
39
+ * presses [{ act, label, icon, text?, solid?, pressed? }]: the item's own presses before ⋯ (a program's charter icon, canvas MsB0Entry; the
40
40
  * charter's Save, MsBCharter). text draws the word beside the icon (not on a phone); solid is the one dark primary.
41
41
  * onPress(act, button) runs them. setPresses(id, list) changes them while the item is shown (Save shows only after a change).
42
42
  * guard (go, anchor) → true when the item holds unsaved changes and asks first: Close, ←, Escape and another open() call it, and
@@ -135,7 +135,7 @@ export function headHtml(it) {
135
135
  const add = o.add && o.add.label && !phone ? ib('add', o.add.label, P.add) : '';
136
136
  const own = (o.presses || []).filter((x) => x && x.act && x.label).map((x) => x.solid
137
137
  ? `<button type="button" class="cz-vw-pri${x.text && !phone ? '' : ' i'}" data-cz-vw="press" data-cz-vw-p="${esc(x.act)}" aria-label="${esc(x.label)}" title="${esc(x.label)}">${svg(path(x.icon), 15, 2.2)}${x.text && !phone ? `<span>${esc(x.text)}</span>` : ''}</button>`
138
- : `<button type="button" class="cz-vw-ib" data-cz-vw="press" data-cz-vw-p="${esc(x.act)}" aria-label="${esc(x.label)}" title="${esc(x.label)}">${svg(path(x.icon), 18)}</button>`).join('');
138
+ : `<button type="button" class="cz-vw-ib" data-cz-vw="press" data-cz-vw-p="${esc(x.act)}" aria-label="${esc(x.label)}" title="${esc(x.label)}"${x.pressed != null ? ` aria-pressed="${x.pressed ? 'true' : 'false'}"` : ''}>${svg(path(x.icon), 18)}</button>`).join('');
139
139
  const sub = o.sub ? `<p class="cz-vw-sub">${esc(o.sub)}</p>` : '';
140
140
  const chip = o.chip && (o.chip.n > 0 || o.chip.looking) ? `<button type="button" class="cz-vw-chip${o.chip.looking ? ' live' : ''}" data-cz-vw="chip" aria-haspopup="dialog" aria-label="${esc(o.chip.label || 'Claude proposes ' + o.chip.n + '. Open')}" title="${esc(o.chip.label || 'Claude proposes')}">${svg(ICONS.spark, 13, 2)}${o.chip.n > 0 ? `<b>${esc(o.chip.n)}</b>` : ''}</button>` : '';
141
141
  return (o.canBack || phone ? ib('back', o.canBack ? (o.backTo ? 'Back to ' + o.backTo : 'Back') : 'Close the viewer', P.back) : '')
@@ -213,3 +213,16 @@ button.rp-cy:hover { background: var(--cz-well); }
213
213
  .vz-dk .czs-secs { margin: 0; }
214
214
  .vz-dkp { border-radius: 16px; background: var(--cz-card); box-shadow: inset 0 0 0 1px var(--cz-hair); padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; }
215
215
  .vz-dkp h2 { margin: 0; font-size: var(--fs-5); font-weight: 800; }
216
+ /* the two cuts of a ready-made report (batch 17 item 1, PbG5): the switch, then which sections the sponsors read */
217
+ .vz-cut { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 10px; }
218
+ .vz-cuts { flex: none; align-self: flex-start; }
219
+ .vz-cuts button { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; }
220
+ .vz-cuts svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
221
+ .vz-cutl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
222
+ .vz-cutl li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--cz-hair); font-size: var(--fs-3); }
223
+ .vz-cutl li:first-child { border-top: 0; }
224
+ .vz-cutl li span:last-child { display: flex; flex-direction: column; gap: 1px; }
225
+ .vz-cutl small { font-size: var(--fs-2); color: var(--cz-ink3); }
226
+ .vz-cb { flex: none; width: 18px; height: 18px; border-radius: 5px; border: 2px solid var(--cz-ink3); box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; }
227
+ .vz-cutl li.on .vz-cb { background: var(--cz-blue); border-color: var(--cz-blue); color: var(--cz-onsolid); }
228
+ .vz-cb svg { fill: none; stroke: currentColor; stroke-width: 3; }
@@ -0,0 +1,111 @@
1
+ /* pm/dash-view.css — the ready-made Dashboard view (pm/dash-view.js; canvas In development, band "Ready-made dashboards and reports": PbA1–PbA3,
2
+ * PbA5, PbA7, PbS1, PbS2, PbG2, PbG3, PbG6–PbG10). dash-view.js loads it once, so it works wherever the program panel, the initiative view or the
3
+ * product page opens (Board, Home). Token vars only, over pm/cozy.css; the type scale is --fs-1..--fs-6. Every class starts with db-.
4
+ * The body is a size container: 720 px or wider lays the blocks in two columns, each block its own card (PbA7). */
5
+
6
+ .db { container-type: inline-size; display: flex; flex-direction: column; gap: 14px; padding: 2px 0 18px; color: var(--cz-ink); font-family: var(--cz-sans); }
7
+ .db-wait, .db-note { margin: 0; font-size: var(--fs-2); line-height: 1.5; color: var(--cz-ink3); }
8
+ .db-grid { display: flex; flex-direction: column; gap: 14px; }
9
+ .db-b { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
10
+ .db-h { margin: 0; font-size: var(--fs-4); font-weight: 800; }
11
+ .db-card { background: var(--cz-card); border: 1px solid var(--cz-hair); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
12
+ .db-list { gap: 0; padding-top: 4px; padding-bottom: 4px; }
13
+
14
+ /* the ✦ line: what Claude handled, with the M face; a warning is the honest face on a warm edge */
15
+ .db-hd { display: flex; align-items: flex-start; gap: 12px; border-radius: 16px; padding: 12px 14px; background: var(--cz-bluebg); border: 1px solid color-mix(in srgb, var(--cz-blueink) 18%, transparent); }
16
+ .db-hd.warn { background: var(--cz-latebg); border-color: color-mix(in srgb, var(--cz-late) 55%, transparent); }
17
+ .db-hd p { margin: 0; flex: 1; min-width: 0; font-size: var(--fs-4); line-height: 1.45; color: var(--cz-ink2); }
18
+ .db-hd b { color: var(--cz-ink); font-weight: 800; }
19
+ .db-face { flex: none; width: 36px; height: 36px; display: inline-flex; }
20
+ .db-face svg { width: 36px; height: 36px; }
21
+
22
+ /* rows: a dot, the words, the owner */
23
+ .db-row, .db-rep, .db-sum, .db-fold { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; padding: 9px 0; min-width: 0; width: 100%; }
24
+ button.db-row, button.db-rep, .db-sum, .db-fold { cursor: pointer; }
25
+ .db-list > .db-row + .db-row, .db-list > .db-row + .db-fold, .db-reps > * + * { border-top: 1px solid var(--cz-hair); }
26
+ .db-rt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
27
+ .db-rt b { font-size: var(--fs-4); font-weight: 800; line-height: 1.3; }
28
+ .db-rt small, .db-r { font-size: var(--fs-2); line-height: 1.4; color: var(--cz-ink3); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
29
+ .db-r { flex: none; text-align: right; }
30
+ .db-fold .db-rt b { font-size: var(--fs-3); }
31
+ .db-fold > svg, .db-rep > svg:last-child, .db-sum > svg:last-child { flex: none; color: var(--cz-ink3); }
32
+ .db-fold[aria-expanded="true"] > svg { transform: rotate(180deg); }
33
+ .db-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--cz-dot-q); }
34
+ .db-dot.ok { background: var(--cz-dot-ok); } .db-dot.risk { background: var(--cz-dot-risk); } .db-dot.late { background: var(--cz-dot-late); }
35
+ .db-dot.q { background: transparent; border: 2px solid var(--cz-ink3); box-sizing: border-box; }
36
+ .db-dots { display: inline-flex; gap: 4px; flex: none; }
37
+ .db-who { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--cz-well); color: var(--cz-ink2); font-size: var(--fs-1); font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
38
+ .db-tag { flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 18px; padding: 0 4px; border-radius: 5px; background: var(--cz-bluebg); color: var(--cz-blueink); font-size: var(--fs-1); font-weight: 800; }
39
+ .db-none { margin: 0; display: flex; align-items: center; gap: 8px; font-size: var(--fs-3); color: var(--cz-ink3); }
40
+ .db-meta, .db-more, .db-p { margin: 0; font-size: var(--fs-2); line-height: 1.5; color: var(--cz-ink3); }
41
+ .db-p { font-size: var(--fs-3); color: var(--cz-ink2); }
42
+ .db-top { display: flex; align-items: center; gap: 10px; }
43
+ .db-top > small { margin-left: auto; font-size: var(--fs-2); color: var(--cz-ink3); text-align: right; }
44
+ .db-big { font-size: var(--fs-5); font-weight: 800; }
45
+
46
+ /* the stages of Ships: done green, now blue, next grey */
47
+ .db-steps { display: flex; align-items: flex-start; }
48
+ .db-st { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; min-width: 0; }
49
+ .db-st::before { content: ''; position: absolute; top: 6px; left: -50%; right: 50%; height: 2px; background: var(--cz-hair); }
50
+ .db-st:first-child::before { display: none; }
51
+ .db-st.done::before, .db-st.now::before { background: var(--cz-dot-ok); }
52
+ .db-st i { width: 12px; height: 12px; transform: rotate(45deg); border-radius: 3px; background: var(--cz-well2, var(--cz-hair)); position: relative; }
53
+ .db-st.done i { background: var(--cz-dot-ok); } .db-st.now i { background: var(--cz-blue); }
54
+ .db-st small { font-size: var(--fs-1); color: var(--cz-ink3); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
55
+
56
+ /* milestones: the track, then one row each */
57
+ .db-trk { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px; background: linear-gradient(var(--cz-hair), var(--cz-hair)) center / 100% 2px no-repeat; }
58
+ .db-trk i { width: 12px; height: 12px; transform: rotate(45deg); border-radius: 3px; background: var(--cz-dot-q); }
59
+ .db-trk i.ok, .db-trk i.done { background: var(--cz-dot-ok); } .db-trk i.risk { background: var(--cz-dot-risk); } .db-trk i.late { background: var(--cz-dot-late); }
60
+ .db-ms { display: flex; align-items: center; gap: 10px; padding: 4px 0; font-size: var(--fs-3); }
61
+ .db-ms .db-rt { font-weight: 600; }
62
+ .db-gh { display: flex; align-items: center; gap: 4px; }
63
+ .db-gh > .db-sum { flex: 1; }
64
+ .db-hr { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -10px 0; }
65
+
66
+ /* the window of Did it work? */
67
+ .db-win { height: 4px; border-radius: 99px; background: var(--cz-hair); overflow: hidden; }
68
+ .db-win i { display: block; height: 100%; background: var(--cz-dot-ok); }
69
+
70
+ /* Ready for build: the checklist */
71
+ .db-cks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
72
+ .db-ck { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: var(--fs-3); }
73
+ .db-box { flex: none; width: 18px; height: 18px; border-radius: 5px; border: 2px solid var(--cz-ink3); box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; }
74
+ .db-ck.on .db-box { background: var(--cz-blue); border-color: var(--cz-blue); color: var(--cz-onsolid); }
75
+
76
+ /* Needs you, drafts, held and late reports: the presses sit at the card's end */
77
+ .db-need { background: var(--cz-bluebg); border-color: color-mix(in srgb, var(--cz-blueink) 18%, transparent); }
78
+ .db-nq { display: flex; gap: 10px; align-items: flex-start; }
79
+ .db-nq > svg { flex: none; margin-top: 2px; color: var(--cz-blueink); }
80
+ .db-pick { font-size: var(--fs-2); font-weight: 800; color: var(--cz-blueink); margin-top: 4px; }
81
+ .db-acts { display: flex; justify-content: flex-end; align-items: center; gap: 4px; }
82
+ .db-ib { all: unset; box-sizing: border-box; cursor: pointer; width: 40px; height: 40px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; color: var(--cz-ink2); flex: none; }
83
+ .db-ib.solid { width: 44px; height: 44px; background: var(--cz-blue); color: var(--cz-onsolid); }
84
+ .db-ib[disabled] { opacity: .45; cursor: default; }
85
+ @media (hover: hover) { .db-ib:not([disabled]):not(.solid):hover { background: var(--cz-well); color: var(--cz-ink); } .db-ib.solid:not([disabled]):hover { filter: brightness(1.1); } button.db-row:hover .db-rt b, button.db-rep:hover .db-rt b { text-decoration: underline; text-underline-offset: 3px; } }
86
+ .db-ib:focus-visible, .db-row:focus-visible, .db-rep:focus-visible, .db-fold:focus-visible, .db-sum:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; border-radius: 10px; }
87
+ .db-draft, .db-held { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--cz-well); }
88
+ .db-held { background: var(--cz-bluebg); }
89
+ .db-draft > .db-acts, .db-held > .db-acts { flex-basis: 100%; }
90
+ .db-dic { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--cz-well); color: var(--cz-ink2); display: inline-flex; align-items: center; justify-content: center; }
91
+ .db-draft .db-dic { width: auto; height: auto; background: none; margin-top: 2px; }
92
+ .db-held .db-dic { width: auto; height: auto; background: none; color: var(--cz-blueink); margin-top: 2px; }
93
+ .db-late { display: flex; flex-direction: column; }
94
+ .db-hu { gap: 10px; }
95
+ .db-hut { font-size: var(--fs-5); font-weight: 800; line-height: 1.35; }
96
+ .db-chips { display: flex; flex-wrap: wrap; gap: 6px; }
97
+ .db-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: var(--cz-well); font-size: var(--fs-2); font-weight: 700; color: var(--cz-ink2); }
98
+ .db-trust .db-acts { margin-top: -6px; }
99
+ .db-done { padding-top: 2px; padding-bottom: 2px; }
100
+
101
+ /* two columns at 720 px and wider (PbA7): each block is its own card, its heading inside */
102
+ @container (min-width: 720px) {
103
+ .db-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: stretch; }
104
+ .db-grid > .db-b { background: var(--cz-card); border: 1px solid var(--cz-hair); border-radius: 16px; padding: 14px 16px; }
105
+ .db-grid > .db-b > .db-card { border: 0; padding: 0; background: none; }
106
+ .db-grid > .db-b > .db-card.db-need { background: var(--cz-bluebg); padding: 12px 14px; }
107
+ .db-grid > .db-b > .db-h, .db-grid > .db-b > .db-hr { padding-bottom: 6px; border-bottom: 1px solid var(--cz-hair); }
108
+ .db-grid > .db-b > .db-hr { margin: -6px 0 0; }
109
+ }
110
+ @media (prefers-reduced-motion: no-preference) { .db-hd, .db-b { animation: db-in .24s ease-out both; } }
111
+ @keyframes db-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }