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,103 @@
1
+ /* pm/home-review.js — the weekly review in the Viewer (initiative premium-uncovered-features, H1; canvas HmReview).
2
+ *
3
+ * Four short steps, each one keeping what the PM decided: Sort what came in, Check what you wait on, Look at untouched work, Pick next
4
+ * week's three. The ladder shows the steps done and the one on now; the step on now opens as a card with its rows. A step is done with
5
+ * POST /api/home-review/step (its note: "4 sorted · 1 kept"); an untouched initiative that was looked at is kept with
6
+ * POST /api/home-review/keep. The rows' own presses are the routes My work already uses (/api/pm-items/*) and the lifecycle route for
7
+ * a hold (POST /api/lifecycle, with the reason on the record). Every write is the PM's press. "My work" beside "Weekly review" switches the
8
+ * Viewer to My work (home-work.js).
9
+ * h: { VW, pmPost, toast, D() (Home's data), reload() (reads Home again), ws(), iniTitle(id), askAbout(stale), openWork(), now() } */
10
+ import { esc, svg, P } from './home-today.js';
11
+ import { reviewModel, staleInis } from './home-list.js';
12
+
13
+ const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
14
+ const dayLabel = (iso) => { const m = /^(\d{4})-(\d{2})-(\d{2})/.exec(String(iso || '')); return m ? +m[3] + ' ' + MON[+m[2] - 1] : ''; };
15
+ const plural = (n, one, many) => n + ' ' + (n === 1 ? one : many);
16
+ /** The seg over My work and the weekly review: which of the two the Viewer shows. */
17
+ export const tabsHtml = () => ''; // My work is no longer a page of its own (Home's list is the list), so the review has no tab beside it
18
+
19
+ export function openReview(h) {
20
+ const st = { done: {}, picked: new Set(), msg: '', busy: false };
21
+ const work = () => h.D().work || null;
22
+ const tab = (k) => (((work() && work().queue && work().queue.tabs) || []).find((t) => t.key === k) || { groups: [] }).groups.flatMap((g) => g.rows || []);
23
+ function stepBody(s, R) {
24
+ const D = h.D(), kept = R.kept || {};
25
+ if (s.key === 'sort') {
26
+ const rows = tab('inbox').concat(tab('tray'));
27
+ return (rows.slice(0, 8).map((r) => `<div class="ut-trow"><span><b>${esc(r.title)}</b>${r.sub ? ` <span class="ut-mut">· ${esc(r.sub)}</span>` : ''}</span>${st.done[r.key] ? `<span class="cz-pill ${st.done[r.key] === 'kept' ? 'q' : 'ok'}">${st.done[r.key] === 'kept' ? 'Kept' : 'In Today'}</span>` : `<button type="button" class="ut-btn sm soft" data-rv-today="${esc(r.id)}" data-k="${esc(r.key)}">Today</button><button type="button" class="ut-btn sm ghost" data-rv-keep="${esc(r.id)}" data-k="${esc(r.key)}">Keep</button>`}</div>`).join('')
28
+ || '<p class="ut-small ut-mut">Nothing came in that is not placed.</p>');
29
+ }
30
+ if (s.key === 'wait') {
31
+ const rows = (work() && work().waiting ? work().waiting.rows : []);
32
+ return rows.slice(0, 8).map((r) => `<div class="ut-trow"><span><b>${esc(r.title)}</b>${r.sub ? ` <span class="ut-mut">· ${esc(r.sub)}</span>` : ''}</span>${st.done[r.key] ? '<span class="cz-pill ok">Done</span>' : `<button type="button" class="ut-btn sm ghost" data-rv-done="${esc(r.id)}" data-k="${esc(r.key)}">It came in</button>`}</div>`).join('')
33
+ || '<p class="ut-small ut-mut">Nobody owes you anything.</p>';
34
+ }
35
+ if (s.key === 'untouched') {
36
+ const rows = staleInis(D, h.now());
37
+ const items = (work() && work().review && work().review.ids) || [];
38
+ const iRows = ((work() && work().rows) || []).filter((r, i, a) => items.includes(r.id) && a.findIndex((x) => x.id === r.id) === i);
39
+ const pill = (k) => (k.how === 'asked' ? '<span class="cz-pill">Asked in chat</span>' : k.how === 'held' ? '<span class="cz-pill q">On hold</span>' : '<span class="cz-pill ok">Kept going</span>');
40
+ return rows.slice(0, 8).map((r) => `<div class="ut-trow"><span><b>${esc(r.title)}</b> <span class="ut-mut">· ${esc([r.stage, plural(r.days, 'day', 'days')].filter(Boolean).join(' ') + (r.owner ? '' : ' · no owner'))}</span></span>`
41
+ + (kept[r.id] ? pill(kept[r.id]) : `<button type="button" class="ut-btn sm soft" data-rv-go="${esc(r.id)}">Keep going</button><button type="button" class="ut-btn sm ghost" data-rv-ask="${esc(r.id)}">Ask in chat</button>`) + '</div>').join('')
42
+ + iRows.slice(0, 6).map((r) => `<div class="ut-trow"><span><b>${esc(r.title)}</b> <span class="ut-mut">· ${esc(r.sub || 'your list')}</span></span>${st.done[r.key] ? '<span class="cz-pill ok">Done</span>' : `<button type="button" class="ut-btn sm ghost" data-rv-done="${esc(r.id)}" data-k="${esc(r.key)}">Done</button>`}</div>`).join('')
43
+ || '<p class="ut-small ut-mut">Nothing has sat untouched for 14 days.</p>';
44
+ }
45
+ const rows = tab('today').concat(tab('upcoming')).slice(0, 10);
46
+ return rows.map((r) => `<div class="ut-trow"><span><b>${esc(r.title)}</b>${r.sub ? ` <span class="ut-mut">· ${esc(r.sub)}</span>` : ''}</span><button type="button" class="cz-chip${st.picked.has(r.id) ? ' on' : ''}" data-rv-pick="${esc(r.id)}" aria-pressed="${st.picked.has(r.id)}"${!st.picked.has(r.id) && st.picked.size >= 3 ? ' disabled' : ''}>${st.picked.has(r.id) ? 'Picked' : 'Pick'}</button></div>`).join('')
47
+ + (rows.length ? `<p class="ut-small ut-mut">${st.picked.size} of 3 picked. Each one becomes P1 on your list.</p>` : '<p class="ut-small ut-mut">Your list has nothing for next week yet.</p>');
48
+ }
49
+ function noteOf(key) {
50
+ const vals = Object.values(st.done);
51
+ if (key === 'sort') { const k = vals.filter((x) => x === 'kept').length, t = vals.filter((x) => x === 'today').length; return t + k ? plural(t + k, 'sorted', 'sorted') + (k ? ' · ' + k + ' kept' : '') : 'Nothing to sort'; }
52
+ if (key === 'wait') { const d = vals.filter((x) => x === 'done').length; return d ? d + ' came in' : 'Checked'; }
53
+ if (key === 'untouched') { const R = reviewModel(h.D(), h.now()); return plural(Object.keys(R.kept || {}).length, 'looked at', 'looked at'); }
54
+ return st.picked.size ? st.picked.size + ' picked' : 'None picked';
55
+ }
56
+ const draw = (b) => {
57
+ const R = reviewModel(h.D(), h.now());
58
+ const steps = R.steps.map((s) => {
59
+ if (s.done) return `<div class="ut-step"><span class="ut-chk on">${svg(P.check, 12)}</span><b>${esc(s.label)}</b><span class="ut-small ut-mut">${esc(s.note)}</span></div>`;
60
+ if (s.now) return `<div class="ut-step now" role="group" aria-label="${esc(s.label)}, now"><div class="h"><span class="ut-chk"></span><b>${esc(s.label)}</b><span class="ut-small ut-bl"><b>Now</b></span></div>`
61
+ + `<div>${stepBody(s, R)}</div><div class="ut-acts"><button type="button" class="ut-btn sm pri" data-rv-step="${s.key}"${st.busy ? ' disabled' : ''}>Done with this step</button></div></div>`;
62
+ return `<div class="ut-step later"><span class="ut-chk"></span><b>${esc(s.label)}</b></div>`;
63
+ }).join('');
64
+ const last = R.last ? 'Last review: ' + dayLabel(R.last.week) + (R.last.minutes ? ' · ' + plural(R.last.minutes, 'minute', 'minutes') : '') : 'This is your first weekly review here.';
65
+ b.innerHTML = `<div class="ut-vc">${tabsHtml('review')}<div><h2 class="ut-h2">Weekly review · ${esc(R.label)}</h2><p class="ut-sub">${R.done ? 'Done for this week. Each step kept what you decided.' : 'Four short steps. Each one keeps what you decided.'}</p></div>`
66
+ + `<div class="cz-ladder" role="img" aria-label="${R.steps.filter((x) => x.done).length} of 4 steps done">${R.steps.map((s) => `<i class="${s.done ? 'done' : s.now ? 'now' : ''}"></i>`).join('')}</div>`
67
+ + `<div class="ut-steps">${steps}</div><p class="ut-small ut-mut" role="status" id="rvMsg">${esc(st.msg)}</p><p class="ut-small ut-mut ut-foot">${esc(last)}</p></div>`;
68
+ };
69
+ const body = h.VW.open({ id: 'review', kind: 'Weekly review', title: 'Weekly review', icon: 'list', render: draw });
70
+ const say = (m) => { st.msg = m; const el = body.querySelector('#rvMsg'); if (el) el.textContent = m; };
71
+ const post = async (path, b) => { const r = await h.pmPost(path, b).catch(() => null); if (!r || r.ok !== true) { say((r && r.error) || 'Nothing was changed.'); return null; } return r; };
72
+ const redraw = async () => { await h.reload(); if (body.isConnected) draw(body); };
73
+ body.onclick = async (e) => {
74
+ const b = e.target.closest('button'); if (!b || b.disabled) return;
75
+ const d = b.dataset;
76
+ if (d.rvToday) { if (await post('/api/pm-items/flag', { id: d.rvToday, flagged: true })) { st.done[d.k] = 'today'; draw(body); } return; }
77
+ if (d.rvKeep) { if (await post('/api/pm-items/keep', { id: d.rvKeep })) { st.done[d.k] = 'kept'; draw(body); } return; }
78
+ if (d.rvDone) { if (await post('/api/pm-items/done', { id: d.rvDone })) { st.done[d.k] = 'done'; draw(body); } return; }
79
+ if (d.rvPick) { if (st.picked.has(d.rvPick)) st.picked.delete(d.rvPick); else if (st.picked.size < 3) st.picked.add(d.rvPick); draw(body); return; }
80
+ if (d.rvGo) { if (await post('/api/home-review/keep', { ws: h.ws(), initiative: d.rvGo, how: 'kept' })) { h.toast('Kept going. It is not asked about again this week.'); redraw(); } return; }
81
+ if (d.rvAsk) {
82
+ const s = staleInis(h.D(), h.now()).find((x) => x.id === d.rvAsk); if (!s) return;
83
+ if (await post('/api/home-review/keep', { ws: h.ws(), initiative: s.id, how: 'asked' })) { h.askAbout(s, { hold: () => hold(s), keep: () => post('/api/home-review/keep', { ws: h.ws(), initiative: s.id, how: 'kept' }).then(redraw) }); redraw(); }
84
+ return;
85
+ }
86
+ if (d.rvStep) {
87
+ st.busy = true; draw(body);
88
+ if (d.rvStep === 'pick') for (const id of st.picked) await post('/api/pm-items/edit', { id, fields: { priority: 'P1' } });
89
+ const r = await post('/api/home-review/step', { ws: h.ws(), week: reviewModel(h.D(), h.now()).week || undefined, step: d.rvStep, note: noteOf(d.rvStep) });
90
+ st.busy = false; st.done = {};
91
+ if (r) { st.msg = ''; await redraw(); if (reviewModel(h.D(), h.now()).done) h.toast('The weekly review is done for this week.'); } else draw(body);
92
+ }
93
+ };
94
+ async function hold(s) {
95
+ const r = await post('/api/lifecycle', { ws: h.ws(), initiative_id: s.id, state: 'on-hold', reason: 'Weekly review: no change for ' + s.days + ' days' });
96
+ if (!r) return false;
97
+ await post('/api/home-review/keep', { ws: h.ws(), initiative: s.id, how: 'held' });
98
+ h.toast('On hold. The reason is on the record.');
99
+ await redraw();
100
+ return true;
101
+ }
102
+ return body;
103
+ }
@@ -0,0 +1,67 @@
1
+ /* pm/home-task.js — one task in the Viewer (initiative premium-uncovered-features, H1; canvas HmMyWork, the Viewer).
2
+ *
3
+ * A PMOS task of an initiative (GET /api/boards/items, src "pmos") opens here from the list: its check, its title and where it sits
4
+ * ("Session list v2 · task · due today"), its due chip, its status, what the PM needs for it (the initiative, its core documents and its
5
+ * Jira item), and the two presses of the canvas: talk it through in the chat, and Done. Every write is the board's own route
6
+ * (POST /api/boards/tasks/state) and is the PM's press; a refusal shows the route's reason and changes nothing.
7
+ * The PM's own items (a note, a mention made into a task) open in My work's item view (home-work.js), drawn in the same shape. */
8
+ import { esc, svg, P } from './home-today.js';
9
+
10
+ const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
11
+ const STATES = ['To do', 'In progress', 'In review', 'Done'];
12
+ const dayDiff = (iso, now) => { const m = /^(\d{4})-(\d{2})-(\d{2})/.exec(String(iso || '')); if (!m) return null; const a = new Date(+m[1], +m[2] - 1, +m[3]); const t = new Date(now); t.setHours(0, 0, 0, 0); return Math.round((a - t) / 86400000); };
13
+ /** The due chip's words: "Due today", "Due tomorrow", "2 days late", "Due 30 Oct", or "No date". Pure. */
14
+ export function dueText(iso, now = Date.now()) {
15
+ const d = dayDiff(iso, now);
16
+ if (d == null) return 'No date';
17
+ if (d === 0) return 'Due today';
18
+ if (d === 1) return 'Due tomorrow';
19
+ if (d < 0) return -d + (d === -1 ? ' day late' : ' days late');
20
+ const m = /^(\d{4})-(\d{2})-(\d{2})/.exec(iso); return 'Due ' + +m[3] + ' ' + MON[+m[2] - 1];
21
+ }
22
+
23
+ /** h: { VW, pmPost, toast, now, ws, board, iniTitle(id), docs(id) → [{ title, path }], openIni(id), openDoc(doc), askInChat(task), openRecord(task), onChange() } */
24
+ export function openTask(task, h) {
25
+ const st = { msg: '', busy: false };
26
+ const t = task;
27
+ const draw = (b) => {
28
+ const now = h.now ? h.now() : Date.now();
29
+ const done = t.status === 'Done';
30
+ const due = dueText(t.end, now);
31
+ const where = [h.iniTitle(t.ini), 'task', due === 'No date' ? '' : due.replace(/^Due /, '').toLowerCase(), t.owner && !/^(pm|you)(:|$)/i.test(t.owner) ? 'with ' + t.owner : ''].filter(Boolean).join(' · ');
32
+ const docs = (h.docs ? h.docs(t.ini) : []) || [];
33
+ const need = [`<div class="ut-trow">${svg(P.flag, 16)}<span>${esc(h.iniTitle(t.ini))} <span class="ut-mut">· the initiative</span></span><button type="button" class="ut-btn sm soft" data-tk="ini">Open</button></div>`]
34
+ .concat(docs.slice(0, 4).map((d, i) => `<div class="ut-trow">${svg(P.doc, 16)}<span>${esc(d.title)}</span><button type="button" class="ut-btn sm soft" data-tk-doc="${i}">Open</button></div>`))
35
+ .concat(t.ref && t.src !== 'pmos' ? [`<div class="ut-trow">${svg(P.ticket, 16)}<span>${esc(t.ref)}</span></div>`] : []);
36
+ b.innerHTML = `<div class="ut-vc">`
37
+ + `<div class="ut-vh"><button type="button" class="hm-ck" data-tk="done" aria-label="${done ? 'Done' : 'Mark ' + esc(t.title) + ' done'}"${done ? ' disabled' : ''}><span class="ut-chk${done ? ' on' : ''}">${done ? svg(P.check, 12) : ''}</span></button>`
38
+ + `<div><h2 class="ut-h2">${esc(t.title)}</h2><p class="ut-sub">${esc(where)}</p></div>`
39
+ + `<button type="button" class="ut-ib" data-tk="record" aria-label="Open the task's record" title="The task's record">${svg(P.dots, 16, 'dots')}</button></div>`
40
+ + `<div class="ut-chips"><span class="cz-chip${/late/.test(due) ? ' on' : ''}">${esc(due)}</span>${STATES.filter((x) => x !== 'Done').map((x) => `<button type="button" class="cz-chip${t.status === x ? ' on' : ' gh'}" data-tk-state="${esc(x)}" aria-pressed="${t.status === x}">${esc(x)}</button>`).join('')}</div>`
41
+ + `<p class="ut-lbl">What you need for it</p><div>${need.join('')}</div>`
42
+ + `<div class="ut-foot"><button type="button" class="ut-btn pri" data-tk="chat">Talk it through in chat</button><button type="button" class="ut-btn" data-tk="done"${done ? ' disabled' : ''}>Done</button></div>`
43
+ + `<p class="ut-small ut-mut" role="status" id="tkMsg">${esc(st.msg)}</p></div>`;
44
+ };
45
+ const body = h.VW.open({ id: 'task:' + t.uid, kind: 'Task', title: t.title, icon: 'M5 12l5 5 9-10', render: draw });
46
+ const setState = async (state) => {
47
+ if (st.busy) return; st.busy = true;
48
+ const r = await h.pmPost('/api/boards/tasks/state', { ws: h.ws, board: t.board || h.board, task: t.uid, state }).catch(() => null);
49
+ st.busy = false;
50
+ if (!r || r.ok !== true) { st.msg = (r && r.error) || 'The status did not change.'; draw(body); return; }
51
+ t.status = state; st.msg = '';
52
+ h.toast(state === 'Done' ? 'Done. It leaves your list.' : 'Now ' + state.toLowerCase() + '.');
53
+ if (state === 'Done') h.VW.close(); else draw(body);
54
+ if (h.onChange) h.onChange();
55
+ };
56
+ body.onclick = (e) => {
57
+ const b = e.target.closest('button'); if (!b || b.disabled) return;
58
+ const k = b.dataset.tk;
59
+ if (b.dataset.tkState) { if (b.dataset.tkState !== t.status) setState(b.dataset.tkState); return; }
60
+ if (b.dataset.tkDoc != null && b.dataset.tkDoc !== '') { const d = (h.docs ? h.docs(t.ini) : [])[+b.dataset.tkDoc]; if (d && h.openDoc) h.openDoc(d); return; }
61
+ if (k === 'done') setState('Done');
62
+ else if (k === 'ini') h.openIni(t.ini);
63
+ else if (k === 'chat') h.askInChat(t);
64
+ else if (k === 'record' && h.openRecord) h.openRecord(t);
65
+ };
66
+ return body;
67
+ }
@@ -0,0 +1,148 @@
1
+ /* pm/home-today.js — draws Home's one list (initiative premium-uncovered-features, H1 and H2; canvas HmMyWork, HmReview, HmProducts,
2
+ * HmDay, HmMic, HmPhone, HmPhone2).
3
+ *
4
+ * The list column, top to bottom: the head (Today, the products picker when Home reads more than one product, New), the Today card through
5
+ * the day, the filters (Today, Waiting, Kept, Done), one group per product ("PMOS · 2 of 4 goals on track") with its own next steps and its
6
+ * initiatives (the ones where it is your turn first, each with its tasks, next steps, sessions and meetings nested under it), "Not in an
7
+ * initiative", the capture box ("Add a task. PMOS files it under its initiative") and "Untouched 14+ days". Another product's group can be
8
+ * closed: "Partner portal · 2 initiatives · 1 your turn".
9
+ * The model is home-list.js (pure). This file only turns it into HTML: every control is a <button> (or the capture form) with a data-hm-*
10
+ * press that home-app.js handles. Text from the records goes through esc(). */
11
+
12
+ export const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
13
+ export const P = {
14
+ chevR: 'M10 7l5 5-5 5', chevD: 'M7 10l5 5 5-5', plus: 'M12 5v14M5 12h14', x: 'M6 6l12 12M18 6L6 18', check: 'M5 12l5 5 9-10',
15
+ mic: 'M12 3a3 3 0 0 0-3 3v6a3 3 0 0 0 6 0V6a3 3 0 0 0-3-3M5 11a7 7 0 0 0 14 0M12 18v3', clock: 'M12 4a8 8 0 1 0 0 16a8 8 0 1 0 0-16M12 8v4l3 2',
16
+ pause: 'M8 5v14M16 5v14', stop: 'M7 7h10v10H7z', list: 'M9 6h11M9 12h11M9 18h11', doc: 'M7 3h7l5 5v13H7zM14 3v5h5',
17
+ gate: 'M12 3l7 3v6c0 4-3 7-7 9-4-2-7-5-7-9V6z', flag: 'M5 21V4h11l-2 4 2 4H5', cal: 'M4 6h16v14H4zM4 10h16', pin: 'M9 4h6l-1 6 3 3H7l3-3zM12 13v7',
18
+ decide: 'M12 3v18M5 8l7-5 7 5', ret: 'M9 14L4 9l5-5M4 9h10a6 6 0 0 1 0 12h-3', back: 'M19 12H5M11 6l-6 6 6 6', warn: 'M12 4l9 16H3zM12 10v4M12 17v.5',
19
+ chat: 'M4 5h16v11H9l-5 4z', dots: 'M5 12h.01M12 12h.01M19 12h.01', send: 'M5 12h14M13 6l6 6-6 6', ticket: 'M3 5h18v4H3zM3 11h18v4H3z',
20
+ };
21
+ export const svg = (d, w = 16, cls = '') => `<svg aria-hidden="true"${cls ? ` class="${cls}"` : ''} width="${w}" height="${w}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="${d}"/></svg>`;
22
+ const ROW_ICON = { decision: P.decide, blocked: P.warn, waited: P.clock, src: P.doc, source: P.doc, ev: P.gate, run: P.ret, update: P.doc, meeting: P.cal };
23
+ const dotOf = (st) => ({ needs: 'you', blocked: 'late', working: 'ok', wait: 'none' }[st] || 'none');
24
+ const iconOfNeed = (r) => (r.kind === 'update' ? P.doc : r.row && r.row.dialog && r.row.dialog.write && r.row.dialog.write.kind === 'return' ? P.ret : ROW_ICON[(r.row && r.row.kind) || ''] || P.gate);
25
+
26
+ /* ── one row ── */
27
+ function tileHtml(r, o) {
28
+ if (r.kind === 'session') return o.avHtml(r.role || { initial: r.initial || 'C' }, 32, 'hm-tile');
29
+ if (r.kind === 'meeting') return `<span class="hm-tile">${svg(P.cal, 16)}</span>`;
30
+ return `<span class="hm-tile">${svg(r.kind === 'need' || r.kind === 'update' ? iconOfNeed(r) : P.chat, 16)}</span>`;
31
+ }
32
+ /** A row of the list: a next step, a task, a note, a mention, a session or a meeting. o: { sel, kid, flat, avHtml, pinned } */
33
+ export function rowHtml(r, o) {
34
+ const sel = o.sel === r.id;
35
+ const cls = ['hm-r', 'lr', o.kid ? 'kid' : '', sel ? 'sel' : '', 'st-' + (r.state || 'quiet'), r.kind === 'task' ? 'task' : '', r.kind === 'item' ? 'item' : '', r.done ? 'done' : ''].filter(Boolean).join(' ');
36
+ const hint = r.hint || '';
37
+ const quiet = r.kind === 'task' || r.kind === 'item' || r.kind === 'meeting' || r.kind === 'finished' || r.state === 'quiet' || r.state === 'wait';
38
+ let lead = '';
39
+ if (r.check || (r.kind === 'task' && r.mine)) lead = `<button type="button" class="hm-ck" data-hm-check="${esc(r.id)}" aria-label="Mark ${esc(r.name)} done" title="Done"><span class="ut-chk${r.done ? ' on' : ''}">${r.done ? svg(P.check, 12) : ''}</span></button>`;
40
+ else if (r.kind === 'task') lead = '<span class="hm-ck wait" aria-hidden="true"><i></i></span>';
41
+ else if (r.done) lead = `<span class="hm-ck wait" aria-hidden="true"><span class="ut-chk on">${svg(P.check, 12)}</span></span>`;
42
+ const dot = lead ? '' : `<i class="hm-dot ${dotOf(r.state)}" aria-hidden="true"></i>`;
43
+ const tile = lead || o.kid ? '' : tileHtml(r, o);
44
+ const end = r.kind === 'session' && r.sid ? `<button type="button" class="hm-x" data-hm-end="${esc(r.id)}" aria-label="End ${esc(r.name)}" title="End this session">${svg(P.x, 14)}</button>`
45
+ : r.kind === 'need' && r.row && r.row.kind !== 'source' ? `<button type="button" class="hm-x" data-hm-end="${esc(r.id)}" aria-label="Put off ${esc(r.name)} until tomorrow" title="Put off until tomorrow">${svg(P.x, 14)}</button>` : '';
46
+ const right = r.link && r.kind === 'loose-rec' ? '<span class="hm-rr">Link it</span>' : '';
47
+ return `<div class="${cls}" data-id="${esc(r.id)}">${lead}<button type="button" class="hm-rm" data-hm-sel="${esc(r.id)}"${sel ? ' aria-current="true"' : ''}>${dot}${tile}`
48
+ + `<span class="hm-rt"><b>${esc(r.name)}</b>${hint ? `<em${quiet ? ' class="q"' : ''}>${esc(hint)}</em>` : ''}</span>${right}</button>${end}</div>`;
49
+ }
50
+ /** An initiative row: the chevron opens what sits under it, the title opens the initiative. */
51
+ function iniHtml(r, o) {
52
+ const open = o.isOpen(r.id);
53
+ const all = o.tasksOpen ? o.tasksOpen(r.id) : false, hid = r.kids.filter((k) => k.extra).length;
54
+ const kids = all ? r.kids : r.kids.filter((k) => !k.extra);
55
+ const more = hid ? `<button type="button" class="hm-more2" data-hm-tasks="${esc(r.id)}" aria-expanded="${all}">${all ? 'Show fewer tasks' : `Show ${hid} more ${hid === 1 ? 'task' : 'tasks'}`}</button>` : '';
56
+ const nest = open ? `<div class="hm-nest" role="group" aria-label="In ${esc(r.name)}">${kids.map((k) => rowHtml(k, { ...o, kid: true })).join('') || '<p class="hm-none">Nothing today.</p>'}${more}</div>` : '';
57
+ return `<div class="hm-r lr ini st-${esc(r.state)}${o.sel === r.id ? ' sel' : ''}" data-id="${esc(r.id)}"><button type="button" class="hm-tg" data-hm-kids="${esc(r.id)}" aria-expanded="${open}" aria-label="${open ? 'Hide' : 'Show'} what is in ${esc(r.name)}">${svg(open ? P.chevD : P.chevR, 14)}</button>`
58
+ + `<button type="button" class="hm-rm" data-hm-sel="${esc(r.id)}"><span class="hm-rt"><b>${esc(r.name)}</b><em class="q">${esc(r.hint)}</em></span><span class="hm-rr${r.turn ? '' : ' q'}">${esc(r.right)}</span></button></div>${nest}`;
59
+ }
60
+
61
+ /* ── a group ── */
62
+ function productHtml(g, o) {
63
+ const open = o.pOpen(g);
64
+ const head = open
65
+ ? `<div class="hm-ghr2"><button type="button" class="hm-ghd" data-hm-pg="${esc(g.key)}" aria-expanded="true" aria-label="${esc(g.name)}: ${esc(g.goals ? g.goals.text : g.closedLine)}. Close the group">${esc(g.name)}</button>`
66
+ + (g.goals ? (g.primary ? `<button type="button" class="hm-gn" data-hm-prod aria-label="${esc(g.goals.text)}. Open the product">${esc(g.goals.text)}</button>` : `<span class="hm-gn">${esc(g.goals.text)}</span>`) : `<span class="hm-gn">${esc(g.closedLine)}</span>`) + '</div>'
67
+ : `<button type="button" class="hm-ghd" data-hm-pg="${esc(g.key)}" aria-expanded="false">${svg(P.chevR, 14)}${esc(g.name)}<span class="n">${esc(g.closedLine)}</span></button>`;
68
+ if (!open) return `<section class="hm-pg" aria-label="${esc(g.name)}">${head}</section>`;
69
+ const pinned = (x) => (o.pin.has(x.key) ? 0 : 1);
70
+ const flat = g.flat.slice().sort((a, b) => pinned(a) - pinned(b)).map((r) => rowHtml(r, o)).join('');
71
+ const QUIET = 3;
72
+ const restAll = o.restOpen(g.key);
73
+ const rest = restAll ? g.rest : g.rest.slice(0, Math.max(0, QUIET - g.inis.length));
74
+ const more = g.rest.length - rest.length;
75
+ const body = flat + g.inis.concat(rest).map((r) => iniHtml(r, o)).join('')
76
+ + (more > 0 ? `<button type="button" class="hm-more2" data-hm-rest="${esc(g.key)}">${more} more ${more === 1 ? 'initiative' : 'initiatives'} with nothing today · Show</button>`
77
+ : restAll && g.rest.length > QUIET ? `<button type="button" class="hm-more2" data-hm-rest="${esc(g.key)}">Show fewer</button>` : '');
78
+ return `<section class="hm-pg" aria-label="${esc(g.name)}">${head}${body || `<p class="hm-none">${g.primary ? 'No initiative is open on this board.' : 'Nothing is open here.'}</p>`}</section>`;
79
+ }
80
+ function looseHtml(g, o) {
81
+ if (!g.rows.length) return '';
82
+ return `<section class="hm-pg" aria-label="${esc(g.name)}"><div class="hm-ghd">${esc(g.name)}<span class="n">${g.n}</span></div>${g.rows.map((r) => rowHtml(r, o)).join('')}</section>`;
83
+ }
84
+
85
+ /* ── the Today card ── */
86
+ /** The card's HTML. T is todayCard(); greet the greeting; sub the line under it when the day has no meeting. */
87
+ export function todayHtml(T, o) {
88
+ if (T.mode === 'rec') {
89
+ return `<div class="hm-tc rec" role="group" aria-label="Recording"><span class="ut-rec" aria-hidden="true"></span><div><b>${T.paused ? 'Paused' : 'Recording'}${T.clock ? ' · ' + esc(T.clock) : ''}</b><p>${esc(T.sub)}</p></div>`
90
+ + `<button type="button" class="ut-ib" data-hm-tc="${T.paused ? 'resume' : 'pause'}" aria-label="${T.paused ? 'Go on recording' : 'Pause the recording'}" title="${T.paused ? 'Go on' : 'Pause'}">${svg(T.paused ? P.mic : P.pause, 16)}</button>`
91
+ + `<button type="button" class="ut-ib solid" data-hm-tc="stop" aria-label="Stop the recording" title="Stop">${svg(P.stop, 14, 'fill')}</button></div>`;
92
+ }
93
+ if (T.mode === 'soon') {
94
+ return `<div class="hm-tc soon" role="group" aria-label="${esc(T.time + ' ' + T.title + ', ' + T.in)}"><p class="hm-tch">${svg(P.clock, 18)}<b>${esc(T.time)} ${esc(T.title)}</b><span class="r">${esc(T.in)}</span></p>`
95
+ + (T.sub ? `<p class="sub ut-small">${esc(T.sub)}</p>` : '')
96
+ + `<p class="ut-acts"><button type="button" class="ut-btn sm pri" data-hm-tc="prep">Open prep</button>${T.link ? `<a class="ut-btn sm soft" href="${esc(T.link)}" target="_blank" rel="noopener noreferrer">Join</a>` : ''}</p></div>`;
97
+ }
98
+ if (T.mode === 'live') {
99
+ return `<div class="hm-tc live" role="group" aria-label="${esc(T.title)}, on now"><p class="hm-tch">${T.rec ? '<span class="ut-rec" aria-hidden="true"></span>' : svg(P.clock, 18)}<b>${esc(T.title)} · live</b><span class="r q">${esc(T.mins)}</span></p>`
100
+ + `<p class="sub ut-small">${esc(T.sub)}</p><p class="ut-acts"><button type="button" class="ut-btn sm soft" data-hm-tc="open">Open</button>${T.rec ? '<button type="button" class="ut-btn sm ghost" data-hm-tc="hl">Highlight</button>' : '<button type="button" class="ut-btn sm ghost" data-hm-tc="record">Record</button>'}</p></div>`;
101
+ }
102
+ if (T.mode === 'eod') {
103
+ return `<div class="hm-tc eod" role="group" aria-label="End of day"><p class="hm-tch"><b>End of day</b><span class="r q">${esc(T.time)}</span><button type="button" class="ut-ib" data-hm-tc="hide" aria-label="Hide until tomorrow" title="Hide until tomorrow">${svg(P.x, 14)}</button></p>`
104
+ + `<div class="ut-need"><span class="ut-small"><b>${esc(T.blockLine)}</b>${T.why ? ' ' + esc(T.why) : ''}</span><span class="ut-acts"><button type="button" class="ut-btn sm pri" data-hm-tc="now">Do it now</button>${T.later ? '<button type="button" class="ut-btn sm" data-hm-tc="tomorrow">Tomorrow 09:00</button>' : ''}</span></div>`
105
+ + (T.lines.length ? `<div class="hm-eodl">${T.lines.map(([k, v]) => `<span><b>${esc(k)}</b><span>${esc(v)}</span></span>`).join('')}</div>` : '') + '</div>';
106
+ }
107
+ if (T.mode === 'clear') return `<div class="hm-tc clear" role="status">${esc(T.line)}</div>`;
108
+ if (T.mode === 'review') {
109
+ return `<button type="button" class="hm-tc" data-hm-review aria-label="${esc(T.big)} ${esc(T.sub)}. Open the review"><b class="big">${esc(T.big)}</b><span class="sub">${esc(T.sub)}</span></button>`;
110
+ }
111
+ const L = T.load || { segs: [] };
112
+ const sub = L.n ? L.sub : o.sub;
113
+ const bar = L.segs.length ? `<span class="hm-load" aria-hidden="true">${L.segs.map((s) => `<i class="${s.m ? 'm' : ''}${s.now ? ' n' : ''}" data-f="${Math.max(1, s.flex)}"></i>`).join('')}</span><span class="hm-lx" aria-hidden="true"><span>09</span><span>12</span><span>15</span><span>18</span></span>` : '';
114
+ return `<button type="button" class="hm-tc day" data-hm-tc="cal" aria-label="${esc(o.greet)} ${esc(sub)}. Open the calendar"><b class="big">${esc(o.greet)}</b><span class="sub">${esc(sub)}</span>${bar}</button>`;
115
+ }
116
+
117
+ /* ── the whole column ── */
118
+ /** M is homeList(); T todayCard(); o: { sel, isOpen, pOpen, restOpen, pin, avHtml, ready, err, product (the picked key), review, sub, phone } */
119
+ export function listHtml(M, T, o) {
120
+ const many = M.products.length > 1;
121
+ const picked = o.product ? M.products.find((p) => p.key === o.product) : null;
122
+ const head = `<div class="hm-hd"><h1>Today</h1>`
123
+ + (many ? `<button type="button" class="cz-pick hm-pk" data-hm-pick aria-haspopup="menu" aria-expanded="false">${esc(picked ? picked.name : 'All products')} ${svg(P.chevD, 14)}</button><button type="button" class="ut-ib" data-hm-new aria-haspopup="menu" aria-label="New" title="New">${svg(P.plus, 16)}</button>`
124
+ : `<button type="button" class="hm-new" data-hm-new aria-haspopup="menu">${svg(P.plus, 14)}New</button>`) + '</div>';
125
+ const card = todayHtml(T, { greet: M.greet, sub: o.sub });
126
+ // Focus (once on the My work page): the agent's suggested focus for today, or what the PM accepted; it opens Focus and jobs
127
+ const fc = M.focus && (M.focus.suggested || M.focus.accepted) ? `<button type="button" class="cz-chip gh hm-fc" data-hm-focus aria-label="Focus and jobs: ${esc(M.focus.title)}" title="${esc(M.focus.title)}">Focus <em>${M.focus.suggested ? M.focus.suggested + ' suggested' : M.focus.accepted + ' in focus'}</em></button>` : '';
128
+ const flt = `<div class="hm-flt" role="group" aria-label="Show">${M.filters.map((f, i) => `<button type="button" class="cz-chip${f.key === M.filter ? ' on' : ' gh'}${i > 1 ? ' dk' : ''}" data-hm-filter="${f.key}" aria-pressed="${f.key === M.filter}">${esc(f.label)}${f.n ? ' ' + f.n : ''}</button>`).join('')}${fc}</div>`;
129
+ if (!o.ready) return head + card + '<p class="hm-none" role="status">Reading your work.</p>';
130
+ const errLine = `<p class="hm-none" role="status">Home could not read the repository: ${esc(o.err)}.</p>`;
131
+ if (o.err && !M.groups.some((g) => (g.kind === 'product' && g.count) || (g.rows && g.rows.length))) return head + card + errLine;
132
+ // the repository's read failed but sessions or notes still answered: say so above what did come back, never an empty product as if calm
133
+ let body = o.err && !M.groups.some((g) => g.kind === 'product' && (g.count || g.flat.length)) ? errLine : '';
134
+ if (M.list) {
135
+ body = `<section class="hm-pg" aria-label="${esc(M.list.title)}"><div class="hm-ghd">${esc(M.list.title)}<span class="n">${M.list.rows.length || ''}</span></div>`
136
+ + (M.list.rows.map((r) => rowHtml(r, o)).join('') || `<p class="hm-none">${esc(M.list.empty)}</p>`) + '</section>';
137
+ } else {
138
+ const R = o.review;
139
+ if (R && R.open) body += `<section class="hm-pg" aria-label="This week"><div class="hm-ghd">This week<span class="n">Fri</span></div><div class="hm-r lr${o.sel === 'review' ? ' sel' : ''}" data-id="review"><button type="button" class="hm-rm" data-hm-review><span class="hm-tile wk">${svg(P.check, 16)}</span><span class="hm-rt"><b>Weekly review</b><em>${R.started ? 'Step ' + (R.at + 1) + ' of 4' : 'Four short steps'}</em></span></button></div></section>`;
140
+ body += M.groups.map((g) => (g.kind === 'product' ? productHtml(g, o) : looseHtml(g, o))).join('');
141
+ if (!M.groups.some((g) => (g.kind === 'product' && (g.count || g.flat.length)) || (g.rows && g.rows.length))) body += '<p class="hm-none">Nothing is open. A new initiative or a task you add shows here.</p>';
142
+ // the capture box shows only after New → A task → Not in an initiative (o.cap); an initiative's task is added in its Tasks view
143
+ if (o.cap) body += `<form class="hm-cap" id="hmCapF"><label class="vh" for="hmCap">Add a task to your own list</label><input id="hmCap" autocomplete="off" maxlength="250" placeholder="A task for your own list. Esc to cancel">`
144
+ + (o.mic ? `<button type="button" class="ut-ib" data-hm-capmic aria-label="Say it instead" title="Say it instead">${svg(P.mic, 16)}</button>` : '') + '</form>';
145
+ if (M.untouched.n) body += `<button type="button" class="hm-un" data-hm-review><b>Untouched 14+ days · ${M.untouched.n}</b><span>Weekly review ${esc(M.untouched.day)}</span></button>`;
146
+ }
147
+ return head + card + flt + body;
148
+ }
@@ -1,24 +1,30 @@
1
- /* pm/home-work.js — My work in the Home Viewer (initiative premium-agreed-design; the depth of initiative premium-work-depth).
2
- * The Agreed design does not draw My work yet, so this is a plain minimal card marked "Waiting for design". It reads GET /api/my-work-premium
3
- * (lib/my-work-premium.js builds the model) and keeps every feature of the old My work page usable:
4
- * four tabs: Your list (the Work queue but Kept and Done, with the Focus chip and one add box), Waiting on others, Weekly review, Untouched
5
- * a row opens the item in the same card, with Back: Done, Edit ▾ (When, Waiting on, Who does it, Priority · Due), Keep it, Drop it, the agent
6
- * on the item (draft, stop, try again, edit, post after a confirm, send back), and the draft or the source under it
1
+ /* pm/home-work.js — My work in the Home Viewer. Since the testing fixes it opens only alone (solo): an item's card from a row of Home's list
2
+ * (openWorkItem) and Focus and jobs from the Focus chip (openFocus); Home's list is the list, so the tabbed page is not reachable from Home. (initiative premium-uncovered-features, H1; canvas HmMyWork; the depth of premium-work-depth).
3
+ * There is no separate list on Home: a task sits under its initiative, and the PM's own notes sit under "Not in an initiative". This card is
4
+ * the depth behind those rows. It reads GET /api/my-work-premium (lib/my-work-premium.js builds the model) and keeps every feature of the
5
+ * old My work page usable:
6
+ * "My work" beside "Weekly review" (the review is home-review.js, opened through the hm:review event Home answers)
7
+ * the filters: Open (the Work queue but Kept and Done, with the Focus chip and one add box), Waiting, Untouched, Kept, Done
8
+ * an item opens as the canvas's task card: its check, its title and where it sits, its chips (the due day, Edit with the fields,
9
+ * Keep for later), where it came from, the agent on the item (draft, stop, try again, edit, post after a confirm, send back), Done
7
10
  * the Focus chip opens Focus and jobs in the same card: accept or dismiss a suggestion, clear one, add a job
8
- * keys and swipe on the rows of Your list: J and K move, the arrows (or a drag past 90 px) do what the row names; most presses offer Undo
11
+ * keys and swipe on the open rows: J and K move, the arrows (or a drag past 90 px) do what the row names; most presses offer Undo
9
12
  * Every press is the PM's and goes to the Work page's own route under /api/pm-items, /api/pm-jobs or /api/my-work (pmPost carries the launch
10
13
  * nonce); this file adds no writer. A refused press shows the route's reason and changes nothing. Text from the list goes through esc(). */
11
14
  import { pmGet, pmPost } from './http.js';
12
- import { open as vwOpen } from './cozy-viewer.js';
15
+ import { open as vwOpen, close as vwClose } from './cozy-viewer.js';
13
16
  import { mdRender } from './markdown.js';
17
+ import { tabsHtml } from './home-review.js';
14
18
 
15
19
  const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
16
- const WAIT = '<p class="hx-wait"><i aria-hidden="true"></i>Waiting for design</p>';
20
+ const BACK = SVB('<path d="M19 12H5M11 6l-6 6 6 6"/>');
17
21
  const wsQ = () => { const w = new URLSearchParams(location.search).get('ws'); return w ? '?ws=' + encodeURIComponent(w) : ''; };
18
22
  const WS = () => new URLSearchParams(location.search).get('ws') || '';
19
23
  const RM = () => typeof matchMedia === 'function' && matchMedia('(prefers-reduced-motion: reduce)').matches;
20
24
  const SV = (p) => `<svg class="i" viewBox="0 0 24 24" aria-hidden="true">${p}</svg>`;
21
25
  const CHECK = SV('<path d="M5 12l5 5 9-10"/>');
26
+ function SVB(p) { return `<svg viewBox="0 0 24 24" aria-hidden="true">${p}</svg>`; }
27
+ const DOTS = '<svg class="dots" viewBox="0 0 24 24" aria-hidden="true"><path d="M5 12h.01M12 12h.01M19 12h.01"/></svg>';
22
28
  const ICON = { sun: '<circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M2 12h2M20 12h2"/>', moon: '<path d="M20 14.5A8 8 0 0 1 9.5 4 8 8 0 1 0 20 14.5z"/>', eye: '<path d="M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12z"/><circle cx="12" cy="12" r="3"/>' };
23
29
  const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
24
30
  const dayLabel = (iso) => { const m = /^(\d{4})-(\d{2})-(\d{2})$/.exec(iso || ''); return m ? +m[3] + ' ' + MON[+m[2] - 1] : ''; };
@@ -36,7 +42,7 @@ function toastUndo(msg, undo, after) {
36
42
  clearTimeout(toast.t); toast.t = setTimeout(() => t.classList.remove('on', 'act'), 8000);
37
43
  }
38
44
 
39
- const TABS = [['yours', 'Your list'], ['waiting', 'Waiting on others'], ['review', 'Weekly review'], ['stale', 'Untouched']];
45
+ const TABS = [['yours', 'Open'], ['waiting', 'Waiting'], ['stale', 'Untouched'], ['kept', 'Kept'], ['done', 'Done']];
40
46
  const AG_CHIP = { ready: 'Draft ready', queued: 'Agent working', working: 'Agent working', sending: 'Agent working', failed: 'Agent stopped' };
41
47
  const NOTYET = [['later-today', 'Later today'], ['tomorrow', 'Tomorrow'], ['next-week', 'Next week']];
42
48
  const WHO = [['you', 'You'], ['agent-drafts', 'Agent drafts'], ['agent-does', 'Agent does']];
@@ -47,8 +53,10 @@ const SAID = { done: 'Marked done.', notyet: 'Put off. It comes back by itself.'
47
53
  const freshUi = () => ({ xp: null, ed: null, dd: '', sn: '', ask: null, body: null, editing: false, confirm: false, back: false, note: '', wo: '', pick: null, round: null, dpick: null, sheet: false, all: false, job: '' });
48
54
 
49
55
  /** Open My work in the Viewer on one tab (yours | waiting | review | stale). */
50
- export function openMyWork(tab = 'yours') {
51
- const W = { r: null, M: null, tab: TABS.some((t) => t[0] === tab) ? tab : 'yours', msg: '', view: null, key: null, ui: freshUi(), refocus: null };
56
+ export function openMyWork(tab = 'yours', o = {}) {
57
+ if (tab === 'review' && askReview()) return null;
58
+ const W = { solo: !!o.solo, home: o.view || null, r: null, M: null, tab: TABS.some((t) => t[0] === tab) || tab === 'review' ? tab : 'yours', msg: '', view: null, key: null, ui: freshUi(), refocus: null, want: o.item || null };
59
+ if (W.home) W.view = W.home;
52
60
  let body = null;
53
61
  const rowOf = (key) => ((W.M && W.M.rows) || []).find((r) => r.key === key) || null;
54
62
  const openR = () => (W.view === 'item' ? rowOf(W.key) : null);
@@ -83,8 +91,12 @@ export function openMyWork(tab = 'yours') {
83
91
  if (W.tab === 'yours') {
84
92
  const tabs = m.queue.tabs.filter((t) => t.key !== 'kept' && t.key !== 'done'); // Kept and Done are not on your list
85
93
  const groups = tabs.filter((t) => t.n).map((t) => `<h4 class="mw-g">${esc(t.label)}</h4>` + t.groups.flatMap((g) => g.rows || []).map((r) => rowHtml(r)).join('')).join('');
86
- return `<div class="mw-list"><div class="mw-head">${focusChip()}</div>${groups || '<p class="hx-n">Nothing on your list.</p>'}`
87
- + '<div class="hx-add"><input id="hxLine" placeholder="Add to your list, e.g. Call Ana tomorrow" aria-label="Add to your list"><button type="button" class="hx-b pri" data-x="add">Add</button></div></div>';
94
+ return `<div class="mw-list"><div class="mw-head">${focusChip()}</div>${groups || '<p class="hx-n">Nothing is open. Add a task below.</p>'}`
95
+ + '<div class="hx-add"><input id="hxLine" placeholder="Add a task, e.g. Call Ana tomorrow" aria-label="Add a task"><button type="button" class="hx-b pri" data-x="add">Add</button></div></div>';
96
+ }
97
+ if (W.tab === 'kept' || W.tab === 'done') {
98
+ const t = m.queue.tabs.find((x) => x.key === W.tab), rows = t ? t.groups.flatMap((g) => g.rows || []) : [];
99
+ return `<div class="mw-wait">${rows.length ? rows.map((r) => rowHtml(r, true)).join('') : `<p class="hx-n">${W.tab === 'kept' ? 'Nothing is kept for later.' : 'Nothing is done yet.'}</p>`}</div>`;
88
100
  }
89
101
  if (W.tab === 'waiting') return `<div class="mw-wait">${m.waiting.rows.length ? m.waiting.rows.map((r) => rowHtml(r, true)).join('') : '<p class="hx-n">Nobody owes you anything.</p>'}</div>`;
90
102
  if (W.tab === 'review') {
@@ -205,9 +217,9 @@ export function openMyWork(tab = 'yours') {
205
217
  + (a.includes('waiting') || e.waiting_on ? fld('wait', 'Waiting on', e.waiting_on || 'Nobody', '') : '')
206
218
  + fld('steps', 'Who does it', whos.length ? whos.join(', ') : 'You', steps)
207
219
  + fld('edit', 'Priority · Due', e.priority || 'None', e.due ? 'due ' + dayLabel(e.due) : 'no date');
208
- f += `<div class="hx-top">${a.includes('keep') ? '<button type="button" class="hx-b" data-p="keep">Keep it</button>' : ''}<button type="button" class="hx-b" data-p="remove">Drop it</button></div>`;
209
- return `<div class="hx-top"><button type="button" class="hx-b" id="iTog" data-p="sheet" aria-expanded="${!!ui.sheet}" aria-controls="iSheet" title="Edit when, who and priority">Edit <em class="isum">${esc(sum)}</em></button>`
210
- + '<button type="button" class="hx-b pri" data-p="done">Done</button></div>'
220
+ const due = e.due ? 'Due ' + dayLabel(e.due) : when[0], late = !!e.due && e.due < W.M.today;
221
+ return `<div class="ut-chips"><span class="cz-chip${late ? ' on' : ''}">${esc(due)}</span><button type="button" class="cz-chip gh" id="iTog" data-p="sheet" aria-expanded="${!!ui.sheet}" aria-controls="iSheet" title="Edit when, who and priority">Edit <em class="isum">${esc(sum)}</em></button>`
222
+ + `${a.includes('keep') ? '<button type="button" class="cz-chip gh" data-p="keep">Keep for later</button>' : ''}</div>`
211
223
  + `<div class="mw-sheet" id="iSheet" role="group" aria-label="Item fields"${ui.sheet ? '' : ' hidden'}>${f}</div>`
212
224
  + '<p class="hx-n mw-err" id="cardErr" role="alert" hidden></p>';
213
225
  }
@@ -239,9 +251,13 @@ export function openMyWork(tab = 'yours') {
239
251
  return h + `<section class="mw-rec">${kv}<p class="hx-n">The item as your list holds it · ${esc(p.file)}</p></section>`;
240
252
  }
241
253
  function itemHtml(r) {
242
- return `<div class="mw-sub mw-it" data-esc-layer>${WAIT}<div class="hx-top"><button type="button" class="hx-b" data-mw="back">Back to My work</button></div>`
243
- + `<h3 class="mw-t">${esc(r.title)}</h3>${r.sub ? `<p class="hx-n">${esc(r.sub)}</p>` : ''}${r.dialog.say ? `<p class="mw-say">${esc(r.dialog.say)}</p>` : ''}`
244
- + `<div id="card">${cardInner(r)}</div><div id="agCard">${agCardInner(r)}</div><div class="mw-pane">${paneHtml(r)}</div></div>`;
254
+ const src = !!r.dialog.source;
255
+ return `<div class="mw-sub mw-it ut-vc" data-esc-layer><div>${backBtn()}</div>`
256
+ + `<div class="ut-vh"><button type="button" class="hm-ck" data-p="done" aria-label="Mark ${esc(r.title)} done"><span class="ut-chk"></span></button><div><h2 class="ut-h2 mw-t">${esc(r.title)}</h2>${r.sub ? `<p class="ut-sub">${esc(r.sub)}</p>` : ''}</div>`
257
+ + `<button type="button" class="ut-ib" data-p="sheet" aria-label="More for this item" title="When, who and priority">${DOTS}</button></div>`
258
+ + `${r.dialog.say ? `<p class="mw-say">${esc(r.dialog.say)}</p>` : ''}<div id="card">${cardInner(r)}</div><div id="agCard">${agCardInner(r)}</div>`
259
+ + `<p class="ut-lbl">${src ? 'Where it came from' : 'The record'}</p><div class="mw-pane">${paneHtml(r)}</div>`
260
+ + '<div class="ut-foot"><button type="button" class="ut-btn pri" data-p="done">Done</button><button type="button" class="ut-btn ghost" data-p="remove">Drop it</button></div></div>';
245
261
  }
246
262
 
247
263
  /* ── Focus and jobs ── */
@@ -260,7 +276,7 @@ export function openMyWork(tab = 'yours') {
260
276
  const rows = F.accepted.map((f) => card(f, 'acc')).concat(F.suggestions.map((f) => card(f, 'sug')), F.dismissed.map((k) => card({ key: k, title: titleOfKey(k), why: '', item_ids: [] }, 'no')));
261
277
  const jobs = (W.M.jobs || []).map((j) => `<div class="mw-fc"><b>${esc(j.name)}</b><p class="hx-n">When ${esc(j.when)}, I want ${esc(j.want)}, so ${esc(j.so)}.</p><p class="hx-n">${j.open} open ${j.open === 1 ? 'item' : 'items'}</p></div>`).join('');
262
278
  const okLine = /when .+,\s*i want .+,\s*so .+/i.test(W.ui.job || '');
263
- return `<div class="mw-sub mw-fj" data-esc-layer>${WAIT}<div class="hx-top"><button type="button" class="hx-b" data-mw="back">Back to My work</button></div>`
279
+ return `<div class="mw-sub mw-fj" data-esc-layer><div class="hx-top">${backBtn()}</div>`
264
280
  + '<p class="hx-n">PMOS suggests at most three, from your Today list: overdue first, then due today. Rules only, no model call.</p>'
265
281
  + (rows.join('') || '<p class="hx-n">Nothing is in Today, so there is nothing to suggest.</p>')
266
282
  + `<h4>Your jobs</h4>${jobs || '<p class="hx-n">You have no jobs yet. A job is something that matters to you, which items can serve.</p>'}`
@@ -272,13 +288,15 @@ export function openMyWork(tab = 'yours') {
272
288
  function draw(sel) {
273
289
  if (!body || !body.isConnected) return;
274
290
  const keep = body.scrollTop;
275
- if (!W.r) body.innerHTML = WAIT + '<p class="hx-n">Reading your list.</p>';
276
- else if (!W.M) body.innerHTML = WAIT + `<p class="hx-n">Your list could not be read${W.r.error ? ': ' + esc(W.r.error) : ''}.</p>`;
291
+ if (!W.r) body.innerHTML = '<p class="hx-n">Reading My work.</p>';
292
+ else if (!W.M) body.innerHTML = `<p class="hx-n">My work could not be read${W.r.error ? ': ' + esc(W.r.error) : ''}.</p>`;
277
293
  else if (W.view === 'item' && openR()) { body.innerHTML = itemHtml(openR()); setTitle(openR().title); }
278
294
  else if (W.view === 'fjobs') { body.innerHTML = focusHtml(); setTitle('Focus and jobs'); }
295
+ else if (W.solo) { vwClose(); return; } // opened alone from Home (an item, or Focus and jobs): there is no list behind it
279
296
  else {
280
- W.view = null; setTitle('Your list');
281
- body.innerHTML = WAIT + `<div class="hx-tabs" role="tablist">${TABS.map(([k, l]) => `<button type="button" role="tab" aria-selected="${k === W.tab}" data-tab="${k}">${esc(l)}</button>`).join('')}</div>` + listHtml() + `<p class="hx-n" role="status">${esc(W.msg)}</p>`;
297
+ W.view = null; setTitle('My work');
298
+ const n = (k) => (k === 'waiting' ? W.M.waiting.rows.length : k === 'stale' ? (W.M.review && W.M.review.n) || 0 : 0);
299
+ body.innerHTML = `<div class="ut-vc">${tabsHtml('work')}<div class="hx-tabs ut-chips" role="tablist" aria-label="Filter">${TABS.map(([k, l]) => `<button type="button" class="cz-chip${k === W.tab ? ' on' : ' gh'}" role="tab" aria-selected="${k === W.tab}" data-tab="${k}">${esc(l)}${n(k) ? ' ' + n(k) : ''}</button>`).join('')}</div>` + listHtml() + `<p class="hx-n" role="status">${esc(W.msg)}</p></div>`;
282
300
  }
283
301
  body.scrollTop = keep;
284
302
  if (sel) { const f = body.querySelector(sel); if (f) f.focus(); }
@@ -295,10 +313,13 @@ export function openMyWork(tab = 'yours') {
295
313
  W.M = r && r.ok && r.model ? r.model : null;
296
314
  if (r && r.state === 'reading') setTimeout(load, 3000);
297
315
  if (W.view === 'item' && !openR()) W.view = null; // the item left the list
316
+ if (W.want && W.M) { const k = W.want; W.want = null; if (rowOf(k)) { openItem(k); return; } }
298
317
  draw();
299
318
  }
300
319
  function openItem(key) { if (!rowOf(key)) return; W.view = 'item'; W.key = key; W.ui = freshUi(); draw('[data-mw="back"]'); }
301
- function back() { const k = W.key; W.view = null; W.ui = freshUi(); W.refocus = k ? { key: k, i: 0 } : null; draw(); }
320
+ // the way back: to My work's list, or (opened alone) to Focus when an item was opened from it; none when the Viewer's own close is the way out
321
+ const backBtn = () => (W.solo && !(W.home && W.view !== W.home) ? '' : `<button type="button" class="ut-btn sm ghost" data-mw="back">${BACK}${W.solo ? 'Back to Focus' : 'Back to My work'}</button>`);
322
+ function back() { if (W.solo) { if (W.home && W.view !== W.home) { W.view = W.home; W.ui = freshUi(); draw(); } else vwClose(); return; } const k = W.key; W.view = null; W.ui = freshUi(); W.refocus = k ? { key: k, i: 0 } : null; draw(); }
302
323
 
303
324
  /* ── presses ── */
304
325
  async function commit(o) {
@@ -409,6 +430,8 @@ export function openMyWork(tab = 'yours') {
409
430
  if (Date.now() - sw.up < 120) return; // the click that ends a drag does nothing
410
431
  const t = e.target.closest('button, a'); if (!t || t.disabled) return;
411
432
  if (t.dataset.mw === 'back') { back(); return; }
433
+ if (t.dataset.utTab === 'review') { if (!askReview()) { W.tab = 'review'; W.view = null; draw(); } return; }
434
+ if (t.dataset.utTab === 'work') { if (W.tab === 'review') { W.tab = 'yours'; draw(); } return; }
412
435
  if (t.dataset.tab) { W.tab = t.dataset.tab; W.msg = ''; draw(); return; }
413
436
  if (t.dataset.xf) { W.view = 'fjobs'; W.ui = freshUi(); draw('[data-mw="back"]'); return; }
414
437
  if (t.dataset.fx) {
@@ -454,7 +477,7 @@ export function openMyWork(tab = 'yours') {
454
477
  else if (id === 'agNote') { ui.note = t.value; const g = body.querySelector('[data-p="ag-sendback"]'); if (g) g.disabled = !t.value.trim(); }
455
478
  else if (id === 'xjIn') { ui.job = t.value; const g = body.querySelector('[data-fx="jadd"]'); if (g) g.disabled = !/when .+,\s*i want .+,\s*so .+/i.test(ui.job); }
456
479
  }
457
- /* keys on the rows of Your list: J and K move, the arrows do what the row names */
480
+ /* keys on the open rows: J and K move, the arrows do what the row names */
458
481
  function onKey(e) {
459
482
  const h = e.target.closest && e.target.closest('.mw-list .wrow:not(.sm) .wrh');
460
483
  if (!h || e.metaKey || e.ctrlKey || e.altKey || e.shiftKey) return;
@@ -504,7 +527,7 @@ export function openMyWork(tab = 'yours') {
504
527
  back();
505
528
  }
506
529
 
507
- body = vwOpen({ id: 'more:work', kind: 'My work', title: 'Your list', icon: 'list', render: (b) => { b.classList.add('hx'); }, onClose: () => { removeEventListener('keydown', onEsc, true); clearInterval(timer); } });
530
+ body = vwOpen({ id: 'more:work', kind: W.solo ? (W.home === 'fjobs' ? 'Focus' : 'Task') : 'My work', title: W.solo ? (W.home === 'fjobs' ? 'Focus and jobs' : 'Task') : 'My work', icon: 'list', render: (b) => { b.classList.add('hx'); }, onClose: () => { removeEventListener('keydown', onEsc, true); clearInterval(timer); } });
508
531
  // delegated, as the other Home cards do: every control in the card is a real <button>; the drag repeats what the arrow keys do
509
532
  body.onclick = onClick;
510
533
  body.oninput = onInput;
@@ -517,3 +540,15 @@ export function openMyWork(tab = 'yours') {
517
540
  load();
518
541
  return body;
519
542
  }
543
+
544
+ /** Open one of the PM's own items (a note, a mention made into a task) as its card, from a row of Home's list: key "work:<id>". */
545
+ export function openWorkItem(key) { return openMyWork('yours', { item: key, solo: true }); }
546
+ /** Focus and jobs alone, from the Focus chip of Home's list (My work is no longer a page of its own). */
547
+ export function openFocus() { return openMyWork('yours', { view: 'fjobs', solo: true }); }
548
+ /* The weekly review lives on Home (home-review.js needs Home's data): Home answers the hm:review event. Elsewhere the old summary shows. */
549
+ function askReview() {
550
+ if (typeof CustomEvent !== 'function') return false;
551
+ const ev = new CustomEvent('hm:review', { cancelable: true });
552
+ dispatchEvent(ev);
553
+ return ev.defaultPrevented;
554
+ }
@@ -226,8 +226,7 @@ export const viewReady = () => { view(); return !!V; };
226
226
 
227
227
  /** Show a note in the Notes place: the list by initiative, with this note open. */
228
228
  export async function openDock(id) {
229
- const r = await import('./registry.js');
230
- r.openDestination('notes', { slug: id });
229
+ window.dispatchEvent(new CustomEvent('pm-open-note', { detail: { id } })); // the page that holds the notes opens it, if it listens
231
230
  }
232
231
  /** A note was deleted: the Record control lets go of it. */
233
232
  export function forget(id) {
@@ -102,8 +102,7 @@ export const upcomingWithoutNote = (evs) => (evs || []).filter((e) => notesFor(e
102
102
 
103
103
  /** Open a note in the Notes place (meeting-notes Run 12): the list by initiative, with this note open. */
104
104
  export async function openNote(id) {
105
- const r = await import('./registry.js');
106
- r.openDestination('notes', { slug: id });
105
+ window.dispatchEvent(new CustomEvent('pm-open-note', { detail: { id } })); // the page that holds the notes opens it, if it listens
107
106
  }
108
107
  const dayOf = (iso) => { try { return new Date(iso).toLocaleDateString([], { weekday: 'short', day: 'numeric', month: 'short' }); } catch { return ''; } };
109
108
  const clock = (iso) => { try { return new Date(iso).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }); } catch { return ''; } };