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
@@ -15,8 +15,8 @@
15
15
  /* the stage card and the Plan card (XipB .card2): a quiet outlined card, its head the name and where it stands */
16
16
  .xv-card { border: 1px solid var(--cz-hair); border-radius: 18px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
17
17
  .xv-ch { display: flex; align-items: center; gap: 8px; color: var(--cz-ink); }
18
- .xv-ch b { font-size: 15px; font-weight: 800; }
19
- .xv-ch .r { margin-left: auto; font-size: 12.5px; color: var(--cz-ink3); font-weight: 700; white-space: nowrap; }
18
+ .xv-ch b { font-size: var(--fs-3); font-weight: 800; }
19
+ .xv-ch .r { margin-left: auto; font-size: var(--fs-2); color: var(--cz-ink3); font-weight: 700; white-space: nowrap; }
20
20
  .xv-sc .xv-lr { padding-left: 0; padding-right: 0; }
21
21
  .xv-sl { margin: 0; }
22
22
  .xv-sl .cz-nd.tl { width: 14px; height: 14px; margin: 4px; border-radius: 3px; transform: rotate(45deg); border-style: solid; }
@@ -30,7 +30,7 @@
30
30
 
31
31
  /* the summary's meta: the owner's avatar and name, the workflow's icon and name */
32
32
  .xv-who { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
33
- .xv-av { width: 22px; height: 22px; border-radius: 50%; background: var(--cz-bluebg); color: var(--cz-blueink); font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex: none; }
33
+ .xv-av { width: 22px; height: 22px; border-radius: 50%; background: var(--cz-bluebg); color: var(--cz-blueink); font-size: var(--fs-1); font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex: none; }
34
34
  .xv-who .wfi { color: var(--cz-ink3); }
35
35
 
36
36
  /* the plan line (XipB .pl): your plan grey, past the plan amber dashed, Jira's pace blue dashed, a tick for today */
@@ -42,12 +42,12 @@
42
42
  .xv-pl .tk { position: absolute; top: 12px; width: 2px; height: 22px; margin-left: -1px; border-radius: 1px; background: var(--cz-ink); }
43
43
  .xv-pl .tk.am { background: var(--cz-dot-risk); }
44
44
  .xv-pl .tk.e { background: var(--cz-blueink); }
45
- .xv-pl .lb { position: absolute; top: 38px; font-size: 11.5px; font-weight: 700; color: var(--cz-ink3); white-space: nowrap; }
45
+ .xv-pl .lb { position: absolute; top: 38px; font-size: var(--fs-1); font-weight: 700; color: var(--cz-ink3); white-space: nowrap; }
46
46
  .xv-pl .lb.tp { top: -2px; }
47
47
  .xv-pl .lb b { color: var(--cz-ink); font-weight: 800; }
48
48
  .xv-pl .lb.w, .xv-pl .lb.w b { color: var(--cz-risk); }
49
49
  .xv-pl .lb.e, .xv-pl .lb.e b { color: var(--cz-blueink); }
50
- .xv-lg { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--cz-ink3); font-weight: 600; }
50
+ .xv-lg { display: flex; gap: 14px; flex-wrap: wrap; font-size: var(--fs-1); color: var(--cz-ink3); font-weight: 600; }
51
51
  .xv-lg span { display: inline-flex; align-items: center; gap: 5px; }
52
52
  .xv-lg i { display: inline-block; width: 14px; height: 4px; border-radius: 2px; background: var(--cz-well2); }
53
53
  .xv-lg i.over { background: repeating-linear-gradient(90deg, var(--cz-dot-risk) 0 4px, transparent 4px 6px); }
@@ -56,7 +56,7 @@
56
56
  .xv-lg i.today.am { background: var(--cz-dot-risk); }
57
57
 
58
58
  /* one row in a section (XvABoard .lr): a mark, a title, one quiet line; a ticket row is a press */
59
- .xv-lr { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 10px; border-radius: 12px; font: inherit; font-size: 13.5px; color: var(--cz-ink); background: none; border: 0; width: 100%; box-sizing: border-box; text-align: left; }
59
+ .xv-lr { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 10px; border-radius: 12px; font: inherit; font-size: var(--fs-3); color: var(--cz-ink); background: none; border: 0; width: 100%; box-sizing: border-box; text-align: left; }
60
60
  .xv-lr + .xv-lr { border-top: 1px solid var(--cz-hair); border-radius: 0; }
61
61
  button.xv-lr { cursor: pointer; }
62
62
  @media (hover: hover) { button.xv-lr:hover { background: color-mix(in srgb, var(--cz-well) 50%, var(--cz-card)); border-radius: 12px; } }
@@ -64,21 +64,21 @@ button.xv-lr:focus-visible { outline: 2px solid var(--cz-blue); outline-offset:
64
64
  .xv-lr .w { flex: 1; min-width: 0; }
65
65
  .xv-lr .w b { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
66
66
  .xv-lr .w b em { font-style: normal; font-weight: 800; color: var(--cz-ink2); }
67
- .xv-lr .w span { display: block; font-size: 12.5px; color: var(--cz-ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
68
- .xv-lr .r { font-size: 12.5px; color: var(--cz-ink3); font-weight: 600; white-space: nowrap; }
67
+ .xv-lr .w span { display: block; font-size: var(--fs-2); color: var(--cz-ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
68
+ .xv-lr .r { font-size: var(--fs-2); color: var(--cz-ink3); font-weight: 600; white-space: nowrap; }
69
69
  .xv-mk { width: 8px; height: 8px; border-radius: 50%; flex: none; }
70
70
  .xv-mk.warn { background: var(--cz-dot-risk); }
71
71
  .xv-mk.you { background: var(--cz-blue); }
72
72
  .xv-mk.done { background: var(--cz-done); }
73
73
 
74
74
  /* quiet words, chips, a small secondary press */
75
- .xv-q { margin: 0; font-size: 12.5px; color: var(--cz-ink3); line-height: 1.45; }
75
+ .xv-q { margin: 0; font-size: var(--fs-2); color: var(--cz-ink3); line-height: 1.45; }
76
76
  .xv-q b { color: var(--cz-ink2); }
77
77
  .xv-chips { display: flex; flex-wrap: wrap; gap: 6px; }
78
- .xv-chip { height: 30px; padding: 0 12px; border-radius: 999px; background: var(--cz-well); font: 700 12.5px var(--cz-sans); color: var(--cz-ink2); display: inline-flex; align-items: center; border: 0; }
78
+ .xv-chip { height: 30px; padding: 0 12px; border-radius: 999px; background: var(--cz-well); font: 700 var(--fs-2) var(--cz-sans); color: var(--cz-ink2); display: inline-flex; align-items: center; border: 0; }
79
79
  button.xv-chip { cursor: pointer; }
80
80
  button.xv-chip:focus-visible, .xv-mini:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; }
81
- .xv-mini { height: 30px; padding: 0 12px; border-radius: 999px; background: var(--cz-bluebg); color: var(--cz-blueink); font: 700 12.5px var(--cz-sans); border: 0; cursor: pointer; }
81
+ .xv-mini { height: 30px; padding: 0 12px; border-radius: 999px; background: var(--cz-bluebg); color: var(--cz-blueink); font: 700 var(--fs-2) var(--cz-sans); border: 0; cursor: pointer; }
82
82
 
83
83
 
84
84
  @media (max-width: 760px) {
@@ -6,6 +6,9 @@
6
6
  @font-face { font-family: 'Nunito'; font-style: normal; font-weight: 400 800; font-display: swap; src: url(/vendor/nunito-var.woff2) format('woff2'); }
7
7
 
8
8
  :root{
9
+ /* The type scale (R27; feedback batch 15 item 2): every font size in the cozy sheets is one of these six. Hierarchy comes from weight and
10
+ colour, never from a half pixel. 11 marks and badges · 12 meta · 14 body and rows · 16 group heads and phone rows · 20 page titles · 28 display. */
11
+ --fs-1: 11px; --fs-2: 12px; --fs-3: 14px; --fs-4: 16px; --fs-5: 20px; --fs-6: 28px;
9
12
  /* The Agreed design's palette (premium-agreed-design): every colour the cozy sheets use, one token each, defined only here.
10
13
  The light and dark .cz blocks and the page sheets (cozy-board, -home, -initiative, -viewer, bd-span.js) name these. */
11
14
  --cz-c-17191c: #17191C;
@@ -131,7 +134,7 @@
131
134
  --cz-late: var(--cz-c-e8a07a); --cz-latebg: var(--cz-c-3a2418); --cz-ok: var(--cz-c-8fcf9c); --cz-okbg: var(--cz-c-1f3324);
132
135
  --cz-risk: var(--cz-c-e3c46a); --cz-riskbg: var(--cz-c-3a3018); --cz-red: var(--cz-c-f09a92); --cz-redbg: var(--cz-c-3a1f1d);
133
136
  }
134
- body.cz { margin: 0; font-family: var(--cz-sans); color: var(--cz-ink); background: var(--cz-ground); background-attachment: fixed; -webkit-font-smoothing: antialiased; font-size: 14px; }
137
+ body.cz { margin: 0; font-family: var(--cz-sans); color: var(--cz-ink); background: var(--cz-ground); background-attachment: fixed; -webkit-font-smoothing: antialiased; font-size: var(--fs-3); }
135
138
  .cz .sky { display: none; }
136
139
  /* The old five-place rail is gone: premium-shell.js takes its markup out of the page, and this rule hides it until then. */
137
140
  .cz nav.rail { display: none !important; }
@@ -143,7 +146,7 @@ body.cz { margin: 0; font-family: var(--cz-sans); color: var(--cz-ink); backgrou
143
146
  .cz-fab svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
144
147
  .cz-fabm { box-sizing: border-box; width: 220px; padding: 8px; display: flex; flex-direction: column; gap: 2px; border-radius: 24px; background: var(--cz-card); border: 1px solid var(--cz-hair); box-shadow: 0 24px 60px -24px rgba(27,42,24,.45); }
145
148
  .cz-fabm[hidden] { display: none; }
146
- .cz-fabm a, .cz-fabm button { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 14px; font: inherit; font-size: 14px; color: var(--cz-ink2); text-decoration: none; background: none; border: 0; cursor: pointer; text-align: left; }
149
+ .cz-fabm a, .cz-fabm button { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 14px; font: inherit; font-size: var(--fs-3); color: var(--cz-ink2); text-decoration: none; background: none; border: 0; cursor: pointer; text-align: left; }
147
150
  .cz-fabm a:hover, .cz-fabm button:hover { background: var(--cz-well); }
148
151
  .cz-fabm [aria-current="page"] { background: var(--cz-bluebg); color: var(--cz-ink); font-weight: 700; }
149
152
  .cz-fabm .cz-set { border-top: 1px solid var(--cz-hair); margin-top: 4px; border-radius: 0 0 14px 14px; }
@@ -161,29 +164,29 @@ body.cz { margin: 0; font-family: var(--cz-sans); color: var(--cz-ink); backgrou
161
164
  .cz-fabw { left: auto; right: 18px; bottom: 24px; align-items: flex-end; }
162
165
  .cz-panel { margin: 0; border-radius: 0; min-height: 100vh; padding: 12px 12px 96px; box-shadow: none; }
163
166
  .cz-top { display: flex; align-items: center; gap: 6px; min-height: 48px; }
164
- .cz-top .cz-title { font-weight: 800; font-size: 16px; margin-left: 4px; margin-right: auto; }
167
+ .cz-top .cz-title { font-weight: 800; font-size: var(--fs-4); margin-left: 4px; margin-right: auto; }
165
168
  }
166
169
 
167
170
  /* ── Shared parts ── */
168
- .cz-pick { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px 0 12px; border-radius: 999px; background: var(--cz-well); font: inherit; font-size: 13.5px; font-weight: 800; color: var(--cz-ink); border: 0; cursor: pointer; }
171
+ .cz-pick { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px 0 12px; border-radius: 999px; background: var(--cz-well); font: inherit; font-size: var(--fs-3); font-weight: 800; color: var(--cz-ink); border: 0; cursor: pointer; }
169
172
  .cz-tabs { display: flex; gap: 2px; }
170
- .cz-tab { height: 34px; padding: 0 13px; border-radius: 999px; font: inherit; font-size: 14px; font-weight: 700; color: var(--cz-ink3); display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; cursor: pointer; }
173
+ .cz-tab { height: 34px; padding: 0 13px; border-radius: 999px; font: inherit; font-size: var(--fs-3); font-weight: 700; color: var(--cz-ink3); display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; cursor: pointer; }
171
174
  .cz-tab[aria-selected="true"] { background: var(--cz-well); color: var(--cz-ink); }
172
- .cz-tab .n { font-weight: 600; color: var(--cz-ink3); font-size: 12.5px; }
175
+ .cz-tab .n { font-weight: 600; color: var(--cz-ink3); font-size: var(--fs-2); }
173
176
  .cz-ib { width: 38px; height: 38px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; color: var(--cz-ink2); background: none; border: 0; cursor: pointer; flex: none; padding: 0; }
174
177
  .cz-ib:hover { background: var(--cz-well); }
175
178
  .cz-ib svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
176
179
  .cz-ib.solid { background: var(--cz-ink); color: var(--cz-card); }
177
180
  .cz-seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--cz-well); gap: 2px; }
178
- .cz-seg button { height: 30px; min-width: 34px; padding: 0 11px; border-radius: 999px; font: inherit; font-size: 12.5px; font-weight: 700; color: var(--cz-ink3); background: none; border: 0; cursor: pointer; }
181
+ .cz-seg button { height: 30px; min-width: 34px; padding: 0 11px; border-radius: 999px; font: inherit; font-size: var(--fs-2); font-weight: 700; color: var(--cz-ink3); background: none; border: 0; cursor: pointer; }
179
182
  .cz-seg button[aria-pressed="true"] { background: var(--cz-card); color: var(--cz-ink); box-shadow: 0 1px 3px rgba(42,46,53,.12); }
180
183
  .cz-vr { width: 1px; height: 20px; background: var(--cz-hair); margin: 0 4px; flex: none; }
181
- .cz-chip { height: 30px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--cz-hair); background: var(--cz-card); display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 12.5px; font-weight: 700; color: var(--cz-ink2); white-space: nowrap; cursor: pointer; }
184
+ .cz-chip { height: 30px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--cz-hair); background: var(--cz-card); display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: var(--fs-2); font-weight: 700; color: var(--cz-ink2); white-space: nowrap; cursor: pointer; }
182
185
  .cz-chip:hover { background: var(--cz-well); }
183
186
  .cz-chip.gh { border-color: transparent; background: transparent; padding: 0 8px; }
184
187
  .cz-chip.on { background: var(--cz-bluebg); border-color: transparent; color: var(--cz-blueink); }
185
188
  .cz-chip b { font-weight: 800; color: var(--cz-ink); }
186
- .cz-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 800; border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
189
+ .cz-pill { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-1); font-weight: 800; border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
187
190
  .cz-pill.late { background: var(--cz-latebg); color: var(--cz-late); } .cz-pill.ok { background: var(--cz-okbg); color: var(--cz-ok); }
188
191
  .cz-pill.q { background: var(--cz-well); color: var(--cz-ink3); } .cz-pill.you { background: var(--cz-bluebg); color: var(--cz-blueink); }
189
192
  .cz-pill.red { background: var(--cz-redbg); color: var(--cz-red); } .cz-pill.risk { background: var(--cz-riskbg); color: var(--cz-risk); }
@@ -226,9 +229,9 @@ body.cz { margin: 0; font-family: var(--cz-sans); color: var(--cz-ink); backgrou
226
229
  .cz-vw-tile { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--cz-bluebg); color: var(--cz-blueink); flex: none; }
227
230
  .cz-vw-tile svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
228
231
  .cz-vw-t { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 6px; } /* the kind in small grey before the bold title, on one line (AgHome) */
229
- .cz-vw-kind { margin: 0; flex: none; max-width: 45%; font-size: 12px; color: var(--cz-ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
232
+ .cz-vw-kind { margin: 0; flex: none; max-width: 45%; font-size: var(--fs-2); color: var(--cz-ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
230
233
  .cz-vw-kind:empty { display: none; }
231
- .cz-vw-title { margin: 0; min-width: 0; font-size: 15px; font-weight: 700; color: var(--cz-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
234
+ .cz-vw-title { margin: 0; min-width: 0; font-size: var(--fs-4); font-weight: 700; color: var(--cz-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
232
235
  .cz-vw-ib { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: var(--cz-ink2); background: none; border: 0; padding: 0; cursor: pointer; flex: none; font: inherit; }
233
236
  .cz-vw-ib svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
234
237
  .cz-vw-ib[data-cz-vw="close"] svg { stroke-width: 2; }
@@ -248,8 +251,8 @@ body.cz { margin: 0; font-family: var(--cz-sans); color: var(--cz-ink); backgrou
248
251
  .cz-ph-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--cz-card); color: var(--cz-ink3); flex: none; }
249
252
  .cz-ph-ic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
250
253
  .cz-ph-t { min-width: 0; }
251
- .cz-ph-l { margin: 0; font-size: 14px; font-weight: 700; color: var(--cz-ink2); }
252
- .cz-ph-n { margin: 2px 0 0; font-size: 12px; color: var(--cz-ink3); }
254
+ .cz-ph-l { margin: 0; font-size: var(--fs-3); font-weight: 700; color: var(--cz-ink2); }
255
+ .cz-ph-n { margin: 2px 0 0; font-size: var(--fs-2); color: var(--cz-ink3); }
253
256
 
254
257
  /* ── slide editor on the cozy pages (moved from premium-vw-slides.css, which stays on the console type scale) ── */
255
258
  /* ── the cozy pages (premium-agreed-design, area viewer): the console tokens this sheet names, mapped to the cozy tokens of cozy.css,
@@ -257,12 +260,12 @@ body.cz { margin: 0; font-family: var(--cz-sans); color: var(--cz-ink); backgrou
257
260
  .cz .sl,.cz .sl-pres,.cz .sl-pop,.cz.sl-audw{--hair:var(--cz-hair);--ink:var(--cz-ink);--ink-2:var(--cz-ink2);--ink-3:var(--cz-ink3);--ember:var(--cz-blue);--card:var(--cz-card);--card-solid:var(--cz-card);
258
261
  --well:var(--cz-well);--solid:var(--cz-blueink);--on-solid:var(--cz-card);--spot:var(--cz-bluebg);--bad:var(--cz-red);--sans:var(--cz-sans);--mono:var(--cz-mono);--card-shadow:var(--cz-lift)}
259
262
  /* the report slide kicker (ReportPanel.dc.html): 20px, 700 */
260
- .sl-cv[data-th="report"] .r-kicker .sl-tx{display:inline-block;width:auto;height:auto;padding:6px 16px;border-radius:8px;background:var(--sso);color:var(--sfg);font-size:20px;font-weight:700;letter-spacing:.06em}
263
+ .sl-cv[data-th="report"] .r-kicker .sl-tx{display:inline-block;width:auto;height:auto;padding:6px 16px;border-radius:8px;background:var(--sso);color:var(--sfg);font-size:var(--fs-5);font-weight:700;letter-spacing:.06em}
261
264
 
262
265
  /* testing fixes: a phone zooms the page into any field typed in under 16 px, and the page then sits off the screen's right edge with
263
266
  the keyboard open. On a touch screen every field is at least 16 px. */
264
267
  @media (hover: none) and (pointer: coarse) {
265
- input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), textarea, select { font-size: 16px !important; }
268
+ input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), textarea, select { font-size: var(--fs-4) !important; }
266
269
  }
267
270
  /* testing fixes: nothing may widen the page on a phone (a menu past the right edge made the whole page zoom out) */
268
271
  /* on body only: an overflow set on html stops body.cz-home's overflow:hidden from reaching the viewport, and the whole page then scrolls */
@@ -1,9 +1,9 @@
1
1
  /* hi-pop.css — the initiative's popovers, menus and the toast with Undo (pm/hi-pop.js), the same on Home and the Board (feedback batch 14
2
2
  * item 5). Moved out of home-ini.css, which Home loads after this sheet, so Home's phone rules still win. Every class starts with hi-. */
3
3
  /* buttons, as the canvas draws them */
4
- .hi-btn { height: 36px; padding: 0 14px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 13.5px; font-weight: 700; border: 1px solid var(--cz-hair); background: var(--cz-card); color: var(--cz-ink); white-space: nowrap; cursor: pointer; }
4
+ .hi-btn { height: 36px; padding: 0 14px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: var(--fs-3); font-weight: 700; border: 1px solid var(--cz-hair); background: var(--cz-card); color: var(--cz-ink); white-space: nowrap; cursor: pointer; }
5
5
  .hi-btn svg { flex: none; }
6
- .hi-btn.sm { height: 30px; padding: 0 11px; font-size: 12.5px; }
6
+ .hi-btn.sm { height: 30px; padding: 0 11px; font-size: var(--fs-2); }
7
7
  .hi-btn.dark { background: var(--cz-ink); border-color: transparent; color: var(--cz-card); }
8
8
  .hi-btn.ghost { border-color: transparent; background: transparent; color: var(--cz-ink2); }
9
9
  .hi-btn.ghost:hover { background: var(--cz-well); }
@@ -13,7 +13,7 @@
13
13
  .hi-ib.solid { background: var(--cz-ink); color: var(--cz-card); }
14
14
  .hi-ib.sm { width: 28px; height: 28px; }
15
15
  /* ── the popovers: Move anyway, Back, the menus ── */
16
- .hi-pop { position: fixed; z-index: 90; left: var(--hi-x, 24px); top: var(--hi-y, 24px); width: 360px; max-width: calc(100vw - 24px); box-sizing: border-box; background: var(--cz-card); color: var(--cz-ink); border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 10px; font-family: var(--cz-sans); font-size: 14px; box-shadow: 0 24px 60px -24px rgba(42,46,53,.45), 0 0 0 1px var(--cz-hair); }
16
+ .hi-pop { position: fixed; z-index: 90; left: var(--hi-x, 24px); top: var(--hi-y, 24px); width: 360px; max-width: calc(100vw - 24px); box-sizing: border-box; background: var(--cz-card); color: var(--cz-ink); border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 10px; font-family: var(--cz-sans); font-size: var(--fs-3); box-shadow: 0 24px 60px -24px rgba(42,46,53,.45), 0 0 0 1px var(--cz-hair); }
17
17
  .hi-pop.menu { width: 290px; padding: 8px; gap: 2px; }
18
18
  .hi-pop.sheet { left: 0; right: 0; top: auto; bottom: 0; width: auto; max-width: none; border-radius: 28px 28px 0 0; padding: 10px 16px 28px; box-shadow: 0 -20px 50px -20px rgba(42,46,53,.35); }
19
19
  .hi-pop.sheet .hi-btn { height: 48px; justify-content: center; }
@@ -21,14 +21,14 @@
21
21
  .hi-grab { width: 40px; height: 5px; border-radius: 3px; background: var(--cz-c-d9dce1); align-self: center; margin-bottom: 4px; }
22
22
  .hi-scrim { position: fixed; inset: 0; z-index: 89; background: rgba(42,46,53,.18); }
23
23
  .hi-pop p { margin: 0; }
24
- .hi-h3 { font-size: 15px; font-weight: 800; }
25
- .hi-lbl { margin: 0; font-size: 12px; font-weight: 800; color: var(--cz-ink3); }
26
- .hi-small { margin: 0; font-size: 12.5px; color: var(--cz-ink3); }
27
- .hi-warn { background: var(--cz-riskbg); color: var(--cz-risk); border-radius: 14px; padding: 12px 14px; font-size: 12.5px; }
24
+ .hi-h3 { font-size: var(--fs-4); font-weight: 800; }
25
+ .hi-lbl { margin: 0; font-size: var(--fs-2); font-weight: 800; color: var(--cz-ink3); }
26
+ .hi-small { margin: 0; font-size: var(--fs-2); color: var(--cz-ink3); }
27
+ .hi-warn { background: var(--cz-riskbg); color: var(--cz-risk); border-radius: 14px; padding: 12px 14px; font-size: var(--fs-2); }
28
28
  .hi-field { display: flex; flex-direction: column; gap: 6px; }
29
- .hi-field > span { font-size: 12.5px; font-weight: 800; color: var(--cz-ink2); }
29
+ .hi-field > span { font-size: var(--fs-2); font-weight: 800; color: var(--cz-ink2); }
30
30
  .hi-field em { font-style: normal; font-weight: 600; color: var(--cz-ink3); }
31
- .hi-field input, .hi-field textarea { box-sizing: border-box; width: 100%; border: 0; border-radius: 14px; background: var(--cz-well); color: var(--cz-ink); font: inherit; font-size: 14px; padding: 10px 14px; outline: 0; }
31
+ .hi-field input, .hi-field textarea { box-sizing: border-box; width: 100%; border: 0; border-radius: 14px; background: var(--cz-well); color: var(--cz-ink); font: inherit; font-size: var(--fs-3); padding: 10px 14px; outline: 0; }
32
32
  .hi-field input { height: 42px; }
33
33
  .hi-field textarea { min-height: 56px; resize: vertical; }
34
34
  .hi-acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
@@ -36,20 +36,20 @@
36
36
  .hi-chips .cz-chip[aria-pressed="true"] { background: var(--cz-bluebg); border-color: transparent; color: var(--cz-blueink); }
37
37
  .hi-cks { display: flex; flex-direction: column; gap: 4px; }
38
38
  .hi-pop:not(.sheet) .hi-cks { display: none; } /* the card shows the items; the phone's sheet repeats them (InPhone) */
39
- .hi-ck { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--cz-ink2); padding: 2px 0; }
39
+ .hi-ck { display: flex; align-items: center; gap: 8px; font-size: var(--fs-2); color: var(--cz-ink2); padding: 2px 0; }
40
40
  .hi-ck i { width: 16px; height: 16px; border-radius: 5px; border: 2px solid var(--cz-c-c5c9d0); box-sizing: border-box; display: inline-grid; place-items: center; flex: none; color: var(--cz-card); }
41
41
  .hi-ck.on i { background: var(--cz-ink); border-color: var(--cz-ink); }
42
- .hi-mlbl { margin: 0; font-size: 12px; font-weight: 800; color: var(--cz-ink3); padding: 8px 12px 4px; }
42
+ .hi-mlbl { margin: 0; font-size: var(--fs-2); font-weight: 800; color: var(--cz-ink3); padding: 8px 12px 4px; }
43
43
  .hi-hr { height: 1px; background: var(--cz-hair); margin: 4px 0; }
44
- .hi-mi { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border-radius: 12px; font: inherit; font-size: 14px; font-weight: 600; color: var(--cz-ink); width: 100%; border: 0; background: none; cursor: pointer; text-align: left; }
44
+ .hi-mi { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border-radius: 12px; font: inherit; font-size: var(--fs-3); font-weight: 600; color: var(--cz-ink); width: 100%; border: 0; background: none; cursor: pointer; text-align: left; }
45
45
  .hi-mi:hover, .hi-mi.on { background: var(--cz-well); }
46
46
  .hi-mi span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
47
- .hi-mi em { font-style: normal; margin-left: auto; font-size: 12px; color: var(--cz-ink3); font-weight: 600; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
47
+ .hi-mi em { font-style: normal; margin-left: auto; font-size: var(--fs-2); color: var(--cz-ink3); font-weight: 600; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
48
48
  .hi-mi:disabled { opacity: .45; cursor: default; }
49
49
  .hi-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
50
50
 
51
51
  /* the toast with Undo: info, so it does not move */
52
- .hi-toast { position: fixed; z-index: 95; left: 50%; bottom: 40px; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 6px 6px 6px 16px; border-radius: 999px; background: var(--cz-ink); color: var(--cz-card); font-family: var(--cz-sans); font-size: 13px; box-shadow: 0 10px 30px -10px rgba(0,0,0,.4); max-width: calc(100vw - 32px); }
52
+ .hi-toast { position: fixed; z-index: 95; left: 50%; bottom: 40px; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 6px 6px 6px 16px; border-radius: 999px; background: var(--cz-ink); color: var(--cz-card); font-family: var(--cz-sans); font-size: var(--fs-3); box-shadow: 0 10px 30px -10px rgba(0,0,0,.4); max-width: calc(100vw - 32px); }
53
53
  .hi-toast[hidden] { display: none; }
54
54
  .hi-toast span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
55
55
  .hi-toast button { height: 32px; padding: 0 12px; border-radius: 999px; border: 0; background: rgba(255,255,255,.14); color: inherit; font: inherit; font-weight: 700; cursor: pointer; flex: none; }
@@ -61,14 +61,14 @@
61
61
  .hi-wfh { display: flex; align-items: center; gap: 8px; }
62
62
  .hi-wfh .hi-h3 { flex: 1; min-width: 0; }
63
63
  .hi-wfrows { display: flex; flex-direction: column; }
64
- .hi-wfrow { display: grid; grid-template-columns: minmax(0, 130px) 14px minmax(0, 130px) minmax(0, 1fr); align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--cz-hair); font-size: 13.5px; }
64
+ .hi-wfrow { display: grid; grid-template-columns: minmax(0, 130px) 14px minmax(0, 130px) minmax(0, 1fr); align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--cz-hair); font-size: var(--fs-3); }
65
65
  .hi-wfrow:first-child { border-top: 0; }
66
66
  .hi-wfrow span { min-width: 0; }
67
- .hi-wfrow em { display: block; font-style: normal; font-size: 12px; color: var(--cz-ink3); }
67
+ .hi-wfrow em { display: block; font-style: normal; font-size: var(--fs-2); color: var(--cz-ink3); }
68
68
  .hi-wfland { display: flex; align-items: center; gap: 8px; }
69
69
  .hi-wfland span { flex: 1; }
70
- .hi-wfland select { font: inherit; font-size: 13px; font-weight: 700; color: var(--cz-ink); background: var(--cz-well); border: 0; border-radius: 10px; padding: 6px 10px; max-width: 60%; }
71
- .hi-end { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px; background: var(--cz-well); font-size: 13px; }
70
+ .hi-wfland select { font: inherit; font-size: var(--fs-2); font-weight: 700; color: var(--cz-ink); background: var(--cz-well); border: 0; border-radius: 10px; padding: 6px 10px; max-width: 60%; }
71
+ .hi-end { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px; background: var(--cz-well); font-size: var(--fs-3); }
72
72
  .hi-end p { margin: 0; flex: 1; min-width: 0; color: var(--cz-ink2); }
73
73
  .hi-endi { display: inline-flex; color: var(--cz-ink3); }
74
74
  @media (max-width: 760px) {
@@ -79,4 +79,4 @@
79
79
  .hi-pop .wfi { display: inline-flex; align-items: center; justify-content: center; flex: none; border-radius: 6px; background: var(--cz-well); color: var(--cz-ink2); }
80
80
  .hi-pop .wfi svg { width: 70%; height: 70%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
81
81
  /* a small form in the Viewer (the Board's Add a stakeholder) */
82
- .hi-form { display: flex; flex-direction: column; gap: 12px; padding: 16px 20px 24px; font-size: 14px; color: var(--cz-ink); }
82
+ .hi-form { display: flex; flex-direction: column; gap: 12px; padding: 16px 20px 24px; font-size: var(--fs-3); color: var(--cz-ink); }
@@ -304,7 +304,8 @@ function day(on) {
304
304
  // a desktop has no Your day any more (batch 14 item 4): the greeting opens the calendar in the Viewer; the list already holds every next step.
305
305
  // A phone keeps Your day: its moment card (TfPhone) lives there
306
306
  if (!isPhone()) { S.day = false; openCalendar(); return; }
307
- const Y = YD.dayModel(S.M, S.D, L.reviewModel(S.D, NOW()), NOW());
307
+ const Y = YD.dayModel(S.M, S.D, L.reviewModel(S.D, NOW()), NOW(), { delightOk: delightOk() });
308
+ if (Y.mood === 'delighted') { try { localStorage.setItem(DELIGHT_KEY, new Date(NOW()).toDateString()); } catch { /* the face still shows */ } }
308
309
  const ph = isPhone() && PHC;
309
310
  const P = YD.dayParts(Y, { moment: !!ph });
310
311
  VW.open({ id: 'day', kind: 'Your day', title: 'Your day', icon: YD.DAY_ICON, more: [{ label: 'Open the calendar', on: () => openCalendar() }],
@@ -314,11 +315,36 @@ function day(on) {
314
315
  body.onclick = (e) => { // the rows are the list's own rows: the same presses open them
315
316
  const b = e.target.closest('button'); if (!b) return;
316
317
  if (b.dataset.hmSel) { select(b.dataset.hmSel); return; }
318
+ if (b.dataset.yd === 'sel') { const c = b.closest('.yd-call'); if (c) select(c.dataset.id); return; }
319
+ if (b.dataset.yd === 'retry' || b.dataset.yd === 'prep') { dayAct(b); return; }
317
320
  if ('hmReview' in b.dataset) { openReviewVw(); return; }
318
321
  if ('hdMeet' in b.dataset && Y.next) openMeeting(Y.next.meeting);
319
322
  };
320
323
  } });
321
324
  }
325
+ /* Delighted shows at most once a week (canvas note ydEBuild): the day it last showed, kept in this browser. Another day of this week says no. */
326
+ const DELIGHT_KEY = 'pmos-yd-delight';
327
+ function delightOk() {
328
+ let last = null; try { last = localStorage.getItem(DELIGHT_KEY); } catch { return true; }
329
+ if (!last) return true;
330
+ const d = new Date(last), n = new Date(NOW());
331
+ if (Number.isNaN(d.getTime()) || d.toDateString() === n.toDateString()) return true;
332
+ const monday = (x) => { const y = new Date(x.getFullYear(), x.getMonth(), x.getDate()); y.setDate(y.getDate() - ((y.getDay() + 6) % 7)); return y.getTime(); };
333
+ return monday(d) !== monday(n);
334
+ }
335
+ /** Your day's two real presses: ✓ on Claude's miss runs that task again (POST /api/proactive/day/decide retry); ✓ on "I haven't prepared
336
+ * today yet" is Prepare my day (POST /api/proactive/goals/plan). Then the day is read again and Your day redrawn. */
337
+ async function dayAct(b) {
338
+ if (b.disabled) return;
339
+ b.disabled = true;
340
+ const prep = b.dataset.yd === 'prep';
341
+ const r = await (prep ? pmPost('/api/proactive/goals/plan', { ws: WS || boardWs() || undefined }) : pmPost('/api/proactive/day/decide', { task: b.dataset.id, action: 'retry' })).catch(() => null);
342
+ if (!r || r.ok === false) { b.disabled = false; toast('That did not go through' + (r && r.error ? ': ' + r.error : '.')); return; }
343
+ toast(prep ? 'I’m on it. Your day fills in as I finish.' : 'Running it again.');
344
+ const pd = await pmGet('/api/phone-day').catch(() => null);
345
+ if (pd && pd.ok) S.D.phoneDay = pd;
346
+ if (S.day) { const c = VW.current(); if (c && c.id === 'day') day(true); }
347
+ }
322
348
  /* the list's filter (HvACDesk): Today, Kept or Done, behind the icon in the list's top bar */
323
349
  function filterMenu(b) {
324
350
  const M = S.M || L.homeList(S.D, { now: NOW() });
@@ -987,7 +1013,7 @@ function pickProduct(chip) {
987
1013
  PP.openPicker(chip, { P: S.D.pick, label: 'Products on Home', tones: pickTones(), lines: pickLine, onApply: async (on) => { const r = await PP.savePick(on); if (!r.ok) toast(r.error); } });
988
1014
  }
989
1015
  // a saved pick (from this chip or Settings): Home shows and reads the ticked products
990
- addEventListener('pp:changed', (e) => { if (WS) { location.assign('/premium.html'); return; } S.D.pick = e.detail; drawList(); toast('Saved. Home, Board and Insights show the products you picked.'); load(); });
1016
+ addEventListener('pp:changed', (e) => { if (WS) { location.assign('/premium.html'); return; } S.D.pick = e.detail; drawList(); toast('Saved. Home, Board and Intelligence show the products you picked.'); load(); });
991
1017
 
992
1018
  /* ── the Viewer: needs rows, the weekly update, the overview, files, people, routines ── */
993
1019
  let lastViewer = null;
@@ -1,64 +1,169 @@
1
1
  /* pm/home-day.js — Your day in the Viewer, shell A (initiative viewer-shell-a, V10; canvas XvAPhDay, was TfPhone and the HvAOpen sheet).
2
2
  *
3
- * "Good morning" opens Your day as an item in the Viewer, not as a sheet over the list: on a phone the shell is full screen, on a desktop
4
- * it sits beside the chat like any other item. The summary card says what is yours and the day's meetings; three sections fold:
5
- * Your move every row that is the PM's move now (homeList's move), open by default
6
- * Now a phone only: the moment card (TfPhone: own late tasks with Done, finished drafts, the recap), open by default
7
- * Next meeting the meeting on now or the next one today
8
- * This week the Weekly review
9
- * The calendar is under ⋯. dayModel is pure; dayParts turns it into the shell's summary and sections. Text from records goes through esc(). */
3
+ * "Good morning" opens Your day as an item in the Viewer (a phone only since batch 14 item 4). Batch 15 item 3 (design E, frames YdE1Ready,
4
+ * YdE2AllClear, YdE3Evening, YdE6BigDay, YdE7Rough): the opening card is Claude's small mood face and one first-person line, with chips for
5
+ * the work Claude really did; Your move holds only the calls that need the PM; the rest folds:
6
+ * Your move the calls only the PM can make (homeList's move rows with call: true), open by default
7
+ * Drafted for you the drafts of today's morning prep run (GET /api/phone-day finished) and the weekly update
8
+ * Can wait every other row that was "Your move" (tasks, brief items, Jira)
9
+ * Now the phone's moment card (home-phone-card.js), open by default
10
+ * This week the Weekly review
11
+ * Every claim comes from what PMOS holds: a meeting is "prepped" only when it has the agent's prep note, "drafted" only from today's run,
12
+ * a thank-you only from a real mention, a miss only from a failed task. No data, no line (zero is silence). The mood is never happier than
13
+ * the data: concerned when something failed or is blocked, delighted at most once a week, calm on a packed or ordinary day.
14
+ * Voice: Claude's Adlerian rules (canvas note ydAdler): thanks for contribution, no praise, no orders, say whose task it is, no blame,
15
+ * no "N days late". dayModel is pure; dayParts turns it into the shell's sections. Text from records goes through esc(). */
10
16
 
11
17
  import { todayOf, hm } from './home-data.js';
12
18
 
13
19
  const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
14
20
  const plural = (n, one, many) => n + ' ' + (n === 1 ? one : many);
21
+ const clip = (s, n) => { const t = String(s || '').replace(/\s+/g, ' ').trim(); return t.length > n ? t.slice(0, n - 1) + '…' : t; };
15
22
  export const DAY_ICON = 'M12 3l1.8 4.6L18 9l-4.2 1.4L12 15l-1.8-4.6L6 9l4.2-1.4z';
16
23
  const CLOCK = 'M12 4a8 8 0 1 0 0 16a8 8 0 1 0 0-16M12 8v4l3 2', CAL = 'M4 5h16v15H4zM8 3v4M16 3v4M4 10h16', CHEV = 'M10 7l5 5-5 5';
17
- const svg = (d, w = 15) => `<svg aria-hidden="true" width="${w}" height="${w}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="${d}"/></svg>`;
24
+ const CHECK = 'M5 12.5l4.5 4.5L19 7', OPEN = 'M14 4h6v6M20 4l-9 9M18 14v6H4V6h6';
25
+ const svg = (d, w = 15, 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>`;
18
26
 
19
27
  const span = (m) => { const a = Date.parse(m.start); const b = m.end ? Date.parse(m.end) : a + (m.minutes || 30) * 60000; return { a, b }; };
20
28
  const dur = (mins) => (mins >= 60 ? (Math.round(mins / 30) / 2).toString().replace(/\.0$/, '') + ' h' : mins + ' min');
29
+ const localDay = (ms) => new Date(ms).toDateString();
30
+ const PACKED = 5; // meetings in a day that make it a packed day (YdE6BigDay)
31
+ const THANKS = /\b(thank(s| you)?|thx|appreciate[ds]?)\b/i;
21
32
 
22
- /** Your day's words. M: homeList's model (move); D: Home's data (today's meetings); R: reviewModel. → { signal, text, move, next, week } */
23
- export function dayModel(M, D, R, now = Date.now()) {
33
+ /** The free stretches of 30 minutes or more between now (or 09:00) and 18:00, between today's meetings. [{ a, b }] in ms. */
34
+ export function gapsOf(t, now) {
35
+ const d0 = new Date(now); d0.setHours(9, 0, 0, 0); const d1 = new Date(now); d1.setHours(18, 0, 0, 0);
36
+ let at = Math.max(now, d0.getTime()); const out = [];
37
+ for (const m of t) { const s = span(m); if (s.b <= at) continue; if (s.a - at >= 30 * 60000) out.push({ a: at, b: Math.min(s.a, d1.getTime()) }); at = Math.max(at, s.b); }
38
+ if (d1.getTime() - at >= 30 * 60000) out.push({ a: at, b: d1.getTime() });
39
+ return out.filter((g) => g.b - g.a >= 30 * 60000);
40
+ }
41
+
42
+ /** A real thank-you to the PM today: the newest mention of today whose words thank them. { quote, who, where, at } or null. */
43
+ export function thanksOf(D, now) {
44
+ const L = (D && D.today && Array.isArray(D.today.mentions) ? D.today.mentions : []).filter((m) => m && m.text && THANKS.test(m.text) && (!m.at || localDay(Date.parse(m.at)) === localDay(now)));
45
+ const m = L[0];
46
+ return m ? { quote: clip(m.text, 160), who: m.who || '', where: m.source ? m.source.charAt(0).toUpperCase() + m.source.slice(1) : '', at: m.at ? hm(m.at) : '' } : null;
47
+ }
48
+
49
+ /** Your day's words. M: homeList's model (move); D: Home's data (today's meetings, phoneDay, the brief page's me and mentions);
50
+ * R: reviewModel. o: { delightOk: false when the delighted face showed on another day this week }.
51
+ * → { mood, line, sub, chips, misses, offer, calls, drafts, wait, done, next, week, thanks } */
52
+ export function dayModel(M, D, R, now = Date.now(), o = {}) {
53
+ D = D || {};
24
54
  const move = (M && M.move) || [];
25
- const t = todayOf(D || {}).filter((m) => m && m.start && !Number.isNaN(Date.parse(m.start))).sort((x, y) => Date.parse(x.start) - Date.parse(y.start));
55
+ const t = todayOf(D).filter((m) => m && m.start && !Number.isNaN(Date.parse(m.start))).sort((x, y) => Date.parse(x.start) - Date.parse(y.start));
26
56
  const mins = t.reduce((n, m) => { const s = span(m); return n + Math.max(0, Math.round((s.b - s.a) / 60000)); }, 0);
27
57
  const next = t.find((m) => m.state === 'now') || t.find((m) => m.state !== 'past' && span(m).b > now) || null;
28
- const lead = !t.length ? 'No meeting today.' : plural(t.length, 'meeting', 'meetings') + ', ' + dur(mins) + '. '
58
+ const meetText = !t.length ? 'No meeting today.' : plural(t.length, 'meeting', 'meetings') + ', ' + dur(mins) + '. '
29
59
  + (!next ? 'They are all over.' : next.state === 'now' ? (next.title || 'A meeting') + ' is on now.' : 'The ' + (next === t[0] ? 'first' : 'next') + ' is at ' + hm(next.start) + '.');
30
60
  const un = R && R.started && !R.done ? 'Step ' + (R.at + 1) + ' of 4' : '';
61
+
62
+ // what Claude really did: the agent's prep note on a meeting; today's run's drafts and sends
63
+ const PD = D.phoneDay || null, run = PD && PD.run ? PD.run : null;
64
+ const fin = (PD && Array.isArray(PD.finished) ? PD.finished : []);
65
+ const prepped = t.filter((m) => (m.prepared || []).some((x) => x && x.kind === 'prep')).length;
66
+ const drafted = fin.filter((x) => x.status !== 'sent').length, sent = fin.filter((x) => x.status === 'sent').length;
67
+ const chips = [prepped && plural(prepped, 'meeting prepped', 'meetings prepped'), drafted && plural(drafted, 'draft ready', 'drafts ready'), sent && sent + ' sent'].filter(Boolean);
68
+
69
+ const calls = move.filter((r) => r.call), drafts = [...fin.map((x) => ({ fin: x })), ...move.filter((r) => r.kind === 'update').map((r) => ({ row: r }))];
70
+ const wait = move.filter((r) => !r.call && r.kind !== 'update');
71
+ const misses = run ? (run.failed || []).map((f) => ({ id: f.id, title: f.title, why: f.error || '' })) : [];
72
+ const blocked = calls.filter((r) => r.state === 'blocked');
73
+ const rc = PD && PD.recap ? PD.recap : null;
74
+ const done = rc ? (rc.decided || 0) + (rc.done || 0) : 0;
75
+ const thanks = thanksOf(D, now);
76
+
77
+ const h = new Date(now).getHours(), name = D.today && D.today.me ? String(D.today.me) : '';
78
+ const hi = (h < 12 ? 'Morning' : h < 17 ? 'Afternoon' : 'Evening') + (name ? ', ' + name : '') + '.';
79
+ const gaps = gapsOf(t, now);
80
+ let mood = 'calm', line = hi, sub = meetText, offer = null;
81
+ if (misses.length || blocked.length) {
82
+ // concerned: said plainly, Claude's own miss first, then whose call it is (YdE7Rough)
83
+ mood = 'concerned';
84
+ line = 'Straight answer: ' + (misses.length ? (misses.length === 1 ? 'I couldn’t finish one of today’s drafts.' : 'I couldn’t finish ' + misses.length + ' of today’s drafts.')
85
+ : (blocked.length === 1 ? clip(blocked[0].name, 80) + ' is stuck.' : blocked.length + ' pieces of work are stuck.'));
86
+ sub = misses.length ? 'That one’s on me. I can run it again.' : 'It’s your call, so it’s first in Your move.';
87
+ } else if (!calls.length && done > 0 && o.delightOk !== false) {
88
+ // delighted: earned, at most once a week (YdE2AllClear)
89
+ mood = 'delighted'; line = 'That was everything that needed you today.';
90
+ sub = [rc.decided ? plural(rc.decided, 'decision of yours is', 'decisions of yours are') + ' on record' : '', rc.done ? plural(rc.done, 'item of yours is', 'items of yours are') + ' closed' : ''].filter(Boolean).join(', and ') + '.';
91
+ sub = sub.charAt(0).toUpperCase() + sub.slice(1);
92
+ } else if (t.length >= PACKED && h < 17) {
93
+ // a packed day: calm, Claude takes its share (YdE6BigDay)
94
+ line = plural(t.length, 'meeting', 'meetings') + ' today. You talk, I do the rest.';
95
+ sub = gaps.length === 1 ? hm(new Date(gaps[0].a).toISOString()) + ' is your only gap.' : gaps.length ? 'Your longest gap starts at ' + hm(new Date(gaps.slice().sort((x, y) => (y.b - y.a) - (x.b - x.a))[0].a).toISOString()) + '.' : 'No gap between them today.';
96
+ } else if (h >= 17 && (thanks || done > 0)) {
97
+ mood = 'glad'; line = hi;
98
+ sub = [t.length ? plural(t.length, 'meeting', 'meetings') + ' today.' : '', thanks && thanks.who ? thanks.who.split(/\s+/)[0] + ' thanked you.' : done ? 'Your work today moved things on.' : ''].filter(Boolean).join(' ');
99
+ } else if (run && !run.working && chips.length) {
100
+ mood = 'glad'; line = hi + ' My part’s done.'; sub = calls.length ? (calls.length === 1 ? 'One call is yours.' : 'The calls below are yours.') : 'Nothing needs your call right now.';
101
+ } else if (run && run.working) {
102
+ line = hi + ' I’m still on ' + plural(run.working, 'draft', 'drafts') + '.'; sub = meetText;
103
+ }
104
+ // no prep run today: say so, and offer it (Prepare my day); never claim work that did not happen
105
+ if (!run && h < 17) offer = { kind: 'prep', text: 'I haven’t prepared today yet.', sub: 'Shall I prep your meetings and draft what I can?' };
31
106
  return {
32
- signal: move.length ? { text: move.length === 1 ? '1 is yours' : move.length + ' are yours', tone: 'you' } : null, // zero is silence
33
- text: lead,
34
- move,
107
+ mood, line, sub, chips, misses, offer, calls, drafts, wait, done, thanks,
35
108
  next: next ? { meeting: next, now: next.state === 'now', time: hm(next.start), title: next.title || 'A meeting' } : null,
36
109
  week: { sub: un || 'Weekly review' },
37
110
  };
38
111
  }
39
112
 
40
- /* one row of Your move: the mark says what it is (a check box is a task, a dot waits on you, amber when blocked or late) */
41
- function moveRow(r) {
42
- const mark = r.check ? `<span class="hv-ck${r.late ? ' late' : ''}" role="img" aria-label="Your task${r.late ? ', late' : ''}"></span>`
43
- : `<span class="hv-d${r.state === 'blocked' ? ' am' : ''}" role="img" aria-label="${r.state === 'blocked' ? 'Blocked, waits on you' : 'Waits on you'}"></span>`;
113
+ /* Claude's small mood face (glad, delighted, calm, concerned): the frames' faces, drawn in currentColor on a tinted disc */
114
+ const MOUTH = {
115
+ glad: '<path d="M7.5 13.5c1.3 2.2 2.8 3.2 4.5 3.2s3.2-1 4.5-3.2" fill="none" stroke-width="1.6" stroke-linecap="round"/>',
116
+ delighted: '<path d="M7 13h10c-.6 3-2.6 4.6-5 4.6S7.6 16 7 13z" fill="currentColor" stroke-width="1.6" stroke-linejoin="round"/>',
117
+ calm: '<path d="M8.5 15c1 .9 2.2 1.3 3.5 1.3s2.5-.4 3.5-1.3" fill="none" stroke-width="1.6" stroke-linecap="round"/>',
118
+ concerned: '<path d="M7.6 7.6l2.4.9M16.4 7.6l-2.4.9" stroke-width="1.4" stroke-linecap="round"/><path d="M8.5 16.5c1-1.3 2.2-1.9 3.5-1.9s2.5.6 3.5 1.9" fill="none" stroke-width="1.6" stroke-linecap="round"/>',
119
+ };
120
+ export const faceHtml = (mood) => `<span class="yd-face ${esc(mood)}" role="img" aria-label="Claude is ${esc(mood)}"><svg width="32" height="32" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true"><circle cx="9" cy="10.5" r="1.3" fill="currentColor" stroke="none"/><circle cx="15" cy="10.5" r="1.3" fill="currentColor" stroke="none"/>${MOUTH[mood] || MOUTH.calm}</svg></span>`;
121
+ const ok = (act, label, id) => `<button type="button" class="yd-ok" data-yd="${esc(act)}"${id ? ` data-id="${esc(id)}"` : ''} aria-label="${esc(label)}" title="${esc(label)}">${svg(CHECK, 22, 2.6)}</button>`;
122
+ const alt = (act, label, id, icon) => `<button type="button" class="yd-alt" data-yd="${esc(act)}"${id ? ` data-id="${esc(id)}"` : ''} aria-label="${esc(label)}" title="${esc(label)}">${svg(icon || OPEN, 18, 2)}</button>`;
123
+
124
+ /** The opening card: face, line, sub, the chips of real work, and Claude's own misses with a ✓ to run them again. */
125
+ export function openHtml(Y) {
126
+ const chips = Y.chips.length ? `<div class="yd-chips">${Y.chips.map((c) => `<span class="yd-chip">${svg(CHECK, 14, 2.6)}${esc(c)}</span>`).join('')}</div>` : '';
127
+ const miss = Y.misses.map((m) => `<div class="yd-miss" data-id="${esc(m.id)}"><div class="yd-mt"><b>My miss: ${esc(m.title)}</b>${m.why ? `<em>${esc(m.why)}</em>` : ''}</div>${ok('retry', 'Run it again', m.id)}</div>`).join('');
128
+ return `<div class="yd-open ${esc(Y.mood)}"><div class="yd-hd">${faceHtml(Y.mood)}<div class="yd-ht"><b>${esc(Y.line)}</b>${Y.sub ? `<em>${esc(Y.sub)}</em>` : ''}</div></div>${chips}${miss}</div>`
129
+ + (Y.offer ? `<div class="yd-card yd-offer"><div class="yd-mt"><b>${esc(Y.offer.text)}</b><em>${esc(Y.offer.sub)}</em></div>${ok('prep', 'Prepare my day')}</div>` : '');
130
+ }
131
+
132
+ /* one call (YdE1Ready): the sentence, Claude's pick when it has one ("I'd …. It's your call."), and one quiet round icon that opens it */
133
+ function callHtml(r) {
134
+ const why = r.pick ? 'I’d ' + r.pick.charAt(0).toLowerCase() + r.pick.slice(1).replace(/\.?$/, '.') + ' It’s your call.' : r.when ? 'Goes out ' + r.when + '.' : r.sub || '';
135
+ return `<div class="yd-card yd-call${r.state === 'blocked' ? ' am' : ''}" data-id="${esc(r.id)}"><div class="yd-mt"><b>${esc(r.name)}</b>${why ? `<em>${esc(why)}</em>` : ''}</div>${alt('sel', 'Open: ' + r.name, '', CHEV)}</div>`;
136
+ }
137
+ /* one row that can wait: the list's own row, so a press opens what the list row opens; no "late" words (here and now) */
138
+ function waitRow(r) {
139
+ const mark = r.check ? '<span class="hv-ck" role="img" aria-label="Your task"></span>' : '<span class="hv-d" role="img" aria-label="Waits on you"></span>';
44
140
  const sub = r.when ? `<em>${svg(CLOCK, 13)} ${esc(r.when)}</em>` : r.sub ? `<em>${esc(r.sub)}</em>` : '';
45
141
  return `<div class="hm-r hv-r two" data-id="${esc(r.id)}"><button type="button" class="hm-rm" data-hm-sel="${esc(r.id)}"><span class="hv-mk">${mark}</span><span class="hm-rt"><b>${esc(r.name)}</b>${sub}</span></button></div>`;
46
142
  }
143
+ const DSTATE = { review: 'Ready for you at your desk', done: 'Finished', sent: 'Sent' };
144
+ function draftRow(d) {
145
+ if (d.row) return waitRow({ ...d.row, sub: d.row.sub || 'Drafted for you' });
146
+ const f = d.fin;
147
+ return `<div class="hm-r hv-r two yd-fin"><div class="hm-rm"><span class="hv-mk"><span class="yd-tick">${svg(CHECK, 13, 2.6)}</span></span><span class="hm-rt"><b>${esc(f.title)}</b><em>${esc(DSTATE[f.status] || 'Finished')}${f.summary ? ' · ' + esc(f.summary) : ''}</em></span></div></div>`;
148
+ }
47
149
 
48
- /** The shell's parts for Your day (czSummary and czSections take them). o: { moment: true on a phone with the moment card } → { summary, sections } */
150
+ /** The shell's parts for Your day (czSections takes them). o: { moment: true on a phone with the moment card } → { open, sections } */
49
151
  export function dayParts(Y, o = {}) {
50
152
  const sections = [];
51
- if (Y.move.length) sections.push({ id: 'move', title: 'Your move', count: Y.move.length, open: true, html: `<div class="hv-card hd-move">${Y.move.map(moveRow).join('')}</div>` });
52
- if (o.moment) sections.push({ id: 'now', title: 'Now', open: true, html: '<div class="hd-now"></div>' }); // kept: the frame has no slot for it; drawDay puts the card in
53
- if (Y.next) {
153
+ if (Y.calls.length) sections.push({ id: 'move', title: 'Your move', count: Y.calls.length, open: true, html: Y.calls.map(callHtml).join('') });
154
+ else if (Y.mood === 'delighted') sections.push({ id: 'move', title: 'Your move', open: true, html: '<div class="yd-card"><div class="yd-mt"><em>That was everything that needed you today.</em></div></div>' });
155
+ if (Y.drafts.length) sections.push({ id: 'drafts', title: 'Drafted for you', count: Y.drafts.length, html: `<div class="hv-card">${Y.drafts.map(draftRow).join('')}</div>` });
156
+ if (Y.wait.length) sections.push({ id: 'wait', title: 'Can wait', count: Y.wait.length, html: `<div class="hv-card hd-move">${Y.wait.map(waitRow).join('')}</div>` });
157
+ if (o.moment) sections.push({ id: 'now', title: 'Now', open: true, html: '<div class="hd-now"></div>' }); // drawDay puts the moment card in
158
+ else if (Y.next) {
54
159
  sections.push({ id: 'next', title: Y.next.now ? 'On now' : 'Next meeting', count: Y.next.now ? '' : Y.next.time, html: `<div class="hv-card"><div class="hm-r hv-r two"><button type="button" class="hm-rm" data-hd-meet><span class="hv-mk">${svg(CLOCK, 15)}</span><span class="hm-rt"><b>${esc(Y.next.title)}</b><em>${esc(Y.next.now ? 'On now' : Y.next.time)}</em></span><span class="hv-cv">${svg(CHEV, 16)}</span></button></div></div>` });
55
160
  }
56
161
  sections.push({ id: 'week', title: 'This week', count: Y.week.sub, html: `<div class="hv-card"><div class="hm-r hv-r two" data-id="review"><button type="button" class="hm-rm" data-hm-review aria-label="Weekly review: ${esc(Y.week.sub)}. Open"><span class="hv-mk">${svg(CAL, 16)}</span><span class="hm-rt"><b>Weekly review</b><em>${esc(Y.week.sub)}</em></span><span class="hv-cv">${svg(CHEV, 16)}</span></button></div></div>` });
57
- return { summary: { line: Y.signal ? Y.signal.text : '', tone: Y.signal ? Y.signal.tone : '', text: Y.text }, sections };
162
+ return { open: openHtml(Y), sections };
58
163
  }
59
164
 
60
- /** Draws Your day into the Viewer's body with the shell's summary and folds; moment(el) puts the phone's moment card in Now. */
165
+ /** Draws Your day into the Viewer's body: the opening card, then the folds; moment(el) puts the phone's moment card in Now. */
61
166
  export function drawDay(body, P, VW, moment) {
62
- body.innerHTML = VW.czSummary(P.summary) + VW.czSections(P.sections, { key: 'day' });
167
+ body.innerHTML = `<div class="yd">${P.open}${VW.czSections(P.sections, { key: 'day' })}</div>`;
63
168
  const now = body.querySelector('.hd-now'); if (now && moment) moment(now);
64
169
  }