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
@@ -0,0 +1,261 @@
1
+ /* pm/bd-asks.js — new asks, New initiative and its first questions (initiative premium-uncovered-features, Board: BdAsks, BdNew, BdGrill, BdPhone).
2
+ * New asks (BdAsks) a popover (a bottom sheet on a phone) under the chip: each ask with who sent it and where, the product it is for and why,
3
+ * the kind PMOS suggests, its anchor, the initiative it is close to and an earlier rejection. Accept to Triage
4
+ * POST /api/boards/asks/accept (Undo archives what it made); Add to <initiative> and Decline POST /api/boards/asks/decline
5
+ * with the reason. An ask the record gives two products for sits under "Not sure which product".
6
+ * New initiative (BdNew) the side panel: name, why, material (links and files), no lane field (PMOS leans on the intake draft and names the
7
+ * kind in Triage), what it counts toward, the product. A name close to an earlier rejection or to an open initiative
8
+ * says so. Create: POST /api/boards/asks/add then /asks/accept (it starts in the first stage), then POST /api/board-grill/start
9
+ * and /file for the material.
10
+ * First questions (BdGrill) the same panel, right after: what PMOS took from the Why and the material, then only the open questions, one at a
11
+ * time (POST /api/board-grill/answer). Later (POST /api/board-grill/later) keeps them as the initiative's next step.
12
+ * Nothing is sent to anyone: a decline keeps its reason in the board ledger. */
13
+ import { pmPost } from './http.js';
14
+ import { $, $$, esc } from './premium-shell.js';
15
+ import * as Pop from './bd-pop.js';
16
+ import { avatar } from './bd-views.js';
17
+
18
+ let A = null; // the page: { M(), load(), say(msg, undo?), panel(html, from, cls), close(), rowOf(key), openIni(r), openDoc(path), anchors() }
19
+ export function init(api) { A = api; }
20
+ const M = () => A.M();
21
+ const post = (p, body) => pmPost(p, { ws: M().board.ws, ...body });
22
+ const errOf = (r) => (r && r.error) || 'Nothing was recorded. The server did not say why.';
23
+ const SV = (d) => `<svg viewBox="0 0 24 24" aria-hidden="true"><path d="${d}"/></svg>`;
24
+ const I = { x: 'M6 6l12 12M18 6L6 18', link: 'M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1', file: 'M7 3h7l5 5v13H7zM14 3v5h5', up: 'M12 16V4M7 9l5-5 5 5M5 20h14', info: 'M12 8v5M12 16h.01M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0-18', chev: 'M7 10l5 5 5-5', next: 'M9 6l6 6-6 6' };
25
+ const cap = (s) => (s ? s.charAt(0).toUpperCase() + s.slice(1) : '');
26
+ const krShort = (a) => { const s = String(a || ''); if (!s) return ''; if (/^health:/.test(s)) return 'Health budget'; const m = /:o(\d+):kr(\d+)/i.exec(s); return m ? 'KR ' + m[1] + '.' + m[2] : s; };
27
+ const WHY_NOT = ['Out of scope', 'Already planned', 'Not now', 'Other'];
28
+
29
+ /* ── New asks (BdAsks, BdPhone) ─────────────────────────────────────────────────────────────────────────────────── */
30
+ let declining = null, expanded = null, picked = {};
31
+ const asksOf = () => ((M().asks && M().asks.rows) || []);
32
+ function askCard(a, i, phone) {
33
+ if (phone && i > 0 && expanded !== a.id) return `<button type="button" class="bd-acard row" data-askopen="${esc(a.id)}">${avatar(a.by || a.source)}<span class="tx"><b>${esc(a.by || a.source || 'Someone')}</b> · “${esc(a.line)}”</span>${SV(I.next)}</button>`;
34
+ const who = `<div class="bd-awho">${avatar(a.by || a.source)}<b>${esc(a.by || a.source || 'Someone')}</b><span class="bd-amut">${esc([a.by ? a.source : '', a.at].filter(Boolean).map((x) => '· ' + x).join(' '))}</span></div>`;
35
+ const prod = picked[a.id] || a.product;
36
+ const product = prod && prod.name ? `<div class="bd-aprod"><span class="bd-chip sm"><b>${esc(prod.name)}</b></span><span class="bd-amut">Why: ${esc(prod.why || '')}</span></div>` : '';
37
+ const pills = [a.draft.lane ? `<span class="bd-pill">Suggest: ${esc(cap(a.draft.lane))}</span>` : '', a.draft.anchor ? `<span class="bd-pill">${esc(krShort(a.draft.anchor))}</span>` : '', a.close ? `<span class="bd-pill w">Close to: ${esc(a.close.title)}</span>` : ''].join('');
38
+ const prior = (a.prior || []).length ? `<p class="bd-warn sm">Close to something you declined: “${esc(a.prior[0].title)}”.</p>` : '';
39
+ if (declining === a.id) {
40
+ return `<div class="bd-acard" data-ask="${esc(a.id)}">${who}<p class="bd-aq">“${esc(a.line)}”</p>${product}<p class="bd-lbl">Why not</p><div class="bd-chips" role="radiogroup" aria-label="Why not">${WHY_NOT.map((w, j) => `<button type="button" class="bd-chip${j === 0 ? ' on' : ''}" role="radio" aria-checked="${j === 0}" data-whynot="${esc(w)}">${esc(w)}</button>`).join('')}</div>`
41
+ + `<input class="bd-inp sm" name="why" maxlength="400" placeholder="Say a little more, optional" aria-label="Why not, in your words"><p class="bd-amsg" role="status"></p>`
42
+ + `<div class="bd-arow"><button type="button" class="bd-btn sm solid" data-askact="decline-go" data-id="${esc(a.id)}">Decline</button><button type="button" class="bd-btn sm ghost" data-askact="back">Back</button><span class="bd-amut bd-push">The reason is kept with the ask</span></div></div>`;
43
+ }
44
+ const btns = phone
45
+ ? `<button type="button" class="bd-btn solid wide" data-askact="accept" data-id="${esc(a.id)}">Accept to ${esc(firstStage())}</button><div class="bd-arow two">${a.close ? `<button type="button" class="bd-btn" data-askact="add" data-id="${esc(a.id)}">Add to existing</button>` : ''}<button type="button" class="bd-btn ghost" data-askact="decline" data-id="${esc(a.id)}">Decline</button></div>`
46
+ : `<div class="bd-arow"><button type="button" class="bd-btn sm solid" data-askact="accept" data-id="${esc(a.id)}">Accept to ${esc(firstStage())}</button>${a.close ? `<button type="button" class="bd-btn sm" data-askact="add" data-id="${esc(a.id)}">Add to ${esc(a.close.title)}</button>` : ''}<button type="button" class="bd-btn sm ghost" data-askact="decline" data-id="${esc(a.id)}">Decline</button></div>`;
47
+ return `<div class="bd-acard" data-ask="${esc(a.id)}">${who}<p class="bd-aq">“${esc(a.line)}”</p>${product}${pills ? `<div class="bd-pills">${pills}</div>` : ''}${prior}${btns}<p class="bd-amsg" role="status"></p></div>`;
48
+ }
49
+ const firstStage = () => (M().board.stages || [])[0] || 'Triage';
50
+ function unsureHtml(L) {
51
+ if (!L.length) return '';
52
+ return `<div class="bd-unsure"><p class="bd-lbl">Not sure which product · ${L.length}</p>${L.map((a) => `<div class="bd-un1"><p class="sm">${esc(a.by || 'Someone')}${a.source ? ' by ' + esc(a.source.toLowerCase()) : ''}: “${esc(a.line)}”</p><p class="bd-amut">Could be ${a.products.map((p) => esc(p.name) + (p.why ? ' (' + esc(p.why) + ')' : '')).join(' or ')}.</p><div class="bd-chips">${a.products.map((p) => `<button type="button" class="bd-chip" data-pickprod="${esc(a.id)}" data-prod="${esc(p.id)}">${esc(p.name)}</button>`).join('')}</div></div>`).join('')}<p class="bd-amut bd-hr">PMOS picks the product from where the ask came from and what it talks about. When both point the same way, it shows the product with its reason. When they disagree, it asks you.</p></div>`;
53
+ }
54
+ function asksHtml() {
55
+ const L = asksOf(), phone = matchMedia('(max-width: 720px)').matches;
56
+ if (M().board.self) return '<p class="bd-h3">New asks</p><p class="bd-amut">PMOS-self has no ask source. New work starts at the pmos-router skill.</p>';
57
+ if (M().asks == null || M().asks.missing) return '<p class="bd-h3">New asks</p><p class="bd-amut">The new asks could not be read, so none is shown.</p>';
58
+ const sure = L.filter((a) => !(a.products || []).length || picked[a.id]), unsure = L.filter((a) => (a.products || []).length && !picked[a.id]);
59
+ const src = [...new Set(L.map((a) => a.source).filter(Boolean))];
60
+ const head = `<div class="bd-phead"><p class="bd-h3" id="hAsks">${L.length} new ${L.length === 1 ? 'ask' : 'asks'}</p>${src.length ? `<span class="bd-amut">For ${esc(M().board.name || 'this board')} · from ${esc(src.slice(0, 3).join(', ').toLowerCase())}</span>` : ''}</div>`;
61
+ if (!L.length) return head + '<p class="bd-amut">No new ask waits for triage.</p>';
62
+ return head + `<div class="bd-acards">${sure.map((a, i) => askCard(a, i, phone)).join('')}</div>` + unsureHtml(unsure);
63
+ }
64
+ export function openAsks(btn) {
65
+ declining = null; expanded = null;
66
+ Pop.open(asksHtml(), btn, { label: 'New asks', width: 520, cls: 'bd-asks' });
67
+ }
68
+ const redrawAsks = () => Pop.redraw(asksHtml());
69
+ async function acceptAsk(a, btn) {
70
+ const d = a.draft || {};
71
+ if (!d.anchor) { Pop.close(false); openNew(null, a); return; } // no anchor yet: the New initiative panel asks for one
72
+ btn.disabled = true;
73
+ const r = await post('/api/boards/asks/accept', { board: M().board.id, ask: a.id, title: d.title, lane: d.lane || 'feature', anchor: d.anchor, intent: a.line.slice(0, 400) }).catch(() => null);
74
+ if (!r || !r.ok) { btn.disabled = false; const m = btn.closest('.bd-acard').querySelector('.bd-amsg'); if (m) m.textContent = errOf(r); return; }
75
+ Pop.close(false);
76
+ const id = r.initiative && r.initiative.id;
77
+ A.say('Accepted to ' + (r.stage || firstStage()) + ' · ' + d.title, id ? async () => { const u = await post('/api/boards/archive', { board: M().board.id, id, archived: true, reason: 'Accepted by mistake: undone' }).catch(() => null); A.say(u && u.ok ? d.title + ' is undone. It is archived, and nothing else changed.' : errOf(u)); await A.load(); } : null);
78
+ await A.load();
79
+ }
80
+ document.addEventListener('click', async (e) => {
81
+ if (!A || !Pop.isOpen() || !Pop.el().contains(e.target)) return;
82
+ const op = e.target.closest('[data-askopen]'); if (op) { expanded = op.dataset.askopen; redrawAsks(); return; }
83
+ const wn = e.target.closest('[data-whynot]'); if (wn) { $$('[data-whynot]', Pop.el()).forEach((b) => { const on = b === wn; b.classList.toggle('on', on); b.setAttribute('aria-checked', String(on)); }); return; }
84
+ const pp = e.target.closest('[data-pickprod]');
85
+ if (pp) {
86
+ const a = asksOf().find((x) => x.id === pp.dataset.pickprod), p = a && a.products.find((x) => x.id === pp.dataset.prod); if (!p) return;
87
+ if (p.name === M().board.name || p.id === M().board.id) { picked[a.id] = { name: p.name, why: 'you chose it' }; redrawAsks(); }
88
+ else A.say('Open the ' + p.name + ' Board to accept it there. This Board holds only ' + (M().board.name || 'its own') + ' work.');
89
+ return;
90
+ }
91
+ const b = e.target.closest('[data-askact]'); if (!b) return;
92
+ const k = b.dataset.askact, a = asksOf().find((x) => x.id === b.dataset.id);
93
+ if (k === 'back') { declining = null; redrawAsks(); return; }
94
+ if (!a) return;
95
+ if (k === 'decline') { declining = a.id; redrawAsks(); const f = Pop.el().querySelector('[data-whynot].on'); if (f) f.focus(); return; }
96
+ if (k === 'accept') { acceptAsk(a, b); return; }
97
+ const card = b.closest('.bd-acard'), m = card && card.querySelector('.bd-amsg');
98
+ let why;
99
+ if (k === 'add') why = 'Added to ' + a.close.title + ' (' + a.close.id + ')';
100
+ else { const c = Pop.el().querySelector('[data-whynot].on'), t = (card.querySelector('input[name="why"]') || {}).value || ''; why = ((c && c.dataset.whynot) || 'Other') + (t.trim() ? ': ' + t.trim().replace(/\s+/g, ' ') : ''); }
101
+ b.disabled = true;
102
+ const r = await post('/api/boards/asks/decline', { board: M().board.id, ask: a.id, why }).catch(() => null);
103
+ if (!r || !r.ok) { b.disabled = false; if (m) m.textContent = errOf(r); return; }
104
+ declining = null; Pop.close(false);
105
+ A.say(k === 'add' ? 'Added to ' + a.close.title + '. The ask is kept with the reason.' : 'Ask declined. The reason is kept in the board ledger.');
106
+ await A.load();
107
+ });
108
+
109
+ /* ── New initiative (BdNew) ────────────────────────────────────────────────────────────────────────────────────── */
110
+ let N = null; // the form: { ask, links: [{url,label}], files: [File], lean, prior, ack }
111
+ function materialChips() {
112
+ return N.links.map((k, i) => `<span class="bd-chip sm">${SV(I.link)}${esc(k.label)}<button type="button" class="bd-x0" data-rmlink="${i}" aria-label="Remove ${esc(k.label)}">${SV(I.x)}</button></span>`).join('')
113
+ + N.files.map((f, i) => `<span class="bd-chip sm">${SV(I.file)}${esc(f.name)}<button type="button" class="bd-x0" data-rmfile="${i}" aria-label="Remove ${esc(f.name)}">${SV(I.x)}</button></span>`).join('');
114
+ }
115
+ function kindBox() {
116
+ const lean = N.lean ? cap(N.lean) : null;
117
+ return `<b>Kind of work · PMOS works it out</b><span>No need to choose now. It starts in ${esc(firstStage())}, and PMOS names the kind (feature, discovery, chore and so on) once the BRD or the first research makes it clear. It tells you in New for you, and you can change it.</span><span class="bd-amut">Now: ${lean ? 'not sure yet · leaning ' + esc(lean) + ', from the words of the name' : 'not sure yet'}</span>`;
118
+ }
119
+ function hintsHtml() {
120
+ const p = N.prior && N.prior[0] && !N.ack ? `<div class="bd-warn"><b>Close to something you declined</b><span>“${esc(N.prior[0].title)}” was set aside in ${esc(N.prior[0].file)}.</span><div class="bd-arow"><button type="button" class="bd-btn sm" data-newact="seewhy">See why</button><button type="button" class="bd-btn sm ghost" data-newact="ack">It is different</button></div></div>` : '';
121
+ const c = N.close ? `<div class="bd-need">${SV(I.info)}<span>Also close to <button type="button" class="bd-dlink" data-newact="close">${esc(N.close.title)}</button> in ${esc(N.close.stage || 'its stage')}. Add to it instead?</span></div>` : '';
122
+ return p + c;
123
+ }
124
+ /** The open initiative a new name is close to (the model's rule for asks, run on the page as the PM types). */
125
+ function closeOf(text) {
126
+ const STOP = new Set(['the', 'and', 'for', 'with', 'from', 'that', 'this', 'who', 'what', 'when', 'can', 'are', 'was', 'not', 'our', 'your', 'their', 'they', 'into', 'each', 'all', 'any', 'has', 'have', 'its']);
127
+ const sig = (s) => new Set(String(s || '').toLowerCase().split(/[^a-z0-9]+/).filter((w) => w.length >= 3 && !STOP.has(w)));
128
+ const want = sig(text); let best = null;
129
+ for (const r of M().initiatives.list.rows) { const have = sig(r.title), n = [...have].filter((w) => want.has(w)).length; if (have.size && (n >= 2 || (n >= 1 && n / have.size >= 0.5)) && (!best || n > best.n)) best = { n, r }; }
130
+ return best ? { key: best.r.key, title: best.r.title, stage: (best.r.track && best.r.track.label) || best.r.stage } : null;
131
+ }
132
+ export async function openNew(from, ask) {
133
+ const d = ask ? ask.draft || {} : {};
134
+ N = { ask: ask || null, links: [], files: [], lean: d.lane || null, prior: ask ? ask.prior || [] : [], ack: false, close: null };
135
+ const body = `<form class="bd-form bd-new" data-form="new2"${ask ? ` data-ask="${esc(ask.id)}"` : ''} novalidate>`
136
+ + (ask ? `<p class="bd-quote">“${esc(ask.line)}”</p>` : '')
137
+ + `<label class="bd-field">Name<input class="bd-inp" name="title" maxlength="120" value="${esc(d.title || '')}" placeholder="For example: Partner SSO audit trail" autocomplete="off"></label>`
138
+ + `<label class="bd-field">Why<textarea class="bd-inp ta" name="why" rows="3" maxlength="400" placeholder="Who asks for it, and what it changes for them">${esc(ask ? ask.line : '')}</textarea></label>`
139
+ + `<div class="bd-field"><span class="bd-flbl">Material · links or files</span><div class="bd-drop" id="nwDrop"><span class="bd-mchips" id="nwMat"></span><span class="bd-sp"></span><button type="button" class="bd-ib sm" data-newact="link" aria-label="Paste a link" title="Paste a link">${SV(I.link)}</button><button type="button" class="bd-ib sm" data-newact="file" aria-label="Upload a file" title="Upload a file">${SV(I.up)}</button><input type="file" id="nwFile" multiple hidden></div>`
140
+ + `<div class="bd-linkin" id="nwLink" hidden><input class="bd-inp sm" name="link" maxlength="600" placeholder="https://" aria-label="A link"><button type="button" class="bd-btn sm" data-newact="addlink">Add</button></div><p class="bd-amut">Drop files here. PMOS reads them before it asks you anything.</p></div>`
141
+ + `<div class="bd-box sm" id="nwKind">${kindBox()}</div>`
142
+ + `<label class="bd-field">Counts toward<span id="anW"><select class="bd-inp" name="anchor" disabled><option>Reading the goals</option></select></span><span class="bd-amut">A goal, or a health budget for upkeep work.</span></label>`
143
+ + `<div class="bd-field"><span class="bd-flbl">Product</span><span class="bd-inp ro">${esc(M().board.name || 'This board')}</span></div>`
144
+ + `<div id="nwHints">${hintsHtml()}</div><p class="bd-amsg" id="formM" role="status"></p>`
145
+ + `<div class="bd-arow bd-pfoot"><button type="submit" class="bd-btn solid">${ask ? 'Accept and start ' : 'Create and start '}${esc(firstStage())}</button><span class="bd-amut">PMOS asks a few questions next</span></div></form>`;
146
+ A.panel(`<div class="pk-h"><div class="pk-ht"><h2 id="pkTitle">${ask ? 'Accept ask' : 'New initiative'}</h2></div><div class="pk-tools"><button type="button" class="bd-ib" data-pk="close" aria-label="Close" title="Close">${SV(I.x)}</button></div></div><div class="pk-b bd-pl">${body}</div>`, from, 'pk-new');
147
+ const L = await A.anchors(), w = $('#anW'); if (!w) return;
148
+ w.innerHTML = L && L.length ? `<select class="bd-inp" name="anchor"><option value="">Choose a goal or a health budget</option>${L.map((x) => `<option value="${esc(x.value)}"${x.value === d.anchor ? ' selected' : ''}>${esc(x.label || x.value)}</option>`).join('')}</select>`
149
+ : `<input class="bd-inp" name="anchor" maxlength="120" value="${esc(d.anchor || '')}" placeholder="A KR id or health:<budget>">`;
150
+ if (d.title) lean(d.title);
151
+ }
152
+ let leanT = null;
153
+ /** The intake draft of the name (POST /api/intake/draft): the kind it leans to and an earlier rejection it is close to. Drafts only. */
154
+ function lean(text) {
155
+ clearTimeout(leanT);
156
+ leanT = setTimeout(async () => {
157
+ if (!N) return;
158
+ N.close = text.trim().length > 3 ? closeOf(text) : null;
159
+ const r = text.trim().length > 3 ? await pmPost('/api/intake/draft', { line: text.trim() }).catch(() => null) : null;
160
+ if (!N) return;
161
+ if (r && r.ok && r.draft) { N.lean = r.draft.lane || N.lean; if (!N.ask) N.prior = r.draft.prior_rejections || []; }
162
+ const k = $('#nwKind'), h = $('#nwHints'); if (k) k.innerHTML = kindBox(); if (h) h.innerHTML = hintsHtml();
163
+ }, 350);
164
+ }
165
+ const drawMat = () => { const m = $('#nwMat'); if (m) m.innerHTML = materialChips(); };
166
+ function addFiles(list) { for (const f of list || []) if (N && N.files.length < 10 && !N.files.some((x) => x.name === f.name)) N.files.push(f); drawMat(); }
167
+ document.addEventListener('input', (e) => { if (N && e.target.matches('form[data-form="new2"] input[name="title"]')) lean(e.target.value); });
168
+ document.addEventListener('change', (e) => { if (N && e.target.id === 'nwFile') { addFiles(e.target.files); e.target.value = ''; } });
169
+ document.addEventListener('dragover', (e) => { const d = e.target.closest && e.target.closest('#nwDrop'); if (d) { e.preventDefault(); d.classList.add('on'); } });
170
+ document.addEventListener('dragleave', (e) => { const d = e.target.closest && e.target.closest('#nwDrop'); if (d) d.classList.remove('on'); });
171
+ document.addEventListener('drop', (e) => { const d = e.target.closest && e.target.closest('#nwDrop'); if (!d || !N) return; e.preventDefault(); d.classList.remove('on'); addFiles(e.dataTransfer && e.dataTransfer.files); });
172
+ document.addEventListener('click', (e) => {
173
+ if (!N) return;
174
+ const rl = e.target.closest('[data-rmlink]'); if (rl) { N.links.splice(+rl.dataset.rmlink, 1); drawMat(); return; }
175
+ const rf = e.target.closest('[data-rmfile]'); if (rf) { N.files.splice(+rf.dataset.rmfile, 1); drawMat(); return; }
176
+ const b = e.target.closest('[data-newact]'); if (!b) return;
177
+ const k = b.dataset.newact;
178
+ if (k === 'file') $('#nwFile').click();
179
+ else if (k === 'link') { const l = $('#nwLink'); l.hidden = !l.hidden; if (!l.hidden) l.querySelector('input').focus(); }
180
+ else if (k === 'addlink') {
181
+ const i = $('#nwLink input'), u = i.value.trim();
182
+ if (!/^https?:\/\/\S{3,}$/i.test(u)) { $('#formM').textContent = 'A link must start with http or https.'; return; }
183
+ let label = u; try { const x = new URL(u); label = x.hostname.replace(/^www\./, '') + (x.pathname.length > 1 ? x.pathname.replace(/\/$/, '').split('/').slice(-1)[0].slice(0, 30).replace(/^/, ' · ') : ''); } catch { /* keep it */ }
184
+ N.links.push({ url: u, label }); i.value = ''; $('#nwLink').hidden = true; $('#formM').textContent = ''; drawMat();
185
+ } else if (k === 'ack') { N.ack = true; $('#nwHints').innerHTML = hintsHtml(); }
186
+ else if (k === 'seewhy' && N.prior[0]) A.openDoc(N.prior[0].file);
187
+ else if (k === 'close' && N.close) { const r = A.rowOf(N.close.key); if (r) A.openIni(r); }
188
+ });
189
+ document.addEventListener('keydown', (e) => { if (N && e.key === 'Enter' && e.target.matches('#nwLink input')) { e.preventDefault(); const b = document.querySelector('[data-newact="addlink"]'); if (b) b.click(); } });
190
+ const b64 = (file) => new Promise((res) => { const fr = new FileReader(); fr.onload = () => res(String(fr.result).split(',')[1] || ''); fr.onerror = () => res(''); fr.readAsDataURL(file); });
191
+ document.addEventListener('submit', async (e) => {
192
+ const f = e.target.closest('form[data-form="new2"]'); if (!f || !A || !N) return;
193
+ e.preventDefault();
194
+ const m = $('#formM'), go = f.querySelector('[type="submit"]'), val = (n) => (f.elements[n] ? String(f.elements[n].value || '').trim() : '');
195
+ const title = val('title'), why = val('why').replace(/\s+/g, ' ').slice(0, 400), anchor = val('anchor'), askId = f.dataset.ask || null;
196
+ if (!title) { m.textContent = 'Give it a name.'; f.title.focus(); return; }
197
+ if (!anchor) { m.textContent = 'Choose what it counts toward. Unanchored work is rejected.'; return; }
198
+ go.disabled = true; m.textContent = '';
199
+ let ask = askId;
200
+ if (!ask) { const r0 = await post('/api/boards/asks/add', { board: M().board.id, line: title, source: 'New initiative, typed by you' }).catch(() => null); if (!r0 || r0.ok !== true) { go.disabled = false; m.textContent = errOf(r0); return; } ask = r0.ask && r0.ask.id; }
201
+ const res = await post('/api/boards/asks/accept', { board: M().board.id, ask, title, lane: N.lean || 'feature', anchor, ...(why ? { intent: why } : {}) }).catch(() => null);
202
+ if (!res || res.ok !== true) { go.disabled = false; m.textContent = errOf(res); return; }
203
+ const id = res.initiative && res.initiative.id, stage = res.stage || firstStage();
204
+ if (id) {
205
+ await post('/api/board-grill/start', { id, why, links: N.links }).catch(() => null);
206
+ for (const file of N.files) { if (file.size > 4 * 1024 * 1024) continue; await post('/api/board-grill/file', { id, name: file.name, type: file.type, data: await b64(file) }).catch(() => null); }
207
+ }
208
+ N = null;
209
+ A.say('“' + title + '” is ' + (askId ? 'accepted' : 'created') + ' in ' + stage + ', anchored to ' + anchor + '.');
210
+ A.load();
211
+ if (id) openGrill(id, title, stage, true); else A.close();
212
+ });
213
+
214
+ /* ── the first questions (BdGrill) ─────────────────────────────────────────────────────────────────────────────── */
215
+ let Q = null; // { id, title, stage, fresh, data, at }
216
+ const gget = async (id) => { try { const r = await (await fetch('/api/board-grill?ws=' + encodeURIComponent(M().board.ws || '') + '&id=' + encodeURIComponent(id), { credentials: 'same-origin' })).json(); return r && r.ok ? r : null; } catch { return null; } };
217
+ function grillHtml() {
218
+ const g = Q.data, qs = g ? g.questions : [], cur = qs[Q.at] || null, open = qs.filter((x) => !x.answer).length;
219
+ const took = g && g.summary.took.length ? g.summary.took : ['Nothing yet: no Why and no material were given.'];
220
+ const names = g ? g.material.links.map((k) => k.label).concat(g.material.files.map((f) => f.name)) : [];
221
+ const card = (x, i) => (i === Q.at
222
+ ? `<div class="bd-qc on" data-q="${esc(x.key)}"><span class="src">${x.n} of ${x.of} · ${esc(x.topic)}</span><b>${esc(x.q)}</b><span class="bd-amut">${esc(x.why)}</span>${x.chips.length ? `<div class="bd-chips" role="radiogroup" aria-label="${esc(x.topic)}">${x.chips.map((c) => `<button type="button" class="bd-chip${x.answer === c ? ' on' : ''}" role="radio" aria-checked="${x.answer === c}" data-qchip="${esc(c)}">${esc(c)}</button>`).join('')}</div>` : ''}<input class="bd-inp sm" name="qa" maxlength="500" value="${esc(x.answer && !x.chips.includes(x.answer) ? x.answer : '')}" placeholder="Or answer in your words…" aria-label="Your answer"></div>`
223
+ : `<button type="button" class="bd-qc off" data-qgo="${i}"><span class="src">${x.n} of ${x.of} · ${esc(x.topic)}${x.answer ? ' · answered' : ''}</span><span class="sm">${esc(x.answer ? x.q + ' ' + x.answer : x.q)}</span></button>`);
224
+ const last = Q.at >= qs.length - 1;
225
+ return `<div class="pk-h"><div class="pk-ht"><p class="pk-eye">${esc(Q.stage)} · ${Q.fresh ? 'just created' : 'open questions'}</p><h2 id="pkTitle">${esc(Q.title)}</h2></div><div class="pk-tools"><button type="button" class="bd-ib" data-grill="later" aria-label="Close. The questions stay as this initiative’s next step" title="Close">${SV(I.x)}</button></div></div>`
226
+ + `<div class="pk-b bd-pl"><div class="bd-box sm"><b>What PMOS took from your material</b>${took.map((t) => `<span>${esc(t)}</span>`).join('')}${names.length ? `<span class="bd-amut">From ${esc(names.join(' and '))}</span>` : ''}</div>`
227
+ + (qs.length ? `<div class="bd-qhd"><b>${qs.length} ${qs.length === 1 ? 'question' : 'questions'} before the BRD</b><span class="bd-amut">Only what the material does not answer</span></div>${qs.map(card).join('')}` : '<p class="bd-amut">Nothing is left to ask: the BRD can start from what you gave.</p>')
228
+ + `<p class="bd-amsg" id="grM" role="status"></p><div class="bd-arow bd-pfoot">${qs.length ? `<button type="button" class="bd-btn solid" data-grill="next">${last ? 'Done' : 'Next question'}</button>` : ''}<button type="button" class="bd-btn ghost" data-grill="later">Later</button><span class="bd-amut bd-push">${open ? 'Later keeps them as the next step' : 'Every question is answered'}</span></div></div>`;
229
+ }
230
+ export async function openGrill(id, title, stage, fresh, from) {
231
+ Q = { id, title, stage, fresh: !!fresh, data: null, at: 0 };
232
+ A.panel(grillHtml(), from || null, 'pk-new');
233
+ const g = await gget(id); if (!Q || Q.id !== id) return;
234
+ Q.data = g; Q.at = Math.max(0, g ? g.questions.findIndex((x) => !x.answer) : 0);
235
+ A.panel(grillHtml(), null, 'pk-new');
236
+ }
237
+ async function saveCur() {
238
+ const cur = Q.data && Q.data.questions[Q.at]; if (!cur) return true;
239
+ const box = document.querySelector('#peek .bd-qc.on'); if (!box) return true;
240
+ const typed = (box.querySelector('input[name="qa"]') || {}).value || '', chip = box.querySelector('[data-qchip].on');
241
+ const answer = typed.trim() || (chip ? chip.dataset.qchip : '');
242
+ if (answer === (cur.answer || '')) return true;
243
+ const r = await post('/api/board-grill/answer', { id: Q.id, q: cur.key, answer }).catch(() => null);
244
+ if (!r || !r.ok) { $('#grM').textContent = errOf(r); return false; }
245
+ Q.data = r; return true;
246
+ }
247
+ document.addEventListener('click', async (e) => {
248
+ if (!Q || !e.target.closest('#peek')) return;
249
+ const c = e.target.closest('[data-qchip]'); if (c) { $$('#peek [data-qchip]').forEach((x) => { const on = x === c && !x.classList.contains('on'); x.classList.toggle('on', on); x.setAttribute('aria-checked', String(on)); }); return; }
250
+ const go = e.target.closest('[data-qgo]'); if (go) { if (await saveCur()) { Q.at = +go.dataset.qgo; A.panel(grillHtml(), null, 'pk-new'); } return; }
251
+ const b = e.target.closest('[data-grill]'); if (!b) return;
252
+ if (!(await saveCur())) return;
253
+ const open = Q.data ? Q.data.questions.filter((x) => !x.answer).length : 0, title = Q.title;
254
+ if (b.dataset.grill === 'next' && Q.at < ((Q.data && Q.data.questions.length) || 0) - 1) { Q.at++; A.panel(grillHtml(), null, 'pk-new'); const i = $('#peek .bd-qc.on input'); if (i) i.focus(); return; }
255
+ if (b.dataset.grill === 'later' && open) await post('/api/board-grill/later', { id: Q.id }).catch(() => null);
256
+ Q = null; A.close();
257
+ A.say(open ? 'Kept as the next step of ' + title + ': ' + open + ' open ' + (open === 1 ? 'question' : 'questions') + '.' : 'The answers are kept on ' + title + ' for its BRD.');
258
+ A.load();
259
+ });
260
+ export const grillOpen = () => !!Q;
261
+ export function dropGrill() { Q = null; N = null; }
@@ -0,0 +1,59 @@
1
+ /* pm/bd-pop.js — the Board's popovers (initiative premium-uncovered-features, Board): one floating card under the button that opened it
2
+ * (BdActions' row menu, BdFilter's Filter and Find, BdSprint's sprints and releases, BdAsks' new asks, BdPanel's metric trend), and on a
3
+ * phone the same card as a bottom sheet over a scrim (BdPhone). One popover is open at a time; a press outside it, Escape or a second press
4
+ * on its button closes it, and the focus goes back to that button. */
5
+ import { $ } from './premium-shell.js';
6
+
7
+ let host = null, scrim = null, from = null, onClose = null;
8
+ const PHONE = matchMedia('(max-width: 720px)');
9
+ function ensure() {
10
+ if (host) return;
11
+ host = document.createElement('div'); host.className = 'bd-pp'; host.id = 'bdPop'; host.hidden = true; host.setAttribute('role', 'dialog');
12
+ scrim = document.createElement('div'); scrim.className = 'bd-scrim'; scrim.hidden = true;
13
+ const main = $('#stage') || document.body;
14
+ main.appendChild(scrim); main.appendChild(host);
15
+ scrim.addEventListener('click', () => close(true));
16
+ document.addEventListener('pointerdown', (e) => { if (!host.hidden && !host.contains(e.target) && !(from && from.contains(e.target)) && !e.target.closest('.bd-scrim')) close(false); }, true);
17
+ window.addEventListener('keydown', (e) => { if (e.key === 'Escape' && !host.hidden) { e.stopPropagation(); close(true); } }, true);
18
+ window.addEventListener('resize', () => { if (!host.hidden) place(); });
19
+ }
20
+ /** Where the card goes: under its button, kept inside the window; a phone puts it at the bottom as a sheet. */
21
+ function place() {
22
+ const sheet = PHONE.matches;
23
+ host.classList.toggle('sheet', sheet); scrim.hidden = !sheet;
24
+ if (sheet || !from) { host.style.left = host.style.top = ''; return; }
25
+ const b = from.getBoundingClientRect(), w = host.offsetWidth, h = host.offsetHeight;
26
+ let left = host.dataset.align === 'right' ? b.right - w : b.left;
27
+ left = Math.max(12, Math.min(left, innerWidth - w - 12));
28
+ let top = b.bottom + 8;
29
+ if (top + h > innerHeight - 12) top = Math.max(12, b.top - h - 8);
30
+ host.style.left = left + 'px'; host.style.top = top + 'px';
31
+ }
32
+ /** Opens `html` under `btn`. o: { label, cls, width, align: 'left'|'right', onClose, focus: selector } → the card. A second press on the same button closes it. */
33
+ export function open(html, btn, o = {}) {
34
+ ensure();
35
+ if (!host.hidden && btn && from === btn) { close(true); return null; }
36
+ if (!host.hidden) close(false);
37
+ host.className = 'bd-pp' + (o.cls ? ' ' + o.cls : '');
38
+ host.style.width = o.width ? o.width + 'px' : '';
39
+ host.dataset.align = o.align || 'left';
40
+ host.setAttribute('aria-label', o.label || 'Board');
41
+ host.setAttribute('role', o.role || 'dialog');
42
+ host.innerHTML = (PHONE.matches ? '<div class="bd-grab" aria-hidden="true"></div>' : '') + html;
43
+ host.hidden = false; from = btn || null; onClose = o.onClose || null;
44
+ if (from) from.setAttribute('aria-expanded', 'true');
45
+ place();
46
+ const f = (o.focus && host.querySelector(o.focus)) || host.querySelector('input, button, [tabindex="0"]');
47
+ if (f) f.focus({ preventScroll: true });
48
+ return host;
49
+ }
50
+ /** Draws the open card again with new markup, in place (a filter chip pressed, a decline opened). */
51
+ export function redraw(html) { if (!host || host.hidden) return; host.innerHTML = (PHONE.matches ? '<div class="bd-grab" aria-hidden="true"></div>' : '') + html; place(); }
52
+ export function close(back) {
53
+ if (!host || host.hidden) return;
54
+ host.hidden = true; scrim.hidden = true;
55
+ if (from) { from.setAttribute('aria-expanded', 'false'); if (back && document.contains(from)) from.focus({ preventScroll: true }); }
56
+ const cb = onClose; from = null; onClose = null; if (cb) cb();
57
+ }
58
+ export const isOpen = () => !!host && !host.hidden;
59
+ export const el = () => host;
@@ -4,7 +4,9 @@
4
4
  * the sprint band, the today line and the release line, with their labels under the axis. Monitor and Evaluate are hidden here.
5
5
  * · Year: themes, with their initiatives as bars inside, coloured by theme.
6
6
  * · 5 yr: themes only, as one phase each from the dates on record; past 18 months is directional.
7
- * · Sprint, Half and 2 yr have no Agreed frame: they are plain versions of Quarter (Sprint) and Year (Half, 2 yr), with a "Waiting for design" tag.
7
+ * · Sprint (BdSpans, initiative premium-uncovered-features): the sprint's working days, each initiative with its tickets in the sprint as rows,
8
+ * who has each one, the release sign-off and "Push tickets" as ◆, and the backlog row. Half is the Year view over six months; 2 yr is the
9
+ * 5 yr view over two years (themes as phases).
8
10
  * Themes come from GET /api/board-trail (lib/board-trail.js): one per objective, named by the PRD's theme: key, else the objective's title. The Group
9
11
  * control groups the long spans by theme, lane or owner. Milestones: a release's sign-off (◆ with its name), "Push tickets" where drafted tickets
10
12
  * wait on the Commit, and "after <initiative>" where a dependency is not done. A bar is drawn only from dates a record holds. Pure: rows and the
@@ -17,11 +19,10 @@ export const md = (d) => MON[d.getMonth()] + ' ' + d.getDate();
17
19
  const addDays = (d, n) => new Date(d.getFullYear(), d.getMonth(), d.getDate() + n);
18
20
  const addMonths = (d, n) => new Date(d.getFullYear(), d.getMonth() + n, 1);
19
21
  export const SPANS = [['sprint', 'Sprint'], ['quarter', 'Quarter'], ['half', 'Half'], ['year', 'Year'], ['y2', '2 yr'], ['y5', '5 yr']];
20
- /** The spans the Agreed design draws; the others show the "Waiting for design" card. */
21
- export const DRAWN = new Set(['quarter', 'year', 'y5']);
22
+ /** The spans a design draws: every one since the uncovered-features build. */
23
+ export const DRAWN = new Set(SPANS.map(([k]) => k));
22
24
  /** The trail's theme tones (lib/board-trail.js TONES), in THEME_TONES order. */
23
25
  const TONE_KEYS = ['grey', 'blue', 'green', 'amber', 'violet', 'teal'];
24
- const WTAG = '<span class="bd-wtag" title="This span has no Agreed design yet. It works as a plain version until it has one.">Waiting for design</span>';
25
26
  export const GROUPS = [['theme', 'Theme'], ['lane', 'Lane'], ['owner', 'Owner']];
26
27
  /** Theme colours, in the order the Agreed design's themes take them (grey, blue, green, amber, then two more). */
27
28
  export const THEME_TONES = ['var(--cz-c-8c929b)', 'var(--cz-c-4894ea)', 'var(--cz-c-5e9c6a)', 'var(--cz-c-d4a13a)', 'var(--cz-c-b07cc6)', 'var(--cz-c-d9773f)'];
@@ -134,8 +135,42 @@ function quarter(rows, M, o) {
134
135
  const body = list.map((r) => `<div class="tg-r${o.sel === r.key ? ' sel' : ''}" data-row="${esc(r.key)}"><button type="button" class="tg-n ini2" data-key="${esc(r.key)}"><b>${esc(r.title)}</b><small>${esc([r.owner, r.track ? r.track.label : r.stage].filter(Boolean).join(' · '))}</small></button><div class="tg-p">${ov}${qBar(r, X, now, false)}</div></div>`).join('');
135
136
  const axis = `<div class="tg-ax"><span></span><div class="tg-p">${now > W.from && now < W.to ? `<span class="tg-axl td" style="left:${P(X(now))}">Today</span>` : ''}${sa && sb && sb > W.from && sa < W.to ? `<span class="tg-axl sb" style="left:${P(X(sa))}">Jira ${esc(sprint.name.toLowerCase())} · ${esc(md(sa))} – ${esc(md(sb))}</span>` : ''}${ra && ra > W.from && ra < W.to ? `<span class="tg-axl rl" style="left:${P(X(ra))}">${SV(FLAG)}${esc(rel.name)} · ${esc(md(ra))}</span>` : ''}</div></div>`;
136
137
  const foot = `<div class="tg-ft">${none.length ? `<span class="tg-none"><b>${none.length} ${none.length === 1 ? 'has' : 'have'} no dates:</b> <span>${esc(none.slice(0, 4).map((r) => r.title).join(', '))}${none.length > 4 ? ' and ' + (none.length - 4) + ' more' : ''}</span>${askBtn}</span>` : '<span></span>'}${o.hiddenCount ? `<span class="tg-hid">Monitor and Evaluate hidden · ${o.hiddenCount}</span>` : ''}</div>`;
137
- const tag = o.span === 'sprint' ? `<p class="bd-whead">${WTAG}<span>The Sprint span: the current sprint's days${sprint ? ', ' + esc(sprint.name) : ''}</span></p>` : '';
138
- return { html: `${tag}<div class="tg tg-q" data-span="${o.span === 'sprint' ? 'sprint' : 'quarter'}">${head}<div class="tg-body">${lgd}${body || '<p class="tg-empty">No initiative on screen has a date on record.</p>'}</div>${axis}${foot}</div>`, none };
138
+ return { html: `<div class="tg tg-q" data-span="${o.span === 'sprint' ? 'sprint' : 'quarter'}">${head}<div class="tg-body">${lgd}${body || '<p class="tg-empty">No initiative on screen has a date on record.</p>'}</div>${axis}${foot}</div>`, none };
139
+ }
140
+
141
+ /** Sprint (BdSpans): the sprint's working days as columns; per initiative with work in the sprint, its row (the release sign-off ◆, "Push
142
+ * tickets" ◆ where drafted tickets wait on the Commit) and one row per ticket with its state and who has it. A Jira reading holds no dates per
143
+ * ticket, so a bar runs from the sprint's first day to today; a drafted ticket runs from today to the sprint's end, dashed. The backlog row counts
144
+ * the open tickets in no sprint and opens the backlog. o: { now, sel, avatar(name) } */
145
+ const WD = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
146
+ const TB = (k) => (k.blocked ? 'r' : k.status === 'Done' ? 'k' : k.status === 'In review' ? 'y' : '');
147
+ function sprintSpan(rows, M, o) {
148
+ const now = o.now, J = M.jira || {}, sp = J.sprint, W = windowOf('sprint', now, false, sp);
149
+ const days = []; for (let d = W.from; d < W.to; d = addDays(d, 1)) if (d.getDay() % 6) days.push(d);
150
+ const n = days.length || 1, same = (a, b) => a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
151
+ const idx = (d) => { if (!d) return -1; const i = days.findIndex((x) => same(x, d) || x > d); return i < 0 ? (d >= W.to ? n : -1) : i; };
152
+ const ti = Math.min(n, Math.max(0, idx(now))), at = (i) => P((i / n) * 100);
153
+ const head = `<div class="sp-r sp-h"><div class="sp-n">Initiative and ticket</div><div class="sp-g" style="--n:${n}">${days.map((d) => `<span${same(d, now) ? ' class="td"' : ''}>${WD[d.getDay()]} ${d.getDate()}</span>`).join('')}</div></div>`;
154
+ // the label sits right of the ◆, or left of it in the last third of the sprint so it stays inside the row
155
+ const dia = (i, label, cls) => `<i class="sp-dia${cls ? ' ' + cls : ''}" style="left:${at(i + 0.5)}"></i><span class="sp-dl${cls ? ' ' + cls : ''}" style="${i > n * 0.66 ? `right:calc(${P(100 - ((i + 0.5) / n) * 100)} + 14px)` : `left:calc(${at(i + 0.5)} + 14px)`}">${esc(label)}</span>`;
156
+ const groups = rows.map((r) => {
157
+ const t = r.track || {}, tk = (t.tickets || []).filter((k) => sp && k.sprint === sp.name), dr = ((r.trail && r.trail.drafted) || []).filter((x) => !x.key);
158
+ if (!tk.length && !dr.length) return '';
159
+ const ra = r.release && day(r.release.iso), ri = ra ? idx(ra) : -1;
160
+ const ms = (ri >= 0 && ri < n ? dia(ri, r.release.name + ' sign-off · ' + WD[ra.getDay()] + ' ' + ra.getDate(), '') : '') + (dr.length && ti < n ? dia(Math.min(n - 1, ti), 'Push tickets · ' + WD[(days[Math.min(n - 1, ti)] || now).getDay()], 'bl') : '');
161
+ const ini = `<div class="sp-r sp-i${o.sel === r.key ? ' sel' : ''}" data-row="${esc(r.key)}"><button type="button" class="sp-n ini2" data-key="${esc(r.key)}"><b>${esc(r.title)}</b></button><div class="sp-g sp-t" style="--n:${n}">${ms}</div></div>`;
162
+ const tks = tk.map((k) => {
163
+ const w = Math.max(1, ti + (k.status === 'Done' ? 0 : 1)), word = k.blocked ? 'Blocked' + (k.reason ? ' · ' + k.reason.replace(/^Waiting on /i, 'waits on ') : '') : k.status === 'In progress' ? 'Doing' : k.status;
164
+ return `<div class="sp-r"><button type="button" class="sp-n sp-k" data-tk="${esc(k.key)}" data-ini="${esc(r.key)}">${esc(k.key)} · ${esc(k.title)}</button><div class="sp-g sp-t" style="--n:${n}"><span class="sp-b ${TB(k)}" style="left:0;width:${at(Math.min(n, w))}"><span>${esc(word)}</span>${k.assignee && o.avatar ? o.avatar(k.assignee) : ''}</span></div></div>`;
165
+ }).join('');
166
+ const drafted = dr.length ? `<div class="sp-r"><span class="sp-n sp-k">${esc(dr.length === 1 ? (dr[0].id || 'A ticket') : (dr[0].id && dr[dr.length - 1].id ? dr[0].id + ' to ' + dr[dr.length - 1].id : dr.length + ' tickets'))} · drafted</span><div class="sp-g sp-t" style="--n:${n}"><span class="sp-b d" style="left:${at(Math.max(0, n - Math.max(3, n - ti)))};width:${at(Math.min(n, Math.max(3, n - ti)))}"><span>Draft · not pushed · waits on your Commit</span></span></div></div>` : '';
167
+ return ini + tks + drafted;
168
+ }).join('');
169
+ const bl = (J.backlog || []).length;
170
+ const back = `<div class="sp-r sp-bk"><span class="sp-n">Backlog · ${bl} not in ${sp ? esc(sp.name) : 'a sprint'}</span><div class="sp-g sp-bkg"><button type="button" class="bd-btn sm" data-backlog${bl ? '' : ' disabled'}>Show backlog</button></div></div>`;
171
+ const cap = sp ? `${esc(sp.name)} · ${esc(String(days[0] ? days[0].getDate() : ''))} to ${esc(days.length ? days[n - 1].getDate() + ' ' + MON[days[n - 1].getMonth()] : '')} · tickets with who has them` : 'No sprint is in the Jira reading. These are the next two weeks.';
172
+ const empty = `<p class="tg-empty">${sp ? 'No initiative on screen has a ticket in ' + esc(sp.name) + '.' : 'Read Jira to see the sprint\'s tickets here.'}</p>`;
173
+ return { html: `<p class="sp-cap"><span>${cap}</span><span class="bd-sp"></span><span>Group: Initiative</span></p><div class="sp" data-span="sprint">${head}<div class="sp-body">${groups || empty}</div>${back}</div><p class="tg-note">Jira holds no dates for each ticket, so a bar runs from the sprint's first day to today.</p>`, none: [] };
139
174
  }
140
175
 
141
176
  /** The groups of the long spans. By theme (default): the trail's themes (one per objective; the PRD's theme: names it, theme_note: says what it
@@ -175,7 +210,7 @@ function releasesOf(rows) {
175
210
 
176
211
  /** Year: themes with their initiatives as bars inside. */
177
212
  function year(rows, o) {
178
- const sp = o.span === 'half' || o.span === 'y2' ? o.span : 'year';
213
+ const sp = o.span === 'half' ? 'half' : 'year';
179
214
  const now = o.now, W = windowOf(sp, now), X = pctOf(W), T = themesOf(rows, o), G = (GROUPS.find((x) => x[0] === (o.group || 'theme')) || GROUPS[0])[1];
180
215
  const tn = now > W.from && now < W.to ? X(now) : null;
181
216
  const head = `<div class="tg-r tg-h"><button type="button" class="tg-n tg-help" data-rules aria-haspopup="dialog" title="How the timeline groups by span"><b>${G}</b><small>${T.length} ${T.length === 1 ? G.toLowerCase() : G.toLowerCase() + 's'} · ${rows.length} ${rows.length === 1 ? 'initiative' : 'initiatives'}</small></button><div class="tg-p">${W.ticks.map((k) => `<span style="left:${P(X(k.at))}"><b>${esc(k.label)}</b>${k.sub ? `<small>${esc(k.sub)}</small>` : ''}</span>`).join('')}</div></div>`;
@@ -189,13 +224,13 @@ function year(rows, o) {
189
224
  return `<div class="tg-r tg-th">${themeCell(t, false)}<div class="tg-p tg-stack">${grid}${lines || '<span class="tg-nod">No dates on record</span>'}</div></div>`;
190
225
  }).join('');
191
226
  const pill = tn != null ? `<span class="tg-today" style="left:calc(230px + (100% - 230px) * ${(tn / 100).toFixed(4)})">Today · ${esc(md(now))}</span>` : '';
192
- const tag = sp !== 'year' ? `<p class="bd-whead">${WTAG}<span>The ${sp === 'half' ? 'Half' : '2 yr'} span: the Year view over ${sp === 'half' ? 'six months' : 'two years'}</span></p>` : '';
193
- return { html: `${tag}<div class="tg tg-y" data-span="${sp}">${head}<div class="tg-body">${pill}${body || '<p class="tg-empty">No initiative is on screen.</p>'}</div><div class="tg-ft"><span>Bars show initiatives inside their ${G.toLowerCase()}. The darker part is done. <i class="cz-ms" aria-hidden="true"></i> is a milestone.</span><button type="button" class="tg-go" data-span-go="quarter">Switch to Quarter to see one row per initiative</button></div></div>`, none: [] };
227
+ return { html: `<div class="tg tg-y" data-span="${sp}">${head}<div class="tg-body">${pill}${body || '<p class="tg-empty">No initiative is on screen.</p>'}</div><div class="tg-ft"><span>Bars show initiatives inside their ${G.toLowerCase()}. The darker part is done. <i class="cz-ms" aria-hidden="true"></i> is a milestone.</span><button type="button" class="tg-go" data-span-go="quarter">Switch to Quarter to see one row per initiative</button></div></div>`, none: [] };
194
228
  }
195
229
 
196
230
  /** 5 yr: themes only, as one phase each from the earliest date on record to the latest; past 18 months is directional (dashed). */
197
231
  function fiveYear(rows, o) {
198
- const now = o.now, W = windowOf('y5', now), X = pctOf(W), T = themesOf(rows, o), G = (GROUPS.find((x) => x[0] === (o.group || 'theme')) || GROUPS[0])[1];
232
+ const sp = o.span === 'y2' ? 'y2' : 'y5';
233
+ const now = o.now, W = windowOf(sp, now), X = pctOf(W), T = themesOf(rows, o), G = (GROUPS.find((x) => x[0] === (o.group || 'theme')) || GROUPS[0])[1];
199
234
  const far = addMonths(now, 18), fx = X(far), tn = now > W.from && now < W.to ? X(now) : null;
200
235
  const head = `<div class="tg-r tg-h"><button type="button" class="tg-n tg-help" data-rules aria-haspopup="dialog" title="How the timeline groups by span"><b>${G}</b><small>what each ${G.toLowerCase()} is for</small></button><div class="tg-p">${fx < 100 ? `<i class="tg-dir" style="left:${P(fx)}"></i>` : ''}${W.ticks.map((k) => `<span style="left:${P(X(k.at))}"><b>${esc(k.label)}</b><small>${esc(k.sub)}</small></span>`).join('')}</div></div>`;
201
236
  const grid = W.ticks.slice(1).map((k) => `<i class="tg-gl" style="left:${P(X(k.at))}"></i>`).join('') + (fx < 100 ? `<i class="tg-dir" style="left:${P(fx)}"></i>` : '') + (tn != null ? `<u class="tg-td" style="left:${P(tn)}"></u>` : '');
@@ -211,14 +246,15 @@ function fiveYear(rows, o) {
211
246
  }).join('');
212
247
  const lab = (x) => `calc(230px + (100% - 230px) * ${(x / 100).toFixed(4)})`; // the 230 px theme column
213
248
  const marks = (tn != null ? `<span class="tg-today" style="left:${lab(tn)}">Today</span>` : '') + (fx < 100 ? `<span class="tg-far" style="left:${lab(fx)}">Beyond 18 months · directional</span>` : '');
214
- return { html: `<div class="tg tg-5y" data-span="y5">${head}<div class="tg-body">${marks}${body || '<p class="tg-empty">No initiative is on screen.</p>'}</div><div class="tg-ft"><span>Only themes and their phases at this span. Dashed means directional, not committed.</span><span class="tg-go2">Open a phase to see its initiatives</span></div></div>`, none: [] };
249
+ return { html: `<div class="tg tg-5y" data-span="${sp}">${head}<div class="tg-body">${marks}${body || '<p class="tg-empty">No initiative is on screen.</p>'}</div><div class="tg-ft"><span>Only themes and their phases at this span. Dashed means directional, not committed.</span><span class="tg-go2">Open a phase to see its initiatives</span></div></div>`, none: [] };
215
250
  }
216
251
 
217
252
  /** The timeline's markup for the rows on screen. → { html, none: [rows with no dates] } */
218
253
  export function timelineHtml(rows, M, span, o = {}) {
219
254
  const opt = { now: new Date(), phone: false, sel: null, status: () => ({ tone: 'q', text: '' }), hiddenCount: 0, askHref: () => '#', ...o };
220
255
  opt.span = span;
221
- if (span === 'year' || span === 'half' || span === 'y2') return year(rows, opt);
222
- if (span === 'y5') return fiveYear(rows, opt);
256
+ if (span === 'year' || span === 'half') return year(rows, opt);
257
+ if (span === 'y5' || span === 'y2') return fiveYear(rows, opt);
258
+ if (span === 'sprint' && !opt.phone) return sprintSpan(rows, M, opt);
223
259
  return quarter(rows, M, opt);
224
260
  }