create-pmos 0.399.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 (421) hide show
  1. package/package.json +18 -13
  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 +2 -2
  7. package/workspace/briefing-premium-board-test.js +2 -2
  8. package/workspace/briefing-premium-doc-edit-test.js +2 -8
  9. package/workspace/briefing-premium-test.js +3 -2
  10. package/workspace/briefing-premium-work-test.js +9 -4
  11. package/workspace/c3-capture-test.js +0 -17
  12. package/workspace/changelog.json +17 -0
  13. package/workspace/guide/briefing-premium.md +2 -2
  14. package/workspace/guide/home.md +20 -2
  15. package/workspace/guide/layout.md +2 -2
  16. package/workspace/guide/notes.md +2 -2
  17. package/workspace/guide/phone-companion.md +1 -1
  18. package/workspace/lib/route-modules.js +1 -9
  19. package/workspace/lib/routes-phone-day.js +18 -9
  20. package/workspace/lib/routes-slash.js +95 -0
  21. package/workspace/package-lock.json +2 -2
  22. package/workspace/package.json +1 -2
  23. package/workspace/premium-chat-goal-view-test.js +1 -1
  24. package/workspace/premium-chat-term-test.js +0 -10
  25. package/workspace/premium-menu-rows-test.js +1 -1
  26. package/workspace/premium-phone-card-test.js +2 -2
  27. package/workspace/premium-vw-doc-test.js +1 -8
  28. package/workspace/premium-work-depth-test.js +2 -3
  29. package/workspace/public/capture.html +23 -0
  30. package/workspace/public/pm/c3-base.js +47 -0
  31. package/workspace/public/pm/c3-capture.js +1 -1
  32. package/workspace/public/pm/c3-ini-ui.js +1 -1
  33. package/workspace/public/pm/c3-sheet.js +1 -1
  34. package/workspace/public/pm/c3-toast.js +1 -1
  35. package/workspace/public/pm/console3.css +3 -0
  36. package/workspace/public/pm/cozy-home.css +20 -5
  37. package/workspace/public/pm/cozy-today.css +5 -2
  38. package/workspace/public/pm/cozy-viewer.js +4 -2
  39. package/workspace/public/pm/cozy.css +9 -0
  40. package/workspace/public/pm/goal-chat.js +5 -1
  41. package/workspace/public/pm/home-app.js +47 -26
  42. package/workspace/public/pm/home-chat.js +10 -4
  43. package/workspace/public/pm/home-data.js +3 -1
  44. package/workspace/public/pm/home-dictate.js +7 -4
  45. package/workspace/public/pm/home-ini.js +12 -2
  46. package/workspace/public/pm/home-list.js +20 -7
  47. package/workspace/public/pm/home-more.js +2 -2
  48. package/workspace/public/pm/home-phone-card.js +9 -4
  49. package/workspace/public/pm/home-review.js +2 -3
  50. package/workspace/public/pm/home-today.js +10 -6
  51. package/workspace/public/pm/home-work.js +15 -8
  52. package/workspace/public/pm/note-dock.js +1 -2
  53. package/workspace/public/pm/notes-links.js +1 -2
  54. package/workspace/public/pm/notes-task.js +3 -4
  55. package/workspace/public/pm/premium-board.js +1 -1
  56. package/workspace/public/pm/premium-initiative-head.js +3 -3
  57. package/workspace/public/pm/premium-vw-doc.css +20 -2
  58. package/workspace/public/pm/premium-vw-doc.js +22 -7
  59. package/workspace/public/pm/view-notes.js +2 -2
  60. package/workspace/replaced-tests.json +435 -0
  61. package/workspace/run-tests.js +323 -28
  62. package/workspace/server.js +15 -10
  63. package/workspace/test-files.json +3 -140
  64. package/workspace/test-lists/base.json +1 -2
  65. package/workspace/test-lists/c3-desktop-light-load.json +1 -2
  66. package/workspace/test-lists/c3-initiative-boards.json +1 -2
  67. package/workspace/test-lists/c3-meeting-focus.json +2 -12
  68. package/workspace/test-lists/c3-work-agent.json +1 -2
  69. package/workspace/test-lists/calendar-tidy-up.json +1 -2
  70. package/workspace/test-lists/console3-reports.json +1 -2
  71. package/workspace/test-lists/docs-three-way-sync.json +1 -2
  72. package/workspace/test-lists/extension-capture.json +5 -0
  73. package/workspace/test-lists/jira-wbs.json +1 -2
  74. package/workspace/test-lists/legacy-cleanup-a.json +9 -0
  75. package/workspace/test-lists/meeting-material.json +1 -2
  76. package/workspace/test-lists/meeting-notes.json +2 -36
  77. package/workspace/test-lists/meeting-replay.json +1 -2
  78. package/workspace/test-lists/mm-capture.json +2 -12
  79. package/workspace/test-lists/my-work.json +2 -10
  80. package/workspace/test-lists/onboarding-firstrun.json +2 -12
  81. package/workspace/test-lists/people-directory.json +1 -2
  82. package/workspace/test-lists/run2-a.json +1 -2
  83. package/workspace/test-lists/run2-d.json +2 -19
  84. package/workspace/test-lists/run3-b.json +1 -2
  85. package/workspace/test-lists/run3-c.json +2 -12
  86. package/workspace/test-lists/run4-b.json +1 -2
  87. package/workspace/test-lists/run4-d.json +1 -5
  88. package/workspace/test-lists/run5-c.json +1 -11
  89. package/workspace/test-lists/run6.json +1 -5
  90. package/workspace/test-lists/workspace-launch-flags.json +2 -12
  91. package/workspace/test-lists/workspace-profile-detection.json +2 -10
  92. package/workspace/test-timings.json +242 -123
  93. package/workspace/c3-briefing-test.js +0 -136
  94. package/workspace/c3-core-docs-test.js +0 -170
  95. package/workspace/c3-driver-fixture.js +0 -64
  96. package/workspace/c3-driver-test.js +0 -169
  97. package/workspace/c3-foundation-test.js +0 -163
  98. package/workspace/c3-ib-items-test.js +0 -114
  99. package/workspace/c3-ib-more-test.js +0 -146
  100. package/workspace/c3-ib-triage-backlog-test.js +0 -128
  101. package/workspace/c3-ini-harness.js +0 -66
  102. package/workspace/c3-ini-life-test.js +0 -167
  103. package/workspace/c3-initiatives-test.js +0 -186
  104. package/workspace/c3-light-load-test.js +0 -112
  105. package/workspace/c3-one-home-test.js +0 -149
  106. package/workspace/c3-phone-test.js +0 -289
  107. package/workspace/c3-quiet-test.js +0 -157
  108. package/workspace/c3-report-design-real-test.js +0 -264
  109. package/workspace/c3-report-design-test.js +0 -442
  110. package/workspace/c3-report-setup-test.js +0 -192
  111. package/workspace/c3-report-structure-real-test.js +0 -248
  112. package/workspace/c3-report-structure-test.js +0 -397
  113. package/workspace/c3-reports-test.js +0 -288
  114. package/workspace/c3-scan-test.js +0 -517
  115. package/workspace/c3-sessions-panel-test.js +0 -365
  116. package/workspace/c3-settings-test.js +0 -204
  117. package/workspace/c3-updates-test.js +0 -131
  118. package/workspace/c3-work-test.js +0 -260
  119. package/workspace/cut-stub.js +0 -40
  120. package/workspace/first-paint-audit.js +0 -160
  121. package/workspace/lib/c3-full-console.js +0 -15
  122. package/workspace/lib/engine/derived/trust.js +0 -3
  123. package/workspace/lib/engine/plan-forecast.js +0 -342
  124. package/workspace/lib/engine/report-families.js +0 -175
  125. package/workspace/lib/engine/truth-table.js +0 -57
  126. package/workspace/lib/routes-c3-init.js +0 -54
  127. package/workspace/lib/routes-c3-life.js +0 -120
  128. package/workspace/lib/routes-c3-timeline.js +0 -192
  129. package/workspace/lib/routes-forecast.js +0 -86
  130. package/workspace/lib/routes-releases.js +0 -130
  131. package/workspace/lib/routes-report-facts.js +0 -85
  132. package/workspace/lib/routes-report-families.js +0 -33
  133. package/workspace/lib/routes-signals.js +0 -51
  134. package/workspace/lib/routes-timeline.js +0 -197
  135. package/workspace/public/c3.html +0 -35
  136. package/workspace/public/index.html +0 -156
  137. package/workspace/public/pm/app.js +0 -831
  138. package/workspace/public/pm/bd-board.js +0 -159
  139. package/workspace/public/pm/bd-drag.js +0 -59
  140. package/workspace/public/pm/bd-model.js +0 -152
  141. package/workspace/public/pm/bd-timeline.js +0 -233
  142. package/workspace/public/pm/bd-tree.js +0 -244
  143. package/workspace/public/pm/board-copy.js +0 -59
  144. package/workspace/public/pm/board-read.js +0 -38
  145. package/workspace/public/pm/branches-sheet.js +0 -56
  146. package/workspace/public/pm/breakdown-api.js +0 -58
  147. package/workspace/public/pm/breakdown-copy.js +0 -138
  148. package/workspace/public/pm/briefing-deck.js +0 -441
  149. package/workspace/public/pm/briefing-model.js +0 -251
  150. package/workspace/public/pm/c3-ambient.js +0 -100
  151. package/workspace/public/pm/c3-audience-link.js +0 -21
  152. package/workspace/public/pm/c3-audience.js +0 -46
  153. package/workspace/public/pm/c3-boot.js +0 -13
  154. package/workspace/public/pm/c3-breakdown.js +0 -240
  155. package/workspace/public/pm/c3-brief-data.js +0 -11
  156. package/workspace/public/pm/c3-brief-mentions.js +0 -137
  157. package/workspace/public/pm/c3-brief-needs.js +0 -288
  158. package/workspace/public/pm/c3-brief-pulse.js +0 -112
  159. package/workspace/public/pm/c3-brief-summary.js +0 -139
  160. package/workspace/public/pm/c3-brief-today.js +0 -79
  161. package/workspace/public/pm/c3-brief.js +0 -279
  162. package/workspace/public/pm/c3-cal-strategy.js +0 -529
  163. package/workspace/public/pm/c3-calendar.js +0 -965
  164. package/workspace/public/pm/c3-calpop.js +0 -111
  165. package/workspace/public/pm/c3-case.js +0 -196
  166. package/workspace/public/pm/c3-core-docs.css +0 -18
  167. package/workspace/public/pm/c3-core-docs.js +0 -236
  168. package/workspace/public/pm/c3-daypart.js +0 -176
  169. package/workspace/public/pm/c3-demo-boards.js +0 -764
  170. package/workspace/public/pm/c3-demo-brief-ix.js +0 -350
  171. package/workspace/public/pm/c3-demo-brief-page.js +0 -70
  172. package/workspace/public/pm/c3-demo-cal-ix.js +0 -74
  173. package/workspace/public/pm/c3-demo-cal2.js +0 -66
  174. package/workspace/public/pm/c3-demo-cal3.js +0 -173
  175. package/workspace/public/pm/c3-demo-cal4.js +0 -169
  176. package/workspace/public/pm/c3-demo-cal5.js +0 -52
  177. package/workspace/public/pm/c3-demo-coredocs.js +0 -221
  178. package/workspace/public/pm/c3-demo-data.js +0 -552
  179. package/workspace/public/pm/c3-demo-focus.js +0 -181
  180. package/workspace/public/pm/c3-demo-init.js +0 -430
  181. package/workspace/public/pm/c3-demo-life.js +0 -77
  182. package/workspace/public/pm/c3-demo-material.js +0 -58
  183. package/workspace/public/pm/c3-demo-misc2.js +0 -34
  184. package/workspace/public/pm/c3-demo-phone.js +0 -48
  185. package/workspace/public/pm/c3-demo-plan2.js +0 -30
  186. package/workspace/public/pm/c3-demo-rd.js +0 -432
  187. package/workspace/public/pm/c3-demo-rep-ix.js +0 -126
  188. package/workspace/public/pm/c3-demo-rep2.js +0 -130
  189. package/workspace/public/pm/c3-demo-rep3.js +0 -138
  190. package/workspace/public/pm/c3-demo-rs.js +0 -287
  191. package/workspace/public/pm/c3-demo-term.js +0 -153
  192. package/workspace/public/pm/c3-demo-time.js +0 -49
  193. package/workspace/public/pm/c3-demo-work-ix.js +0 -32
  194. package/workspace/public/pm/c3-demo.js +0 -131
  195. package/workspace/public/pm/c3-design-studio.js +0 -369
  196. package/workspace/public/pm/c3-doc-formats.js +0 -153
  197. package/workspace/public/pm/c3-doc-sheet.js +0 -1230
  198. package/workspace/public/pm/c3-dock.js +0 -206
  199. package/workspace/public/pm/c3-docs.js +0 -291
  200. package/workspace/public/pm/c3-driver-work.js +0 -110
  201. package/workspace/public/pm/c3-driver.css +0 -18
  202. package/workspace/public/pm/c3-driver.js +0 -298
  203. package/workspace/public/pm/c3-focus.css +0 -304
  204. package/workspace/public/pm/c3-focus.js +0 -983
  205. package/workspace/public/pm/c3-ib-docs.js +0 -92
  206. package/workspace/public/pm/c3-ib-initiatives.js +0 -201
  207. package/workspace/public/pm/c3-ib-items.js +0 -210
  208. package/workspace/public/pm/c3-ib-releases.js +0 -48
  209. package/workspace/public/pm/c3-ib-sprints.js +0 -201
  210. package/workspace/public/pm/c3-ib-triage.js +0 -177
  211. package/workspace/public/pm/c3-ii-tabs.js +0 -252
  212. package/workspace/public/pm/c3-ini-life.css +0 -34
  213. package/workspace/public/pm/c3-ini-life.js +0 -379
  214. package/workspace/public/pm/c3-ini-records.js +0 -197
  215. package/workspace/public/pm/c3-ini-timeline.js +0 -278
  216. package/workspace/public/pm/c3-ini-work.js +0 -139
  217. package/workspace/public/pm/c3-init-extras.js +0 -170
  218. package/workspace/public/pm/c3-initiatives.js +0 -852
  219. package/workspace/public/pm/c3-lifecycle-panels.js +0 -479
  220. package/workspace/public/pm/c3-look.js +0 -27
  221. package/workspace/public/pm/c3-material.css +0 -22
  222. package/workspace/public/pm/c3-material.js +0 -321
  223. package/workspace/public/pm/c3-md.js +0 -3
  224. package/workspace/public/pm/c3-misc-panels.js +0 -89
  225. package/workspace/public/pm/c3-new-session.js +0 -110
  226. package/workspace/public/pm/c3-notes.js +0 -751
  227. package/workspace/public/pm/c3-phone-boot.js +0 -47
  228. package/workspace/public/pm/c3-phone-detail.js +0 -97
  229. package/workspace/public/pm/c3-phone-model.js +0 -3
  230. package/workspace/public/pm/c3-phone.css +0 -66
  231. package/workspace/public/pm/c3-phone.js +0 -444
  232. package/workspace/public/pm/c3-plan-panels.js +0 -163
  233. package/workspace/public/pm/c3-plan.js +0 -193
  234. package/workspace/public/pm/c3-quiet.css +0 -113
  235. package/workspace/public/pm/c3-quiet.js +0 -177
  236. package/workspace/public/pm/c3-replay.css +0 -133
  237. package/workspace/public/pm/c3-replay.js +0 -429
  238. package/workspace/public/pm/c3-report-deck.css +0 -163
  239. package/workspace/public/pm/c3-report-deck.js +0 -598
  240. package/workspace/public/pm/c3-report-frame.css +0 -20
  241. package/workspace/public/pm/c3-report-print.css +0 -20
  242. package/workspace/public/pm/c3-report-setup.css +0 -67
  243. package/workspace/public/pm/c3-report-setup.js +0 -298
  244. package/workspace/public/pm/c3-report-store.js +0 -244
  245. package/workspace/public/pm/c3-report-structure.css +0 -44
  246. package/workspace/public/pm/c3-report-structure.js +0 -473
  247. package/workspace/public/pm/c3-reports.css +0 -68
  248. package/workspace/public/pm/c3-reports.js +0 -377
  249. package/workspace/public/pm/c3-roadmap.js +0 -249
  250. package/workspace/public/pm/c3-scan-api.js +0 -167
  251. package/workspace/public/pm/c3-scan-next.js +0 -248
  252. package/workspace/public/pm/c3-scan-setup.js +0 -313
  253. package/workspace/public/pm/c3-scan-words.js +0 -41
  254. package/workspace/public/pm/c3-scan.css +0 -74
  255. package/workspace/public/pm/c3-scan.js +0 -93
  256. package/workspace/public/pm/c3-session-chat.js +0 -103
  257. package/workspace/public/pm/c3-session-conv.js +0 -165
  258. package/workspace/public/pm/c3-session-term.js +0 -216
  259. package/workspace/public/pm/c3-settings.css +0 -85
  260. package/workspace/public/pm/c3-settings.js +0 -1045
  261. package/workspace/public/pm/c3-shell.js +0 -628
  262. package/workspace/public/pm/c3-signals.js +0 -196
  263. package/workspace/public/pm/c3-strategy-panels.js +0 -45
  264. package/workspace/public/pm/c3-swipe.js +0 -230
  265. package/workspace/public/pm/c3-terminal-data.js +0 -48
  266. package/workspace/public/pm/c3-terminal-edge.js +0 -91
  267. package/workspace/public/pm/c3-terminal-icons.js +0 -40
  268. package/workspace/public/pm/c3-terminal-results.js +0 -141
  269. package/workspace/public/pm/c3-terminal.js +0 -52
  270. package/workspace/public/pm/c3-tickets.js +0 -163
  271. package/workspace/public/pm/c3-timeline.js +0 -201
  272. package/workspace/public/pm/calendar-views.js +0 -1049
  273. package/workspace/public/pm/console3-lift.md +0 -220
  274. package/workspace/public/pm/cozy-home.js +0 -172
  275. package/workspace/public/pm/cozy-initiative.css +0 -138
  276. package/workspace/public/pm/cycle-review.js +0 -125
  277. package/workspace/public/pm/data.js +0 -1577
  278. package/workspace/public/pm/dest-board.js +0 -444
  279. package/workspace/public/pm/dest-docs.js +0 -530
  280. package/workspace/public/pm/dest-initiatives.js +0 -162
  281. package/workspace/public/pm/dest-mywork.js +0 -307
  282. package/workspace/public/pm/dest-notes.js +0 -537
  283. package/workspace/public/pm/dest-people.js +0 -449
  284. package/workspace/public/pm/dest-reports.js +0 -383
  285. package/workspace/public/pm/dest-settings.js +0 -601
  286. package/workspace/public/pm/dest-today.js +0 -267
  287. package/workspace/public/pm/display-word.js +0 -56
  288. package/workspace/public/pm/doc-editor.js +0 -473
  289. package/workspace/public/pm/doc-graph.js +0 -272
  290. package/workspace/public/pm/doc-health-panel.js +0 -110
  291. package/workspace/public/pm/doc-rail.js +0 -167
  292. package/workspace/public/pm/doc-remote.js +0 -180
  293. package/workspace/public/pm/dock-sessions.js +0 -472
  294. package/workspace/public/pm/dock.js +0 -216
  295. package/workspace/public/pm/fixture.js +0 -821
  296. package/workspace/public/pm/flag-picker.js +0 -104
  297. package/workspace/public/pm/frame-copy.js +0 -278
  298. package/workspace/public/pm/freshness-line.js +0 -149
  299. package/workspace/public/pm/handoff-box.js +0 -82
  300. package/workspace/public/pm/initiative-list.js +0 -235
  301. package/workspace/public/pm/initiative-sheet.js +0 -331
  302. package/workspace/public/pm/initiatives-api.js +0 -95
  303. package/workspace/public/pm/initiatives-copy.js +0 -287
  304. package/workspace/public/pm/initiatives-timeline-copy.js +0 -59
  305. package/workspace/public/pm/initiatives-timeline.js +0 -410
  306. package/workspace/public/pm/initiatives-ui.js +0 -291
  307. package/workspace/public/pm/item-sheet.js +0 -268
  308. package/workspace/public/pm/keep-card.js +0 -204
  309. package/workspace/public/pm/lifecycle-lens-model.js +0 -246
  310. package/workspace/public/pm/lifecycle-lens.js +0 -276
  311. package/workspace/public/pm/lifecycle.js +0 -111
  312. package/workspace/public/pm/mobile.css +0 -366
  313. package/workspace/public/pm/mobile.js +0 -581
  314. package/workspace/public/pm/modes-live.js +0 -453
  315. package/workspace/public/pm/modes.js +0 -147
  316. package/workspace/public/pm/my-work-card.js +0 -51
  317. package/workspace/public/pm/my-work-data.js +0 -36
  318. package/workspace/public/pm/new-initiative-sheet.js +0 -169
  319. package/workspace/public/pm/next-step-ui.js +0 -190
  320. package/workspace/public/pm/outbox-panel.js +0 -125
  321. package/workspace/public/pm/palette-copy.js +0 -55
  322. package/workspace/public/pm/palette.js +0 -343
  323. package/workspace/public/pm/panel-breakdown.js +0 -702
  324. package/workspace/public/pm/panel-cockpit.js +0 -425
  325. package/workspace/public/pm/panel-detail.js +0 -1513
  326. package/workspace/public/pm/panel-initiatives.js +0 -929
  327. package/workspace/public/pm/panel-newsess.js +0 -709
  328. package/workspace/public/pm/panel-repos.js +0 -741
  329. package/workspace/public/pm/panel-tabs.js +0 -1506
  330. package/workspace/public/pm/panel-trees.js +0 -204
  331. package/workspace/public/pm/people-link.js +0 -106
  332. package/workspace/public/pm/phone-deck.js +0 -167
  333. package/workspace/public/pm/pm-work-view.js +0 -1533
  334. package/workspace/public/pm/portfolio-report.js +0 -61
  335. package/workspace/public/pm/premium-acts.js +0 -280
  336. package/workspace/public/pm/premium-brief.js +0 -111
  337. package/workspace/public/pm/premium-chat.js +0 -22
  338. package/workspace/public/pm/premium-doc-sheet.js +0 -312
  339. package/workspace/public/pm/premium-initiative.js +0 -324
  340. package/workspace/public/pm/premium-insights.css +0 -228
  341. package/workspace/public/pm/premium-metric-tiles.js +0 -68
  342. package/workspace/public/pm/premium-report-brief.js +0 -132
  343. package/workspace/public/pm/premium-vw-rec.js +0 -67
  344. package/workspace/public/pm/premium-wide.css +0 -30
  345. package/workspace/public/pm/print.css +0 -44
  346. package/workspace/public/pm/provider-cards.js +0 -136
  347. package/workspace/public/pm/registry.js +0 -203
  348. package/workspace/public/pm/release-card.js +0 -110
  349. package/workspace/public/pm/releases-view.js +0 -248
  350. package/workspace/public/pm/report-families-view.js +0 -505
  351. package/workspace/public/pm/report-slides.js +0 -438
  352. package/workspace/public/pm/report-tab.js +0 -33
  353. package/workspace/public/pm/report-view.js +0 -337
  354. package/workspace/public/pm/reports-copy.js +0 -134
  355. package/workspace/public/pm/roadmap.js +0 -294
  356. package/workspace/public/pm/run-card.js +0 -260
  357. package/workspace/public/pm/sessions-panel.js +0 -219
  358. package/workspace/public/pm/sheet-jira.js +0 -353
  359. package/workspace/public/pm/shell-bell.js +0 -163
  360. package/workspace/public/pm/shell-model.js +0 -83
  361. package/workspace/public/pm/shell-phone.js +0 -124
  362. package/workspace/public/pm/shell-readaloud.js +0 -53
  363. package/workspace/public/pm/shell-recording.js +0 -274
  364. package/workspace/public/pm/shell-ticker.js +0 -90
  365. package/workspace/public/pm/sig-watch.js +0 -41
  366. package/workspace/public/pm/slide-confirm.js +0 -163
  367. package/workspace/public/pm/slides-copy.js +0 -52
  368. package/workspace/public/pm/status-banner.js +0 -95
  369. package/workspace/public/pm/tab-doc.js +0 -859
  370. package/workspace/public/pm/tab-gone.js +0 -21
  371. package/workspace/public/pm/tab-term.js +0 -1210
  372. package/workspace/public/pm/tab-web.js +0 -90
  373. package/workspace/public/pm/timeline-copy.js +0 -48
  374. package/workspace/public/pm/timeline-forecast-view.js +0 -164
  375. package/workspace/public/pm/today-agenda.js +0 -331
  376. package/workspace/public/pm/today-cards.js +0 -244
  377. package/workspace/public/pm/today-copy.js +0 -506
  378. package/workspace/public/pm/today-day.js +0 -1371
  379. package/workspace/public/pm/today-goals.js +0 -297
  380. package/workspace/public/pm/today-jobs.js +0 -84
  381. package/workspace/public/pm/today-mentions.js +0 -50
  382. package/workspace/public/pm/topbar.js +0 -202
  383. package/workspace/public/pm/triage-card.js +0 -60
  384. package/workspace/public/pm/undo-hold.js +0 -103
  385. package/workspace/public/pm/view-addrepo.js +0 -208
  386. package/workspace/public/pm/view-files.js +0 -197
  387. package/workspace/public/pm/view-livenotes.js +0 -399
  388. package/workspace/public/pm/view-today.js +0 -13
  389. package/workspace/public/pm/view-validate.js +0 -171
  390. package/workspace/public/pm/welcome.js +0 -391
  391. package/workspace/public/pm/work-place.js +0 -68
  392. package/workspace/public/pm/xlsx-read.js +0 -117
  393. package/workspace/public/welcome.html +0 -22
  394. package/workspace/test-lists/browser-suites-green.json +0 -5
  395. package/workspace/test-lists/c3-core-docs.json +0 -9
  396. package/workspace/test-lists/c3-doc-sheet-rich.json +0 -6
  397. package/workspace/test-lists/c3-doc-sheet-size.json +0 -6
  398. package/workspace/test-lists/c3-doc-sheet-v2.json +0 -6
  399. package/workspace/test-lists/c3-ib-items.json +0 -9
  400. package/workspace/test-lists/c3-ib-more.json +0 -9
  401. package/workspace/test-lists/c3-ib-triage-backlog.json +0 -9
  402. package/workspace/test-lists/c3-ini-life.json +0 -9
  403. package/workspace/test-lists/c3-meeting-board.json +0 -5
  404. package/workspace/test-lists/c3-meeting-card.json +0 -5
  405. package/workspace/test-lists/c3-notes-place.json +0 -5
  406. package/workspace/test-lists/c3-notes-series.json +0 -5
  407. package/workspace/test-lists/calendar-time-page.json +0 -5
  408. package/workspace/test-lists/calpop.json +0 -4
  409. package/workspace/test-lists/console3-briefing.json +0 -9
  410. package/workspace/test-lists/console3-foundation.json +0 -9
  411. package/workspace/test-lists/console3-work-page.json +0 -9
  412. package/workspace/test-lists/premium-brief-parity.json +0 -9
  413. package/workspace/test-lists/report-design-studio-ui.json +0 -5
  414. package/workspace/test-lists/report-structure-ui.json +0 -11
  415. package/workspace/test-lists/report-workspace-ui.json +0 -5
  416. package/workspace/test-lists/run3-a.json +0 -5
  417. package/workspace/test-lists/run3-d.json +0 -6
  418. package/workspace/test-lists/run4-c.json +0 -13
  419. package/workspace/test-lists/today-goals-jobs-ui.json +0 -5
  420. package/workspace/test-lists/today-mentions-cards.json +0 -5
  421. 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
- }