rvlib-shipkit 2.12.0 → 2.14.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 (378) hide show
  1. package/CHANGELOG.md +75 -21
  2. package/README.md +1 -1
  3. package/package.json +4 -2
  4. package/src/agent-time/store.ts +2 -2
  5. package/src/assets/run-assets.ts +2 -2
  6. package/src/assets/server/studio-server.ts +27 -23
  7. package/src/check.ts +4 -4
  8. package/src/checks/SK001-package-json-shape.check.ts +8 -4
  9. package/src/checks/SK002-contracts-fulfillness.check.ts +2 -2
  10. package/src/checks/SK003-claude-md-shape.check.ts +20 -13
  11. package/src/checks/SK004-gitignore-policy.check.ts +45 -6
  12. package/src/checks/SK005-rvlib-versions.check.ts +2 -2
  13. package/src/checks/SK006-npm-publish-safety.check.ts +3 -3
  14. package/src/checks/SK007-github-visibility.check.ts +2 -2
  15. package/src/checks/SK008-reviewer-agent.check.ts +3 -3
  16. package/src/checks/SK010-undeclared-unit.check.ts +2 -2
  17. package/src/checks/SK011-sibling-unit-ranges.check.ts +2 -2
  18. package/src/checks/SK012-config-barrel-import.check.ts +2 -2
  19. package/src/checks/SK013-one-way-in-policy.check.ts +2 -2
  20. package/src/checks/SK015-nested-repo.check.ts +3 -3
  21. package/src/checks/SK016-legacy-check-shapes.check.ts +2 -2
  22. package/src/checks/SK017-vscode-hub-task.check.ts +2 -2
  23. package/src/checks/SK018-test-files-run.check.ts +2 -2
  24. package/src/checks/SK019-tests-run-in-units.check.ts +2 -2
  25. package/src/checks/SK020-self-spawning-check.check.ts +2 -2
  26. package/src/checks/SK022-machine-runs-the-pin.check.ts +2 -2
  27. package/src/checks/SK024-identity-colors.check.ts +1 -1
  28. package/src/checks/SK025-release-drift.check.ts +2 -2
  29. package/src/checks/SK026-asks-autoclose.check.ts +2 -2
  30. package/src/checks/SK027-agent-wiki-links.check.ts +8 -2
  31. package/src/checks/SK028-readme.check.ts +2 -2
  32. package/src/checks/SK029-explicit-check-files.check.ts +3 -3
  33. package/src/checks/SK030-cache-audit.check.ts +7 -5
  34. package/src/checks/SK031-trace-audit.check.ts +7 -7
  35. package/src/checks/SK032-ignored-inputs.check.ts +3 -3
  36. package/src/checks/SK033-global-contribution.check.ts +11 -4
  37. package/src/checks/SK034-commit-gates-armed.check.ts +2 -2
  38. package/src/checks/SK035-public-clean.check.ts +46 -0
  39. package/src/checks/SK036-draft-media-size.check.ts +28 -0
  40. package/src/checks/SK037-keyword-additions.check.ts +43 -0
  41. package/src/cli/cmd_Backup.ts +152 -0
  42. package/src/cli/cmd_Ci.ts +8 -11
  43. package/src/cli/cmd_Commands.ts +4 -4
  44. package/src/cli/cmd_ConfigKeys.ts +2 -2
  45. package/src/cli/cmd_Drill.ts +145 -0
  46. package/src/cli/cmd_Home.ts +50 -3
  47. package/src/cli/cmd_Init.ts +1 -1
  48. package/src/cli/cmd_Media.ts +10 -8
  49. package/src/cli/cmd_Mv.ts +14 -7
  50. package/src/cli/cmd_Review.ts +6 -4
  51. package/src/cli/cmd_Shot.ts +5 -2
  52. package/src/cli/cmd_Smoke.ts +5 -2
  53. package/src/cli/cmd_Social.ts +226 -0
  54. package/src/cli/cmd_Sound.ts +1 -1
  55. package/src/cli/cmd_Start.ts +1 -1
  56. package/src/cli/cmd_Time.ts +1 -1
  57. package/src/cli/cmd_TraceAudit.ts +6 -6
  58. package/src/cli/cmd_Trailer.ts +7 -4
  59. package/src/cli/cmd_Veille.ts +173 -0
  60. package/src/cli/cmd_When.ts +2 -2
  61. package/src/cli/family-pages.ts +19 -16
  62. package/src/cli/registry.ts +13 -2
  63. package/src/cli.ts +5 -2
  64. package/src/collections/actions.ts +1 -49
  65. package/src/collections/checks.ts +2 -1
  66. package/src/collections/collection-types.ts +12 -3
  67. package/src/collections/providers.ts +4 -4
  68. package/src/collections/review.ts +3 -2
  69. package/src/collections/tests.ts +19 -8
  70. package/src/comfy/comfy-panel.ts +2 -2
  71. package/src/contracts/apply-contracts.ts +1 -3
  72. package/src/contracts/contract-manifests.ts +2 -3
  73. package/src/contracts/contract-types.ts +0 -1
  74. package/src/contracts/contracts-engine.ts +0 -3
  75. package/src/contracts/manifests/discord.contract.ts +1 -1
  76. package/src/contracts/manifests/identity.contract.ts +1 -1
  77. package/src/contracts/manifests/itch.contract.ts +1 -1
  78. package/src/contracts/manifests/steam.contract.ts +1 -1
  79. package/src/core/agent-dir-at.ts +12 -0
  80. package/src/core/agent-dir.ts +16 -0
  81. package/src/core/app-icon.ts +9 -3
  82. package/src/core/budget.ts +1 -1
  83. package/src/core/bun-builtins.ts +2 -2
  84. package/src/core/canonical-scripts.ts +2 -2
  85. package/src/core/discover-checks.ts +38 -6
  86. package/src/core/fix-scope.ts +4 -2
  87. package/src/core/floor-resolve.ts +68 -48
  88. package/src/core/floor.ts +9 -0
  89. package/src/core/git-root.ts +24 -0
  90. package/src/core/global-contribution.ts +4 -1
  91. package/src/core/ignored-block.ts +1 -1
  92. package/src/core/ignored-inputs.ts +3 -2
  93. package/src/core/last-good.ts +3 -1
  94. package/src/core/layout.ts +8 -0
  95. package/src/core/log-stamp.ts +36 -0
  96. package/src/core/loop-watch.ts +93 -0
  97. package/src/core/machine-link.ts +134 -0
  98. package/src/core/memory-watch.ts +41 -0
  99. package/src/core/motherhome.ts +2 -2
  100. package/src/core/one-way-in-policy.ts +34 -26
  101. package/src/core/run-ci.ts +9 -11
  102. package/src/core/run-fixers.ts +9 -9
  103. package/src/core/runs-matrix.ts +1 -1
  104. package/src/core/slots.ts +30 -0
  105. package/src/core/trace-audit.ts +50 -9
  106. package/src/core/tree-rev.ts +60 -0
  107. package/src/core/unit-files.ts +42 -0
  108. package/src/drill/render.ts +140 -0
  109. package/src/drill/run.ts +269 -0
  110. package/src/fleet/scan-fleet.ts +6 -5
  111. package/src/home/daemon-jobs.ts +201 -0
  112. package/src/home/global-context.ts +44 -8
  113. package/src/home/gui-app/ShipkitGui.swift +91 -2
  114. package/src/home/home-routes.ts +22 -15
  115. package/src/home/hubs.ts +10 -3
  116. package/src/home/inbox-shape.ts +54 -5
  117. package/src/home/inbox.ts +17 -2
  118. package/src/home/lib-watch.ts +10 -3
  119. package/src/home/machine-stores.ts +15 -29
  120. package/src/home/pm-config.ts +4 -1
  121. package/src/home/pm-inputs.ts +2 -0
  122. package/src/home/resources.ts +7 -2
  123. package/src/home/run-daemon.ts +15 -18
  124. package/src/home/run-pm.ts +3 -1
  125. package/src/home/serve-daemon.ts +4 -3
  126. package/src/home/serve-web.ts +104 -1
  127. package/src/hooks/commit-message.ts +29 -20
  128. package/src/hooks/hook-gates.ts +1 -1
  129. package/src/hooks/leak-guard.ts +69 -9
  130. package/src/hooks/run-hooks.ts +18 -22
  131. package/src/identities/identities.ts +334 -0
  132. package/src/identities/machine-route.ts +126 -0
  133. package/src/identities/machine.ts +62 -0
  134. package/src/init-repo.ts +3 -3
  135. package/src/ledger/check-stats.ts +10 -9
  136. package/src/ledger/gate-checks.ts +32 -1
  137. package/src/ledger/record-kept.ts +112 -0
  138. package/src/ledger/repo-view.ts +10 -0
  139. package/src/ledger/run-log.ts +17 -12
  140. package/src/ledger/run-timeline.ts +8 -4
  141. package/src/ledger/store.ts +7 -0
  142. package/src/ledger/suite-log.ts +17 -13
  143. package/src/media-kinds.ts +3 -2
  144. package/src/media-store/backup/daemon.ts +73 -0
  145. package/src/media-store/backup/keys.ts +25 -0
  146. package/src/media-store/backup/manifest.ts +193 -0
  147. package/src/media-store/backup/restore.ts +192 -0
  148. package/src/media-store/backup/run.ts +278 -0
  149. package/src/media-store/backup/secret.ts +86 -0
  150. package/src/media-store/backup/snapshot.ts +64 -0
  151. package/src/media-store/backup/sources.ts +199 -0
  152. package/src/media-store/content.ts +1 -1
  153. package/src/media-store/daemon.ts +56 -70
  154. package/src/media-store/db.ts +1 -1
  155. package/src/media-store/fact.ts +1 -1
  156. package/src/media-store/hand.ts +1 -1
  157. package/src/media-store/kind.ts +1 -1
  158. package/src/media-store/purge.ts +1 -1
  159. package/src/media-store/put.ts +5 -3
  160. package/src/media-store/remote.ts +1 -1
  161. package/src/media-store/space.ts +24 -5
  162. package/src/mv/mv-md.ts +63 -22
  163. package/src/pages/forward.ts +35 -0
  164. package/src/pages/frame-client.ts +118 -0
  165. package/src/pages/routes.ts +29 -0
  166. package/src/pages/unit.ts +92 -0
  167. package/src/plan/planner.ts +12 -0
  168. package/src/plan/repo-source.ts +19 -5
  169. package/src/reflect/transcript.ts +35 -10
  170. package/src/release/public-clean.ts +319 -0
  171. package/src/release/published-here.ts +22 -0
  172. package/src/release/run-bump.ts +3 -2
  173. package/src/release/run-release.ts +7 -4
  174. package/src/repo-config.ts +71 -13
  175. package/src/review/anim.ts +1 -1
  176. package/src/review/auto.ts +1 -1
  177. package/src/review/cells.ts +15 -1
  178. package/src/review/format.ts +2 -2
  179. package/src/review/http.ts +16 -2
  180. package/src/review/marks.ts +1 -1
  181. package/src/review/media-kind.ts +1 -1
  182. package/src/review/media-read.ts +1 -1
  183. package/src/review/model.ts +27 -6
  184. package/src/review/notes.ts +125 -0
  185. package/src/review/previews.ts +1 -1
  186. package/src/review/project.ts +7 -39
  187. package/src/review/role.ts +1 -1
  188. package/src/review/routes.ts +18 -14
  189. package/src/review/store.ts +42 -2
  190. package/src/review/threads.ts +1 -1
  191. package/src/review/trailer-desk.ts +3 -3
  192. package/src/review/trailer-media.ts +8 -5
  193. package/src/review/trailer-model.ts +1 -1
  194. package/src/review/trailer-routes.ts +1 -1
  195. package/src/review/trailer-shots.ts +22 -5
  196. package/src/review/unit.ts +2 -2
  197. package/src/scaffold/files/agent-handoff.md +3 -0
  198. package/src/scaffold/files/agent-index.md +4 -12
  199. package/src/scaffold/files/tsconfig.json +1 -1
  200. package/src/scaffold/project-scaffold.ts +6 -5
  201. package/src/serve/embed.ts +2 -2
  202. package/src/serve/hub-app/check-words.ts +1 -1
  203. package/src/serve/hub-app/col-card.tsx +3 -17
  204. package/src/serve/hub-app/col-tables-view.tsx +2 -1
  205. package/src/serve/hub-app/cols-svc.ts +0 -13
  206. package/src/serve/hub-app/dock-st.ts +4 -2
  207. package/src/serve/hub-app/dock-view.tsx +2 -0
  208. package/src/serve/hub-app/frames-st.ts +35 -0
  209. package/src/serve/hub-app/hash-route.ts +64 -1
  210. package/src/serve/hub-app/home-st.ts +32 -8
  211. package/src/serve/hub-app/home-strip.css +9 -1
  212. package/src/serve/hub-app/home-strip.tsx +7 -6
  213. package/src/serve/hub-app/home.html +5 -0
  214. package/src/serve/hub-app/hub-app.tsx +51 -7
  215. package/src/serve/hub-app/hub.css +29 -11
  216. package/src/serve/hub-app/icons.tsx +16 -1
  217. package/src/serve/hub-app/identities-st.ts +210 -0
  218. package/src/serve/hub-app/identities-view.tsx +353 -0
  219. package/src/serve/hub-app/identities.css +48 -0
  220. package/src/serve/hub-app/identity-address.ts +52 -0
  221. package/src/serve/hub-app/inbox-st.ts +60 -7
  222. package/src/serve/hub-app/inbox-view.tsx +49 -7
  223. package/src/serve/hub-app/inbox.css +12 -1
  224. package/src/serve/hub-app/index.html +3 -0
  225. package/src/serve/hub-app/kept-cols.tsx +30 -0
  226. package/src/serve/hub-app/keys.ts +10 -2
  227. package/src/serve/hub-app/list-walk.ts +89 -0
  228. package/src/serve/hub-app/machine-st.ts +12 -0
  229. package/src/serve/hub-app/media-svc.ts +1 -1
  230. package/src/serve/hub-app/media-view.tsx +2 -1
  231. package/src/serve/hub-app/pages-frames.tsx +134 -0
  232. package/src/serve/hub-app/pages-svc.ts +111 -0
  233. package/src/serve/hub-app/palette-st.ts +18 -3
  234. package/src/serve/hub-app/palette-view.tsx +9 -2
  235. package/src/serve/hub-app/planned-view.tsx +2 -1
  236. package/src/serve/hub-app/project-list.css +18 -14
  237. package/src/serve/hub-app/project-list.tsx +88 -49
  238. package/src/serve/hub-app/projects-svc.ts +33 -3
  239. package/src/serve/hub-app/repo-sections.ts +19 -2
  240. package/src/serve/hub-app/repo-st.ts +76 -20
  241. package/src/serve/hub-app/review/review-board.tsx +1 -1
  242. package/src/serve/hub-app/review/review-cells.tsx +6 -5
  243. package/src/serve/hub-app/review/review-kit.ts +30 -7
  244. package/src/serve/hub-app/review/review-page.tsx +6 -5
  245. package/src/serve/hub-app/review/review-st.ts +34 -15
  246. package/src/serve/hub-app/review/review-thread.tsx +63 -14
  247. package/src/serve/hub-app/review/review-views.tsx +133 -51
  248. package/src/serve/hub-app/review/thread-st.ts +80 -37
  249. package/src/serve/hub-app/review/trailer-page.tsx +7 -5
  250. package/src/serve/hub-app/review/trailer-st.ts +1 -1
  251. package/src/serve/hub-app/review.css +26 -9
  252. package/src/serve/hub-app/site/site-part.tsx +173 -0
  253. package/src/serve/hub-app/site/site-st.ts +157 -0
  254. package/src/serve/hub-app/site.css +35 -0
  255. package/src/serve/hub-app/social/calendar.tsx +182 -0
  256. package/src/serve/hub-app/social/comms-page.tsx +330 -0
  257. package/src/serve/hub-app/social/kit.tsx +244 -0
  258. package/src/serve/hub-app/social/post-card.tsx +456 -0
  259. package/src/serve/hub-app/social/problems.tsx +60 -0
  260. package/src/serve/hub-app/social/social-model.ts +154 -0
  261. package/src/serve/hub-app/social/social-page.tsx +681 -0
  262. package/src/serve/hub-app/social/social-st.ts +1014 -0
  263. package/src/serve/hub-app/social.css +289 -0
  264. package/src/serve/hub-app/stores/stores-page.tsx +312 -0
  265. package/src/serve/hub-app/stores/stores-st.ts +286 -0
  266. package/src/serve/hub-app/stores.css +54 -0
  267. package/src/serve/hub-app/timeline-geometry.ts +1 -1
  268. package/src/serve/hub-app/timeline-view.tsx +3 -2
  269. package/src/serve/hub-app/tree-build.ts +6 -0
  270. package/src/serve/hub-app/tree-row.tsx +27 -4
  271. package/src/serve/hub-app/tree-svc.ts +18 -49
  272. package/src/serve/hub-app/veille/veille-page.tsx +515 -0
  273. package/src/serve/hub-app/veille/veille-st.ts +443 -0
  274. package/src/serve/hub-app/veille.css +84 -0
  275. package/src/serve/hub-runtime.ts +20 -11
  276. package/src/serve/project-gutter-route.ts +44 -12
  277. package/src/serve/run-lanes.ts +7 -4
  278. package/src/serve/same-origin.ts +1 -1
  279. package/src/serve/serve-hub.ts +20 -12
  280. package/src/serve/tracked-watch.ts +24 -3
  281. package/src/serve/warm-cell.ts +5 -1
  282. package/src/shipkit-files.ts +15 -4
  283. package/src/shipkit.ts +0 -1
  284. package/src/shot/box.ts +160 -0
  285. package/src/shot/browser-slot.ts +74 -0
  286. package/src/shot/client.ts +42 -7
  287. package/src/shot/clip-encoder.ts +108 -24
  288. package/src/shot/film-box.ts +292 -0
  289. package/src/shot/shooter.ts +71 -17
  290. package/src/shot/shot-ask.ts +10 -2
  291. package/src/shot/stepped-clip.ts +5 -4
  292. package/src/site/desk.ts +242 -0
  293. package/src/site/routes.ts +66 -0
  294. package/src/site/unit.ts +62 -0
  295. package/src/social/brands.ts +22 -0
  296. package/src/social/card-drafts.ts +24 -0
  297. package/src/social/compose.ts +97 -0
  298. package/src/social/desk-index.ts +123 -0
  299. package/src/social/desk-wire.ts +64 -0
  300. package/src/social/drafts.ts +183 -0
  301. package/src/social/house.ts +24 -0
  302. package/src/social/load.ts +332 -0
  303. package/src/social/md.ts +70 -0
  304. package/src/social/media-facts.ts +53 -0
  305. package/src/social/media-kind.ts +189 -0
  306. package/src/social/media-limit.ts +42 -0
  307. package/src/social/media-of.ts +30 -0
  308. package/src/social/migrate.ts +123 -0
  309. package/src/social/open.ts +17 -0
  310. package/src/social/post-url.ts +158 -0
  311. package/src/social/presence.ts +332 -0
  312. package/src/social/public-read.ts +53 -0
  313. package/src/social/publish/bluesky.ts +168 -0
  314. package/src/social/publish/discord.ts +76 -0
  315. package/src/social/publish/index.ts +24 -0
  316. package/src/social/publish/secret.ts +13 -0
  317. package/src/social/push.ts +37 -0
  318. package/src/social/richtext.ts +37 -0
  319. package/src/social/routes.ts +186 -0
  320. package/src/social/stats.ts +134 -0
  321. package/src/social/text.ts +267 -0
  322. package/src/social/tracker-route.ts +39 -0
  323. package/src/social/tracker.ts +255 -0
  324. package/src/social/unit.ts +53 -0
  325. package/src/social/writes.ts +130 -0
  326. package/src/start-repo.ts +14 -9
  327. package/src/stores/collection.ts +27 -0
  328. package/src/stores/desk.ts +336 -0
  329. package/src/stores/model.ts +187 -0
  330. package/src/stores/routes.ts +126 -0
  331. package/src/stores/unit.ts +57 -0
  332. package/src/suite/calibrate.ts +127 -0
  333. package/src/suite/core-counters.ts +91 -0
  334. package/src/suite/judge-suites.ts +95 -35
  335. package/src/suite/suite-cli.ts +44 -10
  336. package/src/suite/suite-cpu-preload.ts +34 -9
  337. package/src/trace/tracer.ts +12 -5
  338. package/src/trailer/adapter.ts +5 -1
  339. package/src/trailer/build.ts +45 -12
  340. package/src/trailer/ffmpeg.ts +11 -0
  341. package/src/trailer/footage.ts +30 -13
  342. package/src/trailer/grammar.ts +18 -2
  343. package/src/trailer/graph.ts +28 -6
  344. package/src/trailer/holes.ts +1 -1
  345. package/src/trailer/passage.ts +18 -6
  346. package/src/trailer/plan.ts +74 -3
  347. package/src/trailer/prune.ts +1 -1
  348. package/src/trailer/states.ts +1 -1
  349. package/src/trailer/stitch.ts +67 -26
  350. package/src/trailer/url.ts +1 -1
  351. package/src/trailer/versions.ts +24 -0
  352. package/src/trailer/words.ts +1 -1
  353. package/src/ts/gate-typecheck.ts +32 -0
  354. package/src/ts/typecheck-cli.ts +9 -11
  355. package/src/tui/run-tui.ts +1 -1
  356. package/src/tui/tui-app.tsx +0 -1
  357. package/src/tui/tui-store.ts +1 -1
  358. package/src/veille/asks.ts +155 -0
  359. package/src/veille/auto.ts +31 -0
  360. package/src/veille/batch.ts +27 -0
  361. package/src/veille/chrome.ts +127 -0
  362. package/src/veille/collection.ts +28 -0
  363. package/src/veille/desk.ts +242 -0
  364. package/src/veille/identity.ts +80 -0
  365. package/src/veille/import.ts +68 -0
  366. package/src/veille/log.ts +183 -0
  367. package/src/veille/platforms.ts +118 -0
  368. package/src/veille/reads.ts +66 -0
  369. package/src/veille/replied.ts +110 -0
  370. package/src/veille/routes.ts +185 -0
  371. package/src/veille/service.ts +81 -0
  372. package/src/veille/watch.ts +116 -0
  373. package/src/veille/worth.ts +46 -0
  374. package/src/wiki/scan-md.ts +18 -0
  375. package/src/collections/posts.ts +0 -142
  376. package/src/contracts/manifests/social.contract.ts +0 -20
  377. package/src/scaffold/files/agent-coding.md +0 -35
  378. package/src/ts/typecheck-cache.ts +0 -11
@@ -0,0 +1,210 @@
1
+ // the identity view's state (wiki tools/shipkit/social.md, Identities; home.md, Identities): every identity as the
2
+ // daemon reads its folder, the one picked from the address (`/identities#<id>[/<part>[/<place>]]`), and the desk
3
+ // its accounts, setup and messages come from. The desk is a repo's Social desk read again: its identities are the
4
+ // machine's whatever the repo, its drafts that repo's, so an identity reads the desk of the repo that speaks as it
5
+ // with the most drafts
6
+ import { makeAutoObservable, observableRef, runInAction } from 'mobx'
7
+ import type { DataPlace, IdentitiesAnswer, MachineIdentity } from '../../identities/machine-route.ts'
8
+ import type { HomeSt } from './home-st.ts'
9
+ import { identityRows, isSection, type IdentityRow, type IdentitySel } from './identity-address.ts'
10
+ import { walkKey, WalkEntry, type WalkHost } from './list-walk.ts'
11
+ import { ownTrouble, reach } from './reach.ts'
12
+ import { LEGAL } from './social/social-model.ts'
13
+ import { SocialSt } from './social/social-st.ts'
14
+
15
+ export class IdentitiesSt implements WalkHost<IdentityRow> {
16
+ data: IdentitiesAnswer | null = null
17
+ error = ''
18
+ loading = false
19
+ /** what the address picked */
20
+ sel: IdentitySel = { id: null, part: null, place: null }
21
+ /** what the last open said, or why it failed */
22
+ note = ''
23
+ /** the desk the shown identity reads (applyDesk) */
24
+ desk: SocialSt | null = null
25
+ /** one desk per repo read, kept for the life of the page */
26
+ private desks = new Map<string, SocialSt>()
27
+ private gen = 0
28
+ /** the list's filter, `/` focuses it */
29
+ query = ''
30
+ searchEl: HTMLInputElement | null = null
31
+ /** the row the arrows last landed on; a click or an address clears it. A repo row under it opens only on Enter */
32
+ cursor: string | null = null
33
+ /** a walk with the arrows is one history entry (HomeSt.show asks it) */
34
+ readonly entry = new WalkEntry()
35
+
36
+ constructor(private readonly st: HomeSt) {
37
+ makeAutoObservable<this, 'st' | 'gen' | 'desks'>(this, { st: false, gen: false, desks: false, entry: false, searchEl: false, data: observableRef, desk: observableRef })
38
+ }
39
+
40
+ start(): void {
41
+ void this.load()
42
+ }
43
+
44
+ /** read once for the picker, never again while it holds them */
45
+ ensure(): void {
46
+ if (this.data == null && !this.loading) void this.load()
47
+ }
48
+
49
+ select(sel: IdentitySel): void {
50
+ this.sel = sel
51
+ this.cursor = null
52
+ this.applyDesk()
53
+ }
54
+
55
+ setQuery(q: string): void {
56
+ this.query = q
57
+ }
58
+
59
+ // ── the list and its keys: the repo tree's (list-walk.ts) ────────────
60
+
61
+ /** the shown identity's rows, the filter applied */
62
+ get rows(): IdentityRow[] {
63
+ const i = this.shown
64
+ if (i == null) return []
65
+ return identityRows(i, this.desk?.identityOf(i.id)?.legal != null, this.query)
66
+ }
67
+
68
+ /** the row of the part shown */
69
+ home(rows: readonly IdentityRow[]): number {
70
+ return rows.findIndex((r) => r.repo == null && r.part === this.sel.part)
71
+ }
72
+
73
+ /** the row lit: the cursor's, else the part shown's */
74
+ get lit(): string | null {
75
+ const rows = this.rows
76
+ return this.cursor ?? rows[this.home(rows)]?.key ?? null
77
+ }
78
+
79
+ inert(): boolean {
80
+ return false
81
+ }
82
+
83
+ /** an arrow on a part opens it at once, one history entry for the walk; on a repo it only takes the cursor */
84
+ land(row: IdentityRow): void {
85
+ const id = this.shownId
86
+ if (row.repo == null) this.entry.run(() => this.st.openIdentity({ id, part: row.part, place: null }))
87
+ this.cursor = row.key
88
+ }
89
+
90
+ activate(row: IdentityRow): void {
91
+ const id = this.shownId
92
+ if (row.repo != null && id != null) this.openRepo(row.repo, id)
93
+ else this.st.openIdentity({ id, part: row.part, place: null })
94
+ }
95
+
96
+ isOpen(): boolean {
97
+ return false
98
+ }
99
+
100
+ toggle(): void {}
101
+
102
+ /** true = the key was the list's */
103
+ key(k: string): boolean {
104
+ return walkKey(this, k)
105
+ }
106
+
107
+ /** the identity on screen: the one the address names, else the first */
108
+ get shown(): MachineIdentity | null {
109
+ const ids = this.data?.identities ?? []
110
+ return ids.find((i) => i.id === this.sel.id) ?? (this.sel.id == null ? ids[0] ?? null : null)
111
+ }
112
+
113
+ get shownId(): string | null {
114
+ return this.shown?.id ?? this.sel.id
115
+ }
116
+
117
+ /** the repo whose desk the identity reads: the one speaking as it with the most drafts, else the first speaking as
118
+ * it, else the first repo of the list (an identity no repo speaks as has no drafts, its accounts are the same) */
119
+ deskRepo(i: MachineIdentity): string | null {
120
+ const drafts = i.data.filter((p) => p.place === 'drafts' && p.repo != null && (p.count ?? 0) > 0).sort((a, b) => (b.count ?? 0) - (a.count ?? 0))
121
+ return drafts[0]?.repo ?? i.repos[0] ?? this.st.projects.list[0]?.name ?? null
122
+ }
123
+
124
+ /** the other repos speaking as it that hold drafts: their Communications are a click away */
125
+ otherDrafts(i: MachineIdentity): DataPlace[] {
126
+ const own = this.deskRepo(i)
127
+ return i.data.filter((p) => p.place === 'drafts' && p.repo != null && p.repo !== own && (p.count ?? 0) > 0)
128
+ }
129
+
130
+ private deskOf(repo: string): SocialSt {
131
+ let d = this.desks.get(repo)
132
+ if (d == null) {
133
+ const home = this.st
134
+ d = new SocialSt(home.repo(repo), {
135
+ social: (identity, account, place) => home.openIdentity({ id: identity, part: account, place }),
136
+ draft: (slug) => {
137
+ home.repo(repo).showComms(slug, null)
138
+ home.select(repo)
139
+ },
140
+ })
141
+ this.desks.set(repo, d)
142
+ }
143
+ return d
144
+ }
145
+
146
+ /** the desk shows what the address picked: the company, an account and its place, else the identity */
147
+ private applyDesk(): void {
148
+ const i = this.shown
149
+ const repo = i == null ? null : this.deskRepo(i)
150
+ const d = repo == null ? null : this.deskOf(repo)
151
+ this.desk = d
152
+ if (i == null || d == null) return
153
+ const part = this.sel.part
154
+ if (part === LEGAL) d.selectSocial(i.id, LEGAL, null)
155
+ else if (part == null || isSection(part)) d.selectSocial(i.id, null, null)
156
+ else d.selectSocial(i.id, part, this.sel.place)
157
+ }
158
+
159
+ /** the hub of the desk's repo, started when it is down */
160
+ ensureHub(): void {
161
+ const i = this.shown
162
+ const repo = i == null ? null : this.deskRepo(i)
163
+ if (repo != null && this.st.machine?.data != null) void this.st.machine.hub(repo, 'ensure')
164
+ }
165
+
166
+ async load(): Promise<void> {
167
+ const id = ++this.gen
168
+ this.loading = true
169
+ try {
170
+ const r = await reach('/api/home/identities.json', { cache: 'no-store' })
171
+ if (!r.ok) throw new Error(`${r.status} ${await r.text()}`)
172
+ const j = (await r.json()) as IdentitiesAnswer
173
+ runInAction(() => {
174
+ if (id !== this.gen) return
175
+ this.data = j
176
+ this.error = ''
177
+ this.applyDesk()
178
+ })
179
+ } catch (e) {
180
+ runInAction(() => { if (id === this.gen) this.error = ownTrouble(e, this.st.machine, (m) => `the identities could not be read: ${m}`) })
181
+ } finally {
182
+ runInAction(() => { if (id === this.gen) this.loading = false })
183
+ }
184
+ }
185
+
186
+ /** a place of an identity's data, in VS Code or the Finder: the daemon resolves the path from the two names */
187
+ async open(identity: string, p: DataPlace, app: 'code' | 'finder'): Promise<void> {
188
+ try {
189
+ const r = await reach('/api/home/identities/open', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ id: identity, place: p.place, repo: p.repo, app }) })
190
+ if (!r.ok) throw new Error(await r.text())
191
+ runInAction(() => { this.note = `opened ${p.shown} in ${app === 'code' ? 'VS Code' : 'the Finder'}` })
192
+ } catch (e) {
193
+ runInAction(() => { this.note = ownTrouble(e, this.st.machine, (m) => `open ${p.shown}: ${m}`) })
194
+ }
195
+ }
196
+
197
+ /** a repo of an identity: its Social page */
198
+ openRepo(repo: string, identity: string): void {
199
+ this.st.repo(repo).showSocial(identity)
200
+ this.st.select(repo)
201
+ }
202
+
203
+ /** a repo's own page of the identity: its Veille, its Communications */
204
+ openRepoPage(repo: string, page: 'veille' | 'comms'): void {
205
+ const r = this.st.repo(repo)
206
+ if (page === 'veille') r.showVeille(null)
207
+ else r.showComms(null)
208
+ this.st.select(repo)
209
+ }
210
+ }
@@ -0,0 +1,353 @@
1
+ // `/identities#<id>[/<part>[/<place>]]`: one identity (wiki tools/shipkit/social.md, Identities). On the left its
2
+ // head, its sections (profile, company, Veille, site), one row per account with the platform's logo and its state,
3
+ // the repos that speak as it; on the right the part picked: the profile (rows, brand, links, pictures, where its data
4
+ // lives), the company, the Veille, the site (site/site-part.tsx), or an account's whole page (its head, setup, places, profile, the drafts
5
+ // waiting for it). Its parts are the repo Social page's (social-page.tsx), on a desk the identity reads (identities-st.ts)
6
+ import { observer } from 'mobx-react-lite'
7
+ import { useEffect, type CSSProperties, type ReactNode } from 'react'
8
+ import { Panel, Separator } from 'react-resizable-panels'
9
+ import { KeptCols } from './kept-cols.tsx'
10
+ import type { DataPlace, MachineIdentity } from '../../identities/machine-route.ts'
11
+ import type { HomeSt } from './home-st.ts'
12
+ import { plainClick, repoPage } from './home-st.ts'
13
+ import type { IdentitiesSt } from './identities-st.ts'
14
+ import { identityAddress, isSection, type IdentityRow } from './identity-address.ts'
15
+ import { isTreeWalk, SEARCH_KEY } from './keys.ts'
16
+ import { useInSight } from './tree-row.tsx'
17
+ import { PANEL } from './review/review-page.tsx'
18
+ import { SitePart } from './site/site-part.tsx'
19
+ import { Icon, ICON } from './icons.tsx'
20
+ import { ErrorLine, KeptFold, Lightbox, Logo, Toast } from './social/kit.tsx'
21
+ import { Problems } from './social/problems.tsx'
22
+ import { AccountProfile, IdentityMedia, IdentityPage, LegalPage, LegalPlatforms, Messages, PlacePane, PlatformHeader } from './social/social-page.tsx'
23
+ import { LEGAL, ME, type DeskAccount, type DeskIdentity } from './social/social-model.ts'
24
+ import type { SocialSt } from './social/social-st.ts'
25
+
26
+ const Mark = ({ i, px }: { i: MachineIdentity; px: number }) => {
27
+ const style = { width: px, height: px, ...(i.colour == null ? {} : { '--idc': i.colour }) } as CSSProperties
28
+ return i.mark != null ? <img className="idmark" src={i.mark} alt="" width={px} height={px} style={style} /> : <span className="idmark idini" style={{ ...style, fontSize: px * 0.45 }}>{i.name.charAt(0).toUpperCase()}</span>
29
+ }
30
+
31
+ /** a link of the view: an address of the home, opened in place on a plain click */
32
+ const Go = observer(({ app, to, cls, title, lit, children }: { app: HomeSt; to: { part: string | null; place?: string | null }; cls: string; title?: string; lit?: boolean; children: ReactNode }) => {
33
+ const sel = { id: app.identities.shownId, part: to.part, place: to.place ?? null }
34
+ const el = useInSight<HTMLAnchorElement>(lit === true)
35
+ return (
36
+ <a ref={el} className={cls} href={identityAddress(sel)} title={title} onClick={(e) => {
37
+ if (!plainClick(e)) return
38
+ e.preventDefault()
39
+ app.openIdentity(sel)
40
+ }}>{children}</a>
41
+ )
42
+ })
43
+
44
+ /** a plain click on a link of the home: run it in place; any other click keeps the browser's own behaviour */
45
+ const inPlace = (run: () => void) => (e: { button: number; metaKey: boolean; ctrlKey: boolean; shiftKey: boolean; altKey: boolean; preventDefault(): void }): void => {
46
+ if (!plainClick(e)) return
47
+ e.preventDefault()
48
+ run()
49
+ }
50
+
51
+ export const IdentitiesView = observer(({ app }: { app: HomeSt }) => {
52
+ const st = app.identities
53
+ const so = st.desk
54
+ useEffect(() => {
55
+ if (so == null) return
56
+ st.ensureHub()
57
+ so.start()
58
+ return () => so.stop()
59
+ }, [so, st])
60
+ const i = st.shown
61
+ if (i == null)
62
+ return (
63
+ <div className="hall activity identities">
64
+ {st.error !== '' ? <div className="hnote">{st.error}</div> : null}
65
+ {st.data?.errors.map((e) => <div key={e} className="hnote">{e}</div>)}
66
+ {st.data == null && st.error === '' ? <div className="iddim"><span className="spin" />reading the identities folder…</div> : null}
67
+ {st.data != null && st.sel.id != null ? <div className="hnote">no identity « {st.sel.id} » in {st.data.dir ?? 'the house repo'}: {st.data.identities.map((x) => x.name).join(', ') || 'none'}</div> : null}
68
+ {st.data != null && st.data.identities.length === 0 ? <div className="iddim">no identity: write .shipkit/identities/&lt;id&gt;/identity.md in the house repo</div> : null}
69
+ </div>
70
+ )
71
+ return (
72
+ <div className="so-page idview">
73
+ <KeptCols id="identities">
74
+ <Panel id="identity-list" defaultSize="30%" minSize={260} className="rv-pane" style={PANEL}>
75
+ <IdentityList app={app} i={i} />
76
+ </Panel>
77
+ <Separator className="rsep" />
78
+ <Panel id="identity-page" minSize={420} className="rv-pane" style={PANEL}>
79
+ <div className="rv-scroll so-ground">
80
+ <PartPage app={app} i={i} />
81
+ </div>
82
+ </Panel>
83
+ </KeptCols>
84
+ {so == null ? null : <Lightbox so={so} />}
85
+ {so == null ? null : <Toast so={so} />}
86
+ </div>
87
+ )
88
+ })
89
+
90
+ /** the desk's own view of the identity: its rows, pictures, company and accounts; null until the desk answers */
91
+ const deskOf = (so: SocialSt | null, i: MachineIdentity): DeskIdentity | null => so?.identityOf(i.id) ?? null
92
+
93
+ /** the list: its head and filter stay in reach, the problems and the blocks under them scroll as one column; every row is
94
+ * the walk's (identities-st.ts rows), lit where the cursor or the part shown sits */
95
+ const IdentityList = observer(({ app, i }: { app: HomeSt; i: MachineIdentity }) => {
96
+ const st = app.identities
97
+ const so = st.desk
98
+ const d = deskOf(so, i)
99
+ const online = i.accounts.filter((a) => a.live !== '').length
100
+ const style = i.colour == null ? undefined : ({ '--idc': i.colour } as CSSProperties)
101
+ const problems = [
102
+ ...(st.error !== '' ? [st.error] : []),
103
+ ...(st.data?.errors ?? []),
104
+ ...(st.data?.strays.map((x) => `${x.repo} speaks as ${x.speaksAs}, which no folder holds`) ?? []),
105
+ ...(so?.loadError ? [so.loadError] : []),
106
+ ...(so?.errors ?? []),
107
+ ]
108
+ const rows = st.rows
109
+ const block = (b: IdentityRow['block']) => rows.filter((r) => r.block === b)
110
+ const accounts = block('accounts')
111
+ const repos = block('repos')
112
+ const filtered = st.query.trim() !== ''
113
+ return (
114
+ <div className="idcol" style={style}>
115
+ <header className="idhead" title={`${i.id}${i.default ? ': the default identity, it speaks for every repo whose repo.config.ts names no speaksAs' : ''}`}>
116
+ <Mark i={i} px={28} />
117
+ <div className="idtitle">
118
+ <b>{i.name}</b>
119
+ {i.bio === '' ? null : <span className="iddim">{i.bio}</span>}
120
+ </div>
121
+ </header>
122
+ <div className="ssearch">
123
+ <span className="sfield">
124
+ <input ref={(el) => { st.searchEl = el }} placeholder="filter" aria-label="filter the accounts, sections and repos by name or handle" value={st.query}
125
+ onChange={(e) => st.setQuery(e.target.value)}
126
+ onKeyDown={(e) => { if (e.key === 'Escape') st.setQuery(''); else if (isTreeWalk(e.key) && st.key(e.key)) e.preventDefault() }} />
127
+ <kbd className="skey">{SEARCH_KEY}</kbd>
128
+ </span>
129
+ </div>
130
+ <div className="rv-scroll idlist">
131
+ <Problems so={so} lines={problems} />
132
+ <nav className="idrows" aria-label={`${i.name}: its sections`}>
133
+ {block('sections').map((r) => <SectionRow key={r.key} app={app} i={i} d={d} r={r} />)}
134
+ </nav>
135
+ {filtered && accounts.length === 0 ? null : <div className="idband">accounts <span>{filtered ? `${accounts.length} of ${i.accounts.length}` : `${online}/${i.accounts.length}`}</span></div>}
136
+ <nav className="idrows" aria-label={`${i.name}: its accounts`}>
137
+ {accounts.map((r) => <AccountRow key={r.key} app={app} i={i} d={d} r={r} />)}
138
+ </nav>
139
+ {filtered && repos.length === 0 ? null : <div className="idband">repos <span>{filtered ? `${repos.length} of ${i.repos.length}` : i.repos.length}</span></div>}
140
+ <nav className="idrows" aria-label={`${i.name}: its repos`}>
141
+ {i.repos.length === 0 ? <span className="iddim idrow">none speaks as it</span> : repos.map((r) => <RepoRow key={r.key} app={app} i={i} r={r} />)}
142
+ </nav>
143
+ {filtered && rows.length === 0 ? <div className="iddim idrow">nothing holds « {st.query.trim()} »</div> : null}
144
+ </div>
145
+ </div>
146
+ )
147
+ })
148
+
149
+ const rowCls = (app: HomeSt, r: IdentityRow, more = ''): string => `idrow${app.identities.lit === r.key ? ' on' : ''}${more}`
150
+
151
+ const SectionRow = observer(({ app, i, d, r }: { app: HomeSt; i: MachineIdentity; d: DeskIdentity | null; r: IdentityRow }) => {
152
+ const so = app.identities.desk
153
+ const lit = app.identities.lit === r.key
154
+ if (r.part == null)
155
+ return (
156
+ <Go app={app} to={{ part: null }} cls={rowCls(app, r)} lit={lit} title="its profile rows, its brand, its links and pictures, where its data lives">
157
+ <Icon d={ICON.social} /><span className="idgrow">profile</span>
158
+ </Go>
159
+ )
160
+ if (r.part === LEGAL) {
161
+ const legal = d?.legal != null && so != null && so.legalLive(d)
162
+ return (
163
+ <Go app={app} to={{ part: LEGAL }} cls={rowCls(app, r)} lit={lit} title={`the company: every fact a form asks, payouts and taxes by platform; ${legal ? 'registered' : 'still to register'}`}>
164
+ <Icon d={ICON.contracts} /><span className="idgrow">company</span><i className={`iddot${legal ? ' live' : ''}`} />
165
+ </Go>
166
+ )
167
+ }
168
+ if (r.part === '@veille')
169
+ return (
170
+ <Go app={app} to={{ part: '@veille' }} cls={rowCls(app, r)} lit={lit} title="the posts it scrolls past, ranked by the worth of a reply">
171
+ <Icon d={ICON.veille} /><span className="idgrow">veille</span>
172
+ </Go>
173
+ )
174
+ return (
175
+ <Go app={app} to={{ part: '@site' }} cls={rowCls(app, r)} lit={lit} title={i.site === '' ? 'its website: none named' : `its website, ${i.site}`}>
176
+ <Icon d={ICON.browser} /><span>site</span><span className="iddim idgrow so-ellip">{i.site.replace(/^https?:\/\/(www\.)?/, '')}</span>
177
+ </Go>
178
+ )
179
+ })
180
+
181
+ const AccountRow = observer(({ app, i, d, r }: { app: HomeSt; i: MachineIdentity; d: DeskIdentity | null; r: IdentityRow }) => {
182
+ const so = app.identities.desk
183
+ const m = i.accounts.find((x) => x.id === r.part)
184
+ if (m == null) return null
185
+ const a = d?.accounts.find((x) => x.id === m.id) ?? null
186
+ const c = a == null || so == null ? null : so.counts(a)
187
+ const stat = a == null ? undefined : so?.statOf(a)
188
+ const live = m.live !== ''
189
+ return (
190
+ <Go app={app} to={{ part: m.id }} cls={rowCls(app, r, live ? '' : ' off')} lit={app.identities.lit === r.key}
191
+ title={[`${m.name}${m.handle === '' ? '' : ` ${m.handle}`}`, live ? 'online' : 'still to create', stat, c != null && c.waiting > 0 ? `${c.waiting} messages to post` : ''].filter(Boolean).join(' · ')}>
192
+ <Logo id={m.id} name={m.name} size={16} muted={!live} />
193
+ <span className="idname">{m.name}</span>
194
+ <span className="iddim idgrow so-ellip">{m.handle}</span>
195
+ {c != null && c.waiting > 0 ? <b className="idnum">{c.waiting}</b> : null}
196
+ <i className={`iddot${live ? ' live' : ''}`} />
197
+ </Go>
198
+ )
199
+ })
200
+
201
+ /** a repo that speaks as it: the arrows only point at it, Enter or a click opens its Social page */
202
+ const RepoRow = observer(({ app, i, r }: { app: HomeSt; i: MachineIdentity; r: IdentityRow }) => {
203
+ const st = app.identities
204
+ const repo = r.repo!
205
+ const el = useInSight<HTMLAnchorElement>(st.lit === r.key)
206
+ return (
207
+ <a ref={el} className={rowCls(app, r)} href={`${repoPage(repo)}#page:social:${i.id}`} title={`${repo}: its Social page (Enter)`} onClick={inPlace(() => st.openRepo(repo, i.id))}>
208
+ <Icon d={ICON.repo} />
209
+ <span className="idgrow so-ellip">{repo}</span>
210
+ {draftsOf(i, repo) == null ? null : <span className="iddim" title="its drafts">{draftsOf(i, repo)}</span>}
211
+ </a>
212
+ )
213
+ })
214
+
215
+ const draftsOf = (i: MachineIdentity, repo: string): number | null => {
216
+ const n = i.data.find((p) => p.place === 'drafts' && p.repo === repo)?.count ?? 0
217
+ return n > 0 ? n : null
218
+ }
219
+
220
+ const PartPage = observer(({ app, i }: { app: HomeSt; i: MachineIdentity }) => {
221
+ const st = app.identities
222
+ const so = st.desk
223
+ const part = st.sel.part
224
+ if (part === '@veille') return <VeillePart app={app} i={i} />
225
+ if (part === '@site') return <SitePart app={app} i={i} />
226
+ const d = deskOf(so, i)
227
+ if (so == null || d == null) return <div className="rv-empty">{so?.loadError ?? so?.waitText ?? 'no repo to read the desk from'}</div>
228
+ if (part === LEGAL) {
229
+ if (d.legal == null) return <div className="rv-empty">{i.name} has no company: a legal.md in its folder</div>
230
+ return (
231
+ <div className="idpage">
232
+ <LegalPage so={so} i={d} />
233
+ <LegalPlatforms so={so} i={d} />
234
+ </div>
235
+ )
236
+ }
237
+ if (part == null || isSection(part))
238
+ return (
239
+ <div className="idpage">
240
+ <IdentityPage so={so} i={d} />
241
+ {d.pictures.length > 0 ? <IdentityMedia so={so} i={d} /> : null}
242
+ <DataPlaces st={st} i={i} />
243
+ </div>
244
+ )
245
+ const a = d.accounts.find((x) => x.id === part)
246
+ if (a == null) return <div className="rv-empty">{i.name} has no account « {part} »: {d.accounts.map((x) => x.id).join(', ')}</div>
247
+ return <AccountPart app={app} i={i} so={so} a={a} />
248
+ })
249
+
250
+ /** an account's whole page: its head, setup and profile URL; its places; its profile; the drafts waiting for it */
251
+ const AccountPart = observer(({ app, i, so, a }: { app: HomeSt; i: MachineIdentity; so: SocialSt; a: DeskAccount }) => {
252
+ const st = app.identities
253
+ const place = so.currentPlace
254
+ const others = st.otherDrafts(i)
255
+ return (
256
+ <div className="idpage">
257
+ <div className="so-colin">
258
+ <ErrorLine so={so} />
259
+ <PlatformHeader so={so} a={a} />
260
+ {a.id === 'site' ? (
261
+ <Go app={app} to={{ part: '@site' }} cls="idrow" title="the site section: its pages live from the local preview, what changed since the deploy, the deploy">
262
+ <Icon d={ICON.browser} /><span className="idgrow">its pages, preview and deploy: the site section</span>
263
+ </Go>
264
+ ) : null}
265
+ {a.places.length > 0 ? (
266
+ <KeptFold so={so} card={`places/${a.identity}/${a.id}`} title="Places" flush right={<span className="rv-dim rv-small">{a.places.length}</span>}>
267
+ {[{ id: ME, name: 'my profile', when: '' }, ...a.places].map((x) => {
268
+ const c = so.counts(a, x.id)
269
+ return (
270
+ <Go key={x.id} app={app} to={{ part: a.id, place: so.place === x.id ? null : x.id }} cls={`so-placerow${so.place === x.id ? ' on' : ''}`}>
271
+ <span className={`so-pdot${so.placeDone(a, x.id) ? ' done' : ''}`} />
272
+ <b className="so-ellip so-pname">{x.name}</b>
273
+ <span className="rv-dim so-ellip so-grow">{x.when}</span>
274
+ {c.waiting > 0 || c.posted > 0 ? <span className="rv-dim">{c.waiting > 0 ? `${c.waiting} to post` : `${c.posted} posted`}</span> : null}
275
+ </Go>
276
+ )
277
+ })}
278
+ </KeptFold>
279
+ ) : null}
280
+ {place != null ? <PlacePane so={so} a={a} place={place} /> : null}
281
+ </div>
282
+ <AccountProfile so={so} a={a} />
283
+ <div className="so-colin">
284
+ <Messages so={so} a={a} />
285
+ <span className="rv-dim rv-small">
286
+ the drafts of {so.repoName}
287
+ {others.length === 0 ? null : (
288
+ <>
289
+ ; the drafts of{' '}
290
+ {others.map((p, n) => (
291
+ <span key={p.repo}>
292
+ {n > 0 ? ', ' : ''}
293
+ <a href={`${repoPage(p.repo!)}#page:comms`} onClick={inPlace(() => st.openRepoPage(p.repo!, 'comms'))}>{p.repo}</a> ({p.count})
294
+ </span>
295
+ ))}{' '}
296
+ are in their Communications
297
+ </>
298
+ )}
299
+ </span>
300
+ </div>
301
+ </div>
302
+ )
303
+ })
304
+
305
+ /** the Veille of the identity: its log on this machine, and each repo's Veille page, which reads it */
306
+ const VeillePart = observer(({ app, i }: { app: HomeSt; i: MachineIdentity }) => {
307
+ const st = app.identities
308
+ const log = i.data.filter((p) => p.place === 'veille')
309
+ return (
310
+ <div className="idpage so-colin">
311
+ <h2 className="so-h so-big">{i.name} <span className="rv-dim so-light">· the Veille</span></h2>
312
+ <p className="iddim">the posts its Chrome profile scrolls past, ranked by the worth of a reply: the extension posts them to the daemon, one log per identity, on this machine only</p>
313
+ <table className="iddata"><tbody>{log.map((p) => <DataRow key={p.place} st={st} i={i} p={p} />)}</tbody></table>
314
+ <b className="so-section">Open it</b>
315
+ {i.repos.length === 0 ? <span className="iddim">no repo speaks as it: a repo's Veille page shows the identity it speaks as</span> : i.repos.slice(0, 1).map((r) => (
316
+ <a key={r} className="idrow" href={`${repoPage(r)}#page:veille`} onClick={inPlace(() => st.openRepoPage(r, 'veille'))}>its Veille, in {r} ↗</a>
317
+ ))}
318
+ </div>
319
+ )
320
+ })
321
+
322
+ const DataRow = observer(({ st, i, p }: { st: IdentitiesSt; i: MachineIdentity; p: DataPlace }) => (
323
+ <tr>
324
+ <td className="idwhat">{p.label}{p.count == null ? null : <span className="iddim"> · {p.count} {p.place === 'veille' ? `day${p.count === 1 ? '' : 's'}` : `draft${p.count === 1 ? '' : 's'}`}</span>}</td>
325
+ <td className="idpath"><code title={p.shown}>{p.shown}</code>{p.exists ? null : <span className="iddim"> not there yet</span>}</td>
326
+ <td className="idopen">
327
+ <button className="ghost" disabled={!p.exists} title={`open ${p.shown} in VS Code`} onClick={() => void st.open(i.id, p, 'code')}>VS Code</button>
328
+ <button className="ghost" disabled={!p.exists} title={`show ${p.shown} in the Finder`} onClick={() => void st.open(i.id, p, 'finder')}>Finder</button>
329
+ </td>
330
+ </tr>
331
+ ))
332
+
333
+ /** where the identity's data lives on disk, each place a click to VS Code or the Finder */
334
+ const DataPlaces = observer(({ st, i }: { st: IdentitiesSt; i: MachineIdentity }) => {
335
+ const shown = i.data.filter((p) => p.exists || p.place !== 'drafts')
336
+ const empty = i.data.filter((p) => p.place === 'drafts' && !p.exists)
337
+ return (
338
+ <div className="so-colin">
339
+ <b className="so-section">Where its data lives</b>
340
+ {st.note !== '' ? <div className="iddim idnote">{st.note}</div> : null}
341
+ <table className="iddata">
342
+ <tbody>
343
+ {shown.map((p) => <DataRow key={`${p.place}/${p.repo ?? ''}`} st={st} i={i} p={p} />)}
344
+ {empty.length === 0 ? null : (
345
+ <tr>
346
+ <td colSpan={3} className="iddim" title={empty.map((p) => p.repo).join(', ')}>{empty.length} other repo{empty.length === 1 ? '' : 's'} speaking as it: no drafts yet (a repo's first draft makes its .shipkit/social/drafts/)</td>
347
+ </tr>
348
+ )}
349
+ </tbody>
350
+ </table>
351
+ </div>
352
+ )
353
+ })
@@ -0,0 +1,48 @@
1
+ /* the identity view (identities-view.tsx): two panels, the identity's list on the left (its head, its filter, its
2
+ sections, one row per account, its repos), the part picked on the right, drawn with the Social page's parts (social.css). The data
3
+ places a table of what, where, and two open buttons */
4
+ .idview{height:100%}
5
+ /* the head and the filter stay put, everything under them scrolls as ONE column: every block and row keeps its own
6
+ height, so no row is ever squeezed under the next block's title */
7
+ .idcol{display:flex;flex-direction:column;min-width:0;height:100%}
8
+ .idcol > :not(.idlist){flex:none}
9
+ .idlist{padding:0 0 var(--s3)}
10
+ .idlist > *,.idrows > *{flex:none}
11
+ /* the head: the avatar, the name, the bio dim under it, on the hub's type scale */
12
+ .idhead{display:flex;gap:var(--s2);align-items:center;padding:var(--s2) var(--s3);border-bottom:1px solid var(--line)}
13
+ .idmark{flex:none;width:28px;height:28px;border-radius:50%;object-fit:cover}
14
+ .idini{display:grid;place-items:center;background:var(--idc,var(--dim));color:var(--bg);font-weight:700;font-size:13px}
15
+ .idtitle{min-width:0;display:flex;flex-direction:column}
16
+ .idtitle b{font-size:13px}
17
+ .idtitle .iddim{font-size:11.5px;line-height:1.35;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
18
+ .iddim{color:var(--dim)}
19
+ .idnote{margin-bottom:var(--s2);font-size:12px}
20
+ /* a band's title over its rows, the tree's rule between them */
21
+ .idband{display:flex;align-items:center;gap:var(--s1);height:24px;margin-top:var(--s2);padding:0 var(--s3);font-size:11px;color:var(--dim);box-shadow:inset 0 1px 0 var(--line)}
22
+ .idband span{margin-left:auto;font-variant-numeric:tabular-nums}
23
+ /* every row in the tree's shape (hub.css .tsec): 26px, its 16px icon, the name, what it carries at its end */
24
+ .idrows{display:flex;flex-direction:column;padding-top:var(--s1)}
25
+ .idrow{display:flex;align-items:center;gap:var(--s2);height:26px;padding:0 var(--s3);color:var(--dim);font-size:13px;text-decoration:none;white-space:nowrap;min-width:0;cursor:pointer}
26
+ .idrow .hico{flex:none;width:16px;height:16px}
27
+ .idrow:hover{background:var(--panel2);color:var(--ink)}
28
+ .idrow.on{background:var(--sel);color:var(--ink);box-shadow:inset 3px 0 0 var(--idc,var(--accent));font-weight:600}
29
+ .idrow.off .idname{opacity:.6}
30
+ .idname{flex:none;max-width:50%;overflow:hidden;text-overflow:ellipsis}
31
+ .idrow .iddim{font-size:11.5px;font-weight:400}
32
+ .idgrow{flex:1;min-width:0}
33
+ /* an account's messages to post, the tree's count badge; its state a dot: green online, a ring still to create */
34
+ .idnum{flex:none;min-width:16px;height:16px;padding:0 var(--s1);border-radius:8px;font-size:10px;line-height:16px;text-align:center;color:var(--dim);background:var(--panel2)}
35
+ .iddot{flex:none;width:7px;height:7px;border-radius:50%;box-shadow:inset 0 0 0 1px var(--dim)}
36
+ .iddot.live{background:var(--ok);box-shadow:none}
37
+ .idpage{display:flex;flex-direction:column;gap:var(--s3)}
38
+ .idfacts{display:grid;grid-template-columns:72px 1fr;gap:var(--s1) var(--s3);margin:var(--s3) 0;font-size:12.5px}
39
+ .idfacts dt{color:var(--dim)}
40
+ .idfacts dd{margin:0;min-width:0}
41
+ .idfacts a,.idpage .idrow{color:var(--accent);text-decoration:none}
42
+ .iddata{width:100%;table-layout:fixed;border-collapse:collapse;font-size:12px}
43
+ .iddata td{padding:var(--s0) var(--s1);border-top:1px solid var(--line);vertical-align:middle}
44
+ .idwhat{width:38%}
45
+ .idpath code{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:11.5px}
46
+ .idopen{width:132px;text-align:right;white-space:nowrap}
47
+ .idopen button{height:20px;padding:0 var(--s2);font-size:11px}
48
+ .idpage a.so-placerow{color:var(--ink);text-decoration:none}