rvlib-shipkit 2.19.0 → 2.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -0
- package/package.json +1 -1
- package/src/annex/annex.ts +227 -0
- package/src/annex/offload.ts +279 -0
- package/src/checks/SK004-gitignore-policy.check.ts +6 -3
- 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_Commands.ts +4 -1
- package/src/cli/cmd_GlobalProcesses.ts +2 -107
- package/src/cli/cmd_Home.ts +4 -3
- package/src/cli/cmd_Messages.ts +155 -0
- package/src/cli/cmd_Overview.ts +2 -1
- package/src/cli/cmd_Releases.ts +84 -0
- package/src/cli/cmd_Review.ts +176 -12
- package/src/cli/cmd_Shot.ts +4 -4
- package/src/cli/cmd_Social.ts +151 -8
- package/src/cli/cmd_Sound.ts +17 -4
- package/src/cli/cmd_Trailer.ts +67 -1
- 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 +7 -1
- package/src/collections/collection-types.ts +8 -1
- package/src/collections/providers.ts +4 -1
- package/src/collections/review.ts +23 -4
- 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 +11 -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 +337 -5
- package/src/home/gui-app.ts +64 -33
- package/src/home/hmr-keep.ts +134 -0
- package/src/home/home-start.ts +2 -2
- package/src/home/lib-watch.ts +21 -11
- package/src/home/pm-switch.ts +112 -0
- 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-web.ts +7 -4
- package/src/home/serve-web.ts +64 -14
- package/src/identities/collection.ts +49 -0
- package/src/identities/identities.ts +121 -14
- 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 +182 -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 +94 -0
- package/src/releases/before.ts +31 -0
- package/src/releases/collection.ts +36 -0
- package/src/releases/from-card.ts +151 -0
- package/src/releases/model.ts +327 -0
- package/src/releases/pictures.ts +110 -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 +1 -1
- package/src/review/model.ts +102 -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 +47 -1
- package/src/review/trailer-card.ts +99 -0
- package/src/review/trailer-desk.ts +76 -4
- package/src/review/trailer-model.ts +106 -7
- package/src/review/trailer-notes.ts +45 -0
- package/src/review/trailer-routes.ts +119 -13
- package/src/review/trailer-voices.ts +144 -0
- package/src/review/watchers.ts +58 -1
- package/src/serve/hub-app/app-bridge.ts +71 -0
- package/src/serve/hub-app/benign-errors.ts +22 -0
- 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 +59 -8
- package/src/serve/hub-app/home-st.ts +19 -2
- package/src/serve/hub-app/home.html +3 -0
- package/src/serve/hub-app/hub-app.tsx +8 -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/project-list.css +7 -2
- package/src/serve/hub-app/project-list.tsx +9 -0
- package/src/serve/hub-app/projects-svc.ts +16 -6
- package/src/serve/hub-app/releases/releases-page.tsx +187 -0
- package/src/serve/hub-app/releases/releases-st.ts +111 -0
- package/src/serve/hub-app/releases.css +52 -0
- package/src/serve/hub-app/repo-sections.ts +16 -2
- package/src/serve/hub-app/repo-st.ts +66 -10
- package/src/serve/hub-app/review/clip-st.ts +34 -4
- package/src/serve/hub-app/review/kit.tsx +3 -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 +92 -36
- package/src/serve/hub-app/review/trailer-st.ts +306 -34
- package/src/serve/hub-app/review/trailer-timeline.tsx +68 -23
- package/src/serve/hub-app/review/trailer-voices-st.ts +370 -0
- package/src/serve/hub-app/review/trailer-voices.tsx +574 -0
- package/src/serve/hub-app/review.css +137 -6
- package/src/serve/hub-app/social/comms-page.tsx +65 -28
- package/src/serve/hub-app/social/identity-pictures.ts +46 -8
- package/src/serve/hub-app/social/kit.tsx +9 -6
- package/src/serve/hub-app/social/next-release.tsx +118 -0
- package/src/serve/hub-app/social/post-card.tsx +10 -2
- package/src/serve/hub-app/social/social-model.ts +39 -3
- package/src/serve/hub-app/social/social-page.tsx +179 -65
- package/src/serve/hub-app/social/social-st.ts +117 -27
- 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 -1
- package/src/serve/hub-app/tree-build.ts +40 -1
- package/src/serve/hub-app/tree-svc.ts +10 -3
- package/src/serve/project-gutter-route.ts +12 -2
- package/src/serve/project-gutter.ts +4 -2
- package/src/serve/same-origin.ts +24 -1
- package/src/serve/serve-hub.ts +15 -1
- package/src/shipkit-files.ts +9 -7
- package/src/shot/box.ts +33 -12
- package/src/shot/client.ts +1 -1
- package/src/shot/shooter.ts +22 -12
- package/src/shot/shot-ask.ts +14 -3
- package/src/shot/shot.shipkit.ts +1 -1
- package/src/social/desk-index.ts +49 -8
- package/src/social/discord-layout.ts +54 -7
- package/src/social/drafts.ts +1 -1
- 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 +93 -0
- package/src/social/load.ts +125 -10
- 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/index.ts +47 -6
- package/src/social/reach.ts +49 -0
- package/src/social/release-stage.ts +277 -0
- package/src/social/routes.ts +44 -8
- package/src/social/stage.ts +246 -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/trailer/bed.ts +111 -0
- package/src/trailer/build.ts +72 -40
- package/src/trailer/ffmpeg.ts +6 -0
- package/src/trailer/grammar.ts +37 -6
- package/src/trailer/graph.ts +12 -1
- package/src/trailer/public-words.ts +41 -0
- package/src/trailer/shot-plan.ts +75 -0
- package/src/trailer/shot-state.ts +191 -0
- package/src/trailer/sound/audio.ts +28 -0
- package/src/trailer/sound/brand.ts +53 -3
- package/src/trailer/sound/gen.ts +61 -2
- package/src/trailer/sound/index.ts +25 -11
- package/src/trailer/sound/presets.ts +86 -5
- package/src/trailer/sound/run.ts +1 -1
- package/src/trailer/sound/takes.ts +94 -0
- package/src/trailer/titles.ts +36 -0
- package/src/trailer/url.ts +1 -1
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import { makeAutoObservable, reaction } from 'mobx'
|
|
9
9
|
import { ClockSvc } from './clock-svc.ts'
|
|
10
10
|
import { ColsSvc } from './cols-svc.ts'
|
|
11
|
-
import { canonicalSel, currentHash, hashFor, parseHash, selOf, type CheckOwner, type HashSel } from './hash-route.ts'
|
|
11
|
+
import { canonicalSel, currentHash, hashFor, parseHash, selOf, type CheckOwner, type HashSel, type ReleasesTab } from './hash-route.ts'
|
|
12
12
|
import { ComfySvc } from './comfy-svc.ts'
|
|
13
13
|
import { HealthSvc } from './health-svc.ts'
|
|
14
14
|
import { ReadmeSvc } from './readme-svc.ts'
|
|
@@ -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,13 +353,20 @@ 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)
|
|
341
365
|
}
|
|
366
|
+
if (r.type === 'voice') {
|
|
367
|
+
const [trailer = null, key = ''] = r.id.replace(/^voice:/, '').split('/')
|
|
368
|
+
return this.showTrailer(trailer, null, null, null, key)
|
|
369
|
+
}
|
|
342
370
|
const assetId = r.id.replace(/^media:/, '')
|
|
343
371
|
if (r.collection === 'media' && this.media.assets.some((a) => a.id === assetId)) {
|
|
344
372
|
this.selectAsset(assetId)
|
|
@@ -379,6 +407,15 @@ export class RepoSt {
|
|
|
379
407
|
showGit(): void {
|
|
380
408
|
this.setSel({ t: 'git' })
|
|
381
409
|
}
|
|
410
|
+
/** the commands page on a command, null for none open, and one of its runs */
|
|
411
|
+
showCommands(cmd: string | null, run: string | null = null): void {
|
|
412
|
+
this.commands.select(cmd, run)
|
|
413
|
+
// the tree is the list: the command opened shows where it sits
|
|
414
|
+
this.tree.reveal(sectionKey('commands'))
|
|
415
|
+
// its family's branch, when it has one: the rows may not be read yet, and a key no branch has unfolds nothing
|
|
416
|
+
if (cmd != null) this.tree.reveal(`cmdfam:${cmd.split(' ')[0]}`)
|
|
417
|
+
this.setSel({ t: 'commands', cmd, ...(run ? { run } : {}) })
|
|
418
|
+
}
|
|
382
419
|
/** the processes page, `id` the card to scroll to and light */
|
|
383
420
|
showProcesses(id: string | null): void {
|
|
384
421
|
this.setSel({ t: 'processes', id })
|
|
@@ -399,9 +436,9 @@ export class RepoSt {
|
|
|
399
436
|
return (this.sel?.t === 'review' && this.review.key(e)) || (this.sel?.t === 'trailer' && this.trailer.key(e)) || (this.sel?.t === 'stores' && this.stores.key(e)) || (this.sel?.t === 'veille' && this.veille.key(e)) || (this.sel?.t === 'comms' && this.social.key(e, 'comms')) || (this.sel?.t === 'social' && this.social.key(e, 'social'))
|
|
400
437
|
}
|
|
401
438
|
/** the trailer page on a trailer folder and one of its cuts, null for the first */
|
|
402
|
-
showTrailer(trailer: string | null, cut: string | null, note: string | null = null, filter: 'open' | 'all' | null = null): void {
|
|
403
|
-
this.trailer.select(trailer, cut, note, filter)
|
|
404
|
-
this.setSel({ t: 'trailer', trailer, cut, note, filter })
|
|
439
|
+
showTrailer(trailer: string | null, cut: string | null, note: string | null = null, filter: 'open' | 'all' | null = null, voices?: string): void {
|
|
440
|
+
this.trailer.select(trailer, cut, note, filter, voices)
|
|
441
|
+
this.setSel({ t: 'trailer', trailer, cut, note, filter, ...(voices !== undefined ? { voices } : {}) })
|
|
405
442
|
if (this.polling) this.trailer.start()
|
|
406
443
|
}
|
|
407
444
|
/** the stores page on a store, null for the first; `asset` a thing of it to scroll to, its note box open */
|
|
@@ -410,6 +447,22 @@ export class RepoSt {
|
|
|
410
447
|
this.setSel({ t: 'stores', store, ...(asset ? { asset } : {}) })
|
|
411
448
|
}
|
|
412
449
|
|
|
450
|
+
/** the releases page on a version (`next` or X.Y.Z), null for the first, in a view, null for the one shown; its
|
|
451
|
+
* versions are rows under the section */
|
|
452
|
+
showReleases(version: string | null, tab: ReleasesTab | null = null): void {
|
|
453
|
+
this.releases.select(version, tab)
|
|
454
|
+
this.tree.reveal(sectionKey('releases'))
|
|
455
|
+
this.setSel({ t: 'releases', version, ...(this.releases.tab === 'notes' ? { tab: 'notes' as const } : {}) })
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
/** the messages page on a tab, `run` the run it scores by, null for the newest */
|
|
459
|
+
showMessages(tab: MessagesTab, run: string | null = null): void {
|
|
460
|
+
this.messages.select(tab, run)
|
|
461
|
+
// the tabs are rows under the section: the page shown, they are in sight
|
|
462
|
+
this.tree.reveal(sectionKey('messages'))
|
|
463
|
+
this.setSel({ t: 'messages', tab, ...(run ? { run } : {}) })
|
|
464
|
+
}
|
|
465
|
+
|
|
413
466
|
/** the Veille page, `post` the post picked; `q` its window, chips, folds and lightbox, as an address carries them */
|
|
414
467
|
showVeille(post: string | null, q?: string): void {
|
|
415
468
|
if (q !== undefined) this.veille.applyAddress(q)
|
|
@@ -464,11 +517,14 @@ export class RepoSt {
|
|
|
464
517
|
case 'processes': return this.showProcesses(sel.id)
|
|
465
518
|
case 'plan': return this.showPlan()
|
|
466
519
|
case 'git': return this.showGit()
|
|
520
|
+
case 'commands': return this.showCommands(sel.cmd, sel.run ?? null)
|
|
467
521
|
case 'when': return this.showWhen()
|
|
468
522
|
case 'checks': return this.showChecks(sel.from)
|
|
469
523
|
case 'review': return this.showReview(sel.id, sel.q ?? '')
|
|
470
|
-
case 'trailer': return this.showTrailer(sel.trailer, sel.cut, sel.note ?? null, sel.filter ?? null)
|
|
524
|
+
case 'trailer': return this.showTrailer(sel.trailer, sel.cut, sel.note ?? null, sel.filter ?? null, sel.voices)
|
|
471
525
|
case 'stores': return this.showStores(sel.store, sel.asset ?? null)
|
|
526
|
+
case 'releases': return this.showReleases(sel.version, sel.tab ?? null)
|
|
527
|
+
case 'messages': return this.showMessages(sel.tab, sel.run ?? null)
|
|
472
528
|
case 'veille': return this.showVeille(sel.post, sel.q ?? '')
|
|
473
529
|
case 'comms': return this.showComms(sel.draft, sel.part ?? null, sel.q ?? '')
|
|
474
530
|
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 {
|
|
@@ -143,12 +171,14 @@ export class ClipSt {
|
|
|
143
171
|
|
|
144
172
|
/** a video of the view on screen; it returns its release */
|
|
145
173
|
attach(el: ClipEl): () => void {
|
|
174
|
+
// a video playing already leads; alone, the clock's time (a source swapped mid play starts its element at 0)
|
|
175
|
+
const lead = this.els[0]
|
|
146
176
|
this.els.push(el)
|
|
147
177
|
owners.set(el, this)
|
|
148
178
|
el.muted = !this.sound || this.els[0] !== el
|
|
149
179
|
el.volume = heard.level
|
|
150
180
|
el.playbackRate = this.rate
|
|
151
|
-
el.currentTime = this.paused ? this.time :
|
|
181
|
+
el.currentTime = this.paused || !lead ? this.time : lead.currentTime
|
|
152
182
|
if (this.paused) el.pause()
|
|
153
183
|
else this.start(el)
|
|
154
184
|
if (this.raf === 0 && typeof requestAnimationFrame === 'function') this.raf = requestAnimationFrame(this.follow)
|
|
@@ -205,7 +235,7 @@ export class ClipSt {
|
|
|
205
235
|
this.time = this.centerOf(this.frameOf(t))
|
|
206
236
|
for (const el of this.els) {
|
|
207
237
|
el.pause()
|
|
208
|
-
el
|
|
238
|
+
this.place(el, this.time)
|
|
209
239
|
}
|
|
210
240
|
}
|
|
211
241
|
|
|
@@ -214,7 +244,7 @@ export class ClipSt {
|
|
|
214
244
|
if (this.paused) return this.seek(t)
|
|
215
245
|
const to = Math.max(0, Math.min(this.duration, t))
|
|
216
246
|
this.time = to
|
|
217
|
-
for (const el of this.els) el
|
|
247
|
+
for (const el of this.els) this.place(el, to)
|
|
218
248
|
}
|
|
219
249
|
|
|
220
250
|
setRate(r: number): void {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { observer } from 'mobx-react-lite'
|
|
4
4
|
import { useEffect, useState } from 'react'
|
|
5
5
|
import type { ThreadRow } from '../../../review/cells.ts'
|
|
6
|
-
import type
|
|
6
|
+
import { listenWords, type ReviewStatus, type ShownStatus, type Side } from '../../../review/model.ts'
|
|
7
7
|
import type { ReviewSt } from './review-st.ts'
|
|
8
8
|
|
|
9
9
|
/** a status's tone, as a class review.css colours: its tint, its line, its badge */
|
|
@@ -84,7 +84,7 @@ export const Rework = ({ r }: { r: ThreadRow['rework'] }) => {
|
|
|
84
84
|
)
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
/** who listens: the
|
|
87
|
+
/** who listens, in words: the live `sk review watch` processes that read his answer on these cards; their pids only in the tooltip */
|
|
88
88
|
export const Listeners = observer(({ rv, heads }: { rv: ReviewSt; heads: readonly { lane?: string | undefined; session?: string | undefined }[] }) => {
|
|
89
89
|
const ws = rv.listenersOf(heads)
|
|
90
90
|
const on = ws.length > 0
|
|
@@ -97,7 +97,7 @@ export const Listeners = observer(({ rv, heads }: { rv: ReviewSt; heads: readonl
|
|
|
97
97
|
: 'no sk review watch reads these cards: your answer will wait'
|
|
98
98
|
}
|
|
99
99
|
>
|
|
100
|
-
◉ {
|
|
100
|
+
◉ {listenWords(ws)}
|
|
101
101
|
</span>
|
|
102
102
|
)
|
|
103
103
|
})
|
|
@@ -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
|
<>
|
|
@@ -10,6 +10,8 @@ import type { Role } from '../../../review/role.ts'
|
|
|
10
10
|
import type { RepoSt } from '../repo-st.ts'
|
|
11
11
|
import { copyText, etagLoader, GALLERY_FITS, GALLERY_MODES, kept, postJson, TILE_H, ZOOMS, type EtagLoader, type GalleryFit, type GalleryMode, type Zoom } from './review-kit.ts'
|
|
12
12
|
import { ThreadSt, type Draft } from './thread-st.ts'
|
|
13
|
+
import { cardSource, StageSt, type StageFill } from '../social/stage-st.ts'
|
|
14
|
+
import { isPostRating } from '../../../identities/rating.ts'
|
|
13
15
|
|
|
14
16
|
/** a live `sk review watch`: its process, the session or lane it keeps, when it started */
|
|
15
17
|
export interface Watcher {
|
|
@@ -50,22 +52,31 @@ const draftOf = (s: string | null): Draft | null => {
|
|
|
50
52
|
}
|
|
51
53
|
}
|
|
52
54
|
|
|
53
|
-
/** the pair's compare mode, the curtain's line and the onion's opacity, shared by every pair of the page
|
|
55
|
+
/** the pair's compare mode, the curtain's line and the onion's opacity, shared by every pair of the page. Only a
|
|
56
|
+
* normal mode is kept: the changes stay on the card he turned them on (a slip of D read as every pair broken) */
|
|
54
57
|
export class CompareSt {
|
|
55
58
|
mode: CompareMode = 'side'
|
|
59
|
+
/** the normal mode he picked last: kept in the browser, and the one another card opens in */
|
|
60
|
+
saved: Exclude<CompareMode, 'diff'> = 'side'
|
|
56
61
|
split = 0.5
|
|
57
62
|
opacity = 0.5
|
|
58
63
|
constructor(private readonly key: string) {
|
|
59
64
|
const m = kept.get(key)
|
|
60
|
-
if (m && (COMPARE_MODES as readonly string[]).includes(m)) this.mode = m as CompareMode
|
|
65
|
+
if (m && m !== 'diff' && (COMPARE_MODES as readonly string[]).includes(m)) this.mode = this.saved = m as Exclude<CompareMode, 'diff'>
|
|
61
66
|
makeAutoObservable<this, 'key'>(this, { key: false })
|
|
62
67
|
}
|
|
68
|
+
/** another card opens: the changes drop back to the kept mode, every other mode carries over */
|
|
69
|
+
leaveCard(): void {
|
|
70
|
+
if (this.mode === 'diff') this.mode = this.saved
|
|
71
|
+
}
|
|
63
72
|
/** the mode a pair draws in: the changes read pixels from two images, so a pair of clips shows side by side */
|
|
64
73
|
modeFor(clip: boolean): CompareMode {
|
|
65
74
|
return clip && this.mode === 'diff' ? 'side' : this.mode
|
|
66
75
|
}
|
|
67
76
|
setMode(m: CompareMode): void {
|
|
68
77
|
this.mode = m
|
|
78
|
+
if (m === 'diff') return
|
|
79
|
+
this.saved = m
|
|
69
80
|
kept.put(this.key, m)
|
|
70
81
|
}
|
|
71
82
|
/** the next mode (D), or the one before (⇧D), round the list */
|
|
@@ -124,6 +135,8 @@ export class ReviewSt {
|
|
|
124
135
|
pinned: string | null = null
|
|
125
136
|
/** the open card as a thread: made when a card opens */
|
|
126
137
|
card: ThreadSt | null = null
|
|
138
|
+
/** the stage popup over the card: one of its media staged as a post */
|
|
139
|
+
stage: StageSt | null = null
|
|
127
140
|
/** what the search box holds; `q` is what the server was asked, once he stopped typing */
|
|
128
141
|
query = ''
|
|
129
142
|
q = ''
|
|
@@ -206,6 +219,7 @@ export class ReviewSt {
|
|
|
206
219
|
compare: false,
|
|
207
220
|
phone: false,
|
|
208
221
|
card: observableRef,
|
|
222
|
+
stage: observableRef,
|
|
209
223
|
page: observableRef,
|
|
210
224
|
boardRows: observableRef,
|
|
211
225
|
})
|
|
@@ -230,6 +244,11 @@ export class ReviewSt {
|
|
|
230
244
|
}
|
|
231
245
|
|
|
232
246
|
/** an absolute hub path as this repo's hub answers it */
|
|
247
|
+
/** the repo this page is of: a trailer card's player reads its trailers through it */
|
|
248
|
+
get repo(): RepoSt {
|
|
249
|
+
return this.st
|
|
250
|
+
}
|
|
251
|
+
|
|
233
252
|
url(p: string): string {
|
|
234
253
|
return this.st.url(p)
|
|
235
254
|
}
|
|
@@ -424,6 +443,7 @@ export class ReviewSt {
|
|
|
424
443
|
if (this.status !== null) q.set('status', this.status)
|
|
425
444
|
if (!this.hideHandled) q.set('handled', '1')
|
|
426
445
|
if (this.byLane) q.set('lanes', '1')
|
|
446
|
+
if (this.stage !== null) q.set('stage', this.stage.pick || '1')
|
|
427
447
|
return q.toString()
|
|
428
448
|
}
|
|
429
449
|
|
|
@@ -443,13 +463,42 @@ export class ReviewSt {
|
|
|
443
463
|
if (status !== null && isShownStatus(status)) this.status = status
|
|
444
464
|
if (q.get('handled') === '1') this.hideHandled = false
|
|
445
465
|
if (q.get('lanes') === '1') this.byLane = true
|
|
466
|
+
// `stage=<pick>` (or `stage=1`, its first media): the stage popup open, a link or a shot of it
|
|
467
|
+
// with it, `rating=`, `text=`, `kind=` and `kindWhy=` prefill the popup: a link an agent hands him with its
|
|
468
|
+
// suggested line and kind
|
|
469
|
+
const stage = q.get('stage')
|
|
470
|
+
if (stage !== null && this.stage?.pick !== stage) {
|
|
471
|
+
const rating = q.get('rating')
|
|
472
|
+
const kind = q.get('kind')
|
|
473
|
+
const kindWhy = q.get('kindWhy')
|
|
474
|
+
this.pendingStage = {
|
|
475
|
+
want: stage === '1' ? '' : stage,
|
|
476
|
+
text: q.get('text') ?? '',
|
|
477
|
+
rating: rating !== null && isPostRating(rating) ? rating : null,
|
|
478
|
+
...(kind ? { kind } : {}),
|
|
479
|
+
...(kindWhy ? { kindWhy } : {}),
|
|
480
|
+
}
|
|
481
|
+
if (this.card !== null || this.selectedId !== null) this.openPendingStage()
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
/** the popup an address asked for, opened once a card is there */
|
|
486
|
+
private pendingStage: (StageFill & { want: string }) | null = null
|
|
487
|
+
|
|
488
|
+
private openPendingStage(): void {
|
|
489
|
+
const p = this.pendingStage
|
|
490
|
+
if (p === null) return
|
|
491
|
+
this.pendingStage = null
|
|
492
|
+
this.openStage(p.want, p)
|
|
446
493
|
}
|
|
447
494
|
|
|
448
495
|
/** the card the address names */
|
|
449
496
|
select(id: string | null): void {
|
|
450
497
|
// a link to a card on the phone opens the card, never the list
|
|
451
498
|
if (id !== null && id !== this.selectedId && this.phone.on) this.phone.show('card')
|
|
499
|
+
if (id !== this.selectedId) this.compare.leaveCard()
|
|
452
500
|
this.selectedId = id
|
|
501
|
+
if (id !== null) this.openPendingStage()
|
|
453
502
|
}
|
|
454
503
|
|
|
455
504
|
/** opens a card from the page: its address follows */
|
|
@@ -606,6 +655,29 @@ export class ReviewSt {
|
|
|
606
655
|
await this.copied(text, `copied for an agent: title, repo, sk review show, ${w?.phone ? 'links' : 'link'}`)
|
|
607
656
|
}
|
|
608
657
|
|
|
658
|
+
/** « 📤 »: the stage popup over the open card, on the media `want` names (a pick, or `<item>#<view>`; empty, the
|
|
659
|
+
* newest version's first) */
|
|
660
|
+
openStage(want = '', fill?: StageFill): void {
|
|
661
|
+
const card = this.card?.data?.head ?? this.card?.id ?? this.selectedId
|
|
662
|
+
if (card == null) return
|
|
663
|
+
this.stage?.dispose()
|
|
664
|
+
this.stage = new StageSt(
|
|
665
|
+
cardSource((p) => this.url(p), card),
|
|
666
|
+
want,
|
|
667
|
+
(slug) => {
|
|
668
|
+
this.closeStage()
|
|
669
|
+
this.say(`staged: ${slug}, waiting in Communications`)
|
|
670
|
+
void this.answered()
|
|
671
|
+
},
|
|
672
|
+
fill,
|
|
673
|
+
)
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
closeStage(): void {
|
|
677
|
+
this.stage?.dispose()
|
|
678
|
+
this.stage = null
|
|
679
|
+
}
|
|
680
|
+
|
|
609
681
|
/** a draft this card was turned into, opened in Communications: the hub's own, or the host's in a frame */
|
|
610
682
|
openDraft(slug: string): void {
|
|
611
683
|
if (this.st.home.embedded && window.parent !== window) window.parent.postMessage({ shipkit: 'show', page: 'comms', hash: `#page:comms:${slug}` }, location.origin)
|
|
@@ -633,6 +705,8 @@ export class ReviewSt {
|
|
|
633
705
|
* compare mode of every pair (⇧D the one before), ↑ ↓ the list (W the card wide is the hub's, kept-cols.tsx); the card takes
|
|
634
706
|
* the rest (ThreadSt.key). A digit is read from its physical key (`code`), so ⇧ and an AZERTY keyboard read the same */
|
|
635
707
|
key(e: Pick<KeyboardEvent, 'key' | 'shiftKey'> & { code?: string }): boolean {
|
|
708
|
+
// the stage popup takes its own keys
|
|
709
|
+
if (this.stage !== null) return false
|
|
636
710
|
const card = this.card
|
|
637
711
|
if (card?.key(e)) return true
|
|
638
712
|
const k = e.key.toLowerCase()
|
|
@@ -646,6 +720,7 @@ export class ReviewSt {
|
|
|
646
720
|
else if (k === 'm') this.toggleMarks()
|
|
647
721
|
else if (k === 't') this.toggleRail()
|
|
648
722
|
else if (k === 'd') this.compare.cycle(e.shiftKey ? -1 : 1)
|
|
723
|
+
else if (k === 's' && card?.data) this.openStage(`${card.data.head}#${card.view}`)
|
|
649
724
|
else return false
|
|
650
725
|
return true
|
|
651
726
|
}
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
// them: one word, sent with a verdict or as a reply. The column opens scrolled to the newest cell
|
|
5
5
|
import { observer } from 'mobx-react-lite'
|
|
6
6
|
import { useEffect, useRef } from 'react'
|
|
7
|
-
import {
|
|
7
|
+
import { MOVE_LABEL, STATUS_LABEL, subjectLabel, viewName, viewTag } from '../../../review/model.ts'
|
|
8
8
|
import { AutoText } from '../auto-text.tsx'
|
|
9
|
+
import { StagePopup } from '../social/stage-popup.tsx'
|
|
9
10
|
import { Icon, ICON } from '../icons.tsx'
|
|
10
11
|
import { AutoTag, Empty, keepFocus, LaneTag, Listeners, Rework, toneOf, VERDICTS } from './kit.tsx'
|
|
11
12
|
import { CellFrame, EventsLine } from './review-cells.tsx'
|
|
@@ -49,49 +50,27 @@ export const ThreadColumn = observer(({ rv, back }: { rv: ReviewSt; back?: (() =
|
|
|
49
50
|
) : null}
|
|
50
51
|
</div>
|
|
51
52
|
<Composer rv={rv} card={card} />
|
|
53
|
+
{rv.stage ? <StagePopup st={rv.stage} url={(p) => rv.url(p)} close={() => rv.closeStage()} /> : null}
|
|
52
54
|
</>
|
|
53
55
|
)}
|
|
54
56
|
</div>
|
|
55
57
|
)
|
|
56
58
|
})
|
|
57
59
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
/** « 📣 post »: this card deserves its own public post; each post already asked, where it stands, a click away */
|
|
61
|
-
const PostAsk = observer(({ rv, card }: { rv: ReviewSt; card: ThreadSt }) => {
|
|
60
|
+
/** « 📤 stage »: a media of the card staged as a post in one popup; each draft already staged from it, a click away */
|
|
61
|
+
const StageBar = observer(({ rv, card }: { rv: ReviewSt; card: ThreadSt }) => {
|
|
62
62
|
const v = card.data
|
|
63
|
-
if (!v ||
|
|
63
|
+
if (!v || v.origin.by !== 'agent') return null
|
|
64
64
|
return (
|
|
65
65
|
<>
|
|
66
66
|
{v.drafts.map((d) => (
|
|
67
|
-
<button key={d.slug} className="ghost rv-chip" title={`the draft
|
|
68
|
-
))}
|
|
69
|
-
{v.posts.map((p) => (
|
|
70
|
-
<button key={p.id} className="ghost rv-chip" title={`the post asked from this card: ${p.id}`} onMouseDown={keepFocus} onClick={() => rv.pick(p.id)}>📣 {POST_STATE(p.state)}</button>
|
|
67
|
+
<button key={d.slug} className="ghost rv-chip" title={`the draft staged from this card: ${d.slug}, in comms`} onMouseDown={keepFocus} onClick={() => rv.openDraft(d.slug)}>📝 {d.title}</button>
|
|
71
68
|
))}
|
|
72
|
-
<button className={
|
|
69
|
+
<button className={rv.stage !== null ? 'on' : ''} title="stage a media of this card as a post (S): a draft in comms, never posted" onMouseDown={keepFocus} onClick={() => rv.openStage()}>📤 stage</button>
|
|
73
70
|
</>
|
|
74
71
|
)
|
|
75
72
|
})
|
|
76
73
|
|
|
77
|
-
/** his word on the post he asks: the angle, the account; Enter asks, an empty word too */
|
|
78
|
-
const PostBox = observer(({ card }: { card: ThreadSt }) => {
|
|
79
|
-
if (card.postBox === null) return null
|
|
80
|
-
return (
|
|
81
|
-
<div className="rv-postbox">
|
|
82
|
-
<AutoText autoFocus placeholder="its own post: the angle, the account (optional). Enter asks, Escape closes" value={card.postBox}
|
|
83
|
-
onText={(t) => card.setPost(t)}
|
|
84
|
-
onKeyDown={(e) => {
|
|
85
|
-
if (e.key === 'Enter' && !e.shiftKey) {
|
|
86
|
-
e.preventDefault()
|
|
87
|
-
void card.askPost()
|
|
88
|
-
} else if (e.key === 'Escape') card.closePost()
|
|
89
|
-
}} />
|
|
90
|
-
<button disabled={card.busy} onClick={() => void card.askPost()}>ask</button>
|
|
91
|
-
</div>
|
|
92
|
-
)
|
|
93
|
-
})
|
|
94
|
-
|
|
95
74
|
/** the card's bar: its title, where it stands, its lane, who listens, the copy for an agent, fold or unfold all; on the
|
|
96
75
|
* phone the contents and a way back to the cards */
|
|
97
76
|
const TopBar = observer(({ rv, card, back }: { rv: ReviewSt; card: ThreadSt; back?: (() => void) | null }) => {
|
|
@@ -107,7 +86,6 @@ const TopBar = observer(({ rv, card, back }: { rv: ReviewSt; card: ThreadSt; bac
|
|
|
107
86
|
<Icon d={ICON.copy} />
|
|
108
87
|
</button>
|
|
109
88
|
</div>
|
|
110
|
-
<PostBox card={card} />
|
|
111
89
|
{rv.phone.on && v ? <Minimap rv={rv} card={card} dir="row" /> : null}
|
|
112
90
|
{v ? (
|
|
113
91
|
<div className="rv-meta">
|
|
@@ -125,7 +103,7 @@ const TopBar = observer(({ rv, card, back }: { rv: ReviewSt; card: ThreadSt; bac
|
|
|
125
103
|
) : null}
|
|
126
104
|
<Rework r={v.rework} />
|
|
127
105
|
<span className="sp" />
|
|
128
|
-
<
|
|
106
|
+
<StageBar rv={rv} card={card} />
|
|
129
107
|
<button className={`rv-iconbtn${rv.wide ? ' on' : ''}`} aria-pressed={rv.wide} title={rv.wide ? 'back to the sidebar and the cards (W)' : 'wide: fold the sidebar and the cards, the card takes the page (W)'} aria-label="wide" onMouseDown={keepFocus} onClick={() => rv.toggleWide()}><Icon d={ICON.wide} /></button>
|
|
130
108
|
<span className="seg">
|
|
131
109
|
<button className="rv-iconbtn" title="fold every cell" aria-label="fold every cell" onMouseDown={keepFocus} onClick={() => card.foldAll(false)}><Icon d={ICON.foldAll} /></button>
|