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
@@ -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>
@@ -1,10 +1,11 @@
1
1
  // the desks' words and pure rules (wiki tools/shipkit/social.md, The desks in the hub): the desk as the hub's route
2
2
  // sends it, a draft's angle as cards, the families of the list, a card a heading, the address's query. Pure, no
3
3
  // browser, so the rules are pinned headless
4
+ import type { DeskKind } from '../../../social/kind-pages.ts'
4
5
  import type { Draft, Desk, DeskAccount, DeskIdentity, Media, SocialPost } from '../../../social/load.ts'
5
6
  import type { Family, Timeline } from '../../../social/presence.ts'
6
7
 
7
- export type { Draft, DeskAccount, DeskIdentity, Media, SocialPost, Timeline }
8
+ export type { DeskKind, Draft, DeskAccount, DeskIdentity, Media, SocialPost, Timeline }
8
9
  export type Place = DeskAccount['places'][number]
9
10
  export type Row = DeskIdentity['rows'][number]
10
11
  export type Picture = DeskIdentity['pictures'][number]
@@ -15,6 +16,8 @@ export type DeskJson = Desk & { timelines: Record<string, Timeline>; statsPlatfo
15
16
 
16
17
  /** the account's own profile, beside its places */
17
18
  export const ME = 'me'
19
+ /** the address of the next release in Communications (`#page:comms:next-release`): no draft's slug, which opens on a date */
20
+ export const NEXT_PICK = 'next-release'
18
21
  /** the company card of an identity, never an account's folder name */
19
22
  export const LEGAL = '@legal'
20
23
  /** YouTube's title, the one title a group heading carries (`## vertical`) */
@@ -126,12 +129,43 @@ export function partsOf(d: Pick<Draft, 'posts'>): string[] {
126
129
  }
127
130
 
128
131
  /** a kind's hue, a token of the hub: the kinds named, else one by its letters */
129
- const KIND_TONE: Readonly<Record<string, string>> = { look: 'k3', devlog: 'k2', people: 'warn', puzzle: 'blue', trailer: 'red', announcement: 'k4', hello: 'k1', welcome: 'review', roundup: 'ok', page: 'dim' }
132
+ const KIND_TONE: Readonly<Record<string, string>> = {
133
+ announcement: 'k4',
134
+ feature: 'accent',
135
+ iteration: 'k2',
136
+ showcase: 'warn',
137
+ release: 'ok',
138
+ trailer: 'red',
139
+ throwback: 'k5',
140
+ custom: 'dim',
141
+ look: 'k3',
142
+ devlog: 'k2',
143
+ people: 'warn',
144
+ puzzle: 'blue',
145
+ hello: 'k1',
146
+ welcome: 'review',
147
+ roundup: 'ok',
148
+ page: 'dim',
149
+ }
130
150
  const SPARE = ['k6', 'k5', 'accent', 'k4']
131
151
  export const kindTone = (kind: string): string => `var(--${KIND_TONE[kind] ?? SPARE[[...kind].reduce((n, c) => n + c.charCodeAt(0), 0) % SPARE.length]})`
132
152
 
153
+ /** a file of this machine opened in VS Code */
154
+ export const editorLink = (abs: string): string => `vscode://file${encodeURI(abs)}`
155
+
156
+ /** a choice of the list's kind filter: a kind the repo takes with its drafts, or a word off the set its drafts still name */
157
+ export type KindChoice = { id: string; n: number; off: boolean }
158
+
159
+ /** the kinds the repo takes, each with its drafts among `drafts`, then each word off the set the drafts name */
160
+ export function kindChoices(drafts: readonly Pick<Draft, 'kind'>[], kinds: readonly Pick<DeskKind, 'id'>[]): KindChoice[] {
161
+ const n = (k: string): number => drafts.filter((d) => d.kind === k).length
162
+ const set = new Set(kinds.map((k) => k.id))
163
+ const off = [...new Set(drafts.map((d) => d.kind).filter((k) => !set.has(k)))].sort()
164
+ return [...kinds.map((k) => ({ id: k.id, n: n(k.id), off: false })), ...off.map((k) => ({ id: k, n: n(k), off: true }))]
165
+ }
166
+
133
167
  /** the list's view as the address carries it, each key only when it is not the default */
134
- export type CommsView = { fam: Fam | null; channel: string | null; newestFirst: boolean; who: string | null }
168
+ export type CommsView = { fam: Fam | null; channel: string | null; newestFirst: boolean; who: string | null; kind: string | null }
135
169
 
136
170
  export function commsQuery(v: CommsView): string {
137
171
  const q = new URLSearchParams()
@@ -139,6 +173,7 @@ export function commsQuery(v: CommsView): string {
139
173
  if (v.channel) q.set('ch', v.channel)
140
174
  if (!v.newestFirst) q.set('order', 'old')
141
175
  if (v.who) q.set('who', v.who)
176
+ if (v.kind != null) q.set('kind', v.kind)
142
177
  return q.toString()
143
178
  }
144
179
 
@@ -150,5 +185,6 @@ export function readCommsQuery(q: string): Partial<CommsView> {
150
185
  if (p.has('ch')) out.channel = p.get('ch') || null
151
186
  if (p.has('order')) out.newestFirst = p.get('order') !== 'old'
152
187
  if (p.has('who')) out.who = p.get('who') || null
188
+ if (p.has('kind')) out.kind = p.get('kind')
153
189
  return out
154
190
  }
@@ -4,7 +4,7 @@
4
4
  // payouts, its profile or the place's rules. Its parts are the home's identity view too (identities-view.tsx). Green
5
5
  // is only ever a link he pasted
6
6
  import { observer } from 'mobx-react-lite'
7
- import { useEffect, type CSSProperties } from 'react'
7
+ import { useEffect, type CSSProperties, type ReactNode } from 'react'
8
8
  import { Panel, Separator } from 'react-resizable-panels'
9
9
  import { KeptCols } from '../kept-cols.tsx'
10
10
  import { plainClick } from '../home-st.ts'
@@ -13,9 +13,11 @@ import { PANEL, PhoneTop } from '../review/review-page.tsx'
13
13
  import { brandVar, CopyIcon, CopyRow, ErrorLine, Go, KeptFold, Lightbox, Logo, Md, MdInline, Toast } from './kit.tsx'
14
14
  import { PostCard } from './post-card.tsx'
15
15
  import { Problems } from './problems.tsx'
16
- import { bannerGroups, factsOf, hasNote, otherRating, pictureOf, ratingOf, rowPictures, usedBy } from './identity-pictures.ts'
16
+ import { stepRefs } from '../../../identities/steps.ts'
17
+ import { bannerGroups, factsOf, hasNote, otherRating, otherRows, pasteOf, pasteState, pictureOf, ratingOf, rowPictures, shownFile, staleBadge, staleWhy, uploadOf, usedBy, type Upload } from './identity-pictures.ts'
17
18
  import { AUTOMATION, fileName, LEGAL, linksText, ME, type DeskAccount, type DeskIdentity, type Picture, type Place, type Row } from './social-model.ts'
18
19
  import type { SocialSt } from './social-st.ts'
20
+ import { stepLayout, textKind, type RefKind } from './step-layout.ts'
19
21
 
20
22
  export const SocialPage = observer(({ app }: { app: RepoSt }) => {
21
23
  const so = app.social
@@ -288,6 +290,7 @@ export const IdentityPage = observer(({ so, i }: { so: SocialSt; i: DeskIdentity
288
290
  <Logo id={a.id} name={a.name} size={22} muted={a.live === ''} />
289
291
  <b className="so-rowname">{a.name}</b>
290
292
  <span className="so-rowvalue so-ellip">{a.handle}</span>
293
+ {staleBadge(a) == null ? null : <span className="so-badge solid t-warn">{staleBadge(a)}</span>}
291
294
  <span className={`so-badge ${a.live ? 't-ok solid' : 't-dim'}`}>{a.live ? 'online' : 'to create'}</span>
292
295
  {a.live ? <CopyIcon so={so} text={a.live} k={`${i.id}/link/${a.id}`} title="copy the link" /> : null}
293
296
  {a.live || a.profile ? (
@@ -357,13 +360,35 @@ const YOUTUBE_AREAS = [
357
360
  { w: 1546, label: 'phone', cls: ' phone' },
358
361
  ]
359
362
 
363
+ /** what one does with a picture, wherever it shows: « copy » (not a clip), « ⬇ », 📂 the Finder (none on a phone) */
364
+ const PictureActions = observer(({ so, i, f }: { so: SocialSt; i: DeskIdentity; f: Picture }) => {
365
+ const { url, clip } = so.picture(i, f)
366
+ const key = `${i.id}/pic/${f.file}`
367
+ return (
368
+ <>
369
+ {!clip ? (
370
+ <button className="so-icon" onClick={() => void so.copyImage(url, key)} title="copy the image, to paste in the account's page">
371
+ {so.copiedKey === key ? '✓' : '⧉'}
372
+ </button>
373
+ ) : null}
374
+ <a className="so-icon" href={url} download={fileName(f.file)} title="download">
375
+ ⬇
376
+ </a>
377
+ {!so.phone ? (
378
+ <button className="so-icon" onClick={() => void so.revealPicture(i.id, f.file)} title={`show ${fileName(f.file)} in the Finder`}>
379
+ 📂
380
+ </button>
381
+ ) : null}
382
+ </>
383
+ )
384
+ })
385
+
360
386
  /** one picture: the image (a clip plays muted), its name or `label` and size, « copy », « ⬇ », 📂 the Finder (the
361
387
  * desktop has one, a phone none) and a download per other format; under it the accounts whose row names it (`used`);
362
388
  * `width` a tile, else the width it is given */
363
- const PictureTile = observer(({ so, i, f, width, label, used }: { so: SocialSt; i: DeskIdentity; f: Picture; width?: number; label?: string; used?: readonly string[] }) => {
389
+ const PictureTile = observer(({ so, i, f, width, label, used, foot }: { so: SocialSt; i: DeskIdentity; f: Picture; width?: number; label?: string; used?: readonly string[]; foot?: ReactNode }) => {
364
390
  const { url, clip } = so.picture(i, f)
365
391
  const size = f.w !== null ? ` · ${f.w}×${f.h}` : ''
366
- const key = `${i.id}/pic/${f.file}`
367
392
  const ext = (file: string): string => file.replace(/^.*\./, '')
368
393
  return (
369
394
  <div className="so-card so-pic" style={width ? { width } : undefined}>
@@ -382,19 +407,7 @@ const PictureTile = observer(({ so, i, f, width, label, used }: { so: SocialSt;
382
407
  {label ?? fileName(f.file).replace(/^(avatar|banner)-(caid-)?/, '').replace(/\.\w+$/, '').replace(/-round$/, ' round')}
383
408
  {label == null && !width ? <span className="rv-dim so-light">{size}</span> : null}
384
409
  </b>
385
- {!clip ? (
386
- <button className="so-icon" onClick={() => void so.copyImage(url, key)} title="copy the image, to paste in the account's page">
387
- {so.copiedKey === key ? '✓' : '⧉'}
388
- </button>
389
- ) : null}
390
- <a className="so-icon" href={url} download={fileName(f.file)} title="download">
391
- ⬇
392
- </a>
393
- {!so.phone ? (
394
- <button className="so-icon" onClick={() => void so.revealPicture(i.id, f.file)} title={`show ${fileName(f.file)} in the Finder`}>
395
- 📂
396
- </button>
397
- ) : null}
410
+ <PictureActions so={so} i={i} f={f} />
398
411
  </div>
399
412
  {f.also.length > 0 || (label != null && size !== '') ? (
400
413
  <div className="so-picrow so-picmore">
@@ -407,10 +420,83 @@ const PictureTile = observer(({ so, i, f, width, label, used }: { so: SocialSt;
407
420
  </div>
408
421
  ) : null}
409
422
  {used?.length ? <span className="rv-dim rv-small" title="the accounts whose row names it">→ {used.join(', ')}</span> : null}
423
+ {foot}
410
424
  </div>
411
425
  )
412
426
  })
413
427
 
428
+ /** the row file a tile shows, by its shown file or one of its other formats */
429
+ const rowFileOf = (u: Upload, f: Picture): string | null => u.files.find((x) => x === f.file || f.also.includes(x)) ?? null
430
+
431
+ /** under a picture of a row: « Done, uploaded » while the account does not show the row as it is now, « on X » under
432
+ * the one it shows */
433
+ const ShownFoot = observer(({ so, a, u, f }: { so: SocialSt; a: DeskAccount; u: Upload; f: Picture }) => {
434
+ const file = rowFileOf(u, f)
435
+ if (file == null) return null
436
+ if (!u.stale) return shownFile(u) === file ? <span className="so-badge t-ok so-shownok" title={`recorded ${u.shown!.on}, sha ${u.shown!.sha}`}>✓ on {a.name}</span> : null
437
+ return (
438
+ <button className="so-btn primary so-uploaded" disabled={so.busy} onClick={() => void so.markShown(a, u.field, file)} title={`records that ${a.name} now shows ${fileName(file)}`}>
439
+ ✓ Done, uploaded
440
+ </button>
441
+ )
442
+ })
443
+
444
+ /** after a text row he pastes: « ✓ pasted » when the account shows it as it is now, else « Done, pasted », with
445
+ * « changed, paste again » once its value moved since he pasted it */
446
+ const PasteFoot = observer(({ so, a, field }: { so: SocialSt; a: DeskAccount; field: string }) => {
447
+ const u = pasteOf(a, field)
448
+ if (u == null) return null
449
+ const state = pasteState(u)
450
+ if (state === 'pasted')
451
+ return (
452
+ <span className="so-paste">
453
+ <span className="so-badge t-ok" title={`pasted on ${a.name} ${u.shown!.on}, sha ${u.shown!.sha}`}>✓ pasted</span>
454
+ </span>
455
+ )
456
+ return (
457
+ <span className="so-paste">
458
+ {state === 'changed' ? (
459
+ <span className="so-badge solid t-warn" title={staleWhy(a, u)}>
460
+ changed, paste again
461
+ </span>
462
+ ) : null}
463
+ <button className={`so-btn so-pastebtn${state === 'changed' ? ' primary' : ''}`} disabled={so.busy} onClick={() => void so.markPasted(a, field, u.shas[0]!)} title={`records that ${a.name} now shows this text as it is here`}>
464
+ ✓ Done, pasted
465
+ </button>
466
+ </span>
467
+ )
468
+ })
469
+
470
+ /** a text row's tone on the page: warn once its value moved since he pasted it */
471
+ const pasteTone = (a: DeskAccount, field: string): string | undefined => (pasteOf(a, field)?.stale === true ? 'warn' : undefined)
472
+
473
+ /** one picture row of « Upload here »: its stale headline, its tiles with « Done, uploaded » or « on X », its note */
474
+ const UploadRow = observer(({ so, i, a, r }: { so: SocialSt; i: DeskIdentity; a: DeskAccount; r: Row }) => {
475
+ const u = uploadOf(a, r.field)
476
+ return (
477
+ <div className="so-row">
478
+ <span className="so-rowfield">{r.field}</span>
479
+ <div className="so-uppics">
480
+ {u?.stale ? <StaleLine a={a} u={u} /> : null}
481
+ <div className="so-tiles">
482
+ {rowPictures(i, r.files).map((f) => (
483
+ <PictureTile key={f.file} so={so} i={i} f={f} width={tileWidth(f)} label={factsOf(f.file, i.id).label} foot={u == null ? null : <ShownFoot so={so} a={a} u={u} f={f} />} />
484
+ ))}
485
+ </div>
486
+ {hasNote(r) ? <span className="rv-dim rv-small">{r.value}</span> : null}
487
+ </div>
488
+ </div>
489
+ )
490
+ })
491
+
492
+ /** a stale row's headline, impossible to miss: « new: not on X yet », and why */
493
+ const StaleLine = ({ a, u }: { a: DeskAccount; u: Upload }) => (
494
+ <div className="so-stale t-warn">
495
+ <b>new: not on {a.name} yet</b>
496
+ <span>{staleWhy(a, u)}</span>
497
+ </div>
498
+ )
499
+
414
500
  /** the middle of the company: every row a form asks, the private ones under a lock, then the open questions */
415
501
  export const LegalPage = observer(({ so, i }: { so: SocialSt; i: DeskIdentity }) => {
416
502
  const l = i.legal
@@ -542,6 +628,7 @@ export const PlatformHeader = observer(({ so, a }: { so: SocialSt; a: DeskAccoun
542
628
  <Go href={a.write.replace('{text}', '')} label="Write" icon="✎" solid />
543
629
  <Go href={a.inbox} label="Replies" icon="🔔" solid />
544
630
  <Go href={a.stats} label="Stats" icon="▥" solid />
631
+ <Go href={a.settings} label="Settings" icon="⚙" solid />
545
632
  </div>
546
633
  </div>
547
634
  <KeptFold so={so} card="automation" title="What can be automated" open={false} summary={a.automationText} right={<span className={`so-badge t-${auto.tone}`}>{auto.label}</span>}>
@@ -585,23 +672,35 @@ const Checklist = observer(({ so, a }: { so: SocialSt; a: DeskAccount }) => {
585
672
  )
586
673
  })
587
674
 
588
- const REF = /\[\[([^\]]+)\]\]/g
589
-
590
- /** a step's words, its refs drawn inline: a row's value with « copy », an image with « ⬇ », a draft to copy */
675
+ /** a step's words, then its form (step-layout.ts): a short row a chip whole in the sentence, a long row or a picture
676
+ * one line under it with its name, its whole value and « copy », or its pictures with « ⬇ » and « Done, uploaded » */
591
677
  const StepText = observer(({ so, a, index, text }: { so: SocialSt; a: DeskAccount; index: number; text: string }) => {
592
- const parts = text.split(REF)
593
678
  const i = so.identityOf(a.identity)
679
+ const rowOf = (ref: string): Row | undefined => a.rows.find((r) => r.field === ref)
680
+ const kindOf = (ref: string): RefKind => {
681
+ if (so.refDraft(a, ref)) return 'draft'
682
+ const row = rowOf(ref)
683
+ if (row == null) return 'bad'
684
+ return row.files.length > 0 && i ? 'picture' : textKind(row.value)
685
+ }
686
+ const { sentence, fields } = stepLayout(text, kindOf)
687
+ const keyOf = (ref: string): string => `${a.identity}/${a.id}/step/${index}/${ref}`
594
688
  return (
595
689
  <>
596
- {parts.map((part, j) => {
597
- if (j % 2 === 0) return <MdInline key={j} text={part} />
598
- const key = `${a.identity}/${a.id}/step/${index}/${part}`
599
- const draft = so.refDraft(a, part)
690
+ {sentence.map((p, j) => {
691
+ if ('text' in p) return <MdInline key={j} text={p.text} />
692
+ if (p.as === 'tag')
693
+ return (
694
+ <span key={j} className="so-steptag" title="its value is in the form under this step">
695
+ {p.ref}
696
+ </span>
697
+ )
698
+ const draft = so.refDraft(a, p.ref)
600
699
  if (draft)
601
700
  return (
602
701
  <span key={j} className="so-chip">
603
- <button className="primary" onClick={() => void so.copy(draft.text, key)} title="copy that draft's text">
604
- {so.copiedKey === key ? '✓ copied' : `⧉ « ${draft.title || draft.slug.replace(/^\d{8}-\d{6}-/, '')} »`}
702
+ <button className="primary" onClick={() => void so.copy(draft.text, keyOf(p.ref))} title="copy that draft's text">
703
+ {so.copiedKey === keyOf(p.ref) ? '✓ copied' : `⧉ « ${draft.title || draft.slug.replace(/^\d{8}-\d{6}-/, '')} »`}
605
704
  </button>
606
705
  {draft.media ? (
607
706
  <a className="so-btn" href={so.mediaUrl(draft.slug, draft.media)} download={fileName(draft.media.name)}>
@@ -610,34 +709,46 @@ const StepText = observer(({ so, a, index, text }: { so: SocialSt; a: DeskAccoun
610
709
  ) : null}
611
710
  </span>
612
711
  )
613
- const row: Row | undefined = a.rows.find((r) => r.field === part)
614
- if (row?.files.length && i)
615
- return (
616
- <span key={j} className="so-chip">
617
- {row.files.map((file) => (
618
- <span key={file} className="so-chip">
619
- <img className="so-stepimg" src={so.pictureUrl(i.id, file)} alt="" />
620
- <a className="so-btn" href={so.pictureUrl(i.id, file)} download={fileName(file)}>
621
- ⬇
622
- </a>
623
- </span>
624
- ))}
625
- </span>
626
- )
712
+ const row = rowOf(p.ref)
627
713
  if (row)
628
714
  return (
629
715
  <span key={j} className="so-chip">
630
- <button className="primary so-chipvalue" onClick={() => void so.copy(row.value, key)} title={row.value}>
631
- <span className="so-ellip">{row.value}</span> {so.copiedKey === key ? '✓' : '⧉'}
716
+ <button className="primary so-chipvalue" onClick={() => void so.copy(row.value, keyOf(p.ref))} title={`copy ${row.field}`}>
717
+ {row.value} {so.copiedKey === keyOf(p.ref) ? '✓' : '⧉'}
632
718
  </button>
719
+ <PasteFoot so={so} a={a} field={row.field} />
633
720
  </span>
634
721
  )
635
722
  return (
636
723
  <span key={j} className="so-badref">
637
- [[{part}]]
724
+ [[{p.ref}]]
638
725
  </span>
639
726
  )
640
727
  })}
728
+ {fields.length > 0 ? (
729
+ <div className="so-stepform">
730
+ {fields.map((ref) => {
731
+ const row = rowOf(ref)!
732
+ if (row.files.length === 0 || i == null) return <CopyRow key={ref} so={so} k={keyOf(ref)} field={ref} value={row.value} tone={pasteTone(a, ref)} foot={<PasteFoot so={so} a={a} field={ref} />} />
733
+ // one chip a picture, its other formats (the svg master of a png) under it, never an image of their own
734
+ const u = uploadOf(a, ref)
735
+ return (
736
+ <CopyRow key={ref} so={so} k={keyOf(ref)} field={ref} value={row.value}>
737
+ <span className="so-steppics">
738
+ {u?.stale ? <span className="so-badge solid t-warn" title={staleWhy(a, u)}>new: not on {a.name} yet</span> : null}
739
+ {rowPictures(i, row.files).map((f) => (
740
+ <span key={f.file} className="so-chip">
741
+ <img className="so-stepimg" src={so.pictureUrl(i.id, f.file)} alt="" title={fileName(f.file)} />
742
+ <PictureActions so={so} i={i} f={f} />
743
+ {u == null ? null : <ShownFoot so={so} a={a} u={u} f={f} />}
744
+ </span>
745
+ ))}
746
+ </span>
747
+ </CopyRow>
748
+ )
749
+ })}
750
+ </div>
751
+ ) : null}
641
752
  </>
642
753
  )
643
754
  })
@@ -653,33 +764,36 @@ export const AccountProfile = observer(({ so, a }: { so: SocialSt; a: DeskAccoun
653
764
  const pics = i == null ? [] : a.rows.filter((r) => r.files.length > 0)
654
765
  const mine = pics.filter((r) => !otherRating(r.field, rating))
655
766
  const others = pics.filter((r) => otherRating(r.field, rating))
767
+ // a row of the other rating the account names itself is a variant it shows too, tracked like the others
768
+ const variants = others.filter((r) => uploadOf(a, r.field) != null)
769
+ const apart = others.filter((r) => uploadOf(a, r.field) == null)
770
+ const stale = a.uploads.filter((u) => u.stale && u.kind === 'picture').length
771
+ const guided = stepRefs(a.steps).size > 0
772
+ const rest = otherRows(i, a)
773
+ const right = (
774
+ <>
775
+ {stale > 0 ? <span className="so-badge solid t-warn" title="rows this account does not show as the folder holds them now">{stale} to update</span> : null}
776
+ {rating === '' ? null : <span className={`so-badge solid ${rating === 'sfw' ? 't-ok' : 't-warn'}`} title="its rating row: the pictures it shows">{rating}</span>}
777
+ </>
778
+ )
656
779
  return (
657
780
  <div className="so-colin">
658
781
  {i != null && mine.length > 0 ? (
659
- <KeptFold so={so} card="upload" title="Upload here" flush right={rating === '' ? null : <span className={`so-badge solid ${rating === 'sfw' ? 't-ok' : 't-warn'}`} title="its rating row: the pictures it shows">{rating}</span>}>
660
- {mine.map((r) => (
661
- <div key={r.field} className="so-row">
662
- <span className="so-rowfield">{r.field}</span>
663
- <div className="so-uppics">
664
- <div className="so-tiles">
665
- {rowPictures(i, r.files).map((f) => (
666
- <PictureTile key={f.file} so={so} i={i} f={f} width={tileWidth(f)} label={factsOf(f.file, i.id).label} />
667
- ))}
668
- </div>
669
- {hasNote(r) ? <span className="rv-dim rv-small">{r.value}</span> : null}
670
- </div>
671
- </div>
672
- ))}
673
- {others.length > 0 ? <div className="so-row rv-dim rv-small">not for this venue, its rating is {rating}: {others.map((r) => r.field).join(', ')}</div> : null}
782
+ <KeptFold so={so} card="upload" title="Upload here" flush tone={stale > 0 ? 'warn' : undefined} right={right}>
783
+ {mine.map((r) => <UploadRow key={r.field} so={so} i={i} a={a} r={r} />)}
784
+ {variants.length > 0 ? <div className="so-row so-upband rv-small">its {variants[0]!.field.split(/\s+/).pop()} variant, named by this account</div> : null}
785
+ {variants.map((r) => <UploadRow key={r.field} so={so} i={i} a={a} r={r} />)}
786
+ {apart.length > 0 ? <div className="so-row rv-dim rv-small">not for this venue, its rating is {rating}: {apart.map((r) => r.field).join(', ')}</div> : null}
674
787
  </KeptFold>
675
788
  ) : null}
676
- <KeptFold so={so} card="profile" title="The profile" flush>
677
- {a.rows
678
- .filter((r) => i == null || r.files.length === 0)
679
- .map((r) => (
680
- <CopyRow key={r.field} so={so} k={`${a.identity}/${a.id}/row/${r.field}`} field={r.field} value={r.value} />
789
+ {rest.length > 0 ? (
790
+ // with a setup, its steps are the form he fills; the rows no step names stay apart, folded
791
+ <KeptFold so={so} card={guided ? 'rows' : 'profile'} title={guided ? 'Other rows' : 'The profile'} open={!guided} flush right={guided ? <span className="rv-dim rv-small">{rest.length}</span> : undefined}>
792
+ {rest.map((r) => (
793
+ <CopyRow key={r.field} so={so} k={`${a.identity}/${a.id}/row/${r.field}`} field={r.field} value={r.value} tone={pasteTone(a, r.field)} foot={<PasteFoot so={so} a={a} field={r.field} />} />
681
794
  ))}
682
- </KeptFold>
795
+ </KeptFold>
796
+ ) : null}
683
797
  {a.notes ? (
684
798
  <KeptFold so={so} card="notes" title="Notes" open={false} summary={a.notes}>
685
799
  <Md text={a.notes} />