create-pmos 0.398.0 → 0.400.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (515) hide show
  1. package/package.json +30 -25
  2. package/payload/KIT-VERSION +1 -1
  3. package/payload/planning/evals/eval-calibration.md +1 -1
  4. package/payload/planning/okrs/health-budgets.md +1 -1
  5. package/payload/state/discoveries.md +1 -1
  6. package/workspace/briefing-premium-adddoc-test.js +19 -15
  7. package/workspace/briefing-premium-board-test.js +82 -50
  8. package/workspace/briefing-premium-calendar-2-test.js +36 -36
  9. package/workspace/briefing-premium-calendar-3-test.js +39 -39
  10. package/workspace/briefing-premium-calendar-test.js +23 -24
  11. package/workspace/briefing-premium-doc-edit-test.js +8 -10
  12. package/workspace/briefing-premium-initiative-test.js +38 -16
  13. package/workspace/briefing-premium-insights-test.js +114 -37
  14. package/workspace/briefing-premium-metrics-test.js +6 -4
  15. package/workspace/briefing-premium-products-test.js +10 -7
  16. package/workspace/briefing-premium-sources-test.js +25 -22
  17. package/workspace/briefing-premium-test.js +48 -43
  18. package/workspace/briefing-premium-work-test.js +16 -11
  19. package/workspace/c3-capture-test.js +0 -17
  20. package/workspace/changelog.json +29 -0
  21. package/workspace/ev-everywhere-test.js +210 -0
  22. package/workspace/fixtures/premium-viewer-fixtures.js +11 -6
  23. package/workspace/guide/briefing-premium.md +2 -2
  24. package/workspace/guide/home.md +58 -19
  25. package/workspace/guide/index.md +1 -1
  26. package/workspace/guide/layout.md +2 -2
  27. package/workspace/guide/notes.md +2 -2
  28. package/workspace/guide/phone-companion.md +1 -1
  29. package/workspace/lib/board-grill.js +63 -0
  30. package/workspace/lib/board-premium.js +36 -5
  31. package/workspace/lib/initiative-layout.js +77 -0
  32. package/workspace/lib/insights-premium.js +3 -2
  33. package/workspace/lib/insights-records.js +21 -7
  34. package/workspace/lib/meeting-points.js +52 -0
  35. package/workspace/lib/news-for-you.js +88 -0
  36. package/workspace/lib/notes-series.js +29 -6
  37. package/workspace/lib/report-confirm.js +48 -0
  38. package/workspace/lib/route-modules.js +9 -9
  39. package/workspace/lib/routes-board-docs.js +46 -0
  40. package/workspace/lib/routes-board-grill.js +90 -0
  41. package/workspace/lib/routes-home-review.js +108 -0
  42. package/workspace/lib/routes-initiative-layout.js +57 -0
  43. package/workspace/lib/routes-insights-premium.js +4 -1
  44. package/workspace/lib/routes-insights-records.js +8 -4
  45. package/workspace/lib/routes-meeting-points.js +37 -0
  46. package/workspace/lib/routes-news.js +57 -0
  47. package/workspace/lib/routes-notes.js +2 -1
  48. package/workspace/lib/routes-phone-day.js +18 -9
  49. package/workspace/lib/routes-report-confirm.js +31 -0
  50. package/workspace/lib/routes-search.js +38 -0
  51. package/workspace/lib/routes-slash.js +95 -0
  52. package/workspace/lib/search-index.js +176 -0
  53. package/workspace/package-lock.json +2 -2
  54. package/workspace/package.json +1 -2
  55. package/workspace/premium-board-actions-test.js +86 -50
  56. package/workspace/premium-briefing-depth-test.js +55 -54
  57. package/workspace/premium-chat-chart-tab-test.js +4 -2
  58. package/workspace/premium-chat-goal-view-test.js +1 -1
  59. package/workspace/premium-chat-report-tab-test.js +16 -2
  60. package/workspace/premium-chat-term-test.js +0 -10
  61. package/workspace/premium-core-doc-issue-test.js +15 -13
  62. package/workspace/premium-menu-rows-test.js +1 -1
  63. package/workspace/premium-phone-card-test.js +7 -5
  64. package/workspace/premium-report-read-test.js +55 -18
  65. package/workspace/premium-vw-backlog-test.js +2 -2
  66. package/workspace/premium-vw-cal-test.js +50 -35
  67. package/workspace/premium-vw-doc-test.js +10 -11
  68. package/workspace/premium-vw-item-test.js +1 -1
  69. package/workspace/premium-vw-jira-test.js +2 -2
  70. package/workspace/premium-vw-meet-test.js +37 -40
  71. package/workspace/premium-vw-notes-test.js +21 -19
  72. package/workspace/premium-vw-rec-test.js +11 -12
  73. package/workspace/premium-welcome-test.js +3 -3
  74. package/workspace/premium-work-depth-test.js +5 -6
  75. package/workspace/public/capture.html +23 -0
  76. package/workspace/public/pm/bd-acts.js +303 -225
  77. package/workspace/public/pm/bd-asks.js +261 -0
  78. package/workspace/public/pm/bd-pop.js +59 -0
  79. package/workspace/public/pm/bd-span.js +49 -13
  80. package/workspace/public/pm/bd-views.js +169 -0
  81. package/workspace/public/pm/c3-base.js +47 -0
  82. package/workspace/public/pm/c3-capture.js +1 -1
  83. package/workspace/public/pm/c3-ini-ui.js +1 -1
  84. package/workspace/public/pm/c3-sheet.js +1 -1
  85. package/workspace/public/pm/c3-toast.js +1 -1
  86. package/workspace/public/pm/console3.css +3 -0
  87. package/workspace/public/pm/cozy-board.css +301 -0
  88. package/workspace/public/pm/cozy-ev.css +228 -0
  89. package/workspace/public/pm/cozy-evmodel.js +106 -0
  90. package/workspace/public/pm/cozy-evui.js +47 -0
  91. package/workspace/public/pm/cozy-home.css +20 -5
  92. package/workspace/public/pm/cozy-insights.css +148 -10
  93. package/workspace/public/pm/cozy-nav.js +103 -39
  94. package/workspace/public/pm/cozy-news.js +140 -0
  95. package/workspace/public/pm/cozy-search.js +203 -0
  96. package/workspace/public/pm/cozy-settings.js +198 -0
  97. package/workspace/public/pm/cozy-sources.js +89 -0
  98. package/workspace/public/pm/cozy-today.css +220 -0
  99. package/workspace/public/pm/cozy-viewer.js +5 -2
  100. package/workspace/public/pm/cozy-vw-mtg.css +350 -0
  101. package/workspace/public/pm/cozy-vw-rp.css +152 -0
  102. package/workspace/public/pm/cozy.css +9 -0
  103. package/workspace/public/pm/goal-chat.js +5 -1
  104. package/workspace/public/pm/home-adddoc.js +5 -5
  105. package/workspace/public/pm/home-app.js +365 -70
  106. package/workspace/public/pm/home-around.js +24 -126
  107. package/workspace/public/pm/home-chat.js +77 -18
  108. package/workspace/public/pm/home-data.js +9 -7
  109. package/workspace/public/pm/home-dictate.js +57 -0
  110. package/workspace/public/pm/home-draft.js +6 -6
  111. package/workspace/public/pm/home-ini-model.js +190 -0
  112. package/workspace/public/pm/home-ini.css +171 -0
  113. package/workspace/public/pm/home-ini.js +466 -0
  114. package/workspace/public/pm/home-list.js +289 -0
  115. package/workspace/public/pm/home-more.js +18 -135
  116. package/workspace/public/pm/home-phone-card.js +13 -8
  117. package/workspace/public/pm/home-review.js +103 -0
  118. package/workspace/public/pm/home-task.js +67 -0
  119. package/workspace/public/pm/home-today.js +148 -0
  120. package/workspace/public/pm/home-work.js +63 -28
  121. package/workspace/public/pm/note-dock.js +1 -2
  122. package/workspace/public/pm/notes-links.js +1 -2
  123. package/workspace/public/pm/notes-task.js +3 -4
  124. package/workspace/public/pm/premium-board.js +164 -40
  125. package/workspace/public/pm/premium-chart-tab.js +4 -5
  126. package/workspace/public/pm/premium-first.js +5 -7
  127. package/workspace/public/pm/premium-initiative-head.js +3 -3
  128. package/workspace/public/pm/premium-insights.js +499 -202
  129. package/workspace/public/pm/premium-mtg-present.js +138 -0
  130. package/workspace/public/pm/premium-mtg-replay.js +142 -0
  131. package/workspace/public/pm/premium-report-read.js +216 -52
  132. package/workspace/public/pm/premium-report-tab.js +44 -19
  133. package/workspace/public/pm/premium-shell.js +7 -7
  134. package/workspace/public/pm/premium-vw-cal.js +150 -60
  135. package/workspace/public/pm/premium-vw-doc.css +20 -2
  136. package/workspace/public/pm/premium-vw-doc.js +22 -7
  137. package/workspace/public/pm/premium-vw-mtg.js +488 -261
  138. package/workspace/public/pm/premium-vw-notes.js +61 -0
  139. package/workspace/public/pm/rp-parts.js +269 -0
  140. package/workspace/public/pm/view-notes.js +2 -2
  141. package/workspace/public/premium-board.html +4 -3
  142. package/workspace/public/premium-insights.html +10 -10
  143. package/workspace/public/premium.html +3 -1
  144. package/workspace/r/m1.png +0 -0
  145. package/workspace/r/m2.png +0 -0
  146. package/workspace/r/m3.png +0 -0
  147. package/workspace/r/nl.png +0 -0
  148. package/workspace/replaced-tests.json +435 -0
  149. package/workspace/run-tests.js +323 -28
  150. package/workspace/server.js +15 -10
  151. package/workspace/test-files.json +3 -140
  152. package/workspace/test-lists/base.json +1 -2
  153. package/workspace/test-lists/c3-desktop-light-load.json +1 -2
  154. package/workspace/test-lists/c3-initiative-boards.json +1 -2
  155. package/workspace/test-lists/c3-meeting-focus.json +2 -12
  156. package/workspace/test-lists/c3-work-agent.json +1 -2
  157. package/workspace/test-lists/calendar-tidy-up.json +1 -2
  158. package/workspace/test-lists/console3-reports.json +1 -2
  159. package/workspace/test-lists/docs-three-way-sync.json +1 -2
  160. package/workspace/test-lists/extension-capture.json +5 -0
  161. package/workspace/test-lists/initiative-layout.json +9 -0
  162. package/workspace/test-lists/jira-wbs.json +1 -2
  163. package/workspace/test-lists/legacy-cleanup-a.json +9 -0
  164. package/workspace/test-lists/meeting-material.json +1 -2
  165. package/workspace/test-lists/meeting-notes.json +2 -36
  166. package/workspace/test-lists/meeting-replay.json +1 -2
  167. package/workspace/test-lists/mm-capture.json +2 -12
  168. package/workspace/test-lists/my-work.json +2 -10
  169. package/workspace/test-lists/onboarding-firstrun.json +2 -12
  170. package/workspace/test-lists/people-directory.json +1 -2
  171. package/workspace/test-lists/premium-uncovered-meetings.json +9 -0
  172. package/workspace/test-lists/premium-uncovered-reports.json +9 -0
  173. package/workspace/test-lists/run2-a.json +1 -2
  174. package/workspace/test-lists/run2-d.json +2 -19
  175. package/workspace/test-lists/run3-b.json +1 -2
  176. package/workspace/test-lists/run3-c.json +2 -12
  177. package/workspace/test-lists/run4-b.json +1 -2
  178. package/workspace/test-lists/run4-d.json +1 -5
  179. package/workspace/test-lists/run5-c.json +1 -11
  180. package/workspace/test-lists/run6.json +1 -5
  181. package/workspace/test-lists/uf-everywhere.json +15 -0
  182. package/workspace/test-lists/uf-home.json +9 -0
  183. package/workspace/test-lists/uncovered-board.json +9 -0
  184. package/workspace/test-lists/workspace-launch-flags.json +2 -12
  185. package/workspace/test-lists/workspace-profile-detection.json +2 -10
  186. package/workspace/test-timings.json +242 -123
  187. package/workspace/c3-briefing-test.js +0 -136
  188. package/workspace/c3-core-docs-test.js +0 -170
  189. package/workspace/c3-driver-fixture.js +0 -64
  190. package/workspace/c3-driver-test.js +0 -169
  191. package/workspace/c3-foundation-test.js +0 -163
  192. package/workspace/c3-ib-items-test.js +0 -114
  193. package/workspace/c3-ib-more-test.js +0 -146
  194. package/workspace/c3-ib-triage-backlog-test.js +0 -128
  195. package/workspace/c3-ini-harness.js +0 -66
  196. package/workspace/c3-ini-life-test.js +0 -167
  197. package/workspace/c3-initiatives-test.js +0 -186
  198. package/workspace/c3-light-load-test.js +0 -112
  199. package/workspace/c3-one-home-test.js +0 -149
  200. package/workspace/c3-phone-test.js +0 -289
  201. package/workspace/c3-quiet-test.js +0 -157
  202. package/workspace/c3-report-design-real-test.js +0 -264
  203. package/workspace/c3-report-design-test.js +0 -442
  204. package/workspace/c3-report-setup-test.js +0 -192
  205. package/workspace/c3-report-structure-real-test.js +0 -248
  206. package/workspace/c3-report-structure-test.js +0 -397
  207. package/workspace/c3-reports-test.js +0 -288
  208. package/workspace/c3-scan-test.js +0 -517
  209. package/workspace/c3-sessions-panel-test.js +0 -365
  210. package/workspace/c3-settings-test.js +0 -204
  211. package/workspace/c3-updates-test.js +0 -131
  212. package/workspace/c3-work-test.js +0 -260
  213. package/workspace/cut-stub.js +0 -40
  214. package/workspace/first-paint-audit.js +0 -160
  215. package/workspace/lib/c3-full-console.js +0 -15
  216. package/workspace/lib/engine/derived/trust.js +0 -3
  217. package/workspace/lib/engine/plan-forecast.js +0 -342
  218. package/workspace/lib/engine/report-families.js +0 -175
  219. package/workspace/lib/engine/truth-table.js +0 -57
  220. package/workspace/lib/routes-c3-init.js +0 -54
  221. package/workspace/lib/routes-c3-life.js +0 -120
  222. package/workspace/lib/routes-c3-timeline.js +0 -192
  223. package/workspace/lib/routes-forecast.js +0 -86
  224. package/workspace/lib/routes-releases.js +0 -130
  225. package/workspace/lib/routes-report-facts.js +0 -85
  226. package/workspace/lib/routes-report-families.js +0 -33
  227. package/workspace/lib/routes-signals.js +0 -51
  228. package/workspace/lib/routes-timeline.js +0 -197
  229. package/workspace/public/c3.html +0 -35
  230. package/workspace/public/index.html +0 -156
  231. package/workspace/public/pm/app.js +0 -831
  232. package/workspace/public/pm/bd-board.js +0 -159
  233. package/workspace/public/pm/bd-drag.js +0 -59
  234. package/workspace/public/pm/bd-model.js +0 -152
  235. package/workspace/public/pm/bd-timeline.js +0 -233
  236. package/workspace/public/pm/bd-tree.js +0 -244
  237. package/workspace/public/pm/board-copy.js +0 -59
  238. package/workspace/public/pm/board-read.js +0 -38
  239. package/workspace/public/pm/branches-sheet.js +0 -56
  240. package/workspace/public/pm/breakdown-api.js +0 -58
  241. package/workspace/public/pm/breakdown-copy.js +0 -138
  242. package/workspace/public/pm/briefing-deck.js +0 -441
  243. package/workspace/public/pm/briefing-model.js +0 -251
  244. package/workspace/public/pm/c3-ambient.js +0 -100
  245. package/workspace/public/pm/c3-audience-link.js +0 -21
  246. package/workspace/public/pm/c3-audience.js +0 -46
  247. package/workspace/public/pm/c3-boot.js +0 -13
  248. package/workspace/public/pm/c3-breakdown.js +0 -240
  249. package/workspace/public/pm/c3-brief-data.js +0 -11
  250. package/workspace/public/pm/c3-brief-mentions.js +0 -137
  251. package/workspace/public/pm/c3-brief-needs.js +0 -288
  252. package/workspace/public/pm/c3-brief-pulse.js +0 -112
  253. package/workspace/public/pm/c3-brief-summary.js +0 -139
  254. package/workspace/public/pm/c3-brief-today.js +0 -79
  255. package/workspace/public/pm/c3-brief.js +0 -279
  256. package/workspace/public/pm/c3-cal-strategy.js +0 -529
  257. package/workspace/public/pm/c3-calendar.js +0 -965
  258. package/workspace/public/pm/c3-calpop.js +0 -111
  259. package/workspace/public/pm/c3-case.js +0 -196
  260. package/workspace/public/pm/c3-core-docs.css +0 -18
  261. package/workspace/public/pm/c3-core-docs.js +0 -236
  262. package/workspace/public/pm/c3-daypart.js +0 -176
  263. package/workspace/public/pm/c3-demo-boards.js +0 -764
  264. package/workspace/public/pm/c3-demo-brief-ix.js +0 -350
  265. package/workspace/public/pm/c3-demo-brief-page.js +0 -70
  266. package/workspace/public/pm/c3-demo-cal-ix.js +0 -74
  267. package/workspace/public/pm/c3-demo-cal2.js +0 -66
  268. package/workspace/public/pm/c3-demo-cal3.js +0 -173
  269. package/workspace/public/pm/c3-demo-cal4.js +0 -169
  270. package/workspace/public/pm/c3-demo-cal5.js +0 -52
  271. package/workspace/public/pm/c3-demo-coredocs.js +0 -221
  272. package/workspace/public/pm/c3-demo-data.js +0 -552
  273. package/workspace/public/pm/c3-demo-focus.js +0 -181
  274. package/workspace/public/pm/c3-demo-init.js +0 -430
  275. package/workspace/public/pm/c3-demo-life.js +0 -77
  276. package/workspace/public/pm/c3-demo-material.js +0 -58
  277. package/workspace/public/pm/c3-demo-misc2.js +0 -34
  278. package/workspace/public/pm/c3-demo-phone.js +0 -48
  279. package/workspace/public/pm/c3-demo-plan2.js +0 -30
  280. package/workspace/public/pm/c3-demo-rd.js +0 -432
  281. package/workspace/public/pm/c3-demo-rep-ix.js +0 -126
  282. package/workspace/public/pm/c3-demo-rep2.js +0 -130
  283. package/workspace/public/pm/c3-demo-rep3.js +0 -138
  284. package/workspace/public/pm/c3-demo-rs.js +0 -287
  285. package/workspace/public/pm/c3-demo-term.js +0 -153
  286. package/workspace/public/pm/c3-demo-time.js +0 -49
  287. package/workspace/public/pm/c3-demo-work-ix.js +0 -32
  288. package/workspace/public/pm/c3-demo.js +0 -131
  289. package/workspace/public/pm/c3-design-studio.js +0 -369
  290. package/workspace/public/pm/c3-doc-formats.js +0 -153
  291. package/workspace/public/pm/c3-doc-sheet.js +0 -1230
  292. package/workspace/public/pm/c3-dock.js +0 -206
  293. package/workspace/public/pm/c3-docs.js +0 -291
  294. package/workspace/public/pm/c3-driver-work.js +0 -110
  295. package/workspace/public/pm/c3-driver.css +0 -18
  296. package/workspace/public/pm/c3-driver.js +0 -298
  297. package/workspace/public/pm/c3-focus.css +0 -304
  298. package/workspace/public/pm/c3-focus.js +0 -983
  299. package/workspace/public/pm/c3-ib-docs.js +0 -92
  300. package/workspace/public/pm/c3-ib-initiatives.js +0 -201
  301. package/workspace/public/pm/c3-ib-items.js +0 -210
  302. package/workspace/public/pm/c3-ib-releases.js +0 -48
  303. package/workspace/public/pm/c3-ib-sprints.js +0 -201
  304. package/workspace/public/pm/c3-ib-triage.js +0 -177
  305. package/workspace/public/pm/c3-ii-tabs.js +0 -252
  306. package/workspace/public/pm/c3-ini-life.css +0 -34
  307. package/workspace/public/pm/c3-ini-life.js +0 -379
  308. package/workspace/public/pm/c3-ini-records.js +0 -197
  309. package/workspace/public/pm/c3-ini-timeline.js +0 -278
  310. package/workspace/public/pm/c3-ini-work.js +0 -139
  311. package/workspace/public/pm/c3-init-extras.js +0 -170
  312. package/workspace/public/pm/c3-initiatives.js +0 -852
  313. package/workspace/public/pm/c3-lifecycle-panels.js +0 -479
  314. package/workspace/public/pm/c3-look.js +0 -27
  315. package/workspace/public/pm/c3-material.css +0 -22
  316. package/workspace/public/pm/c3-material.js +0 -321
  317. package/workspace/public/pm/c3-md.js +0 -3
  318. package/workspace/public/pm/c3-misc-panels.js +0 -89
  319. package/workspace/public/pm/c3-new-session.js +0 -110
  320. package/workspace/public/pm/c3-notes.js +0 -751
  321. package/workspace/public/pm/c3-phone-boot.js +0 -47
  322. package/workspace/public/pm/c3-phone-detail.js +0 -97
  323. package/workspace/public/pm/c3-phone-model.js +0 -3
  324. package/workspace/public/pm/c3-phone.css +0 -66
  325. package/workspace/public/pm/c3-phone.js +0 -444
  326. package/workspace/public/pm/c3-plan-panels.js +0 -163
  327. package/workspace/public/pm/c3-plan.js +0 -193
  328. package/workspace/public/pm/c3-quiet.css +0 -113
  329. package/workspace/public/pm/c3-quiet.js +0 -177
  330. package/workspace/public/pm/c3-replay.css +0 -133
  331. package/workspace/public/pm/c3-replay.js +0 -429
  332. package/workspace/public/pm/c3-report-deck.css +0 -163
  333. package/workspace/public/pm/c3-report-deck.js +0 -598
  334. package/workspace/public/pm/c3-report-frame.css +0 -20
  335. package/workspace/public/pm/c3-report-print.css +0 -20
  336. package/workspace/public/pm/c3-report-setup.css +0 -67
  337. package/workspace/public/pm/c3-report-setup.js +0 -298
  338. package/workspace/public/pm/c3-report-store.js +0 -244
  339. package/workspace/public/pm/c3-report-structure.css +0 -44
  340. package/workspace/public/pm/c3-report-structure.js +0 -473
  341. package/workspace/public/pm/c3-reports.css +0 -68
  342. package/workspace/public/pm/c3-reports.js +0 -377
  343. package/workspace/public/pm/c3-roadmap.js +0 -249
  344. package/workspace/public/pm/c3-scan-api.js +0 -167
  345. package/workspace/public/pm/c3-scan-next.js +0 -248
  346. package/workspace/public/pm/c3-scan-setup.js +0 -313
  347. package/workspace/public/pm/c3-scan-words.js +0 -41
  348. package/workspace/public/pm/c3-scan.css +0 -74
  349. package/workspace/public/pm/c3-scan.js +0 -93
  350. package/workspace/public/pm/c3-session-chat.js +0 -103
  351. package/workspace/public/pm/c3-session-conv.js +0 -165
  352. package/workspace/public/pm/c3-session-term.js +0 -216
  353. package/workspace/public/pm/c3-settings.css +0 -85
  354. package/workspace/public/pm/c3-settings.js +0 -1045
  355. package/workspace/public/pm/c3-shell.js +0 -628
  356. package/workspace/public/pm/c3-signals.js +0 -196
  357. package/workspace/public/pm/c3-strategy-panels.js +0 -45
  358. package/workspace/public/pm/c3-swipe.js +0 -230
  359. package/workspace/public/pm/c3-terminal-data.js +0 -48
  360. package/workspace/public/pm/c3-terminal-edge.js +0 -91
  361. package/workspace/public/pm/c3-terminal-icons.js +0 -40
  362. package/workspace/public/pm/c3-terminal-results.js +0 -141
  363. package/workspace/public/pm/c3-terminal.js +0 -52
  364. package/workspace/public/pm/c3-tickets.js +0 -163
  365. package/workspace/public/pm/c3-timeline.js +0 -201
  366. package/workspace/public/pm/calendar-views.js +0 -1049
  367. package/workspace/public/pm/console3-lift.md +0 -220
  368. package/workspace/public/pm/cozy-home.js +0 -172
  369. package/workspace/public/pm/cozy-initiative.css +0 -138
  370. package/workspace/public/pm/cycle-review.js +0 -125
  371. package/workspace/public/pm/data.js +0 -1577
  372. package/workspace/public/pm/dest-board.js +0 -444
  373. package/workspace/public/pm/dest-docs.js +0 -530
  374. package/workspace/public/pm/dest-initiatives.js +0 -162
  375. package/workspace/public/pm/dest-mywork.js +0 -307
  376. package/workspace/public/pm/dest-notes.js +0 -537
  377. package/workspace/public/pm/dest-people.js +0 -449
  378. package/workspace/public/pm/dest-reports.js +0 -383
  379. package/workspace/public/pm/dest-settings.js +0 -601
  380. package/workspace/public/pm/dest-today.js +0 -267
  381. package/workspace/public/pm/display-word.js +0 -56
  382. package/workspace/public/pm/doc-editor.js +0 -473
  383. package/workspace/public/pm/doc-graph.js +0 -272
  384. package/workspace/public/pm/doc-health-panel.js +0 -110
  385. package/workspace/public/pm/doc-rail.js +0 -167
  386. package/workspace/public/pm/doc-remote.js +0 -180
  387. package/workspace/public/pm/dock-sessions.js +0 -472
  388. package/workspace/public/pm/dock.js +0 -216
  389. package/workspace/public/pm/fixture.js +0 -821
  390. package/workspace/public/pm/flag-picker.js +0 -104
  391. package/workspace/public/pm/frame-copy.js +0 -278
  392. package/workspace/public/pm/freshness-line.js +0 -149
  393. package/workspace/public/pm/handoff-box.js +0 -82
  394. package/workspace/public/pm/initiative-list.js +0 -235
  395. package/workspace/public/pm/initiative-sheet.js +0 -331
  396. package/workspace/public/pm/initiatives-api.js +0 -95
  397. package/workspace/public/pm/initiatives-copy.js +0 -287
  398. package/workspace/public/pm/initiatives-timeline-copy.js +0 -59
  399. package/workspace/public/pm/initiatives-timeline.js +0 -410
  400. package/workspace/public/pm/initiatives-ui.js +0 -291
  401. package/workspace/public/pm/item-sheet.js +0 -268
  402. package/workspace/public/pm/keep-card.js +0 -204
  403. package/workspace/public/pm/lifecycle-lens-model.js +0 -246
  404. package/workspace/public/pm/lifecycle-lens.js +0 -276
  405. package/workspace/public/pm/lifecycle.js +0 -111
  406. package/workspace/public/pm/mobile.css +0 -366
  407. package/workspace/public/pm/mobile.js +0 -581
  408. package/workspace/public/pm/modes-live.js +0 -453
  409. package/workspace/public/pm/modes.js +0 -147
  410. package/workspace/public/pm/my-work-card.js +0 -51
  411. package/workspace/public/pm/my-work-data.js +0 -36
  412. package/workspace/public/pm/new-initiative-sheet.js +0 -169
  413. package/workspace/public/pm/next-step-ui.js +0 -190
  414. package/workspace/public/pm/outbox-panel.js +0 -125
  415. package/workspace/public/pm/palette-copy.js +0 -55
  416. package/workspace/public/pm/palette.js +0 -343
  417. package/workspace/public/pm/panel-breakdown.js +0 -702
  418. package/workspace/public/pm/panel-cockpit.js +0 -425
  419. package/workspace/public/pm/panel-detail.js +0 -1513
  420. package/workspace/public/pm/panel-initiatives.js +0 -929
  421. package/workspace/public/pm/panel-newsess.js +0 -709
  422. package/workspace/public/pm/panel-repos.js +0 -741
  423. package/workspace/public/pm/panel-tabs.js +0 -1506
  424. package/workspace/public/pm/panel-trees.js +0 -204
  425. package/workspace/public/pm/people-link.js +0 -106
  426. package/workspace/public/pm/phone-deck.js +0 -167
  427. package/workspace/public/pm/pm-work-view.js +0 -1533
  428. package/workspace/public/pm/portfolio-report.js +0 -61
  429. package/workspace/public/pm/premium-acts.js +0 -280
  430. package/workspace/public/pm/premium-brief.js +0 -111
  431. package/workspace/public/pm/premium-chat.js +0 -22
  432. package/workspace/public/pm/premium-doc-sheet.js +0 -312
  433. package/workspace/public/pm/premium-initiative.js +0 -324
  434. package/workspace/public/pm/premium-insights.css +0 -228
  435. package/workspace/public/pm/premium-metric-tiles.js +0 -68
  436. package/workspace/public/pm/premium-report-brief.js +0 -132
  437. package/workspace/public/pm/premium-vw-rec.js +0 -67
  438. package/workspace/public/pm/premium-wide.css +0 -30
  439. package/workspace/public/pm/print.css +0 -44
  440. package/workspace/public/pm/provider-cards.js +0 -136
  441. package/workspace/public/pm/registry.js +0 -203
  442. package/workspace/public/pm/release-card.js +0 -110
  443. package/workspace/public/pm/releases-view.js +0 -248
  444. package/workspace/public/pm/report-families-view.js +0 -505
  445. package/workspace/public/pm/report-slides.js +0 -438
  446. package/workspace/public/pm/report-tab.js +0 -33
  447. package/workspace/public/pm/report-view.js +0 -337
  448. package/workspace/public/pm/reports-copy.js +0 -134
  449. package/workspace/public/pm/roadmap.js +0 -294
  450. package/workspace/public/pm/run-card.js +0 -260
  451. package/workspace/public/pm/sessions-panel.js +0 -219
  452. package/workspace/public/pm/sheet-jira.js +0 -353
  453. package/workspace/public/pm/shell-bell.js +0 -163
  454. package/workspace/public/pm/shell-model.js +0 -83
  455. package/workspace/public/pm/shell-phone.js +0 -124
  456. package/workspace/public/pm/shell-readaloud.js +0 -53
  457. package/workspace/public/pm/shell-recording.js +0 -274
  458. package/workspace/public/pm/shell-ticker.js +0 -90
  459. package/workspace/public/pm/sig-watch.js +0 -41
  460. package/workspace/public/pm/slide-confirm.js +0 -163
  461. package/workspace/public/pm/slides-copy.js +0 -52
  462. package/workspace/public/pm/status-banner.js +0 -95
  463. package/workspace/public/pm/tab-doc.js +0 -859
  464. package/workspace/public/pm/tab-gone.js +0 -21
  465. package/workspace/public/pm/tab-term.js +0 -1210
  466. package/workspace/public/pm/tab-web.js +0 -90
  467. package/workspace/public/pm/timeline-copy.js +0 -48
  468. package/workspace/public/pm/timeline-forecast-view.js +0 -164
  469. package/workspace/public/pm/today-agenda.js +0 -331
  470. package/workspace/public/pm/today-cards.js +0 -244
  471. package/workspace/public/pm/today-copy.js +0 -506
  472. package/workspace/public/pm/today-day.js +0 -1371
  473. package/workspace/public/pm/today-goals.js +0 -297
  474. package/workspace/public/pm/today-jobs.js +0 -84
  475. package/workspace/public/pm/today-mentions.js +0 -50
  476. package/workspace/public/pm/topbar.js +0 -202
  477. package/workspace/public/pm/triage-card.js +0 -60
  478. package/workspace/public/pm/undo-hold.js +0 -103
  479. package/workspace/public/pm/view-addrepo.js +0 -208
  480. package/workspace/public/pm/view-files.js +0 -197
  481. package/workspace/public/pm/view-livenotes.js +0 -399
  482. package/workspace/public/pm/view-today.js +0 -13
  483. package/workspace/public/pm/view-validate.js +0 -171
  484. package/workspace/public/pm/welcome.js +0 -391
  485. package/workspace/public/pm/work-place.js +0 -68
  486. package/workspace/public/pm/xlsx-read.js +0 -117
  487. package/workspace/public/welcome.html +0 -22
  488. package/workspace/test-lists/browser-suites-green.json +0 -5
  489. package/workspace/test-lists/c3-core-docs.json +0 -9
  490. package/workspace/test-lists/c3-doc-sheet-rich.json +0 -6
  491. package/workspace/test-lists/c3-doc-sheet-size.json +0 -6
  492. package/workspace/test-lists/c3-doc-sheet-v2.json +0 -6
  493. package/workspace/test-lists/c3-ib-items.json +0 -9
  494. package/workspace/test-lists/c3-ib-more.json +0 -9
  495. package/workspace/test-lists/c3-ib-triage-backlog.json +0 -9
  496. package/workspace/test-lists/c3-ini-life.json +0 -9
  497. package/workspace/test-lists/c3-meeting-board.json +0 -5
  498. package/workspace/test-lists/c3-meeting-card.json +0 -5
  499. package/workspace/test-lists/c3-notes-place.json +0 -5
  500. package/workspace/test-lists/c3-notes-series.json +0 -5
  501. package/workspace/test-lists/calendar-time-page.json +0 -5
  502. package/workspace/test-lists/calpop.json +0 -4
  503. package/workspace/test-lists/console3-briefing.json +0 -9
  504. package/workspace/test-lists/console3-foundation.json +0 -9
  505. package/workspace/test-lists/console3-work-page.json +0 -9
  506. package/workspace/test-lists/premium-brief-parity.json +0 -9
  507. package/workspace/test-lists/report-design-studio-ui.json +0 -5
  508. package/workspace/test-lists/report-structure-ui.json +0 -11
  509. package/workspace/test-lists/report-workspace-ui.json +0 -5
  510. package/workspace/test-lists/run3-a.json +0 -5
  511. package/workspace/test-lists/run3-d.json +0 -6
  512. package/workspace/test-lists/run4-c.json +0 -13
  513. package/workspace/test-lists/today-goals-jobs-ui.json +0 -5
  514. package/workspace/test-lists/today-mentions-cards.json +0 -5
  515. package/workspace/test-lists/workspace-tabs-declutter.json +0 -13
@@ -1,14 +1,17 @@
1
1
  /* pm/home-app.js — Home in the Agreed design (initiative premium-agreed-design, Home; mockup Main.dc.html place="work": AgHome, AgHomePhone,
2
- * AgInit*, AgProduct, AgChat*).
2
+ * AgInit*, AgProduct, AgChat*), with the one list of the Uncovered features canvas (initiative premium-uncovered-features, H1 and H2:
3
+ * HmMyWork, HmReview, HmProducts, HmMic, HmDay, HmDecide, HmPhone, HmPhone2).
3
4
  *
4
- * One desk. The list on the left: Today with New and the fold, the meeting line (+N, the record dot), then only three groups, Needs you
5
- * (the top 3 and "N more · Show"), Initiatives (the product first) and Loose. An initiative is a layout of this page (?ini=<id>): its card
6
- * sits at the top of the list with its own groups and the Elsewhere card under it. The chat is in the middle (home-chat.js) and the Viewer
7
- * on the right (cozy-viewer.js). On a phone the chat is the page; the top bar names what is open and "N need you" opens the list as a sheet.
5
+ * One desk. The list on the left is one list grouped by product (home-list.js builds it, home-today.js draws it): the Today card through
6
+ * the day, the filters (Today, Waiting, Kept, Done), each product's group with its initiatives (yours first, marked "your turn") and their
7
+ * tasks, next steps, sessions and meetings under them, then "Not in an initiative", the capture box and the untouched work. There is no
8
+ * Needs you group and no Your list. An initiative is a layout of this page (?ini=<id>): its card sits at the top of the list with its own
9
+ * groups and the Elsewhere card under it. The chat is in the middle (home-chat.js) and the Viewer on the right (cozy-viewer.js): a task opens
10
+ * there (home-task.js), and so does the weekly review (home-review.js). On a phone the list is the page; a row opens its conversation over
11
+ * it, with a back bar.
8
12
  *
9
- * The models are in home-data.js (pure). This file reads the routes, draws, and wires the presses. Every write is the PM's press (pmPost).
10
- * The features the design does not draw yet open from a quiet entry (the ⋯ menu on a phone, the place menu on desktop) as minimal
11
- * versions with a "Waiting for design" marker (home-more.js). Nothing here opens the old dialog or links to the console. */
13
+ * The models are in home-data.js and home-list.js (pure). This file reads the routes, draws, and wires the presses. Every write is the PM's
14
+ * press (pmPost). Nothing here opens the old dialog or links to the console. */
12
15
  import { mountNav } from './cozy-nav.js';
13
16
  import * as VW from './cozy-viewer.js';
14
17
  import { pmGet, pmPost, pmHeaders } from './http.js';
@@ -20,13 +23,17 @@ import { startAgent } from './page-agent.js';
20
23
  import { mdHtml } from './chat-md.js';
21
24
  import { mountPhoneCard } from './home-phone-card.js';
22
25
  import { mountFirst } from './premium-first.js';
26
+ import * as L from './home-list.js';
27
+ import * as TD from './home-today.js';
28
+ import { canDictate, dictate } from './home-dictate.js';
29
+ import { mountIni, iniList, iniOverview } from './home-ini.js'; // the initiative's stage move, Tasks and Core documents (premium-uncovered-features)
23
30
 
24
31
  const $ = (s, r = document) => r.querySelector(s);
25
32
  const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
26
33
  const P = new URLSearchParams(location.search);
27
34
  const WS = P.get('ws') || '';
28
35
  let PHC = null; // the phone moment card (home-phone-card.js): the top of the phone's sheet
29
- const FST = mountFirst(); // the first-run card after an import (?first=<import id>, premium-first.js): the top of the list, Waiting for design
36
+ const FST = mountFirst(); // the first-run card after an import (?first=<import id>, premium-first.js): the top of the list
30
37
  const wsQ = (pre = '?') => (WS ? pre + 'ws=' + encodeURIComponent(WS) : '');
31
38
  const BOARD = P.get('board') || ''; // the Board's expand link names its board: Home reads that board, not the default one
32
39
  const boardQ = (pre = '?') => (BOARD ? pre + 'board=' + encodeURIComponent(BOARD) : '');
@@ -44,6 +51,7 @@ const ROW_ICON = { gate: I.gate, warn: I.warn, clock: I.clock, doc: I.doc, chat:
44
51
  const COMMS = { key: 'comms', name: 'Communicator', initial: 'Co' };
45
52
  const CLAUDE = { key: 'claude', name: 'Claude', initial: 'C' };
46
53
  const RET_REASONS = ['wrong facts', 'wrong scope', 'not now', 'too long'];
54
+ const RET_LABEL = { 'wrong facts': 'Facts are wrong', 'wrong scope': 'Wrong scope', 'not now': 'Not needed now', 'too long': 'Too long' };
47
55
  const store = {
48
56
  get(k) { try { return localStorage.getItem(k); } catch { return null; } },
49
57
  set(k, v) { try { if (v == null) localStorage.removeItem(k); else localStorage.setItem(k, v); } catch { /* a private window */ } },
@@ -66,6 +74,10 @@ const S = {
66
74
  IM: null, IMid: null, // the selected initiative's model (GET /api/initiative-premium)
67
75
  doneOpen: false, sheet: false, rec: {}, pin: new Set(JSON.parse(store.get('pmos.home.pin') || '[]')),
68
76
  cardFold: store.get('pmos.home.cardfold') === '1', // the card's checklist folded to one line (AgInitSpec), kept in this browser
77
+ // the one list (premium-uncovered-features): the filter, the picked product, which groups and initiatives are open, kept in this browser
78
+ filter: 'today', product: store.get('pmos.home.product') || null, kidsOff: new Set(), rest: new Set(), tasks: new Set(), cap: false,
79
+ pg: (() => { try { return JSON.parse(store.get('pmos.home.pg') || '{}') || {}; } catch { return {}; } })(),
80
+ eodHidden: store.get('pmos.home.eod') === L.dayOf(), phoneChat: false,
69
81
  };
70
82
  const toast = (t) => { const el = $('#toast'); el.textContent = t; el.classList.add('on'); clearTimeout(toast.t); toast.t = setTimeout(() => el.classList.remove('on'), 4200); };
71
83
 
@@ -79,9 +91,9 @@ async function getRetry(path, tries = 20) {
79
91
  return { ok: false, error: 'still reading' };
80
92
  }
81
93
  async function load() {
82
- const [brief, board, ses, desk, today, sch] = await Promise.all([
94
+ const [brief, board, ses, desk, today, sch, work, day, rev] = await Promise.all([
83
95
  getRetry('/api/briefing-premium' + wsQ()), getRetry('/api/board-premium' + wsQ() + boardQ(WS ? '&' : '?')), pmGet('/api/sessions'), pmGet('/api/home-desk' + wsQ()),
84
- pmGet('/api/brief-page' + wsQ()), pmGet('/api/schedules' + wsQ()),
96
+ pmGet('/api/brief-page' + wsQ()), pmGet('/api/schedules' + wsQ()), pmGet('/api/my-work-premium' + wsQ()), pmGet('/api/phone-day'), pmGet('/api/home-review' + wsQ()),
85
97
  ]);
86
98
  const D = S.D;
87
99
  D.brief = brief && brief.ok && brief.model ? brief.model : null;
@@ -90,6 +102,9 @@ async function load() {
90
102
  D.desk = desk && desk.ok ? desk : null;
91
103
  D.today = today && today.ok ? today : null;
92
104
  D.schedules = sch && Array.isArray(sch.schedules) ? sch : null;
105
+ D.work = work && work.ok && work.model ? work.model : null; // the PM's own list (GET /api/my-work-premium): the filters and "Not in an initiative"
106
+ D.phoneDay = day && day.ok ? day : null; // what finished today, the recap and tomorrow (the end-of-day card, the Done filter)
107
+ D.review = rev && rev.ok ? rev : null; // this week's review (GET /api/home-review)
93
108
  D.now = Date.now();
94
109
  D.err = [brief, board].filter((x) => !x || !x.ok).map((x) => (x && x.error) || 'the server did not answer');
95
110
  const rows = H.boardRows(D);
@@ -98,9 +113,24 @@ async function load() {
98
113
  const tr = await pmGet('/api/board-trail?ids=' + encodeURIComponent(rows.slice(0, 150).map((r) => r.id).join(',')) + (b.ws ? '&ws=' + encodeURIComponent(b.ws) : wsQ('&')) + (b.id ? '&board=' + encodeURIComponent(b.id) : boardQ('&')));
99
114
  D.trail = tr && tr.ok ? tr : null;
100
115
  }
116
+ // the PMOS tasks of the board, so each sits under its initiative
117
+ const b0 = (D.board && D.board.board) || {};
118
+ const items = b0.id ? await pmGet('/api/boards/items?ws=' + encodeURIComponent(b0.ws || WS || '') + '&board=' + encodeURIComponent(b0.id)) : null;
119
+ D.items = items && items.ok ? items : null;
120
+ D.others = D.others || [];
101
121
  S.ready = true;
102
122
  await loadIni();
103
123
  draw();
124
+ // the boards of the other products Home reads, each its own closed group: read after the list is drawn, so a slow one never holds it up
125
+ const others = await Promise.all(otherProducts(D).map((a) => getRetry('/api/board-premium?ws=' + encodeURIComponent(a.ws), 4).then((r) => (r && r.ok && r.model ? { ws: a.ws, name: a.name, model: r.model } : null))));
126
+ const got = others.filter(Boolean);
127
+ if (got.length || D.others.length) { D.others = got; drawList(); }
128
+ }
129
+ /** The products Home reads (Products, on) other than the board's own: each is a group of the list, read from its own board. At most four. */
130
+ function otherProducts(D) {
131
+ const av = (D.brief && D.brief.products && D.brief.products.available) || [];
132
+ const own = ((D.board && D.board.board) || {}).ws || WS;
133
+ return av.filter((a) => a.on && a.ws && a.ws !== own).slice(0, 4);
104
134
  }
105
135
  async function loadIni() {
106
136
  const id = S.ini;
@@ -150,28 +180,37 @@ function groupHtml(key, title, rows, extra = '', head = '') {
150
180
  return `<section class="hm-g" aria-label="${esc(title)}"><div class="hm-ghr"><button type="button" class="hm-gh" data-hm-group="${esc(key)}" aria-expanded="${!shut}">${SVG(shut ? I.chev : I.down, 12, 2.2)}<span>${esc(title)}</span></button>${head}</div>`
151
181
  + (shut ? '' : rows.map((r) => rowHtml(r)).join('') + extra) + '</section>';
152
182
  }
153
- function meetHtml() {
154
- const m = H.meetLineOf(S.D.today);
155
- const live = recLive();
156
- const rec = live ? `<button type="button" class="hm-mp rec on" data-hm-recopen="${esc(live.id)}" aria-label="Recording: ${esc(live.title || 'a meeting')}. Open it" title="Recording: ${esc(live.title || 'a meeting')}"><i aria-hidden="true"></i></button>`
157
- : `<button type="button" class="hm-mp rec" data-hm-rec aria-label="Record a note now" title="Record a note now"><i aria-hidden="true"></i></button>`;
158
- if (!m) return `<div class="hm-meet"><button type="button" class="hm-mt" data-hm-cal>${SVG(I.clock, 16)}<span><b>No meeting left today</b></span></button>${rec}</div>`;
159
- return `<div class="hm-meet"><button type="button" class="hm-mt" data-hm-meet aria-label="${esc(m.aria)}">${SVG(I.clock, 16)}<span><b>${esc(m.time)}</b> ${esc(m.meeting.title)}${m.note ? ` · <em>${esc(m.note)}</em>` : ''}</span></button>`
160
- + (m.more ? `<button type="button" class="hm-mp" data-hm-cal aria-label="${m.more} more ${m.more === 1 ? 'meeting' : 'meetings'} today. Open the calendar">+${m.more}</button>` : '') + rec + '</div>';
183
+ /* ── the one list (premium-uncovered-features: HmMyWork, HmProducts, HmDay, HmMic, HmReview, HmPhone) ── */
184
+ const NOW = () => S.D.now || Date.now();
185
+ function recOf() { // a recording that is on and is no calendar meeting: the Today card shows it (HmMic)
186
+ const r = recLive(); if (!r) return null;
187
+ const n = REC && REC.note ? REC.note(r.id) : null;
188
+ const meeting = !!(n && (n.meeting || n.event || n.calendar));
189
+ return { id: r.id, title: r.title || (n && n.title) || '', at: (REC && REC.started && REC.started()) || (n && (n.started || n.created)) || null, paused: !!(n && n.state === 'paused'), meeting };
190
+ }
191
+ function todayModel() {
192
+ const T = L.todayCard(S.D, { now: NOW(), rec: recOf(), hidden: S.eodHidden, titleOf: (id) => iniTitle(id) });
193
+ const R = L.reviewModel(S.D, NOW());
194
+ if (T.mode === 'day' && R.open && R.started) {
195
+ const left = R.steps.filter((x) => !x.done).length;
196
+ return { mode: 'review', big: 'Friday. Your weekly review is open.', sub: 'Step ' + (R.at + 1) + ' of 4 · about ' + left * 3 + ' minutes left' };
197
+ }
198
+ return T;
161
199
  }
162
200
  function homeListHtml() {
163
- const L = H.homeLists(S.D, { allNeeds: S.allNeeds });
164
- S.L = L;
165
- const pinned = L.needs.rows.filter((r) => S.pin.has(r.key));
166
- const needRows = pinned.concat(L.needs.rows.filter((r) => !S.pin.has(r.key)));
167
- const more = !S.allNeeds && L.needs.more ? `<button type="button" class="hm-more" data-hm-allneeds>${L.needs.more} more · Show</button>` : S.allNeeds && L.needs.all > 3 ? '<button type="button" class="hm-more" data-hm-allneeds>Show fewer</button>' : '';
168
- const err = !S.ready ? '<p class="hm-none" role="status">Reading your work.</p>' : S.D.err.length && !L.initiatives.length && !L.needs.all ? `<p class="hm-none" role="status">Home could not read the repository: ${esc(S.D.err[0])}.</p>` : '';
169
- return `<div class="hm-hd"><h1>Today</h1><button type="button" class="hm-new" data-hm-new aria-haspopup="menu">${SVG(I.plus, 14, 2.2)}New</button>`
170
- + `<button type="button" class="hm-ib" data-hm-fold aria-label="Fold the list" title="Fold the list">${SVG(I.fold, 16)}</button></div>`
171
- + meetHtml() + err
172
- + (L.needs.all ? groupHtml('needs', 'Needs you', needRows, more) : S.ready ? '<section class="hm-g"><p class="hm-none">Nothing needs you now.</p></section>' : '')
173
- + (L.initiatives.length ? groupHtml('inis', 'Initiatives', L.initiatives) : '')
174
- + (L.loose.length ? groupHtml('loose', 'Loose', L.loose) : '');
201
+ const M = L.homeList(S.D, { now: NOW(), filter: S.filter, product: S.product && L.productsOf(S.D).some((p) => p.key === S.product) ? S.product : null });
202
+ S.M = M;
203
+ const R = L.reviewModel(S.D, NOW());
204
+ // the first initiative where it is your turn shows what is under it, until the PM closes it
205
+ const firstTurn = M.groups.filter((g) => g.kind === 'product').flatMap((g) => g.inis).find((x) => x.turn);
206
+ const open = (id) => S.kids.has(id) || (!!firstTurn && firstTurn.id === id && !S.kidsOff.has(id));
207
+ const pOpen = (g) => (g.key in S.pg ? !!S.pg[g.key] : g.primary || M.products.length === 1 || (!!S.product && S.product === g.product.key));
208
+ const nPick = M.products.length > 1 ? M.counts.products + ' products · ' + M.counts.initiatives + ' initiatives' : '';
209
+ const pins = H.needsOf(S.D).filter((r) => S.pin.has(r.key)).length;
210
+ return TD.listHtml(M, todayModel(), {
211
+ sel: S.sel, isOpen: open, pOpen, restOpen: (k) => S.rest.has(k), cap: S.cap, tasksOpen: (k) => S.tasks.has(k), pin: S.pin, avHtml, ready: S.ready, err: S.D.err.length ? S.D.err[0] : '',
212
+ product: S.product, review: R, mic: canDictate(), sub: pins ? pins + ' pinned' : nPick || 'Each one sits under its initiative',
213
+ });
175
214
  }
176
215
 
177
216
  /* ── the initiative card ── */
@@ -198,7 +237,8 @@ const TAG = { you: 'You', agent: 'Working', wait: 'Next', jira: 'Jira', risk: 'A
198
237
  const itemHtml = (x, o = {}) => {
199
238
  const k = x.kind === 'agent' && !o.role && !o.stalled ? 'wait' : x.kind; // an agent step with no agent at work on it waits: it is next
200
239
  const tag = k === 'agent' && o.stalled ? 'Stuck' : TAG[k];
201
- return `<div class="hm-it ${esc(k)}"${x.note ? ` title="${esc(x.note)}"` : ''}>${markHtml(k, o.role)}<span class="l">${esc(x.label)}</span>${k !== 'done' && tag ? `<span class="tag ${esc(k)}${tag === 'Stuck' ? ' stuck' : ''}">${tag}</span>` : ''}</div>`;
240
+ // the note (what the step waits on) is a line under the label, not only a title: a phone has no hover
241
+ return `<div class="hm-it ${esc(k)}"${x.note ? ` title="${esc(x.note)}"` : ''}>${markHtml(k, o.role)}<span class="l">${esc(x.label)}${x.note && k !== 'done' ? `<small>${esc(x.note)}</small>` : ''}</span>${k !== 'done' && tag ? `<span class="tag ${esc(k)}${tag === 'Stuck' ? ' stuck' : ''}">${tag}</span>` : ''}</div>`;
202
242
  };
203
243
  const MS = '<i class="cz-ms" aria-hidden="true"></i>'; // the milestone mark (◆), drawn as a shape
204
244
  const msStep = (label) => !!(STEPS.find((s) => s.label === label) || {}).ms;
@@ -270,13 +310,20 @@ function drawList() {
270
310
  let sc = el.querySelector(':scope > .hm-lsc'), ft = el.querySelector(':scope > .hm-lft');
271
311
  if (!sc || !ft) { el.innerHTML = '<div class="hm-lsc"></div><div class="hm-lft"></div>'; sc = el.firstElementChild; ft = el.lastElementChild; }
272
312
  const html = S.ini ? iniListHtml() : homeListHtml();
273
- if (sc.__h !== html) { const st = sc.scrollTop; sc.__h = html; sc.innerHTML = html; sc.scrollTop = st; }
313
+ if (sc.__h !== html) {
314
+ const st = sc.scrollTop, cap = sc.querySelector('#hmCap'), capV = cap ? cap.value : '', capF = !!cap && document.activeElement === cap;
315
+ sc.__h = html; sc.innerHTML = html; sc.scrollTop = st;
316
+ sc.querySelectorAll('.hm-load i[data-f]').forEach((i) => i.style.setProperty('--bd-f', i.dataset.f)); // the day's load: run-time geometry
317
+ const c2 = sc.querySelector('#hmCap'); if (c2 && capV) { c2.value = capV; } if (c2 && capF) c2.focus(); // a task being typed survives a redraw
318
+ }
274
319
  const fh = elseHtml();
275
320
  if (ft.__h !== fh) { ft.__h = fh; ft.innerHTML = fh; }
276
- // the first-run card after an import tops the list; the phone moment card (not in the Agreed design, Waiting for design) sits after the groups
321
+ iniList(sc);
322
+ // the first-run card after an import tops the list; the phone moment card sits after the groups
277
323
  if (FST && sc.firstElementChild !== FST) sc.prepend(FST);
278
324
  if (PHC && sc.lastElementChild !== PHC.el) sc.append(PHC.el);
279
325
  document.body.classList.toggle('hm-folded', S.folded && !isPhone());
326
+ document.body.classList.toggle('hm-plist', isPhone() && !S.phoneChat); // a phone: the list is the page until a row opens its conversation (HmPhone)
280
327
  }
281
328
 
282
329
  function draw() { drawList(); drawTop(); chat.refresh(); }
@@ -284,9 +331,12 @@ function draw() { drawList(); drawTop(); chat.refresh(); }
284
331
  /* ── rows by id ── */
285
332
  function allRows() {
286
333
  const out = [];
287
- const L = S.L || H.homeLists(S.D, { allNeeds: true });
334
+ const M = S.M || L.homeList(S.D, { now: NOW() });
288
335
  const add = (r) => { if (!r) return; out.push(r); (r.kids || []).forEach(add); };
289
- H.needsOf(S.D).forEach(add); L.initiatives.forEach(add); L.loose.forEach(add);
336
+ H.needsOf(S.D).forEach(add);
337
+ for (const g of M.groups) { (g.flat || []).forEach(add); (g.inis || []).forEach(add); (g.rest || []).forEach(add); (g.rows || []).forEach(add); }
338
+ if (M.list) M.list.rows.forEach(add);
339
+ if (S.filter !== 'today') { const T = L.homeList(S.D, { now: NOW() }); T.groups.forEach((g) => { (g.rows || []).forEach(add); (g.inis || []).concat(g.rest || []).forEach(add); }); }
290
340
  if (S.lay) S.lay.groups.forEach((g) => g.rows.forEach(add));
291
341
  for (const s of S.D.sessions) { const r = { id: 's:' + s.id, kind: 'session', sid: s.id, key: H.keyOfSession(s), ini: H.iniOfSession(s), name: (s.hx && s.hx.title) || s.name, role: H.roleOf(s, S.D.desk && S.D.desk.roles), state: s.shown }; out.push(r); }
292
342
  return out;
@@ -298,7 +348,7 @@ function drawTop() {
298
348
  const n = H.needsOf(S.D).length;
299
349
  const cur = S.cur || { title: 'Home', sub: '' };
300
350
  $('#hmTopTitle').textContent = cur.title; $('#hmTopSub').textContent = cur.sub || '';
301
- $('#hmNeedsN').textContent = !S.ready ? 'Reading' : n ? n + (n === 1 ? ' needs you' : ' need you') : 'Your list';
351
+ $('#hmNeedsN').textContent = !S.ready ? 'Reading' : n ? n + (n === 1 ? ' next step' : ' next steps') : 'Today';
302
352
  $('#hmNeeds').classList.toggle('loud', n > 0);
303
353
  document.title = 'PMOS · ' + (cur.title || 'Home');
304
354
  }
@@ -315,11 +365,11 @@ const chat = mountChat($('#hmChat'), {
315
365
  unqueue: (sid, at) => { pmPost('/api/home-desk/queue-drop', { session: sid, at }); if (S.D.desk && S.D.desk.queued && S.D.desk.queued[sid]) S.D.desk.queued[sid] = S.D.desk.queued[sid].filter((x) => x.at !== at); },
316
366
  onScope: (b) => menu(b, scopeItems(), 'Where this goes'),
317
367
  onLink: (b, t) => menu(b, H.boardRows(S.D).map((r) => ({ label: r.title, sub: r.stage, go: () => link(t.sid, r.id) })), 'Link it to an initiative'),
318
- onTo: (b) => menu(b, toItems(), 'Who reads this'),
368
+ onTo: (b, t) => menu(b, toItems(t), 'Send your messages to'), // @ and the To: chip: which conversation of this initiative you are writing in
319
369
  workItem: (text, t) => workItem(text, t),
320
370
  openTerminal: (sid) => openTerminal(sid),
321
371
  viewerClosed: () => !VW.isOpen() && !isPhone(),
322
- wait: MORE.WAIT,
372
+ wait: MORE.WAIT, // the Notes viewer only: the Home canvas does not draw it
323
373
  desk: () => !isPhone(),
324
374
  reopenViewer: () => reopenViewer(),
325
375
  });
@@ -327,12 +377,13 @@ function scopeItems() {
327
377
  return [{ label: 'All work', sub: 'Home', go: () => select(null) }, { label: H.productName(S.D) + ' · product', go: () => goIni('product') }]
328
378
  .concat(H.boardRows(S.D).map((r) => ({ label: r.title, sub: [r.lane, r.stage].filter(Boolean).join(' · '), go: () => goIni(r.id) })));
329
379
  }
330
- function toItems() {
331
- const id = S.ini;
380
+ function toItems(cur) {
381
+ const id = S.ini, at = cur && cur.key;
332
382
  const ses = S.D.sessions.filter((s) => H.iniOfSession(s) === id && s.shown !== 'exited');
333
- return [{ label: 'Claude', sub: 'The chat of this initiative', go: () => openTarget(iniTarget(id)) }]
334
- .concat(ses.map((s) => { const r = H.roleOf(s, S.D.desk && S.D.desk.roles); return { label: r.name, sub: (s.hx && s.hx.title) || s.name, go: () => openTarget(sessionTarget(s)) }; }))
335
- .concat([{ label: 'A new session', sub: 'Starts in ' + iniTitle(id), go: () => newIn(id) }]);
383
+ const main = iniTarget(id);
384
+ return [{ label: 'The initiative’s chat', sub: 'Claude, with ' + iniTitle(id) + ' as its context', checked: at === main.key, go: () => openTarget(main) }]
385
+ .concat(ses.map((s) => { const r = H.roleOf(s, S.D.desk && S.D.desk.roles), st = sessionTarget(s); return { label: (s.hx && s.hx.title) || s.name, sub: r.name + ' · another session of this initiative', checked: at === st.key, go: () => openTarget(st) }; }))
386
+ .concat([{ label: 'A new session', sub: 'A fresh conversation in ' + iniTitle(id), go: () => newIn(id) }]);
336
387
  }
337
388
  async function link(sid, ini) {
338
389
  const r = await pmPost('/api/session/initiative', { id: sid, initiative: ini });
@@ -366,19 +417,58 @@ function sessionTarget(s) {
366
417
  return t;
367
418
  }
368
419
  function alsoOf(ini) {
369
- const other = H.needsOf(S.D).filter((r) => !ini || r.ini !== ini || true).filter((r) => !(S.sel && S.sel === r.id));
370
- const n = other.find((r) => r.ini === ini) || other[0];
420
+ // in an initiative's chat only that initiative's own next step shows; another initiative's is not "also" this conversation's
421
+ const other = H.needsOf(S.D).filter((r) => !(S.sel && S.sel === r.id));
422
+ const n = ini ? other.find((r) => r.ini === ini) : other[0];
371
423
  return n ? { text: n.name, go: () => select(n.id) } : null;
372
424
  }
425
+ /* HmDecide: a decision is recorded in the chat, on a card under the agent's question: the choices, Why (kept in the journal), Record,
426
+ * Later (Later today, Tomorrow 09:00, Next week) and Pin. Nothing changes until the PM presses Record (POST /api/briefing-premium/decide). */
427
+ function decisionCard(r) {
428
+ const d = r.row.dialog || {};
429
+ const st = S.rec[r.key] || (S.rec[r.key] = { choice: d.sel || null, why: '', ret: null, note: '' });
430
+ if (st.whyShown == null) st.whyShown = st.why;
431
+ const ok = () => !!st.choice && st.why.trim().length >= 3;
432
+ return {
433
+ html: () => `<div class="ut-card ut-dec" role="group" aria-label="Your decision"><p class="ut-lbl">Your decision</p><div role="radiogroup" aria-label="Choices">${(d.opts || []).map((o) => `<button type="button" class="ut-radio" role="radio" aria-checked="${st.choice === o.k}" data-dc-opt="${esc(o.k)}"><span class="o" aria-hidden="true"></span><span><b>${esc(o.t)}</b>${o.d ? `<br><span class="ut-small ut-mut">${esc(o.d)}</span>` : ''}</span></button>`).join('')}</div>`
434
+ + `<div class="ut-field"><label for="dcWhy">Why <span class="ut-mut">· kept in the journal</span></label><textarea id="dcWhy" rows="2" placeholder="The reason goes in pm-decisions.md with your choice">${esc(st.whyShown)}</textarea></div>`
435
+ + `<div class="ut-acts"><button type="button" class="ut-btn pri" data-dc-rec${ok() ? '' : ' disabled'}>Record</button><button type="button" class="ut-btn" data-dc-later aria-haspopup="menu">Later${TD.svg(TD.P.chevD, 14)}</button>`
436
+ + `<button type="button" class="ut-ib${S.pin.has(r.key) ? ' on' : ''}" data-dc-pin aria-pressed="${S.pin.has(r.key)}" aria-label="${S.pin.has(r.key) ? 'Unpin' : 'Pin to the top'}" title="${S.pin.has(r.key) ? 'Unpin' : 'Pin to the top'}">${TD.svg(TD.P.pin, 16)}</button><span class="sp">Nothing changes until you press Record</span></div>`
437
+ + '<p class="ut-small ut-mut" role="status" id="dcMsg"></p></div>',
438
+ input: (t, card) => { if (t.id !== 'dcWhy') return; st.why = t.value; const b = card.querySelector('[data-dc-rec]'); if (b) b.disabled = !ok(); },
439
+ press: async (b) => {
440
+ st.whyShown = st.why; // a redraw after a press keeps what was typed; typing itself never changes the card's html
441
+ const say = (m) => { const el = document.getElementById('dcMsg'); if (el) el.textContent = m; };
442
+ if (b.dataset.dcOpt) { st.choice = b.dataset.dcOpt; return true; }
443
+ if ('dcPin' in b.dataset) { if (S.pin.has(r.key)) S.pin.delete(r.key); else S.pin.add(r.key); store.set('pmos.home.pin', JSON.stringify([...S.pin])); drawList(); return true; }
444
+ if ('dcLater' in b.dataset) {
445
+ const at = new Date(NOW() + 3 * 3600000);
446
+ const put = async (until) => { const res = await bpPost('put-off', { key: r.key, until }); if (res.ok) { toast('Put off. It comes back by itself, and it is not counted as done.'); delete S.rec[r.key]; VW.close(); await load(); select(null); } else say(res.error); };
447
+ menu(b, [{ label: 'Later today', k: H.hm(at.toISOString()), go: () => put('later') }, { label: 'Tomorrow', k: '09:00', go: () => put('tomorrow') }, { label: 'Next week', k: 'Mon', go: () => put('nextweek') }], '');
448
+ return false;
449
+ }
450
+ if ('dcRec' in b.dataset) {
451
+ b.disabled = true;
452
+ const res = await bpPost('decide', { key: r.key, choice: st.choice, why: st.why });
453
+ if (!res.ok) { b.disabled = false; say(res.error); return false; }
454
+ delete S.rec[r.key];
455
+ toast('Recorded in pm-decisions.md.');
456
+ VW.close(); await load(); select(null);
457
+ }
458
+ return false;
459
+ },
460
+ };
461
+ }
373
462
  function needTarget(r) {
374
463
  const row = r.row, d = row.dialog || {};
375
464
  const pills = [];
376
- for (const o of d.opts || []) pills.push({ label: o.t, primary: o.k === (d.prim || d.sel), go: () => { S.rec[r.key] = { ...(S.rec[r.key] || {}), choice: o.k }; openNeedViewer(r, true); } });
465
+ const dec = d.write && d.write.kind === 'decision';
466
+ if (!dec) for (const o of d.opts || []) pills.push({ label: o.t, primary: o.k === (d.prim || d.sel), go: () => { S.rec[r.key] = { ...(S.rec[r.key] || {}), choice: o.k }; openNeedViewer(r, true); } });
377
467
  if (d.write && d.write.kind === 'start') pills.unshift({ label: 'Start the agent', primary: true, go: () => start(r) });
378
468
  if (d.write && d.write.kind === 'return') pills.push({ label: 'Return it', go: () => openNeedViewer(r, true) });
379
- pills.push({ label: 'Discuss', go: () => chat.focus() });
469
+ if (!dec) pills.push({ label: 'Discuss', go: () => chat.focus() });
380
470
  return { key: r.key, ini: r.ini, ws: WS || undefined, title: r.name, sub: r.hint || '', scope: scopeOf(r.ini), rich: rich(), role: CLAUDE,
381
- intro: { role: CLAUDE, text: d.say || row.subject || row.title, pills }, placeholder: 'Ask about ' + r.name, also: null };
471
+ intro: { role: CLAUDE, text: d.say || row.subject || row.title, pills: dec ? [] : pills, card: dec ? decisionCard(r) : undefined }, placeholder: dec ? 'Answer, or type /' : 'Ask about ' + r.name, also: null };
382
472
  }
383
473
  function updateTarget() {
384
474
  const U = H.weeklyUpdate(S.D, S.D.now);
@@ -406,12 +496,18 @@ function select(id, o = {}) {
406
496
  S.sel = id;
407
497
  const r = id ? rowById(id) : null;
408
498
  if (isPhone()) sheet(false);
409
- if (!r) { if (S.ini) openTarget(iniTarget(S.ini)); else openTarget(homeTarget()); drawList(); return; }
499
+ if (!r) { S.phoneChat = false; if (S.ini) openTarget(iniTarget(S.ini)); else openTarget(homeTarget()); drawList(); return; }
410
500
  if (r.kind === 'ini') { goIni(r.ini); return; }
411
501
  if (r.kind === 'product') { goIni('product'); return; }
502
+ // a row with a conversation opens it; on a phone it opens over the list, with a back bar (HmPhone2)
503
+ if (isPhone() && (r.kind === 'update' || (r.kind === 'need' && r.row) || r.kind === 'session' || r.needSession)) S.phoneChat = true;
412
504
  if (r.kind === 'update') { openTarget(updateTarget()); if (!o.keepViewer) openUpdateViewer(); }
413
505
  else if (r.kind === 'need' && r.row) { openTarget(needTarget(r)); if (!o.keepViewer) openNeedViewer(r); }
414
506
  else if (r.kind === 'session' || r.needSession) { const s = S.D.sessions.find((x) => x.id === r.sid); if (s) { openTarget(sessionTarget(s)); if (isMetricsSession(s) && !o.keepViewer && !isPhone()) openMetricsViewer(); } }
507
+ else if (r.kind === 'task') { openBoardTask(r.task); }
508
+ else if (r.kind === 'item') { import('./home-work.js').then((M) => M.openWorkItem(r.key)); }
509
+ else if (r.kind === 'mention') { openMention(r); }
510
+ else if (r.kind === 'finished') { openFinished(r.finished); }
415
511
  else if (r.kind === 'meeting') { openMeeting(r.meeting); }
416
512
  else if (r.kind === 'routine') { if (isMetrics(r.schedule)) openMetrics(o); else openRoutine(r.schedule); }
417
513
  else if (r.kind === 'file') { openFile(r.file); }
@@ -441,6 +537,104 @@ function syncUrl() {
441
537
  history.replaceState(null, '', location.pathname + (s ? '?' + s : ''));
442
538
  }
443
539
 
540
+ /* ── the one list's own views: a task, a mention, finished work, the weekly review (premium-uncovered-features) ── */
541
+ const boardWs = () => ((S.D.board && S.D.board.board) || {}).ws || WS || undefined;
542
+ const boardId = () => ((S.D.board && S.D.board.board) || {}).id || BOARD || undefined;
543
+ const HTTPS = /^https:\/\//;
544
+ function openBoardTask(t) {
545
+ if (!t) return;
546
+ import('./home-task.js').then((M) => M.openTask(t, {
547
+ VW, pmPost, toast, now: NOW, ws: t.ws || boardWs(), board: t.board || boardId(), iniTitle,
548
+ docs: (id) => (S.IMid === id && S.IM ? (S.IM.docs.rows || []).filter((d) => d.path && !d.tech).map((d) => ({ title: d.title, path: d.path })) : []),
549
+ openIni: (id) => goIni(id), openDoc: (d) => openFile({ path: d.path, name: d.title }),
550
+ askInChat: (task) => {
551
+ S.phoneChat = isPhone();
552
+ openTarget({ ...iniTarget(task.ini), placeholder: 'Ask about ' + task.title });
553
+ setTimeout(() => { const ta = $('#hmIn'); if (ta) { ta.value = 'About the task "' + task.title + '": '; ta.dispatchEvent(new Event('input', { bubbles: true })); ta.focus(); } }, 0);
554
+ drawList();
555
+ },
556
+ openRecord: (task) => import('./premium-vw-item.js').then((V) => V.openWorkItem({ kind: 'task', ini: task.ini, key: 'task:' + task.uid, title: task.title, ws: boardWs(), board: boardId() })).catch(() => toast('The record could not open.')),
557
+ onChange: () => load(),
558
+ }));
559
+ }
560
+ function openMention(r) {
561
+ const m = r.mention || {};
562
+ const draw = (b) => {
563
+ b.innerHTML = `<div class="ut-vc"><div><h2 class="ut-h2">${esc(r.name)}</h2><p class="ut-sub">${esc(['Mention', m.where || m.source, m.at ? H.hm(m.at) : ''].filter(Boolean).join(' · '))}</p></div>`
564
+ + (m.text ? `<div class="ut-box">${esc(m.text)}</div>` : '') + (m.reply ? `<p class="ut-lbl">A reply you could send</p><div class="ut-box">${esc(m.reply)}</div>` : '')
565
+ + `<div class="ut-foot">${HTTPS.test(m.link || '') ? `<a class="ut-btn pri" href="${esc(m.link)}" target="_blank" rel="noopener noreferrer">Open it</a>` : ''}<button type="button" class="ut-btn" data-mn-read>Mark it read</button></div>`
566
+ + '<p class="ut-small ut-mut">PMOS sends nothing. Reply where the mention is.</p></div>';
567
+ };
568
+ const body = VW.open({ id: 'mention:' + (m.id || r.id), kind: 'Mention', title: r.name, icon: 'info', render: draw });
569
+ body.onclick = async (e) => {
570
+ if (!e.target.closest('[data-mn-read]')) return;
571
+ const res = await pmPost('/api/mentions/read', { id: m.id, read: true });
572
+ if (res && res.ok) { toast('Marked read.'); VW.close(); load(); } else toast((res && res.error) || 'Not marked read.');
573
+ };
574
+ }
575
+ function openFinished(f) {
576
+ if (!f) return;
577
+ VW.open({ id: 'fin:' + (f.id || f.title), kind: f.status === 'review' ? 'Finished · waits for your review' : 'Finished', title: f.title, icon: 'doc',
578
+ html: `<div class="ut-vc">${f.summary ? `<p class="ut-sub">${esc(f.summary)}</p>` : ''}${f.body ? `<article class="hv-doc">${mdHtml(f.body)}</article>` : ''}${HTTPS.test(f.link || '') ? `<div class="ut-foot"><a class="ut-btn" href="${esc(f.link)}" target="_blank" rel="noopener noreferrer">Open it</a></div>` : ''}</div>` });
579
+ }
580
+ function openReviewVw() {
581
+ S.sel = 'review'; drawList();
582
+ import('./home-review.js').then((M) => M.openReview({
583
+ VW, pmPost, toast, D: () => S.D, reload: () => load(), ws: () => boardWs(), iniTitle, now: NOW,
584
+ askAbout: (st, act) => {
585
+ S.phoneChat = isPhone();
586
+ const owner = st.owner ? ' It is ' + st.owner + '’s.' : ' It has no owner.';
587
+ openTarget({ ...homeTarget(), key: 'chat:review-' + st.id, title: 'Weekly review · ' + st.title, scope: { text: st.title, icon: I.flag },
588
+ intro: { role: CLAUDE, text: st.title + ' has had no change for ' + st.days + ' days, in ' + (st.stage || 'its stage') + '.' + owner + ' Do you want to hold it, or keep it going?',
589
+ pills: [{ label: 'Hold it', go: async () => { if (await act.hold()) chat.focus(); } }, { label: 'Keep it going', go: () => act.keep() }, { label: 'Skip', go: () => chat.focus() }] },
590
+ placeholder: 'Answer, or type /', context: 'Weekly review: ' + st.title + ' (' + st.id + ') has had no change for ' + st.days + ' days.' });
591
+ drawList();
592
+ },
593
+ }));
594
+ }
595
+ /* New → A task: the PM names the initiative first. An initiative's task is added in its Tasks view (home-ini.js, the box there);
596
+ * "Not in an initiative" opens the capture box in the list, on the PM's own list (POST /api/pm-items/add). The box is not on Home otherwise. */
597
+ async function addTaskIn(id) {
598
+ if (!id) { S.cap = true; drawList(); const i = $('#hmCap'); if (i) i.focus(); return; }
599
+ await goIni(id);
600
+ if (S.ini !== id) return;
601
+ iniOverview('tasks');
602
+ setTimeout(() => { const n = document.querySelector('#czViewer #ovTask'); if (n) n.focus(); }, 0);
603
+ }
604
+ async function capture(text) {
605
+ const line = String(text || '').trim(); if (!line) return false;
606
+ const r = await pmPost('/api/pm-items/add', { line });
607
+ if (!r || r.ok !== true) { toast((r && r.error) || 'The task was not added.'); return false; }
608
+ toast('Added to your own list, under Not in an initiative.');
609
+ S.cap = false;
610
+ await load();
611
+ return true;
612
+ }
613
+ /* a check in the list: a task or a note is done (the board's task route, or My work's) */
614
+ async function checkRow(id) {
615
+ const r = rowById(id); if (!r) return;
616
+ let res = null;
617
+ if (r.kind === 'task' && r.task) res = await pmPost('/api/boards/tasks/state', { ws: r.task.ws || boardWs(), board: r.task.board || boardId(), task: r.task.uid, state: 'Done' });
618
+ else if (r.kind === 'item' && r.item) res = await pmPost('/api/pm-items/done', { id: r.item.id });
619
+ else return;
620
+ if (!res || !res.ok) { toast((res && res.error) || 'Not marked done.'); return; }
621
+ toast('Done.');
622
+ await load();
623
+ }
624
+ /* the products picker (HmProducts): All products, each product with its goals, Add a product */
625
+ function pickProduct(anchor) {
626
+ const M = S.M || L.homeList(S.D, { now: NOW() });
627
+ const items = [{ label: 'All products', sub: 'Home only · Board and Insights show one', checked: !S.product, go: () => setProduct(null) }, { sep: true }]
628
+ .concat(M.products.map((p) => {
629
+ const g = M.groups.find((x) => x.product && x.product.key === p.key);
630
+ const n = g ? g.count : ((p.model && p.model.initiatives && p.model.initiatives.list && p.model.initiatives.list.rows) || []).filter(H.OPEN).length;
631
+ return { label: p.name, sub: [n + (n === 1 ? ' initiative' : ' initiatives'), p.goals && p.goals.n ? p.goals.ok + ' of ' + p.goals.n + ' goals' : ''].filter(Boolean).join(' · '), tile: p.initials, primary: p.primary, checked: S.product === p.key, go: () => setProduct(p.key) };
632
+ }))
633
+ .concat([{ sep: true }, { label: 'Add a product', icon: TD.P.plus, go: () => MORE.openProducts() }]);
634
+ menu(anchor, items, '');
635
+ }
636
+ function setProduct(key) { S.product = key; store.set('pmos.home.product', key); if (key) S.pg['p:' + key] = true; drawList(); }
637
+
444
638
  /* ── the Viewer: needs rows, the weekly update, the overview, files, people, routines ── */
445
639
  let lastViewer = null;
446
640
  VW.onChange((d) => { if (d.open) lastViewer = d.id; chat.refresh(); document.body.classList.toggle('hm-vw-open', d.open); });
@@ -450,7 +644,7 @@ function reopenViewer() {
450
644
  if (r) { select(r.id); return; }
451
645
  if (S.ini === 'product') { openUpdateViewer(); return; }
452
646
  if (S.ini) { openOverview(); return; }
453
- MORE.openMyWork();
647
+ openUpdateViewer(); // nothing picked on Home: the product's weekly update (My work is no longer a page of its own)
454
648
  }
455
649
  function factsHtml(rows) { return rows && rows.length ? `<dl class="hv-facts">${rows.map(([k, v]) => `<div><dt>${esc(k)}</dt><dd>${esc(v)}</dd></div>`).join('')}</dl>` : ''; }
456
650
  function openNeedViewer(r, focusWhy) {
@@ -466,20 +660,26 @@ function openNeedViewer(r, focusWhy) {
466
660
  const link = /^https:\/\//.test(d.link || '') ? `<a class="hx-b hv-link" id="srcLink" href="${esc(d.link)}" target="_blank" rel="noopener noreferrer">${esc(d.linkLabel || 'Open it')}</a>` : '';
467
661
  let rec = '';
468
662
  if (w.kind === 'decision') {
469
- rec = `<section class="hv-sec"><h4>Your decision</h4><div class="hv-opts" role="radiogroup" aria-label="Choices">${(d.opts || []).map((o) => `<button type="button" role="radio" aria-checked="${st.choice === o.k}" data-hv-opt="${esc(o.k)}"><b>${esc(o.t)}</b>${o.d ? `<em>${esc(o.d)}</em>` : ''}</button>`).join('')}</div>`
470
- + `<label class="hv-why"><span>Why</span><textarea id="hvWhy" rows="3" placeholder="The reason goes in pm-decisions.md with your choice">${esc(st.why)}</textarea></label>`
471
- + `<div class="hv-acts"><button type="button" class="hx-b pri" data-hv-rec${st.choice && st.why.trim().length >= 3 ? '' : ' disabled'}>Record the decision</button>${laterHtml()}${pinHtml(r)}</div></section>`;
663
+ // the decision is recorded on the chat's card (HmDecide); the Viewer keeps the facts it rests on
664
+ rec = '<p class="ut-small ut-mut">Record your decision on the card in the chat.</p>';
472
665
  } else if (w.kind === 'return') {
473
- rec = `<section class="hv-sec"><h4>Return this run: why</h4><div class="hv-seg">${RET_REASONS.map((x) => `<button type="button" aria-pressed="${st.ret === x}" data-hv-ret="${esc(x)}">${esc(x)}</button>`).join('')}</div>`
474
- + `<div class="hv-acts"><button type="button" class="hx-b pri" data-hv-rec${st.ret ? '' : ' disabled'}>Return it to the agent</button>${laterHtml()}${pinHtml(r)}</div></section>`;
666
+ // HmDecide, the Viewer's "Return a run": why it goes back, what to change, Return it or Keep it as is
667
+ b.innerHTML = `<div class="ut-vc"><div><h2 class="ut-h2">${esc(r.name)}</h2><p class="ut-sub">${esc(r.hint || pane.h || '')}</p></div>${facts}`
668
+ + `<p class="ut-lbl">Why it goes back</p><div class="ut-chips" role="group" aria-label="Why it goes back">${RET_REASONS.map((x) => `<button type="button" class="cz-chip${st.ret === x ? ' on' : ''}" aria-pressed="${st.ret === x}" data-hv-ret="${esc(x)}">${esc(RET_LABEL[x] || x)}</button>`).join('')}</div>`
669
+ + `<div class="ut-field"><label for="hvNote">What to change</label><textarea id="hvNote" rows="3" placeholder="Say what the agent should change">${esc(st.note || '')}</textarea></div>`
670
+ + '<div class="ut-box ut-small">The agent gets this note in its conversation and tries again. It counts as one correction.</div>'
671
+ + `<div class="ut-foot"><button type="button" class="ut-btn dark" data-hv-rec${st.ret ? '' : ' disabled'}>Return it</button><button type="button" class="ut-btn ghost" data-hv-keep>Keep it as is</button></div>`
672
+ + '<p class="ut-small ut-mut" role="status" id="hvMsg"></p></div>';
673
+ if (focusWhy) { const t = b.querySelector('#hvNote'); if (t) setTimeout(() => t.focus(), 0); focusWhy = false; }
674
+ return;
475
675
  } else if (w.kind === 'start') {
476
676
  rec = `<section class="hv-sec"><h4>Start</h4><p class="hx-n">The agent drafts ${esc(w.what || 'it')} in a real session. Its draft waits for you to read.</p><div class="hv-acts"><button type="button" class="hx-b pri" data-hv-start>Start the agent</button>${laterHtml()}${pinHtml(r)}</div></section>`;
477
677
  } else rec = `<div class="hv-acts">${link}${src ? '' : laterHtml()}${pinHtml(r)}</div>`; // a source row cannot be put off (the server refuses it)
478
- b.innerHTML = `<div class="hv">${pane.note ? `<p class="hv-note">${esc(pane.note)}</p>` : ''}${pane.h ? `<h4 class="hv-h">${esc(pane.h)}</h4>` : ''}${intro}${facts}${paras}${MORE.WAIT}${rec}<p class="hx-n" role="status" id="hvMsg"></p></div>`;
678
+ b.innerHTML = `<div class="hv">${pane.note ? `<p class="hv-note">${esc(pane.note)}</p>` : ''}${pane.h ? `<h4 class="hv-h">${esc(pane.h)}</h4>` : ''}${intro}${facts}${paras}${rec}<p class="hx-n" role="status" id="hvMsg"></p></div>`;
479
679
  if (focusWhy) { const t = b.querySelector('#hvWhy'); if (t) setTimeout(() => t.focus(), 0); focusWhy = false; }
480
680
  };
481
681
  const body = VW.open({ id: 'need:' + r.key, kind: ({ decision: 'Decision', blocked: 'Blocked', waited: 'Waiting', src: 'Source', ev: 'Event' }[row.kind] || 'Needs you'), title: r.name, icon: 'info', url: d.pane && d.pane.file ? '/premium-board.html?doc=' + encodeURIComponent(d.pane.file) : '', render: draw });
482
- body.oninput = (e) => { if (e.target.id === 'hvWhy') { st.why = e.target.value; const b = body.querySelector('[data-hv-rec]'); if (b) b.disabled = !(st.choice && st.why.trim().length >= 3); } };
682
+ body.oninput = (e) => { if (e.target.id === 'hvNote') { st.note = e.target.value; return; } if (e.target.id === 'hvWhy') { st.why = e.target.value; const b = body.querySelector('[data-hv-rec]'); if (b) b.disabled = !(st.choice && st.why.trim().length >= 3); } };
483
683
  body.onclick = async (e) => {
484
684
  const t = e.target.closest('button'); if (!t || t.disabled) return;
485
685
  const say = (m) => { const el = body.querySelector('#hvMsg'); if (el) el.textContent = m; };
@@ -489,12 +689,15 @@ function openNeedViewer(r, focusWhy) {
489
689
  if (t.dataset.hvUntil) { const res = await bpPost('put-off', { key: r.key, until: t.dataset.hvUntil }); if (res.ok) { toast('Put off. It comes back by itself, and it is not counted as done.'); VW.close(); await load(); select(null); } else say(res.error); return; }
490
690
  if ('hvPin' in t.dataset) { if (S.pin.has(r.key)) S.pin.delete(r.key); else S.pin.add(r.key); store.set('pmos.home.pin', JSON.stringify([...S.pin])); draw(body); drawList(); return; }
491
691
  if ('hvStart' in t.dataset) { start(r); return; }
692
+ if ('hvKeep' in t.dataset) { delete S.rec[r.key]; VW.close(); return; }
492
693
  if ('hvRec' in t.dataset) {
493
694
  t.disabled = true;
494
695
  const res = w.kind === 'decision' ? await bpPost('decide', { key: r.key, choice: st.choice, why: st.why }) : await bpPost('return', { run: w.run, reason: st.ret, ...(w.ws ? { ws: w.ws } : {}) });
495
696
  if (!res.ok) { t.disabled = false; say(res.error); return; }
496
697
  delete S.rec[r.key];
497
698
  toast(w.kind === 'decision' ? 'Recorded in pm-decisions.md.' : 'Returned to the agent. It counts as a correction.');
699
+ const note = w.kind === 'return' && String(st.note || '').trim();
700
+ if (note && chat.current() && chat.current().key === r.key) chat.send('What to change: ' + note);
498
701
  VW.close(); await load(); select(null);
499
702
  }
500
703
  };
@@ -550,6 +753,7 @@ async function sendUpdate() {
550
753
 
551
754
  /* the overview of an initiative: stage moves and hold, Tasks, Core documents (no design yet: a minimal version) */
552
755
  function openOverview() {
756
+ if (iniOverview()) return;
553
757
  const id = S.ini; if (!id || id === 'product') return;
554
758
  let M = S.IM;
555
759
  let ask = null; // on-hold | cancelled while its reason is asked
@@ -589,15 +793,15 @@ function openOverview() {
589
793
  (await import('./premium-vw-item.js')).openWorkItem({ kind: 'task', ini: id, key: row.key, title: row.title, ...o });
590
794
  return;
591
795
  }
592
- if (t.dataset.ovDread) { // a draft: read it, edit it, Issue it (a minimal reader in the Viewer, Waiting for design)
796
+ if (t.dataset.ovDread) { // a draft: read it, edit it, Issue it (home-draft.js, in the Viewer's card shape)
593
797
  const d = (M.docs.rows || []).find((x) => x.key === t.dataset.ovDread); if (!d) return;
594
798
  const A = await import('./home-draft.js');
595
- A.openDraftVw({ VW, pmGet, pmPost, toast, wait: MORE.WAIT, ws: M.board.ws, scope: M.docs.scope, doc: d, onIssued: () => load() });
799
+ A.openDraftVw({ VW, pmGet, pmPost, toast, ws: M.board.ws, scope: M.docs.scope, doc: d, onIssued: () => load() });
596
800
  return;
597
801
  }
598
- if ('ovAdddoc' in t.dataset) { // a minimal form in the Viewer (Waiting for design): it posts to /api/custom-docs/add only
802
+ if ('ovAdddoc' in t.dataset) { // the form in the Viewer (home-adddoc.js): it posts to /api/custom-docs/add only
599
803
  const A = await import('./home-adddoc.js');
600
- A.openAddDocVw({ VW, pmPost, toast, wait: MORE.WAIT, ws: M.board.ws, scope: M.docs.scope, phases: (M.acts && M.acts.stages) || [], title: iniTitle(id), back: () => openOverview(), onAdded: async () => { await load(); if (S.ini === id) openOverview(); } });
804
+ A.openAddDocVw({ VW, pmPost, toast, ws: M.board.ws, scope: M.docs.scope, phases: (M.acts && M.acts.stages) || [], title: iniTitle(id), back: () => openOverview(), onAdded: async () => { await load(); if (S.ini === id) openOverview(); } });
601
805
  }
602
806
  };
603
807
  body.onchange = async (e) => { const s = e.target.closest('[data-ov-task]'); if (s) after(await pmPost('/api/boards/tasks/state', { ...bw(), task: s.dataset.ovTask, state: s.value }), 'Status changed.'); };
@@ -739,10 +943,13 @@ function newItems() {
739
943
  const here = S.ini && S.ini !== 'product' ? S.ini : null;
740
944
  const inis = H.boardRows(S.D);
741
945
  return [
946
+ { label: 'A task', sub: 'Choose its initiative first', go: (b) => menu(b, inis.filter(H.OPEN).map((r) => ({ label: r.title, sub: r.stage, go: () => addTaskIn(r.id) }))
947
+ .concat([{ sep: true }, { label: 'Not in an initiative', sub: 'Your own list', go: () => addTaskIn(null) }]), 'Under which initiative') },
742
948
  { label: 'Next step of an initiative', sub: 'Open where it waits', go: (b) => menu(b, inis.map((r) => ({ label: r.title, sub: r.stage, go: () => goIni(r.id) })), 'Which initiative') },
743
949
  { label: here ? 'New session in ' + iniTitle(here) : 'New session in an initiative', sub: 'A fresh chat with its own history', go: (b) => (here ? newIn(here) : menu(b, inis.map((r) => ({ label: r.title, sub: r.stage, go: () => newIn(r.id) })), 'In which initiative')) },
744
950
  { label: 'Quick ask', sub: 'Your own chat, about all work', go: () => { goHome(); chat.focus(); } },
745
951
  { label: 'Something unrelated', sub: 'A loose chat; link it later', go: () => newLoose() },
952
+ { label: 'Record a note now', sub: 'A conversation that is not on the calendar', go: () => MORE.openRecorder().then(() => drawList()) },
746
953
  ];
747
954
  }
748
955
  function newIn(id) {
@@ -750,6 +957,8 @@ function newIn(id) {
750
957
  let n = 2; while (used.has('init:' + id + ':' + n)) n++;
751
958
  if (S.ini !== id) { S.ini = id; drawList(); loadIni().then(drawList); syncUrl(); }
752
959
  S.sel = null;
960
+ S.phoneChat = isPhone(); // on a phone the new session's chat shows over the list; without it the + looked like it did nothing
961
+ drawList();
753
962
  openTarget({ ...iniTarget(id), key: 'init:' + id + ':' + n, title: 'New session · ' + iniTitle(id), empty: 'A new session in ' + iniTitle(id) + '. Say what it is for.' });
754
963
  chat.focus();
755
964
  }
@@ -758,6 +967,7 @@ function newLoose() {
758
967
  const key = 'chat:loose-' + d.getFullYear() + p(d.getMonth() + 1) + p(d.getDate()) + '-' + p(d.getHours()) + p(d.getMinutes()) + p(d.getSeconds());
759
968
  if (S.ini) { S.ini = null; drawList(); syncUrl(); }
760
969
  S.sel = null;
970
+ S.phoneChat = isPhone(); drawList();
761
971
  openTarget({ key, ws: WS || undefined, title: 'New chat', scope: { text: 'Loose', icon: I.chat, loose: true }, rich: false, placeholder: 'Message Claude', empty: 'A loose chat. Link it to an initiative when it turns into one.', onSent: () => setTimeout(load, 1500) });
762
972
  chat.focus();
763
973
  }
@@ -784,13 +994,27 @@ const menuEl = $('#hmMenu');
784
994
  let menuItems = [];
785
995
  function menu(anchor, items, label) {
786
996
  menuItems = items;
787
- menuEl.innerHTML = (label ? `<p class="hm-ml">${esc(label)}</p>` : '') + items.map((x, i) => `<button type="button" role="menuitem" data-hm-mi="${i}"${x.disabled ? ' disabled' : ''}><b>${esc(x.label)}</b>${x.sub ? `<em>${esc(x.sub)}</em>` : ''}</button>`).join('') || '<p class="hm-ml">Nothing to choose.</p>';
997
+ // an item: { label, sub?, go, disabled? } and, for the products picker and Later (HmProducts, HmDecide): tile (initials), checked
998
+ // (a radio item with its check), icon (a path), k (the time on the right), or { sep: true } for a hairline
999
+ const itemHtml = (x, i) => {
1000
+ if (x.sep) return '<div class="ut-hr" role="separator"></div>';
1001
+ const rich = x.tile || x.checked != null || x.icon || x.k;
1002
+ const role = x.checked != null ? `role="menuitemradio" aria-checked="${!!x.checked}"` : 'role="menuitem"';
1003
+ if (!rich) return `<button type="button" ${role} data-hm-mi="${i}"${x.disabled ? ' disabled' : ''}><b>${esc(x.label)}</b>${x.sub ? `<em>${esc(x.sub)}</em>` : ''}</button>`;
1004
+ return `<button type="button" ${role} class="ut-mi${x.tile ? ' tall' : ''}" data-hm-mi="${i}"${x.disabled ? ' disabled' : ''}>${x.tile ? `<span class="ut-it${x.primary ? ' p' : ''}" aria-hidden="true">${esc(x.tile)}</span>` : ''}${x.icon ? TD.svg(x.icon, 16) : ''}`
1005
+ + `<span><b>${esc(x.label)}</b>${x.sub ? `<em>${esc(x.sub)}</em>` : ''}</span>${x.k ? `<span class="k">${esc(x.k)}</span>` : ''}${x.checked ? TD.svg(TD.P.check, 16) : ''}</button>`;
1006
+ };
1007
+ menuEl.innerHTML = (label ? `<p class="hm-ml">${esc(label)}</p>` : '') + items.map(itemHtml).join('') || '<p class="hm-ml">Nothing to choose.</p>';
788
1008
  menuEl.hidden = false; menuEl.setAttribute('data-esc-layer', '');
789
1009
  // the menu sits under (or over) the button that opened it: CSS anchor positioning reads .hm-anc, so no geometry is set from here
790
1010
  if (menu.anchor && menu.anchor !== anchor) menu.anchor.classList.remove('hm-anc');
791
1011
  anchor.classList.add('hm-anc');
792
1012
  menu.anchor = anchor;
793
- menuEl.classList.toggle('top', !!anchor.closest('.hm-top')); // the phone's ⋯ menu drops from its button at the top right
1013
+ // on a phone the menu is a sheet at the bottom, unless the button that opened it is in the top half of the screen: then it drops from
1014
+ // that button (the ⋯ of the top bar, the + of Today), so the choice opens where the press was (testing fixes)
1015
+ const ar = anchor.getBoundingClientRect(), high = !!anchor.closest('.hm-top') || ar.bottom < innerHeight / 2;
1016
+ menuEl.classList.toggle('top', high);
1017
+ menuEl.style.top = high && innerWidth <= 760 ? Math.round(ar.bottom + 6) + 'px' : '';
794
1018
  const f = menuEl.querySelector('button'); if (f) f.focus();
795
1019
  }
796
1020
  function closeMenu() { if (menuEl.hidden) return; menuEl.hidden = true; menuEl.removeAttribute('data-esc-layer'); if (menu.anchor) menu.anchor.classList.remove('hm-anc'); if (menu.anchor && menu.anchor.isConnected) menu.anchor.focus(); }
@@ -804,7 +1028,7 @@ document.addEventListener('click', (e) => { if (!menuEl.hidden && !menuEl.contai
804
1028
  document.addEventListener('keydown', (e) => { if (e.key === 'Escape' && !menuEl.hidden) { e.stopPropagation(); closeMenu(); } else if (e.key === 'Escape' && S.sheet) sheet(false); }, true);
805
1029
  function moreMenu(anchor) {
806
1030
  const go = {
807
- work: () => MORE.openMyWork(), around: () => MORE.openAround(), inbox: () => MORE.openInbox(searchGo), eod: () => MORE.openEndOfDay(), cal: () => openCalendar(),
1031
+ around: () => MORE.openAround(), inbox: () => MORE.openInbox(searchGo), eod: () => MORE.openEndOfDay(), cal: () => openCalendar(),
808
1032
  rec: () => MORE.openRecorder(), search: () => MORE.openSearch(searchGo), products: () => MORE.openProducts(), sources: () => MORE.openSources(), settings: () => MORE.openSettings(),
809
1033
  };
810
1034
  menu(anchor, MORE.moreItems.map(([k, l]) => ({ label: l, go: go[k] })), 'Waiting for design');
@@ -824,6 +1048,10 @@ function sheet(on) {
824
1048
  if (S.sheet) { const f = $('#hmList button'); if (f) f.focus(); }
825
1049
  }
826
1050
  $('#hmNeeds').onclick = () => sheet(!S.sheet);
1051
+ // a phone: the back bar of a conversation returns to the list, which is the page (HmPhone2)
1052
+ // My work's "Weekly review" (home-work.js) asks Home, which holds the data the review reads
1053
+ addEventListener('hm:review', (e) => { e.preventDefault(); openReviewVw(); });
1054
+ $('#hmBack').onclick = () => { S.phoneChat = false; S.sel = null; drawList(); syncUrl(); const f = $('#hmList .hm-rm'); if (f) f.focus(); };
827
1055
  $('#hmMoreP').onclick = (e) => moreMenu(e.currentTarget);
828
1056
  $('#hmDesk').onclick = (e) => { if (S.sheet && e.target === $('#hmDesk')) sheet(false); }; // a press beside the sheet closes it; Escape and the N need you button do too
829
1057
 
@@ -832,7 +1060,21 @@ $('#hmList').onclick = (e) => { // delegated: every press on the list is a <bu
832
1060
  const b = e.target.closest('button'); if (!b) return;
833
1061
  const d = b.dataset;
834
1062
  if (d.hmSel) { select(d.hmSel); return; }
835
- if (d.hmKids) { if (S.kids.has(d.hmKids)) S.kids.delete(d.hmKids); else S.kids.add(d.hmKids); drawList(); return; }
1063
+ if (d.hmKids) { // the chevron of an initiative: what sits under it shows or hides
1064
+ if (b.getAttribute('aria-expanded') === 'true') { S.kids.delete(d.hmKids); S.kidsOff.add(d.hmKids); } else { S.kids.add(d.hmKids); S.kidsOff.delete(d.hmKids); }
1065
+ drawList(); const f = $(`#hmList [data-hm-kids="${CSS.escape(d.hmKids)}"]`); if (f) f.focus(); return;
1066
+ }
1067
+ if (d.hmPg) { const open = b.getAttribute('aria-expanded') === 'true'; S.pg[d.hmPg] = !open; store.set('pmos.home.pg', JSON.stringify(S.pg)); drawList(); const f = $(`#hmList [data-hm-pg="${CSS.escape(d.hmPg)}"]`); if (f) f.focus(); return; }
1068
+ if ('hmProd' in d) { goIni('product'); return; }
1069
+ if (d.hmTasks) { if (S.tasks.has(d.hmTasks)) S.tasks.delete(d.hmTasks); else S.tasks.add(d.hmTasks); drawList(); return; }
1070
+ if (d.hmRest) { if (S.rest.has(d.hmRest)) S.rest.delete(d.hmRest); else S.rest.add(d.hmRest); drawList(); return; }
1071
+ if (d.hmFilter) { S.filter = d.hmFilter; drawList(); const f = $(`#hmList [data-hm-filter="${d.hmFilter}"]`); if (f) f.focus(); return; }
1072
+ if (d.hmCheck) { checkRow(d.hmCheck); return; }
1073
+ if ('hmReview' in d) { openReviewVw(); return; }
1074
+ if ('hmFocus' in d) { import('./home-work.js').then((M) => M.openFocus()); return; }
1075
+ if ('hmPick' in d) { pickProduct(b); return; }
1076
+ if ('hmCapmic' in d) { const i = $('#hmCap'); if (i) capMic(i, b); return; }
1077
+ if (d.hmTc) { todayPress(d.hmTc, b); return; }
836
1078
  if (d.hmEnd) { endRow(d.hmEnd); return; }
837
1079
  if (d.hmGroup) { if (S.shut.has(d.hmGroup)) S.shut.delete(d.hmGroup); else S.shut.add(d.hmGroup); store.set('pmos.home.shut', JSON.stringify([...S.shut])); drawList(); return; }
838
1080
  if ('hmAllneeds' in d) { S.allNeeds = !S.allNeeds; drawList(); return; }
@@ -851,24 +1093,76 @@ $('#hmList').onclick = (e) => { // delegated: every press on the list is a <bu
851
1093
  if ('hmElse' in d) { const f = S.lay && S.lay.elsewhere && S.lay.elsewhere.first; goHome(); if (f) select(f.id); return; }
852
1094
  if ('hmPerson' in d) addPerson();
853
1095
  };
1096
+ $('#hmList').addEventListener('keydown', (e) => { if (e.key === 'Escape' && e.target.id === 'hmCap' && S.cap) { e.stopPropagation(); S.cap = false; drawList(); } });
1097
+ $('#hmList').addEventListener('submit', async (e) => { // the capture box: Enter adds the task
1098
+ if (e.target.id !== 'hmCapF') return;
1099
+ e.preventDefault();
1100
+ const i = $('#hmCap'); if (!i || !i.value.trim()) return;
1101
+ i.disabled = true;
1102
+ const ok = await capture(i.value);
1103
+ const j = $('#hmCap'); if (j) { j.disabled = false; if (ok) j.value = ''; j.focus(); }
1104
+ });
1105
+ /* the mic of the capture box: the words are typed into it, nothing is saved as audio (home-dictate.js) */
1106
+ let capDict = null;
1107
+ function capMic(input, b) {
1108
+ if (capDict && capDict.on()) { capDict.stop(); return; }
1109
+ capDict = dictate(input, { onState: (x) => {
1110
+ const btn = $('#hmList [data-hm-capmic]'), form = $('#hmCapF');
1111
+ if (btn) { btn.classList.toggle('on', !!x.on); btn.setAttribute('aria-label', x.on ? 'Stop listening' : 'Say it instead'); }
1112
+ if (form) form.classList.toggle('on', !!x.on);
1113
+ if (x.error) toast(x.error);
1114
+ } });
1115
+ b.classList.add('on');
1116
+ }
1117
+ /* the Today card's presses (HmDay, HmMic): the calendar, the meeting's prep, the live meeting, the recording, the end of the day */
1118
+ async function todayPress(k, b) {
1119
+ const T = todayModel();
1120
+ if (k === 'cal') { openCalendar(); return; }
1121
+ if ((k === 'prep' || k === 'open') && T.meeting) { openMeeting(T.meeting); return; }
1122
+ if (k === 'record') { MORE.openRecorder().then(() => drawList()); return; }
1123
+ if (k === 'hl') { const r = REC && await REC.highlight(); toast(r && r.ok ? 'Highlighting the last 30 seconds and the next ones.' : (r && r.error) || 'The highlight did not start.'); return; }
1124
+ if (k === 'pause' || k === 'resume' || k === 'stop') {
1125
+ if (!REC || T.mode !== 'rec') return;
1126
+ b.disabled = true;
1127
+ const r = k === 'pause' ? await REC.pause() : k === 'resume' ? await REC.resume(T.id) : await REC.stop(T.id);
1128
+ if (!r || !r.ok) toast((r && r.error) || 'The recording did not change.');
1129
+ else if (k === 'stop') toast(r.discarded ? 'Stopped. Nothing was said, so nothing was kept.' : 'Stopped. The notes are under Not in an initiative until you link them.');
1130
+ await REC.refresh(); drawList();
1131
+ if (k === 'stop') load();
1132
+ return;
1133
+ }
1134
+ if (k === 'hide') { S.eodHidden = true; store.set('pmos.home.eod', L.dayOf()); drawList(); return; }
1135
+ if (k === 'now' && T.block) { select(T.block.id); return; }
1136
+ if (k === 'tomorrow' && T.block && T.block.key) {
1137
+ const res = await bpPost('put-off', { key: T.block.key, until: 'tomorrow' });
1138
+ if (!res.ok) { toast(res.error); return; }
1139
+ toast('Tomorrow 09:00. It comes back by itself, and it is not counted as done.');
1140
+ load();
1141
+ }
1142
+ }
854
1143
  $('#hmDesk').insertAdjacentHTML('afterbegin', `<button type="button" class="hm-unfold" id="hmUnfold" aria-label="Show the list" title="Show the list">${SVG(I.fold, 16)}</button>`);
855
1144
  $('#hmUnfold').onclick = () => { S.folded = false; store.set('pmos.home.fold', null); drawList(); };
856
1145
  function cta() {
857
1146
  if (S.ini === 'product') { const C = H.productCard(S.D); if (C.sent) openUpdateViewer(); else { select('n:update'); } return; }
858
1147
  const h = S.H || {};
859
- if (h.need) { select(h.need.id); return; }
860
- const t = iniTarget(S.ini);
861
- openTarget(t);
1148
+ if (h.need && h.need.ini === S.ini) { select(h.need.id); return; }
1149
+ // the review step: this initiative's own findings (its review document), never another row
1150
+ const rv = h.step === 'review' && S.IM && S.IMid === S.ini ? (S.IM.docs.rows || []).find((d) => d.key === 'review' && d.path) : null;
1151
+ if (rv) { openFile({ name: rv.title, path: rv.path }); return; }
1152
+ S.phoneChat = isPhone(); drawList(); // on a phone the chat shows over the list, or the press looks like it did nothing
1153
+ openTarget(iniTarget(S.ini));
862
1154
  if (h.ask) chat.send(h.ask);
863
1155
  }
864
1156
 
865
1157
  /* ── start ── */
1158
+ mountIni({ S, VW, pmGet, pmPost, toast, load: () => load(), loadIni: () => loadIni(), openFile: (f) => openFile(f), iniTitle: (id) => iniTitle(id), drawList: () => drawList(), wait: MORE.WAIT });
866
1159
  mountNav('home', document, { more: () => moreMenu, settings: () => MORE.openSettings() });
867
- PHC = mountPhoneCard({ pmGet, pmPost, toast, ws: () => WS || null, openMeeting: (m) => openMeeting(m), wait: MORE.WAIT }); drawList();
1160
+ PHC = mountPhoneCard({ pmGet, pmPost, toast, ws: () => WS || null, openMeeting: (m) => openMeeting(m) }); drawList();
868
1161
  drawList(); drawTop();
869
1162
  { // a conversation the address names opens at once, before the lists are read, so nothing typed or attached lands in the Home chat
870
1163
  const a = P.get('about') || '', early = /^(decision|blocked|waited|src|ev|work|board|doc|ins|chat|pop):[A-Za-z0-9][A-Za-z0-9._:-]{0,100}$/.test(a) && !P.get('open') && !P.get('session') ? a : null;
871
1164
  const sidAt = !early && !P.get('open') && /^[A-Za-z0-9._:-]{1,120}$/.test(P.get('session') || ''); // a session link: read nothing until its session is known, so Home's own chat never shows first
1165
+ if (early || sidAt) { S.phoneChat = isPhone(); drawList(); } // a phone: a conversation the address names is the page, not the list (HmPhone2)
872
1166
  openTarget(early ? { ...homeTarget(), key: early, title: (P.get('label') || '').slice(0, 80) || early }
873
1167
  : sidAt ? { ...homeTarget(), key: '', title: 'Reading', empty: 'Reading the session.' }
874
1168
  : S.ini ? (S.ini === 'product' ? { ...homeTarget(), title: 'Reading' } : iniTarget(S.ini)) : homeTarget());
@@ -884,6 +1178,7 @@ load().then(() => {
884
1178
  const say = (P.get('say') || P.get('q') || '').slice(0, 500);
885
1179
  const asked = !ask ? '' : /^board:/.test(ask) ? ask : /^(insights|verdict)$/.test(ask) ? 'ins:' + ask : 'init:' + ask;
886
1180
  const about = KEY.test(P.get('about') || '') ? P.get('about') : KEY.test(asked) ? asked : null;
1181
+ if (isPhone() && ((open && !blockOpen) || sid || about)) { S.phoneChat = true; drawList(); } // the conversation the address names, not the list
887
1182
  if (open && !blockOpen) { const r = allRows().find((x) => x.key === open); if (r) select(r.id); else if (KEY.test(open)) openTarget({ ...homeTarget(), key: open, title: open }); }
888
1183
  else if (sid) { const s = S.D.sessions.find((x) => x.id === sid); if (s) { S.sel = 's:' + s.id; openTarget(sessionTarget(s)); drawList(); } else { openTarget(homeTarget()); toast('That session is not on this machine.'); } }
889
1184
  else if (about && /^init:/.test(about) && iniRowOf(about.slice(5))) goIni(about.slice(5));