create-pmos 0.399.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 (421) hide show
  1. package/package.json +18 -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-adddoc-test.js +2 -2
  7. package/workspace/briefing-premium-board-test.js +2 -2
  8. package/workspace/briefing-premium-doc-edit-test.js +2 -8
  9. package/workspace/briefing-premium-test.js +3 -2
  10. package/workspace/briefing-premium-work-test.js +9 -4
  11. package/workspace/c3-capture-test.js +0 -17
  12. package/workspace/changelog.json +17 -0
  13. package/workspace/guide/briefing-premium.md +2 -2
  14. package/workspace/guide/home.md +20 -2
  15. package/workspace/guide/layout.md +2 -2
  16. package/workspace/guide/notes.md +2 -2
  17. package/workspace/guide/phone-companion.md +1 -1
  18. package/workspace/lib/route-modules.js +1 -9
  19. package/workspace/lib/routes-phone-day.js +18 -9
  20. package/workspace/lib/routes-slash.js +95 -0
  21. package/workspace/package-lock.json +2 -2
  22. package/workspace/package.json +1 -2
  23. package/workspace/premium-chat-goal-view-test.js +1 -1
  24. package/workspace/premium-chat-term-test.js +0 -10
  25. package/workspace/premium-menu-rows-test.js +1 -1
  26. package/workspace/premium-phone-card-test.js +2 -2
  27. package/workspace/premium-vw-doc-test.js +1 -8
  28. package/workspace/premium-work-depth-test.js +2 -3
  29. package/workspace/public/capture.html +23 -0
  30. package/workspace/public/pm/c3-base.js +47 -0
  31. package/workspace/public/pm/c3-capture.js +1 -1
  32. package/workspace/public/pm/c3-ini-ui.js +1 -1
  33. package/workspace/public/pm/c3-sheet.js +1 -1
  34. package/workspace/public/pm/c3-toast.js +1 -1
  35. package/workspace/public/pm/console3.css +3 -0
  36. package/workspace/public/pm/cozy-home.css +20 -5
  37. package/workspace/public/pm/cozy-today.css +5 -2
  38. package/workspace/public/pm/cozy-viewer.js +4 -2
  39. package/workspace/public/pm/cozy.css +9 -0
  40. package/workspace/public/pm/goal-chat.js +5 -1
  41. package/workspace/public/pm/home-app.js +47 -26
  42. package/workspace/public/pm/home-chat.js +10 -4
  43. package/workspace/public/pm/home-data.js +3 -1
  44. package/workspace/public/pm/home-dictate.js +7 -4
  45. package/workspace/public/pm/home-ini.js +12 -2
  46. package/workspace/public/pm/home-list.js +20 -7
  47. package/workspace/public/pm/home-more.js +2 -2
  48. package/workspace/public/pm/home-phone-card.js +9 -4
  49. package/workspace/public/pm/home-review.js +2 -3
  50. package/workspace/public/pm/home-today.js +10 -6
  51. package/workspace/public/pm/home-work.js +15 -8
  52. package/workspace/public/pm/note-dock.js +1 -2
  53. package/workspace/public/pm/notes-links.js +1 -2
  54. package/workspace/public/pm/notes-task.js +3 -4
  55. package/workspace/public/pm/premium-board.js +1 -1
  56. package/workspace/public/pm/premium-initiative-head.js +3 -3
  57. package/workspace/public/pm/premium-vw-doc.css +20 -2
  58. package/workspace/public/pm/premium-vw-doc.js +22 -7
  59. package/workspace/public/pm/view-notes.js +2 -2
  60. package/workspace/replaced-tests.json +435 -0
  61. package/workspace/run-tests.js +323 -28
  62. package/workspace/server.js +15 -10
  63. package/workspace/test-files.json +3 -140
  64. package/workspace/test-lists/base.json +1 -2
  65. package/workspace/test-lists/c3-desktop-light-load.json +1 -2
  66. package/workspace/test-lists/c3-initiative-boards.json +1 -2
  67. package/workspace/test-lists/c3-meeting-focus.json +2 -12
  68. package/workspace/test-lists/c3-work-agent.json +1 -2
  69. package/workspace/test-lists/calendar-tidy-up.json +1 -2
  70. package/workspace/test-lists/console3-reports.json +1 -2
  71. package/workspace/test-lists/docs-three-way-sync.json +1 -2
  72. package/workspace/test-lists/extension-capture.json +5 -0
  73. package/workspace/test-lists/jira-wbs.json +1 -2
  74. package/workspace/test-lists/legacy-cleanup-a.json +9 -0
  75. package/workspace/test-lists/meeting-material.json +1 -2
  76. package/workspace/test-lists/meeting-notes.json +2 -36
  77. package/workspace/test-lists/meeting-replay.json +1 -2
  78. package/workspace/test-lists/mm-capture.json +2 -12
  79. package/workspace/test-lists/my-work.json +2 -10
  80. package/workspace/test-lists/onboarding-firstrun.json +2 -12
  81. package/workspace/test-lists/people-directory.json +1 -2
  82. package/workspace/test-lists/run2-a.json +1 -2
  83. package/workspace/test-lists/run2-d.json +2 -19
  84. package/workspace/test-lists/run3-b.json +1 -2
  85. package/workspace/test-lists/run3-c.json +2 -12
  86. package/workspace/test-lists/run4-b.json +1 -2
  87. package/workspace/test-lists/run4-d.json +1 -5
  88. package/workspace/test-lists/run5-c.json +1 -11
  89. package/workspace/test-lists/run6.json +1 -5
  90. package/workspace/test-lists/workspace-launch-flags.json +2 -12
  91. package/workspace/test-lists/workspace-profile-detection.json +2 -10
  92. package/workspace/test-timings.json +242 -123
  93. package/workspace/c3-briefing-test.js +0 -136
  94. package/workspace/c3-core-docs-test.js +0 -170
  95. package/workspace/c3-driver-fixture.js +0 -64
  96. package/workspace/c3-driver-test.js +0 -169
  97. package/workspace/c3-foundation-test.js +0 -163
  98. package/workspace/c3-ib-items-test.js +0 -114
  99. package/workspace/c3-ib-more-test.js +0 -146
  100. package/workspace/c3-ib-triage-backlog-test.js +0 -128
  101. package/workspace/c3-ini-harness.js +0 -66
  102. package/workspace/c3-ini-life-test.js +0 -167
  103. package/workspace/c3-initiatives-test.js +0 -186
  104. package/workspace/c3-light-load-test.js +0 -112
  105. package/workspace/c3-one-home-test.js +0 -149
  106. package/workspace/c3-phone-test.js +0 -289
  107. package/workspace/c3-quiet-test.js +0 -157
  108. package/workspace/c3-report-design-real-test.js +0 -264
  109. package/workspace/c3-report-design-test.js +0 -442
  110. package/workspace/c3-report-setup-test.js +0 -192
  111. package/workspace/c3-report-structure-real-test.js +0 -248
  112. package/workspace/c3-report-structure-test.js +0 -397
  113. package/workspace/c3-reports-test.js +0 -288
  114. package/workspace/c3-scan-test.js +0 -517
  115. package/workspace/c3-sessions-panel-test.js +0 -365
  116. package/workspace/c3-settings-test.js +0 -204
  117. package/workspace/c3-updates-test.js +0 -131
  118. package/workspace/c3-work-test.js +0 -260
  119. package/workspace/cut-stub.js +0 -40
  120. package/workspace/first-paint-audit.js +0 -160
  121. package/workspace/lib/c3-full-console.js +0 -15
  122. package/workspace/lib/engine/derived/trust.js +0 -3
  123. package/workspace/lib/engine/plan-forecast.js +0 -342
  124. package/workspace/lib/engine/report-families.js +0 -175
  125. package/workspace/lib/engine/truth-table.js +0 -57
  126. package/workspace/lib/routes-c3-init.js +0 -54
  127. package/workspace/lib/routes-c3-life.js +0 -120
  128. package/workspace/lib/routes-c3-timeline.js +0 -192
  129. package/workspace/lib/routes-forecast.js +0 -86
  130. package/workspace/lib/routes-releases.js +0 -130
  131. package/workspace/lib/routes-report-facts.js +0 -85
  132. package/workspace/lib/routes-report-families.js +0 -33
  133. package/workspace/lib/routes-signals.js +0 -51
  134. package/workspace/lib/routes-timeline.js +0 -197
  135. package/workspace/public/c3.html +0 -35
  136. package/workspace/public/index.html +0 -156
  137. package/workspace/public/pm/app.js +0 -831
  138. package/workspace/public/pm/bd-board.js +0 -159
  139. package/workspace/public/pm/bd-drag.js +0 -59
  140. package/workspace/public/pm/bd-model.js +0 -152
  141. package/workspace/public/pm/bd-timeline.js +0 -233
  142. package/workspace/public/pm/bd-tree.js +0 -244
  143. package/workspace/public/pm/board-copy.js +0 -59
  144. package/workspace/public/pm/board-read.js +0 -38
  145. package/workspace/public/pm/branches-sheet.js +0 -56
  146. package/workspace/public/pm/breakdown-api.js +0 -58
  147. package/workspace/public/pm/breakdown-copy.js +0 -138
  148. package/workspace/public/pm/briefing-deck.js +0 -441
  149. package/workspace/public/pm/briefing-model.js +0 -251
  150. package/workspace/public/pm/c3-ambient.js +0 -100
  151. package/workspace/public/pm/c3-audience-link.js +0 -21
  152. package/workspace/public/pm/c3-audience.js +0 -46
  153. package/workspace/public/pm/c3-boot.js +0 -13
  154. package/workspace/public/pm/c3-breakdown.js +0 -240
  155. package/workspace/public/pm/c3-brief-data.js +0 -11
  156. package/workspace/public/pm/c3-brief-mentions.js +0 -137
  157. package/workspace/public/pm/c3-brief-needs.js +0 -288
  158. package/workspace/public/pm/c3-brief-pulse.js +0 -112
  159. package/workspace/public/pm/c3-brief-summary.js +0 -139
  160. package/workspace/public/pm/c3-brief-today.js +0 -79
  161. package/workspace/public/pm/c3-brief.js +0 -279
  162. package/workspace/public/pm/c3-cal-strategy.js +0 -529
  163. package/workspace/public/pm/c3-calendar.js +0 -965
  164. package/workspace/public/pm/c3-calpop.js +0 -111
  165. package/workspace/public/pm/c3-case.js +0 -196
  166. package/workspace/public/pm/c3-core-docs.css +0 -18
  167. package/workspace/public/pm/c3-core-docs.js +0 -236
  168. package/workspace/public/pm/c3-daypart.js +0 -176
  169. package/workspace/public/pm/c3-demo-boards.js +0 -764
  170. package/workspace/public/pm/c3-demo-brief-ix.js +0 -350
  171. package/workspace/public/pm/c3-demo-brief-page.js +0 -70
  172. package/workspace/public/pm/c3-demo-cal-ix.js +0 -74
  173. package/workspace/public/pm/c3-demo-cal2.js +0 -66
  174. package/workspace/public/pm/c3-demo-cal3.js +0 -173
  175. package/workspace/public/pm/c3-demo-cal4.js +0 -169
  176. package/workspace/public/pm/c3-demo-cal5.js +0 -52
  177. package/workspace/public/pm/c3-demo-coredocs.js +0 -221
  178. package/workspace/public/pm/c3-demo-data.js +0 -552
  179. package/workspace/public/pm/c3-demo-focus.js +0 -181
  180. package/workspace/public/pm/c3-demo-init.js +0 -430
  181. package/workspace/public/pm/c3-demo-life.js +0 -77
  182. package/workspace/public/pm/c3-demo-material.js +0 -58
  183. package/workspace/public/pm/c3-demo-misc2.js +0 -34
  184. package/workspace/public/pm/c3-demo-phone.js +0 -48
  185. package/workspace/public/pm/c3-demo-plan2.js +0 -30
  186. package/workspace/public/pm/c3-demo-rd.js +0 -432
  187. package/workspace/public/pm/c3-demo-rep-ix.js +0 -126
  188. package/workspace/public/pm/c3-demo-rep2.js +0 -130
  189. package/workspace/public/pm/c3-demo-rep3.js +0 -138
  190. package/workspace/public/pm/c3-demo-rs.js +0 -287
  191. package/workspace/public/pm/c3-demo-term.js +0 -153
  192. package/workspace/public/pm/c3-demo-time.js +0 -49
  193. package/workspace/public/pm/c3-demo-work-ix.js +0 -32
  194. package/workspace/public/pm/c3-demo.js +0 -131
  195. package/workspace/public/pm/c3-design-studio.js +0 -369
  196. package/workspace/public/pm/c3-doc-formats.js +0 -153
  197. package/workspace/public/pm/c3-doc-sheet.js +0 -1230
  198. package/workspace/public/pm/c3-dock.js +0 -206
  199. package/workspace/public/pm/c3-docs.js +0 -291
  200. package/workspace/public/pm/c3-driver-work.js +0 -110
  201. package/workspace/public/pm/c3-driver.css +0 -18
  202. package/workspace/public/pm/c3-driver.js +0 -298
  203. package/workspace/public/pm/c3-focus.css +0 -304
  204. package/workspace/public/pm/c3-focus.js +0 -983
  205. package/workspace/public/pm/c3-ib-docs.js +0 -92
  206. package/workspace/public/pm/c3-ib-initiatives.js +0 -201
  207. package/workspace/public/pm/c3-ib-items.js +0 -210
  208. package/workspace/public/pm/c3-ib-releases.js +0 -48
  209. package/workspace/public/pm/c3-ib-sprints.js +0 -201
  210. package/workspace/public/pm/c3-ib-triage.js +0 -177
  211. package/workspace/public/pm/c3-ii-tabs.js +0 -252
  212. package/workspace/public/pm/c3-ini-life.css +0 -34
  213. package/workspace/public/pm/c3-ini-life.js +0 -379
  214. package/workspace/public/pm/c3-ini-records.js +0 -197
  215. package/workspace/public/pm/c3-ini-timeline.js +0 -278
  216. package/workspace/public/pm/c3-ini-work.js +0 -139
  217. package/workspace/public/pm/c3-init-extras.js +0 -170
  218. package/workspace/public/pm/c3-initiatives.js +0 -852
  219. package/workspace/public/pm/c3-lifecycle-panels.js +0 -479
  220. package/workspace/public/pm/c3-look.js +0 -27
  221. package/workspace/public/pm/c3-material.css +0 -22
  222. package/workspace/public/pm/c3-material.js +0 -321
  223. package/workspace/public/pm/c3-md.js +0 -3
  224. package/workspace/public/pm/c3-misc-panels.js +0 -89
  225. package/workspace/public/pm/c3-new-session.js +0 -110
  226. package/workspace/public/pm/c3-notes.js +0 -751
  227. package/workspace/public/pm/c3-phone-boot.js +0 -47
  228. package/workspace/public/pm/c3-phone-detail.js +0 -97
  229. package/workspace/public/pm/c3-phone-model.js +0 -3
  230. package/workspace/public/pm/c3-phone.css +0 -66
  231. package/workspace/public/pm/c3-phone.js +0 -444
  232. package/workspace/public/pm/c3-plan-panels.js +0 -163
  233. package/workspace/public/pm/c3-plan.js +0 -193
  234. package/workspace/public/pm/c3-quiet.css +0 -113
  235. package/workspace/public/pm/c3-quiet.js +0 -177
  236. package/workspace/public/pm/c3-replay.css +0 -133
  237. package/workspace/public/pm/c3-replay.js +0 -429
  238. package/workspace/public/pm/c3-report-deck.css +0 -163
  239. package/workspace/public/pm/c3-report-deck.js +0 -598
  240. package/workspace/public/pm/c3-report-frame.css +0 -20
  241. package/workspace/public/pm/c3-report-print.css +0 -20
  242. package/workspace/public/pm/c3-report-setup.css +0 -67
  243. package/workspace/public/pm/c3-report-setup.js +0 -298
  244. package/workspace/public/pm/c3-report-store.js +0 -244
  245. package/workspace/public/pm/c3-report-structure.css +0 -44
  246. package/workspace/public/pm/c3-report-structure.js +0 -473
  247. package/workspace/public/pm/c3-reports.css +0 -68
  248. package/workspace/public/pm/c3-reports.js +0 -377
  249. package/workspace/public/pm/c3-roadmap.js +0 -249
  250. package/workspace/public/pm/c3-scan-api.js +0 -167
  251. package/workspace/public/pm/c3-scan-next.js +0 -248
  252. package/workspace/public/pm/c3-scan-setup.js +0 -313
  253. package/workspace/public/pm/c3-scan-words.js +0 -41
  254. package/workspace/public/pm/c3-scan.css +0 -74
  255. package/workspace/public/pm/c3-scan.js +0 -93
  256. package/workspace/public/pm/c3-session-chat.js +0 -103
  257. package/workspace/public/pm/c3-session-conv.js +0 -165
  258. package/workspace/public/pm/c3-session-term.js +0 -216
  259. package/workspace/public/pm/c3-settings.css +0 -85
  260. package/workspace/public/pm/c3-settings.js +0 -1045
  261. package/workspace/public/pm/c3-shell.js +0 -628
  262. package/workspace/public/pm/c3-signals.js +0 -196
  263. package/workspace/public/pm/c3-strategy-panels.js +0 -45
  264. package/workspace/public/pm/c3-swipe.js +0 -230
  265. package/workspace/public/pm/c3-terminal-data.js +0 -48
  266. package/workspace/public/pm/c3-terminal-edge.js +0 -91
  267. package/workspace/public/pm/c3-terminal-icons.js +0 -40
  268. package/workspace/public/pm/c3-terminal-results.js +0 -141
  269. package/workspace/public/pm/c3-terminal.js +0 -52
  270. package/workspace/public/pm/c3-tickets.js +0 -163
  271. package/workspace/public/pm/c3-timeline.js +0 -201
  272. package/workspace/public/pm/calendar-views.js +0 -1049
  273. package/workspace/public/pm/console3-lift.md +0 -220
  274. package/workspace/public/pm/cozy-home.js +0 -172
  275. package/workspace/public/pm/cozy-initiative.css +0 -138
  276. package/workspace/public/pm/cycle-review.js +0 -125
  277. package/workspace/public/pm/data.js +0 -1577
  278. package/workspace/public/pm/dest-board.js +0 -444
  279. package/workspace/public/pm/dest-docs.js +0 -530
  280. package/workspace/public/pm/dest-initiatives.js +0 -162
  281. package/workspace/public/pm/dest-mywork.js +0 -307
  282. package/workspace/public/pm/dest-notes.js +0 -537
  283. package/workspace/public/pm/dest-people.js +0 -449
  284. package/workspace/public/pm/dest-reports.js +0 -383
  285. package/workspace/public/pm/dest-settings.js +0 -601
  286. package/workspace/public/pm/dest-today.js +0 -267
  287. package/workspace/public/pm/display-word.js +0 -56
  288. package/workspace/public/pm/doc-editor.js +0 -473
  289. package/workspace/public/pm/doc-graph.js +0 -272
  290. package/workspace/public/pm/doc-health-panel.js +0 -110
  291. package/workspace/public/pm/doc-rail.js +0 -167
  292. package/workspace/public/pm/doc-remote.js +0 -180
  293. package/workspace/public/pm/dock-sessions.js +0 -472
  294. package/workspace/public/pm/dock.js +0 -216
  295. package/workspace/public/pm/fixture.js +0 -821
  296. package/workspace/public/pm/flag-picker.js +0 -104
  297. package/workspace/public/pm/frame-copy.js +0 -278
  298. package/workspace/public/pm/freshness-line.js +0 -149
  299. package/workspace/public/pm/handoff-box.js +0 -82
  300. package/workspace/public/pm/initiative-list.js +0 -235
  301. package/workspace/public/pm/initiative-sheet.js +0 -331
  302. package/workspace/public/pm/initiatives-api.js +0 -95
  303. package/workspace/public/pm/initiatives-copy.js +0 -287
  304. package/workspace/public/pm/initiatives-timeline-copy.js +0 -59
  305. package/workspace/public/pm/initiatives-timeline.js +0 -410
  306. package/workspace/public/pm/initiatives-ui.js +0 -291
  307. package/workspace/public/pm/item-sheet.js +0 -268
  308. package/workspace/public/pm/keep-card.js +0 -204
  309. package/workspace/public/pm/lifecycle-lens-model.js +0 -246
  310. package/workspace/public/pm/lifecycle-lens.js +0 -276
  311. package/workspace/public/pm/lifecycle.js +0 -111
  312. package/workspace/public/pm/mobile.css +0 -366
  313. package/workspace/public/pm/mobile.js +0 -581
  314. package/workspace/public/pm/modes-live.js +0 -453
  315. package/workspace/public/pm/modes.js +0 -147
  316. package/workspace/public/pm/my-work-card.js +0 -51
  317. package/workspace/public/pm/my-work-data.js +0 -36
  318. package/workspace/public/pm/new-initiative-sheet.js +0 -169
  319. package/workspace/public/pm/next-step-ui.js +0 -190
  320. package/workspace/public/pm/outbox-panel.js +0 -125
  321. package/workspace/public/pm/palette-copy.js +0 -55
  322. package/workspace/public/pm/palette.js +0 -343
  323. package/workspace/public/pm/panel-breakdown.js +0 -702
  324. package/workspace/public/pm/panel-cockpit.js +0 -425
  325. package/workspace/public/pm/panel-detail.js +0 -1513
  326. package/workspace/public/pm/panel-initiatives.js +0 -929
  327. package/workspace/public/pm/panel-newsess.js +0 -709
  328. package/workspace/public/pm/panel-repos.js +0 -741
  329. package/workspace/public/pm/panel-tabs.js +0 -1506
  330. package/workspace/public/pm/panel-trees.js +0 -204
  331. package/workspace/public/pm/people-link.js +0 -106
  332. package/workspace/public/pm/phone-deck.js +0 -167
  333. package/workspace/public/pm/pm-work-view.js +0 -1533
  334. package/workspace/public/pm/portfolio-report.js +0 -61
  335. package/workspace/public/pm/premium-acts.js +0 -280
  336. package/workspace/public/pm/premium-brief.js +0 -111
  337. package/workspace/public/pm/premium-chat.js +0 -22
  338. package/workspace/public/pm/premium-doc-sheet.js +0 -312
  339. package/workspace/public/pm/premium-initiative.js +0 -324
  340. package/workspace/public/pm/premium-insights.css +0 -228
  341. package/workspace/public/pm/premium-metric-tiles.js +0 -68
  342. package/workspace/public/pm/premium-report-brief.js +0 -132
  343. package/workspace/public/pm/premium-vw-rec.js +0 -67
  344. package/workspace/public/pm/premium-wide.css +0 -30
  345. package/workspace/public/pm/print.css +0 -44
  346. package/workspace/public/pm/provider-cards.js +0 -136
  347. package/workspace/public/pm/registry.js +0 -203
  348. package/workspace/public/pm/release-card.js +0 -110
  349. package/workspace/public/pm/releases-view.js +0 -248
  350. package/workspace/public/pm/report-families-view.js +0 -505
  351. package/workspace/public/pm/report-slides.js +0 -438
  352. package/workspace/public/pm/report-tab.js +0 -33
  353. package/workspace/public/pm/report-view.js +0 -337
  354. package/workspace/public/pm/reports-copy.js +0 -134
  355. package/workspace/public/pm/roadmap.js +0 -294
  356. package/workspace/public/pm/run-card.js +0 -260
  357. package/workspace/public/pm/sessions-panel.js +0 -219
  358. package/workspace/public/pm/sheet-jira.js +0 -353
  359. package/workspace/public/pm/shell-bell.js +0 -163
  360. package/workspace/public/pm/shell-model.js +0 -83
  361. package/workspace/public/pm/shell-phone.js +0 -124
  362. package/workspace/public/pm/shell-readaloud.js +0 -53
  363. package/workspace/public/pm/shell-recording.js +0 -274
  364. package/workspace/public/pm/shell-ticker.js +0 -90
  365. package/workspace/public/pm/sig-watch.js +0 -41
  366. package/workspace/public/pm/slide-confirm.js +0 -163
  367. package/workspace/public/pm/slides-copy.js +0 -52
  368. package/workspace/public/pm/status-banner.js +0 -95
  369. package/workspace/public/pm/tab-doc.js +0 -859
  370. package/workspace/public/pm/tab-gone.js +0 -21
  371. package/workspace/public/pm/tab-term.js +0 -1210
  372. package/workspace/public/pm/tab-web.js +0 -90
  373. package/workspace/public/pm/timeline-copy.js +0 -48
  374. package/workspace/public/pm/timeline-forecast-view.js +0 -164
  375. package/workspace/public/pm/today-agenda.js +0 -331
  376. package/workspace/public/pm/today-cards.js +0 -244
  377. package/workspace/public/pm/today-copy.js +0 -506
  378. package/workspace/public/pm/today-day.js +0 -1371
  379. package/workspace/public/pm/today-goals.js +0 -297
  380. package/workspace/public/pm/today-jobs.js +0 -84
  381. package/workspace/public/pm/today-mentions.js +0 -50
  382. package/workspace/public/pm/topbar.js +0 -202
  383. package/workspace/public/pm/triage-card.js +0 -60
  384. package/workspace/public/pm/undo-hold.js +0 -103
  385. package/workspace/public/pm/view-addrepo.js +0 -208
  386. package/workspace/public/pm/view-files.js +0 -197
  387. package/workspace/public/pm/view-livenotes.js +0 -399
  388. package/workspace/public/pm/view-today.js +0 -13
  389. package/workspace/public/pm/view-validate.js +0 -171
  390. package/workspace/public/pm/welcome.js +0 -391
  391. package/workspace/public/pm/work-place.js +0 -68
  392. package/workspace/public/pm/xlsx-read.js +0 -117
  393. package/workspace/public/welcome.html +0 -22
  394. package/workspace/test-lists/browser-suites-green.json +0 -5
  395. package/workspace/test-lists/c3-core-docs.json +0 -9
  396. package/workspace/test-lists/c3-doc-sheet-rich.json +0 -6
  397. package/workspace/test-lists/c3-doc-sheet-size.json +0 -6
  398. package/workspace/test-lists/c3-doc-sheet-v2.json +0 -6
  399. package/workspace/test-lists/c3-ib-items.json +0 -9
  400. package/workspace/test-lists/c3-ib-more.json +0 -9
  401. package/workspace/test-lists/c3-ib-triage-backlog.json +0 -9
  402. package/workspace/test-lists/c3-ini-life.json +0 -9
  403. package/workspace/test-lists/c3-meeting-board.json +0 -5
  404. package/workspace/test-lists/c3-meeting-card.json +0 -5
  405. package/workspace/test-lists/c3-notes-place.json +0 -5
  406. package/workspace/test-lists/c3-notes-series.json +0 -5
  407. package/workspace/test-lists/calendar-time-page.json +0 -5
  408. package/workspace/test-lists/calpop.json +0 -4
  409. package/workspace/test-lists/console3-briefing.json +0 -9
  410. package/workspace/test-lists/console3-foundation.json +0 -9
  411. package/workspace/test-lists/console3-work-page.json +0 -9
  412. package/workspace/test-lists/premium-brief-parity.json +0 -9
  413. package/workspace/test-lists/report-design-studio-ui.json +0 -5
  414. package/workspace/test-lists/report-structure-ui.json +0 -11
  415. package/workspace/test-lists/report-workspace-ui.json +0 -5
  416. package/workspace/test-lists/run3-a.json +0 -5
  417. package/workspace/test-lists/run3-d.json +0 -6
  418. package/workspace/test-lists/run4-c.json +0 -13
  419. package/workspace/test-lists/today-goals-jobs-ui.json +0 -5
  420. package/workspace/test-lists/today-mentions-cards.json +0 -5
  421. package/workspace/test-lists/workspace-tabs-declutter.json +0 -13
@@ -1,751 +0,0 @@
1
- /* pm/c3-notes.js — Calendar › Notes on the console3 Calendar tab (initiative c3-notes-place, PRD done-criteria 1 to 7).
2
- *
3
- * c3-calendar.js draws it when the Calendar | Notes switch is on Notes: notesView(ui) returns one persistent box, which this
4
- * file redraws on its own (a read, a choice, a stage, a search), so the grid's data call is not repeated.
5
- *
6
- * the list "Notes" with a count and a search field, grouped by what a note is about: Portfolio first, then each board in the
7
- * portfolio's order, then "Not linked" (scopeGroups). A row: the time or day, the length, its initiative or a "board"
8
- * tag, recording or paused, "no meeting", and a dot for a conflict.
9
- * the head the note's meeting, then what it is about (the Portfolio, a board, or an initiative on its board) with one picker
10
- * (aboutMenu: /api/boards and each board's Now and next initiatives), the mockup the PM approved on 2026-10-12.
11
- * Copy as Markdown, and Delete (asked first; remove), as the main app's Notes has.
12
- * the note the Calendar stage's layout (calendar-views.js stageNode, the mockup the PM approved on 2026-10-12): a head with
13
- * Before, During and After, then the stage's cards.
14
- * Before the meeting context the note kept (meeting.context): agenda (an item heard is ticked), what it is for, to be ready,
15
- * links and references, people. A note with no meeting says so and offers the main app's link pickers.
16
- * During the main app's live block while the note is recorded or paused (view-notes.js renderLive), else the transcript.
17
- * After the Notes card (decisions with why, next steps with owner, due and Make task, questions, conflicts, highlights,
18
- * the screenshots of the shared screen, the folded transcript) from final_notes, else from what was caught live (dest-notes.js partsOf).
19
- *
20
- * Nothing is invented: a part the note does not hold is left out or says so. The mockup's Rejected column, Settle, told and
21
- * not told, Route actions and the drafts have no data or route yet, so they are not drawn.
22
- *
23
- * openNote(r, id, phase) shows a note (from the Record chip or a meeting's detail) on the instance r
24
- * noteOfEvent(e) the note linked to a calendar event, from the shared notes read (notes-links.js), or null
25
- */
26
- import { el } from './dom.js';
27
- import { button, menu } from './primitives.js';
28
- import { icon } from './icons.js';
29
- import { c3ic } from './pm-work-view.js';
30
- import { pmGet, pmPost } from './http.js';
31
- import { toast } from './c3-toast.js';
32
- import { onNotes, notesFor, refreshNotes } from './notes-links.js';
33
- import { agendaHeard, peopleOf } from './notes-context.js';
34
- import { partsOf, conflictsOf, whenShort } from './dest-notes.js';
35
- import * as dock from './note-dock.js';
36
- import * as V from './view-notes.js';
37
- import { makeTask } from './notes-task.js';
38
- import { screenStrip } from './notes-screen-view.js';
39
- import { askConfirm } from './dialogs.js';
40
-
41
- const PHASES = [['before', 'clip', 'Before'], ['during', 'mic', 'During'], ['after', 'notes', 'After']];
42
- const startOf = (n) => (n.meeting && n.meeting.start) || n.recorded_from || n.created_at || n.updated_at;
43
- const iniName = (i) => (i ? i.title || i.id : null);
44
- const boardName = (b) => (b ? b.title || b.id : null);
45
- /* what a note is about, as the head's path: "Portfolio", "IDPF", or "IDPF › Partner API rate limits" */
46
- const pathOf = (n) => (n.initiative ? [boardName(n.board), iniName(n.initiative)].filter(Boolean) : n.board ? [boardName(n.board)] : n.portfolio ? ['Portfolio'] : []);
47
- const boardKey = (b) => (b.ws || '') + '/' + b.id;
48
- const mins = (ms) => (ms >= 60000 ? Math.round(ms / 60000) + ' min' : '');
49
- const lenOf = (n) => n.meeting_ms || Math.max(0, ...(n.transcript || []).map((x) => x.t || 0));
50
- const dayOf = (iso) => { const t = new Date(iso); return Number.isFinite(t.getTime()) ? t.toLocaleDateString('en-GB', { weekday: 'short', day: 'numeric', month: 'short' }) : ''; };
51
- const hm = (iso) => { const t = new Date(iso); return Number.isFinite(t.getTime()) ? String(t.getHours()).padStart(2, '0') + ':' + String(t.getMinutes()).padStart(2, '0') : ''; };
52
- const avatar = (name) => el('span', { class: 'av', title: name }, String(name).split(/\s+/).map((w) => w[0]).slice(0, 2).join('').toUpperCase());
53
- /* A native button from primitives.js drawn as the console3 control `cls` (chip2 lk, ib, sgb, …); cal3-b takes the primitive's own
54
- * height, padding and hover off (console3.css), as c3-ini-ui.js btn() does with ini-b. */
55
- function btn(cls, attrs, kids, onClick) {
56
- const b = button({ variant: 'ghost', onClick, attrs: { ...(attrs || {}), class: 'cal3-b ' + cls } });
57
- b.replaceChildren(...[].concat(kids).filter((k) => k != null && k !== false));
58
- return b;
59
- }
60
- const fold = (icon, text, attrs) => el('div', { class: 'fold', ...(attrs || {}) }, c3ic(icon, 'sm'), text);
61
- const held = (id) => { const s = dock.recordState(); return s.mode !== 'idle' && s.id === id ? s.mode : null; };
62
- const linked = (n) => !!(n.meeting && (n.meeting.kind === 'event' || n.meeting.kind === 'adhoc'));
63
- const transcriptOf = (n) => (n.final && n.final.segments && n.final.segments.length ? n.final.segments.map((g) => ({ t: g.t, text: g.text, who: g.spk })) : (n.transcript || []).filter((x) => !x.dropped).map((x) => ({ t: x.t, text: x.text, who: x.source })));
64
-
65
- /** The notes state on the calendar instance r. */
66
- function stateOf(r) {
67
- if (!r.notes) r.notes = { box: el('div', { class: 'cal3-notes', 'data-cal3': 'notes' }), rows: null, err: null, open: null, note: null, phase: null, q: '', seq: 0, live: null, unsub: null,
68
- ser: null, thread: null, place: null, expand: new Set(), older: new Set(), found: null, every: false, open_by: {} };
69
- return r.notes;
70
- }
71
-
72
- /** The note the Calendar shows next: from the Record chip (phase During) or a meeting's detail (its default stage). */
73
- export function openNote(r, id, phase) {
74
- const s = stateOf(r);
75
- s.open = id; s.note = null; s.phase = phase || null; s.ser = null; s.thread = null;
76
- r.page = r.page || null;
77
- if (r.page) r.page.mode = 'notes';
78
- else r.pendingMode = 'notes';
79
- }
80
-
81
- /** The note linked to this calendar event (its id, its id without the day of a repeat, or its start and title), from the
82
- * shared read. The calendar's events carry their start as `at`. Null when none is known. */
83
- export function noteOfEvent(e) {
84
- if (!e) return null;
85
- const start = e.start || e.at; const base = String(e.id || '').split('@')[0];
86
- for (const x of [{ id: e.id, start, title: e.title }, { id: base, start, title: e.title }]) { const f = notesFor(x); if (f.length) return f[0]; }
87
- return null;
88
- }
89
-
90
- /** The Notes view: the list and the note, in one box that keeps its identity across the page's redraws. */
91
- export function notesView(ui) {
92
- const s = stateOf(ui.r);
93
- s.ui = ui;
94
- if (!s.unsub) s.unsub = onNotes(() => { if (s.box.isConnected) read(s); });
95
- if (!s.boards) loadBoards(s);
96
- if (!s.rows || (s.open && (!s.note || s.note.id !== s.open)) || (s.ser && (!s.thread || s.thread.key !== s.ser))) read(s);
97
- draw(s);
98
- return s.box;
99
- }
100
-
101
- async function read(s) {
102
- const seq = ++s.seq;
103
- const ser = s.ser;
104
- const [l, one, th] = await Promise.all([pmGet('/api/notes'), !ser && s.open ? pmGet('/api/notes/one?id=' + encodeURIComponent(s.open)) : null,
105
- ser ? pmGet('/api/notes/series?key=' + encodeURIComponent(ser)) : null]);
106
- if (seq !== s.seq) return;
107
- if (l && l.ok) { s.rows = l.notes || []; s.open_by = l.series_open || {}; s.err = null; } else { s.rows = s.rows || []; s.err = (l && l.error) || 'The notes could not be read.'; }
108
- if (ser) {
109
- if (th && th.ok && th.series) s.thread = th.series;
110
- else { s.ser = null; s.thread = null; toast('That meeting series could not be read' + (th && th.error ? ': ' + th.error : '.')); }
111
- draw(s); return;
112
- }
113
- if (!s.open && s.rows.length) { s.open = s.rows[0].id; return read(s); }
114
- if (one && one.ok && one.note && one.note.id === s.open) { s.note = one.note; s.shots = (one.screen && one.screen.frames) || []; s.aside = (one.screen && one.screen.aside) || 0; s.rec = one.recording || null; s.place = one.place || null; }
115
- draw(s);
116
- }
117
-
118
- /* the portfolio's boards, for the list's group order and the board names; a board the read misses keeps the note's own title */
119
- async function loadBoards(s) {
120
- s.boards = [];
121
- const r = await pmGet('/api/boards');
122
- if (r && r.ok && Array.isArray(r.boards)) { s.boards = r.boards.filter((b) => b && b.id && !b.error); if (s.box.isConnected) draw(s); }
123
- }
124
-
125
- function choose(s, id, phase) {
126
- if (s.open === id && !s.ser) return;
127
- s.open = id; s.note = null; s.phase = phase || null; s.shots = []; s.aside = 0; s.rec = null; s.place = null; s.ser = null; s.thread = null;
128
- draw(s); read(s);
129
- }
130
- /* open a meeting series on the right (the series page) */
131
- function chooseSeries(s, key) {
132
- if (s.ser === key) return;
133
- s.ser = key; s.thread = null; s.every = false; s.note = null; s.open = null; s.place = null;
134
- draw(s); read(s);
135
- }
136
-
137
- function draw(s) {
138
- if (!s.box.isConnected && s.drawn) { s.drawn = false; }
139
- // a field being typed in is not redrawn under the cursor; the live block keeps its own fields
140
- const active = typeof document !== 'undefined' ? document.activeElement : null;
141
- if (active && s.box.contains(active) && active.matches('textarea, [contenteditable="true"]') && !active.closest('[data-nt-part="live"]')) return;
142
- const q = s.box.querySelector('[data-cal3-notes="search"]');
143
- const typing = !!q && active === q; const caret = typing ? q.selectionStart : null;
144
- s.box.replaceChildren(el('div', { class: 'cal3-nwrap' }, listCard(s), s.ser ? seriesCol(s) : noteCol(s)));
145
- s.drawn = true;
146
- if (typing) { const nq = s.box.querySelector('[data-cal3-notes="search"]'); if (nq) { nq.focus(); nq.setSelectionRange(caret, caret); } }
147
- }
148
-
149
- /* ── the list ─────────────────────────────────────────────────────────────────────────────────────────────────────── */
150
-
151
- const OLD_DAYS = 30;
152
- const SEARCH_MIN = 2;
153
- const seriesKeyOf = (r) => (r && r.series ? r.series.key : null);
154
-
155
- function listCard(s) {
156
- const qtext = s.q.trim().toLowerCase();
157
- const found = s.found && s.found.q === qtext ? s.found.ids : null;
158
- const shown = (s.rows || []).filter((r) => !qtext || String(r.title || '').toLowerCase().includes(qtext) || pathOf(r).some((x) => String(x).toLowerCase().includes(qtext))
159
- || (r.summary_lines || []).some((x) => String(x).toLowerCase().includes(qtext)) || (found && found.has(r.id)));
160
- const search = el('input', { type: 'text', class: 'cal3-nsearch', placeholder: 'Search notes, decisions, what was said', 'aria-label': 'Search notes', value: s.q, 'data-cal3-notes': 'search' });
161
- search.addEventListener('input', () => { s.q = search.value; draw(s); findLater(s); });
162
- let body;
163
- if (!s.rows) body = fold('clock', 'Reading the notes', { role: 'status' });
164
- else if (!s.rows.length) body = fold('mic', s.err || 'No notes yet. Press Record at the top right to start one.', { 'data-cal3-notes': 'none' });
165
- else if (!shown.length) body = fold('search', qtext.length >= SEARCH_MIN && !found ? 'Searching the notes' : 'No note matches “' + s.q.trim() + '”.', { 'data-cal3-notes': 'no-match' });
166
- else body = scopeGroups(s, shown).map((g) => {
167
- const old = qtext ? [] : g.entries.filter((e) => isOld(e));
168
- const recent = qtext ? g.entries : g.entries.filter((e) => !isOld(e));
169
- const open = s.older.has(g.key);
170
- const olderN = old.reduce((t, e) => t + e.rows.length, 0);
171
- const rows = [...recent.flatMap((e) => entryRows(s, e, !!qtext)), ...(open ? old.flatMap((e) => entryRows(s, e, false)) : [])];
172
- if (old.length) rows.push(el('li', { class: 'nrow cal3-nmore' }, btn('chip2 lk', { 'data-cal3-notes': 'older', 'aria-expanded': String(open) },
173
- open ? 'Hide the older notes' : [c3ic('clock', 'sm'), 'Older than ' + OLD_DAYS + ' days · ' + olderN + (olderN === 1 ? ' note' : ' notes')],
174
- () => { if (open) s.older.delete(g.key); else s.older.add(g.key); draw(s); })));
175
- return el('div', { class: 'cal3-ctx', 'data-cal3-notes-group': g.label }, el('h4', null, g.label), el('ul', { class: 'list', role: 'list' }, rows));
176
- });
177
- return el('section', { class: 'card sect', 'data-cal3-notes': 'list', 'aria-label': 'Notes' },
178
- el('div', { class: 'sh2' }, el('h2', null, c3ic('notes', 'sm'), 'Notes ', el('span', { class: 'bdg g', 'data-cal3-notes': 'count' }, String(shown.length)))),
179
- el('div', { class: 'cal3-nsearchw' }, search), body);
180
- }
181
- const isOld = (e) => { const t = Date.parse(startOf(e.rows[0])); return Number.isFinite(t) && Date.now() - t > OLD_DAYS * 86400000 && !e.rows.some((r) => held(r.id) || r.state === 'recording' || r.state === 'paused'); };
182
-
183
- /* search the notes' text on the server (GET /api/notes/search), a moment after the last key */
184
- function findLater(s) {
185
- clearTimeout(s.findT);
186
- const q = s.q.trim().toLowerCase();
187
- if (q.length < SEARCH_MIN) { s.found = null; return; }
188
- s.findT = setTimeout(async () => {
189
- const r = await pmGet('/api/notes/search?q=' + encodeURIComponent(q));
190
- if (s.q.trim().toLowerCase() !== q) return;
191
- s.found = { q, ids: new Set(r && r.ok && Array.isArray(r.ids) ? r.ids : []) };
192
- if (s.box.isConnected) draw(s);
193
- }, 220);
194
- }
195
-
196
- /* the list's groups: Portfolio, each board in the portfolio's order (a board it does not list goes after them by name), an
197
- * initiative linked before boards were (no board on the note) under "Initiatives", then "Not linked". The notes of one meeting
198
- * series (lib/notes-series.js, two or more notes with one key) are one entry, in the group of their newest note. In a group,
199
- * the newest meeting (or recording) first. → [{ key, label, entries: [{ key, rows (newest first) }] }] */
200
- function scopeGroups(s, rows) {
201
- const order = new Map((s.boards || []).map((b, i) => [boardKey(b), i]));
202
- const known = new Map((s.boards || []).map((b) => [boardKey(b), b.name || b.id]));
203
- const t = (r) => Date.parse(startOf(r)) || 0;
204
- const all = (s.rows || []);
205
- const size = new Map();
206
- for (const r of all) { const k = seriesKeyOf(r); if (k) size.set(k, (size.get(k) || 0) + 1); }
207
- const entries = new Map();
208
- for (const r of rows) {
209
- const k = seriesKeyOf(r);
210
- const ek = k && size.get(k) >= 2 ? 'S' + k : 'N' + r.id;
211
- if (!entries.has(ek)) entries.set(ek, { key: ek, series: ek[0] === 'S' ? k : null, rows: [], size: k ? size.get(k) : 1 });
212
- entries.get(ek).rows.push(r);
213
- }
214
- const g = new Map();
215
- for (const e of entries.values()) {
216
- e.rows.sort((a, b) => t(b) - t(a));
217
- const r = e.rows[0];
218
- const k = r.portfolio ? '@portfolio' : r.board ? boardKey(r.board) : r.initiative ? '@initiative' : '';
219
- if (!g.has(k)) g.set(k, { key: k, label: k === '@portfolio' ? 'Portfolio' : k === '@initiative' ? 'Initiatives' : !k ? 'Not linked' : known.get(k) || boardName(r.board), entries: [] });
220
- g.get(k).entries.push(e);
221
- }
222
- // the server lists notes by when they were last edited; a group reads newest meeting first
223
- for (const x of g.values()) x.entries.sort((a, b) => t(b.rows[0]) - t(a.rows[0]));
224
- const rank = (x) => (x.key === '@portfolio' ? [0, 0] : x.key === '@initiative' ? [3, 0] : !x.key ? [4, 0] : order.has(x.key) ? [1, order.get(x.key)] : [2, 0]);
225
- return [...g.values()].sort((a, b) => { const p = rank(a); const q = rank(b); return p[0] - q[0] || p[1] - q[1] || a.label.localeCompare(b.label); });
226
- }
227
-
228
- /* the rows an entry draws: a note's row, or a series row with its newest meetings under it when open (or matching a search) */
229
- function entryRows(s, e, searching) {
230
- if (!e.series) return [noteRow(s, e.rows[0])];
231
- const open = s.expand.has(e.series) || searching;
232
- const out = [seriesRow(s, e, open)];
233
- if (!open) return out;
234
- const shown = e.rows.slice(0, 3);
235
- out.push(...shown.map((r) => noteRow(s, r, true)));
236
- const more = (searching ? e.rows.length : e.size) - shown.length;
237
- if (more > 0) out.push(el('li', { class: 'nrow cal3-nsub cal3-nmore' }, btn('chip2 lk', { 'data-cal3-notes': 'series-all' },
238
- searching ? more + ' more matching in the series' : 'All ' + e.size + ' meetings in the series', () => chooseSeries(s, e.series))));
239
- return out;
240
- }
241
-
242
- function seriesRow(s, e, open) {
243
- const r = e.rows[0];
244
- const on = s.ser === e.series;
245
- const o = s.open_by[e.series];
246
- const title = (r.meeting && r.meeting.kind === 'event' && r.meeting.title) || r.title || 'Untitled meeting';
247
- return el('li', { class: 'nrow cal3-nrow cal3-nser' + (on ? ' on' : ''), 'data-cal3-series': e.series },
248
- el('span', { class: 'ki' }, c3ic('notes')),
249
- btn('cal3-nopen', { title: 'Open the series ' + title, 'aria-current': on ? 'true' : 'false' }, [
250
- el('span', { class: 'tt' }, title),
251
- el('span', { class: 'chips' }, el('span', { class: 'dim mono cal3-xs' }, whenShort(startOf(r)) + ' · ' + e.size + ' meetings'),
252
- el('span', { class: 'tag', title: 'A regular meeting: its notes are kept together' }, 'series'),
253
- o ? el('span', { class: 'st ' + (o.carried ? 'warn' : 'unt'), title: o.open + (o.open === 1 ? ' action is' : ' actions are') + ' carried from meeting to meeting', 'data-cal3-notes': 'series-open' }, c3ic(o.carried ? 'alert' : 'todo', 'sm'), o.open + ' open') : null)],
254
- () => chooseSeries(s, e.series)),
255
- btn('ib sm', { 'data-cal3-notes': 'series-x', 'aria-expanded': String(open), title: open ? 'Hide its recent meetings' : 'Show its recent meetings', 'aria-label': open ? 'Hide recent meetings' : 'Show recent meetings' },
256
- c3ic(open ? 'fold' : 'next', 'sm'), () => { if (s.expand.has(e.series)) s.expand.delete(e.series); else s.expand.add(e.series); draw(s); }));
257
- }
258
-
259
- function noteRow(s, r, sub) {
260
- const mode = held(r.id) || (r.state === 'recording' || r.state === 'paused' ? r.state : null);
261
- const on = s.open === r.id && !s.ser;
262
- const len = mins(r.meeting_ms || 0);
263
- const gist = sub ? (r.summary_lines || [])[0] : null;
264
- return el('li', { class: 'nrow cal3-nrow' + (on ? ' on' : '') + (sub ? ' cal3-nsub' : ''), 'data-cal3-note-row': r.id },
265
- el('span', { class: 'ki' + (mode ? ' hot' : '') }, c3ic(mode ? 'mic' : 'doc')),
266
- btn('cal3-nopen', { title: 'Open ' + (r.title || 'Untitled note'), 'aria-current': on ? 'true' : 'false' }, [
267
- el('span', { class: 'tt' }, gist || r.title || 'Untitled note'),
268
- el('span', { class: 'chips' }, el('span', { class: 'dim mono cal3-xs' }, [mode ? 'now' : sub ? dayOf(startOf(r)) : whenShort(startOf(r)), len].filter(Boolean).join(' · ')),
269
- mode ? el('span', { class: 'tag', 'data-cal3-notes': 'live' }, mode === 'paused' ? 'paused' : 'recording')
270
- : sub ? null : r.initiative ? el('span', { class: 'chip2', title: 'Initiative', 'data-cal3-notes': 'row-initiative' }, c3ic('init', 'sm'), iniName(r.initiative))
271
- : r.board ? el('span', { class: 'tag', title: 'Linked to the board, not to one initiative', 'data-cal3-notes': 'row-board' }, 'board') : null,
272
- !linked(r) && !mode && !sub ? el('span', { class: 'tag', title: 'Not linked to a meeting', 'data-cal3-notes': 'no-meeting' }, 'no meeting') : null,
273
- r.conflicts ? el('span', { class: 'st warn', title: r.conflicts + (r.conflicts === 1 ? ' statement differs' : ' statements differ') + ' from a file' }, c3ic('alert', 'sm'), String(r.conflicts)) : null)],
274
- () => choose(s, r.id)),
275
- el('span'));
276
- }
277
-
278
- /* ── the note ─────────────────────────────────────────────────────────────────────────────────────────────────────── */
279
-
280
- function noteCol(s) {
281
- const n = s.note;
282
- if (!s.open) return el('div', { 'data-cal3-notes': 'note' }, el('section', { class: 'card' }, fold('doc', s.rows && s.rows.length ? 'Choose a note to read it.' : 'Notes you record show here.')));
283
- if (!n) return el('div', { 'data-cal3-notes': 'note' }, el('section', { class: 'card' }, fold('clock', 'Reading the note', { role: 'status' })));
284
- const mode = held(n.id);
285
- const ph = s.phase || (mode ? 'during' : 'after');
286
- const ev = n.meeting && n.meeting.kind === 'event' ? n.meeting : null;
287
- const len = mins(lenOf(n));
288
- const head = el('section', { class: 'card', 'data-cv': 'stage-head' },
289
- el('div', { class: 'cal3-nhead' },
290
- el('span', { class: 'chips2' }, el('b', { 'data-cal3-notes': 'title' }, n.title || 'Untitled note'), el('span', { class: 'mono dim cal3-sm' }, mode ? 'now' : hm(startOf(n)))),
291
- el('div', { class: 'stg', role: 'group', 'aria-label': 'Note stage', 'data-cv': 'phase' },
292
- PHASES.map(([k, ic, l]) => btn('sgb', { 'data-cal3-phase': k, 'aria-pressed': String(ph === k), title: l }, [c3ic(ic), el('span', null, l)], () => { s.phase = k; draw(s); })))),
293
- el('div', { class: 'chips2 dim cal3-sm' },
294
- [dayOf(startOf(n)), len].filter(Boolean).join(' · '),
295
- btn('ib sm', { title: 'Copy as Markdown (with the meeting context)', 'aria-label': 'Copy as Markdown', 'data-cal3-notes': 'copy' }, c3ic('clip'), () => copy(n)),
296
- btn('ib sm', { title: 'Delete this note', 'aria-label': 'Delete note', 'data-cal3-notes': 'delete' }, c3ic('trash'), () => remove(s, n))),
297
- links(s, n, ev), seriesLine(s, n));
298
- const body = ph === 'before' ? before(s, n) : ph === 'during' ? during(s, n, mode) : [sinceCard(s, n), after(s, n, mode)].filter(Boolean);
299
- return el('div', { class: 'cal3-ncol', 'data-cal3-notes': 'note', 'data-cal3-note': n.id, 'data-cal3-stage': ph }, head, ...[].concat(body));
300
- }
301
-
302
- /* the note's meeting (view-notes.js picker) and what it is about (aboutMenu), each with what it is linked to, then Link or Change */
303
- function links(s, n, ev) {
304
- const adhoc = n.meeting && n.meeting.kind === 'adhoc';
305
- const when = ev ? [dayOf(ev.start), hm(ev.start) + (ev.end ? ' to ' + hm(ev.end) : '')].filter(Boolean).join(' ') : '';
306
- return el('div', { class: 'cal3-nlinks cal3-sm', 'data-cal3-notes': 'links' },
307
- el('span', { class: 'chips2' }, c3ic('cal', 'sm'),
308
- ev ? el('span', { 'data-cal3-notes': 'meeting' }, el('b', null, ev.title), ' · ' + when)
309
- : el('span', { class: 'dim', 'data-cal3-notes': 'meeting' }, adhoc ? 'A meeting that is not on the calendar' : 'No meeting'),
310
- !ev && !adhoc ? el('span', { class: 'tag' }, 'no meeting') : null,
311
- btn('chip2 lk', { 'data-cal3-notes': 'meeting-link', title: ev || adhoc ? 'Link the note to another meeting' : 'Link the note to a meeting on the calendar' }, ev || adhoc ? 'Change' : 'Link to a meeting', () => V.linkMeeting(vctx(s), n.id)),
312
- ev ? btn('chip2 lk', { 'data-cal3-notes': 'show-meeting', title: 'Show the meeting in the calendar' }, [c3ic('next', 'sm'), 'Show in the calendar'], () => showMeeting(s, ev)) : null),
313
- aboutLine(s, n));
314
- }
315
- function aboutLine(s, n) {
316
- const path = pathOf(n);
317
- const b = btn('chip2 lk', { 'data-cal3-notes': 'about-link', title: 'Choose what the note is about: the Portfolio, a board or an initiative' }, path.length ? 'Change' : 'Choose what it is about', () => aboutMenu(s, n, b));
318
- return el('span', { class: 'chips2' }, c3ic('init', 'sm'),
319
- path.length ? el('span', { 'data-cal3-notes': 'about' }, el('b', null, path.join(' › '))) : el('span', { class: 'dim', 'data-cal3-notes': 'about' }, 'Not linked to the Portfolio, a board or an initiative'),
320
- b);
321
- }
322
-
323
- /* each board with its Now and next initiatives (GET /api/boards/backlog), kept for a minute once the repository is read */
324
- async function boardsWithInitiatives(s) {
325
- if (s.about && Date.now() - s.about.at < 60000) return s.about.boards;
326
- const r = await pmGet('/api/boards');
327
- if (!r || !r.ok || !Array.isArray(r.boards)) throw new Error((r && r.error) || 'the boards could not be read');
328
- const boards = r.boards.filter((b) => b && b.id && !b.error);
329
- let pending = !!r.pending;
330
- await Promise.all(boards.map(async (b) => {
331
- const x = await pmGet('/api/boards/backlog?ws=' + encodeURIComponent(b.ws || '') + '&board=' + encodeURIComponent(b.id) + '&limit=100');
332
- if (!x || !x.ok || x.pending || b.pending) pending = true;
333
- b.inis = x && x.ok && Array.isArray(x.rows) ? x.rows : [];
334
- }));
335
- // while the repository is still being read, the initiatives are not all known: the next open reads them again
336
- s.about = pending ? null : { at: Date.now(), boards };
337
- return boards;
338
- }
339
-
340
- /* What is this note about? One menu: Portfolio (every board), each board (the whole board) with its initiatives under it, and
341
- * Not linked when the note has a link. Choosing one saves it (POST /api/notes/link) and the note moves into its group. */
342
- async function aboutMenu(s, n, anchor) {
343
- let boards;
344
- try { boards = await boardsWithInitiatives(s); } catch (e) { toast('The boards could not be read: ' + e.message); return; }
345
- if (!anchor.isConnected) return;
346
- const cur = n.initiative ? 'i:' + (n.initiative.ws || '') + '/' + n.initiative.id : n.board ? 'b:' + boardKey(n.board) : n.portfolio ? 'p' : '';
347
- const save = async (body, said) => {
348
- const r = await pmPost('/api/notes/link', { id: n.id, ...body });
349
- if (!r || !r.ok) { toast('Not saved' + ((r && r.error) ? ': ' + r.error : '')); return; }
350
- toast(said);
351
- refreshNotes();
352
- read(s);
353
- };
354
- const item = (k, label, detail, ic, on, sub) => ({ label, detail, role: 'menuitemradio', iconNode: sub ? el('span', { class: 'cal3-mind' }, icon(ic)) : icon(ic),
355
- attrs: { 'data-cal3-about': k, 'aria-checked': String(cur === k) }, onSelect: on });
356
- const items = [item('p', 'Portfolio', 'every board', 'chart-column', () => save({ portfolio: true }, 'About the Portfolio. The note moved into its group.'))];
357
- for (const b of boards) {
358
- const board = { id: b.id, ws: b.ws || null, title: b.name || b.id };
359
- items.push(item('b:' + boardKey(b), board.title, 'the whole board', 'square-kanban', () => save({ board, initiative: null }, 'About ' + board.title + '. The note moved into its group.')));
360
- for (const i of b.inis || []) {
361
- items.push(item('i:' + (b.ws || '') + '/' + i.id, i.title || i.id, null, 'target',
362
- () => save({ board, initiative: { id: i.id, ws: b.ws || null, title: i.title || i.id } }, 'About ' + (i.title || i.id) + ' on ' + board.title + '. The note moved into its group.'), true));
363
- }
364
- }
365
- if (cur) items.push({ sep: true }, item('none', 'Not linked', 'remove the link', 'x', () => save({ portfolio: false, board: null, initiative: null }, 'Not linked to the Portfolio, a board or an initiative.')));
366
- menu({ anchor, items, ariaLabel: 'What is this note about?' });
367
- }
368
-
369
- /* the replay of the note's kept audio: one <audio> per note, kept across redraws so playback goes on (as dest-notes.js does) */
370
- function replayOf(s, n) {
371
- const rec = s.rec;
372
- if (!rec || n.private) { s.audio = null; return null; }
373
- const key = n.id + ':' + rec.bytes + ':' + (rec.cleaned ? 1 : 0);
374
- if (s.audio && (s.audio.key === key || !s.audio.el.paused)) return s.audio.el;
375
- const a = el('audio', { controls: true, preload: 'metadata', class: 'nt-audio cal3-audio', 'data-cal3-notes': 'audio', src: '/api/notes/recording?id=' + encodeURIComponent(n.id) + '&b=' + rec.bytes + (rec.cleaned ? '&c=1' : '') });
376
- s.audio = { key, el: a };
377
- return a;
378
- }
379
- /* "Replay": the full-screen replay of the meeting (c3-replay.js): the topics, key points, shots and conversation along the audio */
380
- function openReplayBtn(s, n) {
381
- return btn('chip2 lk', { 'data-cal3-notes': 'open-replay', title: 'Open the meeting replay: the topics, the key points, the screen and the conversation along the audio' }, [c3ic('play', 'sm'), 'Replay'], () => {
382
- if (s.audio && s.audio.el) { try { s.audio.el.pause(); } catch { /* none */ } }
383
- import('./c3-replay.js').then((m) => m.openReplay({ note: n.id })).catch(() => toast('The replay could not load.'));
384
- });
385
- }
386
- function seek(s, ms) {
387
- const a = s.audio && s.audio.el;
388
- if (!a) return;
389
- try { a.currentTime = Math.max(0, ms / 1000); a.play(); } catch { /* the audio is not ready */ }
390
- }
391
-
392
- const vctx = (s) => ({ state: {}, setState: () => { if (s.box.isConnected) { read(s); } } });
393
- const linkButtons = (s, n) => el('div', { class: 'chips2' },
394
- btn('chip2 lk', { 'data-cal3-notes': 'link-meeting' }, [c3ic('cal', 'sm'), 'Link to a meeting'], () => V.linkMeeting(vctx(s), n.id)),
395
- btn('chip2 lk', { 'data-cal3-notes': 'link-about' }, [c3ic('init', 'sm'), 'Choose what it is about'], (e) => aboutMenu(s, n, e.currentTarget)));
396
-
397
- /* a row of the stage's prepared list: the icon, the label, what it holds */
398
- const prepRow = (icon, label, detail, done) => el('div', { class: 'chips2 cal3-prep', 'data-cal3-prep': label },
399
- el('span', { class: 'ki' }, c3ic(icon)),
400
- el('div', { class: 'cal3-prepb' }, el('b', null, label), el('div', { class: 'dim' }, detail)),
401
- done ? el('span', { class: 'st ok', title: done }, c3ic('check', 'sm')) : null);
402
-
403
- function before(s, n) {
404
- const ev = n.meeting && n.meeting.kind === 'event' ? n.meeting : null;
405
- const h3 = el('h3', null, c3ic('spark'), 'Before the meeting');
406
- if (!ev) {
407
- return el('section', { class: 'card', 'data-cv': 'stage-before' }, h3, ...carriedIn(s.place),
408
- fold('info', n.meeting && n.meeting.kind === 'adhoc' ? 'A meeting that is not on the calendar, so nothing was prepared for it.' : 'Not linked to a meeting, so nothing was prepared. Link it to a meeting to bring in its people and agenda.', { 'data-cal3-notes': 'no-meeting-before' }),
409
- linkButtons(s, n));
410
- }
411
- const c = ev.context || null;
412
- const lines = transcriptOf(n).map((x) => ({ t: x.t, text: x.text }));
413
- const pl = s.place && s.place.key ? s.place : null;
414
- const heard = c ? agendaHeard(c, lines) : [];
415
- const rows = [];
416
- const isHeard = (i) => heard[i] !== null && heard[i] !== undefined;
417
- if (c && c.agenda && c.agenda.length) rows.push(prepRow('spark', 'Agenda', el('span', null, c.agenda.map((a, i) => el('span', { class: 'cal3-agi', 'data-cal3-heard': isHeard(i) ? 'true' : 'false', title: isHeard(i) ? 'Heard in the transcript' : null }, (i ? ' · ' : '') + a, isHeard(i) ? c3ic('check', 'sm') : null))), heard.some((x) => x !== null) ? heard.filter((x) => x !== null).length + ' of ' + c.agenda.length + ' heard' : null));
418
- if (c && c.purpose) rows.push(prepRow('target', 'What it is for', c.purpose));
419
- if (c && c.prep) rows.push(prepRow('scale', 'To be ready', c.prep));
420
- const files = [...((c && c.links) || []).map((l) => el('a', { class: 'chip2 lk', href: l.url, target: '_blank', rel: 'noopener noreferrer' }, c3ic('out', 'sm'), l.label)),
421
- ...((c && c.refs) || []).map((x) => (x.link ? el('a', { class: 'chip2 lk', href: x.link, target: '_blank', rel: 'noopener noreferrer' }, c3ic('doc', 'sm'), x.label) : el('span', { class: 'chip2' }, c3ic('doc', 'sm'), x.label)))];
422
- if (files.length) rows.push(prepRow('doc', 'Read first', el('span', { class: 'chips2 cal3-wrapl' }, files)));
423
- const names = peopleOf(c);
424
- if (names.length) rows.push(prepRow('user', 'People', el('span', { class: 'chips2 cal3-wrapl' }, names.map(avatar))));
425
- else if (c && c.attendees) rows.push(prepRow('user', 'People', c.attendees + ' attendees. Names are not kept while calendar names are off.'));
426
- const when = (ev.start ? dayOf(ev.start) + ' ' + hm(ev.start) : '') + (ev.end ? ' to ' + hm(ev.end) : '');
427
- rows.push(prepRow('cal', 'Meeting', [ev.title, when, c && c.where ? 'where: ' + c.where : null, c && c.organizer ? 'organizer: ' + c.organizer : null,
428
- c && c.series ? 'series: ' + c.series : null, c && c.role ? 'your role: ' + c.role : null, c && c.external ? 'with people outside the company' : null,
429
- c && c.attendees && names.length ? c.attendees + ' attendees' : null].filter(Boolean).join(' · ')));
430
- return el('section', { class: 'card', 'data-cv': 'stage-before' }, h3, ...carriedIn(pl), ...rows,
431
- c ? null : el('p', { class: 'dim cal3-sm' }, 'The calendar gave no more about this meeting.'));
432
- }
433
-
434
- function during(s, n, mode) {
435
- const head = el('div', { class: 'c3cv-head' }, el('h3', null, c3ic('mic'), mode ? 'Live notes' : 'Transcript'), recordButton(s, n, mode));
436
- if (mode) {
437
- if (!s.live || s.live.id !== n.id) s.live = { id: n.id, host: el('div', { 'data-cal3-notes': 'live' }) };
438
- s.live.host.replaceChildren();
439
- const drawn = V.renderLive(s.live.host, vctx(s), n.id);
440
- return el('section', { class: 'card', 'data-cv': 'stage-during' }, head,
441
- drawn ? s.live.host : fold('mic', 'This note is being recorded in another window.'),
442
- el('div', { class: 'chips2 dim mono cal3-sm' }, c3ic('lock', 'sm'), 'transcribed on this machine' + (mode === 'paused' ? ' · paused' : '')));
443
- }
444
- const tr = transcriptOf(n);
445
- return el('section', { class: 'card', 'data-cv': 'stage-during' }, head,
446
- tr.length ? el('div', { class: 'term cal3-term', 'data-cal3-notes': 'transcript' }, tr.map((x) => V.fmtTime(x.t || 0) + ' ' + (x.who ? V.speakerOf(n, x.who) + ': ' : '') + x.text).join('\n'))
447
- : fold('mic', 'Nothing was transcribed for this note.', { 'data-cal3-notes': 'no-transcript' }),
448
- el('div', { class: 'chips2 dim mono cal3-sm' }, c3ic('lock', 'sm'), 'transcribed on this machine' + (tr.length ? ' · ' + tr.length + (tr.length === 1 ? ' line' : ' lines') : '')));
449
- }
450
-
451
- /* Record, Resume or Stop, as the note allows (dest-notes.js noteParts): a note being recorded stops; a paused one resumes;
452
- * a note never recorded records; a stopped meeting has none. */
453
- function recordButton(s, n, mode) {
454
- if (n.private) return null;
455
- const rb = (label, icon, title, on) => btn('ib pri cal3-recb', { 'data-cal3-notes': 'rec', title, 'aria-label': label }, [c3ic(icon), label], async () => { await on(); setTimeout(() => read(s), 400); });
456
- if (mode === 'recording') return rb('Stop', 'stop', 'Stop and write the final notes', () => dock.stopNow());
457
- if (mode === 'paused') return rb('Resume', 'play', 'Resume the paused meeting', () => dock.resumeNow());
458
- if (n.state === 'idle' || (n.state === undefined && !(n.transcript || []).length)) {
459
- const busy = dock.recordState().mode === 'recording';
460
- const b = rb('Record', 'mic', busy ? 'Pause or stop the meeting being recorded first' : 'Record this note. Notes stay on this machine.', () => (busy ? null : dock.recordNote(n.id)));
461
- if (busy) b.disabled = true;
462
- return b;
463
- }
464
- return null;
465
- }
466
-
467
- function after(s, n, mode) {
468
- const p = partsOf(n);
469
- const names = n.meeting && n.meeting.context ? peopleOf(n.meeting.context) : [];
470
- const cf = conflictsOf(n);
471
- const kids = [
472
- el('div', { class: 'c3cv-head' }, el('h3', null, c3ic('notes'), 'Notes'), recordButton(s, n, mode)),
473
- el('div', { class: 'chips2' }, el('b', null, n.title || 'Untitled note'), el('span', { class: 'dim mono cal3-sm' }, [dayOf(startOf(n)), mins(lenOf(n))].filter(Boolean).join(' · ')), ...names.map(avatar)),
474
- ...(() => { const rp = mode ? null : replayOf(s, n); return rp ? [el('div', { class: 'cal3-replay', 'data-cal3-notes': 'replay' }, el('div', { class: 'c3cv-head' }, el('h4', null, 'Replay'), openReplayBtn(s, n)), rp, el('p', { class: 'dim cal3-sm' }, 'Kept on this machine.'))] : []; })(),
475
- ...cf.map((c) => el('div', { class: 'fold w', 'data-cal3-notes': 'conflict' }, c3ic('alert', 'sm'), '“' + c.text + '” differs from ', el('span', { class: 'mono' }, c.doc + (c.line ? ':' + c.line : '')))),
476
- p.overview || !mode ? editable(true, 'p', p.overview, 'Summary', (t) => saveFinal(s, n, 'overview', 0, t), { class: 'cal3-ov', 'data-cal3-notes': p.overview ? 'overview' : 'no-overview' }, p.from === 'final' ? null : 'Write a summary of the meeting')
477
- : el('p', { class: 'dim cal3-ov', 'data-cal3-notes': 'no-overview' }, 'The overview is written when you stop recording.'),
478
- ];
479
- // each part of a decision or a next step is corrected in place: in the final notes (/api/notes/final-edit), or in the bullet
480
- // it was caught from (/api/notes/bullet). A bullet has no why, so a caught decision's why is not shown.
481
- const fin = p.from === 'final';
482
- const cell = (x, field, label, ph, cls) => {
483
- const on = fin || (x.bullet !== undefined && field !== 'why');
484
- return el('td', cls ? { class: cls } : null, editable(on, 'span', x[field] || '', label, (t) => saveItem(s, n, x, field, t), { 'data-cal3-notes-field': field }, ph));
485
- };
486
- if (p.decisions.length) kids.push(el('table', { class: 'tbl', 'data-cv': 'decisions' }, el('thead', null, el('tr', null, el('th', null, 'Decision'), fin ? el('th', null, 'Why') : null)),
487
- el('tbody', null, p.decisions.map((d) => el('tr', { 'data-cal3-notes': 'decision' }, cell(d, 'text', 'Decision'), fin ? cell(d, 'why', 'Why', 'Add why', 'dim') : null)))));
488
- if (p.actions.length) kids.push(el('table', { class: 'tbl', 'data-cv': 'actions' }, el('thead', null, el('tr', null, el('th', null, 'Next step'), el('th', null, 'Owner'), el('th', null, 'Due'), el('th'))),
489
- el('tbody', null, p.actions.map((a) => el('tr', { 'data-cal3-notes': 'action' }, cell(a, 'text', 'Next step'),
490
- cell(a, 'owner', 'Owner', 'No owner'), cell(a, 'due', 'Due', 'No date'),
491
- el('td', { class: 'cal3-tdr' }, carriedTag(s, a), btn('chip2 lk', { 'data-cal3-notes': 'make-task', title: n.initiative ? 'Add this step to ' + iniName(n.initiative) + ' as a plan item' : 'Link the note to an initiative first' },
492
- [c3ic('plus', 'sm'), 'Make task'], (e) => makeTask(n, a, { btn: e.currentTarget }))))))));
493
- if (p.questions.length) kids.push(el('div', { class: 'cal3-ctx', 'data-cal3-notes': 'questions' }, el('h4', null, 'Open questions'),
494
- el('ul', { class: 'cal3-cl', role: 'list' }, p.questions.map((x) => el('li', { class: 'cal3-ci' }, el('span', { class: 'tag' }, 'Question'), el('span', { class: 'cal3-ct' }, x.text))))));
495
- const hl = n.highlights || [];
496
- if (hl.length) kids.push(el('div', { class: 'cal3-ctx', 'data-cal3-notes': 'highlights' }, el('h4', null, 'Highlights'),
497
- el('ul', { class: 'cal3-cl', role: 'list' }, hl.map((x) => el('li', { class: 'cal3-ci' }, el('span', { class: 'dim mono cal3-at' }, typeof x.t === 'number' ? V.fmtTime(x.t) : ''), el('span', { class: 'tag' }, x.label || 'Highlight'), el('span', { class: 'cal3-ct' }, x.text))))));
498
- if (!p.overview && !p.decisions.length && !p.actions.length && !p.questions.length && !hl.length && !cf.length && !(s.shots || []).length) kids.push(fold('moon', mode ? 'Decisions and next steps show here as they are caught, and in full after you stop.' : 'No decisions, next steps or questions are held for this note.', { 'data-cal3-notes': 'nothing' }));
499
- // the screenshots of the shared screen, after Stop, as the main app's Notes shows them (notes-screen-view.js)
500
- const shots = mode || n.private ? [] : s.shots || [];
501
- const asideN = mode || n.private ? 0 : s.aside || 0; // shots set aside as another app: "N set aside" opens their review
502
- if (shots.length || asideN) kids.push(el('div', { 'data-cal3-notes': 'screen' }, screenStrip({ id: n.id, frames: shots, aside: asideN, seek: s.audio ? (ms) => seek(s, ms) : null, replay: s.audio ? s.audio.el : null })));
503
- const tr = transcriptOf(n);
504
- if (!mode && tr.length) kids.push(el('details', { 'data-cal3-notes': 'transcript-fold' }, el('summary', { class: 'dim cal3-sm' }, 'Transcript · ' + tr.length + (tr.length === 1 ? ' line' : ' lines')),
505
- el('div', { class: 'term cal3-term' }, tr.map((x) => V.fmtTime(x.t || 0) + ' ' + x.text).join('\n'))));
506
- return el('section', { class: 'card cal3-ncard', 'data-cv': 'notes' }, kids);
507
- }
508
-
509
- /** A text the PM corrects in place: a click puts the cursor in it, leaving it saves, Esc puts it back. With a placeholder
510
- * (`ph`), the text may be empty: the placeholder shows, and emptying the text clears it; without one, an empty text is refused. */
511
- function editable(on, tag, text, label, save, attrs, ph) {
512
- if (!on) return el(tag, attrs || null, text || (ph ? el('span', { class: 'dim' }, ph) : ''));
513
- const node = el(tag, { ...(attrs || {}), class: [attrs && attrs.class, ph ? 'cal3-ed' : null].filter(Boolean).join(' ') || null, contenteditable: 'true', spellcheck: 'true', role: 'textbox', 'aria-label': 'Edit ' + label, 'data-cal3-notes-edit': '', 'data-ph': ph || null }, text);
514
- let last = text;
515
- node.addEventListener('keydown', (e) => {
516
- if (e.key === 'Enter' && tag !== 'p') { e.preventDefault(); node.blur(); }
517
- if (e.key === 'Escape') { e.preventDefault(); node.textContent = last; node.blur(); }
518
- });
519
- node.addEventListener('blur', async () => {
520
- const v = node.textContent.replace(/\s+/g, ' ').trim();
521
- if ((!v && !ph) || v === last) { node.textContent = last; return; }
522
- if (await save(v)) { last = v; node.textContent = v; } else node.textContent = last;
523
- });
524
- return node;
525
- }
526
- /* one part of a decision or a next step: in the final notes, or in the bullet it was caught from */
527
- async function saveItem(s, n, x, field, text) {
528
- if (x.sec) return saveFinal(s, n, x.sec, x.i, text, field === 'text' ? undefined : field);
529
- const r = await pmPost('/api/notes/bullet', { id: n.id, bullet: x.bullet, [field]: text });
530
- if (!r || !r.ok) { toast('Not saved' + ((r && r.error) ? ': ' + r.error : '')); return false; }
531
- const b = (n.bullets || []).find((y) => y && y.id === x.bullet);
532
- if (b) Object.assign(b, r.bullet);
533
- x[field] = text;
534
- toast('Saved');
535
- return true;
536
- }
537
- async function saveFinal(s, n, sec, i, text, field) {
538
- const r = await pmPost('/api/notes/final-edit', field ? { id: n.id, sec, i, text, field } : { id: n.id, sec, i, text });
539
- if (!r || !r.ok) { toast('Not saved' + ((r && r.error) ? ': ' + r.error : '')); return false; }
540
- if (r.final_notes) n.final_notes = r.final_notes;
541
- if ('overview_pm' in r) { if (r.overview_pm) n.overview_pm = r.overview_pm; else delete n.overview_pm; }
542
- toast('Saved');
543
- return true;
544
- }
545
- async function copy(n) {
546
- try { await navigator.clipboard.writeText(V.noteMarkdown(n)); toast('The note is on the clipboard as Markdown, with its meeting context.'); }
547
- catch { toast('The clipboard was not available.'); }
548
- }
549
-
550
- /* Delete: asked first, as the main app's Notes asks (view-notes.js deleteNote). A note being recorded stops without keeping its
551
- * audio, then the note, its transcript, audio and screenshots go (POST /api/notes/delete). The next note in the list opens. */
552
- async function remove(s, n) {
553
- const name = n.title || 'Untitled note';
554
- const sure = await askConfirm({ title: 'Delete "' + name + '"?', body: 'The note, its transcript, its summaries and its kept audio are deleted from this machine. Its summary goes from the calendar and the initiative. This cannot be undone.', confirmLabel: 'Delete note', cancelLabel: 'Keep it', danger: true });
555
- if (!sure) return;
556
- if (!(await V.discardRecording({ state: {}, setState: () => {} }, n.id))) { toast('"' + name + '" was not deleted.'); return; }
557
- dock.forget(n.id);
558
- s.rows = (s.rows || []).filter((x) => x.id !== n.id);
559
- s.open = null; s.note = null; s.phase = null; s.shots = []; s.rec = null; s.audio = null;
560
- toast('"' + name + '" was deleted.');
561
- refreshNotes();
562
- read(s);
563
- }
564
-
565
- /* ── a meeting series (initiative c3-notes-series) ────────────────────────────────────────────────────────────────── */
566
-
567
- /* the words of an item, as lib/notes-series.js norm() matches them */
568
- const normItem = (t) => String(t || '').toLowerCase().replace(/[^\p{L}\p{N}]+/gu, ' ').trim();
569
- const plural = (n, one, many) => n + ' ' + (n === 1 ? one : many || one + 's');
570
- const sect = (name, ic, title, count, kids) => el('section', { class: 'card sect', 'data-cal3-series-card': name },
571
- el('div', { class: 'sh2' }, el('h2', null, c3ic(ic, 'sm'), title, count !== null && count !== undefined ? el('span', { class: 'bdg g' }, String(count)) : null)), kids);
572
-
573
- /* "carried · meeting N": the step was raised in N meetings of the series up to this one */
574
- function carriedTag(s, a) {
575
- const k = s.place && s.place.carried ? s.place.carried[normItem(a.text)] : 0;
576
- return k ? el('span', { class: 'st ' + (k >= 3 ? 'warn' : 'unt'), title: 'Raised in ' + k + ' meetings of this series', 'data-cal3-notes': 'carried' }, 'carried · meeting ' + k) : null;
577
- }
578
-
579
- /* Before: what was still open coming in from the meeting before */
580
- function carriedIn(pl) {
581
- if (!pl || !pl.prev) return [];
582
- return [prepRow('notes', 'Carried in from ' + dayOf(pl.prev.at), pl.prev.overview || 'The meeting before in this series.'),
583
- ...(pl.carried_in || []).map((x) => prepRow('todo', x.text, x.owner || 'No owner'))];
584
- }
585
-
586
- /* the head's series line: the meeting before, "IDPF - DSU · 4 of 21" (opens the series), the meeting after, and Take out;
587
- * a note in no series offers Add to a series, and one taken out offers to go back */
588
- function seriesLine(s, n) {
589
- const pl = s.place;
590
- if (pl && pl.key) {
591
- const go = (x, ic, label) => { const b = btn('ib sm', { 'data-cal3-notes': 'series-' + label, title: x ? 'The meeting ' + (label === 'prev' ? 'before' : 'after') + ', ' + dayOf(x.at) : 'None ' + (label === 'prev' ? 'before' : 'after'), 'aria-label': label === 'prev' ? 'The meeting before' : 'The meeting after' }, c3ic(ic, 'sm'), () => { if (x) choose(s, x.id, s.phase); }); if (!x) b.disabled = true; return b; };
592
- return el('div', { class: 'chips2 cal3-sm cal3-nserl', 'data-cal3-notes': 'series-line' }, go(pl.prev, 'prev', 'prev'),
593
- btn('chip2 lk', { 'data-cal3-notes': 'series-open-page', title: 'Open the series: what is still open, decided and coming up' }, [c3ic('notes', 'sm'), pl.title + ' · ' + pl.pos + ' of ' + pl.count], () => chooseSeries(s, pl.key)),
594
- go(pl.next, 'next', 'next'),
595
- btn('chip2 lk', { 'data-cal3-notes': 'series-out', title: 'This note is not a meeting of this series' }, 'Not part of this series', () => member(s, n, 'off')));
596
- }
597
- if (n.series_pm === 'off') return el('div', { class: 'chips2 cal3-sm cal3-nserl', 'data-cal3-notes': 'series-line' }, c3ic('notes', 'sm'), el('span', { class: 'dim' }, 'Taken out of its series'),
598
- btn('chip2 lk', { 'data-cal3-notes': 'series-back' }, 'Put it back', () => member(s, n, null)));
599
- const size = new Map();
600
- for (const r of s.rows || []) { const k = seriesKeyOf(r); if (k) size.set(k, (size.get(k) || [])); if (k) size.get(k).push(r); }
601
- const series = [...size.entries()].filter(([, rs]) => rs.length >= 2 && !rs.some((r) => r.id === n.id));
602
- if (!series.length || n.private) return null;
603
- const b = btn('chip2 lk', { 'data-cal3-notes': 'series-add', title: 'Keep this note with the notes of a regular meeting' }, [c3ic('notes', 'sm'), 'Add to a series'], () => {
604
- menu({ anchor: b, ariaLabel: 'Add to a series', items: series.map(([k, rs]) => {
605
- const r = rs.slice().sort((x, y) => (Date.parse(startOf(y)) || 0) - (Date.parse(startOf(x)) || 0))[0];
606
- const title = (r.meeting && r.meeting.kind === 'event' && r.meeting.title) || r.title || 'Untitled meeting';
607
- return { label: title, detail: plural(rs.length, 'meeting'), iconNode: icon('notes'), attrs: { 'data-cal3-series-pick': k }, onSelect: () => member(s, n, k) };
608
- }) });
609
- });
610
- return el('div', { class: 'chips2 cal3-sm cal3-nserl', 'data-cal3-notes': 'series-line' }, b);
611
- }
612
- async function member(s, n, key) {
613
- const r = await pmPost('/api/notes/series-member', { id: n.id, key });
614
- if (!r || !r.ok) { toast('Not saved' + ((r && r.error) ? ': ' + r.error : '')); return; }
615
- toast(key === 'off' ? 'Taken out of the series.' : key ? 'Added to the series.' : 'Back in its series.');
616
- n.series_pm = key || undefined;
617
- refreshNotes();
618
- read(s);
619
- }
620
-
621
- /* After: Since the last one. Each next step of the meeting before: Done (you marked it), Raised again (this note has it) or
622
- * Not mentioned; then this note's new steps. */
623
- function sinceCard(s, n) {
624
- const pl = s.place;
625
- if (!pl || !pl.since || n.private) return null;
626
- const st = { done: ['ok', 'Done', 'check'], again: ['warn', 'Raised again', 'todo'], quiet: ['unt', 'Not mentioned', 'todo'] };
627
- const rows = [
628
- ...pl.since.items.map((x) => el('li', { class: 'nrow', 'data-cal3-since': x.state }, el('span', { class: 'ki' }, c3ic(st[x.state][2])),
629
- el('div', { class: 'nb' }, el('span', { class: 'tt' }, x.text), el('div', { class: 'chips' }, el('span', { class: 'st ' + st[x.state][0] }, st[x.state][1]), x.owner ? el('span', { class: 'dim cal3-xs' }, x.owner) : null)), el('span'))),
630
- ...pl.since.fresh.map((x) => el('li', { class: 'nrow', 'data-cal3-since': 'new' }, el('span', { class: 'ki' }, c3ic('plus')),
631
- el('div', { class: 'nb' }, el('span', { class: 'tt' }, x.text), el('div', { class: 'chips' }, el('span', { class: 'tag' }, 'New'), x.owner ? el('span', { class: 'dim cal3-xs' }, x.owner) : null)), el('span'))),
632
- ];
633
- return el('section', { class: 'card sect', 'data-cal3-notes': 'since' },
634
- el('div', { class: 'sh2' }, el('h2', null, c3ic('notes', 'sm'), 'Since the last one, ' + dayOf(pl.since.at))),
635
- rows.length ? el('ul', { class: 'list', role: 'list' }, rows) : fold('info', 'The meeting before had no next steps, and this one has none.'));
636
- }
637
-
638
- /* The series page: the head, Next one, Still open and Decided so far, Keeps coming up and Still unanswered, Every meeting.
639
- * Every line comes from the series' notes (GET /api/notes/series) or from the PM's own marks and lines. */
640
- function seriesCol(s) {
641
- const T = s.thread;
642
- if (!T) return el('div', { 'data-cal3-notes': 'series' }, el('section', { class: 'card' }, fold('clock', 'Reading the series', { role: 'status' })));
643
- const a = T.about || {};
644
- const about = a.initiative ? [boardName(a.board), iniName(a.initiative)].filter(Boolean).join(' › ') : a.board ? boardName(a.board) : a.portfolio ? 'Portfolio' : null;
645
- const joined = (T.joined.calendar ? 'From the calendar series' : 'Notes with the same title')
646
- + (T.joined.calendar && T.joined.title ? ', plus ' + plural(T.joined.title, 'note') + ' with the same title' : '') + (T.joined.pm ? ', ' + T.joined.pm + ' added by you' : '') + '.';
647
- const head = el('section', { class: 'card', 'data-cv': 'stage-head', 'data-cal3-notes': 'series-head' },
648
- el('div', { class: 'cal3-nhead' }, el('span', { class: 'chips2' }, el('b', { 'data-cal3-notes': 'title' }, T.title), el('span', { class: 'tag' }, 'series')),
649
- btn('ib sm', { title: 'Copy the series as Markdown', 'aria-label': 'Copy as Markdown', 'data-cal3-notes': 'copy' }, c3ic('clip'), () => copySeries(T))),
650
- el('div', { class: 'chips2 dim cal3-sm' }, plural(T.count, 'meeting') + ' since ' + dayOf(T.since)),
651
- el('div', { class: 'chips2 cal3-sm' }, about ? el('span', { class: 'chip2' }, c3ic(a.portfolio && !a.board ? 'org' : 'init', 'sm'), about) : null, el('span', { class: 'dim', 'data-cal3-notes': 'series-joined' }, joined)));
652
- return el('div', { class: 'cal3-ncol', 'data-cal3-notes': 'series', 'data-cal3-series': T.key }, head, nextCard(s, T),
653
- el('div', { class: 'cal3-two' }, openCard(s, T), decidedCard(s, T)),
654
- el('div', { class: 'cal3-two' }, topicsCard(T), questionsCard(s, T)), everyCard(s, T));
655
- }
656
-
657
- function nextCard(s, T) {
658
- const x = T.next || {};
659
- const rows = [
660
- ...(x.bring || []).map((b) => el('div', { class: 'chips2 cal3-prep', 'data-cal3-bring': b.id }, el('span', { class: 'ki' }, c3ic('spark')),
661
- el('div', { class: 'cal3-prepb' }, el('b', null, b.text), el('div', { class: 'dim' }, 'Added by you, ' + dayOf(b.at))),
662
- btn('ib sm', { title: 'Remove this line', 'aria-label': 'Remove', 'data-cal3-notes': 'bring-remove' }, c3ic('x', 'sm'), () => seriesPost(s, '/api/notes/series-unbring', { key: T.key, id: b.id }, 'Removed.')))),
663
- ...(x.derived || []).map((d) => (d.kind === 'carried' ? prepRow('alert', d.text, 'Still open after ' + d.seen + ' meetings' + (d.owner ? ' · ' + d.owner : ''))
664
- : prepRow('info', d.text, 'Unanswered in ' + d.seen + ' meetings'))),
665
- ];
666
- const add = el('input', { type: 'text', class: 'cal3-nsearch', placeholder: 'Add something to bring up', 'aria-label': 'Add something to bring up', 'data-cal3-notes': 'bring-input', maxlength: '300' });
667
- add.addEventListener('keydown', (e) => { if (e.key === 'Enter' && add.value.trim()) { e.preventDefault(); seriesPost(s, '/api/notes/series-bring', { key: T.key, text: add.value.trim() }, 'Added. It shows here until you remove it.'); } });
668
- const when = x.at ? dayOf(x.at) + ' ' + hm(x.at) : null;
669
- return el('section', { class: 'card sect', 'data-cal3-series-card': 'next' },
670
- el('div', { class: 'sh2' }, el('h2', null, c3ic('spark', 'sm'), when ? 'Next one, ' + when : 'Next one'), when ? null : el('span', { class: 'dim cal3-sm' }, 'not on the calendar yet')),
671
- rows.length ? rows : fold('info', 'Nothing to bring up yet.', { 'data-cal3-notes': 'bring-none' }),
672
- el('div', { class: 'chips2 cal3-nadd' }, add,
673
- x.id ? btn('chip2 lk', { 'data-cal3-notes': 'series-meeting', title: 'Show the next meeting in the calendar' }, [c3ic('cal', 'sm'), 'Open the meeting'], () => showMeeting(s, { start: x.at, event_id: x.id })) : null));
674
- }
675
-
676
- function openCard(s, T) {
677
- const rows = T.open.map((o) => el('li', { class: 'nrow', 'data-cal3-open': o.key }, el('span', { class: 'ki' }, c3ic('todo')),
678
- el('div', { class: 'nb' }, el('span', { class: 'tt' }, o.text),
679
- el('div', { class: 'chips' }, o.owner ? el('span', { class: 'chip2' }, c3ic('user', 'sm'), o.owner) : null, el('span', { class: 'dim mono cal3-xs' }, 'since ' + dayOf(o.first)),
680
- el('span', { class: 'st ' + (o.seen >= 3 ? 'warn' : 'unt'), title: 'Raised in each of these meetings', 'data-cal3-notes': 'seen' }, o.seen >= 3 ? c3ic('alert', 'sm') : null, 'in ' + plural(o.seen, 'meeting'))),
681
- el('div', { class: 'dim cal3-sm' }, o.last.quote ? 'Last said: “' + o.last.quote + '” ' + dayOf(o.last.at) : 'Last raised ' + dayOf(o.last.at))),
682
- btn('chip2 lk', { 'data-cal3-notes': 'series-done', title: 'Mark it done: it stops carrying over' }, [c3ic('check', 'sm'), 'Done'], () => seriesPost(s, '/api/notes/series-done', { key: T.key, text: o.text, kind: 'action' }, 'Done. It stops carrying over.'))));
683
- const closed = T.closed.length ? el('details', { class: 'cal3-ctx', 'data-cal3-notes': 'closed' }, el('summary', null, el('b', null, 'Closed in the last two weeks'), el('span', { class: 'dim' }, ' · ' + T.closed.length)),
684
- el('ul', { class: 'list', role: 'list' }, T.closed.map((c) => el('li', { class: 'nrow' }, el('span', { class: 'ki' }, c3ic('check')),
685
- el('div', { class: 'nb' }, el('span', { class: 'tt' }, c.text), el('div', { class: 'chips' }, el('span', { class: 'dim cal3-xs' }, 'marked done ' + dayOf(c.at)))),
686
- btn('chip2 lk', { 'data-cal3-notes': 'series-undone', title: 'Open it again' }, 'Open again', () => seriesPost(s, '/api/notes/series-done', { key: T.key, text: c.text, kind: 'action', done: false }, 'Open again.')))))) : null;
687
- return sect('open', 'todo', 'Still open', T.open.length, [rows.length ? el('ul', { class: 'list', role: 'list' }, rows) : fold('info', 'Nothing is carried over.'), closed]);
688
- }
689
-
690
- function decidedCard(s, T) {
691
- return sect('decisions', 'scale', 'Decided so far', T.decisions.length, T.decisions.length ? el('ul', { class: 'list', role: 'list' }, T.decisions.map((d) => el('li', { class: 'nrow cal3-nrow' },
692
- el('span', { class: 'ki' }, c3ic('scale')),
693
- btn('cal3-nopen', { title: 'Open the note of ' + dayOf(d.at) }, [el('span', { class: 'tt' }, d.text), el('span', { class: 'chips' }, el('span', { class: 'dim mono cal3-xs' }, dayOf(d.at)), d.why ? el('span', { class: 'dim cal3-xs' }, d.why) : null)], () => choose(s, d.note)),
694
- el('span')))) : fold('info', 'No decisions yet.'));
695
- }
696
-
697
- function topicsCard(T) {
698
- if (!T.topics.length) return null;
699
- return sect('topics', 'spark', 'Keeps coming up', null, el('ul', { class: 'list', role: 'list' }, T.topics.map((t) => el('li', { class: 'nrow' }, el('span', { class: 'ki' }, c3ic('spark')),
700
- el('div', { class: 'nb' }, el('span', { class: 'tt' }, t.name), el('div', { class: 'chips' },
701
- el('span', { class: 'cal3-dots', title: 'The last ' + t.hits.length + ' meetings, newest on the left' }, t.hits.map((h) => el('i', { class: h ? 'cal3-dot on' : 'cal3-dot' }))),
702
- el('span', { class: 'dim mono cal3-xs' }, t.count + ' of last ' + t.hits.length), t.kind === 'agenda' ? el('span', { class: 'tag' }, 'agenda') : null)), el('span')))));
703
- }
704
-
705
- function questionsCard(s, T) {
706
- if (!T.questions.length) return null;
707
- return sect('questions', 'info', 'Still unanswered', T.questions.length, el('ul', { class: 'list', role: 'list' }, T.questions.map((q) => el('li', { class: 'nrow' }, el('span', { class: 'ki' }, c3ic('info')),
708
- el('div', { class: 'nb' }, el('span', { class: 'tt' }, q.text), el('div', { class: 'chips' }, el('span', { class: 'dim mono cal3-xs' }, 'asked ' + dayOf(q.first)),
709
- el('span', { class: 'st unt' }, q.seen > 1 ? 'asked in ' + q.seen + ' meetings' : 'not answered yet'))),
710
- btn('chip2 lk', { 'data-cal3-notes': 'series-answered', title: 'Mark it answered' }, [c3ic('check', 'sm'), 'Answered'], () => seriesPost(s, '/api/notes/series-done', { key: T.key, text: q.text, kind: 'question' }, 'Marked answered.'))))));
711
- }
712
-
713
- function everyCard(s, T) {
714
- const show = s.every ? T.meetings : T.meetings.slice(0, 6);
715
- const rows = show.map((m) => el('li', { class: 'nrow cal3-nrow', 'data-cal3-meeting': m.id }, el('span', { class: 'ki' }, c3ic(m.private ? 'lock' : 'doc')),
716
- btn('cal3-nopen', { title: 'Open the note of ' + dayOf(m.at) }, [el('span', { class: 'tt' }, m.private ? 'Private note' : m.overview || m.title),
717
- el('span', { class: 'chips' }, el('span', { class: 'dim mono cal3-xs' }, [dayOf(m.at), mins(m.ms)].filter(Boolean).join(' · ')),
718
- m.decisions ? el('span', { class: 'tag' }, '+' + m.decisions + ' decided') : null, m.new_actions ? el('span', { class: 'tag' }, '+' + plural(m.new_actions, 'new step')) : null,
719
- m.by === 'title' ? el('span', { class: 'tag', title: 'In the series because the title matches' }, 'by title') : m.by === 'pm' ? el('span', { class: 'tag' }, 'added by you') : null)],
720
- () => choose(s, m.id)), el('span')));
721
- const more = T.meetings.length - show.length;
722
- return sect('every', 'notes', 'Every meeting', T.meetings.length, [el('ul', { class: 'list', role: 'list' }, rows),
723
- more > 0 ? el('div', { class: 'cal3-nadd' }, btn('chip2 lk', { 'data-cal3-notes': 'series-every' }, 'Show ' + plural(more, 'earlier meeting'), () => { s.every = true; draw(s); })) : null]);
724
- }
725
-
726
- async function seriesPost(s, url, body, said) {
727
- const r = await pmPost(url, body);
728
- if (!r || !r.ok) { toast('Not saved' + ((r && r.error) ? ': ' + r.error : '')); return; }
729
- toast(said);
730
- read(s);
731
- }
732
- async function copySeries(T) {
733
- const md = ['# ' + T.title, '', plural(T.count, 'meeting') + ' since ' + dayOf(T.since) + '.', ''];
734
- if (T.open.length) md.push('## Still open', ...T.open.map((o) => '- ' + o.text + (o.owner ? ' (' + o.owner + ')' : '') + ', in ' + plural(o.seen, 'meeting')), '');
735
- if (T.decisions.length) md.push('## Decided so far', ...T.decisions.map((d) => '- ' + dayOf(d.at) + ': ' + d.text), '');
736
- if (T.questions.length) md.push('## Still unanswered', ...T.questions.map((q) => '- ' + q.text), '');
737
- md.push('## Every meeting', ...T.meetings.map((m) => '- ' + dayOf(m.at) + ': ' + (m.private ? 'Private note' : m.overview || m.title)));
738
- try { await navigator.clipboard.writeText(md.join('\n')); toast('The series is on the clipboard as Markdown.'); } catch { toast('The clipboard was not available.'); }
739
- }
740
-
741
- /* "Show in the calendar": the Calendar switch back to the grid, on the meeting's day, with the meeting selected */
742
- function showMeeting(s, ev) {
743
- const ui = s.ui; if (!ui) return;
744
- ui.st.mode = 'cal';
745
- const date = String(ev.start || '').slice(0, 10);
746
- ui.r.sel = ev.event_id || null;
747
- if (/^\d{4}-\d{2}-\d{2}$/.test(date)) ui.h.go(ui.host, ui.r, { view: 'day', date, anim: 'zi' }); else ui.redraw();
748
- }
749
-
750
- /** Read the shared notes list now (a meeting's "Open the note" needs it on the first draw). */
751
- export const primeNotes = () => refreshNotes();