rvlib-shipkit 2.18.0 → 2.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -0
- package/package.json +1 -1
- package/src/annex/annex.ts +227 -0
- package/src/annex/offload.ts +279 -0
- package/src/asks/asks-queue.ts +63 -10
- package/src/checks/SK040-release-words.check.ts +43 -0
- package/src/checks/SK041-annex-links.check.ts +28 -0
- package/src/checks/SK042-post-kinds.check.ts +73 -0
- package/src/cli/cmd_Annex.ts +179 -0
- package/src/cli/cmd_Asks.ts +3 -1
- package/src/cli/cmd_Commands.ts +4 -1
- package/src/cli/cmd_GlobalProcesses.ts +34 -11
- package/src/cli/cmd_Home.ts +41 -4
- package/src/cli/cmd_Messages.ts +155 -0
- package/src/cli/cmd_Releases.ts +48 -0
- package/src/cli/cmd_Review.ts +161 -6
- package/src/cli/cmd_Secret.ts +4 -30
- package/src/cli/cmd_Shot.ts +4 -4
- package/src/cli/cmd_Social.ts +179 -3
- package/src/cli/cmd_Trailer.ts +15 -3
- package/src/cli/family-pages.ts +2 -0
- package/src/cli/kit/index.ts +1 -1
- package/src/cli/kit/verb.ts +11 -3
- package/src/cli/registry.ts +8 -2
- package/src/collections/actions.ts +29 -1
- package/src/collections/collection-types.ts +10 -1
- package/src/collections/providers.ts +5 -2
- package/src/commands/model.ts +36 -0
- package/src/commands/registry.ts +49 -0
- package/src/commands/routes.ts +59 -0
- package/src/commands/runner.ts +35 -0
- package/src/commands/runs.ts +112 -0
- package/src/core/app-icon.ts +4 -3
- package/src/core/icon-type.ts +8 -0
- package/src/core/jobs.ts +4 -3
- package/src/core/layout.ts +5 -2
- package/src/core/squircle.ts +95 -0
- package/src/home/daemon-jobs.ts +26 -2
- package/src/home/global-units.ts +3 -0
- package/src/home/gui-app/ShipkitGui.swift +302 -5
- package/src/home/gui-app.ts +63 -33
- package/src/home/hmr-keep.ts +134 -0
- package/src/home/home-paths.ts +5 -1
- package/src/home/home-start.ts +14 -14
- package/src/home/lib-watch.ts +21 -11
- package/src/home/pm.ts +1 -1
- package/src/home/process-apps.ts +181 -0
- package/src/home/resources.ts +3 -3
- package/src/home/run-daemon.ts +11 -2
- package/src/home/run-pm.ts +9 -1
- package/src/home/run-web.ts +7 -4
- package/src/home/serve-web.ts +64 -14
- package/src/home/supervise.ts +3 -1
- package/src/identities/collection.ts +49 -0
- package/src/identities/identities.ts +130 -11
- package/src/identities/machine.ts +4 -3
- package/src/identities/rating.ts +33 -0
- package/src/identities/shown.ts +170 -0
- package/src/identities/steps.ts +5 -0
- package/src/media-store/purge.ts +15 -1
- package/src/media-store/remote.ts +22 -6
- package/src/messages/brief.ts +117 -0
- package/src/messages/collection.ts +40 -0
- package/src/messages/model.ts +171 -0
- package/src/messages/routes.ts +15 -0
- package/src/messages/score.ts +180 -0
- package/src/messages/tabs.ts +13 -0
- package/src/release/notes.ts +130 -0
- package/src/release/run-bump.ts +41 -18
- package/src/release/run-release.ts +22 -4
- package/src/release/run-releases.ts +17 -15
- package/src/release/unit-resolve.ts +9 -0
- package/src/releases/add.ts +66 -0
- package/src/releases/collection.ts +36 -0
- package/src/releases/from-card.ts +66 -0
- package/src/releases/model.ts +267 -0
- package/src/releases/pictures.ts +89 -0
- package/src/releases/routes.ts +36 -0
- package/src/releases/store.ts +71 -0
- package/src/repo-config.ts +5 -0
- package/src/review/cells.ts +0 -11
- package/src/review/format.ts +10 -6
- package/src/review/http.ts +7 -2
- package/src/review/model.ts +92 -3
- package/src/review/notes.ts +2 -48
- package/src/review/routes.ts +28 -10
- package/src/review/stage-card.ts +197 -0
- package/src/review/stage-routes.ts +123 -0
- package/src/review/store.ts +117 -19
- package/src/review/trailer-card.ts +99 -0
- package/src/review/trailer-desk.ts +57 -4
- package/src/review/trailer-model.ts +41 -7
- package/src/review/trailer-notes.ts +45 -0
- package/src/review/trailer-routes.ts +22 -13
- package/src/secrets/manager.ts +59 -0
- package/src/secrets/name.ts +2 -0
- package/src/serve/hub-app/app-bridge.ts +71 -0
- package/src/serve/hub-app/col-card.tsx +10 -0
- package/src/serve/hub-app/cols-svc.ts +37 -6
- package/src/serve/hub-app/commands/commands-page.tsx +122 -0
- package/src/serve/hub-app/commands/commands-st.ts +177 -0
- package/src/serve/hub-app/commands.css +24 -0
- package/src/serve/hub-app/hash-route.ts +40 -1
- package/src/serve/hub-app/home-st.ts +11 -2
- package/src/serve/hub-app/home.html +3 -0
- package/src/serve/hub-app/hub-app.tsx +6 -0
- package/src/serve/hub-app/hub.css +1 -0
- package/src/serve/hub-app/icons.tsx +5 -0
- package/src/serve/hub-app/identities-view.tsx +4 -1
- package/src/serve/hub-app/identities.css +1 -0
- package/src/serve/hub-app/index.html +3 -0
- package/src/serve/hub-app/keys.ts +2 -2
- package/src/serve/hub-app/machine-st.ts +41 -10
- package/src/serve/hub-app/messages/messages-page.tsx +354 -0
- package/src/serve/hub-app/messages/messages-st.ts +74 -0
- package/src/serve/hub-app/messages.css +35 -0
- package/src/serve/hub-app/releases/releases-page.tsx +94 -0
- package/src/serve/hub-app/releases/releases-st.ts +69 -0
- package/src/serve/hub-app/releases.css +25 -0
- package/src/serve/hub-app/repo-sections.ts +15 -1
- package/src/serve/hub-app/repo-st.ts +56 -5
- package/src/serve/hub-app/review/clip-st.ts +31 -3
- package/src/serve/hub-app/review/note-place.ts +31 -0
- package/src/serve/hub-app/review/review-cells.tsx +27 -3
- package/src/serve/hub-app/review/review-st.ts +77 -2
- package/src/serve/hub-app/review/review-thread.tsx +9 -31
- package/src/serve/hub-app/review/review-views.tsx +164 -58
- package/src/serve/hub-app/review/thread-st.ts +108 -41
- package/src/serve/hub-app/review/trailer-card.tsx +187 -0
- package/src/serve/hub-app/review/trailer-page.tsx +62 -31
- package/src/serve/hub-app/review/trailer-st.ts +138 -26
- package/src/serve/hub-app/review/trailer-timeline.tsx +39 -26
- package/src/serve/hub-app/review.css +49 -6
- package/src/serve/hub-app/social/comms-page.tsx +55 -23
- package/src/serve/hub-app/social/identity-pictures.ts +112 -0
- package/src/serve/hub-app/social/kit.tsx +9 -6
- package/src/serve/hub-app/social/post-card.tsx +10 -2
- package/src/serve/hub-app/social/social-model.ts +37 -3
- package/src/serve/hub-app/social/social-page.tsx +236 -82
- package/src/serve/hub-app/social/social-st.ts +79 -26
- package/src/serve/hub-app/social/stage-popup.tsx +268 -0
- package/src/serve/hub-app/social/stage-st.ts +310 -0
- package/src/serve/hub-app/social/step-layout.ts +42 -0
- package/src/serve/hub-app/social.css +68 -4
- package/src/serve/hub-app/tree-build.ts +38 -1
- package/src/serve/hub-app/tree-svc.ts +10 -3
- package/src/serve/project-gutter-route.ts +4 -2
- package/src/serve/same-origin.ts +24 -1
- package/src/serve/serve-hub.ts +27 -3
- package/src/shipkit-files.ts +9 -7
- package/src/shot/shooter.ts +3 -3
- package/src/shot/shot-ask.ts +14 -3
- package/src/shot/shot.shipkit.ts +1 -1
- package/src/social/discord-layout.ts +282 -0
- package/src/social/fit.ts +84 -0
- package/src/social/identity-words.ts +74 -0
- package/src/social/kind-pages.ts +41 -0
- package/src/social/kinds.ts +92 -0
- package/src/social/load.ts +105 -9
- package/src/social/md.ts +14 -6
- package/src/social/media-limit.ts +63 -2
- package/src/social/presence.ts +1 -1
- package/src/social/publish/bluesky.ts +58 -19
- package/src/social/publish/discord.ts +3 -2
- package/src/social/publish/index.ts +31 -5
- package/src/social/reach.ts +49 -0
- package/src/social/release-stage.ts +173 -0
- package/src/social/routes.ts +44 -9
- package/src/social/stage.ts +227 -0
- package/src/social/strip.ts +85 -0
- package/src/social/text.ts +6 -2
- package/src/social/unit.ts +57 -1
- package/src/social/writes.ts +11 -0
- package/src/stores/routes.ts +2 -2
- package/src/suite/judge-suites.ts +1 -1
- package/src/suite/suite-cli.ts +5 -5
- package/src/trailer/build.ts +90 -52
- package/src/trailer/draft.ts +28 -0
- package/src/trailer/footage.ts +4 -2
- package/src/trailer/grammar.ts +25 -13
- package/src/trailer/graph.ts +32 -9
- package/src/trailer/profile.ts +35 -0
- package/src/trailer/prune.ts +15 -10
- package/src/trailer/public-words.ts +41 -0
- package/src/trailer/stitch.ts +22 -10
- package/src/trailer/titles.ts +47 -2
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
// a repo's releases page (`#page:releases[:<version>]`, wiki tools/shipkit/units.md, The release files): the versions on
|
|
2
|
+
// a row, next first; the one shown as its title, its date, then each category with its changes as cards, each its
|
|
3
|
+
// picture, its words, its bullets and a link to the review card it came from. Read only: the files are its source
|
|
4
|
+
import { observer } from 'mobx-react-lite'
|
|
5
|
+
import { useEffect } from 'react'
|
|
6
|
+
import { isPrivate, NEXT, type Change } from '../../../releases/model.ts'
|
|
7
|
+
import { hashFor } from '../hash-route.ts'
|
|
8
|
+
import type { RepoSt } from '../repo-st.ts'
|
|
9
|
+
import type { ReleasesSt } from './releases-st.ts'
|
|
10
|
+
|
|
11
|
+
const CLIP = /\.(mp4|webm|mov)(\?|$)/i
|
|
12
|
+
|
|
13
|
+
const ChangeCard = observer(({ rs, ch }: { rs: ReleasesSt; ch: Change }) => {
|
|
14
|
+
const pic = ch.picture
|
|
15
|
+
const card = ch.card ? hashFor({ t: 'review', id: ch.card }) : null
|
|
16
|
+
return (
|
|
17
|
+
<article className="rel-card">
|
|
18
|
+
{pic ? (
|
|
19
|
+
<div className="rel-pic">
|
|
20
|
+
{CLIP.test(pic.url) ? <video src={rs.src(pic.url)} muted loop autoPlay playsInline /> : <img src={rs.src(pic.url)} alt={pic.alt} loading="lazy" />}
|
|
21
|
+
</div>
|
|
22
|
+
) : null}
|
|
23
|
+
<div className="rel-words">
|
|
24
|
+
<h3>{ch.title}</h3>
|
|
25
|
+
{ch.text ? <p>{ch.text}</p> : null}
|
|
26
|
+
{ch.bullets.length > 0 ? (
|
|
27
|
+
<ul>
|
|
28
|
+
{ch.bullets.map((b) => (
|
|
29
|
+
<li key={b}>{b}</li>
|
|
30
|
+
))}
|
|
31
|
+
</ul>
|
|
32
|
+
) : null}
|
|
33
|
+
<footer>
|
|
34
|
+
{card ? <a href={`#${card}`}>review card</a> : <span>written by hand</span>}
|
|
35
|
+
{ch.commit ? <code>{ch.commit.slice(0, 8)}</code> : null}
|
|
36
|
+
{pic && isPrivate(pic) ? <span className="rel-private" title="kept private in the Space: sk bump makes it public">private until released</span> : null}
|
|
37
|
+
</footer>
|
|
38
|
+
</div>
|
|
39
|
+
</article>
|
|
40
|
+
)
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
export const ReleasesPage = observer(({ app }: { app: RepoSt }) => {
|
|
44
|
+
const rs = app.releases
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
rs.start()
|
|
47
|
+
return () => rs.stop()
|
|
48
|
+
}, [rs])
|
|
49
|
+
const r = rs.current
|
|
50
|
+
const changes = r ? r.categories.reduce((n, c) => n + c.changes.length, 0) : 0
|
|
51
|
+
return (
|
|
52
|
+
<div className="rel-page">
|
|
53
|
+
<header>
|
|
54
|
+
<h1>Releases</h1>
|
|
55
|
+
<nav>
|
|
56
|
+
{rs.releases.map((x) => (
|
|
57
|
+
<button key={x.version} type="button" className={x.version === r?.version ? 'on' : ''} onClick={() => rs.show(x.version)}>
|
|
58
|
+
{x.version}
|
|
59
|
+
</button>
|
|
60
|
+
))}
|
|
61
|
+
</nav>
|
|
62
|
+
</header>
|
|
63
|
+
{rs.error ? <p className="rel-error">{rs.error}</p> : null}
|
|
64
|
+
{(rs.view?.errors ?? []).map((e) => (
|
|
65
|
+
<p key={e} className="rel-error">
|
|
66
|
+
{e}
|
|
67
|
+
</p>
|
|
68
|
+
))}
|
|
69
|
+
{r == null ? (
|
|
70
|
+
<p className="rel-hint">{rs.view ? 'no release file yet: a card sent with --changelog and approved starts next.md' : 'loading…'}</p>
|
|
71
|
+
) : (
|
|
72
|
+
<section className="rel-release">
|
|
73
|
+
<h2>
|
|
74
|
+
{r.version === NEXT ? 'Next release' : r.version}
|
|
75
|
+
{r.title ? `: ${r.title}` : ''}
|
|
76
|
+
</h2>
|
|
77
|
+
<p className="rel-hint">
|
|
78
|
+
{r.version === NEXT ? `being filled${r.kind ? `, a ${r.kind} release` : ', its kind unsaid'}` : r.date}, {changes} change{changes === 1 ? '' : 's'}
|
|
79
|
+
</p>
|
|
80
|
+
{r.categories.map((c) => (
|
|
81
|
+
<div key={c.name} className="rel-category">
|
|
82
|
+
<h3 className="rel-cat">{c.name}</h3>
|
|
83
|
+
<div className="rel-grid">
|
|
84
|
+
{c.changes.map((ch) => (
|
|
85
|
+
<ChangeCard key={`${ch.card ?? ''}${ch.title}`} rs={rs} ch={ch} />
|
|
86
|
+
))}
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
))}
|
|
90
|
+
</section>
|
|
91
|
+
)}
|
|
92
|
+
</div>
|
|
93
|
+
)
|
|
94
|
+
})
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// a repo's releases page as state (wiki tools/shipkit/units.md, The release files): every release file read from the
|
|
2
|
+
// hub, the version shown in the address. Read when the page opens and when the window comes back; the files are
|
|
3
|
+
// written by an approval, `sk releases add` or a hand, so the page never writes
|
|
4
|
+
import { makeAutoObservable, runInAction } from 'mobx'
|
|
5
|
+
import { pictureRoute, type Release } from '../../../releases/model.ts'
|
|
6
|
+
import type { ReleasesView } from '../../../releases/routes.ts'
|
|
7
|
+
import { reach } from '../reach.ts'
|
|
8
|
+
import type { RepoSt } from '../repo-st.ts'
|
|
9
|
+
|
|
10
|
+
export class ReleasesSt {
|
|
11
|
+
view: ReleasesView | null = null
|
|
12
|
+
error: string | null = null
|
|
13
|
+
/** the version the address names, null for the first */
|
|
14
|
+
version: string | null = null
|
|
15
|
+
private started = 0
|
|
16
|
+
|
|
17
|
+
constructor(private readonly st: RepoSt) {
|
|
18
|
+
makeAutoObservable<this, 'st' | 'started' | 'onBack'>(this, { st: false, started: false, onBack: false })
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
get releases(): Release[] {
|
|
22
|
+
return this.view?.releases ?? []
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** the release shown: the one the address names, else the first (next, when it is being filled) */
|
|
26
|
+
get current(): Release | null {
|
|
27
|
+
return this.releases.find((r) => r.version === this.version) ?? this.releases[0] ?? null
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
start(): void {
|
|
31
|
+
if (this.started++ === 0) window.addEventListener('focus', this.onBack)
|
|
32
|
+
void this.load()
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
stop(): void {
|
|
36
|
+
if (--this.started === 0) window.removeEventListener('focus', this.onBack)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
private readonly onBack = (): void => void this.load()
|
|
40
|
+
|
|
41
|
+
async load(): Promise<void> {
|
|
42
|
+
try {
|
|
43
|
+
const r = await reach(this.st.url('/api/releases'))
|
|
44
|
+
const body = (await r.json()) as ReleasesView & { error?: string }
|
|
45
|
+
if (!r.ok) throw new Error(body.error ?? `HTTP ${r.status}`)
|
|
46
|
+
runInAction(() => {
|
|
47
|
+
this.view = body
|
|
48
|
+
this.error = null
|
|
49
|
+
})
|
|
50
|
+
} catch (e) {
|
|
51
|
+
runInAction(() => (this.error = (e as Error).message))
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
select(version: string | null): void {
|
|
56
|
+
this.version = version
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** a click on a version: the address follows */
|
|
60
|
+
show(version: string): void {
|
|
61
|
+
this.st.showReleases(version)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** a picture's address on this hub */
|
|
65
|
+
src(url: string): string {
|
|
66
|
+
const path = pictureRoute(url)
|
|
67
|
+
return path === url ? url : this.st.url(path)
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/* the releases page (hub-app/releases/, wiki tools/shipkit/units.md, The release files): white cards on the gray
|
|
2
|
+
ground, the hub's tokens; each change a card, its picture on top */
|
|
3
|
+
.rel-page{flex:1;min-width:0;max-width:1280px;display:flex;flex-direction:column;gap:var(--s4);font-size:14px;line-height:1.45}
|
|
4
|
+
.rel-page header{display:flex;flex-wrap:wrap;gap:var(--s3);align-items:center}
|
|
5
|
+
.rel-page h1{font-size:20px;margin:0}
|
|
6
|
+
.rel-page nav{display:flex;gap:var(--s1);flex-wrap:wrap}
|
|
7
|
+
.rel-page nav button{font:inherit;padding:var(--s1) var(--s3);border-radius:7px;border:1px solid var(--line);background:var(--panel);color:var(--ink);cursor:pointer}
|
|
8
|
+
.rel-page nav button.on{background:var(--accent);border-color:var(--accent);color:var(--panel)}
|
|
9
|
+
.rel-release h2{font-size:18px;margin:0}
|
|
10
|
+
.rel-category{display:grid;gap:var(--s3);margin-top:var(--s4)}
|
|
11
|
+
.rel-cat{font-size:13px;text-transform:uppercase;letter-spacing:.08em;color:var(--dim);margin:0}
|
|
12
|
+
.rel-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:var(--s3)}
|
|
13
|
+
.rel-card{background:var(--panel);border:1px solid var(--line);border-radius:10px;overflow:hidden;display:flex;flex-direction:column;min-width:0}
|
|
14
|
+
.rel-pic{background:var(--line);aspect-ratio:16/10;display:flex;align-items:center;justify-content:center}
|
|
15
|
+
.rel-pic img,.rel-pic video{width:100%;height:100%;object-fit:cover;display:block}
|
|
16
|
+
.rel-words{padding:var(--s3) var(--s4);display:grid;gap:var(--s2)}
|
|
17
|
+
.rel-words h3{margin:0;font-size:15px}
|
|
18
|
+
.rel-words p{margin:0}
|
|
19
|
+
.rel-words ul{margin:0;padding-left:var(--s4)}
|
|
20
|
+
.rel-words footer{display:flex;flex-wrap:wrap;gap:var(--s3);align-items:center;font-size:12px;color:var(--dim)}
|
|
21
|
+
.rel-words footer a{color:var(--accent)}
|
|
22
|
+
.rel-words code{font-family:ui-monospace,Menlo,monospace}
|
|
23
|
+
.rel-private{border:1px solid var(--warn);color:var(--warn);border-radius:999px;padding:0 var(--s2)}
|
|
24
|
+
.rel-hint{color:var(--dim);margin:0;font-size:13px}
|
|
25
|
+
.rel-error{color:var(--errink);background:var(--errbg);border:1px solid var(--errline);border-radius:7px;padding:var(--s2) var(--s3);margin:0}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
// own has none of the three. The counts read the severity filter, like everything under them,
|
|
9
9
|
// and come from what the page already holds (the kept screen on a reload), so
|
|
10
10
|
// none arrives late and moves the tree.
|
|
11
|
-
import { REVIEW_COL, RUNS_ID, STORES_COL, TRAILER_COL, VEILLE_COL } from '../../collections/collection-types.ts'
|
|
11
|
+
import { MESSAGES_COL, RELEASES_COL, REVIEW_COL, RUNS_ID, STORES_COL, TRAILER_COL, VEILLE_COL } from '../../collections/collection-types.ts'
|
|
12
12
|
import type { CheckOwner, HashSel } from './hash-route.ts'
|
|
13
13
|
import { sectionLabel, type SectionId } from './keys.ts'
|
|
14
14
|
import type { RepoSt } from './repo-st.ts'
|
|
@@ -42,12 +42,15 @@ export function sectionOfSel(sel: HashSel | null, ownerOf: (checkItemId: string)
|
|
|
42
42
|
case 'processes': return 'processes'
|
|
43
43
|
case 'plan': return 'plan'
|
|
44
44
|
case 'git': return 'git'
|
|
45
|
+
case 'commands': return 'commands'
|
|
45
46
|
case 'when': return 'when'
|
|
46
47
|
case 'checks': return sel.from
|
|
47
48
|
case 'admin': return 'admin'
|
|
48
49
|
case 'review': return 'review'
|
|
49
50
|
case 'trailer': return 'trailer'
|
|
50
51
|
case 'stores': return 'stores'
|
|
52
|
+
case 'releases': return 'releases'
|
|
53
|
+
case 'messages': return 'messages'
|
|
51
54
|
case 'veille': return 'veille'
|
|
52
55
|
case 'comms': return 'comms'
|
|
53
56
|
case 'social': return 'social'
|
|
@@ -63,6 +66,8 @@ export function sectionOfSel(sel: HashSel | null, ownerOf: (checkItemId: string)
|
|
|
63
66
|
if (col === REVIEW_COL) return 'review'
|
|
64
67
|
if (col === TRAILER_COL) return 'trailer'
|
|
65
68
|
if (col === STORES_COL) return 'stores'
|
|
69
|
+
if (col === RELEASES_COL) return 'releases'
|
|
70
|
+
if (col === MESSAGES_COL) return 'messages'
|
|
66
71
|
if (col === VEILLE_COL) return 'veille'
|
|
67
72
|
if (col === 'checks') return sel.t === 'item' ? ownerOf(sel.id) : null
|
|
68
73
|
return col === 'asks' || col === 'tests' || col === 'reflections' ? col : null
|
|
@@ -86,6 +91,7 @@ export function openSection(app: RepoSt, id: SectionId): void {
|
|
|
86
91
|
case 'processes': return app.showProcesses(null)
|
|
87
92
|
case 'plan': return app.showPlan()
|
|
88
93
|
case 'git': return app.showGit()
|
|
94
|
+
case 'commands': return app.showCommands(app.commands.cmd, app.commands.runId)
|
|
89
95
|
case 'when': return app.showWhen()
|
|
90
96
|
case 'reflections': return app.showCol('reflections')
|
|
91
97
|
case 'asks': return app.showCol('asks')
|
|
@@ -100,6 +106,8 @@ export function openSection(app: RepoSt, id: SectionId): void {
|
|
|
100
106
|
case 'review': return app.showReview(app.review.selectedId)
|
|
101
107
|
case 'trailer': return app.showTrailer(app.trailer.trailerId, app.trailer.cutId)
|
|
102
108
|
case 'stores': return app.showStores(app.stores.store)
|
|
109
|
+
case 'releases': return app.showReleases(app.releases.version)
|
|
110
|
+
case 'messages': return app.showMessages('messages')
|
|
103
111
|
case 'veille': return app.showVeille(app.veille.picked)
|
|
104
112
|
case 'comms': return app.showComms(app.social.draftSlug, app.social.draftPart)
|
|
105
113
|
case 'social': return app.showSocial(app.social.identity, app.social.account, app.social.place)
|
|
@@ -130,6 +138,10 @@ export function repoSections(app: RepoSt): RepoSection[] {
|
|
|
130
138
|
unless(has(TRAILER_COL), 'no trailer: write trailer/<name>/main.trailer, then sk trailer')))
|
|
131
139
|
out.push(line('stores', 'the store pages (Steam, itch): every text to paste, every picture to upload, a note on each', none,
|
|
132
140
|
unless(has(STORES_COL), 'no store page: write .shipkit/steam/store.md or .shipkit/itch/listing.md')))
|
|
141
|
+
out.push(line('releases', 'the release notes: next first, then each version, each change a card with its picture and its review card', none,
|
|
142
|
+
unless(has(RELEASES_COL), 'no releases: an approved card sent with --changelog starts .shipkit/releases/next.md')))
|
|
143
|
+
out.push(line('messages', 'the messages a public line says, each phrasing scored by simulated readers: value for its cost, personas, page tops, notes', none,
|
|
144
|
+
unless(has(MESSAGES_COL), 'no messages: write .shipkit/messages/messages.md, then sk messages lint')))
|
|
133
145
|
out.push(line('veille', 'the posts its identity scrolls past, ranked by the worth of a reply, a reply drafted in its voice', none,
|
|
134
146
|
unless(has(VEILLE_COL), "no Veille: the identity this repo speaks as has no watch list (its veille.md)")))
|
|
135
147
|
// every repo has both: a repo with no draft yet still opens the page that says how a first one comes
|
|
@@ -149,6 +161,8 @@ export function repoSections(app: RepoSt): RepoSection[] {
|
|
|
149
161
|
out.push(line('processes', 'the processes this repo declares: start, stop, open, their description and their log', counted(procs.filter((r) => r.dot === 'crashed').length, 'red'),
|
|
150
162
|
unless(procs.length > 0, 'no process: this repo declares no global process (a <id>.shipkit.ts file with globalProcess adds one)')))
|
|
151
163
|
if (app.home.machine != null) out.push(line('git', 'the branch, its upstream, what is not committed, the last commits', none))
|
|
164
|
+
out.push(line('commands', "the repo's project CLI: every command with its description, run from here, its log live", counted(app.commands.running, 'warn'),
|
|
165
|
+
unless(app.hasCli, 'no project CLI: package.json has no `cli` script')))
|
|
152
166
|
const open = res.filter((r) => r.collection === 'asks' && r.type === 'ask' && r.slot !== 'done').length
|
|
153
167
|
out.push(line('asks', 'what waits on a human', counted(open, 'warn'), unless(has('asks'), 'no asks: nothing has ever waited on a human here')))
|
|
154
168
|
out.push(line('reflections', 'friction this repo logged against the wiki, waiting to be folded in', counted(res.filter((r) => r.type === 'reflection').length, 'warn'), unless(has('reflections'), 'no reflections: this repo logged no friction')))
|
|
@@ -18,12 +18,17 @@ import { TimelineSvc } from './timeline-svc.ts'
|
|
|
18
18
|
import { TreeSvc } from './tree-svc.ts'
|
|
19
19
|
import { ChecksSvc } from './checks-svc.ts'
|
|
20
20
|
import { GitSt } from './git-st.ts'
|
|
21
|
+
import { CommandsSt } from './commands/commands-st.ts'
|
|
21
22
|
import type { ProcessRow } from '../../home/process-rows.ts'
|
|
22
23
|
import { TestsSvc } from './tests-svc.ts'
|
|
23
24
|
import { AdminSvc } from './admin-svc.ts'
|
|
24
25
|
import { ReviewSt } from './review/review-st.ts'
|
|
25
26
|
import { TrailerSt } from './review/trailer-st.ts'
|
|
26
27
|
import { StoresSt } from './stores/stores-st.ts'
|
|
28
|
+
import { MessagesSt } from './messages/messages-st.ts'
|
|
29
|
+
import { ReleasesSt } from './releases/releases-st.ts'
|
|
30
|
+
import { sectionKey } from './tree-build.ts'
|
|
31
|
+
import type { MessagesTab } from '../../messages/tabs.ts'
|
|
27
32
|
import { VeilleSt } from './veille/veille-st.ts'
|
|
28
33
|
import { SocialSt } from './social/social-st.ts'
|
|
29
34
|
import { WikiSt } from './wiki-st.ts'
|
|
@@ -70,6 +75,10 @@ export class RepoSt {
|
|
|
70
75
|
live: LiveSvc
|
|
71
76
|
/** the git page's one repo read (git-st.ts) */
|
|
72
77
|
git: GitSt
|
|
78
|
+
/** the commands page: the project CLI's commands and their runs (commands/commands-st.ts) */
|
|
79
|
+
commands: CommandsSt
|
|
80
|
+
/** the repo has a project CLI (a `cli` script), from /hub.json */
|
|
81
|
+
hasCli = false
|
|
73
82
|
/** the pages behind the test groups of the tree (tests-svc.ts) */
|
|
74
83
|
tests: TestsSvc
|
|
75
84
|
/** the admin page: archive behind its confirmation, reload, keep active */
|
|
@@ -80,6 +89,10 @@ export class RepoSt {
|
|
|
80
89
|
trailer: TrailerSt
|
|
81
90
|
/** the stores page: the repo's Steam and itch pages, his notes on each thing (stores/stores-st.ts) */
|
|
82
91
|
stores: StoresSt
|
|
92
|
+
/** the releases page: each version of the release files, its changes as cards (releases/releases-st.ts) */
|
|
93
|
+
releases: ReleasesSt
|
|
94
|
+
/** the messages page: the store's messages, phrasings scored by each reader, its tabs (messages/messages-st.ts) */
|
|
95
|
+
messages: MessagesSt
|
|
83
96
|
/** the Veille page: the posts its identity scrolls past, ranked, and a reply (veille/veille-st.ts) */
|
|
84
97
|
veille: VeilleSt
|
|
85
98
|
/** the Communications and Social pages: the repo's drafts, every identity and its accounts (social/social-st.ts) */
|
|
@@ -123,16 +136,19 @@ export class RepoSt {
|
|
|
123
136
|
this.timeline = new TimelineSvc(this)
|
|
124
137
|
this.live = new LiveSvc(this)
|
|
125
138
|
this.git = new GitSt(this)
|
|
139
|
+
this.commands = new CommandsSt(this)
|
|
126
140
|
this.tests = new TestsSvc(this)
|
|
127
141
|
this.admin = new AdminSvc(this)
|
|
128
142
|
this.review = new ReviewSt(this)
|
|
129
143
|
this.trailer = new TrailerSt(this)
|
|
130
144
|
this.stores = new StoresSt(this)
|
|
145
|
+
this.releases = new ReleasesSt(this)
|
|
146
|
+
this.messages = new MessagesSt(this)
|
|
131
147
|
this.veille = new VeilleSt(this)
|
|
132
148
|
this.social = new SocialSt(this)
|
|
133
149
|
this.wiki = new WikiSt(this)
|
|
134
150
|
this.pages = new PagesSvc(this)
|
|
135
|
-
makeAutoObservable<this, 'beat' | 'onceRead' | 'entry'>(this, { onceRead: false, entry: false, home: false, key: false, base: false, clock: false, media: false, cols: false, tree: false, health: false, readme: false, checks: false, comfy: false, timeline: false, live: false, git: false, tests: false, admin: false, review: false, trailer: false, stores: false, veille: false, social: false, wiki: false, pages: false, searchEl: false, beat: false })
|
|
151
|
+
makeAutoObservable<this, 'beat' | 'onceRead' | 'entry'>(this, { onceRead: false, entry: false, home: false, key: false, base: false, clock: false, media: false, cols: false, tree: false, health: false, readme: false, checks: false, comfy: false, timeline: false, live: false, git: false, commands: false, tests: false, admin: false, review: false, trailer: false, stores: false, releases: false, messages: false, veille: false, social: false, wiki: false, pages: false, searchEl: false, beat: false })
|
|
136
152
|
// a view or a filter changed on the review page: its address follows, the card unchanged
|
|
137
153
|
reaction(
|
|
138
154
|
() => (this.sel?.t === 'review' ? this.review.address : null),
|
|
@@ -173,8 +189,12 @@ export class RepoSt {
|
|
|
173
189
|
/** the repo's name and where it sits on disk, from /hub.json */
|
|
174
190
|
private readHub(): Promise<void> {
|
|
175
191
|
return fetch(this.url('/hub.json'))
|
|
176
|
-
.then((r) => r.json() as Promise<{ name: string; root?: string }>)
|
|
177
|
-
.then((h) => {
|
|
192
|
+
.then((r) => r.json() as Promise<{ name: string; root?: string; cli?: boolean }>)
|
|
193
|
+
.then((h) => {
|
|
194
|
+
this.setHub(h.name, h.root ?? '', h.cli === true)
|
|
195
|
+
// the commands are rows of the tree, so they are read with the repo, not when their page opens
|
|
196
|
+
if (h.cli === true) void this.commands.load()
|
|
197
|
+
})
|
|
178
198
|
.catch(() => {})
|
|
179
199
|
}
|
|
180
200
|
|
|
@@ -241,9 +261,10 @@ export class RepoSt {
|
|
|
241
261
|
this.seen = true
|
|
242
262
|
}
|
|
243
263
|
|
|
244
|
-
private setHub(n: string, root: string): void {
|
|
264
|
+
private setHub(n: string, root: string, cli: boolean): void {
|
|
245
265
|
this.name = n
|
|
246
266
|
this.root = root
|
|
267
|
+
this.hasCli = cli
|
|
247
268
|
}
|
|
248
269
|
|
|
249
270
|
setFilter(v: Filter): void {
|
|
@@ -321,7 +342,7 @@ export class RepoSt {
|
|
|
321
342
|
if (cur.kind === next.kind && cur.col === next.col && cur.id === next.id) {
|
|
322
343
|
// the trailer's note and filter, the review's view and filters ride on their page, as the tool set does on an
|
|
323
344
|
// asset: no history entry
|
|
324
|
-
if ((next.kind === 'trailer' || next.kind === 'review' || next.kind === 'stores' || next.kind === 'veille' || next.kind === 'comms' || next.kind === 'page') && currentHash() !== h) history.replaceState(null, '', `#${h}`)
|
|
345
|
+
if ((next.kind === 'trailer' || next.kind === 'review' || next.kind === 'stores' || next.kind === 'releases' || next.kind === 'messages' || next.kind === 'veille' || next.kind === 'comms' || next.kind === 'page') && currentHash() !== h) history.replaceState(null, '', `#${h}`)
|
|
325
346
|
return
|
|
326
347
|
}
|
|
327
348
|
if (this.entry.how() === 'replace') history.replaceState(null, '', `#${h}`)
|
|
@@ -332,9 +353,12 @@ export class RepoSt {
|
|
|
332
353
|
* lands on the raw wall of text unless it is asked for by name */
|
|
333
354
|
openResource(r: Resource): void {
|
|
334
355
|
if (r.type === 'process') return this.showProcesses(r.id.replace(/^process:/, ''))
|
|
356
|
+
if (r.type === 'command') return this.showCommands(r.id.replace(/^command:/, ''), null)
|
|
335
357
|
if (r.type === 'card') return this.showReview(r.id.replace(/^card:/, ''))
|
|
336
358
|
if (r.type === 'store') return this.showStores(r.id.replace(/^store:/, ''))
|
|
359
|
+
if (r.type === 'release') return this.showReleases(r.id.replace(/^release:/, ''))
|
|
337
360
|
if (r.type === 'veille') return this.showVeille(this.veille.picked)
|
|
361
|
+
if (r.type === 'message') return this.showMessages(r.id.replace(/^message:/, '') as MessagesTab, this.messages.picked || null)
|
|
338
362
|
if (r.type === 'cut') {
|
|
339
363
|
const [trailer = null, cut = null] = r.id.replace(/^cut:/, '').split('/')
|
|
340
364
|
return this.showTrailer(trailer, cut)
|
|
@@ -379,6 +403,15 @@ export class RepoSt {
|
|
|
379
403
|
showGit(): void {
|
|
380
404
|
this.setSel({ t: 'git' })
|
|
381
405
|
}
|
|
406
|
+
/** the commands page on a command, null for none open, and one of its runs */
|
|
407
|
+
showCommands(cmd: string | null, run: string | null = null): void {
|
|
408
|
+
this.commands.select(cmd, run)
|
|
409
|
+
// the tree is the list: the command opened shows where it sits
|
|
410
|
+
this.tree.reveal(sectionKey('commands'))
|
|
411
|
+
// its family's branch, when it has one: the rows may not be read yet, and a key no branch has unfolds nothing
|
|
412
|
+
if (cmd != null) this.tree.reveal(`cmdfam:${cmd.split(' ')[0]}`)
|
|
413
|
+
this.setSel({ t: 'commands', cmd, ...(run ? { run } : {}) })
|
|
414
|
+
}
|
|
382
415
|
/** the processes page, `id` the card to scroll to and light */
|
|
383
416
|
showProcesses(id: string | null): void {
|
|
384
417
|
this.setSel({ t: 'processes', id })
|
|
@@ -410,6 +443,21 @@ export class RepoSt {
|
|
|
410
443
|
this.setSel({ t: 'stores', store, ...(asset ? { asset } : {}) })
|
|
411
444
|
}
|
|
412
445
|
|
|
446
|
+
/** the releases page on a version (`next` or X.Y.Z), null for the first; its versions are rows under the section */
|
|
447
|
+
showReleases(version: string | null): void {
|
|
448
|
+
this.releases.select(version)
|
|
449
|
+
this.tree.reveal(sectionKey('releases'))
|
|
450
|
+
this.setSel({ t: 'releases', version })
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
/** the messages page on a tab, `run` the run it scores by, null for the newest */
|
|
454
|
+
showMessages(tab: MessagesTab, run: string | null = null): void {
|
|
455
|
+
this.messages.select(tab, run)
|
|
456
|
+
// the tabs are rows under the section: the page shown, they are in sight
|
|
457
|
+
this.tree.reveal(sectionKey('messages'))
|
|
458
|
+
this.setSel({ t: 'messages', tab, ...(run ? { run } : {}) })
|
|
459
|
+
}
|
|
460
|
+
|
|
413
461
|
/** the Veille page, `post` the post picked; `q` its window, chips, folds and lightbox, as an address carries them */
|
|
414
462
|
showVeille(post: string | null, q?: string): void {
|
|
415
463
|
if (q !== undefined) this.veille.applyAddress(q)
|
|
@@ -464,11 +512,14 @@ export class RepoSt {
|
|
|
464
512
|
case 'processes': return this.showProcesses(sel.id)
|
|
465
513
|
case 'plan': return this.showPlan()
|
|
466
514
|
case 'git': return this.showGit()
|
|
515
|
+
case 'commands': return this.showCommands(sel.cmd, sel.run ?? null)
|
|
467
516
|
case 'when': return this.showWhen()
|
|
468
517
|
case 'checks': return this.showChecks(sel.from)
|
|
469
518
|
case 'review': return this.showReview(sel.id, sel.q ?? '')
|
|
470
519
|
case 'trailer': return this.showTrailer(sel.trailer, sel.cut, sel.note ?? null, sel.filter ?? null)
|
|
471
520
|
case 'stores': return this.showStores(sel.store, sel.asset ?? null)
|
|
521
|
+
case 'releases': return this.showReleases(sel.version)
|
|
522
|
+
case 'messages': return this.showMessages(sel.tab, sel.run ?? null)
|
|
472
523
|
case 'veille': return this.showVeille(sel.post, sel.q ?? '')
|
|
473
524
|
case 'comms': return this.showComms(sel.draft, sel.part ?? null, sel.q ?? '')
|
|
474
525
|
case 'social': return this.showSocial(sel.identity, sel.account ?? null, sel.place ?? null)
|
|
@@ -12,8 +12,11 @@ interface ClipEl {
|
|
|
12
12
|
volume: number
|
|
13
13
|
playbackRate: number
|
|
14
14
|
readonly paused: boolean
|
|
15
|
+
/** a seek is in flight: its frame is not drawn yet */
|
|
16
|
+
readonly seeking?: boolean
|
|
15
17
|
play(): Promise<void> | void
|
|
16
18
|
pause(): void
|
|
19
|
+
addEventListener?(type: 'seeked', f: () => void, o?: { once?: boolean }): void
|
|
17
20
|
}
|
|
18
21
|
|
|
19
22
|
/** a follower further than this from the first video, in seconds, is put back on it */
|
|
@@ -109,10 +112,35 @@ export class ClipSt {
|
|
|
109
112
|
rate = 1
|
|
110
113
|
private els: ClipEl[] = []
|
|
111
114
|
private raf = 0
|
|
115
|
+
/** the time a video goes to once its seek in flight lands */
|
|
116
|
+
private readonly next = new Map<ClipEl, number>()
|
|
112
117
|
|
|
113
118
|
constructor() {
|
|
114
119
|
this.sound = heard.on
|
|
115
|
-
makeAutoObservable<this, 'els' | 'raf' | 'follow'>(this, { els: false, raf: false, follow: false })
|
|
120
|
+
makeAutoObservable<this, 'els' | 'raf' | 'follow' | 'next' | 'place'>(this, { els: false, raf: false, follow: false, next: false, place: false })
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/** a video sent to `t`: at once, or once its seek in flight lands. A drag sets a time on every move, and an engine
|
|
124
|
+
* that starts a seek over another may never draw the last frame (WebKit keeps the old one until play); one seek at
|
|
125
|
+
* a time, the latest time last, always ends on the frame asked */
|
|
126
|
+
private place(el: ClipEl, t: number): void {
|
|
127
|
+
if (el.seeking && el.addEventListener) {
|
|
128
|
+
const waiting = this.next.has(el)
|
|
129
|
+
this.next.set(el, t)
|
|
130
|
+
if (!waiting)
|
|
131
|
+
el.addEventListener(
|
|
132
|
+
'seeked',
|
|
133
|
+
() => {
|
|
134
|
+
const to = this.next.get(el)
|
|
135
|
+
this.next.delete(el)
|
|
136
|
+
if (to !== undefined && to !== el.currentTime) this.place(el, to)
|
|
137
|
+
},
|
|
138
|
+
{ once: true },
|
|
139
|
+
)
|
|
140
|
+
return
|
|
141
|
+
}
|
|
142
|
+
this.next.delete(el)
|
|
143
|
+
el.currentTime = t
|
|
116
144
|
}
|
|
117
145
|
|
|
118
146
|
get volume(): number {
|
|
@@ -205,7 +233,7 @@ export class ClipSt {
|
|
|
205
233
|
this.time = this.centerOf(this.frameOf(t))
|
|
206
234
|
for (const el of this.els) {
|
|
207
235
|
el.pause()
|
|
208
|
-
el
|
|
236
|
+
this.place(el, this.time)
|
|
209
237
|
}
|
|
210
238
|
}
|
|
211
239
|
|
|
@@ -214,7 +242,7 @@ export class ClipSt {
|
|
|
214
242
|
if (this.paused) return this.seek(t)
|
|
215
243
|
const to = Math.max(0, Math.min(this.duration, t))
|
|
216
244
|
this.time = to
|
|
217
|
-
for (const el of this.els) el
|
|
245
|
+
for (const el of this.els) this.place(el, to)
|
|
218
246
|
}
|
|
219
247
|
|
|
220
248
|
setRate(r: number): void {
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// where a rectangle's note box sits on its frame (wiki tools/shipkit/review-page.md): beside the rectangle, never over
|
|
2
|
+
// it, inside the frame. Pure, in px from the frame's top left: the box and its tests share it
|
|
3
|
+
|
|
4
|
+
export type PlaceBox = { x: number; y: number; w: number; h: number }
|
|
5
|
+
export type NoteSide = 'below' | 'above' | 'right' | 'left'
|
|
6
|
+
export type NotePlace = { left: number; top: number; side: NoteSide; inside: boolean }
|
|
7
|
+
|
|
8
|
+
/** px between the rectangle and its box; over it the box also clears the rectangle's number or label */
|
|
9
|
+
export const NOTE_GAP = { side: 6, above: 24 } as const
|
|
10
|
+
|
|
11
|
+
const clamp = (v: number, lo: number, hi: number): number => Math.max(lo, Math.min(hi, v))
|
|
12
|
+
|
|
13
|
+
/** under the rectangle, else over it, else right of it, else left of it: the first that fits in the frame. None fits (a
|
|
14
|
+
* small frame, a rectangle over most of it): under or over it, where the frame has more room, past the frame's edge */
|
|
15
|
+
export function notePlace(r: PlaceBox, frame: { w: number; h: number }, note: { w: number; h: number }): NotePlace {
|
|
16
|
+
const x = clamp(r.x, 0, Math.max(0, frame.w - note.w))
|
|
17
|
+
const y = clamp(r.y, 0, Math.max(0, frame.h - note.h))
|
|
18
|
+
const below = r.y + r.h + NOTE_GAP.side
|
|
19
|
+
const above = r.y - NOTE_GAP.above - note.h
|
|
20
|
+
const wide = note.w <= frame.w
|
|
21
|
+
const tall = note.h <= frame.h
|
|
22
|
+
const tries: [NoteSide, number, number, boolean][] = [
|
|
23
|
+
['below', x, below, wide && below + note.h <= frame.h],
|
|
24
|
+
['above', x, above, wide && above >= 0],
|
|
25
|
+
['right', r.x + r.w + NOTE_GAP.side, y, tall && r.x + r.w + NOTE_GAP.side + note.w <= frame.w],
|
|
26
|
+
['left', r.x - NOTE_GAP.side - note.w, y, tall && r.x - NOTE_GAP.side - note.w >= 0],
|
|
27
|
+
]
|
|
28
|
+
const fit = tries.find((t) => t[3])
|
|
29
|
+
if (fit) return { side: fit[0], left: fit[1], top: fit[2], inside: true }
|
|
30
|
+
return frame.h - (r.y + r.h) >= r.y ? { side: 'below', left: x, top: below, inside: false } : { side: 'above', left: x, top: above, inside: false }
|
|
31
|
+
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// click shows the view they sit on), a reply and a note are words; a run of state changes is one thin line
|
|
5
5
|
import { observer } from 'mobx-react-lite'
|
|
6
6
|
import type { EventCell, NoteCell, ReplyCell, VerdictCell, VersionCell } from '../../../review/cells.ts'
|
|
7
|
-
import { isGallery, STATUS_LABEL, viewName, viewTag, type Rect } from '../../../review/model.ts'
|
|
7
|
+
import { isGallery, isTrailerCard, STATUS_LABEL, viewName, viewTag, type Item, type Rect, type TrailerCard } from '../../../review/model.ts'
|
|
8
8
|
import { Caret, Icon, ICON } from '../icons.tsx'
|
|
9
9
|
import { renderMd } from '../md.ts'
|
|
10
10
|
import { ageWords, stampWords } from '../time-ago.tsx'
|
|
@@ -13,6 +13,7 @@ import { keepFocus, laneColor, REACTIONS, secs, SIDE_LABEL, toneOf } from './kit
|
|
|
13
13
|
import type { ReviewSt } from './review-st.ts'
|
|
14
14
|
import { VersionViews } from './review-views.tsx'
|
|
15
15
|
import { cellDom, type Framed, type ThreadSt } from './thread-st.ts'
|
|
16
|
+
import { NoteMeta, NoteStill, TrailerCardBody } from './trailer-card.tsx'
|
|
16
17
|
|
|
17
18
|
/** who a cell is from, as its header says it: you, a player, or the agent's lane */
|
|
18
19
|
const whoWords = (who: string): string => (who === 'owner' ? 'you' : who)
|
|
@@ -130,7 +131,8 @@ const VersionMain = observer(({ rv, card, c }: { rv: ReviewSt; card: ThreadSt; c
|
|
|
130
131
|
</div>
|
|
131
132
|
<KindView app={rv} item={r} stamp={stamp} />
|
|
132
133
|
<AnimPanel app={rv} item={r} />
|
|
133
|
-
{
|
|
134
|
+
{/* every version of a trailer card plays its own pinned render in the trailer entry's player */}
|
|
135
|
+
{isTrailerCard(r) ? <TrailerCardBody ver={{ rv, card, cell: c, live, claim }} item={r} /> : r.views.length > 0 ? <VersionViews ver={{ rv, card, cell: c, live, claim }} /> : null}
|
|
134
136
|
</>
|
|
135
137
|
)
|
|
136
138
|
})
|
|
@@ -157,7 +159,8 @@ const VerdictBody = observer(({ card, c }: { card: ThreadSt; c: VerdictCell }) =
|
|
|
157
159
|
{c.pick !== undefined ? (
|
|
158
160
|
<button className="rv-noteline re-approved" onClick={() => card.reveal(c.on, c.pick)}>✓ picked {v ? `${viewTag(v.n, c.pick)} ` : ''}{viewName(views[c.pick], c.pick)}</button>
|
|
159
161
|
) : null}
|
|
160
|
-
{c.
|
|
162
|
+
{v && isTrailerCard(v.item) ? <TrailerVerdictRows card={card} c={c} item={v.item} /> : null}
|
|
163
|
+
{v && isTrailerCard(v.item) ? null : c.rects.map((r, k) => (
|
|
161
164
|
<button key={`r${k}`} className="rv-noteline rect" onClick={() => card.reveal(c.on, r.view ?? 0)}>
|
|
162
165
|
<span className="rv-notemark">⬚ {k + 1}</span>
|
|
163
166
|
<span className="rv-noteplace">{rectPlace(card, c.on, r)}</span>
|
|
@@ -180,6 +183,27 @@ const VerdictBody = observer(({ card, c }: { card: ThreadSt; c: VerdictCell }) =
|
|
|
180
183
|
)
|
|
181
184
|
})
|
|
182
185
|
|
|
186
|
+
/** a trailer card's verdict: its notes as the rail lists them, in the order of the cut; a click opens the player there */
|
|
187
|
+
const TrailerVerdictRows = observer(({ card, c, item }: { card: ThreadSt; c: VerdictCell; item: Item & { trailer: TrailerCard } }) => (
|
|
188
|
+
<div className="tr-verdictrows">
|
|
189
|
+
{card
|
|
190
|
+
.trailerNotes(c.on)
|
|
191
|
+
.filter((n) => n.key.startsWith(`s:${c.id}:`))
|
|
192
|
+
.map((n) => (
|
|
193
|
+
<button key={n.key} className="tr-row tr-verdictrow" onClick={() => {
|
|
194
|
+
card.selectNote(c.on, n)
|
|
195
|
+
card.reveal(c.on, 0)
|
|
196
|
+
}}>
|
|
197
|
+
<NoteStill card={card} item={item} n={n} />
|
|
198
|
+
<div className="tr-rowbody">
|
|
199
|
+
<NoteMeta item={item} n={n} />
|
|
200
|
+
<div className="tr-rowtext">{n.rect.comment || <span className="tr-dim">(no words)</span>}</div>
|
|
201
|
+
</div>
|
|
202
|
+
</button>
|
|
203
|
+
))}
|
|
204
|
+
</div>
|
|
205
|
+
))
|
|
206
|
+
|
|
183
207
|
/** words of either party, and an image he pasted */
|
|
184
208
|
const ReplyBody = ({ rv, c }: { rv: ReviewSt; c: ReplyCell }) => (
|
|
185
209
|
<>
|