rvlib-shipkit 2.29.0 → 2.30.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 (512) hide show
  1. package/CHANGELOG.md +20 -1
  2. package/package.json +2 -1
  3. package/src/advisors/app-graph.ts +1 -1
  4. package/src/advisors/expose.ts +5 -1
  5. package/src/advisors/r2.ts +7 -9
  6. package/src/advisors/routes.ts +29 -2
  7. package/src/advisors/scan.ts +11 -0
  8. package/src/agent-time/accounts-usage.ts +8 -0
  9. package/src/agent-time/claude-sessions.ts +32 -0
  10. package/src/agent-time/hooks.ts +1 -1
  11. package/src/agent-time/live.ts +5 -2
  12. package/src/agent-time/registry.ts +186 -89
  13. package/src/agent-time/store.ts +6 -4
  14. package/src/asks/ask-doc.ts +2 -2
  15. package/src/asks/ask-store.ts +22 -7
  16. package/src/check.ts +9 -1
  17. package/src/checks/SK001-package-json-shape.check.ts +1 -0
  18. package/src/checks/SK003-claude-md-shape.check.ts +1 -0
  19. package/src/checks/SK004-gitignore-policy.check.ts +12 -6
  20. package/src/checks/SK008-reviewer-agent.check.ts +4 -7
  21. package/src/checks/SK013-one-way-in-policy.check.ts +1 -0
  22. package/src/checks/SK017-vscode-hub-task.check.ts +1 -0
  23. package/src/checks/SK024-identity-colors.check.ts +1 -1
  24. package/src/checks/SK027-agent-wiki-links.check.ts +2 -1
  25. package/src/checks/SK033-global-contribution.check.ts +1 -0
  26. package/src/checks/SK034-commit-gates-armed.check.ts +1 -0
  27. package/src/checks/SK039-vscode-watch-generated.check.ts +1 -0
  28. package/src/checks/SK049-thread-answers-hook.check.ts +9 -5
  29. package/src/checks/SK050-retired-commands.check.ts +1 -0
  30. package/src/checks/SK051-no-formatter.check.ts +1 -0
  31. package/src/cli/channel-run.ts +17 -0
  32. package/src/cli/cmd_Advisors.ts +28 -7
  33. package/src/cli/cmd_Asks.ts +2 -2
  34. package/src/cli/cmd_Backup.ts +5 -1
  35. package/src/cli/cmd_CacheAudit.ts +1 -1
  36. package/src/cli/cmd_Channel.ts +43 -0
  37. package/src/cli/cmd_GlobalProcesses.ts +1 -0
  38. package/src/cli/cmd_Home.ts +12 -5
  39. package/src/cli/cmd_Hooks.ts +1 -1
  40. package/src/cli/cmd_Hq.ts +43 -0
  41. package/src/cli/cmd_Lanes.ts +15 -3
  42. package/src/cli/cmd_Media.ts +8 -3
  43. package/src/cli/cmd_Orchestrator.ts +253 -84
  44. package/src/cli/cmd_OrchestratorRole.ts +163 -0
  45. package/src/cli/cmd_Review.ts +142 -165
  46. package/src/cli/cmd_Secret.ts +44 -14
  47. package/src/cli/cmd_Shot.ts +2 -4
  48. package/src/cli/cmd_Sound.ts +1 -0
  49. package/src/cli/cmd_Urls.ts +3 -3
  50. package/src/cli/inbox-hook-run.ts +109 -0
  51. package/src/cli/registry.ts +6 -2
  52. package/src/cli/review-here.ts +136 -0
  53. package/src/cli.ts +45 -14
  54. package/src/collections/actions.ts +5 -4
  55. package/src/collections/checks.ts +5 -0
  56. package/src/collections/collection-types.ts +4 -3
  57. package/src/collections/pings.ts +4 -1
  58. package/src/collections/providers.ts +6 -4
  59. package/src/collections/tests.ts +7 -4
  60. package/src/core/app-icon-frame.ts +62 -0
  61. package/src/core/app-icon.ts +179 -17
  62. package/src/core/archived.ts +10 -7
  63. package/src/core/check-ctx.ts +38 -4
  64. package/src/core/check-pass.ts +7 -0
  65. package/src/core/foreign.ts +87 -0
  66. package/src/core/gui-color.ts +75 -0
  67. package/src/core/hub-theme.ts +1 -3
  68. package/src/core/layout.ts +3 -0
  69. package/src/core/machine-commit.ts +9 -1
  70. package/src/core/one-lib.ts +2 -1
  71. package/src/core/one-way-in-policy.ts +17 -12
  72. package/src/core/owner-word-policy.ts +123 -0
  73. package/src/core/panel-shades.ts +140 -0
  74. package/src/core/repo-gui-color.ts +16 -0
  75. package/src/core/role-policy.ts +17 -0
  76. package/src/core/scope.ts +6 -3
  77. package/src/core/tmux-policy.ts +264 -0
  78. package/src/core/unit-icon.ts +43 -0
  79. package/src/fleet/push-fleet.ts +2 -0
  80. package/src/fleet/scan-fleet.ts +3 -0
  81. package/src/gate/cache-audit.ts +7 -1
  82. package/src/gate/gate-checks.ts +14 -9
  83. package/src/gate/run-fix.ts +30 -5
  84. package/src/gate/run-fixers.ts +8 -3
  85. package/src/home/activity-shape.ts +2 -0
  86. package/src/home/activity.ts +2 -1
  87. package/src/home/daemon-guard.ts +20 -2
  88. package/src/home/daemon-jobs.ts +26 -18
  89. package/src/home/gui-app/ShipkitGui.swift +2012 -144
  90. package/src/home/gui-app/icon.svg +8 -0
  91. package/src/home/gui-app.ts +94 -30
  92. package/src/home/home-routes.ts +53 -9
  93. package/src/home/home-start.ts +27 -3
  94. package/src/home/inbox-shape.ts +7 -3
  95. package/src/home/log-follow.ts +117 -0
  96. package/src/home/machine-fold.ts +1 -1
  97. package/src/home/open-app.ts +9 -3
  98. package/src/home/page-build.ts +5 -1
  99. package/src/home/page-held.ts +1 -1
  100. package/src/home/pm-config.ts +0 -8
  101. package/src/home/pm.ts +62 -5
  102. package/src/home/process-apps.ts +70 -23
  103. package/src/home/process-rows.ts +16 -1
  104. package/src/home/push-sources.ts +18 -13
  105. package/src/home/resources.ts +16 -7
  106. package/src/home/run-daemon.ts +4 -1
  107. package/src/home/run-pm.ts +1 -1
  108. package/src/home/serve-daemon.ts +13 -4
  109. package/src/home/serve-web.ts +141 -17
  110. package/src/home/space-page.ts +3 -3
  111. package/src/home/space-route.ts +2 -2
  112. package/src/home/supervise.ts +2 -1
  113. package/src/home/vault-page.ts +2 -1
  114. package/src/home/web-places.ts +239 -0
  115. package/src/home/widgets.ts +16 -2
  116. package/src/hooks/commit-message.ts +11 -9
  117. package/src/hooks/one-way-in-guard.ts +145 -68
  118. package/src/hooks/run-hooks.ts +15 -5
  119. package/src/hooks/shared-file.ts +273 -83
  120. package/src/hooks/shell-writes.ts +620 -0
  121. package/src/hooks/write-log.ts +149 -0
  122. package/src/hq/door-route.ts +63 -7
  123. package/src/hq/door.ts +45 -12
  124. package/src/hq/history-send.ts +3 -1
  125. package/src/hq/hq-db.ts +10 -3
  126. package/src/hq/hq-local.ts +24 -5
  127. package/src/hq/hq-routes.ts +3 -1
  128. package/src/hq/hq-store.ts +9 -3
  129. package/src/hq/kinds/index.ts +2 -1
  130. package/src/hq/kinds/kind.ts +9 -4
  131. package/src/hq/kinds/presence-rule.ts +56 -0
  132. package/src/hq/kinds/presence.ts +210 -0
  133. package/src/hq/kinds/report.ts +8 -5
  134. package/src/hq/lead-order.ts +68 -0
  135. package/src/hq/outbox.ts +7 -0
  136. package/src/hq/replica.ts +5 -7
  137. package/src/hq/report-facts.ts +14 -7
  138. package/src/hq/report.ts +47 -2
  139. package/src/hq/switch.ts +1 -0
  140. package/src/hq/terminal-hop.ts +64 -0
  141. package/src/hq/thread-sync.ts +13 -6
  142. package/src/http/door-forward.ts +10 -12
  143. package/src/http/door-names.ts +9 -0
  144. package/src/http/hop-caller.ts +23 -0
  145. package/src/http/hop-names.ts +14 -0
  146. package/src/http/loopback-serve.ts +28 -6
  147. package/src/http/owner-word.ts +128 -0
  148. package/src/http/same-origin.ts +12 -0
  149. package/src/{serve → http}/secret-gate.ts +3 -3
  150. package/src/ledger/run-log.ts +25 -1
  151. package/src/media-store/backup/sources.ts +53 -6
  152. package/src/media-store/backup/thread-copy.ts +9 -5
  153. package/src/media-store/copy/config.ts +10 -9
  154. package/src/media-store/daemon.ts +5 -2
  155. package/src/media-store/put.ts +3 -0
  156. package/src/media-store/space.ts +14 -16
  157. package/src/media-store/upload.ts +4 -0
  158. package/src/messages/collection.ts +2 -2
  159. package/src/messages/model.ts +6 -1
  160. package/src/messages/routes.ts +3 -0
  161. package/src/orchestrator/brief.md +8 -6
  162. package/src/orchestrator/channel-declare.ts +58 -0
  163. package/src/orchestrator/channel.ts +226 -0
  164. package/src/orchestrator/guards.ts +12 -3
  165. package/src/orchestrator/host.ts +35 -0
  166. package/src/orchestrator/lead-shape.ts +86 -0
  167. package/src/orchestrator/now.ts +88 -0
  168. package/src/orchestrator/phone.ts +4 -1
  169. package/src/orchestrator/places-file.ts +38 -0
  170. package/src/orchestrator/places-look.ts +180 -0
  171. package/src/orchestrator/places-shape.ts +151 -0
  172. package/src/orchestrator/places.ts +50 -0
  173. package/src/orchestrator/presence-shape.ts +13 -2
  174. package/src/orchestrator/presence.ts +26 -15
  175. package/src/orchestrator/push.ts +5 -10
  176. package/src/orchestrator/role-shape.ts +270 -0
  177. package/src/orchestrator/role.ts +242 -0
  178. package/src/orchestrator/routes.ts +136 -31
  179. package/src/orchestrator/sessions-shape.ts +78 -0
  180. package/src/orchestrator/sessions.ts +86 -0
  181. package/src/orchestrator/share.ts +71 -0
  182. package/src/orchestrator/start-notice.ts +61 -0
  183. package/src/orchestrator/start.ts +137 -0
  184. package/src/orchestrator/started.ts +55 -0
  185. package/src/orchestrator/stuck.ts +196 -0
  186. package/src/orchestrator/unheard.ts +18 -7
  187. package/src/pages/frame-client.ts +44 -6
  188. package/src/problems/failure-words.ts +80 -0
  189. package/src/release/run-bump.ts +26 -5
  190. package/src/release/run-release.ts +34 -14
  191. package/src/repo-config.ts +37 -9
  192. package/src/review/aside-at.ts +19 -0
  193. package/src/review/band.ts +3 -3
  194. package/src/review/doc-save.ts +1 -1
  195. package/src/review/inbox-hook.ts +12 -4
  196. package/src/review/inbox-read.ts +20 -7
  197. package/src/review/instruction-guards.ts +137 -0
  198. package/src/review/instructions.ts +14 -2
  199. package/src/review/item-db.ts +52 -2
  200. package/src/review/mentions.ts +6 -4
  201. package/src/review/model.ts +3 -2
  202. package/src/review/parties.ts +88 -19
  203. package/src/review/push.ts +32 -15
  204. package/src/review/routes.ts +12 -4
  205. package/src/review/secret-route.ts +5 -5
  206. package/src/review/snooze.ts +1 -16
  207. package/src/review/store-parties.ts +4 -2
  208. package/src/review/take-back.ts +2 -1
  209. package/src/review/threads.ts +13 -2
  210. package/src/review/unit.ts +3 -2
  211. package/src/review/view-layout.ts +8 -1
  212. package/src/review/watchers.ts +25 -4
  213. package/src/secrets/key-pair.ts +14 -0
  214. package/src/secrets/lapse.ts +3 -3
  215. package/src/secrets/manager.ts +5 -1
  216. package/src/secrets/name-template.ts +83 -0
  217. package/src/secrets/name.ts +3 -0
  218. package/src/secrets/read.ts +10 -6
  219. package/src/secrets/secrets-view.ts +299 -0
  220. package/src/secrets/who-reads.ts +2 -1
  221. package/src/serve/frame-part.ts +49 -0
  222. package/src/serve/hub-app/accounts-line.tsx +33 -45
  223. package/src/serve/hub-app/activity-st.ts +6 -5
  224. package/src/serve/hub-app/activity-view.tsx +10 -9
  225. package/src/serve/hub-app/advice-box.tsx +6 -5
  226. package/src/serve/hub-app/advisor-app.tsx +2 -0
  227. package/src/serve/hub-app/advisor-face.tsx +3 -2
  228. package/src/serve/hub-app/advisor.html +1 -0
  229. package/src/serve/hub-app/advisors-view.tsx +52 -10
  230. package/src/serve/hub-app/advisors.css +4 -0
  231. package/src/serve/hub-app/app-bridge.ts +31 -5
  232. package/src/serve/hub-app/asked-page.ts +24 -0
  233. package/src/serve/hub-app/asks-page.tsx +10 -6
  234. package/src/serve/hub-app/auto-text.tsx +7 -5
  235. package/src/serve/hub-app/card-head.tsx +3 -2
  236. package/src/serve/hub-app/check-view.tsx +10 -9
  237. package/src/serve/hub-app/checks-svc.ts +96 -32
  238. package/src/serve/hub-app/clock-svc.ts +24 -8
  239. package/src/serve/hub-app/code-copy.ts +1 -1
  240. package/src/serve/hub-app/col-card.tsx +2 -1
  241. package/src/serve/hub-app/col-list-page.tsx +12 -6
  242. package/src/serve/hub-app/col-list-st.ts +12 -2
  243. package/src/serve/hub-app/col-tables-view.tsx +8 -44
  244. package/src/serve/hub-app/col-tables.ts +0 -14
  245. package/src/serve/hub-app/cols-svc.ts +6 -12
  246. package/src/serve/hub-app/columns.ts +94 -0
  247. package/src/serve/hub-app/comfy-view.tsx +8 -7
  248. package/src/serve/hub-app/commands/commands-page.tsx +4 -3
  249. package/src/serve/hub-app/commands/commands-st.ts +2 -2
  250. package/src/serve/hub-app/controls.css +69 -23
  251. package/src/serve/hub-app/cycle-button.tsx +2 -1
  252. package/src/serve/hub-app/database-st.ts +1 -1
  253. package/src/serve/hub-app/database-view.tsx +4 -2
  254. package/src/serve/hub-app/deaf.tsx +27 -0
  255. package/src/serve/hub-app/dock-st.ts +21 -16
  256. package/src/serve/hub-app/dock-view.tsx +19 -12
  257. package/src/serve/hub-app/empty-section.tsx +30 -0
  258. package/src/serve/hub-app/entry-bar.css +1 -1
  259. package/src/serve/hub-app/entry-bar.tsx +11 -6
  260. package/src/serve/hub-app/entry-list.css +32 -0
  261. package/src/serve/hub-app/entry-list.tsx +123 -0
  262. package/src/serve/hub-app/entry-pick.ts +1 -1
  263. package/src/serve/hub-app/entry-sections.ts +140 -0
  264. package/src/serve/hub-app/event-stream-reader.ts +56 -0
  265. package/src/serve/hub-app/floating.tsx +68 -14
  266. package/src/serve/hub-app/geometry-view.tsx +3 -2
  267. package/src/serve/hub-app/git-view.tsx +3 -2
  268. package/src/serve/hub-app/hash-route.ts +14 -2
  269. package/src/serve/hub-app/header-bar.tsx +53 -36
  270. package/src/serve/hub-app/home-st.ts +131 -14
  271. package/src/serve/hub-app/home-strip.css +24 -13
  272. package/src/serve/hub-app/home-strip.tsx +131 -66
  273. package/src/serve/hub-app/home.html +5 -0
  274. package/src/serve/hub-app/hub-app.tsx +94 -102
  275. package/src/serve/hub-app/hub.css +61 -94
  276. package/src/serve/hub-app/icons.tsx +16 -0
  277. package/src/serve/hub-app/identities-st.ts +19 -54
  278. package/src/serve/hub-app/identities-view.tsx +25 -24
  279. package/src/serve/hub-app/identity-address.ts +2 -2
  280. package/src/serve/hub-app/in-sight.ts +10 -0
  281. package/src/serve/hub-app/inbox-st.ts +20 -2
  282. package/src/serve/hub-app/inbox-view.tsx +16 -9
  283. package/src/serve/hub-app/inbox.css +1 -0
  284. package/src/serve/hub-app/index.html +5 -0
  285. package/src/serve/hub-app/insights-view.tsx +6 -5
  286. package/src/serve/hub-app/instructions.css +4 -1
  287. package/src/serve/hub-app/kept-cols.tsx +83 -20
  288. package/src/serve/hub-app/kept-width.tsx +76 -0
  289. package/src/serve/hub-app/keys.ts +116 -38
  290. package/src/serve/hub-app/layout-st.ts +109 -99
  291. package/src/serve/hub-app/lightbox-zoom.css +36 -0
  292. package/src/serve/hub-app/list-filter.tsx +15 -6
  293. package/src/serve/hub-app/list-head.tsx +29 -0
  294. package/src/serve/hub-app/list-row.ts +8 -0
  295. package/src/serve/hub-app/list-walk.ts +26 -105
  296. package/src/serve/hub-app/live-socket.ts +274 -0
  297. package/src/serve/hub-app/live-sources.ts +189 -0
  298. package/src/serve/hub-app/live-svc.ts +2 -2
  299. package/src/serve/hub-app/machine-st.ts +75 -14
  300. package/src/serve/hub-app/main-panel.css +211 -0
  301. package/src/serve/hub-app/main-panel.tsx +259 -0
  302. package/src/serve/hub-app/md.ts +4 -4
  303. package/src/serve/hub-app/media-svc.ts +5 -5
  304. package/src/serve/hub-app/media-view.tsx +13 -12
  305. package/src/serve/hub-app/messages/messages-page.tsx +8 -7
  306. package/src/serve/hub-app/messages/messages-st.ts +5 -2
  307. package/src/serve/hub-app/new-thread-st.ts +170 -0
  308. package/src/serve/hub-app/new-thread.tsx +133 -107
  309. package/src/serve/hub-app/orchestrator-line.tsx +115 -45
  310. package/src/serve/hub-app/orchestrator-places.tsx +86 -0
  311. package/src/serve/hub-app/orchestrator.css +57 -5
  312. package/src/serve/hub-app/page-keys.ts +107 -68
  313. package/src/serve/hub-app/page-reload.ts +46 -6
  314. package/src/serve/hub-app/pages-frames.tsx +40 -3
  315. package/src/serve/hub-app/pages-svc.ts +3 -1
  316. package/src/serve/hub-app/palette-st.ts +198 -43
  317. package/src/serve/hub-app/palette-view.tsx +32 -8
  318. package/src/serve/hub-app/panel-head-action.tsx +39 -0
  319. package/src/serve/hub-app/panel-head.tsx +70 -0
  320. package/src/serve/hub-app/panel-repo.ts +42 -0
  321. package/src/serve/hub-app/panel-source.ts +195 -0
  322. package/src/serve/hub-app/panel-tint.css +6 -0
  323. package/src/serve/hub-app/panel-tint.ts +23 -0
  324. package/src/serve/hub-app/panel-walk.ts +107 -0
  325. package/src/serve/hub-app/pill-row.tsx +2 -1
  326. package/src/serve/hub-app/place-path.ts +4 -0
  327. package/src/serve/hub-app/places-svc.ts +75 -0
  328. package/src/serve/hub-app/plan-view.tsx +3 -2
  329. package/src/serve/hub-app/polled.ts +11 -1
  330. package/src/serve/hub-app/presence-st.ts +66 -32
  331. package/src/serve/hub-app/processes-view.tsx +2 -2
  332. package/src/serve/hub-app/project-bar.tsx +116 -0
  333. package/src/serve/hub-app/project-list.css +20 -173
  334. package/src/serve/hub-app/project-list.tsx +30 -298
  335. package/src/serve/hub-app/projects-svc.ts +59 -32
  336. package/src/serve/hub-app/push-sign.tsx +2 -1
  337. package/src/serve/hub-app/push-svc.ts +86 -69
  338. package/src/serve/hub-app/quiet-st.ts +5 -3
  339. package/src/serve/hub-app/rail-groups.ts +144 -0
  340. package/src/serve/hub-app/reader-chips.tsx +2 -1
  341. package/src/serve/hub-app/recordings-st.ts +2 -1
  342. package/src/serve/hub-app/recordings-view.tsx +19 -47
  343. package/src/serve/hub-app/recordings.css +0 -2
  344. package/src/serve/hub-app/reflections-page.tsx +10 -6
  345. package/src/serve/hub-app/releases/releases-page.tsx +6 -5
  346. package/src/serve/hub-app/repo-sections.ts +127 -38
  347. package/src/serve/hub-app/repo-st.ts +57 -36
  348. package/src/serve/hub-app/review/advisor-bar.tsx +3 -2
  349. package/src/serve/hub-app/review/ask-proof.tsx +79 -0
  350. package/src/serve/hub-app/review/attach-view.tsx +11 -10
  351. package/src/serve/hub-app/review/box-view.ts +479 -0
  352. package/src/serve/hub-app/review/box-zoom.tsx +70 -0
  353. package/src/serve/hub-app/review/diff-view.tsx +3 -2
  354. package/src/serve/hub-app/review/doc-body.tsx +2 -1
  355. package/src/serve/hub-app/review/dock.tsx +3 -2
  356. package/src/serve/hub-app/review/draft-body.tsx +4 -3
  357. package/src/serve/hub-app/review/faces.tsx +0 -8
  358. package/src/serve/hub-app/review/group-block.tsx +8 -7
  359. package/src/serve/hub-app/review/heard-line.tsx +4 -3
  360. package/src/serve/hub-app/review/instructions-view.tsx +3 -2
  361. package/src/serve/hub-app/review/item-verdict.tsx +40 -40
  362. package/src/serve/hub-app/review/kind-states.tsx +5 -4
  363. package/src/serve/hub-app/review/kit.tsx +24 -4
  364. package/src/serve/hub-app/review/lane-bar.tsx +30 -28
  365. package/src/serve/hub-app/review/lightbox.tsx +6 -4
  366. package/src/serve/hub-app/review/live-bar.tsx +7 -6
  367. package/src/serve/hub-app/review/live-view.tsx +6 -5
  368. package/src/serve/hub-app/review/object-card.tsx +2 -1
  369. package/src/serve/hub-app/review/object-panel.tsx +11 -10
  370. package/src/serve/hub-app/review/pano-view.tsx +3 -2
  371. package/src/serve/hub-app/review/question-views.tsx +6 -5
  372. package/src/serve/hub-app/review/review-cells.tsx +21 -20
  373. package/src/serve/hub-app/review/review-host.ts +3 -0
  374. package/src/serve/hub-app/review/review-kit.ts +7 -5
  375. package/src/serve/hub-app/review/review-list.tsx +98 -52
  376. package/src/serve/hub-app/review/review-page.tsx +3 -3
  377. package/src/serve/hub-app/review/review-st.ts +70 -14
  378. package/src/serve/hub-app/review/review-thread.tsx +234 -138
  379. package/src/serve/hub-app/review/review-views.tsx +166 -191
  380. package/src/serve/hub-app/review/space3d.tsx +17 -9
  381. package/src/serve/hub-app/review/thread-close.tsx +24 -32
  382. package/src/serve/hub-app/review/thread-st.ts +39 -25
  383. package/src/serve/hub-app/review/trailer-body.tsx +5 -4
  384. package/src/serve/hub-app/review/trailer-page.tsx +18 -16
  385. package/src/serve/hub-app/review/trailer-st.ts +3 -2
  386. package/src/serve/hub-app/review/trailer-timeline.tsx +10 -9
  387. package/src/serve/hub-app/review/trailer-voices.tsx +29 -28
  388. package/src/serve/hub-app/review.css +159 -42
  389. package/src/serve/hub-app/row-acts.tsx +126 -0
  390. package/src/serve/hub-app/row-face.tsx +29 -0
  391. package/src/serve/hub-app/running-rows.tsx +142 -0
  392. package/src/serve/hub-app/running-st.ts +110 -0
  393. package/src/serve/hub-app/search-view.tsx +3 -2
  394. package/src/serve/hub-app/secrets-page.tsx +290 -0
  395. package/src/serve/hub-app/secrets-st.ts +181 -0
  396. package/src/serve/hub-app/secrets.css +65 -0
  397. package/src/serve/hub-app/section-head.tsx +3 -2
  398. package/src/serve/hub-app/session-chips.tsx +55 -0
  399. package/src/serve/hub-app/shell.ts +56 -0
  400. package/src/serve/hub-app/site/site-part.tsx +6 -5
  401. package/src/serve/hub-app/site/site-st.ts +0 -6
  402. package/src/serve/hub-app/site.css +0 -1
  403. package/src/serve/hub-app/social/calendar.tsx +7 -6
  404. package/src/serve/hub-app/social/comms-page.tsx +29 -26
  405. package/src/serve/hub-app/social/group-editor.tsx +2 -1
  406. package/src/serve/hub-app/social/kit.tsx +12 -11
  407. package/src/serve/hub-app/social/next-release.tsx +3 -2
  408. package/src/serve/hub-app/social/post-card.tsx +21 -20
  409. package/src/serve/hub-app/social/post-page.tsx +2 -1
  410. package/src/serve/hub-app/social/problems.tsx +3 -2
  411. package/src/serve/hub-app/social/social-page.tsx +29 -27
  412. package/src/serve/hub-app/social/social-st.ts +4 -2
  413. package/src/serve/hub-app/social/stage-popup.tsx +11 -10
  414. package/src/serve/hub-app/social.css +7 -5
  415. package/src/serve/hub-app/source-acts.ts +79 -0
  416. package/src/serve/hub-app/source-page.tsx +17 -0
  417. package/src/serve/hub-app/space-view.tsx +5 -4
  418. package/src/serve/hub-app/stores/stores-page.tsx +21 -19
  419. package/src/serve/hub-app/stores/stores-st.ts +1 -1
  420. package/src/serve/hub-app/stores.css +1 -1
  421. package/src/serve/hub-app/terminal-history-st.ts +112 -0
  422. package/src/serve/hub-app/terminal-keys.ts +79 -0
  423. package/src/serve/hub-app/terminal-lib.ts +110 -0
  424. package/src/serve/hub-app/terminal-links.ts +55 -0
  425. package/src/serve/hub-app/terminal-list-st.ts +304 -0
  426. package/src/serve/hub-app/terminal-log-st.ts +242 -0
  427. package/src/serve/hub-app/terminal-out.ts +135 -0
  428. package/src/serve/hub-app/terminal-pages.tsx +115 -0
  429. package/src/serve/hub-app/terminal-panel.tsx +60 -9
  430. package/src/serve/hub-app/terminal-sources.tsx +335 -0
  431. package/src/serve/hub-app/terminal-st.ts +447 -167
  432. package/src/serve/hub-app/terminal-stream.ts +233 -0
  433. package/src/serve/hub-app/terminal-tab.tsx +64 -0
  434. package/src/serve/hub-app/terminal-widths.ts +30 -0
  435. package/src/serve/hub-app/terminal.css +50 -4
  436. package/src/serve/hub-app/test-view.tsx +5 -3
  437. package/src/serve/hub-app/tests-view.tsx +16 -15
  438. package/src/serve/hub-app/theme-st.ts +5 -0
  439. package/src/serve/hub-app/thread-row.tsx +39 -31
  440. package/src/serve/hub-app/time-ago.tsx +3 -2
  441. package/src/serve/hub-app/time-view.tsx +2 -1
  442. package/src/serve/hub-app/time.css +1 -1
  443. package/src/serve/hub-app/timeline-chart.tsx +5 -4
  444. package/src/serve/hub-app/timeline-view.tsx +10 -9
  445. package/src/serve/hub-app/tips.ts +247 -0
  446. package/src/serve/hub-app/tree-build.ts +40 -8
  447. package/src/serve/hub-app/tree-svc.ts +167 -134
  448. package/src/serve/hub-app/unit-icons.ts +26 -0
  449. package/src/serve/hub-app/url-address.ts +154 -0
  450. package/src/serve/hub-app/url-faces.ts +88 -0
  451. package/src/serve/hub-app/url-forms.tsx +183 -0
  452. package/src/serve/hub-app/urls-svc.ts +167 -5
  453. package/src/serve/hub-app/urls-view.tsx +56 -20
  454. package/src/serve/hub-app/urls.css +26 -0
  455. package/src/serve/hub-app/vault-view.tsx +5 -4
  456. package/src/serve/hub-app/veille/veille-page.tsx +34 -33
  457. package/src/serve/hub-app/veille/veille-st.ts +6 -3
  458. package/src/serve/hub-app/view-layout.css +3 -3
  459. package/src/serve/hub-app/when-view.tsx +5 -4
  460. package/src/serve/hub-app/wikis-view.tsx +6 -5
  461. package/src/serve/hub-app/words.tsx +9 -2
  462. package/src/serve/hub-runtime.ts +3 -2
  463. package/src/serve/orchestrator-host.ts +58 -0
  464. package/src/serve/page-live.ts +147 -0
  465. package/src/serve/project-gutter-route.ts +63 -2
  466. package/src/serve/read-worker.ts +7 -2
  467. package/src/serve/runs-stamp.ts +33 -0
  468. package/src/serve/secrets-read.ts +156 -0
  469. package/src/serve/serve-hub.ts +71 -22
  470. package/src/serve/terminal-claudes.ts +185 -0
  471. package/src/serve/terminal-guard.ts +10 -5
  472. package/src/serve/terminal-host.ts +517 -0
  473. package/src/serve/terminal-record.ts +104 -0
  474. package/src/serve/terminal-route.ts +466 -103
  475. package/src/serve/terminal-shells.ts +3 -0
  476. package/src/serve/terminal-watch.ts +102 -0
  477. package/src/shipkit-files.ts +9 -4
  478. package/src/shot/client.ts +4 -9
  479. package/src/shot/shooter.ts +2 -4
  480. package/src/shot/shot-ask.ts +2 -7
  481. package/src/shot/shot-theme.ts +6 -17
  482. package/src/social/routes.ts +2 -2
  483. package/src/social/writes.ts +3 -0
  484. package/src/suite/test-units.ts +6 -2
  485. package/src/trailer/sound/eleven.ts +1 -0
  486. package/src/urls/added.ts +111 -0
  487. package/src/urls/icons.ts +294 -0
  488. package/src/urls/places.ts +139 -0
  489. package/src/urls/routes.ts +17 -7
  490. package/src/urls/rows.ts +48 -15
  491. package/src/urls/unit.ts +57 -3
  492. package/src/urls/write-routes.ts +207 -0
  493. package/src/vault/vault-destroy.ts +2 -1
  494. package/src/vault/vault-import.ts +4 -11
  495. package/src/vault/vault-restore.ts +3 -2
  496. package/src/veille/chrome.ts +18 -3
  497. package/src/veille/identity.ts +6 -0
  498. package/src/view3d/cam.ts +30 -46
  499. package/src/view3d/lib.ts +20 -2
  500. package/src/view3d/viewer.ts +62 -88
  501. package/src/wiki/agent-paths.ts +2 -1
  502. package/src/orchestrator/deliver.ts +0 -81
  503. package/src/orchestrator/drill.ts +0 -129
  504. package/src/orchestrator/keeper.ts +0 -332
  505. package/src/orchestrator/pm.ts +0 -20
  506. package/src/orchestrator/state.ts +0 -92
  507. package/src/orchestrator/switch.ts +0 -86
  508. package/src/orchestrator/tmux.ts +0 -82
  509. package/src/serve/hub-app/rail-fly.tsx +0 -95
  510. package/src/serve/hub-app/side-lists.ts +0 -72
  511. package/src/serve/hub-app/sidebar.tsx +0 -62
  512. package/src/serve/hub-app/tree-row.tsx +0 -125
@@ -5,15 +5,17 @@
5
5
  // and keeps the frame's time. A choice, or views that each play alone, read as option rows, each image and clip full
6
6
  // under its row
7
7
  import { observer } from 'mobx-react-lite'
8
- import { useEffect, useMemo, useRef, useState, type ReactNode } from 'react'
8
+ import { useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type ReactNode } from 'react'
9
9
  import { createPortal } from 'react-dom'
10
10
  import type { VersionCell } from '../../../review/cells.ts'
11
11
  import { isChoice, isGallery, isPair, onFrame, SCENE_WORDS, STARS, STATUS_LABEL, thumbFileOf, tileName, viewFilesOf, viewName, viewTag, type GalleryTile, type GalleryView, type Item, type MediaView, type Rect, type ReviewClip, type ReviewMark, type ReviewStatus, type ReviewView, type Side } from '../../../review/model.ts'
12
12
  import { AutoText } from '../auto-text.tsx'
13
13
  import type { ClipSt } from './clip-st.ts'
14
14
  import { boxReaction, FIT_ROOM, keepFocus, Key, PAIR_NAMES, PLACE_TIPS, REACTIONS, secs, SIDE_LABEL } from './kit.tsx'
15
- import { BOX_ZOOM, boxStep, TILE_H, type BoxZoom, type Zoom } from './review-kit.ts'
16
- import { formOf, LAYOUT, sizeOf, TILE_ASPECT, type Size, type ViewForm } from '../../../review/view-layout.ts'
15
+ import { BoxView } from './box-view.ts'
16
+ import { BoxViewCtx, BoxZoomBar, useBoxView, ZoomMap } from './box-zoom.tsx'
17
+ import { TILE_H, type Zoom } from './review-kit.ts'
18
+ import { fillWidth, formOf, LAYOUT, sizeOf, TILE_ASPECT, type Size, type ViewForm } from '../../../review/view-layout.ts'
17
19
  import { COMPARE_MODES, drawnSide, type CompareMode, type CompareSt, type PairSide, type ReviewSt } from './review-st.ts'
18
20
  import { TILE_FILTERS, viewDom, viewKind, type SaidNote, type ThreadSt, type TileFilter } from './thread-st.ts'
19
21
  import { Caret, Icon, ICON } from '../icons.tsx'
@@ -25,6 +27,7 @@ import { LiveBody } from './live-view.tsx'
25
27
  import { SceneBody } from './scene-view.tsx'
26
28
  import { Words } from '../words.tsx'
27
29
  import { soleSpot } from '../../../review/one-block.ts'
30
+ import { tip } from '../tips.ts'
28
31
 
29
32
  export const toneClass = (s: string | undefined): string => (s ? ` re-${s}` : '')
30
33
 
@@ -75,7 +78,7 @@ export const VersionViews = observer(({ ver }: { ver: Ver }) => {
75
78
  <div className="rv-views">
76
79
  {options ? (
77
80
  <div className="rv-viewsbar">
78
- <span className="seg" title="the options as thin rows, one below the other, or every view full">
81
+ <span className="seg" {...tip('the options as thin rows, one below the other, or every view full')}>
79
82
  <button className={rows ? 'on' : ''} onMouseDown={keepFocus} onClick={() => thread.setFull(item.id, false)}>rows</button>
80
83
  <button className={rows ? '' : 'on'} onMouseDown={keepFocus} onClick={() => thread.setFull(item.id, true)}>full</button>
81
84
  </span>
@@ -106,7 +109,7 @@ export const ViewCell = observer(({ ver, v: live, i, frames, noted = true, boxed
106
109
  const body = gone.length > 0 ? <Gone files={gone} />
107
110
  : media?.live && rv.can('live') && 'image' in media.files ? <LiveBody live={media.live} label={media.label} shotSrc={rv.fitUrl(cell.id, media.files.image, cell.item.wip)} size={media.size} shot={<MediaBody ver={ver} v={media} i={i} zoom="fit" boxed />} />
108
111
  : isGallery(v) ? <GalleryThumbs ver={ver} v={v} view={i} />
109
- : <MediaBody ver={ver} v={v} i={i} zoom={rv.boxZoom} boxed />
112
+ : <MediaBody ver={ver} v={v} i={i} zoom="fit" boxed />
110
113
  return (
111
114
  <section className={`rv-view boxed${toneClass(shown?.status)}`} data-check="lightbox-view" data-view={i}>
112
115
  {frames ? <FrameSlider thread={thread} frames={frames} /> : null}
@@ -130,7 +133,7 @@ export const ViewCell = observer(({ ver, v: live, i, frames, noted = true, boxed
130
133
  <ViewTools ver={ver} v={v} i={i} tag={caption ? null : tag} />
131
134
  </div>
132
135
  {caption ? (
133
- <div className="rv-viewcap" title={`view ${tag}`}>
136
+ <div className="rv-viewcap" {...tip(`view ${tag}`)}>
134
137
  <span className="rv-viewn">{tag}</span>
135
138
  {v.label ? <b className="rv-viewname">{v.label}</b> : null}
136
139
  {v.label.toLowerCase() === viewKind(v, false).toLowerCase() ? null : <span className="rv-dim">{viewKind(v, false)}</span>}
@@ -172,7 +175,7 @@ const ViewBody = observer(({ ver, v, i, form, size }: { ver: Ver; v: ReviewView;
172
175
  /** a still in the thread a click opens in the lightbox: the media of a tile or a thumb, its word and « open » on it
173
176
  * (« 360° · open »), ▶ on a clip's poster */
174
177
  const Still = ({ src, word, open, fit, play = false }: { src: string; word: string | null; open: () => void; fit: 'cover' | 'contain'; play?: boolean }) => (
175
- <button type="button" className={`rv-still ${fit}`} data-check="view-still" title={word ? `open the ${word} in the lightbox` : 'open it in the lightbox'} onMouseDown={keepFocus} onClick={open}>
178
+ <button type="button" className={`rv-still ${fit}`} data-check="view-still" {...tip(word ? `open the ${word} in the lightbox` : 'open it in the lightbox')} onMouseDown={keepFocus} onClick={open}>
176
179
  <img src={src} alt="" loading="lazy" decoding="async" draggable={false} />
177
180
  {play ? <span className="rv-stillplay" aria-hidden>▶</span> : null}
178
181
  {word ? <span className="rv-stillopen">{word} · open</span> : null}
@@ -187,11 +190,10 @@ const Peek = observer(({ ver, v, i, size, before, after }: { ver: Ver; v: MediaV
187
190
  const item = itemOf(ver)
188
191
  const [peek, setPeek] = useState(false)
189
192
  const touch = useRef(false)
190
- const ratio = v.size.w / v.size.h
191
- const style = size === 'fill' ? { aspectRatio: `${v.size.w} / ${v.size.h}`, width: `min(100%, calc(var(--preview-h) * ${ratio}))` } : undefined
193
+ const style = size === 'fill' ? { aspectRatio: `${v.size.w} / ${v.size.h}`, width: fillWidth(v.size) } : undefined
192
194
  const a = v.clip ? rv.fitUrl(item.id, v.clip.poster, item.wip) : rv.fitUrl(item.id, after, item.wip)
193
195
  return (
194
- <button type="button" className={`rv-peek${peek ? ' on' : ''}`} data-check="view-still" style={style} title="the after; the pointer on it shows the before: open it to see both side by side, judge it, draw on it"
196
+ <button type="button" className={`rv-peek${peek ? ' on' : ''}`} data-check="view-still" style={style} {...tip('the after; the pointer on it shows the before: open it to see both side by side, judge it, draw on it')}
195
197
  onPointerDown={(e) => (touch.current = e.pointerType === 'touch')}
196
198
  onMouseDown={keepFocus}
197
199
  onClick={() => (touch.current ? setPeek(!peek) : ver.thread.openBox(ver.cell.id, i))}>
@@ -217,8 +219,8 @@ const ViewTools = observer(({ ver, v, i, tag }: { ver: Ver; v: ReviewView; i: nu
217
219
  const opens = LAYOUT[formOf(v)].opens !== null && !isGallery(v)
218
220
  return (
219
221
  <span className="rv-viewtools">
220
- {tag ? <span className="rv-viewn" title={`view ${tag}`}>{tag}</span> : null}
221
- {opens ? <button className="ghost rv-iconbtn" data-check="view-open" title="open it whole in the lightbox" aria-label="open it in the lightbox" onMouseDown={keepFocus} onClick={() => ver.thread.openBox(ver.cell.id, i)}>⤢</button> : null}
222
+ {tag ? <span className="rv-viewn" {...tip(`view ${tag}`)}>{tag}</span> : null}
223
+ {opens ? <button className="ghost rv-iconbtn" data-check="view-open" {...tip('open it whole in the lightbox')} aria-label="open it in the lightbox" onMouseDown={keepFocus} onClick={() => ver.thread.openBox(ver.cell.id, i)}>⤢</button> : null}
222
224
  {!isGallery(v) && isPair(v.files) && !v.clip && !v.audio ? <AnimPanel app={rv} item={item} /> : null}
223
225
  {isGallery(v) && rv.phone.on ? null : <StageButtons ver={ver} v={v} i={i} />}
224
226
  {isGallery(v) ? (rv.phone.on ? null : <GalleryMenu ver={ver} v={v} />) : files.length > 0 && !v.audio ? (
@@ -240,7 +242,7 @@ const StageButtons = observer(({ ver, v, i, tile = 0 }: { ver: Ver; v: ReviewVie
240
242
  const at = `${item.id}#${i}`
241
243
  const icon = <Icon d={ICON.stage} />
242
244
  if (isGallery(v) || !isPair(v.files))
243
- return <button className="ghost rv-iconbtn rv-stagebtn" title={isGallery(v) ? 'stage this image of the gallery as a post' : 'stage this media as a post: a draft in comms, never posted'} aria-label="stage as a post" onMouseDown={keepFocus} onClick={() => rv.openStage(isGallery(v) ? `${at}/${tile}` : at)}>{icon}</button>
245
+ return <button className="ghost rv-iconbtn rv-stagebtn" {...tip(isGallery(v) ? 'stage this image of the gallery as a post' : 'stage this media as a post: a draft in comms, never posted')} aria-label="stage as a post" onMouseDown={keepFocus} onClick={() => rv.openStage(isGallery(v) ? `${at}/${tile}` : at)}>{icon}</button>
244
246
  const entries: [string, string][] = [[`${at}.after`, 'the after'], [`${at}.before`, 'the before'], ...(v.clip ? [] : [[`${at}.wipe`, 'a wipe from before to after'] as [string, string]])]
245
247
  return (
246
248
  <Pop className="ghost rv-iconbtn rv-stagebtn" aria-label="stage as a post" title="stage as a post: a draft in comms, never posted" label={icon} placement="bottom-end">
@@ -272,13 +274,13 @@ const ViewNotes = observer(({ ver, i }: { ver: Ver; i: number }) => {
272
274
  ) : null}
273
275
  {draft.map(([r, k]) => (
274
276
  <div key={`d${k}`} className={`rv-outrow${thread.rect === k ? ' on' : ''}`}>
275
- <button className={`rv-outbadge rect${thread.rect === k ? ' on' : ''}`} title={r.t !== undefined ? 'go to this moment and open the note' : 'open the note on the image'} onMouseDown={keepFocus} onClick={() => thread.pickRect(k, true)}>
277
+ <button className={`rv-outbadge rect${thread.rect === k ? ' on' : ''}`} {...tip(r.t !== undefined ? 'go to this moment and open the note' : 'open the note on the image')} onMouseDown={keepFocus} onClick={() => thread.pickRect(k, true)}>
276
278
  {k + 1}{r.side ? ` ${SIDE_LABEL[r.side]}` : ''}{r.t !== undefined ? ` · ${secs(r.t)}` : ''}{r.tile !== undefined ? ` ${tileWhere(views[i], r.tile) ?? ''}` : ''}
277
279
  </button>
278
- <button className="rv-outtext ghost" title="open the note on the image" onMouseDown={keepFocus} onClick={() => thread.pickRect(k, true)}>
280
+ <button className="rv-outtext ghost" {...tip('open the note on the image')} onMouseDown={keepFocus} onClick={() => thread.pickRect(k, true)}>
279
281
  {r.comment.trim() ? r.comment : <i className="rv-dim">no word yet</i>}
280
282
  </button>
281
- <button className="ghost rv-x" title="delete this note" aria-label="delete this note" onClick={() => thread.removeRect(k)}>✕</button>
283
+ <button className="ghost rv-x" {...tip('delete this note')} aria-label="delete this note" onClick={() => thread.removeRect(k)}>✕</button>
282
284
  </div>
283
285
  ))}
284
286
  </div>
@@ -339,31 +341,31 @@ const OptionRow = observer(({ ver, v, i }: { ver: Ver; v: ReviewView; i: number
339
341
  <div className="rv-optrow">
340
342
  <span className="rv-optn">{viewTag(cell.n, i)}</span>
341
343
  {c && clock2 ? (
342
- <button className={`rv-optplay${c.paused ? '' : ' on'}`} title={`${c.paused ? 'play' : 'pause'}${ver.live ? ` (${i + 1})` : ''}`} onMouseDown={keepFocus} onClick={() => thread.listen(id, i)}>
344
+ <button className={`rv-optplay${c.paused ? '' : ' on'}`} {...tip(`${c.paused ? 'play' : 'pause'}${ver.live ? ` (${i + 1})` : ''}`)} onMouseDown={keepFocus} onClick={() => thread.listen(id, i)}>
343
345
  {c.paused ? '▶' : '❚❚'}
344
346
  </button>
345
347
  ) : null}
346
- <b className="rv-optlabel" title={viewName(v, i)}>{viewName(v, i)}</b>
347
- {choice && item.agentPick === i ? <span className="rv-mypick" title="the option the agent suggests; your pick is your own">my pick</span> : null}
348
+ <b className="rv-optlabel" {...tip(viewName(v, i))}>{viewName(v, i)}</b>
349
+ {choice && item.agentPick === i ? <span className="rv-mypick" {...tip('the option the agent suggests; your pick is your own')}>my pick</span> : null}
348
350
  {c && playable?.clip && !unfolded ? (
349
- <span className="rv-optthumb" style={{ aspectRatio: `${playable.size.w} / ${playable.size.h}` }} onClick={() => thread.toggleRow(item, i)} title="the full view">
351
+ <span className="rv-optthumb" style={{ aspectRatio: `${playable.size.w} / ${playable.size.h}` }} onClick={() => thread.toggleRow(item, i)} {...tip('the full view')}>
350
352
  <ClipVideo clip={c} src={rv.fitUrl(id, file, item.wip)} poster={rv.thumbUrl(id, playable.clip.poster)} loop={false} />
351
353
  </span>
352
354
  ) : null}
353
355
  {c && playable && clock2 ? (
354
356
  <Strip clip={c} duration={duration} wave={playable.audio ? rv.fileUrl(id, playable.audio.wave) : undefined} />
355
357
  ) : unfolded || c ? <span className="sp" /> : (
356
- <span className="rv-optthumb img" onClick={() => thread.toggleRow(item, i)} title="the full view"><img src={rv.thumbUrl(id, thumbFileOf(v))} alt="" draggable={false} loading="lazy" /></span>
358
+ <span className="rv-optthumb img" onClick={() => thread.toggleRow(item, i)} {...tip('the full view')}><img src={rv.thumbUrl(id, thumbFileOf(v))} alt="" draggable={false} loading="lazy" /></span>
357
359
  )}
358
360
  {c && clock2 ? <span className="rv-mono rv-opttime">{clock(c.time)} / {clock(duration)}</span> : null}
359
361
  <span className="rv-optacts">
360
362
  {choice ? <Stars ver={ver} view={i} given={reaction?.stars} /> : reaction?.status ? <SentReaction status={reaction.status} /> : null}
361
363
  {playable?.clip || !playable ? (
362
- <button className={unfolded ? 'on' : ''} title={unfolded ? 'fold it back to its row' : 'show it full under its row'} onMouseDown={keepFocus} onClick={() => thread.toggleRow(item, i)}><Caret v open={unfolded} /> {unfolded ? 'fold' : 'show'}</button>
364
+ <button className={unfolded ? 'on' : ''} {...tip(unfolded ? 'fold it back to its row' : 'show it full under its row')} onMouseDown={keepFocus} onClick={() => thread.toggleRow(item, i)}><Caret v open={unfolded} /> {unfolded ? 'fold' : 'show'}</button>
363
365
  ) : null}
364
- {playable?.audio ? <a className="rv-dl" href={rv.fileUrl(id, file)} download={`${id}-${file}`} title="download the sound">⤓</a> : null}
366
+ {playable?.audio ? <a className="rv-dl" href={rv.fileUrl(id, file)} download={`${id}-${file}`} {...tip('download the sound')}>⤓</a> : null}
365
367
  {choice && takes(ver) ? (
366
- <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={thread.busy} onClick={() => mark(ver, () => void thread.choose(i))}>
368
+ <button className={`rv-pick${picked ? ' on' : ''}`} {...tip(held ? 'your pick: click again to take it back, the version waits for you again' : 'pick this one: it is your answer', held ? null : 'P')} disabled={thread.busy} onClick={() => mark(ver, () => void thread.choose(i))}>
367
369
  {picked ? '✓ picked' : 'pick'}
368
370
  {held ? <span className="rv-undo" aria-label="click again to take it back"> ↺</span> : null}
369
371
  </button>
@@ -408,7 +410,7 @@ const Stars = observer(({ ver, view, tile, given }: { ver: Ver; view: number; ti
408
410
  const live = takes(ver)
409
411
  const n = given ?? 0
410
412
  return (
411
- <span className="rv-stars" title={live ? (tile === undefined ? `your score (⇧1 to ⇧${STARS} on the row playing)` : `your score (1 to ${STARS} with the pointer on the tile)`) : 'your score'}>
413
+ <span className="rv-stars" {...tip(live ? (tile === undefined ? `your score (⇧1 to ⇧${STARS} on the row playing)` : `your score (1 to ${STARS} with the pointer on the tile)`) : 'your score')}>
412
414
  {Array.from({ length: STARS }, (_, k) => (
413
415
  <button key={k} className={k < n ? 'on' : ''} disabled={!live} aria-label={`${k + 1} of ${STARS}`} onMouseDown={keepFocus} onClick={() => mark(ver, () => thread.setStars(view, k + 1, tile))}>{k < n ? '★' : '☆'}</button>
414
416
  ))}
@@ -467,9 +469,9 @@ const FrameSlider = observer(({ thread, frames }: { thread: ThreadSt; frames: Ga
467
469
  const go = (f: number): void => thread.setFrame(f >= last ? null : Math.max(0, f))
468
470
  return (
469
471
  <div className="rv-frames">
470
- <button title="the frame before" disabled={at === 0} onMouseDown={keepFocus} onClick={() => go(at - 1)}>‹</button>
472
+ <button {...tip('the frame before')} disabled={at === 0} onMouseDown={keepFocus} onClick={() => go(at - 1)}>‹</button>
471
473
  <input type="range" min={0} max={last} step={1} value={at} aria-label="the draft's frames" onChange={(e) => go(Number(e.currentTarget.value))} onMouseUp={(e) => e.currentTarget.blur()} />
472
- <button title="the frame after" disabled={at === last} onMouseDown={keepFocus} onClick={() => go(at + 1)}>›</button>
474
+ <button {...tip('the frame after')} disabled={at === last} onMouseDown={keepFocus} onClick={() => go(at + 1)}>›</button>
473
475
  <span className="rv-dim rv-small">{at === last ? 'now' : (frames.gallery[at]?.label ?? `frame ${at + 1}`)}</span>
474
476
  </div>
475
477
  )
@@ -481,11 +483,11 @@ const FrameSlider = observer(({ thread, frames }: { thread: ThreadSt; frames: Ga
481
483
  export const ReactionToggles = observer(({ ver, view, tile, post, small, keys, said, verdict = false }: { ver: Ver; view: number; tile?: number; post?: string; small?: boolean; keys?: boolean; said?: (status: ReviewStatus) => void; verdict?: boolean }) => {
482
484
  const { thread } = ver
483
485
  const cur = verdict ? thread.chosenOn(ver.cell.id) : ver.claim ? undefined : thread.reactionOf(view, tile, post)?.status
484
- const tip = (o: (typeof REACTIONS)[number]): string => (post !== undefined ? (PLACE_TIPS[o.status] ?? o.tip) : o.tip)
486
+ const says = (o: (typeof REACTIONS)[number]): string => (post !== undefined ? (PLACE_TIPS[o.status] ?? o.tip) : o.tip)
485
487
  return (
486
488
  <span className="rv-reacts">
487
489
  {REACTIONS.map((o) => (
488
- <button key={o.status} title={keys ? `${tip(o)} (${o.key})` : tip(o)} className={`rv-react re-${o.status}${small ? '' : ' big'}${cur === o.status ? ' on' : ''}${cur && cur !== o.status ? ' off' : ''}`}
490
+ <button key={o.status} {...tip(says(o), keys ? o.key : null)} className={`rv-react re-${o.status}${small ? '' : ' big'}${cur === o.status ? ' on' : ''}${cur && cur !== o.status ? ' off' : ''}`}
489
491
  onMouseDown={keepFocus} onClick={() => {
490
492
  mark(ver, () => (verdict ? void thread.submit(o.status) : thread.react(view, tile, o.status, post)))
491
493
  if (cur !== o.status) said?.(o.status)
@@ -550,17 +552,17 @@ const Thumb = observer(({ ver, view, t, k, big }: { ver: Ver; view: number; t: G
550
552
  const marked = o !== undefined || !!r?.stars || !!r?.picked || notes > 0
551
553
  return (
552
554
  <button type="button" className={`rv-gtile${r?.picked ? ' picked' : ''}${toneClass(r?.status)}`} data-check="gallery-tile" data-tile={k}
553
- title={`${t.label}: open it large to rate it and draw on it${live ? ' (1 to 5 score it here)' : ''}`}
555
+ {...tip(`${t.label}: open it large to rate it and draw on it${live ? ' (1 to 5 score it here)' : ''}`)}
554
556
  onMouseDown={keepFocus} onClick={() => thread.openBox(cell.id, view, k)}
555
557
  onMouseEnter={live ? () => thread.setHoverTile({ view, tile: k }) : undefined} onMouseLeave={live ? () => thread.setHoverTile(null) : undefined}>
556
558
  <span className="rv-gtileimg">
557
559
  <img src={src} alt="" loading="lazy" decoding="async" draggable={false} />
558
560
  {marked ? (
559
561
  <span className="rv-gmarks">
560
- {o ? <span className="rv-gmark tone" title={o.label}>{o.glyph}</span> : null}
561
- {r?.stars ? <span className="rv-gmark star" title={`${r.stars} of ${STARS}`}>★{r.stars}</span> : null}
562
- {r?.picked ? <span className="rv-gmark kept" title="kept for its row">✓ kept</span> : null}
563
- {notes > 0 ? <span className="rv-gmark note" title="your notes drawn on it, a draft">⬚ {notes}</span> : null}
562
+ {o ? <span className="rv-gmark tone" {...tip(o.label)}>{o.glyph}</span> : null}
563
+ {r?.stars ? <span className="rv-gmark star" {...tip(`${r.stars} of ${STARS}`)}>★{r.stars}</span> : null}
564
+ {r?.picked ? <span className="rv-gmark kept" {...tip('kept for its row')}>✓ kept</span> : null}
565
+ {notes > 0 ? <span className="rv-gmark note" {...tip('your notes drawn on it, a draft')}>⬚ {notes}</span> : null}
564
566
  </span>
565
567
  ) : null}
566
568
  </span>
@@ -582,7 +584,7 @@ const GalleryCount = observer(({ ver, v, view, shown }: { ver: Ver; v: GalleryVi
582
584
  <b>{v.gallery.length} images</b>
583
585
  <span className="rv-dim">{marked === 0 ? 'none marked yet' : `${marked} marked`}</span>
584
586
  {thread.tileFilter !== 'all' ? (
585
- <button className="rv-chip on" title="show every image" onMouseDown={keepFocus} onClick={() => thread.setTileFilter('all')}>
587
+ <button className="rv-chip on" {...tip('show every image')} onMouseDown={keepFocus} onClick={() => thread.setTileFilter('all')}>
586
588
  {TILE_FILTER_LABEL[thread.tileFilter]}: {shown} ✕
587
589
  </button>
588
590
  ) : null}
@@ -597,7 +599,7 @@ const GalleryMenu = observer(({ ver, v }: { ver: Ver; v: GalleryView }) => {
597
599
  <Pop className="ghost rv-iconbtn rv-gallerymenu" popClass="fpop rv-gallerypop" placement="bottom-end" aria-label="how the images show" title="how the images show: their size, the small sizes, the befores" label="⋯">
598
600
  {() => (
599
601
  <div className="rv-gallerypopbody">
600
- <label className="rv-tilesize" title="the size of every thumbnail of every gallery, kept for this repo">
602
+ <label className="rv-tilesize" {...tip('the size of every thumbnail of every gallery, kept for this repo')}>
601
603
  size
602
604
  <input type="range" min={TILE_H.min} max={TILE_H.max} step={10} value={rv.tileH} onChange={(e) => rv.setTileH(Number(e.target.value))} />
603
605
  </label>
@@ -613,8 +615,8 @@ const GalleryLook = observer(({ ver, v }: { ver: Ver; v: GalleryView }) => {
613
615
  const { rv, thread } = ver
614
616
  return (
615
617
  <span className="rv-gallerylook">
616
- {v.gallery.some((t) => t.before) ? <button className={`rv-chip${thread.beforeAll ? ' on' : ''}`} title="every image shows its before" onMouseDown={keepFocus} onClick={() => thread.toggleBeforeAll()}>before</button> : null}
617
- <button className={`rv-chip${rv.tileSmall ? ' on' : ''}`} title="each image also at 16, 32 and 64 px" onMouseDown={keepFocus} onClick={() => rv.toggleTileSmall()}>real size</button>
618
+ {v.gallery.some((t) => t.before) ? <button className={`rv-chip${thread.beforeAll ? ' on' : ''}`} {...tip('every image shows its before')} onMouseDown={keepFocus} onClick={() => thread.toggleBeforeAll()}>before</button> : null}
619
+ <button className={`rv-chip${rv.tileSmall ? ' on' : ''}`} {...tip('each image also at 16, 32 and 64 px')} onMouseDown={keepFocus} onClick={() => rv.toggleTileSmall()}>real size</button>
618
620
  </span>
619
621
  )
620
622
  })
@@ -644,41 +646,36 @@ const SMALL_SIZES = [16, 32, 64] as const
644
646
  /** an image at the small sizes an icon lives at, on a checkerboard */
645
647
  const SmallSizes = ({ src }: { src: string }) => (
646
648
  <span className="rv-tilesmall">
647
- {SMALL_SIZES.map((px) => <img key={px} src={src} alt="" width={px} height={px} title={`${px} px`} draggable={false} loading="lazy" />)}
649
+ {SMALL_SIZES.map((px) => <img key={px} src={src} alt="" width={px} height={px} {...tip(`${px} px`)} draggable={false} loading="lazy" />)}
648
650
  </span>
649
651
  )
650
652
 
651
653
  /** what sits under a gallery image in the lightbox: its stars and keep, and the small sizes when shown */
652
654
  const tileUnder = (rv: ReviewSt): number => 44 + (rv.tileSmall ? 84 : 0)
653
655
 
654
- /** a gallery image large in the lightbox, at the lightbox's size (whole, as wide as the box, or a share of its own
655
- * pixels): its image (its before while flipped or peeked), a drag circles a spot; under it the small sizes, its
656
- * stars, keep on a row of variants. OK, Fix, No are the lightbox bar's */
656
+ /** a gallery image large in the lightbox, whole in the stage's room (--fit-h, review.css, less what sits under it)
657
+ * until the lightbox's view sizes it (box-view.ts): its image (its before while flipped or peeked), a drag circles a
658
+ * spot; under it the small sizes, its stars, keep on a row of variants. OK, Fix, No are the lightbox bar's */
657
659
  const BoxTile = observer(({ ver, v, view, t, k }: { ver: Ver; v: GalleryView; view: number; t: GalleryTile; k: number }) => {
658
660
  const { rv, thread, cell } = ver
659
661
  const id = itemOf(ver).id
660
662
  const r = thread.reactionShown(cell, view, k)
661
663
  const live = takes(ver)
662
664
  const file = t.before && thread.showsBefore(view, k) ? t.before : t.file
663
- const aspect = `${t.size.w} / ${t.size.h}`
664
- const z = rv.boxZoom
665
- const scale = typeof z === 'number' ? z : null
666
- const wide = z === 'width'
667
- const under = tileUnder(rv)
668
- // « fit »: the lightbox's stage (--fit-h, review.css) less what sits under the image
669
- const style = scale ? { width: `${t.size.w * scale}px`, aspectRatio: aspect } : wide ? { width: '100%', aspectRatio: aspect } : { width: `min(100%, calc((var(--fit-h, 100vh - ${FIT_ROOM}px) - ${under}px) * ${t.size.w / t.size.h}))`, aspectRatio: aspect }
670
- const scroll = scale || wide ? { overflow: 'auto', maxHeight: `calc(var(--fit-h) - ${under}px)` } : undefined
665
+ const zoom = useBoxView()
666
+ const room = `(var(--fit-h, 100vh - ${FIT_ROOM}px) - ${tileUnder(rv)}px)`
667
+ const style = { width: `min(100%, calc(${room} * ${t.size.w / t.size.h}))`, aspectRatio: `${t.size.w} / ${t.size.h}`, '--port-h': `calc(${room})` } as CSSProperties
671
668
  // past « fit » the full file, so its own pixels show
672
- const src = scale || wide ? rv.fileUrl(id, file) : rv.fitUrl(id, file)
669
+ const src = zoom?.full ? rv.fileUrl(id, file) : rv.fitUrl(id, file)
673
670
  return (
674
671
  <div className={`rv-tile big${r?.picked ? ' picked' : ''}${toneClass(r?.status)}`}
675
672
  onMouseEnter={live ? () => thread.setHoverTile({ view, tile: k }) : undefined} onMouseLeave={live ? () => thread.setHoverTile(null) : undefined}>
676
- <div className="rv-tilestage" style={scroll}>
677
- <div className="rv-tileimg rv-zoomface" data-cols={1} title={live ? 'drag to circle a spot' : undefined} style={style}>
673
+ <div className="rv-tilestage">
674
+ <div className="rv-tileimg rv-zoomface rv-zoomport" data-cols={1} {...tip(live ? 'drag to circle a spot' : undefined)} style={style}>
678
675
  <Marks ver={ver} src={src} side={undefined} view={view} tile={k} />
679
676
  {ver.live ? <div className="rv-over"><RectNote ver={ver} view={view} sides={[undefined]} tile={k} /></div> : null}
680
677
  {t.before ? (
681
- <span className={`rv-beforechip${file === t.before ? ' on' : ''}`} title="the pointer here shows the before" onClick={(e) => e.stopPropagation()}
678
+ <span className={`rv-beforechip${file === t.before ? ' on' : ''}`} {...tip('the pointer here shows the before')} onClick={(e) => e.stopPropagation()}
682
679
  onMouseEnter={() => thread.setPeekTile(view, k)} onMouseLeave={() => thread.setPeekTile(view, null)}>before</span>
683
680
  ) : null}
684
681
  </div>
@@ -687,7 +684,7 @@ const BoxTile = observer(({ ver, v, view, t, k }: { ver: Ver; v: GalleryView; vi
687
684
  <div className="rv-tileunder">
688
685
  {live || r?.stars ? <Stars ver={ver} view={view} tile={k} given={r?.stars} /> : null}
689
686
  {t.group && (live || r?.picked) ? (
690
- <button className={`rv-chip rv-keep${r?.picked ? ' on' : ''}`} disabled={!live} title={`keep this one for ${t.group}: one a row`} onMouseDown={keepFocus}
687
+ <button className={`rv-chip rv-keep${r?.picked ? ' on' : ''}`} disabled={!live} {...tip(`keep this one for ${t.group}: one a row`)} onMouseDown={keepFocus}
691
688
  onClick={() => mark(ver, () => thread.pickTile(view, k, t.group ?? '', v.gallery))}>{r?.picked ? '✓ kept' : `keep for ${t.group}`}</button>
692
689
  ) : null}
693
690
  </div>
@@ -695,11 +692,12 @@ const BoxTile = observer(({ ver, v, view, t, k }: { ver: Ver; v: GalleryView; vi
695
692
  )
696
693
  })
697
694
 
698
- /** one media view: a single image or clip, or the pair in the compare component; fitted to the column on its own, as
699
- * wide as the column, or zoomed (the full file), the last two with their own scroll. `.rv-zoomface` is the element a
700
- * size is measured on: its width holds `data-cols` images side by side */
701
- const MediaBody = observer(({ ver, v, i, zoom, boxed = false }: { ver: Ver; v: MediaView; i: number; zoom: Zoom | BoxZoom; boxed?: boolean }) => {
695
+ /** one media view: a single image or clip, or the pair in the compare component, fitted to the column, or in the
696
+ * lightbox (`boxed`) to the stage's room. `.rv-zoomface` holds `data-cols` images side by side and the room a frame
697
+ * takes (--port-h) once the lightbox's view shows the picture larger (box-view.ts, lightbox-zoom.css) */
698
+ const MediaBody = observer(({ ver, v, i, zoom, boxed = false }: { ver: Ver; v: MediaView; i: number; zoom: Zoom; boxed?: boolean }) => {
702
699
  const { rv, thread } = ver
700
+ const view = useBoxView()
703
701
  const item = itemOf(ver)
704
702
  const id = item.id
705
703
  if (v.audio) return <SoundBody ver={ver} v={v} saves={!boxed} />
@@ -709,8 +707,6 @@ const MediaBody = observer(({ ver, v, i, zoom, boxed = false }: { ver: Ver; v: M
709
707
  const f = v.files
710
708
  const ratio = v.size.w / v.size.h
711
709
  const aspect = `${v.size.w} / ${v.size.h}`
712
- const wide = zoom === 'width'
713
- const scale = zoom === 'fit' || zoom === 'preview' || wide ? null : Number(zoom)
714
710
  const room = FIT_ROOM + (v.clip ? 40 : 0)
715
711
  const c = rv.compare
716
712
  const mode = c.modeFor(v.clip !== undefined)
@@ -718,23 +714,21 @@ const MediaBody = observer(({ ver, v, i, zoom, boxed = false }: { ver: Ver; v: M
718
714
  const under = (isPair(v.files) && !rv.phone.on ? 26 : 0) + (v.clip ? 44 : 0) + (isPair(v.files) && mode === 'swipe' ? 22 : 0)
719
715
  // the height a view fits in: a preview's, the lightbox's, or the column's
720
716
  const fitH = zoom === 'preview' ? 'var(--preview-h)' : boxed ? `(var(--fit-h) - ${under}px)` : `(100vh - ${room}px)`
717
+ const port = { '--port-h': `calc(${fitH})` }
721
718
  // a clip always plays its fit url (its play copy keeps its size and frames), an image is the full file past « fit »
722
- const src = (name: string): string => ((scale || wide) && !v.clip ? rv.fileUrl(id, name, item.wip) : rv.fitUrl(id, name, item.wip))
719
+ const src = (name: string): string => (view?.full && !v.clip ? rv.fileUrl(id, name, item.wip) : rv.fitUrl(id, name, item.wip))
723
720
  // the page's clip keys reach the version his answer goes to: space when it is no pair, ← → when it has one view
724
721
  const page = boxed && ver.cell.id === thread.target
725
722
  const keys = boxed ? { play: page && !isPair(f), frames: page && item.views.length === 1 } : undefined
726
723
  const bar = v.clip ? <ClipBar clip={thread.clipOf(id, i)} info={v.clip} use={() => ver.live && thread.setView(i)} keys={keys} /> : null
727
- const scroll = scale || wide ? { overflow: 'auto', maxHeight: boxed ? `calc(var(--fit-h) - ${under}px)` : `calc(100vh - ${room}px)` } : undefined
728
724
  if (!isPair(f)) {
729
725
  const name = 'image' in f ? f.image : 'video' in f ? f.video : f.audio
730
726
  return (
731
- <div style={scroll}>
732
- <div className="rv-zoomface" data-cols={1} style={{ width: scale ? `${v.size.w * scale}px` : wide ? '100%' : `min(100%, calc(${fitH} * ${ratio}))`, margin: '0 auto' }}>
733
- <Compare c={rv.compare} base={src(name)} mod={undefined} aspect={aspect} draw={(s) => <Marks ver={ver} src={s} side={undefined} view={i} />}
734
- over={() => (ver.live ? <RectNote ver={ver} view={i} sides={[undefined]} /> : null)} />
735
- {bar}
736
- {boxed ? null : <Downloads rv={rv} item={item} files={[{ file: name }]} />}
737
- </div>
727
+ <div className="rv-zoomface" data-cols={1} style={{ width: zoom === 'preview' ? fillWidth(v.size) : `min(100%, calc(${fitH} * ${ratio}))`, margin: '0 auto', ...port } as CSSProperties}>
728
+ <Compare c={rv.compare} base={src(name)} mod={undefined} aspect={aspect} draw={(s) => <Marks ver={ver} src={s} side={undefined} view={i} />}
729
+ over={() => (ver.live ? <RectNote ver={ver} view={i} sides={[undefined]} /> : null)} />
730
+ {bar}
731
+ {boxed ? null : <Downloads rv={rv} item={item} files={[{ file: name }]} />}
738
732
  </div>
739
733
  )
740
734
  }
@@ -744,24 +738,22 @@ const MediaBody = observer(({ ver, v, i, zoom, boxed = false }: { ver: Ver; v: M
744
738
  if (rv.phone.on)
745
739
  return (
746
740
  <>
747
- <PhonePair ver={ver} view={i} bar={bar} before={before} after={after} aspect={aspect} size={v.size} scale={scale} fitH={boxed ? fitH : null} />
741
+ <PhonePair ver={ver} view={i} bar={bar} before={before} after={after} aspect={aspect} size={v.size} fitH={boxed ? fitH : null} />
748
742
  {saves}
749
743
  </>
750
744
  )
751
745
  const cols = mode === 'side' ? 2 : 1
752
- const fitW = wide ? '100%' : `min(100%, calc(${fitH} * ${ratio * cols}))`
746
+ const fitW = `min(100%, calc(${fitH} * ${ratio * cols}))`
753
747
  return (
754
748
  <>
755
- <div style={scroll}>
756
- <div className="rv-pairgrid rv-zoomface" data-cols={cols} style={{ width: scale ? `${v.size.w * scale * cols + 8 * (cols - 1)}px` : fitW, gridTemplateColumns: `repeat(${cols}, 1fr)` }}>
757
- <Compare c={c} mode={mode} base={before} mod={after} names={PAIR_NAMES} aspect={aspect}
758
- draw={(s, face) => <Marks ver={ver} src={s} side={drawnSide(mode, s === before ? 'before' : 'after')} view={i} face={face} />}
759
- over={(srcs) => (ver.live ? <RectNote ver={ver} view={i} sides={srcs.map((s) => drawnSide(mode, s === before ? 'before' : 'after'))} /> : null)} />
760
- </div>
749
+ <div className="rv-pairgrid rv-zoomface" data-cols={cols} style={{ width: fitW, gridTemplateColumns: `repeat(${cols}, 1fr)`, ...port } as CSSProperties}>
750
+ <Compare c={c} mode={mode} base={before} mod={after} names={PAIR_NAMES} aspect={aspect}
751
+ draw={(s, face) => <Marks ver={ver} src={s} side={drawnSide(mode, s === before ? 'before' : 'after')} view={i} face={face} />}
752
+ over={(srcs) => (ver.live ? <RectNote ver={ver} view={i} sides={srcs.map((s) => drawnSide(mode, s === before ? 'before' : 'after'))} /> : null)} />
761
753
  </div>
762
754
  {bar ? <div style={{ width: fitW, margin: '0 auto' }}>{bar}</div> : null}
763
755
  {saves ? <div style={{ width: fitW, margin: '0 auto' }}>{saves}</div> : null}
764
- {mode === 'swipe' ? <div className="rv-dim rv-center">curtain: a drag moves the line; rectangles are drawn in the other modes</div> : null}
756
+ {mode === 'swipe' ? <div className="rv-dim rv-center">curtain: a drag moves the line{view?.on ? ' (hold the line itself: a drag elsewhere moves the picture)' : ''}; rectangles are drawn in the other modes</div> : null}
765
757
  </>
766
758
  )
767
759
  })
@@ -772,44 +764,12 @@ const PreviewOf = observer(({ ver, v, i }: { ver: Ver; v: MediaView; i: number }
772
764
  const { rv } = ver
773
765
  const item = itemOf(ver)
774
766
  return (
775
- <button type="button" className="rv-viewpreview" data-check="view-still" title="open it whole: judge it, draw on it, save it" onMouseDown={keepFocus} onClick={() => ver.thread.openBox(ver.cell.id, i)}>
776
- <img src={rv.fitUrl(item.id, thumbFileOf(v), item.wip)} alt="" loading="lazy" decoding="async" style={{ aspectRatio: `${v.size.w} / ${v.size.h}`, width: `min(100%, calc(var(--preview-h) * ${v.size.w / v.size.h}))` }} />
767
+ <button type="button" className="rv-viewpreview" data-check="view-still" {...tip('open it whole: judge it, draw on it, save it')} onMouseDown={keepFocus} onClick={() => ver.thread.openBox(ver.cell.id, i)}>
768
+ <img src={rv.fitUrl(item.id, thumbFileOf(v), item.wip)} alt="" loading="lazy" decoding="async" style={{ aspectRatio: `${v.size.w} / ${v.size.h}`, width: fillWidth(v.size) }} />
777
769
  </button>
778
770
  )
779
771
  })
780
772
 
781
- /** the share of its own pixels a view is drawn at now, read off the page: what « fit » and « width » come to */
782
- function shownScale(box: HTMLElement | null, size: { w: number } | null): number | null {
783
- const face = box?.querySelector<HTMLElement>('.rv-zoomface')
784
- if (face == null || size === null || !(size.w > 0)) return null
785
- const cols = Number(face.dataset['cols'] ?? 1) || 1
786
- const w = (face.getBoundingClientRect().width - 8 * (cols - 1)) / cols
787
- return w > 0 ? w / size.w : null
788
- }
789
-
790
- const BOX_LABEL = { fit: 'Fit', width: 'Width' } as const
791
- const BOX_TIP = { fit: 'the whole view in the window (0)', width: 'as wide as the window, it scrolls' } as const
792
-
793
- /** the size of the view in the lightbox: whole, wide, its own pixels; a size the wheel or the keys gave shows as its
794
- * percent; − and + step it. Kept for the repo */
795
- const BoxZoomBar = observer(({ rv, step }: { rv: ReviewSt; step: (by: 1 | -1) => void }) => {
796
- const z = rv.boxZoom
797
- const free = typeof z === 'number' && !(BOX_ZOOM.picks as readonly number[]).includes(z)
798
- return (
799
- <span className="rv-boxzoom rv-keyed" title="the size of the view: ⌘ or ctrl with the wheel, a pinch, or + and −">
800
- <span className="seg">
801
- {(['fit', 'width'] as const).map((k) => (
802
- <button key={k} className={z === k ? 'on' : ''} title={BOX_TIP[k]} onMouseDown={keepFocus} onClick={() => rv.setBoxZoom(k)}>{BOX_LABEL[k]}{k === 'fit' ? <Key k="0" /> : null}</button>
803
- ))}
804
- {BOX_ZOOM.picks.map((n) => <button key={n} className={z === n ? 'on' : ''} title={`${n * 100} % of its own pixels`} onMouseDown={keepFocus} onClick={() => rv.setBoxZoom(n)}>{n * 100} %</button>)}
805
- {free ? <button className="on" title="the size the wheel or the keys gave" onMouseDown={keepFocus}>{Math.round(z * 100)} %</button> : null}
806
- </span>
807
- <button className="ghost rv-keybtn" title="smaller (−)" aria-label="smaller" onMouseDown={keepFocus} onClick={() => step(-1)}><Key k="−" /><span className="rv-nokey">−</span></button>
808
- <button className="ghost rv-keybtn" title="larger (+)" aria-label="larger" onMouseDown={keepFocus} onClick={() => step(1)}><Key k="+" /><span className="rv-nokey">+</span></button>
809
- </span>
810
- )
811
- })
812
-
813
773
  /** what the lightbox shows: the version and its view, and what that view takes (the steps, a pair's flip and compare
814
774
  * modes, a size); null while it is shut */
815
775
  function boxOf(rv: ReviewSt, thread: ThreadSt) {
@@ -832,28 +792,36 @@ function boxOf(rv: ReviewSt, thread: ThreadSt) {
832
792
  // a view that is a gallery opens on its first image
833
793
  const view = (to: number): void => thread.openBox(cell.id, to, isGallery(cell.item.views[to]!) ? 0 : undefined)
834
794
  const step = (by: number): void => (tile ? thread.openBox(cell.id, b.view, order[(order.indexOf(tile.k) + by + order.length) % order.length]) : view((b.view + by + views) % views))
835
- return { at: b.view, cell, v, media, views, ver, can, step, tile, size }
795
+ // the whole picture, small: the map of a view larger than its room
796
+ const whole = size === null ? null : rv.fitUrl(cell.id, tile ? tile.t.file : media !== null ? thumbFileOf(media) : '', cell.item.wip)
797
+ return { at: b.view, cell, v, media, views, ver, can, step, tile, size, whole }
836
798
  }
837
799
 
838
- /** a step of the lightbox's size from the size the view is drawn at now */
839
- const resizeOf = (rv: ReviewSt, stage: { current: HTMLElement | null }, size: { w: number } | null) => (by: 1 | -1): void => rv.setBoxZoom(boxStep(shownScale(stage.current, size) ?? 1, by))
840
-
841
800
  /** a key in the lightbox, true when it acted. Each acts only where its control shows: ← → the views, space a pair's
842
801
  * before or after, V F R (or 1 2 3) OK Fix No on the view, 0 + − the size, Escape closes; V F R never reach the
843
- * version's verdict from here. The page keeps the rest (D the compare mode, a clip's space, its ← → on a version of one
844
- * view, A archives the thread). A text field (`field`) keeps every key but Escape */
845
- export function boxKey(rv: ReviewSt, thread: ThreadSt, stage: { current: HTMLElement | null }, e: Pick<KeyboardEvent, 'key' | 'metaKey' | 'ctrlKey' | 'altKey'>, field: boolean): boolean {
802
+ * version's verdict from here; ↑ ↓ stay here, the lightbox's own: they move a picture larger than its room, and so do
803
+ * ← → where they step nothing (one view, no clip). The page keeps the
804
+ * rest (D the compare mode, a clip's space, its ← → on a version of one view, A archives the thread). A text field
805
+ * (`field`) keeps every key but Escape */
806
+ export function boxKey(rv: ReviewSt, thread: ThreadSt, view: BoxView, e: Pick<KeyboardEvent, 'key' | 'metaKey' | 'ctrlKey' | 'altKey'>, field: boolean): boolean {
807
+ // ↑ ↓ are the lightbox's and never reach the page behind it. They are the view's
808
+ // (a 3D view goes forward and back, view3d/viewer.ts hears them itself)
809
+ const upDown = !e.metaKey && !e.ctrlKey && !e.altKey && !field && (e.key === 'ArrowUp' || e.key === 'ArrowDown')
846
810
  // a kind's page takes every key but Escape: its own camera, its own walk
847
- if (thread.boxed != null && 'states' in thread.boxed) return e.key === 'Escape' ? (thread.closeBox(), true) : false
811
+ if (thread.boxed != null && 'states' in thread.boxed) return e.key === 'Escape' ? (thread.closeBox(), true) : upDown
848
812
  const x = boxOf(rv, thread)
849
813
  if (x == null || e.metaKey || e.ctrlKey || e.altKey || (field && e.key !== 'Escape')) return false
850
814
  const { at, ver, can, step, tile } = x
851
815
  const said = boxReaction(e.key)
852
816
  if (e.key === 'Escape') thread.closeBox()
853
817
  else if (can.step && (e.key === 'ArrowLeft' || e.key === 'ArrowRight')) step(e.key === 'ArrowLeft' ? -1 : 1)
818
+ else if (upDown) view.nudge(0, e.key === 'ArrowUp' ? -1 : 1)
819
+ else if (view.on && !x.media?.clip && (e.key === 'ArrowLeft' || e.key === 'ArrowRight')) view.nudge(e.key === 'ArrowLeft' ? -1 : 1, 0)
854
820
  else if (can.pair && e.key === ' ') rv.compare.flip()
855
- else if (can.size && e.key === '0') rv.setBoxZoom('fit')
856
- else if (can.size && (e.key === '+' || e.key === '=' || e.key === '-')) resizeOf(rv, stage, x.size)(e.key === '-' ? -1 : 1)
821
+ else if (can.size && e.key === '0') {
822
+ rv.setBoxZoom('fit')
823
+ view.preset('fit')
824
+ } else if (can.size && (e.key === '+' || e.key === '=' || e.key === '-')) view.step(e.key === '-' ? -1 : 1)
857
825
  else if (said != null) {
858
826
  // a version of one view: O, F, N are the version's verdict
859
827
  if (takes(ver)) mark(ver, () => (tile === undefined && oneSet(ver) ? void thread.submit(said) : thread.react(at, tile?.k, said)))
@@ -861,47 +829,39 @@ export function boxKey(rv: ReviewSt, thread: ThreadSt, stage: { current: HTMLEle
861
829
  return true
862
830
  }
863
831
 
864
- /** the lightbox over the whole window (BoxFrame draws it), its wheel and its keys */
832
+ /** the lightbox over the whole window (BoxFrame draws it), its view of the picture (box-view.ts: the size, the place,
833
+ * the gestures on the stage) and its keys. Each view opens whole, then at the size the bar keeps */
865
834
  export const ViewBox = observer(({ rv, thread }: { rv: ReviewSt; thread: ThreadSt }) => {
866
835
  const stage = useRef<HTMLDivElement>(null)
836
+ const [view] = useState(() => new BoxView())
867
837
  const x = boxOf(rv, thread)
868
- const v = x?.v
869
- const size = x?.size ?? null
870
- // ⌘ or ctrl with the wheel (a pinch on a trackpad arrives as one) sizes the view around the pointer; the plain
871
- // wheel scrolls. Not passive: the browser would zoom the whole page
872
- useEffect(() => {
838
+ // a phone sizes with the browser's own pinch
839
+ const size = rv.phone.on ? null : (x?.size ?? null)
840
+ const shows = x == null ? null : `${x.cell.id}#${x.at}/${x.tile?.k ?? ''}`
841
+ const w = size?.w
842
+ const h = size?.h
843
+ useLayoutEffect(() => {
873
844
  const el = stage.current
874
- if (el == null || v === undefined) return
875
- const wheel = (e: WheelEvent): void => {
876
- if (!e.ctrlKey && !e.metaKey) return
877
- const face = el.querySelector<HTMLElement>('.rv-zoomface')
878
- const from = shownScale(el, size)
879
- if (face == null || from == null) return
880
- e.preventDefault()
881
- const was = face.getBoundingClientRect()
882
- const fx = (e.clientX - was.left) / was.width
883
- const fy = (e.clientY - was.top) / was.height
884
- rv.setBoxZoom(boxStep(from, -e.deltaY / 100))
885
- // once it is drawn at its new size, the point that was under the pointer is put back under it
886
- requestAnimationFrame(() => {
887
- const now = el.querySelector<HTMLElement>('.rv-zoomface')
888
- const scroller = now?.parentElement
889
- if (now == null || scroller == null) return
890
- const is = now.getBoundingClientRect()
891
- scroller.scrollLeft += is.left + fx * is.width - e.clientX
892
- scroller.scrollTop += is.top + fy * is.height - e.clientY
893
- })
845
+ if (el == null || shows === null) return
846
+ const off = view.attach(el)
847
+ // the note box beside a rectangle is placed again when its frame scrolls: a move of the view says so
848
+ view.onMoved = () => {
849
+ if (thread.rect !== null) el.dispatchEvent(new Event('scroll'))
894
850
  }
895
- el.addEventListener('wheel', wheel, { passive: false })
896
- return () => el.removeEventListener('wheel', wheel)
897
- }, [v, size, rv])
851
+ view.open(w === undefined || h === undefined ? null : { w, h }, rv.boxZoom)
852
+ return () => {
853
+ off()
854
+ view.onMoved = null
855
+ view.open(null, 'fit')
856
+ }
857
+ }, [shows, w, h, view, rv, thread])
898
858
  // its keys come before the page's (capture): boxKey
899
859
  const open = thread.boxed != null
900
860
  useEffect(() => {
901
861
  if (!open) return
902
862
  const key = (e: KeyboardEvent): void => {
903
863
  const field = (e.target as HTMLElement | null)?.closest?.('input, textarea, select, [contenteditable]') != null
904
- if (!boxKey(rv, thread, stage, e, field)) return
864
+ if (!boxKey(rv, thread, view, e, field)) return
905
865
  e.preventDefault()
906
866
  e.stopPropagation()
907
867
  }
@@ -911,15 +871,16 @@ export const ViewBox = observer(({ rv, thread }: { rv: ReviewSt; thread: ThreadS
911
871
  const b = thread.boxed
912
872
  if (b != null && 'states' in b) return createPortal(<KindBox rv={rv} thread={thread} cell={b.cell} />, document.body)
913
873
  if (x == null) return null
914
- return createPortal(<BoxFrame rv={rv} thread={thread} stage={stage} />, document.body)
874
+ return createPortal(<BoxViewCtx.Provider value={rv.phone.on ? null : view}><BoxFrame rv={rv} thread={thread} stage={stage} view={view} /></BoxViewCtx.Provider>, document.body)
915
875
  })
916
876
 
917
877
  /** the lightbox: the view a preview opened, over the whole window. One bar on top reads as what he does, left to
918
878
  * right: where he is (← → the version's views, the view's name, its tag, the thread), what he says of it (OK Fix No),
919
- * how he looks at it (the compare modes, one side alone, the size, a gallery's filter and look), ✕. The view takes the room
920
- * between, « fit » fitting that room (--fit-h, review.css). One bar under it: his word on the view and its files.
921
- * Every key is a chip on the control it triggers, shown only where the key acts */
922
- export const BoxFrame = observer(({ rv, thread, stage }: { rv: ReviewSt; thread: ThreadSt; stage: React.RefObject<HTMLDivElement | null> }) => {
879
+ * how he looks at it (the compare modes, one side alone, the size and what a drag does, a gallery's filter and look), ✕.
880
+ * The view takes the room between, « fit » fitting that room (--fit-h, review.css); larger, its map sits in a corner.
881
+ * One bar under it: his word on the view and its files. Every key is a chip on the control it triggers, shown only
882
+ * where the key acts */
883
+ export const BoxFrame = observer(({ rv, thread, stage, view }: { rv: ReviewSt; thread: ThreadSt; stage: React.RefObject<HTMLDivElement | null>; view: BoxView }) => {
923
884
  const x = boxOf(rv, thread)
924
885
  if (x == null) return null
925
886
  const { at, cell, v, media, views, ver, can, step, tile } = x
@@ -929,37 +890,40 @@ export const BoxFrame = observer(({ rv, thread, stage }: { rv: ReviewSt; thread:
929
890
  const files = filesOf(v)
930
891
  const said = thread.saidOn(cell.id, at)
931
892
  const tag = viewTag(cell.n, at)
893
+ // a drag draws a note's rectangle on a view that takes his notes, never under the curtain, whose drag is the line's
894
+ const draws = takes(ver) && !(can.pair && rv.compare.modeFor(media?.clip !== undefined) === 'swipe')
932
895
  return (
933
896
  <Lightbox
934
897
  tone={toneClass(shown?.status)}
935
898
  label={`view ${tag}: ${name}`}
936
899
  close={() => thread.closeBox()}
937
900
  stage={stage}
901
+ over={x.size !== null && x.whole !== null && !rv.phone.on ? <ZoomMap view={view} src={x.whole} size={x.size} /> : null}
938
902
  top={<>
939
903
  <span className="rv-boxwhere">
940
- {can.step ? <button className="ghost rv-keybtn" data-check="lightbox-prev" 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}
904
+ {can.step ? <button className="ghost rv-keybtn" data-check="lightbox-prev" {...tip(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}
941
905
  <span className="rv-boxn rv-dim">{tile ? tile.order.indexOf(tile.k) + 1 : at + 1} of {tile ? tile.order.length : views}{tile && thread.tileFilter !== 'all' ? ` · ${TILE_FILTER_LABEL[thread.tileFilter]}` : ''}</span>
942
- {can.step ? <button className="ghost rv-keybtn" data-check="lightbox-next" 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}
943
- <b className="rv-boxname" title={name}>{name}</b>
906
+ {can.step ? <button className="ghost rv-keybtn" data-check="lightbox-next" {...tip(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}
907
+ <b className="rv-boxname" {...tip(name)}>{name}</b>
944
908
  {tile ? (v.label ? <span className="rv-boxkind rv-dim">{v.label}</span> : null) : v.label && v.label.toLowerCase() !== kind.toLowerCase() ? <span className="rv-boxkind rv-dim">{kind}</span> : null}
945
- <span className="rv-boxtag" title={`view ${tag}`}>{tag}</span>
946
- <span className="rv-boxtitle rv-dim" title={cell.item.title}>{cell.item.title}</span>
909
+ <span className="rv-boxtag" {...tip(`view ${tag}`)}>{tag}</span>
910
+ <span className="rv-boxtitle rv-dim" {...tip(cell.item.title)}>{cell.item.title}</span>
947
911
  </span>
948
912
  {/* a version of one view: its keys and buttons here are the version's own verdict */}
949
913
  {takes(ver) ? <ReactionToggles ver={ver} view={at} {...(tile ? { tile: tile.k } : {})} keys verdict={!tile && oneSet(ver)} /> : shown?.status ? <SentReaction status={shown.status} /> : null}
950
914
  <span className="rv-boxlook">
951
- {rv.phone.on && takes(ver) && (tile !== null || (media !== null && !media.clip && !media.audio && !media.scene)) ? <button className={rv.phone.draw ? 'primary' : ''} title="a drag circles a spot instead of scrolling" onClick={() => rv.phone.toggleDraw()}>Circle</button> : null}
915
+ {rv.phone.on && takes(ver) && (tile !== null || (media !== null && !media.clip && !media.audio && !media.scene)) ? <button className={rv.phone.draw ? 'primary' : ''} {...tip('a drag circles a spot instead of scrolling')} onClick={() => rv.phone.toggleDraw()}>Circle</button> : null}
952
916
  {can.pair && rv.phone.on ? <PhoneSides rv={rv} /> : null}
953
917
  {can.pair && !rv.phone.on ? <CompareModes c={rv.compare} clip={media?.clip !== undefined} keys /> : null}
954
918
  {can.pair && !rv.phone.on ? <PairFlip c={rv.compare} /> : null}
955
- {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}
919
+ {media?.marks && media.marks.length > 0 ? <button className={rv.marksOn ? 'primary' : ''} {...tip("the repo's own rings on the shot", 'M')} onMouseDown={keepFocus} onClick={() => rv.toggleMarks()}>marks<Key k="M" /></button> : null}
956
920
  {/* a phone sizes with a pinch: the size control is the keyboard's and the wheel's */}
957
- {can.size && !rv.phone.on ? <BoxZoomBar rv={rv} step={resizeOf(rv, stage, x.size)} /> : null}
921
+ {can.size && !rv.phone.on ? <BoxZoomBar view={view} pick={(k) => rv.setBoxZoom(k)} draws={draws} /> : null}
958
922
  {isGallery(v) && tile?.t.view === undefined ? <GalleryTools ver={ver} v={v} /> : null}
959
923
  </span>
960
924
  </>}
961
925
  foot={<>
962
- {media?.note ? <span className="rv-boxnote rv-dim" title={media.note}>{media.note}</span> : null}
926
+ {media?.note ? <span className="rv-boxnote rv-dim" {...tip(media.note)}>{media.note}</span> : null}
963
927
  {said.length > 0 ? <div className="rv-boxsaid">{said.map((s, k) => <SaidLine key={k} s={s} v={v} n={cell.n} />)}</div> : null}
964
928
  {/* the owner's words on a fix go in the thread's reply box, under the lightbox: one click there */}
965
929
  {takes(ver) && thread.replyOn !== null && thread.replyOn.to !== 'action' ? (
@@ -1016,20 +980,20 @@ const filesOf = (v: ReviewView): { file: string; label?: string }[] => {
1016
980
  const Downloads = observer(({ rv, item, files }: { rv: ReviewSt; item: Item; files: readonly { file: string; label?: string }[] }) => (
1017
981
  <div className="rv-downloads">
1018
982
  {files.map(({ file, label }) => (
1019
- <a key={file} className="rv-dl" href={rv.fileUrl(item.id, file, item.wip)} download={`${item.id}-${file}`} title={`download ${file} at full size`}>⤓ save {label ?? (file.split('.').pop() ?? 'file')}</a>
983
+ <a key={file} className="rv-dl" href={rv.fileUrl(item.id, file, item.wip)} download={`${item.id}-${file}`} {...tip(`download ${file} at full size`)}>⤓ save {label ?? (file.split('.').pop() ?? 'file')}</a>
1020
984
  ))}
1021
985
  {rv.can('publish') && files.map(({ file, label }) => {
1022
986
  const s = rv.shared.get(`${item.id}/${file}`)
1023
987
  return (
1024
988
  <button key={`share-${file}`} className="rv-dl ghost" disabled={s === 'sending'} onClick={() => void rv.share(item.id, file)}
1025
- title={s && s !== 'sending' ? `copy again: ${s}` : `publish ${file} in the Space and copy its link: a permanent public url, anyone who has it downloads the file`}>
989
+ {...tip(s && s !== 'sending' ? `copy again: ${s}` : `publish ${file} in the Space and copy its link: a permanent public url, anyone who has it downloads the file`)}>
1026
990
  {s === 'sending' ? 'uploading…' : `🔗 ${label ? `link ${label}` : 'copy link'}`}
1027
991
  </button>
1028
992
  )
1029
993
  })}
1030
994
  {/* the Finder is on the desktop only: a phone has none */}
1031
995
  {rv.phone.on || files[0] === undefined || !rv.can('reveal') ? null : (
1032
- <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>
996
+ <button className="rv-dl ghost" {...tip(`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>
1033
997
  )}
1034
998
  </div>
1035
999
  ))
@@ -1052,9 +1016,9 @@ const PhoneSides = observer(({ rv }: { rv: ReviewSt }) => {
1052
1016
  return <span className="seg">{PAIR_SIDES.map((s) => <button key={s.value} className={side === s.value ? 'on' : ''} onClick={() => pick(s.value)}>{s.label}</button>)}</span>
1053
1017
  })
1054
1018
 
1055
- /** a pair on a phone: one side at a time full width, or the curtain; the zoom scrolls. `fitH`: in the lightbox, the
1056
- * height it fits, its sides chosen in the lightbox's bar */
1057
- const PhonePair = observer(({ ver, view, bar, before, after, aspect, size, scale, fitH }: {
1019
+ /** a pair on a phone: one side at a time full width, or the curtain. `fitH`: in the lightbox, the height it fits, its
1020
+ * sides chosen in the lightbox's bar */
1021
+ const PhonePair = observer(({ ver, view, bar, before, after, aspect, size, fitH }: {
1058
1022
  ver: Ver
1059
1023
  view: number
1060
1024
  bar: ReactNode
@@ -1062,7 +1026,6 @@ const PhonePair = observer(({ ver, view, bar, before, after, aspect, size, scale
1062
1026
  after: string
1063
1027
  aspect: string
1064
1028
  size: { w: number; h: number }
1065
- scale: number | null
1066
1029
  fitH: string | null
1067
1030
  }) => {
1068
1031
  const { rv } = ver
@@ -1074,8 +1037,8 @@ const PhonePair = observer(({ ver, view, bar, before, after, aspect, size, scale
1074
1037
  return (
1075
1038
  <div className="rv-phonepair">
1076
1039
  {fitH ? null : <PhoneSides rv={rv} />}
1077
- <div style={scale ? { overflow: 'auto', maxHeight: fitH ? `calc(${fitH})` : '70vh' } : undefined}>
1078
- <div className={fitH ? 'rv-zoomface' : undefined} data-cols={fitH ? 1 : undefined} style={{ width: scale ? `${size.w * scale}px` : fit, margin: '0 auto' }}>
1040
+ <div>
1041
+ <div className={fitH ? 'rv-zoomface' : undefined} data-cols={fitH ? 1 : undefined} style={{ width: fit, margin: '0 auto' }}>
1079
1042
  {side === 'swipe' ? (
1080
1043
  <Compare c={c} base={before} mod={after} names={PAIR_NAMES} aspect={aspect} draw={(s) => <Marks ver={ver} src={s} side={s === before ? 'before' : 'after'} view={view} />}
1081
1044
  over={(srcs) => (ver.live ? <RectNote ver={ver} view={view} sides={srcs.map((s) => (s === before ? 'before' : 'after'))} /> : null)} />
@@ -1107,13 +1070,13 @@ const CompareModes = observer(({ c, clip, keys }: { c: CompareSt; clip: boolean;
1107
1070
  <span className="seg">
1108
1071
  {COMPARE_MODES.filter((m) => !(clip && m === 'diff')).map((m) => {
1109
1072
  const o = MODES.find((x) => x.mode === m)!
1110
- return <button key={m} title={`${o.tip} (D cycles, ⇧D back)`} className={c.modeFor(clip) === m ? 'on' : ''} onMouseDown={keepFocus} onClick={() => c.setMode(m)}>{o.glyph}</button>
1073
+ return <button key={m} {...tip(`${o.tip} (D cycles, ⇧D back)`)} className={c.modeFor(clip) === m ? 'on' : ''} onMouseDown={keepFocus} onClick={() => c.setMode(m)}>{o.glyph}</button>
1111
1074
  })}
1112
1075
  </span>
1113
1076
  {keys ? <Key k="D" /> : null}
1114
1077
  </span>
1115
1078
  {c.mode === 'onion' ? (
1116
- <input className="rv-onion" type="range" min={0} max={1} step={0.05} value={c.opacity} title={`after ${Math.round(c.opacity * 100)} %`} onChange={(e) => c.setOpacity(Number(e.currentTarget.value))} />
1079
+ <input className="rv-onion" type="range" min={0} max={1} step={0.05} value={c.opacity} {...tip(`after ${Math.round(c.opacity * 100)} %`)} onChange={(e) => c.setOpacity(Number(e.currentTarget.value))} />
1117
1080
  ) : null}
1118
1081
  </span>
1119
1082
  ))
@@ -1123,7 +1086,7 @@ const PairFlip = observer(({ c }: { c: CompareSt }) => (
1123
1086
  <span className="rv-keyed">
1124
1087
  <span className="seg" role="group" aria-label="one side alone">
1125
1088
  {(['before', 'after'] as const).map((side) => (
1126
- <button key={side} className={c.shown === side ? 'on' : ''} title={`the ${side} alone (space flips)`} onMouseDown={keepFocus} onClick={() => c.show(side)}>{side}</button>
1089
+ <button key={side} className={c.shown === side ? 'on' : ''} {...tip(`the ${side} alone (space flips)`)} onMouseDown={keepFocus} onClick={() => c.show(side)}>{side}</button>
1127
1090
  ))}
1128
1091
  </span>
1129
1092
  <Key k="space" />
@@ -1257,9 +1220,13 @@ const Compare = observer(({ c, mode = c.mode, base, mod, names, aspect, draw, ov
1257
1220
  * after green) and its name in a corner tag, both drawn over the image so nothing moves when it changes */
1258
1221
  const Frame = ({ aspect, caption, modCap, swipe, onPeek, side, over, children }: { aspect: string; caption: ReactNode; modCap?: boolean; swipe?: CompareSt | undefined; onPeek?: (on: boolean) => void; side?: { tone: 'before' | 'after'; name: string }; over?: ReactNode; children: ReactNode }) => {
1259
1222
  const frame = useRef<HTMLDivElement>(null)
1223
+ // in the lightbox the frame is a port on the picture: larger than its room, the picture moves under it (box-view.ts)
1224
+ const zoom = useBoxView()
1260
1225
  const down = (e: React.PointerEvent): void => {
1261
1226
  const el = frame.current
1262
1227
  if (!swipe || !el || !e.isPrimary) return
1228
+ // a picture larger than its room: a drag moves it, the curtain's line is held by itself
1229
+ if (zoom?.on && !(e.target instanceof Element && e.target.closest('.rv-curtain'))) return
1263
1230
  e.preventDefault()
1264
1231
  const at = (x: number): void => {
1265
1232
  const r = el.getBoundingClientRect()
@@ -1271,7 +1238,7 @@ const Frame = ({ aspect, caption, modCap, swipe, onPeek, side, over, children }:
1271
1238
  return (
1272
1239
  <div className="rv-cell">
1273
1240
  <div className="rv-framebox">
1274
- <div ref={frame} className={`rv-frame${swipe ? ' swipe' : ''}${side ? ` side-${side.tone}` : ''}`} style={{ aspectRatio: aspect }} onPointerDown={down}
1241
+ <div ref={frame} className={`rv-frame${zoom ? ' rv-zoomport' : ''}${swipe ? ' swipe' : ''}${side ? ` side-${side.tone}` : ''}`} style={{ aspectRatio: aspect }} onPointerDown={down}
1275
1242
  onMouseEnter={() => onPeek?.(true)} onMouseLeave={() => onPeek?.(false)}>
1276
1243
  {children}
1277
1244
  </div>
@@ -1291,6 +1258,8 @@ export const pct = (r: { x: number; y: number; w: number; h: number }) => ({ lef
1291
1258
  const clamp01 = (v: number): number => Math.max(0, Math.min(1, v))
1292
1259
  /** a drag shorter than this, on either axis, is a click: it picks nothing */
1293
1260
  const MIN_DRAG = 0.01
1261
+ /** and never more than this on the screen, in px: on a picture shown many times its size a hundredth of it is far */
1262
+ const MIN_DRAG_PX = 6
1294
1263
 
1295
1264
  /** the drag that draws a rectangle on a picture, 0 to 1 over `el`: `show` the box while it moves (null once let go),
1296
1265
  * `end` the rectangle, or null for a click. A version's views draw with it, and a trailer page's frame */
@@ -1315,7 +1284,8 @@ export function dragBox(e: { clientX: number; clientY: number }, el: Element, sh
1315
1284
  // a second finger hands the gesture to the browser's pinch, which cancels this one: no rectangle, no tap
1316
1285
  if (ev.type === 'pointercancel') return
1317
1286
  const r = box(cur)
1318
- end(r.w > MIN_DRAG && r.h > MIN_DRAG ? r : null)
1287
+ const b = el.getBoundingClientRect()
1288
+ end(r.w > Math.min(MIN_DRAG, MIN_DRAG_PX / b.width) && r.h > Math.min(MIN_DRAG, MIN_DRAG_PX / b.height) ? r : null)
1319
1289
  }
1320
1290
  window.addEventListener('pointermove', move)
1321
1291
  window.addEventListener('pointerup', up)
@@ -1348,6 +1318,9 @@ const Marks = observer(({ ver, src, side, view, face, tile, onTap, alone, notes
1348
1318
  const { rv, thread, cell } = ver
1349
1319
  const el = useRef<HTMLDivElement>(null)
1350
1320
  const [drag, setDrag] = useState<Corners | null>(null)
1321
+ // in the lightbox this is the layer the view sizes and moves: it takes the view again each time the page drew it
1322
+ const zoom = useBoxView()
1323
+ useLayoutEffect(() => zoom?.sync())
1351
1324
  const phone = rv.phone
1352
1325
  const any = itemOf(ver).views[view]
1353
1326
  const shown = any && !isGallery(any) ? any : undefined
@@ -1371,6 +1344,7 @@ const Marks = observer(({ ver, src, side, view, face, tile, onTap, alone, notes
1371
1344
  if (c && !c.paused) c.pause()
1372
1345
  if (!el.current) return
1373
1346
  dragBox(e, el.current, setDrag, (r) => {
1347
+ if (r) zoom?.drew()
1374
1348
  if (r) thread.addRect(r, side, view, tile)
1375
1349
  else if (onTap) onTap()
1376
1350
  else thread.pickRect(null)
@@ -1382,7 +1356,7 @@ const Marks = observer(({ ver, src, side, view, face, tile, onTap, alone, notes
1382
1356
  const rings = rv.marksOn ? (shown?.marks ?? []).filter((m) => m.side === side) : []
1383
1357
  const live = drawing || (clock !== null && ver.live && !active)
1384
1358
  return (
1385
- <div ref={el} className={`rv-marks${clock && ver.live && !active ? ' pick' : drawing ? ' draw' : ''}`} onPointerDown={down} style={{ pointerEvents: live ? 'auto' : 'none', touchAction: drawing ? 'pinch-zoom' : undefined }}>
1359
+ <div ref={el} className={`rv-marks${zoom ? ' rv-zoomlayer' : ''}${clock && ver.live && !active ? ' pick' : drawing ? ' draw' : ''}`} onPointerDown={down} style={{ pointerEvents: live ? 'auto' : 'none', touchAction: drawing ? 'pinch-zoom' : undefined }}>
1386
1360
  {face ?? (c ? <ClipVideo key={src} clip={c} src={src} poster={shown?.clip ? rv.fitUrl(cell.id, shown.clip.poster) : undefined} preload={ver.live ? 'auto' : 'none'} /> : <img src={src} alt="" draggable={false} className="rv-markimg" loading="lazy" decoding="async" />)}
1387
1361
  {shown && rings.length > 0 ? <Rings marks={rings} w={shown.size.w} h={shown.size.h} /> : null}
1388
1362
  {notes
@@ -1390,7 +1364,7 @@ const Marks = observer(({ ver, src, side, view, face, tile, onTap, alone, notes
1390
1364
  const s = notes(r)
1391
1365
  return s ? [<NoteRect key={`s${k}`} r={r} n={s.n} on={s.lit} sent />] : []
1392
1366
  })
1393
- : sent.map(({ r, n }, k) => <div key={`s${k}`} className={`rv-rect sent${onIts(r) ? '' : ' faint'}`} style={pct(r)} title={r.comment || `rectangle ${n}`}><span className="rv-rectn">{n}</span></div>)}
1367
+ : sent.map(({ r, n }, k) => <div key={`s${k}`} className={`rv-rect sent${onIts(r) ? '' : ' faint'}`} style={pct(r)} {...tip(r.comment || `rectangle ${n}`)}><span className="rv-rectn">{n}</span></div>)}
1394
1368
  {notes
1395
1369
  ? rects.flatMap(([r, i]) => {
1396
1370
  const s = notes(r)
@@ -1406,7 +1380,7 @@ const Marks = observer(({ ver, src, side, view, face, tile, onTap, alone, notes
1406
1380
 
1407
1381
  /** a note's rectangle as a host that shows notes by time draws it: solid, its number and its first words on its label */
1408
1382
  export const NoteRect = ({ r, n, on, sent, pick }: { r: { x: number; y: number; w: number; h: number; comment: string }; n: number; on: boolean; sent?: boolean; pick?: () => void }) => (
1409
- <div className={`rv-rect tr-noterect${on ? ' on' : ''}${sent ? ' was' : ''}`} style={{ ...pct(r), pointerEvents: pick ? 'auto' : 'none' }} title={r.comment || `note ${n}`}
1383
+ <div className={`rv-rect tr-noterect${on ? ' on' : ''}${sent ? ' was' : ''}`} style={{ ...pct(r), pointerEvents: pick ? 'auto' : 'none' }} {...tip(r.comment || `note ${n}`)}
1410
1384
  onPointerDown={pick ? (e) => { e.stopPropagation(); pick() } : undefined} onMouseDown={keepFocus}>
1411
1385
  <span className="tr-notelabel"><b>{n}</b>{r.comment.trim() ? ` ${firstWords(r.comment)}` : ''}</span>
1412
1386
  </div>
@@ -1426,7 +1400,7 @@ const Rings = ({ marks, w, h }: { marks: readonly ReviewMark[]; w: number; h: nu
1426
1400
 
1427
1401
  /** a rectangle of his draft; on a clip, faint and dashed away from its frame, its time on its number */
1428
1402
  const RectMark = ({ r, n, on, faint, at, pick }: { r: Rect; n: number; on: boolean; faint: boolean; at: string | undefined; pick: () => void }) => (
1429
- <div className={`rv-rect${on ? ' on' : ''}${faint ? ' faint' : ''}`} style={{ ...pct(r), pointerEvents: 'auto' }} title={r.comment || `rectangle ${n}`}
1403
+ <div className={`rv-rect${on ? ' on' : ''}${faint ? ' faint' : ''}`} style={{ ...pct(r), pointerEvents: 'auto' }} {...tip(r.comment || `rectangle ${n}`)}
1430
1404
  onPointerDown={(e) => { e.stopPropagation(); pick() }} onMouseDown={keepFocus}>
1431
1405
  <span className="rv-rectn">{n}{at ? ` · ${at}` : ''}{!on && r.comment.trim() ? <span className="rv-rectword">{firstWords(r.comment)}</span> : null}</span>
1432
1406
  </div>
@@ -1480,7 +1454,8 @@ const RectNote = observer(({ ver, view, sides, tile, notes }: { ver: Ver; view:
1480
1454
  return {
1481
1455
  contextElement: frame,
1482
1456
  getBoundingClientRect: () => {
1483
- const b = frame.getBoundingClientRect()
1457
+ // in the lightbox the rectangle is on the picture's layer, which moves under its frame
1458
+ const b = (frame.parentElement?.querySelector('.rv-zoomlayer') ?? frame).getBoundingClientRect()
1484
1459
  const left = b.left + x * b.width
1485
1460
  const top = b.top + y * b.height
1486
1461
  return { x: left, y: top, left, top, width: w * b.width, height: h * b.height, right: left + w * b.width, bottom: top + h * b.height }
@@ -1504,7 +1479,7 @@ const RectNote = observer(({ ver, view, sides, tile, notes }: { ver: Ver; view:
1504
1479
  thread.pickRect(null)
1505
1480
  }
1506
1481
  }} />
1507
- <button className="ghost rv-x" title="delete this rectangle" aria-label="delete this rectangle" onMouseDown={keepFocus} onClick={() => thread.removeRect(i)}>✕</button>
1482
+ <button className="ghost rv-x" {...tip('delete this rectangle')} aria-label="delete this rectangle" onMouseDown={keepFocus} onClick={() => thread.removeRect(i)}>✕</button>
1508
1483
  {notes || oneSet(ver) ? null : <span className="rv-notereacts"><ReactionToggles ver={ver} view={view} small /></span>}
1509
1484
  </div>
1510
1485
  </Popover>
@@ -1529,7 +1504,7 @@ const ClipVideo = ({ clip, src, poster, loop = true, preload = 'auto' }: { clip:
1529
1504
  /** the sound button and the volume: a volume moved turns the sound on */
1530
1505
  export const ClipSound = observer(({ clip, keyHint }: { clip: ClipSt; keyHint?: string }) => (
1531
1506
  <span className="rv-sound">
1532
- <button className={clip.sound ? 'primary' : ''} title={`${clip.sound ? 'sound off' : 'sound on'}${keyHint ? ` (${keyHint})` : ''}`} onMouseDown={keepFocus} onClick={() => clip.toggleSound()}>
1507
+ <button className={clip.sound ? 'primary' : ''} {...tip(`${clip.sound ? 'sound off' : 'sound on'}${keyHint ? ` (${keyHint})` : ''}`)} onMouseDown={keepFocus} onClick={() => clip.toggleSound()}>
1533
1508
  {clip.sound ? '🔊' : '🔇'}
1534
1509
  </button>
1535
1510
  <input type="range" min={0} max={1} step={0.05} value={clip.sound ? clip.volume : 0} aria-label="volume" onChange={(e) => clip.setVolume(Number(e.currentTarget.value))}
@@ -1546,10 +1521,10 @@ const ClipBar = observer(({ clip, info, use, keys }: { clip: ClipSt; info: Revie
1546
1521
  const step = keys?.frames ?? true
1547
1522
  return (
1548
1523
  <div className="rv-clipbar" onMouseDownCapture={use} onTouchStartCapture={use}>
1549
- <button title={`${clip.paused ? 'play' : 'pause'}${play ? ' (Space)' : ''}`} onMouseDown={keepFocus} onClick={() => clip.toggle()}>{clip.paused ? '▶' : '❚❚'}{keys && play ? <Key k="space" /> : null}</button>
1524
+ <button {...tip(`${clip.paused ? 'play' : 'pause'}${play ? ' (Space)' : ''}`)} onMouseDown={keepFocus} onClick={() => clip.toggle()}>{clip.paused ? '▶' : '❚❚'}{keys && play ? <Key k="space" /> : null}</button>
1550
1525
  <ClipSound clip={clip} />
1551
- <button title={`frame back${step ? ' (←)' : ''}`} onMouseDown={keepFocus} onClick={() => clip.step(-1)}>⏮{keys && step ? <Key k="←" /> : null}</button>
1552
- <button title={`frame on${step ? ' (→)' : ''}`} onMouseDown={keepFocus} onClick={() => clip.step(1)}>⏭{keys && step ? <Key k="→" /> : null}</button>
1526
+ <button {...tip(`frame back${step ? ' (←)' : ''}`)} onMouseDown={keepFocus} onClick={() => clip.step(-1)}>⏮{keys && step ? <Key k="←" /> : null}</button>
1527
+ <button {...tip(`frame on${step ? ' (→)' : ''}`)} onMouseDown={keepFocus} onClick={() => clip.step(1)}>⏭{keys && step ? <Key k="→" /> : null}</button>
1553
1528
  <input className="rv-scrub" type="range" min={0} max={info.duration} step={1 / info.fps} value={Math.min(clip.time, info.duration)}
1554
1529
  onChange={(e) => clip.seek(Number(e.currentTarget.value))} onMouseUp={(e) => e.currentTarget.blur()} />
1555
1530
  <span className="rv-mono">{secs(clip.time)} · frame {clip.frameOf(clip.time) + 1}/{frames}</span>