create-pmos 0.428.0 → 0.429.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 (106) hide show
  1. package/package.json +13 -13
  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/briefing-premium-board-test.js +2 -2
  7. package/workspace/briefing-premium-insights-test.js +81 -60
  8. package/workspace/briefing-premium-metrics-test.js +5 -3
  9. package/workspace/briefing-premium-sources-test.js +5 -5
  10. package/workspace/briefing-premium-test.js +5 -4
  11. package/workspace/changelog.json +12 -0
  12. package/workspace/ev-everywhere-test.js +2 -2
  13. package/workspace/guide/home.md +2 -0
  14. package/workspace/guide/index.md +1 -0
  15. package/workspace/guide/metric-drafts.md +48 -0
  16. package/workspace/intel-report-ui-test.js +189 -0
  17. package/workspace/lib/board-metrics-premium.js +1 -1
  18. package/workspace/lib/headless.js +15 -2
  19. package/workspace/lib/insights-premium.js +5 -1
  20. package/workspace/lib/insights-records.js +14 -5
  21. package/workspace/lib/intel-report.js +419 -0
  22. package/workspace/lib/metric-draft-runs.js +193 -0
  23. package/workspace/lib/metric-drafts.js +231 -0
  24. package/workspace/lib/metrics-cli.js +104 -0
  25. package/workspace/lib/pmos-verbs.js +3 -0
  26. package/workspace/lib/report-setups.js +29 -13
  27. package/workspace/lib/route-modules.js +1 -0
  28. package/workspace/lib/routes-insights-premium.js +2 -2
  29. package/workspace/lib/routes-insights-records.js +13 -5
  30. package/workspace/lib/routes-metric-drafts.js +141 -0
  31. package/workspace/lib/routes-phone-day.js +13 -2
  32. package/workspace/lib/routes-report-setups.js +92 -3
  33. package/workspace/lib/routes-viewer.js +5 -2
  34. package/workspace/metric-drafts-ui-test.js +209 -0
  35. package/workspace/package-lock.json +2 -2
  36. package/workspace/package.json +1 -1
  37. package/workspace/premium-phone-card-test.js +8 -5
  38. package/workspace/public/pm/bd-acts.js +3 -3
  39. package/workspace/public/pm/bd-pin-card.css +4 -4
  40. package/workspace/public/pm/bd-prog-panel.js +9 -4
  41. package/workspace/public/pm/cozy-aud.css +1 -1
  42. package/workspace/public/pm/cozy-board.css +256 -256
  43. package/workspace/public/pm/cozy-ev.css +45 -45
  44. package/workspace/public/pm/cozy-evmodel.js +1 -1
  45. package/workspace/public/pm/cozy-home-rows.css +23 -23
  46. package/workspace/public/pm/cozy-home.css +207 -207
  47. package/workspace/public/pm/cozy-insights.css +207 -108
  48. package/workspace/public/pm/cozy-live-pill.css +5 -5
  49. package/workspace/public/pm/cozy-mtg-present.css +23 -23
  50. package/workspace/public/pm/cozy-nav.js +1 -1
  51. package/workspace/public/pm/cozy-news.js +2 -2
  52. package/workspace/public/pm/cozy-panel.css +29 -29
  53. package/workspace/public/pm/cozy-pick.css +5 -5
  54. package/workspace/public/pm/cozy-rec-now.css +20 -20
  55. package/workspace/public/pm/cozy-rec-present.css +11 -11
  56. package/workspace/public/pm/cozy-rec-tab.css +13 -13
  57. package/workspace/public/pm/cozy-settings.js +1 -1
  58. package/workspace/public/pm/cozy-steps.css +9 -9
  59. package/workspace/public/pm/cozy-today.css +107 -71
  60. package/workspace/public/pm/cozy-viewer.css +7 -7
  61. package/workspace/public/pm/cozy-viewer.js +1 -1
  62. package/workspace/public/pm/cozy-vw-mtg.css +81 -81
  63. package/workspace/public/pm/cozy-vw-rp.css +53 -53
  64. package/workspace/public/pm/cozy-vw-shell.css +23 -23
  65. package/workspace/public/pm/cozy-vw.css +117 -117
  66. package/workspace/public/pm/cozy-xv.css +11 -11
  67. package/workspace/public/pm/cozy.css +18 -15
  68. package/workspace/public/pm/hi-pop.css +19 -19
  69. package/workspace/public/pm/home-app.js +28 -2
  70. package/workspace/public/pm/home-day.js +131 -26
  71. package/workspace/public/pm/home-ini.css +32 -32
  72. package/workspace/public/pm/home-line.css +7 -7
  73. package/workspace/public/pm/home-list.js +12 -1
  74. package/workspace/public/pm/home-phone-card.js +18 -15
  75. package/workspace/public/pm/ini-view.css +102 -102
  76. package/workspace/public/pm/ini-view.js +9 -3
  77. package/workspace/public/pm/loose-props.css +13 -13
  78. package/workspace/public/pm/metric-drafts.css +82 -0
  79. package/workspace/public/pm/metric-drafts.js +165 -0
  80. package/workspace/public/pm/ms-suggest.css +8 -8
  81. package/workspace/public/pm/ov-view.css +12 -12
  82. package/workspace/public/pm/premium-chart-tab.js +6 -6
  83. package/workspace/public/pm/premium-insights.js +298 -107
  84. package/workspace/public/pm/premium-report-intel.css +56 -0
  85. package/workspace/public/pm/premium-report-intel.js +232 -0
  86. package/workspace/public/pm/premium-shell.js +2 -2
  87. package/workspace/public/pm/premium-vw-file.js +2 -2
  88. package/workspace/public/pm/premium.css +127 -128
  89. package/workspace/public/pm/prog-order.css +6 -6
  90. package/workspace/public/pm/program-charter.css +23 -23
  91. package/workspace/public/pm/rp-parts.js +2 -2
  92. package/workspace/public/pm/sort-order.css +1 -1
  93. package/workspace/public/pm/split-merge.css +15 -15
  94. package/workspace/public/pm/task-card.css +21 -21
  95. package/workspace/public/pm/tk-tasks.css +37 -37
  96. package/workspace/public/pm/tk-view.css +6 -6
  97. package/workspace/public/pm/wf-page.css +28 -28
  98. package/workspace/public/premium-intelligence.html +82 -0
  99. package/workspace/server.js +38 -3
  100. package/workspace/skills/metric-draft.skill +47 -0
  101. package/workspace/test-lists/intel-report-ui.json +5 -0
  102. package/workspace/test-lists/intel-report.json +9 -0
  103. package/workspace/test-lists/metric-drafts-ui.json +5 -0
  104. package/workspace/test-lists/metric-drafts.json +9 -0
  105. package/workspace/test-run.js +3 -0
  106. package/workspace/public/premium-insights.html +0 -81
@@ -7,7 +7,9 @@
7
7
  * the meta line: the status when something waits, the owner, the workflow, the program), the stage card (the stage's
8
8
  * number and name, how much of its section is done, the day clock and the → to the next stage, then its one line:
9
9
  * each stage on its own dates with the milestone tasks as ◇, pm/stage-line.js, batch 11 item 21), Tasks as the WBS
10
- * (sections in workflow order), then Documents and Linked as folds.
10
+ * (sections in workflow order), then Documents and Linked as folds. Under the stage card, the success measure Claude
11
+ * drafted from the PRD (pm/metric-drafts.js, GET /api/metric-drafts scope initiative): the proposal, or once kept its
12
+ * fold with Undo; nothing when nothing is drafted.
11
13
  * o: { add (the Tasks + icon), adding (the inline field is open), next (the next stage is a press: Home's move sheet), openTask, docs: { n, html? } | null,
12
14
  * quick (each task's box carries the status caret and its date is a press: the host has h.status and h.dates),
13
15
  * draft (the empty breakdown's Draft it), program (the chip opens the program), wf (the workflow on the meta line opens the Change picker) }
@@ -35,6 +37,7 @@ import * as PP from './ini-props.js'; // what Claude proposes, under the one b
35
37
  import * as G from './ini-groups.js'; // Group by and Send to Jira, in place of the old All tasks panel (batch 11 item 20)
36
38
  import { cardHtml as smCard, mergedHtml as smMerged } from './split-merge.js'; // split or merge: Claude's card, the merged summary (batch 11 item 14)
37
39
  import { lineHtml, fitLine } from './stage-line.js'; // the stage card's one line (batch 11 item 21)
40
+ import * as MD from './metric-drafts.js'; // the success measure Claude drafts from the PRD (batch 15 item 1, canvas Iq9Initiative)
38
41
 
39
42
  const CSS = new URL('./ini-view.css', import.meta.url).href;
40
43
  if (typeof document !== 'undefined' && document.head && !document.querySelector(`link[href="${CSS}"]`)) {
@@ -229,7 +232,7 @@ export function viewHtml(v, o = {}) {
229
232
  if (v && v.id) VIEWED.set(v.id, v);
230
233
  // a merged initiative leads with where its work went, and draws no stage or tasks (they moved; its folds stay); an open one shows Claude's split or merge card under the summary (batch 11 item 14)
231
234
  const top = v.merged ? smMerged(v.merged) : summaryHtml(v.summary, o) + (o.sm !== false ? smCard(v.suggest, v.title) : '');
232
- return `<div class="iv" data-iv="${esc(v.id || v.key || '')}">${top}${v.merged ? '' : stageHtml(v.stage, o, v.id || v.key || '') + tasksHtml(v, o)}${foldsHtml(v, o)}${o.tail || ''}</div>`;
235
+ return `<div class="iv" data-iv="${esc(v.id || v.key || '')}">${top}${v.merged ? '' : stageHtml(v.stage, o, v.id || v.key || '') + MD.iniHtml(v.id, '', v.title) + tasksHtml(v, o)}${foldsHtml(v, o)}${o.tail || ''}</div>`;
233
236
  }
234
237
 
235
238
  /* ── the presses ── */
@@ -238,7 +241,9 @@ export function wireView(body, h) {
238
241
  const idOf = () => { const n = body.querySelector('[data-iv]'); return n ? n.dataset.iv : null; };
239
242
  body.__iv = LK.wrap(VS.wrap(h, body, (id) => SHOWN.get(id)), idOf);
240
243
  // the one blue ✦ after the title (pm/ini-props.js), drawn again with each draw of the initiative
241
- const chip = () => { const id = idOf(); if (id && VIEWED.has(id)) PP.sync(VIEWED.get(id), body.__iv || {}); };
244
+ const chip = () => { const id = idOf(); if (id && VIEWED.has(id)) PP.sync(VIEWED.get(id), body.__iv || {}); drafts(id); };
245
+ // the success measure Claude drafted: read once per page load, the view draws again when it arrives
246
+ const drafts = (id) => { const H = body.__iv || {}; if (id && VIEWED.has(id)) MD.want(((H.where && H.where()) || {}).ws || '', 'initiative', id, () => { if (idOf() === id && H.redraw) H.redraw(); }); };
242
247
  chip();
243
248
  G.attach(body, body.__iv); // the layout and the drafted tickets of the initiative shown (batch 11 item 20)
244
249
  if (body.__ivWired) return;
@@ -255,6 +260,7 @@ export function wireView(body, h) {
255
260
  const root = b.closest('[data-iv]'); if (!root) return;
256
261
  const id = root.dataset.iv;
257
262
  const d = b.dataset;
263
+ if (d.md && MD.press(b, { redraw: H.redraw, toast: H.toast })) { e.preventDefault(); return; }
258
264
  if (VS.press(b, d, root, H)) return;
259
265
  if (G.press(b, d, root, H)) return;
260
266
  if (LK.press(b, d, root, { ...H, __dates: (x) => TV.press(x, { ivtBar: x.dataset.ivtBar }, root, H, e) })) return;
@@ -3,19 +3,19 @@
3
3
  .hv-lhw { position: relative; }
4
4
  .hv-lhw.has-chip .hv-lh .nl { margin-right: 64px; }
5
5
  .hv-lhw.has-chip .hv-lh .nl:empty { margin-right: 58px; }
6
- .lp-chip { position: absolute; right: 34px; top: calc(50% + 6px); transform: translateY(-50%); display: inline-flex; align-items: center; gap: 3px; height: 26px; padding: 0 9px 0 7px; border-radius: 999px; border: 1.5px solid var(--cz-blue); background: var(--cz-card); color: var(--cz-blueink); font: inherit; font-size: 12.5px; font-weight: 800; cursor: pointer; }
6
+ .lp-chip { position: absolute; right: 34px; top: calc(50% + 6px); transform: translateY(-50%); display: inline-flex; align-items: center; gap: 3px; height: 26px; padding: 0 9px 0 7px; border-radius: 999px; border: 1.5px solid var(--cz-blue); background: var(--cz-card); color: var(--cz-blueink); font: inherit; font-size: var(--fs-2); font-weight: 800; cursor: pointer; }
7
7
  .lp-chip:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; }
8
8
  @media (hover: hover) { .lp-chip:hover { background: var(--cz-bluebg); } }
9
9
  @media (max-width: 760px) { .lp-chip { height: 32px; } .lp-chip::after { content: ''; position: absolute; inset: -6px; } }
10
10
 
11
11
  .lp { display: flex; flex-direction: column; gap: 10px; padding: 0 16px 24px; }
12
- .lp-intro { margin: 2px 0 4px; font-size: 13.5px; line-height: 1.5; color: var(--cz-ink2); max-width: 600px; }
13
- .lp-sec h4 { margin: 8px 0 2px; font-size: 12.5px; font-weight: 700; color: var(--cz-ink3); }
12
+ .lp-intro { margin: 2px 0 4px; font-size: var(--fs-2); line-height: 1.5; color: var(--cz-ink2); max-width: 600px; }
13
+ .lp-sec h4 { margin: 8px 0 2px; font-size: var(--fs-2); font-weight: 700; color: var(--cz-ink3); }
14
14
  .lp-p { padding: 4px 0; }
15
15
  .lp-ph { display: flex; align-items: flex-start; gap: 8px; padding: 6px 0; }
16
16
  .lp-ph .w, .lp-r .w, .lp-hr .w { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
17
- .lp-ph b { font-size: 14px; font-weight: 800; color: var(--cz-ink); }
18
- .lp-ph small, .lp-r small, .lp-hr small { font-size: 12.5px; color: var(--cz-ink2); line-height: 1.4; display: inline-flex; align-items: center; gap: 4px; }
17
+ .lp-ph b { font-size: var(--fs-3); font-weight: 800; color: var(--cz-ink); }
18
+ .lp-ph small, .lp-r small, .lp-hr small { font-size: var(--fs-2); color: var(--cz-ink2); line-height: 1.4; display: inline-flex; align-items: center; gap: 4px; }
19
19
  .lp-ic { width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; color: var(--cz-blueink); flex: none; margin-top: 1px; }
20
20
  .lp-ib { all: unset; box-sizing: border-box; cursor: pointer; width: 32px; height: 32px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; color: var(--cz-ink2); flex: none; }
21
21
  .lp-ib.ok { color: var(--cz-blueink); }
@@ -24,31 +24,31 @@
24
24
  @media (hover: hover) { .lp-ib:hover { background: var(--cz-well); color: var(--cz-ink); } }
25
25
  .lp-rows { display: flex; flex-direction: column; margin: 2px 0 6px 12px; padding-left: 22px; border-left: 2px solid var(--cz-hair); }
26
26
  .lp-r { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 3px 0; }
27
- .lp-r b { font-size: 13.5px; font-weight: 600; color: var(--cz-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
27
+ .lp-r b { font-size: var(--fs-3); font-weight: 600; color: var(--cz-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
28
28
  .lp-r.out b { text-decoration: line-through; color: var(--cz-ink3); }
29
29
  .lp-mk { width: 16px; flex: none; display: inline-flex; align-items: center; justify-content: center; color: var(--cz-ink3); margin-left: -4px; }
30
30
  .lp-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cz-blue); display: inline-block; }
31
31
  .lp-late { width: 9px; height: 9px; border-radius: 2px; background: var(--cz-risk); display: inline-block; }
32
32
  .lp-tile { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; gap: 2px; height: 28px; padding: 0 6px 0 8px; border-radius: 999px; background: var(--cz-well); color: var(--cz-blueink); flex: none; }
33
- .lp-tile b { font-size: 10.5px; font-weight: 800; letter-spacing: .02em; }
33
+ .lp-tile b { font-size: var(--fs-1); font-weight: 800; letter-spacing: .02em; }
34
34
  .lp-tile.on { box-shadow: 0 0 0 1.5px var(--cz-blue); background: var(--cz-card); }
35
35
  .lp-tile.moved { background: var(--cz-bluebg); }
36
- .lp-more { all: unset; box-sizing: border-box; cursor: pointer; min-height: 36px; padding: 6px 0; font-size: 12.5px; font-weight: 700; color: var(--cz-blueink); }
36
+ .lp-more { all: unset; box-sizing: border-box; cursor: pointer; min-height: 36px; padding: 6px 0; font-size: var(--fs-2); font-weight: 700; color: var(--cz-blueink); }
37
37
  .lp-pick { align-self: flex-end; margin: 0 0 6px; width: min(330px, 100%); background: var(--cz-card); border-radius: 18px; box-shadow: 0 24px 60px -24px rgba(42,46,53,.45), 0 0 0 1px var(--cz-hair); padding: 6px; display: flex; flex-direction: column; }
38
- .lp-pick p { margin: 8px 10px 4px; font-size: 12px; font-weight: 700; color: var(--cz-ink3); }
39
- .lp-pick button { all: unset; box-sizing: border-box; cursor: pointer; min-height: 44px; padding: 6px 10px; border-radius: 12px; display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 700; color: var(--cz-ink); }
38
+ .lp-pick p { margin: 8px 10px 4px; font-size: var(--fs-2); font-weight: 700; color: var(--cz-ink3); }
39
+ .lp-pick button { all: unset; box-sizing: border-box; cursor: pointer; min-height: 44px; padding: 6px 10px; border-radius: 12px; display: flex; align-items: center; gap: 10px; font-size: var(--fs-3); font-weight: 700; color: var(--cz-ink); }
40
40
  .lp-pick button .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
41
41
  .lp-pick button[aria-checked="true"] { background: var(--cz-well); }
42
42
  .lp-pick button[aria-checked="true"] svg { color: var(--cz-blueink); }
43
43
  .lp-pick button.nw { color: var(--cz-ink2); font-weight: 600; }
44
44
  @media (hover: hover) { .lp-pick button:hover { background: var(--cz-well); } }
45
- .lp-tl { width: 26px; height: 26px; border-radius: 8px; background: var(--cz-bluebg); color: var(--cz-blueink); display: inline-flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 800; flex: none; }
45
+ .lp-tl { width: 26px; height: 26px; border-radius: 8px; background: var(--cz-bluebg); color: var(--cz-blueink); display: inline-flex; align-items: center; justify-content: center; font-size: var(--fs-1); font-weight: 800; flex: none; }
46
46
  .lp-pick .nw .lp-tl { background: none; color: var(--cz-ink3); }
47
47
  .lp-hist { margin-top: 8px; border-top: 1px solid var(--cz-hair); padding-top: 6px; }
48
- .lp-hist summary { cursor: pointer; min-height: 40px; display: flex; align-items: center; font-size: 12.5px; font-weight: 700; color: var(--cz-ink3); list-style: none; }
48
+ .lp-hist summary { cursor: pointer; min-height: 40px; display: flex; align-items: center; font-size: var(--fs-2); font-weight: 700; color: var(--cz-ink3); list-style: none; }
49
49
  .lp-hist summary::-webkit-details-marker { display: none; }
50
50
  .lp-hist summary:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 1px; border-radius: 8px; }
51
51
  .lp-hr { display: flex; align-items: center; gap: 8px; min-height: 44px; }
52
- .lp-hr b { font-size: 13px; font-weight: 700; color: var(--cz-ink); }
52
+ .lp-hr b { font-size: var(--fs-3); font-weight: 700; color: var(--cz-ink); }
53
53
  .lp-hr.undone b { color: var(--cz-ink3); }
54
54
  @media (max-width: 760px) { .lp { padding: 0 12px 24px; } .lp-ib { width: 40px; height: 40px; } .lp-rows { margin-left: 4px; padding-left: 12px; } }
@@ -0,0 +1,82 @@
1
+ /* pm/metric-drafts.css — the metrics Claude drafts (pm/metric-drafts.js; canvas Iq9Program, Iq9Initiative). metric-drafts.js loads it once,
2
+ * so it works wherever the program panel or the initiative view opens (Board, Home). Token vars only, over pm/cozy.css; the type scale is
3
+ * cozy.css's --fs-1..--fs-6 (each with its value as the fallback). Every class starts with md-. Motion: one soft fade the first time a part
4
+ * shows, and none when the PM asks for reduced motion. */
5
+
6
+ /* the proposal: a dashed card, Claude's blue */
7
+ .md-card { border: 1px dashed color-mix(in srgb, var(--cz-blueink) 45%, transparent); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px;
8
+ background: linear-gradient(100deg, var(--cz-bluebg) 0%, var(--cz-card) 60%); color: var(--cz-ink); }
9
+ .md-hd { display: flex; align-items: center; gap: 8px; font-size: var(--fs-3); color: var(--cz-blueink); min-width: 0; }
10
+ .md-hd b { font-weight: 800; white-space: nowrap; }
11
+ .md-sp { display: inline-flex; flex: none; }
12
+ .md-src { margin-left: auto; font-size: var(--fs-2); font-weight: 600; color: var(--cz-ink3); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
13
+ .md-gl { margin: 0; font-size: var(--fs-4); font-weight: 800; line-height: 1.35; }
14
+ .md-cps { display: flex; flex-wrap: wrap; gap: 6px; }
15
+ .md-cp { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-2); font-weight: 700; color: var(--cz-ink2); background: var(--cz-card); border: 1px solid var(--cz-hair); border-radius: 999px; padding: 3px 10px; }
16
+ .md-dm { width: 9px; height: 9px; transform: rotate(45deg); border-radius: 3px; border: 2px solid var(--pp-prog, var(--cz-ink3)); box-sizing: border-box; flex: none; }
17
+ .md-pill { display: inline-flex; align-items: center; max-width: 100%; font-size: var(--fs-1); font-weight: 800; border-radius: 999px; padding: 2px 8px; white-space: nowrap; background: var(--cz-riskbg); color: var(--cz-risk); }
18
+
19
+ /* Built from: Now and Target */
20
+ .md-bt { display: flex; flex-direction: column; }
21
+ .md-ru { display: grid; grid-template-columns: minmax(0, 1fr) 64px minmax(0, 150px); gap: 10px; align-items: center; font-size: var(--fs-3); padding: 7px 0; border-top: 1px solid var(--cz-hair); }
22
+ .md-ru.q { border-top: 0; padding-top: 0; font-size: var(--fs-2); color: var(--cz-ink3); }
23
+ .md-ru.q span:first-child { font-weight: 800; }
24
+ .md-ru b { font-weight: 800; }
25
+ .md-ru .md-pill { white-space: normal; }
26
+
27
+ /* the success measure's rows: what it is, Now, Target */
28
+ .md-ms { display: flex; flex-direction: column; }
29
+ .md-mr { display: grid; grid-template-columns: minmax(0, 1fr) 56px minmax(0, 110px); gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--cz-hair); font-size: var(--fs-3); }
30
+ .md-mr:first-child { border-top: 0; padding-top: 0; }
31
+ .md-nm { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
32
+ .md-nm b { font-weight: 800; }
33
+ .md-nm small { font-size: var(--fs-2); color: var(--cz-ink3); }
34
+ .md-role { font-size: var(--fs-1); font-weight: 800; color: var(--cz-ink3); }
35
+ .md-now { color: var(--cz-ink2); }
36
+ .md-to { font-weight: 800; }
37
+
38
+ /* the why and the presses */
39
+ .md-ft { display: flex; align-items: center; gap: 6px; }
40
+ .md-why { flex: 1; min-width: 0; margin: 0; font-size: var(--fs-2); line-height: 1.45; color: var(--cz-ink3); }
41
+ .md-why:empty { visibility: hidden; }
42
+ .md-ib { all: unset; box-sizing: border-box; cursor: pointer; width: 36px; height: 36px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; color: var(--cz-ink2); flex: none; }
43
+ .md-ib.solid { background: var(--cz-ink); color: var(--cz-card); }
44
+ .md-ib[disabled] { opacity: .45; cursor: default; }
45
+ @media (hover: hover) { .md-ib:not([disabled]):hover { background: var(--cz-well); color: var(--cz-ink); } .md-ib.solid:not([disabled]):hover { background: var(--cz-ink); color: var(--cz-card); filter: brightness(1.15); } }
46
+ .md-ib:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; }
47
+
48
+ /* kept: the program's Goal row (the panel's own .pp-goal chips), the initiative's fold */
49
+ .md-kept .md-kr b { margin-right: 2px; }
50
+ .md-kept .md-ib { width: 30px; height: 30px; }
51
+ /* the Undo stays at the row's end when the chips wrap */
52
+ .pp-goal.md-kept { position: relative; padding-right: 38px; }
53
+ .pp-goal.md-kept > .md-ib { position: absolute; right: 0; top: 0; }
54
+ .md-kept-i { display: flex; align-items: flex-start; gap: 6px; }
55
+ .md-kept-i .md-folds { flex: 1; min-width: 0; }
56
+ .md-kept-i > .md-ib { margin-top: 6px; }
57
+ .md-ok { display: inline-flex; align-items: center; font-size: var(--fs-1); font-weight: 800; border-radius: 999px; padding: 2px 8px; white-space: nowrap; background: var(--cz-okbg); color: var(--cz-ok); }
58
+ .md-list { display: flex; flex-direction: column; gap: 2px; }
59
+ .md-lr { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; }
60
+ .md-mk { width: 8px; height: 8px; border-radius: 50%; background: var(--cz-dot-ok); flex: none; margin-top: 6px; }
61
+ .md-w { display: flex; flex-direction: column; min-width: 0; }
62
+ .md-w b { font-size: var(--fs-3); font-weight: 800; }
63
+ .md-w span { font-size: var(--fs-2); color: var(--cz-ink3); }
64
+
65
+ /* the wide Viewer (.cz-vw-w2): the part first in the panel sits above the summary, in its column */
66
+ .cz-vw-w2 .cz-vw-body > .md-top { grid-column: 1; max-width: none; }
67
+
68
+ /* a phone: 44 px touch targets; the columns tighten */
69
+ @media (max-width: 760px) {
70
+ .md-ib { width: 44px; height: 44px; }
71
+ .md-kept .md-ib { width: 40px; height: 40px; }
72
+ .pp-goal.md-kept { padding-right: 48px; }
73
+ .md-ru { grid-template-columns: minmax(0, 1fr) 48px minmax(0, 120px); }
74
+ .md-mr { grid-template-columns: minmax(0, 1fr) 44px minmax(0, 90px); }
75
+ .md-hd { flex-wrap: wrap; }
76
+ .md-src { margin-left: 0; flex-basis: 100%; white-space: normal; }
77
+ }
78
+
79
+ @media (prefers-reduced-motion: no-preference) {
80
+ .md-in { animation: md-in .3s ease-out both; }
81
+ @keyframes md-in { from { opacity: 0; } to { opacity: 1; } }
82
+ }
@@ -0,0 +1,165 @@
1
+ /* pm/metric-drafts.js — the metrics Claude drafts without being asked, as the program panel and the initiative view show them (feedback batch 15
2
+ * item 1; canvas Iq9Program, Iq9Initiative). The drafts, the run and the writes are the server's (GET /api/metric-drafts and its POSTs,
3
+ * lib/routes-metric-drafts.js); this module reads them and draws two parts:
4
+ *
5
+ * want(ws, scope, id, onChange) reads GET /api/metric-drafts?ws=&scope=&id= once per page load; onChange() runs when the answer arrives
6
+ * progHtml(p, ws) the program panel's part (scope program), at the top of its body:
7
+ * open rows: the dashed "✦ Proposed goal" card: the goal line, its checkpoints and guardrail as chips, "Built
8
+ * from" (Now, Target, a drafted ticket as a pill), one line of why, then Discuss in Home, Edit and ✓ keep all
9
+ * kept rows: one Goal row of chips, each with a dot (ok: a reading; off: it waits on a ticket), and Undo
10
+ * iniHtml(id, ws, title) the initiative view's part (scope initiative), under the stage card:
11
+ * open rows: "✦ Proposed success measure": Proves it worked, Early signal and Guardrail as Now → Target rows,
12
+ * one line of why, then Edit and ✓ keep all
13
+ * kept rows: the folded "Success measure · Set before the build · N" with its rows, and Undo
14
+ * press(b, h) a press on [data-md]: keep all, Undo, the fold. h: { redraw(), toast(text) }. → true when it was one
15
+ *
16
+ * Zero is silence: no row drafted (or a read that failed) draws nothing. Discuss and Edit go to Home's chat with the question in the box; the
17
+ * server has no edit of a draft, so a change is asked of Claude there. Nothing is kept until the PM's ✓. */
18
+ import { pmPost } from './http.js';
19
+
20
+ (function sheet() { // once, at import: the parts show on the Board and in Home's Viewer, and the look must come with them on both
21
+ if (typeof document === 'undefined' || !document.head || typeof document.getElementById !== 'function' || document.getElementById('mdCss')) return;
22
+ const l = document.createElement('link'); l.id = 'mdCss'; l.rel = 'stylesheet';
23
+ try { l.href = new URL('./metric-drafts.css', import.meta.url).href; } catch { l.href = '/pm/metric-drafts.css'; }
24
+ document.head.appendChild(l);
25
+ })();
26
+
27
+ const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
28
+ 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>`;
29
+ const I = {
30
+ spark: 'M12 3l1.8 4.7L18.5 9.5l-4.7 1.8L12 16l-1.8-4.7L5.5 9.5l4.7-1.8z', ask: 'M4 5h16v11H9l-5 4z',
31
+ pen: 'M4 20h4l10.5-10.5a2.1 2.1 0 0 0-3-3L5 17v3z', check: 'M5 12l5 5L20 7', undo: 'M9 14L4 9l5-5M4 9h11a5 5 0 0 1 0 10h-3',
32
+ right: 'M10 7l5 5-5 5', down: 'M7 10l5 5 5-5',
33
+ };
34
+ const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
35
+ const DAY = /^(\d{4})-(\d{2})-(\d{2})/;
36
+ const day = (iso) => { const m = DAY.exec(String(iso || '')); return m ? MON[+m[2] - 1] + ' ' + +m[3] : ''; };
37
+ const month = (iso) => { const m = DAY.exec(String(iso || '')); return m ? MON[+m[2] - 1] + ' ' + m[1] : ''; };
38
+
39
+ /* ── the reads: one per scope and id, per page load ── */
40
+ const READ = new Map(); // scope|id → { ws, d: the GET answer | null, reading, busy }
41
+ const SEEN = new Set(); // scope|id whose part has been drawn once: the soft fade runs on the first draw only, never on a redraw
42
+ const FOLD = new Set(); // initiative ids whose kept success measure is open (it starts folded: summary first)
43
+ const keyOf = (scope, id) => scope + '|' + id;
44
+ function fetchOne(ws, scope, id) {
45
+ const q = new URLSearchParams({ scope, id }); if (ws) q.set('ws', ws);
46
+ return fetch('/api/metric-drafts?' + q.toString(), { credentials: 'same-origin' }).then((r) => (r.status === 200 ? r.json() : null)).catch(() => null);
47
+ }
48
+ export function want(ws, scope, id, onChange) {
49
+ if (!id || typeof fetch !== 'function') return null;
50
+ const k = keyOf(scope, id), had = READ.get(k);
51
+ if (had && had.ws === (ws || '')) return had;
52
+ const one = { ws: ws || '', d: null, reading: true, busy: false };
53
+ READ.set(k, one);
54
+ fetchOne(ws, scope, id).then((r) => { one.reading = false; one.d = r && r.ok ? r : null; if (one.d && rowsOf(one.d).length && onChange) onChange(); });
55
+ return one;
56
+ }
57
+ /** Reads again after a press, then draws. */
58
+ async function again(scope, id, onChange) {
59
+ const one = READ.get(keyOf(scope, id)); if (!one) return;
60
+ const r = await fetchOne(one.ws, scope, id);
61
+ one.d = r && r.ok ? r : null;
62
+ if (onChange) onChange();
63
+ }
64
+ const rowsOf = (d) => ((d && Array.isArray(d.rows)) ? d.rows : []).filter((r) => r && r.state !== 'dropped');
65
+ /** The rows to draw: the open ones while Claude has finished drafting them (a run still shaping them draws nothing yet), else the kept ones. */
66
+ function partOf(scope, id) {
67
+ const one = READ.get(keyOf(scope, id)), d = one && one.d; if (!d) return null;
68
+ const R = rowsOf(d), open = R.filter((r) => r.state === 'open'), kept = R.filter((r) => r.state === 'kept');
69
+ const running = d.run && d.run.state === 'running';
70
+ if (open.length && !running) return { d, mode: 'open', rows: open, busy: one.busy };
71
+ if (kept.length && !open.length) return { d, mode: 'kept', rows: kept, busy: one.busy };
72
+ return null;
73
+ }
74
+ const fade = (scope, id) => { const k = keyOf(scope, id); if (SEEN.has(k)) return ''; SEEN.add(k); return ' md-in'; };
75
+
76
+ /* ── the words ── */
77
+ const is = (r, re) => re.test(String((r && r.group) || ''));
78
+ const ticketText = (t) => { const s = String((t && (t.text || (t.key ? t.key + ' drafted' : ''))) || ''); return /^ticket\b/i.test(s) ? s : 'Ticket ' + s; };
79
+ const ticketPill = (t) => `<span class="md-pill">${esc(ticketText(t))}</span>`;
80
+ const nowOf = (r) => (r.now == null && !r.nowTxt ? '—' : r.nowTxt || String(r.now));
81
+ const homeHref = (o) => { const q = new URLSearchParams(); for (const [k, v] of Object.entries(o)) if (v) q.set(k, v); return '/premium.html?' + q.toString(); };
82
+ const ib = (o) => (o.href
83
+ ? `<a class="md-ib" href="${esc(o.href)}" aria-label="${esc(o.label)}" title="${esc(o.title || o.label)}">${SVG(o.icon)}</a>`
84
+ : `<button type="button" class="md-ib${o.solid ? ' solid' : ''}" data-md="${esc(o.act)}" data-md-scope="${esc(o.scope)}" data-md-id="${esc(o.id)}" aria-label="${esc(o.label)}" title="${esc(o.title || o.label)}"${o.busy ? ' disabled' : ''}>${SVG(o.icon, 16, o.solid ? 2.2 : 1.8)}</button>`);
85
+ const head = (label, src) => `<div class="md-hd"><span class="md-sp">${SVG(I.spark)}</span><b>${esc(label)}</b>${src ? `<span class="md-src">${esc(src)}</span>` : ''}</div>`;
86
+ /** The one line of why: the server's line for the whole draft, else the lead row's own. */
87
+ const whyOf = (d, lead) => String((d && d.sub) || (lead && lead.why) || '');
88
+
89
+ /* ── the program: the proposed goal, then the kept Goal row ── */
90
+ export function progHtml(p, ws) {
91
+ if (!p || !p.id) return '';
92
+ const P = partOf('program', p.id); if (!P) return '';
93
+ const goal = P.rows.find((r) => is(r, /goal/i)) || P.rows[0];
94
+ const rolls = P.rows.filter((r) => r !== goal && is(r, /roll/i)), guard = P.rows.filter((r) => r !== goal && is(r, /guard/i));
95
+ if (P.mode === 'kept') {
96
+ // the dot: a reading behind it (ok), or it waits on a drafted ticket (off)
97
+ const chip = (r, lead) => { const off = r.now == null && !!r.ticket;
98
+ const txt = off ? 'waits on ' + (r.ticket.key || 'a ticket') : is(r, /guard/i) ? r.targetTxt || '' : [r.nowTxt && r.targetTxt ? r.nowTxt + ' of ' + r.targetTxt : r.targetTxt || r.nowTxt || '', lead ? month(r.by) : day(r.by)].filter(Boolean).join(' · ');
99
+ return `<span class="pp-kr md-kr" title="${esc(r.why || '')}"><i class="pp-gd${off ? ' off' : ''}" aria-hidden="true"></i><b>${esc(r.name)}</b>${esc(txt)}</span>`; };
100
+ return `<div class="pp-goal md-kept md-top${fade('program', p.id)}" role="group" aria-label="Program goal"><span class="pp-per">Goal</span>${chip(goal, true)}${rolls.concat(guard).map((r) => chip(r)).join('')}`
101
+ + ib({ act: 'undo', scope: 'program', id: p.id, icon: I.undo, label: 'Undo: make the goal a proposal again', title: 'Undo', busy: P.busy }) + '</div>';
102
+ }
103
+ const line = goal.name + ': ' + [goal.nowTxt, goal.targetTxt].filter(Boolean).join(' → ') + (goal.by ? ' by ' + month(goal.by) : '');
104
+ const chips = ((goal.checkpoints) || []).map((c) => `<span class="md-cp"><span class="md-dm" aria-hidden="true"></span>${esc([c.target != null ? String(c.target) + (goal.type === 'Percentage' && typeof c.target === 'number' ? '%' : '') : '', c.label].filter(Boolean).join(' at '))}${c.by ? ' · ' + esc(day(c.by)) : ''}</span>`)
105
+ .concat(guard.map((g) => `<span class="md-cp">Guardrail: ${esc(g.name)}${g.targetTxt ? ' · ' + esc(g.targetTxt) : ''}</span>`)).join('');
106
+ const built = rolls.length ? `<div class="md-bt" role="table" aria-label="Built from"><div class="md-ru q" role="row"><span role="columnheader">Built from</span><span role="columnheader">Now</span><span role="columnheader">Target</span></div>`
107
+ + rolls.map((r) => { const [a, ...b] = String(r.name).split(' · ');
108
+ return `<div class="md-ru" role="row"><span role="cell">${b.length ? `<b>${esc(a)}</b> · ${esc(b.join(' · '))}` : esc(a)}</span><span role="cell">${esc(nowOf(r))}</span><span role="cell">${r.ticket && r.now == null ? ticketPill(r.ticket) : esc([r.targetTxt, r.by ? 'by ' + day(r.by) : ''].filter(Boolean).join(' '))}</span></div>`; }).join('') + '</div>' : '';
109
+ const q = (w) => homeHref({ ws: ws || p.home, ask: 'program:' + p.id, q: w + p.title + ': ' });
110
+ return `<section class="md-card md-top${fade('program', p.id)}" aria-label="Proposed goal">${head('Proposed goal', P.d.src)}<p class="md-gl">${esc(line)}</p>`
111
+ + (chips ? `<div class="md-cps">${chips}</div>` : '') + built
112
+ + `<div class="md-ft"><p class="md-why">${esc(whyOf(P.d, goal))}</p>`
113
+ + ib({ href: q('About the proposed goal for '), icon: I.ask, label: 'Discuss the proposed goal in Home', title: 'Discuss in Home' })
114
+ + ib({ href: q('Change the proposed goal for '), icon: I.pen, label: 'Edit the proposed goal in Home', title: 'Edit' })
115
+ + ib({ act: 'keep', scope: 'program', id: p.id, icon: I.check, label: 'Keep this goal', solid: true, busy: P.busy }) + '</div></section>';
116
+ }
117
+
118
+ /* ── the initiative: the proposed success measure, then the kept fold ── */
119
+ const ROLE = [[/proves/i, 'Proves it worked · 4 weeks after release'], [/early|signal/i, 'Early signal · shows in days'], [/guard/i, 'Guardrail']];
120
+ const roleOf = (r) => { const m = ROLE.find(([re]) => is(r, re)); return m ? m[1] : String(r.group || ''); };
121
+ const order = (r) => { const j = ROLE.findIndex(([re]) => is(r, re)); return j < 0 ? ROLE.length : j; };
122
+ const targetOf = (r) => r.targetTxt || (r.target == null ? '' : String(r.target));
123
+ export function iniHtml(id, ws, title) {
124
+ if (!id) return '';
125
+ const P = partOf('initiative', id); if (!P) return '';
126
+ ws = ws || (READ.get(keyOf('initiative', id)) || {}).ws || '';
127
+ const R = P.rows.slice().sort((a, b) => order(a) - order(b)), why = whyOf(P.d, R[0]);
128
+ if (P.mode === 'kept') {
129
+ const op = FOLD.has(id);
130
+ const sub = (r) => (r.now == null && r.ticket ? 'Waits on ' + (r.ticket.key || 'a drafted ticket') : is(r, /guard/i) ? 'Stays at ' + targetOf(r) : [r.nowTxt ? r.nowTxt + ' → ' + targetOf(r) : targetOf(r), is(r, /proves/i) ? '4 weeks after release' : ''].filter(Boolean).join(', '));
131
+ return `<div class="md-kept-i${fade('initiative', id)}"><div class="iv-folds md-folds"><button type="button" class="iv-fr" data-md="fold" data-md-scope="initiative" data-md-id="${esc(id)}" aria-expanded="${op}"><b>Success measure</b><span class="md-ok">Set before the build</span><span class="n">${R.length}</span>${SVG(op ? I.down : I.right)}</button>`
132
+ + (op ? `<div class="iv-fb md-list">${R.map((r) => `<div class="md-lr"><span class="md-mk" aria-hidden="true"></span><span class="md-w"><b>${esc(r.name)}</b><span>${esc(sub(r))}</span></span></div>`).join('')}</div>` : '') + '</div>'
133
+ + ib({ act: 'undo', scope: 'initiative', id, icon: I.undo, label: 'Undo: make the success measure a proposal again', title: 'Undo', busy: P.busy }) + '</div>';
134
+ }
135
+ const row = (r) => `<div class="md-mr"><span class="md-nm"><span class="md-role">${esc(roleOf(r))}</span><b>${esc(r.name)}</b>${r.ticket && r.now == null ? `<small>${ticketPill(r.ticket)}</small>` : r.why && r.why !== why ? `<small>${esc(r.why)}</small>` : ''}</span><span class="md-now">${esc(nowOf(r))}</span><b class="md-to">${esc(targetOf(r))}</b></div>`;
136
+ const q = homeHref({ ws, ask: id, q: 'Change the proposed success measure for ' + (title || id) + ': ' });
137
+ return `<section class="md-card${fade('initiative', id)}" aria-label="Proposed success measure">${head('Proposed success measure', P.d.src)}<div class="md-ms" role="list">${R.map(row).join('')}</div>`
138
+ + `<div class="md-ft"><p class="md-why">${esc(why)}</p>${ib({ href: q, icon: I.pen, label: 'Edit the proposed success measure in Home', title: 'Edit' })}`
139
+ + ib({ act: 'keep', scope: 'initiative', id, icon: I.check, label: 'Keep this success measure', solid: true, busy: P.busy }) + '</div></section>';
140
+ }
141
+
142
+ /* ── the presses ── */
143
+ export function press(b, h = {}) {
144
+ const a = b && b.dataset && b.dataset.md; if (!a) return false;
145
+ const scope = b.dataset.mdScope, id = b.dataset.mdId, one = READ.get(keyOf(scope, id));
146
+ const redraw = () => { if (h.redraw) h.redraw(); }, say = (m) => { if (h.toast) h.toast(m); };
147
+ if (a === 'fold') { if (FOLD.has(id)) FOLD.delete(id); else FOLD.add(id); redraw(); return true; }
148
+ if (!one || !one.d || one.busy) return true;
149
+ const body = { ws: one.ws || null, scope, id };
150
+ one.busy = true; redraw();
151
+ (async () => {
152
+ let r;
153
+ if (a === 'keep') r = await pmPost('/api/metric-drafts/keep-all', body).catch(() => null);
154
+ else if (a === 'undo') {
155
+ // no undo of all: each kept row goes back to open, one at a time
156
+ for (const x of rowsOf(one.d).filter((y) => y.state === 'kept')) { r = await pmPost('/api/metric-drafts/undo', { ...body, row: x.id }).catch(() => null); if (!r || !r.ok) break; }
157
+ }
158
+ one.busy = false;
159
+ if (!r || !r.ok) { say((r && r.error) || (a === 'keep' ? 'Not kept. The server did not say why.' : 'Not undone. The server did not say why.')); redraw(); return; }
160
+ if (a === 'keep') say(scope === 'program' ? 'Kept. I check the goal every morning.' : 'Kept. I check the success measure every morning after the release.');
161
+ else say('Undone. It is a proposal again.');
162
+ await again(scope, id, redraw);
163
+ })();
164
+ return true;
165
+ }
@@ -3,7 +3,7 @@
3
3
  * Quiet: no motion. Every class starts with msg-. */
4
4
  .msg-box, .msg-list { --msg-prog: var(--pp-prog, var(--cz-c-6b4fa3)); --msg-progbg: var(--pp-progbg, rgba(107,79,163,.10)); }
5
5
  .msg-box { border: 1px dashed color-mix(in srgb, var(--msg-prog) 45%, transparent); border-radius: 16px; overflow: hidden; }
6
- .msg-hd { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; background: var(--msg-progbg); font-size: 12.5px; color: var(--cz-ink2); }
6
+ .msg-hd { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; background: var(--msg-progbg); font-size: var(--fs-2); color: var(--cz-ink2); }
7
7
  .msg-ht { flex: 1; min-width: 0; }
8
8
  .msg-ht b { color: var(--msg-prog); font-weight: 700; }
9
9
  .msg-list { display: flex; flex-direction: column; }
@@ -13,10 +13,10 @@
13
13
  .msg-mk { color: var(--msg-prog); display: inline-flex; flex: none; padding-top: 2px; }
14
14
  .msg-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
15
15
  .msg-h { display: flex; gap: 8px; align-items: baseline; width: 100%; }
16
- .msg-h b { font-size: 13px; font-weight: 700; color: var(--cz-ink); flex: 1; min-width: 0; }
17
- .msg-d { font-size: 12px; font-weight: 700; color: var(--cz-ink2); white-space: nowrap; }
18
- .msg-w { font-size: 12px; color: var(--cz-ink3); line-height: 1.4; }
19
- .msg-src { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; color: var(--cz-ink2); background: var(--cz-well); border-radius: 999px; padding: 2px 8px; }
16
+ .msg-h b { font-size: var(--fs-3); font-weight: 700; color: var(--cz-ink); flex: 1; min-width: 0; }
17
+ .msg-d { font-size: var(--fs-2); font-weight: 700; color: var(--cz-ink2); white-space: nowrap; }
18
+ .msg-w { font-size: var(--fs-2); color: var(--cz-ink3); line-height: 1.4; }
19
+ .msg-src { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-1); font-weight: 600; color: var(--cz-ink2); background: var(--cz-well); border-radius: 999px; padding: 2px 8px; }
20
20
  .msg-src svg { color: var(--cz-ink3); }
21
21
  .msg-gd { width: 7px; height: 7px; transform: rotate(45deg); border-radius: 2px; background: var(--msg-prog); display: inline-block; }
22
22
  .msg-ends { display: inline-flex; align-items: center; gap: 2px; flex: none; }
@@ -32,18 +32,18 @@
32
32
  .pp-needs .msg-list { background: var(--cz-card); border-radius: 12px; margin-bottom: 4px; }
33
33
 
34
34
  /* the charter: last checked and Check now (XmsgB, last frame), and the change filled in from the pencil */
35
- .msg-chk { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--cz-ink3); }
35
+ .msg-chk { display: flex; align-items: center; gap: 8px; font-size: var(--fs-2); color: var(--cz-ink3); }
36
36
  .msg-chk span { flex: 1; min-width: 0; }
37
37
  .msg-chk .msg-ib { width: 28px; height: 28px; }
38
38
  .msg-chk .msg-ib.on svg { animation: msg-spin 1.2s linear infinite; }
39
39
  @keyframes msg-spin { to { transform: rotate(360deg); } }
40
40
  @media (prefers-reduced-motion: reduce) { .msg-chk .msg-ib.on svg { animation: none; } }
41
- .msg-risk { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--cz-risk); }
41
+ .msg-risk { display: flex; align-items: center; gap: 6px; font-size: var(--fs-2); color: var(--cz-risk); }
42
42
  .msg-risk span { flex: 1; min-width: 0; }
43
43
  .msg-risk { margin: 4px 0 0 30px; }
44
44
  .msg-risk i { width: 7px; height: 7px; border-radius: 50%; background: var(--pc-amberdot, var(--cz-risk)); flex: none; }
45
45
  .msg-risk .pc-ib { width: 28px; height: 28px; }
46
- .msg-chg { display: flex; align-items: flex-start; gap: 6px; margin: 4px 0 0 30px; font-size: 12px; color: var(--cz-ink2); }
46
+ .msg-chg { display: flex; align-items: flex-start; gap: 6px; margin: 4px 0 0 30px; font-size: var(--fs-2); color: var(--cz-ink2); }
47
47
  .msg-chg svg { color: var(--pp-prog, var(--cz-c-6b4fa3)); flex: none; margin-top: 1px; }
48
48
  .pc-lnw.msg-on > .pc-ln { border: 1px dashed color-mix(in srgb, var(--pp-prog, var(--cz-c-6b4fa3)) 45%, transparent); border-radius: 14px; }
49
49
  .pc-ms > .msg-chg { margin: 0 0 8px; }
@@ -1,25 +1,25 @@
1
1
  /* pm/ov-view.css — the parts every object Viewer shares (feedback batch 6 item 1b; canvas OvViewers, OvReport): the facts card, a quiet
2
2
  * label over a block of words, the clamped description with its open icon, and the one "where it sits" row. Over cozy.css's tokens, so the
3
3
  * dark theme follows. task-card.js, tk-view.js and the goal Viewer (premium-insights.js) load it. */
4
- .ovf { border-radius: 18px; box-shadow: inset 0 0 0 1px var(--cz-hair); background: var(--cz-card); padding: 14px 16px; display: grid; grid-template-columns: max-content 1fr; column-gap: 18px; row-gap: 6px; align-items: center; font-size: 14px; }
5
- .ovf > .k { color: var(--cz-ink3); font-size: 13px; font-weight: 600; min-height: 30px; display: flex; align-items: center; }
4
+ .ovf { border-radius: 18px; box-shadow: inset 0 0 0 1px var(--cz-hair); background: var(--cz-card); padding: 14px 16px; display: grid; grid-template-columns: max-content 1fr; column-gap: 18px; row-gap: 6px; align-items: center; font-size: var(--fs-3); }
5
+ .ovf > .k { color: var(--cz-ink3); font-size: var(--fs-2); font-weight: 600; min-height: 30px; display: flex; align-items: center; }
6
6
  .ovf > .v { min-width: 0; min-height: 30px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-weight: 700; color: var(--cz-ink); }
7
7
  .ovf > .v .late { color: var(--cz-risk); font-weight: 700; }
8
- .ovf > .foot { grid-column: 1 / -1; margin: 10px 0 0; font-size: 12.5px; color: var(--cz-ink3); font-weight: 600; }
9
- .ovf .av { width: 22px; height: 22px; border-radius: 7px; background: var(--cz-well); color: var(--cz-ink2); font-size: 10.5px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex: none; }
8
+ .ovf > .foot { grid-column: 1 / -1; margin: 10px 0 0; font-size: var(--fs-2); color: var(--cz-ink3); font-weight: 600; }
9
+ .ovf .av { width: 22px; height: 22px; border-radius: 7px; 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; flex: none; }
10
10
  .ovf .av.j { border-radius: 50%; background: var(--cz-okbg); color: var(--cz-ok); }
11
11
  .ovf .av.no { background: transparent; border: 1.5px dashed var(--cz-ink3); box-sizing: border-box; }
12
12
 
13
13
  /* a quiet label over a block (Notes, Your notes, Description · from Jira) */
14
14
  .ovb { display: flex; flex-direction: column; gap: 4px; }
15
- .ovl { margin: 0; font-size: 12.5px; font-weight: 700; color: var(--cz-ink3); }
16
- .ovl small { font-weight: 600; font-size: 12.5px; }
17
- .ovt { margin: 0; font-size: 14px; line-height: 1.55; color: var(--cz-ink); }
15
+ .ovl { margin: 0; font-size: var(--fs-2); font-weight: 700; color: var(--cz-ink3); }
16
+ .ovl small { font-weight: 600; font-size: var(--fs-2); }
17
+ .ovt { margin: 0; font-size: var(--fs-3); line-height: 1.55; color: var(--cz-ink); }
18
18
  /* the description: shown open, cut at five lines, an icon opens the rest */
19
19
  .ovd { position: relative; }
20
- .ovd .ovdx { font-size: 14px; line-height: 1.55; color: var(--cz-ink); overflow-wrap: anywhere; }
20
+ .ovd .ovdx { font-size: var(--fs-3); line-height: 1.55; color: var(--cz-ink); overflow-wrap: anywhere; }
21
21
  .ovd .ovdx p, .ovd .ovdx ul, .ovd .ovdx ol { margin: 0 0 6px; }
22
- .ovd .ovdx h4 { margin: 8px 0 2px; font-size: 13px; }
22
+ .ovd .ovdx h4 { margin: 8px 0 2px; font-size: var(--fs-3); }
23
23
  .ovd.cut .ovdx { max-height: calc(1.55em * 5); overflow: hidden; -webkit-mask-image: linear-gradient(180deg, var(--cz-ink) 55%, transparent); mask-image: linear-gradient(180deg, var(--cz-ink) 55%, transparent); }
24
24
  .ovd .ovdm { display: flex; justify-content: center; margin-top: 2px; }
25
25
  .ovib { width: 30px; height: 30px; border-radius: 999px; border: 0; padding: 0; background: var(--cz-well); color: var(--cz-ink2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
@@ -31,8 +31,8 @@
31
31
  .ovw .go:hover { background: var(--cz-well2); }
32
32
  .ovw .tl { width: 28px; height: 28px; border-radius: 9px; background: var(--cz-bluebg); color: var(--cz-blueink); display: inline-flex; align-items: center; justify-content: center; flex: none; }
33
33
  .ovw .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
34
- .ovw .tx b { font-size: 14px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
35
- .ovw .tx small { font-size: 12.5px; color: var(--cz-ink3); font-weight: 600; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
34
+ .ovw .tx b { font-size: var(--fs-3); font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
35
+ .ovw .tx small { font-size: var(--fs-2); color: var(--cz-ink3); font-weight: 600; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
36
36
  .ovw .tx small .sep { opacity: .7; }
37
37
  .ovw .cv { color: var(--cz-ink3); display: inline-flex; flex: none; }
38
38
  .ovw .ovmv { width: 38px; height: 38px; border-radius: 999px; border: 0; background: transparent; color: var(--cz-ink2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
@@ -40,5 +40,5 @@
40
40
 
41
41
  /* the foot link (Open in Jira) */
42
42
  .ovft { display: flex; justify-content: center; padding: 6px 0 4px; }
43
- .ovft a { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 700; color: var(--cz-ink2); text-decoration: none; padding: 6px 12px; border-radius: 999px; }
43
+ .ovft a { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-2); font-weight: 700; color: var(--cz-ink2); text-decoration: none; padding: 6px 12px; border-radius: 999px; }
44
44
  .ovft a:hover { background: var(--cz-well); color: var(--cz-ink); }
@@ -120,7 +120,7 @@ function chartHtml(t) {
120
120
  + `<p class="vz-note">${esc(base ? base.title : d.measure)}${d.range ? ' · last ' + d.range + ' readings' : ' · every reading'}${d.target != null ? ' · target ' + esc(d.target) : ''}</p>`
121
121
  + `<div class="vz-sg" role="group" aria-label="Form">${FORMS.map(([f, l]) => `<button type="button" data-ct="form|${f}" aria-pressed="${form === f}">${l}</button>`).join('')}</div>${meter}`
122
122
  + (changed ? `<div class="vz-r1">${btn('save', t.busy ? 'Saving' : s ? 'Save the change' : 'Save chart', { off: t.busy || !base || !!meter })}</div>` : '')
123
- + `<p class="vz-note">${s ? 'It shows on Insights under Your charts.' : 'Saved, it shows on Insights under Your charts and can go on a dashboard.'} Ask in the chat to change it.</p>`
123
+ + `<p class="vz-note">${s ? 'It shows on Intelligence under Your charts.' : 'Saved, it shows on Intelligence under Your charts and can go on a dashboard.'} Ask in the chat to change it.</p>`
124
124
  + (s ? `<div class="vz-r1">${btn('remove', 'Delete chart', { sec: true, off: t.busy })}</div>` : '') + '</section>';
125
125
  }
126
126
  /** A dashboard's chart as a small tile: its name, the reading now and its readings as small bars. */
@@ -142,15 +142,15 @@ function dashHtml(t) {
142
142
  const many = d.charts.length > 6 ? '<p class="vz-note">This dashboard holds more than six charts. A dashboard that serves one routine usually holds six or fewer.</p>' : '';
143
143
  return `${d.purpose ? `<p class="vz-sum">${esc(d.purpose)}</p>` : ''}<div class="vz-mx-grid">${tiles}</div>${many}`
144
144
  + `<section class="vz-blk" aria-label="${esc(eye)}"><div class="vz-r1"><h3>${esc(eye)}</h3></div>`
145
- + `<p class="vz-note">${d.charts.length} ${d.charts.length === 1 ? 'chart' : 'charts'}${s && s.main ? ' · pinned on Insights' : ''}</p>`
145
+ + `<p class="vz-note">${d.charts.length} ${d.charts.length === 1 ? 'chart' : 'charts'}${s && s.main ? ' · pinned on Intelligence' : ''}</p>`
146
146
  + (changed ? `<div class="vz-r1">${btn('save', t.busy ? 'Saving' : s ? 'Save the change' : 'Save dashboard', { off: t.busy })}</div>` : '')
147
- + `<p class="vz-note">${s ? 'It is in the list on Insights.' : 'Saved, it is in the list on Insights, where you can pin it.'} Ask in the chat to change it.</p>`
147
+ + `<p class="vz-note">${s ? 'It is in the list on Intelligence.' : 'Saved, it is in the list on Intelligence, where you can pin it.'} Ask in the chat to change it.</p>`
148
148
  + (s ? `<div class="vz-r1">${btn('remove', 'Delete dashboard', { sec: true, off: t.busy })}</div>` : '') + '</section>';
149
149
  }
150
150
  function bodyHtml(t) {
151
151
  const noun = t.block.kind;
152
152
  if (!t.loaded) return `<p class="vz-empty" role="status">Reading the ${noun}.</p>`;
153
- if (!t.M) return `<p class="vz-msg">The Insights records could not be read, so the ${noun} cannot be drawn. Try again in a moment.</p>`;
153
+ if (!t.M) return `<p class="vz-msg">The Intelligence records could not be read, so the ${noun} cannot be drawn. Try again in a moment.</p>`;
154
154
  if (t.removed) return '<p class="vz-msg">Deleted. Ask in the chat for a new one.</p>';
155
155
  if (t.gone) return `<p class="vz-msg">This ${noun} (${esc(t.block.id)}) is deleted, or it is not saved on this board.</p>`;
156
156
  if (!t.M.board.id) return '<p class="vz-msg">This workspace has no board to save on, so nothing can be saved here.</p>';
@@ -181,13 +181,13 @@ async function press(t, e) {
181
181
  question: d.question || '', form: d.form || 'line', range: d.range || null, target: d.target == null ? null : d.target, better: d.better || 'higher', note: d.note || '' });
182
182
  if (!r || !r.ok) return 'It was not saved: ' + why(r, 'the page could not reach PMOS') + '.';
183
183
  t.block = { kind, id: r.chart.id }; await load(t);
184
- return 'Saved. It shows on Insights under Your charts.';
184
+ return 'Saved. It shows on Intelligence under Your charts.';
185
185
  }
186
186
  const d = t.d;
187
187
  const r = await post('/api/premium-dashboards/save', { board, id: t.saved ? t.saved.id : undefined, name: d.name, purpose: d.purpose || d.name, charts: d.charts, main: !!(t.saved && t.saved.main) });
188
188
  if (!r || !r.ok) return 'It was not saved: ' + why(r, 'the page could not reach PMOS') + '.';
189
189
  t.block = { kind, id: r.dashboard.id }; await load(t);
190
- return 'Saved. It is in the list on Insights.';
190
+ return 'Saved. It is in the list on Intelligence.';
191
191
  });
192
192
  return;
193
193
  }