rvlib-shipkit 2.18.0 → 2.20.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 (186) hide show
  1. package/CHANGELOG.md +31 -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/asks/asks-queue.ts +63 -10
  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_Asks.ts +3 -1
  11. package/src/cli/cmd_Commands.ts +4 -1
  12. package/src/cli/cmd_GlobalProcesses.ts +34 -11
  13. package/src/cli/cmd_Home.ts +41 -4
  14. package/src/cli/cmd_Messages.ts +155 -0
  15. package/src/cli/cmd_Releases.ts +48 -0
  16. package/src/cli/cmd_Review.ts +161 -6
  17. package/src/cli/cmd_Secret.ts +4 -30
  18. package/src/cli/cmd_Shot.ts +4 -4
  19. package/src/cli/cmd_Social.ts +179 -3
  20. package/src/cli/cmd_Trailer.ts +15 -3
  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 +8 -2
  25. package/src/collections/actions.ts +29 -1
  26. package/src/collections/collection-types.ts +10 -1
  27. package/src/collections/providers.ts +5 -2
  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 +5 -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 +302 -5
  41. package/src/home/gui-app.ts +63 -33
  42. package/src/home/hmr-keep.ts +134 -0
  43. package/src/home/home-paths.ts +5 -1
  44. package/src/home/home-start.ts +14 -14
  45. package/src/home/lib-watch.ts +21 -11
  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-daemon.ts +11 -2
  50. package/src/home/run-pm.ts +9 -1
  51. package/src/home/run-web.ts +7 -4
  52. package/src/home/serve-web.ts +64 -14
  53. package/src/home/supervise.ts +3 -1
  54. package/src/identities/collection.ts +49 -0
  55. package/src/identities/identities.ts +130 -11
  56. package/src/identities/machine.ts +4 -3
  57. package/src/identities/rating.ts +33 -0
  58. package/src/identities/shown.ts +170 -0
  59. package/src/identities/steps.ts +5 -0
  60. package/src/media-store/purge.ts +15 -1
  61. package/src/media-store/remote.ts +22 -6
  62. package/src/messages/brief.ts +117 -0
  63. package/src/messages/collection.ts +40 -0
  64. package/src/messages/model.ts +171 -0
  65. package/src/messages/routes.ts +15 -0
  66. package/src/messages/score.ts +180 -0
  67. package/src/messages/tabs.ts +13 -0
  68. package/src/release/notes.ts +130 -0
  69. package/src/release/run-bump.ts +41 -18
  70. package/src/release/run-release.ts +22 -4
  71. package/src/release/run-releases.ts +17 -15
  72. package/src/release/unit-resolve.ts +9 -0
  73. package/src/releases/add.ts +66 -0
  74. package/src/releases/collection.ts +36 -0
  75. package/src/releases/from-card.ts +66 -0
  76. package/src/releases/model.ts +267 -0
  77. package/src/releases/pictures.ts +89 -0
  78. package/src/releases/routes.ts +36 -0
  79. package/src/releases/store.ts +71 -0
  80. package/src/repo-config.ts +5 -0
  81. package/src/review/cells.ts +0 -11
  82. package/src/review/format.ts +10 -6
  83. package/src/review/http.ts +7 -2
  84. package/src/review/model.ts +92 -3
  85. package/src/review/notes.ts +2 -48
  86. package/src/review/routes.ts +28 -10
  87. package/src/review/stage-card.ts +197 -0
  88. package/src/review/stage-routes.ts +123 -0
  89. package/src/review/store.ts +117 -19
  90. package/src/review/trailer-card.ts +99 -0
  91. package/src/review/trailer-desk.ts +57 -4
  92. package/src/review/trailer-model.ts +41 -7
  93. package/src/review/trailer-notes.ts +45 -0
  94. package/src/review/trailer-routes.ts +22 -13
  95. package/src/secrets/manager.ts +59 -0
  96. package/src/secrets/name.ts +2 -0
  97. package/src/serve/hub-app/app-bridge.ts +71 -0
  98. package/src/serve/hub-app/col-card.tsx +10 -0
  99. package/src/serve/hub-app/cols-svc.ts +37 -6
  100. package/src/serve/hub-app/commands/commands-page.tsx +122 -0
  101. package/src/serve/hub-app/commands/commands-st.ts +177 -0
  102. package/src/serve/hub-app/commands.css +24 -0
  103. package/src/serve/hub-app/hash-route.ts +40 -1
  104. package/src/serve/hub-app/home-st.ts +11 -2
  105. package/src/serve/hub-app/home.html +3 -0
  106. package/src/serve/hub-app/hub-app.tsx +6 -0
  107. package/src/serve/hub-app/hub.css +1 -0
  108. package/src/serve/hub-app/icons.tsx +5 -0
  109. package/src/serve/hub-app/identities-view.tsx +4 -1
  110. package/src/serve/hub-app/identities.css +1 -0
  111. package/src/serve/hub-app/index.html +3 -0
  112. package/src/serve/hub-app/keys.ts +2 -2
  113. package/src/serve/hub-app/machine-st.ts +41 -10
  114. package/src/serve/hub-app/messages/messages-page.tsx +354 -0
  115. package/src/serve/hub-app/messages/messages-st.ts +74 -0
  116. package/src/serve/hub-app/messages.css +35 -0
  117. package/src/serve/hub-app/releases/releases-page.tsx +94 -0
  118. package/src/serve/hub-app/releases/releases-st.ts +69 -0
  119. package/src/serve/hub-app/releases.css +25 -0
  120. package/src/serve/hub-app/repo-sections.ts +15 -1
  121. package/src/serve/hub-app/repo-st.ts +56 -5
  122. package/src/serve/hub-app/review/clip-st.ts +31 -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 +62 -31
  131. package/src/serve/hub-app/review/trailer-st.ts +138 -26
  132. package/src/serve/hub-app/review/trailer-timeline.tsx +39 -26
  133. package/src/serve/hub-app/review.css +49 -6
  134. package/src/serve/hub-app/social/comms-page.tsx +55 -23
  135. package/src/serve/hub-app/social/identity-pictures.ts +112 -0
  136. package/src/serve/hub-app/social/kit.tsx +9 -6
  137. package/src/serve/hub-app/social/post-card.tsx +10 -2
  138. package/src/serve/hub-app/social/social-model.ts +37 -3
  139. package/src/serve/hub-app/social/social-page.tsx +236 -82
  140. package/src/serve/hub-app/social/social-st.ts +79 -26
  141. package/src/serve/hub-app/social/stage-popup.tsx +268 -0
  142. package/src/serve/hub-app/social/stage-st.ts +310 -0
  143. package/src/serve/hub-app/social/step-layout.ts +42 -0
  144. package/src/serve/hub-app/social.css +68 -4
  145. package/src/serve/hub-app/tree-build.ts +38 -1
  146. package/src/serve/hub-app/tree-svc.ts +10 -3
  147. package/src/serve/project-gutter-route.ts +4 -2
  148. package/src/serve/same-origin.ts +24 -1
  149. package/src/serve/serve-hub.ts +27 -3
  150. package/src/shipkit-files.ts +9 -7
  151. package/src/shot/shooter.ts +3 -3
  152. package/src/shot/shot-ask.ts +14 -3
  153. package/src/shot/shot.shipkit.ts +1 -1
  154. package/src/social/discord-layout.ts +282 -0
  155. package/src/social/fit.ts +84 -0
  156. package/src/social/identity-words.ts +74 -0
  157. package/src/social/kind-pages.ts +41 -0
  158. package/src/social/kinds.ts +92 -0
  159. package/src/social/load.ts +105 -9
  160. package/src/social/md.ts +14 -6
  161. package/src/social/media-limit.ts +63 -2
  162. package/src/social/presence.ts +1 -1
  163. package/src/social/publish/bluesky.ts +58 -19
  164. package/src/social/publish/discord.ts +3 -2
  165. package/src/social/publish/index.ts +31 -5
  166. package/src/social/reach.ts +49 -0
  167. package/src/social/release-stage.ts +173 -0
  168. package/src/social/routes.ts +44 -9
  169. package/src/social/stage.ts +227 -0
  170. package/src/social/strip.ts +85 -0
  171. package/src/social/text.ts +6 -2
  172. package/src/social/unit.ts +57 -1
  173. package/src/social/writes.ts +11 -0
  174. package/src/stores/routes.ts +2 -2
  175. package/src/suite/judge-suites.ts +1 -1
  176. package/src/suite/suite-cli.ts +5 -5
  177. package/src/trailer/build.ts +90 -52
  178. package/src/trailer/draft.ts +28 -0
  179. package/src/trailer/footage.ts +4 -2
  180. package/src/trailer/grammar.ts +25 -13
  181. package/src/trailer/graph.ts +32 -9
  182. package/src/trailer/profile.ts +35 -0
  183. package/src/trailer/prune.ts +15 -10
  184. package/src/trailer/public-words.ts +41 -0
  185. package/src/trailer/stitch.ts +22 -10
  186. package/src/trailer/titles.ts +47 -2
@@ -1,17 +1,25 @@
1
- // the trailer page's timeline: the sections, the shots, the captions and the notes of the render on screen, a
2
- // playhead, a click or a drag to seek, a hover with the shot's frame from the contact strip; then every shot as a card
1
+ // the trailer page's timeline: the sections, the shots, the captions and the notes lane of the render on screen (a
2
+ // card's notes or the page's frame notes, one marker each at its time), a playhead, a click or a drag to seek, a hover
3
+ // with the shot's frame from the contact strip; then every shot as a card
3
4
  import { observer } from 'mobx-react-lite'
4
5
  import { useEffect, useRef, useState, type CSSProperties, type RefObject } from 'react'
5
- import { clock, shotAt, type ShotSpan, type Timeline } from '../../../review/trailer-model.ts'
6
- import { captionText, type PlacedNote, type TrailerSt } from './trailer-st.ts'
6
+ import { clock, shotAt, type LaneMark, type ShotSpan, type Timeline } from '../../../review/trailer-model.ts'
7
+ import { captionText, type TrailerSt } from './trailer-st.ts'
7
8
 
8
9
  const RULER = 18
9
10
  const SECTIONS = 22
10
11
  const SHOTS = 46
11
12
  const CAPTIONS = 22
13
+ const NOTES = 26
12
14
  const GAP = 3
13
- const HEIGHT = RULER + SECTIONS + SHOTS + CAPTIONS + GAP * 3
14
- const ROW = { ruler: 0, sections: RULER + GAP, shots: RULER + SECTIONS + GAP * 2, captions: RULER + SECTIONS + SHOTS + GAP * 3 }
15
+ const HEIGHT = RULER + SECTIONS + SHOTS + CAPTIONS + NOTES + GAP * 4
16
+ const ROW = { ruler: 0, sections: RULER + GAP, shots: RULER + SECTIONS + GAP * 2, captions: RULER + SECTIONS + SHOTS + GAP * 3, notes: RULER + SECTIONS + SHOTS + CAPTIONS + GAP * 4 }
17
+
18
+ /** the hover card's height: it shows under the timeline when this much room is left there */
19
+ const HOVER_H = 180
20
+
21
+ /** a length in seconds as the page writes it: `2.6 s`, `0.55 s` */
22
+ export const secsOf = (s: number): string => `${Number(s.toFixed(s < 1 ? 2 : 1))} s`
15
23
 
16
24
  /** a section's hue, one of the page's kind hues by its order: the shot blocks of a section share it */
17
25
  export const hueOf = (tl: Timeline, section: string | null): string => {
@@ -107,7 +115,7 @@ export const TrailerTimeline = observer(({ st }: { st: TrailerSt }) => {
107
115
  {s.name}
108
116
  </div>
109
117
  ))}
110
- {tl.shots.map((s, i) => <ShotBlock key={`${s.name}@${i}`} s={s} i={i} x={xOf(s.start)} w={xOf(s.end) - xOf(s.start)} on={cur === s} hue={hueOf(tl, s.section)} />)}
118
+ {tl.shots.map((s, i) => <ShotBlock key={`${s.name}@${i}`} s={s} i={i} x={xOf(s.start)} w={xOf(s.end) - xOf(s.start)} on={cur === s} hue={hueOf(tl, s.section)} changed={st.changed.has(s.name)} />)}
111
119
  {tl.shots.flatMap((s) =>
112
120
  s.captions.map((c, j) => (
113
121
  <div key={`${s.name}-${j}`} className={`tr-caption${lit.has(`${c.start}|${c.text}`) ? ' on' : ''}`} title={captionText(c)}
@@ -116,7 +124,8 @@ export const TrailerTimeline = observer(({ st }: { st: TrailerSt }) => {
116
124
  </div>
117
125
  )),
118
126
  )}
119
- {st.here.map((n) => <NotePin key={n.note.id} st={st} n={n} x={xOf(n.at ?? 0)} />)}
127
+ <div className="tr-lanelabel" style={{ top: ROW.notes, height: NOTES, lineHeight: `${NOTES}px` }}>notes</div>
128
+ {st.lane.map((m) => <LaneMarker key={m.key} m={m} x={xOf(m.at)} />)}
120
129
  {st.draft ? <div className="tr-draftmark" style={{ left: xOf(st.draft.time) - 1, height: HEIGHT }} /> : null}
121
130
  <Playhead st={st} W={W} total={tl.total} scroller={scroller} />
122
131
  </div>
@@ -126,24 +135,24 @@ export const TrailerTimeline = observer(({ st }: { st: TrailerSt }) => {
126
135
  )
127
136
  })
128
137
 
129
- const ShotBlock = ({ s, i, x, w, on, hue }: { s: ShotSpan; i: number; x: number; w: number; on: boolean; hue: string }) => (
130
- <div className={`tr-shot ${hue}${on ? ' on' : ''}${i % 2 ? ' odd' : ''}`} title={`${s.name} · ${clock(s.start)} · ${s.length} s`}
138
+ const ShotBlock = ({ s, i, x, w, on, hue, changed }: { s: ShotSpan; i: number; x: number; w: number; on: boolean; hue: string; changed: boolean }) => (
139
+ <div className={`tr-shot ${hue}${on ? ' on' : ''}${i % 2 ? ' odd' : ''}${changed ? ' changed' : ''}`} title={`${s.name} · ${clock(s.start)} · ${secsOf(s.length)}${changed ? ' · changed' : ''}`}
131
140
  style={{ left: x + 0.5, width: Math.max(1, w - 1), top: ROW.shots, height: SHOTS }}>
132
141
  {w > 26 ? s.name : ''}
133
142
  {w > 44 ? <div className="tr-shottime">{clock(s.start)}</div> : null}
134
143
  </div>
135
144
  )
136
145
 
137
- const NotePin = observer(({ st, n, x }: { st: TrailerSt; n: PlacedNote; x: number }) => {
138
- const on = st.selected === n.note.id
139
- return (
140
- <>
141
- <div className={`tr-noteline ns-${n.note.state}${on ? ' on' : ''}`} style={{ left: x, top: ROW.sections, height: HEIGHT - ROW.sections }} />
142
- <div data-note className={`tr-notepin ns-${n.note.state}${on ? ' on' : ''}`} title={`#${n.note.n} · ${n.note.text}`} style={{ left: x - 8 }}
143
- onPointerDown={(e) => e.stopPropagation()} onClick={() => st.goTo(n)} />
144
- </>
145
- )
146
- })
146
+ /** one note on the lane, numbered in the order of the cut: a click lands on its frame */
147
+ const LaneMarker = ({ m, x }: { m: LaneMark; x: number }) => (
148
+ <>
149
+ <div className={`tr-noteline ns-${m.tone}${m.selected ? ' on' : ''}`} style={{ left: x, top: ROW.sections, height: ROW.notes - ROW.sections }} />
150
+ <button type="button" data-note className={`tr-lanemark ns-${m.tone}${m.selected ? ' on' : ''}`} title={`${m.n} · ${clock(m.at)} · ${m.text}`} style={{ left: Math.max(0, x - 11), top: ROW.notes + 2 }}
151
+ onPointerDown={(e) => e.stopPropagation()} onMouseDown={(e) => e.preventDefault()} onClick={() => m.go()}>
152
+ {m.n}
153
+ </button>
154
+ </>
155
+ )
147
156
 
148
157
  /** the playhead; while it plays, the timeline scrolls to keep it in view */
149
158
  const Playhead = observer(({ st, W, total, scroller }: { st: TrailerSt; W: number; total: number; scroller: RefObject<HTMLDivElement | null> }) => {
@@ -163,12 +172,15 @@ const HoverCard = observer(({ st, t, x, scroller }: { st: TrailerSt; t: number;
163
172
  const s = shotAt(tl, t)
164
173
  if (!s) return null
165
174
  const i = tl.shots.indexOf(s)
166
- const top = scroller.current?.getBoundingClientRect().top ?? 0
175
+ const b = scroller.current?.getBoundingClientRect()
176
+ // under the timeline when it fits there, so it never covers the frame or the card's header
177
+ const under = b ? window.innerHeight - b.bottom > HOVER_H : false
178
+ const place = under ? { top: (b?.bottom ?? 0) + 8 } : { bottom: window.innerHeight - ((b?.top ?? 0) - 8) }
167
179
  return (
168
- <div className="tr-hover" style={{ left: Math.max(8, Math.min(window.innerWidth - 216, x - 104)), bottom: window.innerHeight - (top - 8) }}>
180
+ <div className="tr-hover" style={{ left: Math.max(8, Math.min(window.innerWidth - 216, x - 104)), ...place }}>
169
181
  <Thumb st={st} index={i} w={192} />
170
182
  <div className="tr-hoverrow"><b>{s.name}</b><span>{clock(t)}</span></div>
171
- <div className="tr-dim">{s.section ?? 'opening'} · shot {i + 1}/{tl.shots.length} · {s.length} s</div>
183
+ <div className="tr-dim">{s.section ?? 'opening'} · shot {i + 1}/{tl.shots.length} · {secsOf(s.length)}</div>
172
184
  </div>
173
185
  )
174
186
  })
@@ -193,11 +205,12 @@ export const ShotCards = observer(({ st }: { st: TrailerSt }) => {
193
205
  <div ref={box} className="tr-shotcards">
194
206
  {tl.shots.map((s, i) => {
195
207
  const n = counts.get(s.name) ?? 0
208
+ const changed = st.changed.has(s.name)
196
209
  return (
197
- <button type="button" key={`${s.name}@${i}`} className={`tr-shotcard ${hueOf(tl, s.section)}${i === cur ? ' on' : ''}`} onMouseDown={(e) => e.preventDefault()} onClick={() => st.seek(s.start)}>
210
+ <button type="button" key={`${s.name}@${i}`} className={`tr-shotcard ${hueOf(tl, s.section)}${i === cur ? ' on' : ''}${changed ? ' changed' : ''}`} onMouseDown={(e) => e.preventDefault()} onClick={() => st.seek(s.start)}>
198
211
  <Thumb st={st} index={i} w={136} />
199
- <div className="tr-shotname"><span className="tr-dim">{i + 1} </span>{s.name}</div>
200
- <div className="tr-dim tr-small">{clock(s.start)} · {s.length} s{s.captions.length > 0 ? ` · ${s.captions.length} title${s.captions.length > 1 ? 's' : ''}` : ''}</div>
212
+ <div className="tr-shotname"><span className="tr-dim">{i + 1} </span>{s.name}{changed ? <span className="tr-changed" title="the change touched this shot">changed</span> : null}</div>
213
+ <div className="tr-dim tr-small">{clock(s.start)} · {secsOf(s.length)}{s.captions.length > 0 ? ` · ${s.captions.length} title${s.captions.length > 1 ? 's' : ''}` : ''}</div>
201
214
  {n > 0 ? <span className="tr-shotnotes">{n}</span> : null}
202
215
  </button>
203
216
  )
@@ -279,11 +279,9 @@ span.rv-react{display:inline-block;border:1px solid;border-radius:4px}
279
279
  .rv-rect.on .rv-rectn{background:var(--blue)}
280
280
  .rv-rect.sent .rv-rectn{background:var(--k4)}
281
281
  .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;
282
+ /* the picked rectangle's note box, in the picked rectangle's blue: beside it, its place in px from notePlace */
283
+ .rv-note{position:absolute;width:min(300px,100%);pointer-events:auto;display:flex;flex-wrap:wrap;gap:var(--s1);align-items:flex-start;
284
284
  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
285
  .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
286
  .rv-note textarea{flex:1;min-width:0}
289
287
  /* 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 +349,8 @@ span.rv-react{display:inline-block;border:1px solid;border-radius:4px}
351
349
  .rv-optplay{flex:none;width:32px;height:28px;padding:0;font-size:13px}
352
350
  .rv-optplay.on{color:var(--bg);background:var(--accent);border-color:var(--accent)}
353
351
  .rv-optlabel{flex:0 1 auto;min-width:48px;max-width:30%;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
352
+ /* the agent's suggestion on a choice: the .rv-kind pill in the accent, apart from his own « ✓ picked » in --ok */
353
+ .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
354
  .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
355
  .rv-optthumb.img{width:48px}
356
356
  .rv-optthumb img{display:block;width:100%;height:100%;object-fit:cover}
@@ -480,8 +480,6 @@ span.rv-pick{display:inline-block;border:1px solid;border-radius:4px;font-size:1
480
480
  .tr-caption.on{background:var(--warn);color:var(--bg)}
481
481
  .tr-noteline{position:absolute;border-left:1px dashed var(--tone);opacity:.5;pointer-events:none}
482
482
  .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
483
  .tr-draftmark{position:absolute;top:0;width:2px;background:var(--warn);z-index:3;pointer-events:none}
486
484
  .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
485
  .tr-playknob{position:absolute;left:-5px;top:-2px;width:12px;height:8px;border-radius:3px;background:var(--red)}
@@ -492,6 +490,51 @@ span.rv-pick{display:inline-block;border:1px solid;border-radius:4px;font-size:1
492
490
  .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
491
  .tr-shotcard.on{border:2px solid var(--hue);background:color-mix(in srgb,var(--hue) 12%,var(--panel))}
494
492
  .tr-shotname{font-size:12px;font-weight:800;margin-top:var(--s1);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
493
+ .tr-shot.changed::after{content:'';position:absolute;left:0;right:0;bottom:0;height:3px;background:var(--accent)}
494
+ .tr-shotcard.changed{box-shadow:inset 0 -3px 0 var(--accent)}
495
+ .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}
496
+ button.tr-changed.on{background:var(--accent);color:var(--bg)}
497
+ .tr-card{display:flex;flex-direction:column;gap:var(--s2);border:1px solid var(--line);border-radius:6px;background:var(--bg);--tr-room:500px}
498
+ .tr-card .tr-player{padding:0 var(--s2) var(--s2)}
499
+ .tr-cardbar{display:flex;flex-wrap:wrap;gap:var(--s2);align-items:center;padding:var(--s2) var(--s3) 0}
500
+ .tr-cardshots{display:flex;flex-wrap:wrap;gap:var(--s0);align-items:center}
501
+ .tr-cardgrid{display:grid;grid-template-columns:minmax(0,1fr) 420px;gap:var(--s2);align-items:start}
502
+ .tr-card.wide .tr-rail{margin:0 var(--s2) var(--s2) 0;max-height:calc(100vh - 230px);position:sticky;top:var(--s2)}
503
+ .tr-card:not(.wide) .tr-rail{margin:0;max-height:380px}
504
+ /* a note's lane, its rail row and its rectangle: drafts warm, sent notes the accent */
505
+ .ns-draft{--tone:var(--warn)}
506
+ .ns-sent{--tone:var(--accent)}
507
+ .tr-lanelabel{position:absolute;right:var(--s2);font-size:10px;font-weight:700;color:var(--dim);text-transform:uppercase;pointer-events:none}
508
+ .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}
509
+ .tr-lanemark.on{box-shadow:0 0 0 3px color-mix(in srgb,var(--tone) 45%,transparent);transform:scale(1.15)}
510
+ .rv-rect.tr-noterect{border-style:solid;border-width:2px;background:color-mix(in srgb,var(--warn) 6%,transparent)}
511
+ .rv-rect.tr-noterect.was{border-color:var(--accent);background:color-mix(in srgb,var(--accent) 6%,transparent)}
512
+ .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)}
513
+ .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}
514
+ .tr-noterect.was .tr-notelabel{background:var(--accent)}
515
+ .tr-notelabel b{margin-right:var(--s1)}
516
+ .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)}
517
+ .tr-railhead{display:flex;gap:var(--s2);align-items:baseline;padding:var(--s2) var(--s3);border-bottom:1px solid var(--line)}
518
+ .tr-railrows,.tr-verdictrows{display:flex;flex-direction:column;gap:var(--s2);padding:var(--s2);overflow-y:auto;min-height:0}
519
+ .tr-verdictrows{padding:var(--s1) 0;overflow:visible}
520
+ .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}
521
+ .tr-row:hover{border-color:var(--accent)}
522
+ .tr-row.on{border:2px solid var(--accent);background:color-mix(in srgb,var(--accent) 8%,var(--bg))}
523
+ .tr-row.draft{border-style:dashed;border-color:var(--warn)}
524
+ .tr-row.draft.on{border-style:solid}
525
+ .tr-rowstill{position:relative;width:150px;border-radius:4px;background-color:var(--solid);background-size:cover;background-position:center;overflow:hidden}
526
+ .tr-rowrect{position:absolute;border:2px solid var(--accent);box-shadow:0 0 0 1px var(--shadow)}
527
+ .tr-row.draft .tr-rowrect{border-color:var(--warn)}
528
+ .tr-rowbody{display:flex;flex-direction:column;gap:var(--s1);min-width:0}
529
+ .tr-rowmeta{display:flex;gap:var(--s2);align-items:center;flex-wrap:wrap;font-size:12px}
530
+ .tr-rowtext{font-size:13px;line-height:1.4;white-space:pre-wrap;overflow-wrap:anywhere}
531
+ .tr-rowwrite{display:flex;gap:var(--s1);align-items:flex-start}
532
+ .tr-rowwrite textarea{flex:1;min-width:0;font:13px/1.4 system-ui,sans-serif;padding:var(--s1) var(--s2)}
533
+ .tr-rowx{flex:none}
534
+ .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}
535
+ .tr-notenum.draft{background:var(--warn)}
536
+ .tr-drafttag{font-size:10px;font-weight:700;text-transform:uppercase;color:var(--warn)}
537
+ .tr-stillrect{position:absolute;border:2px solid var(--accent);pointer-events:none}
495
538
  .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
539
  .tr-montage{display:flex;flex-direction:column;gap:var(--s1);align-items:flex-start}
497
540
  .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}
@@ -2,7 +2,7 @@
2
2
  // the drafts on the left (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,11 @@ 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
18
 
19
19
  export const CommsPage = observer(({ app }: { app: RepoSt }) => {
20
20
  const so = app.social
@@ -73,6 +73,8 @@ export const CommsPage = observer(({ app }: { app: RepoSt }) => {
73
73
  })
74
74
 
75
75
  const FAM_CHOICES: (Fam | null)[] = ['feed', 'vertical', null]
76
+ /** the kind select's « every kind »: no kind is a word too, the empty one */
77
+ const EVERY_KIND = '*'
76
78
 
77
79
  /** every draft in the order asked: its day, its title, its platforms (lit once posted there), its count */
78
80
  const DraftsList = observer(({ so }: { so: SocialSt }) => {
@@ -107,6 +109,17 @@ const DraftsList = observer(({ so }: { so: SocialSt }) => {
107
109
  ))}
108
110
  </select>
109
111
  </div>
112
+ <div className="so-selects">
113
+ <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">
114
+ <option value={EVERY_KIND}>every kind</option>
115
+ {so.kindChoices.map((k) => (
116
+ <option key={k.id} value={k.id} title={k.off ? so.kindProblemOf(k.id) : so.kindOf(k.id)?.for}>
117
+ {k.off ? '⚠ ' : ''}
118
+ {k.id || '(no kind)'} · {k.n}
119
+ </option>
120
+ ))}
121
+ </select>
122
+ </div>
110
123
  <div className="so-selects">
111
124
  <button className="ghost" onClick={() => so.foldAll(!so.allFolded)} title={so.allFolded ? 'unfold every series' : 'fold every series'}>
112
125
  {so.allFolded ? '⇕ unfold all' : '⇳ fold all'}
@@ -117,14 +130,11 @@ const DraftsList = observer(({ so }: { so: SocialSt }) => {
117
130
  </div>
118
131
  <span className="rv-count">
119
132
  {drafts.length < t.drafts ? `${drafts.length} of ` : ''}
120
- {t.drafts} drafts · {t.waiting} to post{so.asked.length > 0 ? ` · ${so.asked.length} asked` : ''}
133
+ {t.drafts} drafts · {t.waiting} to post
121
134
  </span>
122
135
  </div>
123
136
  <Problems so={so} lines={[...(so.loadError ? [so.loadError] : []), ...so.errors]} />
124
137
  <div className="rv-listscroll so-rows">
125
- {so.asked.map((a) => (
126
- <AskedRow key={a.id} so={so} a={a} />
127
- ))}
128
138
  {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
139
  {drafts.map((d) => (
130
140
  <Fragment key={d.slug}>
@@ -139,20 +149,6 @@ const DraftsList = observer(({ so }: { so: SocialSt }) => {
139
149
  )
140
150
  })
141
151
 
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
152
  /** the row picked stays in view, as the arrows walk the list */
157
153
  function useInView(on: boolean) {
158
154
  const ref = useRef<HTMLButtonElement>(null)
@@ -185,6 +181,11 @@ const DraftRow = observer(({ so, d }: { so: SocialSt; d: Draft }) => {
185
181
  ) : null}
186
182
  <span className="so-day">{madeOn(d.slug)}</span>
187
183
  <span className="so-rowtitle">
184
+ {d.kindProblem ? (
185
+ <span className="so-kindwarn" title={d.kindProblem}>
186
+ ⚠
187
+ </span>
188
+ ) : null}
188
189
  {d.article ? <span className="so-art" title="an article: it holds a post.md">▤</span> : null}
189
190
  {d.title || d.slug}
190
191
  </span>
@@ -238,7 +239,9 @@ const DraftPage = observer(({ so, d }: { so: SocialSt; d: Draft }) => {
238
239
  </h2>
239
240
  <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
241
  </div>
242
+ {d.kindProblem ? <div className="so-kindproblem">⚠ {d.kindProblem}</div> : null}
241
243
  <div className="so-meta">
244
+ <KindLink so={so} d={d} />
242
245
  {speaker ? (
243
246
  <span className={`so-who${d.identity !== so.desk?.speaksAs ? '' : ' own'}`} title="the identity that speaks it">
244
247
  {speaker.name}
@@ -246,10 +249,23 @@ const DraftPage = observer(({ so, d }: { so: SocialSt; d: Draft }) => {
246
249
  ) : null}
247
250
  <a href={so.editorUrl(d.path)}>open in VS Code ({d.file}) ↗</a>
248
251
  {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
252
+ <button className="so-linkbtn" title={`the review card it was staged from: ${d.review}`} onClick={() => so.openNote(d.review as string)}>
253
+ 📤 from its review card
254
+ </button>
255
+ ) : null}
256
+ {d.release ? <span className="so-badge t-dim" title="the release it was staged from">🔼 {d.release}</span> : null}
257
+ {d.release ? (
258
+ <button className="so-linkbtn" title="pick its media among the approved cards this release ships" onClick={() => so.openStage(d.slug)}>
259
+ 📤 {d.media.length > 0 ? 'another media' : 'add a media'}
251
260
  </button>
252
261
  ) : null}
262
+ {so.stage ? <StagePopup st={so.stage} url={(p) => so.url(p)} close={() => so.closeStage()} /> : null}
263
+ {d.rating !== 'safe' ? <span className="so-badge t-warn" title="what it shows: each place takes it or not">🔞 {d.rating}</span> : null}
264
+ {d.skipped.map((k) => (
265
+ <span key={k.account} className="so-badge t-dim" title={k.why}>
266
+ skips {k.account}
267
+ </span>
268
+ ))}
253
269
  </div>
254
270
  {d.angle ? <AngleCards key={d.slug} angle={d.angle} /> : null}
255
271
  <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,6 +288,22 @@ const DraftPage = observer(({ so, d }: { so: SocialSt; d: Draft }) => {
272
288
  )
273
289
  })
274
290
 
291
+ /** 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 */
292
+ const KindLink = observer(({ so, d }: { so: SocialSt; d: Draft }) => {
293
+ const k = so.kindOf(d.kind)
294
+ if (k == null) return null
295
+ const label = `${k.id}: ${k.title ?? k.for}`
296
+ return k.page ? (
297
+ <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}`}>
298
+ {label} ↗
299
+ </a>
300
+ ) : (
301
+ <span className="so-kind" style={{ '--kt': kindTone(k.id) } as CSSProperties} title="its rules page is not on this machine">
302
+ {label}
303
+ </span>
304
+ )
305
+ })
306
+
275
307
  const DraftSide = observer(({ so }: { so: SocialSt }) => {
276
308
  const d = so.currentDraft
277
309
  return d ? <DraftMedia so={so} d={d} /> : null
@@ -0,0 +1,112 @@
1
+ // an identity's pictures as the hub shows them (wiki tools/shipkit/social-identities.md, Identities): what a picture's
2
+ // name says (`avatar-<name>[-round]`, `banner-<venue>-<rating>-<variant>`), the banners by venue, which account's row
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'
6
+ import { fileName, type DeskAccount, type DeskIdentity, type Picture, type Row } from './social-model.ts'
7
+
8
+ export { otherRating, RATINGS }
9
+
10
+ /** the picture a path names, by its shown file or one of its other formats */
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: {} }
12
+
13
+ /** a row's pictures, one each however many of its formats the row names */
14
+ export function rowPictures(i: DeskIdentity, files: readonly string[]): Picture[] {
15
+ const out: Picture[] = []
16
+ for (const f of files) {
17
+ const p = pictureOf(i, f)
18
+ if (!out.some((x) => x.file === p.file)) out.push(p)
19
+ }
20
+ return out
21
+ }
22
+
23
+ export type Facts = { kind: 'avatar' | 'banner' | 'other'; venue: string; rating: string; label: string }
24
+
25
+ /** what a picture's name says; its label the words after its kind, venue and identity: « sfw · a », « nsfw · round » */
26
+ export function factsOf(file: string, identity: string): Facts {
27
+ const name = fileName(file).replace(/\.\w+$/, '')
28
+ const [head = '', ...tokens] = name.split('-')
29
+ if (head !== 'avatar' && head !== 'banner') return { kind: 'other', venue: '', rating: '', label: name }
30
+ const r = tokens.findIndex((t) => RATINGS.includes(t))
31
+ const venue = head === 'banner' && r > 0 ? tokens.slice(0, r).join('-') : ''
32
+ const words = (venue === '' ? tokens : tokens.slice(r)).filter((t) => t !== identity)
33
+ return { kind: head, venue, rating: r === -1 ? '' : tokens[r]!, label: words.join(' · ') || head }
34
+ }
35
+
36
+ /** the banners by venue, in the order of the identity's accounts, then the venues no account names, then the
37
+ * banners whose name says no venue; each group named by its account: « Discord · splash » */
38
+ export function bannerGroups(i: DeskIdentity): { venue: string; title: string; pictures: Picture[] }[] {
39
+ const groups = new Map<string, Picture[]>()
40
+ for (const p of i.pictures) {
41
+ const f = factsOf(p.file, i.id)
42
+ if (f.kind === 'banner') groups.set(f.venue, [...(groups.get(f.venue) ?? []), p])
43
+ }
44
+ const rank = (venue: string): number => {
45
+ if (venue === '') return Number.MAX_SAFE_INTEGER
46
+ const n = i.accounts.findIndex((a) => a.id === venue.split('-')[0])
47
+ return n === -1 ? i.accounts.length : n
48
+ }
49
+ const title = (venue: string): string => {
50
+ if (venue === '') return 'banners'
51
+ const [first = '', ...rest] = venue.split('-')
52
+ return [i.accounts.find((a) => a.id === first)?.name ?? first, ...rest].join(' · ')
53
+ }
54
+ return [...groups]
55
+ .sort(([a], [b]) => rank(a) - rank(b) || a.localeCompare(b))
56
+ .map(([venue, pictures]) => ({ venue, title: title(venue), pictures: pictures.sort((x, y) => x.file.localeCompare(y.file)) }))
57
+ }
58
+
59
+ /** an account's own rows: the ones the identity's profile does not give it as they are */
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
+ }
70
+
71
+ /** every account whose own row names the picture: « X banner », « Discord icon » */
72
+ export const usedBy = (i: DeskIdentity, p: Picture): string[] =>
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}`))
74
+
75
+ /** the account's `rating` row, its first word: `sfw`, `nsfw`, or '' when it names none */
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
85
+
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}`
106
+ }
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
+
111
+ /** a row's value is more than its paths: a note to show under its pictures */
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
 
@@ -88,6 +88,12 @@ const PosterButton = observer((p: { so: SocialSt; a: DeskAccount; post: SocialPo
88
88
  const so = p.so
89
89
  const done = p.post.posted !== ''
90
90
  const key = so.postKey(p.post)
91
+ if (p.post.refused !== '' && !done)
92
+ return (
93
+ <button disabled title={p.post.refused}>
94
+ ⛔ Refused
95
+ </button>
96
+ )
91
97
  if (p.a.automation === 'live') {
92
98
  const over = p.a.max !== null && so.length(p.post) > p.a.max
93
99
  const err = so.publishError[key]
@@ -269,7 +275,7 @@ const ShareCard = observer((p: { so: SocialSt; sends: readonly { a: DeskAccount;
269
275
  {first.post.name ? <span className="rv-dim"> · {first.post.name}</span> : null}
270
276
  </span>
271
277
  {!so.phone && !all ? (
272
- <button onClick={() => void so.openAll(first.post)} title="each write page in a window of its own, side by side, in the identity's Chrome profile, the media in the Finder under them">
278
+ <button disabled={first.post.refused !== ''} onClick={() => void so.openAll(first.post)} title={first.post.refused || "each write page in a window of its own, side by side, in the identity's Chrome profile, the media in the Finder under them"}>
273
279
  ⧉ Open all
274
280
  </button>
275
281
  ) : null}
@@ -336,8 +342,10 @@ const Fields = observer((p: { so: SocialSt; a: DeskAccount; post: SocialPost; pl
336
342
  </Field>
337
343
  ) : null}
338
344
  <Field label={label}>
339
- <CopyFrame so={so} text={post.body} copy={post.text} k={key} onEdit={() => so.startEdit(post)} />
345
+ <CopyFrame so={so} text={post.body} copy={post.text} k={key} onEdit={() => so.startEdit(post)} refused={post.refused} />
340
346
  </Field>
347
+ {post.refused !== '' ? <div className="so-refused t-red">⛔ {post.refused}</div> : null}
348
+ {post.rating !== 'safe' && p.a.sensitive !== '' ? <div className="so-refused t-warn">🔞 {post.rating} on {p.a.name}: {p.a.sensitive}</div> : null}
341
349
  {post.tags.length > 0 ? (
342
350
  <Field label="Tags">
343
351
  <div className="so-tags">{post.tags.join(' ')}</div>