rvlib-shipkit 2.27.0 → 2.28.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 +16 -0
- package/package.json +1 -1
- package/src/agent-time/hooks.ts +10 -3
- package/src/agent-time/live.ts +11 -5
- package/src/agent-time/registry.ts +289 -0
- package/src/agent-time/store.ts +2 -2
- package/src/annex/born.ts +2 -2
- package/src/annex/offload.ts +12 -11
- package/src/asks/ask-after.ts +6 -2
- package/src/asks/ask-bar-fold.ts +57 -0
- package/src/asks/ask-migrate.ts +280 -0
- package/src/asks/ask-steps-fold.ts +166 -0
- package/src/asks/ask-store.ts +586 -0
- package/src/assets/kits/identity-kit.ts +106 -38
- package/src/assets/kits/poster-thumbnail.ts +282 -0
- package/src/checks/SK003-claude-md-shape.check.ts +92 -25
- package/src/checks/SK004-gitignore-policy.check.ts +8 -4
- package/src/checks/SK013-one-way-in-policy.check.ts +10 -0
- package/src/checks/SK026-asks-autoclose.check.ts +9 -23
- package/src/checks/SK038-speaks-as.check.ts +3 -3
- package/src/checks/SK042-post-kinds.check.ts +26 -24
- package/src/checks/SK049-thread-answers-hook.check.ts +81 -0
- package/src/checks/SK050-retired-commands.check.ts +127 -0
- package/src/cli/cmd_Asks.ts +204 -53
- package/src/cli/cmd_Backup.ts +151 -8
- package/src/cli/cmd_Calls.ts +1 -0
- package/src/cli/cmd_Commands.ts +140 -34
- package/src/cli/cmd_Contracts.ts +1 -0
- package/src/cli/cmd_Keys.ts +1 -0
- package/src/cli/cmd_Lanes.ts +15 -4
- package/src/cli/cmd_Messages.ts +152 -1
- package/src/cli/cmd_Needs.ts +1 -0
- package/src/cli/cmd_Review.ts +931 -229
- package/src/cli/cmd_Secret.ts +255 -34
- package/src/cli/cmd_Social.ts +36 -33
- package/src/cli/cmd_SocialDrafts.ts +235 -0
- package/src/cli/cmd_Sound.ts +22 -1
- package/src/cli/cmd_Start.ts +3 -2
- package/src/cli/cmd_ThreadHolds.ts +34 -0
- package/src/cli/cmd_ThreadKinds.ts +146 -0
- package/src/cli/cmd_ThreadReflect.ts +83 -0
- package/src/cli/cmd_ThreadSyncNeeds.ts +62 -0
- package/src/cli/cmd_Vault.ts +1 -1
- package/src/cli/cmd_When.ts +1 -0
- package/src/cli/family-help.ts +2 -2
- package/src/cli/family-pages.ts +1 -1
- package/src/cli/kit/builtins.ts +1 -0
- package/src/cli/kit/verb.ts +6 -2
- package/src/cli/registry.ts +21 -2
- package/src/cli.ts +5 -2
- package/src/collections/actions.ts +25 -74
- package/src/collections/collection-types.ts +9 -5
- package/src/collections/md-body.ts +5 -3
- package/src/collections/pings.ts +13 -6
- package/src/collections/providers.ts +53 -61
- package/src/collections/reflections.ts +9 -4
- package/src/core/discover-checks.ts +18 -3
- package/src/core/git.ts +31 -0
- package/src/core/house-layout.ts +17 -0
- package/src/core/layout.ts +10 -5
- package/src/core/locked-write.ts +4 -1
- package/src/core/machine-db.ts +5 -3
- package/src/core/migrate-layout.ts +8 -10
- package/src/home/activity.ts +8 -15
- package/src/home/daemon-jobs.ts +13 -1
- package/src/home/home-paths.ts +6 -3
- package/src/home/home-routes.ts +8 -0
- package/src/home/inbox-shape.ts +233 -100
- package/src/home/inbox.ts +26 -71
- package/src/home/machine-fold.ts +10 -15
- package/src/home/machine-host.ts +19 -1
- package/src/home/other-macs.ts +2 -2
- package/src/home/serve-web.ts +6 -5
- package/src/home/space-page.ts +1 -1
- package/src/home/vault-page.ts +51 -17
- package/src/home/vault-words.ts +2 -2
- package/src/hooks/one-way-in-guard.ts +24 -2
- package/src/hq/files-send.ts +27 -28
- package/src/hq/hq-db.ts +4 -1
- package/src/hq/hq-local.ts +37 -4
- package/src/hq/hq-routes.ts +10 -2
- package/src/hq/hq-store.ts +6 -2
- package/src/hq/kinds/ask.ts +6 -6
- package/src/hq/outbox.ts +5 -3
- package/src/hq/replica.ts +1 -2
- package/src/hq/vault-route.ts +112 -0
- package/src/identities/collection.ts +2 -2
- package/src/identities/identities.ts +9 -8
- package/src/identities/machine-route.ts +8 -3
- package/src/ledger/db.ts +8 -1
- package/src/media-store/backup/daemon.ts +48 -8
- package/src/media-store/backup/keys.ts +1 -1
- package/src/media-store/backup/manifest.ts +20 -2
- package/src/media-store/backup/prune.ts +365 -0
- package/src/media-store/backup/retention.ts +122 -0
- package/src/media-store/backup/run.ts +14 -8
- package/src/media-store/backup/sources.ts +18 -17
- package/src/media-store/backup/thread-copy.ts +340 -0
- package/src/media-store/copy/config.ts +3 -4
- package/src/media-store/copy/store.ts +2 -2
- package/src/media-store/db.ts +2 -2
- package/src/media-store/forget.ts +118 -0
- package/src/media-store/purge.ts +3 -2
- package/src/media-store/space-listing.ts +20 -4
- package/src/media-store/space.ts +6 -5
- package/src/messages/guard.ts +49 -0
- package/src/messages/model.ts +1 -1
- package/src/messages/objects.ts +201 -0
- package/src/messages/routes.ts +2 -2
- package/src/messages/score.ts +1 -1
- package/src/messages/write.ts +285 -0
- package/src/pages/frame-client.ts +181 -4
- package/src/reflections/reflections-queue.ts +1 -1
- package/src/release/gate-checkout.ts +2 -1
- package/src/release/git-facts.ts +3 -2
- package/src/release/public-clean.ts +3 -2
- package/src/repo-config.ts +40 -18
- package/src/review/anim.ts +1 -1
- package/src/review/answer-kinds.ts +131 -0
- package/src/review/band.ts +53 -0
- package/src/review/branch-hold.ts +84 -0
- package/src/review/card-db.ts +16 -6
- package/src/review/card-rows.ts +4 -3
- package/src/review/cells.ts +297 -65
- package/src/review/close.ts +92 -0
- package/src/review/draft-card.ts +8 -16
- package/src/review/draft-model.ts +2 -2
- package/src/review/events.ts +171 -0
- package/src/review/format.ts +128 -14
- package/src/review/glyphs.ts +63 -0
- package/src/review/gone.ts +1 -1
- package/src/review/holds-sync.ts +62 -0
- package/src/review/holds.ts +85 -0
- package/src/review/house-kind-defs.ts +41 -0
- package/src/review/inbox-hook.ts +22 -9
- package/src/review/inbox-read.ts +201 -0
- package/src/review/instructions.ts +199 -0
- package/src/review/kind-apply.ts +61 -0
- package/src/review/kind-catalog.ts +96 -0
- package/src/review/kinds.ts +278 -0
- package/src/review/lane-ask.ts +109 -0
- package/src/review/model.ts +396 -86
- package/src/review/move.ts +3 -3
- package/src/review/need-address.ts +15 -0
- package/src/review/need-threads.ts +93 -0
- package/src/review/object-card.ts +48 -0
- package/src/review/object-read.ts +31 -0
- package/src/review/owner-verdict.ts +36 -0
- package/src/review/parties.ts +182 -0
- package/src/review/previews.ts +3 -1
- package/src/review/projections.ts +235 -0
- package/src/review/referring.ts +54 -0
- package/src/review/reflection-object.ts +195 -0
- package/src/review/routes.ts +137 -32
- package/src/review/secret-route.ts +80 -0
- package/src/review/snooze.ts +38 -0
- package/src/review/stage-card.ts +4 -4
- package/src/review/store.ts +366 -85
- package/src/review/supersede.ts +116 -0
- package/src/review/take-back.ts +52 -0
- package/src/review/thread-fold.ts +20 -7
- package/src/review/threads.ts +236 -39
- package/src/review/traces.ts +218 -0
- package/src/review/trailer-card.ts +2 -2
- package/src/review/unit.ts +71 -5
- package/src/review/verdict-items.ts +73 -0
- package/src/review/verdict-write.ts +15 -0
- package/src/review/wait.ts +85 -0
- package/src/review/watchers.ts +22 -9
- package/src/scaffold/files/claude-settings-local.json +2 -0
- package/src/secrets/archive-mark.ts +52 -0
- package/src/secrets/archive.ts +83 -0
- package/src/secrets/copy.ts +14 -14
- package/src/secrets/keychain-write.ts +48 -0
- package/src/secrets/keychain.ts +8 -5
- package/src/secrets/lapse-mark.ts +33 -0
- package/src/secrets/lapse.ts +60 -0
- package/src/secrets/list.ts +16 -22
- package/src/secrets/manager.ts +31 -16
- package/src/secrets/read.ts +161 -33
- package/src/secrets/tail.ts +31 -0
- package/src/serve/hub-app/asks-page.tsx +2 -1
- package/src/serve/hub-app/auto-text.tsx +14 -6
- package/src/serve/hub-app/benign-errors.ts +15 -1
- package/src/serve/hub-app/card-head.tsx +49 -0
- package/src/serve/hub-app/check-view.tsx +3 -2
- package/src/serve/hub-app/code-copy.ts +35 -0
- package/src/serve/hub-app/col-card.tsx +31 -40
- package/src/serve/hub-app/col-list-page.tsx +5 -2
- package/src/serve/hub-app/col-tables-view.tsx +7 -4
- package/src/serve/hub-app/col-tables.ts +5 -5
- package/src/serve/hub-app/cols-svc.ts +4 -79
- package/src/serve/hub-app/commands/commands-page.tsx +2 -1
- package/src/serve/hub-app/controls.css +83 -0
- package/src/serve/hub-app/frames-st.ts +17 -1
- package/src/serve/hub-app/git-view.tsx +3 -2
- package/src/serve/hub-app/home-st.ts +57 -6
- package/src/serve/hub-app/home-strip.css +1 -6
- package/src/serve/hub-app/home-strip.tsx +2 -1
- package/src/serve/hub-app/home.html +3 -0
- package/src/serve/hub-app/house-wiki-view.tsx +20 -0
- package/src/serve/hub-app/hub-app.tsx +48 -32
- package/src/serve/hub-app/hub-types.ts +2 -0
- package/src/serve/hub-app/hub.css +50 -61
- package/src/serve/hub-app/icons.tsx +14 -4
- package/src/serve/hub-app/identities-view.tsx +4 -3
- package/src/serve/hub-app/inbox-st.ts +203 -42
- package/src/serve/hub-app/inbox-view.tsx +189 -101
- package/src/serve/hub-app/inbox.css +47 -44
- package/src/serve/hub-app/index.html +3 -0
- package/src/serve/hub-app/instructions.css +30 -0
- package/src/serve/hub-app/keys.ts +5 -3
- package/src/serve/hub-app/machine-st.ts +2 -2
- package/src/serve/hub-app/machines-view.tsx +4 -11
- package/src/serve/hub-app/machines.css +0 -9
- package/src/serve/hub-app/markdown.css +51 -0
- package/src/serve/hub-app/md-copy.tsx +18 -40
- package/src/serve/hub-app/md.ts +25 -9
- package/src/serve/hub-app/media-view.tsx +2 -2
- package/src/serve/hub-app/messages/messages-page.tsx +2 -1
- package/src/serve/hub-app/messages/messages-st.ts +1 -1
- package/src/serve/hub-app/messages.css +0 -1
- package/src/serve/hub-app/objects.css +51 -0
- package/src/serve/hub-app/page-keys.ts +1 -1
- package/src/serve/hub-app/pages-frames.tsx +11 -1
- package/src/serve/hub-app/palette-st.ts +4 -4
- package/src/serve/hub-app/pane-boundary.tsx +72 -0
- package/src/serve/hub-app/pane-errors.ts +54 -0
- package/src/serve/hub-app/plan-view.tsx +3 -2
- package/src/serve/hub-app/planned-view.tsx +3 -3
- package/src/serve/hub-app/planned.css +0 -4
- package/src/serve/hub-app/processes-view.tsx +3 -2
- package/src/serve/hub-app/project-list.css +5 -13
- package/src/serve/hub-app/project-list.tsx +3 -6
- package/src/serve/hub-app/projects-svc.ts +6 -2
- package/src/serve/hub-app/readme.css +9 -15
- package/src/serve/hub-app/reflections-page.tsx +54 -1
- package/src/serve/hub-app/releases/releases-page.tsx +3 -2
- package/src/serve/hub-app/releases.css +0 -1
- package/src/serve/hub-app/review/code-colors.ts +30 -0
- package/src/serve/hub-app/review/diff-view.tsx +75 -0
- package/src/serve/hub-app/review/dock.tsx +104 -0
- package/src/serve/hub-app/review/draft-card.tsx +2 -2
- package/src/serve/hub-app/review/group-block.tsx +209 -0
- package/src/serve/hub-app/review/instructions-view.tsx +116 -0
- package/src/serve/hub-app/review/item-verdict.tsx +38 -0
- package/src/serve/hub-app/review/kind-states.tsx +193 -0
- package/src/serve/hub-app/review/kind-view.tsx +1 -37
- package/src/serve/hub-app/review/kit.tsx +57 -54
- package/src/serve/hub-app/review/lane-bar.tsx +64 -0
- package/src/serve/hub-app/review/object-card.tsx +62 -0
- package/src/serve/hub-app/review/object-panel.tsx +179 -0
- package/src/serve/hub-app/review/question-views.tsx +385 -0
- package/src/serve/hub-app/review/review-cells.tsx +86 -105
- package/src/serve/hub-app/review/review-list.tsx +104 -47
- package/src/serve/hub-app/review/review-page.tsx +5 -4
- package/src/serve/hub-app/review/review-st.ts +68 -28
- package/src/serve/hub-app/review/review-thread.tsx +171 -40
- package/src/serve/hub-app/review/review-views.tsx +35 -31
- package/src/serve/hub-app/review/thread-close.tsx +124 -0
- package/src/serve/hub-app/review/thread-control.tsx +4 -4
- package/src/serve/hub-app/review/thread-st.ts +222 -22
- package/src/serve/hub-app/review/trailer-card.tsx +1 -1
- package/src/serve/hub-app/review/trailer-timeline.tsx +2 -2
- package/src/serve/hub-app/review.css +216 -57
- package/src/serve/hub-app/section-head.tsx +51 -0
- package/src/serve/hub-app/social/calendar.tsx +5 -11
- package/src/serve/hub-app/social/comms-page.tsx +23 -10
- package/src/serve/hub-app/social/kit.tsx +8 -15
- package/src/serve/hub-app/social/next-release.tsx +3 -5
- package/src/serve/hub-app/social/post-card.tsx +3 -0
- package/src/serve/hub-app/social/post-page.tsx +80 -0
- package/src/serve/hub-app/social/problems.tsx +5 -9
- package/src/serve/hub-app/social/social-model.ts +13 -5
- package/src/serve/hub-app/social/social-page.tsx +1 -1
- package/src/serve/hub-app/social/social-st.ts +42 -5
- package/src/serve/hub-app/social.css +7 -17
- package/src/serve/hub-app/space.css +1 -1
- package/src/serve/hub-app/stores/stores-page.tsx +6 -2
- package/src/serve/hub-app/thread-row.tsx +101 -0
- package/src/serve/hub-app/time-ago.tsx +3 -2
- package/src/serve/hub-app/time-view.tsx +2 -1
- package/src/serve/hub-app/time.css +2 -5
- package/src/serve/hub-app/tree-row.tsx +1 -9
- package/src/serve/hub-app/vault-view.tsx +4 -4
- package/src/serve/hub-app/veille/veille-page.tsx +2 -11
- package/src/serve/hub-app/veille.css +0 -1
- package/src/serve/hub-app/waiting-svc.ts +4 -4
- package/src/serve/hub-app/when-view.tsx +6 -3
- package/src/serve/hub-app/wiki-st.ts +30 -4
- package/src/serve/hub-app/wikis-view.tsx +4 -3
- package/src/serve/hub-runtime.ts +20 -6
- package/src/serve/project-gutter-route.ts +16 -6
- package/src/serve/project-gutter.ts +6 -53
- package/src/serve/same-origin.ts +3 -0
- package/src/serve/secret-gate.ts +21 -0
- package/src/serve/serve-hub.ts +29 -20
- package/src/serve/tailnet-caller.ts +117 -0
- package/src/shipkit.ts +2 -2
- package/src/site/desk.ts +2 -2
- package/src/smoke/run-smoke.ts +3 -4
- package/src/social/brands.ts +4 -0
- package/src/social/card-drafts.ts +11 -19
- package/src/social/desk-index.ts +34 -13
- package/src/social/drafts.ts +4 -4
- package/src/social/import-drafts.ts +244 -0
- package/src/social/kind-pages.ts +3 -3
- package/src/social/kinds.ts +1 -1
- package/src/social/load.ts +89 -64
- package/src/social/media-kind.ts +68 -161
- package/src/social/media-of.ts +5 -4
- package/src/social/open.ts +3 -2
- package/src/social/post-object.ts +120 -0
- package/src/social/post-sources.ts +136 -0
- package/src/social/post-text.ts +103 -0
- package/src/social/posts.ts +378 -0
- package/src/social/presence.ts +7 -5
- package/src/social/publish/index.ts +17 -5
- package/src/social/publish/secret.ts +2 -2
- package/src/social/release-stage.ts +58 -57
- package/src/social/routes.ts +64 -24
- package/src/social/stage.ts +42 -57
- package/src/social/text.ts +4 -3
- package/src/social/thumbnail.ts +135 -43
- package/src/social/tracker.ts +1 -1
- package/src/social/writes.ts +12 -29
- package/src/stores/desk.ts +16 -11
- package/src/stores/unit.ts +2 -2
- package/src/trailer/sound/eleven.ts +33 -3
- package/src/urls/rows.ts +1 -1
- package/src/vault/vault-http.ts +11 -3
- package/src/vault/vault-import.ts +6 -1
- package/src/veille/identity.ts +2 -2
- package/src/wiki/graph-pages.ts +13 -1
- package/src/wiki/scan-md.ts +1 -1
- package/src/asks/asks-queue.ts +0 -424
- package/src/messages/suggest.ts +0 -96
- package/src/social/migrate.ts +0 -123
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
// disposed when another one does. Only the newest version takes his marks: an older one shows what was said on it
|
|
5
5
|
import { makeAutoObservable, observableRef, runInAction } from 'mobx'
|
|
6
6
|
import type { Cell, EventCell, NoteCell, ReplyCell, ThreadView, VerdictCell, VersionCell } from '../../../review/cells.ts'
|
|
7
|
+
import type { Trace } from '../../../review/traces.ts'
|
|
7
8
|
import {
|
|
8
9
|
asOptions,
|
|
9
10
|
isApproved,
|
|
@@ -21,14 +22,19 @@ import {
|
|
|
21
22
|
type ReviewView,
|
|
22
23
|
type Side,
|
|
23
24
|
type TrailerCard,
|
|
25
|
+
isOpening,
|
|
24
26
|
} from '../../../review/model.ts'
|
|
25
27
|
import { ClipSt } from './clip-st.ts'
|
|
26
28
|
import { etagLoader, postJson } from './review-kit.ts'
|
|
27
29
|
import type { ReviewSt } from './review-st.ts'
|
|
28
30
|
import { TrailerSt } from './trailer-st.ts'
|
|
29
31
|
import { laneNotes, notesNow, sortedDraft, type LaneNote } from '../../../review/trailer-notes.ts'
|
|
32
|
+
import type { ItemVerdict } from '../../../review/verdict-items.ts'
|
|
30
33
|
import type { LaneMark } from '../../../review/trailer-model.ts'
|
|
31
34
|
|
|
35
|
+
|
|
36
|
+
/** what the object panel shows: the object a message links (its cell, its address), or a loose picture */
|
|
37
|
+
export type PanelObject = { cell: string; address: string } | { src: string; title: string }
|
|
32
38
|
export interface Draft {
|
|
33
39
|
rects: Rect[]
|
|
34
40
|
comment: string
|
|
@@ -48,8 +54,11 @@ export type Framed = VersionCell | VerdictCell | ReplyCell | NoteCell
|
|
|
48
54
|
export const TILE_FILTERS = ['all', 'unrated', 'low', 'fix'] as const
|
|
49
55
|
export type TileFilter = (typeof TILE_FILTERS)[number]
|
|
50
56
|
|
|
51
|
-
/**
|
|
52
|
-
export type
|
|
57
|
+
/** a cell drawn as one trace line (review/traces.ts): an event, a verdict with no words */
|
|
58
|
+
export type Traced = (EventCell | VerdictCell) & { trace: Trace }
|
|
59
|
+
|
|
60
|
+
/** one line of the thread as drawn: a day's divider, a run of traces, or a framed cell */
|
|
61
|
+
export type Line = { kind: 'day'; day: string } | { kind: 'events'; cells: Traced[] } | { kind: 'cell'; cell: Framed }
|
|
53
62
|
|
|
54
63
|
/** one item of the contents strip: a cell, or one view of a version, and the key a click unfolds */
|
|
55
64
|
export interface Entry {
|
|
@@ -83,8 +92,44 @@ export interface SaidNote {
|
|
|
83
92
|
|
|
84
93
|
/** the dom id of a cell and of a view of a version: a message id carries a slash */
|
|
85
94
|
export const cellDom = (id: string): string => `rvc-${id.replace(/[^A-Za-z0-9-]/g, '_')}`
|
|
95
|
+
/** a step of an ask's instructions in the timeline, where the dock's reminder jumps */
|
|
96
|
+
export const stepDom = (cell: string, step: number): string => `${cellDom(cell)}-s${step}`
|
|
86
97
|
export const viewDom = (id: string, view: number): string => `${cellDom(id)}-v${view}`
|
|
87
98
|
export const viewKey = (id: string, view: number): string => `${id}#${view}`
|
|
99
|
+
export const dockDom = (id: string): string => `rvd-${id.replace(/[^A-Za-z0-9-]/g, '_')}`
|
|
100
|
+
|
|
101
|
+
/** an agent's question or proposed change that still waits on his answer */
|
|
102
|
+
const waitsOnHim = (c: ReplyCell): boolean => (c.propose ? c.propose.open : c.ask ? (c.ask.open ?? c.ask.answered === undefined) : c.judge?.open === true)
|
|
103
|
+
|
|
104
|
+
const ASK_WORD: Record<NonNullable<NonNullable<ReplyCell['ask']>['kind']>, string> = { choice: 'question', checklist: 'checklist', confirm: 'a step to do', text: 'question', url: 'a link', secret: 'a secret', file: 'a file' }
|
|
105
|
+
|
|
106
|
+
/** what kind of request a cell makes, in a word */
|
|
107
|
+
export const requestWord = (c: ReplyCell): string => (c.propose ? 'proposed change' : c.ask === undefined && c.judge ? 'your verdict' : c.instructions ? 'steps' : ASK_WORD[c.ask?.kind ?? 'choice'])
|
|
108
|
+
|
|
109
|
+
/** his answer on a question or a change, in one line; a secret says where it is stored, never a byte of it */
|
|
110
|
+
export function answeredWords(c: ReplyCell): string {
|
|
111
|
+
const p = c.propose
|
|
112
|
+
if (p) {
|
|
113
|
+
const n = p.fields.filter((f) => f.applied).length
|
|
114
|
+
return n === 0 ? 'with words' : n === p.fields.length ? (n === 1 ? `applied ${p.fields[0]!.key}` : `applied all ${n}`) : `applied ${n} of ${p.fields.length}, then words`
|
|
115
|
+
}
|
|
116
|
+
const a = c.ask
|
|
117
|
+
if (!a) return ''
|
|
118
|
+
if (a.answered) {
|
|
119
|
+
// the answer's text is the option's label, then the owner's words after « : » when there are some
|
|
120
|
+
const label = a.options[a.answered.option] ?? `option ${a.answered.option + 1}`
|
|
121
|
+
const t = a.answered.text
|
|
122
|
+
const words = t === label ? '' : t.startsWith(`${label}: `) ? t.slice(label.length + 2) : t
|
|
123
|
+
return `${label}${words ? ` · « ${words} »` : ''}`
|
|
124
|
+
}
|
|
125
|
+
if (a.none !== undefined) return `none of these · « ${a.none} »`
|
|
126
|
+
if (a.kind === 'secret') return a.secret?.stored ? `stored as ${a.secret.name}` : 'not given'
|
|
127
|
+
if (a.kind === 'checklist') return `all ${a.lines?.length ?? 0} ${c.instructions ? 'steps ' : ''}done`
|
|
128
|
+
if (a.kind === 'confirm') return 'done'
|
|
129
|
+
if (a.kind === 'url' && a.value) return `${a.value.text}${a.value.opens ? '' : ' · did not open from this Mac'}`
|
|
130
|
+
if (a.value) return a.kind === 'file' ? `his file, view ${(a.value.view ?? 0) + 1}` : a.value.text
|
|
131
|
+
return 'yes'
|
|
132
|
+
}
|
|
88
133
|
|
|
89
134
|
/** a reaction is on that view, that tile of it, or that message of a draft card */
|
|
90
135
|
const sameSpot = (r: ReviewReaction, view: number, tile: number | undefined, post?: string): boolean => r.view === view && r.tile === tile && r.post === post
|
|
@@ -115,7 +160,8 @@ export class ThreadSt {
|
|
|
115
160
|
/** the column scrolled to the newest cell once, on the first load */
|
|
116
161
|
landed = false
|
|
117
162
|
/** the view open in the lightbox over the thread (a preview clicked), to judge and draw on at its full size */
|
|
118
|
-
|
|
163
|
+
/** the view the lightbox shows; on a gallery, the one tile it shows large */
|
|
164
|
+
boxed: { cell: string; view: number; tile?: number } | null = null
|
|
119
165
|
private drafts: Record<string, Draft> = {}
|
|
120
166
|
/** the older version his answer goes to: a version landed while he wrote, or he chose to answer it. His first mark
|
|
121
167
|
* on the newest version, or « answer v4 », brings his answer back to the newest */
|
|
@@ -130,7 +176,6 @@ export class ThreadSt {
|
|
|
130
176
|
/** the rectangle whose note box takes the focus once it shows */
|
|
131
177
|
noteFocus: number | null = null
|
|
132
178
|
/** the gallery tile shown large, `<item>#<view>/<tile>` */
|
|
133
|
-
bigTile: string | null = null
|
|
134
179
|
/** the tile each gallery view opens in tabs mode, by view; absent = its first shown tile */
|
|
135
180
|
galleryTab: Record<number, number> = {}
|
|
136
181
|
/** the gallery tile under the pointer of the newest version: 1 to 5 score it */
|
|
@@ -149,6 +194,8 @@ export class ThreadSt {
|
|
|
149
194
|
openRows: Record<string, boolean> = {}
|
|
150
195
|
/** his hint being typed on an agent's update, by the update's cell id */
|
|
151
196
|
hints: Record<string, string> = {}
|
|
197
|
+
/** the message whose « fix » opened its own words box, null when none is open */
|
|
198
|
+
fixing: string | null = null
|
|
152
199
|
busy = false
|
|
153
200
|
/** the verdict he just gave (null: the one he took back): shown the moment he clicks, while the store takes it */
|
|
154
201
|
sending: { on: string; status: ReviewStatus | null } | null = null
|
|
@@ -204,7 +251,9 @@ export class ThreadSt {
|
|
|
204
251
|
receive(v: ThreadView): void {
|
|
205
252
|
if (v === this.data) return
|
|
206
253
|
const before = this.data
|
|
207
|
-
|
|
254
|
+
// a cell a newer object just superseded folds even under the owner's eyes: that is the point of superseding it
|
|
255
|
+
const gone = new Set(v.cells.flatMap((c) => (c.superseded ? [c.id] : [])))
|
|
256
|
+
if (before) for (const c of before.cells) if (c.kind !== 'event' && !gone.has(c.id) && this.folds[c.id] === undefined && this.defaultOpen(c, before) !== this.defaultOpen(c, v)) this.folds = { ...this.folds, [c.id]: this.defaultOpen(c, before) }
|
|
208
257
|
if (before && before.head !== v.head && this.draftOn === null && isDirty(this.drafts[before.head]) && v.members.includes(before.head)) this.draftOn = before.head
|
|
209
258
|
this.data = v
|
|
210
259
|
// an address's view on a link to an old version is that version's view, never the newest's
|
|
@@ -224,6 +273,7 @@ export class ThreadSt {
|
|
|
224
273
|
}
|
|
225
274
|
|
|
226
275
|
private defaultOpen(c: Cell, v: ThreadView): boolean {
|
|
276
|
+
if (c.superseded) return false
|
|
227
277
|
return c.open || c.id === v.asked
|
|
228
278
|
}
|
|
229
279
|
|
|
@@ -318,7 +368,8 @@ export class ThreadSt {
|
|
|
318
368
|
/** the newest version takes a verdict and his marks: an agent's card that is no draft */
|
|
319
369
|
get takesVerdict(): boolean {
|
|
320
370
|
const h = this.head
|
|
321
|
-
|
|
371
|
+
// a thread opened with words holds nothing to judge: its questions and changes take his answer in their cells
|
|
372
|
+
return h?.kind === 'version' && !h.item.wip && (!isOpening(h.item) || h.item.asksVerdict === true)
|
|
322
373
|
}
|
|
323
374
|
|
|
324
375
|
/** the version cell an item id names */
|
|
@@ -337,14 +388,79 @@ export class ThreadSt {
|
|
|
337
388
|
day = d
|
|
338
389
|
}
|
|
339
390
|
const last = out.at(-1)
|
|
340
|
-
if (c.kind === 'event') {
|
|
341
|
-
|
|
342
|
-
|
|
391
|
+
if (c.kind === 'event' || (c.kind === 'verdict' && c.trace !== undefined)) {
|
|
392
|
+
const t = c as Traced
|
|
393
|
+
if (last?.kind === 'events') last.cells.push(t)
|
|
394
|
+
else out.push({ kind: 'events', cells: [t] })
|
|
343
395
|
} else out.push({ kind: 'cell', cell: c })
|
|
344
396
|
}
|
|
345
397
|
return out
|
|
346
398
|
}
|
|
347
399
|
|
|
400
|
+
// ── the dock: what waits on his answer, above his reply box (wiki tools/shipkit/threads-page.md, The dock) ──
|
|
401
|
+
|
|
402
|
+
/** each question and proposed change of an agent that still waits on him, oldest first; a closed thread or ask asks
|
|
403
|
+
* nothing: the server closes a request asked before his close (review/cells.ts, moot) */
|
|
404
|
+
get openRequests(): ReplyCell[] {
|
|
405
|
+
if (this.data?.ask && this.data.ask.state !== 'open') return []
|
|
406
|
+
// a field inside a step waits as its step does: the instructions' one reminder covers it
|
|
407
|
+
return this.cells.filter((c): c is ReplyCell => c.kind === 'reply' && c.party === 'agent' && c.step === undefined && waitsOnHim(c))
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
/** when he closed the thread, null while it is open: the server's `closedAt` (review/threads.ts), the one function
|
|
411
|
+
* every list reads. A request asked before it closes with it, one asked after it still waits */
|
|
412
|
+
get closedAt(): string | null {
|
|
413
|
+
return this.data?.closedAt ?? null
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
/** the request still waits on him: its cell draws its controls live, the dock reminds of it */
|
|
417
|
+
waitsNow(id: string): boolean {
|
|
418
|
+
return this.openRequests.some((c) => c.id === id)
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
/** the version that waits for the owner's verdict: its verdicts sit under it in the timeline (item-verdict.tsx), the
|
|
422
|
+
* dock holds one line that reminds of it */
|
|
423
|
+
get verdictAbove(): VersionCell | null {
|
|
424
|
+
const h = this.head
|
|
425
|
+
if (h?.kind !== 'version' || !this.takesVerdict || this.chosenOn(h.id) !== undefined || this.data?.state.state === 'closed') return null
|
|
426
|
+
return h
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
/** the owner's verdict on a message that asks it; its own words box's words go with it, else the reply box's. A fix
|
|
430
|
+
* needs words: with none, « fix » opens the item's own words box, as a question has one */
|
|
431
|
+
async judge(c: ReplyCell, status: ItemVerdict): Promise<void> {
|
|
432
|
+
if (this.busy) return
|
|
433
|
+
const own = (this.hints[c.id] ?? '').trim()
|
|
434
|
+
const text = own !== '' ? own : this.draft.comment.trim()
|
|
435
|
+
if (status === 'approved-with-fix' && text === '') {
|
|
436
|
+
this.fixing = c.id
|
|
437
|
+
return
|
|
438
|
+
}
|
|
439
|
+
this.busy = true
|
|
440
|
+
this.error = null
|
|
441
|
+
try {
|
|
442
|
+
await postJson(this.rv.url(`/api/review/${c.on}/item-verdict`), { re: c.id.slice(c.on.length + 1), status, ...(text !== '' ? { text } : {}) })
|
|
443
|
+
runInAction(() => {
|
|
444
|
+
if (own !== '') delete this.hints[c.id]
|
|
445
|
+
else if (text !== '') this.setComment('')
|
|
446
|
+
this.fixing = null
|
|
447
|
+
})
|
|
448
|
+
await this.refresh()
|
|
449
|
+
await this.rv.answered()
|
|
450
|
+
} catch (e) {
|
|
451
|
+
runInAction(() => (this.error = (e as Error).message))
|
|
452
|
+
} finally {
|
|
453
|
+
runInAction(() => (this.busy = false))
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
/** V, F, R: the newest open item that asks the owner's verdict, a message or the version; the version when none waits */
|
|
458
|
+
judgeKey(status: ItemVerdict): Promise<void> {
|
|
459
|
+
const c = [...this.openRequests].reverse().find((x) => x.judge?.open === true)
|
|
460
|
+
const v = this.verdictAbove
|
|
461
|
+
return c !== undefined && (v === null || c.at >= v.at) ? this.judge(c, status) : this.submit(status)
|
|
462
|
+
}
|
|
463
|
+
|
|
348
464
|
// ── folding ──
|
|
349
465
|
|
|
350
466
|
isOpen(c: Cell): boolean {
|
|
@@ -386,15 +502,38 @@ export class ThreadSt {
|
|
|
386
502
|
if (view !== undefined && cell === this.target) this.setView(view)
|
|
387
503
|
}
|
|
388
504
|
|
|
505
|
+
/** the dock's reminder of an ask's instructions: the column scrolls to that step and lights it */
|
|
506
|
+
revealStep(cell: string, step: number): void {
|
|
507
|
+
this.folds = { ...this.folds, [cell]: true }
|
|
508
|
+
this.jump = stepDom(cell, step)
|
|
509
|
+
}
|
|
510
|
+
|
|
389
511
|
jumped(): void {
|
|
390
512
|
this.jump = null
|
|
391
513
|
}
|
|
392
514
|
|
|
393
|
-
openBox(cell: string, view: number): void {
|
|
394
|
-
this.boxed = { cell, view }
|
|
515
|
+
openBox(cell: string, view: number, tile?: number): void {
|
|
516
|
+
this.boxed = { cell, view, ...(tile !== undefined ? { tile } : {}) }
|
|
395
517
|
if (cell === this.target) this.setView(view)
|
|
396
518
|
}
|
|
397
519
|
|
|
520
|
+
/** the object open in the panel on the right of the thread (object-panel.tsx): an object a message links, read live
|
|
521
|
+
* from its cell, or a loose picture (a reply's, a note's still) */
|
|
522
|
+
panel: PanelObject | null = null
|
|
523
|
+
|
|
524
|
+
openPanel(p: PanelObject): void {
|
|
525
|
+
this.boxed = null
|
|
526
|
+
this.panel = p
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
closePanel(): void {
|
|
530
|
+
this.panel = null
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
openPicture(src: string, title: string): void {
|
|
534
|
+
this.openPanel({ src, title })
|
|
535
|
+
}
|
|
536
|
+
|
|
398
537
|
closeBox(): void {
|
|
399
538
|
this.boxed = null
|
|
400
539
|
}
|
|
@@ -450,7 +589,8 @@ export class ThreadSt {
|
|
|
450
589
|
const choice = isChoice(h.item)
|
|
451
590
|
// an older update's picture is history: only the newest one waits for his answer
|
|
452
591
|
const ups = this.updateViewsOf(h.id)
|
|
453
|
-
|
|
592
|
+
// an older update's picture, a question's option and a proposed sound are answered in their own cells
|
|
593
|
+
const past = new Set([...ups.slice(0, -1), ...[...this.messageViewsOf(h.id)].filter((i) => !ups.includes(i))])
|
|
454
594
|
return h.item.views.flatMap((v, i) => (past.has(i) ? [] : [{ v, i }])).map(({ v, i }) => {
|
|
455
595
|
const own = this.reactionOf(i)
|
|
456
596
|
const given = sent?.reactions.find((r) => r.view === i && r.tile === undefined)
|
|
@@ -469,6 +609,18 @@ export class ThreadSt {
|
|
|
469
609
|
return this.cells.flatMap((c) => (c.kind === 'reply' && c.on === on && c.update?.view !== undefined ? [c.update.view] : []))
|
|
470
610
|
}
|
|
471
611
|
|
|
612
|
+
/** every view of an item a message holds: an update's media, a question's options, a proposed sound; each draws in
|
|
613
|
+
* its message's cell, never among the version's views */
|
|
614
|
+
messageViewsOf(on: string): Set<number> {
|
|
615
|
+
return new Set(
|
|
616
|
+
this.cells.flatMap((c) =>
|
|
617
|
+
c.kind === 'reply' && c.on === on && c.party === 'agent'
|
|
618
|
+
? [...(c.update?.view !== undefined ? [c.update.view] : []), ...(c.ask?.views ?? []).flatMap((v) => (v === null ? [] : [v])), ...(c.propose?.fields ?? []).flatMap((f) => (f.view === undefined ? [] : [f.view]))]
|
|
619
|
+
: [],
|
|
620
|
+
),
|
|
621
|
+
)
|
|
622
|
+
}
|
|
623
|
+
|
|
472
624
|
/** the views of that version still waiting for his answer, of all its views: « 3 of 5 views waiting for you » */
|
|
473
625
|
get waitingViews(): { waiting: number; of: number } | null {
|
|
474
626
|
const marks = this.viewMarks
|
|
@@ -799,11 +951,6 @@ export class ThreadSt {
|
|
|
799
951
|
this.galleryTab = { ...this.galleryTab, [view]: tile }
|
|
800
952
|
}
|
|
801
953
|
|
|
802
|
-
toggleTile(id: string, view: number, tile: number): void {
|
|
803
|
-
const k = `${viewKey(id, view)}/${tile}`
|
|
804
|
-
this.bigTile = this.bigTile === k ? null : k
|
|
805
|
-
}
|
|
806
|
-
|
|
807
954
|
/** a version as thin option rows: a choice, or views that each play alone, unless he asked them full */
|
|
808
955
|
rows(item: Item): boolean {
|
|
809
956
|
return asOptions(item) && this.full[item.id] !== true
|
|
@@ -907,7 +1054,7 @@ export class ThreadSt {
|
|
|
907
1054
|
return
|
|
908
1055
|
}
|
|
909
1056
|
if (h.item.wip) {
|
|
910
|
-
this.error = 'a draft
|
|
1057
|
+
this.error = 'a draft version: the verdict comes once its agent makes it ready; a word goes in a reply'
|
|
911
1058
|
return
|
|
912
1059
|
}
|
|
913
1060
|
const d = this.draft
|
|
@@ -999,16 +1146,50 @@ export class ThreadSt {
|
|
|
999
1146
|
}
|
|
1000
1147
|
}
|
|
1001
1148
|
|
|
1002
|
-
/** one click on a question's option, or « apply » on a proposed change (
|
|
1003
|
-
* goes to the item it sits on, naming it,
|
|
1004
|
-
|
|
1149
|
+
/** one click on a question's option, or « apply » on one field of a proposed change (the owner's edit of its value in the
|
|
1150
|
+
* field's box, `<cell>#<key>`): the owner's answer goes to the item it sits on, naming it, the owner's words the cell's box, and wakes
|
|
1151
|
+
* the agent that holds the thread */
|
|
1152
|
+
async answer(c: { id: string; on: string }, a: { option?: number; apply?: true; field?: string; tick?: boolean; value?: string }): Promise<void> {
|
|
1005
1153
|
if (this.busy) return
|
|
1154
|
+
await this.answering(c, [a])
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1157
|
+
/** « apply all »: one answer a field not applied yet, each with its value as he left it */
|
|
1158
|
+
async applyAll(c: { id: string; on: string }, fields: readonly string[]): Promise<void> {
|
|
1159
|
+
if (this.busy || fields.length === 0) return
|
|
1160
|
+
await this.answering(c, fields.map((field) => ({ apply: true as const, field })))
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
/** the owner's words on a question with no option clicked: none of them, and why; on a proposed change, a word on it */
|
|
1164
|
+
async noneOf(c: { id: string; on: string }): Promise<void> {
|
|
1165
|
+
await this.sendHint(c)
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
/** the key of the box that holds the owner's edit of one field's value */
|
|
1169
|
+
fieldBox = (c: { id: string }, key: string): string => `${c.id}#${key}`
|
|
1170
|
+
|
|
1171
|
+
private async answering(c: { id: string; on: string }, all: readonly { option?: number; apply?: true; field?: string; tick?: boolean; value?: string }[]): Promise<void> {
|
|
1006
1172
|
const sent = this.hints[c.id] ?? ''
|
|
1007
1173
|
const re = c.id.slice(c.on.length + 1)
|
|
1008
1174
|
this.busy = true
|
|
1009
1175
|
this.error = null
|
|
1010
1176
|
try {
|
|
1011
|
-
|
|
1177
|
+
for (const a of all) {
|
|
1178
|
+
const box = a.field !== undefined ? this.fieldBox(c, a.field) : null
|
|
1179
|
+
const value = a.value?.trim() ?? (box !== null ? (this.hints[box] ?? '').trim() : '')
|
|
1180
|
+
await postJson(this.rv.url(`/api/review/${c.on}/answer`), {
|
|
1181
|
+
re,
|
|
1182
|
+
...(a.option !== undefined ? { option: a.option } : {}),
|
|
1183
|
+
...(a.tick !== undefined ? { tick: a.tick } : {}),
|
|
1184
|
+
...(a.apply ? { apply: true } : {}),
|
|
1185
|
+
...(a.field !== undefined && a.field !== '' ? { field: a.field } : {}),
|
|
1186
|
+
...(value !== '' ? { value } : {}),
|
|
1187
|
+
...(sent.trim() ? { text: sent.trim() } : {}),
|
|
1188
|
+
})
|
|
1189
|
+
runInAction(() => {
|
|
1190
|
+
if (box !== null) delete this.hints[box]
|
|
1191
|
+
})
|
|
1192
|
+
}
|
|
1012
1193
|
runInAction(() => {
|
|
1013
1194
|
if (this.hints[c.id] === sent) delete this.hints[c.id]
|
|
1014
1195
|
})
|
|
@@ -1020,6 +1201,25 @@ export class ThreadSt {
|
|
|
1020
1201
|
}
|
|
1021
1202
|
}
|
|
1022
1203
|
|
|
1204
|
+
/** the ticks on their way, by `<cell id>#<line>`: the box shows his click at once, and a tick never waits on another */
|
|
1205
|
+
ticking: Record<string, boolean> = {}
|
|
1206
|
+
|
|
1207
|
+
/** his tick on one line of a checklist or one step of an ask's instructions (with his pick on a choice step), sent
|
|
1208
|
+
* at once, apart from any other answer on its way */
|
|
1209
|
+
async tick(c: { id: string; on: string }, line: number, tick: boolean, pick?: number): Promise<void> {
|
|
1210
|
+
const key = `${c.id}#${line}`
|
|
1211
|
+
if (this.ticking[key] !== undefined) return
|
|
1212
|
+
this.ticking[key] = tick
|
|
1213
|
+
try {
|
|
1214
|
+
await postJson(this.rv.url(`/api/review/${c.on}/answer`), { re: c.id.slice(c.on.length + 1), option: line, tick, ...(pick !== undefined ? { pick } : {}) })
|
|
1215
|
+
await this.rv.answered()
|
|
1216
|
+
} catch (e) {
|
|
1217
|
+
runInAction(() => (this.error = (e as Error).message))
|
|
1218
|
+
} finally {
|
|
1219
|
+
runInAction(() => delete this.ticking[key])
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1023
1223
|
/** the agent words he has not read, by cell id: the page sends them read once each shows on his screen */
|
|
1024
1224
|
get unreadCells(): string[] {
|
|
1025
1225
|
return this.cells.filter((c) => (c.kind === 'reply' || c.kind === 'note') && c.party === 'agent' && !c.read && c.id.includes('/')).map((c) => c.id)
|
|
@@ -89,7 +89,7 @@ const CardBar = observer(({ ver, tr, spec }: { ver: Ver; tr: TrailerSt; spec: Tr
|
|
|
89
89
|
<span className="sp" />
|
|
90
90
|
<span className="tr-dim tr-small">{ver.live || ver.claim ? `Space · , . a frame · drag on the frame: a note${spec.before ? ' · B before, after' : ''}` : 'an older version: its own render and the notes sent on it'}</span>
|
|
91
91
|
{ver.rv.phone.on ? null : (
|
|
92
|
-
<button className={ver.rv.wide ? 'on' : ''} title="the
|
|
92
|
+
<button className={ver.rv.wide ? 'on' : ''} title="the version takes the page, its notes beside the player (W)" onMouseDown={keepFocus} onClick={() => ver.rv.toggleWide()}>
|
|
93
93
|
{ver.rv.wide ? 'narrow' : 'wide'} (W)
|
|
94
94
|
</button>
|
|
95
95
|
)}
|
|
@@ -157,14 +157,14 @@ export const ShotSummary = observer(({ st }: { st: TrailerSt }) => {
|
|
|
157
157
|
const { counts: c, total, cards } = ss.summary
|
|
158
158
|
const cut = st.cut?.cut
|
|
159
159
|
return (
|
|
160
|
-
<div className="tr-summary" title="each shot's state: a coloured bar under it on the timeline, a line on its
|
|
160
|
+
<div className="tr-summary" title="each shot's state: a coloured bar under it on the timeline, a line on its version; a lane writes it with sk trailer plan">
|
|
161
161
|
<span className="ss-ready"><span className="tr-sdot" /><b>{c.ready} of {total}</b> shots ready</span>
|
|
162
162
|
<span className="ss-queued"><span className="tr-sdot" />{c.queued} queued</span>
|
|
163
163
|
<span className="ss-filming"><span className="tr-sdot" />{c.filming} filming</span>
|
|
164
164
|
{c.unfilmed > 0 ? <span className="ss-unfilmed"><span className="tr-sdot" />{c.unfilmed} not filmed</span> : null}
|
|
165
165
|
<span className="ss-waiting">
|
|
166
166
|
<span className="tr-sdot" />cards waiting: {cards.length === 0 ? 'none' : cards.map((x) => (
|
|
167
|
-
<button key={x.card} type="button" className="tr-cardlink" title={`open
|
|
167
|
+
<button key={x.card} type="button" className="tr-cardlink" title={`open version ${x.card}: the new take of ${x.shots.join(', ')}`} onClick={() => st.openCard(x.card)}>{x.card} ({x.shots.join(', ')})</button>
|
|
168
168
|
))}
|
|
169
169
|
</span>
|
|
170
170
|
{ss.plan !== cut ? <span className="tr-dim tr-small">the plan of {ss.plan}, the cut this version keeps</span> : null}
|