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,131 +0,0 @@
1
- #!/usr/bin/env node
2
- 'use strict';
3
- /* c3-updates-test.js — console3 Settings › Updates runs the app update itself, and the kit Update sends the checked version
4
- * (initiative c3-app-update).
5
- *
6
- * The page used to say "run it from the main app" and link to /, and its kit Update posted no version, which the server
7
- * refuses with "Check for updates first". Against a real server; the kit routes and /api/sessions are stood in by the
8
- * page's route table, so nothing is installed and npm is never asked. Hooks only (data-c3set-*).
9
- */
10
- const path = require('path');
11
- const { spawn } = require('child_process');
12
- const { findBrowser } = require('./lib/find-browser');
13
- const T = require('./test-run').configure({ name: 'c3-updates' });
14
-
15
- const BASE = T.BASE;
16
- const results = [];
17
- const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + extra : ''}`); };
18
- let srv = null; let browser = null;
19
- const finish = async (code) => {
20
- if (browser) await browser.close().catch(() => {});
21
- if (srv) { try { srv.kill('SIGKILL'); } catch { /* gone */ } }
22
- T.killTmux();
23
- const bad = results.filter((x) => !x.cond).length;
24
- console.log(`\n${results.length - bad}/${results.length} c3-updates assertions passed`);
25
- process.exit(code !== undefined ? code : (bad ? 1 : 0));
26
- };
27
- process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
28
-
29
- async function waitFor(page, fn, arg, ms = 8000) {
30
- try { await page.waitForFunction(fn, arg, { timeout: ms }); return true; } catch { return false; }
31
- }
32
-
33
- (async () => {
34
- const exe = findBrowser();
35
- if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the c3-updates suite cannot run'); return finish(1); }
36
- let chromium;
37
- try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed — the c3-updates suite cannot run'); return finish(1); }
38
-
39
- srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
40
- await T.waitForServer(BASE);
41
- browser = await chromium.launch({ executablePath: exe });
42
- const ctx = await browser.newContext({ viewport: { width: 1440, height: 1000 } });
43
- const page = await ctx.newPage();
44
- const errors = [];
45
- page.on('pageerror', (e) => errors.push(String(e && e.message || e)));
46
-
47
- // The stand-ins: an installed app 0.1.0 and a kit 0.1.0 in every workspace, both behind 0.2.0.
48
- const S = { app: '0.1.0', kit: '0.1.0', checkout: false, upgrade: { ok: true }, down: 0 };
49
- const calls = [];
50
- const body = (ws) => ({ ok: true, ws, app: { version: S.app, fromCheckout: S.checkout }, kit: { present: true, version: S.kit }, source: { kind: 'npm' } });
51
- const wsOf = (route) => { try { return JSON.parse(route.request().postData() || '{}'); } catch { return {}; } };
52
- await page.route((u) => u.pathname === '/api/kit/status', (route) => route.fulfill({ json: { ...body(new URL(route.request().url()).searchParams.get('ws')), busy: null } }));
53
- await page.route((u) => u.pathname === '/api/kit/check', (route) => { const b = wsOf(route); calls.push(['check', b]); route.fulfill({ json: { ...body(b.ws), latest: '0.2.0', appBehind: S.app !== '0.2.0', kitBehind: S.kit !== '0.2.0' } }); });
54
- await page.route((u) => u.pathname === '/api/kit/update', (route) => {
55
- const b = wsOf(route); calls.push(['kit', b]);
56
- if (b.version !== '0.2.0') return route.fulfill({ status: 502, json: { ok: false, error: 'Check for updates first' } });
57
- route.fulfill({ json: { ...body(b.ws), kit: { present: true, version: '0.2.0' }, output: 'kit updated' } });
58
- });
59
- await page.route((u) => u.pathname === '/api/kit/upgrade-app', (route) => {
60
- const b = wsOf(route); calls.push(['app', b]);
61
- if (!S.upgrade.ok) return route.fulfill({ status: 403, json: S.upgrade });
62
- S.down = 2; // the server is away for two polls, then answers on the new version
63
- route.fulfill({ json: { ok: true, ws: b.ws, from: '0.1.0', to: b.version, log: '/tmp/app-update.log' } });
64
- });
65
- let reloaded = false;
66
- await page.route((u) => u.pathname === '/api/sessions', async (route) => {
67
- if (!calls.some((c) => c[0] === 'app' && S.upgrade.ok)) return route.continue();
68
- if (S.down > 0) { S.down -= 1; return route.abort('connectionrefused'); }
69
- S.app = '0.2.0';
70
- const r = await route.fetch(); const j = await r.json().catch(() => ({}));
71
- return route.fulfill({ json: { ...j, version: S.app } });
72
- });
73
- page.on('framenavigated', (f) => { if (f === page.mainFrame() && calls.some((c) => c[0] === 'app')) reloaded = true; });
74
- const named = (kind) => calls.filter((c) => c[0] === kind);
75
-
76
- const open = async () => {
77
- await page.goto(BASE + '/console.html?tab=settings');
78
- await waitFor(page, () => !!document.querySelector('[data-c3set-nav] [data-c3set-sec="updates"]'));
79
- await page.click('[data-c3set-nav] [data-c3set-sec="updates"]');
80
- return waitFor(page, () => !!document.querySelector('[data-c3set-section="updates"] [data-c3set-check]:not([disabled])'));
81
- };
82
-
83
- /* ── A: before a check, nothing is offered and npm is not asked ── */
84
- ok('A1 Updates opens with Check now', await open());
85
- ok('A2 no app Update and no Open the main app before a check', await page.evaluate(() => !document.querySelector('[data-c3set-app-update]') && !/Open the main app/.test(document.querySelector('[data-c3set-section="updates"]').textContent)));
86
- ok('A3 nothing was asked of npm before the press', calls.length === 0, JSON.stringify(calls));
87
-
88
- /* ── B: the kit Update sends the version the check found ── */
89
- await page.click('[data-c3set-check]');
90
- ok('B1 after the check, the app row offers Update to 0.2.0', await waitFor(page, () => { const b = document.querySelector('[data-c3set-app-update]'); return !!b && /Update to 0\.2\.0/.test(b.textContent); }));
91
- ok('B2 the page no longer sends you to the main app', await page.evaluate(() => !/Open the main app/.test(document.querySelector('[data-c3set-section="updates"]').textContent)));
92
- ok('B3 each workspace row offers a kit Update', await waitFor(page, () => !!document.querySelector('[data-c3set-kit-update]')));
93
- const kitWs = await page.getAttribute('[data-c3set-kit-update]', 'data-c3set-kit-update');
94
- await page.click(`[data-c3set-kit-update="${kitWs}"]`);
95
- ok('B4 kit Update posts that workspace and the checked version', await waitFor(page, () => !!document.querySelector('[data-c3-toast]') && /Updated the kit/.test(document.querySelector('[data-c3-toast]').textContent)) && named('kit').length === 1 && named('kit')[0][1].ws === kitWs && named('kit')[0][1].version === '0.2.0', JSON.stringify(named('kit')));
96
- ok('B5 that row no longer offers Update', await waitFor(page, (w) => !document.querySelector(`[data-c3set-kit-update="${w}"]`), kitWs));
97
-
98
- /* ── C: the app update asks first, then runs, waits for the restart and reloads ── */
99
- await page.click('[data-c3set-app-update]');
100
- ok('C1 it asks first, and says PMOS stops while the new version installs', await waitFor(page, () => { const c = document.querySelector('[data-c3set-app-confirm]'); return !!c && /stops/.test(c.textContent) && !!document.querySelector('[data-c3set-app-go]'); }));
101
- ok('C2 nothing runs before the answer', named('app').length === 0);
102
- await page.click('[data-c3set-app-cancel]');
103
- ok('C3 Cancel puts the Update button back', await waitFor(page, () => !document.querySelector('[data-c3set-app-confirm]') && !!document.querySelector('[data-c3set-app-update]')) && named('app').length === 0);
104
- await page.click('[data-c3set-app-update]');
105
- await page.click('[data-c3set-app-go]');
106
- for (let i = 0; i < 40 && !named('app').length; i++) await new Promise((r) => setTimeout(r, 100));
107
- ok('C4 the update posts the checked version', named('app').length === 1 && named('app')[0][1].version === '0.2.0', JSON.stringify(named('app')));
108
- ok('C5 the row says it is updating and that the page reloads', await waitFor(page, () => { const b = document.querySelector('[data-c3set-app-busy]'); return !!b && /reloads/.test(b.textContent); }, null, 3000) || reloaded);
109
- for (let i = 0; i < 200 && !reloaded; i++) await new Promise((r) => setTimeout(r, 100));
110
- ok('C6 the page reloads by itself when the new version answers', reloaded);
111
-
112
- /* ── D: a refusal is shown on the row ── */
113
- S.app = '0.1.0'; S.upgrade = { ok: false, error: 'This page signed in with a token that changes when the workspace restarts' };
114
- calls.length = 0; reloaded = false;
115
- await open();
116
- await page.click('[data-c3set-check]');
117
- await waitFor(page, () => !!document.querySelector('[data-c3set-app-update]'));
118
- await page.click('[data-c3set-app-update]');
119
- await page.click('[data-c3set-app-go]');
120
- ok('D1 a refused update says why, on the app row', await waitFor(page, () => { const r = document.querySelector('[data-c3set-row="upd.app"]'); return !!r && /token that changes/.test(r.textContent); }));
121
- ok('D2 a refused update does not reload the page', !reloaded);
122
-
123
- /* ── E: a checkout updates with git ── */
124
- S.checkout = true; S.upgrade = { ok: true }; calls.length = 0;
125
- await open();
126
- await page.click('[data-c3set-check]');
127
- ok('E1 a checkout says git pull and offers no app Update', await waitFor(page, () => /git pull/.test(document.querySelector('[data-c3set-row="upd.app"]').textContent)) && !(await page.$('[data-c3set-app-update]')));
128
-
129
- ok('F1 the page throws no error', errors.length === 0, errors.slice(0, 3).join(' | '));
130
- finish();
131
- })();
@@ -1,260 +0,0 @@
1
- #!/usr/bin/env node
2
- 'use strict';
3
- /* c3-work-test.js — the console3 Work page (initiative console3-work-page; planning/prd/console3-work-page-prd.md R1 to R10, rubric
4
- * dimensions 1 to 5 and 7). Loads /console.html?demo=1 at 1440 wide and then at 390 wide. Demo mode answers every /api call in the page,
5
- * so nothing reaches the server and the fixture (public/pm/c3-demo-data.js pmItems) is placed by the same rule the server uses.
6
- *
7
- * views seven views in order (Inbox, Today, Upcoming, Waiting, Someday, Review, Done), each with its count; no Triage, Week, Later
8
- * lens; the right column is Focus on every view, with no Flow today (console3-deck-flow-fixes); no Jobs card, Group by job, ring or plan deck (console3-work-parity)
9
- * one home none of the decisions and approvals whose home is Briefing · Needs you is a Work row or Work text
10
- * Focus Today opens with up to three suggestions, each with the reason; Accept pins, Not today hides, Edit title saves, Unpin
11
- * offline an item done outside PMOS shows "outside PMOS" and the person; Looks done? has Confirm (with Undo); Not yet moves it
12
- * to a later day; Done takes a one-line outcome
13
- * Upcoming the next 7 days by day, then Later; a deferred item says "Not before …"
14
- * Review one at a time with progress: Keep, Change (the edit fields), Drop, then "Review done"
15
- * Done the last 30 days by day (Today, Yesterday, …) with the outcome and how it closed; the badge counts today; Reopen puts an
16
- * item back in its view, with Undo, also an item that was done before the page opened (c3-work-agent amendment 18)
17
- * capture the preview chip names the view the line lands in, by the server's rule, and never Triage
18
- * phone at 390 wide every view draws with no horizontal scroll
19
- * The page must raise no script error. Every wait polls the page; no fixed sleep stands in for a state.
20
- */
21
- const path = require('path');
22
- const { spawn } = require('child_process');
23
- const { findBrowser } = require('./lib/find-browser');
24
- const T = require('./test-run').configure({ name: 'c3-work' });
25
-
26
- const BASE = T.BASE;
27
- const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
28
- const until = async (fn, ms = 10000, step = 120) => {
29
- const t0 = Date.now();
30
- for (;;) { const v = await fn(); if (v) return v; if (Date.now() - t0 > ms) return v; await sleep(step); }
31
- };
32
- const results = [];
33
- const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + extra : ''}`); };
34
- let srv = null; let browser = null;
35
- const finish = async (code) => {
36
- if (browser) await browser.close().catch(() => {});
37
- if (srv) { try { srv.kill('SIGKILL'); } catch { /* gone */ } }
38
- T.killTmux();
39
- const bad = results.filter((x) => !x.cond).length;
40
- console.log(`\n${results.length - bad}/${results.length} c3-work assertions passed`);
41
- process.exit(code !== undefined ? code : (bad ? 1 : 0));
42
- };
43
- process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
44
-
45
- const VIEWS = ['inbox', 'today', 'upcoming', 'waiting', 'someday', 'review', 'done'];
46
- const LABELS = ['Inbox', 'Today', 'Upcoming', 'Waiting', 'Someday', 'Review', 'Done'];
47
- /* The decisions and approvals the demo used to list in Work (PRD R9): their home is Briefing · Needs you. */
48
- const DECISIONS = ['Approve pricing-page copy before handoff', 'Confirm the growth assumption in the Q4 forecast', 'Say yes to Sam: ship the logging change',
49
- 'Self-serve onboarding: continue or park?', 'Pick interview slots with 3 customers', 'Assign owners to 2 unowned workshop actions',
50
- 'Confirm the 1 Oct numbers before the 10:30 update', 'Accept the 15 Oct interview invite', 'Review the 13:00 interview guide',
51
- 'Cut Checkout v2 to 3 core flows to hold 24 Oct?'];
52
- /* The agent's drafts moved from Briefing to the Review view of Work (console3-work-parity R10): they are not Work items, but they show in Review. */
53
- const DRAFTS = ['Reply to Marta: SSO 14 Oct, SCIM in Nov', 'Weekly status for leadership', 'Prep note for 10:30 Checkout sync'];
54
- const W = '[data-pm-work]';
55
-
56
- (async () => {
57
- const exe = findBrowser();
58
- if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the c3-work suite cannot run'); return finish(1); }
59
- let chromium;
60
- try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed — the c3-work suite cannot run'); return finish(1); }
61
-
62
- srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
63
- await T.waitForServer(BASE);
64
- browser = await chromium.launch({ executablePath: exe });
65
- require('./lib/c3-full-console').fullConsole(browser); // the desktop layout at phone width (c3-phone-companion)
66
- const ctx = await browser.newContext({ viewport: { width: 1440, height: 1000 } });
67
- const page = await ctx.newPage();
68
- const errors = [];
69
- page.on('pageerror', (e) => errors.push(String((e && e.message) || e)));
70
- page.on('dialog', (d) => d.dismiss().catch(() => {}));
71
- const st = (f, a) => page.evaluate(f, a);
72
- const click = (sel) => st((s) => { const b = document.querySelector(s); if (b) b.click(); return !!b; }, sel);
73
- const view = async (id) => { await click(W + ' [data-lens="' + id + '"]'); return until(() => st(([w, v]) => { const h = document.querySelector(w + ' [data-pm-lens-head]'); return !!h && h.getAttribute('data-pm-lens-head') === v; }, [W, id]), 8000); };
74
- const titles = () => st((w) => [...document.querySelectorAll(w + ' [data-pm-item] [data-pm-title]')].map((n) => n.textContent), W);
75
- const counts = () => st((w) => Object.fromEntries([...document.querySelectorAll(w + ' [data-pm-count]')].map((n) => [n.getAttribute('data-pm-count'), Number(n.textContent)])), W);
76
- const rowSel = (title) => st(([w, t]) => { const n = [...document.querySelectorAll(w + ' [data-pm-item]')].find((r) => (r.querySelector('[data-pm-title]') || {}).textContent === t); return n ? '[data-pm-item="' + n.getAttribute('data-pm-item') + '"]' : null; }, [W, title]);
77
- const open = async (title) => {
78
- const s = await rowSel(title); if (!s) return null;
79
- await click(W + ' ' + s + ' [data-pm-title]');
80
- return (await until(() => st((q) => { const c = document.querySelector(q + ' [data-pm-case]'); return !!c && !!c.closest('.xp.open'); }, W + ' ' + s), 4000)) ? s : null;
81
- };
82
- const toastUndo = () => until(() => click('[data-c3-toast-action]'), 4000);
83
-
84
- await page.goto(BASE + '/console.html?demo=1&tab=work');
85
- const up = await until(() => st((w) => !!document.querySelector('[data-c3-demo="1"]') && !!document.querySelector(w + ' [data-pm-lenses]') && !!document.querySelector(w + ' [data-pm-lens-head]'), W), 45000, 250);
86
- if (!up) { await click('[data-c3-tab="work"]'); }
87
- const ready = up || await until(() => st((w) => !!document.querySelector(w + ' [data-pm-lens-head]'), W), 20000, 250);
88
- ok('the console3 page comes up in demo mode with the Work tab', !!ready);
89
- if (!ready) return finish(1);
90
-
91
- /* the six views and their counts (R1) */
92
- // only the bar on screen: a redraw puts a new bar in the header, hidden there (.calbar.qt-moved), until the quiet layout moves it beside Add work
93
- const readBar = () => st((w) => [...document.querySelectorAll(w + ' [data-pm-lenses] [data-lens]')].filter((b) => b.offsetParent !== null).map((b) => [b.getAttribute('data-lens'), b.textContent.replace(/\d+$/, '').trim()]), W);
94
- await until(async () => (await readBar()).length === VIEWS.length, 10000, 100);
95
- const bar = await readBar();
96
- ok('the bar has the seven views in order: Inbox, Today, Upcoming, Waiting, Someday, Review, Done', JSON.stringify(bar.map((b) => b[0])) === JSON.stringify(VIEWS) && JSON.stringify(bar.map((b) => b[1])) === JSON.stringify(LABELS), JSON.stringify(bar));
97
- const c0 = await counts();
98
- ok('each view shows its count (3, 5, 6, 2, 2, 3; Done counts today: 0)', JSON.stringify(VIEWS.map((v) => c0[v])) === '[3,5,6,2,2,3,0]', JSON.stringify(c0));
99
- ok('the page opens on Today', await st((w) => (document.querySelector(w + ' [data-pm-lens-head]') || {}).getAttribute && document.querySelector(w + ' [data-pm-lens-head]').getAttribute('data-pm-lens-head') === 'today', W));
100
- const text0 = await st((w) => document.querySelector(w).textContent, W);
101
- ok('no Triage, Week or Later view', !(await st((w) => !!document.querySelector(w + ' [data-lens="triage"], ' + w + ' [data-lens="week"], ' + w + ' [data-lens="later"]'), W)));
102
- ok('no Flow today card (the PM removed it)', !(await st((w) => !!document.querySelector(w + ' [data-pm-flow]'), W)) && !/Flow today|Your part is the commit/.test(text0));
103
- ok('no Jobs card, Group by job, Today ring or plan deck', !(await st((w) => !!document.querySelector(w + ' [data-pm-jobs], ' + w + ' [data-pm-group], ' + w + ' [data-c3pg="plan"], ' + w + ' .lh svg[role="img"]'), W)) && !/Jobs to be done|Group by job/.test(text0));
104
- ok('Focus leads the right column', await st((w) => { const r = document.querySelector(w + ' .bcol.r'); return !!r && !!r.firstElementChild && r.firstElementChild.matches('[data-pm-focus]'); }, W));
105
-
106
- /* one home (R9): no decision is a Work row in any view, nor Work text */
107
- const seen = new Set(); let allText = '';
108
- for (const v of VIEWS) { await view(v); (await titles()).forEach((t) => seen.add(t)); allText += '\n' + await st((w) => document.querySelector(w).textContent, W); }
109
- const leaked = DECISIONS.filter((t) => seen.has(t) || allText.includes(t));
110
- ok('no decision or approval whose home is Briefing · Needs you shows on the Work page', leaked.length === 0, leaked.join(' | '));
111
- ok('the Work page lists the PM\'s own work in every view', seen.size >= 14, String(seen.size));
112
-
113
- /* Today and Focus (R4) */
114
- await view('today');
115
- const today0 = await titles();
116
- ok('Today lists Overdue, then Due today, then Flagged', today0[0] === 'Call Priya about the Q4 budget variance' && today0[1] === 'Send the revised Checkout v2 timeline to Dara' && today0[4] === 'Prep the one-pager for the Search relevance review', JSON.stringify(today0));
117
- const sects = await st((w) => [...document.querySelectorAll(w + ' [data-pm-sect]')].map((n) => [n.getAttribute('data-pm-sect'), n.querySelectorAll('[data-pm-item]').length, !!n.querySelector('[data-pm-legend]')]), W);
118
- ok('…each in its own card with a count, the legend on the first only', JSON.stringify(sects) === '[["overdue",2,true],["due",2,false],["flagged",1,false]]', JSON.stringify(sects));
119
- const chipsTxt = await st((w) => ({ over: (document.querySelector(w + ' [data-pm-due="overdue"]') || {}).textContent, today: (document.querySelector(w + ' [data-pm-due="today"]') || {}).textContent, iso: /\d{4}-\d{2}-\d{2}/.test(document.querySelector(w + ' [data-pm-list="today"]').textContent), done: document.querySelectorAll(w + ' [data-pm-list="today"] [data-pm-done]').length }), W);
120
- ok('rows read "N days overdue", "Due today", no ISO dates, and each has a Done button', /overdue/.test(chipsTxt.over) && chipsTxt.today === 'Due today' && !chipsTxt.iso && chipsTxt.done === 5, JSON.stringify(chipsTxt));
121
- const foc = await st((w) => [...document.querySelectorAll(w + ' [data-pm-focus] [data-pm-focus-card]')].map((c) => ({ key: c.getAttribute('data-pm-focus-card'), state: c.getAttribute('data-pm-focus-state'), why: (c.querySelector('.wkfc-why') || {}).textContent || '' })), W);
122
- ok('Today opens with Focus: three suggested jobs, each with the reason', foc.length === 3 && foc.every((f) => f.state === 'suggested' && /^Why: \S/.test(f.why)), JSON.stringify(foc));
123
- ok('Focus is a list of rows in the right column', await st((w) => !!document.querySelector(w + ' .bcol.r [data-pm-focus] li.nrow[data-pm-focus-card]') && !!document.querySelector(w + ' [data-pm-focus-job]'), W));
124
- const [k1, k2, k3] = foc.map((f) => f.key);
125
- await click(W + ' [data-pm-focus-accept="' + k1 + '"]');
126
- ok('Accept pins the job to Today', !!await until(() => st(([w, k]) => { const c = document.querySelector(w + ' [data-pm-focus-card="' + k + '"]'); return c && c.getAttribute('data-pm-focus-state') === 'accepted'; }, [W, k1]), 5000));
127
- await click(W + ' [data-pm-focus-dismiss="' + k2 + '"]');
128
- ok('Not today takes a suggestion away', !!await until(() => st(([w, k]) => !document.querySelector(w + ' [data-pm-focus-card="' + k + '"]'), [W, k2]), 5000));
129
- ok('…and the footer says how many are marked not today, with Bring back', await st((w) => /^1 marked not today/.test((document.querySelector(w + ' [data-pm-focus-hidden]') || {}).textContent || ''), W));
130
- await click(W + ' [data-pm-focus-restore]');
131
- ok('Bring back returns it as a suggestion', !!await until(() => st(([w, k]) => { const c = document.querySelector(w + ' [data-pm-focus-card="' + k + '"]'); return c && c.getAttribute('data-pm-focus-state') === 'suggested'; }, [W, k2]), 5000));
132
- await click(W + ' [data-pm-focus-job]');
133
- ok('a Focus row with a job opens the job\'s sheet (its words, Keep, Delete)', !!await until(() => st(() => { const sh = document.querySelector('[data-shell="sheet"] [data-pm-case]'); return !!sh && !!sh.querySelector('[data-pm-job-edit$=":want"]'); }), 4000));
134
- await page.keyboard.press('Escape');
135
- await click(W + ' [data-pm-job-add-toggle]');
136
- ok('New job opens a sheet with the one-line draft', !!await until(() => st(() => !!document.querySelector('[data-shell="sheet"] [data-pm-add="/api/pm-jobs/add"]')), 4000));
137
- await page.keyboard.press('Escape');
138
- ok('both sheets close with Esc', !!await until(() => st(() => !document.querySelector('[data-shell="sheet"]')), 3000));
139
- await click(W + ' [data-pm-focus-edit="' + k3 + '"]');
140
- const inp = await until(() => st(([w, k]) => !!document.querySelector(w + ' [data-pm-focus-input="' + k + '"]'), [W, k3]), 4000);
141
- if (inp) await page.fill(W + ' [data-pm-focus-input="' + k3 + '"]', 'Prep the search one-pager before lunch');
142
- await click(W + ' [data-pm-focus-save="' + k3 + '"]');
143
- const edited = await until(() => st(([w, k]) => { const c = document.querySelector(w + ' [data-pm-focus-card="' + k + '"]'); return c && c.getAttribute('data-pm-focus-state') === 'accepted' ? (c.querySelector('[data-pm-focus-title]') || {}).textContent : null; }, [W, k3]), 5000);
144
- ok('Edit title saves the new title and pins the job', edited === 'Prep the search one-pager before lunch', String(edited));
145
- await click(W + ' [data-pm-focus-clear="' + k1 + '"]');
146
- ok('Unpin takes a pinned job back to a suggestion', !!await until(() => st(([w, k]) => { const c = document.querySelector(w + ' [data-pm-focus-card="' + k + '"]'); return c && c.getAttribute('data-pm-focus-state') === 'suggested'; }, [W, k1]), 5000));
147
- const focText = await st((w) => document.querySelector(w + ' [data-pm-focus]').textContent, W);
148
- ok('Focus copy has no em-dash', !/—/.test(focText));
149
-
150
- /* offline work (R6) */
151
- const qa = await open('Talk to Dara about QA capacity for the beta');
152
- ok('an offline row says "outside PMOS" and names the person', !!qa && await st((s) => { const r = document.querySelector(s); return !!r.querySelector('[data-pm-offline-tag]') && /outside PMOS/.test(r.textContent) && /Dara/.test(r.querySelector('.chips').textContent); }, W + ' ' + qa));
153
- ok('…its case file offers Done with an outcome, Not yet (later today, tomorrow, next week) and Drop', !!qa && await st((s) => { const b = document.querySelector(s + ' [data-pm-offline]'); return !!b && !!b.querySelector('[data-pm-outcome]') && !!b.querySelector('[data-pm-offline-done]') && ['later-today', 'tomorrow', 'next-week'].every((w) => b.querySelector('[data-pm-notyet="' + w + '"]')) && !!b.querySelector('[data-pm-drop]'); }, W + ' ' + qa));
154
- ok('…and "Looks done?" with a Confirm button; it is not done until the PM confirms', !!qa && await st((s) => { const e = document.querySelector(s + ' [data-pm-evidence]'); return !!e && /Looks done\?/.test(e.textContent) && !!e.querySelector('[data-pm-confirm]'); }, W + ' ' + qa) && (await titles()).includes('Talk to Dara about QA capacity for the beta'));
155
- ok('…with the shared actions Flag, Not before, Someday and Waiting', !!qa && await st((s) => ['[data-pm-flag]', '[data-pm-defer]', '[data-pm-someday]', '[data-pm-wait-on]'].every((q) => document.querySelector(s + ' ' + q)), W + ' ' + qa));
156
- await click(W + ' ' + qa + ' [data-pm-confirm]');
157
- ok('Confirm closes it: the row leaves Today and the count follows', !!await until(async () => !(await titles()).includes('Talk to Dara about QA capacity for the beta') && (await counts()).today === 4, 5000), JSON.stringify(await counts()));
158
- await toastUndo();
159
- ok('…and Undo brings it back', !!await until(async () => (await titles()).includes('Talk to Dara about QA capacity for the beta') && (await counts()).today === 5, 5000));
160
- const call = await open('Call Priya about the Q4 budget variance');
161
- ok('an item moved before says how often', !!call && /Moved 1×/.test(await st((s) => document.querySelector(s).textContent, W + ' ' + call)));
162
- if (call) await click(W + ' ' + call + ' [data-pm-notyet="tomorrow"]');
163
- ok('Not yet, tomorrow: it leaves Today and Upcoming gains it', !!await until(async () => { const c = await counts(); return !(await titles()).includes('Call Priya about the Q4 budget variance') && c.today === 4 && c.upcoming === 7; }, 5000), JSON.stringify(await counts()));
164
-
165
- /* Upcoming (R5) */
166
- await view('upcoming');
167
- const days = await st((w) => [...document.querySelectorAll(w + ' [data-pm-day]')].map((d) => ({ key: d.getAttribute('data-pm-day'), head: (d.querySelector('h3, h2') || {}).textContent, rows: [...d.querySelectorAll('[data-pm-title]')].map((t) => t.textContent), clear: /Clear/.test((d.querySelector('.wkday-none') || {}).textContent || '') })), W);
168
- ok('Upcoming is a Next 7 days card with one heading per day, then a separate Later card', days.length === 8 && days[0].key === '2026-10-09' && /^Tomorrow/.test(days[0].head) && days[7].key === 'later' && /^Later/.test(days[7].head) && days[1].clear, JSON.stringify(days.map((d) => d.key + ':' + d.head)));
169
- ok('…each item under the day it arrives', days.length === 8 && days[0].rows.includes('Set up a meeting with Sam about the logging rollout') && days[0].rows.includes('Call Priya about the Q4 budget variance')
170
- && days.find((d) => d.key === '2026-10-12').rows.includes('Write release notes for SSO 1.0') && days[7].rows.includes('Write the Q1 discovery plan'), JSON.stringify(days.map((d) => d.rows)));
171
- const nb = await st((w) => { const s = [...document.querySelectorAll(w + ' [data-pm-item]')].find((r) => /Write release notes for SSO 1\.0/.test(r.textContent)); const c = s && s.querySelector('[data-pm-notbefore]'); return c ? c.textContent : null; }, W);
172
- ok('a deferred item says "Not before" its date', nb === 'Not before Mon 12 Oct', String(nb));
173
- const adv = await st((w) => [...document.querySelectorAll(w + ' [data-pm-resolves]')].map((n) => n.textContent), W);
174
- ok('an item that advances a team task names it ("Advances team task <title>", or the id when the title is unknown)', adv.includes('Advances team task SSO general release checklist') && adv.includes('Advances team task returns-interview-5'), JSON.stringify(adv));
175
- const sam = await open('Set up a meeting with Sam about the logging rollout');
176
- if (sam) { await page.fill(W + ' ' + sam + ' [data-pm-outcome]', 'Booked for Tuesday 10:00'); await click(W + ' ' + sam + ' [data-pm-offline-done]'); }
177
- ok('Done with a one-line outcome closes an offline item', !!sam && !!await until(async () => !(await titles()).includes('Set up a meeting with Sam about the logging rollout') && (await counts()).upcoming === 6, 5000));
178
-
179
- /* Done (c3-work-agent amendment 18): what the PM finished, by day, with how it closed; Reopen puts it back */
180
- ok('the Done badge counts the items done today', !!await until(async () => (await counts()).done === 1, 5000), JSON.stringify(await counts()));
181
- await view('done');
182
- const doneRows = () => st((w) => [...document.querySelectorAll(w + ' [data-pm-list="done"]')].map((s) => [s.getAttribute('data-pm-sect'), [...s.querySelectorAll('[data-pm-done-item]')].map((r) => ({
183
- t: (r.querySelector('[data-pm-title]') || {}).textContent, out: (r.querySelector('[data-pm-done-outcome]') || {}).textContent || '', how: (r.querySelector('[data-pm-done-how]') || {}).textContent || '',
184
- at: (r.querySelector('[data-pm-done-at]') || {}).textContent || '', reopen: !!r.querySelector('[data-pm-reopen]') }))]), W);
185
- const d0 = await doneRows();
186
- ok('Done groups the items by day: Today (Sam, done just now) and Yesterday (the PRD)', JSON.stringify(d0.map((g) => [g[0], g[1].map((r) => r.t)])) === JSON.stringify([['today', ['Set up a meeting with Sam about the logging rollout']], ['yday', ['Send revised PRD to Dara']]]), JSON.stringify(d0));
187
- const samD = d0.length ? d0[0][1][0] : {};
188
- ok('…a row shows the outcome, how it closed, the time and Reopen', String(samD.out).trim() === 'Booked for Tuesday 10:00' && samD.how === 'You marked it done' && /^Done \d\d:\d\d$/.test(samD.at) && samD.reopen, JSON.stringify(samD));
189
- ok('…an older row shows the day it was done', d0.length > 1 && /^Done (Tue|Wed) 7 Oct$/.test(d0[1][1][0].at), JSON.stringify(d0[1]));
190
- ok('…with the summary line and the header', await st((w) => /^2 done in the last 7 days, 2 in 30 days\. Older items stay in their job's sheet\.$/.test((document.querySelector(w + ' [data-pm-done-sum]') || {}).textContent.trim()) && /What you finished/.test(document.querySelector(w + ' [data-pm-lens-head]').textContent), W));
191
- await click(W + ' [data-pm-done-item] [data-pm-reopen]');
192
- ok('Reopen says where the item went back to', !!await until(() => st(() => /Reopened\. It is back in Upcoming\./.test(document.body.textContent)), 4000));
193
- ok('…and it leaves Done and is back in Upcoming', !!await until(async () => { const c = await counts(); return c.done === 0 && c.upcoming === 7; }, 5000), JSON.stringify(await counts()));
194
- await toastUndo();
195
- ok('…Undo marks it done again', !!await until(async () => (await counts()).done === 1, 5000), JSON.stringify(await counts()));
196
- await click(W + ' [data-pm-sect="yday"] [data-pm-reopen]');
197
- ok('Reopen works on an item done before the page opened', !!await until(async () => !(await doneRows()).some((g) => g[1].some((r) => r.t === 'Send revised PRD to Dara')), 5000), JSON.stringify(await doneRows()));
198
- await toastUndo();
199
- ok('…and Undo puts it back in Done', !!await until(async () => (await doneRows()).some((g) => g[1].some((r) => r.t === 'Send revised PRD to Dara')), 5000));
200
-
201
- /* the shared actions: Flag from the Inbox (R2) */
202
- await view('inbox');
203
- const tear = await open('Read the competitor pricing teardown');
204
- if (tear) await click(W + ' ' + tear + ' [data-pm-flag]');
205
- ok('Flag moves an Inbox item to Today', !!tear && !!await until(async () => { const c = await counts(); return c.inbox === 2 && c.today === 5; }, 5000), JSON.stringify(await counts()));
206
-
207
- /* Review (R7) */
208
- await view('review');
209
- const drafts = await st((w) => [...document.querySelectorAll(w + ' [data-pm-review-drafts] [data-draft-row] .tt')].map((n) => n.textContent), W);
210
- ok('Review also carries the agent\'s drafts that Briefing used to show', DRAFTS.every((t) => drafts.includes(t)) && drafts.length >= 6, JSON.stringify(drafts));
211
- ok('…and its badge still counts the weekly review only', (await counts()).review === 3);
212
- const prog = () => st((w) => { const r = document.querySelector(w + ' [data-pm-review]'); return r ? { id: r.getAttribute('data-pm-review'), p: r.querySelector('[data-pm-review-progress]').textContent, t: r.querySelector('[data-pm-title]').textContent } : null; }, W);
213
- const r1 = await until(prog, 5000);
214
- ok('Review shows one item at a time, the most stale first, with progress', !!r1 && r1.p === '1 of 3' && r1.t === 'Clean up the Checkout Jira labels', JSON.stringify(r1));
215
- if (r1) await click(W + ' [data-pm-review-keep="' + r1.id + '"]');
216
- const r2 = await until(async () => { const p = await prog(); return p && p.p === '2 of 3' ? p : null; }, 5000);
217
- ok('Keep moves on to the next item', !!r2 && r2.t === 'Idea: weekly digest for partner admins', JSON.stringify(r2));
218
- if (r2) await click(W + ' [data-pm-review-change="' + r2.id + '"]');
219
- ok('Change opens the item\'s edit fields', !!r2 && !!await until(() => st((id) => !!document.querySelector('[data-pm-review] [data-pm-edit-form="' + id + '"]') && !!document.querySelector('[data-pm-review] [data-pm-edit="' + id + ':defer"]'), r2.id), 4000));
220
- if (r2) await click(W + ' [data-pm-review-next="' + r2.id + '"]');
221
- const r3 = await until(async () => { const p = await prog(); return p && p.p === '3 of 3' ? p : null; }, 5000);
222
- ok('…and Done changing moves on', !!r3 && r3.t === 'Annual-plan label', JSON.stringify(r3));
223
- if (r3) await click(W + ' [data-pm-review-drop="' + r3.id + '"]');
224
- ok('Drop ends the pass with "Review done"', !!await until(() => st((w) => { const d = document.querySelector(w + ' [data-pm-review-done]'); return !!d && /Review done/.test(d.textContent); }, W), 5000));
225
-
226
- /* Focus and the header on every view; Inbox and Waiting carry their own furniture */
227
- const every = [];
228
- for (const v of VIEWS) { await view(v); every.push(await st((w) => !document.querySelector(w + ' [data-pm-flow]') && !!document.querySelector(w + ' .bcol.r [data-pm-focus]'), W)); }
229
- ok('Focus shows on every view, and Flow today on none', every.every(Boolean), JSON.stringify(every));
230
- await view('inbox');
231
- ok('Inbox: an Inbox card, a Decide button that opens the row, and the note about Initiatives', await st((w) => !!document.querySelector(w + ' [data-pm-list="inbox"] h2') && /^Inbox/.test(document.querySelector(w + ' [data-pm-list="inbox"] h2').textContent) && !!document.querySelector(w + ' [data-pm-decide]') && /triaged in/.test((document.querySelector(w + ' [data-pm-inbox-note]') || {}).textContent || ''), W));
232
- await click(W + ' [data-pm-decide]');
233
- ok('…Decide opens the row\'s case file', !!await until(() => st((w) => !!document.querySelector(w + ' .xp.open [data-pm-case]'), W), 4000));
234
- await view('waiting');
235
- ok('Waiting: each row says who and since when, and has a Nudge button that sends nothing', await st((w) => { const r = document.querySelector(w + ' [data-pm-list="waiting"] [data-pm-item]'); return !!r && /^Waiting for \S/.test((r.querySelector('[data-pm-waiting-chip]') || {}).textContent || '') && !!r.querySelector('[data-pm-nudge]'); }, W));
236
- ok('every view header names how many decisions wait in Briefing and offers Open Briefing', await st((w) => /decisions? waits? in Briefing, Needs you\./.test(document.querySelector(w + ' [data-pm-lens-head]').textContent) && !!document.querySelector(w + ' [data-pm-open-briefing]'), W));
237
- /* capture (R2): the chip names the view the server will place the line in */
238
- const chip = async (line) => { await page.fill(W + ' [data-pm-add]', line); return until(() => st((w) => { const t = document.querySelector(w + ' [data-pm-chips] [data-pm-lands]'); return t ? t.textContent : null; }, W), 3000); };
239
- const lands = [await chip('Read the security brief'), await chip('Send Dana the new date by tomorrow'), await chip('Ship the fix due today'), await chip('Get the contract back waiting on Lee')];
240
- ok('the capture chip says where a line lands: Inbox, Upcoming, Today, Waiting', JSON.stringify(lands) === '["Inbox","Upcoming","Today","Waiting"]', JSON.stringify(lands));
241
- ok('…and never says Triage', !/Triage/.test(await st((w) => document.querySelector(w + ' .c3add').textContent, W)));
242
- await page.fill(W + ' [data-pm-add]', 'Read the security brief');
243
- await page.press(W + ' [data-pm-add]', 'Enter');
244
- ok('a captured line lands in Inbox and the page shows it there', !!await until(async () => (await st((w) => document.querySelector(w + ' [data-pm-lens-head]').getAttribute('data-pm-lens-head'), W)) === 'inbox' && (await titles()).includes('Read the security brief'), 6000));
245
-
246
- /* phone width: every view, no horizontal scroll */
247
- await page.setViewportSize({ width: 390, height: 844 });
248
- const wide = [];
249
- for (const v of VIEWS) {
250
- await view(v);
251
- await sleep(150); // a layout settle before a measurement that must NOT find overflow
252
- const w = await st(() => Math.max(document.documentElement.scrollWidth, document.body.scrollWidth));
253
- if (w > 391) wide.push(v + ':' + w);
254
- }
255
- ok('at 390 wide no view scrolls sideways', wide.length === 0, wide.join(' '));
256
- const tgt = await st((w) => [...document.querySelectorAll(w + ' [data-pm-lenses] [data-lens]')].every((b) => b.getBoundingClientRect().height >= 44), W);
257
- ok('…and the view buttons are at least 44px tall', tgt);
258
- ok('the page raised no script error', errors.length === 0, errors.slice(0, 3).join(' | '));
259
- return finish();
260
- })();
@@ -1,40 +0,0 @@
1
- 'use strict';
2
- /* PMOS workspace — the suites whose subject R29 cut (pm-os-absorb Run 3, slice 3D).
3
- *
4
- * The All repos, Knowledge, Memory, Skills and Scheduled views, and the Reports tab, are gone from the shell. The suites that
5
- * drew them in a browser (pm-r29-portfolio, -knowledge, -memory, -skills-scheduled, -reports-addrepo) have nothing to draw.
6
- * Each keeps its file and its name, and asserts what is left of its subject: the view is not in the table, its module is not
7
- * on disk, and the thing that replaced it is still there. Every removed assertion is in workspace/replaced-tests.json
8
- * (C03 to C11). No browser and no server: these are reads of the sources, so they run in milliseconds.
9
- */
10
- const fs = require('fs');
11
- const path = require('path');
12
-
13
- const PM = path.join(__dirname, 'public', 'pm');
14
- const read = (f) => { try { return fs.readFileSync(path.join(PM, f), 'utf8'); } catch { return null; } };
15
- const gone = (f) => !fs.existsSync(path.join(PM, f));
16
- /** The keys of `export const VIEWS = { … }` in panel-cockpit.js, in order. */
17
- const viewKeys = () => {
18
- const m = /export const VIEWS = \{([\s\S]*?)\n\};/.exec(read('panel-cockpit.js') || '');
19
- return m ? [...m[1].matchAll(/^ {2}(\w+):/gm)].map((x) => x[1]) : [];
20
- };
21
- /** The keys of `BOARD_MODULES = { … }` in panel-cockpit.js. */
22
- const boardKeys = () => {
23
- const m = /BOARD_MODULES = \{([\s\S]*?)\};/.exec(read('panel-cockpit.js') || '');
24
- return m ? [...m[1].matchAll(/(\w+):\s*'\.\/view-/g)].map((x) => x[1]) : [];
25
- };
26
-
27
- function suite(label, cases) {
28
- const results = [];
29
- for (const [name, fn] of cases) {
30
- let cond = false; let extra = '';
31
- try { const r = fn(); cond = r === true || (r && r.cond === true); extra = r && r.extra ? r.extra : ''; } catch (e) { extra = String((e && e.message) || e); }
32
- results.push(cond);
33
- console.log(`${cond ? '✓' : '✗'} ${name}${extra ? ' — ' + extra : ''}`);
34
- }
35
- const bad = results.filter((x) => !x).length;
36
- console.log(`\n${results.length - bad}/${results.length} ${label} assertions passed`);
37
- process.exit(bad ? 1 : 0);
38
- }
39
-
40
- module.exports = { suite, read, gone, viewKeys, boardKeys, PM };
@@ -1,160 +0,0 @@
1
- 'use strict';
2
- /* first-paint-audit.js — the first-paint instrument, shared by every first-paint suite (pm-os-absorb seams).
3
- *
4
- * Not a suite: first-paint-count.test.js (the Breakdown, Run 1) and each destination's first-paint suite (Initiatives
5
- * 2D, Today 3B, Board 4D, Reports 5C) require it, so every surface is counted with ONE instrument: shoot.js's audit(),
6
- * the one the PM's numbers came from. A "control" is a visible button, link, input, select, textarea, [role=button] or
7
- * [draggable=true] inside the viewport on first paint.
8
- *
9
- * EXPECT PRD Q5's budgets at 1280×800, counted outside the dock and the terminal
10
- * SPECIMEN_A specimen A's own counts (2026-10-05), the calibration the audit must reproduce
11
- * audit(phone) shoot.js's audit, verbatim; runs in the page (page.evaluate(audit, false))
12
- * countIn([scope, exclude]) the same selector and visibility test, inside `scope` and outside `exclude`; in the page
13
- * stableCount([scope, exclude, minus]) countIn once the screen is still (two animation frames apart); in the page,
14
- * after installCounter(page)
15
- * installCounter(page) the init script stableCount needs (window.__countIn); call it before page.goto
16
- *
17
- * Do not tune the selector or the visibility test for one surface: change them here, for all, or not at all.
18
- */
19
-
20
- // The budgets start at specimen A's counts. reports: 14 → 15 in Run 6 for Present, the one control the PM asked to keep
21
- // with the slides (2026-10-06). Every place +1 for Docs in the top bar (the PM, 2026-10-06, docs-three-way-sync): the
22
- // budget is for the whole screen and the bar is on every screen. The calibration stays specimen A's own count: the
23
- // specimen did not change. Every place +1 again for People in the top bar (the PM, 2026-10-06, people-directory), and
24
- // +1 again for My work beside Agenda (the PM approved that mockup and said build it, 2026-10-07, my-work).
25
- // reports: +1 for New report in the Reports header (the PM asked for it, 2026-10-07, reports-new-session).
26
- const SPECIMEN_A = Object.freeze({ today: 17, initiatives: 24, board: 33, reports: 14 });
27
- const BAR_DOCS = 1;
28
- const BAR_PEOPLE = 1;
29
- const BAR_MY_WORK = 1;
30
- const BAR = BAR_DOCS + BAR_PEOPLE + BAR_MY_WORK;
31
- // Agenda opens on the month (the PM's Agenda mockup v5, 2026-10-06): the month adds its own controls to Today's budget,
32
- // at most six week rows of a week button and seven days, the two month arrows and the five lenses.
33
- const AGENDA_MONTH = 6 * 8 + 2 + 5;
34
- const EXPECT = Object.freeze({ today: 17 + BAR + AGENDA_MONTH, initiatives: 24 + BAR, board: 33 + BAR, reports: 16 + BAR });
35
-
36
- /* ── shoot.js audit(), copied verbatim (scratchpad/specimens2/shoot.js, 2026-10-05) ─────────────────────────────── */
37
- // runs in the page
38
- function audit(phone) {
39
- const SEL = 'button, a[href], a[role], input:not([type="hidden"]), select, textarea, [role="button"], [draggable="true"]';
40
- const vw = window.innerWidth;
41
- const vh = window.innerHeight;
42
- const visible = (el) => {
43
- if (el.closest("dialog:not([open])")) return false;
44
- const pop = el.closest("[popover]");
45
- if (pop && !pop.matches(":popover-open")) return false;
46
- const r = el.getBoundingClientRect();
47
- if (r.width < 1 || r.height < 1) return false;
48
- for (let n = el; n && n.nodeType === 1; n = n.parentElement) {
49
- const cs = getComputedStyle(n);
50
- if (cs.display === "none" || cs.visibility === "hidden" || Number(cs.opacity) === 0) return false;
51
- }
52
- return r.bottom > 0 && r.right > 0 && r.top < vh && r.left < vw;
53
- };
54
- const describe = (el) => {
55
- const t = (el.getAttribute("aria-label") || el.textContent || el.value || "").trim().replace(/\s+/g, " ");
56
- const r = el.getBoundingClientRect();
57
- return `${el.tagName.toLowerCase()}${el.className && typeof el.className === "string" ? "." + el.className.trim().split(/\s+/).slice(0, 2).join(".") : ""} "${t.slice(0, 28)}" ${Math.round(r.width)}x${Math.round(r.height)}`;
58
- };
59
- const all = [...document.querySelectorAll(SEL)].filter(visible);
60
- const notBar = all.filter((el) => !el.closest(".specbar"));
61
- const small = phone
62
- ? notBar.filter((el) => {
63
- const r = el.getBoundingClientRect();
64
- // inline text links inside prose are exempt from the 44px rule
65
- if (el.tagName === "A" && !el.className && getComputedStyle(el).display === "inline") return false;
66
- return r.width < 43.5 || r.height < 43.5;
67
- })
68
- : [];
69
- const sw = document.documentElement.scrollWidth;
70
- const offenders = [];
71
- if (sw > vw) {
72
- for (const el of document.querySelectorAll("body *")) {
73
- const r = el.getBoundingClientRect();
74
- if (r.right > vw + 0.5 && r.width > 0) {
75
- let clipped = false;
76
- for (let p = el.parentElement; p && p !== document.body; p = p.parentElement) {
77
- const o = getComputedStyle(p).overflowX;
78
- if (o === "auto" || o === "scroll" || o === "hidden" || o === "clip") {
79
- clipped = true;
80
- break;
81
- }
82
- }
83
- if (!clipped) offenders.push({ el: describe(el), right: Math.round(r.right) });
84
- }
85
- }
86
- offenders.sort((a, b) => b.right - a.right);
87
- }
88
- return {
89
- title: document.title,
90
- controlsInViewport: all.length,
91
- controlsExcludingSpecbar: notBar.length,
92
- smallTargets: small.length,
93
- smallTargetExamples: small.slice(0, 8).map(describe),
94
- scrollWidth: sw,
95
- innerWidth: vw,
96
- horizontalOverflow: sw > vw,
97
- overflowOffenders: offenders.slice(0, 6),
98
- pageHeight: document.documentElement.scrollHeight
99
- };
100
- }
101
-
102
- /**
103
- * The same selector and the same visibility test as audit(), counted inside `scope` and outside every `exclude`.
104
- * Runs in the page. Returns { n, names }.
105
- */
106
- function countIn([scope, exclude]) {
107
- const SEL = 'button, a[href], a[role], input:not([type="hidden"]), select, textarea, [role="button"], [draggable="true"]';
108
- const vw = window.innerWidth;
109
- const vh = window.innerHeight;
110
- const visible = (el) => {
111
- if (el.closest("dialog:not([open])")) return false;
112
- const pop = el.closest("[popover]");
113
- if (pop && !pop.matches(":popover-open")) return false;
114
- const r = el.getBoundingClientRect();
115
- if (r.width < 1 || r.height < 1) return false;
116
- for (let n = el; n && n.nodeType === 1; n = n.parentElement) {
117
- const cs = getComputedStyle(n);
118
- if (cs.display === "none" || cs.visibility === "hidden" || Number(cs.opacity) === 0) return false;
119
- }
120
- return r.bottom > 0 && r.right > 0 && r.top < vh && r.left < vw;
121
- };
122
- const roots = scope ? [...document.querySelectorAll(scope)] : [document];
123
- const seen = new Set();
124
- for (const root of roots) for (const el of root.querySelectorAll(SEL)) {
125
- if (seen.has(el) || !visible(el)) continue;
126
- if (exclude && el.closest(exclude)) continue;
127
- seen.add(el);
128
- }
129
- const names = [...seen].map((el) => `${el.tagName.toLowerCase()} "${(el.getAttribute('aria-label') || el.textContent || '').trim().replace(/\s+/g, ' ').slice(0, 24)}"`);
130
- return { n: seen.size, names };
131
- }
132
-
133
- /**
134
- * countIn, but only once the screen is still: the count of `scope` minus `exclude` must be the same two animation
135
- * frames apart (up to 60 tries). With `minus`, the controls inside `minus` are counted out in the SAME task, so the two
136
- * numbers of a difference come from one paint. Runs in the page; needs window.__countIn (an init script).
137
- */
138
- async function stableCount([scope, exclude, minus]) {
139
- const frame = () => new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(r)));
140
- const both = () => {
141
- const a = window.__countIn([scope, exclude]);
142
- const b = minus ? window.__countIn([scope, exclude ? exclude + ', ' + minus : minus]) : null;
143
- return { n: a.n, names: a.names, without: b ? b.n : null };
144
- };
145
- let prev = both();
146
- for (let k = 0; k < 60; k++) {
147
- await frame();
148
- const cur = both();
149
- if (cur.n === prev.n && cur.without === prev.without) return { ...cur, still: true, tries: k + 1 };
150
- prev = cur;
151
- }
152
- return { ...prev, still: false, tries: 60 };
153
- }
154
-
155
- /** Add the init script that stableCount calls. Call it once per page, before the first goto. */
156
- function installCounter(page) {
157
- return page.addInitScript({ content: 'window.__countIn = ' + countIn.toString() + ';' });
158
- }
159
-
160
- module.exports = { AGENDA_MONTH, EXPECT, SPECIMEN_A, audit, countIn, stableCount, installCounter };