rvlib-shipkit 2.12.0 → 2.14.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 (378) hide show
  1. package/CHANGELOG.md +75 -21
  2. package/README.md +1 -1
  3. package/package.json +4 -2
  4. package/src/agent-time/store.ts +2 -2
  5. package/src/assets/run-assets.ts +2 -2
  6. package/src/assets/server/studio-server.ts +27 -23
  7. package/src/check.ts +4 -4
  8. package/src/checks/SK001-package-json-shape.check.ts +8 -4
  9. package/src/checks/SK002-contracts-fulfillness.check.ts +2 -2
  10. package/src/checks/SK003-claude-md-shape.check.ts +20 -13
  11. package/src/checks/SK004-gitignore-policy.check.ts +45 -6
  12. package/src/checks/SK005-rvlib-versions.check.ts +2 -2
  13. package/src/checks/SK006-npm-publish-safety.check.ts +3 -3
  14. package/src/checks/SK007-github-visibility.check.ts +2 -2
  15. package/src/checks/SK008-reviewer-agent.check.ts +3 -3
  16. package/src/checks/SK010-undeclared-unit.check.ts +2 -2
  17. package/src/checks/SK011-sibling-unit-ranges.check.ts +2 -2
  18. package/src/checks/SK012-config-barrel-import.check.ts +2 -2
  19. package/src/checks/SK013-one-way-in-policy.check.ts +2 -2
  20. package/src/checks/SK015-nested-repo.check.ts +3 -3
  21. package/src/checks/SK016-legacy-check-shapes.check.ts +2 -2
  22. package/src/checks/SK017-vscode-hub-task.check.ts +2 -2
  23. package/src/checks/SK018-test-files-run.check.ts +2 -2
  24. package/src/checks/SK019-tests-run-in-units.check.ts +2 -2
  25. package/src/checks/SK020-self-spawning-check.check.ts +2 -2
  26. package/src/checks/SK022-machine-runs-the-pin.check.ts +2 -2
  27. package/src/checks/SK024-identity-colors.check.ts +1 -1
  28. package/src/checks/SK025-release-drift.check.ts +2 -2
  29. package/src/checks/SK026-asks-autoclose.check.ts +2 -2
  30. package/src/checks/SK027-agent-wiki-links.check.ts +8 -2
  31. package/src/checks/SK028-readme.check.ts +2 -2
  32. package/src/checks/SK029-explicit-check-files.check.ts +3 -3
  33. package/src/checks/SK030-cache-audit.check.ts +7 -5
  34. package/src/checks/SK031-trace-audit.check.ts +7 -7
  35. package/src/checks/SK032-ignored-inputs.check.ts +3 -3
  36. package/src/checks/SK033-global-contribution.check.ts +11 -4
  37. package/src/checks/SK034-commit-gates-armed.check.ts +2 -2
  38. package/src/checks/SK035-public-clean.check.ts +46 -0
  39. package/src/checks/SK036-draft-media-size.check.ts +28 -0
  40. package/src/checks/SK037-keyword-additions.check.ts +43 -0
  41. package/src/cli/cmd_Backup.ts +152 -0
  42. package/src/cli/cmd_Ci.ts +8 -11
  43. package/src/cli/cmd_Commands.ts +4 -4
  44. package/src/cli/cmd_ConfigKeys.ts +2 -2
  45. package/src/cli/cmd_Drill.ts +145 -0
  46. package/src/cli/cmd_Home.ts +50 -3
  47. package/src/cli/cmd_Init.ts +1 -1
  48. package/src/cli/cmd_Media.ts +10 -8
  49. package/src/cli/cmd_Mv.ts +14 -7
  50. package/src/cli/cmd_Review.ts +6 -4
  51. package/src/cli/cmd_Shot.ts +5 -2
  52. package/src/cli/cmd_Smoke.ts +5 -2
  53. package/src/cli/cmd_Social.ts +226 -0
  54. package/src/cli/cmd_Sound.ts +1 -1
  55. package/src/cli/cmd_Start.ts +1 -1
  56. package/src/cli/cmd_Time.ts +1 -1
  57. package/src/cli/cmd_TraceAudit.ts +6 -6
  58. package/src/cli/cmd_Trailer.ts +7 -4
  59. package/src/cli/cmd_Veille.ts +173 -0
  60. package/src/cli/cmd_When.ts +2 -2
  61. package/src/cli/family-pages.ts +19 -16
  62. package/src/cli/registry.ts +13 -2
  63. package/src/cli.ts +5 -2
  64. package/src/collections/actions.ts +1 -49
  65. package/src/collections/checks.ts +2 -1
  66. package/src/collections/collection-types.ts +12 -3
  67. package/src/collections/providers.ts +4 -4
  68. package/src/collections/review.ts +3 -2
  69. package/src/collections/tests.ts +19 -8
  70. package/src/comfy/comfy-panel.ts +2 -2
  71. package/src/contracts/apply-contracts.ts +1 -3
  72. package/src/contracts/contract-manifests.ts +2 -3
  73. package/src/contracts/contract-types.ts +0 -1
  74. package/src/contracts/contracts-engine.ts +0 -3
  75. package/src/contracts/manifests/discord.contract.ts +1 -1
  76. package/src/contracts/manifests/identity.contract.ts +1 -1
  77. package/src/contracts/manifests/itch.contract.ts +1 -1
  78. package/src/contracts/manifests/steam.contract.ts +1 -1
  79. package/src/core/agent-dir-at.ts +12 -0
  80. package/src/core/agent-dir.ts +16 -0
  81. package/src/core/app-icon.ts +9 -3
  82. package/src/core/budget.ts +1 -1
  83. package/src/core/bun-builtins.ts +2 -2
  84. package/src/core/canonical-scripts.ts +2 -2
  85. package/src/core/discover-checks.ts +38 -6
  86. package/src/core/fix-scope.ts +4 -2
  87. package/src/core/floor-resolve.ts +68 -48
  88. package/src/core/floor.ts +9 -0
  89. package/src/core/git-root.ts +24 -0
  90. package/src/core/global-contribution.ts +4 -1
  91. package/src/core/ignored-block.ts +1 -1
  92. package/src/core/ignored-inputs.ts +3 -2
  93. package/src/core/last-good.ts +3 -1
  94. package/src/core/layout.ts +8 -0
  95. package/src/core/log-stamp.ts +36 -0
  96. package/src/core/loop-watch.ts +93 -0
  97. package/src/core/machine-link.ts +134 -0
  98. package/src/core/memory-watch.ts +41 -0
  99. package/src/core/motherhome.ts +2 -2
  100. package/src/core/one-way-in-policy.ts +34 -26
  101. package/src/core/run-ci.ts +9 -11
  102. package/src/core/run-fixers.ts +9 -9
  103. package/src/core/runs-matrix.ts +1 -1
  104. package/src/core/slots.ts +30 -0
  105. package/src/core/trace-audit.ts +50 -9
  106. package/src/core/tree-rev.ts +60 -0
  107. package/src/core/unit-files.ts +42 -0
  108. package/src/drill/render.ts +140 -0
  109. package/src/drill/run.ts +269 -0
  110. package/src/fleet/scan-fleet.ts +6 -5
  111. package/src/home/daemon-jobs.ts +201 -0
  112. package/src/home/global-context.ts +44 -8
  113. package/src/home/gui-app/ShipkitGui.swift +91 -2
  114. package/src/home/home-routes.ts +22 -15
  115. package/src/home/hubs.ts +10 -3
  116. package/src/home/inbox-shape.ts +54 -5
  117. package/src/home/inbox.ts +17 -2
  118. package/src/home/lib-watch.ts +10 -3
  119. package/src/home/machine-stores.ts +15 -29
  120. package/src/home/pm-config.ts +4 -1
  121. package/src/home/pm-inputs.ts +2 -0
  122. package/src/home/resources.ts +7 -2
  123. package/src/home/run-daemon.ts +15 -18
  124. package/src/home/run-pm.ts +3 -1
  125. package/src/home/serve-daemon.ts +4 -3
  126. package/src/home/serve-web.ts +104 -1
  127. package/src/hooks/commit-message.ts +29 -20
  128. package/src/hooks/hook-gates.ts +1 -1
  129. package/src/hooks/leak-guard.ts +69 -9
  130. package/src/hooks/run-hooks.ts +18 -22
  131. package/src/identities/identities.ts +334 -0
  132. package/src/identities/machine-route.ts +126 -0
  133. package/src/identities/machine.ts +62 -0
  134. package/src/init-repo.ts +3 -3
  135. package/src/ledger/check-stats.ts +10 -9
  136. package/src/ledger/gate-checks.ts +32 -1
  137. package/src/ledger/record-kept.ts +112 -0
  138. package/src/ledger/repo-view.ts +10 -0
  139. package/src/ledger/run-log.ts +17 -12
  140. package/src/ledger/run-timeline.ts +8 -4
  141. package/src/ledger/store.ts +7 -0
  142. package/src/ledger/suite-log.ts +17 -13
  143. package/src/media-kinds.ts +3 -2
  144. package/src/media-store/backup/daemon.ts +73 -0
  145. package/src/media-store/backup/keys.ts +25 -0
  146. package/src/media-store/backup/manifest.ts +193 -0
  147. package/src/media-store/backup/restore.ts +192 -0
  148. package/src/media-store/backup/run.ts +278 -0
  149. package/src/media-store/backup/secret.ts +86 -0
  150. package/src/media-store/backup/snapshot.ts +64 -0
  151. package/src/media-store/backup/sources.ts +199 -0
  152. package/src/media-store/content.ts +1 -1
  153. package/src/media-store/daemon.ts +56 -70
  154. package/src/media-store/db.ts +1 -1
  155. package/src/media-store/fact.ts +1 -1
  156. package/src/media-store/hand.ts +1 -1
  157. package/src/media-store/kind.ts +1 -1
  158. package/src/media-store/purge.ts +1 -1
  159. package/src/media-store/put.ts +5 -3
  160. package/src/media-store/remote.ts +1 -1
  161. package/src/media-store/space.ts +24 -5
  162. package/src/mv/mv-md.ts +63 -22
  163. package/src/pages/forward.ts +35 -0
  164. package/src/pages/frame-client.ts +118 -0
  165. package/src/pages/routes.ts +29 -0
  166. package/src/pages/unit.ts +92 -0
  167. package/src/plan/planner.ts +12 -0
  168. package/src/plan/repo-source.ts +19 -5
  169. package/src/reflect/transcript.ts +35 -10
  170. package/src/release/public-clean.ts +319 -0
  171. package/src/release/published-here.ts +22 -0
  172. package/src/release/run-bump.ts +3 -2
  173. package/src/release/run-release.ts +7 -4
  174. package/src/repo-config.ts +71 -13
  175. package/src/review/anim.ts +1 -1
  176. package/src/review/auto.ts +1 -1
  177. package/src/review/cells.ts +15 -1
  178. package/src/review/format.ts +2 -2
  179. package/src/review/http.ts +16 -2
  180. package/src/review/marks.ts +1 -1
  181. package/src/review/media-kind.ts +1 -1
  182. package/src/review/media-read.ts +1 -1
  183. package/src/review/model.ts +27 -6
  184. package/src/review/notes.ts +125 -0
  185. package/src/review/previews.ts +1 -1
  186. package/src/review/project.ts +7 -39
  187. package/src/review/role.ts +1 -1
  188. package/src/review/routes.ts +18 -14
  189. package/src/review/store.ts +42 -2
  190. package/src/review/threads.ts +1 -1
  191. package/src/review/trailer-desk.ts +3 -3
  192. package/src/review/trailer-media.ts +8 -5
  193. package/src/review/trailer-model.ts +1 -1
  194. package/src/review/trailer-routes.ts +1 -1
  195. package/src/review/trailer-shots.ts +22 -5
  196. package/src/review/unit.ts +2 -2
  197. package/src/scaffold/files/agent-handoff.md +3 -0
  198. package/src/scaffold/files/agent-index.md +4 -12
  199. package/src/scaffold/files/tsconfig.json +1 -1
  200. package/src/scaffold/project-scaffold.ts +6 -5
  201. package/src/serve/embed.ts +2 -2
  202. package/src/serve/hub-app/check-words.ts +1 -1
  203. package/src/serve/hub-app/col-card.tsx +3 -17
  204. package/src/serve/hub-app/col-tables-view.tsx +2 -1
  205. package/src/serve/hub-app/cols-svc.ts +0 -13
  206. package/src/serve/hub-app/dock-st.ts +4 -2
  207. package/src/serve/hub-app/dock-view.tsx +2 -0
  208. package/src/serve/hub-app/frames-st.ts +35 -0
  209. package/src/serve/hub-app/hash-route.ts +64 -1
  210. package/src/serve/hub-app/home-st.ts +32 -8
  211. package/src/serve/hub-app/home-strip.css +9 -1
  212. package/src/serve/hub-app/home-strip.tsx +7 -6
  213. package/src/serve/hub-app/home.html +5 -0
  214. package/src/serve/hub-app/hub-app.tsx +51 -7
  215. package/src/serve/hub-app/hub.css +29 -11
  216. package/src/serve/hub-app/icons.tsx +16 -1
  217. package/src/serve/hub-app/identities-st.ts +210 -0
  218. package/src/serve/hub-app/identities-view.tsx +353 -0
  219. package/src/serve/hub-app/identities.css +48 -0
  220. package/src/serve/hub-app/identity-address.ts +52 -0
  221. package/src/serve/hub-app/inbox-st.ts +60 -7
  222. package/src/serve/hub-app/inbox-view.tsx +49 -7
  223. package/src/serve/hub-app/inbox.css +12 -1
  224. package/src/serve/hub-app/index.html +3 -0
  225. package/src/serve/hub-app/kept-cols.tsx +30 -0
  226. package/src/serve/hub-app/keys.ts +10 -2
  227. package/src/serve/hub-app/list-walk.ts +89 -0
  228. package/src/serve/hub-app/machine-st.ts +12 -0
  229. package/src/serve/hub-app/media-svc.ts +1 -1
  230. package/src/serve/hub-app/media-view.tsx +2 -1
  231. package/src/serve/hub-app/pages-frames.tsx +134 -0
  232. package/src/serve/hub-app/pages-svc.ts +111 -0
  233. package/src/serve/hub-app/palette-st.ts +18 -3
  234. package/src/serve/hub-app/palette-view.tsx +9 -2
  235. package/src/serve/hub-app/planned-view.tsx +2 -1
  236. package/src/serve/hub-app/project-list.css +18 -14
  237. package/src/serve/hub-app/project-list.tsx +88 -49
  238. package/src/serve/hub-app/projects-svc.ts +33 -3
  239. package/src/serve/hub-app/repo-sections.ts +19 -2
  240. package/src/serve/hub-app/repo-st.ts +76 -20
  241. package/src/serve/hub-app/review/review-board.tsx +1 -1
  242. package/src/serve/hub-app/review/review-cells.tsx +6 -5
  243. package/src/serve/hub-app/review/review-kit.ts +30 -7
  244. package/src/serve/hub-app/review/review-page.tsx +6 -5
  245. package/src/serve/hub-app/review/review-st.ts +34 -15
  246. package/src/serve/hub-app/review/review-thread.tsx +63 -14
  247. package/src/serve/hub-app/review/review-views.tsx +133 -51
  248. package/src/serve/hub-app/review/thread-st.ts +80 -37
  249. package/src/serve/hub-app/review/trailer-page.tsx +7 -5
  250. package/src/serve/hub-app/review/trailer-st.ts +1 -1
  251. package/src/serve/hub-app/review.css +26 -9
  252. package/src/serve/hub-app/site/site-part.tsx +173 -0
  253. package/src/serve/hub-app/site/site-st.ts +157 -0
  254. package/src/serve/hub-app/site.css +35 -0
  255. package/src/serve/hub-app/social/calendar.tsx +182 -0
  256. package/src/serve/hub-app/social/comms-page.tsx +330 -0
  257. package/src/serve/hub-app/social/kit.tsx +244 -0
  258. package/src/serve/hub-app/social/post-card.tsx +456 -0
  259. package/src/serve/hub-app/social/problems.tsx +60 -0
  260. package/src/serve/hub-app/social/social-model.ts +154 -0
  261. package/src/serve/hub-app/social/social-page.tsx +681 -0
  262. package/src/serve/hub-app/social/social-st.ts +1014 -0
  263. package/src/serve/hub-app/social.css +289 -0
  264. package/src/serve/hub-app/stores/stores-page.tsx +312 -0
  265. package/src/serve/hub-app/stores/stores-st.ts +286 -0
  266. package/src/serve/hub-app/stores.css +54 -0
  267. package/src/serve/hub-app/timeline-geometry.ts +1 -1
  268. package/src/serve/hub-app/timeline-view.tsx +3 -2
  269. package/src/serve/hub-app/tree-build.ts +6 -0
  270. package/src/serve/hub-app/tree-row.tsx +27 -4
  271. package/src/serve/hub-app/tree-svc.ts +18 -49
  272. package/src/serve/hub-app/veille/veille-page.tsx +515 -0
  273. package/src/serve/hub-app/veille/veille-st.ts +443 -0
  274. package/src/serve/hub-app/veille.css +84 -0
  275. package/src/serve/hub-runtime.ts +20 -11
  276. package/src/serve/project-gutter-route.ts +44 -12
  277. package/src/serve/run-lanes.ts +7 -4
  278. package/src/serve/same-origin.ts +1 -1
  279. package/src/serve/serve-hub.ts +20 -12
  280. package/src/serve/tracked-watch.ts +24 -3
  281. package/src/serve/warm-cell.ts +5 -1
  282. package/src/shipkit-files.ts +15 -4
  283. package/src/shipkit.ts +0 -1
  284. package/src/shot/box.ts +160 -0
  285. package/src/shot/browser-slot.ts +74 -0
  286. package/src/shot/client.ts +42 -7
  287. package/src/shot/clip-encoder.ts +108 -24
  288. package/src/shot/film-box.ts +292 -0
  289. package/src/shot/shooter.ts +71 -17
  290. package/src/shot/shot-ask.ts +10 -2
  291. package/src/shot/stepped-clip.ts +5 -4
  292. package/src/site/desk.ts +242 -0
  293. package/src/site/routes.ts +66 -0
  294. package/src/site/unit.ts +62 -0
  295. package/src/social/brands.ts +22 -0
  296. package/src/social/card-drafts.ts +24 -0
  297. package/src/social/compose.ts +97 -0
  298. package/src/social/desk-index.ts +123 -0
  299. package/src/social/desk-wire.ts +64 -0
  300. package/src/social/drafts.ts +183 -0
  301. package/src/social/house.ts +24 -0
  302. package/src/social/load.ts +332 -0
  303. package/src/social/md.ts +70 -0
  304. package/src/social/media-facts.ts +53 -0
  305. package/src/social/media-kind.ts +189 -0
  306. package/src/social/media-limit.ts +42 -0
  307. package/src/social/media-of.ts +30 -0
  308. package/src/social/migrate.ts +123 -0
  309. package/src/social/open.ts +17 -0
  310. package/src/social/post-url.ts +158 -0
  311. package/src/social/presence.ts +332 -0
  312. package/src/social/public-read.ts +53 -0
  313. package/src/social/publish/bluesky.ts +168 -0
  314. package/src/social/publish/discord.ts +76 -0
  315. package/src/social/publish/index.ts +24 -0
  316. package/src/social/publish/secret.ts +13 -0
  317. package/src/social/push.ts +37 -0
  318. package/src/social/richtext.ts +37 -0
  319. package/src/social/routes.ts +186 -0
  320. package/src/social/stats.ts +134 -0
  321. package/src/social/text.ts +267 -0
  322. package/src/social/tracker-route.ts +39 -0
  323. package/src/social/tracker.ts +255 -0
  324. package/src/social/unit.ts +53 -0
  325. package/src/social/writes.ts +130 -0
  326. package/src/start-repo.ts +14 -9
  327. package/src/stores/collection.ts +27 -0
  328. package/src/stores/desk.ts +336 -0
  329. package/src/stores/model.ts +187 -0
  330. package/src/stores/routes.ts +126 -0
  331. package/src/stores/unit.ts +57 -0
  332. package/src/suite/calibrate.ts +127 -0
  333. package/src/suite/core-counters.ts +91 -0
  334. package/src/suite/judge-suites.ts +95 -35
  335. package/src/suite/suite-cli.ts +44 -10
  336. package/src/suite/suite-cpu-preload.ts +34 -9
  337. package/src/trace/tracer.ts +12 -5
  338. package/src/trailer/adapter.ts +5 -1
  339. package/src/trailer/build.ts +45 -12
  340. package/src/trailer/ffmpeg.ts +11 -0
  341. package/src/trailer/footage.ts +30 -13
  342. package/src/trailer/grammar.ts +18 -2
  343. package/src/trailer/graph.ts +28 -6
  344. package/src/trailer/holes.ts +1 -1
  345. package/src/trailer/passage.ts +18 -6
  346. package/src/trailer/plan.ts +74 -3
  347. package/src/trailer/prune.ts +1 -1
  348. package/src/trailer/states.ts +1 -1
  349. package/src/trailer/stitch.ts +67 -26
  350. package/src/trailer/url.ts +1 -1
  351. package/src/trailer/versions.ts +24 -0
  352. package/src/trailer/words.ts +1 -1
  353. package/src/ts/gate-typecheck.ts +32 -0
  354. package/src/ts/typecheck-cli.ts +9 -11
  355. package/src/tui/run-tui.ts +1 -1
  356. package/src/tui/tui-app.tsx +0 -1
  357. package/src/tui/tui-store.ts +1 -1
  358. package/src/veille/asks.ts +155 -0
  359. package/src/veille/auto.ts +31 -0
  360. package/src/veille/batch.ts +27 -0
  361. package/src/veille/chrome.ts +127 -0
  362. package/src/veille/collection.ts +28 -0
  363. package/src/veille/desk.ts +242 -0
  364. package/src/veille/identity.ts +80 -0
  365. package/src/veille/import.ts +68 -0
  366. package/src/veille/log.ts +183 -0
  367. package/src/veille/platforms.ts +118 -0
  368. package/src/veille/reads.ts +66 -0
  369. package/src/veille/replied.ts +110 -0
  370. package/src/veille/routes.ts +185 -0
  371. package/src/veille/service.ts +81 -0
  372. package/src/veille/watch.ts +116 -0
  373. package/src/veille/worth.ts +46 -0
  374. package/src/wiki/scan-md.ts +18 -0
  375. package/src/collections/posts.ts +0 -142
  376. package/src/contracts/manifests/social.contract.ts +0 -20
  377. package/src/scaffold/files/agent-coding.md +0 -35
  378. package/src/ts/typecheck-cache.ts +0 -11
@@ -1,5 +1,5 @@
1
1
  // RepoSt: one repo's hub page as a node of the page tree (home-st.ts owns
2
- // the root, build/app-state-tree). Owns cross-service state: selection, the
2
+ // the root, patterns/app-state-tree). Owns cross-service state: selection, the
3
3
  // severity filter (an ADDRESS: ?f=needs · ?f=red), and the hash router: every
4
4
  // page and every tab is a selection, every selection has an address
5
5
  // (hash-route.ts), and setSel is the one place both move together. A repo
@@ -23,9 +23,14 @@ import { TestsSvc } from './tests-svc.ts'
23
23
  import { AdminSvc } from './admin-svc.ts'
24
24
  import { ReviewSt } from './review/review-st.ts'
25
25
  import { TrailerSt } from './review/trailer-st.ts'
26
+ import { StoresSt } from './stores/stores-st.ts'
27
+ import { VeilleSt } from './veille/veille-st.ts'
28
+ import { SocialSt } from './social/social-st.ts'
26
29
  import { WikiSt } from './wiki-st.ts'
30
+ import { PagesSvc } from './pages-svc.ts'
27
31
  import { repoSections } from './repo-sections.ts'
28
32
  import { isTreeWalk, sectionKeyLabel } from './keys.ts'
33
+ import { WalkEntry } from './list-walk.ts'
29
34
  import type { Resource } from './hub-types.ts'
30
35
  import type { HomeSt } from './home-st.ts'
31
36
 
@@ -33,7 +38,7 @@ export type Sel = HashSel | null
33
38
 
34
39
  /** one picker target (cmd+j): run() fires the SAME action clicking would */
35
40
  /** what a picker entry wears: a repo's own icon, or a place's button icon */
36
- export type JumpFace = { repo: string } | { place: 'home' | 'inbox' | 'planned' | 'activity' | 'insights' | 'archived' }
41
+ export type JumpFace = { repo: string } | { place: 'home' | 'inbox' | 'planned' | 'activity' | 'insights' | 'archived' } | { identity: string; account?: string }
37
42
  /** `key`: the shortcut that does the same, printed at the entry's end */
38
43
  export type Jump = { id: string; label: string; section: string; run: () => void; face?: JumpFace; key?: string }
39
44
 
@@ -73,8 +78,16 @@ export class RepoSt {
73
78
  review: ReviewSt
74
79
  /** the trailer page: a cut played with its timeline and his frame notes (review/trailer-st.ts) */
75
80
  trailer: TrailerSt
81
+ /** the stores page: the repo's Steam and itch pages, his notes on each thing (stores/stores-st.ts) */
82
+ stores: StoresSt
83
+ /** the Veille page: the posts its identity scrolls past, ranked, and a reply (veille/veille-st.ts) */
84
+ veille: VeilleSt
85
+ /** the Communications and Social pages: the repo's drafts, every identity and its accounts (social/social-st.ts) */
86
+ social: SocialSt
76
87
  /** the wikis page's search and preview */
77
88
  wiki: WikiSt
89
+ /** the repo's own pages, each a frame of its process (pages-svc.ts) */
90
+ pages: PagesSvc
78
91
  sel: Sel = null
79
92
  filter: Filter = 'all'
80
93
  /** sidebar search — live substring filter over asset + collection rows */
@@ -114,8 +127,12 @@ export class RepoSt {
114
127
  this.admin = new AdminSvc(this)
115
128
  this.review = new ReviewSt(this)
116
129
  this.trailer = new TrailerSt(this)
130
+ this.stores = new StoresSt(this)
131
+ this.veille = new VeilleSt(this)
132
+ this.social = new SocialSt(this)
117
133
  this.wiki = new WikiSt(this)
118
- makeAutoObservable<this, 'beat' | 'onceRead'>(this, { onceRead: false, home: false, key: false, base: false, clock: false, media: false, cols: false, tree: false, health: false, readme: false, checks: false, comfy: false, timeline: false, live: false, git: false, tests: false, admin: false, review: false, trailer: false, wiki: false, searchEl: false, beat: false })
134
+ this.pages = new PagesSvc(this)
135
+ makeAutoObservable<this, 'beat' | 'onceRead' | 'entry'>(this, { onceRead: false, entry: false, home: false, key: false, base: false, clock: false, media: false, cols: false, tree: false, health: false, readme: false, checks: false, comfy: false, timeline: false, live: false, git: false, tests: false, admin: false, review: false, trailer: false, stores: false, veille: false, social: false, wiki: false, pages: false, searchEl: false, beat: false })
119
136
  // a view or a filter changed on the review page: its address follows, the card unchanged
120
137
  reaction(
121
138
  () => (this.sel?.t === 'review' ? this.review.address : null),
@@ -195,6 +212,7 @@ export class RepoSt {
195
212
  this.media.start()
196
213
  this.cols.start()
197
214
  this.live.start()
215
+ this.pages.start()
198
216
  if (this.sel?.t === 'review') this.review.start()
199
217
  if (this.sel?.t === 'trailer') this.trailer.start()
200
218
  }
@@ -207,6 +225,7 @@ export class RepoSt {
207
225
  this.media.stop()
208
226
  this.cols.stop()
209
227
  this.live.stop()
228
+ this.pages.stop()
210
229
  this.review.stop()
211
230
  this.trailer.stop()
212
231
  }
@@ -280,20 +299,10 @@ export class RepoSt {
280
299
  void this.tests.load(check)
281
300
  }
282
301
 
283
- /** a walk with the tree's arrows is under way, and whether the current
284
- * history entry is its own: a held arrow opens ~30 pages a second, and
285
- * the browser throws past 100 pushState calls per 10 seconds */
286
- private walking = false
287
- private walked = false
288
- /** open pages as one walk: the first step is a history entry, every next
289
- * one rewrites it, so back returns to where the walk started */
302
+ /** a walk with the tree's arrows is one history entry (list-walk.ts) */
303
+ private readonly entry = new WalkEntry()
290
304
  walk(open: () => void): void {
291
- this.walking = true
292
- try {
293
- open()
294
- } finally {
295
- this.walking = false
296
- }
305
+ this.entry.run(open)
297
306
  }
298
307
 
299
308
  /** the ONE place a selection is written, so the url always describes what
@@ -312,12 +321,11 @@ export class RepoSt {
312
321
  if (cur.kind === next.kind && cur.col === next.col && cur.id === next.id) {
313
322
  // the trailer's note and filter, the review's view and filters ride on their page, as the tool set does on an
314
323
  // asset: no history entry
315
- if ((next.kind === 'trailer' || next.kind === 'review') && currentHash() !== h) history.replaceState(null, '', `#${h}`)
324
+ if ((next.kind === 'trailer' || next.kind === 'review' || next.kind === 'stores' || next.kind === 'veille' || next.kind === 'comms' || next.kind === 'page') && currentHash() !== h) history.replaceState(null, '', `#${h}`)
316
325
  return
317
326
  }
318
- if (this.walking && this.walked) history.replaceState(null, '', `#${h}`)
327
+ if (this.entry.how() === 'replace') history.replaceState(null, '', `#${h}`)
319
328
  else history.pushState(null, '', `#${h}`)
320
- this.walked = this.walking
321
329
  }
322
330
  /** one tree row, opened: an asset goes to the atelier, everything else to
323
331
  * its own item card. A gate check has a page of its own now, so nothing
@@ -325,6 +333,8 @@ export class RepoSt {
325
333
  openResource(r: Resource): void {
326
334
  if (r.type === 'process') return this.showProcesses(r.id.replace(/^process:/, ''))
327
335
  if (r.type === 'card') return this.showReview(r.id.replace(/^card:/, ''))
336
+ if (r.type === 'store') return this.showStores(r.id.replace(/^store:/, ''))
337
+ if (r.type === 'veille') return this.showVeille(this.veille.picked)
328
338
  if (r.type === 'cut') {
329
339
  const [trailer = null, cut = null] = r.id.replace(/^cut:/, '').split('/')
330
340
  return this.showTrailer(trailer, cut)
@@ -386,7 +396,7 @@ export class RepoSt {
386
396
  * the tree's while its cursor walks it, so a walk crosses these sections; a click in the page hands them back */
387
397
  pageKey(e: Pick<KeyboardEvent, 'key' | 'shiftKey'>): boolean {
388
398
  if (isTreeWalk(e.key) && !e.shiftKey && this.tree.cursor != null) return false
389
- return (this.sel?.t === 'review' && this.review.key(e)) || (this.sel?.t === 'trailer' && this.trailer.key(e))
399
+ return (this.sel?.t === 'review' && this.review.key(e)) || (this.sel?.t === 'trailer' && this.trailer.key(e)) || (this.sel?.t === 'stores' && this.stores.key(e)) || (this.sel?.t === 'veille' && this.veille.key(e)) || (this.sel?.t === 'comms' && this.social.key(e, 'comms')) || (this.sel?.t === 'social' && this.social.key(e, 'social'))
390
400
  }
391
401
  /** the trailer page on a trailer folder and one of its cuts, null for the first */
392
402
  showTrailer(trailer: string | null, cut: string | null, note: string | null = null, filter: 'open' | 'all' | null = null): void {
@@ -394,6 +404,47 @@ export class RepoSt {
394
404
  this.setSel({ t: 'trailer', trailer, cut, note, filter })
395
405
  if (this.polling) this.trailer.start()
396
406
  }
407
+ /** the stores page on a store, null for the first; `asset` a thing of it to scroll to, its note box open */
408
+ showStores(store: string | null, asset: string | null = null): void {
409
+ this.stores.select(store, asset)
410
+ this.setSel({ t: 'stores', store, ...(asset ? { asset } : {}) })
411
+ }
412
+
413
+ /** the Veille page, `post` the post picked; `q` its window, chips, folds and lightbox, as an address carries them */
414
+ showVeille(post: string | null, q?: string): void {
415
+ if (q !== undefined) this.veille.applyAddress(q)
416
+ this.veille.select(post)
417
+ const query = this.veille.address
418
+ this.setSel({ t: 'veille', post, ...(query ? { q: query } : {}) })
419
+ }
420
+
421
+ /** Communications on a draft, null for the first the list keeps, one message of its series; `q` the list's view
422
+ * as an address carries it */
423
+ showComms(draft: string | null, part: string | null = null, q?: string): void {
424
+ if (q !== undefined) this.social.applyCommsAddress(q)
425
+ this.social.selectDraft(draft, part)
426
+ const query = this.social.commsAddress
427
+ this.setSel({ t: 'comms', draft, ...(part ? { part } : {}), ...(query ? { q: query } : {}) })
428
+ }
429
+
430
+ /** Social on an identity, null for the repo's; its company (`@legal`) or an account, null for its card; a place */
431
+ showSocial(identity: string | null, account: string | null = null, place: string | null = null): void {
432
+ this.social.selectSocial(identity, account, place)
433
+ this.setSel({ t: 'social', identity, ...(identity && account ? { account } : {}), ...(identity && account && place ? { place } : {}) })
434
+ }
435
+
436
+ /** a repo's own page, `q` its keys as the address carries them: its frame is kept alive (frames-st.ts) */
437
+ showPage(id: string, q?: string): void {
438
+ this.home.frames.touch(this.key, id, this.pages.find(id)?.gl === true)
439
+ const keys = q ?? this.pages.keys.get(id)
440
+ this.setSel({ t: 'page', repo: this.name, id, ...(keys ? { q: keys } : {}) })
441
+ }
442
+ /** the keys a page's frame posted: its address follows in place, never a history entry a move */
443
+ pageMoved(id: string, q: string): void {
444
+ this.pages.keys.set(id, q)
445
+ if (this.sel?.t !== 'page' || this.sel.id !== id || (this.sel.q ?? '') === q) return
446
+ this.setSel({ t: 'page', repo: this.name, id, ...(q ? { q } : {}) })
447
+ }
397
448
 
398
449
  /** collection view — one card per instance */
399
450
  showCol(id: string): void {
@@ -417,6 +468,11 @@ export class RepoSt {
417
468
  case 'checks': return this.showChecks(sel.from)
418
469
  case 'review': return this.showReview(sel.id, sel.q ?? '')
419
470
  case 'trailer': return this.showTrailer(sel.trailer, sel.cut, sel.note ?? null, sel.filter ?? null)
471
+ case 'stores': return this.showStores(sel.store, sel.asset ?? null)
472
+ case 'veille': return this.showVeille(sel.post, sel.q ?? '')
473
+ case 'comms': return this.showComms(sel.draft, sel.part ?? null, sel.q ?? '')
474
+ case 'social': return this.showSocial(sel.identity, sel.account ?? null, sel.place ?? null)
475
+ case 'page': return this.showPage(sel.id, sel.q)
420
476
  }
421
477
  }
422
478
  /** the url decides the page: a reload, back, forward and a pasted link
@@ -1,4 +1,4 @@
1
- // the dispatcher's board (wiki build/shipkit/review.md, Raised items): what the owner, a player or a rule raised, by state,
1
+ // the dispatcher's board (wiki tools/shipkit/review.md, Raised items): what the owner, a player or a rule raised, by state,
2
2
  // each with its topic and its worker, a stale claim marked (`GET /api/review/board`); who holds the dispatcher role. A row
3
3
  // opens its item
4
4
  import { observer } from 'mobx-react-lite'
@@ -1,11 +1,11 @@
1
- // the cells of a thread, one framed card each (wiki build/shipkit/review.md, The review page): a header bar (who, when,
1
+ // the cells of a thread, one framed card each (wiki tools/shipkit/review.md, The review page): a header bar (who, when,
2
2
  // the kind, `v2`, fold, copy the id), then the body, or one line of summary when folded. A folded cell draws no media.
3
3
  // A version holds its words and its views, a verdict points back at the version it judged and lists his notes (a
4
4
  // click shows the view they sit on), a reply and a note are words; a run of state changes is one thin line
5
5
  import { observer } from 'mobx-react-lite'
6
6
  import type { EventCell, NoteCell, ReplyCell, VerdictCell, VersionCell } from '../../../review/cells.ts'
7
7
  import { isGallery, STATUS_LABEL, viewName, viewTag, type Rect } from '../../../review/model.ts'
8
- import { Icon, ICON } from '../icons.tsx'
8
+ import { Caret, Icon, ICON } from '../icons.tsx'
9
9
  import { renderMd } from '../md.ts'
10
10
  import { ageWords, stampWords } from '../time-ago.tsx'
11
11
  import { KindView, AnimPanel } from './kind-view.tsx'
@@ -53,7 +53,7 @@ export const CellFrame = observer(({ rv, card, c }: { rv: ReviewSt; card: Thread
53
53
  return (
54
54
  <article id={cellDom(c.id)} data-unread={unread ? c.id : undefined} className={`rv-c k-${c.kind} p-${c.party}${open ? '' : ' folded'}${head ? ' head' : ''} ${tone}`}>
55
55
  <header className="rv-chead" onClick={() => card.toggleCell(c)}>
56
- <button className="rv-foldbtn" aria-label={open ? 'fold' : 'unfold'} aria-expanded={open} onMouseDown={keepFocus} onClick={(e) => { e.stopPropagation(); card.toggleCell(c) }}>{open ? '▾' : '▸'}</button>
56
+ <button className="rv-foldbtn" aria-label={open ? 'fold' : 'unfold'} aria-expanded={open} onMouseDown={keepFocus} onClick={(e) => { e.stopPropagation(); card.toggleCell(c) }}><Caret open={open} /></button>
57
57
  <Avatar who={c.who} />
58
58
  {avatarText(c.who) === whoWords(c.who) ? null : <b className="rv-cwho">{whoWords(c.who)}</b>}
59
59
  <span className="rv-ckind">{c.kind === 'version' ? `v${c.n}` : c.kind === 'reply' && c.op ? (c.op === 'ask' ? 'question' : 'answer') : KIND_LABEL[c.kind]}</span>
@@ -100,7 +100,7 @@ const Clamp = observer(({ card, id, md }: { card: ThreadSt; id: string; md: stri
100
100
  <div className={`rv-clamp${open ? '' : ' shut'}`}>
101
101
  <div className="md rv-what" dangerouslySetInnerHTML={{ __html: renderMd(md) }} />
102
102
  {long ? (
103
- <button className="rv-more ghost" aria-expanded={open} onMouseDown={keepFocus} onClick={() => card.toggle(key, open)}>{open ? 'less ▴' : 'more ▾'}</button>
103
+ <button className="rv-more ghost" aria-expanded={open} onMouseDown={keepFocus} onClick={() => card.toggle(key, open)}>{open ? 'less' : 'more'} <Caret v open={open} /></button>
104
104
  ) : null}
105
105
  </div>
106
106
  )
@@ -117,6 +117,7 @@ const VersionBody = observer(({ rv, card, c }: { rv: ReviewSt; card: ThreadSt; c
117
117
  const VersionMain = observer(({ rv, card, c }: { rv: ReviewSt; card: ThreadSt; c: VersionCell }) => {
118
118
  const r = c.item
119
119
  const live = c.id === card.head?.id && card.takesVerdict
120
+ const claim = c.id === card.newest?.id && card.claims
120
121
  const stamp = card.cells.findLast((x) => x.on === c.id)?.id ?? c.id
121
122
  return (
122
123
  <>
@@ -129,7 +130,7 @@ const VersionMain = observer(({ rv, card, c }: { rv: ReviewSt; card: ThreadSt; c
129
130
  </div>
130
131
  <KindView app={rv} item={r} stamp={stamp} />
131
132
  <AnimPanel app={rv} item={r} />
132
- {r.views.length > 0 ? <VersionViews ver={{ rv, card, cell: c, live }} /> : null}
133
+ {r.views.length > 0 ? <VersionViews ver={{ rv, card, cell: c, live, claim }} /> : null}
133
134
  </>
134
135
  )
135
136
  })
@@ -28,19 +28,42 @@ export const kept = {
28
28
  /** a loader for a polled url: it sends the tag of its last answer for that same url, and on « not modified » gives
29
29
  * that answer again (the same object, so nothing draws again). A tag is the store's index build, the same for every
30
30
  * url, so it is only sent back to the url that answered it */
31
- export function etagLoader<T>(url: () => string): () => Promise<T> {
32
- let last: { url: string; tag: string; value: T } | null = null
33
- return async () => {
31
+ export type EtagLoader<T> = (() => Promise<T>) & {
32
+ /** the last answer for the url as it reads now, at once, with no request: what the page draws first */
33
+ held(): T | null
34
+ }
35
+
36
+ /** how many urls of one key the browser keeps: a filter or a mode switched back draws at once too */
37
+ const KEPT_URLS = 4
38
+
39
+ /** `keep`: the browser keeps the last answer of its last few urls under this key, so a page opened again (a reload,
40
+ * a daemon restarting, a filter switched back) draws it in the first frame, and its first request sends the kept tag */
41
+ export function etagLoader<T>(url: () => string, o: { keep?: string } = {}): EtagLoader<T> {
42
+ type Last = { url: string; tag: string; value: T }
43
+ const key = o.keep == null ? null : `shipkit.answer.${o.keep}`
44
+ let held: Last[] = []
45
+ if (key != null) {
46
+ try {
47
+ const v = JSON.parse(kept.get(key) ?? '[]') as unknown
48
+ held = Array.isArray(v) ? (v as Last[]) : []
49
+ } catch {
50
+ held = []
51
+ }
52
+ }
53
+ const of = (u: string): Last | null => held.find((x) => x.url === u) ?? null
54
+ const load = async (): Promise<T> => {
34
55
  const u = url()
35
- const held = last?.url === u ? last : null
36
- const res = await reach(u, { cache: 'no-store', headers: held ? { 'If-None-Match': held.tag } : {} })
37
- if (res.status === 304 && held) return held.value
56
+ const last = of(u)
57
+ const res = await reach(u, { cache: 'no-store', headers: last ? { 'If-None-Match': last.tag } : {} })
58
+ if (res.status === 304 && last) return last.value
38
59
  if (!res.ok) throw new Error(`${u}: HTTP ${res.status} ${await res.text().catch(() => '')}`.trim())
39
60
  const value = (await res.json()) as T
40
61
  const tag = res.headers.get('ETag')
41
- last = tag ? { url: u, tag, value } : null
62
+ held = [...(tag ? [{ url: u, tag, value }] : []), ...held.filter((x) => x.url !== u)].slice(0, key == null ? 1 : KEPT_URLS)
63
+ if (key != null) kept.put(key, JSON.stringify(held))
42
64
  return value
43
65
  }
66
+ return Object.assign(load, { held: (): T | null => (key == null ? null : of(url())?.value ?? null) })
44
67
  }
45
68
 
46
69
  export async function postJson<T>(url: string, body: unknown): Promise<T> {
@@ -1,9 +1,10 @@
1
- // a repo's review page (`#page:review`, wiki build/shipkit/review.md, The review page): the cards on the left, the open
1
+ // a repo's review page (`#page:review`, wiki tools/shipkit/review.md, The review page): the cards on the left, the open
2
2
  // one as a chat on the right (review-thread.tsx). On a phone one pane at a time: the cards, or the card with its answer
3
3
  // box and the verdicts under the thumb. Everything is read while the page shows
4
4
  import { observer } from 'mobx-react-lite'
5
5
  import { useEffect } from 'react'
6
- import { Group, Panel, Separator } from 'react-resizable-panels'
6
+ import { Panel, Separator } from 'react-resizable-panels'
7
+ import { KeptCols } from '../kept-cols.tsx'
7
8
  import type { RepoSt } from '../repo-st.ts'
8
9
  import { ReviewList } from './review-list.tsx'
9
10
  import type { ReviewSt } from './review-st.ts'
@@ -32,7 +33,7 @@ export const ReviewPage = observer(({ app }: { app: RepoSt }) => {
32
33
  return (
33
34
  <>
34
35
  <Toast rv={rv} />
35
- <Group className="rv-cols" orientation="horizontal">
36
+ <KeptCols id="review">
36
37
  <Panel id="review-list" defaultSize="24%" minSize={180} className="rv-pane" style={PANEL}>
37
38
  <ReviewList rv={rv} />
38
39
  </Panel>
@@ -40,7 +41,7 @@ export const ReviewPage = observer(({ app }: { app: RepoSt }) => {
40
41
  <Panel id="review-thread" defaultSize="76%" minSize={360} className="rv-pane" style={PANEL}>
41
42
  <ThreadColumn rv={rv} />
42
43
  </Panel>
43
- </Group>
44
+ </KeptCols>
44
45
  </>
45
46
  )
46
47
  })
@@ -51,7 +52,7 @@ export const PhoneTop = observer(({ app }: { app: RepoSt }) => (
51
52
  <div className="rv-phonetop">
52
53
  {app.home.embedded ? null : <button className="ghost" onClick={() => app.showReadme()}>◂ hub</button>}
53
54
  <b>{app.name}</b>
54
- <span className="rv-dim">{app.sel?.t === 'trailer' ? 'trailer' : `review${app.review.pendingCount > 0 ? ` · ${app.review.pendingCount} waiting` : ''}`}</span>
55
+ <span className="rv-dim">{app.sel?.t === 'trailer' ? 'trailer' : app.sel?.t === 'stores' ? 'stores' : app.sel?.t === 'veille' ? 'veille' : app.sel?.t === 'comms' ? 'communications' : app.sel?.t === 'social' ? 'social' : `review${app.review.pendingCount > 0 ? ` · ${app.review.pendingCount} waiting` : ''}`}</span>
55
56
  </div>
56
57
  ))
57
58
 
@@ -1,4 +1,4 @@
1
- // a repo's review page as state (wiki build/shipkit/review.md, The review page): the list as pages of threads
1
+ // a repo's review page as state (wiki tools/shipkit/review.md, The review page): the list as pages of threads
2
2
  // (`GET /api/review/threads`, the filters and the search asked of the server), the open card as a thread
3
3
  // (thread-st.ts), the watches, the board, his prefs. Every read is polled every 2 s while the page shows and answered
4
4
  // 304 when the store did not move. His drafts are kept in the browser until they are sent
@@ -8,7 +8,7 @@ import { MOVE_LABEL, pasteBlock, STATUS_LABEL, type Move, type ShownStatus, type
8
8
  import type { PasteHosts } from '../../../review/paste.ts'
9
9
  import type { Role } from '../../../review/role.ts'
10
10
  import type { RepoSt } from '../repo-st.ts'
11
- import { copyText, etagLoader, kept, postJson, ZOOMS, type Zoom } from './review-kit.ts'
11
+ import { copyText, etagLoader, kept, postJson, ZOOMS, type EtagLoader, type Zoom } from './review-kit.ts'
12
12
  import { ThreadSt, type Draft } from './thread-st.ts'
13
13
 
14
14
  /** a live `sk review watch`: its process, the session or lane it keeps, when it started */
@@ -20,10 +20,11 @@ export interface Watcher {
20
20
  }
21
21
 
22
22
  /** how a pair of images shows: side by side, the curtain, one over the other, the after alone */
23
- export type CompareMode = 'side' | 'swipe' | 'onion' | 'mod'
24
- export const COMPARE_MODES: readonly CompareMode[] = ['side', 'swipe', 'onion', 'mod']
25
- /** the side a rectangle lands on: the after alone draws on the after */
26
- export const drawnSide = (mode: CompareMode, drawn: 'before' | 'after'): 'before' | 'after' => (mode === 'mod' ? 'after' : drawn)
23
+ /** side by side, the curtain, the onion skin, the after alone, or only what changed (the after's changed pixels) */
24
+ export type CompareMode = 'side' | 'swipe' | 'onion' | 'mod' | 'diff'
25
+ export const COMPARE_MODES: readonly CompareMode[] = ['side', 'swipe', 'onion', 'mod', 'diff']
26
+ /** the side a rectangle lands on: the after alone and the changes draw on the after */
27
+ export const drawnSide = (mode: CompareMode, drawn: 'before' | 'after'): 'before' | 'after' => (mode === 'mod' || mode === 'diff' ? 'after' : drawn)
27
28
 
28
29
  /** a repo's review unit as the page reads it: the words of its kinds and topics, its dispatcher and who holds the role */
29
30
  export type RepoSpec = Spec & { role: Role | null; sources: string[]; auto: { id: string; every: string }[]; where?: PasteHosts | null }
@@ -63,6 +64,11 @@ export class CompareSt {
63
64
  this.mode = m
64
65
  kept.put(this.key, m)
65
66
  }
67
+ /** the next mode (D), or the one before (⇧D), round the list */
68
+ cycle(step: 1 | -1): void {
69
+ const i = COMPARE_MODES.indexOf(this.mode)
70
+ this.setMode(COMPARE_MODES[(i + step + COMPARE_MODES.length) % COMPARE_MODES.length]!)
71
+ }
66
72
  setSplit(v: number): void {
67
73
  this.split = Math.max(0, Math.min(1, v))
68
74
  }
@@ -146,14 +152,14 @@ export class ReviewSt {
146
152
  private starting: { card: ThreadSt | null; p: Promise<void> } | null = null
147
153
  /** the unit's words, read once a start, again after a stop */
148
154
  private specRead: Promise<unknown> | null = null
149
- private readonly loadPage: () => Promise<ThreadPage>
155
+ private readonly loadPage: EtagLoader<ThreadPage>
150
156
  private readonly loadWatchers: () => Promise<Watcher[]>
151
157
  private readonly loadBoard: () => Promise<{ role: Role | null; rows: BoardRow[] }>
152
158
  private readonly prefix: string
153
159
 
154
160
  constructor(private readonly st: RepoSt) {
155
161
  this.prefix = `shipkit.review.${st.key}.`
156
- this.loadPage = etagLoader(() => st.url(`/api/review/threads?${this.listQuery}`))
162
+ this.loadPage = etagLoader(() => st.url(`/api/review/threads?${this.listQuery}`), { keep: `review.${st.key}` })
157
163
  this.loadWatchers = etagLoader(() => st.url('/api/review/watchers'))
158
164
  this.loadBoard = etagLoader(() => st.url('/api/review/board'))
159
165
  this.compare = new CompareSt(`${this.prefix}compare`)
@@ -167,6 +173,8 @@ export class ReviewSt {
167
173
  } catch {
168
174
  // a broken pref is the default
169
175
  }
176
+ // the last list drawn in the first frame: the daemon answers after, and only what moved draws again
177
+ this.page = this.loadPage.held()
170
178
  makeAutoObservable<this, 'st' | 'toastTimer' | 'searchTimer' | 'timer' | 'starting' | 'specRead' | 'loadPage' | 'loadWatchers' | 'loadBoard' | 'prefix'>(this, {
171
179
  st: false,
172
180
  toastTimer: false,
@@ -529,22 +537,31 @@ export class ReviewSt {
529
537
  await this.copied(text, `copied for an agent: title, repo, sk review show, ${w?.phone ? 'links' : 'link'}`)
530
538
  }
531
539
 
540
+ /** a draft this card was turned into, opened in Communications: the hub's own, or the host's in a frame */
541
+ openDraft(slug: string): void {
542
+ if (this.st.home.embedded && window.parent !== window) window.parent.postMessage({ shipkit: 'show', page: 'comms', hash: `#page:comms:${slug}` }, location.origin)
543
+ else this.st.showComms(slug, null)
544
+ }
545
+
532
546
  /** one cell's id, for an agent to name it */
533
547
  async copyId(id: string): Promise<void> {
534
548
  await this.copied(id, `copied ${id}`)
535
549
  }
536
550
 
537
551
  private async copied(text: string, said: string): Promise<void> {
538
- const ok = await copyText(text)
539
- runInAction(() => {
540
- this.toast = ok ? said : 'the browser refused the copy'
541
- if (this.toastTimer !== null) clearTimeout(this.toastTimer)
542
- this.toastTimer = setTimeout(() => runInAction(() => (this.toast = null)), 2600)
543
- })
552
+ this.say((await copyText(text)) ? said : 'the browser refused the copy')
553
+ }
554
+
555
+ /** one line in the toast, gone after a few seconds */
556
+ say(text: string): void {
557
+ this.toast = text
558
+ if (this.toastTimer !== null) clearTimeout(this.toastTimer)
559
+ this.toastTimer = setTimeout(() => runInAction(() => (this.toast = null)), 2600)
544
560
  }
545
561
 
546
562
  /** the page's keys, as the atelier takes its own: true when it used the key. V approves, F ok with a fix, R rejects,
547
- * A archives, N the next waiting card, C copies the card for an agent, M the rings, ↑ ↓ the list; the card takes
563
+ * A archives, N the next waiting card, C copies the card for an agent, M the rings, T the contents, D the next
564
+ * compare mode of every pair (⇧D the one before), ↑ ↓ the list; the card takes
548
565
  * the rest (ThreadSt.key). A digit is read from its physical key (`code`), so ⇧ and an AZERTY keyboard read the same */
549
566
  key(e: Pick<KeyboardEvent, 'key' | 'shiftKey'> & { code?: string }): boolean {
550
567
  const card = this.card
@@ -558,6 +575,8 @@ export class ReviewSt {
558
575
  else if (k === 'n') this.nextPending()
559
576
  else if (k === 'c') void this.copyCard()
560
577
  else if (k === 'm') this.toggleMarks()
578
+ else if (k === 't') this.toggleRail()
579
+ else if (k === 'd') this.compare.cycle(e.shiftKey ? -1 : 1)
561
580
  else return false
562
581
  return true
563
582
  }
@@ -1,16 +1,16 @@
1
- // the open card as one chat (wiki build/shipkit/review.md, The review page): a bar on top (the title, where it stands,
2
- // fold or unfold all, the contents), the cells in time order with the newest at the bottom, the contents strip beside
1
+ // the open card as one chat (wiki tools/shipkit/review.md, The review page): a bar on top (the title, where it stands,
2
+ // fold or unfold all, on a phone the contents), the cells in time order with the newest at the bottom, the contents strip beside
3
3
  // them (every version, view, verdict and reply: a click scrolls there and unfolds it), and his answer box pinned under
4
4
  // them: one word, sent with a verdict or as a reply. The column opens scrolled to the newest cell
5
5
  import { observer } from 'mobx-react-lite'
6
6
  import { useEffect, useRef } from 'react'
7
- import { MOVE_LABEL, STATUS_LABEL, subjectLabel, viewName, viewTag } from '../../../review/model.ts'
7
+ import { isPostSubject, MOVE_LABEL, STATUS_LABEL, subjectLabel, viewName, viewTag, type ItemState } from '../../../review/model.ts'
8
8
  import { AutoText } from '../auto-text.tsx'
9
9
  import { Icon, ICON } from '../icons.tsx'
10
10
  import { AutoTag, Empty, keepFocus, LaneTag, Listeners, Rework, toneOf, VERDICTS } from './kit.tsx'
11
11
  import { CellFrame, EventsLine } from './review-cells.tsx'
12
12
  import type { ReviewSt } from './review-st.ts'
13
- import { cellDom, type ThreadSt, type ViewMark } from './thread-st.ts'
13
+ import { type ThreadSt, type ViewMark } from './thread-st.ts'
14
14
 
15
15
  /** `back`: where the phone's ◂ goes, the cards when absent; null when the page around the column draws its own */
16
16
  export const ThreadColumn = observer(({ rv, back }: { rv: ReviewSt; back?: (() => void) | null }) => {
@@ -55,8 +55,45 @@ export const ThreadColumn = observer(({ rv, back }: { rv: ReviewSt; back?: (() =
55
55
  )
56
56
  })
57
57
 
58
- /** the card's bar: its title, where it stands, its lane, who listens, the copy for an agent, fold or unfold all, the
59
- * contents; on the phone a way back to the cards */
58
+ const POST_STATE = (s: ItemState): string => (s.state === 'closed' ? (s.why === 'fixed' ? 'written' : s.why ?? 'closed') : s.state === 'claimed' ? 'in work' : 'asked')
59
+
60
+ /** « 📣 post »: this card deserves its own public post; each post already asked, where it stands, a click away */
61
+ const PostAsk = observer(({ rv, card }: { rv: ReviewSt; card: ThreadSt }) => {
62
+ const v = card.data
63
+ if (!v || isPostSubject(v.subject)) return null
64
+ return (
65
+ <>
66
+ {v.drafts.map((d) => (
67
+ <button key={d.slug} className="ghost rv-chip" title={`the draft written from this card: ${d.slug}, in comms`} onMouseDown={keepFocus} onClick={() => rv.openDraft(d.slug)}>📝 {d.title}</button>
68
+ ))}
69
+ {v.posts.map((p) => (
70
+ <button key={p.id} className="ghost rv-chip" title={`the post asked from this card: ${p.id}`} onMouseDown={keepFocus} onClick={() => rv.pick(p.id)}>📣 {POST_STATE(p.state)}</button>
71
+ ))}
72
+ <button className={card.postBox !== null ? 'on' : ''} title="this card deserves its own post: an agent writes the draft in comms" onMouseDown={keepFocus} onClick={() => (card.postBox === null ? card.openPost() : card.closePost())}>📣 post</button>
73
+ </>
74
+ )
75
+ })
76
+
77
+ /** his word on the post he asks: the angle, the account; Enter asks, an empty word too */
78
+ const PostBox = observer(({ card }: { card: ThreadSt }) => {
79
+ if (card.postBox === null) return null
80
+ return (
81
+ <div className="rv-postbox">
82
+ <AutoText autoFocus placeholder="its own post: the angle, the account (optional). Enter asks, Escape closes" value={card.postBox}
83
+ onText={(t) => card.setPost(t)}
84
+ onKeyDown={(e) => {
85
+ if (e.key === 'Enter' && !e.shiftKey) {
86
+ e.preventDefault()
87
+ void card.askPost()
88
+ } else if (e.key === 'Escape') card.closePost()
89
+ }} />
90
+ <button disabled={card.busy} onClick={() => void card.askPost()}>ask</button>
91
+ </div>
92
+ )
93
+ })
94
+
95
+ /** the card's bar: its title, where it stands, its lane, who listens, the copy for an agent, fold or unfold all; on the
96
+ * phone the contents and a way back to the cards */
60
97
  const TopBar = observer(({ rv, card, back }: { rv: ReviewSt; card: ThreadSt; back?: (() => void) | null }) => {
61
98
  const v = card.data
62
99
  const row = rv.openRow
@@ -70,6 +107,7 @@ const TopBar = observer(({ rv, card, back }: { rv: ReviewSt; card: ThreadSt; bac
70
107
  <Icon d={ICON.copy} />
71
108
  </button>
72
109
  </div>
110
+ <PostBox card={card} />
73
111
  {rv.phone.on && v ? <Minimap rv={rv} card={card} dir="row" /> : null}
74
112
  {v ? (
75
113
  <div className="rv-meta">
@@ -87,11 +125,13 @@ const TopBar = observer(({ rv, card, back }: { rv: ReviewSt; card: ThreadSt; bac
87
125
  ) : null}
88
126
  <Rework r={v.rework} />
89
127
  <span className="sp" />
128
+ <PostAsk rv={rv} card={card} />
90
129
  <span className="seg">
91
- <button title="fold every cell" onMouseDown={keepFocus} onClick={() => card.foldAll(false)}>fold all</button>
92
- <button title="unfold every cell (it loads every image)" onMouseDown={keepFocus} onClick={() => card.foldAll(true)}>unfold all</button>
130
+ <button className="rv-iconbtn" title="fold every cell" aria-label="fold every cell" onMouseDown={keepFocus} onClick={() => card.foldAll(false)}><Icon d={ICON.foldAll} /></button>
131
+ <button className="rv-iconbtn" title="unfold every cell (it loads every image)" aria-label="unfold every cell" onMouseDown={keepFocus} onClick={() => card.foldAll(true)}><Icon d={ICON.unfoldAll} /></button>
93
132
  </span>
94
- <button className={rv.rail || rv.sheet ? 'on' : ''} title="every item of the card: a click shows it" onMouseDown={keepFocus} onClick={() => rv.toggleRail()}>☰ contents</button>
133
+ {/* on a desk the strip (☰) and the panel (fold ›) carry the toggle in place; a phone has neither, so its contents sheet opens here */}
134
+ {rv.phone.on ? <button className={rv.sheet ? 'on' : ''} title="every item of the card" onMouseDown={keepFocus} onClick={() => rv.toggleRail()}>☰ contents</button> : null}
95
135
  </div>
96
136
  ) : card.error ? null : (
97
137
  <div className="rv-meta"><span className="spin" /> reading the thread…</div>
@@ -177,7 +217,8 @@ const Contents = observer(({ rv, card }: { rv: ReviewSt; card: ThreadSt }) => (
177
217
  <b>contents</b>
178
218
  <span className="rv-dim">{card.contents.length}</span>
179
219
  <span className="sp" />
180
- {rv.sheet ? <button className="ghost rv-x" aria-label="close" onClick={() => rv.closeSheet()}>✕</button> : null}
220
+ {rv.sheet ? <button className="ghost rv-x" aria-label="close" onClick={() => rv.closeSheet()}>✕</button>
221
+ : <button className="ghost rv-fold" title="fold the contents (T)" aria-label="fold the contents" onMouseDown={keepFocus} onClick={() => rv.toggleRail()}>fold ›</button>}
181
222
  </div>
182
223
  <Minimap rv={rv} card={card} dir="row" />
183
224
  <ol>
@@ -224,7 +265,7 @@ export const Minimap = observer(({ rv, card, dir }: { rv: ReviewSt; card: Thread
224
265
  const marks = card.viewMarks
225
266
  return (
226
267
  <nav className={`rv-mini ${dir}`} aria-label="the card's versions, the views of the one you answer, the answers">
227
- {dir === 'col' ? <button className="rv-miniopen" title="every item of the card" onMouseDown={keepFocus} onClick={() => rv.toggleRail()}>☰</button> : null}
268
+ {dir === 'col' ? <button className="rv-miniopen" title="show every item of the card (T)" onMouseDown={keepFocus} onClick={() => rv.toggleRail()}>☰</button> : null}
228
269
  {dir === 'row' && rv.phone.on ? <Waiting card={card} /> : null}
229
270
  {card.contents.filter((e) => e.kind !== 'view').map((e) => (
230
271
  <span key={e.key} className="rv-minigroup">
@@ -260,13 +301,21 @@ const Composer = observer(({ rv, card }: { rv: ReviewSt; card: ThreadSt }) => {
260
301
  const verdicts = card.takesVerdict
261
302
  const sent = h?.kind === 'version' ? card.verdictsOn(h.id).findLast((x) => x.current)?.verdict : undefined
262
303
  const newest = card.newest
304
+ const parked = card.parked === null ? null : card.versionOf(card.parked)
263
305
  return (
264
306
  <div className="rv-composer">
265
- {card.draftOn !== null && !card.keptOn && newest?.kind === 'version' && n !== null ? (
307
+ {card.draftOn !== null && newest?.kind === 'version' && n !== null ? (
308
+ <div className="rv-moved" role="status">
309
+ <span>your answer goes to v{n}, your draft is there; v{newest.n} is newer and takes your marks too</span>
310
+ <button className="primary" onClick={() => card.moveDraft()}>move it to v{newest.n}</button>
311
+ <button onClick={() => card.answerNewest()}>answer v{newest.n}</button>
312
+ </div>
313
+ ) : parked !== null && newest?.kind === 'version' ? (
266
314
  <div className="rv-moved" role="status">
267
- <span>your draft is on v{n}; v{newest.n} landed while you wrote</span>
315
+ <span>an unsent draft waits on v{parked.n}</span>
268
316
  <button className="primary" onClick={() => card.moveDraft()}>move it to v{newest.n}</button>
269
- <button onClick={() => card.keepDraftOn()}>keep it on v{n}</button>
317
+ <button onClick={() => card.answerParked()}>answer v{parked.n} with it</button>
318
+ <button className="ghost" onClick={() => card.dropParked()}>drop it</button>
270
319
  </div>
271
320
  ) : null}
272
321
  <div className="rv-goes">