rvlib-shipkit 2.19.0 → 2.21.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 (196) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/package.json +1 -1
  3. package/src/annex/annex.ts +227 -0
  4. package/src/annex/offload.ts +279 -0
  5. package/src/checks/SK004-gitignore-policy.check.ts +6 -3
  6. package/src/checks/SK040-release-words.check.ts +43 -0
  7. package/src/checks/SK041-annex-links.check.ts +28 -0
  8. package/src/checks/SK042-post-kinds.check.ts +73 -0
  9. package/src/cli/cmd_Annex.ts +179 -0
  10. package/src/cli/cmd_Commands.ts +4 -1
  11. package/src/cli/cmd_GlobalProcesses.ts +2 -107
  12. package/src/cli/cmd_Home.ts +4 -3
  13. package/src/cli/cmd_Messages.ts +155 -0
  14. package/src/cli/cmd_Overview.ts +2 -1
  15. package/src/cli/cmd_Releases.ts +84 -0
  16. package/src/cli/cmd_Review.ts +176 -12
  17. package/src/cli/cmd_Shot.ts +4 -4
  18. package/src/cli/cmd_Social.ts +151 -8
  19. package/src/cli/cmd_Sound.ts +17 -4
  20. package/src/cli/cmd_Trailer.ts +67 -1
  21. package/src/cli/family-pages.ts +2 -0
  22. package/src/cli/kit/index.ts +1 -1
  23. package/src/cli/kit/verb.ts +11 -3
  24. package/src/cli/registry.ts +7 -1
  25. package/src/collections/collection-types.ts +8 -1
  26. package/src/collections/providers.ts +4 -1
  27. package/src/collections/review.ts +23 -4
  28. package/src/commands/model.ts +36 -0
  29. package/src/commands/registry.ts +49 -0
  30. package/src/commands/routes.ts +59 -0
  31. package/src/commands/runner.ts +35 -0
  32. package/src/commands/runs.ts +112 -0
  33. package/src/core/app-icon.ts +4 -3
  34. package/src/core/icon-type.ts +8 -0
  35. package/src/core/jobs.ts +4 -3
  36. package/src/core/layout.ts +11 -2
  37. package/src/core/squircle.ts +95 -0
  38. package/src/home/daemon-jobs.ts +26 -2
  39. package/src/home/global-units.ts +3 -0
  40. package/src/home/gui-app/ShipkitGui.swift +337 -5
  41. package/src/home/gui-app.ts +64 -33
  42. package/src/home/hmr-keep.ts +134 -0
  43. package/src/home/home-start.ts +2 -2
  44. package/src/home/lib-watch.ts +21 -11
  45. package/src/home/pm-switch.ts +112 -0
  46. package/src/home/pm.ts +1 -1
  47. package/src/home/process-apps.ts +181 -0
  48. package/src/home/resources.ts +3 -3
  49. package/src/home/run-web.ts +7 -4
  50. package/src/home/serve-web.ts +64 -14
  51. package/src/identities/collection.ts +49 -0
  52. package/src/identities/identities.ts +121 -14
  53. package/src/identities/machine.ts +4 -3
  54. package/src/identities/rating.ts +33 -0
  55. package/src/identities/shown.ts +170 -0
  56. package/src/identities/steps.ts +5 -0
  57. package/src/media-store/purge.ts +15 -1
  58. package/src/media-store/remote.ts +22 -6
  59. package/src/messages/brief.ts +117 -0
  60. package/src/messages/collection.ts +40 -0
  61. package/src/messages/model.ts +171 -0
  62. package/src/messages/routes.ts +15 -0
  63. package/src/messages/score.ts +182 -0
  64. package/src/messages/tabs.ts +13 -0
  65. package/src/release/notes.ts +130 -0
  66. package/src/release/run-bump.ts +41 -18
  67. package/src/release/run-release.ts +22 -4
  68. package/src/release/run-releases.ts +17 -15
  69. package/src/release/unit-resolve.ts +9 -0
  70. package/src/releases/add.ts +94 -0
  71. package/src/releases/before.ts +31 -0
  72. package/src/releases/collection.ts +36 -0
  73. package/src/releases/from-card.ts +151 -0
  74. package/src/releases/model.ts +327 -0
  75. package/src/releases/pictures.ts +110 -0
  76. package/src/releases/routes.ts +36 -0
  77. package/src/releases/store.ts +71 -0
  78. package/src/repo-config.ts +5 -0
  79. package/src/review/cells.ts +0 -11
  80. package/src/review/format.ts +10 -6
  81. package/src/review/http.ts +1 -1
  82. package/src/review/model.ts +102 -3
  83. package/src/review/notes.ts +2 -48
  84. package/src/review/routes.ts +28 -10
  85. package/src/review/stage-card.ts +197 -0
  86. package/src/review/stage-routes.ts +123 -0
  87. package/src/review/store.ts +47 -1
  88. package/src/review/trailer-card.ts +99 -0
  89. package/src/review/trailer-desk.ts +76 -4
  90. package/src/review/trailer-model.ts +106 -7
  91. package/src/review/trailer-notes.ts +45 -0
  92. package/src/review/trailer-routes.ts +119 -13
  93. package/src/review/trailer-voices.ts +144 -0
  94. package/src/review/watchers.ts +58 -1
  95. package/src/serve/hub-app/app-bridge.ts +71 -0
  96. package/src/serve/hub-app/benign-errors.ts +22 -0
  97. package/src/serve/hub-app/commands/commands-page.tsx +122 -0
  98. package/src/serve/hub-app/commands/commands-st.ts +177 -0
  99. package/src/serve/hub-app/commands.css +24 -0
  100. package/src/serve/hub-app/hash-route.ts +59 -8
  101. package/src/serve/hub-app/home-st.ts +19 -2
  102. package/src/serve/hub-app/home.html +3 -0
  103. package/src/serve/hub-app/hub-app.tsx +8 -0
  104. package/src/serve/hub-app/icons.tsx +5 -0
  105. package/src/serve/hub-app/identities-view.tsx +4 -1
  106. package/src/serve/hub-app/identities.css +1 -0
  107. package/src/serve/hub-app/index.html +3 -0
  108. package/src/serve/hub-app/keys.ts +2 -2
  109. package/src/serve/hub-app/machine-st.ts +41 -10
  110. package/src/serve/hub-app/messages/messages-page.tsx +354 -0
  111. package/src/serve/hub-app/messages/messages-st.ts +74 -0
  112. package/src/serve/hub-app/messages.css +35 -0
  113. package/src/serve/hub-app/project-list.css +7 -2
  114. package/src/serve/hub-app/project-list.tsx +9 -0
  115. package/src/serve/hub-app/projects-svc.ts +16 -6
  116. package/src/serve/hub-app/releases/releases-page.tsx +187 -0
  117. package/src/serve/hub-app/releases/releases-st.ts +111 -0
  118. package/src/serve/hub-app/releases.css +52 -0
  119. package/src/serve/hub-app/repo-sections.ts +16 -2
  120. package/src/serve/hub-app/repo-st.ts +66 -10
  121. package/src/serve/hub-app/review/clip-st.ts +34 -4
  122. package/src/serve/hub-app/review/kit.tsx +3 -3
  123. package/src/serve/hub-app/review/note-place.ts +31 -0
  124. package/src/serve/hub-app/review/review-cells.tsx +27 -3
  125. package/src/serve/hub-app/review/review-st.ts +77 -2
  126. package/src/serve/hub-app/review/review-thread.tsx +9 -31
  127. package/src/serve/hub-app/review/review-views.tsx +164 -58
  128. package/src/serve/hub-app/review/thread-st.ts +108 -41
  129. package/src/serve/hub-app/review/trailer-card.tsx +187 -0
  130. package/src/serve/hub-app/review/trailer-page.tsx +92 -36
  131. package/src/serve/hub-app/review/trailer-st.ts +306 -34
  132. package/src/serve/hub-app/review/trailer-timeline.tsx +68 -23
  133. package/src/serve/hub-app/review/trailer-voices-st.ts +370 -0
  134. package/src/serve/hub-app/review/trailer-voices.tsx +574 -0
  135. package/src/serve/hub-app/review.css +137 -6
  136. package/src/serve/hub-app/social/comms-page.tsx +65 -28
  137. package/src/serve/hub-app/social/identity-pictures.ts +46 -8
  138. package/src/serve/hub-app/social/kit.tsx +9 -6
  139. package/src/serve/hub-app/social/next-release.tsx +118 -0
  140. package/src/serve/hub-app/social/post-card.tsx +10 -2
  141. package/src/serve/hub-app/social/social-model.ts +39 -3
  142. package/src/serve/hub-app/social/social-page.tsx +179 -65
  143. package/src/serve/hub-app/social/social-st.ts +117 -27
  144. package/src/serve/hub-app/social/stage-popup.tsx +268 -0
  145. package/src/serve/hub-app/social/stage-st.ts +310 -0
  146. package/src/serve/hub-app/social/step-layout.ts +42 -0
  147. package/src/serve/hub-app/social.css +68 -1
  148. package/src/serve/hub-app/tree-build.ts +40 -1
  149. package/src/serve/hub-app/tree-svc.ts +10 -3
  150. package/src/serve/project-gutter-route.ts +12 -2
  151. package/src/serve/project-gutter.ts +4 -2
  152. package/src/serve/same-origin.ts +24 -1
  153. package/src/serve/serve-hub.ts +15 -1
  154. package/src/shipkit-files.ts +9 -7
  155. package/src/shot/box.ts +33 -12
  156. package/src/shot/client.ts +1 -1
  157. package/src/shot/shooter.ts +22 -12
  158. package/src/shot/shot-ask.ts +14 -3
  159. package/src/shot/shot.shipkit.ts +1 -1
  160. package/src/social/desk-index.ts +49 -8
  161. package/src/social/discord-layout.ts +54 -7
  162. package/src/social/drafts.ts +1 -1
  163. package/src/social/fit.ts +84 -0
  164. package/src/social/identity-words.ts +74 -0
  165. package/src/social/kind-pages.ts +41 -0
  166. package/src/social/kinds.ts +93 -0
  167. package/src/social/load.ts +125 -10
  168. package/src/social/media-limit.ts +63 -2
  169. package/src/social/presence.ts +1 -1
  170. package/src/social/publish/bluesky.ts +58 -19
  171. package/src/social/publish/index.ts +47 -6
  172. package/src/social/reach.ts +49 -0
  173. package/src/social/release-stage.ts +277 -0
  174. package/src/social/routes.ts +44 -8
  175. package/src/social/stage.ts +246 -0
  176. package/src/social/strip.ts +85 -0
  177. package/src/social/text.ts +6 -2
  178. package/src/social/unit.ts +57 -1
  179. package/src/social/writes.ts +11 -0
  180. package/src/trailer/bed.ts +111 -0
  181. package/src/trailer/build.ts +72 -40
  182. package/src/trailer/ffmpeg.ts +6 -0
  183. package/src/trailer/grammar.ts +37 -6
  184. package/src/trailer/graph.ts +12 -1
  185. package/src/trailer/public-words.ts +41 -0
  186. package/src/trailer/shot-plan.ts +75 -0
  187. package/src/trailer/shot-state.ts +191 -0
  188. package/src/trailer/sound/audio.ts +28 -0
  189. package/src/trailer/sound/brand.ts +53 -3
  190. package/src/trailer/sound/gen.ts +61 -2
  191. package/src/trailer/sound/index.ts +25 -11
  192. package/src/trailer/sound/presets.ts +86 -5
  193. package/src/trailer/sound/run.ts +1 -1
  194. package/src/trailer/sound/takes.ts +94 -0
  195. package/src/trailer/titles.ts +36 -0
  196. package/src/trailer/url.ts +1 -1
@@ -13,6 +13,11 @@
13
13
  .ns-wontfix{--tone:var(--dim)}
14
14
  .hue-k1{--hue:var(--k1)}.hue-k2{--hue:var(--k2)}.hue-k3{--hue:var(--k3)}.hue-k4{--hue:var(--k4)}.hue-k5{--hue:var(--k5)}.hue-k6{--hue:var(--k6)}
15
15
  .hue-none{--hue:var(--dim)}
16
+ .ss-ready{--tone:var(--ok)}
17
+ .ss-queued{--tone:var(--warn)}
18
+ .ss-filming{--tone:var(--blue)}
19
+ .ss-waiting{--tone:var(--review)}
20
+ .ss-unfilmed{--tone:var(--red)}
16
21
 
17
22
  /* ── the columns ── */
18
23
  .rv-cols{flex:1;min-height:0}
@@ -279,11 +284,9 @@ span.rv-react{display:inline-block;border:1px solid;border-radius:4px}
279
284
  .rv-rect.on .rv-rectn{background:var(--blue)}
280
285
  .rv-rect.sent .rv-rectn{background:var(--k4)}
281
286
  .rv-drag{position:absolute;border:2px dashed var(--warn)}
282
- /* the picked rectangle's note box, in the picked rectangle's blue: under it, or over it (clearing its number) */
283
- .rv-note{position:absolute;left:clamp(0px,var(--nx),calc(100% - min(300px,100%)));width:min(300px,100%);pointer-events:auto;display:flex;flex-wrap:wrap;gap:var(--s1);align-items:flex-start;
287
+ /* the picked rectangle's note box, in the picked rectangle's blue: beside it, its place in px from notePlace */
288
+ .rv-note{position:absolute;width:min(300px,100%);pointer-events:auto;display:flex;flex-wrap:wrap;gap:var(--s1);align-items:flex-start;
284
289
  padding:var(--s1);border-radius:6px;border:2px solid var(--blue);background:var(--panel);box-shadow:0 2px 10px var(--shadow)}
285
- .rv-note.below{margin-top:var(--s1)}
286
- .rv-note.above{margin-bottom:var(--s4)}
287
290
  .rv-noten{flex:none;padding:0 var(--s1);border-radius:3px;background:var(--blue);color:var(--bg);font-size:11px;font-weight:800;line-height:18px;white-space:nowrap}
288
291
  .rv-note textarea{flex:1;min-width:0}
289
292
  /* the side the rectangle marks, beside its number: after keeps the blue, before turns to the warn tone so a wrong side shows */
@@ -351,6 +354,8 @@ span.rv-react{display:inline-block;border:1px solid;border-radius:4px}
351
354
  .rv-optplay{flex:none;width:32px;height:28px;padding:0;font-size:13px}
352
355
  .rv-optplay.on{color:var(--bg);background:var(--accent);border-color:var(--accent)}
353
356
  .rv-optlabel{flex:0 1 auto;min-width:48px;max-width:30%;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
357
+ /* the agent's suggestion on a choice: the .rv-kind pill in the accent, apart from his own « ✓ picked » in --ok */
358
+ .rv-mypick{flex:none;font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.07em;color:var(--accent);border:1px solid color-mix(in srgb,var(--accent) 60%,var(--line));background:color-mix(in srgb,var(--accent) 10%,var(--bg));border-radius:10px;padding:0 var(--s2);line-height:18px;white-space:nowrap}
354
359
  .rv-optthumb{flex:none;height:32px;max-width:72px;border-radius:3px;overflow:hidden;cursor:zoom-in;border:1px solid var(--line);background:var(--panel2)}
355
360
  .rv-optthumb.img{width:48px}
356
361
  .rv-optthumb img{display:block;width:100%;height:100%;object-fit:cover}
@@ -433,6 +438,82 @@ span.rv-pick{display:inline-block;border:1px solid;border-radius:4px;font-size:1
433
438
  .tr-edited{color:var(--warn)}
434
439
  .tr-cuterr{color:var(--red);font-weight:800}
435
440
  .tr-opencount{flex:none;min-width:16px;padding:0 var(--s1);border-radius:8px;background:var(--warn);color:var(--bg);font-size:10px;font-weight:700;text-align:center;line-height:16px}
441
+ /* the Voices view: the open line in the middle, every line on the right */
442
+ .tv-button{margin:var(--s1) 0 var(--s2);border:1px solid var(--line)}
443
+ .tv-button .sp,.tv-cliphead .sp{flex:1}
444
+ .tv-open{display:flex;flex-direction:column;gap:var(--s2);padding:var(--s3)}
445
+ .tv-head{display:flex;align-items:center;gap:var(--s2);flex-wrap:wrap}
446
+ .tv-dim{color:var(--dim);font-size:12px}
447
+ .tv-pill{padding:0 var(--s2);border-radius:9px;font-size:11px;font-weight:700;background:var(--panel2);color:var(--dim)}
448
+ .tv-pill.waiting{background:var(--warn);color:var(--bg)}
449
+ .tv-pill.recorded{background:var(--ok);color:var(--bg)}
450
+ .tv-text{margin:0;padding:var(--s2) var(--s3);border-left:3px solid var(--accent);font-size:22px;line-height:1.35;font-weight:600}
451
+ .tv-tag{display:inline-block;margin:0 var(--s1);padding:0 var(--s1);border-radius:4px;background:var(--panel2);color:var(--dim);font-size:12px;font-weight:400;vertical-align:middle}
452
+ .tv-audio{display:flex;align-items:center;gap:var(--s2);flex-wrap:wrap}
453
+ .tv-audio audio{height:32px;max-width:100%}
454
+ .tv-label{min-width:96px;font-size:12px;font-weight:700;color:var(--dim)}
455
+ .tv-actions{display:flex;align-items:center;gap:var(--s2);flex-wrap:wrap}
456
+ .tv-actions button,.tv-small{padding:var(--s1) var(--s3);border:1px solid var(--line);border-radius:6px;background:var(--panel)}
457
+ .tv-small{padding:var(--s0) var(--s2);font-size:12px}
458
+ /* the line's sounds as waveforms on one time scale: a button and a name a lane, the shapes in one column under the
459
+ ruler, the cursor and the next line's mark over that column only */
460
+ .tv-waves{--tv-head:calc(32px + 96px + 2 * var(--s1));position:relative;display:flex;flex-direction:column;gap:var(--s1);padding:var(--s4) 0 var(--s4)}
461
+ .tv-lane{display:grid;grid-template-columns:32px 96px 1fr;gap:var(--s1);align-items:center}
462
+ .tv-lanename{font-size:12px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
463
+ .tv-wave{width:100%;height:56px;display:block;border-radius:4px;background:var(--panel2);color:var(--line);cursor:pointer}
464
+ .tv-wave.drags{cursor:ew-resize;touch-action:none}
465
+ /* the clip's play bar: the range between two handles, the line's start, the playhead; loop beside it */
466
+ .tv-range{display:flex;flex-wrap:wrap;align-items:center;gap:var(--s2)}
467
+ .tv-range .tv-rangebar{flex:1 1 100%;order:-1}
468
+ .tv-loop.on{background:var(--accent);border-color:var(--accent);color:var(--bg)}
469
+ .tv-volume{display:inline-flex;align-items:center;gap:var(--s1)}
470
+ .tv-volume input{width:80px;accent-color:var(--accent)}
471
+ .tv-rangebar{position:relative;flex:1;height:24px;border-radius:4px;background:var(--panel2);cursor:pointer;touch-action:none}
472
+ .tv-rangebar.off{opacity:.5;cursor:default}
473
+ .tv-rangeon{position:absolute;top:0;bottom:0;background:var(--sel);box-shadow:inset 0 0 0 1px var(--accent);border-radius:4px}
474
+ .tv-rangeline{position:absolute;top:0;bottom:0;border-left:2px dashed var(--warn)}
475
+ .tv-rangehead{position:absolute;top:0;bottom:0;width:2px;transform:translateX(-1px);background:var(--red)}
476
+ .tv-handle{position:absolute;top:0;bottom:0;width:8px;transform:translateX(-4px);border-radius:3px;background:var(--accent);cursor:ew-resize}
477
+ /* which version of the line the clip plays: one segmented switch */
478
+ .tv-hear{display:inline-flex;border:1px solid var(--line);border-radius:6px;overflow:hidden}
479
+ .tv-hear button{padding:var(--s0) var(--s2);border:0;background:var(--panel);font-size:12px}
480
+ .tv-hear button.on{background:var(--accent);color:var(--bg);font-weight:700}
481
+ .tv-brushes{display:flex;gap:var(--s1)}
482
+ .tv-brush{flex:1;padding:0 var(--s1);border:1px solid var(--line);border-radius:4px;background:var(--panel);font-size:11px}
483
+ .tv-brush.mute.on{background:var(--red);border-color:var(--red);color:var(--bg)}
484
+ .tv-brush.keep.on{background:var(--ok);border-color:var(--ok);color:var(--bg)}
485
+ .tv-maskbar{position:relative;height:16px;border-radius:4px;background:var(--panel2);box-shadow:inset 0 0 0 1px var(--ok);cursor:crosshair;touch-action:none;overflow:hidden}
486
+ .tv-maskbar.off{cursor:default;opacity:.5}
487
+ .tv-masked{position:absolute;top:0;bottom:0;background:var(--red)}
488
+ .tv-overlay{position:absolute;left:var(--tv-head);right:0;top:var(--s4);bottom:var(--s4);pointer-events:none}
489
+ .tv-cursor{position:absolute;top:0;bottom:0;width:2px;transform:translateX(-1px);background:var(--red)}
490
+ .tv-room{position:absolute;top:0;bottom:0;border-left:2px dashed var(--warn)}
491
+ .tv-room span{position:absolute;top:calc(-1 * var(--s4));left:var(--s1);font-size:10px;color:var(--warn);white-space:nowrap}
492
+ .tv-cliphead{flex-wrap:wrap}
493
+ .tv-mic{display:flex;align-items:center;gap:var(--s2);font-size:12px}
494
+ .tv-mic select{max-width:100%;min-width:0;flex:1}
495
+ .tv-tick{position:absolute;bottom:calc(-1 * var(--s4));height:var(--s2);border-left:1px solid var(--line);font-size:10px;color:var(--dim);padding-left:var(--s0);line-height:1}
496
+ .tv-tick.whole{height:var(--s4)}
497
+ .tv-rec{font-weight:700;color:var(--red)}
498
+ .tv-rec.on{background:var(--red);color:var(--bg);border-color:var(--red)}
499
+ .tv-meter{width:120px;height:8px;border-radius:4px;background:var(--panel2);overflow:hidden}
500
+ .tv-meter span{display:block;height:100%;background:var(--ok)}
501
+ .tv-time{font-variant-numeric:tabular-nums;font-size:12px}
502
+ .tv-clip{display:flex;flex-direction:column;gap:var(--s1)}
503
+ .tv-cliphead{display:flex;align-items:center;gap:var(--s2)}
504
+ .tv-frame{position:relative}
505
+ .tv-frame video{display:block;width:100%;border-radius:6px;background:var(--bg);cursor:pointer}
506
+ .tv-cue{position:absolute;top:var(--s3);right:var(--s3);padding:var(--s1) var(--s3);border-radius:6px;background:var(--red);color:var(--bg);font-weight:700;font-size:18px}
507
+ .tv-uses{display:flex;flex-direction:column;gap:var(--s0);font-size:12px}
508
+ .tv-uses a{color:var(--dim)}
509
+ .tv-list{display:flex;flex-direction:column;gap:0;padding:var(--s2)}
510
+ .tv-row{display:flex;align-items:center;gap:var(--s2);width:100%;padding:var(--s1) var(--s2);border:0;border-radius:4px;background:none;text-align:left;font-size:13px}
511
+ .tv-row:hover{background:var(--panel2)}
512
+ .tv-row.on{background:var(--sel);box-shadow:inset 2px 0 0 var(--accent)}
513
+ .tv-rowtext{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
514
+ .tv-dot{flex:none;width:8px;height:8px;border-radius:50%;background:var(--line)}
515
+ .tv-dot.waiting{background:var(--warn)}
516
+ .tv-dot.recorded{background:var(--ok)}
436
517
  .tr-cutage{flex:none;font-size:11px;color:var(--dim);font-variant-numeric:tabular-nums;white-space:nowrap}
437
518
  .tr-keys{margin-top:var(--s3);padding:var(--s2);border:1px solid var(--line);border-radius:6px;background:var(--panel);display:flex;flex-direction:column;gap:var(--s0)}
438
519
  .tr-keyshead{font-size:11px;font-weight:700;color:var(--dim)}
@@ -480,8 +561,6 @@ span.rv-pick{display:inline-block;border:1px solid;border-radius:4px;font-size:1
480
561
  .tr-caption.on{background:var(--warn);color:var(--bg)}
481
562
  .tr-noteline{position:absolute;border-left:1px dashed var(--tone);opacity:.5;pointer-events:none}
482
563
  .tr-noteline.on{border-left-style:solid;opacity:.9}
483
- .tr-notepin{position:absolute;top:0;width:16px;height:16px;border-radius:50% 50% 50% 0;transform:rotate(-45deg);background:var(--tone);border:1px solid var(--shadow);cursor:pointer;z-index:3}
484
- .tr-notepin.on{border:2px solid var(--tag)}
485
564
  .tr-draftmark{position:absolute;top:0;width:2px;background:var(--warn);z-index:3;pointer-events:none}
486
565
  .tr-playhead{position:absolute;top:0;width:2px;background:var(--red);z-index:4;pointer-events:none;box-shadow:0 0 6px var(--red)}
487
566
  .tr-playknob{position:absolute;left:-5px;top:-2px;width:12px;height:8px;border-radius:3px;background:var(--red)}
@@ -492,6 +571,58 @@ span.rv-pick{display:inline-block;border:1px solid;border-radius:4px;font-size:1
492
571
  .tr-shotcard{position:relative;flex:none;width:148px;padding:var(--s1);border-radius:6px;text-align:left;border:1px solid var(--line);background:var(--panel)}
493
572
  .tr-shotcard.on{border:2px solid var(--hue);background:color-mix(in srgb,var(--hue) 12%,var(--panel))}
494
573
  .tr-shotname{font-size:12px;font-weight:800;margin-top:var(--s1);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
574
+ .tr-sbar{position:absolute;left:0;right:0;bottom:0;height:5px;background:var(--tone)}
575
+ .tr-sdot{display:inline-block;flex:none;width:8px;height:8px;border-radius:50%;background:var(--tone);vertical-align:baseline}
576
+ .tr-sstate{display:flex;gap:var(--s1);align-items:center;margin-top:var(--s1);font-size:11px;font-weight:700;color:var(--tone);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
577
+ .tr-sstate .tr-dim{font-weight:500}
578
+ .tr-summary{display:flex;flex-wrap:wrap;gap:var(--s1) var(--s3);align-items:center;font-size:12.5px;padding:var(--s1) 0}
579
+ .tr-summary>span{display:inline-flex;gap:var(--s1);align-items:center}
580
+ .tr-summary .tr-cardlink{padding:0 var(--s1);font-size:12px;font-weight:700;color:var(--tone);border:1px solid color-mix(in srgb,var(--tone) 50%,var(--line));border-radius:3px;background:transparent;line-height:18px}
581
+ .tr-shot.changed::after{content:'';position:absolute;left:0;right:0;bottom:0;height:3px;background:var(--accent)}
582
+ .tr-shotcard.changed{box-shadow:inset 0 -3px 0 var(--accent)}
583
+ .tr-changed{margin-left:var(--s1);font-size:10px;font-weight:700;padding:0 var(--s1);border-radius:3px;line-height:16px;color:var(--accent);border:1px solid color-mix(in srgb,var(--accent) 50%,var(--line));background:transparent}
584
+ button.tr-changed.on{background:var(--accent);color:var(--bg)}
585
+ .tr-card{display:flex;flex-direction:column;gap:var(--s2);border:1px solid var(--line);border-radius:6px;background:var(--bg);--tr-room:500px}
586
+ .tr-card .tr-player{padding:0 var(--s2) var(--s2)}
587
+ .tr-cardbar{display:flex;flex-wrap:wrap;gap:var(--s2);align-items:center;padding:var(--s2) var(--s3) 0}
588
+ .tr-cardshots{display:flex;flex-wrap:wrap;gap:var(--s0);align-items:center}
589
+ .tr-cardgrid{display:grid;grid-template-columns:minmax(0,1fr) 420px;gap:var(--s2);align-items:start}
590
+ .tr-card.wide .tr-rail{margin:0 var(--s2) var(--s2) 0;max-height:calc(100vh - 230px);position:sticky;top:var(--s2)}
591
+ .tr-card:not(.wide) .tr-rail{margin:0;max-height:380px}
592
+ /* a note's lane, its rail row and its rectangle: drafts warm, sent notes the accent */
593
+ .ns-draft{--tone:var(--warn)}
594
+ .ns-sent{--tone:var(--accent)}
595
+ .tr-lanelabel{position:absolute;right:var(--s2);font-size:10px;font-weight:700;color:var(--dim);text-transform:uppercase;pointer-events:none}
596
+ .tr-lanemark{position:absolute;width:22px;height:22px;padding:0;border-radius:11px;border:2px solid var(--bg);background:var(--tone);color:var(--bg);font-size:11px;font-weight:800;line-height:18px;text-align:center;cursor:pointer;z-index:3}
597
+ .tr-lanemark.on{box-shadow:0 0 0 3px color-mix(in srgb,var(--tone) 45%,transparent);transform:scale(1.15)}
598
+ .rv-rect.tr-noterect{border-style:solid;border-width:2px;background:color-mix(in srgb,var(--warn) 6%,transparent)}
599
+ .rv-rect.tr-noterect.was{border-color:var(--accent);background:color-mix(in srgb,var(--accent) 6%,transparent)}
600
+ .rv-rect.tr-noterect.on{border-width:3px;box-shadow:0 0 0 2px var(--hi1),0 0 18px color-mix(in srgb,var(--accent) 45%,transparent)}
601
+ .tr-notelabel{position:absolute;left:-2px;bottom:100%;max-width:min(480px,90vw);padding:0 var(--s2);border-radius:4px 4px 4px 0;background:var(--warn);color:var(--bg);font-size:12.5px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
602
+ .tr-noterect.was .tr-notelabel{background:var(--accent)}
603
+ .tr-notelabel b{margin-right:var(--s1)}
604
+ .tr-rail{display:flex;flex-direction:column;min-height:0;margin:0 var(--s2) var(--s2);border:1px solid var(--line);border-radius:6px;background:var(--panel)}
605
+ .tr-railhead{display:flex;gap:var(--s2);align-items:baseline;padding:var(--s2) var(--s3);border-bottom:1px solid var(--line)}
606
+ .tr-railrows,.tr-verdictrows{display:flex;flex-direction:column;gap:var(--s2);padding:var(--s2);overflow-y:auto;min-height:0}
607
+ .tr-verdictrows{padding:var(--s1) 0;overflow:visible}
608
+ .tr-row{display:grid;grid-template-columns:150px minmax(0,1fr);gap:var(--s2);padding:var(--s2);border:1px solid var(--line);border-radius:6px;background:var(--bg);text-align:left;cursor:pointer;font:inherit;color:inherit}
609
+ .tr-row:hover{border-color:var(--accent)}
610
+ .tr-row.on{border:2px solid var(--accent);background:color-mix(in srgb,var(--accent) 8%,var(--bg))}
611
+ .tr-row.draft{border-style:dashed;border-color:var(--warn)}
612
+ .tr-row.draft.on{border-style:solid}
613
+ .tr-rowstill{position:relative;width:150px;border-radius:4px;background-color:var(--solid);background-size:cover;background-position:center;overflow:hidden}
614
+ .tr-rowrect{position:absolute;border:2px solid var(--accent);box-shadow:0 0 0 1px var(--shadow)}
615
+ .tr-row.draft .tr-rowrect{border-color:var(--warn)}
616
+ .tr-rowbody{display:flex;flex-direction:column;gap:var(--s1);min-width:0}
617
+ .tr-rowmeta{display:flex;gap:var(--s2);align-items:center;flex-wrap:wrap;font-size:12px}
618
+ .tr-rowtext{font-size:13px;line-height:1.4;white-space:pre-wrap;overflow-wrap:anywhere}
619
+ .tr-rowwrite{display:flex;gap:var(--s1);align-items:flex-start}
620
+ .tr-rowwrite textarea{flex:1;min-width:0;font:13px/1.4 system-ui,sans-serif;padding:var(--s1) var(--s2)}
621
+ .tr-rowx{flex:none}
622
+ .tr-notenum{display:inline-block;min-width:20px;padding:0 var(--s1);border-radius:4px;background:var(--accent);color:var(--bg);font-weight:800;font-size:12px;text-align:center}
623
+ .tr-notenum.draft{background:var(--warn)}
624
+ .tr-drafttag{font-size:10px;font-weight:700;text-transform:uppercase;color:var(--warn)}
625
+ .tr-stillrect{position:absolute;border:2px solid var(--accent);pointer-events:none}
495
626
  .tr-shotnotes{position:absolute;top:var(--s2);right:var(--s2);min-width:18px;height:18px;border-radius:9px;background:var(--warn);color:var(--bg);font-size:11px;font-weight:800;text-align:center;line-height:18px;padding:0 var(--s1)}
496
627
  .tr-montage{display:flex;flex-direction:column;gap:var(--s1);align-items:flex-start}
497
628
  .tr-montagebody{width:100%;font-size:12.5px;padding:var(--s2) var(--s3);border:1px solid var(--line);border-radius:4px;background:var(--panel);overflow-x:auto}
@@ -1,8 +1,8 @@
1
1
  // a repo's Communications page (`#page:comms`, wiki tools/shipkit/social.md, The desks in the hub): the calendar on top,
2
- // the drafts on the left (the family, the channel, the identity, the order), the draft picked in the middle (its angle,
2
+ // the drafts on the left (the next release on top, the family, the channel, the identity, the order), the draft picked in the middle (its angle,
3
3
  // his notes, a card a heading), its article and media on the right. On a phone one pane at a time
4
4
  import { observer } from 'mobx-react-lite'
5
- import { Fragment, useEffect, useRef } from 'react'
5
+ import { Fragment, useEffect, useRef, type CSSProperties } from 'react'
6
6
  import { Panel, Separator } from 'react-resizable-panels'
7
7
  import { KeptCols } from '../kept-cols.tsx'
8
8
  import type { RepoSt } from '../repo-st.ts'
@@ -10,11 +10,12 @@ import { PANEL, PhoneTop } from '../review/review-page.tsx'
10
10
  import { SocialCalendar } from './calendar.tsx'
11
11
  import { CopyIcon, ErrorLine, Lightbox, NotesBox, Toast } from './kit.tsx'
12
12
  import { AngleCards, Cards, Logos, MediaTile } from './post-card.tsx'
13
- import { FAM_LABEL, madeOn, posting, STATUS, countsOf, type Draft, type Fam } from './social-model.ts'
13
+ import { FAM_LABEL, kindTone, madeOn, posting, STATUS, countsOf, type Draft, type Fam } from './social-model.ts'
14
14
  import { Problems } from './problems.tsx'
15
15
  import type { SocialSt } from './social-st.ts'
16
- import type { AskedPost } from '../../../review/notes.ts'
17
16
  import { Caret } from '../icons.tsx'
17
+ import { StagePopup } from './stage-popup.tsx'
18
+ import { NextPage, NextSection, NextSide } from './next-release.tsx'
18
19
 
19
20
  export const CommsPage = observer(({ app }: { app: RepoSt }) => {
20
21
  const so = app.social
@@ -36,10 +37,10 @@ export const CommsPage = observer(({ app }: { app: RepoSt }) => {
36
37
  <button className="ghost" onClick={() => so.showPhoneList()}>
37
38
  ◂ drafts
38
39
  </button>
39
- <b className="so-ellip">{so.currentDraft?.title || so.currentDraft?.slug}</b>
40
+ <b className="so-ellip">{so.nextPicked ? 'Next release (unreleased)' : so.currentDraft?.title || so.currentDraft?.slug}</b>
40
41
  </div>
41
42
  <DraftPane so={so} />
42
- <DraftSide so={so} />
43
+ <DraftSide app={app} />
43
44
  </>
44
45
  )}
45
46
  <Lightbox so={so} />
@@ -62,7 +63,7 @@ export const CommsPage = observer(({ app }: { app: RepoSt }) => {
62
63
  <Separator className="rsep" />
63
64
  <Panel id="comms-side" defaultSize="32%" minSize={280} className="rv-pane" style={PANEL}>
64
65
  <div className="rv-scroll so-ground">
65
- <DraftSide so={so} />
66
+ <DraftSide app={app} />
66
67
  </div>
67
68
  </Panel>
68
69
  </KeptCols>
@@ -73,6 +74,8 @@ export const CommsPage = observer(({ app }: { app: RepoSt }) => {
73
74
  })
74
75
 
75
76
  const FAM_CHOICES: (Fam | null)[] = ['feed', 'vertical', null]
77
+ /** the kind select's « every kind »: no kind is a word too, the empty one */
78
+ const EVERY_KIND = '*'
76
79
 
77
80
  /** every draft in the order asked: its day, its title, its platforms (lit once posted there), its count */
78
81
  const DraftsList = observer(({ so }: { so: SocialSt }) => {
@@ -107,6 +110,17 @@ const DraftsList = observer(({ so }: { so: SocialSt }) => {
107
110
  ))}
108
111
  </select>
109
112
  </div>
113
+ <div className="so-selects">
114
+ <select value={so.kindShown ?? EVERY_KIND} onChange={(e) => so.setView({ kind: e.currentTarget.value === EVERY_KIND ? null : e.currentTarget.value })} title="only the drafts of one kind: what a post is for, each kind with its rules page">
115
+ <option value={EVERY_KIND}>every kind</option>
116
+ {so.kindChoices.map((k) => (
117
+ <option key={k.id} value={k.id} title={k.off ? so.kindProblemOf(k.id) : so.kindOf(k.id)?.for}>
118
+ {k.off ? '⚠ ' : ''}
119
+ {k.id || '(no kind)'} · {k.n}
120
+ </option>
121
+ ))}
122
+ </select>
123
+ </div>
110
124
  <div className="so-selects">
111
125
  <button className="ghost" onClick={() => so.foldAll(!so.allFolded)} title={so.allFolded ? 'unfold every series' : 'fold every series'}>
112
126
  {so.allFolded ? '⇕ unfold all' : '⇳ fold all'}
@@ -117,14 +131,12 @@ const DraftsList = observer(({ so }: { so: SocialSt }) => {
117
131
  </div>
118
132
  <span className="rv-count">
119
133
  {drafts.length < t.drafts ? `${drafts.length} of ` : ''}
120
- {t.drafts} drafts · {t.waiting} to post{so.asked.length > 0 ? ` · ${so.asked.length} asked` : ''}
134
+ {t.drafts} drafts · {t.waiting} to post
121
135
  </span>
122
136
  </div>
123
137
  <Problems so={so} lines={[...(so.loadError ? [so.loadError] : []), ...so.errors]} />
124
138
  <div className="rv-listscroll so-rows">
125
- {so.asked.map((a) => (
126
- <AskedRow key={a.id} so={so} a={a} />
127
- ))}
139
+ <NextSection so={so} />
128
140
  {so.desk && so.desk.drafts.length === 0 ? <div className="rv-empty">no draft: write .shipkit/social/drafts/&lt;YYYYMMDD-HHMMSS&gt;-&lt;topic&gt;/draft.md</div> : null}
129
141
  {drafts.map((d) => (
130
142
  <Fragment key={d.slug}>
@@ -139,20 +151,6 @@ const DraftsList = observer(({ so }: { so: SocialSt }) => {
139
151
  )
140
152
  })
141
153
 
142
- const ASKED_STATE: Record<string, string> = { claimed: 'in work', blocked: 'blocked', question: 'a question' }
143
-
144
- /** a post he asked from a review card, no draft yet: a click opens the request on the review page */
145
- const AskedRow = observer(({ so, a }: { so: SocialSt; a: AskedPost }) => (
146
- <button className="so-draftrow so-asked" onClick={() => so.openNote(a.id)} title={`asked from the review card ${a.card}: an agent writes the draft${a.text ? `\n${a.text}` : ''}`}>
147
- <span className="so-day">{madeOn(a.id)}</span>
148
- <span className="so-rowtitle">
149
- 📣 {a.title}
150
- {a.text ? <span className="rv-dim"> · {a.text.split('\n').at(-1)}</span> : null}
151
- </span>
152
- <span className="so-frac">{ASKED_STATE[a.state] ?? 'asked'}</span>
153
- </button>
154
- ))
155
-
156
154
  /** the row picked stays in view, as the arrows walk the list */
157
155
  function useInView(on: boolean) {
158
156
  const ref = useRef<HTMLButtonElement>(null)
@@ -185,6 +183,11 @@ const DraftRow = observer(({ so, d }: { so: SocialSt; d: Draft }) => {
185
183
  ) : null}
186
184
  <span className="so-day">{madeOn(d.slug)}</span>
187
185
  <span className="so-rowtitle">
186
+ {d.kindProblem ? (
187
+ <span className="so-kindwarn" title={d.kindProblem}>
188
+ ⚠
189
+ </span>
190
+ ) : null}
188
191
  {d.article ? <span className="so-art" title="an article: it holds a post.md">▤</span> : null}
189
192
  {d.title || d.slug}
190
193
  </span>
@@ -216,6 +219,7 @@ const PartRow = observer(({ so, d, part }: { so: SocialSt; d: Draft; part: strin
216
219
  })
217
220
 
218
221
  const DraftPane = observer(({ so }: { so: SocialSt }) => {
222
+ if (so.nextPicked && so.next?.preview) return <NextPage so={so} p={so.next.preview} />
219
223
  const d = so.currentDraft
220
224
  if (!d) return <div className="rv-empty">{so.desk ? 'no draft here: the list keeps none' : so.loadError ?? so.waitText}</div>
221
225
  return <DraftPage so={so} d={d} />
@@ -238,7 +242,9 @@ const DraftPage = observer(({ so, d }: { so: SocialSt; d: Draft }) => {
238
242
  </h2>
239
243
  <span className={`so-badge ${all ? 't-ok' : d.status === 'picked' ? 't-warn' : 't-dim'}`}>{all ? 'posted everywhere' : `${STATUS[d.status] ?? d.status} · ${c.posted}/${c.of}`}</span>
240
244
  </div>
245
+ {d.kindProblem ? <div className="so-kindproblem">⚠ {d.kindProblem}</div> : null}
241
246
  <div className="so-meta">
247
+ <KindLink so={so} d={d} />
242
248
  {speaker ? (
243
249
  <span className={`so-who${d.identity !== so.desk?.speaksAs ? '' : ' own'}`} title="the identity that speaks it">
244
250
  {speaker.name}
@@ -246,10 +252,23 @@ const DraftPage = observer(({ so, d }: { so: SocialSt; d: Draft }) => {
246
252
  ) : null}
247
253
  <a href={so.editorUrl(d.path)}>open in VS Code ({d.file}) ↗</a>
248
254
  {d.review ? (
249
- <button className="so-linkbtn" title={`the review card it was asked from: ${d.review}`} onClick={() => so.openNote(d.review as string)}>
250
- 📣 from its review card
255
+ <button className="so-linkbtn" title={`the review card it was staged from: ${d.review}`} onClick={() => so.openNote(d.review as string)}>
256
+ 📤 from its review card
257
+ </button>
258
+ ) : null}
259
+ {d.release ? <span className="so-badge t-dim" title="the release it was staged from">🔼 {d.release}</span> : null}
260
+ {d.release ? (
261
+ <button className="so-linkbtn" title="pick its media among the approved cards this release ships" onClick={() => so.openStage(d.slug)}>
262
+ 📤 {d.media.length > 0 ? 'another media' : 'add a media'}
251
263
  </button>
252
264
  ) : null}
265
+ {so.stage ? <StagePopup st={so.stage} url={(p) => so.url(p)} close={() => so.closeStage()} /> : null}
266
+ {d.rating !== 'safe' ? <span className="so-badge t-warn" title="what it shows: each place takes it or not">🔞 {d.rating}</span> : null}
267
+ {d.skipped.map((k) => (
268
+ <span key={k.account} className="so-badge t-dim" title={k.why}>
269
+ skips {k.account}
270
+ </span>
271
+ ))}
253
272
  </div>
254
273
  {d.angle ? <AngleCards key={d.slug} angle={d.angle} /> : null}
255
274
  <NotesBox so={so} notes={so.notes[d.slug] ?? []} placeholder="a note on this draft: it goes to the review page, an agent takes it" send={(text) => so.sendNote(d, text)} />
@@ -272,7 +291,25 @@ const DraftPage = observer(({ so, d }: { so: SocialSt; d: Draft }) => {
272
291
  )
273
292
  })
274
293
 
275
- const DraftSide = observer(({ so }: { so: SocialSt }) => {
294
+ /** the draft's kind, a link to its rules page in VS Code, named by that page's title; a word off the set, by itself */
295
+ const KindLink = observer(({ so, d }: { so: SocialSt; d: Draft }) => {
296
+ const k = so.kindOf(d.kind)
297
+ if (k == null) return null
298
+ const label = `${k.id}: ${k.title ?? k.for}`
299
+ return k.page ? (
300
+ <a className="so-kind" style={{ '--kt': kindTone(k.id) } as CSSProperties} href={so.editorUrl(k.page)} title={`the rules of a ${k.id} post, read before its first word: ${k.page}`}>
301
+ {label} ↗
302
+ </a>
303
+ ) : (
304
+ <span className="so-kind" style={{ '--kt': kindTone(k.id) } as CSSProperties} title="its rules page is not on this machine">
305
+ {label}
306
+ </span>
307
+ )
308
+ })
309
+
310
+ const DraftSide = observer(({ app }: { app: RepoSt }) => {
311
+ const so = app.social
312
+ if (so.nextPicked && so.next?.preview) return <NextSide rs={app.releases} p={so.next.preview} />
276
313
  const d = so.currentDraft
277
314
  return d ? <DraftMedia so={so} d={d} /> : null
278
315
  })
@@ -1,12 +1,14 @@
1
1
  // an identity's pictures as the hub shows them (wiki tools/shipkit/social-identities.md, Identities): what a picture's
2
2
  // name says (`avatar-<name>[-round]`, `banner-<venue>-<rating>-<variant>`), the banners by venue, which account's row
3
3
  // names each one, the rows of an account's rating. Pure, no browser
4
+ import { otherRating, RATINGS, ratingIn } from '../../../identities/rating.ts'
5
+ import { stepRefs } from '../../../identities/steps.ts'
4
6
  import { fileName, type DeskAccount, type DeskIdentity, type Picture, type Row } from './social-model.ts'
5
7
 
6
- export const RATINGS: readonly string[] = ['sfw', 'nsfw']
8
+ export { otherRating, RATINGS }
7
9
 
8
10
  /** the picture a path names, by its shown file or one of its other formats */
9
- export const pictureOf = (i: DeskIdentity, file: string): Picture => i.pictures.find((p) => p.file === file || p.also.includes(file)) ?? { file, w: null, h: null, also: [] }
11
+ export const pictureOf = (i: DeskIdentity, file: string): Picture => i.pictures.find((p) => p.file === file || p.also.includes(file)) ?? { file, w: null, h: null, also: [], v: {} }
10
12
 
11
13
  /** a row's pictures, one each however many of its formats the row names */
12
14
  export function rowPictures(i: DeskIdentity, files: readonly string[]): Picture[] {
@@ -55,20 +57,56 @@ export function bannerGroups(i: DeskIdentity): { venue: string; title: string; p
55
57
  }
56
58
 
57
59
  /** an account's own rows: the ones the identity's profile does not give it as they are */
58
- const ownRows = (i: DeskIdentity, a: DeskAccount): Row[] => a.rows.filter((r) => !i.rows.some((s) => s.field === r.field && s.value === r.value))
60
+ const ownRows = (i: Pick<DeskIdentity, 'rows'>, a: Pick<DeskAccount, 'rows'>): Row[] => a.rows.filter((r) => !i.rows.some((s) => s.field === r.field && s.value === r.value))
61
+
62
+ /** an account's text rows outside its form: with a setup, its own rows no step names (an identity row it inherits and
63
+ * no step names is the identity's profile, never every account's); with none, its whole profile; its picture rows are
64
+ * « Upload here », but with no identity to show them */
65
+ export function otherRows(i: Pick<DeskIdentity, 'rows'> | null, a: Pick<DeskAccount, 'rows' | 'steps'>): Row[] {
66
+ const named = stepRefs(a.steps)
67
+ const pool = i == null || named.size === 0 ? a.rows : ownRows(i, a)
68
+ return pool.filter((r) => (i == null || r.files.length === 0) && !named.has(r.field))
69
+ }
59
70
 
60
71
  /** every account whose own row names the picture: « X banner », « Discord icon » */
61
72
  export const usedBy = (i: DeskIdentity, p: Picture): string[] =>
62
73
  i.accounts.flatMap((a) => ownRows(i, a).filter((r) => r.files.some((f) => f === p.file || p.also.includes(f))).map((r) => `${a.name} ${r.field}`))
63
74
 
64
75
  /** the account's `rating` row, its first word: `sfw`, `nsfw`, or '' when it names none */
65
- export const ratingOf = (a: DeskAccount): string => (a.rows.find((r) => r.field === 'rating')?.value.trim().split(/\s/)[0] ?? '').toLowerCase()
76
+ export const ratingOf = (a: DeskAccount): string => ratingIn(a.rows)
77
+
78
+ export type Upload = DeskAccount['uploads'][number]
79
+
80
+ /** the account's picture row of that field, with what it shows; null for a row that names no picture */
81
+ export const uploadOf = (a: DeskAccount, field: string): Upload | null => a.uploads.find((u) => u.field === field && u.kind === 'picture') ?? null
82
+
83
+ /** the account's text row of that field he pastes, with what it shows; null for a row it does not track */
84
+ export const pasteOf = (a: DeskAccount, field: string): Upload | null => a.uploads.find((u) => u.field === field && u.kind === 'text') ?? null
66
85
 
67
- /** a row for the other rating, `avatar nsfw` on an sfw account: not this venue's */
68
- export function otherRating(field: string, rating: string): boolean {
69
- const last = field.trim().split(/\s+/).pop() ?? ''
70
- return rating !== '' && RATINGS.includes(last) && last !== rating
86
+ /** a text row's state: `pasted` as it is now, `changed` since it was pasted, `unknown` until « Done, pasted » */
87
+ export const pasteState = (u: Upload): 'pasted' | 'changed' | 'unknown' => (u.shown == null ? 'unknown' : u.stale ? 'changed' : 'pasted')
88
+
89
+ /** the list row's badge: « avatar to update », « 3 pictures to update », « 2 texts to paste again », « 3 rows to
90
+ * update »; null when it shows every row as it is now, or while the account is still to create (its setup steps carry
91
+ * them) */
92
+ export function staleBadge(a: DeskAccount): string | null {
93
+ const stale = a.uploads.filter((u) => u.stale)
94
+ if (a.live === '' || stale.length === 0) return null
95
+ if (stale.length === 1) return `${stale[0]!.field} to ${stale[0]!.kind === 'text' ? 'paste again' : 'update'}`
96
+ const texts = stale.filter((u) => u.kind === 'text').length
97
+ return texts === 0 ? `${stale.length} pictures to update` : texts === stale.length ? `${texts} texts to paste again` : `${stale.length} rows to update`
98
+ }
99
+
100
+ /** what a stale row says under its headline: what the account shows, and who sets it */
101
+ export function staleWhy(a: DeskAccount, u: Upload): string {
102
+ if (u.kind === 'text') return `pasted on ${u.shown?.on ?? '?'}, its text changed since; copy it, paste it on ${a.name}, then click « Done, pasted »`
103
+ const shows = u.shown == null ? 'nothing records what it shows' : `it shows ${fileName(u.shown.file)} as of ${u.shown.on}, a picture since changed`
104
+ const who = u.by == null ? 'upload it there, then click « Done, uploaded » under it' : `the ${u.by === 'discord' ? 'bot' : 'api'} sets it: sk identities push ${a.identity}`
105
+ return `${shows}; ${who}`
71
106
  }
72
107
 
108
+ /** the file of the row the account shows as it is now, null when stale */
109
+ export const shownFile = (u: Upload): string | null => (u.stale || u.shown == null ? null : (u.files[u.shas.indexOf(u.shown.sha)] ?? null))
110
+
73
111
  /** a row's value is more than its paths: a note to show under its pictures */
74
112
  export const hasNote = (r: Row): boolean => r.value.replace(/,/g, ' ').split(/\s+/).filter(Boolean).join(' ') !== r.files.join(' ')
@@ -96,14 +96,15 @@ export function Field(p: { label: string; note?: ReactNode; children: ReactNode
96
96
  )
97
97
  }
98
98
 
99
- /** words he pastes, in a clear frame, « Copy » in its corner (and « Edit » where the text is his to change) */
100
- export const CopyFrame = observer((p: { so: SocialSt; text: string; k: string; title?: boolean; onEdit?: () => void; copy?: string }) => {
99
+ /** words he pastes, in a clear frame, « Copy » in its corner (and « Edit » where the text is his to change); `refused`
100
+ * greys « Copy » with the reason, so a text the repo's guard or a place refuses never reaches the clipboard */
101
+ export const CopyFrame = observer((p: { so: SocialSt; text: string; k: string; title?: boolean; onEdit?: () => void; copy?: string; refused?: string }) => {
101
102
  const done = p.so.copiedKey === p.k
102
103
  return (
103
104
  <div className={`so-copyframe${p.onEdit ? ' tall' : ''}`}>
104
105
  <div className={`so-copytext rv-pre${p.title ? ' strong' : ''}`}>{p.text}</div>
105
106
  <div className="so-corner">
106
- <button className={done ? 'so-done' : ''} onClick={() => void p.so.copy(p.copy ?? p.text, p.k)}>
107
+ <button className={done ? 'so-done' : ''} disabled={!!p.refused} title={p.refused || undefined} onClick={() => void p.so.copy(p.copy ?? p.text, p.k)}>
107
108
  {done ? '✓ Copied' : '⧉ Copy'}
108
109
  </button>
109
110
  {p.onEdit ? (
@@ -123,9 +124,10 @@ export const CopyIcon = observer((p: { so: SocialSt; text: string; k: string; ti
123
124
  </button>
124
125
  ))
125
126
 
126
- /** one row of a flush card: its field, its value with « copy » */
127
- export const CopyRow = observer((p: { so: SocialSt; k: string; field: string; value: string; children?: ReactNode }) => (
128
- <div className="so-row">
127
+ /** one row of a flush card: its field, its value with « copy », then its foot (a text row's « Done, pasted »); `tone`
128
+ * marks the whole row */
129
+ export const CopyRow = observer((p: { so: SocialSt; k: string; field: string; value: string; children?: ReactNode; foot?: ReactNode; tone?: string }) => (
130
+ <div className={`so-row${p.tone ? ` so-rowtone t-${p.tone}` : ''}`}>
129
131
  <span className="so-rowfield">{p.field}</span>
130
132
  {p.children ?? (
131
133
  <>
@@ -133,6 +135,7 @@ export const CopyRow = observer((p: { so: SocialSt; k: string; field: string; va
133
135
  <CopyIcon so={p.so} text={p.value} k={p.k} title={`copy ${p.field}`} />
134
136
  </>
135
137
  )}
138
+ {p.foot}
136
139
  </div>
137
140
  ))
138
141
 
@@ -0,0 +1,118 @@
1
+ // the next release in Communications (wiki tools/shipkit/social-desks.md, The next release): a foldable section on top
2
+ // of the list, the draft a release would stage from next.md in the middle, next.md's changes on the right. Never a
3
+ // draft: nothing here posts, copies or opens, and its words are the stage's own (release-stage.ts previewNextRelease)
4
+ import { observer } from 'mobx-react-lite'
5
+ import { ChangeCard } from '../releases/releases-page.tsx'
6
+ import type { ReleasesSt } from '../releases/releases-st.ts'
7
+ import { Caret } from '../icons.tsx'
8
+ import { Count, Logo } from './kit.tsx'
9
+ import { AngleCards, Logos } from './post-card.tsx'
10
+ import { NEXT_PICK, sharing, type Send } from './social-model.ts'
11
+ import type { SocialSt } from './social-st.ts'
12
+ import type { NextRelease } from '../../../social/release-stage.ts'
13
+
14
+ const changesIn = (p: NextRelease): number => p.release.categories.reduce((n, c) => n + c.changes.length, 0)
15
+ const titleOf = (p: NextRelease): string => p.draft?.title || (p.release.title ? `next: ${p.release.title}` : 'next')
16
+
17
+ /** the list's section: its fold, then one row, the release as it would be staged */
18
+ export const NextSection = observer(({ so }: { so: SocialSt }) => {
19
+ const view = so.next
20
+ if (view == null || (view.preview == null && view.error == null)) return null
21
+ const p = view.preview
22
+ return (
23
+ <div className="so-nextsec">
24
+ <button className="so-nexthead" onClick={() => so.flipFold(NEXT_PICK, true)} title="the release being filled, .shipkit/releases/next.md: a draft is staged from it when the release is cut">
25
+ <Caret open={so.nextOpen} />
26
+ <span className="so-ellip">Next release (unreleased)</span>
27
+ </button>
28
+ {so.nextOpen && view.error ? <div className="so-kindproblem">⚠ next.md: {view.error}</div> : null}
29
+ {so.nextOpen && p ? (
30
+ <button className={`so-draftrow so-nextrow${so.nextPicked ? ' on' : ''}`} onClick={() => so.pickDraft(NEXT_PICK)} title="not staged: nothing to post until the release is cut">
31
+ <span className="so-day">next</span>
32
+ <span className="so-rowtitle">{titleOf(p)}</span>
33
+ {p.draft ? <Logos so={so} posts={p.draft.posts} size={14} /> : null}
34
+ <span className="so-frac" title="the changes of next.md">
35
+ {changesIn(p)}
36
+ </span>
37
+ </button>
38
+ ) : null}
39
+ </div>
40
+ )
41
+ })
42
+
43
+ /** the middle: the draft a release would stage, each heading's text as each venue gets it, nothing to click */
44
+ export const NextPage = observer(({ so, p }: { so: SocialSt; p: NextRelease }) => (
45
+ <div className="so-colin">
46
+ <div className="so-pagehead">
47
+ <h2 className="so-h">
48
+ {titleOf(p)}
49
+ <span className="rv-dim so-light"> · release</span>
50
+ </h2>
51
+ <span className="so-badge t-warn">unreleased · not staged</span>
52
+ </div>
53
+ <div className="so-nextnote">
54
+ The release being filled, as it would be staged now from <code>.shipkit/releases/next.md</code>: {changesIn(p)} changes. Nothing here posts: the real draft appears in this list when the release is cut, with its polish note.
55
+ </div>
56
+ {p.release.title === '' ? (
57
+ <div className="so-kindproblem">
58
+ ⚠ next.md names no title, so the post is titled « {p.ref.split('@')[0]} &lt;version&gt; »: <code>sk releases add --release-title "…"</code> names it
59
+ </div>
60
+ ) : null}
61
+ {p.errors.map((e) => (
62
+ <div key={e} className="so-kindproblem">
63
+ ⚠ {e}
64
+ </div>
65
+ ))}
66
+ {p.draft ? (
67
+ <>
68
+ <AngleCards key={p.ref} angle={p.draft.angle} />
69
+ {sharing(p.draft.posts, (x) => so.postAccount(x)).map((sends) => (
70
+ <PreviewCard key={sends[0]?.post.from} so={so} sends={sends} />
71
+ ))}
72
+ </>
73
+ ) : (
74
+ <div className="rv-dim rv-small">no post: the repo's social unit declares no release headings, so a release stages nothing</div>
75
+ )}
76
+ </div>
77
+ ))
78
+
79
+ /** one heading's text for its accounts, read only: their logos, where each goes, the text, its length against each max */
80
+ const PreviewCard = observer(({ so, sends }: { so: SocialSt; sends: readonly Send[] }) => {
81
+ const first = sends[0]
82
+ if (!first) return null
83
+ return (
84
+ <div className="so-card so-post so-preview">
85
+ <div className="so-posthead">
86
+ <span className="so-logos">
87
+ {sends.map(({ a }) => (
88
+ <Logo key={a.id} id={a.id} name={a.name} size={24} muted />
89
+ ))}
90
+ </span>
91
+ <span className="so-posttitle">
92
+ <b>{sends.map(({ a, post }) => (post.place ? `${a.name} → ${so.placeName(a, post.place)}` : a.name)).join(' · ')}</b>
93
+ </span>
94
+ <span className="so-badge t-dim">preview</span>
95
+ </div>
96
+ <div className="so-nexttext">{first.post.text}</div>
97
+ <div className="so-postfoot">
98
+ {sends.map(({ a, post }) => (
99
+ <Count key={a.id} n={post.length} max={a.max} title={`its length on ${a.name}`} />
100
+ ))}
101
+ </div>
102
+ </div>
103
+ )
104
+ })
105
+
106
+ /** the right: next.md's changes as the Releases page draws them, pictures through the hub */
107
+ export const NextSide = observer(({ rs, p }: { rs: ReleasesSt; p: NextRelease }) => (
108
+ <div className="so-colin">
109
+ {p.release.categories.map((c) => (
110
+ <div key={c.name} className="so-nextcat">
111
+ <b>{c.name}</b>
112
+ {c.changes.map((ch) => (
113
+ <ChangeCard key={`${ch.card ?? ''}${ch.title}`} rs={rs} ch={ch} />
114
+ ))}
115
+ </div>
116
+ ))}
117
+ </div>
118
+ ))