create-pmos 0.398.0 → 0.400.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (515) hide show
  1. package/package.json +30 -25
  2. package/payload/KIT-VERSION +1 -1
  3. package/payload/planning/evals/eval-calibration.md +1 -1
  4. package/payload/planning/okrs/health-budgets.md +1 -1
  5. package/payload/state/discoveries.md +1 -1
  6. package/workspace/briefing-premium-adddoc-test.js +19 -15
  7. package/workspace/briefing-premium-board-test.js +82 -50
  8. package/workspace/briefing-premium-calendar-2-test.js +36 -36
  9. package/workspace/briefing-premium-calendar-3-test.js +39 -39
  10. package/workspace/briefing-premium-calendar-test.js +23 -24
  11. package/workspace/briefing-premium-doc-edit-test.js +8 -10
  12. package/workspace/briefing-premium-initiative-test.js +38 -16
  13. package/workspace/briefing-premium-insights-test.js +114 -37
  14. package/workspace/briefing-premium-metrics-test.js +6 -4
  15. package/workspace/briefing-premium-products-test.js +10 -7
  16. package/workspace/briefing-premium-sources-test.js +25 -22
  17. package/workspace/briefing-premium-test.js +48 -43
  18. package/workspace/briefing-premium-work-test.js +16 -11
  19. package/workspace/c3-capture-test.js +0 -17
  20. package/workspace/changelog.json +29 -0
  21. package/workspace/ev-everywhere-test.js +210 -0
  22. package/workspace/fixtures/premium-viewer-fixtures.js +11 -6
  23. package/workspace/guide/briefing-premium.md +2 -2
  24. package/workspace/guide/home.md +58 -19
  25. package/workspace/guide/index.md +1 -1
  26. package/workspace/guide/layout.md +2 -2
  27. package/workspace/guide/notes.md +2 -2
  28. package/workspace/guide/phone-companion.md +1 -1
  29. package/workspace/lib/board-grill.js +63 -0
  30. package/workspace/lib/board-premium.js +36 -5
  31. package/workspace/lib/initiative-layout.js +77 -0
  32. package/workspace/lib/insights-premium.js +3 -2
  33. package/workspace/lib/insights-records.js +21 -7
  34. package/workspace/lib/meeting-points.js +52 -0
  35. package/workspace/lib/news-for-you.js +88 -0
  36. package/workspace/lib/notes-series.js +29 -6
  37. package/workspace/lib/report-confirm.js +48 -0
  38. package/workspace/lib/route-modules.js +9 -9
  39. package/workspace/lib/routes-board-docs.js +46 -0
  40. package/workspace/lib/routes-board-grill.js +90 -0
  41. package/workspace/lib/routes-home-review.js +108 -0
  42. package/workspace/lib/routes-initiative-layout.js +57 -0
  43. package/workspace/lib/routes-insights-premium.js +4 -1
  44. package/workspace/lib/routes-insights-records.js +8 -4
  45. package/workspace/lib/routes-meeting-points.js +37 -0
  46. package/workspace/lib/routes-news.js +57 -0
  47. package/workspace/lib/routes-notes.js +2 -1
  48. package/workspace/lib/routes-phone-day.js +18 -9
  49. package/workspace/lib/routes-report-confirm.js +31 -0
  50. package/workspace/lib/routes-search.js +38 -0
  51. package/workspace/lib/routes-slash.js +95 -0
  52. package/workspace/lib/search-index.js +176 -0
  53. package/workspace/package-lock.json +2 -2
  54. package/workspace/package.json +1 -2
  55. package/workspace/premium-board-actions-test.js +86 -50
  56. package/workspace/premium-briefing-depth-test.js +55 -54
  57. package/workspace/premium-chat-chart-tab-test.js +4 -2
  58. package/workspace/premium-chat-goal-view-test.js +1 -1
  59. package/workspace/premium-chat-report-tab-test.js +16 -2
  60. package/workspace/premium-chat-term-test.js +0 -10
  61. package/workspace/premium-core-doc-issue-test.js +15 -13
  62. package/workspace/premium-menu-rows-test.js +1 -1
  63. package/workspace/premium-phone-card-test.js +7 -5
  64. package/workspace/premium-report-read-test.js +55 -18
  65. package/workspace/premium-vw-backlog-test.js +2 -2
  66. package/workspace/premium-vw-cal-test.js +50 -35
  67. package/workspace/premium-vw-doc-test.js +10 -11
  68. package/workspace/premium-vw-item-test.js +1 -1
  69. package/workspace/premium-vw-jira-test.js +2 -2
  70. package/workspace/premium-vw-meet-test.js +37 -40
  71. package/workspace/premium-vw-notes-test.js +21 -19
  72. package/workspace/premium-vw-rec-test.js +11 -12
  73. package/workspace/premium-welcome-test.js +3 -3
  74. package/workspace/premium-work-depth-test.js +5 -6
  75. package/workspace/public/capture.html +23 -0
  76. package/workspace/public/pm/bd-acts.js +303 -225
  77. package/workspace/public/pm/bd-asks.js +261 -0
  78. package/workspace/public/pm/bd-pop.js +59 -0
  79. package/workspace/public/pm/bd-span.js +49 -13
  80. package/workspace/public/pm/bd-views.js +169 -0
  81. package/workspace/public/pm/c3-base.js +47 -0
  82. package/workspace/public/pm/c3-capture.js +1 -1
  83. package/workspace/public/pm/c3-ini-ui.js +1 -1
  84. package/workspace/public/pm/c3-sheet.js +1 -1
  85. package/workspace/public/pm/c3-toast.js +1 -1
  86. package/workspace/public/pm/console3.css +3 -0
  87. package/workspace/public/pm/cozy-board.css +301 -0
  88. package/workspace/public/pm/cozy-ev.css +228 -0
  89. package/workspace/public/pm/cozy-evmodel.js +106 -0
  90. package/workspace/public/pm/cozy-evui.js +47 -0
  91. package/workspace/public/pm/cozy-home.css +20 -5
  92. package/workspace/public/pm/cozy-insights.css +148 -10
  93. package/workspace/public/pm/cozy-nav.js +103 -39
  94. package/workspace/public/pm/cozy-news.js +140 -0
  95. package/workspace/public/pm/cozy-search.js +203 -0
  96. package/workspace/public/pm/cozy-settings.js +198 -0
  97. package/workspace/public/pm/cozy-sources.js +89 -0
  98. package/workspace/public/pm/cozy-today.css +220 -0
  99. package/workspace/public/pm/cozy-viewer.js +5 -2
  100. package/workspace/public/pm/cozy-vw-mtg.css +350 -0
  101. package/workspace/public/pm/cozy-vw-rp.css +152 -0
  102. package/workspace/public/pm/cozy.css +9 -0
  103. package/workspace/public/pm/goal-chat.js +5 -1
  104. package/workspace/public/pm/home-adddoc.js +5 -5
  105. package/workspace/public/pm/home-app.js +365 -70
  106. package/workspace/public/pm/home-around.js +24 -126
  107. package/workspace/public/pm/home-chat.js +77 -18
  108. package/workspace/public/pm/home-data.js +9 -7
  109. package/workspace/public/pm/home-dictate.js +57 -0
  110. package/workspace/public/pm/home-draft.js +6 -6
  111. package/workspace/public/pm/home-ini-model.js +190 -0
  112. package/workspace/public/pm/home-ini.css +171 -0
  113. package/workspace/public/pm/home-ini.js +466 -0
  114. package/workspace/public/pm/home-list.js +289 -0
  115. package/workspace/public/pm/home-more.js +18 -135
  116. package/workspace/public/pm/home-phone-card.js +13 -8
  117. package/workspace/public/pm/home-review.js +103 -0
  118. package/workspace/public/pm/home-task.js +67 -0
  119. package/workspace/public/pm/home-today.js +148 -0
  120. package/workspace/public/pm/home-work.js +63 -28
  121. package/workspace/public/pm/note-dock.js +1 -2
  122. package/workspace/public/pm/notes-links.js +1 -2
  123. package/workspace/public/pm/notes-task.js +3 -4
  124. package/workspace/public/pm/premium-board.js +164 -40
  125. package/workspace/public/pm/premium-chart-tab.js +4 -5
  126. package/workspace/public/pm/premium-first.js +5 -7
  127. package/workspace/public/pm/premium-initiative-head.js +3 -3
  128. package/workspace/public/pm/premium-insights.js +499 -202
  129. package/workspace/public/pm/premium-mtg-present.js +138 -0
  130. package/workspace/public/pm/premium-mtg-replay.js +142 -0
  131. package/workspace/public/pm/premium-report-read.js +216 -52
  132. package/workspace/public/pm/premium-report-tab.js +44 -19
  133. package/workspace/public/pm/premium-shell.js +7 -7
  134. package/workspace/public/pm/premium-vw-cal.js +150 -60
  135. package/workspace/public/pm/premium-vw-doc.css +20 -2
  136. package/workspace/public/pm/premium-vw-doc.js +22 -7
  137. package/workspace/public/pm/premium-vw-mtg.js +488 -261
  138. package/workspace/public/pm/premium-vw-notes.js +61 -0
  139. package/workspace/public/pm/rp-parts.js +269 -0
  140. package/workspace/public/pm/view-notes.js +2 -2
  141. package/workspace/public/premium-board.html +4 -3
  142. package/workspace/public/premium-insights.html +10 -10
  143. package/workspace/public/premium.html +3 -1
  144. package/workspace/r/m1.png +0 -0
  145. package/workspace/r/m2.png +0 -0
  146. package/workspace/r/m3.png +0 -0
  147. package/workspace/r/nl.png +0 -0
  148. package/workspace/replaced-tests.json +435 -0
  149. package/workspace/run-tests.js +323 -28
  150. package/workspace/server.js +15 -10
  151. package/workspace/test-files.json +3 -140
  152. package/workspace/test-lists/base.json +1 -2
  153. package/workspace/test-lists/c3-desktop-light-load.json +1 -2
  154. package/workspace/test-lists/c3-initiative-boards.json +1 -2
  155. package/workspace/test-lists/c3-meeting-focus.json +2 -12
  156. package/workspace/test-lists/c3-work-agent.json +1 -2
  157. package/workspace/test-lists/calendar-tidy-up.json +1 -2
  158. package/workspace/test-lists/console3-reports.json +1 -2
  159. package/workspace/test-lists/docs-three-way-sync.json +1 -2
  160. package/workspace/test-lists/extension-capture.json +5 -0
  161. package/workspace/test-lists/initiative-layout.json +9 -0
  162. package/workspace/test-lists/jira-wbs.json +1 -2
  163. package/workspace/test-lists/legacy-cleanup-a.json +9 -0
  164. package/workspace/test-lists/meeting-material.json +1 -2
  165. package/workspace/test-lists/meeting-notes.json +2 -36
  166. package/workspace/test-lists/meeting-replay.json +1 -2
  167. package/workspace/test-lists/mm-capture.json +2 -12
  168. package/workspace/test-lists/my-work.json +2 -10
  169. package/workspace/test-lists/onboarding-firstrun.json +2 -12
  170. package/workspace/test-lists/people-directory.json +1 -2
  171. package/workspace/test-lists/premium-uncovered-meetings.json +9 -0
  172. package/workspace/test-lists/premium-uncovered-reports.json +9 -0
  173. package/workspace/test-lists/run2-a.json +1 -2
  174. package/workspace/test-lists/run2-d.json +2 -19
  175. package/workspace/test-lists/run3-b.json +1 -2
  176. package/workspace/test-lists/run3-c.json +2 -12
  177. package/workspace/test-lists/run4-b.json +1 -2
  178. package/workspace/test-lists/run4-d.json +1 -5
  179. package/workspace/test-lists/run5-c.json +1 -11
  180. package/workspace/test-lists/run6.json +1 -5
  181. package/workspace/test-lists/uf-everywhere.json +15 -0
  182. package/workspace/test-lists/uf-home.json +9 -0
  183. package/workspace/test-lists/uncovered-board.json +9 -0
  184. package/workspace/test-lists/workspace-launch-flags.json +2 -12
  185. package/workspace/test-lists/workspace-profile-detection.json +2 -10
  186. package/workspace/test-timings.json +242 -123
  187. package/workspace/c3-briefing-test.js +0 -136
  188. package/workspace/c3-core-docs-test.js +0 -170
  189. package/workspace/c3-driver-fixture.js +0 -64
  190. package/workspace/c3-driver-test.js +0 -169
  191. package/workspace/c3-foundation-test.js +0 -163
  192. package/workspace/c3-ib-items-test.js +0 -114
  193. package/workspace/c3-ib-more-test.js +0 -146
  194. package/workspace/c3-ib-triage-backlog-test.js +0 -128
  195. package/workspace/c3-ini-harness.js +0 -66
  196. package/workspace/c3-ini-life-test.js +0 -167
  197. package/workspace/c3-initiatives-test.js +0 -186
  198. package/workspace/c3-light-load-test.js +0 -112
  199. package/workspace/c3-one-home-test.js +0 -149
  200. package/workspace/c3-phone-test.js +0 -289
  201. package/workspace/c3-quiet-test.js +0 -157
  202. package/workspace/c3-report-design-real-test.js +0 -264
  203. package/workspace/c3-report-design-test.js +0 -442
  204. package/workspace/c3-report-setup-test.js +0 -192
  205. package/workspace/c3-report-structure-real-test.js +0 -248
  206. package/workspace/c3-report-structure-test.js +0 -397
  207. package/workspace/c3-reports-test.js +0 -288
  208. package/workspace/c3-scan-test.js +0 -517
  209. package/workspace/c3-sessions-panel-test.js +0 -365
  210. package/workspace/c3-settings-test.js +0 -204
  211. package/workspace/c3-updates-test.js +0 -131
  212. package/workspace/c3-work-test.js +0 -260
  213. package/workspace/cut-stub.js +0 -40
  214. package/workspace/first-paint-audit.js +0 -160
  215. package/workspace/lib/c3-full-console.js +0 -15
  216. package/workspace/lib/engine/derived/trust.js +0 -3
  217. package/workspace/lib/engine/plan-forecast.js +0 -342
  218. package/workspace/lib/engine/report-families.js +0 -175
  219. package/workspace/lib/engine/truth-table.js +0 -57
  220. package/workspace/lib/routes-c3-init.js +0 -54
  221. package/workspace/lib/routes-c3-life.js +0 -120
  222. package/workspace/lib/routes-c3-timeline.js +0 -192
  223. package/workspace/lib/routes-forecast.js +0 -86
  224. package/workspace/lib/routes-releases.js +0 -130
  225. package/workspace/lib/routes-report-facts.js +0 -85
  226. package/workspace/lib/routes-report-families.js +0 -33
  227. package/workspace/lib/routes-signals.js +0 -51
  228. package/workspace/lib/routes-timeline.js +0 -197
  229. package/workspace/public/c3.html +0 -35
  230. package/workspace/public/index.html +0 -156
  231. package/workspace/public/pm/app.js +0 -831
  232. package/workspace/public/pm/bd-board.js +0 -159
  233. package/workspace/public/pm/bd-drag.js +0 -59
  234. package/workspace/public/pm/bd-model.js +0 -152
  235. package/workspace/public/pm/bd-timeline.js +0 -233
  236. package/workspace/public/pm/bd-tree.js +0 -244
  237. package/workspace/public/pm/board-copy.js +0 -59
  238. package/workspace/public/pm/board-read.js +0 -38
  239. package/workspace/public/pm/branches-sheet.js +0 -56
  240. package/workspace/public/pm/breakdown-api.js +0 -58
  241. package/workspace/public/pm/breakdown-copy.js +0 -138
  242. package/workspace/public/pm/briefing-deck.js +0 -441
  243. package/workspace/public/pm/briefing-model.js +0 -251
  244. package/workspace/public/pm/c3-ambient.js +0 -100
  245. package/workspace/public/pm/c3-audience-link.js +0 -21
  246. package/workspace/public/pm/c3-audience.js +0 -46
  247. package/workspace/public/pm/c3-boot.js +0 -13
  248. package/workspace/public/pm/c3-breakdown.js +0 -240
  249. package/workspace/public/pm/c3-brief-data.js +0 -11
  250. package/workspace/public/pm/c3-brief-mentions.js +0 -137
  251. package/workspace/public/pm/c3-brief-needs.js +0 -288
  252. package/workspace/public/pm/c3-brief-pulse.js +0 -112
  253. package/workspace/public/pm/c3-brief-summary.js +0 -139
  254. package/workspace/public/pm/c3-brief-today.js +0 -79
  255. package/workspace/public/pm/c3-brief.js +0 -279
  256. package/workspace/public/pm/c3-cal-strategy.js +0 -529
  257. package/workspace/public/pm/c3-calendar.js +0 -965
  258. package/workspace/public/pm/c3-calpop.js +0 -111
  259. package/workspace/public/pm/c3-case.js +0 -196
  260. package/workspace/public/pm/c3-core-docs.css +0 -18
  261. package/workspace/public/pm/c3-core-docs.js +0 -236
  262. package/workspace/public/pm/c3-daypart.js +0 -176
  263. package/workspace/public/pm/c3-demo-boards.js +0 -764
  264. package/workspace/public/pm/c3-demo-brief-ix.js +0 -350
  265. package/workspace/public/pm/c3-demo-brief-page.js +0 -70
  266. package/workspace/public/pm/c3-demo-cal-ix.js +0 -74
  267. package/workspace/public/pm/c3-demo-cal2.js +0 -66
  268. package/workspace/public/pm/c3-demo-cal3.js +0 -173
  269. package/workspace/public/pm/c3-demo-cal4.js +0 -169
  270. package/workspace/public/pm/c3-demo-cal5.js +0 -52
  271. package/workspace/public/pm/c3-demo-coredocs.js +0 -221
  272. package/workspace/public/pm/c3-demo-data.js +0 -552
  273. package/workspace/public/pm/c3-demo-focus.js +0 -181
  274. package/workspace/public/pm/c3-demo-init.js +0 -430
  275. package/workspace/public/pm/c3-demo-life.js +0 -77
  276. package/workspace/public/pm/c3-demo-material.js +0 -58
  277. package/workspace/public/pm/c3-demo-misc2.js +0 -34
  278. package/workspace/public/pm/c3-demo-phone.js +0 -48
  279. package/workspace/public/pm/c3-demo-plan2.js +0 -30
  280. package/workspace/public/pm/c3-demo-rd.js +0 -432
  281. package/workspace/public/pm/c3-demo-rep-ix.js +0 -126
  282. package/workspace/public/pm/c3-demo-rep2.js +0 -130
  283. package/workspace/public/pm/c3-demo-rep3.js +0 -138
  284. package/workspace/public/pm/c3-demo-rs.js +0 -287
  285. package/workspace/public/pm/c3-demo-term.js +0 -153
  286. package/workspace/public/pm/c3-demo-time.js +0 -49
  287. package/workspace/public/pm/c3-demo-work-ix.js +0 -32
  288. package/workspace/public/pm/c3-demo.js +0 -131
  289. package/workspace/public/pm/c3-design-studio.js +0 -369
  290. package/workspace/public/pm/c3-doc-formats.js +0 -153
  291. package/workspace/public/pm/c3-doc-sheet.js +0 -1230
  292. package/workspace/public/pm/c3-dock.js +0 -206
  293. package/workspace/public/pm/c3-docs.js +0 -291
  294. package/workspace/public/pm/c3-driver-work.js +0 -110
  295. package/workspace/public/pm/c3-driver.css +0 -18
  296. package/workspace/public/pm/c3-driver.js +0 -298
  297. package/workspace/public/pm/c3-focus.css +0 -304
  298. package/workspace/public/pm/c3-focus.js +0 -983
  299. package/workspace/public/pm/c3-ib-docs.js +0 -92
  300. package/workspace/public/pm/c3-ib-initiatives.js +0 -201
  301. package/workspace/public/pm/c3-ib-items.js +0 -210
  302. package/workspace/public/pm/c3-ib-releases.js +0 -48
  303. package/workspace/public/pm/c3-ib-sprints.js +0 -201
  304. package/workspace/public/pm/c3-ib-triage.js +0 -177
  305. package/workspace/public/pm/c3-ii-tabs.js +0 -252
  306. package/workspace/public/pm/c3-ini-life.css +0 -34
  307. package/workspace/public/pm/c3-ini-life.js +0 -379
  308. package/workspace/public/pm/c3-ini-records.js +0 -197
  309. package/workspace/public/pm/c3-ini-timeline.js +0 -278
  310. package/workspace/public/pm/c3-ini-work.js +0 -139
  311. package/workspace/public/pm/c3-init-extras.js +0 -170
  312. package/workspace/public/pm/c3-initiatives.js +0 -852
  313. package/workspace/public/pm/c3-lifecycle-panels.js +0 -479
  314. package/workspace/public/pm/c3-look.js +0 -27
  315. package/workspace/public/pm/c3-material.css +0 -22
  316. package/workspace/public/pm/c3-material.js +0 -321
  317. package/workspace/public/pm/c3-md.js +0 -3
  318. package/workspace/public/pm/c3-misc-panels.js +0 -89
  319. package/workspace/public/pm/c3-new-session.js +0 -110
  320. package/workspace/public/pm/c3-notes.js +0 -751
  321. package/workspace/public/pm/c3-phone-boot.js +0 -47
  322. package/workspace/public/pm/c3-phone-detail.js +0 -97
  323. package/workspace/public/pm/c3-phone-model.js +0 -3
  324. package/workspace/public/pm/c3-phone.css +0 -66
  325. package/workspace/public/pm/c3-phone.js +0 -444
  326. package/workspace/public/pm/c3-plan-panels.js +0 -163
  327. package/workspace/public/pm/c3-plan.js +0 -193
  328. package/workspace/public/pm/c3-quiet.css +0 -113
  329. package/workspace/public/pm/c3-quiet.js +0 -177
  330. package/workspace/public/pm/c3-replay.css +0 -133
  331. package/workspace/public/pm/c3-replay.js +0 -429
  332. package/workspace/public/pm/c3-report-deck.css +0 -163
  333. package/workspace/public/pm/c3-report-deck.js +0 -598
  334. package/workspace/public/pm/c3-report-frame.css +0 -20
  335. package/workspace/public/pm/c3-report-print.css +0 -20
  336. package/workspace/public/pm/c3-report-setup.css +0 -67
  337. package/workspace/public/pm/c3-report-setup.js +0 -298
  338. package/workspace/public/pm/c3-report-store.js +0 -244
  339. package/workspace/public/pm/c3-report-structure.css +0 -44
  340. package/workspace/public/pm/c3-report-structure.js +0 -473
  341. package/workspace/public/pm/c3-reports.css +0 -68
  342. package/workspace/public/pm/c3-reports.js +0 -377
  343. package/workspace/public/pm/c3-roadmap.js +0 -249
  344. package/workspace/public/pm/c3-scan-api.js +0 -167
  345. package/workspace/public/pm/c3-scan-next.js +0 -248
  346. package/workspace/public/pm/c3-scan-setup.js +0 -313
  347. package/workspace/public/pm/c3-scan-words.js +0 -41
  348. package/workspace/public/pm/c3-scan.css +0 -74
  349. package/workspace/public/pm/c3-scan.js +0 -93
  350. package/workspace/public/pm/c3-session-chat.js +0 -103
  351. package/workspace/public/pm/c3-session-conv.js +0 -165
  352. package/workspace/public/pm/c3-session-term.js +0 -216
  353. package/workspace/public/pm/c3-settings.css +0 -85
  354. package/workspace/public/pm/c3-settings.js +0 -1045
  355. package/workspace/public/pm/c3-shell.js +0 -628
  356. package/workspace/public/pm/c3-signals.js +0 -196
  357. package/workspace/public/pm/c3-strategy-panels.js +0 -45
  358. package/workspace/public/pm/c3-swipe.js +0 -230
  359. package/workspace/public/pm/c3-terminal-data.js +0 -48
  360. package/workspace/public/pm/c3-terminal-edge.js +0 -91
  361. package/workspace/public/pm/c3-terminal-icons.js +0 -40
  362. package/workspace/public/pm/c3-terminal-results.js +0 -141
  363. package/workspace/public/pm/c3-terminal.js +0 -52
  364. package/workspace/public/pm/c3-tickets.js +0 -163
  365. package/workspace/public/pm/c3-timeline.js +0 -201
  366. package/workspace/public/pm/calendar-views.js +0 -1049
  367. package/workspace/public/pm/console3-lift.md +0 -220
  368. package/workspace/public/pm/cozy-home.js +0 -172
  369. package/workspace/public/pm/cozy-initiative.css +0 -138
  370. package/workspace/public/pm/cycle-review.js +0 -125
  371. package/workspace/public/pm/data.js +0 -1577
  372. package/workspace/public/pm/dest-board.js +0 -444
  373. package/workspace/public/pm/dest-docs.js +0 -530
  374. package/workspace/public/pm/dest-initiatives.js +0 -162
  375. package/workspace/public/pm/dest-mywork.js +0 -307
  376. package/workspace/public/pm/dest-notes.js +0 -537
  377. package/workspace/public/pm/dest-people.js +0 -449
  378. package/workspace/public/pm/dest-reports.js +0 -383
  379. package/workspace/public/pm/dest-settings.js +0 -601
  380. package/workspace/public/pm/dest-today.js +0 -267
  381. package/workspace/public/pm/display-word.js +0 -56
  382. package/workspace/public/pm/doc-editor.js +0 -473
  383. package/workspace/public/pm/doc-graph.js +0 -272
  384. package/workspace/public/pm/doc-health-panel.js +0 -110
  385. package/workspace/public/pm/doc-rail.js +0 -167
  386. package/workspace/public/pm/doc-remote.js +0 -180
  387. package/workspace/public/pm/dock-sessions.js +0 -472
  388. package/workspace/public/pm/dock.js +0 -216
  389. package/workspace/public/pm/fixture.js +0 -821
  390. package/workspace/public/pm/flag-picker.js +0 -104
  391. package/workspace/public/pm/frame-copy.js +0 -278
  392. package/workspace/public/pm/freshness-line.js +0 -149
  393. package/workspace/public/pm/handoff-box.js +0 -82
  394. package/workspace/public/pm/initiative-list.js +0 -235
  395. package/workspace/public/pm/initiative-sheet.js +0 -331
  396. package/workspace/public/pm/initiatives-api.js +0 -95
  397. package/workspace/public/pm/initiatives-copy.js +0 -287
  398. package/workspace/public/pm/initiatives-timeline-copy.js +0 -59
  399. package/workspace/public/pm/initiatives-timeline.js +0 -410
  400. package/workspace/public/pm/initiatives-ui.js +0 -291
  401. package/workspace/public/pm/item-sheet.js +0 -268
  402. package/workspace/public/pm/keep-card.js +0 -204
  403. package/workspace/public/pm/lifecycle-lens-model.js +0 -246
  404. package/workspace/public/pm/lifecycle-lens.js +0 -276
  405. package/workspace/public/pm/lifecycle.js +0 -111
  406. package/workspace/public/pm/mobile.css +0 -366
  407. package/workspace/public/pm/mobile.js +0 -581
  408. package/workspace/public/pm/modes-live.js +0 -453
  409. package/workspace/public/pm/modes.js +0 -147
  410. package/workspace/public/pm/my-work-card.js +0 -51
  411. package/workspace/public/pm/my-work-data.js +0 -36
  412. package/workspace/public/pm/new-initiative-sheet.js +0 -169
  413. package/workspace/public/pm/next-step-ui.js +0 -190
  414. package/workspace/public/pm/outbox-panel.js +0 -125
  415. package/workspace/public/pm/palette-copy.js +0 -55
  416. package/workspace/public/pm/palette.js +0 -343
  417. package/workspace/public/pm/panel-breakdown.js +0 -702
  418. package/workspace/public/pm/panel-cockpit.js +0 -425
  419. package/workspace/public/pm/panel-detail.js +0 -1513
  420. package/workspace/public/pm/panel-initiatives.js +0 -929
  421. package/workspace/public/pm/panel-newsess.js +0 -709
  422. package/workspace/public/pm/panel-repos.js +0 -741
  423. package/workspace/public/pm/panel-tabs.js +0 -1506
  424. package/workspace/public/pm/panel-trees.js +0 -204
  425. package/workspace/public/pm/people-link.js +0 -106
  426. package/workspace/public/pm/phone-deck.js +0 -167
  427. package/workspace/public/pm/pm-work-view.js +0 -1533
  428. package/workspace/public/pm/portfolio-report.js +0 -61
  429. package/workspace/public/pm/premium-acts.js +0 -280
  430. package/workspace/public/pm/premium-brief.js +0 -111
  431. package/workspace/public/pm/premium-chat.js +0 -22
  432. package/workspace/public/pm/premium-doc-sheet.js +0 -312
  433. package/workspace/public/pm/premium-initiative.js +0 -324
  434. package/workspace/public/pm/premium-insights.css +0 -228
  435. package/workspace/public/pm/premium-metric-tiles.js +0 -68
  436. package/workspace/public/pm/premium-report-brief.js +0 -132
  437. package/workspace/public/pm/premium-vw-rec.js +0 -67
  438. package/workspace/public/pm/premium-wide.css +0 -30
  439. package/workspace/public/pm/print.css +0 -44
  440. package/workspace/public/pm/provider-cards.js +0 -136
  441. package/workspace/public/pm/registry.js +0 -203
  442. package/workspace/public/pm/release-card.js +0 -110
  443. package/workspace/public/pm/releases-view.js +0 -248
  444. package/workspace/public/pm/report-families-view.js +0 -505
  445. package/workspace/public/pm/report-slides.js +0 -438
  446. package/workspace/public/pm/report-tab.js +0 -33
  447. package/workspace/public/pm/report-view.js +0 -337
  448. package/workspace/public/pm/reports-copy.js +0 -134
  449. package/workspace/public/pm/roadmap.js +0 -294
  450. package/workspace/public/pm/run-card.js +0 -260
  451. package/workspace/public/pm/sessions-panel.js +0 -219
  452. package/workspace/public/pm/sheet-jira.js +0 -353
  453. package/workspace/public/pm/shell-bell.js +0 -163
  454. package/workspace/public/pm/shell-model.js +0 -83
  455. package/workspace/public/pm/shell-phone.js +0 -124
  456. package/workspace/public/pm/shell-readaloud.js +0 -53
  457. package/workspace/public/pm/shell-recording.js +0 -274
  458. package/workspace/public/pm/shell-ticker.js +0 -90
  459. package/workspace/public/pm/sig-watch.js +0 -41
  460. package/workspace/public/pm/slide-confirm.js +0 -163
  461. package/workspace/public/pm/slides-copy.js +0 -52
  462. package/workspace/public/pm/status-banner.js +0 -95
  463. package/workspace/public/pm/tab-doc.js +0 -859
  464. package/workspace/public/pm/tab-gone.js +0 -21
  465. package/workspace/public/pm/tab-term.js +0 -1210
  466. package/workspace/public/pm/tab-web.js +0 -90
  467. package/workspace/public/pm/timeline-copy.js +0 -48
  468. package/workspace/public/pm/timeline-forecast-view.js +0 -164
  469. package/workspace/public/pm/today-agenda.js +0 -331
  470. package/workspace/public/pm/today-cards.js +0 -244
  471. package/workspace/public/pm/today-copy.js +0 -506
  472. package/workspace/public/pm/today-day.js +0 -1371
  473. package/workspace/public/pm/today-goals.js +0 -297
  474. package/workspace/public/pm/today-jobs.js +0 -84
  475. package/workspace/public/pm/today-mentions.js +0 -50
  476. package/workspace/public/pm/topbar.js +0 -202
  477. package/workspace/public/pm/triage-card.js +0 -60
  478. package/workspace/public/pm/undo-hold.js +0 -103
  479. package/workspace/public/pm/view-addrepo.js +0 -208
  480. package/workspace/public/pm/view-files.js +0 -197
  481. package/workspace/public/pm/view-livenotes.js +0 -399
  482. package/workspace/public/pm/view-today.js +0 -13
  483. package/workspace/public/pm/view-validate.js +0 -171
  484. package/workspace/public/pm/welcome.js +0 -391
  485. package/workspace/public/pm/work-place.js +0 -68
  486. package/workspace/public/pm/xlsx-read.js +0 -117
  487. package/workspace/public/welcome.html +0 -22
  488. package/workspace/test-lists/browser-suites-green.json +0 -5
  489. package/workspace/test-lists/c3-core-docs.json +0 -9
  490. package/workspace/test-lists/c3-doc-sheet-rich.json +0 -6
  491. package/workspace/test-lists/c3-doc-sheet-size.json +0 -6
  492. package/workspace/test-lists/c3-doc-sheet-v2.json +0 -6
  493. package/workspace/test-lists/c3-ib-items.json +0 -9
  494. package/workspace/test-lists/c3-ib-more.json +0 -9
  495. package/workspace/test-lists/c3-ib-triage-backlog.json +0 -9
  496. package/workspace/test-lists/c3-ini-life.json +0 -9
  497. package/workspace/test-lists/c3-meeting-board.json +0 -5
  498. package/workspace/test-lists/c3-meeting-card.json +0 -5
  499. package/workspace/test-lists/c3-notes-place.json +0 -5
  500. package/workspace/test-lists/c3-notes-series.json +0 -5
  501. package/workspace/test-lists/calendar-time-page.json +0 -5
  502. package/workspace/test-lists/calpop.json +0 -4
  503. package/workspace/test-lists/console3-briefing.json +0 -9
  504. package/workspace/test-lists/console3-foundation.json +0 -9
  505. package/workspace/test-lists/console3-work-page.json +0 -9
  506. package/workspace/test-lists/premium-brief-parity.json +0 -9
  507. package/workspace/test-lists/report-design-studio-ui.json +0 -5
  508. package/workspace/test-lists/report-structure-ui.json +0 -11
  509. package/workspace/test-lists/report-workspace-ui.json +0 -5
  510. package/workspace/test-lists/run3-a.json +0 -5
  511. package/workspace/test-lists/run3-d.json +0 -6
  512. package/workspace/test-lists/run4-c.json +0 -13
  513. package/workspace/test-lists/today-goals-jobs-ui.json +0 -5
  514. package/workspace/test-lists/today-mentions-cards.json +0 -5
  515. package/workspace/test-lists/workspace-tabs-declutter.json +0 -13
@@ -1,92 +0,0 @@
1
- /* pm/c3-ib-docs.js — the Docs tab of a board (mockup v5, 34-initiatives.js tabDocs / docList / docRow), and the doc helpers the
2
- * initiative's own Docs tab (c3-ii-tabs.js) shares.
3
- * registerBoardTab('docs', (host, ctx) => ...)
4
- * CORE First, the board's core documents (c3-core-docs.js, GET /api/core-docs level=board): the set, its state, Draft it, Review the draft.
5
- * Then "Other documents", the list below.
6
- * DOCS The documents of the board's initiatives from the Documents data: GET /api/docs/library (files { path, title, category, date,
7
- * initiative }, categories). A file belongs to the board when its `initiative` is one of the board's initiatives (from
8
- * loadItems, c3-ini-work.js). Graph nodes (files with `node`) are left out. A search box filters by title, path, type and
9
- * initiative. A row opens in place (its path, type and date) and "Open the document" opens the document sheet (c3-doc-sheet.js);
10
- * when the sheet cannot load, the toast names the path.
11
- * SHARED loadDocs(ctx, idSet) · renderDocs(host, ctx, docs, order, titles, grouped)
12
- * Nothing is invented: a board with no linked documents says so. */
13
- import { el } from './dom.js';
14
- import { registerBoardTab } from './c3-initiatives.js';
15
- import { icon, pbtn, lk, chip, tag, st, note, sect, list, empty, nrow, plural, day, ago, parseDay, put, cols } from './c3-ini-ui.js';
16
- import { loadItems } from './c3-ini-work.js';
17
- import { coreDocs } from './c3-core-docs.js';
18
-
19
- const STALE_DAYS = 30;
20
- /** The documents of the library that belong to the ids: { ok, error, docs: [{ path, name, cat, ty, date, ini, st }] }. */
21
- export async function loadDocs(ctx, idSet) {
22
- const lib = await ctx.api.get('/api/docs/library', { board: ctx.board.id });
23
- if (!lib || !lib.ok) return { ok: false, error: (lib && lib.error) || 'no answer', docs: [] };
24
- const catName = Object.fromEntries((lib.categories || []).map((c) => [c.key, c.name]));
25
- const docs = (lib.files || []).filter((f) => !f.node && f.initiative && idSet.has(f.initiative)).map((f) => {
26
- const age = parseDay(f.date) ? -(Math.round((parseDay(f.date) - parseDay(ctx.today)) / 864e5)) : null;
27
- return { path: f.path, name: f.title || f.path, cat: f.category || '', ty: catName[f.category] || f.category || 'Document', date: f.date || '', ini: f.initiative, st: age != null && age > STALE_DAYS ? 'stale' : 'current' };
28
- });
29
- docs.sort((a, b) => String(b.date).localeCompare(String(a.date)));
30
- return { ok: true, error: '', docs };
31
- }
32
-
33
- async function openDoc(ctx, d, titles) {
34
- try {
35
- const { openDocSheet } = await import('./c3-doc-sheet.js');
36
- const ui = openDocSheet({ ws: ctx.ws, doc: { path: d.path, name: d.name, ty: d.ty, v: '', st: d.st, ini: d.ini, iniName: titles.get(d.ini) || d.ini },
37
- library: () => ctx.api.get('/api/docs/library', { board: ctx.board.id }) });
38
- ui.setOpener((o) => openDoc(ctx, { path: o.path, name: o.name, ty: o.ty, st: o.st, ini: o.ini }, titles));
39
- } catch { ctx.toast('The document sheet could not open. The file is ' + d.path + '.'); }
40
- }
41
-
42
- /** The search box and the list of docs. `grouped` false draws one flat list (an initiative's own page). `title` names the list ("Other documents"
43
- * beside the core documents; "Documents" by default). */
44
- export function renderDocs(host, ctx, docs, order, titles, grouped, title) {
45
- const results = el('div', { 'data-inb': 'docs-list' });
46
- const input = el('input', { type: 'text', placeholder: 'Search documents', 'aria-label': 'Search documents', 'data-inb': 'docs-search', autocomplete: 'off' });
47
- const count = el('span', { class: 'dim mono ini-meta', 'data-inb': 'docs-count', 'aria-live': 'polite' });
48
- const row = (d) => nrow({ ic: 'doc', title: d.name, titleAttrs: { 'data-inb-doc': d.path },
49
- chips: [/spec|prd/i.test(d.cat + ' ' + d.ty) ? tag(d.ty) : chip(d.ty), d.st === 'stale' ? st('warn', 'clock', 'Stale') : null, d.date ? chip(icon('clock', 'sm'), 'updated ' + ago(d.date, ctx.today)) : null,
50
- grouped && d.ini ? lk({ onclick: () => ctx.openInitiative(d.ini), 'data-inb-docini': d.ini }, d.ini) : null],
51
- xp: [note(d.path + (d.date ? ' · ' + day(d.date) : '')), el('div', { class: 'chips2' }, pbtn('outline', 'Open the document', 'next', { 'data-inb-docopen': d.path, onclick: () => openDoc(ctx, d, titles) }))],
52
- attrs: { 'data-inb-docrow': d.path } });
53
- const draw = () => {
54
- const q = input.value.trim().toLowerCase();
55
- const shown = docs.filter((d) => !q || (d.name + ' ' + d.path + ' ' + d.ty + ' ' + d.ini + ' ' + (titles.get(d.ini) || '')).toLowerCase().includes(q));
56
- count.textContent = q ? plural(shown.length, 'document') + ' match' + (shown.length === 1 ? 'es' : '') : plural(docs.length, 'document');
57
- if (!shown.length) { put(results, empty(q ? 'No document matches "' + input.value.trim() + '".' : 'No documents.', { 'data-inb': 'docs-none' })); return; }
58
- if (!grouped) { put(results, sect({ ic: 'doc', title: title || 'Documents', count: shown.length }, list(shown.map(row)))); return; }
59
- put(results, ...order.filter((id) => shown.some((d) => d.ini === id)).map((id) => {
60
- const g = shown.filter((d) => d.ini === id);
61
- return sect({ ic: 'init', title: id + ' ' + (titles.get(id) || ''), count: g.length, attrs: { 'data-inb-docgrp': id }, right: lk({ onclick: () => ctx.openInitiative(id, 'docs'), 'aria-label': 'Open ' + id }, 'Open initiative') }, list(g.map(row)));
62
- }));
63
- };
64
- input.addEventListener('input', draw);
65
- put(host, grouped && title ? el('div', { class: 'sh2 cd-oh', 'data-inb': 'docs-title' }, el('h2', null, icon('doc', 'sm'), title, ' ', el('span', { class: 'bdg g' }, String(docs.length)))) : null,
66
- el('div', { class: 'calbar' }, el('div', { class: 'form ini-grow' }, input), count), results);
67
- draw();
68
- }
69
-
70
- registerBoardTab('docs', async (host, ctx) => {
71
- let dead = false;
72
- const other = el('div', { class: 'cd-host', 'data-cd': 'other' }, note('Reading the documents'));
73
- const cd = coreDocs({ api: ctx.api, level: 'board', board: ctx.board.id, ws: ctx.ws, today: ctx.today, toast: ctx.toast, scopeLabel: ctx.board.name, boardRow: ctx.board,
74
- nav: { tab: (t) => ctx.openBoard(ctx.board.id, t), tool: () => {}, reports: () => ctx.showTab('rep') } });
75
- put(host, cols([cd.left, other], cd.right));
76
- const stop = () => { dead = true; cd.dispose(); };
77
- const items = await loadItems(ctx);
78
- if (dead) return stop;
79
- if (!items.ok) { put(other, el('div', { class: 'fold w', role: 'alert' }, icon('alert', 'sm'), 'The initiatives of this board could not be read: ' + items.error + '.')); return stop; }
80
- const titles = new Map(items.initiatives.map((r) => [r.id, r.title]));
81
- const lib = await loadDocs(ctx, new Set(titles.keys()));
82
- if (dead) return stop;
83
- if (!lib.ok) { put(other, el('div', { class: 'fold w', role: 'alert' }, icon('alert', 'sm'), 'The documents could not be read: ' + lib.error + '.')); return stop; }
84
- cd.setIniDocs({ docs: lib.docs.length, initiatives: new Set(lib.docs.map((d) => d.ini)).size });
85
- if (!lib.docs.length) {
86
- put(other, empty(items.initiatives.length ? 'No other documents are linked to the initiatives of ' + ctx.board.name + ' yet.' : ctx.board.name + ' has no initiatives, so there are no other documents.', { 'data-inb': 'docs-empty' }));
87
- return stop;
88
- }
89
- const order = [...new Set(lib.docs.map((d) => d.ini))];
90
- renderDocs(other, ctx, lib.docs, order, titles, true, 'Other documents');
91
- return stop;
92
- });
@@ -1,201 +0,0 @@
1
- /* pm/c3-ib-initiatives.js — the Initiatives tab of a board (mockup v5, 34-initiatives.js tabInitiatives / iniToolbar / iniRow; its header and
2
- * lifecycle from mockup v2 of c3-initiative-lifecycle, approved 2026-10-13).
3
- * registerBoardTab('initiatives', (host, ctx) => ...) ctx is documented in the header of c3-initiatives.js.
4
- * What it draws, all of it paged on the server (GET /api/boards/backlog; q, view, cat, stage, status, owner, horizon, sort, offset, limit, archived):
5
- * - one row of controls: a search box with an icon (debounced), the view menu (Now and next, Mine, At risk, No owner, All), a filter
6
- * icon whose menu holds Status (grouped Active, Paused, Closed), Stage, Category, Owner and Horizon and whose badge counts the
7
- * filters on, a sort icon whose menu holds the sort keys and the direction, and New initiative. "All active" and "At risk or late"
8
- * are comma lists (status=on track,at risk,late), which the server reads as any of;
9
- * - the filters on, as removable chips in the list header, and Clear;
10
- * - one console3 row per initiative: id, its workflow template, the stage dots of its own workflow, status, then owner, progress,
11
- * dates and warnings (or, when it is on hold or cancelled, since when, the check-back day and the reason), "Merged from", the
12
- * duplicate hint; a "…" menu (Move to a stage, Status, Tidy up: c3-ini-life.js rowMenu) and Open;
13
- * - a footer: the numbered pager of 25, "N cancelled hidden" (opens All with Status: Cancelled) and "N archived" (opens the archive);
14
- * - the archive: a search box and Back to initiatives, each archived initiative with its reason or "Merged into <id>", Restore or
15
- * Undo merge.
16
- * ctx.filter (from the URL or a Summary tile) opens the tab on that view and those filters. One request is in flight at a time; a change
17
- * made meanwhile is sent when it returns and the older answer is dropped. After a hold, cancel or resume the list reads again until the
18
- * row shows it (the engine derives a lifecycle change in a child process). host.dataset.ibbState is loading | ready | error and
19
- * host.dataset.ibbSeq counts the answers drawn (the browser suites poll both). */
20
- import { el } from './dom.js';
21
- import { registerBoardTab } from './c3-initiatives.js';
22
- import { icon, lk, ib, pbtn, pill, chip, st, note, list, empty, nrow, sect, statusChip, ownerChip, stepsMini, progChip, dateChip, daysBetween, plural, openMenu, CATS, put } from './c3-ini-ui.js';
23
- import { wfOf, catOf, tplName } from './c3-ini-work.js';
24
- import { rowMenu, lifeChips, archivedChips, dupChip, mergedFromChip, restoreBtn, rowIcon, ensureLifeCss } from './c3-ini-life.js';
25
-
26
- const PAGE = 25;
27
- const VIEWS = [['now', 'Now and next'], ['mine', 'Mine'], ['risk', 'At risk'], ['noowner', 'No owner'], ['all', 'All']];
28
- const STATUS_GROUPS = [['', [['', 'Any']]],
29
- ['Active', [['on track,at risk,late', 'All active'], ['on track', 'On track'], ['at risk,late', 'At risk or late'], ['at risk', 'At risk'], ['late', 'Late']]],
30
- ['Paused', [['on hold', 'On hold']]],
31
- ['Closed', [['done,cancelled', 'Done or cancelled'], ['done', 'Done'], ['cancelled', 'Cancelled']]]];
32
- const STATUS = STATUS_GROUPS.flatMap((g) => g[1]);
33
- const HORIZON = [['', 'Any'], ['now,next', 'Now and next'], ['now', 'Now'], ['next', 'Next'], ['later', 'Later']];
34
- const SORTS = [['horizon', 'Horizon'], ['end', 'Ends'], ['title', 'Title'], ['stage', 'Stage'], ['progress', 'Progress'], ['status', 'Status'], ['owner', 'Owner'], ['id', 'Key']];
35
- const FKEYS = ['status', 'stage', 'cat', 'owner', 'horizon'];
36
- const FNAME = { status: 'Status', stage: 'Stage', cat: 'Category', owner: 'Owner', horizon: 'Horizon' };
37
- const toneOf = (s) => (s === 'late' ? 'bad' : s === 'at risk' ? 'warn' : 'ok');
38
- const warnChip = (w) => st('warn', 'alert', w, { title: 'An order rule, shown as a warning. It never blocks.', 'data-ini-warning': w });
39
- const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
40
-
41
- registerBoardTab('initiatives', (host, ctx) => {
42
- ensureLifeCss();
43
- const b = ctx.board;
44
- const f0 = ctx.filter || {};
45
- const sort0 = String(f0.sort || 'horizon');
46
- const Q = { q: String(f0.q || ''), view: VIEWS.some((v) => v[0] === f0.view) ? f0.view : 'now', cat: CATS.includes(f0.cat) ? f0.cat : '', stage: f0.stage || '', status: f0.status || '', owner: f0.owner || '', horizon: f0.horizon || '',
47
- sort: SORTS.some((s) => s[0] === sort0.replace(/^-/, '')) ? sort0.replace(/^-/, '') : 'horizon', dir: sort0.startsWith('-') ? -1 : 1, offset: Math.max(0, Number(f0.offset) || 0), archived: f0.archived === '1' };
48
- const S = { data: null, flying: false, again: false, dead: false, seq: 0, err: '' };
49
-
50
- const search = el('input', { type: 'text', 'data-ibb': 'q', 'aria-label': 'Search initiatives', value: Q.q, autocomplete: 'off' });
51
- let deb = null;
52
- search.addEventListener('input', () => { clearTimeout(deb); deb = setTimeout(() => { Q.q = search.value.trim(); Q.offset = 0; request(); }, 250); });
53
- search.addEventListener('keydown', (e) => { if (e.key === 'Enter') { e.preventDefault(); clearTimeout(deb); Q.q = search.value.trim(); Q.offset = 0; request(); } });
54
- const top = el('div', { class: 'calbar il-bar', 'data-ibb': 'toolbar' });
55
- const err = el('div', { class: 'fold w', role: 'alert', 'data-ibb': 'error', hidden: '' });
56
- const body = el('div', { 'data-ibb': 'body' });
57
- const foot = el('div', { class: 'il-listfoot', 'data-ibb': 'foot' });
58
- put(host, el('div', { class: 'calbody', 'data-ibb': 'initiatives' }, top, err, body, foot));
59
- host.dataset.ibbState = 'loading'; host.dataset.ibbSeq = '0';
60
-
61
- const on = () => FKEYS.filter((k) => Q[k]);
62
- const labelOf = (k, v) => (k === 'status' ? (STATUS.find((x) => x[0] === v) || [null, v])[1] : k === 'horizon' ? (HORIZON.find((x) => x[0] === v) || [null, v])[1] : k === 'owner' && v === 'none' ? 'No owner' : v);
63
- const set = (patch) => { Object.assign(Q, patch, { offset: 0 }); request(); };
64
- function clearFilters() { for (const k of FKEYS) Q[k] = ''; Q.q = ''; search.value = ''; Q.offset = 0; request(); }
65
-
66
- function drawControls() {
67
- search.placeholder = Q.archived ? 'Search the ' + b.name + ' archive' : 'Search ' + b.name + ' initiatives';
68
- search.setAttribute('aria-label', Q.archived ? 'Search the archive' : 'Search initiatives');
69
- const box = el('div', { class: 'form il-search' }, icon('search', 'sm'), search);
70
- if (Q.archived) {
71
- put(top, box, pbtn('outline', [el('span', { class: 'il-back' }, icon('next', 'sm')), 'Back to initiatives'], null, { 'data-ibb': 'back', onclick: () => set({ archived: false }) }));
72
- return;
73
- }
74
- const n = on().length;
75
- const view = (VIEWS.find((v) => v[0] === Q.view) || VIEWS[0])[1];
76
- const sl = (SORTS.find((s) => s[0] === Q.sort) || SORTS[0])[1];
77
- put(top, box,
78
- pbtn('ghost', [view, el('span', { class: 'il-chev' }, icon('next', 'sm'))], null, { 'data-ibb': 'views', 'aria-haspopup': 'menu', 'aria-expanded': 'false', title: 'Saved views', onclick: (e) => viewsMenu(e.currentTarget) }),
79
- ib(n ? 'Filters, ' + n + ' on' : 'Filters', [icon('filter', 'sm'), n ? el('span', { class: 'bdg' }, String(n)) : null], { class: 'il-ib', 'data-ibb': 'filters', 'aria-haspopup': 'dialog', 'aria-expanded': 'false', title: 'Filters', onclick: (e) => filterMenu(e.currentTarget) }),
80
- ib('Sort: ' + sl + ', ' + (Q.dir > 0 ? 'ascending' : 'descending'), el('span', { class: Q.dir > 0 ? 'il-up' : 'il-down' }, icon('next', 'sm')), { 'data-ibb': 'sort', 'aria-haspopup': 'menu', 'aria-expanded': 'false', onclick: (e) => sortMenu(e.currentTarget) }),
81
- pbtn('primary', 'New initiative', 'plus', { 'data-ini': 'new-initiative', 'aria-haspopup': 'dialog', onclick: () => ctx.newInitiative() }));
82
- }
83
- const tick = () => el('span', { class: 'il-tick' }, icon('check', 'sm'));
84
- function viewsMenu(anchor) {
85
- openMenu(anchor, { label: 'Saved views', items: [{ group: 'Views' }, ...VIEWS.map(([k, l]) => ({ kids: [tick(), l], checked: Q.view === k, attrs: { 'data-ibb-view': k }, onPick: () => set({ view: k }) }))] });
86
- }
87
- function sortMenu(anchor) {
88
- openMenu(anchor, { label: 'Sort', items: [{ group: 'Sort by' }, ...SORTS.map(([k, l]) => ({ kids: [tick(), l], checked: Q.sort === k, attrs: { 'data-ibb-sort': k }, onPick: () => set({ sort: k }) })),
89
- { group: 'Order' }, { kids: [el('span', { class: Q.dir > 0 ? 'il-up' : 'il-down' }, icon('next', 'sm')), Q.dir > 0 ? 'Ascending, press to flip' : 'Descending, press to flip'], attrs: { 'data-ibb': 'dir' }, onPick: () => set({ dir: -Q.dir }) }] });
90
- }
91
- function filterMenu(anchor) {
92
- const fa = (S.data && S.data.facets) || {};
93
- const keep = (k, keys) => (Q[k] && !keys.includes(Q[k]) ? [Q[k], ...keys] : keys);
94
- const order = (b.workflow || []).map((s) => s.name);
95
- const stages = keep('stage', Object.keys(fa.stage || {}).sort((x, y) => ((order.indexOf(x) + 1 || 99) - (order.indexOf(y) + 1 || 99)) || x.localeCompare(y)));
96
- const owners = keep('owner', Object.keys(fa.owner || {}).filter((o) => o !== 'none').sort((x, y) => (x === 'You' ? -1 : y === 'You' ? 1 : x.localeCompare(y))));
97
- const n = (k, v) => (fa[k] && fa[k][v] != null ? ' (' + fa[k][v] + ')' : '');
98
- const opt = (k, [v, l]) => el('option', { value: v, selected: v === Q[k] }, l);
99
- const sel = (k, label, kids) => el('label', { class: 'il-f' }, el('span', null, label), el('select', { 'data-ibb-filter': k, 'aria-label': label, onchange: (e) => { Q[k] = e.target.value; Q.offset = 0; request(); } }, ...kids));
100
- const panel = el('div', { 'data-ibb': 'filter-panel' }, el('div', { class: 'ini-mlbl' }, 'Filter initiatives'),
101
- sel('status', 'Status', STATUS_GROUPS.map(([g, opts]) => (g ? el('optgroup', { label: g }, ...opts.map((o) => opt('status', o))) : opts.map((o) => opt('status', o))))),
102
- sel('stage', 'Stage', [['', 'Any'], ...stages.map((s) => [s, s + n('stage', s)])].map((o) => opt('stage', o))),
103
- sel('cat', 'Category', [['', 'Any'], ...CATS.map((c) => [c, c + n('cat', c)])].map((o) => opt('cat', o))),
104
- sel('owner', 'Owner', [['', 'Anyone'], ['none', 'No owner' + n('owner', 'none')], ...owners.map((o) => [o, o + n('owner', o)])].map((o) => opt('owner', o))),
105
- sel('horizon', 'Horizon', HORIZON.map((o) => opt('horizon', o))),
106
- el('div', { class: 'chips2 il-fend' }, lk({ 'data-ibb': 'clear-in-menu', onclick: () => { clearFilters(); anchor.focus(); } }, 'Clear filters')));
107
- openMenu(anchor, { label: 'Filters', body: panel });
108
- }
109
- function chipsOf() {
110
- const ks = on();
111
- if (!ks.length) return null;
112
- return el('div', { class: 'chips2 il-chips', 'data-ibb': 'chips' },
113
- ...ks.map((k) => lk({ 'data-ibb-unset': k, title: 'Remove this filter', onclick: () => set({ [k]: '' }) }, FNAME[k] + ': ' + labelOf(k, Q[k]) + ' ', icon('x', 'sm'))),
114
- lk({ 'data-ibb': 'clear', onclick: clearFilters }, 'Clear'));
115
- }
116
-
117
- const L = { ctx, done: (change) => settle(change) };
118
- function rowOf(r) {
119
- if (r.archived) {
120
- return nrow({ ic: rowIcon(r), title: r.title || r.id, onOpen: () => ctx.openInitiative(r.id), openLabel: 'Open ' + r.id + ' ' + (r.title || ''), titleAttrs: { 'data-ibb-open': r.id },
121
- chips: archivedChips(r).flat(), right: [restoreBtn(L, r)], attrs: { 'data-ibb-row': r.id, 'data-il-archived': r.archived.into ? 'merged' : 'archived' } });
122
- }
123
- const wf = wfOf(r, b);
124
- const stopped = r.status === 'on hold' || r.status === 'cancelled';
125
- const late = !stopped && r.status !== 'done' && r.end && daysBetween(ctx.today, r.end) < 0;
126
- return nrow({ ic: rowIcon(r), hot: r.status === 'late' || r.status === 'at risk', title: r.title || r.id,
127
- onOpen: () => ctx.openInitiative(r.id), openLabel: 'Open ' + r.id + ' ' + (r.title || ''), titleAttrs: { 'data-ibb-open': r.id },
128
- chips: [el('span', { class: 'chip2 mono' }, r.id), el('span', { class: 'tag', title: 'Workflow' }, tplName(r, b)), stepsMini(wf, r.stage, tplName(r, b)), statusChip(r.status),
129
- ...(stopped ? lifeChips(r) : [ownerChip(r.owner), progChip(r.progress || 0, toneOf(r.status)), dateChip(r.start, r.end, late), b.build ? chip(icon('bolt', 'sm'), plural((r.epics || []).length, 'epic')) : null, r.anchor ? null : st('warn', 'alert', 'No anchor'), ...(r.warnings || []).map(warnChip)]),
130
- mergedFromChip(r), dupChip(L, r)],
131
- right: [ib('Actions for ' + r.id, 'more', { 'data-ibb-move': r.id, 'data-ibb-menu': r.id, 'aria-haspopup': 'menu', 'aria-expanded': 'false', title: 'Move, pause, merge or archive',
132
- onclick: (e) => rowMenu(e.currentTarget, L, r, b.self ? null : async (stage) => { const m = await ctx.moveTo(r.id, stage); if (m && m.ok) request(); }) }),
133
- ib('Open ' + r.id, 'next', { 'data-ini-open': r.id, onclick: () => ctx.openInitiative(r.id) })],
134
- attrs: { 'data-ibb-row': r.id, 'data-cat': r.cat || catOf(wf, r.stage), 'data-status': r.status } });
135
- }
136
- function pagerOf(d) {
137
- const pages = Math.max(1, Math.ceil(d.total / PAGE)); const cur = Math.floor(d.offset / PAGE);
138
- if (pages < 2) return null;
139
- const nums = []; for (let p = 0; p < pages; p++) if (p < 2 || p >= pages - 1 || Math.abs(p - cur) <= 1) nums.push(p); else if (nums[nums.length - 1] !== '…') nums.push('…');
140
- const to = (p) => { Q.offset = p * PAGE; request(true); };
141
- return el('div', { class: 'chips2 ini-pager', 'data-ibb': 'pager' }, el('span', { class: 'dim mono ini-meta' }, (d.offset + 1) + '–' + Math.min(d.total, d.offset + d.rows.length) + ' of ' + d.total),
142
- pill({ 'data-ibb': 'prev', disabled: cur === 0, onclick: () => to(cur - 1) }, 'Previous'),
143
- ...nums.map((p) => (p === '…' ? el('span', { class: 'dim' }, '…') : pill({ 'data-ibb-page': String(p + 1), 'aria-pressed': String(p === cur), 'aria-label': 'Page ' + (p + 1), onclick: () => to(p) }, String(p + 1)))),
144
- pill({ 'data-ibb': 'next', disabled: cur >= pages - 1, onclick: () => to(cur + 1) }, 'Next'));
145
- }
146
- function draw() {
147
- err.textContent = S.err; err.hidden = !S.err;
148
- drawControls();
149
- const d = S.data;
150
- if (!d) return;
151
- if (Q.archived) {
152
- put(body, sect({ ic: 'clip', title: 'Archive', count: d.total, right: el('span', { class: 'dim il-hint' }, 'Kept whole. Restore puts it back as it was.'), attrs: { 'data-ibb': 'archive' } },
153
- d.rows.length ? list(d.rows.map(rowOf), { 'data-ibb': 'rows' }) : empty(Q.q ? 'Nothing in the archive matches.' : 'Nothing archived on this board.', { 'data-ibb': 'empty' })));
154
- put(foot, pagerOf(d));
155
- } else {
156
- const filtered = on().length || Q.q;
157
- put(body, sect({ ic: 'init', title: 'Initiatives', count: d.total, right: chipsOf() },
158
- d.rows.length ? list(d.rows.map(rowOf), { 'data-ibb': 'rows' }) : empty(filtered || Q.view !== 'all' ? 'No initiatives match. Clear the filters or pick All.' : b.name + ' has no initiatives yet. Press New initiative, or accept an ask in Triage.', { 'data-ibb': 'empty' })));
159
- put(foot, pagerOf(d), d.cancelledHidden || d.archived ? el('span', { class: 'chips2' },
160
- d.cancelledHidden ? lk({ 'data-ibb': 'show-cancelled', title: 'Cancelled initiatives are hidden from every view', onclick: () => set({ view: 'all', status: 'cancelled' }) }, icon('x', 'sm'), d.cancelledHidden + ' cancelled hidden') : null,
161
- d.archived ? lk({ 'data-ibb': 'show-archive', onclick: () => set({ archived: true }) }, icon('clip', 'sm'), d.archived + ' archived') : null) : null);
162
- }
163
- host.dataset.ibbSeq = String(++S.seq);
164
- }
165
-
166
- async function request(keepFocus) {
167
- if (S.dead) return;
168
- if (S.flying) { S.again = true; return; }
169
- S.flying = true; host.dataset.ibbState = 'loading'; host.setAttribute('aria-busy', 'true');
170
- let r;
171
- for (;;) {
172
- S.again = false;
173
- const q = { ...Q };
174
- r = await ctx.api.get('/api/boards/backlog', { board: b.id, q: q.q, view: q.view, cat: q.cat, stage: q.stage, status: q.status, owner: q.owner, horizon: q.horizon, sort: (q.dir < 0 ? '-' : '') + q.sort, offset: q.offset, limit: PAGE, archived: q.archived ? '1' : '' });
175
- if (S.dead) return null;
176
- if (!S.again) break;
177
- }
178
- S.flying = false; host.removeAttribute('aria-busy');
179
- if (!r || !r.ok || r.pending) { S.err = r && r.pending ? 'The repository is still being read. Try again in a moment.' : 'The initiatives could not be read: ' + ((r && r.error) || 'no answer') + '.'; host.dataset.ibbState = 'error'; draw(); return null; }
180
- S.err = ''; S.data = { total: r.total || 0, offset: r.offset || 0, limit: r.limit || PAGE, rows: r.rows || [], facets: r.facets || {}, cancelledHidden: r.cancelledHidden || 0, archived: r.archived || 0 };
181
- Q.offset = S.data.offset;
182
- draw(); host.dataset.ibbState = 'ready';
183
- if (keepFocus) { const f = foot.querySelector('[aria-pressed="true"]'); if (f) f.focus(); }
184
- return S.data;
185
- }
186
- /* After a write: read again. A lifecycle line is derived in a child process, so the list may show the old status for a moment;
187
- * read again until the row shows the new one, or it left the list (a paused initiative leaves Now and next), up to ten times. */
188
- async function settle(change) {
189
- for (let k = 0; k < 10 && !S.dead; k++) {
190
- const d = await request();
191
- if (!d || !change || change.kind !== 'status') return;
192
- const row = d.rows.find((x) => x.id === change.id);
193
- if (change.status ? (!row || row.status === change.status) : (!row || (row.status !== 'on hold' && row.status !== 'cancelled'))) return;
194
- await sleep(800);
195
- }
196
- }
197
-
198
- drawControls();
199
- request();
200
- return () => { S.dead = true; clearTimeout(deb); };
201
- });
@@ -1,210 +0,0 @@
1
- /* pm/c3-ib-items.js — the Backlog, Board and Timeline tabs of a board (mockup v5, 34-initiatives.js tabItems / backlogBody / kanbanBody /
2
- * timelineBody). The three show the same work items, Jira items and PMOS tasks mixed (GET /api/boards/items through loadItems), under ONE
3
- * filter set per board that the three tabs share, on one row (c3-board-declutter): search, an initiative picker, and a Filters panel
4
- * with Type, Source and Done; a filter that is on shows as a chip with an x. ctx.filter.ini (a link "this initiative
5
- * only" from an initiative page) sets the Initiative filter on mount. Source shows only when the board has Build and deliver on: with it
6
- * off there is no Jira, and every item is a PMOS task.
7
- * registerBoardTab('backlog' | 'board' | 'timeline', (host, ctx) => ...)
8
- * Backlog an "Add a PMOS task" form (POST /api/boards/tasks/add: title, initiative), then a section per initiative: its epics, each
9
- * followed by its items, then the items with no epic. A row opens the item sheet (c3-ini-work.js openWorkSheet).
10
- * Board four columns, one per item status (To do, In progress, In review, Done), 8 cards each with "Show more". A PMOS task is
11
- * dragged to another column (HTML drag and drop) or moved with its Move menu: POST /api/boards/tasks/state. A Jira item has
12
- * a lock: a drop says its status lives in Jira. Epics are on Backlog and Timeline, not here.
13
- * Timeline initiative > epic > item on the HTML timeline (c3-ini-timeline.js): a PMOS bar drags to reschedule (POST
14
- * /api/boards/tasks/reschedule, with Undo), a Jira bar is locked; release dates (GET /api/releases) are markers.
15
- * Every control is a button; the drag handlers are drag events on the cards and columns (pointer handlers stay on the document). */
16
- import { el } from './dom.js';
17
- import { registerBoardTab } from './c3-initiatives.js';
18
- import { icon, pill, lk, ib, pbtn, note, sect, card, list, empty, stepsMini, jiraLabel, plural, trunc, openMenu, mono, put } from './c3-ini-ui.js';
19
- import { STATUSES, wfOf, tplName, loadItems, dropItems, workRow, workTlRows, iniTlRow, rescheduleTask, lockedToast } from './c3-ini-work.js';
20
- import { timeline, tlInit, tlRange, tlStill } from './c3-ini-timeline.js';
21
-
22
- const COL_CAP = 8;
23
- const TL_CAP = 14;
24
- const KINDS = [['', 'Any type'], ['Epic', 'Epic'], ['Story', 'Story'], ['Task', 'Task'], ['Bug', 'Bug']];
25
- const STATE = new Map(); // ws|board -> the shared filters
26
- const stateOf = (ctx) => {
27
- const k = ctx.ws + '|' + ctx.board.id;
28
- if (!STATE.has(k)) STATE.set(k, { q: '', ini: '', src: '', kind: '', hideDone: false, more: {}, tlAll: false });
29
- return STATE.get(k);
30
- };
31
- const matches = (st, w) => {
32
- const q = st.q.trim().toLowerCase();
33
- return (!st.ini || w.ini === st.ini) && (!st.src || w.src === st.src) && (!st.kind || w.kind === st.kind) && (!st.hideDone || w.status !== 'Done')
34
- && (!q || ((w.key || '') + ' ' + w.title + ' ' + (w.owner || '') + ' ' + w.ini).toLowerCase().includes(q));
35
- };
36
-
37
- function mountItems(tab) {
38
- return async (host, ctx) => {
39
- const b = ctx.board;
40
- const st = stateOf(ctx);
41
- if (ctx.filter && ctx.filter.ini) st.ini = ctx.filter.ini;
42
- if (!b.build && st.src === 'jira') st.src = '';
43
- let dead = false; let R = null;
44
- put(host, note('Reading the work items'));
45
- async function reload(force) {
46
- R = await loadItems(ctx, force);
47
- if (!dead) draw();
48
- }
49
- const changed = () => { dropItems(ctx); reload(true); };
50
-
51
- function toolbar(all, shown) {
52
- const byId = new Map(R.initiatives.map((i) => [i.id, i]));
53
- const withWork = [...new Set(all.map((w) => w.ini))].map((id) => byId.get(id)).filter(Boolean).sort((a, c) => ((c.featured ? 1 : 0) - (a.featured ? 1 : 0)) || a.id.localeCompare(c.id));
54
- if (st.ini && !withWork.some((i) => i.id === st.ini) && byId.get(st.ini)) withWork.push(byId.get(st.ini));
55
- const others = R.initiatives.length - withWork.length;
56
- const search = el('input', { type: 'text', value: st.q, placeholder: 'Search ' + b.name + ' work items', 'aria-label': 'Search work items', 'data-wk': 'q', autocomplete: 'off' });
57
- let deb = null;
58
- search.addEventListener('input', () => { clearTimeout(deb); deb = setTimeout(() => { st.q = search.value; draw('[data-wk="q"]'); }, 200); });
59
- const tick = () => el('span', { class: 'il-tick' }, icon('check', 'sm'));
60
- const SRCS = [['', 'All sources'], ['jira', 'Jira ' + jiraLabel(b)], ['pmos', 'PMOS tasks']];
61
- const nf = (st.kind ? 1 : 0) + (st.src ? 1 : 0) + (st.hideDone ? 1 : 0);
62
- const iniMenu = (anchor) => openMenu(anchor, { label: 'Initiative', items: [{ group: 'Initiative' },
63
- { kids: [tick(), 'All initiatives'], checked: !st.ini, attrs: { 'data-wk-ini': '' }, onPick: () => { st.ini = ''; draw('[data-wk="ini"]'); } },
64
- ...withWork.map((i) => ({ kids: [tick(), el('span', { class: 'mono' }, i.id), ' ' + trunc(i.title, 30)], checked: st.ini === i.id, attrs: { 'data-wk-ini': i.id, title: i.id + ' ' + i.title }, onPick: () => { st.ini = i.id; draw('[data-wk="ini"]'); } })),
65
- ...(others > 0 ? [{ group: plural(others, 'more has', 'more have') + ' no work yet' }] : [])] });
66
- const filterMenu = (anchor) => {
67
- const sel = (k, label, opts) => el('label', { class: 'il-f' }, el('span', null, label), el('select', { 'aria-label': label, 'data-wk': k === 'kind' ? 'kind' : 'src', onchange: (e) => { st[k] = e.target.value; draw('[data-wk="filters"]'); } }, ...opts.map(([v, l]) => el('option', { value: v, selected: v === st[k] }, l))));
68
- openMenu(anchor, { label: 'Filters', body: el('div', { 'data-wk': 'filter-panel' }, el('div', { class: 'ini-mlbl' }, 'Filter work items'),
69
- sel('kind', 'Type', KINDS), b.build ? sel('src', 'Source', SRCS) : null,
70
- el('label', { class: 'il-f' }, el('span', null, 'Done'), el('select', { 'aria-label': 'Done items', 'data-wk': 'done', onchange: (e) => { st.hideDone = e.target.value === 'hide'; draw('[data-wk="filters"]'); } }, el('option', { value: 'show', selected: !st.hideDone }, 'Show'), el('option', { value: 'hide', selected: st.hideDone }, 'Hide'))),
71
- b.build ? null : el('div', { class: 'dim il-fnote', 'data-wk': 'no-jira' }, 'Build and deliver is off, so every item is a PMOS task. ', lk({ onclick: () => ctx.openBoardSettings() }, 'Board settings')),
72
- el('div', { class: 'chips2 il-fend' }, lk({ 'data-wk': 'clear-in-menu', onclick: () => { Object.assign(st, { q: '', ini: '', src: '', kind: '', hideDone: false }); draw(); } }, 'Clear filters'))) });
73
- };
74
- const on = [st.kind ? ['kind', 'Type: ' + st.kind] : null, st.src ? ['src', 'Source: ' + (st.src === 'jira' ? 'Jira' : 'PMOS tasks')] : null, st.hideDone ? ['hideDone', 'Done hidden'] : null].filter(Boolean);
75
- const any = st.q || st.ini || on.length;
76
- return [
77
- el('div', { class: 'calbar wk-fbar' }, el('div', { class: 'form il-search' }, icon('search', 'sm'), search),
78
- pbtn('ghost', [st.ini ? el('span', { class: 'mono' }, st.ini) : 'All initiatives', el('span', { class: 'il-chev' }, icon('next', 'sm'))], null, { 'data-wk': 'ini', 'aria-haspopup': 'menu', 'aria-expanded': 'false', title: 'Initiative', onclick: (e) => iniMenu(e.currentTarget) }),
79
- ib(nf ? 'Filters, ' + nf + ' on' : 'Filters', [icon('filter', 'sm'), nf ? el('span', { class: 'bdg' }, String(nf)) : null], { class: 'il-ib', 'data-wk': 'filters', 'aria-haspopup': 'dialog', 'aria-expanded': 'false', title: 'Filters', onclick: (e) => filterMenu(e.currentTarget) }),
80
- any ? el('div', { class: 'chips2 il-chips', 'data-wk': 'chips' },
81
- ...on.map(([k, l]) => lk({ 'data-wk-unset': k, title: 'Remove this filter', onclick: () => { st[k] = k === 'hideDone' ? false : ''; draw('[data-wk="filters"]'); } }, l + ' ', icon('x', 'sm'))),
82
- lk({ 'data-wk': 'clear', onclick: () => { Object.assign(st, { q: '', ini: '', src: '', kind: '', hideDone: false }); draw(); } }, 'Clear')) : null),
83
- ];
84
- }
85
-
86
- /* ── Backlog ── */
87
- function addForm() {
88
- const inis = R.initiatives.filter((i) => i.status !== 'done' && i.status !== 'cancelled').sort((a, c) => ((c.featured ? 1 : 0) - (a.featured ? 1 : 0)) || a.id.localeCompare(c.id)).slice(0, 60);
89
- const F = { ini: st.ini && inis.some((i) => i.id === st.ini) ? st.ini : (inis[0] || {}).id || '', busy: false };
90
- const input = el('input', { type: 'text', placeholder: 'Add a PMOS task', 'aria-label': 'Add a PMOS task', 'data-wk': 'add-title' });
91
- const msg = el('div', { class: 'fold w', role: 'alert', hidden: '', 'data-wk': 'add-error' });
92
- async function add() {
93
- const title = input.value.trim();
94
- if (!title) { msg.textContent = 'Write the task first.'; msg.hidden = false; input.focus(); return; }
95
- if (!F.ini || F.busy) return;
96
- F.busy = true;
97
- const r = await ctx.api.post('/api/boards/tasks/add', { board: b.id, initiative: F.ini, title });
98
- F.busy = false;
99
- if (!r || !r.ok) { msg.textContent = 'The task was not added: ' + ((r && r.error) || 'no answer') + '.'; msg.hidden = false; return; }
100
- ctx.toast('PMOS task added to ' + F.ini + '. Drag it on the Timeline to set its dates.');
101
- changed();
102
- }
103
- input.addEventListener('keydown', (e) => { if (e.key === 'Enter') { e.preventDefault(); add(); } });
104
- return card({ ic: 'plus', title: 'Add a PMOS task', sub: b.build ? 'Jira items are created in Jira' : 'this board has no Jira', attrs: { 'data-wk': 'add' } },
105
- inis.length ? el('div', { class: 'form' }, input,
106
- el('select', { 'aria-label': 'Initiative for the task', 'data-wk': 'add-ini', onchange: (e) => { F.ini = e.target.value; } }, ...inis.map((i) => el('option', { value: i.id, selected: i.id === F.ini }, i.id + ' ' + trunc(i.title, 28)))),
107
- pbtn('outline', 'Add', 'plus', { 'data-wk': 'add-go', onclick: add })) : note('No open initiative to add a task to.'), msg);
108
- }
109
- function backlogBody(shown, all) {
110
- const byId = new Map(R.initiatives.map((i) => [i.id, i]));
111
- const groups = [...new Set(shown.map((w) => w.ini))].map((id) => byId.get(id)).filter(Boolean).sort((a, c) => ((c.featured ? 1 : 0) - (a.featured ? 1 : 0)) || String(a.start || '9').localeCompare(String(c.start || '9')));
112
- const secs = groups.map((i) => {
113
- const its = shown.filter((w) => w.ini === i.id); const epics = its.filter((w) => w.kind === 'Epic');
114
- const inEpic = (w) => w.kind !== 'Epic' && w.epic && epics.some((e) => e.uid === w.epic);
115
- const ordered = [...epics.flatMap((e) => [e, ...its.filter((w) => w.epic === e.uid)]), ...its.filter((w) => w.kind !== 'Epic' && !inEpic(w))];
116
- return sect({ ic: 'init', title: i.id + ' ' + trunc(i.title, 48), count: its.length, attrs: { 'data-wk-group': i.id },
117
- right: el('span', { class: 'chips2' }, stepsMini(wfOf(i, b), i.stage, tplName(i, b)), lk({ onclick: () => ctx.openInitiative(i.id, 'breakdown') }, 'Open initiative')) },
118
- list(ordered.map((w) => workRow(ctx, w, { all, sub: inEpic(w), onChanged: changed }))));
119
- });
120
- return [addForm(), ...(secs.length ? secs : [empty('No work items match. Clear the filters, or add a PMOS task.', { 'data-wk': 'empty' })])];
121
- }
122
-
123
- /* ── Board (kanban) ── */
124
- async function setState(w, s) {
125
- if (w.src === 'jira') { lockedToast(ctx, w.key); return; }
126
- if (w.status === s) return;
127
- const r = await ctx.api.post('/api/boards/tasks/state', { board: b.id, task: w.ref, state: s });
128
- if (!r || !r.ok) { ctx.toast({ text: 'The status did not change: ' + ((r && r.error) || 'no answer') + '.', tone: 'error' }); return; }
129
- ctx.toast('"' + trunc(w.title, 40) + '" moved to ' + s + '.');
130
- changed();
131
- }
132
- function kbCard(w, all) {
133
- const li = workRow(ctx, w, { all, epic: true, onChanged: changed,
134
- right: w.src === 'pmos' ? [ib('Move ' + w.title + ' to another status', 'more', { 'data-wk-move': w.ref, 'aria-haspopup': 'menu', 'aria-expanded': 'false',
135
- onclick: (e) => openMenu(e.currentTarget, { label: 'Move to a status', items: [{ group: 'Move to' }, ...STATUSES.map((s) => ({ label: s, current: s === w.status, disabled: s === w.status, attrs: { 'data-wk-state': s }, onPick: () => setState(w, s) }))] }) })] : [] });
136
- li.setAttribute('draggable', 'true'); li.setAttribute('data-ini-card', w.uid);
137
- li.addEventListener('dragstart', (e) => { try { e.dataTransfer.setData('text/plain', w.uid); e.dataTransfer.effectAllowed = 'move'; } catch { /* no data transfer */ } li.classList.add('ini-dragging'); });
138
- li.addEventListener('dragend', () => li.classList.remove('ini-dragging'));
139
- return li;
140
- }
141
- function kanbanBody(shown, all) {
142
- const items = shown.filter((w) => w.kind !== 'Epic');
143
- const cols = STATUSES.map((s) => {
144
- const cards = items.filter((w) => w.status === s).sort((a, c) => ((c.blocked ? 1 : 0) - (a.blocked ? 1 : 0)) || String(a.end || '9').localeCompare(String(c.end || '9')));
145
- const cap = st.more[s] ? cards.length : COL_CAP;
146
- const col = sect({ ic: s === 'Done' ? 'check' : s === 'To do' ? 'todo' : 'bolt', title: s, count: cards.length, attrs: { 'data-ini-col': s, 'aria-label': s } },
147
- cards.length ? list(cards.slice(0, cap).map((w) => kbCard(w, all))) : empty('Drop a PMOS task here'),
148
- cards.length > cap ? el('div', { class: 'chips2' }, pill({ 'data-wk-more': s, onclick: () => { st.more[s] = true; draw(); } }, 'Show ' + (cards.length - cap) + ' more')) : null);
149
- col.addEventListener('dragover', (e) => { e.preventDefault(); col.classList.add('over'); });
150
- col.addEventListener('dragleave', (e) => { if (!col.contains(e.relatedTarget)) col.classList.remove('over'); });
151
- col.addEventListener('drop', (e) => {
152
- e.preventDefault(); col.classList.remove('over');
153
- let uid = ''; try { uid = e.dataTransfer.getData('text/plain'); } catch { uid = ''; }
154
- const w = items.find((x) => x.uid === uid); if (w) setState(w, s);
155
- });
156
- return col;
157
- });
158
- return [note('Columns are item statuses. Drag a PMOS task to move it, or use its menu. Jira items carry a lock: their status changes in Jira and shows here after the next sync. Epics are in Backlog and Timeline.'),
159
- el('div', { class: 'brief sbb' }, el('div', { class: 'ini-kb', 'data-wk': 'kanban' }, ...cols))];
160
- }
161
-
162
- /* ── Timeline ── */
163
- let markers = null;
164
- async function loadMarkers() {
165
- if (!b.build) { markers = []; return; }
166
- const r = await ctx.api.get('/api/releases', { board: b.id });
167
- markers = r && r.ok ? (r.releases || []).filter((x) => !x.board || x.board === b.id).map((x) => ({ id: x.id, at: String(x.release_at || x.deploy_at || x.date || '').slice(0, 10), label: x.name || x.id, kind: 'release' })).filter((m) => m.at) : [];
168
- }
169
- function timelineBody(shown) {
170
- const withItems = new Set(shown.map((w) => w.ini));
171
- let inis = R.initiatives.filter((i) => (st.ini ? i.id === st.ini : true));
172
- let hidden = 0;
173
- if (!st.ini) {
174
- const pick = inis.filter((i) => withItems.has(i.id)).sort((a, c) => ((c.featured ? 1 : 0) - (a.featured ? 1 : 0)) || String(a.start || '9').localeCompare(String(c.start || '9')));
175
- const rest = (st.src || st.q || st.kind) ? [] : inis.filter((i) => !withItems.has(i.id) && ['on track', 'at risk', 'late'].includes(i.status) && i.start && i.end && (i.horizon === 'now' || i.featured)).sort((a, c) => String(a.start).localeCompare(String(c.start)));
176
- const cap = st.tlAll ? 1e9 : TL_CAP; inis = [...pick, ...rest].slice(0, Math.max(cap, pick.length));
177
- hidden = pick.length + rest.length - inis.length;
178
- }
179
- const rows = inis.map((i) => iniTlRow(ctx, i, workTlRows(ctx, shown.filter((w) => w.ini === i.id), changed), b));
180
- const first = inis.find((i) => withItems.has(i.id));
181
- const { from, to } = tlRange(ctx.today);
182
- const key = 'b:' + ctx.ws + ':' + b.id;
183
- const node = timeline({ key, rows, from, to, today: ctx.today, markers: markers || [], head: 'Initiative > epic > item',
184
- defOpen: st.ini ? [st.ini] : first ? [first.id, ...shown.filter((w) => w.ini === first.id && w.kind === 'Epic').map((e) => e.uid)] : [],
185
- onMove: (task, days) => rescheduleTask(ctx, task, days, () => { tlStill(key); changed(); }),
186
- onLocked: (k) => lockedToast(ctx, k) });
187
- requestAnimationFrame(() => { if (!dead) tlInit(host); });
188
- return [sect({ ic: 'cal', title: 'Timeline', count: rows.length, right: mono('press a row to open its epics') }, node,
189
- hidden > 0 ? el('div', { class: 'chips2' }, el('span', { class: 'dim ini-note' }, plural(hidden, 'more Now initiative', 'more Now initiatives') + ' with no epics yet'), pill({ 'data-wk': 'tl-all', onclick: () => { st.tlAll = true; draw(); } }, 'Show all')) : null,
190
- b.build ? note('Release dates come from Jira ' + jiraLabel(b) + ' fix versions. PMOS bars drag to reschedule; Jira bars are locked.') : note('Every bar here is a PMOS task: drag it to reschedule.'))];
191
- }
192
-
193
- function draw(focusSel) {
194
- if (dead) return;
195
- if (!R.ok) { put(host, el('div', { class: 'fold w', role: 'alert', 'data-ini': 'error' }, icon('alert', 'sm'), 'The work items could not be read: ' + R.error + '.')); return; }
196
- const all = R.items; const shown = all.filter((w) => matches(st, w));
197
- const body = tab === 'backlog' ? backlogBody(shown, all) : tab === 'board' ? kanbanBody(shown, all) : timelineBody(shown);
198
- put(host, el('div', { class: 'calbody', 'data-wk-tab': tab }, ...toolbar(all, shown), ...body));
199
- if (focusSel) { const f = host.querySelector(focusSel); if (f) { f.focus(); if (f.setSelectionRange && f.value) f.setSelectionRange(f.value.length, f.value.length); } }
200
- }
201
-
202
- if (tab === 'timeline') await loadMarkers();
203
- await reload(false);
204
- return () => { dead = true; };
205
- };
206
- }
207
-
208
- registerBoardTab('backlog', mountItems('backlog'));
209
- registerBoardTab('board', mountItems('board'));
210
- registerBoardTab('timeline', mountItems('timeline'));
@@ -1,48 +0,0 @@
1
- /* pm/c3-ib-releases.js — the Releases tab of a board with Build and deliver on (mockup v5, 34-initiatives.js tabReleases).
2
- * registerBoardTab('releases', (host, ctx) => ...)
3
- * Reads GET /api/releases (lib/routes-releases.js: id, name?, initiative_ids, deploy_at, release_at, accepted_at, gapFlags, and `board`
4
- * and `status` when a release carries them) and keeps the releases whose initiative_ids meet the board's initiatives (loadItems). A
5
- * release that names another board in `board` is left out. Read-only: releases mirror Jira fix versions; their dates live on the Calendar.
6
- * Left: Unreleased (the nearest first), each row with its status, date and days to go, the share of its scope done, and in place its
7
- * scope as links; then Released. The Unreleased header links to the Calendar (c3-board-declutter: no side card). Nothing is invented: a release with no name shows
8
- * its id, one with no date says "No date yet". */
9
- import { el } from './dom.js';
10
- import { registerBoardTab } from './c3-initiatives.js';
11
- import { icon, lk, chip, tag, st, note, sect, list, empty, nrow, hbs, hbr, statusChip, jiraLabel, plural, day, daysBetween, put } from './c3-ini-ui.js';
12
- import { loadItems } from './c3-ini-work.js';
13
-
14
- const whenOf = (r) => String(r.release_at || r.deploy_at || r.date || '').slice(0, 10);
15
- const relSt = (s) => (/at risk/i.test(s) ? st('warn', 'alert', 'At risk') : /ready/i.test(s) ? st('ok', 'check', 'Ready') : /released|accepted/i.test(s) ? st('ok', 'check', s) : tag(s));
16
-
17
- registerBoardTab('releases', async (host, ctx) => {
18
- let dead = false;
19
- const b = ctx.board;
20
- put(host, note('Reading the releases'));
21
- const [items, rel] = await Promise.all([loadItems(ctx), ctx.api.get('/api/releases', { board: b.id })]);
22
- if (dead) return () => {};
23
- const fail = (t) => { put(host, el('div', { class: 'fold w', role: 'alert' }, icon('alert', 'sm'), t)); return () => { dead = true; }; };
24
- if (!items.ok) return fail('The initiatives of this board could not be read: ' + items.error + '.');
25
- if (!rel || !rel.ok) return fail('The releases could not be read: ' + ((rel && rel.error) || 'no answer') + '.');
26
- const byId = new Map(items.initiatives.map((i) => [i.id, i]));
27
- const mine = (rel.releases || []).filter((r) => (r.board ? r.board === b.id : Array.isArray(r.initiative_ids) && r.initiative_ids.some((id) => byId.has(id))));
28
- const statusOf = (r, past) => r.status || (r.accepted_at ? 'Released' : past ? 'Past' : 'Planned');
29
- const up = mine.filter((r) => !whenOf(r) || whenOf(r) >= ctx.today).sort((a, c) => (!whenOf(a)) - (!whenOf(c)) || whenOf(a).localeCompare(whenOf(c)));
30
- const past = mine.filter((r) => whenOf(r) && whenOf(r) < ctx.today).sort((a, c) => whenOf(c).localeCompare(whenOf(a)));
31
- const row = (r, isPast) => {
32
- const scope = (r.initiative_ids || []).map((id) => byId.get(id) || { id, title: '', progress: null, status: '' });
33
- const known = scope.filter((i) => i.progress != null);
34
- const prog = known.length ? known.reduce((n, i) => n + (Number(i.progress) || 0), 0) / known.length : 0;
35
- const status = statusOf(r, isPast); const w = whenOf(r); const gaps = Array.isArray(r.gapFlags) ? r.gapFlags.length : 0;
36
- return nrow({ ic: isPast ? 'check' : 'out', hot: /at risk/i.test(status), tone: isPast ? 'ok' : '', title: r.name || r.id, titleAttrs: { 'data-inb-relopen': r.id },
37
- chips: [relSt(status), chip(icon('cal', 'sm'), w ? day(w) + (isPast ? '' : ' · ' + plural(daysBetween(ctx.today, w), 'day')) : 'No date yet'),
38
- known.length ? chip(Math.round(prog * 100) + '% of scope done') : null, gaps ? st('warn', 'alert', plural(gaps, 'gap')) : null, tag(icon('jira', 'sm'), 'fix version')],
39
- xp: [hbs([hbr('Scope done', Math.round(prog * 100) + '%', prog, /at risk/i.test(status) ? 'warn' : 'ok')]),
40
- el('div', { class: 'chips', 'data-inb': 'release-scope' }, el('span', { class: 'dim ini-note' }, 'Scope:'),
41
- ...(scope.length ? scope.map((i) => el('span', { class: 'chips2' }, byId.has(i.id) ? lk({ onclick: () => ctx.openInitiative(i.id), 'data-inb-scope': i.id }, i.id + (i.title ? ' ' + i.title : '')) : chip(i.id), i.status ? statusChip(i.status) : null))
42
- : [el('span', { class: 'dim' }, 'No initiatives in scope')]))],
43
- attrs: { 'data-inb-release': r.id, 'data-inb-when': isPast ? 'past' : r === up[0] ? 'next' : 'later' } });
44
- };
45
- put(host, ...[sect({ ic: 'out', title: 'Unreleased', count: up.length, right: lk({ 'data-inb': 'open-calendar', title: 'Releases mirror Jira ' + jiraLabel(b) + ' fix versions. Their dates live on the Calendar.', onclick: () => ctx.showTab('cal') }, icon('cal', 'sm'), 'On the Calendar'), attrs: { 'data-inb': 'release-next' } }, up.length ? list(up.map((r) => row(r, false))) : empty('No release planned for ' + b.name + '.', { 'data-inb': 'release-none-next' })),
46
- past.length ? sect({ ic: 'check', title: 'Released', count: past.length, attrs: { 'data-inb': 'release-past' } }, list(past.map((r) => row(r, true)))) : null].filter(Boolean));
47
- return () => { dead = true; };
48
- });