rvlib-shipkit 2.31.0 → 2.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -0
- package/package.json +1 -1
- package/src/advisors/acts.ts +16 -15
- package/src/advisors/advice.ts +56 -102
- package/src/advisors/advisor-view.ts +98 -73
- package/src/advisors/app-graph.ts +1 -1
- package/src/advisors/app.ts +3 -11
- package/src/advisors/cf-api.ts +1 -1
- package/src/advisors/dir-bucket.ts +4 -3
- package/src/advisors/edge/api.ts +26 -198
- package/src/advisors/edge/bucket.ts +2 -2
- package/src/advisors/edge/handler.ts +13 -155
- package/src/advisors/edge/here.ts +5 -5
- package/src/advisors/edge/pages.ts +12 -9
- package/src/advisors/edge/shell.ts +6 -5
- package/src/advisors/edge/sign-in.ts +101 -36
- package/src/advisors/edge/status.ts +19 -6
- package/src/advisors/edge/types.ts +36 -60
- package/src/advisors/expose.ts +29 -29
- package/src/advisors/here.ts +12 -12
- package/src/advisors/invite-send.ts +79 -35
- package/src/advisors/invite.ts +31 -8
- package/src/advisors/job.ts +24 -16
- package/src/advisors/login.ts +40 -15
- package/src/advisors/owner-store.ts +46 -22
- package/src/advisors/photos.ts +3 -3
- package/src/advisors/project.ts +25 -23
- package/src/advisors/reach.ts +89 -0
- package/src/advisors/rights.ts +1 -1
- package/src/advisors/routes.ts +55 -74
- package/src/advisors/scan.ts +0 -4
- package/src/advisors/setup-run.ts +14 -14
- package/src/advisors/share-trace.ts +3 -3
- package/src/advisors/{door-probe.ts → sign-in-probe.ts} +7 -6
- package/src/advisors/speaks.ts +29 -0
- package/src/advisors/sync.ts +92 -182
- package/src/advisors/tunnel.ts +6 -5
- package/src/advisors/users-listen.ts +92 -0
- package/src/advisors/users-router.ts +257 -85
- package/src/advisors/users-store.ts +81 -0
- package/src/agent-time/blocked-scan.ts +181 -0
- package/src/agent-time/registry.ts +12 -5
- package/src/agent-time/store.ts +9 -109
- package/src/asks/ask-bar-fold.ts +2 -1
- package/src/asks/ask-close.ts +2 -1
- package/src/asks/ask-doc.ts +2 -1
- package/src/asks/ask-migrate.ts +3 -2
- package/src/asks/ask-steps-fold.ts +2 -1
- package/src/asks/ask-store.ts +4 -3
- package/src/check.ts +3 -43
- package/src/checks/SK001-package-json-shape.check.ts +4 -55
- package/src/checks/SK004-gitignore-policy.check.ts +24 -69
- package/src/checks/SK013-one-way-in-policy.check.ts +3 -7
- package/src/checks/SK017-vscode-hub-task.check.ts +4 -4
- package/src/checks/SK019-tests-run-in-units.check.ts +3 -14
- package/src/checks/SK020-self-spawning-check.check.ts +5 -7
- package/src/checks/SK035-public-clean.check.ts +1 -1
- package/src/checks/SK039-vscode-watch-generated.check.ts +1 -1
- package/src/checks/SK042-post-kinds.check.ts +5 -14
- package/src/checks/SK054-agent-allow-list.check.ts +5 -74
- package/src/checks/SK055-retired-config-keys.check.ts +45 -0
- package/src/cli/cmd_Advisors.ts +11 -45
- package/src/cli/cmd_Asks.ts +3 -10
- package/src/cli/cmd_Backup.ts +25 -127
- package/src/cli/cmd_BackupTargets.ts +1 -1
- package/src/cli/cmd_Checks.ts +0 -14
- package/src/cli/cmd_Db.ts +3 -82
- package/src/cli/cmd_Home.ts +4 -32
- package/src/cli/cmd_Hq.ts +0 -17
- package/src/cli/cmd_Releases.ts +57 -4
- package/src/cli/cmd_Review.ts +333 -354
- package/src/cli/cmd_SocialDrafts.ts +6 -13
- package/src/cli/cmd_ThreadSyncNeeds.ts +6 -2
- package/src/cli/cmd_Time.ts +1 -1
- package/src/cli/cmd_Trailer.ts +1 -1
- package/src/cli/inbox-hook-run.ts +5 -23
- package/src/cli/registry-heads.ts +5 -55
- package/src/cli/registry.ts +1 -5
- package/src/cli/review-here.ts +1 -1
- package/src/cli.ts +2 -2
- package/src/collections/collection-types.ts +1 -1
- package/src/collections/review.ts +5 -4
- package/src/core/agent-allow-policy.ts +32 -2
- package/src/core/agent-env.ts +8 -0
- package/src/core/allow-rows.ts +74 -0
- package/src/core/check-file-names.ts +19 -106
- package/src/core/footprint.ts +17 -13
- package/src/core/identities-root.ts +1 -4
- package/src/core/layout.ts +1 -2
- package/src/core/machine-db.ts +33 -208
- package/src/core/machine-layout.ts +14 -127
- package/src/core/mask-source.ts +60 -0
- package/src/core/memory-watch.ts +17 -14
- package/src/core/motherhome.ts +8 -35
- package/src/core/one-way-in-policy.ts +0 -3
- package/src/core/repo-walk.ts +0 -9
- package/src/core/retention.ts +1 -9
- package/src/core/retired-checks.ts +2 -0
- package/src/core/tmux-policy.ts +1 -1
- package/src/core/tree-watch.ts +2 -2
- package/src/core/when.ts +7 -45
- package/src/gate/discover-checks.ts +42 -32
- package/src/gate/gate-checks.ts +21 -131
- package/src/gate/pre-commit-discovery.ts +16 -25
- package/src/gate/run-check.ts +0 -4
- package/src/gate/run-fix.ts +5 -17
- package/src/gate/run-fixers.ts +6 -42
- package/src/home/app-sign.ts +2 -2
- package/src/home/backup-status.ts +52 -92
- package/src/home/backup-verdict.ts +2 -2
- package/src/home/daemon-jobs.ts +51 -95
- package/src/home/database-words.ts +1 -2
- package/src/home/databases.ts +9 -25
- package/src/home/home-launchd.ts +0 -6
- package/src/home/home-paths.ts +8 -4
- package/src/home/home-routes.ts +3 -10
- package/src/home/home-state.ts +2 -14
- package/src/home/inbox-shape.ts +14 -15
- package/src/home/inbox.ts +1 -1
- package/src/home/machine-repair.ts +102 -103
- package/src/home/resume.ts +1 -15
- package/src/home/run-daemon.ts +4 -11
- package/src/home/space-page.ts +3 -2
- package/src/home/supervise.ts +3 -7
- package/src/hooks/hook-config.ts +6 -7
- package/src/hooks/leak-guard.ts +1 -1
- package/src/hooks/run-hooks.ts +0 -5
- package/src/hq/daemon-db.ts +8 -8
- package/src/hq/door.ts +3 -16
- package/src/hq/hq-db.ts +4 -3
- package/src/hq/hq-local.ts +1 -2
- package/src/hq/hq-store.ts +0 -15
- package/src/hq/item-direct.ts +8 -10
- package/src/hq/item-fill.ts +37 -0
- package/src/hq/kinds/item-gone.ts +7 -10
- package/src/hq/kinds/item-msg.ts +12 -18
- package/src/hq/kinds/item.ts +13 -19
- package/src/hq/kinds/report.ts +3 -4
- package/src/hq/owner-switch.ts +3 -3
- package/src/hq/report.ts +5 -9
- package/src/hq/switch.ts +2 -11
- package/src/hq/thread-sync.ts +5 -17
- package/src/hq/{shapes-words.ts → threads-words.ts} +2 -12
- package/src/http/owner-word.ts +1 -1
- package/src/identities/machine.ts +16 -0
- package/src/init-repo.ts +0 -1
- package/src/ledger/check-stats.ts +6 -5
- package/src/ledger/db.ts +2 -4
- package/src/ledger/record-kept.ts +117 -48
- package/src/ledger/run-log.ts +21 -2
- package/src/ledger/slow-tests.ts +96 -0
- package/src/ledger/store.ts +3 -86
- package/src/ledger/suite-log.ts +8 -2
- package/src/media-store/backup/facts.ts +3 -37
- package/src/media-store/backup/keys.ts +1 -8
- package/src/media-store/backup/manifest.ts +6 -67
- package/src/media-store/backup/restore.ts +4 -13
- package/src/media-store/backup/retention.ts +13 -1
- package/src/media-store/backup/run.ts +6 -267
- package/src/media-store/backup/snapshot.ts +2 -38
- package/src/media-store/backup/sources.ts +3 -113
- package/src/media-store/backup/target-send.ts +5 -29
- package/src/media-store/db.ts +8 -7
- package/src/media-store/forget-one.ts +1 -1
- package/src/media-store/forget.ts +1 -80
- package/src/orchestrator/guards.ts +0 -1
- package/src/orchestrator/presence.ts +2 -2
- package/src/orchestrator/routes.ts +1 -1
- package/src/orchestrator/started.ts +0 -9
- package/src/orchestrator/talk-key.ts +3 -4
- package/src/orchestrator/unheard.ts +1 -1
- package/src/recordings/edit.ts +3 -3
- package/src/recordings/marks-draw.ts +17 -6
- package/src/recordings/marks.ts +120 -9
- package/src/reflections/reflections-queue.ts +3 -10
- package/src/release/notes.ts +1 -1
- package/src/release/public-clean.ts +66 -6
- package/src/release/run-bump.ts +11 -0
- package/src/release/run-release.ts +4 -0
- package/src/releases/from-thread.ts +3 -3
- package/src/releases/model.ts +186 -36
- package/src/releases/store.ts +13 -3
- package/src/releases/validate.ts +83 -0
- package/src/repo-config.ts +29 -64
- package/src/review/answer-kinds.ts +61 -4
- package/src/review/blocked-guard.ts +11 -0
- package/src/review/blocked-object.ts +298 -0
- package/src/review/cells.ts +116 -229
- package/src/review/close.ts +39 -1
- package/src/review/doc-save.ts +3 -2
- package/src/review/draft-item.ts +1 -1
- package/src/review/events.ts +3 -7
- package/src/review/expect.ts +23 -39
- package/src/review/format.ts +79 -46
- package/src/review/glyphs.ts +1 -0
- package/src/review/hand-over.ts +3 -3
- package/src/review/heard.ts +1 -1
- package/src/review/holds-sync.ts +2 -1
- package/src/review/inbox-hook.ts +2 -2
- package/src/review/inbox-read.ts +39 -33
- package/src/review/instruction-guards.ts +12 -0
- package/src/review/instructions.ts +0 -1
- package/src/review/item-db.ts +13 -43
- package/src/review/item-hq.ts +2 -2
- package/src/review/item-rows.ts +3 -14
- package/src/review/kind-catalog.ts +3 -1
- package/src/review/kinds.ts +18 -8
- package/src/review/live-view.ts +3 -0
- package/src/review/media-kind.ts +1 -1
- package/src/review/mentions.ts +1 -2
- package/src/review/model.ts +158 -114
- package/src/review/move.ts +149 -0
- package/src/review/need-threads.ts +3 -2
- package/src/review/object-card.ts +11 -0
- package/src/review/object-read.ts +6 -1
- package/src/review/one-block.ts +1 -1
- package/src/review/owner-read.ts +1 -1
- package/src/review/phone-push.ts +10 -9
- package/src/review/previews.ts +32 -4
- package/src/review/push.ts +2 -2
- package/src/review/recap.ts +129 -0
- package/src/review/referring.ts +6 -3
- package/src/review/reflection-object.ts +4 -3
- package/src/review/routes.ts +49 -19
- package/src/review/secret-route.ts +3 -2
- package/src/review/settle.ts +0 -6
- package/src/review/snooze.ts +5 -3
- package/src/review/speaker.ts +68 -0
- package/src/review/start-title.ts +19 -0
- package/src/review/store.ts +86 -59
- package/src/review/{wakes.ts → thread-events.ts} +92 -7
- package/src/review/thread-md.ts +35 -14
- package/src/review/thread-state.ts +798 -0
- package/src/review/threads.ts +29 -347
- package/src/review/traces.ts +104 -7
- package/src/review/trailer-item.ts +1 -1
- package/src/review/unit.ts +7 -9
- package/src/review/verdict-items.ts +12 -10
- package/src/review/view-layout.ts +25 -1
- package/src/review/watch-feed.ts +1 -2
- package/src/review/working-guards.ts +2 -3
- package/src/rules/untrack-generated.ts +1 -15
- package/src/secrets/lapse.ts +2 -1
- package/src/serve/hub-app/advisor-app.tsx +4 -4
- package/src/serve/hub-app/advisor-face.tsx +9 -3
- package/src/serve/hub-app/advisor-host.ts +27 -27
- package/src/serve/hub-app/advisors-model.ts +17 -8
- package/src/serve/hub-app/advisors-rights.tsx +1 -1
- package/src/serve/hub-app/advisors-st.ts +15 -14
- package/src/serve/hub-app/advisors-view.tsx +13 -11
- package/src/serve/hub-app/app-bridge.ts +23 -3
- package/src/serve/hub-app/asks-page.tsx +1 -1
- package/src/serve/hub-app/auto-text.tsx +71 -16
- package/src/serve/hub-app/check-view.tsx +0 -8
- package/src/serve/hub-app/controls.css +14 -3
- package/src/serve/hub-app/database-view.tsx +1 -2
- package/src/serve/hub-app/git-view.tsx +3 -1
- package/src/serve/hub-app/hub.css +12 -5
- package/src/serve/hub-app/icons.tsx +1 -1
- package/src/serve/hub-app/inbox-view.tsx +1 -2
- package/src/serve/hub-app/live-sources.ts +2 -2
- package/src/serve/hub-app/main-panel.tsx +2 -1
- package/src/serve/hub-app/panel-repo.ts +0 -9
- package/src/serve/hub-app/pic.tsx +29 -12
- package/src/serve/hub-app/polled.ts +16 -2
- package/src/serve/hub-app/recordings-st.ts +23 -2
- package/src/serve/hub-app/recordings-view.tsx +68 -10
- package/src/serve/hub-app/ref-pill.ts +1 -1
- package/src/serve/hub-app/repo-st.ts +1 -2
- package/src/serve/hub-app/review/advisor-add.tsx +1 -1
- package/src/serve/hub-app/review/advisor-invite.tsx +1 -1
- package/src/serve/hub-app/review/draft-body.tsx +2 -2
- package/src/serve/hub-app/review/heard-line.tsx +1 -1
- package/src/serve/hub-app/review/instructions-view.tsx +1 -8
- package/src/serve/hub-app/review/kind-states.tsx +14 -9
- package/src/serve/hub-app/review/kit.tsx +4 -11
- package/src/serve/hub-app/review/lane-bar.tsx +3 -3
- package/src/serve/hub-app/review/lightbox.tsx +15 -11
- package/src/serve/hub-app/review/line-window.ts +4 -1
- package/src/serve/hub-app/review/live-bar-st.ts +2 -2
- package/src/serve/hub-app/review/live-view.tsx +57 -1
- package/src/serve/hub-app/review/object-panel.tsx +20 -8
- package/src/serve/hub-app/review/question-views.tsx +181 -54
- package/src/serve/hub-app/review/recap-bar.tsx +40 -0
- package/src/serve/hub-app/review/request-cell.tsx +48 -0
- package/src/serve/hub-app/review/review-cells.tsx +154 -96
- package/src/serve/hub-app/review/review-host.ts +2 -2
- package/src/serve/hub-app/review/review-kit.ts +17 -11
- package/src/serve/hub-app/review/review-list.tsx +23 -31
- package/src/serve/hub-app/review/review-st.ts +30 -40
- package/src/serve/hub-app/review/review-thread.tsx +139 -85
- package/src/serve/hub-app/review/review-views.tsx +124 -68
- package/src/serve/hub-app/review/share-lines.tsx +4 -4
- package/src/serve/hub-app/review/start-st.ts +2 -5
- package/src/serve/hub-app/review/superseded-runs.ts +4 -3
- package/src/serve/hub-app/review/thread-close.tsx +10 -7
- package/src/serve/hub-app/review/thread-st.ts +372 -201
- package/src/serve/hub-app/review/tone-bar.tsx +126 -0
- package/src/serve/hub-app/review/tones.ts +35 -0
- package/src/serve/hub-app/review/trailer-body.tsx +2 -2
- package/src/serve/hub-app/review/trailer-st.ts +3 -2
- package/src/serve/hub-app/review/trailer-voices-st.ts +3 -2
- package/src/serve/hub-app/review.css +180 -106
- package/src/serve/hub-app/search-view.tsx +1 -1
- package/src/serve/hub-app/social/social-model.ts +0 -4
- package/src/serve/hub-app/source-acts.ts +2 -1
- package/src/serve/hub-app/stores/stores-page.tsx +2 -2
- package/src/serve/hub-app/terminal-sources.tsx +2 -1
- package/src/serve/hub-app/thread-row.tsx +3 -4
- package/src/serve/hub-app/tree-build.ts +0 -4
- package/src/serve/hub-app/urls-view.tsx +2 -1
- package/src/serve/hub-app/view-layout.css +13 -3
- package/src/serve/hub-app/wikis-view.tsx +5 -2
- package/src/serve/hub-runtime.ts +7 -37
- package/src/serve/project-gutter-route.ts +6 -2
- package/src/serve/read-thread.ts +20 -2
- package/src/serve/read-worker.ts +9 -1
- package/src/serve/record-pages.ts +46 -0
- package/src/serve/serve-hub.ts +2 -2
- package/src/serve/terminal-host.ts +1 -1
- package/src/serve/terminal-route.ts +1 -3
- package/src/serve/tracked-watch.ts +1 -3
- package/src/setup-house.ts +2 -2
- package/src/shipkit-files.ts +1 -1
- package/src/shipkit.ts +1 -6
- package/src/shot/film-box.ts +0 -20
- package/src/social/drafts.ts +1 -1
- package/src/social/kinds.ts +6 -29
- package/src/social/load.ts +2 -2
- package/src/social/post-object.ts +3 -2
- package/src/social/release-stage.ts +1 -1
- package/src/social/stage.ts +2 -2
- package/src/stores/model.ts +4 -0
- package/src/stores/routes.ts +11 -3
- package/src/suite/judge-suites.ts +58 -0
- package/src/suite/red-alone.ts +54 -18
- package/src/suite/runner-shapes.ts +2 -2
- package/src/suite/suite-cli.ts +67 -14
- package/src/suite/test-units.ts +2 -1
- package/src/urls/fill.ts +1 -1
- package/src/urls/places.ts +1 -2
- package/src/vault/vault-config.ts +2 -2
- package/src/vault/vault-init.ts +1 -5
- package/src/wiki/graph-page.ts +14 -2
- package/src/advisors/copy-truth.ts +0 -49
- package/src/advisors/door-child.ts +0 -112
- package/src/advisors/door-serve.ts +0 -52
- package/src/advisors/door.ts +0 -118
- package/src/checks/SK016-legacy-check-shapes.check.ts +0 -189
- package/src/checks/SK029-explicit-check-files.check.ts +0 -112
- package/src/checks/SK048-one-local-file.check.ts +0 -36
- package/src/core/config-rewrite.ts +0 -111
- package/src/core/daemon-port.ts +0 -10
- package/src/core/legacy-shapes.ts +0 -263
- package/src/core/migrate-layout.ts +0 -638
- package/src/core/port-check-cli.ts +0 -52
- package/src/core/port-check-file.ts +0 -295
- package/src/core/port-check-files.ts +0 -31
- package/src/gate/discover-legacy-checks.ts +0 -26
- package/src/home/home-move.ts +0 -527
- package/src/home/machine-fold.ts +0 -810
- package/src/hq/item-shapes.ts +0 -54
- package/src/hq/kinds/items-read.ts +0 -4
- package/src/media-store/backup/daemon.ts +0 -220
- package/src/media-store/backup/kept.ts +0 -241
- package/src/media-store/backup/prune.ts +0 -359
- package/src/media-store/backup/secret.ts +0 -88
- package/src/media-store/backup/ssh-space.ts +0 -202
- package/src/media-store/backup/watch.ts +0 -117
- package/src/review/band.ts +0 -182
- package/src/review/folders.ts +0 -216
- package/src/review/hook-ask.ts +0 -58
- package/src/review/role.ts +0 -48
- package/src/review/thread-fold.ts +0 -64
- package/src/review/wait.ts +0 -91
- package/src/rules/rule.ts +0 -43
- package/src/serve/hook-thread.ts +0 -37
- package/src/serve/hook-work.ts +0 -92
- package/src/serve/hook-worker.ts +0 -57
- package/src/serve/hub-app/review/dock.tsx +0 -147
- package/src/serve/hub-app/review/faces.tsx +0 -18
- package/src/serve/hub-app/review/item-verdict.tsx +0 -112
- package/src/serve/hub-app/review/review-board.tsx +0 -48
- /package/src/{scaffold → core}/jsonc-spans.ts +0 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// « recap » on a thread's head (wiki tools/shipkit/threads.md, A recap): the owner's request, posted in the thread for the
|
|
2
|
+
// agent that holds it, never a recap written here. While it stands, or while a recap waits on the owner's verdict, it says so
|
|
3
|
+
import { observer } from 'mobx-react-lite'
|
|
4
|
+
import { useState } from 'react'
|
|
5
|
+
import { HeadBtn } from './kit.tsx'
|
|
6
|
+
import { postJson } from './review-kit.ts'
|
|
7
|
+
import type { ReviewSt } from './review-st.ts'
|
|
8
|
+
import { tip } from '../tips.ts'
|
|
9
|
+
import type { ThreadSt } from './thread-st.ts'
|
|
10
|
+
|
|
11
|
+
/** `menu`: drawn as a row of the head's « more » popover, `done` closes it */
|
|
12
|
+
export const RecapBar = observer(({ rv, thread, menu }: { rv: ReviewSt; thread: ThreadSt; menu?: { done: () => void } }) => {
|
|
13
|
+
const v = thread.data
|
|
14
|
+
const [busy, setBusy] = useState(false)
|
|
15
|
+
const [err, setErr] = useState<string | null>(null)
|
|
16
|
+
if (!v) return null
|
|
17
|
+
const r = v.state.recap
|
|
18
|
+
if (r?.waits) return <span className="rv-recapbar on" role="status" {...tip('the recap waits on your verdict, in the thread: accepted, the thread reads from it on')}>▤ recap to judge</span>
|
|
19
|
+
if (r?.asked) return <span className="rv-recapbar on" role="status" {...tip('your request waits for the agent that holds the thread')}>▤ recap asked</span>
|
|
20
|
+
const ask = async (): Promise<void> => {
|
|
21
|
+
setBusy(true)
|
|
22
|
+
setErr(null)
|
|
23
|
+
try {
|
|
24
|
+
await postJson(rv.url(`/api/review/${v.head}/recap`), {})
|
|
25
|
+
await thread.refresh()
|
|
26
|
+
void rv.answered()
|
|
27
|
+
} catch (e) {
|
|
28
|
+
setErr((e as Error).message)
|
|
29
|
+
} finally {
|
|
30
|
+
setBusy(false)
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
if (menu) return <button type="button" className="rv-menuitem" disabled={busy} {...tip('ask the agent that holds it for a recap you judge: once you accept it, the thread reads from it on')} onClick={() => { menu.done(); void ask() }}>▤ ask for a recap</button>
|
|
34
|
+
return (
|
|
35
|
+
<span className="rv-recapbar">
|
|
36
|
+
<HeadBtn className="rv-quiet" disabled={busy} says="recap" more="ask the agent that holds it for a recap you judge: once you accept it, the thread reads from it on, the history one click away" onClick={() => void ask()}>▤<span className="rv-btnw"> recap</span></HeadBtn>
|
|
37
|
+
{err ? <span className="err">✗ {err}</span> : null}
|
|
38
|
+
</span>
|
|
39
|
+
)
|
|
40
|
+
})
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// a question, a proposed change or an ask's instructions at its place in the timeline (wiki tools/shipkit/threads-page.md,
|
|
2
|
+
// The timeline): the item whole, its words wrapped and its controls under them (a question's options with the agent's
|
|
3
|
+
// pick, an ask's instructions with their boxes, a checklist, a field, a secret). Nothing sits between the timeline and his
|
|
4
|
+
// reply box: the arrows at the column's top count what waits above
|
|
5
|
+
import { observer } from 'mobx-react-lite'
|
|
6
|
+
import type { ReplyCell } from '../../../review/cells.ts'
|
|
7
|
+
import { AskBody, ProposeBody, RowsBody } from './question-views.tsx'
|
|
8
|
+
import { InstructionsBody } from './instructions-view.tsx'
|
|
9
|
+
import { Cta } from './cta.tsx'
|
|
10
|
+
import { Words } from '../words.tsx'
|
|
11
|
+
import type { ReviewSt } from './review-st.ts'
|
|
12
|
+
import { requestState, type ThreadSt } from './thread-st.ts'
|
|
13
|
+
|
|
14
|
+
/** the question or the change itself, as it answers */
|
|
15
|
+
const RequestBody = observer(({ rv, thread, c }: { rv: ReviewSt; thread: ThreadSt; c: ReplyCell }) =>
|
|
16
|
+
c.ask?.row ? <RowsBody rv={rv} thread={thread} c={c} /> : c.ask ? <AskBody rv={rv} thread={thread} c={c} ask={c.ask} /> : c.propose ? <ProposeBody rv={rv} thread={thread} c={c} p={c.propose} /> : null,
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
/** a question or a change at its place in the timeline, where he answers it: whole, its words wrapped and its controls
|
|
20
|
+
* under them; an ask's instructions with a box on each step; once answered, his answer in its control. Superseded: read
|
|
21
|
+
* only. Its words go read with the thread (review/owner-read.ts) */
|
|
22
|
+
export const RequestCell = observer(({ rv, thread, c }: { rv: ReviewSt; thread: ThreadSt; c: ReplyCell }) => {
|
|
23
|
+
if (c.instructions && c.ask) return <InstructionsBody rv={rv} thread={thread} c={c} live={!c.superseded} />
|
|
24
|
+
// a question with a row per thing waits by its first row while any row does (ThreadSt.openRequests)
|
|
25
|
+
const waiting = thread.waitsNow(c.id)
|
|
26
|
+
// answered, it keeps its layout: the owner's answer draws in place, in its control (the option lit, « ✓ given », the owner's words),
|
|
27
|
+
// never moved or said again over the question; the green edge says answered, the trace line under it records it
|
|
28
|
+
return (
|
|
29
|
+
<div className={`rv-requestcell ${requestState(c, waiting)}`}>
|
|
30
|
+
{/* asked before the close and never answered: it waits on nobody (review/thread-state.ts mootAt) */}
|
|
31
|
+
{!c.superseded && !waiting && c.moot ? (
|
|
32
|
+
<div className="rv-requestline">
|
|
33
|
+
<span className="rv-requestanswer">closed, not answered</span>
|
|
34
|
+
</div>
|
|
35
|
+
) : null}
|
|
36
|
+
{c.text.trim() !== '' ? <Words text={c.text} className="rv-words" /> : null}
|
|
37
|
+
{c.superseded ? (
|
|
38
|
+
<fieldset disabled className="rv-readonly">
|
|
39
|
+
<RequestBody rv={rv} thread={thread} c={c} />
|
|
40
|
+
</fieldset>
|
|
41
|
+
) : (
|
|
42
|
+
<Cta on={waiting}>
|
|
43
|
+
<RequestBody rv={rv} thread={thread} c={c} />
|
|
44
|
+
</Cta>
|
|
45
|
+
)}
|
|
46
|
+
</div>
|
|
47
|
+
)
|
|
48
|
+
})
|
|
@@ -2,15 +2,14 @@
|
|
|
2
2
|
// the kind, `v2`, fold, copy its content, ⇧ its id), then the body, or one line of summary when folded. A folded cell draws no media.
|
|
3
3
|
// A version holds its words and its views, a verdict points back at the version it judged and lists his notes (a
|
|
4
4
|
// click shows the view they sit on), a reply and a note are words, a question or a change whole with its controls, where
|
|
5
|
-
// he answers it (
|
|
5
|
+
// he answers it (request-cell.tsx); a run of state changes is one thin line
|
|
6
6
|
import { observer } from 'mobx-react-lite'
|
|
7
|
-
import type
|
|
8
|
-
import { agentWords, bandOf } from '../../../review/band.ts'
|
|
7
|
+
import { raisedStill, type Backlink, type NoteCell, type ReplyCell, type VerdictCell, type VersionCell } from '../../../review/cells.ts'
|
|
9
8
|
import { refPillHtml } from '../ref-pill.ts'
|
|
10
9
|
import { MESSAGE_TYPES } from '../../../review/glyphs.ts'
|
|
11
10
|
import { kindOf } from '../../../review/kinds.ts'
|
|
12
11
|
import { actorName } from '../../../review/parties.ts'
|
|
13
|
-
import { traceWords } from '../../../review/traces.ts'
|
|
12
|
+
import { quietOf, traceWords } from '../../../review/traces.ts'
|
|
14
13
|
import { NO_SPEC, verdictLabel, isDraftItem, isGallery, isTrailerItem, postLabel, STATUS_LABEL, thumbFileOf, UPDATE_WORDS, viewName, viewTag, type Item, type Rect, type ItemTrailer } from '../../../review/model.ts'
|
|
15
14
|
import { Caret, Icon, ICON } from '../icons.tsx'
|
|
16
15
|
import { renderMd } from '../md.ts'
|
|
@@ -19,18 +18,17 @@ import { Age, stampWords } from '../time-ago.tsx'
|
|
|
19
18
|
import { KindView } from './kind-view.tsx'
|
|
20
19
|
import { editRows, Hunk } from './diff-view.tsx'
|
|
21
20
|
import { cellCopy } from '../../../review/cell-copy.ts'
|
|
22
|
-
import { keepFocus,
|
|
21
|
+
import { keepFocus, REACTIONS, secs, SIDE_LABEL, toneOf } from './kit.tsx'
|
|
22
|
+
import { glyphOf } from './tones.ts'
|
|
23
23
|
import type { ReviewSt } from './review-st.ts'
|
|
24
24
|
import { ADVISOR_WHO } from './review-host.ts'
|
|
25
25
|
import { VersionViews, ViewCell } from './review-views.tsx'
|
|
26
|
-
import { cellDom, viewKind, type Framed, type ThreadSt, type Traced } from './thread-st.ts'
|
|
26
|
+
import { cellDom, quietKey, traceRunsOf, viewKind, type Framed, type ThreadSt, type Traced, type TraceRun } from './thread-st.ts'
|
|
27
27
|
import { DraftItemBody } from './draft-body.tsx'
|
|
28
28
|
import { KindStates } from './kind-states.tsx'
|
|
29
29
|
import { DocBody } from './doc-body.tsx'
|
|
30
|
-
import { RequestCell } from './
|
|
31
|
-
import {
|
|
32
|
-
import { Face } from './faces.tsx'
|
|
33
|
-
import { isItemVerdict } from '../../../review/verdict-items.ts'
|
|
30
|
+
import { RequestCell } from './request-cell.tsx'
|
|
31
|
+
import { ToneBar } from './tone-bar.tsx'
|
|
34
32
|
import { versionActs } from '../../../review/settle.ts'
|
|
35
33
|
import { AddressChip, CellGlyph, ObjectCard } from './object-panel.tsx'
|
|
36
34
|
import { NoteMeta, NoteStill, TrailerItemBody } from './trailer-body.tsx'
|
|
@@ -41,10 +39,11 @@ import { MessageWords } from './attach-view.tsx'
|
|
|
41
39
|
import { UnreadDot } from '../thread-row.tsx'
|
|
42
40
|
import { tip } from '../tips.ts'
|
|
43
41
|
import { AdvisorFace, faceColour } from '../advisor-face.tsx'
|
|
44
|
-
import type
|
|
42
|
+
import { Fragment, type CSSProperties, type ReactNode } from 'react'
|
|
45
43
|
import { ShareActs } from './share-lines.tsx'
|
|
46
44
|
import type { ShareEvent } from '../../../advisors/share-trace.ts'
|
|
47
45
|
import { findLast } from '../../../core/es2022.ts'
|
|
46
|
+
import { agentWords, bandOf } from '../../../review/thread-state.ts'
|
|
48
47
|
|
|
49
48
|
/** who a cell is from, as its header and its trace say it: you, a player, the agent's lane, a session's own act by
|
|
50
49
|
* its session (`<repo> main`) */
|
|
@@ -53,24 +52,64 @@ const whoWords = (rv: ReviewSt, c: { who: string; session?: string; advisor?: {
|
|
|
53
52
|
/** an agent that named no lane: « agent », or « agent 66573d » after its session */
|
|
54
53
|
const anonymous = (who: string): boolean => who === 'agent' || who.startsWith('agent ')
|
|
55
54
|
|
|
56
|
-
/**
|
|
57
|
-
|
|
58
|
-
const
|
|
55
|
+
/** the most letters a mark prints: his own word in his disc, a lane's name under the agents' mark */
|
|
56
|
+
const MARK_LETTERS = 4
|
|
57
|
+
const LANE_LETTERS = 5
|
|
59
58
|
|
|
60
|
-
/**
|
|
59
|
+
/** the words an avatar prints whole, so the head never says them again; null when it prints none of them (a photo, a
|
|
60
|
+
* person's initials, a player's « P », the mark of an agent that named no lane) or cuts them */
|
|
61
|
+
const avatarSays = (who: string, mine: string | null, photo: boolean): string | null =>
|
|
62
|
+
photo ? null : mine !== null ? (mine.length <= MARK_LETTERS ? mine : null) : who === 'player' || anonymous(who) ? null : who.length <= LANE_LETTERS ? who : null
|
|
63
|
+
|
|
64
|
+
/** a round mark of who speaks: his own photo or word, a player's, the agents' mark with the lane's name in small
|
|
65
|
+
* letters under it (every lane the same mark, never a colour of its own: a person's colour is never a lane's), or a
|
|
66
|
+
* neutral mark for an agent that named no lane. `mine`: the reader's or the owner's name, the reader's own side of the
|
|
67
|
+
* thread (ReviewSt.whoWord) */
|
|
61
68
|
const Avatar = ({ who, name, mine: word, photo }: { who: string; name: string; mine: string | null; photo: string | null }) => {
|
|
62
69
|
const mine = word !== null
|
|
63
70
|
if (photo !== null) return <span className="rv-avatar mine" {...tip(name)}><img src={photo} alt="" width="100%" height="100%" style={{ objectFit: 'cover' }} draggable={false} /></span>
|
|
64
71
|
const player = who === 'player'
|
|
65
72
|
const anon = anonymous(who)
|
|
73
|
+
if (!mine && !player && !anon)
|
|
74
|
+
return (
|
|
75
|
+
<>
|
|
76
|
+
<span className="rv-avatar agent" {...tip(`${name}: an agent's lane`)}><AgentMark /></span>
|
|
77
|
+
<span className="rv-avatarname" aria-hidden="true">{who.slice(0, LANE_LETTERS)}</span>
|
|
78
|
+
</>
|
|
79
|
+
)
|
|
66
80
|
const says = anon ? `${name}: ${name === who ? 'an agent that named no lane' : 'a session, no lane'}` : name
|
|
67
81
|
return (
|
|
68
|
-
<span className={`rv-avatar${mine ? ' mine' : player ? ' player' :
|
|
69
|
-
{
|
|
82
|
+
<span className={`rv-avatar${mine ? ' mine' : player ? ' player' : ' anon'}`} {...tip(says)}>
|
|
83
|
+
{mine ? word.slice(0, MARK_LETTERS) : player ? 'P' : '⚙'}
|
|
70
84
|
</span>
|
|
71
85
|
)
|
|
72
86
|
}
|
|
73
87
|
|
|
88
|
+
/** the agents' mark: a spark of twelve rays, long and short, drawn in the agents' colour (hub.css `--agent`) */
|
|
89
|
+
const SPARK = Array.from({ length: 12 }, (_, k) => {
|
|
90
|
+
const a = (k * Math.PI) / 6
|
|
91
|
+
const r = k % 2 === 0 ? 9.6 : 7
|
|
92
|
+
const at = (d: number): string => `${(12 + d * Math.cos(a)).toFixed(2)} ${(12 + d * Math.sin(a)).toFixed(2)}`
|
|
93
|
+
return `M${at(2.4)}L${at(r)}`
|
|
94
|
+
}).join('')
|
|
95
|
+
|
|
96
|
+
export const AgentMark = () => (
|
|
97
|
+
<svg className="rv-agentmark" viewBox="0 0 24 24" aria-hidden="true">
|
|
98
|
+
<path d={SPARK} />
|
|
99
|
+
</svg>
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
/** a message's kind in words where the icon alone does not say it: a version's number, an update's, an edit; null
|
|
103
|
+
* where the word is the icon's own name (« question », « reply »), said by its tip */
|
|
104
|
+
const kindWords = (c: Framed): string | null => {
|
|
105
|
+
if (c.kind === 'version') return c.superseded ? null : `v${c.n}`
|
|
106
|
+
if (c.kind !== 'reply') return null
|
|
107
|
+
if (c.edit) return 'edited'
|
|
108
|
+
if (c.update) return `#${c.update.k}`
|
|
109
|
+
// a hint says « ↑ on update 1 » in its bubble, its link to the update
|
|
110
|
+
return null
|
|
111
|
+
}
|
|
112
|
+
|
|
74
113
|
/** a person's own colour on their words (an advisor's, from their name), never the owner's: the side of the thread is
|
|
75
114
|
* the same, the face and the ink are theirs. The owner's words keep his (review.css `.p-owner`) */
|
|
76
115
|
export const personInk = (rv: ReviewSt, c: { who: string; advisor?: { name: string } }): CSSProperties | undefined => {
|
|
@@ -99,52 +138,51 @@ export const CellFrame = observer(({ rv, thread, c, cont }: { rv: ReviewSt; thre
|
|
|
99
138
|
const copySays = cellCopy(c).says
|
|
100
139
|
const sending = outboxOf(c)
|
|
101
140
|
const tone = c.kind === 'version' ? toneOf(c.status) : c.kind === 'verdict' ? toneOf(c.verdict) : c.kind === 'reply' && c.update ? `upd up-${c.update.state}` : ''
|
|
141
|
+
const photo = c.who === ADVISOR_WHO ? (rv.host.photo ?? null) : c.who === 'owner' ? (rv.host.ownerPhoto ?? null) : null
|
|
142
|
+
// what the avatar prints whole is never said again over the bubble; a person's face prints initials
|
|
143
|
+
const named = c.advisor !== undefined || (c.who === ADVISOR_WHO && rv.host.readerName !== undefined) ? null : avatarSays(c.who, rv.whoWord(c.who), photo !== null)
|
|
144
|
+
const kind = kindWords(c)
|
|
102
145
|
return (
|
|
103
146
|
<article id={cellDom(c.id)} data-unread={unread ? c.id : undefined} className={`rv-c k-${c.kind} p-${c.party}${open ? '' : ' folded'}${head ? ' head' : ''}${thread.beside === c.id ? ' beside' : ''}${cont ? ' cont' : ''}${c.superseded ? ' superseded' : ''} ${tone}`} style={personInk(rv, c)}>
|
|
104
|
-
{/* the side column: who speaks
|
|
105
|
-
one scrolls: a version's, or a message's (view-layout.ts LAYOUT asks-verdict) */}
|
|
147
|
+
{/* the side column: who speaks */}
|
|
106
148
|
<div className="rv-cside">
|
|
107
149
|
{c.advisor !== undefined ? (
|
|
108
150
|
<span className="rv-avatar adv" {...tip(c.advisor.name)}><AdvisorFace name={c.advisor.name} src={rv.host.owner?.home.advisors.faceOf(c.advisor.id) ?? null} px={28} /></span>
|
|
109
151
|
) : c.who === ADVISOR_WHO && rv.host.readerName !== undefined ? (
|
|
110
152
|
<span className="rv-avatar adv" {...tip(rv.host.readerName)}><AdvisorFace name={rv.host.readerName} src={rv.host.photo ?? null} px={28} /></span>
|
|
111
153
|
) : (
|
|
112
|
-
<Avatar who={c.who} name={whoWords(rv, c)} mine={rv.whoWord(c.who)} photo={
|
|
154
|
+
<Avatar who={c.who} name={whoWords(rv, c)} mine={rv.whoWord(c.who)} photo={photo} />
|
|
113
155
|
)}
|
|
114
|
-
{open && c.kind === 'version' && asksVersionVerdict(thread, c) ? (
|
|
115
|
-
<aside className="rv-vgutter" aria-label="your verdict">
|
|
116
|
-
<ItemVerdict thread={thread} version={c.id} />
|
|
117
|
-
</aside>
|
|
118
|
-
) : open && c.kind === 'reply' && asksReplyVerdict(c) ? (
|
|
119
|
-
<aside className="rv-vgutter" aria-label="your verdict">
|
|
120
|
-
<ItemVerdict thread={thread} cell={c} />
|
|
121
|
-
</aside>
|
|
122
|
-
) : null}
|
|
123
156
|
</div>
|
|
124
157
|
<div className="rv-msg">
|
|
158
|
+
{/* the head on the bubble's top edge, never a row of its own: who where the avatar does not print it, the
|
|
159
|
+
kind once (its icon, a word only where the icon does not say it), the time, the tools on a hover */}
|
|
125
160
|
<header className="rv-chead" onClick={() => thread.toggleCell(c)}>
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
<
|
|
141
|
-
|
|
142
|
-
<
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
161
|
+
<span className="rv-cline">
|
|
162
|
+
{sending !== undefined ? null : <button className="rv-foldbtn" {...tip(open ? 'fold this message to one line' : 'open this message whole')} aria-label={open ? 'fold' : 'unfold'} aria-expanded={open} onMouseDown={keepFocus} onClick={(e) => { e.stopPropagation(); thread.toggleCell(c) }}><Caret open={open} /></button>}
|
|
163
|
+
{cont || named === whoWords(rv, c) ? null : <b className="rv-cwho">{whoWords(rv, c)}</b>}
|
|
164
|
+
<CellGlyph rv={rv} c={c} />
|
|
165
|
+
{kind !== null ? <span className="rv-ckind">{kind}</span> : null}
|
|
166
|
+
{c.kind === 'version' ? <span className="rv-cstate">{(thread.sending?.on === c.id ? (rv.host.role === 'advisor' && thread.sending.status !== null ? 'sending…' : verdictLabel(c.item, thread.sending.status ?? 'pending')) : c.id === thread.head?.id && thread.data?.state.next ? 'replaced soon' : c.label).toLowerCase()}</span> : null}
|
|
167
|
+
{c.kind === 'reply' && c.update ? <span className={`rv-badge rv-up up-${c.update.state}`}>{UPDATE_WORDS[c.update.state]}</span> : null}
|
|
168
|
+
{c.kind === 'verdict' ? (
|
|
169
|
+
<button className="rv-on ghost" {...tip(c.n > 0 ? `scroll up to v${c.n}, the version this verdict answers, and light it` : 'scroll up to the note this verdict answers and light it')} onMouseDown={keepFocus} onClick={(e) => { e.stopPropagation(); thread.reveal(c.on) }}>↑ on {c.n > 0 ? `v${c.n}` : 'the note'}</button>
|
|
170
|
+
) : c.kind !== 'version' && c.on !== c.id && c.on !== thread.data?.head ? (
|
|
171
|
+
<button className="rv-on ghost" {...tip('scroll up to the item this was said on and light it')} onMouseDown={keepFocus} onClick={(e) => { e.stopPropagation(); thread.reveal(c.on) }}>↑ on {onWords(thread, c.on)}</button>
|
|
172
|
+
) : null}
|
|
173
|
+
{head && c.kind === 'version' && (thread.sending?.on === c.id ? thread.sending.status === null : c.status === 'pending') ? <span className="rv-headtag" {...tip('your verdict and your reply go to this one')}>answer here</span> : null}
|
|
174
|
+
{unread ? <UnreadDot className="rv-unread" /> : null}
|
|
175
|
+
<When rv={rv} at={c.at} />
|
|
176
|
+
{thread.deleteAsk === c.id ? (
|
|
177
|
+
<span className="rv-delask" role="alertdialog" aria-label="delete this message" onClick={(e) => e.stopPropagation()}>
|
|
178
|
+
delete this message for everyone ?
|
|
179
|
+
<button type="button" className="rv-act danger" data-check="delete-confirm" autoFocus {...tip('delete it: gone from the thread for everyone', 'Enter')} onMouseDown={keepFocus} onClick={() => void thread.deleteMessage(c)} onKeyDown={(e) => { if (e.key === 'Escape') thread.askDelete(null) }}>delete</button>
|
|
180
|
+
<button type="button" className="ghost" {...tip('keep it: nothing changes', 'Esc')} onMouseDown={keepFocus} onClick={() => thread.askDelete(null)}>keep</button>
|
|
181
|
+
</span>
|
|
182
|
+
) : null}
|
|
183
|
+
</span>
|
|
184
|
+
<span className="sp" />
|
|
146
185
|
{sending !== undefined ? null : <span className="rv-ctools">
|
|
147
|
-
<button className="rv-foldbtn" {...tip(open ? 'fold this message to one line' : 'open this message whole')} aria-label={open ? 'fold' : 'unfold'} aria-expanded={open} onMouseDown={keepFocus} onClick={(e) => { e.stopPropagation(); thread.toggleCell(c) }}><Caret open={open} /></button>
|
|
148
186
|
<button type="button" className={`rv-besidebtn ghost${thread.beside === c.id ? ' on' : ''}`} data-check="cell-beside" aria-pressed={thread.beside === c.id} {...tip(thread.beside === c.id ? 'close the panel on the right that shows this message' : 'show the whole message in a panel on the right, the thread kept where it is', thread.beside === c.id ? 'Esc' : undefined)} aria-label="open beside"
|
|
149
187
|
onMouseDown={keepFocus} onClick={(e) => { e.stopPropagation(); if (thread.beside === c.id) thread.closePanel(); else thread.openBeside(c.id) }}>
|
|
150
188
|
<Icon d={ICON.paneRight} />
|
|
@@ -166,7 +204,15 @@ export const CellFrame = observer(({ rv, thread, c, cont }: { rv: ReviewSt; thre
|
|
|
166
204
|
{c.superseded ? <SupersededBy thread={thread} by={c.superseded} /> : null}
|
|
167
205
|
{c.kind === 'version' ? <VersionMain rv={rv} thread={thread} c={c} /> : <CellBody rv={rv} thread={thread} c={c} />}
|
|
168
206
|
</div>
|
|
169
|
-
) :
|
|
207
|
+
) : null}
|
|
208
|
+
{/* the answer bar at the foot of an item that asks the owner's verdict, sticky while a tall one scrolls: a
|
|
209
|
+
version's, or a message's (view-layout.ts LAYOUT asks-verdict); a question draws its own (question-views.tsx) */}
|
|
210
|
+
{open && c.kind === 'version' && asksVersionVerdict(thread, c) ? (
|
|
211
|
+
<ToneBar thread={thread} on={c.id} />
|
|
212
|
+
) : open && c.kind === 'reply' && asksReplyVerdict(c) ? (
|
|
213
|
+
<ToneBar thread={thread} on={c.id} />
|
|
214
|
+
) : null}
|
|
215
|
+
{open ? null : (
|
|
170
216
|
c.kind === 'version' && c.item.views.length > 0 ? (
|
|
171
217
|
<div className="rv-bubble rv-vfold">
|
|
172
218
|
<div className="rv-csum" onClick={() => thread.toggleCell(c)}>
|
|
@@ -314,24 +360,23 @@ export const cellWholeTitle = (rv: ReviewSt, thread: ThreadSt, id: string): { ti
|
|
|
314
360
|
const VersionMain = observer(({ rv, thread, c }: { rv: ReviewSt; thread: ThreadSt; c: VersionCell }) => {
|
|
315
361
|
const r = c.item
|
|
316
362
|
const live = c.id === thread.head?.id && thread.takesVerdict
|
|
317
|
-
|
|
318
|
-
// its verdict sits in the side column under the avatar (CellFrame); the dock only reminds him and jumps there
|
|
363
|
+
// its verdict is the answer bar at the cell's foot (CellFrame)
|
|
319
364
|
return (
|
|
320
365
|
<>
|
|
321
366
|
<VersionText rv={rv} thread={thread} c={c} />
|
|
322
|
-
{c.id === thread.head?.id && thread.data?.next ? <div className="rv-replaced" role="note">no verdict needed: v{thread.data.next.n} is coming from {agentWords(thread.data.next.who)}</div> : null}
|
|
367
|
+
{c.id === thread.head?.id && thread.data?.state.next ? <div className="rv-replaced" role="note">no verdict needed: v{thread.data.state.next.n} is coming from {agentWords(thread.data.state.next.who)}</div> : null}
|
|
323
368
|
{/* every version of a trailer thread plays its own pinned render in the trailer entry's player */}
|
|
324
|
-
{isTrailerItem(r) ? <TrailerItemBody ver={{ rv, thread, cell: c, live
|
|
369
|
+
{isTrailerItem(r) ? <TrailerItemBody ver={{ rv, thread, cell: c, live }} item={r} /> : r.views.length > 0 ? <VersionViews ver={{ rv, thread, cell: c, live }} /> : null}
|
|
325
370
|
{/* a draft version holds no view: its body is the post draft itself, read live */}
|
|
326
|
-
{isDraftItem(r) ? <DraftItemBody ver={{ rv, thread, cell: c, live
|
|
371
|
+
{isDraftItem(r) ? <DraftItemBody ver={{ rv, thread, cell: c, live }} item={r} /> : null}
|
|
327
372
|
{/* a version of an object of a kind: its two states, drawn as its kind declares */}
|
|
328
373
|
{r.states ? <KindStates rv={rv} thread={thread} item={r} live={live} /> : null}
|
|
329
374
|
</>
|
|
330
375
|
)
|
|
331
376
|
})
|
|
332
377
|
|
|
333
|
-
/** a version draws
|
|
334
|
-
*
|
|
378
|
+
/** a version draws the answer bar at its foot (tone-bar.tsx); never an older version, nor a draft version answered by
|
|
379
|
+
* its kind's acts */
|
|
335
380
|
const asksVersionVerdict = (thread: ThreadSt, c: VersionCell): boolean =>
|
|
336
381
|
c.id === thread.head?.id && thread.takesVerdict && versionActs(c.item) === null
|
|
337
382
|
|
|
@@ -352,7 +397,7 @@ const VerdictBody = observer(({ thread, c }: { thread: ThreadSt; c: VerdictCell
|
|
|
352
397
|
return (
|
|
353
398
|
<>
|
|
354
399
|
<div className="rv-verdictline">
|
|
355
|
-
|
|
400
|
+
<span className={`rv-vdisc ${toneOf(c.verdict)}`} aria-hidden="true">{glyphOf(c.verdict)}</span>
|
|
356
401
|
<b className="rv-vwords">{v ? verdictLabel(v.item, c.verdict, c.reactions) : STATUS_LABEL[c.verdict]}{c.judges ? '' : v ? ` · v${v.n}` : ''}</b>
|
|
357
402
|
{c.judges ? <button className="rv-on ghost" {...tip('scroll up to the message this verdict judges and light it')} onMouseDown={keepFocus} onClick={() => thread.reveal(c.judges!)}>↑ on the message it judges</button> : null}
|
|
358
403
|
{c.current ? null : <span className="rv-dim">an earlier answer, before a reopen or a newer one</span>}
|
|
@@ -423,24 +468,25 @@ const EditBody = observer(({ thread, c, edit }: { thread: ThreadSt; c: ReplyCell
|
|
|
423
468
|
|
|
424
469
|
/** words of either party, and an image he pasted; an agent's update draws its view here, at its time, and takes his hint */
|
|
425
470
|
const ReplyBody = observer(({ rv, thread, c }: { rv: ReviewSt; thread: ThreadSt; c: ReplyCell }) => {
|
|
426
|
-
const version = c.update?.view !== undefined ? thread.
|
|
471
|
+
const version = c.update?.view !== undefined ? thread.holderOf(c.on) : null
|
|
427
472
|
const view = c.update?.view !== undefined ? version?.item.views[c.update.view] : undefined
|
|
428
473
|
const url = (f: string): string => rv.threadImageUrl(c.on, f)
|
|
429
474
|
// an older reply's one picture joins its files' row
|
|
430
475
|
const more = c.image ? [{ src: url(c.image), name: 'picture' }] : undefined
|
|
431
|
-
const words = !(c.edit || c.ask || c.propose || c.instructions)
|
|
476
|
+
const words = !(c.edit || c.ask || c.propose || c.instructions || c.recap)
|
|
432
477
|
const media = c.files !== undefined || more !== undefined
|
|
433
478
|
return (
|
|
434
479
|
<>
|
|
480
|
+
{c.recap ? <div className="rv-recapword" {...tip('a recap of the thread: accepted, the thread reads from it on, everything before it one click away')}>recap</div> : null}
|
|
435
481
|
{c.re ? (
|
|
436
482
|
<button className="rv-on ghost" {...tip('scroll up to the update this message answers and light it')} onMouseDown={keepFocus} onClick={() => thread.reveal(c.re!.id)}>↑ on update {c.re.k} · {UPDATE_WORDS[c.re.state]}</button>
|
|
437
483
|
) : null}
|
|
438
|
-
{c.edit ? <EditBody thread={thread} c={c} edit={c.edit} /> : c.ask || c.propose ? <RequestCell rv={rv} thread={thread} c={c} /> : c.instructions ? <Html html={renderMd(c.text)} className="md rv-what" /> : media ? <MessageWords text={c.text} files={c.files ?? []} url={url} box={thread.pictures} more={more} className="rv-words" /> : <Words text={c.text} className="rv-words" />}
|
|
484
|
+
{c.edit ? <EditBody thread={thread} c={c} edit={c.edit} /> : c.ask || c.propose ? <RequestCell rv={rv} thread={thread} c={c} /> : c.instructions || c.recap ? <Html html={renderMd(c.text)} className="md rv-what" /> : media ? <MessageWords text={c.text} files={c.files ?? []} url={url} box={thread.pictures} more={more} className="rv-words" /> : <Words text={c.text} className="rv-words" />}
|
|
439
485
|
{media && !words ? <MessageWords text="" files={c.files ?? []} url={url} box={thread.pictures} more={more} /> : null}
|
|
440
486
|
{c.long ? <div className="rv-longmark" role="note">long on purpose: {c.long}</div> : null}
|
|
441
487
|
{version && view && c.update?.view !== undefined ? (
|
|
442
488
|
<ViewCell
|
|
443
|
-
ver={{ rv, thread, cell: version, live: version.id === thread.head?.id && thread.takesVerdict
|
|
489
|
+
ver={{ rv, thread, cell: version, live: version.id === thread.head?.id && thread.takesVerdict }}
|
|
444
490
|
v={view}
|
|
445
491
|
i={c.update.view}
|
|
446
492
|
noted={false}
|
|
@@ -479,8 +525,8 @@ const HintBox = observer(({ thread, c }: { thread: ThreadSt; c: ReplyCell }) =>
|
|
|
479
525
|
|
|
480
526
|
/** what he or a player raised, or his mark: the words, the still with his rectangles on it */
|
|
481
527
|
const NoteBody = ({ rv, thread, c }: { rv: ReviewSt; thread: ThreadSt; c: NoteCell }) => {
|
|
482
|
-
|
|
483
|
-
const still =
|
|
528
|
+
// an option's picture or an update's file sits on the item too, and draws in its own message's cell
|
|
529
|
+
const still = c.item ? raisedStill(c.item) : null
|
|
484
530
|
const r = c.rate
|
|
485
531
|
return (
|
|
486
532
|
<>
|
|
@@ -505,15 +551,15 @@ const NoteBody = ({ rv, thread, c }: { rv: ReviewSt; thread: ThreadSt; c: NoteCe
|
|
|
505
551
|
)
|
|
506
552
|
}
|
|
507
553
|
|
|
508
|
-
/** a share's act (wiki tools/shipkit/advisors.md,
|
|
554
|
+
/** a share's act (wiki tools/shipkit/advisors.md, What he does, one click each): the person's face, the words, when; the person's
|
|
509
555
|
* name links to their line on the advisors page; a live share's newest line carries its acts (share-lines.tsx) */
|
|
510
|
-
const ShareLine = observer(({ rv, thread, c, e }: { rv: ReviewSt; thread: ThreadSt; c: Traced; e: ShareEvent }) => {
|
|
556
|
+
const ShareLine = observer(({ rv, thread, c, e, quiet }: { rv: ReviewSt; thread: ThreadSt; c: Traced; e: ShareEvent; quiet: string }) => {
|
|
511
557
|
const bar = thread.shareBar
|
|
512
558
|
const adv = rv.host.owner?.home.advisors ?? null
|
|
513
559
|
const at = e.words.indexOf(e.name)
|
|
514
560
|
return (
|
|
515
561
|
<>
|
|
516
|
-
<div id={cellDom(c.id)} className=
|
|
562
|
+
<div id={cellDom(c.id)} className={`rv-event act-share${quiet}`} data-act="share" data-share-act={e.act} {...tip(`${e.words}: ${stampWords(Date.parse(e.at))}`)}>
|
|
517
563
|
<span className="rv-cglyph adv-shareface" aria-hidden><AdvisorFace name={e.name} src={adv?.faceOf(e.advisor) ?? null} px={16} /></span>
|
|
518
564
|
<span className="rv-eventtext">
|
|
519
565
|
{at < 0 || adv === null ? e.words : <>{e.words.slice(0, at)}<a href="/advisors" className="rv-eventobj" {...tip(`opens ${e.name}'s line on the advisors page, the threads they read`)} onClick={() => adv.showPerson(e.advisor)}>{e.name}</a>{e.words.slice(at + e.name.length)}</>}
|
|
@@ -527,10 +573,10 @@ const ShareLine = observer(({ rv, thread, c, e }: { rv: ReviewSt; thread: Thread
|
|
|
527
573
|
|
|
528
574
|
/** another thread's message that names this one by its code (wiki tools/shipkit/threads-page.md, Traces): a quiet
|
|
529
575
|
* line, « mentioned in » and that thread's pill, which opens it there */
|
|
530
|
-
const BacklinkLine = observer(({ rv, thread, c, b }: { rv: ReviewSt; thread: ThreadSt; c: Traced; b: Backlink }) => {
|
|
531
|
-
const band = bandOf(b.from, rv.parties, rv.bandNow)
|
|
576
|
+
const BacklinkLine = observer(({ rv, thread, c, b, quiet }: { rv: ReviewSt; thread: ThreadSt; c: Traced; b: Backlink; quiet: string }) => {
|
|
577
|
+
const band = bandOf(b.from.state, rv.parties, rv.bandNow)
|
|
532
578
|
return (
|
|
533
|
-
<div id={cellDom(c.id)} className=
|
|
579
|
+
<div id={cellDom(c.id)} className={`rv-event act-mention${quiet}`} data-act="mention" {...tip(`a message of the thread « ${b.from.title} » names this one: ${stampWords(Date.parse(b.at))}`)}>
|
|
534
580
|
<span className="rv-cglyph" data-type="trace" aria-hidden><Icon d={MESSAGE_TYPES.trace.icon} /></span>
|
|
535
581
|
<span className="rv-eventtext">
|
|
536
582
|
mentioned in{' '}
|
|
@@ -545,38 +591,50 @@ const BacklinkLine = observer(({ rv, thread, c, b }: { rv: ReviewSt; thread: Thr
|
|
|
545
591
|
|
|
546
592
|
/** a run of traces in a row (wiki tools/shipkit/threads-page.md, Traces): each act one muted line, who, what it did,
|
|
547
593
|
* the object as a link that shows it, when; the same trace in a row said once with its count and its first and last
|
|
548
|
-
* time
|
|
594
|
+
* time; a quiet act's line steps back, and two or more in a row fold into one line « N more » that opens on a click
|
|
595
|
+
* (review/traces.ts quietOf). A run never crosses a framed cell: a word between two acts is its own cell */
|
|
549
596
|
export const TraceLines = observer(({ rv, thread, cells }: { rv: ReviewSt; thread: ThreadSt; cells: Traced[] }) => {
|
|
550
|
-
const runs: { c: Traced; n: number; last: Traced }[] = []
|
|
551
|
-
for (const c of cells) {
|
|
552
|
-
const run = runs.at(-1)
|
|
553
|
-
if (run && run.c.summary === c.summary) {
|
|
554
|
-
run.n++
|
|
555
|
-
run.last = c
|
|
556
|
-
} else runs.push({ c, n: 1, last: c })
|
|
557
|
-
}
|
|
558
597
|
const kind = thread.data ? kindOf(thread.data.subject.kind, rv.spec ?? NO_SPEC) : null
|
|
598
|
+
const line = (r: TraceRun): ReactNode => <TraceLine key={r.c.id} rv={rv} thread={thread} run={r} kind={kind} />
|
|
559
599
|
return (
|
|
560
600
|
<div className="rv-events">
|
|
561
|
-
{
|
|
562
|
-
if (
|
|
563
|
-
|
|
564
|
-
const
|
|
565
|
-
const
|
|
601
|
+
{traceRunsOf(cells).map((p) => {
|
|
602
|
+
if ('one' in p) return line(p.one)
|
|
603
|
+
const key = quietKey(p.fold[0]!)
|
|
604
|
+
const open = thread.quietOpen(key)
|
|
605
|
+
const words = p.fold.map((r) => traceWords(whoWords(rv, r.c), r.c.trace)).join('\n')
|
|
566
606
|
return (
|
|
567
|
-
<
|
|
568
|
-
<
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
</span>
|
|
575
|
-
<When rv={rv} at={c.at} />
|
|
576
|
-
{n > 1 ? <>{' → '}<When rv={rv} at={last.at} /></> : null}
|
|
577
|
-
</div>
|
|
607
|
+
<Fragment key={key}>
|
|
608
|
+
<button className="rv-event quiet rv-quietfold ghost" data-quiet={key} aria-expanded={open} {...tip(open ? 'shut them again' : `show them:\n${words}`)} onMouseDown={keepFocus} onClick={() => thread.toggleQuiet(key)}>
|
|
609
|
+
<span className="rv-cglyph" data-type="trace" aria-hidden><Icon d={MESSAGE_TYPES.trace.icon} /></span>
|
|
610
|
+
<span className="rv-eventtext">{p.fold.length} more</span> <Caret open={open} />
|
|
611
|
+
</button>
|
|
612
|
+
{open ? p.fold.map(line) : null}
|
|
613
|
+
</Fragment>
|
|
578
614
|
)
|
|
579
615
|
})}
|
|
580
616
|
</div>
|
|
581
617
|
)
|
|
582
618
|
})
|
|
619
|
+
|
|
620
|
+
/** one trace line: a share's act, a backlink, or an act, quiet or normal by its act (review/traces.ts quietOf) */
|
|
621
|
+
const TraceLine = observer(({ rv, thread, run: { c, n, last }, kind }: { rv: ReviewSt; thread: ThreadSt; run: TraceRun; kind: ReturnType<typeof kindOf> | null }) => {
|
|
622
|
+
const quiet = quietOf(c.trace) ? ' quiet' : ''
|
|
623
|
+
if (c.share !== undefined) return <ShareLine rv={rv} thread={thread} c={c} e={c.share} quiet={quiet} />
|
|
624
|
+
if (c.backlink !== undefined) return <BacklinkLine rv={rv} thread={thread} c={c} b={c.backlink} quiet={quiet} />
|
|
625
|
+
const t = c.trace
|
|
626
|
+
const did = t.act === 'action' && t.action ? `clicked « ${kind?.actions?.[t.action]?.label ?? t.action} »` : t.did
|
|
627
|
+
return (
|
|
628
|
+
<div id={cellDom(c.id)} className={`rv-event act-${t.act}${quiet}`} data-act={t.act} {...tip(`${n > 1 ? `${n} times: ` : ''}${traceWords(whoWords(rv, c), { ...t, did })}`)}>
|
|
629
|
+
<span className="rv-cglyph" data-type="trace" aria-hidden><Icon d={MESSAGE_TYPES.trace.icon} /></span>
|
|
630
|
+
{n > 1 ? <b className="rv-eventn">{n}×</b> : null}
|
|
631
|
+
<span className="rv-eventtext">
|
|
632
|
+
{whoWords(rv, c)} {did}
|
|
633
|
+
{t.until ? <> {stampWords(Date.parse(t.until))}</> : null}
|
|
634
|
+
{t.object ? <> <a href={`#${cellDom(t.object.cell)}`} className="rv-eventobj" {...tip('scroll to what this event is about and light it')} onMouseDown={keepFocus} onClick={(e) => { e.preventDefault(); thread.reveal(t.object!.cell) }}>{t.object.label}</a></> : null}
|
|
635
|
+
</span>
|
|
636
|
+
<When rv={rv} at={c.at} />
|
|
637
|
+
{n > 1 ? <>{' → '}<When rv={rv} at={last.at} /></> : null}
|
|
638
|
+
</div>
|
|
639
|
+
)
|
|
640
|
+
})
|
|
@@ -18,8 +18,8 @@ export const REVIEW_ACTS = [
|
|
|
18
18
|
'approve', 'fix', 'reply', 'pick', 'files', 'start', 'read', 'search',
|
|
19
19
|
// the owner's alone
|
|
20
20
|
'reject', 'rects', 'react', 'close', 'snooze', 'reopen', 'stage', 'publish', 'action', 'apply', 'answer', 'secret',
|
|
21
|
-
'lane', 'share', 'reveal', 'holds', 'attach', 'note', 'filter', '
|
|
22
|
-
'mute', 'mention', 'tag', 'delete',
|
|
21
|
+
'lane', 'share', 'reveal', 'holds', 'attach', 'note', 'filter', 'copy', 'trailer', 'social', 'live',
|
|
22
|
+
'mute', 'mention', 'tag', 'delete', 'rename', 'move', 'recap',
|
|
23
23
|
] as const
|
|
24
24
|
export type ReviewAct = (typeof REVIEW_ACTS)[number]
|
|
25
25
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// the review page's plumbing, no mobx and no view: the browser's storage, a polled loader that keeps its last answer
|
|
2
2
|
// on « not modified », a json post, the clipboard
|
|
3
|
-
import type { Turn } from '../../../review/band.ts'
|
|
4
3
|
import { threadPageOf, type ThreadPage } from '../../../review/cells.ts'
|
|
5
4
|
import type { ReviewStatus, ShownStatus } from '../../../review/model.ts'
|
|
6
5
|
import { reach } from '../reach.ts'
|
|
@@ -57,7 +56,7 @@ export type EtagLoader<T> = (() => Promise<T>) & {
|
|
|
57
56
|
/** how many urls of one key the browser keeps: a filter or a mode switched back draws at once too */
|
|
58
57
|
const KEPT_URLS = 4
|
|
59
58
|
|
|
60
|
-
/** the threads' store refused for a while (a
|
|
59
|
+
/** the threads' store refused for a while (a repair of the daemon's file): its line and the wait it names */
|
|
61
60
|
export class StoreWait extends Error {
|
|
62
61
|
constructor(
|
|
63
62
|
readonly line: string,
|
|
@@ -127,6 +126,19 @@ export function etagLoader<T>(url: () => string, o: { keep?: string; shape?: (v:
|
|
|
127
126
|
return Object.assign(load, { held: (): T | null => (key == null ? null : of(url())?.value ?? null) })
|
|
128
127
|
}
|
|
129
128
|
|
|
129
|
+
/** where a thread went, from a read of its old place (review/move.ts: a 404 that names `moved`); null for any other error */
|
|
130
|
+
export function movedOfError(e: unknown): { repo: string; head: string } | null {
|
|
131
|
+
const text = e instanceof Error ? e.message : ''
|
|
132
|
+
const at = text.indexOf('{')
|
|
133
|
+
if (!text.includes('HTTP 404') || at < 0) return null
|
|
134
|
+
try {
|
|
135
|
+
const m = (JSON.parse(text.slice(at)) as { moved?: { repo?: unknown; head?: unknown } }).moved
|
|
136
|
+
return typeof m?.repo === 'string' && typeof m.head === 'string' ? { repo: m.repo, head: m.head } : null
|
|
137
|
+
} catch {
|
|
138
|
+
return null
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
130
142
|
export async function postJson<T>(url: string, body: unknown, signal?: AbortSignal): Promise<T> {
|
|
131
143
|
const res = await reach(url, { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify(body), ...(signal !== undefined ? { signal } : {}) })
|
|
132
144
|
const text = await res.text()
|
|
@@ -162,12 +174,6 @@ export async function copyText(text: string): Promise<boolean> {
|
|
|
162
174
|
}
|
|
163
175
|
}
|
|
164
176
|
|
|
165
|
-
/** a row or a thread as the owner's verdict on its way leaves it, drawn in the click's frame: its status
|
|
166
|
-
*
|
|
167
|
-
|
|
168
|
-
export const answeredAs = <T extends { status: ShownStatus; waits: boolean; turn: Turn }>(r: T, a: ReviewStatus | 'pending'): T => ({
|
|
169
|
-
...r,
|
|
170
|
-
status: a,
|
|
171
|
-
waits: a === 'pending',
|
|
172
|
-
turn: a === 'pending' ? 'yours' : a === 'approved' ? 'done' : 'agents',
|
|
173
|
-
})
|
|
177
|
+
/** a row or a thread as the owner's verdict on its way leaves it, drawn in the click's frame: its status alone; its turn,
|
|
178
|
+
* its band and what waits stay the server's (review/thread-state.ts), which answers a moment later */
|
|
179
|
+
export const answeredAs = <T extends { state: { status: ShownStatus } }>(r: T, a: ReviewStatus | 'pending'): T => ({ ...r, state: { ...r.state, status: a } })
|