rvlib-shipkit 2.27.0 → 2.28.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 (338) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/package.json +1 -1
  3. package/src/agent-time/hooks.ts +10 -3
  4. package/src/agent-time/live.ts +11 -5
  5. package/src/agent-time/registry.ts +289 -0
  6. package/src/agent-time/store.ts +2 -2
  7. package/src/annex/born.ts +2 -2
  8. package/src/annex/offload.ts +12 -11
  9. package/src/asks/ask-after.ts +6 -2
  10. package/src/asks/ask-bar-fold.ts +57 -0
  11. package/src/asks/ask-migrate.ts +280 -0
  12. package/src/asks/ask-steps-fold.ts +166 -0
  13. package/src/asks/ask-store.ts +586 -0
  14. package/src/assets/kits/identity-kit.ts +106 -38
  15. package/src/assets/kits/poster-thumbnail.ts +282 -0
  16. package/src/checks/SK003-claude-md-shape.check.ts +92 -25
  17. package/src/checks/SK004-gitignore-policy.check.ts +8 -4
  18. package/src/checks/SK013-one-way-in-policy.check.ts +10 -0
  19. package/src/checks/SK026-asks-autoclose.check.ts +9 -23
  20. package/src/checks/SK038-speaks-as.check.ts +3 -3
  21. package/src/checks/SK042-post-kinds.check.ts +26 -24
  22. package/src/checks/SK049-thread-answers-hook.check.ts +81 -0
  23. package/src/checks/SK050-retired-commands.check.ts +127 -0
  24. package/src/cli/cmd_Asks.ts +204 -53
  25. package/src/cli/cmd_Backup.ts +151 -8
  26. package/src/cli/cmd_Calls.ts +1 -0
  27. package/src/cli/cmd_Commands.ts +140 -34
  28. package/src/cli/cmd_Contracts.ts +1 -0
  29. package/src/cli/cmd_Keys.ts +1 -0
  30. package/src/cli/cmd_Lanes.ts +15 -4
  31. package/src/cli/cmd_Messages.ts +152 -1
  32. package/src/cli/cmd_Needs.ts +1 -0
  33. package/src/cli/cmd_Review.ts +931 -229
  34. package/src/cli/cmd_Secret.ts +255 -34
  35. package/src/cli/cmd_Social.ts +36 -33
  36. package/src/cli/cmd_SocialDrafts.ts +235 -0
  37. package/src/cli/cmd_Sound.ts +22 -1
  38. package/src/cli/cmd_Start.ts +3 -2
  39. package/src/cli/cmd_ThreadHolds.ts +34 -0
  40. package/src/cli/cmd_ThreadKinds.ts +146 -0
  41. package/src/cli/cmd_ThreadReflect.ts +83 -0
  42. package/src/cli/cmd_ThreadSyncNeeds.ts +62 -0
  43. package/src/cli/cmd_Vault.ts +1 -1
  44. package/src/cli/cmd_When.ts +1 -0
  45. package/src/cli/family-help.ts +2 -2
  46. package/src/cli/family-pages.ts +1 -1
  47. package/src/cli/kit/builtins.ts +1 -0
  48. package/src/cli/kit/verb.ts +6 -2
  49. package/src/cli/registry.ts +21 -2
  50. package/src/cli.ts +5 -2
  51. package/src/collections/actions.ts +25 -74
  52. package/src/collections/collection-types.ts +9 -5
  53. package/src/collections/md-body.ts +5 -3
  54. package/src/collections/pings.ts +13 -6
  55. package/src/collections/providers.ts +53 -61
  56. package/src/collections/reflections.ts +9 -4
  57. package/src/core/discover-checks.ts +18 -3
  58. package/src/core/git.ts +31 -0
  59. package/src/core/house-layout.ts +17 -0
  60. package/src/core/layout.ts +10 -5
  61. package/src/core/locked-write.ts +4 -1
  62. package/src/core/machine-db.ts +5 -3
  63. package/src/core/migrate-layout.ts +8 -10
  64. package/src/home/activity.ts +8 -15
  65. package/src/home/daemon-jobs.ts +13 -1
  66. package/src/home/home-paths.ts +6 -3
  67. package/src/home/home-routes.ts +8 -0
  68. package/src/home/inbox-shape.ts +233 -100
  69. package/src/home/inbox.ts +26 -71
  70. package/src/home/machine-fold.ts +10 -15
  71. package/src/home/machine-host.ts +19 -1
  72. package/src/home/other-macs.ts +2 -2
  73. package/src/home/serve-web.ts +6 -5
  74. package/src/home/space-page.ts +1 -1
  75. package/src/home/vault-page.ts +51 -17
  76. package/src/home/vault-words.ts +2 -2
  77. package/src/hooks/one-way-in-guard.ts +24 -2
  78. package/src/hq/files-send.ts +27 -28
  79. package/src/hq/hq-db.ts +4 -1
  80. package/src/hq/hq-local.ts +37 -4
  81. package/src/hq/hq-routes.ts +10 -2
  82. package/src/hq/hq-store.ts +6 -2
  83. package/src/hq/kinds/ask.ts +6 -6
  84. package/src/hq/outbox.ts +5 -3
  85. package/src/hq/replica.ts +1 -2
  86. package/src/hq/vault-route.ts +112 -0
  87. package/src/identities/collection.ts +2 -2
  88. package/src/identities/identities.ts +9 -8
  89. package/src/identities/machine-route.ts +8 -3
  90. package/src/ledger/db.ts +8 -1
  91. package/src/media-store/backup/daemon.ts +48 -8
  92. package/src/media-store/backup/keys.ts +1 -1
  93. package/src/media-store/backup/manifest.ts +20 -2
  94. package/src/media-store/backup/prune.ts +365 -0
  95. package/src/media-store/backup/retention.ts +122 -0
  96. package/src/media-store/backup/run.ts +14 -8
  97. package/src/media-store/backup/sources.ts +18 -17
  98. package/src/media-store/backup/thread-copy.ts +340 -0
  99. package/src/media-store/copy/config.ts +3 -4
  100. package/src/media-store/copy/store.ts +2 -2
  101. package/src/media-store/db.ts +2 -2
  102. package/src/media-store/forget.ts +118 -0
  103. package/src/media-store/purge.ts +3 -2
  104. package/src/media-store/space-listing.ts +20 -4
  105. package/src/media-store/space.ts +6 -5
  106. package/src/messages/guard.ts +49 -0
  107. package/src/messages/model.ts +1 -1
  108. package/src/messages/objects.ts +201 -0
  109. package/src/messages/routes.ts +2 -2
  110. package/src/messages/score.ts +1 -1
  111. package/src/messages/write.ts +285 -0
  112. package/src/pages/frame-client.ts +181 -4
  113. package/src/reflections/reflections-queue.ts +1 -1
  114. package/src/release/gate-checkout.ts +2 -1
  115. package/src/release/git-facts.ts +3 -2
  116. package/src/release/public-clean.ts +3 -2
  117. package/src/repo-config.ts +40 -18
  118. package/src/review/anim.ts +1 -1
  119. package/src/review/answer-kinds.ts +131 -0
  120. package/src/review/band.ts +53 -0
  121. package/src/review/branch-hold.ts +84 -0
  122. package/src/review/card-db.ts +16 -6
  123. package/src/review/card-rows.ts +4 -3
  124. package/src/review/cells.ts +297 -65
  125. package/src/review/close.ts +92 -0
  126. package/src/review/draft-card.ts +8 -16
  127. package/src/review/draft-model.ts +2 -2
  128. package/src/review/events.ts +171 -0
  129. package/src/review/format.ts +128 -14
  130. package/src/review/glyphs.ts +63 -0
  131. package/src/review/gone.ts +1 -1
  132. package/src/review/holds-sync.ts +62 -0
  133. package/src/review/holds.ts +85 -0
  134. package/src/review/house-kind-defs.ts +41 -0
  135. package/src/review/inbox-hook.ts +22 -9
  136. package/src/review/inbox-read.ts +201 -0
  137. package/src/review/instructions.ts +199 -0
  138. package/src/review/kind-apply.ts +61 -0
  139. package/src/review/kind-catalog.ts +96 -0
  140. package/src/review/kinds.ts +278 -0
  141. package/src/review/lane-ask.ts +109 -0
  142. package/src/review/model.ts +396 -86
  143. package/src/review/move.ts +3 -3
  144. package/src/review/need-address.ts +15 -0
  145. package/src/review/need-threads.ts +93 -0
  146. package/src/review/object-card.ts +48 -0
  147. package/src/review/object-read.ts +31 -0
  148. package/src/review/owner-verdict.ts +36 -0
  149. package/src/review/parties.ts +182 -0
  150. package/src/review/previews.ts +3 -1
  151. package/src/review/projections.ts +235 -0
  152. package/src/review/referring.ts +54 -0
  153. package/src/review/reflection-object.ts +195 -0
  154. package/src/review/routes.ts +137 -32
  155. package/src/review/secret-route.ts +80 -0
  156. package/src/review/snooze.ts +38 -0
  157. package/src/review/stage-card.ts +4 -4
  158. package/src/review/store.ts +366 -85
  159. package/src/review/supersede.ts +116 -0
  160. package/src/review/take-back.ts +52 -0
  161. package/src/review/thread-fold.ts +20 -7
  162. package/src/review/threads.ts +236 -39
  163. package/src/review/traces.ts +218 -0
  164. package/src/review/trailer-card.ts +2 -2
  165. package/src/review/unit.ts +71 -5
  166. package/src/review/verdict-items.ts +73 -0
  167. package/src/review/verdict-write.ts +15 -0
  168. package/src/review/wait.ts +85 -0
  169. package/src/review/watchers.ts +22 -9
  170. package/src/scaffold/files/claude-settings-local.json +2 -0
  171. package/src/secrets/archive-mark.ts +52 -0
  172. package/src/secrets/archive.ts +83 -0
  173. package/src/secrets/copy.ts +14 -14
  174. package/src/secrets/keychain-write.ts +48 -0
  175. package/src/secrets/keychain.ts +8 -5
  176. package/src/secrets/lapse-mark.ts +33 -0
  177. package/src/secrets/lapse.ts +60 -0
  178. package/src/secrets/list.ts +16 -22
  179. package/src/secrets/manager.ts +31 -16
  180. package/src/secrets/read.ts +161 -33
  181. package/src/secrets/tail.ts +31 -0
  182. package/src/serve/hub-app/asks-page.tsx +2 -1
  183. package/src/serve/hub-app/auto-text.tsx +14 -6
  184. package/src/serve/hub-app/benign-errors.ts +15 -1
  185. package/src/serve/hub-app/card-head.tsx +49 -0
  186. package/src/serve/hub-app/check-view.tsx +3 -2
  187. package/src/serve/hub-app/code-copy.ts +35 -0
  188. package/src/serve/hub-app/col-card.tsx +31 -40
  189. package/src/serve/hub-app/col-list-page.tsx +5 -2
  190. package/src/serve/hub-app/col-tables-view.tsx +7 -4
  191. package/src/serve/hub-app/col-tables.ts +5 -5
  192. package/src/serve/hub-app/cols-svc.ts +4 -79
  193. package/src/serve/hub-app/commands/commands-page.tsx +2 -1
  194. package/src/serve/hub-app/controls.css +83 -0
  195. package/src/serve/hub-app/frames-st.ts +17 -1
  196. package/src/serve/hub-app/git-view.tsx +3 -2
  197. package/src/serve/hub-app/home-st.ts +57 -6
  198. package/src/serve/hub-app/home-strip.css +1 -6
  199. package/src/serve/hub-app/home-strip.tsx +2 -1
  200. package/src/serve/hub-app/home.html +3 -0
  201. package/src/serve/hub-app/house-wiki-view.tsx +20 -0
  202. package/src/serve/hub-app/hub-app.tsx +48 -32
  203. package/src/serve/hub-app/hub-types.ts +2 -0
  204. package/src/serve/hub-app/hub.css +50 -61
  205. package/src/serve/hub-app/icons.tsx +14 -4
  206. package/src/serve/hub-app/identities-view.tsx +4 -3
  207. package/src/serve/hub-app/inbox-st.ts +203 -42
  208. package/src/serve/hub-app/inbox-view.tsx +189 -101
  209. package/src/serve/hub-app/inbox.css +47 -44
  210. package/src/serve/hub-app/index.html +3 -0
  211. package/src/serve/hub-app/instructions.css +30 -0
  212. package/src/serve/hub-app/keys.ts +5 -3
  213. package/src/serve/hub-app/machine-st.ts +2 -2
  214. package/src/serve/hub-app/machines-view.tsx +4 -11
  215. package/src/serve/hub-app/machines.css +0 -9
  216. package/src/serve/hub-app/markdown.css +51 -0
  217. package/src/serve/hub-app/md-copy.tsx +18 -40
  218. package/src/serve/hub-app/md.ts +25 -9
  219. package/src/serve/hub-app/media-view.tsx +2 -2
  220. package/src/serve/hub-app/messages/messages-page.tsx +2 -1
  221. package/src/serve/hub-app/messages/messages-st.ts +1 -1
  222. package/src/serve/hub-app/messages.css +0 -1
  223. package/src/serve/hub-app/objects.css +51 -0
  224. package/src/serve/hub-app/page-keys.ts +1 -1
  225. package/src/serve/hub-app/pages-frames.tsx +11 -1
  226. package/src/serve/hub-app/palette-st.ts +4 -4
  227. package/src/serve/hub-app/pane-boundary.tsx +72 -0
  228. package/src/serve/hub-app/pane-errors.ts +54 -0
  229. package/src/serve/hub-app/plan-view.tsx +3 -2
  230. package/src/serve/hub-app/planned-view.tsx +3 -3
  231. package/src/serve/hub-app/planned.css +0 -4
  232. package/src/serve/hub-app/processes-view.tsx +3 -2
  233. package/src/serve/hub-app/project-list.css +5 -13
  234. package/src/serve/hub-app/project-list.tsx +3 -6
  235. package/src/serve/hub-app/projects-svc.ts +6 -2
  236. package/src/serve/hub-app/readme.css +9 -15
  237. package/src/serve/hub-app/reflections-page.tsx +54 -1
  238. package/src/serve/hub-app/releases/releases-page.tsx +3 -2
  239. package/src/serve/hub-app/releases.css +0 -1
  240. package/src/serve/hub-app/review/code-colors.ts +30 -0
  241. package/src/serve/hub-app/review/diff-view.tsx +75 -0
  242. package/src/serve/hub-app/review/dock.tsx +104 -0
  243. package/src/serve/hub-app/review/draft-card.tsx +2 -2
  244. package/src/serve/hub-app/review/group-block.tsx +209 -0
  245. package/src/serve/hub-app/review/instructions-view.tsx +116 -0
  246. package/src/serve/hub-app/review/item-verdict.tsx +38 -0
  247. package/src/serve/hub-app/review/kind-states.tsx +193 -0
  248. package/src/serve/hub-app/review/kind-view.tsx +1 -37
  249. package/src/serve/hub-app/review/kit.tsx +57 -54
  250. package/src/serve/hub-app/review/lane-bar.tsx +64 -0
  251. package/src/serve/hub-app/review/object-card.tsx +62 -0
  252. package/src/serve/hub-app/review/object-panel.tsx +179 -0
  253. package/src/serve/hub-app/review/question-views.tsx +385 -0
  254. package/src/serve/hub-app/review/review-cells.tsx +86 -105
  255. package/src/serve/hub-app/review/review-list.tsx +104 -47
  256. package/src/serve/hub-app/review/review-page.tsx +5 -4
  257. package/src/serve/hub-app/review/review-st.ts +68 -28
  258. package/src/serve/hub-app/review/review-thread.tsx +171 -40
  259. package/src/serve/hub-app/review/review-views.tsx +35 -31
  260. package/src/serve/hub-app/review/thread-close.tsx +124 -0
  261. package/src/serve/hub-app/review/thread-control.tsx +4 -4
  262. package/src/serve/hub-app/review/thread-st.ts +222 -22
  263. package/src/serve/hub-app/review/trailer-card.tsx +1 -1
  264. package/src/serve/hub-app/review/trailer-timeline.tsx +2 -2
  265. package/src/serve/hub-app/review.css +216 -57
  266. package/src/serve/hub-app/section-head.tsx +51 -0
  267. package/src/serve/hub-app/social/calendar.tsx +5 -11
  268. package/src/serve/hub-app/social/comms-page.tsx +23 -10
  269. package/src/serve/hub-app/social/kit.tsx +8 -15
  270. package/src/serve/hub-app/social/next-release.tsx +3 -5
  271. package/src/serve/hub-app/social/post-card.tsx +3 -0
  272. package/src/serve/hub-app/social/post-page.tsx +80 -0
  273. package/src/serve/hub-app/social/problems.tsx +5 -9
  274. package/src/serve/hub-app/social/social-model.ts +13 -5
  275. package/src/serve/hub-app/social/social-page.tsx +1 -1
  276. package/src/serve/hub-app/social/social-st.ts +42 -5
  277. package/src/serve/hub-app/social.css +7 -17
  278. package/src/serve/hub-app/space.css +1 -1
  279. package/src/serve/hub-app/stores/stores-page.tsx +6 -2
  280. package/src/serve/hub-app/thread-row.tsx +101 -0
  281. package/src/serve/hub-app/time-ago.tsx +3 -2
  282. package/src/serve/hub-app/time-view.tsx +2 -1
  283. package/src/serve/hub-app/time.css +2 -5
  284. package/src/serve/hub-app/tree-row.tsx +1 -9
  285. package/src/serve/hub-app/vault-view.tsx +4 -4
  286. package/src/serve/hub-app/veille/veille-page.tsx +2 -11
  287. package/src/serve/hub-app/veille.css +0 -1
  288. package/src/serve/hub-app/waiting-svc.ts +4 -4
  289. package/src/serve/hub-app/when-view.tsx +6 -3
  290. package/src/serve/hub-app/wiki-st.ts +30 -4
  291. package/src/serve/hub-app/wikis-view.tsx +4 -3
  292. package/src/serve/hub-runtime.ts +20 -6
  293. package/src/serve/project-gutter-route.ts +16 -6
  294. package/src/serve/project-gutter.ts +6 -53
  295. package/src/serve/same-origin.ts +3 -0
  296. package/src/serve/secret-gate.ts +21 -0
  297. package/src/serve/serve-hub.ts +29 -20
  298. package/src/serve/tailnet-caller.ts +117 -0
  299. package/src/shipkit.ts +2 -2
  300. package/src/site/desk.ts +2 -2
  301. package/src/smoke/run-smoke.ts +3 -4
  302. package/src/social/brands.ts +4 -0
  303. package/src/social/card-drafts.ts +11 -19
  304. package/src/social/desk-index.ts +34 -13
  305. package/src/social/drafts.ts +4 -4
  306. package/src/social/import-drafts.ts +244 -0
  307. package/src/social/kind-pages.ts +3 -3
  308. package/src/social/kinds.ts +1 -1
  309. package/src/social/load.ts +89 -64
  310. package/src/social/media-kind.ts +68 -161
  311. package/src/social/media-of.ts +5 -4
  312. package/src/social/open.ts +3 -2
  313. package/src/social/post-object.ts +120 -0
  314. package/src/social/post-sources.ts +136 -0
  315. package/src/social/post-text.ts +103 -0
  316. package/src/social/posts.ts +378 -0
  317. package/src/social/presence.ts +7 -5
  318. package/src/social/publish/index.ts +17 -5
  319. package/src/social/publish/secret.ts +2 -2
  320. package/src/social/release-stage.ts +58 -57
  321. package/src/social/routes.ts +64 -24
  322. package/src/social/stage.ts +42 -57
  323. package/src/social/text.ts +4 -3
  324. package/src/social/thumbnail.ts +135 -43
  325. package/src/social/tracker.ts +1 -1
  326. package/src/social/writes.ts +12 -29
  327. package/src/stores/desk.ts +16 -11
  328. package/src/stores/unit.ts +2 -2
  329. package/src/trailer/sound/eleven.ts +33 -3
  330. package/src/urls/rows.ts +1 -1
  331. package/src/vault/vault-http.ts +11 -3
  332. package/src/vault/vault-import.ts +6 -1
  333. package/src/veille/identity.ts +2 -2
  334. package/src/wiki/graph-pages.ts +13 -1
  335. package/src/wiki/scan-md.ts +1 -1
  336. package/src/asks/asks-queue.ts +0 -424
  337. package/src/messages/suggest.ts +0 -96
  338. package/src/social/migrate.ts +0 -123
@@ -15,7 +15,7 @@ import { blurOnEscape, boxReaction, FIT_ROOM, keepFocus, Key, PAIR_NAMES, PLACE_
15
15
  import { BOX_ZOOM, boxStep, GALLERY_FITS, GALLERY_MODES, PREVIEW_H, TILE_H, ZOOMS, type BoxZoom, type GalleryFit, type GalleryMode, type Zoom } from './review-kit.ts'
16
16
  import { notePlace } from './note-place.ts'
17
17
  import { COMPARE_MODES, drawnSide, type CompareMode, type CompareSt, type PairSide, type ReviewSt } from './review-st.ts'
18
- import { TILE_FILTERS, viewDom, viewKind, viewKey, type SaidNote, type ThreadSt, type TileFilter } from './thread-st.ts'
18
+ import { TILE_FILTERS, viewDom, viewKind, type SaidNote, type ThreadSt, type TileFilter } from './thread-st.ts'
19
19
  import { Caret, Icon, ICON } from '../icons.tsx'
20
20
  import { Pop } from '../floating.tsx'
21
21
 
@@ -51,7 +51,8 @@ export const VersionViews = observer(({ ver }: { ver: Ver }) => {
51
51
  // a draft card's history is no view of its own: its frames cycle in place over the live one
52
52
  const history = item.wip ? views.find(isGallery) : undefined
53
53
  // a view an agent's update holds draws in that update's cell, at its time in the thread
54
- const owned = new Set(card.updateViewsOf(item.id))
54
+ const owned = card.messageViewsOf(item.id)
55
+ if (views.length > 0 && views.every((_, i) => owned.has(i))) return null
55
56
  const options = rows || (card.full[item.id] === true)
56
57
  return (
57
58
  <div className="rv-views">
@@ -71,7 +72,7 @@ export const VersionViews = observer(({ ver }: { ver: Ver }) => {
71
72
  </label>
72
73
  ) : null}
73
74
  {views.some((v) => !isGallery(v)) ? (
74
- <span className="seg" title="the zoom of every view of every card">
75
+ <span className="seg" title="the zoom of every view of every version">
75
76
  {ZOOMS.map((z) => <button key={z} className={rv.zoom === z ? 'on' : ''} onMouseDown={keepFocus} onClick={() => rv.setZoom(z)}>{ZOOM_LABEL[z]}</button>)}
76
77
  </span>
77
78
  ) : null}
@@ -272,7 +273,7 @@ const OptionRow = observer(({ ver, v, i }: { ver: Ver; v: ReviewView; i: number
272
273
  ) : null}
273
274
  {playable?.audio ? <a className="rv-dl" href={rv.fileUrl(id, file)} download={`${id}-${file}`} title="download the sound">⤓</a> : null}
274
275
  {choice && takes(ver) ? (
275
- <button className={`rv-pick${picked ? ' on' : ''}`} title={held ? 'your pick: click again to take it back, the card waits for you again' : 'pick this one: it is your answer (P)'} disabled={card.busy} onClick={() => mark(ver, () => void card.choose(i))}>
276
+ <button className={`rv-pick${picked ? ' on' : ''}`} title={held ? 'your pick: click again to take it back, the version waits for you again' : 'pick this one: it is your answer (P)'} disabled={card.busy} onClick={() => mark(ver, () => void card.choose(i))}>
276
277
  {picked ? '✓ picked' : 'pick'}
277
278
  {held ? <span className="rv-undo" aria-label="click again to take it back"> ↺</span> : null}
278
279
  </button>
@@ -308,7 +309,7 @@ const goneOf = (ver: Ver, v: ReviewView): string[] => {
308
309
  const Gone = ({ files }: { files: readonly string[] }) => (
309
310
  <div className="rv-gone">
310
311
  <b>the media is gone from the store</b>
311
- <span className="rv-dim">{files.join(', ')}: deleted after the card was sent; its words and answers stay</span>
312
+ <span className="rv-dim">{files.join(', ')}: deleted after the version was sent; its words and answers stay</span>
312
313
  </div>
313
314
  )
314
315
 
@@ -536,12 +537,11 @@ const SMALL_SIZES = [16, 32, 64] as const
536
537
  /** one gallery tile: its image (its before while flipped or peeked), the small sizes, its label, stars, the variant
537
538
  * pick on a row, OK fix or no and a word; a click shows it large at the column's size. `fill`: drawn large in the
538
539
  * tabs or the list, at the fit he picks (the column's width, or the screen), with no click to shrink it */
539
- const Tile = observer(({ ver, v, view, t, k, fill = false }: { ver: Ver; v: GalleryView; view: number; t: GalleryTile; k: number; fill?: boolean }) => {
540
+ const Tile = observer(({ ver, v, view, t, k, fill = false, boxed = false }: { ver: Ver; v: GalleryView; view: number; t: GalleryTile; k: number; fill?: boolean; boxed?: boolean }) => {
540
541
  const { rv, card, cell } = ver
541
542
  const id = itemOf(ver).id
542
- const big = card.bigTile === `${viewKey(id, view)}/${k}`
543
543
  const r = card.reactionShown(cell, view, k)
544
- if (!big && !card.tileShown(r)) return null
544
+ if (!boxed && !card.tileShown(r)) return null
545
545
  const live = takes(ver)
546
546
  const h = rv.tileH
547
547
  const ratio = t.size.w / t.size.h
@@ -550,15 +550,16 @@ const Tile = observer(({ ver, v, view, t, k, fill = false }: { ver: Ver; v: Gall
550
550
  const ih = Math.round(iw / ratio)
551
551
  const file = t.before && card.showsBefore(view, k) ? t.before : t.file
552
552
  const thumb = rv.thumbUrl(id, file)
553
- const src = big || fill || h > TILE_H.thumb ? rv.fitUrl(id, file) : thumb
554
- const toggle = (): void => { if (!fill) card.toggleTile(id, view, k) }
553
+ const src = boxed || fill || h > TILE_H.thumb ? rv.fitUrl(id, file) : thumb
554
+ // a click shows the tile large in the lightbox, where ← → step through the gallery
555
+ const toggle = (): void => { if (!boxed) card.openBox(cell.id, view, k) }
555
556
  const aspect = `${t.size.w} / ${t.size.h}`
556
557
  // the height a fit takes: the column's, or the lightbox's stage (--fit-h, review.css), less what sits under the image
557
558
  const screen = { width: `min(100%, calc((var(--fit-h, 100vh - ${FIT_ROOM - TILE_UNDER}px) - ${TILE_UNDER}px) * ${ratio}))`, aspectRatio: aspect }
558
- const imgStyle = fill ? (rv.galleryFit === 'width' ? { width: '100%', aspectRatio: aspect } : screen) : big ? screen : { width: iw, height: ih }
559
- const title = live ? (fill ? 'drag to circle a spot' : 'drag to circle a spot, click to enlarge') : fill ? undefined : big ? 'click to shrink' : 'click to enlarge'
559
+ const imgStyle = boxed ? screen : fill ? (rv.galleryFit === 'width' ? { width: '100%', aspectRatio: aspect } : screen) : { width: iw, height: ih }
560
+ const title = boxed ? (live ? 'drag to circle a spot' : undefined) : live ? 'drag to circle a spot, click to see it large' : 'click to see it large'
560
561
  return (
561
- <div className={`rv-tile${big ? ' big' : ''}${fill ? ' fill' : ''}${r?.picked ? ' picked' : ''}${toneClass(r?.status)}`} style={big || fill ? undefined : { width: Math.max(iw, TILE_MIN_W) + TILE_CHROME }}
562
+ <div className={`rv-tile${boxed ? ' big' : ''}${fill ? ' fill' : ''}${r?.picked ? ' picked' : ''}${toneClass(r?.status)}`} style={boxed || fill ? undefined : { width: Math.max(iw, TILE_MIN_W) + TILE_CHROME }}
562
563
  onMouseEnter={live ? () => card.setHoverTile({ view, tile: k }) : undefined} onMouseLeave={live ? () => card.setHoverTile(null) : undefined}>
563
564
  <div className="rv-tileimg" onClick={live ? undefined : toggle} title={title} style={imgStyle}>
564
565
  <Marks ver={ver} src={src} side={undefined} view={view} tile={k} onTap={toggle} />
@@ -573,13 +574,13 @@ const Tile = observer(({ ver, v, view, t, k, fill = false }: { ver: Ver; v: Gall
573
574
  {SMALL_SIZES.map((px) => <img key={px} src={thumb} alt="" width={px} height={px} title={`${px} px`} draggable={false} loading="lazy" />)}
574
575
  </div>
575
576
  ) : null}
576
- <div className="rv-tilelabel" title={t.label}>{t.label}</div>
577
+ {boxed ? null : <div className="rv-tilelabel" title={t.label}>{t.label}</div>}
577
578
  {live || r?.stars ? <Stars ver={ver} view={view} tile={k} given={r?.stars} /> : null}
578
579
  {t.group && (live || r?.picked) ? (
579
580
  <button className={`rv-chip rv-keep${r?.picked ? ' on' : ''}`} disabled={!live} title={`keep this one for ${t.group}: one a row`} onMouseDown={keepFocus}
580
581
  onClick={() => mark(ver, () => card.pickTile(view, k, t.group ?? '', v.gallery))}>{r?.picked ? '✓ kept' : 'keep'}</button>
581
582
  ) : null}
582
- {live ? (
583
+ {boxed ? null : live ? (
583
584
  <>
584
585
  <ReactionToggles ver={ver} view={view} tile={k} small />
585
586
  <AutoText className="rv-word" placeholder="a word" value={r?.comment ?? ''} onKeyDown={blurOnEscape} onText={(t) => mark(ver, () => card.setReactionComment(view, k, t))} />
@@ -732,8 +733,11 @@ function boxOf(rv: ReviewSt, card: ThreadSt) {
732
733
  const media = isGallery(v) ? null : v
733
734
  const views = cell.item.views.length
734
735
  const ver: Ver = { rv, card, cell, live: cell.id === card.head?.id && card.takesVerdict, claim: cell.id === card.newest?.id && card.claims }
735
- const can = { step: views > 1, pair: media !== null && isPair(media.files) && !media.audio, size: media !== null && !media.audio }
736
- return { at: b.view, cell, v, media, views, ver, can, step: (by: number): void => card.openBox(cell.id, (b.view + by + views) % views) }
736
+ // a gallery's tile shown large: ← → step through its tiles, OK Fix No and the word are the tile's
737
+ const tile = isGallery(v) && b.tile !== undefined && v.gallery[b.tile] !== undefined ? { k: b.tile, t: v.gallery[b.tile]!, n: v.gallery.length } : null
738
+ const can = { step: tile ? tile.n > 1 : views > 1, pair: media !== null && isPair(media.files) && !media.audio, size: media !== null && !media.audio }
739
+ const step = (by: number): void => (tile ? card.openBox(cell.id, b.view, (tile.k + by + tile.n) % tile.n) : card.openBox(cell.id, (b.view + by + views) % views))
740
+ return { at: b.view, cell, v, media, views, ver, can, step, tile }
737
741
  }
738
742
 
739
743
  /** a step of the lightbox's size from the size the view is drawn at now */
@@ -746,7 +750,7 @@ const resizeOf = (rv: ReviewSt, stage: { current: HTMLElement | null }, v: Revie
746
750
  export function boxKey(rv: ReviewSt, card: ThreadSt, stage: { current: HTMLElement | null }, e: Pick<KeyboardEvent, 'key' | 'metaKey' | 'ctrlKey' | 'altKey'>, field: boolean): boolean {
747
751
  const x = boxOf(rv, card)
748
752
  if (x == null || e.metaKey || e.ctrlKey || e.altKey || (field && e.key !== 'Escape')) return false
749
- const { at, ver, can, step } = x
753
+ const { at, ver, can, step, tile } = x
750
754
  const said = boxReaction(e.key)
751
755
  if (e.key === 'Escape') card.closeBox()
752
756
  else if (can.step && (e.key === 'ArrowLeft' || e.key === 'ArrowRight')) step(e.key === 'ArrowLeft' ? -1 : 1)
@@ -754,7 +758,7 @@ export function boxKey(rv: ReviewSt, card: ThreadSt, stage: { current: HTMLEleme
754
758
  else if (can.size && e.key === '0') rv.setBoxZoom('fit')
755
759
  else if (can.size && (e.key === '+' || e.key === '=' || e.key === '-')) resizeOf(rv, stage, x.v)(e.key === '-' ? -1 : 1)
756
760
  else if (said != null) {
757
- if (takes(ver)) mark(ver, () => card.react(at, undefined, said))
761
+ if (takes(ver)) mark(ver, () => card.react(at, tile?.k, said))
758
762
  } else return false
759
763
  return true
760
764
  }
@@ -816,10 +820,10 @@ export const ViewBox = observer(({ rv, card }: { rv: ReviewSt; card: ThreadSt })
816
820
  export const BoxFrame = observer(({ rv, card, stage }: { rv: ReviewSt; card: ThreadSt; stage: React.RefObject<HTMLDivElement | null> }) => {
817
821
  const x = boxOf(rv, card)
818
822
  if (x == null) return null
819
- const { at, cell, v, media, views, ver, can, step } = x
820
- const shown = card.reactionShown(cell, at)
823
+ const { at, cell, v, media, views, ver, can, step, tile } = x
824
+ const shown = card.reactionShown(cell, at, tile?.k)
821
825
  const kind = viewKind(v, false)
822
- const name = v.label || kind
826
+ const name = tile ? tile.t.label : v.label || kind
823
827
  const files = filesOf(v)
824
828
  const said = card.saidOn(cell.id, at)
825
829
  const tag = viewTag(cell.n, at)
@@ -827,15 +831,15 @@ export const BoxFrame = observer(({ rv, card, stage }: { rv: ReviewSt; card: Thr
827
831
  <div className={`rv-viewbox${toneClass(shown?.status)}`} role="dialog" aria-modal="true" aria-label={`view ${tag}: ${name}`}>
828
832
  <header className="rv-boxbar rv-boxtop">
829
833
  <span className="rv-boxwhere">
830
- {can.step ? <button className="ghost rv-keybtn" title="the view before (←)" aria-label="the view before" onMouseDown={keepFocus} onClick={() => step(-1)}><Key k="←" /><span className="rv-nokey">‹</span></button> : null}
831
- <span className="rv-boxn rv-dim">{at + 1} of {views}</span>
832
- {can.step ? <button className="ghost rv-keybtn" title="the view after (→)" aria-label="the view after" onMouseDown={keepFocus} onClick={() => step(1)}><Key k="→" /><span className="rv-nokey">›</span></button> : null}
834
+ {can.step ? <button className="ghost rv-keybtn" title={tile ? 'the image before (←)' : 'the view before (←)'} aria-label="the one before" onMouseDown={keepFocus} onClick={() => step(-1)}><Key k="←" /><span className="rv-nokey">‹</span></button> : null}
835
+ <span className="rv-boxn rv-dim">{tile ? tile.k + 1 : at + 1} of {tile ? tile.n : views}</span>
836
+ {can.step ? <button className="ghost rv-keybtn" title={tile ? 'the image after (→)' : 'the view after (→)'} aria-label="the one after" onMouseDown={keepFocus} onClick={() => step(1)}><Key k="→" /><span className="rv-nokey">›</span></button> : null}
833
837
  <b className="rv-boxname" title={name}>{name}</b>
834
838
  {v.label && v.label.toLowerCase() !== kind.toLowerCase() ? <span className="rv-boxkind rv-dim">{kind}</span> : null}
835
839
  <span className="rv-boxtag" title={`view ${tag}`}>{tag}</span>
836
840
  <span className="rv-boxtitle rv-dim" title={cell.item.title}>{cell.item.title}</span>
837
841
  </span>
838
- {takes(ver) ? <ReactionToggles ver={ver} view={at} keys /> : shown?.status ? <SentReaction status={shown.status} /> : null}
842
+ {takes(ver) ? <ReactionToggles ver={ver} view={at} {...(tile ? { tile: tile.k } : {})} keys /> : shown?.status ? <SentReaction status={shown.status} /> : null}
839
843
  <span className="rv-boxlook">
840
844
  {can.pair && rv.phone.on ? <PhoneSides rv={rv} /> : null}
841
845
  {can.pair && !rv.phone.on ? <CompareModes c={rv.compare} clip={media?.clip !== undefined} keys /> : null}
@@ -843,19 +847,19 @@ export const BoxFrame = observer(({ rv, card, stage }: { rv: ReviewSt; card: Thr
843
847
  {media?.marks && media.marks.length > 0 ? <button className={rv.marksOn ? 'primary' : ''} title="the repo's own rings on the shot (M)" onMouseDown={keepFocus} onClick={() => rv.toggleMarks()}>marks<Key k="M" /></button> : null}
844
848
  {/* a phone sizes with a pinch: the size control is the keyboard's and the wheel's */}
845
849
  {can.size && !rv.phone.on ? <BoxZoomBar rv={rv} step={resizeOf(rv, stage, v)} /> : null}
846
- {isGallery(v) ? <GalleryHead ver={ver} v={v} /> : null}
850
+ {isGallery(v) && !tile ? <GalleryHead ver={ver} v={v} /> : null}
847
851
  </span>
848
852
  <button className="ghost rv-boxclose" title="close (Escape)" aria-label="close" onClick={() => card.closeBox()}>✕<Key k="esc" /></button>
849
853
  </header>
850
854
  <div ref={stage} className="rv-boxstage">
851
- <ViewCell ver={ver} v={v} i={at} boxed />
855
+ {tile && isGallery(v) ? <Tile ver={ver} v={v} view={at} t={tile.t} k={tile.k} boxed /> : <ViewCell ver={ver} v={v} i={at} boxed />}
852
856
  </div>
853
857
  <footer className="rv-boxbar rv-boxfoot">
854
858
  {media?.note ? <span className="rv-boxnote rv-dim" title={media.note}>{media.note}</span> : null}
855
859
  {said.length > 0 ? <div className="rv-boxsaid">{said.map((s, k) => <SaidLine key={k} s={s} v={v} n={cell.n} />)}</div> : null}
856
860
  {takes(ver) ? (
857
- <AutoText className="rv-word rv-boxword" placeholder={isGallery(v) ? 'a word on these images' : 'a word on this view'} value={(ver.live ? card.reactionOf(at)?.comment : undefined) ?? ''}
858
- onKeyDown={blurOnEscape} onText={(t) => mark(ver, () => card.setReactionComment(at, undefined, t))} />
861
+ <AutoText className="rv-word rv-boxword" placeholder={tile ? `a word on ${tile.t.label}` : isGallery(v) ? 'a word on these images' : 'a word on this view'} value={(ver.live ? card.reactionOf(at, tile?.k)?.comment : undefined) ?? ''}
862
+ onKeyDown={blurOnEscape} onText={(t) => mark(ver, () => card.setReactionComment(at, tile?.k, t))} />
859
863
  ) : <span className="sp" />}
860
864
  <span className="rv-boxfiles">
861
865
  {files.length > 0 ? <Downloads rv={rv} item={cell.item} files={files} /> : null}
@@ -915,7 +919,7 @@ const Downloads = observer(({ rv, item, files }: { rv: ReviewSt; item: Item; fil
915
919
  })}
916
920
  {/* the Finder is on the desktop only: a phone has none */}
917
921
  {rv.phone.on || files[0] === undefined ? null : (
918
- <button className="rv-dl ghost" title={`open the card's folder in the Finder, ${files[0].file} selected`} onClick={() => void rv.reveal(item.id, files[0]!.file)}>show in Finder</button>
922
+ <button className="rv-dl ghost" title={`open the version's folder in the Finder, ${files[0].file} selected`} onClick={() => void rv.reveal(item.id, files[0]!.file)}>show in Finder</button>
919
923
  )}
920
924
  </div>
921
925
  ))
@@ -0,0 +1,124 @@
1
+ // close a thread from its head, or open it again (wiki tools/shipkit/threads-page.md, Close and reopen): « done »,
2
+ // « not doing it » with an optional word, « reopen » once closed; the route takes the verb the head allows
3
+ // (review/close.ts). An ask's thread closes by its own record bar instead
4
+ import { observer } from 'mobx-react-lite'
5
+ import { useEffect, useState } from 'react'
6
+ import type { Hold } from '../../../review/holds.ts'
7
+ import { keepFocus } from './kit.tsx'
8
+ import { postJson } from './review-kit.ts'
9
+ import type { ReviewSt } from './review-st.ts'
10
+ import type { ThreadSt } from './thread-st.ts'
11
+
12
+ /** why a thread is closed, in plain words */
13
+ const CLOSED_WORDS: Record<string, string> = { fixed: 'done', wontfix: 'not doing it', approved: 'OK', archived: 'not doing it', dropped: 'dropped', withdrawn: 'withdrawn', superseded: 'a newer version redoes it', rated: 'marked', 'approved-with-fix': 'done, with the fix', rejected: 'redone' }
14
+
15
+ /** a standing hold as the server's check reads it now: its words, and a branch's facts */
16
+ type LiveHold = Hold & { facts?: { base?: string; ahead?: number; behind?: number; last?: { sha?: string; subject?: string; at?: string }; diff?: { url?: string; command?: string } } }
17
+
18
+ /** each object that holds the thread open, read now (`GET /api/review/<id>/holds`, review/holds-sync.ts): « held open by
19
+ * branch:app/x: 3 ahead of main », its last commit, the diff */
20
+ const HoldLines = ({ rv, head, holds }: { rv: ReviewSt; head: string; holds: Hold[] }) => {
21
+ const [live, setLive] = useState<LiveHold[] | null>(null)
22
+ const key = `${head}|${holds.map((h) => `${h.address}@${h.at}`).join(',')}`
23
+ useEffect(() => {
24
+ let off = false
25
+ fetch(rv.url(`/api/review/${head}/holds`))
26
+ .then((r) => (r.ok ? (r.json() as Promise<LiveHold[]>) : null))
27
+ .then((j) => void (!off && j && setLive(j)))
28
+ .catch(() => undefined)
29
+ return () => void (off = true)
30
+ }, [key])
31
+ return (
32
+ <>
33
+ {(live ?? holds).map((h) => {
34
+ const f = (h as LiveHold).facts
35
+ const last = f?.last?.subject ? `last commit ${f.last.sha ?? ''} « ${f.last.subject} »` : ''
36
+ return (
37
+ <span key={h.address} className="rv-dim rv-hold" title={[h.words, last, f?.diff?.command ?? ''].filter(Boolean).join('\n')}>
38
+ ⑂ {h.words}
39
+ {last ? ` · ${last}` : ''}
40
+ {f?.diff?.url ? (
41
+ <>
42
+ {' · '}
43
+ <a href={f.diff.url} target="_blank" rel="noreferrer">
44
+ the diff
45
+ </a>
46
+ </>
47
+ ) : null}
48
+ </span>
49
+ )
50
+ })}
51
+ </>
52
+ )
53
+ }
54
+
55
+ export const CloseBar = observer(({ rv, card }: { rv: ReviewSt; card: ThreadSt }) => {
56
+ const v = card.data
57
+ const [words, setWords] = useState<string | null>(null)
58
+ const [busy, setBusy] = useState(false)
59
+ const [err, setErr] = useState<string | null>(null)
60
+ if (!v || v.ask) return null
61
+ const held = v.holds.filter((h) => h.held)
62
+ const send = async (how: 'done' | 'wontfix' | 'reopen', note?: string): Promise<void> => {
63
+ setBusy(true)
64
+ setErr(null)
65
+ try {
66
+ await postJson(rv.url(`/api/review/${v.head}/close`), { how, ...(note?.trim() ? { note: note.trim() } : {}) })
67
+ setWords(null)
68
+ await card.refresh()
69
+ void rv.answered()
70
+ } catch (e) {
71
+ setErr((e as Error).message)
72
+ } finally {
73
+ setBusy(false)
74
+ }
75
+ }
76
+ // closed by the owner's verdict, still held: what holds it, and the owner's close, which wins and releases it
77
+ if (v.state.state === 'closed' && held.length > 0)
78
+ return (
79
+ <span className="rv-closebar on">
80
+ <span>{CLOSED_WORDS[v.state.why ?? ''] ?? v.state.why ?? 'closed'}, held open</span>
81
+ <HoldLines rv={rv} head={v.head} holds={held} />
82
+ <button className="ghost" disabled={busy} title="close it now: the holds are released and named in the thread" onMouseDown={keepFocus} onClick={() => void send('done')}>✓ close anyway</button>
83
+ {err ? <span className="err">✗ {err}</span> : null}
84
+ </span>
85
+ )
86
+ if (v.state.state === 'closed')
87
+ return (
88
+ <span className="rv-closebar on">
89
+ <span>closed · {CLOSED_WORDS[v.state.why ?? ''] ?? v.state.why ?? 'closed'}</span>
90
+ <button className="ghost" disabled={busy} title="open the thread again: it waits on its holder or on you" onMouseDown={keepFocus} onClick={() => void send('reopen')}>reopen</button>
91
+ {err ? <span className="err">✗ {err}</span> : null}
92
+ </span>
93
+ )
94
+ return (
95
+ <span className="rv-closebar">
96
+ {held.length > 0 ? <HoldLines rv={rv} head={v.head} holds={held} /> : null}
97
+ {words === null ? (
98
+ <>
99
+ <button className="ghost" disabled={busy} title="close the thread as done: its holder hears it" onMouseDown={keepFocus} onClick={() => void send('done')}>✓ close as done</button>
100
+ <button className="ghost" disabled={busy} title="close the thread as not done, with a word if you like: its holder hears it" onMouseDown={keepFocus} onClick={() => setWords('')}>✕ not doing it</button>
101
+ </>
102
+ ) : (
103
+ <>
104
+ <input
105
+ className="rv-closewords"
106
+ autoFocus
107
+ placeholder="why not (optional), Enter closes"
108
+ aria-label="why not, optional"
109
+ value={words}
110
+ disabled={busy}
111
+ onChange={(e) => setWords(e.currentTarget.value)}
112
+ onKeyDown={(e) => {
113
+ if (e.key === 'Enter') void send('wontfix', words)
114
+ else if (e.key === 'Escape') setWords(null)
115
+ }}
116
+ />
117
+ <button className="ghost" disabled={busy} onMouseDown={keepFocus} onClick={() => void send('wontfix', words)}>close: not doing it</button>
118
+ <button className="ghost" aria-label="cancel" onClick={() => setWords(null)}>✕</button>
119
+ </>
120
+ )}
121
+ {err ? <span className="err">✗ {err}</span> : null}
122
+ </span>
123
+ )
124
+ })
@@ -2,6 +2,7 @@
2
2
  // threads name it, and a menu to open one, start one with the owner's words, or attach it to an open thread
3
3
  import { observer, useLocalObservable } from 'mobx-react-lite'
4
4
  import { useEffect } from 'react'
5
+ import { AutoText } from '../auto-text.tsx'
5
6
  import { Pop } from '../floating.tsx'
6
7
  import type { RepoSt } from '../repo-st.ts'
7
8
  import { ThreadControlSt, type ControlHost } from './thread-control-st.ts'
@@ -15,7 +16,7 @@ export const threadHost = (st: RepoSt): ControlHost => ({
15
16
  },
16
17
  })
17
18
 
18
- const TURN: Record<string, string> = { yours: 'your turn', working: 'in work', done: 'done' }
19
+ const TURN: Record<string, string> = { yours: 'your turn', aside: 'set aside', agents: "an agent's move", done: 'done' }
19
20
 
20
21
  export const ThreadControl = observer(({ st, address, name, host }: { st?: RepoSt; host?: ControlHost; address: string; name: string }) => {
21
22
  const h = host ?? (st ? threadHost(st) : null)
@@ -38,12 +39,11 @@ export const ThreadControl = observer(({ st, address, name, host }: { st?: RepoS
38
39
  {t.owns ? <span className="rv-dim"> · its thread</span> : null}
39
40
  </button>
40
41
  ))}
41
- <textarea
42
+ <AutoText
42
43
  className="rv-answerwords"
43
- rows={2}
44
44
  placeholder={s.data?.noteGoesTo ? 'a note: it goes into its thread, and the agent owes it' : 'a note: it starts a thread on it, and an agent owes it'}
45
45
  value={s.text}
46
- onChange={(e) => s.setText(e.target.value)}
46
+ onText={(t) => s.setText(t)}
47
47
  onKeyDown={(e) => {
48
48
  if (e.key === 'Enter' && (e.metaKey || e.ctrlKey)) {
49
49
  e.preventDefault()