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
@@ -73,11 +73,14 @@
73
73
  /* ⌘1 to ⌘9 select the first nine rows (keys.ts): the hint sits at the row's end */
74
74
  .pjkey{flex:none;font:10px/1 ui-monospace,Menlo,monospace;color:var(--dim);opacity:.6;background:none;border:0;padding:0}
75
75
  .pjrow:hover .pjkey,.pjrow.cur .pjkey{opacity:1}
76
- /* what waits on the owner, at the end of the row: the review cards (a click opens them), then the open asks */
77
- .pga,.pgr{flex:none;min-width:16px;height:16px;padding:0 var(--s1);border-radius:8px;
76
+ /* what waits on the owner, at the end of the row: the review cards and the trailer lines to record (a click opens
77
+ each), then the open asks */
78
+ .pga,.pgr,.pgvox{flex:none;min-width:16px;height:16px;padding:0 var(--s1);border-radius:8px;
78
79
  font-size:10px;font-weight:700;line-height:16px;text-align:center;color:var(--bg);background:var(--warn)}
79
80
  .pgr{background:var(--review);cursor:pointer}
80
81
  .pgr:hover{box-shadow:0 0 0 2px var(--review)}
82
+ .pgvox{background:var(--accent);cursor:pointer}
83
+ .pgvox:hover{box-shadow:0 0 0 2px var(--accent)}
81
84
  /* Claude sessions running: a thin edge on the left that breathes */
82
85
  .pgs{position:absolute;left:0;top:5px;bottom:5px;width:2px;border-radius:1px;background:var(--accent);pointer-events:none;animation:pgpulse 2.4s ease-in-out infinite}
83
86
  /* the home only: the repo's hub state (starting, crashed) */
@@ -147,4 +150,6 @@
147
150
  .pjlist.rail .pga,.pjlist.rail .pgr{position:absolute;top:0;min-width:14px;height:14px;padding:0 var(--s0);border-radius:7px;font-size:9px;line-height:14px}
148
151
  .pjlist.rail .pga{right:calc(50% - var(--ri,24px) / 2 - 4px)}
149
152
  .pjlist.rail .pgr{left:calc(50% - var(--ri,24px) / 2 - 4px)}
153
+ /* the voice pill rides the icon's bottom left corner on the rail */
154
+ .pjlist.rail .pgvox{position:absolute;bottom:0;left:calc(50% - var(--ri,24px) / 2 - 4px);min-width:14px;height:14px;padding:0 var(--s0);border-radius:7px;font-size:9px;line-height:14px}
150
155
  .pjlist.rail .pgd,.pjlist.rail .pgw{position:absolute;bottom:var(--s0);right:calc(50% - var(--ri,24px) / 2 - 2px)}
@@ -110,6 +110,10 @@ export const Row = observer(({ app, p, i }: { app: ListHost; p: Project; i: numb
110
110
  <b className="pgr" aria-label={`${face.cards} review card${face.cards === 1 ? '' : 's'} wait on you: open them`}
111
111
  onClick={(e) => { e.stopPropagation(); s.review(p.name) }} onDoubleClick={(e) => e.stopPropagation()}>{face.cards}</b>
112
112
  ) : null}
113
+ {face.voices != null ? (
114
+ <b className="pgvox" title={`${face.voices} trailer line${face.voices === 1 ? '' : 's'} wait for your voice: record them`}
115
+ onClick={(e) => { e.stopPropagation(); s.voices(p.name) }} onDoubleClick={(e) => e.stopPropagation()}>🎙{face.voices}</b>
116
+ ) : null}
113
117
  {face.badge != null ? <b className="pga">{face.badge}</b> : null}
114
118
  {face.busy ? <i className="pgs" /> : null}
115
119
  {dot != null ? <i className={`pgd ${dot}`} /> : null}
@@ -178,6 +182,11 @@ export const Card = ({ p, now }: { p: Project; now: number }) => {
178
182
  {m.needs.cards.more > 0 ? <span className="pgcmore">+{m.needs.cards.more}</span> : null}
179
183
  </div>
180
184
  )}
185
+ {m.needs.voices == null ? null : (
186
+ <div className="pgcneed">
187
+ <span className="pgcask">🎙 {m.needs.voices} trailer line{m.needs.voices === 1 ? '' : 's'} to record in your voice</span>
188
+ </div>
189
+ )}
181
190
  {m.needs.asks == null ? null : (
182
191
  <div className="pgcneed">
183
192
  <span className="pgcask">{m.needs.asks.count} ask{m.needs.asks.count === 1 ? '' : 's'}: {m.needs.asks.titles.join(' · ')}</span>
@@ -148,12 +148,14 @@ export function sortNames(list: Project[], mode: SortMode): string[] {
148
148
  export type HubDot = 'starting' | 'crashed' | null
149
149
 
150
150
  /** what the icon face shows, and nothing more: what waits on the owner as
151
- * two pills (the review cards waiting on a verdict, the open asks waiting
152
- * on hands), a dim name while VS Code does not have the folder open (the
153
- * icon stays whole), and a pulsing edge while Claude sessions run */
154
- export type Face = { cards: number | null; badge: number | null; dim: boolean; busy: boolean }
151
+ * pills (the review cards waiting on a verdict, the trailer lines waiting
152
+ * on his voice, the open asks waiting on hands), a dim name while VS Code
153
+ * does not have the folder open (the icon stays whole), and a pulsing edge
154
+ * while Claude sessions run */
155
+ export type Face = { cards: number | null; voices: number | null; badge: number | null; dim: boolean; busy: boolean }
155
156
  export const faceOf = (p: Project): Face => ({
156
157
  cards: p.cards.length > 0 ? p.cards.length : null,
158
+ voices: p.voices > 0 ? p.voices : null,
157
159
  badge: p.asks > 0 ? p.asks : null,
158
160
  dim: p.vscode === false,
159
161
  busy: p.sessions != null && p.sessions > 0,
@@ -164,7 +166,7 @@ export const faceOf = (p: Project): Face => ({
164
166
  * human, and label and value rows. Each part leaves out an unknown fact */
165
167
  export type CardModel = {
166
168
  head: { name: string; current: boolean; icon: string | null; version: string | null; branch: string | null; description: string | null }
167
- needs: { cards: { count: number; titles: string[]; more: number } | null; asks: { count: number; titles: string[]; more: number } | null; gate: string | null } | null
169
+ needs: { cards: { count: number; titles: string[]; more: number } | null; voices: number | null; asks: { count: number; titles: string[]; more: number } | null; gate: string | null } | null
168
170
  facts: { k: 'release' | 'live' | 'activity'; v: string; tone?: 'warn' }[]
169
171
  }
170
172
 
@@ -194,7 +196,7 @@ export function cardModel(p: Project, now: number): CardModel {
194
196
  if (act.length > 0) facts.push({ k: 'activity', v: act.join(' · ') })
195
197
  return {
196
198
  head: { name: p.name, current: p.current, icon: p.icon, version: p.version, branch, description: p.description },
197
- needs: cards == null && asks == null && gate == null ? null : { cards, asks, gate },
199
+ needs: cards == null && asks == null && gate == null && p.voices === 0 ? null : { cards, voices: p.voices > 0 ? p.voices : null, asks, gate },
198
200
  facts,
199
201
  }
200
202
  }
@@ -242,6 +244,8 @@ export class ProjectsSvc {
242
244
  /** a click on a row's review pill: that repo's review page on its first
243
245
  * waiting card. The home and a hub of its own each set it */
244
246
  onReview: (name: string, card: string | null) => void = (name) => this.select(name)
247
+ /** a click on a row's voice pill: that repo's trailer page, on Voices */
248
+ onVoices: (name: string) => void = (name) => this.select(name)
245
249
  /** the two places at the top of the list, the overview and the plan:
246
250
  * the home sets it, a hub of its own has none */
247
251
  onPlace: ((p: Place) => void) | null = null
@@ -313,6 +317,12 @@ export class ProjectsSvc {
313
317
  this.onReview(name, this.list.find((p) => p.name === name)?.cards[0]?.id ?? null)
314
318
  }
315
319
 
320
+ /** the voice pill: the trailer lines that wait on his voice in that repo */
321
+ voices(name: string): void {
322
+ this.selected = name
323
+ this.onVoices(name)
324
+ }
325
+
316
326
 
317
327
  /** the repo above (-1) or below (+1) the selected one, round the ends;
318
328
  * with none selected, down starts at the top and up at the bottom */
@@ -0,0 +1,187 @@
1
+ // a repo's releases page (`#page:releases[:<version>][?view=notes]`, wiki tools/shipkit/units.md, The release files):
2
+ // the versions on a row, next first; the one shown as its title, its date, then two views of the same parsed release.
3
+ // Cards: each category with its changes as cards, each its picture (its before a tab beside it), its words, its
4
+ // bullets and a link to the review card it came from. Notes: the release as one long page to read, as a GitHub release shows its markdown. Read only:
5
+ // the files are its source
6
+ import { observer } from 'mobx-react-lite'
7
+ import { useEffect } from 'react'
8
+ import { POST_RATINGS } from '../../../identities/rating.ts'
9
+ import { changeKey, isClip, isPrivate, NEXT, picturesOf, ratingOf, type Change, type Picture, type Release } from '../../../releases/model.ts'
10
+ import { hashFor, type ReleasesTab } from '../hash-route.ts'
11
+ import { renderMd } from '../md.ts'
12
+ import type { RepoSt } from '../repo-st.ts'
13
+ import type { ReleasesSt } from './releases-st.ts'
14
+
15
+
16
+ const TABS: [ReleasesTab, string][] = [
17
+ ['cards', 'Cards'],
18
+ ['notes', 'Notes'],
19
+ ]
20
+
21
+ /** a picture's rating as the private page names it: an unrated one says how it reads */
22
+ const ratingLabel = (p: Picture): string => p.rating ?? 'unrated, reads explicit'
23
+
24
+ /** a change's shots through the hub: a private one never by a public url. With more than one, a tab a rating over it,
25
+ * the safe one first; with a before, two small tabs over it, the after picked first; a file is asked only once its tab
26
+ * is. Every shot's rating on it: the page is private, so it shows every shot */
27
+ const ChangePicture = observer(({ rs, ch }: { rs: ReleasesSt; ch: Change }) => {
28
+ const shots = [...ch.shots].sort((a, b) => POST_RATINGS.indexOf(ratingOf(a.picture)) - POST_RATINGS.indexOf(ratingOf(b.picture)))
29
+ const shot = shots.find((s) => s.picture.url === rs.shots.get(changeKey(ch))) ?? shots[0]
30
+ if (!shot) return null
31
+ const before = shot.before && rs.befores.has(shot.before.url) ? shot.before : null
32
+ const shown = before ?? shot.picture
33
+ return (
34
+ <>
35
+ {shots.length > 1 ? (
36
+ <div className="rel-ratings" role="tablist" aria-label="its pictures by rating">
37
+ {shots.map((s) => (
38
+ <button key={s.picture.url} type="button" role="tab" aria-selected={s === shot} className={`${ratingOf(s.picture)}${s === shot ? ' on' : ''}`} onClick={() => rs.showShot(changeKey(ch), s.picture.url)}>
39
+ {s.picture.rating ?? 'unrated'}
40
+ </button>
41
+ ))}
42
+ </div>
43
+ ) : null}
44
+ {shot.before ? (
45
+ <div className="rel-sides" role="tablist" aria-label="before and after">
46
+ <button type="button" role="tab" aria-selected={!before} className={`after${before ? '' : ' on'}`} onClick={() => rs.showBefore(shot.before!.url, false)}>
47
+ After
48
+ </button>
49
+ <button type="button" role="tab" aria-selected={!!before} className={`before${before ? ' on' : ''}`} onClick={() => rs.showBefore(shot.before!.url, true)}>
50
+ Before
51
+ </button>
52
+ </div>
53
+ ) : null}
54
+ <span className={`rel-rating ${ratingOf(shown)}`} title="what this picture shows: a venue takes it only up to its ceiling">
55
+ {ratingLabel(shown)}
56
+ </span>
57
+ {isClip(shown.url) ? <video key={shown.url} src={rs.src(shown.url)} muted loop autoPlay playsInline /> : <img key={shown.url} src={rs.src(shown.url)} alt={shown.alt} loading="lazy" />}
58
+ </>
59
+ )
60
+ })
61
+
62
+ /** a change's description: markdown, through the hub's safe renderer */
63
+ const ChangeText = ({ ch }: { ch: Change }) => (ch.text ? <div className="rel-text" dangerouslySetInnerHTML={{ __html: renderMd(ch.text) }} /> : null)
64
+
65
+ const Bullets = ({ ch }: { ch: Change }) =>
66
+ ch.bullets.length > 0 ? (
67
+ <ul>
68
+ {ch.bullets.map((b) => (
69
+ <li key={b}>{b}</li>
70
+ ))}
71
+ </ul>
72
+ ) : null
73
+
74
+ /** one change as a card: its picture, its words, its card; Communications draws the next release with it too */
75
+ export const ChangeCard = observer(({ rs, ch }: { rs: ReleasesSt; ch: Change }) => {
76
+ const pic = ch.shots[0]?.picture
77
+ const card = ch.card ? hashFor({ t: 'review', id: ch.card }) : null
78
+ return (
79
+ <article className="rel-card">
80
+ {pic ? (
81
+ <div className="rel-pic">
82
+ <ChangePicture rs={rs} ch={ch} />
83
+ </div>
84
+ ) : null}
85
+ <div className="rel-words">
86
+ <h3>{ch.title}</h3>
87
+ <ChangeText ch={ch} />
88
+ <Bullets ch={ch} />
89
+ <footer>
90
+ {card ? <a href={`#${card}`}>review card</a> : <span>written by hand</span>}
91
+ {ch.commit ? <code>{ch.commit.slice(0, 8)}</code> : null}
92
+ {picturesOf(ch).some((p) => isPrivate(p) && ratingOf(p) === 'safe') ? <span className="rel-private" title="kept private in the Space: sk bump makes it public">private until released</span> : null}
93
+ </footer>
94
+ </div>
95
+ </article>
96
+ )
97
+ })
98
+
99
+ const Cards = observer(({ rs, r }: { rs: ReleasesSt; r: Release }) => (
100
+ <>
101
+ {r.categories.map((c) => (
102
+ <div key={c.name} className="rel-category">
103
+ <h3 className="rel-cat">{c.name}</h3>
104
+ <div className="rel-grid">
105
+ {c.changes.map((ch) => (
106
+ <ChangeCard key={`${ch.card ?? ''}${ch.title}`} rs={rs} ch={ch} />
107
+ ))}
108
+ </div>
109
+ </div>
110
+ ))}
111
+ </>
112
+ ))
113
+
114
+ /** the release as one document in one reading column: each category a heading, each change its title, its words, its
115
+ * bullets, its picture at the column's width; the card and the commit stay on the cards */
116
+ const Notes = observer(({ rs, r }: { rs: ReleasesSt; r: Release }) => (
117
+ <article className="rel-notes">
118
+ {r.categories.map((c) => (
119
+ <section key={c.name}>
120
+ <h2>{c.name}</h2>
121
+ {c.changes.map((ch) => (
122
+ <div key={`${ch.card ?? ''}${ch.title}`} className="rel-note">
123
+ <h3>{ch.title}</h3>
124
+ <ChangeText ch={ch} />
125
+ <Bullets ch={ch} />
126
+ {ch.shots.length > 0 ? (
127
+ <figure>
128
+ <ChangePicture rs={rs} ch={ch} />
129
+ </figure>
130
+ ) : null}
131
+ </div>
132
+ ))}
133
+ </section>
134
+ ))}
135
+ </article>
136
+ ))
137
+
138
+ export const ReleasesPage = observer(({ app }: { app: RepoSt }) => {
139
+ const rs = app.releases
140
+ useEffect(() => {
141
+ rs.start()
142
+ return () => rs.stop()
143
+ }, [rs])
144
+ const r = rs.current
145
+ const changes = r ? r.categories.reduce((n, c) => n + c.changes.length, 0) : 0
146
+ return (
147
+ <div className="rel-page">
148
+ <header>
149
+ <h1>Releases</h1>
150
+ <nav>
151
+ {rs.releases.map((x) => (
152
+ <button key={x.version} type="button" className={x.version === r?.version ? 'on' : ''} onClick={() => rs.show(x.version)}>
153
+ {x.version}
154
+ </button>
155
+ ))}
156
+ </nav>
157
+ </header>
158
+ {rs.error ? <p className="rel-error">{rs.error}</p> : null}
159
+ {(rs.view?.errors ?? []).map((e) => (
160
+ <p key={e} className="rel-error">
161
+ {e}
162
+ </p>
163
+ ))}
164
+ {r == null ? (
165
+ <p className="rel-hint">{rs.view ? 'no release file yet: a card sent with --changelog and approved starts next.md' : 'loading…'}</p>
166
+ ) : (
167
+ <section className="rel-release">
168
+ <h2>
169
+ {r.version === NEXT ? 'Next release' : r.version}
170
+ {r.title ? `: ${r.title}` : ''}
171
+ </h2>
172
+ <p className="rel-hint">
173
+ {r.version === NEXT ? `being filled${r.kind ? `, a ${r.kind} release` : ', its kind unsaid'}` : r.date}, {changes} change{changes === 1 ? '' : 's'}
174
+ </p>
175
+ <div className="rtabs rel-tabs">
176
+ {TABS.map(([t, label]) => (
177
+ <button key={t} type="button" className={`rtab${rs.tab === t ? ' on' : ''}`} onClick={() => rs.showTab(t)}>
178
+ {label}
179
+ </button>
180
+ ))}
181
+ </div>
182
+ {rs.tab === 'notes' ? <Notes rs={rs} r={r} /> : <Cards rs={rs} r={r} />}
183
+ </section>
184
+ )}
185
+ </div>
186
+ )
187
+ })
@@ -0,0 +1,111 @@
1
+ // a repo's releases page as state (wiki tools/shipkit/units.md, The release files): every release file read from the
2
+ // hub, the version shown in the address, its view (cards or notes) from the address or this browser's last pick. Read
3
+ // when the page opens and when the window comes back; the files are written by an approval, `sk releases add` or a
4
+ // hand, so the page never writes
5
+ import { makeAutoObservable, runInAction } from 'mobx'
6
+ import { pictureRoute, type Release } from '../../../releases/model.ts'
7
+ import type { ReleasesTab } from '../hash-route.ts'
8
+ import type { ReleasesView } from '../../../releases/routes.ts'
9
+ import { reach } from '../reach.ts'
10
+ import type { RepoSt } from '../repo-st.ts'
11
+
12
+ /** the view this browser picked last, for every repo's page */
13
+ const TAB_KEY = 'shipkit.releases.tab'
14
+
15
+ function keptTab(): ReleasesTab {
16
+ try {
17
+ return globalThis.localStorage?.getItem(TAB_KEY) === 'notes' ? 'notes' : 'cards'
18
+ } catch {
19
+ return 'cards'
20
+ }
21
+ }
22
+
23
+ export class ReleasesSt {
24
+ view: ReleasesView | null = null
25
+ error: string | null = null
26
+ /** the version the address names, null for the first */
27
+ version: string | null = null
28
+ /** the view shown: the address's when it names one, else this browser's last pick */
29
+ tab: ReleasesTab = keptTab()
30
+ /** the shot each change shows, its picture's url by `changeKey`: unset, its first by rating (the safe one) */
31
+ shots = new Map<string, string>()
32
+ /** the changes showing their before, by `sideKey`: every other change shows its after, the tab picked first */
33
+ befores = new Set<string>()
34
+ private started = 0
35
+
36
+ constructor(private readonly st: RepoSt) {
37
+ makeAutoObservable<this, 'st' | 'started' | 'onBack'>(this, { st: false, started: false, onBack: false })
38
+ }
39
+
40
+ get releases(): Release[] {
41
+ return this.view?.releases ?? []
42
+ }
43
+
44
+ /** the release shown: the one the address names, else the first (next, when it is being filled) */
45
+ get current(): Release | null {
46
+ return this.releases.find((r) => r.version === this.version) ?? this.releases[0] ?? null
47
+ }
48
+
49
+ start(): void {
50
+ if (this.started++ === 0) window.addEventListener('focus', this.onBack)
51
+ void this.load()
52
+ }
53
+
54
+ stop(): void {
55
+ if (--this.started === 0) window.removeEventListener('focus', this.onBack)
56
+ }
57
+
58
+ private readonly onBack = (): void => void this.load()
59
+
60
+ async load(): Promise<void> {
61
+ try {
62
+ const r = await reach(this.st.url('/api/releases'))
63
+ const body = (await r.json()) as ReleasesView & { error?: string }
64
+ if (!r.ok) throw new Error(body.error ?? `HTTP ${r.status}`)
65
+ runInAction(() => {
66
+ this.view = body
67
+ this.error = null
68
+ })
69
+ } catch (e) {
70
+ runInAction(() => (this.error = (e as Error).message))
71
+ }
72
+ }
73
+
74
+ /** a view null keeps the one shown */
75
+ select(version: string | null, tab: ReleasesTab | null = null): void {
76
+ this.version = version
77
+ if (tab) this.tab = tab
78
+ }
79
+
80
+ /** a click on a version: the address follows, the view stays */
81
+ show(version: string): void {
82
+ this.st.showReleases(version)
83
+ }
84
+
85
+ /** a click on a view: kept for this browser, the address follows */
86
+ showTab(tab: ReleasesTab): void {
87
+ try {
88
+ globalThis.localStorage?.setItem(TAB_KEY, tab)
89
+ } catch {
90
+ /* private window: the pick lasts the tab */
91
+ }
92
+ this.st.showReleases(this.version, tab)
93
+ }
94
+
95
+ /** a change's picture tab: its before or its after, the same in both views */
96
+ showBefore(key: string, on: boolean): void {
97
+ if (on) this.befores.add(key)
98
+ else this.befores.delete(key)
99
+ }
100
+
101
+ /** a change's rating tab: the shot it shows */
102
+ showShot(change: string, url: string): void {
103
+ this.shots.set(change, url)
104
+ }
105
+
106
+ /** a picture's address on this hub */
107
+ src(url: string): string {
108
+ const path = pictureRoute(url)
109
+ return path === url ? url : this.st.url(path)
110
+ }
111
+ }
@@ -0,0 +1,52 @@
1
+ /* the releases page (hub-app/releases/, wiki tools/shipkit/units.md, The release files): white cards on the gray
2
+ ground, the hub's tokens; each change a card, its picture on top, or the notes view's one reading column */
3
+ .rel-page{flex:1;min-width:0;max-width:1280px;display:flex;flex-direction:column;gap:var(--s4);font-size:14px;line-height:1.45}
4
+ .rel-page header{display:flex;flex-wrap:wrap;gap:var(--s3);align-items:center}
5
+ .rel-page h1{font-size:20px;margin:0}
6
+ .rel-page nav{display:flex;gap:var(--s1);flex-wrap:wrap}
7
+ .rel-page nav button{font:inherit;padding:var(--s1) var(--s3);border-radius:7px;border:1px solid var(--line);background:var(--panel);color:var(--ink);cursor:pointer}
8
+ .rel-page nav button.on{background:var(--accent);border-color:var(--accent);color:var(--panel)}
9
+ .rel-release h2{font-size:18px;margin:0}
10
+ .rel-category{display:grid;gap:var(--s3);margin-top:var(--s4)}
11
+ .rel-cat{font-size:13px;text-transform:uppercase;letter-spacing:.08em;color:var(--dim);margin:0}
12
+ .rel-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:var(--s3)}
13
+ .rel-card{background:var(--panel);border:1px solid var(--line);border-radius:10px;overflow:hidden;display:flex;flex-direction:column;min-width:0}
14
+ .rel-pic{background:var(--line);aspect-ratio:16/10;display:flex;align-items:center;justify-content:center;position:relative}
15
+ .rel-pic img,.rel-pic video{width:100%;height:100%;object-fit:cover;display:block}
16
+ /* a change with a before: two small tabs over its picture, the after green and picked first, the before red */
17
+ .rel-sides{position:absolute;top:var(--s2);left:var(--s2);display:flex;gap:2px;padding:2px;border-radius:7px;background:var(--panel);border:1px solid var(--line);box-shadow:0 2px 8px var(--shadow);z-index:1}
18
+ .rel-sides button{font:inherit;font-size:11px;font-weight:600;line-height:1;padding:4px 8px;border-radius:5px;border:1px solid transparent;background:none;color:var(--dim);cursor:pointer}
19
+ .rel-sides button:hover{color:var(--ink)}
20
+ .rel-sides button.after.on{background:var(--ok);border-color:var(--ok);color:var(--panel)}
21
+ .rel-sides button.before.on{background:var(--red);border-color:var(--red);color:var(--panel)}
22
+ /* a change with a shot a rating: a tab each over its top right corner, the safe one first; every shot names its rating */
23
+ .rel-ratings{position:absolute;top:var(--s2);right:var(--s2);display:flex;gap:2px;padding:2px;border-radius:7px;background:var(--panel);border:1px solid var(--line);box-shadow:0 2px 8px var(--shadow);z-index:1}
24
+ .rel-ratings button{font:inherit;font-size:11px;font-weight:600;line-height:1;padding:4px 8px;border-radius:5px;border:1px solid transparent;background:none;color:var(--dim);cursor:pointer}
25
+ .rel-ratings button.on{background:var(--ink);border-color:var(--ink);color:var(--panel)}
26
+ .rel-rating{position:absolute;bottom:var(--s2);left:var(--s2);z-index:1;font-size:11px;font-weight:600;line-height:1;padding:4px 8px;border-radius:999px;background:var(--panel);border:1px solid var(--line);color:var(--ok)}
27
+ .rel-rating.mild{color:var(--warn);border-color:var(--warn)}
28
+ .rel-rating.explicit{color:var(--red);border-color:var(--red)}
29
+ .rel-note figure{position:relative}
30
+ .rel-words{padding:var(--s3) var(--s4);display:grid;gap:var(--s2)}
31
+ .rel-words h3{margin:0;font-size:15px}
32
+ .rel-text{display:grid;gap:var(--s2)}
33
+ .rel-text p{margin:0}
34
+ .rel-tabs{margin-top:var(--s3)}
35
+ .rel-tabs .rtab{font-size:13px;cursor:pointer}
36
+ /* the notes: one reading column, as a GitHub release shows its markdown; pictures at the column's width */
37
+ .rel-notes{max-width:720px;margin-top:var(--s4);background:var(--panel);border:1px solid var(--line);border-radius:10px;padding:var(--s4) var(--s4) var(--s4) var(--s4);display:grid;gap:var(--s4);font-size:15px;line-height:1.6}
38
+ .rel-notes section{display:grid;gap:var(--s4);padding:var(--s2) var(--s3) 0}
39
+ .rel-notes section+section{padding-top:var(--s4)}
40
+ .rel-notes h2{font-size:20px;margin:0;padding-bottom:var(--s2);border-bottom:1px solid var(--line)}
41
+ .rel-note{padding-top:var(--s2)}
42
+ .rel-note h3{font-size:16px;margin:0 0 var(--s2)}
43
+ .rel-note ul{margin:var(--s2) 0 0;padding-left:var(--s4)}
44
+ .rel-note figure{margin:var(--s3) 0 0}
45
+ .rel-note figure img,.rel-note figure video{display:block;width:100%;height:auto;border-radius:8px;border:1px solid var(--line)}
46
+ .rel-words ul{margin:0;padding-left:var(--s4)}
47
+ .rel-words footer{display:flex;flex-wrap:wrap;gap:var(--s3);align-items:center;font-size:12px;color:var(--dim)}
48
+ .rel-words footer a{color:var(--accent)}
49
+ .rel-words code{font-family:ui-monospace,Menlo,monospace}
50
+ .rel-private{border:1px solid var(--warn);color:var(--warn);border-radius:999px;padding:0 var(--s2)}
51
+ .rel-hint{color:var(--dim);margin:0;font-size:13px}
52
+ .rel-error{color:var(--errink);background:var(--errbg);border:1px solid var(--errline);border-radius:7px;padding:var(--s2) var(--s3);margin:0}
@@ -8,7 +8,7 @@
8
8
  // own has none of the three. The counts read the severity filter, like everything under them,
9
9
  // and come from what the page already holds (the kept screen on a reload), so
10
10
  // none arrives late and moves the tree.
11
- import { REVIEW_COL, RUNS_ID, STORES_COL, TRAILER_COL, VEILLE_COL } from '../../collections/collection-types.ts'
11
+ import { MESSAGES_COL, RELEASES_COL, REVIEW_COL, RUNS_ID, STORES_COL, TRAILER_COL, VEILLE_COL } from '../../collections/collection-types.ts'
12
12
  import type { CheckOwner, HashSel } from './hash-route.ts'
13
13
  import { sectionLabel, type SectionId } from './keys.ts'
14
14
  import type { RepoSt } from './repo-st.ts'
@@ -42,12 +42,15 @@ export function sectionOfSel(sel: HashSel | null, ownerOf: (checkItemId: string)
42
42
  case 'processes': return 'processes'
43
43
  case 'plan': return 'plan'
44
44
  case 'git': return 'git'
45
+ case 'commands': return 'commands'
45
46
  case 'when': return 'when'
46
47
  case 'checks': return sel.from
47
48
  case 'admin': return 'admin'
48
49
  case 'review': return 'review'
49
50
  case 'trailer': return 'trailer'
50
51
  case 'stores': return 'stores'
52
+ case 'releases': return 'releases'
53
+ case 'messages': return 'messages'
51
54
  case 'veille': return 'veille'
52
55
  case 'comms': return 'comms'
53
56
  case 'social': return 'social'
@@ -63,6 +66,8 @@ export function sectionOfSel(sel: HashSel | null, ownerOf: (checkItemId: string)
63
66
  if (col === REVIEW_COL) return 'review'
64
67
  if (col === TRAILER_COL) return 'trailer'
65
68
  if (col === STORES_COL) return 'stores'
69
+ if (col === RELEASES_COL) return 'releases'
70
+ if (col === MESSAGES_COL) return 'messages'
66
71
  if (col === VEILLE_COL) return 'veille'
67
72
  if (col === 'checks') return sel.t === 'item' ? ownerOf(sel.id) : null
68
73
  return col === 'asks' || col === 'tests' || col === 'reflections' ? col : null
@@ -86,6 +91,7 @@ export function openSection(app: RepoSt, id: SectionId): void {
86
91
  case 'processes': return app.showProcesses(null)
87
92
  case 'plan': return app.showPlan()
88
93
  case 'git': return app.showGit()
94
+ case 'commands': return app.showCommands(app.commands.cmd, app.commands.runId)
89
95
  case 'when': return app.showWhen()
90
96
  case 'reflections': return app.showCol('reflections')
91
97
  case 'asks': return app.showCol('asks')
@@ -100,6 +106,8 @@ export function openSection(app: RepoSt, id: SectionId): void {
100
106
  case 'review': return app.showReview(app.review.selectedId)
101
107
  case 'trailer': return app.showTrailer(app.trailer.trailerId, app.trailer.cutId)
102
108
  case 'stores': return app.showStores(app.stores.store)
109
+ case 'releases': return app.showReleases(app.releases.version)
110
+ case 'messages': return app.showMessages('messages')
103
111
  case 'veille': return app.showVeille(app.veille.picked)
104
112
  case 'comms': return app.showComms(app.social.draftSlug, app.social.draftPart)
105
113
  case 'social': return app.showSocial(app.social.identity, app.social.account, app.social.place)
@@ -126,10 +134,14 @@ export function repoSections(app: RepoSt): RepoSection[] {
126
134
  // review and trailer sit right under the readme: the pages he answers
127
135
  out.push(line('review', 'the review cards agents send you: approve, fix, reject, circle a detail', counted(res.filter((r) => r.type === 'card').length, 'warn'),
128
136
  unless(has(REVIEW_COL), 'no review card yet: an agent sends one with sk review add')))
129
- out.push(line('trailer', 'the trailer cuts: play one with its timeline, pin a note on any frame', none,
137
+ out.push(line('trailer', 'the trailer cuts: play one with its timeline, pin a note on any frame, record the lines your own voice reads', counted(res.filter((r) => r.type === 'voice').length, 'warn'),
130
138
  unless(has(TRAILER_COL), 'no trailer: write trailer/<name>/main.trailer, then sk trailer')))
131
139
  out.push(line('stores', 'the store pages (Steam, itch): every text to paste, every picture to upload, a note on each', none,
132
140
  unless(has(STORES_COL), 'no store page: write .shipkit/steam/store.md or .shipkit/itch/listing.md')))
141
+ out.push(line('releases', 'the release notes: next first, then each version, each change a card with its picture and its review card', none,
142
+ unless(has(RELEASES_COL), 'no releases: an approved card sent with --changelog starts .shipkit/releases/next.md')))
143
+ out.push(line('messages', 'the messages a public line says, each phrasing scored by simulated readers: value for its cost, personas, page tops, notes', none,
144
+ unless(has(MESSAGES_COL), 'no messages: write .shipkit/messages/messages.md, then sk messages lint')))
133
145
  out.push(line('veille', 'the posts its identity scrolls past, ranked by the worth of a reply, a reply drafted in its voice', none,
134
146
  unless(has(VEILLE_COL), "no Veille: the identity this repo speaks as has no watch list (its veille.md)")))
135
147
  // every repo has both: a repo with no draft yet still opens the page that says how a first one comes
@@ -149,6 +161,8 @@ export function repoSections(app: RepoSt): RepoSection[] {
149
161
  out.push(line('processes', 'the processes this repo declares: start, stop, open, their description and their log', counted(procs.filter((r) => r.dot === 'crashed').length, 'red'),
150
162
  unless(procs.length > 0, 'no process: this repo declares no global process (a <id>.shipkit.ts file with globalProcess adds one)')))
151
163
  if (app.home.machine != null) out.push(line('git', 'the branch, its upstream, what is not committed, the last commits', none))
164
+ out.push(line('commands', "the repo's project CLI: every command with its description, run from here, its log live", counted(app.commands.running, 'warn'),
165
+ unless(app.hasCli, 'no project CLI: package.json has no `cli` script')))
152
166
  const open = res.filter((r) => r.collection === 'asks' && r.type === 'ask' && r.slot !== 'done').length
153
167
  out.push(line('asks', 'what waits on a human', counted(open, 'warn'), unless(has('asks'), 'no asks: nothing has ever waited on a human here')))
154
168
  out.push(line('reflections', 'friction this repo logged against the wiki, waiting to be folded in', counted(res.filter((r) => r.type === 'reflection').length, 'warn'), unless(has('reflections'), 'no reflections: this repo logged no friction')))