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,530 +0,0 @@
1
- /* pm/dest-docs.js — the Docs destination: is each document the same as its Google Docs and Confluence copy, and use
2
- * one version over the other on the PM's press (initiative docs-three-way-sync, PRD R-D1 to R-D6 and R-F1 to R-F4).
3
- *
4
- * A DESTINATION MODULE (registry.js): mountDestination(host, ctx) on every render with the same host, disposeDestination(host).
5
- * It keeps ONE persistent root per host; the header (title and search) is built once, so typing never loses focus, and
6
- * only the body is rebuilt when its own data changed.
7
- *
8
- * What it shows, for the repository the tab names (or the open one):
9
- * - Docs, a search box, Needs you · With a copy · All files, and when the copies were last compared, with a control
10
- * that compares again;
11
- * - the copies grouped by category, ONE line per copy: a status dot, the title, a link that opens the copy, one
12
- * sentence (which side is newer, and who edited it last) and at most one button (Use PMOS version, Use Confluence
13
- * version, or Choose… when both changed);
14
- * - a click on a line: both sides with where they live and their last edit, a Use … version button for each, the first
15
- * difference the check saw, Compare again, Stop tracking this copy, and the file's links (doc-graph.js);
16
- * - All files (docs-library-graph): every repository file under folding categories, each line naming its initiative;
17
- * a category opens on its first 20 files. A press on a file shows the files it links to and the files that link to
18
- * it. Add copy shows on hover or focus, and always on a touch screen;
19
- * - search: every file whose title, path or initiative matches, grouped by category, with the match marked.
20
- * The signal is decided on the server (lib/doc-sync.js) from what a check session read. Nothing here reads or writes
21
- * Google Docs or Confluence. Use … version waits five seconds behind Undo, then asks the server to start ONE doc-sync
22
- * session for that copy, which writes one side with the PM's own connectors (the PM's ruling, amended 2026-10-06).
23
- * In fixture mode it reads nothing.
24
- */
25
-
26
- import { el } from './dom.js';
27
- import { button, row, field, toast, empty, tabs, ensureComponentsCss } from './primitives.js';
28
- import { ensureSprite, icon } from './icons.js';
29
- import { pmGet, pmPost } from './http.js';
30
- import { wsOf } from './data.js';
31
- import { registerCommand, openDestination } from './registry.js';
32
- import { getLibrary, fileGraph } from './doc-graph.js';
33
- import { openDoc } from './panel-initiatives.js';
34
-
35
- const LABEL = { google: 'Google Docs', confluence: 'Confluence' };
36
- const UNDO_MS = 5000;
37
- const PAGE = 20;
38
- /* the library's categories, in display order (lib/doc-library.js CATEGORIES) */
39
- const CATS = [['spec', 'Specs'], ['ini', 'Initiatives'], ['dec', 'Decisions'], ['res', 'Research & plans'], ['exp', 'Explainers'],
40
- ['eval', 'Evals'], ['know', 'Knowledge'], ['guide', 'Guides & rules'], ['proto', 'Prototypes']];
41
- const CAT_NAME = Object.fromEntries(CATS);
42
-
43
- export const COPY = Object.freeze({
44
- title: 'Docs',
45
- fixture: 'Docs shows linked documents in a real session.',
46
- noRepo: 'Open a repository to see its documents.',
47
- loading: 'Reading…',
48
- readError: 'The documents could not be read.',
49
- find: 'Find a document',
50
- findIn: (n) => `Find in ${n.toLocaleString('en-US')} files`,
51
- needs: 'Needs you',
52
- copies: 'With a copy',
53
- files: 'All files',
54
- readingFiles: 'Reading the files…',
55
- filesError: 'The file list could not be read.',
56
- matches: (n, all) => `${n} of ${all.toLocaleString('en-US')} files match by title, path or initiative. Press Esc to clear.`,
57
- showAll: (n, cat) => `Show all ${n} in ${cat}`,
58
- needYou: (n) => `${n} need${n === 1 ? 's' : ''} you`,
59
- compared: (iso) => 'Compared ' + ago(iso),
60
- never: 'Not compared yet',
61
- comparing: 'Comparing…',
62
- compareAll: 'Compare every copy again',
63
- none: 'No document has a copy yet. Open All files and press Add copy on a file.',
64
- nothingNeeds: 'Nothing needs you. Every copy matches PMOS.',
65
- noMatch: (q) => `No document matches “${q}”.`,
66
- usePmos: 'Use PMOS version',
67
- useCopy: (label) => `Use ${label} version`,
68
- choose: 'Choose…',
69
- addCopy: 'Add copy',
70
- add: 'Add',
71
- cancel: 'Cancel',
72
- paste: 'Paste a Google Docs or Confluence link',
73
- badPaste: 'Paste the address of a Google Doc or a Confluence page.',
74
- added: 'Copy added. Compare to see which side is newer.',
75
- compareAgain: 'Compare again',
76
- stop: 'Stop tracking this copy',
77
- stopped: (label) => `Stopped tracking the ${label} copy. Nothing was deleted.`,
78
- undo: 'Undo',
79
- pushing: (label) => `Updating ${label} with the PMOS version.`,
80
- pulling: (label) => `Updating PMOS with the ${label} version.`,
81
- cancelled: 'Nothing was changed.',
82
- started: 'Compare started. It reads every copy and changes nothing.',
83
- });
84
-
85
- // Docs is in the top bar (the PM, 2026-10-06); ⌘K and `g d` open it too.
86
- registerCommand({ id: 'docs-open', label: 'Docs', hint: 'Is each document the same as its Google Docs and Confluence copy', cli: 'pmos docs list', run: () => openDestination('docs') });
87
-
88
- /* ── words ───────────────────────────────────────────────────────────────────────────────────────────────────────── */
89
-
90
- function ago(iso) {
91
- if (!iso) return 'never';
92
- const m = Math.round((Date.now() - Date.parse(iso)) / 60000);
93
- if (m < 1) return 'just now';
94
- if (m < 60) return `${m} min ago`;
95
- if (m < 48 * 60) return `${Math.round(m / 60)} h ago`;
96
- return `${Math.round(m / 1440)} days ago`;
97
- }
98
- /** "today 09:12", "yesterday 17:55", "Mon 14:05", "Sep 30". */
99
- function when(iso) {
100
- const t = new Date(iso);
101
- if (Number.isNaN(t.getTime())) return '';
102
- const hm = t.toTimeString().slice(0, 5);
103
- const day = (d) => new Date(d.getFullYear(), d.getMonth(), d.getDate()).getTime();
104
- const days = Math.round((day(new Date()) - day(t)) / 86400000);
105
- if (days === 0) return 'today ' + hm;
106
- if (days === 1) return 'yesterday ' + hm;
107
- if (days > 1 && days < 7) return t.toLocaleDateString('en-US', { weekday: 'short' }) + ' ' + hm;
108
- return t.toLocaleDateString('en-US', { month: 'short', day: 'numeric' });
109
- }
110
- /** A file's last edit from its YYYY-MM-DD date: "Oct 6", or "Oct 6, 2025" in another year. */
111
- function day(d) {
112
- const m = /^(\d{4})-(\d{2})-(\d{2})$/.exec(String(d || ''));
113
- if (!m) return '';
114
- const t = new Date(Number(m[1]), Number(m[2]) - 1, Number(m[3]));
115
- return t.toLocaleDateString('en-US', { month: 'short', day: 'numeric', ...(t.getFullYear() !== new Date().getFullYear() ? { year: 'numeric' } : {}) });
116
- }
117
- /** The text with every match of q marked. */
118
- function marked(text, q) {
119
- const t = String(text || '');
120
- if (!q) return t;
121
- const out = []; const low = t.toLowerCase(); let at = 0;
122
- for (let k = low.indexOf(q); k >= 0 && q; k = low.indexOf(q, at)) { out.push(t.slice(at, k), el('mark', { class: 'rp-docs-mark' }, t.slice(k, k + q.length))); at = k + q.length; }
123
- out.push(t.slice(at));
124
- return out;
125
- }
126
- const openFile = (p) => openDoc(null, p, 'FILE');
127
- const edit = (by, at) => [by, at ? when(at) : null].filter(Boolean).join(', ');
128
- const keyOf = (doc, link) => `${doc.path}|${link.kind}`;
129
- /** Which kind a pasted address names. The server checks it again; this only picks the kind. */
130
- function kindOf(target) {
131
- const t = String(target || '');
132
- if (/atlassian|confluence|\/wiki\/|pageId=/i.test(t)) return 'confluence';
133
- if (/google|docs\.|drive\./i.test(t)) return 'google';
134
- return null;
135
- }
136
-
137
- /** One dot, one sentence and at most one button per copy. The newer side's last edit is the only detail on the line. */
138
- function stateOf(inst, doc, link) {
139
- const L = link.label || LABEL[link.kind];
140
- const pend = inst.pending.get(keyOf(doc, link));
141
- const syncing = link.syncing || (pend ? { use: pend.use } : null);
142
- if (syncing) return { dot: 'none', strong: syncing.use === 'pmos' ? `Updating ${L}…` : `Updating PMOS from ${L}…` };
143
- const by = (s) => (link.basis === 'date' ? s + ' · by date' : s);
144
- let st;
145
- switch (link.signal) {
146
- case 'same': st = { dot: 'ok', rest: 'Same' }; break;
147
- case 'ahead': st = { dot: 'warn', strong: 'PMOS is newer', rest: by(edit(doc.repo && doc.repo.modified_by, doc.repo && doc.repo.modified_at)), btn: 'pmos' }; break;
148
- case 'behind': st = { dot: 'warn', strong: `${L} is newer`, rest: by(edit(link.remote_modified_by, link.remote_modified_at)), btn: 'copy' }; break;
149
- case 'diverged': st = { dot: 'bad', strong: 'Edited on both sides', btn: 'choose' }; break;
150
- case 'unchecked': st = { dot: 'none', rest: COPY.never }; break;
151
- case 'unreadable': st = { dot: 'bad', strong: `Can't open in ${L}`, rest: String(link.words || '').replace(/^Could not check — /, '') }; break;
152
- case 'missing-remote': st = { dot: 'bad', strong: `Not found in ${L}` }; break;
153
- case 'missing-repo': st = { dot: 'bad', strong: 'Not in PMOS any more' }; break;
154
- default: st = { dot: 'none', rest: link.words || '' };
155
- }
156
- if (link.sync_failed) return { ...st, dot: 'bad', strong: 'Sync failed', rest: link.sync_failed.reason };
157
- return st;
158
- }
159
-
160
- /* ── mount ───────────────────────────────────────────────────────────────────────────────────────────────────────── */
161
-
162
- const insts = new WeakMap();
163
- const REREAD_MS = 5000;
164
-
165
- export function mountDestination(host, ctx) {
166
- let inst = insts.get(host);
167
- if (!inst) {
168
- inst = { host, root: el('div', { class: 'rp-page rp-docs', 'data-docs': '' }), head: null, body: el('div', { class: 'rp-docs-body' }),
169
- ws: null, loaded: false, error: null, view: null, filter: 'needs', q: '', files: [], open: null, adding: null,
170
- pending: new Map(), busy: false, seq: 0, fseq: 0, last: '', timer: null, ftimer: null,
171
- lib: null, libError: null, openCats: new Set(), full: new Set(), graph: null };
172
- insts.set(host, inst);
173
- }
174
- ensureComponentsCss();
175
- if (!inst.root.isConnected || inst.root.parentNode !== host) host.replaceChildren(inst.root);
176
- if (ctx && ctx.FIXTURE) { inst.root.replaceChildren(empty({ text: COPY.fixture })); return; }
177
- const repo = (ctx && ctx.tab && ctx.tab.repo) || (ctx && ctx.state && ctx.state.product) || null;
178
- const ws = repo ? wsOf(repo) : null;
179
- if (ws !== inst.ws) {
180
- stopPoll(inst);
181
- Object.assign(inst, { ws, repo, loaded: false, error: null, view: null, last: '', open: null, adding: null, files: [], lib: null, libError: null, graph: null });
182
- inst.openCats.clear(); inst.full.clear();
183
- if (ws) { ensureSprite(); refresh(inst); }
184
- draw(inst);
185
- return;
186
- }
187
- // Coming back to Docs reads again (at most every few seconds): a file edited since shows its new signal.
188
- if (Date.now() - (inst.readAt || 0) > REREAD_MS) refresh(inst);
189
- if (!inst.last) draw(inst);
190
- }
191
-
192
- export function disposeDestination(host) {
193
- const inst = insts.get(host);
194
- if (!inst) return;
195
- stopPoll(inst);
196
- inst.seq++;
197
- inst.root.remove();
198
- insts.delete(host);
199
- }
200
-
201
- function stopPoll(inst) { if (inst.timer) { clearInterval(inst.timer); inst.timer = null; } }
202
- /** While a compare or a sync runs, read again every few seconds so its result lands without a reload; stop when it ends. */
203
- function pollWhileRunning(inst) {
204
- const v = inst.view;
205
- const running = v && (v.open || v.session || v.docs.some((d) => d.links.some((l) => l.syncing)));
206
- if (running && !inst.timer) inst.timer = setInterval(() => refresh(inst), 4000);
207
- if (!running) stopPoll(inst);
208
- }
209
-
210
- async function refresh(inst) {
211
- const ws = inst.ws;
212
- if (!ws) return;
213
- const seq = ++inst.seq;
214
- inst.readAt = Date.now();
215
- const [v, lib] = await Promise.all([pmGet('/api/docs?ws=' + encodeURIComponent(ws)), getLibrary(ws)]);
216
- if (seq !== inst.seq || ws !== inst.ws) return;
217
- if (lib) { inst.lib = lib; inst.libError = null; } else if (!inst.lib) inst.libError = COPY.filesError;
218
- inst.loaded = true;
219
- if (!v || v.ok === false) { inst.error = (v && v.error) || COPY.readError; inst.view = null; }
220
- else { inst.error = null; inst.view = v; }
221
- pollWhileRunning(inst);
222
- draw(inst);
223
- }
224
-
225
- /** The repository's files that match the search and have no copy yet: what Add copy is offered on. */
226
- function searchFiles(inst) {
227
- if (inst.ftimer) clearTimeout(inst.ftimer);
228
- const q = inst.q.trim();
229
- if (!q || inst.lib) { inst.files = []; return; }
230
- inst.ftimer = setTimeout(async () => {
231
- const seq = ++inst.fseq;
232
- const r = await pmGet('/api/docs/files?ws=' + encodeURIComponent(inst.ws) + '&q=' + encodeURIComponent(q));
233
- if (seq !== inst.fseq || q !== inst.q.trim()) return;
234
- inst.files = (r && r.ok && r.files) || [];
235
- draw(inst);
236
- }, 200);
237
- }
238
-
239
- /* ── actions ─────────────────────────────────────────────────────────────────────────────────────────────────────── */
240
-
241
- async function compareAll(inst) {
242
- inst.busy = true; draw(inst);
243
- const r = await pmPost('/api/docs/check', { ws: inst.ws });
244
- inst.busy = false;
245
- if (r && r.ok) toast({ text: COPY.started, timeout: 4000 });
246
- else toast({ text: (r && r.error) || 'The compare could not start.', tone: 'error' });
247
- await refresh(inst);
248
- }
249
-
250
- /** Use one version over the other. Held for five seconds behind Undo; only then is the session asked for. */
251
- function useVersion(inst, doc, link, use) {
252
- const key = keyOf(doc, link);
253
- if (inst.pending.has(key)) return;
254
- const L = link.label || LABEL[link.kind];
255
- const p = { use, timer: null, toast: null };
256
- p.timer = setTimeout(async () => {
257
- inst.pending.delete(key);
258
- const r = await pmPost('/api/docs/sync', { ws: inst.ws, path: doc.path, kind: link.kind, use });
259
- if (!r || !r.ok) toast({ text: (r && r.error) || 'The sync could not start.', tone: 'error' });
260
- await refresh(inst);
261
- }, UNDO_MS);
262
- p.toast = toast({ text: use === 'pmos' ? COPY.pushing(L) : COPY.pulling(L), actionLabel: COPY.undo, timeout: UNDO_MS,
263
- onAction: () => { clearTimeout(p.timer); inst.pending.delete(key); draw(inst); toast({ text: COPY.cancelled, timeout: 3000 }); } });
264
- inst.pending.set(key, p);
265
- inst.open = null;
266
- draw(inst);
267
- }
268
-
269
- async function stopTracking(inst, doc, link) {
270
- const r = await pmPost('/api/docs/unlink', { ws: inst.ws, path: doc.path, kind: link.kind });
271
- if (!r || !r.ok) { toast({ text: (r && r.error) || 'The copy is still tracked.', tone: 'error' }); return; }
272
- inst.open = null;
273
- toast({ text: COPY.stopped(link.label || LABEL[link.kind]), actionLabel: COPY.undo, timeout: 6000,
274
- onAction: async () => { await pmPost('/api/docs/link', { ws: inst.ws, path: doc.path, kind: link.kind, target: link.target }); refresh(inst); } });
275
- refresh(inst);
276
- }
277
-
278
- async function addCopy(inst, path, target, err) {
279
- const kind = kindOf(target);
280
- if (!kind) { err.textContent = COPY.badPaste; return; }
281
- const r = await pmPost('/api/docs/link', { ws: inst.ws, path, kind, target });
282
- if (!r || !r.ok) { err.textContent = (r && r.error) || 'The copy was not added.'; return; }
283
- inst.adding = null;
284
- inst.files = inst.files.filter((f) => f.path !== path);
285
- toast({ text: COPY.added, timeout: 4000 });
286
- refresh(inst);
287
- }
288
-
289
- /* ── lines ───────────────────────────────────────────────────────────────────────────────────────────────────────── */
290
-
291
- function copyLine(inst, doc, link, q = '') {
292
- const key = keyOf(doc, link);
293
- const L = link.label || LABEL[link.kind];
294
- const st = stateOf(inst, doc, link);
295
- const open = inst.open === key;
296
- const toggle = () => { inst.open = open ? null : key; draw(inst); };
297
- let act = null;
298
- if (st.btn === 'pmos' || st.btn === 'copy') {
299
- act = button({ label: st.btn === 'pmos' ? COPY.usePmos : COPY.useCopy(L), variant: 'primary', size: 'sm',
300
- attrs: { 'data-docs-act': 'use-' + st.btn, 'data-docs-key': key }, onClick: () => useVersion(inst, doc, link, st.btn) });
301
- } else if (st.btn === 'choose') {
302
- act = button({ label: COPY.choose, variant: 'outline', size: 'sm', attrs: { 'data-docs-act': 'choose', 'data-docs-key': key, 'aria-expanded': open ? 'true' : 'false' },
303
- onClick: toggle });
304
- }
305
- const opener = link.url
306
- ? el('a', { class: 'rp-docs-open', href: link.url, target: '_blank', rel: 'noopener noreferrer', 'data-docs-open': link.kind }, L + ' ↗')
307
- : el('span', { class: 'rp-docs-open' }, L);
308
- const line = row({
309
- title: marked(doc.title, q),
310
- meta: [st.strong, st.rest].filter(Boolean),
311
- lead: [el('span', { class: 'rp-docs-dot rp-docs-dot--' + st.dot, 'aria-hidden': 'true' })],
312
- trail: [opener, act].filter(Boolean),
313
- onOpen: toggle,
314
- openLabel: `${doc.title}, ${L}: ${[st.strong, st.rest].filter(Boolean).join(', ')}`,
315
- openAttrs: { 'aria-expanded': open ? 'true' : 'false', title: doc.path, 'data-docs-toggle': key },
316
- attrs: { 'data-docs-line': key, 'data-docs-signal': link.signal, 'data-docs-kind': link.kind, 'data-docs-title': doc.title,
317
- 'data-docs-state': [st.strong, st.rest].filter(Boolean).join(' · ') },
318
- });
319
- const wrap = el('div', { class: 'rp-docs-row', role: 'listitem', 'data-docs-doc': doc.path }, line);
320
- if (open) wrap.appendChild(details(inst, doc, link, st));
321
- return wrap;
322
- }
323
-
324
- /** The details, on a click: where each side lives, its last edit, both choices, and the first difference the check saw. */
325
- function details(inst, doc, link, st) {
326
- const L = link.label || LABEL[link.kind];
327
- const can = !st.strong || !/^Updating/.test(st.strong);
328
- const offer = can && ['ahead', 'behind', 'diverged'].includes(link.signal);
329
- const pNew = link.signal === 'ahead';
330
- const cNew = link.signal === 'behind';
331
- const side = (name, where, last, isNew, use) => el('div', { class: 'rp-docs-side' + (isNew ? ' rp-docs-side--new' : ''), 'data-docs-side': use },
332
- el('span', { class: 'rp-docs-side__label' }, name + (isNew ? ' · newer' : '')),
333
- el('span', { class: 'rp-docs-side__where' }, where),
334
- el('span', { class: 'rp-docs-side__edit' }, last ? 'Last edit: ' + last : 'Last edit: read at the next compare'),
335
- offer ? button({ label: use === 'pmos' ? COPY.usePmos : COPY.useCopy(L), variant: isNew ? 'primary' : 'outline', size: 'sm',
336
- attrs: { 'data-docs-act': 'use-' + use, 'data-docs-key': keyOf(doc, link) }, onClick: () => useVersion(inst, doc, link, use) }) : null);
337
- const diff = link.note && link.signal !== 'same' && link.signal !== 'unchecked'
338
- ? el('p', { class: 'rp-docs-diff', 'data-docs-diff': '' }, 'First difference: ' + link.note) : null;
339
- return el('div', { class: 'rp-docs-detail', 'data-docs-detail': keyOf(doc, link) },
340
- side('PMOS', doc.path, edit(doc.repo && doc.repo.modified_by, doc.repo && doc.repo.modified_at), pNew, 'pmos'),
341
- side(L, link.target, edit(link.remote_modified_by, link.remote_modified_at), cNew, 'copy'),
342
- diff,
343
- inst.lib && inst.lib.byPath.has(doc.path) ? el('div', { class: 'rp-docs-links' }, fileGraph(inst.lib, doc.path, { onOpen: openFile })) : null,
344
- el('div', { class: 'rp-docs-more' },
345
- button({ label: COPY.compareAgain, variant: 'ghost', size: 'sm', disabled: !!(inst.view && (inst.view.open || inst.view.session)) || inst.busy,
346
- attrs: { 'data-docs-act': 'compare-one' }, onClick: () => compareAll(inst) }),
347
- button({ label: COPY.stop, variant: 'ghost', size: 'sm', attrs: { 'data-docs-act': 'stop', 'data-docs-key': keyOf(doc, link) },
348
- onClick: () => stopTracking(inst, doc, link) })));
349
- }
350
-
351
- /**
352
- * A file with no copy: its title, its initiative's short name (or its path) and the date of its last edit. A press shows
353
- * its links; Add copy opens a paste field in place.
354
- */
355
- function fileLine(inst, f, q = '') {
356
- const start = () => { inst.adding = f.path; inst.graph = null; draw(inst); };
357
- const adding = inst.adding === f.path;
358
- const open = inst.graph === f.path;
359
- const toggle = () => { inst.graph = open ? null : f.path; draw(inst); };
360
- const ini = inst.lib && f.initiative ? inst.lib.ini(f) : null;
361
- const line = row({
362
- title: marked(f.title, q),
363
- meta: [ini ? el('span', { class: 'rp-docs-ini', title: ini.title }, marked(ini.short, q)) : el('span', { class: 'rp-docs-path' }, marked(f.path, q)), day(f.date)],
364
- lead: [el('span', { class: 'rp-docs-dot rp-docs-dot--none', 'aria-hidden': 'true' })],
365
- trail: adding ? [] : [button({ label: COPY.addCopy, variant: 'outline', size: 'sm', icon: 'plus', attrs: { class: 'rp-docs-addcopy', 'data-docs-act': 'add-copy', 'data-docs-key': f.path }, onClick: start })],
366
- onOpen: inst.lib ? toggle : null,
367
- openLabel: `${f.title}: show the files it links to`,
368
- openAttrs: { 'aria-expanded': open ? 'true' : 'false', title: f.path, 'data-docs-file-toggle': f.path },
369
- attrs: { 'data-docs-file-line': f.path, title: f.path },
370
- });
371
- const wrap = el('div', { class: 'rp-docs-row', role: 'listitem', 'data-docs-file': f.path }, line);
372
- if (open && inst.lib) wrap.appendChild(el('div', { class: 'rp-docs-links' }, fileGraph(inst.lib, f.path, { onOpen: openFile })));
373
- if (!adding) return wrap;
374
- const err = el('span', { class: 'rp-docs-add__err', role: 'alert' });
375
- const inp = field({ label: `Copy of ${f.title}`, hideLabel: true, placeholder: COPY.paste, attrs: { 'data-docs-field': 'target' } });
376
- inp.control.addEventListener('keydown', (e) => {
377
- if (e.key === 'Enter') addCopy(inst, f.path, inp.control.value.trim(), err);
378
- if (e.key === 'Escape') { inst.adding = null; draw(inst); }
379
- });
380
- setTimeout(() => inp.control.focus(), 0);
381
- wrap.appendChild(el('div', { class: 'rp-docs-add' }, el('div', { class: 'rp-docs-add__input' }, inp),
382
- button({ label: COPY.add, variant: 'primary', size: 'sm', attrs: { 'data-docs-act': 'add-save' }, onClick: () => addCopy(inst, f.path, inp.control.value.trim(), err) }),
383
- button({ label: COPY.cancel, variant: 'ghost', size: 'sm', onClick: () => { inst.adding = null; draw(inst); } }),
384
- err));
385
- return wrap;
386
- }
387
-
388
- /* ── the page ────────────────────────────────────────────────────────────────────────────────────────────────────── */
389
-
390
- function header(inst) {
391
- if (!inst.head) {
392
- const find = field({ label: COPY.find, hideLabel: true, placeholder: COPY.find, attrs: { 'data-docs-find': '' } });
393
- const q = find.control;
394
- inst.findControl = q;
395
- q.addEventListener('input', () => { inst.q = q.value; inst.open = null; inst.adding = null; inst.graph = null; inst.full.clear(); searchFiles(inst); draw(inst); });
396
- // The field restores its last committed text on Escape; here Escape clears the search instead.
397
- q.addEventListener('keydown', (e) => { if (e.key === 'Escape') { q.resetCommitted(''); inst.q = ''; inst.graph = null; searchFiles(inst); draw(inst); } });
398
- inst.titleEl = el('h2', { class: 'rp-head__title' }, COPY.title);
399
- inst.tabsSlot = el('div', { class: 'rp-docs-views' });
400
- inst.whenEl = el('span', { class: 'rp-docs-when', 'data-docs-summary': '' });
401
- inst.compareBtn = button({ label: COPY.compareAll, variant: 'primary', size: 'sm', icon: 'refresh-cw', attrs: { 'data-docs-act': 'check' }, onClick: () => compareAll(inst) });
402
- inst.head = el('div', { class: 'rp-docs-head' },
403
- el('div', { class: 'rp-docs-top' }, inst.titleEl, inst.tabsSlot),
404
- el('div', { class: 'rp-docs-bar' }, inst.whenEl, el('div', { class: 'rp-docs-find' }, find), inst.compareBtn));
405
- }
406
- return inst.head;
407
- }
408
-
409
- /** The parts of the header that follow the data: the title, the view tabs with their counts, when the copies were compared. */
410
- function updateHead(inst) {
411
- const v = inst.view;
412
- const lib = inst.lib;
413
- const all = v ? v.docs.reduce((n, d) => n + d.links.length, 0) : 0;
414
- const needs = v ? v.docs.reduce((n, d) => n + d.links.filter((l) => needsYou(inst, d, l)).length, 0) : 0;
415
- const running = !!v && (!!(v.open || v.session) || inst.busy);
416
- const repoName = inst.repo ? String(inst.repo).split('/').pop() : '';
417
- inst.titleEl.textContent = needs > 0 ? COPY.needYou(needs) + (repoName ? ` in ${repoName}` : '') : COPY.title;
418
- inst.tabsSlot.replaceChildren(tabs({ variant: 'segmented', items: [{ id: 'needs', label: COPY.needs, count: needs }, { id: 'copies', label: COPY.copies, count: all },
419
- { id: 'files', label: COPY.files, count: lib ? lib.files.length.toLocaleString('en-US') : null }],
420
- value: inst.filter, ariaLabel: 'Filter', attrs: { 'data-docs-filter': '' }, onChange: (val) => { inst.filter = val; inst.graph = null; draw(inst); } }));
421
- inst.whenEl.replaceChildren(icon('refresh-cw'), el('span', null, !v ? '' : running ? COPY.comparing : (v.last ? COPY.compared(v.last.finished_at) : COPY.never)));
422
- inst.compareBtn.disabled = running || !all;
423
- inst.compareBtn.setAttribute('aria-label', COPY.compareAll);
424
- inst.compareBtn.title = COPY.compareAll;
425
- }
426
-
427
- /** The body inside one card with a small label, like an Agenda panel. */
428
- function panel(inst, nodes) {
429
- const label = inst.q.trim() ? 'Results' : inst.filter === 'files' ? COPY.files : inst.filter === 'copies' ? COPY.copies : COPY.needs;
430
- return el('section', { class: 'rp-docs-panel' }, el('div', { class: 'rp-docs-panel__eyebrow' }, label), ...nodes);
431
- }
432
-
433
- const needsYou = (inst, d, l) => l.signal !== 'same' || !!l.syncing || inst.pending.has(keyOf(d, l));
434
-
435
- /**
436
- * One category: its title (a fold when `foldable`), then its lines — files with a copy first, then newest first; the
437
- * first 20, then Show all. `entries` are { f, doc }: f the file, doc its copies (null for a file with none).
438
- */
439
- function section(inst, key, entries, { q = '', foldable = false, page = true } = {}) {
440
- const name = CAT_NAME[key] || key;
441
- const open = !foldable || inst.openCats.has(key);
442
- const copies = entries.reduce((n, e) => n + (e.doc ? e.doc.links.length : 0), 0);
443
- const needs = entries.reduce((n, e) => n + (e.doc ? e.doc.links.filter((l) => needsYou(inst, e.doc, l)).length : 0), 0);
444
- const toggle = () => { if (inst.openCats.has(key)) inst.openCats.delete(key); else inst.openCats.add(key); draw(inst); };
445
- const head = foldable
446
- ? row({ title: name, meta: [String(entries.length), needs ? COPY.needYou(needs) : null], lead: [icon(open ? 'chevron-down' : 'chevron-right')],
447
- onOpen: toggle, openLabel: `${name}, ${entries.length} files${needs ? ', ' + COPY.needYou(needs) : ''}`,
448
- openAttrs: { 'aria-expanded': open ? 'true' : 'false', 'data-docs-cat-toggle': key }, attrs: { class: 'rp-docs-cat', 'data-docs-cat': key, 'data-docs-count': String(entries.length) } })
449
- : el('h3', { class: 'rp-docs-group__title' }, `${name} · ${entries.length}`);
450
- const box = el('section', { class: 'rp-docs-group', 'data-docs-group': key }, head);
451
- if (!open) return box;
452
- const sorted = entries.slice().sort((a, b) => (!!b.doc - !!a.doc) || String(b.f.date || '').localeCompare(String(a.f.date || '')) || a.f.path.localeCompare(b.f.path));
453
- const all = !page || inst.full.has(key);
454
- const shown = all ? sorted : sorted.slice(0, PAGE);
455
- const list = el('div', { role: 'list' }, shown.flatMap((e) => (e.doc ? e.doc.links.map((l) => copyLine(inst, e.doc, l, q)) : [fileLine(inst, e.f, q)])));
456
- box.appendChild(list);
457
- if (shown.length < sorted.length) {
458
- box.appendChild(button({ label: COPY.showAll(sorted.length, name), variant: 'ghost', size: 'sm', attrs: { class: 'rp-docs-showall', 'data-docs-act': 'show-all', 'data-docs-key': key },
459
- onClick: () => { inst.full.add(key); draw(inst); } }));
460
- }
461
- return box;
462
- }
463
-
464
- /** Entries grouped by category, in the categories' order. */
465
- function byCategory(entries) {
466
- const by = new Map();
467
- for (const e of entries) { const k = CAT_NAME[e.f.category] ? e.f.category : 'guide'; if (!by.has(k)) by.set(k, []); by.get(k).push(e); }
468
- return CATS.map(([k]) => [k, by.get(k)]).filter(([, es]) => es && es.length);
469
- }
470
-
471
- /** Every file: the library's, with each one's copies, plus a file with a copy the library does not list yet. */
472
- function allEntries(inst) {
473
- const v = inst.view;
474
- const docOf = new Map(v.docs.map((d) => [d.path, d]));
475
- const out = inst.lib ? inst.lib.files.map((f) => ({ f, doc: docOf.get(f.path) || null })) : [];
476
- const listed = new Set(out.map((e) => e.f.path));
477
- for (const d of v.docs) if (!listed.has(d.path)) out.push({ f: { path: d.path, title: d.title, category: d.category, date: null, initiative: null }, doc: d });
478
- return out;
479
- }
480
-
481
- function body(inst) {
482
- const v = inst.view;
483
- const q = inst.q.trim().toLowerCase();
484
- const lib = inst.lib;
485
- if (inst.findControl) inst.findControl.placeholder = lib ? COPY.findIn(lib.files.length) : COPY.find;
486
- if (q) {
487
- if (!lib) {
488
- const hits = v.docs.filter((d) => [d.title, d.path, d.initiative ? d.initiative.title : ''].join(' ').toLowerCase().includes(q));
489
- const rows = [...hits.flatMap((d) => d.links.map((l) => copyLine(inst, d, l, q))), ...inst.files.map((f) => fileLine(inst, f, q))];
490
- return rows.length ? [el('div', { role: 'list', class: 'rp-docs-group', 'data-docs-results': '' }, rows)] : [el('p', { class: 'rp-section__empty' }, COPY.noMatch(inst.q.trim()))];
491
- }
492
- const hay = (e) => { const ini = e.f.initiative ? lib.ini(e.f) : null; return [e.f.title, e.f.path, ini ? ini.short + ' ' + ini.title : ''].join(' ').toLowerCase(); };
493
- const hits = allEntries(inst).filter((e) => hay(e).includes(q));
494
- if (!hits.length) return [el('p', { class: 'rp-section__empty' }, COPY.noMatch(inst.q.trim()))];
495
- return [el('p', { class: 'rp-docs-hint', 'data-docs-results': String(hits.length) }, COPY.matches(hits.length, lib.files.length)),
496
- ...byCategory(hits).map(([k, es]) => section(inst, k, es, { q }))];
497
- }
498
- const all = v.docs.reduce((n, d) => n + d.links.length, 0);
499
- const needs = v.docs.reduce((n, d) => n + d.links.filter((l) => needsYou(inst, d, l)).length, 0);
500
- const running = !!(v.open || v.session) || inst.busy;
501
- const out = [];
502
- if (inst.filter === 'files') {
503
- if (!lib) { out.push(el('p', { class: 'rp-section__empty' + (inst.libError ? ' rp-section__empty--bad' : '') }, inst.libError || COPY.readingFiles)); return out; }
504
- out.push(el('div', { class: 'rp-docs-folds' }, byCategory(allEntries(inst)).map(([k, es]) => section(inst, k, es, { foldable: true }))));
505
- return out;
506
- }
507
- if (!v.docs.length) { out.push(el('p', { class: 'rp-section__empty' }, COPY.none)); return out; }
508
- const docs = inst.filter === 'needs'
509
- ? v.docs.map((d) => ({ ...d, links: d.links.filter((l) => needsYou(inst, d, l)) })).filter((d) => d.links.length)
510
- : v.docs;
511
- if (!docs.length) { out.push(el('p', { class: 'rp-section__empty' }, COPY.nothingNeeds)); return out; }
512
- const libFile = (d) => (lib && lib.byPath.has(d.path) ? lib.files[lib.byPath.get(d.path)] : { path: d.path, title: d.title, category: d.category, date: null });
513
- out.push(...byCategory(docs.map((d) => ({ f: libFile(d), doc: d }))).map(([k, es]) => section(inst, k, es, { page: false })));
514
- return out;
515
- }
516
-
517
- function draw(inst) {
518
- const root = inst.root;
519
- if (!inst.ws) { root.replaceChildren(empty({ text: COPY.noRepo })); inst.last = 'none'; return; }
520
- const fp = JSON.stringify([inst.loaded, inst.error, inst.view, inst.filter, inst.busy, inst.q, inst.files, inst.open, inst.adding, [...inst.pending.keys()],
521
- inst.lib ? inst.lib.key : null, inst.libError, [...inst.openCats], [...inst.full], inst.graph]);
522
- if (fp === inst.last && root.childNodes.length && root.contains(inst.body)) return;
523
- inst.last = fp;
524
- const head = header(inst);
525
- updateHead(inst);
526
- if (head.parentNode !== root || inst.body.parentNode !== root) root.replaceChildren(head, inst.body);
527
- if (!inst.loaded) { inst.body.replaceChildren(panel(inst, [el('p', { class: 'rp-section__empty' }, COPY.loading)])); return; }
528
- if (inst.error) { inst.body.replaceChildren(panel(inst, [el('p', { class: 'rp-section__empty rp-section__empty--bad', role: 'alert' }, inst.error)])); return; }
529
- inst.body.replaceChildren(panel(inst, body(inst)));
530
- }