create-pmos 0.399.0 → 0.401.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 (425) 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 +2 -2
  7. package/workspace/briefing-premium-board-test.js +3 -3
  8. package/workspace/briefing-premium-doc-edit-test.js +2 -8
  9. package/workspace/briefing-premium-sources-test.js +2 -0
  10. package/workspace/briefing-premium-test.js +6 -2
  11. package/workspace/briefing-premium-work-test.js +9 -4
  12. package/workspace/c3-capture-test.js +0 -17
  13. package/workspace/changelog.json +29 -0
  14. package/workspace/guide/briefing-premium.md +2 -2
  15. package/workspace/guide/home.md +24 -3
  16. package/workspace/guide/layout.md +2 -2
  17. package/workspace/guide/notes.md +2 -2
  18. package/workspace/guide/phone-companion.md +1 -1
  19. package/workspace/lib/core-docs.js +2 -2
  20. package/workspace/lib/route-modules.js +1 -9
  21. package/workspace/lib/routes-phone-day.js +18 -9
  22. package/workspace/lib/routes-slash.js +95 -0
  23. package/workspace/package-lock.json +2 -2
  24. package/workspace/package.json +1 -2
  25. package/workspace/premium-chat-goal-view-test.js +1 -1
  26. package/workspace/premium-chat-term-test.js +0 -10
  27. package/workspace/premium-menu-rows-test.js +1 -1
  28. package/workspace/premium-phone-card-test.js +8 -3
  29. package/workspace/premium-vw-cal-test.js +4 -1
  30. package/workspace/premium-vw-doc-test.js +1 -8
  31. package/workspace/premium-work-depth-test.js +2 -3
  32. package/workspace/public/capture.html +23 -0
  33. package/workspace/public/pm/c3-base.js +47 -0
  34. package/workspace/public/pm/c3-capture.js +1 -1
  35. package/workspace/public/pm/c3-ini-ui.js +1 -1
  36. package/workspace/public/pm/c3-sheet.js +1 -1
  37. package/workspace/public/pm/c3-toast.js +1 -1
  38. package/workspace/public/pm/console3.css +3 -0
  39. package/workspace/public/pm/cozy-home.css +21 -6
  40. package/workspace/public/pm/cozy-today.css +4 -3
  41. package/workspace/public/pm/cozy-viewer.js +4 -2
  42. package/workspace/public/pm/cozy.css +9 -0
  43. package/workspace/public/pm/goal-chat.js +5 -1
  44. package/workspace/public/pm/home-app.js +65 -33
  45. package/workspace/public/pm/home-chat.js +34 -29
  46. package/workspace/public/pm/home-data.js +10 -2
  47. package/workspace/public/pm/home-dictate.js +7 -4
  48. package/workspace/public/pm/home-ini.js +13 -3
  49. package/workspace/public/pm/home-list.js +18 -10
  50. package/workspace/public/pm/home-more.js +2 -2
  51. package/workspace/public/pm/home-phone-card.js +9 -4
  52. package/workspace/public/pm/home-review.js +2 -3
  53. package/workspace/public/pm/home-today.js +11 -8
  54. package/workspace/public/pm/home-work.js +13 -8
  55. package/workspace/public/pm/note-dock.js +1 -2
  56. package/workspace/public/pm/notes-links.js +1 -2
  57. package/workspace/public/pm/notes-task.js +3 -4
  58. package/workspace/public/pm/premium-board.js +1 -1
  59. package/workspace/public/pm/premium-initiative-head.js +3 -3
  60. package/workspace/public/pm/premium-vw-doc.css +20 -2
  61. package/workspace/public/pm/premium-vw-doc.js +22 -7
  62. package/workspace/public/pm/premium-vw-item.css +6 -0
  63. package/workspace/public/pm/view-notes.js +2 -2
  64. package/workspace/replaced-tests.json +435 -0
  65. package/workspace/run-tests.js +323 -28
  66. package/workspace/server.js +15 -10
  67. package/workspace/test-files.json +4 -140
  68. package/workspace/test-lists/base.json +1 -2
  69. package/workspace/test-lists/c3-desktop-light-load.json +1 -2
  70. package/workspace/test-lists/c3-initiative-boards.json +1 -2
  71. package/workspace/test-lists/c3-meeting-focus.json +2 -12
  72. package/workspace/test-lists/c3-work-agent.json +1 -2
  73. package/workspace/test-lists/calendar-tidy-up.json +1 -2
  74. package/workspace/test-lists/console3-reports.json +1 -2
  75. package/workspace/test-lists/docs-three-way-sync.json +1 -2
  76. package/workspace/test-lists/extension-capture.json +5 -0
  77. package/workspace/test-lists/jira-wbs.json +1 -2
  78. package/workspace/test-lists/legacy-cleanup-a.json +9 -0
  79. package/workspace/test-lists/meeting-material.json +1 -2
  80. package/workspace/test-lists/meeting-notes.json +2 -36
  81. package/workspace/test-lists/meeting-replay.json +1 -2
  82. package/workspace/test-lists/mm-capture.json +2 -12
  83. package/workspace/test-lists/my-work.json +2 -10
  84. package/workspace/test-lists/onboarding-firstrun.json +2 -12
  85. package/workspace/test-lists/people-directory.json +1 -2
  86. package/workspace/test-lists/run2-a.json +1 -2
  87. package/workspace/test-lists/run2-d.json +2 -19
  88. package/workspace/test-lists/run3-b.json +1 -2
  89. package/workspace/test-lists/run3-c.json +2 -12
  90. package/workspace/test-lists/run4-b.json +1 -2
  91. package/workspace/test-lists/run4-d.json +1 -5
  92. package/workspace/test-lists/run5-c.json +1 -11
  93. package/workspace/test-lists/run6.json +1 -5
  94. package/workspace/test-lists/workspace-launch-flags.json +2 -12
  95. package/workspace/test-lists/workspace-profile-detection.json +2 -10
  96. package/workspace/test-timings.json +242 -123
  97. package/workspace/c3-briefing-test.js +0 -136
  98. package/workspace/c3-core-docs-test.js +0 -170
  99. package/workspace/c3-driver-fixture.js +0 -64
  100. package/workspace/c3-driver-test.js +0 -169
  101. package/workspace/c3-foundation-test.js +0 -163
  102. package/workspace/c3-ib-items-test.js +0 -114
  103. package/workspace/c3-ib-more-test.js +0 -146
  104. package/workspace/c3-ib-triage-backlog-test.js +0 -128
  105. package/workspace/c3-ini-harness.js +0 -66
  106. package/workspace/c3-ini-life-test.js +0 -167
  107. package/workspace/c3-initiatives-test.js +0 -186
  108. package/workspace/c3-light-load-test.js +0 -112
  109. package/workspace/c3-one-home-test.js +0 -149
  110. package/workspace/c3-phone-test.js +0 -289
  111. package/workspace/c3-quiet-test.js +0 -157
  112. package/workspace/c3-report-design-real-test.js +0 -264
  113. package/workspace/c3-report-design-test.js +0 -442
  114. package/workspace/c3-report-setup-test.js +0 -192
  115. package/workspace/c3-report-structure-real-test.js +0 -248
  116. package/workspace/c3-report-structure-test.js +0 -397
  117. package/workspace/c3-reports-test.js +0 -288
  118. package/workspace/c3-scan-test.js +0 -517
  119. package/workspace/c3-sessions-panel-test.js +0 -365
  120. package/workspace/c3-settings-test.js +0 -204
  121. package/workspace/c3-updates-test.js +0 -131
  122. package/workspace/c3-work-test.js +0 -260
  123. package/workspace/cut-stub.js +0 -40
  124. package/workspace/first-paint-audit.js +0 -160
  125. package/workspace/lib/c3-full-console.js +0 -15
  126. package/workspace/lib/engine/derived/trust.js +0 -3
  127. package/workspace/lib/engine/plan-forecast.js +0 -342
  128. package/workspace/lib/engine/report-families.js +0 -175
  129. package/workspace/lib/engine/truth-table.js +0 -57
  130. package/workspace/lib/routes-c3-init.js +0 -54
  131. package/workspace/lib/routes-c3-life.js +0 -120
  132. package/workspace/lib/routes-c3-timeline.js +0 -192
  133. package/workspace/lib/routes-forecast.js +0 -86
  134. package/workspace/lib/routes-releases.js +0 -130
  135. package/workspace/lib/routes-report-facts.js +0 -85
  136. package/workspace/lib/routes-report-families.js +0 -33
  137. package/workspace/lib/routes-signals.js +0 -51
  138. package/workspace/lib/routes-timeline.js +0 -197
  139. package/workspace/public/c3.html +0 -35
  140. package/workspace/public/index.html +0 -156
  141. package/workspace/public/pm/app.js +0 -831
  142. package/workspace/public/pm/bd-board.js +0 -159
  143. package/workspace/public/pm/bd-drag.js +0 -59
  144. package/workspace/public/pm/bd-model.js +0 -152
  145. package/workspace/public/pm/bd-timeline.js +0 -233
  146. package/workspace/public/pm/bd-tree.js +0 -244
  147. package/workspace/public/pm/board-copy.js +0 -59
  148. package/workspace/public/pm/board-read.js +0 -38
  149. package/workspace/public/pm/branches-sheet.js +0 -56
  150. package/workspace/public/pm/breakdown-api.js +0 -58
  151. package/workspace/public/pm/breakdown-copy.js +0 -138
  152. package/workspace/public/pm/briefing-deck.js +0 -441
  153. package/workspace/public/pm/briefing-model.js +0 -251
  154. package/workspace/public/pm/c3-ambient.js +0 -100
  155. package/workspace/public/pm/c3-audience-link.js +0 -21
  156. package/workspace/public/pm/c3-audience.js +0 -46
  157. package/workspace/public/pm/c3-boot.js +0 -13
  158. package/workspace/public/pm/c3-breakdown.js +0 -240
  159. package/workspace/public/pm/c3-brief-data.js +0 -11
  160. package/workspace/public/pm/c3-brief-mentions.js +0 -137
  161. package/workspace/public/pm/c3-brief-needs.js +0 -288
  162. package/workspace/public/pm/c3-brief-pulse.js +0 -112
  163. package/workspace/public/pm/c3-brief-summary.js +0 -139
  164. package/workspace/public/pm/c3-brief-today.js +0 -79
  165. package/workspace/public/pm/c3-brief.js +0 -279
  166. package/workspace/public/pm/c3-cal-strategy.js +0 -529
  167. package/workspace/public/pm/c3-calendar.js +0 -965
  168. package/workspace/public/pm/c3-calpop.js +0 -111
  169. package/workspace/public/pm/c3-case.js +0 -196
  170. package/workspace/public/pm/c3-core-docs.css +0 -18
  171. package/workspace/public/pm/c3-core-docs.js +0 -236
  172. package/workspace/public/pm/c3-daypart.js +0 -176
  173. package/workspace/public/pm/c3-demo-boards.js +0 -764
  174. package/workspace/public/pm/c3-demo-brief-ix.js +0 -350
  175. package/workspace/public/pm/c3-demo-brief-page.js +0 -70
  176. package/workspace/public/pm/c3-demo-cal-ix.js +0 -74
  177. package/workspace/public/pm/c3-demo-cal2.js +0 -66
  178. package/workspace/public/pm/c3-demo-cal3.js +0 -173
  179. package/workspace/public/pm/c3-demo-cal4.js +0 -169
  180. package/workspace/public/pm/c3-demo-cal5.js +0 -52
  181. package/workspace/public/pm/c3-demo-coredocs.js +0 -221
  182. package/workspace/public/pm/c3-demo-data.js +0 -552
  183. package/workspace/public/pm/c3-demo-focus.js +0 -181
  184. package/workspace/public/pm/c3-demo-init.js +0 -430
  185. package/workspace/public/pm/c3-demo-life.js +0 -77
  186. package/workspace/public/pm/c3-demo-material.js +0 -58
  187. package/workspace/public/pm/c3-demo-misc2.js +0 -34
  188. package/workspace/public/pm/c3-demo-phone.js +0 -48
  189. package/workspace/public/pm/c3-demo-plan2.js +0 -30
  190. package/workspace/public/pm/c3-demo-rd.js +0 -432
  191. package/workspace/public/pm/c3-demo-rep-ix.js +0 -126
  192. package/workspace/public/pm/c3-demo-rep2.js +0 -130
  193. package/workspace/public/pm/c3-demo-rep3.js +0 -138
  194. package/workspace/public/pm/c3-demo-rs.js +0 -287
  195. package/workspace/public/pm/c3-demo-term.js +0 -153
  196. package/workspace/public/pm/c3-demo-time.js +0 -49
  197. package/workspace/public/pm/c3-demo-work-ix.js +0 -32
  198. package/workspace/public/pm/c3-demo.js +0 -131
  199. package/workspace/public/pm/c3-design-studio.js +0 -369
  200. package/workspace/public/pm/c3-doc-formats.js +0 -153
  201. package/workspace/public/pm/c3-doc-sheet.js +0 -1230
  202. package/workspace/public/pm/c3-dock.js +0 -206
  203. package/workspace/public/pm/c3-docs.js +0 -291
  204. package/workspace/public/pm/c3-driver-work.js +0 -110
  205. package/workspace/public/pm/c3-driver.css +0 -18
  206. package/workspace/public/pm/c3-driver.js +0 -298
  207. package/workspace/public/pm/c3-focus.css +0 -304
  208. package/workspace/public/pm/c3-focus.js +0 -983
  209. package/workspace/public/pm/c3-ib-docs.js +0 -92
  210. package/workspace/public/pm/c3-ib-initiatives.js +0 -201
  211. package/workspace/public/pm/c3-ib-items.js +0 -210
  212. package/workspace/public/pm/c3-ib-releases.js +0 -48
  213. package/workspace/public/pm/c3-ib-sprints.js +0 -201
  214. package/workspace/public/pm/c3-ib-triage.js +0 -177
  215. package/workspace/public/pm/c3-ii-tabs.js +0 -252
  216. package/workspace/public/pm/c3-ini-life.css +0 -34
  217. package/workspace/public/pm/c3-ini-life.js +0 -379
  218. package/workspace/public/pm/c3-ini-records.js +0 -197
  219. package/workspace/public/pm/c3-ini-timeline.js +0 -278
  220. package/workspace/public/pm/c3-ini-work.js +0 -139
  221. package/workspace/public/pm/c3-init-extras.js +0 -170
  222. package/workspace/public/pm/c3-initiatives.js +0 -852
  223. package/workspace/public/pm/c3-lifecycle-panels.js +0 -479
  224. package/workspace/public/pm/c3-look.js +0 -27
  225. package/workspace/public/pm/c3-material.css +0 -22
  226. package/workspace/public/pm/c3-material.js +0 -321
  227. package/workspace/public/pm/c3-md.js +0 -3
  228. package/workspace/public/pm/c3-misc-panels.js +0 -89
  229. package/workspace/public/pm/c3-new-session.js +0 -110
  230. package/workspace/public/pm/c3-notes.js +0 -751
  231. package/workspace/public/pm/c3-phone-boot.js +0 -47
  232. package/workspace/public/pm/c3-phone-detail.js +0 -97
  233. package/workspace/public/pm/c3-phone-model.js +0 -3
  234. package/workspace/public/pm/c3-phone.css +0 -66
  235. package/workspace/public/pm/c3-phone.js +0 -444
  236. package/workspace/public/pm/c3-plan-panels.js +0 -163
  237. package/workspace/public/pm/c3-plan.js +0 -193
  238. package/workspace/public/pm/c3-quiet.css +0 -113
  239. package/workspace/public/pm/c3-quiet.js +0 -177
  240. package/workspace/public/pm/c3-replay.css +0 -133
  241. package/workspace/public/pm/c3-replay.js +0 -429
  242. package/workspace/public/pm/c3-report-deck.css +0 -163
  243. package/workspace/public/pm/c3-report-deck.js +0 -598
  244. package/workspace/public/pm/c3-report-frame.css +0 -20
  245. package/workspace/public/pm/c3-report-print.css +0 -20
  246. package/workspace/public/pm/c3-report-setup.css +0 -67
  247. package/workspace/public/pm/c3-report-setup.js +0 -298
  248. package/workspace/public/pm/c3-report-store.js +0 -244
  249. package/workspace/public/pm/c3-report-structure.css +0 -44
  250. package/workspace/public/pm/c3-report-structure.js +0 -473
  251. package/workspace/public/pm/c3-reports.css +0 -68
  252. package/workspace/public/pm/c3-reports.js +0 -377
  253. package/workspace/public/pm/c3-roadmap.js +0 -249
  254. package/workspace/public/pm/c3-scan-api.js +0 -167
  255. package/workspace/public/pm/c3-scan-next.js +0 -248
  256. package/workspace/public/pm/c3-scan-setup.js +0 -313
  257. package/workspace/public/pm/c3-scan-words.js +0 -41
  258. package/workspace/public/pm/c3-scan.css +0 -74
  259. package/workspace/public/pm/c3-scan.js +0 -93
  260. package/workspace/public/pm/c3-session-chat.js +0 -103
  261. package/workspace/public/pm/c3-session-conv.js +0 -165
  262. package/workspace/public/pm/c3-session-term.js +0 -216
  263. package/workspace/public/pm/c3-settings.css +0 -85
  264. package/workspace/public/pm/c3-settings.js +0 -1045
  265. package/workspace/public/pm/c3-shell.js +0 -628
  266. package/workspace/public/pm/c3-signals.js +0 -196
  267. package/workspace/public/pm/c3-strategy-panels.js +0 -45
  268. package/workspace/public/pm/c3-swipe.js +0 -230
  269. package/workspace/public/pm/c3-terminal-data.js +0 -48
  270. package/workspace/public/pm/c3-terminal-edge.js +0 -91
  271. package/workspace/public/pm/c3-terminal-icons.js +0 -40
  272. package/workspace/public/pm/c3-terminal-results.js +0 -141
  273. package/workspace/public/pm/c3-terminal.js +0 -52
  274. package/workspace/public/pm/c3-tickets.js +0 -163
  275. package/workspace/public/pm/c3-timeline.js +0 -201
  276. package/workspace/public/pm/calendar-views.js +0 -1049
  277. package/workspace/public/pm/console3-lift.md +0 -220
  278. package/workspace/public/pm/cozy-home.js +0 -172
  279. package/workspace/public/pm/cozy-initiative.css +0 -138
  280. package/workspace/public/pm/cycle-review.js +0 -125
  281. package/workspace/public/pm/data.js +0 -1577
  282. package/workspace/public/pm/dest-board.js +0 -444
  283. package/workspace/public/pm/dest-docs.js +0 -530
  284. package/workspace/public/pm/dest-initiatives.js +0 -162
  285. package/workspace/public/pm/dest-mywork.js +0 -307
  286. package/workspace/public/pm/dest-notes.js +0 -537
  287. package/workspace/public/pm/dest-people.js +0 -449
  288. package/workspace/public/pm/dest-reports.js +0 -383
  289. package/workspace/public/pm/dest-settings.js +0 -601
  290. package/workspace/public/pm/dest-today.js +0 -267
  291. package/workspace/public/pm/display-word.js +0 -56
  292. package/workspace/public/pm/doc-editor.js +0 -473
  293. package/workspace/public/pm/doc-graph.js +0 -272
  294. package/workspace/public/pm/doc-health-panel.js +0 -110
  295. package/workspace/public/pm/doc-rail.js +0 -167
  296. package/workspace/public/pm/doc-remote.js +0 -180
  297. package/workspace/public/pm/dock-sessions.js +0 -472
  298. package/workspace/public/pm/dock.js +0 -216
  299. package/workspace/public/pm/fixture.js +0 -821
  300. package/workspace/public/pm/flag-picker.js +0 -104
  301. package/workspace/public/pm/frame-copy.js +0 -278
  302. package/workspace/public/pm/freshness-line.js +0 -149
  303. package/workspace/public/pm/handoff-box.js +0 -82
  304. package/workspace/public/pm/initiative-list.js +0 -235
  305. package/workspace/public/pm/initiative-sheet.js +0 -331
  306. package/workspace/public/pm/initiatives-api.js +0 -95
  307. package/workspace/public/pm/initiatives-copy.js +0 -287
  308. package/workspace/public/pm/initiatives-timeline-copy.js +0 -59
  309. package/workspace/public/pm/initiatives-timeline.js +0 -410
  310. package/workspace/public/pm/initiatives-ui.js +0 -291
  311. package/workspace/public/pm/item-sheet.js +0 -268
  312. package/workspace/public/pm/keep-card.js +0 -204
  313. package/workspace/public/pm/lifecycle-lens-model.js +0 -246
  314. package/workspace/public/pm/lifecycle-lens.js +0 -276
  315. package/workspace/public/pm/lifecycle.js +0 -111
  316. package/workspace/public/pm/mobile.css +0 -366
  317. package/workspace/public/pm/mobile.js +0 -581
  318. package/workspace/public/pm/modes-live.js +0 -453
  319. package/workspace/public/pm/modes.js +0 -147
  320. package/workspace/public/pm/my-work-card.js +0 -51
  321. package/workspace/public/pm/my-work-data.js +0 -36
  322. package/workspace/public/pm/new-initiative-sheet.js +0 -169
  323. package/workspace/public/pm/next-step-ui.js +0 -190
  324. package/workspace/public/pm/outbox-panel.js +0 -125
  325. package/workspace/public/pm/palette-copy.js +0 -55
  326. package/workspace/public/pm/palette.js +0 -343
  327. package/workspace/public/pm/panel-breakdown.js +0 -702
  328. package/workspace/public/pm/panel-cockpit.js +0 -425
  329. package/workspace/public/pm/panel-detail.js +0 -1513
  330. package/workspace/public/pm/panel-initiatives.js +0 -929
  331. package/workspace/public/pm/panel-newsess.js +0 -709
  332. package/workspace/public/pm/panel-repos.js +0 -741
  333. package/workspace/public/pm/panel-tabs.js +0 -1506
  334. package/workspace/public/pm/panel-trees.js +0 -204
  335. package/workspace/public/pm/people-link.js +0 -106
  336. package/workspace/public/pm/phone-deck.js +0 -167
  337. package/workspace/public/pm/pm-work-view.js +0 -1533
  338. package/workspace/public/pm/portfolio-report.js +0 -61
  339. package/workspace/public/pm/premium-acts.js +0 -280
  340. package/workspace/public/pm/premium-brief.js +0 -111
  341. package/workspace/public/pm/premium-chat.js +0 -22
  342. package/workspace/public/pm/premium-doc-sheet.js +0 -312
  343. package/workspace/public/pm/premium-initiative.js +0 -324
  344. package/workspace/public/pm/premium-insights.css +0 -228
  345. package/workspace/public/pm/premium-metric-tiles.js +0 -68
  346. package/workspace/public/pm/premium-report-brief.js +0 -132
  347. package/workspace/public/pm/premium-vw-rec.js +0 -67
  348. package/workspace/public/pm/premium-wide.css +0 -30
  349. package/workspace/public/pm/print.css +0 -44
  350. package/workspace/public/pm/provider-cards.js +0 -136
  351. package/workspace/public/pm/registry.js +0 -203
  352. package/workspace/public/pm/release-card.js +0 -110
  353. package/workspace/public/pm/releases-view.js +0 -248
  354. package/workspace/public/pm/report-families-view.js +0 -505
  355. package/workspace/public/pm/report-slides.js +0 -438
  356. package/workspace/public/pm/report-tab.js +0 -33
  357. package/workspace/public/pm/report-view.js +0 -337
  358. package/workspace/public/pm/reports-copy.js +0 -134
  359. package/workspace/public/pm/roadmap.js +0 -294
  360. package/workspace/public/pm/run-card.js +0 -260
  361. package/workspace/public/pm/sessions-panel.js +0 -219
  362. package/workspace/public/pm/sheet-jira.js +0 -353
  363. package/workspace/public/pm/shell-bell.js +0 -163
  364. package/workspace/public/pm/shell-model.js +0 -83
  365. package/workspace/public/pm/shell-phone.js +0 -124
  366. package/workspace/public/pm/shell-readaloud.js +0 -53
  367. package/workspace/public/pm/shell-recording.js +0 -274
  368. package/workspace/public/pm/shell-ticker.js +0 -90
  369. package/workspace/public/pm/sig-watch.js +0 -41
  370. package/workspace/public/pm/slide-confirm.js +0 -163
  371. package/workspace/public/pm/slides-copy.js +0 -52
  372. package/workspace/public/pm/status-banner.js +0 -95
  373. package/workspace/public/pm/tab-doc.js +0 -859
  374. package/workspace/public/pm/tab-gone.js +0 -21
  375. package/workspace/public/pm/tab-term.js +0 -1210
  376. package/workspace/public/pm/tab-web.js +0 -90
  377. package/workspace/public/pm/timeline-copy.js +0 -48
  378. package/workspace/public/pm/timeline-forecast-view.js +0 -164
  379. package/workspace/public/pm/today-agenda.js +0 -331
  380. package/workspace/public/pm/today-cards.js +0 -244
  381. package/workspace/public/pm/today-copy.js +0 -506
  382. package/workspace/public/pm/today-day.js +0 -1371
  383. package/workspace/public/pm/today-goals.js +0 -297
  384. package/workspace/public/pm/today-jobs.js +0 -84
  385. package/workspace/public/pm/today-mentions.js +0 -50
  386. package/workspace/public/pm/topbar.js +0 -202
  387. package/workspace/public/pm/triage-card.js +0 -60
  388. package/workspace/public/pm/undo-hold.js +0 -103
  389. package/workspace/public/pm/view-addrepo.js +0 -208
  390. package/workspace/public/pm/view-files.js +0 -197
  391. package/workspace/public/pm/view-livenotes.js +0 -399
  392. package/workspace/public/pm/view-today.js +0 -13
  393. package/workspace/public/pm/view-validate.js +0 -171
  394. package/workspace/public/pm/welcome.js +0 -391
  395. package/workspace/public/pm/work-place.js +0 -68
  396. package/workspace/public/pm/xlsx-read.js +0 -117
  397. package/workspace/public/welcome.html +0 -22
  398. package/workspace/test-lists/browser-suites-green.json +0 -5
  399. package/workspace/test-lists/c3-core-docs.json +0 -9
  400. package/workspace/test-lists/c3-doc-sheet-rich.json +0 -6
  401. package/workspace/test-lists/c3-doc-sheet-size.json +0 -6
  402. package/workspace/test-lists/c3-doc-sheet-v2.json +0 -6
  403. package/workspace/test-lists/c3-ib-items.json +0 -9
  404. package/workspace/test-lists/c3-ib-more.json +0 -9
  405. package/workspace/test-lists/c3-ib-triage-backlog.json +0 -9
  406. package/workspace/test-lists/c3-ini-life.json +0 -9
  407. package/workspace/test-lists/c3-meeting-board.json +0 -5
  408. package/workspace/test-lists/c3-meeting-card.json +0 -5
  409. package/workspace/test-lists/c3-notes-place.json +0 -5
  410. package/workspace/test-lists/c3-notes-series.json +0 -5
  411. package/workspace/test-lists/calendar-time-page.json +0 -5
  412. package/workspace/test-lists/calpop.json +0 -4
  413. package/workspace/test-lists/console3-briefing.json +0 -9
  414. package/workspace/test-lists/console3-foundation.json +0 -9
  415. package/workspace/test-lists/console3-work-page.json +0 -9
  416. package/workspace/test-lists/premium-brief-parity.json +0 -9
  417. package/workspace/test-lists/report-design-studio-ui.json +0 -5
  418. package/workspace/test-lists/report-structure-ui.json +0 -11
  419. package/workspace/test-lists/report-workspace-ui.json +0 -5
  420. package/workspace/test-lists/run3-a.json +0 -5
  421. package/workspace/test-lists/run3-d.json +0 -6
  422. package/workspace/test-lists/run4-c.json +0 -13
  423. package/workspace/test-lists/today-goals-jobs-ui.json +0 -5
  424. package/workspace/test-lists/today-mentions-cards.json +0 -5
  425. package/workspace/test-lists/workspace-tabs-declutter.json +0 -13
@@ -1,379 +0,0 @@
1
- /* pm/c3-ini-life.js — On hold, Cancelled, Merge and Archive for an initiative (c3-initiative-lifecycle; mockup v2, 34-initiatives.js
2
- * "LIFECYCLE", approved 2026-10-13; planning/prd/c3-initiative-lifecycle-prd.md).
3
- *
4
- * Stage says where the work is in its workflow. Status says how it is going: On track, At risk or Late while it is active, or a stop
5
- * the PM chose: On hold, Cancelled. Done is the end of the workflow. Archive is not a status: it takes an initiative out of every
6
- * board list and count and keeps it whole, so Restore brings it back as it was. Merge archives a duplicate as "Merged into <id>"
7
- * after moving its Jira epic links and PMOS tasks.
8
- *
9
- * rowMenu(anchor, L, r) the row's "…" menu: Move to a stage, Status, Tidy up
10
- * pageMenu(anchor, L, r, own) the initiative page's "…" menu: the page's own items, Status and Tidy up
11
- * lifeBanner(L, r) the page banner of an on-hold, cancelled or archived initiative, or null
12
- * lifeChips(r) · archivedChips(r) · dupChip(L, r) the chips a row shows
13
- * restoreBtn(L, r) Restore, or Undo merge
14
- * L = { ctx, done(change) }: ctx is the tab or page ctx of c3-initiatives.js; done() is called after a write lands, with
15
- * { kind, id, status?, archived? } so the caller can read again until the answer shows it.
16
- *
17
- * WRITES. Hold, cancel, resume and reopen are D70 lifecycle lines (POST /api/lifecycle, a PM press). Archive, restore, merge and
18
- * not-a-duplicate are board-ledger lines (POST /api/boards/archive, /merge, /notdup). Moving to another board is POST
19
- * /api/boards/assign. Every action's toast has Undo, which writes the opposite line. Nothing here writes a record or Jira. */
20
- import { el } from './dom.js';
21
- import { btn, icon, pill, lk, pbtn, chip, st, lbl, statusChip, sw, openMenu, closeMenu, put, trunc, day, plural, card, chgl, chgli } from './c3-ini-ui.js';
22
- import { openSheet, closeSheet } from './c3-sheet.js';
23
- import { toast } from './c3-toast.js';
24
- import { wfOf } from './c3-ini-work.js';
25
-
26
- /** Link c3-ini-life.css once, from this module's own folder. */
27
- export function ensureLifeCss() {
28
- if (typeof document === 'undefined' || document.querySelector('link[data-c3-life]')) return;
29
- const l = document.createElement('link');
30
- l.rel = 'stylesheet'; l.href = new URL('./c3-ini-life.css', import.meta.url).href; l.setAttribute('data-c3-life', '');
31
- document.head.appendChild(l);
32
- }
33
- ensureLifeCss();
34
-
35
- export const ACTIVE = ['on track', 'at risk', 'late'];
36
- export const isActive = (r) => !!r && ACTIVE.includes(r.status);
37
- const BACK = [['two', 'In 2 weeks', 14], ['month', 'In a month', 30], ['quarter', 'Next quarter', 80], ['none', 'No date', null]];
38
- const WHY = [['needed', 'No longer needed'], ['replaced', 'Replaced by another initiative'], ['worth', 'Not worth it now'], ['kill', 'Hit a kill condition'], ['other', 'Other']];
39
- const AWHY = [['unrelated', 'Not related to this board'], ['stale', 'Old idea, never started'], ['dup', 'Duplicate'], ['other', 'Other']];
40
- const LC = { 'on hold': 'on-hold', cancelled: 'cancelled' };
41
-
42
- function addDays(iso, n) {
43
- const [y, m, d] = String(iso || '').split('-').map(Number);
44
- const t = new Date(Date.UTC(y || 2026, (m || 1) - 1, d || 1) + n * 864e5);
45
- return t.toISOString().slice(0, 10);
46
- }
47
- /* A sheet's line of text. Not `.ini-note`: the quiet pages hide those, and a sheet's sentences are what it asks. */
48
- const inote = (...kids) => el('div', { class: 'dim il-note' }, ...kids);
49
- const dayOf = (v) => (v ? day(String(v).slice(0, 10)) : '');
50
- const errText = (r) => (r && r.error) || 'no answer';
51
- const pct = (r) => Math.round((Number(r.progress) || 0) * 100) + '% done';
52
-
53
- /* ── the writes ── */
54
- async function lifecycle(L, id, state, reason, back) {
55
- const body = { initiative_id: id, state, reason: reason || '' };
56
- if (back) body.back = back;
57
- return L.ctx.api.post('/api/lifecycle', body);
58
- }
59
- const archive = (L, id, archived, reason) => L.ctx.api.post('/api/boards/archive', { board: L.ctx.board.id, id, archived, ...(reason ? { reason } : {}) });
60
- const merge = (L, id, into, epics, tasks) => L.ctx.api.post('/api/boards/merge', { board: L.ctx.board.id, id, into, epics, tasks });
61
- const failed = (what, r) => { toast({ text: what + ' did not save: ' + errText(r) + '.', tone: 'error' }); return false; };
62
-
63
- /** The lifecycle line that puts `r` back as it was before this change (Undo). */
64
- function priorState(r) {
65
- if (r.status === 'on hold') return { state: 'on-hold', reason: (r.stopped && r.stopped.reason) || '', back: (r.stopped && r.stopped.back) || null };
66
- if (r.status === 'cancelled') return { state: 'cancelled', reason: (r.stopped && r.stopped.reason) || '', back: null };
67
- return { state: 'active', reason: '', back: null };
68
- }
69
- const statusAfter = (state) => (state === 'on-hold' ? 'on hold' : state === 'cancelled' ? 'cancelled' : null);
70
-
71
- async function setState(L, r, state, reason, back, words) {
72
- const prev = priorState(r);
73
- const res = await lifecycle(L, r.id, state, reason, back);
74
- if (!res || !res.ok) return failed('The change', res);
75
- closeSheet();
76
- L.done({ kind: 'status', id: r.id, status: statusAfter(state) });
77
- toast(words, async () => {
78
- const u = await lifecycle(L, r.id, prev.state, prev.reason, prev.back);
79
- if (!u || !u.ok) { failed('The undo', u); return; }
80
- L.done({ kind: 'status', id: r.id, status: statusAfter(prev.state) || r.status });
81
- });
82
- return true;
83
- }
84
- const resume = (L, r) => setState(L, r, 'active', '', null, r.id + ' is active again, in ' + r.stage);
85
- const reopen = (L, r) => setState(L, r, 'active', '', null, r.id + ' is reopened, in ' + r.stage);
86
-
87
- async function restore(L, r) {
88
- const a = r.archived || {};
89
- const res = await archive(L, r.id, false);
90
- if (!res || !res.ok) return failed('The restore', res);
91
- L.done({ kind: 'archive', id: r.id, archived: false });
92
- toast(a.into ? 'The merge of ' + r.id + ' is undone. What moved went back.' : r.id + ' restored', async () => {
93
- const u = a.into ? await merge(L, r.id, a.into, (a.moved && a.moved.epics) || [], (a.moved && a.moved.tasks) || []) : await archive(L, r.id, true, a.reason || '');
94
- if (!u || !u.ok) { failed('The undo', u); return; }
95
- L.done({ kind: 'archive', id: r.id, archived: true });
96
- });
97
- return true;
98
- }
99
-
100
- /* ── the sheet frame ── */
101
- const field = (label, ...kids) => el('div', { class: 'ini-field' }, lbl(label), ...kids);
102
- function pills(key, opts, cur, onPick) {
103
- return el('div', { class: 'chips2', role: 'radiogroup', 'aria-label': key },
104
- ...opts.map(([v, l]) => pill({ role: 'radio', 'aria-checked': String(cur === v), 'aria-pressed': String(cur === v), 'data-il-set': key, 'data-v': v, onclick: () => onPick(v) }, l)));
105
- }
106
- const happens = (lines) => card({ ic: 'info', title: 'What happens' }, chgl(lines.filter(Boolean).map(([ic, t]) => chgli(ic, t))));
107
- const jiraLine = (L) => (L.ctx.board.build ? ['jira', 'Its Jira epics are not changed. PMOS records this; you decide in Jira.'] : null);
108
- function foot(sh, label, onDo, attrs, busy) {
109
- return el('div', { class: 'chips2 il-foot' }, pbtn('ghost', 'Not now', null, { 'data-il': 'not-now', onclick: () => sh.close() }),
110
- pbtn('primary', busy ? 'Saving' : label, null, { 'data-il-do': attrs, disabled: !!busy, onclick: onDo }));
111
- }
112
- function textBox(label, ph, value, onInput, key) {
113
- return el('textarea', { rows: '2', 'aria-label': label, placeholder: ph, 'data-il-text': key, oninput: (e) => onInput(e.target.value) }, value || '');
114
- }
115
- const head = (r) => inote(el('b', null, r.title || r.id), ' · ' + (r.stage || 'no stage') + ' · ' + pct(r));
116
- function sheet(title, ic, wide) {
117
- const host = el('div', { class: 'ini-form il-sheet', 'data-il': 'sheet' });
118
- const sh = openSheet({ title, icon: ic, body: host, wide: !!wide });
119
- return { host, sh };
120
- }
121
-
122
- /* ── Put on hold ── */
123
- export function openHold(L, r) {
124
- const F = { reason: '', back: 'month', busy: false };
125
- const { host, sh } = sheet('Put on hold · ' + r.id, 'moon');
126
- const ta = textBox('Why is it paused', 'For example: waiting for the Q1 budget decision', '', (v) => { F.reason = v; }, 'reason');
127
- const backDay = () => { const b = BACK.find((x) => x[0] === F.back); return b && b[2] != null ? addDays(L.ctx.today, b[2]) : null; };
128
- function render() {
129
- const d = backDay();
130
- put(host, head(r), field('WHY IS IT PAUSED', el('div', { class: 'form' }, ta)), field('CHECK BACK', pills('back', BACK, F.back, (v) => { F.back = v; render(); })),
131
- happens([['check', 'Keeps its stage (' + (r.stage || 'none') + '), its work and its history'],
132
- ['moon', 'Shows as On hold. It leaves Now and next and the at-risk counts, and never turns Late while paused'],
133
- ['spark', 'The agent stops driving it'],
134
- ['bell', d ? 'The check-back date, ' + day(d) + ', shows on its row and its page' : 'No check-back date: it stays paused until you resume it'],
135
- jiraLine(L)]),
136
- foot(sh, 'Put on hold', go, 'hold', F.busy));
137
- }
138
- async function go() {
139
- F.busy = true; render();
140
- const ok = await setState(L, r, 'on-hold', F.reason.trim(), backDay(), r.id + ' is on hold');
141
- if (!ok) { F.busy = false; if (host.isConnected) render(); }
142
- }
143
- render(); ta.focus();
144
- }
145
-
146
- /* ── Cancel ── */
147
- export function openCancel(L, r) {
148
- const F = { why: '', note: '', busy: false };
149
- const { host, sh } = sheet('Cancel · ' + r.id, 'x');
150
- const ta = textBox('Note', 'What did we learn, and who was told', '', (v) => { F.note = v; }, 'note');
151
- function render() {
152
- put(host, head(r), field('WHY', pills('why', WHY, F.why, (v) => { F.why = v; render(); })),
153
- F.why === 'replaced' ? inote('If the other initiative does the same thing, ', lk({ 'data-il': 'merge-instead', onclick: () => openMerge(L, r) }, 'merge it instead'), '. Its work then moves over.') : null,
154
- field('NOTE (OPTIONAL)', el('div', { class: 'form' }, ta)),
155
- happens([['x', 'Shows as Cancelled. The Summary and the counts treat it as cancelled, not done'],
156
- ['eye', 'Hidden from every view until the Status filter asks for Cancelled'],
157
- ['check', 'Keeps its stage (' + (r.stage || 'none') + '), its work and its history'],
158
- ['spark', 'The agent stops driving it'],
159
- ['undo', 'Reopen it any time; it comes back at the same stage'],
160
- jiraLine(L)]),
161
- F.why ? foot(sh, 'Cancel initiative', go, 'cancel', F.busy) : el('div', { class: 'chips2 il-foot' }, inote('Pick a reason to cancel.')));
162
- }
163
- async function go() {
164
- const why = (WHY.find((w) => w[0] === F.why) || [null, ''])[1];
165
- F.busy = true; render();
166
- const ok = await setState(L, r, 'cancelled', why + (F.note.trim() ? ': ' + F.note.trim() : ''), null, r.id + ' is cancelled');
167
- if (!ok) { F.busy = false; if (host.isConnected) render(); }
168
- }
169
- render();
170
- }
171
-
172
- /* ── Merge ── */
173
- const words = (s) => new Set(String(s || '').toLowerCase().replace(/[^a-z0-9 ]/g, ' ').split(/\s+/).filter((w) => w.length > 3));
174
- /** The three initiatives most like `r`: shared title words, the same anchor (+2), the duplicate hint (+5). */
175
- export function similar(r, rows) {
176
- const w = words(r.title);
177
- return rows.filter((x) => x.id !== r.id && !x.archived).map((x) => {
178
- const xw = words(x.title); let n = 0; w.forEach((k) => { if (xw.has(k)) n++; });
179
- return { x, n: n + (x.anchor && x.anchor === r.anchor ? 2 : 0) + (x.id === r.dupOf ? 5 : 0) };
180
- }).filter((s) => s.n >= 2).sort((a, c) => c.n - a.n).slice(0, 3).map((s) => s.x);
181
- }
182
- async function boardRows(L) {
183
- const out = [];
184
- for (let off = 0; off < 500; off += 100) {
185
- const r = await L.ctx.api.get('/api/boards/backlog', { board: L.ctx.board.id, view: 'all', sort: 'id', offset: off, limit: 100 });
186
- if (!r || !r.ok) break;
187
- out.push(...(r.rows || []));
188
- if (out.length >= (r.total || 0)) break;
189
- }
190
- return out;
191
- }
192
- export function openMerge(L, r, into) {
193
- const F = { pick: into || null, rows: null, tasks: null, moveEpics: true, moveTasks: true, busy: false };
194
- const { host, sh } = sheet('Merge ' + r.id, 'branch', true);
195
- Promise.all([boardRows(L), L.ctx.api.get('/api/boards/items', { board: L.ctx.board.id })]).then(([rows, it]) => {
196
- F.rows = rows;
197
- F.tasks = it && it.ok ? (it.items || []).filter((w) => w.src === 'pmos' && w.ini === r.id).map((w) => w.uid) : [];
198
- if (!F.pick) { const s = similar(r, rows)[0]; F.pick = s ? s.id : null; }
199
- if (host.isConnected) render();
200
- });
201
- function opt(x, k) {
202
- const on = F.pick === x.id;
203
- return btn({ class: 'opt' + (k === 0 ? ' rec' : ''), role: 'radio', 'aria-pressed': String(on), 'aria-checked': String(on), 'data-il-set': 'pick', 'data-v': x.id, onclick: () => { F.pick = x.id; render(); } },
204
- el('span', { class: 'pk' }, icon('check')), el('span', { class: 'rk' }, k === 0 ? [icon('spark'), 'Most alike'] : null),
205
- el('b', null, x.id + ' ' + (x.title || '')), el('div', { class: 'fx' }, el('span', null, x.stage || ''), el('span', null, x.anchor || 'no anchor'), el('span', null, x.owner || 'No owner')));
206
- }
207
- function render() {
208
- if (!F.rows) { put(host, inote('Reading the initiatives of ' + L.ctx.board.name)); return; }
209
- const sim = similar(r, F.rows);
210
- const others = F.rows.filter((x) => x.id !== r.id && !x.archived && !sim.includes(x));
211
- const tgt = F.rows.find((x) => x.id === F.pick) || null;
212
- const epics = L.ctx.board.build ? (r.epics || []) : [];
213
- const mv = (key, ic, label, n, hint, on, set) => el('label', { class: 'chips2 il-move' },
214
- el('input', { type: 'checkbox', 'data-il-move': key, checked: !!(on && n), disabled: !n, onchange: (e) => set(e.target.checked) }),
215
- el('span', null, icon(ic, 'sm'), ' ', el('b', null, label), ' ', el('span', { class: 'bdg g' }, String(n)), hint ? [el('br'), el('span', { class: 'dim il-hint' }, hint)] : null));
216
- put(host,
217
- inote('Merging moves what you pick from ', el('b', null, r.id + ' ' + (r.title || '')), ' into the initiative you keep. ' + r.id + ' then goes to the Archive as Merged.'),
218
- field('KEEP WHICH INITIATIVE', sim.length ? el('div', { class: 'opts', role: 'radiogroup', 'aria-label': 'Keep which initiative' }, ...sim.map(opt)) : null,
219
- el('label', { class: 'chips2' }, el('span', { class: 'dim il-hint' }, sim.length ? 'Or pick another' : 'Pick the initiative to keep'),
220
- el('select', { 'data-il-pick': '', 'aria-label': 'Pick another initiative', onchange: (e) => { if (e.target.value) { F.pick = e.target.value; render(); } } },
221
- el('option', { value: '' }, 'Choose…'), ...others.map((x) => el('option', { value: x.id, selected: F.pick === x.id && !sim.includes(x) }, x.id + ' ' + trunc(x.title, 50)))))),
222
- tgt ? [
223
- field('WHAT MOVES TO ' + tgt.id,
224
- L.ctx.board.build ? mv('epics', 'jira', 'Jira epic links', epics.length, 'The link moves. Nothing changes in Jira.', F.moveEpics, (v) => { F.moveEpics = v; }) : null,
225
- mv('tasks', 'todo', 'PMOS tasks', (F.tasks || []).length, '', F.moveTasks, (v) => { F.moveTasks = v; })),
226
- happens([['check', tgt.id + ' keeps its title, stage (' + (tgt.stage || 'none') + '), owner and dates'],
227
- ['clip', r.id + ' goes to the Archive as Merged into ' + tgt.id + ', with its history'],
228
- ['doc', 'Documents, asks and notes stay with ' + r.id + ' and open from it'],
229
- ['undo', 'Undo the merge from ' + r.id + ' in the Archive; what moved goes back']]),
230
- r.dupOf === tgt.id ? inote(lk({ 'data-il': 'not-dup', onclick: notDup }, 'Not a duplicate'), ': the hint on ' + r.id + ' stops.') : null,
231
- foot(sh, 'Merge into ' + tgt.id, () => go(tgt, epics), 'merge', F.busy)]
232
- : inote('Pick the initiative to keep.'));
233
- }
234
- async function notDup() {
235
- const res = await L.ctx.api.post('/api/boards/notdup', { board: L.ctx.board.id, id: r.id, of: r.dupOf });
236
- if (!res || !res.ok) { failed('Not a duplicate', res); return; }
237
- sh.close(); L.done({ kind: 'notdup', id: r.id });
238
- toast(r.id + ' is not marked as a duplicate of ' + r.dupOf + ' again');
239
- }
240
- async function go(tgt, epics) {
241
- F.busy = true; render();
242
- const e = F.moveEpics ? epics : []; const t = F.moveTasks ? (F.tasks || []) : [];
243
- const res = await merge(L, r.id, tgt.id, e, t);
244
- if (!res || !res.ok) { F.busy = false; if (host.isConnected) render(); failed('The merge', res); return; }
245
- sh.close();
246
- L.done({ kind: 'archive', id: r.id, archived: true });
247
- toast(r.id + ' merged into ' + tgt.id, async () => {
248
- const u = await archive(L, r.id, false);
249
- if (!u || !u.ok) { failed('The undo', u); return; }
250
- L.done({ kind: 'archive', id: r.id, archived: false });
251
- });
252
- }
253
- render();
254
- }
255
-
256
- /* ── Archive ── */
257
- export function openArchive(L, r) {
258
- const F = { why: 'unrelated', note: '', board: '', boards: null, busy: false };
259
- const { host, sh } = sheet('Archive · ' + r.id, 'clip');
260
- const ta = textBox('Note', 'Anything you want to remember about it', '', (v) => { F.note = v; }, 'note');
261
- L.ctx.api.get('/api/boards').then((res) => {
262
- F.boards = res && res.ok ? (res.boards || []).filter((x) => x.ws === L.ctx.ws && x.id !== L.ctx.board.id) : [];
263
- if (host.isConnected) render();
264
- });
265
- function render() {
266
- const to = (F.boards || []).find((x) => x.id === F.board);
267
- put(host, inote(el('b', null, r.title || r.id), ' · ' + (r.stage || 'no stage') + ' · ', statusChip(r.status)),
268
- field('WHY', pills('why', AWHY, F.why, (v) => { F.why = v; render(); })),
269
- F.why === 'dup' ? el('div', { class: 'fold w' }, icon('branch', 'sm'), ' A duplicate is better merged: its work moves to the one you keep. ',
270
- lk({ 'data-il': 'merge-instead', onclick: () => openMerge(L, r, r.dupOf || null) }, 'Merge it instead')) : null,
271
- F.why === 'unrelated' && F.boards && F.boards.length ? el('label', { class: 'chips2' }, el('span', { class: 'dim il-hint' }, 'Belongs on another board? Move it there instead'),
272
- el('select', { 'data-il-board': '', 'aria-label': 'Move to board', onchange: (e) => { F.board = e.target.value; render(); } },
273
- el('option', { value: '' }, 'Choose a board…'), ...F.boards.map((x) => el('option', { value: x.id, selected: x.id === F.board }, x.name))),
274
- to ? pbtn('outline', 'Move to ' + to.name, 'next', { 'data-il-do': 'moveboard', onclick: () => moveBoard(to) }) : null) : null,
275
- field('NOTE (OPTIONAL)', el('div', { class: 'form' }, ta)),
276
- happens([['eye', 'It leaves every list, count and timeline of the board'],
277
- ['check', 'Nothing is deleted. The record, its work and its history stay in the repository'],
278
- ['undo', 'Restore it from the Archive any time, as it was'],
279
- jiraLine(L)]),
280
- foot(sh, 'Archive', go, 'archive', F.busy));
281
- }
282
- async function go() {
283
- const why = (AWHY.find((w) => w[0] === F.why) || [null, ''])[1];
284
- F.busy = true; render();
285
- const res = await archive(L, r.id, true, why + (F.note.trim() ? ': ' + F.note.trim() : ''));
286
- if (!res || !res.ok) { F.busy = false; if (host.isConnected) render(); failed('The archive', res); return; }
287
- sh.close();
288
- L.done({ kind: 'archive', id: r.id, archived: true });
289
- toast(r.id + ' archived', async () => {
290
- const u = await archive(L, r.id, false);
291
- if (!u || !u.ok) { failed('The undo', u); return; }
292
- L.done({ kind: 'archive', id: r.id, archived: false });
293
- });
294
- }
295
- async function moveBoard(to) {
296
- const from = L.ctx.board;
297
- const res = await L.ctx.api.post('/api/boards/assign', { id: r.id, to: to.id });
298
- if (!res || !res.ok) { failed('The move', res); return; }
299
- sh.close();
300
- L.done({ kind: 'board', id: r.id });
301
- toast(r.id + ' moved to ' + to.name, async () => {
302
- const u = await L.ctx.api.post('/api/boards/assign', { id: r.id, to: from.id });
303
- if (!u || !u.ok) { failed('The undo', u); return; }
304
- L.done({ kind: 'board', id: r.id });
305
- });
306
- }
307
- render();
308
- }
309
-
310
- /* ── menus ── */
311
- const mi = (ic, label, hint, attr, onPick) => ({ kids: [icon(ic, 'sm'), el('span', null, label, hint ? [el('br'), el('span', { class: 'dim il-hint' }, hint)] : null)], attrs: { [attr]: '' }, onPick });
312
- function statusItems(L, r) {
313
- if (r.archived) return [];
314
- if (r.status === 'on hold') return [mi('play', 'Resume', 'Back to ' + r.stage + ', active again', 'data-il-resume', () => resume(L, r)), mi('x', 'Cancel…', 'Stop it for good, with a reason', 'data-il-cancel', () => openCancel(L, r))];
315
- if (r.status === 'cancelled') return [mi('undo', 'Reopen', 'Back to ' + r.stage + ', active again', 'data-il-reopen', () => reopen(L, r))];
316
- if (r.status === 'done') return [];
317
- return [mi('moon', 'Put on hold…', 'Pause it; keeps its stage and work', 'data-il-hold', () => openHold(L, r)), mi('x', 'Cancel…', 'Stop it for good, with a reason', 'data-il-cancel', () => openCancel(L, r))];
318
- }
319
- function tidyItems(L, r) {
320
- if (r.archived) return [mi('undo', r.archived.into ? 'Undo merge' : 'Restore', r.archived.into ? 'What moved goes back' : 'Back in the lists, as it was', 'data-il-restore', () => restore(L, r))];
321
- return [mi('branch', 'Merge into another…', 'For a duplicate: its work moves over', 'data-il-merge', () => openMerge(L, r)), mi('clip', 'Archive…', 'Out of every list; restore any time', 'data-il-archive', () => openArchive(L, r))];
322
- }
323
- /** The row menu. stageItems: the Move to items (empty on a board that keeps the derived ladder, or for a cancelled initiative). */
324
- export function rowMenu(anchor, L, r, onMove) {
325
- const stages = !onMove || r.status === 'cancelled' || r.archived ? [] : wfOf(r, L.ctx.board).map((s) => ({ kids: [sw(s.cat), s.name, s.name === r.stage ? el('span', { class: 'dim' }, ' (here)') : null], current: s.name === r.stage, disabled: s.name === r.stage, attrs: { 'data-ini-moveto': s.name }, onPick: () => onMove(s.name) }));
326
- const status = statusItems(L, r);
327
- openMenu(anchor, { label: 'Actions for ' + r.id, items: [
328
- ...(stages.length ? [{ group: 'Move to a stage' }, ...stages] : []),
329
- ...(status.length ? [{ group: 'Status' }, ...status] : []),
330
- { group: 'Tidy up' }, ...tidyItems(L, r)] });
331
- }
332
- export function pageMenu(anchor, L, r, own) {
333
- const status = statusItems(L, r);
334
- openMenu(anchor, { label: 'Actions for ' + r.id, items: [...(own && own.length ? [{ group: 'This initiative' }, ...own] : []), ...(status.length ? [{ group: 'Status' }, ...status] : []), { group: 'Tidy up' }, ...tidyItems(L, r)] });
335
- }
336
-
337
- /* ── chips and the banner ── */
338
- export function lifeChips(r) {
339
- const s = r.stopped || {};
340
- if (r.status === 'on hold') return [chip('since ' + (dayOf(s.at) || 'today')), s.back ? chip(icon('bell', 'sm'), 'check back ' + dayOf(s.back)) : null, s.reason ? el('span', { class: 'chip2 dim', title: 'Reason' }, trunc(s.reason, 48)) : null];
341
- if (r.status === 'cancelled') return [s.at ? chip(dayOf(s.at)) : null, s.reason ? el('span', { class: 'chip2 dim', title: 'Reason' }, trunc(s.reason, 48)) : null];
342
- return [];
343
- }
344
- export function archivedChips(r) {
345
- const a = r.archived || {};
346
- return [el('span', { class: 'chip2 mono' }, r.id),
347
- a.into ? [el('span', { class: 'tag' }, icon('branch', 'sm'), 'Merged into ' + a.into), a.intoTitle && a.intoTitle !== a.into ? chip(trunc(a.intoTitle, 36)) : null]
348
- : [el('span', { class: 'tag' }, icon('clip', 'sm'), 'Archived'), a.reason ? el('span', { class: 'chip2 dim' }, trunc(a.reason, 56)) : null],
349
- a.at ? chip(dayOf(a.at)) : null, r.stage ? chip('was ' + r.stage) : null];
350
- }
351
- export const restoreBtn = (L, r) => pbtn('outline', r.archived && r.archived.into ? 'Undo merge' : 'Restore', 'undo', { 'data-il-restore': r.id, onclick: () => restore(L, r) });
352
- export function dupChip(L, r) {
353
- if (!r.dupOf || r.archived) return null;
354
- return btn({ class: 'tag acc', 'data-il-merge': r.id, 'data-into': r.dupOf, title: 'The same anchor and most of the same words', onclick: () => openMerge(L, r, r.dupOf) },
355
- icon('spark', 'sm'), 'Looks like a duplicate of ' + r.dupOf);
356
- }
357
- export const mergedFromChip = (r) => (r.mergedFrom && r.mergedFrom.length ? chip(icon('branch', 'sm'), 'Merged from ' + r.mergedFrom.join(', ')) : null);
358
- export function lifeBanner(L, r) {
359
- const s = r.stopped || {};
360
- if (r.archived) {
361
- const a = r.archived;
362
- return el('div', { class: 'fold w il-banner', role: 'status', 'data-il': 'banner' }, icon('clip', 'sm'),
363
- el('span', null, a.into ? 'Merged into ' + a.into + (a.intoTitle && a.intoTitle !== a.into ? ' ' + trunc(a.intoTitle, 40) : '') + ' on ' + dayOf(a.at) + '. This initiative is in the Archive.'
364
- : 'Archived on ' + dayOf(a.at) + (a.reason ? ': ' + a.reason : '') + '. It is out of every list.'), restoreBtn(L, r));
365
- }
366
- if (r.status === 'on hold') {
367
- return el('div', { class: 'fold w il-banner', role: 'status', 'data-il': 'banner' }, icon('moon', 'sm'),
368
- el('span', null, 'On hold since ' + (dayOf(s.at) || 'today') + (s.reason ? ': ' + s.reason : '') + '.' + (s.back ? ' Check back ' + dayOf(s.back) + '.' : '') + ' Stage, work and history are kept.'),
369
- el('span', { class: 'chips2' }, pbtn('outline', 'Resume', 'play', { 'data-il-resume': r.id, onclick: () => resume(L, r) }), lk({ 'data-il-cancel': r.id, onclick: () => openCancel(L, r) }, 'Cancel…')));
370
- }
371
- if (r.status === 'cancelled') {
372
- return el('div', { class: 'fold il-banner', role: 'status', 'data-il': 'banner' }, icon('x', 'sm'),
373
- el('span', null, 'Cancelled' + (s.at ? ' on ' + dayOf(s.at) : '') + (s.reason ? ': ' + s.reason : '') + '. Counted as cancelled, not done.'),
374
- pbtn('outline', 'Reopen', 'undo', { 'data-il-reopen': r.id, onclick: () => reopen(L, r) }));
375
- }
376
- return null;
377
- }
378
- export const rowIcon = (r) => (r.archived ? (r.archived.into ? 'branch' : 'clip') : r.status === 'late' || r.status === 'at risk' ? 'alert' : r.status === 'done' ? 'check' : r.status === 'on hold' ? 'moon' : r.status === 'cancelled' ? 'x' : 'init');
379
- export { closeMenu, plural, st };
@@ -1,197 +0,0 @@
1
- /* pm/c3-ini-records.js — the stage records of one initiative, drawn as tool cards on its Overview (mockup v5, 34-initiatives.js toolHTML:
2
- * problem, rice, release (launch checklist), kill, learn, and the sprint burndown). The records are stored by the stage-records routes,
3
- * which another change builds (route contract: /mnt/project-files/pmos/stage-records/route-contract.md); this file only reads and writes
4
- * them through ctx.api:
5
- * GET /api/stage-tools/records?ws&id { records: { problem, rice, launch, kill, learnings } }, each { data, at, by } or null
6
- * POST /api/stage-tools/records { ws, id, tool, data } -> { record }
7
- * GET /api/stage-tools/rice?ws&ids=A,B { rows: [{ id, score, rank }] } ranks within the board
8
- * GET /api/stage-tools/burndown?ws&board&ids=A { available, sprint, committed, done, left, daysLeft, needPerDay, series } | { available: false, reason,
9
- * unpointed? } ("Jira not enabled on this board" when the board's buildDeliver is false)
10
- * Shapes as built in PR #607 (the contract's "As built" section): a save never answers 409 (no state folder writes to the import overlay).
11
- * In demo mode c3-demo-boards.js answers them. When a route is not on this server yet (404), each card shows a quiet empty state and no
12
- * editor: nothing is invented.
13
- *
14
- * RECORD_TOOLS[kind][cat] -> tool ids · RECORD_META { id: [label, icon] } · recordToolsFor(kind, cat)
15
- * recordCards(ctx, ids, { boardIds }) -> Promise<[section]> one card per id, each `[data-ini-tool-card=<id>]`; boardIds ranks RICE
16
- */
17
- import { el } from './dom.js';
18
- import { icon, pill, lk, pbtn, chip, note, lbl, card, chgl, kv, hbs, hbr, plural, day, ago, put } from './c3-ini-ui.js';
19
-
20
- export const RECORD_META = {
21
- problem: ['Problem statement', 'target'], rice: ['RICE prioritisation', 'scale'], launch: ['Launch checklist', 'out'],
22
- burndown: ['Sprint burndown', 'up'], kill: ['Kill conditions', 'x'], learnings: ['Learnings and retro', 'notes'],
23
- };
24
- export const RECORD_TOOLS = {
25
- product: { Discover: ['problem'], Plan: ['rice'], Do: ['launch', 'burndown'], Learn: ['kill', 'learnings'] },
26
- project: { Discover: [], Plan: [], Do: ['launch'], Learn: ['learnings'] },
27
- simple: { Discover: [], Plan: [], Do: [], Learn: [] },
28
- };
29
- /** The record tools of a category; burndown only on a board with Build and deliver on (it reads the Jira sprint). */
30
- export const recordToolsFor = (kind, cat, build) => ((RECORD_TOOLS[kind] || RECORD_TOOLS.product)[cat] || []).filter((k) => k !== 'burndown' || build);
31
- const IMPACT = [0.25, 0.5, 1, 2, 3];
32
- const KILL = [['watching', 'Watching', 'warn'], ['tripped', 'Tripped', 'bad'], ['cleared', 'Cleared', 'ok']];
33
- const nid = () => 'r' + Date.now().toString(36) + Math.floor(Math.random() * 1e4).toString(36);
34
- const scoreOf = (r) => Math.round((Number(r.reach) || 0) * (Number(r.impact) || 0) * ((Number(r.confidence) || 0) / 100) / Math.max(0.25, Number(r.effort) || 0));
35
- const missing = (r) => !r || r.status === 404;
36
- const quiet = (text) => el('div', { class: 'dim ini-note', 'data-rec': 'quiet' }, text);
37
-
38
- /** Read the records once per Overview draw. { ok, missing, records, error }. */
39
- async function loadRecords(ctx) {
40
- const r = await ctx.api.get('/api/stage-tools/records', { id: ctx.row.id });
41
- if (missing(r)) return { ok: false, missing: true, records: {}, error: '' };
42
- if (!r.ok) return { ok: false, missing: false, records: {}, error: r.error || 'no answer' };
43
- return { ok: true, missing: false, records: r.records || {}, error: '' };
44
- }
45
- async function save(ctx, tool, data) {
46
- const r = await ctx.api.post('/api/stage-tools/records', { id: ctx.row.id, tool, data });
47
- if (missing(r)) { ctx.toast({ text: 'Stage records are not on this workspace server yet, so this was not saved.', tone: 'error' }); return null; }
48
- if (!r.ok) { ctx.toast({ text: 'Not saved: ' + (r.error || 'no answer') + '.', tone: 'error' }); return null; }
49
- return r.record || { data, at: new Date().toISOString(), by: 'You' };
50
- }
51
- const stamp = (rec, today) => (rec && rec.at ? note('Saved ' + ago(String(rec.at).slice(0, 10), today) + (rec.by ? ' by ' + rec.by : '') + '.') : null);
52
-
53
- export async function recordCards(ctx, ids, opts) {
54
- opts = opts || {};
55
- if (!ids.length) return [];
56
- const R = await loadRecords(ctx);
57
- const out = [];
58
- for (const id of ids) {
59
- const meta = RECORD_META[id]; if (!meta) continue;
60
- const host = el('div', { 'data-rec': id });
61
- out.push(card({ ic: meta[1], title: meta[0], attrs: { 'data-ini-tool-card': id, id: 'tool-' + id } }, host));
62
- if (id === 'burndown') { burndown(ctx, host); continue; }
63
- if (R.missing) { put(host, quiet('Nothing recorded yet.')); continue; }
64
- if (!R.ok) { put(host, el('div', { class: 'fold w', role: 'alert' }, icon('alert', 'sm'), 'The records could not be read: ' + R.error + '.')); continue; }
65
- const rec = R.records[id] || null;
66
- ({ problem, rice, launch, kill, learnings })[id](ctx, host, rec, opts);
67
- }
68
- return out;
69
- }
70
-
71
- /* ── problem: one text ── */
72
- function problem(ctx, host, rec) {
73
- const S = { text: (rec && rec.data && rec.data.text) || '', rec };
74
- const draw = () => {
75
- const ta = el('textarea', { rows: '3', 'aria-label': 'Problem statement', 'data-rec-field': 'problem', placeholder: 'Who has the problem, what it costs them, and how we know', maxlength: '4000' });
76
- ta.value = S.text;
77
- const go = pbtn('outline', 'Save', null, { 'data-rec-save': 'problem', onclick: async () => { const r = await save(ctx, 'problem', { text: ta.value.trim() }); if (r) { S.text = ta.value.trim(); S.rec = r; ctx.toast('Problem statement saved.'); draw(); } } });
78
- put(host, el('div', { class: 'form ini-text' }, ta), el('div', { class: 'chips2' }, go, note('Write it before ideas. The evidence should back each claim.')), stamp(S.rec, ctx.today));
79
- };
80
- draw();
81
- }
82
-
83
- /* ── rice: four inputs, the score, the rank on the board ── */
84
- function rice(ctx, host, rec, opts) {
85
- const d = (rec && rec.data) || {};
86
- const S = { reach: d.reach ?? '', impact: d.impact ?? 1, confidence: d.confidence ?? '', effort: d.effort ?? '', rank: '', rec };
87
- const score = el('b', { 'data-rec': 'rice-score' });
88
- const rank = el('span', { class: 'dim ini-note', 'data-rec': 'rice-rank' });
89
- const upd = () => { score.textContent = S.reach !== '' && S.confidence !== '' && S.effort !== '' ? String(scoreOf(S)) : 'not scored'; };
90
- const num = (k, label, help) => {
91
- const i = el('input', { type: 'text', inputmode: 'decimal', class: 'ini-num', value: String(S[k]), 'aria-label': label + ', ' + help, title: help, 'data-rec-rice': k, oninput: (e) => { S[k] = e.target.value.trim(); upd(); } });
92
- return el('label', { class: 'chips2' }, lbl(label), i);
93
- };
94
- async function readRank() {
95
- const r = await ctx.api.get('/api/stage-tools/rice', { ids: (opts.boardIds || []).join(',') });
96
- if (!r || !r.ok) { rank.textContent = ''; return; }
97
- const rows = r.rows || []; const me = rows.find((x) => x.id === ctx.row.id);
98
- rank.textContent = me ? 'Ranks ' + me.rank + ' of ' + rows.length + ' scored initiatives on ' + ctx.board.name : rows.length ? 'Not ranked yet: ' + plural(rows.length, 'initiative') + ' on ' + ctx.board.name + ' are scored.' : '';
99
- }
100
- async function go() {
101
- const data = { reach: Number(S.reach), impact: Number(S.impact), confidence: Number(S.confidence), effort: Number(S.effort) };
102
- if (![data.reach, data.confidence, data.effort].every((n) => Number.isFinite(n)) || data.effort <= 0 || data.confidence < 0 || data.confidence > 100 || data.reach < 0) {
103
- ctx.toast({ text: 'Reach is a number, confidence 0 to 100, and effort more than 0.', tone: 'error' }); return;
104
- }
105
- const r = await save(ctx, 'rice', data);
106
- if (r) { S.rec = r; ctx.toast('RICE saved: score ' + scoreOf(data) + '.'); readRank(); host.querySelector('[data-rec="stamp"]')?.replaceWith(stampNode()); }
107
- }
108
- const stampNode = () => { const n = stamp(S.rec, ctx.today) || el('span'); n.setAttribute('data-rec', 'stamp'); return n; };
109
- put(host,
110
- el('div', { class: 'chips2' }, num('reach', 'Reach', 'accounts a quarter'),
111
- el('label', { class: 'chips2' }, lbl('Impact'), el('select', { 'aria-label': 'Impact, 0.25 to 3', 'data-rec-rice': 'impact', onchange: (e) => { S.impact = Number(e.target.value); upd(); } }, ...IMPACT.map((v) => el('option', { value: String(v), selected: Number(S.impact) === v }, String(v))))),
112
- num('confidence', 'Confidence', 'percent'), num('effort', 'Effort', 'person-months')),
113
- el('div', { class: 'chips2' }, el('span', null, 'Score ', score), rank, pbtn('outline', 'Save', null, { 'data-rec-save': 'rice', onclick: go })),
114
- note('Score = reach × impact × confidence ÷ effort. The inputs stay visible so the ranking can be argued with.'), stampNode());
115
- upd(); readRank();
116
- }
117
-
118
- /* ── the three lists: launch checklist, kill conditions, learnings ── */
119
- function listTool(ctx, host, rec, o) {
120
- const S = { items: Array.isArray(rec && rec.data && rec.data.items) ? rec.data.items.map((x) => ({ ...x })) : [], rec, busy: false };
121
- async function commit(next, msg) {
122
- if (S.busy) return;
123
- S.busy = true;
124
- const r = await save(ctx, o.tool, { items: next });
125
- S.busy = false;
126
- if (r) { S.items = next; S.rec = r; if (msg) ctx.toast(msg); }
127
- draw();
128
- }
129
- function draw(focus) {
130
- const input = el('input', { type: 'text', placeholder: o.placeholder, 'aria-label': o.addLabel, 'data-rec-add': o.tool, maxlength: '300' });
131
- const add = () => { const t = input.value.trim(); if (!t) { input.focus(); return; } if (S.items.length >= o.max) { ctx.toast({ text: 'At most ' + o.max + ' items.', tone: 'error' }); return; } commit([...S.items, o.make(t)], null).then(() => { const f = host.querySelector('[data-rec-add]'); if (f) f.focus(); }); };
132
- input.addEventListener('keydown', (e) => { if (e.key === 'Enter') { e.preventDefault(); add(); } });
133
- put(host,
134
- S.items.length ? o.list(S.items, (next, msg) => commit(next, msg)) : note(o.empty),
135
- el('div', { class: 'form' }, input, pbtn('outline', 'Add', 'plus', { 'data-rec-addgo': o.tool, onclick: add })),
136
- o.foot ? o.foot(S.items) : null, stamp(S.rec, ctx.today));
137
- if (focus) { const f = host.querySelector(focus); if (f) f.focus(); }
138
- }
139
- draw();
140
- }
141
- function launch(ctx, host, rec) {
142
- listTool(ctx, host, rec, { tool: 'launch', max: 40, placeholder: 'Add a launch step', addLabel: 'Add a launch step', empty: 'No launch checklist yet. List what has to be true on launch day.',
143
- make: (t) => ({ id: nid(), text: t, done: false }),
144
- list: (items, commit) => el('div', { class: 'ini-checks', 'data-rec': 'launch-list' }, ...items.map((c, n) => el('label', { class: 'ini-chk' + (c.done ? ' done' : '') },
145
- el('input', { type: 'checkbox', checked: !!c.done, 'data-rec-check': String(n), onchange: (e) => commit(items.map((x, k) => (k === n ? { ...x, done: e.target.checked } : x)), null) }), el('span', null, c.text)))),
146
- foot: (items) => (items.length ? note(items.filter((c) => c.done).length + ' of ' + items.length + ' done') : null) });
147
- }
148
- function kill(ctx, host, rec) {
149
- listTool(ctx, host, rec, { tool: 'kill', max: 20, placeholder: 'A result that would make you stop', addLabel: 'Add a kill condition', empty: 'No kill conditions. Say what result would make you stop.',
150
- make: (t) => ({ id: nid(), text: t, status: 'watching' }),
151
- list: (items, commit) => chgl(items.map((k, n) => el('li', { class: k.status === 'tripped' ? 'bad' : k.status === 'watching' ? 'warn' : '', 'data-rec-kill': String(n) }, icon('x', 'sm'), el('span', null, k.text),
152
- el('span', { class: 'seg ini-seg', role: 'group', 'aria-label': 'Status of ' + k.text }, ...KILL.map(([v, l]) => pill({ 'aria-pressed': String(k.status === v), 'data-rec-killst': v, onclick: () => { if (k.status !== v) commit(items.map((x, j) => (j === n ? { ...x, status: v } : x)), v === 'tripped' ? 'Kill condition tripped. Decide whether to stop.' : null); } }, l)))))) });
153
- }
154
- function learnings(ctx, host, rec) {
155
- listTool(ctx, host, rec, { tool: 'learnings', max: 60, placeholder: 'What we learned, or would do differently', addLabel: 'Add a learning', empty: 'No learnings yet. Add them as they come, not only at the end.',
156
- make: (t) => ({ id: nid(), text: t, date: ctx.today }),
157
- list: (items) => chgl(items.slice().reverse().map((x) => el('li', { 'data-rec-learning': x.id }, icon('notes', 'sm'), el('span', null, x.text), el('span', { class: 'tag' }, day(x.date) || 'no date')))) });
158
- }
159
-
160
- /* ── burndown: read-only, mirrored from the Jira sprint ── */
161
- const SVGNS = 'http://www.w3.org/2000/svg';
162
- const svg = (tag, attrs) => { const n = document.createElementNS(SVGNS, tag); for (const [k, v] of Object.entries(attrs || {})) n.setAttribute(k, String(v)); return n; };
163
- function burnSvg(b, W, H) {
164
- const series = (b.series || []).filter((p) => p && p.date);
165
- const max = Math.max(1, Number(b.committed) || 0, ...series.map((p) => Number(p.remaining) || 0));
166
- const n = Math.max(1, series.length - 1);
167
- const x = (k) => 30 + (k / n) * (W - 40); const y = (v) => 8 + (1 - v / max) * (H - 26);
168
- const s = svg('svg', { class: 'ini-burn', viewBox: '0 0 ' + W + ' ' + H, role: 'img', 'aria-label': 'Burndown: ' + (b.left ?? '') + ' of ' + (b.committed ?? '') + ' points left' });
169
- s.append(svg('line', { class: 'ax', x1: 30, y1: y(0), x2: W - 10, y2: y(0) }), svg('line', { class: 'ax', x1: 30, y1: 8, x2: 30, y2: y(0) }));
170
- if (series.length) {
171
- s.append(svg('path', { class: 'ideal', d: series.map((p, k) => (k ? 'L' : 'M') + x(k).toFixed(1) + ' ' + y(Number(p.ideal) || 0).toFixed(1)).join(' ') }));
172
- const act = series.filter((p) => p.remaining != null);
173
- if (act.length) {
174
- s.append(svg('path', { class: 'act', d: act.map((p, k) => (k ? 'L' : 'M') + x(k).toFixed(1) + ' ' + y(Number(p.remaining)).toFixed(1)).join(' ') }));
175
- const k = act.length - 1; s.append(svg('circle', { class: 'dot', cx: x(k), cy: y(Number(act[k].remaining)), r: 3.5 }));
176
- }
177
- }
178
- const t = (tx, ty, text, anchor) => { const e = svg('text', { x: tx, y: ty, 'text-anchor': anchor || 'start' }); e.textContent = text; return e; };
179
- s.append(t(26, y(max) + 4, String(max), 'end'), t(26, y(0) + 3, '0', 'end'));
180
- if (series.length) s.append(t(30, H - 4, day(series[0].date)), t(W - 10, H - 4, day(series[series.length - 1].date), 'end'));
181
- return s;
182
- }
183
- async function burndown(ctx, host) {
184
- put(host, note('Reading the sprint'));
185
- const r = await ctx.api.get('/api/stage-tools/burndown', { board: ctx.board.id, ids: ctx.row.id });
186
- if (missing(r)) { put(host, quiet('No sprint burndown yet.')); return; }
187
- if (!r.ok) { put(host, el('div', { class: 'fold w', role: 'alert' }, icon('alert', 'sm'), 'The burndown could not be read: ' + (r.error || 'no answer') + '.')); return; }
188
- if (!r.available) { put(host, quiet(r.reason || 'The Jira snapshot has no sprint dates or points yet.')); return; }
189
- const sp = r.sprint || {};
190
- put(host,
191
- el('div', { class: 'chips2' }, chip(icon('lock', 'sm'), 'Mirrored from Jira, read-only'), chip(icon('clock', 'sm'), (sp.name || 'Sprint') + ' · ' + day(sp.start) + ' to ' + day(sp.end))),
192
- burnSvg(r, 360, 140),
193
- kv([['Committed', String(r.committed ?? 0) + ' points'], ['Done', String(r.done ?? 0)], ['Left · ' + plural(Number(r.daysLeft) || 0, 'day'), String(r.left ?? 0)]]),
194
- hbs([hbr('Done', (r.done ?? 0) + ' of ' + (r.committed ?? 0), (Number(r.done) || 0) / Math.max(1, Number(r.committed) || 0), 'ok')]),
195
- note((r.left ?? 0) + ' points left with ' + plural(Number(r.daysLeft) || 0, 'day') + ' to go: needs ' + (Number(r.needPerDay) || 0).toFixed(1) + ' a day.' + (r.unpointed ? ' ' + plural(r.unpointed, 'ticket has', 'tickets have') + ' no points.' : '')),
196
- lk({ onclick: () => ctx.openBoard(ctx.board.id, 'sprints') }, icon('next', 'sm'), 'Open ' + ctx.board.name + ' Sprints'));
197
- }