create-pmos 0.398.0 → 0.400.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 (515) hide show
  1. package/package.json +30 -25
  2. package/payload/KIT-VERSION +1 -1
  3. package/payload/planning/evals/eval-calibration.md +1 -1
  4. package/payload/planning/okrs/health-budgets.md +1 -1
  5. package/payload/state/discoveries.md +1 -1
  6. package/workspace/briefing-premium-adddoc-test.js +19 -15
  7. package/workspace/briefing-premium-board-test.js +82 -50
  8. package/workspace/briefing-premium-calendar-2-test.js +36 -36
  9. package/workspace/briefing-premium-calendar-3-test.js +39 -39
  10. package/workspace/briefing-premium-calendar-test.js +23 -24
  11. package/workspace/briefing-premium-doc-edit-test.js +8 -10
  12. package/workspace/briefing-premium-initiative-test.js +38 -16
  13. package/workspace/briefing-premium-insights-test.js +114 -37
  14. package/workspace/briefing-premium-metrics-test.js +6 -4
  15. package/workspace/briefing-premium-products-test.js +10 -7
  16. package/workspace/briefing-premium-sources-test.js +25 -22
  17. package/workspace/briefing-premium-test.js +48 -43
  18. package/workspace/briefing-premium-work-test.js +16 -11
  19. package/workspace/c3-capture-test.js +0 -17
  20. package/workspace/changelog.json +29 -0
  21. package/workspace/ev-everywhere-test.js +210 -0
  22. package/workspace/fixtures/premium-viewer-fixtures.js +11 -6
  23. package/workspace/guide/briefing-premium.md +2 -2
  24. package/workspace/guide/home.md +58 -19
  25. package/workspace/guide/index.md +1 -1
  26. package/workspace/guide/layout.md +2 -2
  27. package/workspace/guide/notes.md +2 -2
  28. package/workspace/guide/phone-companion.md +1 -1
  29. package/workspace/lib/board-grill.js +63 -0
  30. package/workspace/lib/board-premium.js +36 -5
  31. package/workspace/lib/initiative-layout.js +77 -0
  32. package/workspace/lib/insights-premium.js +3 -2
  33. package/workspace/lib/insights-records.js +21 -7
  34. package/workspace/lib/meeting-points.js +52 -0
  35. package/workspace/lib/news-for-you.js +88 -0
  36. package/workspace/lib/notes-series.js +29 -6
  37. package/workspace/lib/report-confirm.js +48 -0
  38. package/workspace/lib/route-modules.js +9 -9
  39. package/workspace/lib/routes-board-docs.js +46 -0
  40. package/workspace/lib/routes-board-grill.js +90 -0
  41. package/workspace/lib/routes-home-review.js +108 -0
  42. package/workspace/lib/routes-initiative-layout.js +57 -0
  43. package/workspace/lib/routes-insights-premium.js +4 -1
  44. package/workspace/lib/routes-insights-records.js +8 -4
  45. package/workspace/lib/routes-meeting-points.js +37 -0
  46. package/workspace/lib/routes-news.js +57 -0
  47. package/workspace/lib/routes-notes.js +2 -1
  48. package/workspace/lib/routes-phone-day.js +18 -9
  49. package/workspace/lib/routes-report-confirm.js +31 -0
  50. package/workspace/lib/routes-search.js +38 -0
  51. package/workspace/lib/routes-slash.js +95 -0
  52. package/workspace/lib/search-index.js +176 -0
  53. package/workspace/package-lock.json +2 -2
  54. package/workspace/package.json +1 -2
  55. package/workspace/premium-board-actions-test.js +86 -50
  56. package/workspace/premium-briefing-depth-test.js +55 -54
  57. package/workspace/premium-chat-chart-tab-test.js +4 -2
  58. package/workspace/premium-chat-goal-view-test.js +1 -1
  59. package/workspace/premium-chat-report-tab-test.js +16 -2
  60. package/workspace/premium-chat-term-test.js +0 -10
  61. package/workspace/premium-core-doc-issue-test.js +15 -13
  62. package/workspace/premium-menu-rows-test.js +1 -1
  63. package/workspace/premium-phone-card-test.js +7 -5
  64. package/workspace/premium-report-read-test.js +55 -18
  65. package/workspace/premium-vw-backlog-test.js +2 -2
  66. package/workspace/premium-vw-cal-test.js +50 -35
  67. package/workspace/premium-vw-doc-test.js +10 -11
  68. package/workspace/premium-vw-item-test.js +1 -1
  69. package/workspace/premium-vw-jira-test.js +2 -2
  70. package/workspace/premium-vw-meet-test.js +37 -40
  71. package/workspace/premium-vw-notes-test.js +21 -19
  72. package/workspace/premium-vw-rec-test.js +11 -12
  73. package/workspace/premium-welcome-test.js +3 -3
  74. package/workspace/premium-work-depth-test.js +5 -6
  75. package/workspace/public/capture.html +23 -0
  76. package/workspace/public/pm/bd-acts.js +303 -225
  77. package/workspace/public/pm/bd-asks.js +261 -0
  78. package/workspace/public/pm/bd-pop.js +59 -0
  79. package/workspace/public/pm/bd-span.js +49 -13
  80. package/workspace/public/pm/bd-views.js +169 -0
  81. package/workspace/public/pm/c3-base.js +47 -0
  82. package/workspace/public/pm/c3-capture.js +1 -1
  83. package/workspace/public/pm/c3-ini-ui.js +1 -1
  84. package/workspace/public/pm/c3-sheet.js +1 -1
  85. package/workspace/public/pm/c3-toast.js +1 -1
  86. package/workspace/public/pm/console3.css +3 -0
  87. package/workspace/public/pm/cozy-board.css +301 -0
  88. package/workspace/public/pm/cozy-ev.css +228 -0
  89. package/workspace/public/pm/cozy-evmodel.js +106 -0
  90. package/workspace/public/pm/cozy-evui.js +47 -0
  91. package/workspace/public/pm/cozy-home.css +20 -5
  92. package/workspace/public/pm/cozy-insights.css +148 -10
  93. package/workspace/public/pm/cozy-nav.js +103 -39
  94. package/workspace/public/pm/cozy-news.js +140 -0
  95. package/workspace/public/pm/cozy-search.js +203 -0
  96. package/workspace/public/pm/cozy-settings.js +198 -0
  97. package/workspace/public/pm/cozy-sources.js +89 -0
  98. package/workspace/public/pm/cozy-today.css +220 -0
  99. package/workspace/public/pm/cozy-viewer.js +5 -2
  100. package/workspace/public/pm/cozy-vw-mtg.css +350 -0
  101. package/workspace/public/pm/cozy-vw-rp.css +152 -0
  102. package/workspace/public/pm/cozy.css +9 -0
  103. package/workspace/public/pm/goal-chat.js +5 -1
  104. package/workspace/public/pm/home-adddoc.js +5 -5
  105. package/workspace/public/pm/home-app.js +365 -70
  106. package/workspace/public/pm/home-around.js +24 -126
  107. package/workspace/public/pm/home-chat.js +77 -18
  108. package/workspace/public/pm/home-data.js +9 -7
  109. package/workspace/public/pm/home-dictate.js +57 -0
  110. package/workspace/public/pm/home-draft.js +6 -6
  111. package/workspace/public/pm/home-ini-model.js +190 -0
  112. package/workspace/public/pm/home-ini.css +171 -0
  113. package/workspace/public/pm/home-ini.js +466 -0
  114. package/workspace/public/pm/home-list.js +289 -0
  115. package/workspace/public/pm/home-more.js +18 -135
  116. package/workspace/public/pm/home-phone-card.js +13 -8
  117. package/workspace/public/pm/home-review.js +103 -0
  118. package/workspace/public/pm/home-task.js +67 -0
  119. package/workspace/public/pm/home-today.js +148 -0
  120. package/workspace/public/pm/home-work.js +63 -28
  121. package/workspace/public/pm/note-dock.js +1 -2
  122. package/workspace/public/pm/notes-links.js +1 -2
  123. package/workspace/public/pm/notes-task.js +3 -4
  124. package/workspace/public/pm/premium-board.js +164 -40
  125. package/workspace/public/pm/premium-chart-tab.js +4 -5
  126. package/workspace/public/pm/premium-first.js +5 -7
  127. package/workspace/public/pm/premium-initiative-head.js +3 -3
  128. package/workspace/public/pm/premium-insights.js +499 -202
  129. package/workspace/public/pm/premium-mtg-present.js +138 -0
  130. package/workspace/public/pm/premium-mtg-replay.js +142 -0
  131. package/workspace/public/pm/premium-report-read.js +216 -52
  132. package/workspace/public/pm/premium-report-tab.js +44 -19
  133. package/workspace/public/pm/premium-shell.js +7 -7
  134. package/workspace/public/pm/premium-vw-cal.js +150 -60
  135. package/workspace/public/pm/premium-vw-doc.css +20 -2
  136. package/workspace/public/pm/premium-vw-doc.js +22 -7
  137. package/workspace/public/pm/premium-vw-mtg.js +488 -261
  138. package/workspace/public/pm/premium-vw-notes.js +61 -0
  139. package/workspace/public/pm/rp-parts.js +269 -0
  140. package/workspace/public/pm/view-notes.js +2 -2
  141. package/workspace/public/premium-board.html +4 -3
  142. package/workspace/public/premium-insights.html +10 -10
  143. package/workspace/public/premium.html +3 -1
  144. package/workspace/r/m1.png +0 -0
  145. package/workspace/r/m2.png +0 -0
  146. package/workspace/r/m3.png +0 -0
  147. package/workspace/r/nl.png +0 -0
  148. package/workspace/replaced-tests.json +435 -0
  149. package/workspace/run-tests.js +323 -28
  150. package/workspace/server.js +15 -10
  151. package/workspace/test-files.json +3 -140
  152. package/workspace/test-lists/base.json +1 -2
  153. package/workspace/test-lists/c3-desktop-light-load.json +1 -2
  154. package/workspace/test-lists/c3-initiative-boards.json +1 -2
  155. package/workspace/test-lists/c3-meeting-focus.json +2 -12
  156. package/workspace/test-lists/c3-work-agent.json +1 -2
  157. package/workspace/test-lists/calendar-tidy-up.json +1 -2
  158. package/workspace/test-lists/console3-reports.json +1 -2
  159. package/workspace/test-lists/docs-three-way-sync.json +1 -2
  160. package/workspace/test-lists/extension-capture.json +5 -0
  161. package/workspace/test-lists/initiative-layout.json +9 -0
  162. package/workspace/test-lists/jira-wbs.json +1 -2
  163. package/workspace/test-lists/legacy-cleanup-a.json +9 -0
  164. package/workspace/test-lists/meeting-material.json +1 -2
  165. package/workspace/test-lists/meeting-notes.json +2 -36
  166. package/workspace/test-lists/meeting-replay.json +1 -2
  167. package/workspace/test-lists/mm-capture.json +2 -12
  168. package/workspace/test-lists/my-work.json +2 -10
  169. package/workspace/test-lists/onboarding-firstrun.json +2 -12
  170. package/workspace/test-lists/people-directory.json +1 -2
  171. package/workspace/test-lists/premium-uncovered-meetings.json +9 -0
  172. package/workspace/test-lists/premium-uncovered-reports.json +9 -0
  173. package/workspace/test-lists/run2-a.json +1 -2
  174. package/workspace/test-lists/run2-d.json +2 -19
  175. package/workspace/test-lists/run3-b.json +1 -2
  176. package/workspace/test-lists/run3-c.json +2 -12
  177. package/workspace/test-lists/run4-b.json +1 -2
  178. package/workspace/test-lists/run4-d.json +1 -5
  179. package/workspace/test-lists/run5-c.json +1 -11
  180. package/workspace/test-lists/run6.json +1 -5
  181. package/workspace/test-lists/uf-everywhere.json +15 -0
  182. package/workspace/test-lists/uf-home.json +9 -0
  183. package/workspace/test-lists/uncovered-board.json +9 -0
  184. package/workspace/test-lists/workspace-launch-flags.json +2 -12
  185. package/workspace/test-lists/workspace-profile-detection.json +2 -10
  186. package/workspace/test-timings.json +242 -123
  187. package/workspace/c3-briefing-test.js +0 -136
  188. package/workspace/c3-core-docs-test.js +0 -170
  189. package/workspace/c3-driver-fixture.js +0 -64
  190. package/workspace/c3-driver-test.js +0 -169
  191. package/workspace/c3-foundation-test.js +0 -163
  192. package/workspace/c3-ib-items-test.js +0 -114
  193. package/workspace/c3-ib-more-test.js +0 -146
  194. package/workspace/c3-ib-triage-backlog-test.js +0 -128
  195. package/workspace/c3-ini-harness.js +0 -66
  196. package/workspace/c3-ini-life-test.js +0 -167
  197. package/workspace/c3-initiatives-test.js +0 -186
  198. package/workspace/c3-light-load-test.js +0 -112
  199. package/workspace/c3-one-home-test.js +0 -149
  200. package/workspace/c3-phone-test.js +0 -289
  201. package/workspace/c3-quiet-test.js +0 -157
  202. package/workspace/c3-report-design-real-test.js +0 -264
  203. package/workspace/c3-report-design-test.js +0 -442
  204. package/workspace/c3-report-setup-test.js +0 -192
  205. package/workspace/c3-report-structure-real-test.js +0 -248
  206. package/workspace/c3-report-structure-test.js +0 -397
  207. package/workspace/c3-reports-test.js +0 -288
  208. package/workspace/c3-scan-test.js +0 -517
  209. package/workspace/c3-sessions-panel-test.js +0 -365
  210. package/workspace/c3-settings-test.js +0 -204
  211. package/workspace/c3-updates-test.js +0 -131
  212. package/workspace/c3-work-test.js +0 -260
  213. package/workspace/cut-stub.js +0 -40
  214. package/workspace/first-paint-audit.js +0 -160
  215. package/workspace/lib/c3-full-console.js +0 -15
  216. package/workspace/lib/engine/derived/trust.js +0 -3
  217. package/workspace/lib/engine/plan-forecast.js +0 -342
  218. package/workspace/lib/engine/report-families.js +0 -175
  219. package/workspace/lib/engine/truth-table.js +0 -57
  220. package/workspace/lib/routes-c3-init.js +0 -54
  221. package/workspace/lib/routes-c3-life.js +0 -120
  222. package/workspace/lib/routes-c3-timeline.js +0 -192
  223. package/workspace/lib/routes-forecast.js +0 -86
  224. package/workspace/lib/routes-releases.js +0 -130
  225. package/workspace/lib/routes-report-facts.js +0 -85
  226. package/workspace/lib/routes-report-families.js +0 -33
  227. package/workspace/lib/routes-signals.js +0 -51
  228. package/workspace/lib/routes-timeline.js +0 -197
  229. package/workspace/public/c3.html +0 -35
  230. package/workspace/public/index.html +0 -156
  231. package/workspace/public/pm/app.js +0 -831
  232. package/workspace/public/pm/bd-board.js +0 -159
  233. package/workspace/public/pm/bd-drag.js +0 -59
  234. package/workspace/public/pm/bd-model.js +0 -152
  235. package/workspace/public/pm/bd-timeline.js +0 -233
  236. package/workspace/public/pm/bd-tree.js +0 -244
  237. package/workspace/public/pm/board-copy.js +0 -59
  238. package/workspace/public/pm/board-read.js +0 -38
  239. package/workspace/public/pm/branches-sheet.js +0 -56
  240. package/workspace/public/pm/breakdown-api.js +0 -58
  241. package/workspace/public/pm/breakdown-copy.js +0 -138
  242. package/workspace/public/pm/briefing-deck.js +0 -441
  243. package/workspace/public/pm/briefing-model.js +0 -251
  244. package/workspace/public/pm/c3-ambient.js +0 -100
  245. package/workspace/public/pm/c3-audience-link.js +0 -21
  246. package/workspace/public/pm/c3-audience.js +0 -46
  247. package/workspace/public/pm/c3-boot.js +0 -13
  248. package/workspace/public/pm/c3-breakdown.js +0 -240
  249. package/workspace/public/pm/c3-brief-data.js +0 -11
  250. package/workspace/public/pm/c3-brief-mentions.js +0 -137
  251. package/workspace/public/pm/c3-brief-needs.js +0 -288
  252. package/workspace/public/pm/c3-brief-pulse.js +0 -112
  253. package/workspace/public/pm/c3-brief-summary.js +0 -139
  254. package/workspace/public/pm/c3-brief-today.js +0 -79
  255. package/workspace/public/pm/c3-brief.js +0 -279
  256. package/workspace/public/pm/c3-cal-strategy.js +0 -529
  257. package/workspace/public/pm/c3-calendar.js +0 -965
  258. package/workspace/public/pm/c3-calpop.js +0 -111
  259. package/workspace/public/pm/c3-case.js +0 -196
  260. package/workspace/public/pm/c3-core-docs.css +0 -18
  261. package/workspace/public/pm/c3-core-docs.js +0 -236
  262. package/workspace/public/pm/c3-daypart.js +0 -176
  263. package/workspace/public/pm/c3-demo-boards.js +0 -764
  264. package/workspace/public/pm/c3-demo-brief-ix.js +0 -350
  265. package/workspace/public/pm/c3-demo-brief-page.js +0 -70
  266. package/workspace/public/pm/c3-demo-cal-ix.js +0 -74
  267. package/workspace/public/pm/c3-demo-cal2.js +0 -66
  268. package/workspace/public/pm/c3-demo-cal3.js +0 -173
  269. package/workspace/public/pm/c3-demo-cal4.js +0 -169
  270. package/workspace/public/pm/c3-demo-cal5.js +0 -52
  271. package/workspace/public/pm/c3-demo-coredocs.js +0 -221
  272. package/workspace/public/pm/c3-demo-data.js +0 -552
  273. package/workspace/public/pm/c3-demo-focus.js +0 -181
  274. package/workspace/public/pm/c3-demo-init.js +0 -430
  275. package/workspace/public/pm/c3-demo-life.js +0 -77
  276. package/workspace/public/pm/c3-demo-material.js +0 -58
  277. package/workspace/public/pm/c3-demo-misc2.js +0 -34
  278. package/workspace/public/pm/c3-demo-phone.js +0 -48
  279. package/workspace/public/pm/c3-demo-plan2.js +0 -30
  280. package/workspace/public/pm/c3-demo-rd.js +0 -432
  281. package/workspace/public/pm/c3-demo-rep-ix.js +0 -126
  282. package/workspace/public/pm/c3-demo-rep2.js +0 -130
  283. package/workspace/public/pm/c3-demo-rep3.js +0 -138
  284. package/workspace/public/pm/c3-demo-rs.js +0 -287
  285. package/workspace/public/pm/c3-demo-term.js +0 -153
  286. package/workspace/public/pm/c3-demo-time.js +0 -49
  287. package/workspace/public/pm/c3-demo-work-ix.js +0 -32
  288. package/workspace/public/pm/c3-demo.js +0 -131
  289. package/workspace/public/pm/c3-design-studio.js +0 -369
  290. package/workspace/public/pm/c3-doc-formats.js +0 -153
  291. package/workspace/public/pm/c3-doc-sheet.js +0 -1230
  292. package/workspace/public/pm/c3-dock.js +0 -206
  293. package/workspace/public/pm/c3-docs.js +0 -291
  294. package/workspace/public/pm/c3-driver-work.js +0 -110
  295. package/workspace/public/pm/c3-driver.css +0 -18
  296. package/workspace/public/pm/c3-driver.js +0 -298
  297. package/workspace/public/pm/c3-focus.css +0 -304
  298. package/workspace/public/pm/c3-focus.js +0 -983
  299. package/workspace/public/pm/c3-ib-docs.js +0 -92
  300. package/workspace/public/pm/c3-ib-initiatives.js +0 -201
  301. package/workspace/public/pm/c3-ib-items.js +0 -210
  302. package/workspace/public/pm/c3-ib-releases.js +0 -48
  303. package/workspace/public/pm/c3-ib-sprints.js +0 -201
  304. package/workspace/public/pm/c3-ib-triage.js +0 -177
  305. package/workspace/public/pm/c3-ii-tabs.js +0 -252
  306. package/workspace/public/pm/c3-ini-life.css +0 -34
  307. package/workspace/public/pm/c3-ini-life.js +0 -379
  308. package/workspace/public/pm/c3-ini-records.js +0 -197
  309. package/workspace/public/pm/c3-ini-timeline.js +0 -278
  310. package/workspace/public/pm/c3-ini-work.js +0 -139
  311. package/workspace/public/pm/c3-init-extras.js +0 -170
  312. package/workspace/public/pm/c3-initiatives.js +0 -852
  313. package/workspace/public/pm/c3-lifecycle-panels.js +0 -479
  314. package/workspace/public/pm/c3-look.js +0 -27
  315. package/workspace/public/pm/c3-material.css +0 -22
  316. package/workspace/public/pm/c3-material.js +0 -321
  317. package/workspace/public/pm/c3-md.js +0 -3
  318. package/workspace/public/pm/c3-misc-panels.js +0 -89
  319. package/workspace/public/pm/c3-new-session.js +0 -110
  320. package/workspace/public/pm/c3-notes.js +0 -751
  321. package/workspace/public/pm/c3-phone-boot.js +0 -47
  322. package/workspace/public/pm/c3-phone-detail.js +0 -97
  323. package/workspace/public/pm/c3-phone-model.js +0 -3
  324. package/workspace/public/pm/c3-phone.css +0 -66
  325. package/workspace/public/pm/c3-phone.js +0 -444
  326. package/workspace/public/pm/c3-plan-panels.js +0 -163
  327. package/workspace/public/pm/c3-plan.js +0 -193
  328. package/workspace/public/pm/c3-quiet.css +0 -113
  329. package/workspace/public/pm/c3-quiet.js +0 -177
  330. package/workspace/public/pm/c3-replay.css +0 -133
  331. package/workspace/public/pm/c3-replay.js +0 -429
  332. package/workspace/public/pm/c3-report-deck.css +0 -163
  333. package/workspace/public/pm/c3-report-deck.js +0 -598
  334. package/workspace/public/pm/c3-report-frame.css +0 -20
  335. package/workspace/public/pm/c3-report-print.css +0 -20
  336. package/workspace/public/pm/c3-report-setup.css +0 -67
  337. package/workspace/public/pm/c3-report-setup.js +0 -298
  338. package/workspace/public/pm/c3-report-store.js +0 -244
  339. package/workspace/public/pm/c3-report-structure.css +0 -44
  340. package/workspace/public/pm/c3-report-structure.js +0 -473
  341. package/workspace/public/pm/c3-reports.css +0 -68
  342. package/workspace/public/pm/c3-reports.js +0 -377
  343. package/workspace/public/pm/c3-roadmap.js +0 -249
  344. package/workspace/public/pm/c3-scan-api.js +0 -167
  345. package/workspace/public/pm/c3-scan-next.js +0 -248
  346. package/workspace/public/pm/c3-scan-setup.js +0 -313
  347. package/workspace/public/pm/c3-scan-words.js +0 -41
  348. package/workspace/public/pm/c3-scan.css +0 -74
  349. package/workspace/public/pm/c3-scan.js +0 -93
  350. package/workspace/public/pm/c3-session-chat.js +0 -103
  351. package/workspace/public/pm/c3-session-conv.js +0 -165
  352. package/workspace/public/pm/c3-session-term.js +0 -216
  353. package/workspace/public/pm/c3-settings.css +0 -85
  354. package/workspace/public/pm/c3-settings.js +0 -1045
  355. package/workspace/public/pm/c3-shell.js +0 -628
  356. package/workspace/public/pm/c3-signals.js +0 -196
  357. package/workspace/public/pm/c3-strategy-panels.js +0 -45
  358. package/workspace/public/pm/c3-swipe.js +0 -230
  359. package/workspace/public/pm/c3-terminal-data.js +0 -48
  360. package/workspace/public/pm/c3-terminal-edge.js +0 -91
  361. package/workspace/public/pm/c3-terminal-icons.js +0 -40
  362. package/workspace/public/pm/c3-terminal-results.js +0 -141
  363. package/workspace/public/pm/c3-terminal.js +0 -52
  364. package/workspace/public/pm/c3-tickets.js +0 -163
  365. package/workspace/public/pm/c3-timeline.js +0 -201
  366. package/workspace/public/pm/calendar-views.js +0 -1049
  367. package/workspace/public/pm/console3-lift.md +0 -220
  368. package/workspace/public/pm/cozy-home.js +0 -172
  369. package/workspace/public/pm/cozy-initiative.css +0 -138
  370. package/workspace/public/pm/cycle-review.js +0 -125
  371. package/workspace/public/pm/data.js +0 -1577
  372. package/workspace/public/pm/dest-board.js +0 -444
  373. package/workspace/public/pm/dest-docs.js +0 -530
  374. package/workspace/public/pm/dest-initiatives.js +0 -162
  375. package/workspace/public/pm/dest-mywork.js +0 -307
  376. package/workspace/public/pm/dest-notes.js +0 -537
  377. package/workspace/public/pm/dest-people.js +0 -449
  378. package/workspace/public/pm/dest-reports.js +0 -383
  379. package/workspace/public/pm/dest-settings.js +0 -601
  380. package/workspace/public/pm/dest-today.js +0 -267
  381. package/workspace/public/pm/display-word.js +0 -56
  382. package/workspace/public/pm/doc-editor.js +0 -473
  383. package/workspace/public/pm/doc-graph.js +0 -272
  384. package/workspace/public/pm/doc-health-panel.js +0 -110
  385. package/workspace/public/pm/doc-rail.js +0 -167
  386. package/workspace/public/pm/doc-remote.js +0 -180
  387. package/workspace/public/pm/dock-sessions.js +0 -472
  388. package/workspace/public/pm/dock.js +0 -216
  389. package/workspace/public/pm/fixture.js +0 -821
  390. package/workspace/public/pm/flag-picker.js +0 -104
  391. package/workspace/public/pm/frame-copy.js +0 -278
  392. package/workspace/public/pm/freshness-line.js +0 -149
  393. package/workspace/public/pm/handoff-box.js +0 -82
  394. package/workspace/public/pm/initiative-list.js +0 -235
  395. package/workspace/public/pm/initiative-sheet.js +0 -331
  396. package/workspace/public/pm/initiatives-api.js +0 -95
  397. package/workspace/public/pm/initiatives-copy.js +0 -287
  398. package/workspace/public/pm/initiatives-timeline-copy.js +0 -59
  399. package/workspace/public/pm/initiatives-timeline.js +0 -410
  400. package/workspace/public/pm/initiatives-ui.js +0 -291
  401. package/workspace/public/pm/item-sheet.js +0 -268
  402. package/workspace/public/pm/keep-card.js +0 -204
  403. package/workspace/public/pm/lifecycle-lens-model.js +0 -246
  404. package/workspace/public/pm/lifecycle-lens.js +0 -276
  405. package/workspace/public/pm/lifecycle.js +0 -111
  406. package/workspace/public/pm/mobile.css +0 -366
  407. package/workspace/public/pm/mobile.js +0 -581
  408. package/workspace/public/pm/modes-live.js +0 -453
  409. package/workspace/public/pm/modes.js +0 -147
  410. package/workspace/public/pm/my-work-card.js +0 -51
  411. package/workspace/public/pm/my-work-data.js +0 -36
  412. package/workspace/public/pm/new-initiative-sheet.js +0 -169
  413. package/workspace/public/pm/next-step-ui.js +0 -190
  414. package/workspace/public/pm/outbox-panel.js +0 -125
  415. package/workspace/public/pm/palette-copy.js +0 -55
  416. package/workspace/public/pm/palette.js +0 -343
  417. package/workspace/public/pm/panel-breakdown.js +0 -702
  418. package/workspace/public/pm/panel-cockpit.js +0 -425
  419. package/workspace/public/pm/panel-detail.js +0 -1513
  420. package/workspace/public/pm/panel-initiatives.js +0 -929
  421. package/workspace/public/pm/panel-newsess.js +0 -709
  422. package/workspace/public/pm/panel-repos.js +0 -741
  423. package/workspace/public/pm/panel-tabs.js +0 -1506
  424. package/workspace/public/pm/panel-trees.js +0 -204
  425. package/workspace/public/pm/people-link.js +0 -106
  426. package/workspace/public/pm/phone-deck.js +0 -167
  427. package/workspace/public/pm/pm-work-view.js +0 -1533
  428. package/workspace/public/pm/portfolio-report.js +0 -61
  429. package/workspace/public/pm/premium-acts.js +0 -280
  430. package/workspace/public/pm/premium-brief.js +0 -111
  431. package/workspace/public/pm/premium-chat.js +0 -22
  432. package/workspace/public/pm/premium-doc-sheet.js +0 -312
  433. package/workspace/public/pm/premium-initiative.js +0 -324
  434. package/workspace/public/pm/premium-insights.css +0 -228
  435. package/workspace/public/pm/premium-metric-tiles.js +0 -68
  436. package/workspace/public/pm/premium-report-brief.js +0 -132
  437. package/workspace/public/pm/premium-vw-rec.js +0 -67
  438. package/workspace/public/pm/premium-wide.css +0 -30
  439. package/workspace/public/pm/print.css +0 -44
  440. package/workspace/public/pm/provider-cards.js +0 -136
  441. package/workspace/public/pm/registry.js +0 -203
  442. package/workspace/public/pm/release-card.js +0 -110
  443. package/workspace/public/pm/releases-view.js +0 -248
  444. package/workspace/public/pm/report-families-view.js +0 -505
  445. package/workspace/public/pm/report-slides.js +0 -438
  446. package/workspace/public/pm/report-tab.js +0 -33
  447. package/workspace/public/pm/report-view.js +0 -337
  448. package/workspace/public/pm/reports-copy.js +0 -134
  449. package/workspace/public/pm/roadmap.js +0 -294
  450. package/workspace/public/pm/run-card.js +0 -260
  451. package/workspace/public/pm/sessions-panel.js +0 -219
  452. package/workspace/public/pm/sheet-jira.js +0 -353
  453. package/workspace/public/pm/shell-bell.js +0 -163
  454. package/workspace/public/pm/shell-model.js +0 -83
  455. package/workspace/public/pm/shell-phone.js +0 -124
  456. package/workspace/public/pm/shell-readaloud.js +0 -53
  457. package/workspace/public/pm/shell-recording.js +0 -274
  458. package/workspace/public/pm/shell-ticker.js +0 -90
  459. package/workspace/public/pm/sig-watch.js +0 -41
  460. package/workspace/public/pm/slide-confirm.js +0 -163
  461. package/workspace/public/pm/slides-copy.js +0 -52
  462. package/workspace/public/pm/status-banner.js +0 -95
  463. package/workspace/public/pm/tab-doc.js +0 -859
  464. package/workspace/public/pm/tab-gone.js +0 -21
  465. package/workspace/public/pm/tab-term.js +0 -1210
  466. package/workspace/public/pm/tab-web.js +0 -90
  467. package/workspace/public/pm/timeline-copy.js +0 -48
  468. package/workspace/public/pm/timeline-forecast-view.js +0 -164
  469. package/workspace/public/pm/today-agenda.js +0 -331
  470. package/workspace/public/pm/today-cards.js +0 -244
  471. package/workspace/public/pm/today-copy.js +0 -506
  472. package/workspace/public/pm/today-day.js +0 -1371
  473. package/workspace/public/pm/today-goals.js +0 -297
  474. package/workspace/public/pm/today-jobs.js +0 -84
  475. package/workspace/public/pm/today-mentions.js +0 -50
  476. package/workspace/public/pm/topbar.js +0 -202
  477. package/workspace/public/pm/triage-card.js +0 -60
  478. package/workspace/public/pm/undo-hold.js +0 -103
  479. package/workspace/public/pm/view-addrepo.js +0 -208
  480. package/workspace/public/pm/view-files.js +0 -197
  481. package/workspace/public/pm/view-livenotes.js +0 -399
  482. package/workspace/public/pm/view-today.js +0 -13
  483. package/workspace/public/pm/view-validate.js +0 -171
  484. package/workspace/public/pm/welcome.js +0 -391
  485. package/workspace/public/pm/work-place.js +0 -68
  486. package/workspace/public/pm/xlsx-read.js +0 -117
  487. package/workspace/public/welcome.html +0 -22
  488. package/workspace/test-lists/browser-suites-green.json +0 -5
  489. package/workspace/test-lists/c3-core-docs.json +0 -9
  490. package/workspace/test-lists/c3-doc-sheet-rich.json +0 -6
  491. package/workspace/test-lists/c3-doc-sheet-size.json +0 -6
  492. package/workspace/test-lists/c3-doc-sheet-v2.json +0 -6
  493. package/workspace/test-lists/c3-ib-items.json +0 -9
  494. package/workspace/test-lists/c3-ib-more.json +0 -9
  495. package/workspace/test-lists/c3-ib-triage-backlog.json +0 -9
  496. package/workspace/test-lists/c3-ini-life.json +0 -9
  497. package/workspace/test-lists/c3-meeting-board.json +0 -5
  498. package/workspace/test-lists/c3-meeting-card.json +0 -5
  499. package/workspace/test-lists/c3-notes-place.json +0 -5
  500. package/workspace/test-lists/c3-notes-series.json +0 -5
  501. package/workspace/test-lists/calendar-time-page.json +0 -5
  502. package/workspace/test-lists/calpop.json +0 -4
  503. package/workspace/test-lists/console3-briefing.json +0 -9
  504. package/workspace/test-lists/console3-foundation.json +0 -9
  505. package/workspace/test-lists/console3-work-page.json +0 -9
  506. package/workspace/test-lists/premium-brief-parity.json +0 -9
  507. package/workspace/test-lists/report-design-studio-ui.json +0 -5
  508. package/workspace/test-lists/report-structure-ui.json +0 -11
  509. package/workspace/test-lists/report-workspace-ui.json +0 -5
  510. package/workspace/test-lists/run3-a.json +0 -5
  511. package/workspace/test-lists/run3-d.json +0 -6
  512. package/workspace/test-lists/run4-c.json +0 -13
  513. package/workspace/test-lists/today-goals-jobs-ui.json +0 -5
  514. package/workspace/test-lists/today-mentions-cards.json +0 -5
  515. package/workspace/test-lists/workspace-tabs-declutter.json +0 -13
@@ -1,288 +0,0 @@
1
- /* pm/c3-brief-needs.js — the Briefing's "Needs you" (PRD briefing-brief R3, R4, R6).
2
- * needsSection(S) the section: own items first (overdue, most late first; then due today; then outside PMOS), then the decisions only the PM
3
- * can make (c3-brief.js needRow): the briefing's `needs`. In real mode GET /api/briefing builds them (initiative briefing-real-data):
4
- * the assigned Jira and WBS items that are overdue, blocked, a decision or due today, the engine cards that carry a move or are
5
- * Critical (a row with `card`, drawn from the card), and the morning brief's worth asking items. Without `needs` (an older
6
- * server), the engine cards that carry a move or are Critical; the cards from the PM's own data (`origin`) are not decisions.
7
- * itemRow(row, ctx) a row of an own item. It opens in place (c3-expand). Its actions write to the item's home record, through the pm-items routes:
8
- * Done POST /api/pm-items/done { id, outcome? }
9
- * Not yet POST /api/pm-items/notyet { id, when: 'later-today' | 'tomorrow' | 'next-week' } the item returns on that date
10
- * Drop POST /api/pm-items/remove { id } (Undo: POST /api/pm-items/undo)
11
- * An outside-PMOS item (talk to, meet, call, ask) takes an optional one-line outcome. When PMOS holds evidence ("a meeting with Ana is
12
- * booked Tue 10:00") it asks "Looks done: ... Confirm?". It never marks the item done itself: only a press on Done or Confirm does.
13
- * The own-item rows are built again only when their keys change, so a re-read does not close an open row. An open row is kept in BX.open.
14
- *
15
- * ONE RANKING (initiative briefing-prioritization). The four sources above no longer sit in four lists. Each builds its rows into a pool; paint() asks
16
- * priority-model.js to rank them together: "Do these first" holds the hard lane (a Critical card, a promise to someone outside that is due) and the
17
- * best rows up to three, each with the reasons it ranks there; "Next up" holds the rest, folded after five; a line counts what the PM cannot act on now
18
- * (waiting, later, someday). The ranking reads the rows and writes nothing. */
19
- import { el } from './dom.js';
20
- import { c3ic } from './pm-work-view.js';
21
- import { pmPost } from './http.js';
22
- import { makeXp, attachExpand } from './c3-expand.js';
23
- import { needRow, belowLine, BX, toast, hooks } from './c3-brief.js';
24
- import { onBriefing, loadBriefing } from './shell-ticker.js';
25
- import { cardView, TAG_STYLE } from './briefing-model.js';
26
- import { onBriefPage } from './c3-brief-data.js';
27
- import { button, SEL, ensureComponentsCss } from './primitives.js';
28
- import { loadDriverNeeds, needsRow as driverRow } from './c3-driver.js';
29
- import { needsLoc } from './c3-core-docs.js';
30
- import { rank, fromOwn, fromDecision, fromAgent, heldLine, FIRST_N } from './priority-model.js';
31
-
32
- const reduced = () => typeof matchMedia === 'function' && matchMedia('(prefers-reduced-motion: reduce)').matches;
33
- const post = (path, body) => pmPost(path, body).catch(() => ({ ok: false }));
34
- export const WHEN = [['later-today', 'Later today'], ['tomorrow', 'Tomorrow'], ['next-week', 'Next week']];
35
- const WHEN_TOAST = { 'later-today': 'Back later today', tomorrow: 'Back tomorrow', 'next-week': 'Back next week' };
36
-
37
- function leave(row, then) {
38
- if (reduced()) { then(); return; }
39
- row.classList.add('leave'); setTimeout(then, 340);
40
- }
41
-
42
- export function itemRow(r, ctx = {}) {
43
- const key = r.key; const offline = !!r.offline;
44
- const tone = r.kind === 'overdue' ? 't-bad' : offline ? 't-ink' : 't-warn';
45
- ensureComponentsCss();
46
- const late = r.days_late > 0 ? (r.days_late === 1 ? '1 day late' : r.days_late + ' days late') : null;
47
- let row = null; let busy = false;
48
- const out = el('input', { type: 'text', class: 'ioutcome', 'data-outcome': '', maxlength: '160', placeholder: offline ? 'What happened? One line, optional' : 'Note, optional', 'aria-label': 'Outcome, optional' });
49
-
50
- const write = (call, okText, undo) => {
51
- if (busy) return; busy = true;
52
- call().then((res) => {
53
- busy = false;
54
- if (!res || res.ok === false) { toast('That did not go through' + (res && res.error ? ': ' + res.error : '.')); return; }
55
- BX.open.delete(key);
56
- leave(row, () => { row.remove(); if (ctx.changed) ctx.changed(); });
57
- toast(okText, undo ? () => { post(undo.path, undo.body).then(() => { if (ctx.reload) ctx.reload(); }); } : undefined);
58
- });
59
- };
60
- const done = (why) => {
61
- const o = out.value.trim() || why || '';
62
- write(() => post('/api/pm-items/done', { id: r.id, ...(o ? { outcome: o } : {}) }), 'Marked done', { path: '/api/pm-items/reopen', body: { id: r.id } });
63
- };
64
- const notYet = (when) => write(() => post('/api/pm-items/notyet', { id: r.id, when }), WHEN_TOAST[when]);
65
- const drop = () => write(() => post('/api/pm-items/remove', { id: r.id }), 'Dropped', { path: '/api/pm-items/undo', body: { id: r.id } });
66
-
67
- const btn = (label, act, fn, extra) => button({ label, onClick: (e) => { e.stopPropagation(); fn(); }, attrs: { 'data-act': act, ...(extra || {}) } });
68
- const panel = el('div', { class: 'ip', 'data-item-panel': r.id },
69
- r.evidence ? el('div', { class: 'looks', 'data-evidence': '', role: 'note' }, c3ic('eye', 'sm'), el('span', null, 'Looks done: ' + r.evidence.text + '. Confirm?'),
70
- btn('Yes, it is done', 'confirm', () => done('Confirmed: ' + r.evidence.text))) : null,
71
- out,
72
- el('div', { class: 'iacts' },
73
- btn('Done', 'done', () => done('')),
74
- el('span', { class: 'ny', role: 'group', 'aria-label': 'Not yet: ask again' }, el('span', { class: 'dim c3s2' }, 'Not yet, ask again:'),
75
- ...WHEN.map(([w, l]) => btn(l, 'notyet', () => notYet(w), { 'data-when': w }))),
76
- btn('Drop', 'drop', drop)));
77
- const xp = makeXp(panel);
78
- const chips = [late ? el('span', { class: 'st warn', 'data-late': String(r.days_late) }, c3ic('clock', 'sm'), late) : null,
79
- r.kind === 'due-today' ? el('span', { class: 'chip2' }, c3ic('clock', 'sm'), 'Due today') : null,
80
- offline ? el('span', { class: 'tag', 'data-offline': '' }, 'Outside PMOS') : el('span', { class: 'tag' }, 'Yours'),
81
- r.person ? el('span', { class: 'chip2' }, c3ic('user', 'sm'), r.person) : null,
82
- r.priority ? el('span', { class: 'fl ' + String(r.priority).toLowerCase() }, r.priority) : null,
83
- r.evidence ? el('span', { class: 'st ok', 'data-looks-done': '' }, c3ic('eye', 'sm'), 'Looks done') : null,
84
- el('span', { class: 'chip2', title: 'Where this lives', 'data-home-chip': '' }, c3ic('repo', 'sm'), 'Work')];
85
- row = el('li', { class: 'nrow', 'data-row': '', 'data-id': key, 'data-needs-row': key, 'data-item-id': r.id, 'data-ref-row': r.id, 'data-kind': r.kind, 'data-a': 'expand' },
86
- el('span', { class: 'ki ' + tone + (r.kind === 'overdue' ? ' hot' : ''), title: r.kind }, c3ic(r.kind === 'overdue' ? 'alert' : offline ? 'user' : 'clock')),
87
- el('div', { class: 'nb' }, el('span', { class: 'tt' }, r.headline), el('div', { class: 'chips' }, ...chips.filter(Boolean)), xp));
88
- attachExpand(row, xp, { key: 'item-' + key, initial: BX.open.has(key), onToggle: (on) => { if (on) BX.open.add(key); else BX.open.delete(key); } });
89
- return row;
90
- }
91
-
92
- /* The Needs you count for the Briefing tab's badge, read without the section: the decisions (the briefing's needs, or its engine cards that carry a move or are
93
- * Critical) plus the own items of the brief page. The section's own count (recount) takes over once it is on the page. */
94
- export function needsCount(b, page) {
95
- const decide = b && Array.isArray(b.needs) && b.needs.length ? b.needs.filter((n) => !BX.gone[n.key]).length : ((b && b.cards) || []).filter(isDecision).length;
96
- const own = page && page.ok !== false ? (page.needs || []).filter((r) => r.kind !== 'decision').length : 0;
97
- return decide + own;
98
- }
99
-
100
- /* an engine card a PM decides on; a card from the PM's own data (origin) is a reminder, and its row comes in `needs` instead */
101
- export const isDecision = (c) => !!c && !c.origin && !!(c.move || c.tag === 'Critical');
102
- /* a needs row that carries an engine card is drawn from the card, as the cards-only path draws it */
103
- export function fromCard(n, i) {
104
- if (!n || !n.card) return n;
105
- const v = cardView(n.card); const T = TAG_STYLE[v.tag] || TAG_STYLE['Just in'];
106
- return { key: n.key || v.key || String(i), headline: v.headline, kind: v.tag, icon: T.icon, color: T.color, time: v.deadline && v.deadline.text ? v.deadline.text : null, src: v.tag, view: v };
107
- }
108
-
109
- export function needsSection(S) {
110
- const count = el('span', { class: 'bdg g' }, '0');
111
- const quick = el('span', { class: 'chips2 dim mono c3s2', 'data-needs-summary': '' });
112
- const sumState = { dec: 0, own: 0, late: 0, quick: 0 };
113
- /* the pools: each source builds its rows here; paint() ranks them together and places them */
114
- const pool = { own: [], agent: [], dec: [] };
115
- const ownNote = el('div');
116
- const toWork = () => { if (hooks.go) hooks.go({ action: 'gowork' }); };
117
- const heldBtn = button({ label: '', variant: 'ghost', size: 'sm', onClick: toWork, attrs: { hidden: '', 'data-needs-held': '', title: 'Open Work to see them' } });
118
- const reviewBtn = button({ label: '', variant: 'ghost', size: 'sm', onClick: toWork, attrs: { hidden: '', 'data-needs-review': '', title: 'Open Work to review them' } });
119
- const firstHead = el('div', { class: 'dim mono c3s2', hidden: '', 'data-needs-firsthead': '' });
120
- const first = el('ul', { class: 'list', role: 'list', 'data-needs-first': '' });
121
- const nextHead = el('div', { class: 'dim mono c3s2', hidden: '', 'data-needs-nexthead': '' }, 'Next up');
122
- const list = el('ul', { class: 'list', role: 'list', 'data-needs-next': '' });
123
- const extra = el('div');
124
- const alertHost = el('div');
125
- const box = el('section', { class: 'card sect', 'data-c3pg': 'needs', 'aria-label': 'Needs you' },
126
- el('div', { class: 'sh2' }, el('h2', null, c3ic('inbox', 'sm'), 'Needs you ', count)), alertHost, ownNote, heldBtn, reviewBtn, firstHead, first, nextHead, list, extra);
127
- let sig = ''; let last = null; let ownSig = ''; let page = null; let held = null; let kept = null; let review = 0;
128
- const nothing = () => el('li', { class: 'fold' }, c3ic('check', 'sm'), 'Nothing needs you right now.');
129
- const setLabel = (b, t) => { const l = b.querySelector(SEL.btnLabel); if (l) l.textContent = t; };
130
- const rows = (host) => [...host.querySelectorAll('.nrow[data-needs-row]')];
131
- /* the header line: "3 decisions · 4 of yours · 2 overdue", then how many take under 2 minutes */
132
- const summarise = () => {
133
- const all = rows(box);
134
- const dec = all.filter((r) => r.dataset.needsSrc === 'decision').length;
135
- const ownRows = all.filter((r) => r.dataset.needsSrc === 'own'); const late = ownRows.filter((r) => r.dataset.kind === 'overdue').length;
136
- if (!quick.isConnected) box.querySelector('.sh2').append(quick);
137
- quick.replaceChildren(document.createTextNode(dec + (dec === 1 ? ' decision' : ' decisions') + ' · ' + ownRows.length + ' of yours'));
138
- if (late) quick.append(' · ', el('span', { class: 'tag bad' }, late + ' overdue'));
139
- const ag = all.filter((r) => r.dataset.needsSrc === 'agent').length;
140
- if (ag) quick.append(' · ' + ag + ' from the agent');
141
- if (sumState.quick) quick.append(' · ', c3ic('bolt', 'sm'), sumState.quick + ' under 2 min');
142
- };
143
- const recount = () => {
144
- const n = rows(box).length;
145
- summarise();
146
- count.textContent = String(n);
147
- if (S.setNeedsBdg) S.setNeedsBdg(n);
148
- if (S.tagNeeds) S.tagNeeds(box); // Mentions (c3-brief-mentions.js): the "mentioned you" tag on a worth-asking row
149
- if (S.briefRedraw) S.briefRedraw(); // The brief (c3-brief-summary.js) says what this section holds
150
- };
151
-
152
- /* the reasons a row ranks where it does: a line of chips under its title, each one a term of its own score */
153
- const chipLine = (x, info) => {
154
- const old = x.el.querySelector(':scope > .nb > [data-rank-chips]');
155
- if (old) old.remove();
156
- if (!info) return;
157
- const host = x.el.querySelector(':scope > .nb') || x.el;
158
- host.append(el('div', { class: 'chips rk', 'data-rank-chips': '' }, ...info.chips.map((c) => el('span', { class: 'chip2', 'data-term': c.term }, c.text))));
159
- };
160
- /* a group of three or more rows of one kind on one initiative: one row that opens to its members */
161
- const groupRow = (r, info, byKey) => {
162
- const members = (info.members || []).map((k) => byKey.get(k)).filter(Boolean);
163
- const body = el('ul', { class: 'list', role: 'list' }, ...members.map((m) => m.el));
164
- const li = el('li', { class: 'nrow', 'data-needs-group': r.key, 'data-needs-row': r.key, 'data-needs-src': 'group' },
165
- el('div', { class: 'nb' }, el('details', null, el('summary', { class: 'tt' }, r.title), body)));
166
- return li;
167
- };
168
- const place = (host, items) => host.replaceChildren(...items);
169
-
170
- /* rank every row together and place them: Do these first, then Next up (five shown, the rest folded) */
171
- const paint = () => {
172
- for (const k of Object.keys(pool)) pool[k] = pool[k].filter((x) => !(x.el.__placed && !x.el.isConnected)); // a row the PM finished is gone
173
- const all = [...pool.own, ...pool.agent, ...pool.dec];
174
- const byKey = new Map(all.map((x) => [x.rank.key, x]));
175
- const R = rank(all.map((x) => x.rank), { held });
176
- const draw = (r) => {
177
- const info = R.byKey.get(r.key);
178
- if (info && info.members) { const g = groupRow(r, info, byKey); g.__placed = true; return g; }
179
- const x = byKey.get(r.key);
180
- if (!x) return null;
181
- x.el.__placed = true; x.el.dataset.needsSrc = x.src; chipLine(x, info);
182
- return x.el;
183
- };
184
- const firstEls = R.first.map(draw).filter(Boolean);
185
- let rest = R.rest.slice();
186
- if (S.pinNeed) { const at = rest.findIndex((r) => r.key === S.pinNeed); if (at > 0) rest.unshift(...rest.splice(at, 1)); }
187
- const shown = rest.slice(0, 5).map(draw).filter(Boolean);
188
- const below = rest.slice(5).map(draw).filter(Boolean);
189
- firstEls.forEach((e, i) => { e.dataset.rank = String(i + 1); });
190
- shown.concat(below).forEach((e) => { delete e.dataset.rank; });
191
- place(first, firstEls);
192
- firstHead.hidden = !firstEls.length;
193
- const hard = R.hard.length;
194
- firstHead.textContent = 'Do these first' + (hard > FIRST_N ? ' · ' + hard + ' cannot wait' : '');
195
- nextHead.hidden = !(shown.length || below.length);
196
- place(list, shown);
197
- extra.replaceChildren(...belowLine(below, (e) => e, kept));
198
- const hl = heldLine(R.held);
199
- heldBtn.hidden = !hl; setLabel(heldBtn, hl ? 'Not on this list: ' + hl : '');
200
- reviewBtn.hidden = !(review > 0); setLabel(reviewBtn, review > 0 ? review + (review === 1 ? ' item' : ' items') + ' untouched for a week. Review them' : '');
201
- if (!firstEls.length && !shown.length && !below.length) first.replaceChildren(nothing());
202
- recount();
203
- };
204
-
205
- /* What The brief reads of this section: the rows on the page now, with what each row's data says. null until both reads came back. */
206
- const meta = new Map();
207
- S.needsSnapshot = () => {
208
- if (!last || !page || page.ok === false) return null;
209
- const ordered = rows(box);
210
- const decisions = ordered.filter((r) => r.dataset.needsSrc === 'decision').map((r) => {
211
- const k = r.dataset.needsRow; const m = meta.get(k) || {}; const tt = r.querySelector('.tt');
212
- return { key: k, headline: tt ? tt.textContent : '', time: m.time || null, decide: !!m.decide, overdue: !!m.overdue, days_late: m.days_late || 0 };
213
- });
214
- const own0 = ordered.filter((r) => r.dataset.needsSrc === 'own').map((r) => {
215
- const k = r.dataset.needsRow; const d = (page.needs || []).find((x) => x.key === k) || {}; const tt = r.querySelector('.tt');
216
- return { key: k, headline: tt ? tt.textContent : (d.headline || ''), kind: r.dataset.kind || d.kind, days_late: d.days_late || 0 };
217
- });
218
- return { decisions, own: own0, agentN: ordered.filter((r) => r.dataset.needsSrc === 'agent').length };
219
- };
220
- const ctx = { changed: paint };
221
-
222
- const fillOwn = (j) => {
223
- page = j;
224
- if (!j || j.ok === false) { ownNote.replaceChildren(el('p', { class: 'dim mono c3s2', role: 'status' }, 'Your own items could not be read: ' + ((j && j.error) || 'unreadable'))); return; }
225
- ownNote.replaceChildren();
226
- held = j.held && typeof j.held === 'object' ? j.held : null;
227
- review = Number(j.review) > 0 ? Number(j.review) : 0;
228
- const own = (j.needs || []).filter((r) => r.kind !== 'decision');
229
- const g = JSON.stringify([own.map((r) => [r.key, r.headline, r.days_late, !!r.evidence, !!r.flagged, r.days_to_due]), held, review]);
230
- if (g === ownSig) return; ownSig = g;
231
- const have = new Map(pool.own.map((x) => [x.rank.key, x]));
232
- const fresh = own.map((r) => { const old = have.get(r.key); return old && old.sig === JSON.stringify(r) ? old : { el: itemRow(r, { ...ctx, reload: () => import('./c3-brief-data.js').then((m) => m.loadBriefPage()) }), rank: fromOwn(r), src: 'own', sig: JSON.stringify(r) }; });
233
- pool.own = fresh;
234
- paint();
235
- };
236
-
237
- const fill = (b) => {
238
- last = b;
239
- const inc = !!S.incident;
240
- let needs = b && Array.isArray(b.needs) && b.needs.length ? b.needs.map(fromCard).filter((n) => !BX.gone[n.key] && (!inc || n.hard)) : null;
241
- const decide = ((b && b.cards) || []).filter(isDecision);
242
- const key = needs ? needs.map((n) => n.key + n.headline) : decide.map((c) => (c.key || '') + c.headline);
243
- const g = JSON.stringify([key, inc, !!(b && b.kept_out), S.pinNeed || '']);
244
- if (g === sig) return; sig = g;
245
- kept = !inc && b && b.kept_out ? b.kept_out : null;
246
- alertHost.replaceChildren(...(inc ? [el('div', { class: 'incident', role: 'status', 'data-c3pg': 'incident' }, c3ic('alert', 'lg'), el('div', null, el('b', null, 'Card payments failing since 07:40'), el('div', { class: 'dim c3s3' }, '12% of checkouts. Sam on call. Only deadlines shown.')))] : []));
247
- meta.clear();
248
- /* a decision only the PM can make: an engine card, or an assigned item marked Decide; an assigned item past its date is overdue */
249
- const rowsIn = needs || decide.map((c, i) => fromCard({ key: c.key || String(i), card: c }, i));
250
- rowsIn.forEach((n) => {
251
- const late = /^(\d+) days? overdue$/.exec(String(n.dueText || ''));
252
- meta.set(n.key, { time: n.time || null, decide: !!n.view || /^decide$/i.test(String(n.kind || '')), overdue: n.kind === 'Overdue', days_late: late ? Number(late[1]) : 0 });
253
- });
254
- const have = new Map(pool.dec.map((x) => [x.rank.key, x]));
255
- const make = (n, i) => { const old = have.get(String(n.key)); return old && old.sig === JSON.stringify([n.key, n.headline]) ? old : { el: needRow(n, i, ctx), rank: fromDecision(n), src: 'decision', sig: JSON.stringify([n.key, n.headline]) }; };
256
- if (needs) {
257
- sumState.quick = needs.filter((n) => n.quick).length;
258
- pool.dec = needs.map(make);
259
- } else {
260
- sumState.quick = 0;
261
- pool.dec = decide.map(cardView).map((v, i) => {
262
- const T = TAG_STYLE[v.tag] || TAG_STYLE['Just in'];
263
- return make({ key: v.key || String(i), headline: v.headline, kind: v.tag, icon: T.icon, color: T.color, time: v.deadline && v.deadline.text ? v.deadline.text : null, src: v.tag, view: v }, i);
264
- });
265
- }
266
- paint();
267
- };
268
- /* the agent's rows: drafts waiting on the PM, a target the PM is blocking. A press opens the initiative (its Overview holds the strip) or Work. */
269
- let agentSig = '';
270
- const goAgent = (n) => {
271
- const docsLoc = n.kind === 'core-doc-drafts' ? needsLoc(n) : null;
272
- if (docsLoc) { try { const u = new URL(location.href); u.searchParams.set('init', docsLoc); history.replaceState(history.state, '', u); } catch { /* no history */ } if (hooks.go) hooks.go({ action: 'goinit' }); try { window.dispatchEvent(new CustomEvent('pmos:ini-go', { detail: { loc: docsLoc } })); } catch { /* the page reads the address when it mounts */ } return; }
273
- if (n.initiative_id) { try { const u = new URL(location.href); u.searchParams.set('init', 'ini:' + encodeURIComponent(n.ws) + ':' + encodeURIComponent(n.initiative_id) + ':overview'); history.replaceState(history.state, '', u); } catch { /* no history */ } }
274
- if (hooks.go) hooks.go({ action: n.initiative_id ? 'goinit' : 'gowork' });
275
- };
276
- const fillAgent = () => loadDriverNeeds().then((rs) => {
277
- const g = JSON.stringify(rs.map((r) => [r.run_id, r.question, r.rank || null]));
278
- if (g === agentSig) return; agentSig = g;
279
- pool.agent = rs.map((r) => ({ el: driverRow(r, goAgent), rank: fromAgent(r), src: 'agent' }));
280
- paint();
281
- }, () => {});
282
- S.refreshNeeds = () => { sig = ''; if (last) fill(last); };
283
- S.needsFill = fill;
284
- onBriefing((b) => { S.brief = b; fill(b); fillAgent(); });
285
- onBriefPage(fillOwn);
286
- loadBriefing();
287
- return box;
288
- }
@@ -1,112 +0,0 @@
1
- /* pm/c3-brief-pulse.js — the Briefing's "Portfolio pulse" (PRD briefing-brief R5, R6).
2
- * One status bar and a row per initiative (the Calendar's own gantt rows, GET /api/calendar-views quarter, c3-plan.js readQuarter; the demo's pulse rows
3
- * carry their own colour and reason). A row opens in place with the case component the Needs you rows use (c3-expand + c3-case): why it is where it
4
- * is, promised against forecast. A press on a row does NOT change the tab. "Open initiative" is an explicit link inside the opened row and is the only
5
- * thing here that does. Rows are references (data-ref-row): nothing in them changes a record.
6
- * Jira (initiative briefing-real-data, R7): a gantt row with a `jira` field (its Jira epic's snapshot: done, total, blocked, as_of) shows even
7
- * without a promised date, as "x of y done" with a bar; a row with a plan keeps its look and adds the Jira line to its case. */
8
- import { el } from './dom.js';
9
- import { c3ic } from './pm-work-view.js';
10
- import { makeXp, attachExpand } from './c3-expand.js';
11
- import { caseFile, hooks } from './c3-brief.js';
12
- import { readQuarter } from './c3-plan.js';
13
- import { row, signal, button, meter, ensureComponentsCss } from './primitives.js';
14
- import { ensureSprite } from './icons.js';
15
-
16
- /* tone: ok is neutral, warn is the warning token, bad the destructive one (R28-12) */
17
- const PST = { 'on time': ['ok', 'On time'], 'at risk': ['warn', 'At risk'], delayed: ['bad', 'Delayed'], overdue: ['bad', 'Overdue'], 'no plan': ['', 'No plan'] };
18
- const RAG = { red: ['bad', 'Off track'], amber: ['warn', 'At risk'], green: ['ok', 'On track'], park: ['', 'Parked'] };
19
- const SIG = { bad: 'destructive', warn: 'warning' };
20
- const end = (o) => (o && (o.end || o.start)) || null;
21
-
22
- /* a usable Jira progress: at least one ticket under the epic */
23
- const jiraOf = (g) => (g && g.jira && Number.isInteger(g.jira.total) && g.jira.total > 0 && Number.isInteger(g.jira.done) ? g.jira : null);
24
- const jiraLines = (j) => {
25
- const ev = [['check', j.done + ' of ' + j.total + ' done in Jira' + (j.epics && j.epics.length ? ' (epic ' + j.epics.join(', ') + ')' : ''), 'Jira']];
26
- if (j.blocked > 0) ev.push(['alert', j.blocked + ' blocked', 'Jira', 'warn']);
27
- if (j.as_of) ev.push(['clock', 'Read from Jira ' + String(j.as_of).slice(0, 10), 'Jira']);
28
- return ev;
29
- };
30
-
31
- /** One gantt row as the pulse draws it: { id, title, cls, word, color, why, evidence, progress? }. Pure. */
32
- export function pulseRow(g) {
33
- const j = jiraOf(g);
34
- if (j && !g.pulse && (!PST[g.status] || g.status === 'no plan')) {
35
- /* no plan date: the row is the epic's progress (briefing-real-data R7) */
36
- const all = j.done >= j.total;
37
- const cls = j.blocked > 0 ? 'warn' : all ? 'ok' : '';
38
- const word = j.blocked > 0 ? 'Blocked' : all ? 'Done in Jira' : 'In progress';
39
- const why = j.done + ' of ' + j.total + ' done in Jira' + (j.blocked > 0 ? ', ' + j.blocked + ' blocked' : '') + '; no promised date';
40
- return { id: g.id, title: g.title || g.id, cls, word, why, evidence: jiraLines(j), progress: { done: j.done, total: j.total } };
41
- }
42
- const r = planRow(g);
43
- if (j) { r.evidence = r.evidence.concat(jiraLines(j)); r.progress = { done: j.done, total: j.total }; }
44
- return r;
45
- }
46
-
47
- /** The rows the Portfolio pulse draws from the Calendar's gantt rows: a row without a plan shows only when its Jira epic has progress. Pure. */
48
- export function pulseRows(gantt) {
49
- return (gantt || []).filter((g) => g.pulse || g.status !== 'no plan' || !!jiraOf(g)).map(pulseRow);
50
- }
51
-
52
- function planRow(g) {
53
- if (g.pulse && RAG[g.pulse.c]) {
54
- const [cls, word] = RAG[g.pulse.c];
55
- const ev = [];
56
- if (g.promised) ev.push(['target', 'Promised ' + g.promised, 'Plan', cls === 'bad' ? 'bad' : cls === 'warn' ? 'warn' : '']);
57
- return { id: g.id, title: g.title || g.id, cls, word, why: g.pulse.why, evidence: ev };
58
- }
59
- const k = PST[g.status] ? g.status : 'no plan'; const f = end(g.forecast); const p = g.promised || null;
60
- const why = p ? 'Forecast ' + (f || 'not set') + ' vs promised ' + p : 'No promised date' + (f ? '; forecast ' + f : '');
61
- const ev = [];
62
- if (p) ev.push(['target', 'Promised ' + p, 'Plan']);
63
- if (f) ev.push(['clock', 'Forecast ' + f, 'Plan', PST[k][0] === 'bad' ? 'bad' : PST[k][0] === 'warn' ? 'warn' : '']);
64
- if (g.slip_days > 0) ev.push(['alert', 'Slipping by ' + g.slip_days + ' d', 'Plan', 'warn']);
65
- return { id: g.id, title: g.title || g.id, cls: PST[k][0], word: PST[k][1] + (g.slip_days > 0 ? ' +' + g.slip_days + ' d' : ''), why, evidence: ev };
66
- }
67
-
68
- export function pulseCase(r) {
69
- return { id: 'pulse:' + r.id, tc: r.cls === 'bad' ? 'var(--destructive)' : r.cls === 'warn' ? 'var(--warning)' : 'var(--muted-foreground)', sit: r.why, chg: r.evidence, opts: [], go: ['goinit', r.id, 'Open initiative'], cta: '' };
70
- }
71
-
72
- export function pulse(S) {
73
- ensureComponentsCss();
74
- const body = el('div', null, el('p', { class: 'dim mono c3s2' }, 'Reading the initiatives.'));
75
- const attn = el('span', { class: 'mono dim pulse-attn', 'data-pulse-attn': '' }, 'promised vs forecast');
76
- ensureSprite();
77
- const all = button({ label: 'All initiatives', variant: 'ghost', size: 'sm', icon: 'arrow-right', attrs: { 'data-go': 'initiatives' }, onClick: () => { if (hooks.go) hooks.go({ action: 'goinit' }); } });
78
- const foot = el('div', { class: 'chips2 pulse-foot', 'data-pulse-foot': '' }, el('span', { class: 'dim c3s2' }, 'Tap a row to read why. Open it from there.'), all);
79
- foot.hidden = true;
80
- const box = el('section', { class: 'card pulsecard', 'data-c3pg': 'pulse', 'aria-label': 'Portfolio pulse' },
81
- el('div', { class: 'pulsehead' },
82
- el('h3', null, c3ic('init', 'sm'), 'Portfolio pulse'), attn), body, foot);
83
- const note = (t, ic) => el('div', { class: 'fold' }, c3ic(ic || 'moon', 'sm'), t);
84
- const draw = (rows, err, unplanned) => { // unplanned: rows the server left out because they have no plan (only=gantt)
85
- if (err) { body.replaceChildren(el('p', { class: 'dim mono c3s2', role: 'status' }, 'The initiatives could not be read: ' + err)); return; }
86
- if (!rows.length && !unplanned) { body.replaceChildren(note('No initiative has a promised date yet, so there is nothing to compare with the forecast.')); return; }
87
- const shown = (g) => g.pulse || g.status !== 'no plan' || !!jiraOf(g); // a row without a plan shows when its Jira epic has progress
88
- const noPlan = rows.filter((g) => !shown(g)).length + (Number(unplanned) || 0);
89
- rows = rows.filter(shown);
90
- if (!rows.length) { body.replaceChildren(note('No initiative has a promised date or a Jira epic read yet, so there is nothing to show.'), ...(noPlan ? [el('p', { class: 'dim mono c3s2' }, noPlan + ' initiatives have no plan date.')] : [])); return; }
91
- const pr = rows.map(pulseRow);
92
- S.pulseRows = pr; if (S.briefRedraw) S.briefRedraw(); // The brief (c3-brief-summary.js) names the rows off track or at risk
93
- const need = pr.filter((r) => r.cls === 'bad' || r.cls === 'warn').length;
94
- attn.textContent = need + ' need attention'; foot.hidden = false;
95
- const by = new Map(); pr.forEach((r) => { const k = r.word.replace(/ \+.*/, ''); const o = by.get(k) || { n: 0, cls: r.cls }; o.n += 1; by.set(k, o); });
96
- const bar = el('div', { class: 'pbs', role: 'group', 'aria-label': 'Status of initiatives' },
97
- ...[...by.entries()].map(([k, v]) => { const seg = el('span', { class: 'pb-seg pb-' + (v.cls || 'mute'), title: v.n + ' ' + k.toLowerCase(), 'aria-label': v.n + ' ' + k.toLowerCase() }); seg.style.setProperty('--fr-grow', String(v.n)); return seg; }));
98
- const rowEl = (r) => {
99
- const xp = makeXp(caseFile(pulseCase(r)));
100
- let ex = null;
101
- const bar = r.progress ? [el('span', { 'data-pulse-progress': r.progress.done + '/' + r.progress.total }, meter({ done: r.progress.done, total: r.progress.total, label: r.progress.done + ' of ' + r.progress.total + ' done' }))] : null;
102
- const head = row({ title: r.title, meta: [r.why], signals: [signal({ text: r.word, tone: SIG[r.cls] || 'muted' })], trail: bar, openLabel: r.title + ': ' + r.word, onOpen: () => ex.toggle(), openAttrs: { 'data-c3pg-prow': r.id } });
103
- ex = attachExpand(head, xp, { key: 'pulse-' + r.id });
104
- return el('div', { class: 'pwrap', 'data-ref-row': '', 'data-pulse-row': r.id }, head, xp);
105
- };
106
- body.replaceChildren(...[bar, el('div', null, ...pr.slice(0, 8).map(rowEl)), pr.length > 8 ? el('div', { class: 'dim mono c3s2' }, '+' + (pr.length - 8) + ' more in the Calendar tab') : null, noPlan ? el('div', { class: 'dim mono c3s2' }, noPlan + ' more have no plan date.') : null].filter(Boolean));
107
- };
108
- readQuarter().then((j) => {
109
- if (!j || j.ok === false) draw([], (j && j.error) || 'unreadable'); else { S.today = j.today || ''; draw(j.gantt || [], null, j.no_plan); }
110
- }).catch((e) => draw([], String((e && e.message) || e)));
111
- return box;
112
- }
@@ -1,139 +0,0 @@
1
- /* pm/c3-brief-summary.js — "The brief": one paragraph under the greeting that says the day at a glance (initiative c3-brief-summary-mentions).
2
- *
3
- * composeBrief(input) → { parts, sources } PURE. parts is a list of { t } text and { t, go: { kind, key } } links, in reading order:
4
- * 1. "The day turns on one call": the first decision only the PM can make; without one, "First up": the top row
5
- * ("Still open from today" in Reflect)
6
- * 2. how many things need the PM, how many are overdue, and the oldest
7
- * 3. who waits on a reply to a mention
8
- * 4. how many meetings are left and which one still has a to-do before it ("You held N meetings today." in Reflect)
9
- * 5. which initiatives are off track or at risk
10
- * A sentence whose read has not come back (null input) is left out. Nothing is invented: every number and title
11
- * comes from a row the Briefing shows below.
12
- * summarySection(S) → the card. It composes again when a read comes back, when Needs you changes (S.needsChanged) and when the part of
13
- * the day changes (S.briefLens). A link goes to its row on the page through S.briefGo({ kind, key }).
14
- *
15
- * input: { lens, decisions: [{ key, headline, time, decide, overdue, days_late }] | null (the rows above the PM's own in Needs you; decide: a
16
- * decision only the PM can make, overdue: an assigned item past its date),
17
- * own: [{ key, headline, kind, days_late }] | null, agentN,
18
- * mentions: [mention] | null, agenda: [meeting] | null, pulse: [{ id, title, cls, word }] | null }
19
- * No model call and no write. */
20
- import { el } from './dom.js';
21
- import { c3ic } from './pm-work-view.js';
22
-
23
- const p2 = (n) => String(n).padStart(2, '0');
24
- const hm = (iso) => { const d = new Date(iso); return p2(d.getHours()) + ':' + p2(d.getMinutes()); };
25
- const plural = (n, w) => n + ' ' + w + (n === 1 ? '' : 's');
26
- const first = (s) => String(s || '').trim().split(/\s+/)[0];
27
- const SRC = { slack: 'Slack', jira: 'Jira', confluence: 'Confluence', mail: 'Mail', figma: 'Figma', github: 'GitHub', drive: 'Drive', calendar: 'Calendar', wispr: 'Wispr Flow', website: 'Website', derived: 'PMOS' };
28
- export const srcName = (s) => SRC[s] || String(s || 'a source');
29
- /** a list said as a person says it: "a", "a and b", "a, b and c" */
30
- const andList = (xs) => (xs.length < 2 ? xs.join('') : xs.slice(0, -1).join(', ') + ' and ' + xs[xs.length - 1]);
31
-
32
- /** The mentions that wait on the PM's reply: not read, not already a Needs you row. */
33
- export const waitingMentions = (ms) => (ms || []).filter((m) => m && m.reply && !m.read && !m.in_needs);
34
-
35
- export function composeBrief(input) {
36
- const x = input || {};
37
- const reflect = x.lens === 'Reflect';
38
- const out = []; const sources = [];
39
- const t = (s) => out.push({ t: s });
40
- const link = (s, kind, key) => out.push({ t: s, go: { kind, key } });
41
-
42
- // 1 and 2: Needs you
43
- if (x.decisions && x.own) {
44
- sources.push('Needs you');
45
- const dec = x.decisions.find((d) => d.decide);
46
- const d0 = dec || x.own[0] || x.decisions[0]; // a decision only the PM can make, else the top row of Needs you
47
- if (d0) {
48
- t(reflect ? 'Still open from today: ' : dec ? 'The day turns on one call: ' : 'First up: '); link(d0.headline, 'need', d0.key);
49
- t((d0.time ? (/overdue/.test(d0.time) ? ', ' + d0.time : ', due ' + d0.time) : d0.days_late > 0 ? ', ' + plural(d0.days_late, 'day') + ' late' : '') + '. ');
50
- }
51
- const agentN = Number(x.agentN) || 0;
52
- const total = x.decisions.length + x.own.length + agentN;
53
- const late = [...x.own.filter((r) => r.kind === 'overdue'), ...x.decisions.filter((d) => d.overdue)];
54
- if (!total) t('Nothing needs you right now. ');
55
- else {
56
- const parts = [plural(x.decisions.length, 'decision'), x.own.length + ' of your own'];
57
- if (agentN) parts.push(agentN + ' from the agent');
58
- t(plural(total, 'thing') + (total === 1 ? ' needs' : ' need') + ' you (' + parts.join(', ') + ')');
59
- if (late.length) {
60
- const o = late.slice().sort((a, b) => (b.days_late || 0) - (a.days_late || 0))[0];
61
- t(', and ' + late.length + (late.length === 1 ? ' is' : ' are') + ' overdue, the oldest ');
62
- link(o.headline, 'need', o.key);
63
- t(o.days_late > 0 ? ' (' + plural(o.days_late, 'day') + ' late)' : '');
64
- }
65
- t('. ');
66
- }
67
- }
68
- // 3: mentions that wait on a reply
69
- if (x.mentions) {
70
- sources.push('Mentions');
71
- const w = waitingMentions(x.mentions);
72
- if (w.length) {
73
- const who = w.map((m) => (m.who ? first(m.who) + ' in ' : 'someone in ') + srcName(m.source));
74
- if (w.length === 1) t(who[0].charAt(0).toUpperCase() + who[0].slice(1) + ' is waiting on your reply to a mention. ');
75
- else t(w.length + ' people are waiting on your reply to a mention (' + andList(who) + '). ');
76
- }
77
- }
78
- // 4: the meetings
79
- if (x.agenda) {
80
- sources.push('Calendar');
81
- const all = x.agenda; const left = all.filter((m) => m.state !== 'past');
82
- if (reflect) t(all.length ? 'You held ' + plural(all.length - left.length, 'meeting') + ' today' + (left.length ? ', and ' + left.length + ' ' + (left.length === 1 ? 'is' : 'are') + ' still ahead' : '') + '. ' : 'You had no meetings today. ');
83
- else if (!all.length) t('No meetings today. ');
84
- else if (!left.length) t('No meetings are left today. ');
85
- else {
86
- const todo = left.filter((m) => (m.before || []).length);
87
- t(plural(left.length, 'meeting') + (left.length === 1 ? ' is' : ' are') + ' left today');
88
- if (!todo.length) t(', and nothing is left to do before ' + (left.length === 1 ? 'it' : 'them') + '. ');
89
- else {
90
- t(todo.length === left.length && left.length > 1 ? '; every one has a to-do before it, starting with ' : '; ');
91
- link(todo[0].title, 'meet', todo[0].id);
92
- t(' at ' + hm(todo[0].start) + (todo.length === left.length && left.length > 1 ? '. ' : ' still has a to-do before it. '));
93
- }
94
- }
95
- }
96
- // 5: the initiatives
97
- if (x.pulse && x.pulse.length) {
98
- sources.push('Initiatives');
99
- const bad = x.pulse.filter((r) => r.cls === 'bad'); const warn = x.pulse.filter((r) => r.cls === 'warn'); const ok = x.pulse.filter((r) => r.cls === 'ok').length;
100
- const flagged = [...bad, ...warn];
101
- if (!flagged.length) t(ok ? (ok === 1 ? 'The one initiative with a plan is on track.' : 'All ' + ok + ' initiatives with a plan are on track.') : '');
102
- else {
103
- t('Across the portfolio, ');
104
- flagged.slice(0, 3).forEach((r, i) => {
105
- if (i) t(i === Math.min(flagged.length, 3) - 1 ? ' and ' : ', ');
106
- link(r.title, 'init', r.id);
107
- t(' is ' + String(r.word || (r.cls === 'bad' ? 'off track' : 'at risk')).toLowerCase());
108
- });
109
- if (flagged.length > 3) t(', and ' + (flagged.length - 3) + ' more need attention');
110
- t(ok ? '; ' + ok + (ok === 1 ? ' is' : ' are') + ' on track.' : '.');
111
- }
112
- }
113
- // tidy: one space between sentences, none at the end
114
- const parts = out.filter((p) => p.t);
115
- if (parts.length) parts[parts.length - 1] = { ...parts[parts.length - 1], t: parts[parts.length - 1].t.replace(/\s+$/, '') };
116
- return { parts, sources };
117
- }
118
-
119
- export function summarySection(S) {
120
- const when = el('span', { class: 'mono dim brief-when', 'data-brief-when': '' });
121
- const body = el('p', { class: 'brief-sum', 'data-brief-sum': '' }, 'Reading the day.');
122
- const box = el('section', { class: 'card sect sum-card', 'data-c3pg': 'summary', 'aria-label': 'The brief' },
123
- el('div', { class: 'sh2' }, el('h2', null, c3ic('spark', 'sm'), 'The brief'), when), body);
124
- let queued = false;
125
- const draw = () => {
126
- queued = false;
127
- const input = S.briefInput ? S.briefInput() : {};
128
- const { parts, sources } = composeBrief(input);
129
- if (!parts.length) { body.replaceChildren(sources.length ? 'Nothing to say yet: no decision, item, meeting or initiative needs you.' : 'Reading the day.'); when.textContent = ''; return; }
130
- body.replaceChildren(...parts.map((p) => (p.go
131
- ? el('a', { class: 'brief-lk', href: '#', 'data-brief-go': p.go.kind + ':' + p.go.key, onclick: (e) => { e.preventDefault(); if (S.briefGo) S.briefGo(p.go); } }, p.t)
132
- : document.createTextNode(p.t))));
133
- const d = new Date();
134
- when.textContent = 'As of ' + p2(d.getHours()) + ':' + p2(d.getMinutes()) + ' · ' + sources.join(', ');
135
- };
136
- S.briefRedraw = () => { if (queued) return; queued = true; Promise.resolve().then(draw); };
137
- S.briefRedraw();
138
- return box;
139
- }