rvlib-shipkit 2.12.0 → 2.13.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.
- package/CHANGELOG.md +48 -13
- package/README.md +1 -1
- package/package.json +4 -2
- package/src/agent-time/store.ts +2 -2
- package/src/check.ts +1 -1
- package/src/checks/SK001-package-json-shape.check.ts +4 -0
- package/src/checks/SK003-claude-md-shape.check.ts +1 -1
- package/src/checks/SK004-gitignore-policy.check.ts +27 -2
- package/src/checks/SK005-rvlib-versions.check.ts +1 -1
- package/src/checks/SK008-reviewer-agent.check.ts +2 -2
- package/src/checks/SK012-config-barrel-import.check.ts +1 -1
- package/src/checks/SK015-nested-repo.check.ts +1 -1
- package/src/checks/SK035-public-clean.check.ts +46 -0
- package/src/checks/SK036-draft-media-size.check.ts +28 -0
- package/src/cli/cmd_Backup.ts +152 -0
- package/src/cli/cmd_Ci.ts +8 -11
- package/src/cli/cmd_Drill.ts +145 -0
- package/src/cli/cmd_Home.ts +50 -3
- package/src/cli/cmd_Media.ts +7 -5
- package/src/cli/cmd_Review.ts +4 -2
- package/src/cli/cmd_Shot.ts +5 -2
- package/src/cli/cmd_Smoke.ts +4 -1
- package/src/cli/cmd_Social.ts +226 -0
- package/src/cli/cmd_Start.ts +1 -1
- package/src/cli/cmd_Time.ts +1 -1
- package/src/cli/cmd_Trailer.ts +5 -2
- package/src/cli/cmd_Veille.ts +173 -0
- package/src/cli/family-pages.ts +3 -0
- package/src/cli/registry.ts +13 -2
- package/src/cli.ts +5 -2
- package/src/collections/actions.ts +1 -49
- package/src/collections/checks.ts +2 -1
- package/src/collections/collection-types.ts +11 -2
- package/src/collections/providers.ts +4 -4
- package/src/collections/review.ts +2 -1
- package/src/collections/tests.ts +19 -8
- package/src/contracts/apply-contracts.ts +1 -3
- package/src/contracts/contract-manifests.ts +2 -3
- package/src/contracts/contract-types.ts +0 -1
- package/src/contracts/contracts-engine.ts +0 -3
- package/src/core/app-icon.ts +9 -3
- package/src/core/bun-builtins.ts +2 -2
- package/src/core/discover-checks.ts +37 -5
- package/src/core/fix-scope.ts +4 -2
- package/src/core/floor-resolve.ts +68 -48
- package/src/core/floor.ts +9 -0
- package/src/core/git-root.ts +24 -0
- package/src/core/last-good.ts +3 -1
- package/src/core/layout.ts +8 -0
- package/src/core/log-stamp.ts +36 -0
- package/src/core/loop-watch.ts +93 -0
- package/src/core/machine-link.ts +134 -0
- package/src/core/memory-watch.ts +41 -0
- package/src/core/one-way-in-policy.ts +27 -19
- package/src/core/run-ci.ts +6 -8
- package/src/core/run-fixers.ts +9 -9
- package/src/core/slots.ts +21 -0
- package/src/core/tree-rev.ts +60 -0
- package/src/core/unit-files.ts +42 -0
- package/src/drill/render.ts +140 -0
- package/src/drill/run.ts +269 -0
- package/src/fleet/scan-fleet.ts +6 -5
- package/src/home/daemon-jobs.ts +201 -0
- package/src/home/global-context.ts +34 -1
- package/src/home/home-routes.ts +22 -15
- package/src/home/hubs.ts +10 -3
- package/src/home/inbox-shape.ts +53 -4
- package/src/home/inbox.ts +16 -1
- package/src/home/lib-watch.ts +10 -3
- package/src/home/machine-stores.ts +15 -29
- package/src/home/run-daemon.ts +15 -18
- package/src/home/run-pm.ts +2 -0
- package/src/home/serve-daemon.ts +4 -3
- package/src/home/serve-web.ts +104 -1
- package/src/hooks/commit-message.ts +28 -19
- package/src/hooks/leak-guard.ts +10 -3
- package/src/hooks/run-hooks.ts +2 -6
- package/src/identities/identities.ts +334 -0
- package/src/identities/machine-route.ts +126 -0
- package/src/identities/machine.ts +62 -0
- package/src/init-repo.ts +1 -1
- package/src/ledger/check-stats.ts +10 -9
- package/src/ledger/gate-checks.ts +32 -1
- package/src/ledger/record-kept.ts +112 -0
- package/src/ledger/repo-view.ts +10 -0
- package/src/ledger/run-log.ts +17 -12
- package/src/ledger/run-timeline.ts +8 -4
- package/src/ledger/store.ts +7 -0
- package/src/ledger/suite-log.ts +17 -13
- package/src/media-kinds.ts +2 -1
- package/src/media-store/backup/daemon.ts +73 -0
- package/src/media-store/backup/keys.ts +25 -0
- package/src/media-store/backup/manifest.ts +193 -0
- package/src/media-store/backup/restore.ts +192 -0
- package/src/media-store/backup/run.ts +278 -0
- package/src/media-store/backup/secret.ts +86 -0
- package/src/media-store/backup/snapshot.ts +64 -0
- package/src/media-store/backup/sources.ts +199 -0
- package/src/media-store/daemon.ts +56 -70
- package/src/media-store/put.ts +4 -2
- package/src/media-store/space.ts +23 -4
- package/src/pages/forward.ts +35 -0
- package/src/pages/frame-client.ts +118 -0
- package/src/pages/routes.ts +29 -0
- package/src/pages/unit.ts +92 -0
- package/src/plan/planner.ts +12 -0
- package/src/plan/repo-source.ts +19 -5
- package/src/reflect/transcript.ts +35 -10
- package/src/release/public-clean.ts +301 -0
- package/src/release/published-here.ts +22 -0
- package/src/release/run-bump.ts +2 -1
- package/src/release/run-release.ts +4 -1
- package/src/repo-config.ts +53 -2
- package/src/review/http.ts +16 -2
- package/src/review/model.ts +15 -4
- package/src/review/notes.ts +77 -0
- package/src/review/project.ts +6 -38
- package/src/review/routes.ts +4 -12
- package/src/review/store.ts +41 -1
- package/src/review/trailer-media.ts +7 -4
- package/src/review/trailer-shots.ts +21 -4
- package/src/review/unit.ts +1 -1
- package/src/scaffold/files/agent-handoff.md +3 -0
- package/src/scaffold/files/agent-index.md +4 -12
- package/src/scaffold/project-scaffold.ts +5 -4
- package/src/serve/embed.ts +1 -1
- package/src/serve/hub-app/col-card.tsx +3 -17
- package/src/serve/hub-app/col-tables-view.tsx +2 -1
- package/src/serve/hub-app/cols-svc.ts +0 -13
- package/src/serve/hub-app/dock-st.ts +4 -2
- package/src/serve/hub-app/dock-view.tsx +2 -0
- package/src/serve/hub-app/frames-st.ts +35 -0
- package/src/serve/hub-app/hash-route.ts +64 -1
- package/src/serve/hub-app/home-st.ts +31 -7
- package/src/serve/hub-app/home-strip.css +9 -1
- package/src/serve/hub-app/home-strip.tsx +7 -6
- package/src/serve/hub-app/home.html +5 -0
- package/src/serve/hub-app/hub-app.tsx +49 -5
- package/src/serve/hub-app/hub.css +29 -11
- package/src/serve/hub-app/icons.tsx +16 -1
- package/src/serve/hub-app/identities-st.ts +210 -0
- package/src/serve/hub-app/identities-view.tsx +352 -0
- package/src/serve/hub-app/identities.css +48 -0
- package/src/serve/hub-app/identity-address.ts +52 -0
- package/src/serve/hub-app/inbox-st.ts +59 -6
- package/src/serve/hub-app/inbox-view.tsx +48 -6
- package/src/serve/hub-app/inbox.css +12 -1
- package/src/serve/hub-app/index.html +3 -0
- package/src/serve/hub-app/keys.ts +10 -2
- package/src/serve/hub-app/list-walk.ts +89 -0
- package/src/serve/hub-app/machine-st.ts +12 -0
- package/src/serve/hub-app/media-view.tsx +2 -1
- package/src/serve/hub-app/pages-frames.tsx +134 -0
- package/src/serve/hub-app/pages-svc.ts +111 -0
- package/src/serve/hub-app/palette-st.ts +18 -3
- package/src/serve/hub-app/palette-view.tsx +9 -2
- package/src/serve/hub-app/planned-view.tsx +2 -1
- package/src/serve/hub-app/project-list.css +18 -14
- package/src/serve/hub-app/project-list.tsx +88 -49
- package/src/serve/hub-app/projects-svc.ts +33 -3
- package/src/serve/hub-app/repo-sections.ts +19 -2
- package/src/serve/hub-app/repo-st.ts +75 -19
- package/src/serve/hub-app/review/review-cells.tsx +3 -3
- package/src/serve/hub-app/review/review-kit.ts +30 -7
- package/src/serve/hub-app/review/review-page.tsx +1 -1
- package/src/serve/hub-app/review/review-st.ts +19 -8
- package/src/serve/hub-app/review/review-thread.tsx +11 -9
- package/src/serve/hub-app/review/review-views.tsx +84 -19
- package/src/serve/hub-app/review/thread-st.ts +1 -10
- package/src/serve/hub-app/review/trailer-page.tsx +2 -1
- package/src/serve/hub-app/review.css +17 -8
- package/src/serve/hub-app/site/site-part.tsx +173 -0
- package/src/serve/hub-app/site/site-st.ts +157 -0
- package/src/serve/hub-app/site.css +35 -0
- package/src/serve/hub-app/social/calendar.tsx +182 -0
- package/src/serve/hub-app/social/comms-page.tsx +306 -0
- package/src/serve/hub-app/social/kit.tsx +244 -0
- package/src/serve/hub-app/social/post-card.tsx +456 -0
- package/src/serve/hub-app/social/problems.tsx +60 -0
- package/src/serve/hub-app/social/social-model.ts +154 -0
- package/src/serve/hub-app/social/social-page.tsx +674 -0
- package/src/serve/hub-app/social/social-st.ts +986 -0
- package/src/serve/hub-app/social.css +289 -0
- package/src/serve/hub-app/stores/stores-page.tsx +311 -0
- package/src/serve/hub-app/stores/stores-st.ts +286 -0
- package/src/serve/hub-app/stores.css +54 -0
- package/src/serve/hub-app/timeline-geometry.ts +1 -1
- package/src/serve/hub-app/timeline-view.tsx +3 -2
- package/src/serve/hub-app/tree-build.ts +6 -0
- package/src/serve/hub-app/tree-row.tsx +27 -4
- package/src/serve/hub-app/tree-svc.ts +18 -49
- package/src/serve/hub-app/veille/veille-page.tsx +514 -0
- package/src/serve/hub-app/veille/veille-st.ts +443 -0
- package/src/serve/hub-app/veille.css +84 -0
- package/src/serve/hub-runtime.ts +14 -9
- package/src/serve/project-gutter-route.ts +44 -12
- package/src/serve/run-lanes.ts +7 -4
- package/src/serve/same-origin.ts +1 -1
- package/src/serve/serve-hub.ts +20 -12
- package/src/serve/tracked-watch.ts +24 -3
- package/src/serve/warm-cell.ts +5 -1
- package/src/shipkit-files.ts +15 -4
- package/src/shipkit.ts +0 -1
- package/src/shot/box.ts +162 -0
- package/src/shot/browser-slot.ts +62 -0
- package/src/shot/client.ts +43 -7
- package/src/shot/clip-encoder.ts +93 -12
- package/src/shot/film-box.ts +188 -0
- package/src/shot/shooter.ts +50 -15
- package/src/shot/shot-ask.ts +10 -2
- package/src/shot/stepped-clip.ts +5 -4
- package/src/site/desk.ts +242 -0
- package/src/site/routes.ts +66 -0
- package/src/site/unit.ts +62 -0
- package/src/social/brands.ts +22 -0
- package/src/social/compose.ts +97 -0
- package/src/social/desk-index.ts +123 -0
- package/src/social/desk-wire.ts +64 -0
- package/src/social/drafts.ts +183 -0
- package/src/social/house.ts +24 -0
- package/src/social/load.ts +319 -0
- package/src/social/md.ts +70 -0
- package/src/social/media-facts.ts +53 -0
- package/src/social/media-kind.ts +189 -0
- package/src/social/media-limit.ts +42 -0
- package/src/social/media-of.ts +30 -0
- package/src/social/migrate.ts +123 -0
- package/src/social/open.ts +17 -0
- package/src/social/post-url.ts +158 -0
- package/src/social/presence.ts +332 -0
- package/src/social/public-read.ts +53 -0
- package/src/social/publish/bluesky.ts +168 -0
- package/src/social/publish/discord.ts +76 -0
- package/src/social/publish/index.ts +24 -0
- package/src/social/publish/secret.ts +13 -0
- package/src/social/push.ts +31 -0
- package/src/social/richtext.ts +37 -0
- package/src/social/routes.ts +180 -0
- package/src/social/stats.ts +134 -0
- package/src/social/text.ts +267 -0
- package/src/social/tracker-route.ts +39 -0
- package/src/social/tracker.ts +255 -0
- package/src/social/unit.ts +53 -0
- package/src/social/writes.ts +130 -0
- package/src/start-repo.ts +14 -9
- package/src/stores/collection.ts +27 -0
- package/src/stores/desk.ts +336 -0
- package/src/stores/model.ts +187 -0
- package/src/stores/routes.ts +126 -0
- package/src/stores/unit.ts +57 -0
- package/src/suite/calibrate.ts +127 -0
- package/src/suite/core-counters.ts +91 -0
- package/src/suite/judge-suites.ts +94 -34
- package/src/suite/suite-cli.ts +44 -10
- package/src/suite/suite-cpu-preload.ts +34 -9
- package/src/trailer/adapter.ts +4 -0
- package/src/trailer/build.ts +42 -11
- package/src/trailer/ffmpeg.ts +11 -0
- package/src/trailer/footage.ts +30 -13
- package/src/trailer/grammar.ts +18 -2
- package/src/trailer/graph.ts +28 -6
- package/src/trailer/passage.ts +17 -5
- package/src/trailer/plan.ts +74 -3
- package/src/trailer/stitch.ts +67 -26
- package/src/trailer/url.ts +1 -1
- package/src/trailer/versions.ts +24 -0
- package/src/ts/gate-typecheck.ts +32 -0
- package/src/ts/typecheck-cli.ts +9 -11
- package/src/tui/tui-app.tsx +0 -1
- package/src/veille/asks.ts +155 -0
- package/src/veille/auto.ts +31 -0
- package/src/veille/batch.ts +27 -0
- package/src/veille/chrome.ts +127 -0
- package/src/veille/collection.ts +28 -0
- package/src/veille/desk.ts +242 -0
- package/src/veille/identity.ts +80 -0
- package/src/veille/import.ts +68 -0
- package/src/veille/log.ts +183 -0
- package/src/veille/platforms.ts +118 -0
- package/src/veille/reads.ts +66 -0
- package/src/veille/replied.ts +110 -0
- package/src/veille/routes.ts +185 -0
- package/src/veille/service.ts +81 -0
- package/src/veille/watch.ts +116 -0
- package/src/veille/worth.ts +46 -0
- package/src/wiki/scan-md.ts +18 -0
- package/src/collections/posts.ts +0 -142
- package/src/contracts/manifests/social.contract.ts +0 -20
- package/src/scaffold/files/agent-coding.md +0 -35
- package/src/ts/typecheck-cache.ts +0 -11
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
// the identity view's state (wiki build/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,352 @@
|
|
|
1
|
+
// `/identities#<id>[/<part>[/<place>]]`: one identity (wiki build/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 { Group, Panel, Separator } from 'react-resizable-panels'
|
|
9
|
+
import type { DataPlace, MachineIdentity } from '../../identities/machine-route.ts'
|
|
10
|
+
import type { HomeSt } from './home-st.ts'
|
|
11
|
+
import { plainClick, repoPage } from './home-st.ts'
|
|
12
|
+
import type { IdentitiesSt } from './identities-st.ts'
|
|
13
|
+
import { identityAddress, isSection, type IdentityRow } from './identity-address.ts'
|
|
14
|
+
import { isTreeWalk, SEARCH_KEY } from './keys.ts'
|
|
15
|
+
import { useInSight } from './tree-row.tsx'
|
|
16
|
+
import { PANEL } from './review/review-page.tsx'
|
|
17
|
+
import { SitePart } from './site/site-part.tsx'
|
|
18
|
+
import { Icon, ICON } from './icons.tsx'
|
|
19
|
+
import { ErrorLine, KeptFold, Lightbox, Logo, Toast } from './social/kit.tsx'
|
|
20
|
+
import { Problems } from './social/problems.tsx'
|
|
21
|
+
import { AccountProfile, IdentityMedia, IdentityPage, LegalPage, LegalPlatforms, Messages, PlacePane, PlatformHeader } from './social/social-page.tsx'
|
|
22
|
+
import { LEGAL, ME, type DeskAccount, type DeskIdentity } from './social/social-model.ts'
|
|
23
|
+
import type { SocialSt } from './social/social-st.ts'
|
|
24
|
+
|
|
25
|
+
const Mark = ({ i, px }: { i: MachineIdentity; px: number }) => {
|
|
26
|
+
const style = { width: px, height: px, ...(i.colour == null ? {} : { '--idc': i.colour }) } as CSSProperties
|
|
27
|
+
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>
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** a link of the view: an address of the home, opened in place on a plain click */
|
|
31
|
+
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 }) => {
|
|
32
|
+
const sel = { id: app.identities.shownId, part: to.part, place: to.place ?? null }
|
|
33
|
+
const el = useInSight<HTMLAnchorElement>(lit === true)
|
|
34
|
+
return (
|
|
35
|
+
<a ref={el} className={cls} href={identityAddress(sel)} title={title} onClick={(e) => {
|
|
36
|
+
if (!plainClick(e)) return
|
|
37
|
+
e.preventDefault()
|
|
38
|
+
app.openIdentity(sel)
|
|
39
|
+
}}>{children}</a>
|
|
40
|
+
)
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
/** a plain click on a link of the home: run it in place; any other click keeps the browser's own behaviour */
|
|
44
|
+
const inPlace = (run: () => void) => (e: { button: number; metaKey: boolean; ctrlKey: boolean; shiftKey: boolean; altKey: boolean; preventDefault(): void }): void => {
|
|
45
|
+
if (!plainClick(e)) return
|
|
46
|
+
e.preventDefault()
|
|
47
|
+
run()
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export const IdentitiesView = observer(({ app }: { app: HomeSt }) => {
|
|
51
|
+
const st = app.identities
|
|
52
|
+
const so = st.desk
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
if (so == null) return
|
|
55
|
+
st.ensureHub()
|
|
56
|
+
so.start()
|
|
57
|
+
return () => so.stop()
|
|
58
|
+
}, [so, st])
|
|
59
|
+
const i = st.shown
|
|
60
|
+
if (i == null)
|
|
61
|
+
return (
|
|
62
|
+
<div className="hall activity identities">
|
|
63
|
+
{st.error !== '' ? <div className="hnote">{st.error}</div> : null}
|
|
64
|
+
{st.data?.errors.map((e) => <div key={e} className="hnote">{e}</div>)}
|
|
65
|
+
{st.data == null && st.error === '' ? <div className="iddim"><span className="spin" />reading the identities folder…</div> : null}
|
|
66
|
+
{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}
|
|
67
|
+
{st.data != null && st.data.identities.length === 0 ? <div className="iddim">no identity: write .shipkit/identities/<id>/identity.md in the house repo</div> : null}
|
|
68
|
+
</div>
|
|
69
|
+
)
|
|
70
|
+
return (
|
|
71
|
+
<div className="so-page idview">
|
|
72
|
+
<Group className="rv-cols" orientation="horizontal">
|
|
73
|
+
<Panel id="identity-list" defaultSize="30%" minSize={260} className="rv-pane" style={PANEL}>
|
|
74
|
+
<IdentityList app={app} i={i} />
|
|
75
|
+
</Panel>
|
|
76
|
+
<Separator className="rsep" />
|
|
77
|
+
<Panel id="identity-page" minSize={420} className="rv-pane" style={PANEL}>
|
|
78
|
+
<div className="rv-scroll so-ground">
|
|
79
|
+
<PartPage app={app} i={i} />
|
|
80
|
+
</div>
|
|
81
|
+
</Panel>
|
|
82
|
+
</Group>
|
|
83
|
+
{so == null ? null : <Lightbox so={so} />}
|
|
84
|
+
{so == null ? null : <Toast so={so} />}
|
|
85
|
+
</div>
|
|
86
|
+
)
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
/** the desk's own view of the identity: its rows, pictures, company and accounts; null until the desk answers */
|
|
90
|
+
const deskOf = (so: SocialSt | null, i: MachineIdentity): DeskIdentity | null => so?.identityOf(i.id) ?? null
|
|
91
|
+
|
|
92
|
+
/** the list: its head and filter stay in reach, the problems and the blocks under them scroll as one column; every row is
|
|
93
|
+
* the walk's (identities-st.ts rows), lit where the cursor or the part shown sits */
|
|
94
|
+
const IdentityList = observer(({ app, i }: { app: HomeSt; i: MachineIdentity }) => {
|
|
95
|
+
const st = app.identities
|
|
96
|
+
const so = st.desk
|
|
97
|
+
const d = deskOf(so, i)
|
|
98
|
+
const online = i.accounts.filter((a) => a.live !== '').length
|
|
99
|
+
const style = i.colour == null ? undefined : ({ '--idc': i.colour } as CSSProperties)
|
|
100
|
+
const problems = [
|
|
101
|
+
...(st.error !== '' ? [st.error] : []),
|
|
102
|
+
...(st.data?.errors ?? []),
|
|
103
|
+
...(st.data?.strays.map((x) => `${x.repo} speaks as ${x.speaksAs}, which no folder holds`) ?? []),
|
|
104
|
+
...(so?.loadError ? [so.loadError] : []),
|
|
105
|
+
...(so?.errors ?? []),
|
|
106
|
+
]
|
|
107
|
+
const rows = st.rows
|
|
108
|
+
const block = (b: IdentityRow['block']) => rows.filter((r) => r.block === b)
|
|
109
|
+
const accounts = block('accounts')
|
|
110
|
+
const repos = block('repos')
|
|
111
|
+
const filtered = st.query.trim() !== ''
|
|
112
|
+
return (
|
|
113
|
+
<div className="idcol" style={style}>
|
|
114
|
+
<header className="idhead" title={`${i.id}${i.default ? ': the default identity, it speaks for every repo whose repo.config.ts names no speaksAs' : ''}`}>
|
|
115
|
+
<Mark i={i} px={28} />
|
|
116
|
+
<div className="idtitle">
|
|
117
|
+
<b>{i.name}</b>
|
|
118
|
+
{i.bio === '' ? null : <span className="iddim">{i.bio}</span>}
|
|
119
|
+
</div>
|
|
120
|
+
</header>
|
|
121
|
+
<div className="ssearch">
|
|
122
|
+
<span className="sfield">
|
|
123
|
+
<input ref={(el) => { st.searchEl = el }} placeholder="filter" aria-label="filter the accounts, sections and repos by name or handle" value={st.query}
|
|
124
|
+
onChange={(e) => st.setQuery(e.target.value)}
|
|
125
|
+
onKeyDown={(e) => { if (e.key === 'Escape') st.setQuery(''); else if (isTreeWalk(e.key) && st.key(e.key)) e.preventDefault() }} />
|
|
126
|
+
<kbd className="skey">{SEARCH_KEY}</kbd>
|
|
127
|
+
</span>
|
|
128
|
+
</div>
|
|
129
|
+
<div className="rv-scroll idlist">
|
|
130
|
+
<Problems so={so} lines={problems} />
|
|
131
|
+
<nav className="idrows" aria-label={`${i.name}: its sections`}>
|
|
132
|
+
{block('sections').map((r) => <SectionRow key={r.key} app={app} i={i} d={d} r={r} />)}
|
|
133
|
+
</nav>
|
|
134
|
+
{filtered && accounts.length === 0 ? null : <div className="idband">accounts <span>{filtered ? `${accounts.length} of ${i.accounts.length}` : `${online}/${i.accounts.length}`}</span></div>}
|
|
135
|
+
<nav className="idrows" aria-label={`${i.name}: its accounts`}>
|
|
136
|
+
{accounts.map((r) => <AccountRow key={r.key} app={app} i={i} d={d} r={r} />)}
|
|
137
|
+
</nav>
|
|
138
|
+
{filtered && repos.length === 0 ? null : <div className="idband">repos <span>{filtered ? `${repos.length} of ${i.repos.length}` : i.repos.length}</span></div>}
|
|
139
|
+
<nav className="idrows" aria-label={`${i.name}: its repos`}>
|
|
140
|
+
{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} />)}
|
|
141
|
+
</nav>
|
|
142
|
+
{filtered && rows.length === 0 ? <div className="iddim idrow">nothing holds « {st.query.trim()} »</div> : null}
|
|
143
|
+
</div>
|
|
144
|
+
</div>
|
|
145
|
+
)
|
|
146
|
+
})
|
|
147
|
+
|
|
148
|
+
const rowCls = (app: HomeSt, r: IdentityRow, more = ''): string => `idrow${app.identities.lit === r.key ? ' on' : ''}${more}`
|
|
149
|
+
|
|
150
|
+
const SectionRow = observer(({ app, i, d, r }: { app: HomeSt; i: MachineIdentity; d: DeskIdentity | null; r: IdentityRow }) => {
|
|
151
|
+
const so = app.identities.desk
|
|
152
|
+
const lit = app.identities.lit === r.key
|
|
153
|
+
if (r.part == null)
|
|
154
|
+
return (
|
|
155
|
+
<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">
|
|
156
|
+
<Icon d={ICON.social} /><span className="idgrow">profile</span>
|
|
157
|
+
</Go>
|
|
158
|
+
)
|
|
159
|
+
if (r.part === LEGAL) {
|
|
160
|
+
const legal = d?.legal != null && so != null && so.legalLive(d)
|
|
161
|
+
return (
|
|
162
|
+
<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'}`}>
|
|
163
|
+
<Icon d={ICON.contracts} /><span className="idgrow">company</span><i className={`iddot${legal ? ' live' : ''}`} />
|
|
164
|
+
</Go>
|
|
165
|
+
)
|
|
166
|
+
}
|
|
167
|
+
if (r.part === '@veille')
|
|
168
|
+
return (
|
|
169
|
+
<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">
|
|
170
|
+
<Icon d={ICON.veille} /><span className="idgrow">veille</span>
|
|
171
|
+
</Go>
|
|
172
|
+
)
|
|
173
|
+
return (
|
|
174
|
+
<Go app={app} to={{ part: '@site' }} cls={rowCls(app, r)} lit={lit} title={i.site === '' ? 'its website: none named' : `its website, ${i.site}`}>
|
|
175
|
+
<Icon d={ICON.browser} /><span>site</span><span className="iddim idgrow so-ellip">{i.site.replace(/^https?:\/\/(www\.)?/, '')}</span>
|
|
176
|
+
</Go>
|
|
177
|
+
)
|
|
178
|
+
})
|
|
179
|
+
|
|
180
|
+
const AccountRow = observer(({ app, i, d, r }: { app: HomeSt; i: MachineIdentity; d: DeskIdentity | null; r: IdentityRow }) => {
|
|
181
|
+
const so = app.identities.desk
|
|
182
|
+
const m = i.accounts.find((x) => x.id === r.part)
|
|
183
|
+
if (m == null) return null
|
|
184
|
+
const a = d?.accounts.find((x) => x.id === m.id) ?? null
|
|
185
|
+
const c = a == null || so == null ? null : so.counts(a)
|
|
186
|
+
const stat = a == null ? undefined : so?.statOf(a)
|
|
187
|
+
const live = m.live !== ''
|
|
188
|
+
return (
|
|
189
|
+
<Go app={app} to={{ part: m.id }} cls={rowCls(app, r, live ? '' : ' off')} lit={app.identities.lit === r.key}
|
|
190
|
+
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(' · ')}>
|
|
191
|
+
<Logo id={m.id} name={m.name} size={16} muted={!live} />
|
|
192
|
+
<span className="idname">{m.name}</span>
|
|
193
|
+
<span className="iddim idgrow so-ellip">{m.handle}</span>
|
|
194
|
+
{c != null && c.waiting > 0 ? <b className="idnum">{c.waiting}</b> : null}
|
|
195
|
+
<i className={`iddot${live ? ' live' : ''}`} />
|
|
196
|
+
</Go>
|
|
197
|
+
)
|
|
198
|
+
})
|
|
199
|
+
|
|
200
|
+
/** a repo that speaks as it: the arrows only point at it, Enter or a click opens its Social page */
|
|
201
|
+
const RepoRow = observer(({ app, i, r }: { app: HomeSt; i: MachineIdentity; r: IdentityRow }) => {
|
|
202
|
+
const st = app.identities
|
|
203
|
+
const repo = r.repo!
|
|
204
|
+
const el = useInSight<HTMLAnchorElement>(st.lit === r.key)
|
|
205
|
+
return (
|
|
206
|
+
<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))}>
|
|
207
|
+
<Icon d={ICON.repo} />
|
|
208
|
+
<span className="idgrow so-ellip">{repo}</span>
|
|
209
|
+
{draftsOf(i, repo) == null ? null : <span className="iddim" title="its drafts">{draftsOf(i, repo)}</span>}
|
|
210
|
+
</a>
|
|
211
|
+
)
|
|
212
|
+
})
|
|
213
|
+
|
|
214
|
+
const draftsOf = (i: MachineIdentity, repo: string): number | null => {
|
|
215
|
+
const n = i.data.find((p) => p.place === 'drafts' && p.repo === repo)?.count ?? 0
|
|
216
|
+
return n > 0 ? n : null
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
const PartPage = observer(({ app, i }: { app: HomeSt; i: MachineIdentity }) => {
|
|
220
|
+
const st = app.identities
|
|
221
|
+
const so = st.desk
|
|
222
|
+
const part = st.sel.part
|
|
223
|
+
if (part === '@veille') return <VeillePart app={app} i={i} />
|
|
224
|
+
if (part === '@site') return <SitePart app={app} i={i} />
|
|
225
|
+
const d = deskOf(so, i)
|
|
226
|
+
if (so == null || d == null) return <div className="rv-empty">{so?.loadError ?? so?.waitText ?? 'no repo to read the desk from'}</div>
|
|
227
|
+
if (part === LEGAL) {
|
|
228
|
+
if (d.legal == null) return <div className="rv-empty">{i.name} has no company: a legal.md in its folder</div>
|
|
229
|
+
return (
|
|
230
|
+
<div className="idpage">
|
|
231
|
+
<LegalPage so={so} i={d} />
|
|
232
|
+
<LegalPlatforms so={so} i={d} />
|
|
233
|
+
</div>
|
|
234
|
+
)
|
|
235
|
+
}
|
|
236
|
+
if (part == null || isSection(part))
|
|
237
|
+
return (
|
|
238
|
+
<div className="idpage">
|
|
239
|
+
<IdentityPage so={so} i={d} />
|
|
240
|
+
{d.pictures.length > 0 ? <IdentityMedia so={so} i={d} /> : null}
|
|
241
|
+
<DataPlaces st={st} i={i} />
|
|
242
|
+
</div>
|
|
243
|
+
)
|
|
244
|
+
const a = d.accounts.find((x) => x.id === part)
|
|
245
|
+
if (a == null) return <div className="rv-empty">{i.name} has no account « {part} »: {d.accounts.map((x) => x.id).join(', ')}</div>
|
|
246
|
+
return <AccountPart app={app} i={i} so={so} a={a} />
|
|
247
|
+
})
|
|
248
|
+
|
|
249
|
+
/** an account's whole page: its head, setup and profile URL; its places; its profile; the drafts waiting for it */
|
|
250
|
+
const AccountPart = observer(({ app, i, so, a }: { app: HomeSt; i: MachineIdentity; so: SocialSt; a: DeskAccount }) => {
|
|
251
|
+
const st = app.identities
|
|
252
|
+
const place = so.currentPlace
|
|
253
|
+
const others = st.otherDrafts(i)
|
|
254
|
+
return (
|
|
255
|
+
<div className="idpage">
|
|
256
|
+
<div className="so-colin">
|
|
257
|
+
<ErrorLine so={so} />
|
|
258
|
+
<PlatformHeader so={so} a={a} />
|
|
259
|
+
{a.id === 'site' ? (
|
|
260
|
+
<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">
|
|
261
|
+
<Icon d={ICON.browser} /><span className="idgrow">its pages, preview and deploy: the site section</span>
|
|
262
|
+
</Go>
|
|
263
|
+
) : null}
|
|
264
|
+
{a.places.length > 0 ? (
|
|
265
|
+
<KeptFold so={so} card={`places/${a.identity}/${a.id}`} title="Places" flush right={<span className="rv-dim rv-small">{a.places.length}</span>}>
|
|
266
|
+
{[{ id: ME, name: 'my profile', when: '' }, ...a.places].map((x) => {
|
|
267
|
+
const c = so.counts(a, x.id)
|
|
268
|
+
return (
|
|
269
|
+
<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' : ''}`}>
|
|
270
|
+
<span className={`so-pdot${so.placeDone(a, x.id) ? ' done' : ''}`} />
|
|
271
|
+
<b className="so-ellip so-pname">{x.name}</b>
|
|
272
|
+
<span className="rv-dim so-ellip so-grow">{x.when}</span>
|
|
273
|
+
{c.waiting > 0 || c.posted > 0 ? <span className="rv-dim">{c.waiting > 0 ? `${c.waiting} to post` : `${c.posted} posted`}</span> : null}
|
|
274
|
+
</Go>
|
|
275
|
+
)
|
|
276
|
+
})}
|
|
277
|
+
</KeptFold>
|
|
278
|
+
) : null}
|
|
279
|
+
{place != null ? <PlacePane so={so} a={a} place={place} /> : null}
|
|
280
|
+
</div>
|
|
281
|
+
<AccountProfile so={so} a={a} />
|
|
282
|
+
<div className="so-colin">
|
|
283
|
+
<Messages so={so} a={a} />
|
|
284
|
+
<span className="rv-dim rv-small">
|
|
285
|
+
the drafts of {so.repoName}
|
|
286
|
+
{others.length === 0 ? null : (
|
|
287
|
+
<>
|
|
288
|
+
; the drafts of{' '}
|
|
289
|
+
{others.map((p, n) => (
|
|
290
|
+
<span key={p.repo}>
|
|
291
|
+
{n > 0 ? ', ' : ''}
|
|
292
|
+
<a href={`${repoPage(p.repo!)}#page:comms`} onClick={inPlace(() => st.openRepoPage(p.repo!, 'comms'))}>{p.repo}</a> ({p.count})
|
|
293
|
+
</span>
|
|
294
|
+
))}{' '}
|
|
295
|
+
are in their Communications
|
|
296
|
+
</>
|
|
297
|
+
)}
|
|
298
|
+
</span>
|
|
299
|
+
</div>
|
|
300
|
+
</div>
|
|
301
|
+
)
|
|
302
|
+
})
|
|
303
|
+
|
|
304
|
+
/** the Veille of the identity: its log on this machine, and each repo's Veille page, which reads it */
|
|
305
|
+
const VeillePart = observer(({ app, i }: { app: HomeSt; i: MachineIdentity }) => {
|
|
306
|
+
const st = app.identities
|
|
307
|
+
const log = i.data.filter((p) => p.place === 'veille')
|
|
308
|
+
return (
|
|
309
|
+
<div className="idpage so-colin">
|
|
310
|
+
<h2 className="so-h so-big">{i.name} <span className="rv-dim so-light">· the Veille</span></h2>
|
|
311
|
+
<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>
|
|
312
|
+
<table className="iddata"><tbody>{log.map((p) => <DataRow key={p.place} st={st} i={i} p={p} />)}</tbody></table>
|
|
313
|
+
<b className="so-section">Open it</b>
|
|
314
|
+
{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) => (
|
|
315
|
+
<a key={r} className="idrow" href={`${repoPage(r)}#page:veille`} onClick={inPlace(() => st.openRepoPage(r, 'veille'))}>its Veille, in {r} ↗</a>
|
|
316
|
+
))}
|
|
317
|
+
</div>
|
|
318
|
+
)
|
|
319
|
+
})
|
|
320
|
+
|
|
321
|
+
const DataRow = observer(({ st, i, p }: { st: IdentitiesSt; i: MachineIdentity; p: DataPlace }) => (
|
|
322
|
+
<tr>
|
|
323
|
+
<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>
|
|
324
|
+
<td className="idpath"><code title={p.shown}>{p.shown}</code>{p.exists ? null : <span className="iddim"> not there yet</span>}</td>
|
|
325
|
+
<td className="idopen">
|
|
326
|
+
<button className="ghost" disabled={!p.exists} title={`open ${p.shown} in VS Code`} onClick={() => void st.open(i.id, p, 'code')}>VS Code</button>
|
|
327
|
+
<button className="ghost" disabled={!p.exists} title={`show ${p.shown} in the Finder`} onClick={() => void st.open(i.id, p, 'finder')}>Finder</button>
|
|
328
|
+
</td>
|
|
329
|
+
</tr>
|
|
330
|
+
))
|
|
331
|
+
|
|
332
|
+
/** where the identity's data lives on disk, each place a click to VS Code or the Finder */
|
|
333
|
+
const DataPlaces = observer(({ st, i }: { st: IdentitiesSt; i: MachineIdentity }) => {
|
|
334
|
+
const shown = i.data.filter((p) => p.exists || p.place !== 'drafts')
|
|
335
|
+
const empty = i.data.filter((p) => p.place === 'drafts' && !p.exists)
|
|
336
|
+
return (
|
|
337
|
+
<div className="so-colin">
|
|
338
|
+
<b className="so-section">Where its data lives</b>
|
|
339
|
+
{st.note !== '' ? <div className="iddim idnote">{st.note}</div> : null}
|
|
340
|
+
<table className="iddata">
|
|
341
|
+
<tbody>
|
|
342
|
+
{shown.map((p) => <DataRow key={`${p.place}/${p.repo ?? ''}`} st={st} i={i} p={p} />)}
|
|
343
|
+
{empty.length === 0 ? null : (
|
|
344
|
+
<tr>
|
|
345
|
+
<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>
|
|
346
|
+
</tr>
|
|
347
|
+
)}
|
|
348
|
+
</tbody>
|
|
349
|
+
</table>
|
|
350
|
+
</div>
|
|
351
|
+
)
|
|
352
|
+
})
|
|
@@ -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}
|