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
|
@@ -6,6 +6,7 @@ import { makeAutoObservable, observableRef, reaction, runInAction } from 'mobx'
|
|
|
6
6
|
import { PAGE, type BoardRow, type ThreadPage, type ThreadRow } from '../../../review/cells.ts'
|
|
7
7
|
import { MOVE_LABEL, pasteBlock, STATUS_LABEL, type Move, type ReviewStatus, type ShownStatus, type Spec } from '../../../review/model.ts'
|
|
8
8
|
import type { PasteHosts } from '../../../review/paste.ts'
|
|
9
|
+
import { OWNER_WAITS, waitsOfParam, type OwnerWait } from '../../../review/wait.ts'
|
|
9
10
|
import type { Role } from '../../../review/role.ts'
|
|
10
11
|
import type { RepoSt } from '../repo-st.ts'
|
|
11
12
|
import { copyText, etagLoader, StoreWait, GALLERY_FITS, GALLERY_MODES, kept, postJson, TILE_H, ZOOMS, boxScale, isBoxZoom, type BoxZoom, type EtagLoader, type GalleryFit, type GalleryMode, type Zoom } from './review-kit.ts'
|
|
@@ -13,14 +14,7 @@ import { ThreadSt, type Draft } from './thread-st.ts'
|
|
|
13
14
|
import { cardSource, StageSt, type StageFill } from '../social/stage-st.ts'
|
|
14
15
|
import { isPostRating } from '../../../identities/rating.ts'
|
|
15
16
|
import { sideOf, stepSide, type SideList } from '../list-walk.ts'
|
|
16
|
-
|
|
17
|
-
/** a live `sk thread watch`: its process, the session or lane it keeps, when it started */
|
|
18
|
-
export interface Watcher {
|
|
19
|
-
pid: number
|
|
20
|
-
session: string | null
|
|
21
|
-
lane: string | null
|
|
22
|
-
started: string
|
|
23
|
-
}
|
|
17
|
+
import { hearingOf, NO_PARTIES, treeOf, type Hearing, type Holder, type Parties, type TreeRow } from '../../../review/parties.ts'
|
|
24
18
|
|
|
25
19
|
/** how a pair of images shows: side by side, the curtain, one over the other, the after alone */
|
|
26
20
|
/** side by side, the curtain, the onion skin, the after alone, or only what changed (the after's changed pixels) */
|
|
@@ -140,6 +134,8 @@ const isShownStatus = (s: string): s is ShownStatus => Object.hasOwn(STATUS_LABE
|
|
|
140
134
|
|
|
141
135
|
export class ReviewSt {
|
|
142
136
|
page: ThreadPage | null = null
|
|
137
|
+
/** what moved since he left, as the first answer of the server said it: his own reads never empty it */
|
|
138
|
+
since: ThreadPage['since'] | undefined = undefined
|
|
143
139
|
listError: string | null = null
|
|
144
140
|
/** the cards' store refused for a while: the list stays the last one read, and this line says why */
|
|
145
141
|
listWait: string | null = null
|
|
@@ -150,7 +146,10 @@ export class ReviewSt {
|
|
|
150
146
|
/** the dispatcher's board in place of the cards */
|
|
151
147
|
board = false
|
|
152
148
|
boardRows: BoardRow[] | null = null
|
|
153
|
-
|
|
149
|
+
/** who holds each thread and who hears it: the sessions and lanes its holders name (review/parties.ts) */
|
|
150
|
+
parties: Parties = NO_PARTIES
|
|
151
|
+
/** the repo's name as the registry says it, for « the next session in <repo> » */
|
|
152
|
+
partiesRepo = ''
|
|
154
153
|
selectedId: string | null = null
|
|
155
154
|
/** the card opened with none named (the list's first row then): it stays open until he picks another */
|
|
156
155
|
pinned: string | null = null
|
|
@@ -166,10 +165,15 @@ export class ReviewSt {
|
|
|
166
165
|
subject: string | null = null
|
|
167
166
|
whose: Move | null = null
|
|
168
167
|
status: ShownStatus | null = null
|
|
168
|
+
/** « what I must do »: these verbs of his (review/wait.ts), null every thread */
|
|
169
|
+
waits: OwnerWait[] | null = null
|
|
169
170
|
/** « hide handled »: only the active threads in the list */
|
|
170
171
|
hideHandled = true
|
|
171
172
|
/** « by lane »: the list grouped under one header per lane */
|
|
172
173
|
byLane = false
|
|
174
|
+
/** the list's bands folded, by key (`turn:aside`, `lane:L29`): a folded band draws its head and its count only.
|
|
175
|
+
* Set aside starts folded */
|
|
176
|
+
fold: string[] = ['turn:aside']
|
|
173
177
|
/** the subject rings over the image (M) */
|
|
174
178
|
marksOn = true
|
|
175
179
|
zoom: Zoom = 'preview'
|
|
@@ -204,20 +208,26 @@ export class ReviewSt {
|
|
|
204
208
|
/** the unit's words, read once a start, again after a stop */
|
|
205
209
|
private specRead: Promise<unknown> | null = null
|
|
206
210
|
private readonly loadPage: EtagLoader<ThreadPage>
|
|
207
|
-
private readonly
|
|
211
|
+
private readonly loadParties: () => Promise<{ repo: string; parties: Parties }>
|
|
208
212
|
private readonly loadBoard: () => Promise<{ role: Role | null; rows: BoardRow[] }>
|
|
209
213
|
private readonly prefix: string
|
|
210
214
|
|
|
215
|
+
/** the home this page sits in: its kept frames, whether it is the embed page */
|
|
216
|
+
get home(): RepoSt['home'] {
|
|
217
|
+
return this.st.home
|
|
218
|
+
}
|
|
219
|
+
|
|
211
220
|
constructor(private readonly st: RepoSt) {
|
|
212
221
|
this.prefix = `shipkit.review.${st.key}.`
|
|
213
222
|
this.loadPage = etagLoader(() => st.url(`/api/review/threads?${this.listQuery}`), { keep: `review.${st.key}` })
|
|
214
|
-
this.
|
|
223
|
+
this.loadParties = etagLoader(() => st.url('/api/review/parties'))
|
|
215
224
|
this.loadBoard = etagLoader(() => st.url('/api/review/board'))
|
|
216
225
|
this.compare = new CompareSt(`${this.prefix}compare`)
|
|
217
226
|
try {
|
|
218
|
-
const p = JSON.parse(kept.get(`${this.prefix}prefs`) ?? '{}') as { hideHandled?: boolean; byLane?: boolean; mediaZoom?: string; boxZoom?: unknown; marks?: boolean; rail?: boolean; tileH?: number; tileSmall?: boolean; galleryMode?: string; galleryFit?: string }
|
|
227
|
+
const p = JSON.parse(kept.get(`${this.prefix}prefs`) ?? '{}') as { hideHandled?: boolean; byLane?: boolean; fold?: unknown; mediaZoom?: string; boxZoom?: unknown; marks?: boolean; rail?: boolean; tileH?: number; tileSmall?: boolean; galleryMode?: string; galleryFit?: string }
|
|
219
228
|
if (p.hideHandled === false) this.hideHandled = false
|
|
220
229
|
if (p.byLane === true) this.byLane = true
|
|
230
|
+
if (Array.isArray(p.fold) && p.fold.every((k) => typeof k === 'string')) this.fold = p.fold
|
|
221
231
|
if (p.marks === false) this.marksOn = false
|
|
222
232
|
if (p.rail === false) this.railOn = false
|
|
223
233
|
if ((ZOOMS as readonly string[]).includes(p.mediaZoom ?? '')) this.zoom = p.mediaZoom as Zoom
|
|
@@ -231,7 +241,7 @@ export class ReviewSt {
|
|
|
231
241
|
}
|
|
232
242
|
// the last list drawn in the first frame: the daemon answers after, and only what moved draws again
|
|
233
243
|
this.page = this.loadPage.held()
|
|
234
|
-
makeAutoObservable<this, 'st' | 'toastTimer' | 'searchTimer' | 'timer' | 'starting' | 'specRead' | 'loadPage' | '
|
|
244
|
+
makeAutoObservable<this, 'st' | 'toastTimer' | 'searchTimer' | 'timer' | 'starting' | 'specRead' | 'loadPage' | 'loadParties' | 'loadBoard' | 'prefix'>(this, {
|
|
235
245
|
st: false,
|
|
236
246
|
toastTimer: false,
|
|
237
247
|
searchTimer: false,
|
|
@@ -239,7 +249,7 @@ export class ReviewSt {
|
|
|
239
249
|
starting: false,
|
|
240
250
|
specRead: false,
|
|
241
251
|
loadPage: false,
|
|
242
|
-
|
|
252
|
+
loadParties: false,
|
|
243
253
|
loadBoard: false,
|
|
244
254
|
prefix: false,
|
|
245
255
|
searchEl: false,
|
|
@@ -251,7 +261,7 @@ export class ReviewSt {
|
|
|
251
261
|
boardRows: observableRef,
|
|
252
262
|
})
|
|
253
263
|
reaction(
|
|
254
|
-
() => JSON.stringify({ hideHandled: this.hideHandled, byLane: this.byLane, mediaZoom: this.zoom, boxZoom: this.boxZoom, marks: this.marksOn, rail: this.railOn, tileH: this.tileH, tileSmall: this.tileSmall, galleryMode: this.galleryMode, galleryFit: this.galleryFit }),
|
|
264
|
+
() => JSON.stringify({ hideHandled: this.hideHandled, byLane: this.byLane, fold: this.fold, mediaZoom: this.zoom, boxZoom: this.boxZoom, marks: this.marksOn, rail: this.railOn, tileH: this.tileH, tileSmall: this.tileSmall, galleryMode: this.galleryMode, galleryFit: this.galleryFit }),
|
|
255
265
|
(s) => kept.put(`${this.prefix}prefs`, s),
|
|
256
266
|
)
|
|
257
267
|
// the card the address names, else the list's first: a new one is a new thread state, the old one disposed
|
|
@@ -311,17 +321,22 @@ export class ReviewSt {
|
|
|
311
321
|
this.loadPage().then(
|
|
312
322
|
(page) => runInAction(() => {
|
|
313
323
|
if (page !== this.page) this.page = page
|
|
324
|
+
if (this.since === undefined) this.since = page.since ?? null
|
|
314
325
|
this.listError = null
|
|
315
326
|
this.listWait = null
|
|
316
327
|
}),
|
|
317
328
|
(e: Error) =>
|
|
318
329
|
runInAction(() => {
|
|
319
|
-
if (e instanceof StoreWait) this.listWait = `${/a way back/.test(e.line) ? 'a way back' : /a repair/.test(e.line) ? 'a repair' : 'a fold'} of the
|
|
330
|
+
if (e instanceof StoreWait) this.listWait = `${/a way back/.test(e.line) ? 'a way back' : /a repair/.test(e.line) ? 'a repair' : 'a fold'} of the threads' database runs: the list is the last one read, back in ${/under \d+ s left/.test(e.line) ? 'a moment' : `about ${e.retryS} s`}`
|
|
320
331
|
else this.listError = e.message
|
|
321
332
|
}),
|
|
322
333
|
),
|
|
323
|
-
this.
|
|
324
|
-
(
|
|
334
|
+
this.loadParties().then(
|
|
335
|
+
(p) =>
|
|
336
|
+
runInAction(() => {
|
|
337
|
+
if (JSON.stringify(p.parties) !== JSON.stringify(this.parties)) this.parties = p.parties
|
|
338
|
+
this.partiesRepo = p.repo
|
|
339
|
+
}),
|
|
325
340
|
() => undefined,
|
|
326
341
|
),
|
|
327
342
|
this.board ? this.loadBoard().then((b) => runInAction(() => b.rows !== this.boardRows && (this.boardRows = b.rows)), () => undefined) : null,
|
|
@@ -386,6 +401,7 @@ export class ReviewSt {
|
|
|
386
401
|
if (this.subject !== null) p.set('subject', this.subject)
|
|
387
402
|
if (this.whose !== null) p.set('whose', this.whose)
|
|
388
403
|
if (this.status !== null) p.set('status', this.status)
|
|
404
|
+
if (this.waits !== null) p.set('waits', this.waits.join(','))
|
|
389
405
|
if (this.q) p.set('q', this.q)
|
|
390
406
|
return p.toString()
|
|
391
407
|
}
|
|
@@ -471,9 +487,15 @@ export class ReviewSt {
|
|
|
471
487
|
return id === null ? null : (this.rows.find((r) => r.head === id || r.ids.includes(id)) ?? null)
|
|
472
488
|
}
|
|
473
489
|
|
|
474
|
-
/** the
|
|
475
|
-
|
|
476
|
-
return
|
|
490
|
+
/** who hears his answer on a thread held by `holder` now: the rule the cli, the hook and the watch decide with */
|
|
491
|
+
hearingOf(holder: Omit<Holder, 'at'> | null | undefined): Hearing {
|
|
492
|
+
return hearingOf(holder ? { ...holder, at: '' } : null, this.parties, this.partiesRepo || this.st.name)
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
/** the holder's session and its lanes, which live, which hears: what a click on the chip shows */
|
|
496
|
+
treeOf(holder: Omit<Holder, 'at'> | null | undefined): TreeRow[] {
|
|
497
|
+
const h = holder ? { ...holder, at: '' } : null
|
|
498
|
+
return treeOf(h, this.parties, hearingOf(h, this.parties, this.partiesRepo || this.st.name))
|
|
477
499
|
}
|
|
478
500
|
|
|
479
501
|
setHideHandled(on: boolean): void {
|
|
@@ -484,6 +506,14 @@ export class ReviewSt {
|
|
|
484
506
|
this.byLane = on
|
|
485
507
|
}
|
|
486
508
|
|
|
509
|
+
folded(band: string): boolean {
|
|
510
|
+
return this.fold.includes(band)
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
toggleFold(band: string): void {
|
|
514
|
+
this.fold = this.folded(band) ? this.fold.filter((k) => k !== band) : [...this.fold, band]
|
|
515
|
+
}
|
|
516
|
+
|
|
487
517
|
setBoard(on: boolean): void {
|
|
488
518
|
this.board = on
|
|
489
519
|
if (on) void this.refresh()
|
|
@@ -496,10 +526,18 @@ export class ReviewSt {
|
|
|
496
526
|
this.searchTimer = setTimeout(() => runInAction(() => (this.q = this.query.trim().toLowerCase())), q === '' ? 0 : SEARCH_MS)
|
|
497
527
|
}
|
|
498
528
|
|
|
499
|
-
setFilter(f: { subject?: string | null; whose?: Move | null; status?: ShownStatus | null }): void {
|
|
529
|
+
setFilter(f: { subject?: string | null; whose?: Move | null; status?: ShownStatus | null; waits?: OwnerWait[] | null }): void {
|
|
500
530
|
if (f.subject !== undefined) this.subject = f.subject
|
|
501
531
|
if (f.whose !== undefined) this.whose = f.whose
|
|
502
532
|
if (f.status !== undefined) this.status = f.status
|
|
533
|
+
if (f.waits !== undefined) this.waits = f.waits === null || f.waits.length === 0 ? null : OWNER_WAITS.filter((w) => f.waits!.includes(w))
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
/** one verb of « what I must do » on or off; every verb on is no filter */
|
|
537
|
+
toggleWait(w: OwnerWait): void {
|
|
538
|
+
const on = this.waits ?? []
|
|
539
|
+
const next = on.includes(w) ? on.filter((x) => x !== w) : [...on, w]
|
|
540
|
+
this.setFilter({ waits: next.length === OWNER_WAITS.length ? null : next })
|
|
503
541
|
}
|
|
504
542
|
|
|
505
543
|
// ── the address ──
|
|
@@ -513,6 +551,7 @@ export class ReviewSt {
|
|
|
513
551
|
if (this.subject !== null) q.set('subject', this.subject)
|
|
514
552
|
if (this.whose !== null) q.set('whose', this.whose)
|
|
515
553
|
if (this.status !== null) q.set('status', this.status)
|
|
554
|
+
if (this.waits !== null) q.set('waits', this.waits.join(','))
|
|
516
555
|
if (!this.hideHandled) q.set('handled', '1')
|
|
517
556
|
if (this.byLane) q.set('lanes', '1')
|
|
518
557
|
if (this.stage !== null) q.set('stage', this.stage.pick || '1')
|
|
@@ -533,6 +572,8 @@ export class ReviewSt {
|
|
|
533
572
|
if (whose !== null && Object.hasOwn(MOVE_LABEL, whose)) this.whose = whose as Move
|
|
534
573
|
const status = q.get('status')
|
|
535
574
|
if (status !== null && isShownStatus(status)) this.status = status
|
|
575
|
+
const waits = waitsOfParam(q.get('waits'))
|
|
576
|
+
if (waits !== null) this.waits = waits
|
|
536
577
|
if (q.get('handled') === '1') this.hideHandled = false
|
|
537
578
|
if (q.get('lanes') === '1') this.byLane = true
|
|
538
579
|
// `q=<words>`: the search, an object's address included (a repo page asks the threads of one of its objects)
|
|
@@ -789,8 +830,8 @@ export class ReviewSt {
|
|
|
789
830
|
this.toastTimer = setTimeout(() => runInAction(() => (this.toast = null)), 2600)
|
|
790
831
|
}
|
|
791
832
|
|
|
792
|
-
/** the page's keys, as the atelier takes its own: true when it used the key. V approves, F ok with a fix, R rejects
|
|
793
|
-
*
|
|
833
|
+
/** the page's keys, as the atelier takes its own: true when it used the key. V approves, F ok with a fix, R rejects
|
|
834
|
+
* the newest open item that asks the owner's verdict (ThreadSt.judgeKey), N the next waiting card, C copies the card for an agent, M the rings, T the contents, D the next
|
|
794
835
|
* compare mode of every pair (⇧D the one before); ↑ ↓ the list are the hub's (side-lists.ts), so is W the card wide (kept-cols.tsx); the card takes
|
|
795
836
|
* the rest (ThreadSt.key). A digit is read from its physical key (`code`), so ⇧ and an AZERTY keyboard read the same */
|
|
796
837
|
key(e: Pick<KeyboardEvent, 'key' | 'shiftKey'> & { code?: string }): boolean {
|
|
@@ -799,10 +840,9 @@ export class ReviewSt {
|
|
|
799
840
|
const card = this.card
|
|
800
841
|
if (card?.key(e)) return true
|
|
801
842
|
const k = e.key.toLowerCase()
|
|
802
|
-
if (k === 'v') void card?.
|
|
803
|
-
else if (k === 'f') void card?.
|
|
804
|
-
else if (k === 'r') void card?.
|
|
805
|
-
else if (k === 'a') void card?.submit('archived')
|
|
843
|
+
if (k === 'v') void card?.judgeKey('approved')
|
|
844
|
+
else if (k === 'f') void card?.judgeKey('approved-with-fix')
|
|
845
|
+
else if (k === 'r') void card?.judgeKey('rejected')
|
|
806
846
|
else if (k === 'n') this.nextPending()
|
|
807
847
|
else if (k === 'c') void this.copyCard()
|
|
808
848
|
else if (k === 'm') this.toggleMarks()
|
|
@@ -1,17 +1,28 @@
|
|
|
1
1
|
// the open card as one chat (wiki tools/shipkit/threads.md, The review page): a bar on top (the title, where it stands,
|
|
2
2
|
// fold or unfold all, on a phone the contents), the cells in time order with the newest at the bottom, the contents strip beside
|
|
3
3
|
// them (every version, view, verdict and reply: a click scrolls there and unfolds it), and his answer box pinned under
|
|
4
|
-
// them: one word, sent with a verdict or as a reply
|
|
4
|
+
// them: one word, sent with a verdict or as a reply, one line reminders of what still waits on his answer right above it (dock.tsx).
|
|
5
|
+
// The column opens scrolled to the newest cell
|
|
5
6
|
import { observer } from 'mobx-react-lite'
|
|
6
|
-
import { useEffect, useRef } from 'react'
|
|
7
|
-
import {
|
|
7
|
+
import { useEffect, useRef, useState } from 'react'
|
|
8
|
+
import { postJson } from './review-kit.ts'
|
|
9
|
+
import { STATUS_LABEL, subjectLabel, viewName, viewTag } from '../../../review/model.ts'
|
|
10
|
+
import { BAND_WORDS, bandOf } from '../../../review/band.ts'
|
|
8
11
|
import { AutoText } from '../auto-text.tsx'
|
|
9
12
|
import { StagePopup } from '../social/stage-popup.tsx'
|
|
10
13
|
import { Icon, ICON } from '../icons.tsx'
|
|
11
|
-
import {
|
|
12
|
-
import { CellFrame,
|
|
14
|
+
import { Empty, HolderChip, keepFocus, Rework } from './kit.tsx'
|
|
15
|
+
import { CellFrame, TraceLines, When } from './review-cells.tsx'
|
|
16
|
+
import { Dock } from './dock.tsx'
|
|
17
|
+
import { PaneBoundary } from '../pane-boundary.tsx'
|
|
18
|
+
import { CloseBar } from './thread-close.tsx'
|
|
19
|
+
import { LaneBar } from './lane-bar.tsx'
|
|
20
|
+
import { actorName } from '../../../review/parties.ts'
|
|
13
21
|
import { ViewBox } from './review-views.tsx'
|
|
22
|
+
import { ObjectPanel } from './object-panel.tsx'
|
|
14
23
|
import type { ReviewSt } from './review-st.ts'
|
|
24
|
+
import { SectionHead } from '../section-head.tsx'
|
|
25
|
+
import { ThreadGroups } from './group-block.tsx'
|
|
15
26
|
import { type Line, type ThreadSt, type ViewMark } from './thread-st.ts'
|
|
16
27
|
|
|
17
28
|
/** `back`: where the phone's ◂ goes, the cards when absent; null when the page around the column draws its own */
|
|
@@ -33,25 +44,28 @@ export const ThreadColumn = observer(({ rv, back }: { rv: ReviewSt; back?: (() =
|
|
|
33
44
|
ro.disconnect()
|
|
34
45
|
}
|
|
35
46
|
}, [rv])
|
|
47
|
+
useKeyboardRoom(rv.phone.on)
|
|
36
48
|
const card = rv.card
|
|
37
49
|
return (
|
|
38
50
|
<div ref={el} className="rv-thread">
|
|
39
51
|
{card === null && rv.done ? (
|
|
40
52
|
<Done rv={rv} />
|
|
41
53
|
) : card === null ? (
|
|
42
|
-
<Empty text={rv.page ? 'No
|
|
54
|
+
<Empty text={rv.page ? 'No thread. An agent starts one with sk thread post <address>.' : 'Reading the threads…'} />
|
|
43
55
|
) : (
|
|
44
56
|
<>
|
|
45
57
|
<TopBar rv={rv} card={card} back={back} />
|
|
46
58
|
<div className="rv-threadbody">
|
|
47
59
|
<Cells rv={rv} card={card} />
|
|
48
60
|
{rv.rail ? <Contents rv={rv} card={card} /> : null}
|
|
61
|
+
<ObjectPanel rv={rv} card={card} />
|
|
49
62
|
{rv.sheet && !rv.rail ? (
|
|
50
63
|
<div className="rv-sheet" onClick={() => rv.closeSheet()}>
|
|
51
64
|
<div onClick={(e) => e.stopPropagation()}><Contents rv={rv} card={card} /></div>
|
|
52
65
|
</div>
|
|
53
66
|
) : null}
|
|
54
67
|
</div>
|
|
68
|
+
<PaneBoundary pane="thread dock" at={card.id}><Dock rv={rv} card={card} top={card.data?.ask?.state === 'open' ? <AskBar rv={rv} card={card} ask={card.data.ask} /> : null} /></PaneBoundary>
|
|
55
69
|
<Composer rv={rv} card={card} />
|
|
56
70
|
<ViewBox rv={rv} card={card} />
|
|
57
71
|
{rv.stage ? <StagePopup st={rv.stage} url={(p) => rv.url(p)} close={() => rv.closeStage()} /> : null}
|
|
@@ -61,6 +75,29 @@ export const ThreadColumn = observer(({ rv, back }: { rv: ReviewSt; back?: (() =
|
|
|
61
75
|
)
|
|
62
76
|
})
|
|
63
77
|
|
|
78
|
+
/** on a phone the page keeps to what the keyboard leaves: the visual viewport's height and offset as two css vars the
|
|
79
|
+
* phone pane reads, so the dock and the reply box stay above the keyboard where the browser only pans the page */
|
|
80
|
+
function useKeyboardRoom(on: boolean): void {
|
|
81
|
+
useEffect(() => {
|
|
82
|
+
const vv = typeof window === 'undefined' ? undefined : window.visualViewport
|
|
83
|
+
if (!on || !vv) return
|
|
84
|
+
const root = document.documentElement.style
|
|
85
|
+
const fit = (): void => {
|
|
86
|
+
root.setProperty('--rv-vvh', `${vv.height}px`)
|
|
87
|
+
root.setProperty('--rv-vvtop', `${vv.offsetTop}px`)
|
|
88
|
+
}
|
|
89
|
+
fit()
|
|
90
|
+
vv.addEventListener('resize', fit)
|
|
91
|
+
vv.addEventListener('scroll', fit)
|
|
92
|
+
return () => {
|
|
93
|
+
vv.removeEventListener('resize', fit)
|
|
94
|
+
vv.removeEventListener('scroll', fit)
|
|
95
|
+
root.removeProperty('--rv-vvh')
|
|
96
|
+
root.removeProperty('--rv-vvtop')
|
|
97
|
+
}
|
|
98
|
+
}, [on])
|
|
99
|
+
}
|
|
100
|
+
|
|
64
101
|
/** nothing waits on him in the list (after his last verdict, or at a visit): a green mark and the words; what the filters hide that still
|
|
65
102
|
* waits, and on the phone the way back to the cards */
|
|
66
103
|
const Done = observer(({ rv }: { rv: ReviewSt }) => {
|
|
@@ -70,7 +107,7 @@ const Done = observer(({ rv }: { rv: ReviewSt }) => {
|
|
|
70
107
|
<span className="rv-donemark" aria-hidden="true">✓</span>
|
|
71
108
|
<span className="rv-donewords">everything done :)</span>
|
|
72
109
|
{n > 0 ? <span className="rv-dim">{n} more wait{n === 1 ? 's' : ''} on you outside these filters</span> : null}
|
|
73
|
-
{rv.phone.on ? <button className="ghost" onClick={() => rv.phone.show('list')}>◂ the
|
|
110
|
+
{rv.phone.on ? <button className="ghost" onClick={() => rv.phone.show('list')}>◂ the threads</button> : null}
|
|
74
111
|
</div>
|
|
75
112
|
)
|
|
76
113
|
})
|
|
@@ -82,9 +119,9 @@ const StageBar = observer(({ rv, card }: { rv: ReviewSt; card: ThreadSt }) => {
|
|
|
82
119
|
return (
|
|
83
120
|
<>
|
|
84
121
|
{v.drafts.map((d) => (
|
|
85
|
-
<button key={d.slug} className="ghost rv-chip" title={`the draft staged from this
|
|
122
|
+
<button key={d.slug} className="ghost rv-chip" title={`the draft staged from this version: ${d.slug}, in comms`} onMouseDown={keepFocus} onClick={() => rv.openDraft(d.slug)}>📝 {d.title}</button>
|
|
86
123
|
))}
|
|
87
|
-
<button className={rv.stage !== null ? 'on' : ''} title="stage a media of this
|
|
124
|
+
<button className={rv.stage !== null ? 'on' : ''} title="stage a media of this version as a post (S): a draft in comms, never posted" onMouseDown={keepFocus} onClick={() => rv.openStage()}>📤 stage</button>
|
|
88
125
|
</>
|
|
89
126
|
)
|
|
90
127
|
})
|
|
@@ -100,18 +137,34 @@ const TopBar = observer(({ rv, card, back }: { rv: ReviewSt; card: ThreadSt; bac
|
|
|
100
137
|
{rv.phone.on && back !== null ? <button className="ghost rv-back" aria-label="back" onClick={() => (back != null ? back() : rv.phone.show('list'))}>◂</button> : null}
|
|
101
138
|
<h2 className="rv-title">{v?.title ?? row?.title ?? card.id}</h2>
|
|
102
139
|
{rv.phone.on ? null : <Waiting card={card} />}
|
|
103
|
-
<button className="rv-copyid ghost" title="copy this
|
|
140
|
+
<button className="rv-copyid ghost" title="copy this thread for an agent (C): its title, its repo, sk thread show, its link" aria-label="copy this thread for an agent" onClick={() => void rv.copyCard()}>
|
|
104
141
|
<Icon d={ICON.copy} />
|
|
105
142
|
</button>
|
|
106
143
|
</div>
|
|
107
144
|
{rv.phone.on && v ? <Minimap card={card} /> : null}
|
|
108
145
|
{v && v.versions > 1 ? <Current card={card} /> : null}
|
|
146
|
+
{/* a closed ask's record sits in the head; while it is open, its bar tops the dock, the one control the dock keeps */}
|
|
147
|
+
{v?.ask && v.ask.state !== 'open' ? <AskBar rv={rv} card={card} ask={v.ask} /> : null}
|
|
148
|
+
{v ? (
|
|
149
|
+
<div className="rv-headacts">
|
|
150
|
+
{v.turn === 'yours' || v.aside ? <AsideBar rv={rv} card={card} id={v.head} aside={v.aside ?? null} /> : null}
|
|
151
|
+
<CloseBar rv={rv} card={card} />
|
|
152
|
+
<LaneBar rv={rv} card={card} />
|
|
153
|
+
</div>
|
|
154
|
+
) : null}
|
|
109
155
|
{v ? (
|
|
110
156
|
<div className="rv-meta">
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
157
|
+
{/* the row's calm meta line (thread-row.tsx): who acts now as a dot, the rest muted words, never a pill */}
|
|
158
|
+
<span className="trmeta rv-headmeta">
|
|
159
|
+
<i className={`trturn turn-${bandOf(v, rv.parties)}`} title={BAND_WORDS[bandOf(v, rv.parties)]} aria-label={BAND_WORDS[bandOf(v, rv.parties)]} />
|
|
160
|
+
{/* a closed thread: its close bar says why, once */}
|
|
161
|
+
{v.state.state !== 'closed' ? <span className="trm">{STATUS_LABEL[v.status].toLowerCase()}</span> : null}
|
|
162
|
+
{v.holder ? <span className="trm trholder"><HolderChip rv={rv} holder={v.holder} plain /></span> : null}
|
|
163
|
+
{v.cursor ? <span className="trm trcursor" data-cursor={v.cursor.working !== undefined ? 'working' : 'seen'} title={v.cursor.working ?? 'read your newest word'}>{v.cursor.working !== undefined ? `${actorName(v.cursor.who, v.cursor.session, rv.parties)} is on it: ${v.cursor.working}` : `seen by ${actorName(v.cursor.who, v.cursor.session, rv.parties)}`} · <When rv={rv} at={v.cursor.at} /></span> : null}
|
|
164
|
+
{v.origin.by === 'auto' ? <span className="trm">auto: {v.origin.rule}</span> : null}
|
|
165
|
+
<span className="trm">{v.versions > 1 ? `${v.versions} versions` : 'one version'}</span>
|
|
166
|
+
<span className="trm">{subjectLabel(v.subject.kind, rv.spec ?? undefined)}</span>
|
|
167
|
+
</span>
|
|
115
168
|
{v.forks.length > 0 ? (
|
|
116
169
|
<span className="rv-forks" title="other cards answered the same older versions: each is its own thread">
|
|
117
170
|
· forks:
|
|
@@ -123,12 +176,12 @@ const TopBar = observer(({ rv, card, back }: { rv: ReviewSt; card: ThreadSt; bac
|
|
|
123
176
|
<Rework r={v.rework} />
|
|
124
177
|
<span className="sp" />
|
|
125
178
|
<StageBar rv={rv} card={card} />
|
|
126
|
-
<button className={`rv-iconbtn${rv.wide ? ' on' : ''}`} aria-pressed={rv.wide} title={rv.wide ? 'back to the sidebar and the
|
|
179
|
+
<button className={`rv-iconbtn${rv.wide ? ' on' : ''}`} aria-pressed={rv.wide} title={rv.wide ? 'back to the sidebar and the threads (W)' : 'wide: fold the sidebar and the threads, the version takes the page (W)'} aria-label="wide" onMouseDown={keepFocus} onClick={() => rv.toggleWide()}><Icon d={ICON.wide} /></button>
|
|
127
180
|
<span className="seg">
|
|
128
181
|
<button className="rv-iconbtn" title="fold every cell" aria-label="fold every cell" onMouseDown={keepFocus} onClick={() => card.foldAll(false)}><Icon d={ICON.foldAll} /></button>
|
|
129
182
|
<button className="rv-iconbtn" title="unfold every cell (it loads every image)" aria-label="unfold every cell" onMouseDown={keepFocus} onClick={() => card.foldAll(true)}><Icon d={ICON.unfoldAll} /></button>
|
|
130
183
|
{/* the contents: a panel beside the cells on a wide column, a sheet over them on a narrow one or a phone; folded, it takes no room */}
|
|
131
|
-
<button className={`rv-iconbtn${rv.rail || rv.sheet ? ' on' : ''}`} aria-pressed={rv.rail || rv.sheet} title="the contents: every item of the
|
|
184
|
+
<button className={`rv-iconbtn${rv.rail || rv.sheet ? ' on' : ''}`} aria-pressed={rv.rail || rv.sheet} title="the contents: every item of the thread (T)" aria-label="the contents" onMouseDown={keepFocus} onClick={() => rv.toggleRail()}>☰</button>
|
|
132
185
|
</span>
|
|
133
186
|
</div>
|
|
134
187
|
) : card.error ? null : (
|
|
@@ -138,6 +191,88 @@ const TopBar = observer(({ rv, card, back }: { rv: ReviewSt; card: ThreadSt; bac
|
|
|
138
191
|
)
|
|
139
192
|
})
|
|
140
193
|
|
|
194
|
+
/** an ask's thread: the ask's state, and the owner's two words on the whole ask, the Asks page's own verbs; « done »
|
|
195
|
+
* with a proof url sends it with the close (`ask-proof`). A question or a remark is a reply in the thread, which its
|
|
196
|
+
* holder hears */
|
|
197
|
+
const AskBar = observer(({ rv, card, ask }: { rv: ReviewSt; card: ThreadSt; ask: { id: string; state: 'open' | 'done' | 'declined'; title: string } }) => {
|
|
198
|
+
const [busy, setBusy] = useState(false)
|
|
199
|
+
const [err, setErr] = useState<string | null>(null)
|
|
200
|
+
const [proof, setProof] = useState('')
|
|
201
|
+
const [proving, setProving] = useState(false)
|
|
202
|
+
const act = async (verb: 'ask-done' | 'ask-decline'): Promise<void> => {
|
|
203
|
+
setBusy(true)
|
|
204
|
+
setErr(null)
|
|
205
|
+
try {
|
|
206
|
+
const url = proof.trim()
|
|
207
|
+
if (verb === 'ask-done' && url !== '') await postJson(rv.url('/api/act/ask-proof'), { ask: ask.id, url })
|
|
208
|
+
else await postJson(rv.url(`/api/act/${verb}`), { ask: ask.id })
|
|
209
|
+
await card.refresh()
|
|
210
|
+
} catch (e) {
|
|
211
|
+
setErr((e as Error).message)
|
|
212
|
+
} finally {
|
|
213
|
+
setBusy(false)
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
if (ask.state !== 'open') return <div className={`rv-askbar ${ask.state}`}>ask <code>{ask.id}</code> {ask.title} {ask.state === 'done' ? '✓ done' : 'declined'}</div>
|
|
217
|
+
// one line: the ask, « done ✓ », « I will not do this »; the proof url opens on its own line by a click
|
|
218
|
+
return (
|
|
219
|
+
<div className={`rv-askbar${proving ? ' proving' : ''}`}>
|
|
220
|
+
<span className="rv-asktitle" title={`ask ${ask.id}: ${ask.title}`}><span className="rv-dim">ask · </span>{ask.title}</span>
|
|
221
|
+
<button className={`ghost rv-askproofbtn${proving ? ' on' : ''}`} title="give a proof url with done" aria-pressed={proving} onMouseDown={keepFocus} onClick={() => setProving(!proving)}>🔗</button>
|
|
222
|
+
{proving ? <input className="rv-askproof" type="url" autoFocus placeholder="proof url, sent with done" aria-label="proof url, sent with done" value={proof} disabled={busy} onChange={(e) => setProof(e.currentTarget.value)}
|
|
223
|
+
onKeyDown={(e) => { if (e.key === 'Enter' && proof.trim() !== '') void act('ask-done') }} /> : null}
|
|
224
|
+
<button className="rv-askopt pick" disabled={busy} onMouseDown={keepFocus} onClick={() => void act('ask-done')} title="the whole ask is done: it closes here and on the Asks page">done ✓</button>
|
|
225
|
+
<button className="ghost" disabled={busy} onMouseDown={keepFocus} onClick={() => void act('ask-decline')} title="close it as declined: nothing asks it again; say why in a reply if you like">I will not do this</button>
|
|
226
|
+
{err ? <span className="err">✗ {err}</span> : null}
|
|
227
|
+
</div>
|
|
228
|
+
)
|
|
229
|
+
})
|
|
230
|
+
|
|
231
|
+
/** « set aside » on a thread of his turn: until a time, then his turn again by itself (wiki tools/shipkit/threads-asks.md,
|
|
232
|
+
* Snooze); a thread set aside says until when, and « back now » */
|
|
233
|
+
const AsideBar = observer(({ rv, card, id, aside }: { rv: ReviewSt; card: ThreadSt; id: string; aside: string | null }) => {
|
|
234
|
+
const [open, setOpen] = useState(false)
|
|
235
|
+
const [date, setDate] = useState('')
|
|
236
|
+
const [err, setErr] = useState<string | null>(null)
|
|
237
|
+
const send = async (until: string | null): Promise<void> => {
|
|
238
|
+
setErr(null)
|
|
239
|
+
try {
|
|
240
|
+
await postJson(rv.url(`/api/review/${id}/snooze`), { until })
|
|
241
|
+
setOpen(false)
|
|
242
|
+
await card.refresh()
|
|
243
|
+
void rv.answered()
|
|
244
|
+
} catch (e) {
|
|
245
|
+
setErr((e as Error).message)
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
if (aside)
|
|
249
|
+
return (
|
|
250
|
+
<div className="rv-asidebar on">
|
|
251
|
+
<span>⏾ set aside until {new Date(aside).toLocaleString([], { weekday: 'short', day: 'numeric', month: 'short', hour: '2-digit', minute: '2-digit' })}</span>
|
|
252
|
+
<button className="ghost" onMouseDown={keepFocus} onClick={() => void send(null)}>back now</button>
|
|
253
|
+
{err ? <span className="err">✗ {err}</span> : null}
|
|
254
|
+
</div>
|
|
255
|
+
)
|
|
256
|
+
return (
|
|
257
|
+
<div className="rv-asidebar">
|
|
258
|
+
{open ? (
|
|
259
|
+
<>
|
|
260
|
+
<span className="rv-dim">set aside until</span>
|
|
261
|
+
{[['2h', 'in 2 h'], ['tomorrow', 'tomorrow 9:00'], ['next-week', 'next week']].map(([w, label]) => (
|
|
262
|
+
<button key={w} className="ghost" onMouseDown={keepFocus} onClick={() => void send(w!)}>{label}</button>
|
|
263
|
+
))}
|
|
264
|
+
<input type="datetime-local" value={date} onChange={(e) => setDate(e.target.value)} />
|
|
265
|
+
<button className="ghost" disabled={date === ''} onMouseDown={keepFocus} onClick={() => void send(date)}>set</button>
|
|
266
|
+
<button className="ghost" onClick={() => setOpen(false)}>✕</button>
|
|
267
|
+
</>
|
|
268
|
+
) : (
|
|
269
|
+
<button className="ghost" title="it leaves your turn and every count until then, and comes back by itself" onClick={() => setOpen(true)}>⏾ set aside</button>
|
|
270
|
+
)}
|
|
271
|
+
{err ? <span className="err">✗ {err}</span> : null}
|
|
272
|
+
</div>
|
|
273
|
+
)
|
|
274
|
+
})
|
|
275
|
+
|
|
141
276
|
/** the thread's current version pinned on top of its conversation: its number, its line, a click jumps to its cell */
|
|
142
277
|
const Current = observer(({ card }: { card: ThreadSt }) => {
|
|
143
278
|
const c = card.newest
|
|
@@ -197,7 +332,15 @@ const Cells = observer(({ rv, card }: { rv: ReviewSt; card: ThreadSt }) => {
|
|
|
197
332
|
const box = el.current
|
|
198
333
|
if (!jump || !box) return
|
|
199
334
|
const raf = requestAnimationFrame(() => {
|
|
200
|
-
box.querySelector<HTMLElement>(`#${jump}`)
|
|
335
|
+
const at = box.querySelector<HTMLElement>(`#${jump}`)
|
|
336
|
+
if (at) {
|
|
337
|
+
at.scrollIntoView({ behavior: 'smooth', block: 'start' })
|
|
338
|
+
// the dock's reminder jumped here: the place lights for one beat, a class of the page alone
|
|
339
|
+
at.classList.remove('lit')
|
|
340
|
+
void at.offsetWidth
|
|
341
|
+
at.classList.add('lit')
|
|
342
|
+
setTimeout(() => at.classList.remove('lit'), 1400)
|
|
343
|
+
}
|
|
201
344
|
card.jumped()
|
|
202
345
|
})
|
|
203
346
|
return () => cancelAnimationFrame(raf)
|
|
@@ -208,12 +351,13 @@ const Cells = observer(({ rv, card }: { rv: ReviewSt; card: ThreadSt }) => {
|
|
|
208
351
|
l.kind === 'day' ? (
|
|
209
352
|
<div key={`d${k}`} className="rv-day"><span>{l.day}</span></div>
|
|
210
353
|
) : l.kind === 'events' ? (
|
|
211
|
-
<
|
|
354
|
+
<TraceLines key={l.cells[0]!.id} rv={rv} card={card} cells={l.cells} />
|
|
212
355
|
) : (
|
|
213
|
-
<
|
|
356
|
+
<PaneBoundary key={l.cell.id} pane="message" at={l.cell.id}><CellFrame rv={rv} card={card} c={l.cell} cont={k > 0 && sameWho(card.lines[k - 1], l.cell.who)} /></PaneBoundary>
|
|
214
357
|
),
|
|
215
358
|
)}
|
|
216
359
|
{card.error ? <div className="rv-err rv-pre">{card.error}</div> : null}
|
|
360
|
+
<PaneBoundary pane="draft" at={card.data?.head ?? ''}><ThreadGroups rv={rv} view={card.data} /></PaneBoundary>
|
|
217
361
|
</div>
|
|
218
362
|
)
|
|
219
363
|
})
|
|
@@ -224,13 +368,10 @@ const sameWho = (prev: Line | undefined, who: string): boolean => prev?.kind ===
|
|
|
224
368
|
/** every item of the card, in the thread's order: each version and its views, each verdict, reply and note. A click
|
|
225
369
|
* unfolds it and scrolls there; a folded one reads dim */
|
|
226
370
|
const Contents = observer(({ rv, card }: { rv: ReviewSt; card: ThreadSt }) => (
|
|
227
|
-
<nav className="rv-contents" aria-label="every item of the
|
|
228
|
-
<
|
|
229
|
-
<b>contents</b>
|
|
230
|
-
<span className="rv-dim">{card.contents.length}</span>
|
|
231
|
-
<span className="sp" />
|
|
371
|
+
<nav className="rv-contents" aria-label="every item of the thread">
|
|
372
|
+
<SectionHead label="contents" n={card.contents.length}>
|
|
232
373
|
{rv.sheet ? <button className="ghost rv-x" aria-label="close" onClick={() => rv.closeSheet()}>✕</button> : null}
|
|
233
|
-
</
|
|
374
|
+
</SectionHead>
|
|
234
375
|
<ol>
|
|
235
376
|
{card.contents.map((e) => {
|
|
236
377
|
const c = card.cells.find((x) => x.id === e.cell)
|
|
@@ -274,7 +415,7 @@ export const Minimap = observer(({ card }: { card: ThreadSt }) => {
|
|
|
274
415
|
const target = card.head?.id
|
|
275
416
|
const marks = card.viewMarks
|
|
276
417
|
return (
|
|
277
|
-
<nav className="rv-mini row" aria-label="the
|
|
418
|
+
<nav className="rv-mini row" aria-label="the thread's versions, the views of the one you answer, the answers">
|
|
278
419
|
<Waiting card={card} />
|
|
279
420
|
{card.contents.filter((e) => e.kind !== 'view').map((e) => (
|
|
280
421
|
<span key={e.key} className="rv-minigroup">
|
|
@@ -308,7 +449,6 @@ const Composer = observer(({ rv, card }: { rv: ReviewSt; card: ThreadSt }) => {
|
|
|
308
449
|
const views = card.headItem?.views ?? []
|
|
309
450
|
const reactions = card.outgoingReactions
|
|
310
451
|
const verdicts = card.takesVerdict
|
|
311
|
-
const sent = h?.kind === 'version' ? card.chosenOn(h.id) : undefined
|
|
312
452
|
const newest = card.newest
|
|
313
453
|
const parked = card.parked === null ? null : card.versionOf(card.parked)
|
|
314
454
|
return (
|
|
@@ -328,15 +468,14 @@ const Composer = observer(({ rv, card }: { rv: ReviewSt; card: ThreadSt }) => {
|
|
|
328
468
|
</div>
|
|
329
469
|
) : null}
|
|
330
470
|
<div className="rv-goes">
|
|
331
|
-
<span className="rv-dim">{verdicts ?
|
|
332
|
-
{
|
|
333
|
-
{rv.phone.on ? null : <Listeners rv={rv} heads={[{ lane: v.lane, session: v.origin.by === 'agent' ? v.origin.session : undefined }]} />}
|
|
471
|
+
<span className="rv-dim">{verdicts || card.openRequests.some((c) => c.judge?.open) ? 'your word: a verdict on an item above sends it with that verdict, Reply sends it alone' : h?.kind === 'version' && h.item.wip ? 'a draft version: a word goes in a reply' : h?.kind === 'version' ? `nothing to judge here: ${card.openRequests.length > 0 ? 'answer above' : 'nothing waits on you'}, or a word goes in a reply` : 'your reply goes to this item'}</span>
|
|
472
|
+
{rv.phone.on || rv.openRow?.holder == null ? null : <span className="trmeta"><span className="trm trholder"><HolderChip rv={rv} holder={rv.openRow.holder} plain /></span></span>}
|
|
334
473
|
{d.pick !== undefined && n !== null ? <button className="rv-chip re-approved" onClick={() => card.reveal(h?.id ?? v.head, d.pick)}>✓ picked {viewTag(n, d.pick)} {viewName(views[d.pick], d.pick)}</button> : null}
|
|
335
474
|
{d.rects.length > 0 ? <button className="rv-chip rect" title="your draft notes: the verdict sends them" onClick={() => card.reveal(h?.id ?? v.head, d.rects[0]?.view ?? 0)}>⬚ {d.rects.length} draft note{d.rects.length > 1 ? 's' : ''}, sent with your verdict</button> : null}
|
|
336
475
|
{reactions.length > 0 ? <button className="rv-chip" onClick={() => card.reveal(h?.id ?? v.head, reactions[0]?.view)}>{reactions.length} reaction{reactions.length > 1 ? 's' : ''}</button> : null}
|
|
337
476
|
{card.dirty ? <button className="ghost rv-chip" title="drop the draft: your notes and your word" onClick={() => card.dropDraft()}>clear</button> : null}
|
|
338
477
|
</div>
|
|
339
|
-
<AutoText className="rv-reply" placeholder={rv.phone.on ? 'your word' :
|
|
478
|
+
<AutoText className="rv-reply" placeholder={rv.phone.on ? 'your word' : 'your word (⌘Enter sends it as a reply)'} value={d.comment}
|
|
340
479
|
onText={(t) => card.setComment(t)}
|
|
341
480
|
onKeyDown={(e) => {
|
|
342
481
|
if (e.key === 'Enter' && (e.metaKey || e.ctrlKey)) {
|
|
@@ -345,15 +484,7 @@ const Composer = observer(({ rv, card }: { rv: ReviewSt; card: ThreadSt }) => {
|
|
|
345
484
|
} else if (e.key === 'Escape') e.currentTarget.blur()
|
|
346
485
|
}} />
|
|
347
486
|
<div className="rv-acts">
|
|
348
|
-
{
|
|
349
|
-
? VERDICTS.map((x) => (
|
|
350
|
-
<button key={x.status} className={`rv-verdict ${toneOf(x.status)}${sent === x.status ? ' chosen' : ''}`} disabled={card.busy} onClick={() => void card.submit(x.status)}
|
|
351
|
-
title={sent === x.status ? `${x.label}: your answer now. Click again (${x.key}) to take it back, the card waits for you again` : `${x.label} (${x.key})`}>
|
|
352
|
-
{rv.phone.on ? x.short : <><span className="rv-vglyph">{x.glyph}</span> {x.short} ({x.key})</>}
|
|
353
|
-
{sent === x.status ? <span className="rv-undo" aria-label="click again to take it back"> ↺</span> : null}
|
|
354
|
-
</button>
|
|
355
|
-
))
|
|
356
|
-
: null}
|
|
487
|
+
{card.error ? <span className="err">✗ {card.error}</span> : null}
|
|
357
488
|
<span className="sp" />
|
|
358
489
|
<button className="primary rv-send" disabled={!d.comment.trim() || card.busy} title="send your word alone, as a reply (⌘Enter)" onClick={() => void card.sendReply()}>Reply</button>
|
|
359
490
|
</div>
|