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
@@ -1,10 +1,15 @@
1
1
  // the cells of a thread, one framed card each (wiki tools/shipkit/threads.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
- // click shows the view they sit on), a reply and a note are words; a run of state changes is one thin line
4
+ // click shows the view they sit on), a reply and a note are words, a question or a change whole with its controls, where
5
+ // he answers it (dock.tsx RequestCell); a run of state changes is one thin line
5
6
  import { observer } from 'mobx-react-lite'
6
- import type { EventCell, NoteCell, ReplyCell, VerdictCell, VersionCell } from '../../../review/cells.ts'
7
- import { isDraftCard, isGallery, isTrailerCard, postLabel, STATUS_LABEL, thumbFileOf, UPDATE_WORDS, viewName, viewTag, type Item, type Rect, type TrailerCard } from '../../../review/model.ts'
7
+ import type { NoteCell, ReplyCell, VerdictCell, VersionCell } from '../../../review/cells.ts'
8
+ import { MESSAGE_TYPES } from '../../../review/glyphs.ts'
9
+ import { kindOf } from '../../../review/kinds.ts'
10
+ import { actorName } from '../../../review/parties.ts'
11
+ import { traceWords } from '../../../review/traces.ts'
12
+ import { NO_SPEC, isDraftCard, isGallery, isTrailerCard, postLabel, STATUS_LABEL, thumbFileOf, UPDATE_WORDS, viewName, viewTag, type Item, type Rect, type TrailerCard } from '../../../review/model.ts'
8
13
  import { Caret, Icon, ICON } from '../icons.tsx'
9
14
  import { renderMd } from '../md.ts'
10
15
  import { ageWords, stampWords } from '../time-ago.tsx'
@@ -12,12 +17,17 @@ import { KindView, AnimPanel } from './kind-view.tsx'
12
17
  import { keepFocus, laneColor, PreviewImg, REACTIONS, secs, SIDE_LABEL, toneOf, VERDICTS } from './kit.tsx'
13
18
  import type { ReviewSt } from './review-st.ts'
14
19
  import { VersionViews, ViewCell } from './review-views.tsx'
15
- import { cellDom, viewKind, type Framed, type ThreadSt } from './thread-st.ts'
20
+ import { cellDom, viewKind, type Framed, type ThreadSt, type Traced } from './thread-st.ts'
16
21
  import { DraftCardBody } from './draft-card.tsx'
22
+ import { KindStates } from './kind-states.tsx'
23
+ import { RequestCell } from './dock.tsx'
24
+ import { ItemVerdict } from './item-verdict.tsx'
25
+ import { AddressChip, CellGlyph, ObjectCard } from './object-panel.tsx'
17
26
  import { NoteMeta, NoteStill, TrailerCardBody } from './trailer-card.tsx'
18
27
 
19
- /** who a cell is from, as its header says it: you, a player, or the agent's lane */
20
- const whoWords = (who: string): string => (who === 'owner' ? 'you' : who)
28
+ /** who a cell is from, as its header and its trace say it: you, a player, the agent's lane, a session's own act by
29
+ * its session (`<repo> main`) */
30
+ const whoWords = (rv: ReviewSt, c: { who: string; session?: string }): string => actorName(c.who, c.session, rv.parties)
21
31
 
22
32
  /** an agent that named no lane: « agent », or « agent 66573d » after its session */
23
33
  const anonymous = (who: string): boolean => who === 'agent' || who.startsWith('agent ')
@@ -26,11 +36,11 @@ const anonymous = (who: string): boolean => who === 'agent' || who.startsWith('a
26
36
  * named no lane */
27
37
  const avatarText = (who: string): string => (who === 'owner' ? 'you' : who === 'player' ? 'P' : anonymous(who) ? '⚙' : who.slice(0, 4))
28
38
 
29
- const Avatar = ({ who }: { who: string }) => {
39
+ const Avatar = ({ who, name }: { who: string; name: string }) => {
30
40
  const mine = who === 'owner'
31
41
  const player = who === 'player'
32
42
  const anon = anonymous(who)
33
- const tip = anon ? `${who}: an agent that named no lane${who === 'agent' ? '' : ' (its session)'}` : whoWords(who)
43
+ const tip = anon ? `${name}: ${name === who ? 'an agent that named no lane' : 'a session, no lane'}` : name
34
44
  return (
35
45
  <span className={`rv-avatar${mine ? ' mine' : player ? ' player' : anon ? ' anon' : ''}`} style={mine || player || anon ? undefined : { ['--lane' as string]: laneColor(who) }} title={tip}>
36
46
  {avatarText(who)}
@@ -46,22 +56,27 @@ export const When = observer(({ rv, at }: { rv: ReviewSt; at: string }) => {
46
56
 
47
57
  const KIND_LABEL: Record<Framed['kind'], string> = { version: 'version', verdict: 'verdict', reply: 'reply', note: 'note' }
48
58
 
49
- /** one message of the discussion: who speaks as a round mark beside it (the agents on the left, the owner's words
50
- * on the right), a light line with the name, the kind and the time, then the bubble, or its one line when folded. `cont`: the
59
+ /** one message of the discussion: who speaks as a round mark on its left (the owner's too, told by their tint, never
60
+ * by side), a light line with the name, the kind and the time, then the bubble, or its one line when folded. `cont`: the
51
61
  * same speaker as the message above, so its mark and name are not drawn again */
52
62
  export const CellFrame = observer(({ rv, card, c, cont }: { rv: ReviewSt; card: ThreadSt; c: Framed; cont?: boolean }) => {
63
+ // an ask's head holds its facts alone: its title heads the thread, its words are the instructions under it
64
+ if (c.kind === 'version' && c.item.ask !== undefined && !c.item.what && c.item.views.length === 0) return null
65
+ // a field inside a step of an ask's instructions draws in that step
66
+ if (c.kind === 'reply' && c.step !== undefined) return null
53
67
  const open = card.isOpen(c)
54
- const head = card.head?.id === c.id
68
+ const head = card.head?.id === c.id && card.takesVerdict
55
69
  const unread = (c.kind === 'reply' || c.kind === 'note') && c.party === 'agent' && !c.read
56
70
  const tone = c.kind === 'version' ? toneOf(c.status) : c.kind === 'verdict' ? toneOf(c.verdict) : c.kind === 'reply' && c.update ? `upd up-${c.update.state}` : ''
57
71
  return (
58
- <article id={cellDom(c.id)} data-unread={unread ? c.id : undefined} className={`rv-c k-${c.kind} p-${c.party}${open ? '' : ' folded'}${head ? ' head' : ''}${cont ? ' cont' : ''} ${tone}`}>
59
- <Avatar who={c.who} />
72
+ <article id={cellDom(c.id)} data-unread={unread ? c.id : undefined} className={`rv-c k-${c.kind} p-${c.party}${open ? '' : ' folded'}${head ? ' head' : ''}${cont ? ' cont' : ''}${c.superseded ? ' superseded' : ''} ${tone}`}>
73
+ <Avatar who={c.who} name={whoWords(rv, c)} />
60
74
  <div className="rv-msg">
61
75
  <header className="rv-chead" onClick={() => card.toggleCell(c)}>
62
- {cont ? null : <b className="rv-cwho">{whoWords(c.who)}</b>}
63
- <span className="rv-ckind">{c.kind === 'version' ? `v${c.n}` : c.kind === 'reply' && c.ask ? 'question' : c.kind === 'reply' && c.propose ? 'proposed change' : c.kind === 'reply' && c.answers ? 'answer' : c.kind === 'reply' && c.op ? (c.op === 'ask' ? 'question' : 'answer') : c.kind === 'reply' && c.update ? `update ${c.update.k}` : c.kind === 'reply' && c.re ? `hint on update ${c.re.k}` : KIND_LABEL[c.kind]}</span>
64
- {c.kind === 'version' ? <span className="rv-badge">{STATUS_LABEL[c.status]}</span> : null}
76
+ {cont ? null : <b className="rv-cwho">{whoWords(rv, c)}</b>}
77
+ <CellGlyph rv={rv} c={c} />
78
+ <span className="rv-ckind">{c.kind === 'version' ? (c.superseded ? 'instructions' : `v${c.n}`) : c.kind === 'reply' && c.instructions ? 'instructions' : c.kind === 'reply' && c.ask ? 'question' : c.kind === 'reply' && c.propose ? 'proposed change' : c.kind === 'reply' && c.answers ? 'answer' : c.kind === 'reply' && c.op ? (c.op === 'ask' ? 'question' : 'answer') : c.kind === 'reply' && c.update ? `update ${c.update.k}` : c.kind === 'reply' && c.re ? `hint on update ${c.re.k}` : KIND_LABEL[c.kind]}</span>
79
+ {c.kind === 'version' ? <span className="rv-cstate">{STATUS_LABEL[c.status].toLowerCase()}</span> : null}
65
80
  {c.kind === 'reply' && c.update ? <span className={`rv-badge rv-up up-${c.update.state}`}>{UPDATE_WORDS[c.update.state]}</span> : null}
66
81
  {c.kind === 'verdict' ? (
67
82
  <button className="rv-on ghost" title={c.n > 0 ? `the version this answers: v${c.n}` : 'the note this answers'} onMouseDown={keepFocus} onClick={(e) => { e.stopPropagation(); card.reveal(c.on) }}>↑ on {c.n > 0 ? `v${c.n}` : 'the note'}</button>
@@ -80,7 +95,8 @@ export const CellFrame = observer(({ rv, card, c, cont }: { rv: ReviewSt; card:
80
95
  </header>
81
96
  {open ? (
82
97
  <div className="rv-bubble rv-cbody">
83
- {c.kind === 'version' ? <VersionMain rv={rv} card={card} c={c} /> : c.kind === 'verdict' ? <VerdictBody card={card} c={c} /> : c.kind === 'reply' ? <ReplyBody rv={rv} card={card} c={c} /> : <NoteBody rv={rv} c={c} />}
98
+ {c.superseded ? <SupersededBy card={card} by={c.superseded} /> : null}
99
+ {c.kind === 'version' ? <VersionMain rv={rv} card={card} c={c} /> : c.kind === 'verdict' ? <VerdictBody card={card} c={c} /> : c.kind === 'reply' ? <ReplyBody rv={rv} card={card} c={c} /> : <NoteBody rv={rv} card={card} c={c} />}
84
100
  </div>
85
101
  ) : (
86
102
  c.kind === 'version' && c.item.views.length > 0 ? (
@@ -89,7 +105,7 @@ export const CellFrame = observer(({ rv, card, c, cont }: { rv: ReviewSt; card:
89
105
  <ViewStrip rv={rv} card={card} c={c} />
90
106
  </div>
91
107
  ) : (
92
- <div className="rv-bubble rv-csum" onClick={() => card.toggleCell(c)}>{c.summary || '·'}</div>
108
+ <div className={`rv-bubble rv-csum${c.superseded ? ' rv-superseded' : ''}`} title={c.superseded ? 'a newer one supersedes it: a click shows it, read only' : undefined} onClick={() => card.toggleCell(c)}>{c.summary || '·'}</div>
93
109
  )
94
110
  )}
95
111
  </div>
@@ -97,6 +113,16 @@ export const CellFrame = observer(({ rv, card, c, cont }: { rv: ReviewSt; card:
97
113
  )
98
114
  })
99
115
 
116
+ /** over an unfolded object a newer one supersedes: what supersedes it, a click away; the object below is read only */
117
+ const SupersededBy = ({ card, by }: { card: ThreadSt; by: { by: string; title: string; withdrawn?: true } }) =>
118
+ by.withdrawn ? (
119
+ <span className="rv-supersededby">{by.title}</span>
120
+ ) : (
121
+ <button className="rv-supersededby ghost" title="the newer one: show it" onMouseDown={keepFocus} onClick={() => card.reveal(by.by)}>
122
+ superseded by « {by.title} » <span aria-hidden>↓</span>
123
+ </button>
124
+ )
125
+
100
126
  /** a folded version's views as small previews, a chat's attachments: a click opens the version on that view */
101
127
  const STRIP_MAX = 8
102
128
 
@@ -145,6 +171,10 @@ const VersionMain = observer(({ rv, card, c }: { rv: ReviewSt; card: ThreadSt; c
145
171
  {isTrailerCard(r) ? <TrailerCardBody ver={{ rv, card, cell: c, live, claim }} item={r} /> : r.views.length > 0 ? <VersionViews ver={{ rv, card, cell: c, live, claim }} /> : null}
146
172
  {/* a draft card holds no view: its body is the post draft itself, read live */}
147
173
  {isDraftCard(r) ? <DraftCardBody ver={{ rv, card, cell: c, live, claim }} item={r} /> : null}
174
+ {/* a version of an object of a kind: its two states, drawn as its kind declares */}
175
+ {r.states ? <KindStates rv={rv} card={card} item={r} live={live} /> : null}
176
+ {/* its verdict lives here, under it; the dock only reminds him and jumps here */}
177
+ {live ? <ItemVerdict card={card} version={c.id} phone={rv.phone.on} /> : null}
148
178
  </>
149
179
  )
150
180
  })
@@ -164,7 +194,8 @@ const VerdictBody = observer(({ card, c }: { card: ThreadSt; c: VerdictCell }) =
164
194
  <>
165
195
  <div className="rv-verdictline">
166
196
  <span className="rv-vdisc" aria-hidden="true">{VERDICTS.find((x) => x.status === c.verdict)?.glyph ?? '•'}</span>
167
- <b className="rv-vwords">{STATUS_LABEL[c.verdict]}{v ? ` · v${v.n}` : ''}</b>
197
+ <b className="rv-vwords">{STATUS_LABEL[c.verdict]}{c.judges ? '' : v ? ` · v${v.n}` : ''}</b>
198
+ {c.judges ? <button className="rv-on ghost" onMouseDown={keepFocus} onClick={() => card.reveal(c.judges!)}>↑ on the message it judges</button> : null}
168
199
  {c.current ? null : <span className="rv-dim">an earlier answer, before a reopen or a newer one</span>}
169
200
  <span className="rv-dim">{c.read ? 'read by the agent' : 'not read yet'}</span>
170
201
  </div>
@@ -226,9 +257,9 @@ const ReplyBody = observer(({ rv, card, c }: { rv: ReviewSt; card: ThreadSt; c:
226
257
  {c.re ? (
227
258
  <button className="rv-on ghost" onMouseDown={keepFocus} onClick={() => card.reveal(c.re!.id)}>↑ on update {c.re.k} · {UPDATE_WORDS[c.re.state]}</button>
228
259
  ) : null}
229
- <div className="rv-pre rv-words">{c.text}</div>
260
+ {c.ask || c.propose ? <RequestCell rv={rv} card={card} c={c} /> : c.instructions ? <div className="md rv-what" dangerouslySetInnerHTML={{ __html: renderMd(c.text) }} /> : <div className="rv-pre rv-words">{c.text}</div>}
230
261
  {c.image ? (
231
- <PreviewImg src={rv.threadImageUrl(c.on, c.image)} />
262
+ <PreviewImg src={rv.threadImageUrl(c.on, c.image)} onOpen={() => card.openPicture(rv.threadImageUrl(c.on, c.image!), `${c.who}: ${c.text.split('\n')[0] ?? ''}`)} />
232
263
  ) : null}
233
264
  {version && view && c.update?.view !== undefined ? (
234
265
  <ViewCell
@@ -239,78 +270,15 @@ const ReplyBody = observer(({ rv, card, c }: { rv: ReviewSt; card: ThreadSt; c:
239
270
  />
240
271
  ) : null}
241
272
  {c.update && c.party === 'agent' ? <HintBox card={card} c={c} /> : null}
242
- {c.ask ? <AskBody card={card} c={c} ask={c.ask} /> : null}
243
- {c.propose ? <ProposeBody card={card} c={c} p={c.propose} /> : null}
244
- {c.about ? <div className="rv-dim">links {c.about.join(' · ')}</div> : null}
273
+ {c.linked?.map((l) => <ObjectCard key={l.address} rv={rv} card={card} c={c} l={l} />)}
274
+ {c.about && c.about.some((a) => !c.linked?.some((l) => l.address === a)) ? (
275
+ <div className="rv-objchips">{c.about.filter((a) => !c.linked?.some((l) => l.address === a)).map((a) => <AddressChip key={a} rv={rv} card={card} c={c} address={a} />)}</div>
276
+ ) : null}
277
+ {c.judge && !c.superseded ? <ItemVerdict card={card} cell={c} phone={rv.phone.on} /> : null}
245
278
  </>
246
279
  )
247
280
  })
248
281
 
249
- /** an agent's question: one button per option, its pick marked; one click answers, the words box goes with it */
250
- const AskBody = observer(({ card, c, ask }: { card: ThreadSt; c: ReplyCell; ask: NonNullable<ReplyCell['ask']> }) => {
251
- const done = ask.answered
252
- return (
253
- <div className="rv-ask">
254
- <div className="rv-askopts">
255
- {ask.options.map((o, i) => (
256
- <button
257
- key={i}
258
- className={`rv-askopt${done?.option === i ? ' picked' : ''}${ask.pick === i ? ' pick' : ''}`}
259
- disabled={done !== undefined || card.busy}
260
- onMouseDown={keepFocus}
261
- onClick={() => void card.answer(c, { option: i })}
262
- title={ask.pick === i ? "the agent's pick" : undefined}
263
- >
264
- <span className="rv-askn">{i + 1}</span> {o}
265
- {ask.pick === i ? <span className="rv-mypick">my pick</span> : null}
266
- {done?.option === i ? <span className="rv-badge">✓ yours</span> : null}
267
- </button>
268
- ))}
269
- </div>
270
- {done ? null : <AnswerWords card={card} c={c} placeholder="a word with your answer (optional), then click an option" />}
271
- </div>
272
- )
273
- })
274
-
275
- /** an agent's proposed change of an object's text: the before and the after; « apply » lands it as it is, « apply my
276
- * edit » lands the words box */
277
- const ProposeBody = observer(({ card, c, p }: { card: ThreadSt; c: ReplyCell; p: NonNullable<ReplyCell['propose']> }) => {
278
- const edited = (card.hints[c.id] ?? '').trim() !== ''
279
- return (
280
- <div className="rv-propose">
281
- <div className="rv-dim">on {p.on}</div>
282
- {p.before !== undefined ? <div className="rv-pre rv-before">{p.before}</div> : null}
283
- <div className="rv-pre rv-after">{p.applied ? p.applied.text : p.after}</div>
284
- {p.applied ? (
285
- <span className="rv-badge">✓ applied</span>
286
- ) : (
287
- <>
288
- <AnswerWords card={card} c={c} placeholder="edit it here before you apply (optional)" initial={p.after} />
289
- <div className="rv-askopts">
290
- <button className="rv-askopt pick" disabled={card.busy} onMouseDown={keepFocus} onClick={() => void card.answer(c, { apply: true })}>
291
- {edited ? 'apply my edit' : 'apply'}
292
- </button>
293
- </div>
294
- </>
295
- )}
296
- </div>
297
- )
298
- })
299
-
300
- /** the words that go with an answer: the hint box of the cell, kept per cell until sent */
301
- const AnswerWords = observer(({ card, c, placeholder, initial }: { card: ThreadSt; c: ReplyCell; placeholder: string; initial?: string }) => (
302
- <textarea
303
- className="rv-answerwords"
304
- rows={initial ? Math.min(6, initial.split('\n').length + 1) : 1}
305
- placeholder={placeholder}
306
- value={card.hints[c.id] ?? ''}
307
- onFocus={() => {
308
- if (initial !== undefined && (card.hints[c.id] ?? '') === '') card.setHint(c.id, initial)
309
- }}
310
- onChange={(e) => card.setHint(c.id, e.target.value)}
311
- />
312
- ))
313
-
314
282
  /** his few words on one update: a hint the agent reads, the card left as it is */
315
283
  const HintBox = observer(({ card, c }: { card: ThreadSt; c: ReplyCell }) => {
316
284
  const text = card.hints[c.id] ?? ''
@@ -318,7 +286,7 @@ const HintBox = observer(({ card, c }: { card: ThreadSt; c: ReplyCell }) => {
318
286
  <div className="rv-hint">
319
287
  <input
320
288
  type="text"
321
- placeholder="a hint on this update (Enter sends it, the card stays as it is)"
289
+ placeholder="a hint on this update (Enter sends it, the version stays as it is)"
322
290
  value={text}
323
291
  onChange={(e) => card.setHint(c.id, e.target.value)}
324
292
  onKeyDown={(e) => {
@@ -334,17 +302,19 @@ const HintBox = observer(({ card, c }: { card: ThreadSt; c: ReplyCell }) => {
334
302
  })
335
303
 
336
304
  /** what he or a player raised, or his mark: the words, the still with his rectangles on it */
337
- const NoteBody = ({ rv, c }: { rv: ReviewSt; c: NoteCell }) => {
305
+ const NoteBody = ({ rv, card, c }: { rv: ReviewSt; card: ThreadSt; c: NoteCell }) => {
338
306
  const first = c.item?.views[0]
339
307
  const still = first && !isGallery(first) && 'image' in first.files ? { name: first.files.image, size: first.size } : null
340
308
  const r = c.rate
341
309
  return (
342
310
  <>
343
311
  {c.item && c.item.title !== c.text ? <div className="rv-notetitle">{c.item.title}</div> : null}
312
+ {/* what a rule saw, its markdown: a raised item's body when no words open it */}
313
+ {c.item?.what ? <div className="md rv-what" dangerouslySetInnerHTML={{ __html: renderMd(c.item.what) }} /> : null}
344
314
  {r ? <div className="rv-dim">marked {[r.stars !== undefined ? `★${r.stars}` : '', r.mark ?? '', r.part ? `on ${r.part}` : ''].filter(Boolean).join(' ')}</div> : null}
345
315
  {c.text ? <div className="rv-pre rv-words">{c.text}</div> : null}
346
316
  {still && c.item ? (
347
- <div className="rv-raisedframe" style={{ aspectRatio: `${still.size.w} / ${still.size.h}` }}>
317
+ <div className="rv-raisedframe" style={{ aspectRatio: `${still.size.w} / ${still.size.h}` }} title="show it large" onClick={() => card.openPicture(rv.fitUrl(c.item!.id, still.name), c.item!.title)}>
348
318
  <img src={rv.fitUrl(c.item.id, still.name)} alt="" loading="lazy" decoding="async" />
349
319
  {c.rects.map((q, k) => (
350
320
  <div key={k} className="rv-rect sent" style={{ left: `${q.x * 100}%`, top: `${q.y * 100}%`, width: `${q.w * 100}%`, height: `${q.h * 100}%` }} title={q.comment}>
@@ -354,15 +324,16 @@ const NoteBody = ({ rv, c }: { rv: ReviewSt; c: NoteCell }) => {
354
324
  </div>
355
325
  ) : null}
356
326
  {c.rects.some((q) => q.comment) ? c.rects.map((q, k) => (q.comment ? <div key={k} className="rv-noteline rect still"><span className="rv-notemark">⬚ {k + 1}</span><span className="rv-notetext">{q.comment}</span></div> : null)) : null}
357
- {c.image && c.item ? <PreviewImg src={rv.threadImageUrl(c.item.id, c.image)} /> : null}
327
+ {c.image && c.item ? <PreviewImg src={rv.threadImageUrl(c.item.id, c.image)} onOpen={() => card.openPicture(rv.threadImageUrl(c.item!.id, c.image!), c.item!.title)} /> : null}
358
328
  </>
359
329
  )
360
330
  }
361
331
 
362
- /** a run of state changes in a row: one thin line, the same change said once with its count and its first and last
363
- * time. A run never crosses a framed cell: the thread draws a verdict or a word between two changes as its own cell */
364
- export const EventsLine = observer(({ rv, cells }: { rv: ReviewSt; cells: EventCell[] }) => {
365
- const runs: { c: EventCell; n: number; last: EventCell }[] = []
332
+ /** a run of traces in a row (wiki tools/shipkit/threads-page.md, Traces): each act one muted line, who, what it did,
333
+ * the object as a link that shows it, when; the same trace in a row said once with its count and its first and last
334
+ * time. A run never crosses a framed cell: a word between two acts is its own cell */
335
+ export const TraceLines = observer(({ rv, card, cells }: { rv: ReviewSt; card: ThreadSt; cells: Traced[] }) => {
336
+ const runs: { c: Traced; n: number; last: Traced }[] = []
366
337
  for (const c of cells) {
367
338
  const run = runs.at(-1)
368
339
  if (run && run.c.summary === c.summary) {
@@ -370,16 +341,26 @@ export const EventsLine = observer(({ rv, cells }: { rv: ReviewSt; cells: EventC
370
341
  run.last = c
371
342
  } else runs.push({ c, n: 1, last: c })
372
343
  }
344
+ const kind = card.data ? kindOf(card.data.subject.kind, rv.spec ?? NO_SPEC) : null
373
345
  return (
374
346
  <div className="rv-events">
375
- {runs.map(({ c, n, last }) => (
376
- <div key={c.id} id={cellDom(c.id)} className="rv-event" title={n > 1 ? `${n} times: ${c.summary}` : c.summary}>
377
- {n > 1 ? <b className="rv-eventn">{n}×</b> : null}
378
- <span className="rv-eventtext">{c.summary}</span>
379
- <When rv={rv} at={c.at} />
380
- {n > 1 ? <>{' → '}<When rv={rv} at={last.at} /></> : null}
381
- </div>
382
- ))}
347
+ {runs.map(({ c, n, last }) => {
348
+ const t = c.trace
349
+ const did = t.act === 'action' && t.action ? `clicked « ${kind?.actions?.[t.action]?.label ?? t.action} »` : t.did
350
+ return (
351
+ <div key={c.id} id={cellDom(c.id)} className={`rv-event act-${t.act}`} data-act={t.act} title={`${n > 1 ? `${n} times: ` : ''}${traceWords(whoWords(rv, c), { ...t, did })}`}>
352
+ <span className="rv-cglyph" data-type="trace" aria-hidden><Icon d={MESSAGE_TYPES.trace.icon} /></span>
353
+ {n > 1 ? <b className="rv-eventn">{n}×</b> : null}
354
+ <span className="rv-eventtext">
355
+ {whoWords(rv, c)} {did}
356
+ {t.until ? <> {stampWords(Date.parse(t.until))}</> : null}
357
+ {t.object ? <> <a href={`#${cellDom(t.object.cell)}`} className="rv-eventobj" onMouseDown={keepFocus} onClick={(e) => { e.preventDefault(); card.reveal(t.object!.cell) }}>{t.object.label}</a></> : null}
358
+ </span>
359
+ <When rv={rv} at={c.at} />
360
+ {n > 1 ? <>{' → '}<When rv={rv} at={last.at} /></> : null}
361
+ </div>
362
+ )
363
+ })}
383
364
  </div>
384
365
  )
385
366
  })
@@ -4,12 +4,20 @@ import { observer } from 'mobx-react-lite'
4
4
  import { Fragment, useEffect, useRef } from 'react'
5
5
  import type { ThreadRow } from '../../../review/cells.ts'
6
6
  import { MOVE_LABEL, STATUS_LABEL, subjectLabel, UPDATE_WORDS, type Move, type ShownStatus } from '../../../review/model.ts'
7
- import { AutoTag, LaneTag, laneColor, Listeners, Rework, ThumbOf, toneOf } from './kit.tsx'
7
+ import { isOwnerWait, OWNER_WAITS, type OwnerWait } from '../../../review/wait.ts'
8
+ import { waitGlyph } from './object-panel.tsx'
9
+ import { BAND_WORDS, BANDS, bandOf, waitingWords, type Band } from '../../../review/band.ts'
10
+ import { cursorWords } from '../../../review/traces.ts'
11
+ import { actorName } from '../../../review/parties.ts'
12
+ import { laneAskWords } from '../../../review/lane-ask.ts'
13
+ import { HolderChip, laneColor } from './kit.tsx'
8
14
  import { ReviewBoard } from './review-board.tsx'
9
15
  import type { ReviewSt } from './review-st.ts'
10
16
  import { ListFilter } from '../list-filter.tsx'
11
17
  import { Pop, Tip } from '../floating.tsx'
12
18
  import { Icon, ICON } from '../icons.tsx'
19
+ import { SectionHead } from '../section-head.tsx'
20
+ import { ThreadRow as ThreadRowView, VerbGlyph } from '../thread-row.tsx'
13
21
 
14
22
  const ALL = ''
15
23
 
@@ -24,10 +32,35 @@ export const ReviewList = observer(({ rv }: { rv: ReviewSt }) => (
24
32
  {() => <Filters rv={rv} />}
25
33
  </Pop>
26
34
  </div>
35
+ <MustDo rv={rv} />
36
+ {rv.since && rv.since.moved > 0 ? <div className="rv-since" title={`since your last act here, ${new Date(rv.since.at).toLocaleString()}`}>since you left: {rv.since.moved} moved, <b>{rv.since.yours} yours</b></div> : null}
27
37
  {rv.board && rv.spec?.dispatcher ? <ReviewBoard rv={rv} /> : <Rows rv={rv} />}
28
38
  </div>
29
39
  ))
30
40
 
41
+ /** what each verb asks of him: the inbox's words (inbox-view.tsx) */
42
+ const MUST_SAYS: Record<OwnerWait, string> = {
43
+ judge: 'an item waits for your verdict: a version, a proposed change, a message that asks it',
44
+ answer: 'a question or a decision waits for your answer',
45
+ do: 'something only your hands do: a step, a purchase, a secret, a url',
46
+ }
47
+
48
+ /** « what I must do », the inbox's filter: all, or the threads whose verb is judge, answer, do or read, each its glyph
49
+ * and its count under the other filters, its word only where the column is wide; a click toggles one verb. One row
50
+ * that never wraps (controls.css .verbs) */
51
+ const MustDo = observer(({ rv }: { rv: ReviewSt }) => (
52
+ <div className="verbs seg" role="group" aria-label="what I must do">
53
+ <button className={rv.waits === null ? 'on' : ''} title="every thread" onClick={() => rv.setFilter({ waits: null })}>all</button>
54
+ {OWNER_WAITS.map((w) => (
55
+ <button key={w} className={rv.waits?.includes(w) ? 'on' : ''} aria-pressed={rv.waits?.includes(w) ?? false} aria-label={w} title={`${w}: ${MUST_SAYS[w]}`} onClick={() => rv.toggleWait(w)}>
56
+ <VerbGlyph verb={w} says={`${w}: ${MUST_SAYS[w]}`} />
57
+ <span className="verbw">{w}</span>
58
+ {rv.page?.byWait[w] ? <b className="verbn">{rv.page.byWait[w]}</b> : null}
59
+ </button>
60
+ ))}
61
+ </div>
62
+ ))
63
+
31
64
  /** a switch of the list in its top row: an icon that reads pressed while on, its words at once on hover */
32
65
  const ListToggle = ({ on, set, icon, label, says }: { on: boolean; set: (v: boolean) => void; icon: string; label: string; says: string }) => (
33
66
  <Tip instant content={says} placement="bottom">
@@ -74,13 +107,13 @@ const Rows = observer(({ rv }: { rv: ReviewSt }) => {
74
107
  ? rv.laneGroups.map((g) => (
75
108
  <div key={g.lane ?? ''}>
76
109
  <LaneHeader rv={rv} lane={g.lane} rows={g.rows} />
77
- {g.rows.map((r) => <Row key={r.head} rv={rv} r={r} on={r === open} />)}
110
+ {shown(g.rows, rv.folded(laneBand(g.lane)), open).map((r) => <Row key={r.head} rv={rv} r={r} on={r === open} />)}
78
111
  </div>
79
112
  ))
80
- : rv.rows.map((r, i) => (
81
- <Fragment key={r.head}>
82
- {i === 0 || rv.rows[i - 1]?.turn !== r.turn ? <TurnHeader turn={r.turn} n={rv.rows.filter((x) => x.turn === r.turn).length} /> : null}
83
- <Row rv={rv} r={r} on={r === open} />
113
+ : bandGroups(rv).map((g) => (
114
+ <Fragment key={g.band}>
115
+ <BandHeader rv={rv} band={g.band} n={g.rows.length} />
116
+ {shown(g.rows, rv.folded(`turn:${g.band}`), open).map((r) => <Row key={r.head} rv={rv} r={r} on={r === open} />)}
84
117
  </Fragment>
85
118
  ))}
86
119
  {rv.page && rv.rows.length === 0 ? (
@@ -108,57 +141,81 @@ const More = observer(({ rv }: { rv: ReviewSt }) => {
108
141
  return <button ref={el} className="ghost rv-more" onClick={() => rv.showMore()}>{rv.more} more</button>
109
142
  })
110
143
 
111
- const TURN_WORDS: Record<ThreadRow['turn'], string> = { yours: 'your turn', working: 'an agent works on it', done: 'done' }
144
+ /** a row's band with the parties the page polls (review/band.ts): an agent's move splits by whether a live agent works it */
145
+ const bandOfRow = (rv: ReviewSt, r: ThreadRow): Band => bandOf(r, rv.parties)
112
146
 
113
- /** who acts now on the threads under it: his turn first, then the agents' work, then what is done */
114
- const TurnHeader = ({ turn, n }: { turn: ThreadRow['turn']; n: number }) => (
115
- <div className={`rv-turnhead turn-${turn}`}>
116
- <b>{TURN_WORDS[turn]}</b>
117
- <span className="rv-dim">{n}</span>
118
- </div>
119
- )
147
+ /** the rows under one band each, the bands in their order, the rows in the list's own */
148
+ const bandGroups = (rv: ReviewSt): { band: Band; rows: ThreadRow[] }[] => {
149
+ const by = new Map<Band, ThreadRow[]>()
150
+ for (const r of rv.rows) {
151
+ const b = bandOfRow(rv, r)
152
+ ;(by.get(b) ?? by.set(b, []).get(b))?.push(r)
153
+ }
154
+ return BANDS.flatMap((band) => (by.has(band) ? [{ band, rows: by.get(band)! }] : []))
155
+ }
156
+
157
+ const laneBand = (lane: string | null): string => `lane:${lane ?? ''}`
158
+
159
+ /** a band's rows as drawn: all, or folded only the open one, so the thread he is on never leaves the list */
160
+ const shown = (rows: readonly ThreadRow[], folded: boolean, open: ThreadRow | null): readonly ThreadRow[] => (folded ? rows.filter((r) => r === open) : rows)
161
+
162
+ /** who acts now on the threads under it: his turn first, then what a live agent works, what waits for one, what is
163
+ * done; a click folds it. The waiting band says, by its grey light, who takes one */
164
+ const BandHeader = observer(({ rv, band, n }: { rv: ReviewSt; band: Band; n: number }) => (
165
+ <SectionHead hook="rv-turnhead" label={BAND_WORDS[band]} n={n} tone={band === 'yours' ? 'var(--accent)' : undefined}
166
+ open={!rv.folded(`turn:${band}`)} onFold={() => rv.toggleFold(`turn:${band}`)} title={rv.folded(`turn:${band}`) ? `unfold ${BAND_WORDS[band]}` : `fold ${BAND_WORDS[band]}`}>
167
+ {band === 'waiting' ? <span className="rv-bandwho light-nobody" role="img" aria-label={waitingWords(rv.partiesRepo || rv.repo.name)} title={waitingWords(rv.partiesRepo || rv.repo.name)}><i className="rv-light" aria-hidden /></span> : null}
168
+ </SectionHead>
169
+ ))
120
170
 
121
171
  const LaneHeader = observer(({ rv, lane, rows }: { rv: ReviewSt; lane: string | null; rows: readonly ThreadRow[] }) => (
122
- <div className="rv-lanehead" style={lane ? { ['--lane' as string]: laneColor(lane) } : undefined}>
123
- <b>{lane ?? 'no lane'}</b>
124
- <span className="rv-dim">{rows.length}</span>
125
- <span className="sp" />
126
- <Listeners rv={rv} heads={rows} />
127
- </div>
172
+ <SectionHead label={lane ?? 'no lane'} n={rows.length} tone={lane ? laneColor(lane) : undefined}
173
+ open={!rv.folded(laneBand(lane))} onFold={() => rv.toggleFold(laneBand(lane))} title={rv.folded(laneBand(lane)) ? `unfold ${lane ?? 'no lane'}` : `fold ${lane ?? 'no lane'}`} />
128
174
  ))
129
175
 
130
- const ABOUT = (r: ThreadRow, rv: ReviewSt): string =>
131
- [subjectLabel(r.subject, rv.spec ?? undefined), r.choice ? 'choice' : '', r.clip ? 'clip' : '', r.pair ? 'before/after' : '', r.views > 1 ? `${r.views} views` : ''].filter(Boolean).join(' · ')
176
+ const BACK = (iso: string): string => new Date(iso).toLocaleString([], { weekday: 'short', day: 'numeric', month: 'short', hour: '2-digit', minute: '2-digit' })
132
177
 
178
+ /** a thread of the list as the one thread row: the dot of who acts now only where no turn band says it */
133
179
  const Row = observer(({ rv, r, on }: { rv: ReviewSt; r: ThreadRow; on: boolean }) => {
134
- // handled: nobody owes anything on it, and no lane reworks it
135
- const muted = !on && !r.active
136
- const ref = useRef<HTMLDivElement>(null)
180
+ const ref = useRef<HTMLDivElement & HTMLAnchorElement>(null)
137
181
  useEffect(() => {
138
182
  if (on) ref.current?.scrollIntoView({ block: 'nearest' })
139
183
  }, [on])
184
+ const words = [
185
+ r.versions > 1 ? <span className="rv-rowv" title={`${r.versions} versions in this thread`}>v{r.versions}</span> : null,
186
+ r.rule ? <span title={`raised by the auto rule ${r.rule}`}>auto</span> : null,
187
+ r.aside ? <span className="rv-rowaside">back {BACK(r.aside.until)}{r.aside.moved ? ', moved since' : ''}</span> : null,
188
+ r.cursor ? <span className="rv-rowcursor" data-cursor={r.cursor.working !== undefined ? 'working' : 'seen'} title={r.cursor.working ?? 'read your newest word'}>{cursorWords(r.cursor, actorName(r.cursor.who, r.cursor.session, rv.parties))}</span> : null,
189
+ r.laneAsk ? <span className="rv-rowlane">{laneAskWords(r.laneAsk, r.holder ? { ...r.holder, at: '' } : null, rv.parties, rv.partiesRepo || rv.repo.name)}</span> : null,
190
+ r.update?.state === 'broken' && !isOwnerWait(r.wait) ? <span className="rv-rowstate" title={`${UPDATE_WORDS.broken}: ${r.update.text}`}>broken</span> : null,
191
+ ].filter((w) => w !== null)
192
+ const hint = [
193
+ r.holder ? `held by ${r.holder.lane ?? rv.hearingOf(r.holder).chip}` : null,
194
+ r.cursor ? cursorWords(r.cursor, actorName(r.cursor.who, r.cursor.session, rv.parties)) : null,
195
+ r.versions > 1 ? `v${r.versions}` : null,
196
+ r.rule ? 'auto' : null,
197
+ r.aside ? `back ${BACK(r.aside.until)}` : null,
198
+ ].filter((w) => w !== null).join(' · ')
140
199
  return (
141
- <div ref={ref} className={`rv-row ${toneOf(r.status)}${on ? ' on' : ''}${muted ? ' muted' : ''}${r.lane ? ' laned' : ''}`} style={r.lane ? { ['--lane' as string]: laneColor(r.lane) } : undefined} onClick={() => rv.pick(r.head)}>
142
- <div className="rv-thumb"><ThumbOf rv={rv} row={r} /></div>
143
- <div className="rv-rowbody">
144
- <div className={`rv-rowtitle${on || r.waits ? ' strong' : ''}`}>
145
- {r.unread ? <span className="rv-unread" title="a message of the agent to read" /> : null}
146
- {r.title}
147
- </div>
148
- <div className="rv-rowmeta">
149
- <span className="rv-badge">{STATUS_LABEL[r.status]}</span>
150
- {r.versions > 1 ? <span className="rv-badge outline" title={`${r.versions} versions in this thread`}>v{r.versions}</span> : null}
151
- {r.lane ? <LaneTag lane={r.lane} /> : null}
152
- {r.rule ? <AutoTag rule={r.rule} /> : null}
153
- <span className="rv-about">{ABOUT(r, rv)}</span>
154
- </div>
155
- {r.update ? (
156
- <div className={`rv-rowupdate up-${r.update.state}`} title={r.update.text}>
157
- <b>{UPDATE_WORDS[r.update.state]}</b> {r.update.text}
158
- </div>
159
- ) : null}
160
- <Rework r={r.rework} />
161
- </div>
162
- </div>
200
+ <ThreadRowView
201
+ ref={ref}
202
+ head={r.head}
203
+ title={r.title}
204
+ on={on}
205
+ muted={!on && !r.active && !isOwnerWait(r.wait)}
206
+ unread={r.unread}
207
+ thumb={r.thumb ? rv.thumbUrl(r.head, r.thumb) : null}
208
+ {...(rv.byLane ? { turn: bandOfRow(rv, r) } : {})}
209
+ {...(isOwnerWait(r.wait) ? { need: r.wait, needSays: MUST_SAYS[r.wait] } : {})}
210
+ glyph={r.waitsOn && isOwnerWait(r.wait) ? waitGlyph(r.waitsOn, rv.spec) : null}
211
+ holder={<HolderChip rv={rv} holder={r.holder} plain />}
212
+ words={words}
213
+ {...(hint ? { hint } : {})}
214
+ at={Date.parse(r.updated)}
215
+ clock={rv}
216
+ pill={r.update?.state === 'broken' && isOwnerWait(r.wait) ? { words: 'broken', tone: 'red', title: `${UPDATE_WORDS.broken}: ${r.update.text}` } : null}
217
+ {...(r.update ? { tip: `${UPDATE_WORDS[r.update.state]}: ${r.update.text}` } : {})}
218
+ onClick={() => rv.pick(r.head)}
219
+ />
163
220
  )
164
221
  })
@@ -5,6 +5,7 @@ import { observer } from 'mobx-react-lite'
5
5
  import { useEffect } from 'react'
6
6
  import { Panel, Separator } from 'react-resizable-panels'
7
7
  import { KeptCols, LIST_COL, PANEL } from '../kept-cols.tsx'
8
+ import { PaneBoundary } from '../pane-boundary.tsx'
8
9
  import type { RepoSt } from '../repo-st.ts'
9
10
  import { ReviewList } from './review-list.tsx'
10
11
  import type { ReviewSt } from './review-st.ts'
@@ -22,10 +23,10 @@ export const ReviewPage = observer(({ app }: { app: RepoSt }) => {
22
23
  {rv.phone.pane === 'list' ? (
23
24
  <>
24
25
  <PhoneTop app={app} />
25
- <div className="rv-phonepane"><ReviewList rv={rv} /></div>
26
+ <div className="rv-phonepane"><PaneBoundary pane="thread list" at={app.name}><ReviewList rv={rv} /></PaneBoundary></div>
26
27
  </>
27
28
  ) : (
28
- <ThreadColumn rv={rv} />
29
+ <PaneBoundary pane="thread" at={app.name} resetKey={rv.card?.id ?? ''}><ThreadColumn rv={rv} /></PaneBoundary>
29
30
  )}
30
31
  <Toast rv={rv} />
31
32
  </div>
@@ -35,11 +36,11 @@ export const ReviewPage = observer(({ app }: { app: RepoSt }) => {
35
36
  <Toast rv={rv} />
36
37
  <KeptCols id="review" folds={{ left: 'review-list' }} layout={app.home.layout}>
37
38
  <Panel id="review-list" {...LIST_COL} className="rv-pane" style={PANEL}>
38
- <ReviewList rv={rv} />
39
+ <PaneBoundary pane="thread list" at={app.name}><ReviewList rv={rv} /></PaneBoundary>
39
40
  </Panel>
40
41
  <Separator className="rsep" />
41
42
  <Panel id="review-thread" defaultSize="76%" minSize={360} className="rv-pane" style={PANEL}>
42
- <ThreadColumn rv={rv} />
43
+ <PaneBoundary pane="thread" at={app.name} resetKey={rv.card?.id ?? ''}><ThreadColumn rv={rv} /></PaneBoundary>
43
44
  </Panel>
44
45
  </KeptCols>
45
46
  </>