rvlib-shipkit 2.25.0 → 2.27.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 +33 -0
- package/package.json +2 -2
- package/src/agent-time/diet.ts +77 -0
- package/src/agent-time/family.ts +72 -0
- package/src/agent-time/hooks.ts +331 -0
- package/src/agent-time/limits.ts +44 -0
- package/src/agent-time/live.ts +1 -3
- package/src/agent-time/mask.ts +96 -18
- package/src/agent-time/refused.ts +45 -0
- package/src/agent-time/render.ts +130 -17
- package/src/agent-time/report-cache.ts +57 -0
- package/src/agent-time/report.ts +349 -23
- package/src/agent-time/shape.ts +50 -3
- package/src/agent-time/store.ts +370 -95
- package/src/agent-time/timeline.ts +140 -21
- package/src/agent-time/turns.ts +18 -8
- package/src/annex/offload.ts +17 -6
- package/src/annex/tidy.ts +70 -10
- package/src/asks/ask-after.ts +40 -0
- package/src/asks/asks-queue.ts +205 -47
- package/src/assets/kit-config.ts +7 -3
- package/src/assets/kits/identity-kit.ts +289 -10
- package/src/check.ts +3 -1
- package/src/checks/SK004-gitignore-policy.check.ts +12 -5
- package/src/checks/SK013-one-way-in-policy.check.ts +8 -3
- package/src/checks/SK026-asks-autoclose.check.ts +5 -5
- package/src/checks/SK028-readme.check.ts +7 -66
- package/src/checks/SK030-cache-audit.check.ts +6 -1
- package/src/checks/SK031-trace-audit.check.ts +2 -0
- package/src/checks/SK033-global-contribution.check.ts +3 -1
- package/src/checks/SK035-public-clean.check.ts +2 -2
- package/src/checks/SK043-scratch-on-the-mac.check.ts +59 -4
- package/src/checks/SK045-slow-hooks.check.ts +47 -0
- package/src/checks/SK046-hook-records.check.ts +76 -0
- package/src/checks/SK047-login-in-description.check.ts +36 -0
- package/src/checks/SK048-one-local-file.check.ts +36 -0
- package/src/cli/cmd_Asks.ts +71 -5
- package/src/cli/cmd_Backup.ts +5 -3
- package/src/cli/cmd_Capacity.ts +2 -2
- package/src/cli/cmd_CrossRepoActivity.ts +5 -4
- package/src/cli/cmd_Db.ts +253 -0
- package/src/cli/cmd_History.ts +212 -0
- package/src/cli/cmd_Home.ts +31 -3
- package/src/cli/cmd_Hq.ts +516 -0
- package/src/cli/cmd_Machines.ts +36 -0
- package/src/cli/cmd_Media.ts +38 -6
- package/src/cli/cmd_Mv.ts +1 -1
- package/src/cli/cmd_Reflect.ts +23 -2
- package/src/cli/cmd_Releases.ts +30 -0
- package/src/cli/cmd_Review.ts +569 -118
- package/src/cli/cmd_Secret.ts +62 -12
- package/src/cli/cmd_Social.ts +83 -1
- package/src/cli/cmd_Space.ts +324 -0
- package/src/cli/cmd_Time.ts +82 -5
- package/src/cli/cmd_Tmp.ts +28 -4
- package/src/cli/cmd_Trailer.ts +14 -10
- package/src/cli/cmd_Urls.ts +56 -0
- package/src/cli/cmd_Vault.ts +583 -0
- package/src/cli/family-help.ts +4 -2
- package/src/cli/family-pages.ts +1 -1
- package/src/cli/registry.ts +26 -4
- package/src/collections/actions.ts +63 -13
- package/src/collections/collection-types.ts +23 -1
- package/src/collections/providers.ts +117 -23
- package/src/collections/review.ts +4 -4
- package/src/commands/runner.ts +5 -1
- package/src/contracts/contract-manifests.ts +6 -5
- package/src/contracts/contract-types.ts +6 -4
- package/src/contracts/contracts-engine.ts +11 -0
- package/src/contracts/manifests/chrome-web-store.contract.ts +31 -0
- package/src/core/budget.ts +12 -17
- package/src/core/capacity.ts +27 -18
- package/src/core/check-runner.ts +7 -4
- package/src/core/history-files.ts +9 -5
- package/src/core/layout.ts +3 -0
- package/src/core/machine-busy.ts +127 -0
- package/src/core/machine-commit.ts +6 -1
- package/src/core/machine-db.ts +368 -20
- package/src/core/machine-layout.ts +137 -0
- package/src/core/machine-read.ts +81 -0
- package/src/core/migrate-layout.ts +1 -1
- package/src/core/one-way-in-policy.ts +64 -7
- package/src/core/polling-policy.ts +27 -0
- package/src/core/retention.ts +16 -2
- package/src/core/scope.ts +107 -14
- package/src/core/signal-name.ts +6 -0
- package/src/core/slots.ts +5 -4
- package/src/core/trace-audit.ts +6 -1
- package/src/core/transient.ts +6 -0
- package/src/drill/clean.ts +25 -1
- package/src/drill/run.ts +2 -2
- package/src/drill/seal.ts +27 -4
- package/src/home/activity-shape.ts +2 -0
- package/src/home/activity.ts +66 -3
- package/src/home/app-sign.ts +15 -4
- package/src/home/daemon-jobs.ts +149 -7
- package/src/home/database-projects.ts +111 -0
- package/src/home/database-words.ts +203 -0
- package/src/home/databases.ts +460 -0
- package/src/home/global-units.ts +6 -0
- package/src/home/gui-app/ShipkitGui.swift +122 -1
- package/src/home/gui-app.ts +6 -3
- package/src/home/home-move.ts +514 -0
- package/src/home/home-paths.ts +12 -3
- package/src/home/home-routes.ts +68 -0
- package/src/home/inbox-shape.ts +24 -14
- package/src/home/machine-fold.ts +820 -0
- package/src/home/machine-host.ts +20 -5
- package/src/home/machine-repair.ts +503 -0
- package/src/home/machine-stores.ts +66 -15
- package/src/home/machine-temp.ts +547 -86
- package/src/home/resume.ts +79 -0
- package/src/home/run-daemon.ts +25 -4
- package/src/home/run-pm.ts +18 -5
- package/src/home/serve-daemon.ts +18 -3
- package/src/home/serve-web.ts +175 -7
- package/src/home/space-job.ts +115 -0
- package/src/home/space-page.ts +257 -0
- package/src/home/space-route.ts +167 -0
- package/src/home/space-words.ts +103 -0
- package/src/home/time-page-shape.ts +202 -0
- package/src/home/time-page.ts +64 -0
- package/src/home/vault-page.ts +482 -0
- package/src/home/vault-words.ts +132 -0
- package/src/hooks/leak-guard.ts +40 -13
- package/src/hooks/one-way-in-guard.ts +17 -4
- package/src/hq/cards.ts +581 -0
- package/src/hq/door-route.ts +43 -0
- package/src/hq/door.ts +163 -0
- package/src/hq/files-send.ts +348 -0
- package/src/hq/forgotten-log.ts +35 -0
- package/src/hq/history-check.ts +255 -0
- package/src/hq/history-place.ts +146 -0
- package/src/hq/history-send.ts +487 -0
- package/src/hq/hq-db.ts +99 -0
- package/src/hq/hq-local.ts +469 -0
- package/src/hq/hq-routes.ts +196 -0
- package/src/hq/hq-store.ts +599 -0
- package/src/hq/kinds/ask.ts +147 -0
- package/src/hq/kinds/card-gone.ts +83 -0
- package/src/hq/kinds/card-msg.ts +66 -0
- package/src/hq/kinds/card.ts +99 -0
- package/src/hq/kinds/index.ts +21 -0
- package/src/hq/kinds/kind.ts +126 -0
- package/src/hq/kinds/media.ts +125 -0
- package/src/hq/kinds/prompt.ts +219 -0
- package/src/hq/kinds/reflection.ts +128 -0
- package/src/hq/kinds/report.ts +55 -0
- package/src/hq/kinds/time-day.ts +236 -0
- package/src/hq/ledger.ts +473 -0
- package/src/hq/machine-key.ts +44 -0
- package/src/hq/machine-notes.ts +131 -0
- package/src/hq/outbox.ts +372 -0
- package/src/hq/replica.ts +168 -0
- package/src/hq/repo-id.ts +4 -0
- package/src/hq/report-facts.ts +117 -0
- package/src/hq/report.ts +274 -0
- package/src/hq/switch.ts +151 -0
- package/src/hq/vault-grant.ts +92 -0
- package/src/identities/identities.ts +15 -3
- package/src/identities/steps.ts +31 -0
- package/src/ledger/db.ts +73 -26
- package/src/ledger/gate-checks.ts +29 -4
- package/src/ledger/git-key.ts +3 -3
- package/src/ledger/git-scan.ts +49 -7
- package/src/ledger/run-log.ts +11 -3
- package/src/ledger/store.ts +26 -4
- package/src/media-store/backup/daemon.ts +36 -17
- package/src/media-store/backup/kept.ts +241 -0
- package/src/media-store/backup/restore.ts +14 -4
- package/src/media-store/backup/run.ts +11 -11
- package/src/media-store/backup/secret.ts +6 -4
- package/src/media-store/backup/snapshot.ts +4 -2
- package/src/media-store/backup/sources.ts +68 -20
- package/src/media-store/copy/config.ts +77 -0
- package/src/media-store/copy/copy.ts +194 -0
- package/src/media-store/copy/lifecycle.ts +43 -0
- package/src/media-store/copy/night.ts +90 -0
- package/src/media-store/copy/proof.ts +151 -0
- package/src/media-store/copy/snapshot.ts +152 -0
- package/src/media-store/copy/store.ts +62 -0
- package/src/media-store/copy/stream.ts +176 -0
- package/src/media-store/daemon.ts +66 -16
- package/src/media-store/db.ts +22 -11
- package/src/media-store/forget.ts +23 -3
- package/src/media-store/hand.ts +4 -3
- package/src/media-store/hq-find.ts +75 -0
- package/src/media-store/hq-send.ts +277 -0
- package/src/media-store/kind.ts +2 -0
- package/src/media-store/purge.ts +18 -15
- package/src/media-store/put.ts +24 -8
- package/src/media-store/remote.ts +16 -7
- package/src/media-store/space-listing.ts +240 -0
- package/src/media-store/space.ts +40 -21
- package/src/media-store/sync.ts +5 -5
- package/src/media-store/tidy.ts +98 -0
- package/src/media-store/upload.ts +3 -3
- package/src/media-store/webp.ts +66 -0
- package/src/messages/model.ts +16 -7
- package/src/messages/routes.ts +14 -4
- package/src/messages/score.ts +2 -2
- package/src/messages/suggest.ts +96 -0
- package/src/pages/frame-client.ts +10 -0
- package/src/plan/planner.ts +28 -17
- package/src/recordings/media-kind.ts +1 -0
- package/src/recordings/model.ts +1 -1
- package/src/recordings/recorder-app/Capture.swift +9 -7
- package/src/reflect/hq-corpus.ts +56 -0
- package/src/reflect/prompt-corpus.ts +3 -1
- package/src/reflect/transcript.ts +146 -36
- package/src/release/machine-words.ts +67 -0
- package/src/release/public-clean.ts +8 -3
- package/src/releases/from-card.ts +1 -1
- package/src/releases/model.ts +18 -0
- package/src/releases/routes.ts +10 -5
- package/src/releases/store.ts +23 -2
- package/src/repo-config.ts +42 -2
- package/src/review/anim.ts +2 -2
- package/src/review/auto.ts +2 -2
- package/src/review/card-db.ts +244 -0
- package/src/review/card-rows.ts +266 -0
- package/src/review/cells.ts +76 -5
- package/src/review/draft-card.ts +41 -0
- package/src/review/draft-model.ts +78 -0
- package/src/review/format.ts +29 -10
- package/src/review/gone.ts +98 -0
- package/src/review/inbox-hook.ts +35 -0
- package/src/review/marks.ts +1 -1
- package/src/review/media-kind.ts +7 -5
- package/src/review/media-read.ts +9 -7
- package/src/review/media.ts +32 -5
- package/src/review/model.ts +214 -45
- package/src/review/move.ts +491 -0
- package/src/review/notes.ts +12 -20
- package/src/review/previews.ts +15 -19
- package/src/review/project.ts +1 -1
- package/src/review/rev.ts +8 -0
- package/src/review/role.ts +1 -1
- package/src/review/routes.ts +64 -13
- package/src/review/stage-card.ts +8 -4
- package/src/review/stage-routes.ts +1 -1
- package/src/review/store.ts +529 -83
- package/src/review/thread-fold.ts +51 -0
- package/src/review/threads.ts +147 -9
- package/src/review/trailer-auto-mock.ts +63 -0
- package/src/review/trailer-card.ts +4 -4
- package/src/review/trailer-desk.ts +41 -7
- package/src/review/trailer-media.ts +1 -0
- package/src/review/trailer-model.ts +8 -0
- package/src/review/trailer-notes.ts +1 -1
- package/src/review/trailer-routes.ts +9 -1
- package/src/review/unit.ts +6 -6
- package/src/review/watchers.ts +1 -1
- package/src/rules/untrack-generated.ts +92 -8
- package/src/secrets/held.ts +16 -0
- package/src/secrets/keychain.ts +113 -0
- package/src/secrets/list.ts +16 -6
- package/src/secrets/manager.ts +24 -10
- package/src/secrets/read.ts +257 -0
- package/src/secrets/who-reads.ts +49 -0
- package/src/serve/door-forward.ts +268 -0
- package/src/serve/door-names.ts +47 -0
- package/src/serve/embed.ts +1 -1
- package/src/serve/hub-app/activity-view.tsx +56 -32
- package/src/serve/hub-app/activity.css +7 -1
- package/src/serve/hub-app/asks-page.tsx +48 -0
- package/src/serve/hub-app/asks-st.ts +25 -0
- package/src/serve/hub-app/clock-svc.ts +1 -2
- package/src/serve/hub-app/col-card.tsx +64 -13
- package/src/serve/hub-app/col-list-page.tsx +122 -0
- package/src/serve/hub-app/col-list-st.ts +103 -0
- package/src/serve/hub-app/col-tables-view.tsx +10 -41
- package/src/serve/hub-app/col-tables.ts +76 -8
- package/src/serve/hub-app/cols-svc.ts +70 -16
- package/src/serve/hub-app/database-st.ts +260 -0
- package/src/serve/hub-app/database-view.tsx +289 -0
- package/src/serve/hub-app/database.css +32 -0
- package/src/serve/hub-app/entry-bar.css +14 -0
- package/src/serve/hub-app/entry-bar.tsx +33 -0
- package/src/serve/hub-app/entry-pick.ts +31 -0
- package/src/serve/hub-app/floating.tsx +1 -0
- package/src/serve/hub-app/hash-route.ts +11 -1
- package/src/serve/hub-app/header-bar.tsx +14 -18
- package/src/serve/hub-app/home-st.ts +89 -9
- package/src/serve/hub-app/home-strip.css +5 -19
- package/src/serve/hub-app/home-strip.tsx +58 -92
- package/src/serve/hub-app/home.html +7 -0
- package/src/serve/hub-app/hub-app.tsx +31 -142
- package/src/serve/hub-app/hub-types.ts +3 -1
- package/src/serve/hub-app/hub.css +109 -23
- package/src/serve/hub-app/icons.tsx +18 -1
- package/src/serve/hub-app/identities-st.ts +56 -6
- package/src/serve/hub-app/identities-view.tsx +100 -58
- package/src/serve/hub-app/identities.css +17 -15
- package/src/serve/hub-app/identity-address.ts +5 -0
- package/src/serve/hub-app/inbox-st.ts +41 -24
- package/src/serve/hub-app/inbox-view.tsx +37 -41
- package/src/serve/hub-app/inbox.css +2 -5
- package/src/serve/hub-app/index.html +7 -0
- package/src/serve/hub-app/kept-cols.tsx +7 -0
- package/src/serve/hub-app/keys.ts +28 -15
- package/src/serve/hub-app/later.tsx +26 -0
- package/src/serve/hub-app/list-filter.tsx +14 -0
- package/src/serve/hub-app/list-walk.ts +72 -3
- package/src/serve/hub-app/machines-st.ts +251 -0
- package/src/serve/hub-app/machines-view.tsx +224 -0
- package/src/serve/hub-app/machines.css +76 -0
- package/src/serve/hub-app/md-copy.tsx +79 -0
- package/src/serve/hub-app/media-view.tsx +2 -0
- package/src/serve/hub-app/messages/messages-page.tsx +79 -7
- package/src/serve/hub-app/messages/messages-st.ts +99 -3
- package/src/serve/hub-app/messages.css +14 -0
- package/src/serve/hub-app/page-keys.ts +175 -0
- package/src/serve/hub-app/pages-frames.tsx +11 -3
- package/src/serve/hub-app/palette-st.ts +58 -11
- package/src/serve/hub-app/palette-view.tsx +3 -1
- package/src/serve/hub-app/project-list.css +54 -8
- package/src/serve/hub-app/project-list.tsx +128 -59
- package/src/serve/hub-app/projects-svc.ts +78 -7
- package/src/serve/hub-app/reader-chips.tsx +13 -0
- package/src/serve/hub-app/readme-view.tsx +2 -3
- package/src/serve/hub-app/readme.css +27 -5
- package/src/serve/hub-app/reflections-page.tsx +42 -0
- package/src/serve/hub-app/reflections-st.ts +17 -0
- package/src/serve/hub-app/releases/releases-page.tsx +25 -2
- package/src/serve/hub-app/releases/releases-st.ts +1 -1
- package/src/serve/hub-app/repo-sections.ts +9 -5
- package/src/serve/hub-app/repo-st.ts +35 -8
- package/src/serve/hub-app/review/draft-card.tsx +163 -0
- package/src/serve/hub-app/review/kit.tsx +50 -7
- package/src/serve/hub-app/review/note-place.ts +1 -1
- package/src/serve/hub-app/review/review-board.tsx +2 -2
- package/src/serve/hub-app/review/review-cells.tsx +145 -65
- package/src/serve/hub-app/review/review-kit.ts +27 -1
- package/src/serve/hub-app/review/review-list.tsx +68 -30
- package/src/serve/hub-app/review/review-page.tsx +7 -8
- package/src/serve/hub-app/review/review-st.ts +111 -24
- package/src/serve/hub-app/review/review-thread.tsx +49 -19
- package/src/serve/hub-app/review/review-views.tsx +475 -144
- package/src/serve/hub-app/review/thread-control-st.ts +115 -0
- package/src/serve/hub-app/review/thread-control.tsx +74 -0
- package/src/serve/hub-app/review/thread-st.ts +73 -26
- package/src/serve/hub-app/review/trailer-card.tsx +1 -1
- package/src/serve/hub-app/review/trailer-page.tsx +37 -16
- package/src/serve/hub-app/review/trailer-st.ts +41 -7
- package/src/serve/hub-app/review.css +267 -61
- package/src/serve/hub-app/side-lists.ts +72 -0
- package/src/serve/hub-app/sidebar.tsx +6 -3
- package/src/serve/hub-app/site/site-part.tsx +2 -8
- package/src/serve/hub-app/site/site-st.ts +4 -4
- package/src/serve/hub-app/social/comms-page.tsx +20 -5
- package/src/serve/hub-app/social/kit.tsx +30 -4
- package/src/serve/hub-app/social/post-card.tsx +139 -49
- package/src/serve/hub-app/social/serial-writes.ts +13 -0
- package/src/serve/hub-app/social/social-model.ts +11 -0
- package/src/serve/hub-app/social/social-page.tsx +94 -35
- package/src/serve/hub-app/social/social-st.ts +120 -36
- package/src/serve/hub-app/social/stage-popup.tsx +1 -1
- package/src/serve/hub-app/social/stage-st.ts +1 -1
- package/src/serve/hub-app/social/step-layout.ts +1 -1
- package/src/serve/hub-app/social.css +3 -0
- package/src/serve/hub-app/space-st.ts +209 -0
- package/src/serve/hub-app/space-view.tsx +196 -0
- package/src/serve/hub-app/space.css +27 -0
- package/src/serve/hub-app/stores/stores-page.tsx +91 -23
- package/src/serve/hub-app/stores/stores-st.ts +44 -19
- package/src/serve/hub-app/stores.css +6 -1
- package/src/serve/hub-app/theme-st.ts +22 -9
- package/src/serve/hub-app/time-charts.tsx +291 -0
- package/src/serve/hub-app/time-pages.tsx +749 -0
- package/src/serve/hub-app/time-st.ts +162 -0
- package/src/serve/hub-app/time-view.tsx +76 -0
- package/src/serve/hub-app/time.css +138 -0
- package/src/serve/hub-app/tree-build.ts +52 -42
- package/src/serve/hub-app/tree-row.tsx +4 -4
- package/src/serve/hub-app/tree-svc.ts +18 -9
- package/src/serve/hub-app/urls-svc.ts +154 -0
- package/src/serve/hub-app/urls-view.tsx +117 -0
- package/src/serve/hub-app/urls.css +30 -0
- package/src/serve/hub-app/vault-st.ts +127 -0
- package/src/serve/hub-app/vault-view.tsx +154 -0
- package/src/serve/hub-app/vault.css +38 -0
- package/src/serve/hub-app/veille/veille-st.ts +12 -10
- package/src/serve/hub-app/waiting-svc.ts +29 -0
- package/src/serve/hub-app/wikis-view.tsx +2 -2
- package/src/serve/hub-runtime.ts +15 -2
- package/src/serve/project-gutter-route.ts +27 -14
- package/src/serve/project-gutter.ts +25 -12
- package/src/serve/same-origin.ts +10 -0
- package/src/serve/serve-hub.ts +13 -4
- package/src/shipkit-files.ts +16 -2
- package/src/shipkit.ts +1 -1
- package/src/shot/shooter.ts +616 -420
- package/src/shot/shot-ask.ts +246 -155
- package/src/site/desk.ts +2 -2
- package/src/smoke/run-smoke.ts +3 -2
- package/src/social/cover.ts +202 -0
- package/src/social/discord-layout.ts +37 -13
- package/src/social/drafts.ts +3 -0
- package/src/social/load.ts +23 -2
- package/src/social/media-kind.ts +2 -1
- package/src/social/publish/discord.ts +5 -2
- package/src/social/publish/secret.ts +2 -2
- package/src/social/release-stage.ts +28 -13
- package/src/social/routes.ts +26 -1
- package/src/social/stage.ts +1 -1
- package/src/social/stats.ts +12 -9
- package/src/social/strip.ts +4 -1
- package/src/social/thumbnail.ts +255 -0
- package/src/stores/collection.ts +15 -11
- package/src/stores/desk.ts +236 -42
- package/src/stores/model.ts +72 -6
- package/src/stores/routes.ts +37 -12
- package/src/stores/unit.ts +14 -8
- package/src/suite/judge-suites.ts +113 -16
- package/src/suite/select.ts +45 -3
- package/src/suite/suite-cli.ts +81 -34
- package/src/trailer/bed.ts +1 -1
- package/src/trailer/build.ts +134 -21
- package/src/trailer/ffmpeg.ts +7 -0
- package/src/trailer/fonts.ts +3 -2
- package/src/trailer/grammar.ts +201 -2
- package/src/trailer/graph.ts +42 -5
- package/src/trailer/look.ts +21 -0
- package/src/trailer/mock.ts +154 -0
- package/src/trailer/passage.ts +65 -26
- package/src/trailer/score/heard.ts +89 -0
- package/src/trailer/score/sound.ts +14 -8
- package/src/trailer/sound/run.ts +16 -6
- package/src/trailer/stitch.ts +26 -5
- package/src/trailer/titles.ts +82 -19
- package/src/trailer/versions.ts +1 -3
- package/src/trailer/vertical.ts +3 -1
- package/src/urls/frame.ts +195 -0
- package/src/urls/routes.ts +43 -0
- package/src/urls/rows.ts +171 -0
- package/src/urls/unit.ts +73 -0
- package/src/vault/house-keys.ts +42 -0
- package/src/vault/layout.ts +50 -0
- package/src/vault/policy.ts +165 -0
- package/src/vault/vault-audit.ts +276 -0
- package/src/vault/vault-client.ts +40 -0
- package/src/vault/vault-config.ts +159 -0
- package/src/vault/vault-destroy.ts +78 -0
- package/src/vault/vault-handover.ts +305 -0
- package/src/vault/vault-http.ts +352 -0
- package/src/vault/vault-import.ts +208 -0
- package/src/vault/vault-init.ts +328 -0
- package/src/vault/vault-minter.ts +271 -0
- package/src/vault/vault-restore.ts +333 -0
- package/src/vault/vault-serve.ts +342 -0
- package/src/vault/vault-snapshot.ts +281 -0
- package/src/veille/asks.ts +1 -1
- package/src/veille/desk.ts +2 -2
- package/src/wiki/run-wiki.ts +2 -1
- package/src/wiki/scan-md.ts +42 -2
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
// the cells of a thread, one framed card each (wiki tools/shipkit/
|
|
1
|
+
// the cells of a thread, one framed card each (wiki tools/shipkit/threads.md, The review page): a header bar (who, when,
|
|
2
2
|
// the kind, `v2`, fold, copy the 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 run of state changes is one thin line
|
|
5
5
|
import { observer } from 'mobx-react-lite'
|
|
6
6
|
import type { EventCell, NoteCell, ReplyCell, VerdictCell, VersionCell } from '../../../review/cells.ts'
|
|
7
|
-
import { isGallery, isTrailerCard, STATUS_LABEL, UPDATE_WORDS, viewName, viewTag, type Item, type Rect, type TrailerCard } from '../../../review/model.ts'
|
|
7
|
+
import { isDraftCard, isGallery, isTrailerCard, postLabel, STATUS_LABEL, thumbFileOf, UPDATE_WORDS, viewName, viewTag, type Item, type Rect, type TrailerCard } from '../../../review/model.ts'
|
|
8
8
|
import { Caret, Icon, ICON } from '../icons.tsx'
|
|
9
9
|
import { renderMd } from '../md.ts'
|
|
10
10
|
import { ageWords, stampWords } from '../time-ago.tsx'
|
|
11
11
|
import { KindView, AnimPanel } from './kind-view.tsx'
|
|
12
|
-
import { keepFocus, laneColor, REACTIONS, secs, SIDE_LABEL, toneOf } from './kit.tsx'
|
|
12
|
+
import { keepFocus, laneColor, PreviewImg, REACTIONS, secs, SIDE_LABEL, toneOf, VERDICTS } from './kit.tsx'
|
|
13
13
|
import type { ReviewSt } from './review-st.ts'
|
|
14
14
|
import { VersionViews, ViewCell } from './review-views.tsx'
|
|
15
|
-
import { cellDom, type Framed, type ThreadSt } from './thread-st.ts'
|
|
15
|
+
import { cellDom, viewKind, type Framed, type ThreadSt } from './thread-st.ts'
|
|
16
|
+
import { DraftCardBody } from './draft-card.tsx'
|
|
16
17
|
import { NoteMeta, NoteStill, TrailerCardBody } from './trailer-card.tsx'
|
|
17
18
|
|
|
18
19
|
/** who a cell is from, as its header says it: you, a player, or the agent's lane */
|
|
@@ -45,77 +46,85 @@ export const When = observer(({ rv, at }: { rv: ReviewSt; at: string }) => {
|
|
|
45
46
|
|
|
46
47
|
const KIND_LABEL: Record<Framed['kind'], string> = { version: 'version', verdict: 'verdict', reply: 'reply', note: 'note' }
|
|
47
48
|
|
|
48
|
-
/** one
|
|
49
|
-
|
|
49
|
+
/** one message of the discussion: who speaks as a round mark beside it (the agents on the left, the owner's words
|
|
50
|
+
* on the right), a light line with the name, the kind and the time, then the bubble, or its one line when folded. `cont`: the
|
|
51
|
+
* same speaker as the message above, so its mark and name are not drawn again */
|
|
52
|
+
export const CellFrame = observer(({ rv, card, c, cont }: { rv: ReviewSt; card: ThreadSt; c: Framed; cont?: boolean }) => {
|
|
50
53
|
const open = card.isOpen(c)
|
|
51
54
|
const head = card.head?.id === c.id
|
|
52
55
|
const unread = (c.kind === 'reply' || c.kind === 'note') && c.party === 'agent' && !c.read
|
|
53
|
-
const tone = c.kind === 'version' ? toneOf(c.status) : c.kind === 'verdict' ? toneOf(c.verdict) : ''
|
|
56
|
+
const tone = c.kind === 'version' ? toneOf(c.status) : c.kind === 'verdict' ? toneOf(c.verdict) : c.kind === 'reply' && c.update ? `upd up-${c.update.state}` : ''
|
|
54
57
|
return (
|
|
55
|
-
<article id={cellDom(c.id)} data-unread={unread ? c.id : undefined} className={`rv-c k-${c.kind} p-${c.party}${open ? '' : ' folded'}${head ? ' head' : ''} ${tone}`}>
|
|
56
|
-
<
|
|
57
|
-
|
|
58
|
-
<
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
58
|
+
<article id={cellDom(c.id)} data-unread={unread ? c.id : undefined} className={`rv-c k-${c.kind} p-${c.party}${open ? '' : ' folded'}${head ? ' head' : ''}${cont ? ' cont' : ''} ${tone}`}>
|
|
59
|
+
<Avatar who={c.who} />
|
|
60
|
+
<div className="rv-msg">
|
|
61
|
+
<header className="rv-chead" onClick={() => card.toggleCell(c)}>
|
|
62
|
+
{cont ? null : <b className="rv-cwho">{whoWords(c.who)}</b>}
|
|
63
|
+
<span className="rv-ckind">{c.kind === 'version' ? `v${c.n}` : c.kind === 'reply' && c.ask ? 'question' : c.kind === 'reply' && c.propose ? 'proposed change' : c.kind === 'reply' && c.answers ? 'answer' : c.kind === 'reply' && c.op ? (c.op === 'ask' ? 'question' : 'answer') : c.kind === 'reply' && c.update ? `update ${c.update.k}` : c.kind === 'reply' && c.re ? `hint on update ${c.re.k}` : KIND_LABEL[c.kind]}</span>
|
|
64
|
+
{c.kind === 'version' ? <span className="rv-badge">{STATUS_LABEL[c.status]}</span> : null}
|
|
65
|
+
{c.kind === 'reply' && c.update ? <span className={`rv-badge rv-up up-${c.update.state}`}>{UPDATE_WORDS[c.update.state]}</span> : null}
|
|
66
|
+
{c.kind === 'verdict' ? (
|
|
67
|
+
<button className="rv-on ghost" title={c.n > 0 ? `the version this answers: v${c.n}` : 'the note this answers'} onMouseDown={keepFocus} onClick={(e) => { e.stopPropagation(); card.reveal(c.on) }}>↑ on {c.n > 0 ? `v${c.n}` : 'the note'}</button>
|
|
68
|
+
) : c.kind !== 'version' && c.on !== c.id && c.on !== card.data?.head ? (
|
|
69
|
+
<button className="rv-on ghost" title="the item this was said on" onMouseDown={keepFocus} onClick={(e) => { e.stopPropagation(); card.reveal(c.on) }}>↑ on {onWords(card, c.on)}</button>
|
|
70
|
+
) : null}
|
|
71
|
+
{head ? <span className="rv-headtag" title="your verdict and your reply go to this one">answer here</span> : null}
|
|
72
|
+
{unread ? <span className="rv-unread" title="not read yet" /> : null}
|
|
73
|
+
<When rv={rv} at={c.at} />
|
|
74
|
+
<span className="rv-ctools">
|
|
75
|
+
<button className="rv-foldbtn" title={open ? 'fold' : 'unfold'} aria-label={open ? 'fold' : 'unfold'} aria-expanded={open} onMouseDown={keepFocus} onClick={(e) => { e.stopPropagation(); card.toggleCell(c) }}><Caret open={open} /></button>
|
|
76
|
+
<button className="rv-copyid ghost" title={`copy the id: ${c.id}`} aria-label="copy the id" onMouseDown={keepFocus} onClick={(e) => { e.stopPropagation(); void rv.copyId(c.id) }}>
|
|
77
|
+
<Icon d={ICON.copy} />
|
|
78
|
+
</button>
|
|
79
|
+
</span>
|
|
80
|
+
</header>
|
|
81
|
+
{open ? (
|
|
82
|
+
<div className="rv-bubble rv-cbody">
|
|
83
|
+
{c.kind === 'version' ? <VersionMain rv={rv} card={card} c={c} /> : c.kind === 'verdict' ? <VerdictBody card={card} c={c} /> : c.kind === 'reply' ? <ReplyBody rv={rv} card={card} c={c} /> : <NoteBody rv={rv} c={c} />}
|
|
84
|
+
</div>
|
|
85
|
+
) : (
|
|
86
|
+
c.kind === 'version' && c.item.views.length > 0 ? (
|
|
87
|
+
<div className="rv-bubble rv-vfold">
|
|
88
|
+
<div className="rv-csum" onClick={() => card.toggleCell(c)}>{c.summary || '·'}</div>
|
|
89
|
+
<ViewStrip rv={rv} card={card} c={c} />
|
|
90
|
+
</div>
|
|
91
|
+
) : (
|
|
92
|
+
<div className="rv-bubble rv-csum" onClick={() => card.toggleCell(c)}>{c.summary || '·'}</div>
|
|
93
|
+
)
|
|
94
|
+
)}
|
|
95
|
+
</div>
|
|
84
96
|
</article>
|
|
85
97
|
)
|
|
86
98
|
})
|
|
87
99
|
|
|
88
|
-
/**
|
|
89
|
-
const
|
|
90
|
-
const v = card.versionOf(on)
|
|
91
|
-
return v ? `v${v.n}` : 'the note'
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
/** a long text folded to its first lines, a « more » that unfolds it in place */
|
|
95
|
-
const LONG_WHAT = 480
|
|
100
|
+
/** a folded version's views as small previews, a chat's attachments: a click opens the version on that view */
|
|
101
|
+
const STRIP_MAX = 8
|
|
96
102
|
|
|
97
|
-
const
|
|
98
|
-
const
|
|
99
|
-
const key = `${id}#what`
|
|
100
|
-
const open = !long || card.folds[key] === true
|
|
103
|
+
const ViewStrip = observer(({ rv, card, c }: { rv: ReviewSt; card: ThreadSt; c: VersionCell }) => {
|
|
104
|
+
const views = c.item.views
|
|
101
105
|
return (
|
|
102
|
-
<div className=
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
106
|
+
<div className="rv-vtiles">
|
|
107
|
+
{views.slice(0, STRIP_MAX).map((v, i) => {
|
|
108
|
+
const file = thumbFileOf(v)
|
|
109
|
+
return (
|
|
110
|
+
<button key={i} className="rv-vtile" title={`${viewTag(c.n, i)} ${viewName(v, i)}: open it`} onMouseDown={keepFocus} onClick={() => card.reveal(c.id, i)}>
|
|
111
|
+
{/\.(png|jpe?g|webp)$/i.test(file) ? <img src={rv.thumbUrl(c.item.id, file)} alt="" loading="lazy" decoding="async" /> : <span className="rv-vtilenone">{viewKind(v, false)}</span>}
|
|
112
|
+
<span className="rv-vtiletag">{viewTag(c.n, i)}</span>
|
|
113
|
+
</button>
|
|
114
|
+
)
|
|
115
|
+
})}
|
|
116
|
+
{views.length > STRIP_MAX ? <button className="rv-vtile more" onMouseDown={keepFocus} onClick={() => card.reveal(c.id)}>+{views.length - STRIP_MAX}</button> : null}
|
|
107
117
|
</div>
|
|
108
118
|
)
|
|
109
119
|
})
|
|
110
120
|
|
|
111
|
-
/**
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
</div>
|
|
117
|
-
))
|
|
121
|
+
/** what an item a word sits on is called: its version, or the note it answers */
|
|
122
|
+
const onWords = (card: ThreadSt, on: string): string => {
|
|
123
|
+
const v = card.versionOf(on)
|
|
124
|
+
return v ? `v${v.n}` : 'the note'
|
|
125
|
+
}
|
|
118
126
|
|
|
127
|
+
/** a version: what the agent says, the facts of the repo on it, its views */
|
|
119
128
|
const VersionMain = observer(({ rv, card, c }: { rv: ReviewSt; card: ThreadSt; c: VersionCell }) => {
|
|
120
129
|
const r = c.item
|
|
121
130
|
const live = c.id === card.head?.id && card.takesVerdict
|
|
@@ -123,7 +132,7 @@ const VersionMain = observer(({ rv, card, c }: { rv: ReviewSt; card: ThreadSt; c
|
|
|
123
132
|
const stamp = card.cells.findLast((x) => x.on === c.id)?.id ?? c.id
|
|
124
133
|
return (
|
|
125
134
|
<>
|
|
126
|
-
{r.what ? <
|
|
135
|
+
{r.what ? <div className="md rv-what" dangerouslySetInnerHTML={{ __html: renderMd(r.what) }} /> : null}
|
|
127
136
|
{r.keeps ? <div className="rv-keeps"><b>keeps:</b> {r.keeps}</div> : null}
|
|
128
137
|
{r.why ? <div className="rv-pre rv-why">another subject: {r.why}</div> : null}
|
|
129
138
|
<div className="rv-cfacts">
|
|
@@ -134,6 +143,8 @@ const VersionMain = observer(({ rv, card, c }: { rv: ReviewSt; card: ThreadSt; c
|
|
|
134
143
|
<AnimPanel app={rv} item={r} />
|
|
135
144
|
{/* every version of a trailer card plays its own pinned render in the trailer entry's player */}
|
|
136
145
|
{isTrailerCard(r) ? <TrailerCardBody ver={{ rv, card, cell: c, live, claim }} item={r} /> : r.views.length > 0 ? <VersionViews ver={{ rv, card, cell: c, live, claim }} /> : null}
|
|
146
|
+
{/* a draft card holds no view: its body is the post draft itself, read live */}
|
|
147
|
+
{isDraftCard(r) ? <DraftCardBody ver={{ rv, card, cell: c, live, claim }} item={r} /> : null}
|
|
137
148
|
</>
|
|
138
149
|
)
|
|
139
150
|
})
|
|
@@ -152,7 +163,8 @@ const VerdictBody = observer(({ card, c }: { card: ThreadSt; c: VerdictCell }) =
|
|
|
152
163
|
return (
|
|
153
164
|
<>
|
|
154
165
|
<div className="rv-verdictline">
|
|
155
|
-
<span className=
|
|
166
|
+
<span className="rv-vdisc" aria-hidden="true">{VERDICTS.find((x) => x.status === c.verdict)?.glyph ?? '•'}</span>
|
|
167
|
+
<b className="rv-vwords">{STATUS_LABEL[c.verdict]}{v ? ` · v${v.n}` : ''}</b>
|
|
156
168
|
{c.current ? null : <span className="rv-dim">an earlier answer, before a reopen or a newer one</span>}
|
|
157
169
|
<span className="rv-dim">{c.read ? 'read by the agent' : 'not read yet'}</span>
|
|
158
170
|
</div>
|
|
@@ -175,7 +187,7 @@ const VerdictBody = observer(({ card, c }: { card: ThreadSt; c: VerdictCell }) =
|
|
|
175
187
|
return (
|
|
176
188
|
<button key={`q${k}`} className={`rv-noteline${q.status ? ` re-${q.status}` : ''}`} onClick={() => card.reveal(c.on, q.view)}>
|
|
177
189
|
<span className="rv-notemark">{o?.glyph ?? ''}{q.stars ? ` ★${q.stars}` : ''}</span>
|
|
178
|
-
<span className="rv-noteplace">{v ? `${viewTag(v.n, q.view)} ` : ''}{view?.label || (v ? '' : viewName(view, q.view))}{tile}</span>
|
|
190
|
+
<span className="rv-noteplace">{q.post !== undefined ? postLabel(v?.item.draft, q.post) : <>{v ? `${viewTag(v.n, q.view)} ` : ''}{view?.label || (v ? '' : viewName(view, q.view))}{tile}</>}</span>
|
|
179
191
|
<span className="rv-notetext">{q.comment || (o ? o.label : '')}</span>
|
|
180
192
|
</button>
|
|
181
193
|
)
|
|
@@ -216,7 +228,7 @@ const ReplyBody = observer(({ rv, card, c }: { rv: ReviewSt; card: ThreadSt; c:
|
|
|
216
228
|
) : null}
|
|
217
229
|
<div className="rv-pre rv-words">{c.text}</div>
|
|
218
230
|
{c.image ? (
|
|
219
|
-
<
|
|
231
|
+
<PreviewImg src={rv.threadImageUrl(c.on, c.image)} />
|
|
220
232
|
) : null}
|
|
221
233
|
{version && view && c.update?.view !== undefined ? (
|
|
222
234
|
<ViewCell
|
|
@@ -227,10 +239,78 @@ const ReplyBody = observer(({ rv, card, c }: { rv: ReviewSt; card: ThreadSt; c:
|
|
|
227
239
|
/>
|
|
228
240
|
) : null}
|
|
229
241
|
{c.update && c.party === 'agent' ? <HintBox card={card} c={c} /> : null}
|
|
242
|
+
{c.ask ? <AskBody card={card} c={c} ask={c.ask} /> : null}
|
|
243
|
+
{c.propose ? <ProposeBody card={card} c={c} p={c.propose} /> : null}
|
|
244
|
+
{c.about ? <div className="rv-dim">links {c.about.join(' · ')}</div> : null}
|
|
230
245
|
</>
|
|
231
246
|
)
|
|
232
247
|
})
|
|
233
248
|
|
|
249
|
+
/** an agent's question: one button per option, its pick marked; one click answers, the words box goes with it */
|
|
250
|
+
const AskBody = observer(({ card, c, ask }: { card: ThreadSt; c: ReplyCell; ask: NonNullable<ReplyCell['ask']> }) => {
|
|
251
|
+
const done = ask.answered
|
|
252
|
+
return (
|
|
253
|
+
<div className="rv-ask">
|
|
254
|
+
<div className="rv-askopts">
|
|
255
|
+
{ask.options.map((o, i) => (
|
|
256
|
+
<button
|
|
257
|
+
key={i}
|
|
258
|
+
className={`rv-askopt${done?.option === i ? ' picked' : ''}${ask.pick === i ? ' pick' : ''}`}
|
|
259
|
+
disabled={done !== undefined || card.busy}
|
|
260
|
+
onMouseDown={keepFocus}
|
|
261
|
+
onClick={() => void card.answer(c, { option: i })}
|
|
262
|
+
title={ask.pick === i ? "the agent's pick" : undefined}
|
|
263
|
+
>
|
|
264
|
+
<span className="rv-askn">{i + 1}</span> {o}
|
|
265
|
+
{ask.pick === i ? <span className="rv-mypick">my pick</span> : null}
|
|
266
|
+
{done?.option === i ? <span className="rv-badge">✓ yours</span> : null}
|
|
267
|
+
</button>
|
|
268
|
+
))}
|
|
269
|
+
</div>
|
|
270
|
+
{done ? null : <AnswerWords card={card} c={c} placeholder="a word with your answer (optional), then click an option" />}
|
|
271
|
+
</div>
|
|
272
|
+
)
|
|
273
|
+
})
|
|
274
|
+
|
|
275
|
+
/** an agent's proposed change of an object's text: the before and the after; « apply » lands it as it is, « apply my
|
|
276
|
+
* edit » lands the words box */
|
|
277
|
+
const ProposeBody = observer(({ card, c, p }: { card: ThreadSt; c: ReplyCell; p: NonNullable<ReplyCell['propose']> }) => {
|
|
278
|
+
const edited = (card.hints[c.id] ?? '').trim() !== ''
|
|
279
|
+
return (
|
|
280
|
+
<div className="rv-propose">
|
|
281
|
+
<div className="rv-dim">on {p.on}</div>
|
|
282
|
+
{p.before !== undefined ? <div className="rv-pre rv-before">{p.before}</div> : null}
|
|
283
|
+
<div className="rv-pre rv-after">{p.applied ? p.applied.text : p.after}</div>
|
|
284
|
+
{p.applied ? (
|
|
285
|
+
<span className="rv-badge">✓ applied</span>
|
|
286
|
+
) : (
|
|
287
|
+
<>
|
|
288
|
+
<AnswerWords card={card} c={c} placeholder="edit it here before you apply (optional)" initial={p.after} />
|
|
289
|
+
<div className="rv-askopts">
|
|
290
|
+
<button className="rv-askopt pick" disabled={card.busy} onMouseDown={keepFocus} onClick={() => void card.answer(c, { apply: true })}>
|
|
291
|
+
{edited ? 'apply my edit' : 'apply'}
|
|
292
|
+
</button>
|
|
293
|
+
</div>
|
|
294
|
+
</>
|
|
295
|
+
)}
|
|
296
|
+
</div>
|
|
297
|
+
)
|
|
298
|
+
})
|
|
299
|
+
|
|
300
|
+
/** the words that go with an answer: the hint box of the cell, kept per cell until sent */
|
|
301
|
+
const AnswerWords = observer(({ card, c, placeholder, initial }: { card: ThreadSt; c: ReplyCell; placeholder: string; initial?: string }) => (
|
|
302
|
+
<textarea
|
|
303
|
+
className="rv-answerwords"
|
|
304
|
+
rows={initial ? Math.min(6, initial.split('\n').length + 1) : 1}
|
|
305
|
+
placeholder={placeholder}
|
|
306
|
+
value={card.hints[c.id] ?? ''}
|
|
307
|
+
onFocus={() => {
|
|
308
|
+
if (initial !== undefined && (card.hints[c.id] ?? '') === '') card.setHint(c.id, initial)
|
|
309
|
+
}}
|
|
310
|
+
onChange={(e) => card.setHint(c.id, e.target.value)}
|
|
311
|
+
/>
|
|
312
|
+
))
|
|
313
|
+
|
|
234
314
|
/** his few words on one update: a hint the agent reads, the card left as it is */
|
|
235
315
|
const HintBox = observer(({ card, c }: { card: ThreadSt; c: ReplyCell }) => {
|
|
236
316
|
const text = card.hints[c.id] ?? ''
|
|
@@ -274,7 +354,7 @@ const NoteBody = ({ rv, c }: { rv: ReviewSt; c: NoteCell }) => {
|
|
|
274
354
|
</div>
|
|
275
355
|
) : null}
|
|
276
356
|
{c.rects.some((q) => q.comment) ? c.rects.map((q, k) => (q.comment ? <div key={k} className="rv-noteline rect still"><span className="rv-notemark">⬚ {k + 1}</span><span className="rv-notetext">{q.comment}</span></div> : null)) : null}
|
|
277
|
-
{c.image && c.item ? <
|
|
357
|
+
{c.image && c.item ? <PreviewImg src={rv.threadImageUrl(c.item.id, c.image)} /> : null}
|
|
278
358
|
</>
|
|
279
359
|
)
|
|
280
360
|
}
|
|
@@ -3,9 +3,21 @@
|
|
|
3
3
|
import { reach } from '../reach.ts'
|
|
4
4
|
|
|
5
5
|
/** the zoom of a view: fit the column (and the window's height), or a share of the image's own pixels */
|
|
6
|
-
|
|
6
|
+
/** `preview`: a view as a chat shows an image, at most PREVIEW_H tall; `fit`: the column's height; then the full file */
|
|
7
|
+
export const ZOOMS = ['preview', 'fit', '1', '1.5', '2'] as const
|
|
8
|
+
export const PREVIEW_H = 360
|
|
7
9
|
export type Zoom = (typeof ZOOMS)[number]
|
|
8
10
|
|
|
11
|
+
/** the size of the view in the lightbox: whole on the screen, as wide as the box (it scrolls), or a share of the
|
|
12
|
+
* image's own pixels, any share: the wheel and the keys move it by steps */
|
|
13
|
+
export type BoxZoom = 'fit' | 'width' | number
|
|
14
|
+
export const BOX_ZOOM = { min: 0.1, max: 8, step: 1.25, picks: [1, 2] } as const
|
|
15
|
+
export const isBoxZoom = (v: unknown): v is BoxZoom => v === 'fit' || v === 'width' || (typeof v === 'number' && Number.isFinite(v) && v >= BOX_ZOOM.min && v <= BOX_ZOOM.max)
|
|
16
|
+
/** a share of the image's pixels inside the range, to the percent */
|
|
17
|
+
export const boxScale = (s: number): number => Math.round(Math.max(BOX_ZOOM.min, Math.min(BOX_ZOOM.max, s)) * 100) / 100
|
|
18
|
+
/** the next size from a share: one step in or out (`by` 1 or -1, a wheel gives a fraction) */
|
|
19
|
+
export const boxStep = (from: number, by: number): number => boxScale(from * BOX_ZOOM.step ** by)
|
|
20
|
+
|
|
9
21
|
/** how a gallery draws: a side list of its images with the picked one large, one image a row at full width, or the
|
|
10
22
|
* wrapping grid of tiles at the slider's height */
|
|
11
23
|
export const GALLERY_MODES = ['tabs', 'list', 'grid'] as const
|
|
@@ -50,6 +62,16 @@ const KEPT_URLS = 4
|
|
|
50
62
|
|
|
51
63
|
/** `keep`: the browser keeps the last answer of its last few urls under this key, so a page opened again (a reload,
|
|
52
64
|
* a daemon restarting, a filter switched back) draws it in the first frame, and its first request sends the kept tag */
|
|
65
|
+
/** the cards' store refused for a while (a fold or a way back of the daemon's file): its line and the wait it names */
|
|
66
|
+
export class StoreWait extends Error {
|
|
67
|
+
constructor(
|
|
68
|
+
readonly line: string,
|
|
69
|
+
readonly retryS: number,
|
|
70
|
+
) {
|
|
71
|
+
super(line)
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
53
75
|
export function etagLoader<T>(url: () => string, o: { keep?: string } = {}): EtagLoader<T> {
|
|
54
76
|
type Last = { url: string; tag: string; value: T }
|
|
55
77
|
const key = o.keep == null ? null : `shipkit.answer.${o.keep}`
|
|
@@ -68,6 +90,10 @@ export function etagLoader<T>(url: () => string, o: { keep?: string } = {}): Eta
|
|
|
68
90
|
const last = of(u)
|
|
69
91
|
const res = await reach(u, { cache: 'no-store', headers: last ? { 'If-None-Match': last.tag } : {} })
|
|
70
92
|
if (res.status === 304 && last) return last.value
|
|
93
|
+
if (res.status === 503) {
|
|
94
|
+
const b = (await res.json().catch(() => null)) as { refused?: unknown; retryS?: unknown } | null
|
|
95
|
+
if (typeof b?.refused === 'string') throw new StoreWait(b.refused, typeof b.retryS === 'number' ? b.retryS : 2)
|
|
96
|
+
}
|
|
71
97
|
if (!res.ok) throw new Error(`${u}: HTTP ${res.status} ${await res.text().catch(() => '')}`.trim())
|
|
72
98
|
const value = (await res.json()) as T
|
|
73
99
|
const tag = res.headers.get('ETag')
|
|
@@ -1,49 +1,71 @@
|
|
|
1
1
|
// the review page's left column: the search and the filters (asked of the server), one row per thread, a page more
|
|
2
2
|
// when the list's end scrolls into view
|
|
3
3
|
import { observer } from 'mobx-react-lite'
|
|
4
|
-
import { useEffect, useRef } from 'react'
|
|
4
|
+
import { Fragment, useEffect, useRef } from 'react'
|
|
5
5
|
import type { ThreadRow } from '../../../review/cells.ts'
|
|
6
6
|
import { MOVE_LABEL, STATUS_LABEL, subjectLabel, UPDATE_WORDS, type Move, type ShownStatus } from '../../../review/model.ts'
|
|
7
7
|
import { AutoTag, LaneTag, laneColor, Listeners, Rework, ThumbOf, toneOf } from './kit.tsx'
|
|
8
8
|
import { ReviewBoard } from './review-board.tsx'
|
|
9
9
|
import type { ReviewSt } from './review-st.ts'
|
|
10
|
+
import { ListFilter } from '../list-filter.tsx'
|
|
11
|
+
import { Pop, Tip } from '../floating.tsx'
|
|
12
|
+
import { Icon, ICON } from '../icons.tsx'
|
|
10
13
|
|
|
11
14
|
const ALL = ''
|
|
12
15
|
|
|
13
16
|
export const ReviewList = observer(({ rv }: { rv: ReviewSt }) => (
|
|
14
17
|
<div className="rv-listcol">
|
|
15
18
|
<div className="rv-filters">
|
|
16
|
-
<
|
|
17
|
-
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
<select aria-label="state" value={rv.status ?? ALL} onChange={(e) => rv.setFilter({ status: e.currentTarget.value === ALL ? null : (e.currentTarget.value as ShownStatus) })}>
|
|
24
|
-
<option value={ALL}>every state</option>
|
|
25
|
-
{(Object.keys(STATUS_LABEL) as ShownStatus[]).map((s) => <option key={s} value={s}>{STATUS_LABEL[s]}</option>)}
|
|
26
|
-
</select>
|
|
27
|
-
</div>
|
|
28
|
-
<span className="seg rv-whose" aria-label="whose move">
|
|
29
|
-
<button className={rv.whose === null ? 'on' : ''} onClick={() => rv.setFilter({ whose: null })}>all</button>
|
|
30
|
-
{(['owner', 'agents', 'none'] as const).map((m: Move) => (
|
|
31
|
-
<button key={m} className={rv.whose === m ? 'on' : ''} onClick={() => rv.setFilter({ whose: m })}>{MOVE_LABEL[m]}</button>
|
|
32
|
-
))}
|
|
33
|
-
</span>
|
|
34
|
-
<div className="rv-switches">
|
|
35
|
-
<label className="rv-switch"><input type="checkbox" checked={rv.hideHandled} onChange={(e) => rv.setHideHandled(e.currentTarget.checked)} />hide handled</label>
|
|
36
|
-
<label className="rv-switch"><input type="checkbox" checked={rv.byLane} onChange={(e) => rv.setByLane(e.currentTarget.checked)} />by lane</label>
|
|
37
|
-
{rv.spec?.dispatcher ? <label className="rv-switch"><input type="checkbox" checked={rv.board} onChange={(e) => rv.setBoard(e.currentTarget.checked)} />board</label> : null}
|
|
38
|
-
</div>
|
|
39
|
-
<div className="rv-count">
|
|
40
|
-
{rv.activeCount} active · {rv.pendingCount} waiting{rv.page ? ` · ${rv.page.total} shown of ${rv.page.counts.threads} threads` : ''}
|
|
41
|
-
</div>
|
|
19
|
+
<ListFilter side={rv.side} value={rv.query} set={(v) => rv.setQuery(v)} keep={(el) => { rv.searchEl = el }} placeholder="search every version and message" label="search every version and message" />
|
|
20
|
+
<ListToggle on={rv.hideHandled} set={(v) => rv.setHideHandled(v)} icon={ICON.hideHandled} label="hide handled" says={rv.hideHandled ? 'hide handled: on, the threads you answered are hidden' : 'hide handled: off, every thread shows'} />
|
|
21
|
+
<ListToggle on={rv.byLane} set={(v) => rv.setByLane(v)} icon={ICON.byLane} label="by lane" says={rv.byLane ? 'by lane: on, the threads are grouped by the lane that sent them' : 'by lane: off, one list, newest first'} />
|
|
22
|
+
<Pop className={`rv-filterbtn${changed(rv) > 0 ? ' on' : ''}`} popClass="fpop rv-filterpop" placement="bottom-end" aria-label="the filters" title={`filters: ${rv.activeCount} active, ${rv.pendingCount} waiting`}
|
|
23
|
+
label={<><Icon d={ICON.filter} />{changed(rv) > 0 ? <b>{changed(rv)}</b> : null}</>}>
|
|
24
|
+
{() => <Filters rv={rv} />}
|
|
25
|
+
</Pop>
|
|
42
26
|
</div>
|
|
43
27
|
{rv.board && rv.spec?.dispatcher ? <ReviewBoard rv={rv} /> : <Rows rv={rv} />}
|
|
44
28
|
</div>
|
|
45
29
|
))
|
|
46
30
|
|
|
31
|
+
/** a switch of the list in its top row: an icon that reads pressed while on, its words at once on hover */
|
|
32
|
+
const ListToggle = ({ on, set, icon, label, says }: { on: boolean; set: (v: boolean) => void; icon: string; label: string; says: string }) => (
|
|
33
|
+
<Tip instant content={says} placement="bottom">
|
|
34
|
+
<button type="button" role="switch" aria-checked={on} aria-label={label} className={`rv-filterbtn rv-listtoggle${on ? ' on' : ''}`} onClick={() => set(!on)}><Icon d={icon} /></button>
|
|
35
|
+
</Tip>
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
/** how many filters behind the button differ from the list as it opens: a subject, a state, whose move, the board */
|
|
39
|
+
const changed = (rv: ReviewSt): number =>
|
|
40
|
+
[rv.subject != null, rv.status != null, rv.whose != null, rv.board].filter(Boolean).length
|
|
41
|
+
|
|
42
|
+
/** the filters behind the button beside the search: they are rarely touched, so the list keeps its height. The two
|
|
43
|
+
* switches he flips often (hide handled, by lane) sit in the row itself */
|
|
44
|
+
const Filters = observer(({ rv }: { rv: ReviewSt }) => (
|
|
45
|
+
<div className="rv-filterbox">
|
|
46
|
+
<div className="rv-count">{rv.activeCount} active · {rv.pendingCount} waiting{rv.page ? ` · ${rv.page.total} shown of ${rv.page.counts.threads} threads` : ''}</div>
|
|
47
|
+
<select aria-label="subject" className={rv.subject ? 'set' : ''} value={rv.subject ?? ALL} onChange={(e) => rv.setFilter({ subject: e.currentTarget.value === ALL ? null : e.currentTarget.value })}>
|
|
48
|
+
<option value={ALL}>every subject</option>
|
|
49
|
+
{rv.subjects.map((k) => <option key={k} value={k}>{subjectLabel(k, rv.spec ?? undefined)}</option>)}
|
|
50
|
+
</select>
|
|
51
|
+
<select aria-label="state" className={rv.status ? 'set' : ''} value={rv.status ?? ALL} onChange={(e) => rv.setFilter({ status: e.currentTarget.value === ALL ? null : (e.currentTarget.value as ShownStatus) })}>
|
|
52
|
+
<option value={ALL}>every state</option>
|
|
53
|
+
{(Object.keys(STATUS_LABEL) as ShownStatus[]).map((s) => <option key={s} value={s}>{STATUS_LABEL[s]}</option>)}
|
|
54
|
+
</select>
|
|
55
|
+
<span className="seg" aria-label="whose move">
|
|
56
|
+
<button className={rv.whose === null ? 'on' : ''} onClick={() => rv.setFilter({ whose: null })}>all</button>
|
|
57
|
+
{(['owner', 'agents', 'none'] as const).map((m: Move) => (
|
|
58
|
+
<button key={m} className={rv.whose === m ? 'on' : ''} onClick={() => rv.setFilter({ whose: m })}>{MOVE_LABEL[m]}</button>
|
|
59
|
+
))}
|
|
60
|
+
</span>
|
|
61
|
+
{rv.spec?.dispatcher ? <label className="rv-switch"><input type="checkbox" checked={rv.board} onChange={(e) => rv.setBoard(e.currentTarget.checked)} />board</label> : null}
|
|
62
|
+
{changed(rv) > 0 ? <button className="ghost" onClick={() => {
|
|
63
|
+
rv.setFilter({ subject: null, status: null, whose: null })
|
|
64
|
+
rv.setBoard(false)
|
|
65
|
+
}}>reset the filters</button> : null}
|
|
66
|
+
</div>
|
|
67
|
+
))
|
|
68
|
+
|
|
47
69
|
const Rows = observer(({ rv }: { rv: ReviewSt }) => {
|
|
48
70
|
const open = rv.openRow
|
|
49
71
|
return (
|
|
@@ -55,12 +77,18 @@ const Rows = observer(({ rv }: { rv: ReviewSt }) => {
|
|
|
55
77
|
{g.rows.map((r) => <Row key={r.head} rv={rv} r={r} on={r === open} />)}
|
|
56
78
|
</div>
|
|
57
79
|
))
|
|
58
|
-
: rv.rows.map((r) =>
|
|
80
|
+
: rv.rows.map((r, i) => (
|
|
81
|
+
<Fragment key={r.head}>
|
|
82
|
+
{i === 0 || rv.rows[i - 1]?.turn !== r.turn ? <TurnHeader turn={r.turn} n={rv.rows.filter((x) => x.turn === r.turn).length} /> : null}
|
|
83
|
+
<Row rv={rv} r={r} on={r === open} />
|
|
84
|
+
</Fragment>
|
|
85
|
+
))}
|
|
59
86
|
{rv.page && rv.rows.length === 0 ? (
|
|
60
|
-
<div className="rv-empty">{rv.page.counts.threads === 0 ? 'No
|
|
87
|
+
<div className="rv-empty">{rv.page.counts.threads === 0 ? 'No thread yet. An agent starts one with sk thread post <address>.' : rv.hideHandled && !rv.q ? 'Nothing active: « hide handled » hides the handled threads.' : 'No thread matches.'}</div>
|
|
61
88
|
) : null}
|
|
62
89
|
{rv.more > 0 ? <More rv={rv} /> : null}
|
|
63
|
-
{rv.
|
|
90
|
+
{rv.listWait !== null ? <div className="rv-empty"><span className="spin" /> {rv.listWait}</div> : null}
|
|
91
|
+
{rv.page === null && rv.listError === null && rv.listWait === null ? <div className="rv-empty"><span className="spin" /> reading the threads…</div> : null}
|
|
64
92
|
{rv.listError !== null ? <div className="rv-err">{rv.listError}</div> : null}
|
|
65
93
|
{rv.broken.map((b) => <div key={b.id} className="rv-err">unreadable: {b.id} ({b.error})</div>)}
|
|
66
94
|
</div>
|
|
@@ -80,6 +108,16 @@ const More = observer(({ rv }: { rv: ReviewSt }) => {
|
|
|
80
108
|
return <button ref={el} className="ghost rv-more" onClick={() => rv.showMore()}>{rv.more} more</button>
|
|
81
109
|
})
|
|
82
110
|
|
|
111
|
+
const TURN_WORDS: Record<ThreadRow['turn'], string> = { yours: 'your turn', working: 'an agent works on it', done: 'done' }
|
|
112
|
+
|
|
113
|
+
/** who acts now on the threads under it: his turn first, then the agents' work, then what is done */
|
|
114
|
+
const TurnHeader = ({ turn, n }: { turn: ThreadRow['turn']; n: number }) => (
|
|
115
|
+
<div className={`rv-turnhead turn-${turn}`}>
|
|
116
|
+
<b>{TURN_WORDS[turn]}</b>
|
|
117
|
+
<span className="rv-dim">{n}</span>
|
|
118
|
+
</div>
|
|
119
|
+
)
|
|
120
|
+
|
|
83
121
|
const LaneHeader = observer(({ rv, lane, rows }: { rv: ReviewSt; lane: string | null; rows: readonly ThreadRow[] }) => (
|
|
84
122
|
<div className="rv-lanehead" style={lane ? { ['--lane' as string]: laneColor(lane) } : undefined}>
|
|
85
123
|
<b>{lane ?? 'no lane'}</b>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
// a repo's review page (`#page:review`, wiki tools/shipkit/
|
|
1
|
+
// a repo's review page (`#page:review`, wiki tools/shipkit/threads.md, The review page): the cards on the left, the open
|
|
2
2
|
// one as a chat on the right (review-thread.tsx). On a phone one pane at a time: the cards, or the card with its answer
|
|
3
3
|
// box and the verdicts under the thumb. Everything is read while the page shows
|
|
4
4
|
import { observer } from 'mobx-react-lite'
|
|
5
5
|
import { useEffect } from 'react'
|
|
6
6
|
import { Panel, Separator } from 'react-resizable-panels'
|
|
7
|
-
import { KeptCols } from '../kept-cols.tsx'
|
|
7
|
+
import { KeptCols, LIST_COL, PANEL } from '../kept-cols.tsx'
|
|
8
8
|
import type { RepoSt } from '../repo-st.ts'
|
|
9
9
|
import { ReviewList } from './review-list.tsx'
|
|
10
10
|
import type { ReviewSt } from './review-st.ts'
|
|
@@ -34,7 +34,7 @@ export const ReviewPage = observer(({ app }: { app: RepoSt }) => {
|
|
|
34
34
|
<>
|
|
35
35
|
<Toast rv={rv} />
|
|
36
36
|
<KeptCols id="review" folds={{ left: 'review-list' }} layout={app.home.layout}>
|
|
37
|
-
<Panel id="review-list"
|
|
37
|
+
<Panel id="review-list" {...LIST_COL} className="rv-pane" style={PANEL}>
|
|
38
38
|
<ReviewList rv={rv} />
|
|
39
39
|
</Panel>
|
|
40
40
|
<Separator className="rsep" />
|
|
@@ -47,17 +47,16 @@ export const ReviewPage = observer(({ app }: { app: RepoSt }) => {
|
|
|
47
47
|
})
|
|
48
48
|
|
|
49
49
|
/** the phone's top line over the cards: the way back to the hub (none in another tool's frame), the repo, the count
|
|
50
|
-
* that waits on him. On a phone the page covers the hub's panes, which leave it no room */
|
|
51
|
-
export const PhoneTop = observer(({ app }: { app: RepoSt }) => (
|
|
50
|
+
* that waits on him (`what`: a page that says its own). On a phone the page covers the hub's panes, which leave it no room */
|
|
51
|
+
export const PhoneTop = observer(({ app, what }: { app: RepoSt; what?: string }) => (
|
|
52
52
|
<div className="rv-phonetop">
|
|
53
53
|
{app.home.embedded ? null : <button className="ghost" onClick={() => app.showReadme()}>◂ hub</button>}
|
|
54
54
|
<b>{app.name}</b>
|
|
55
|
-
<span className="rv-dim">{app.sel?.t === 'trailer' ? 'trailer' : app.sel?.t === 'stores' ? 'stores' : app.sel?.t === 'veille' ? 'veille' : app.sel?.t === 'comms' ? 'communications' : app.sel?.t === 'social' ? 'social' : `review${app.review.pendingCount > 0 ? ` · ${app.review.pendingCount} waiting` : ''}`}</span>
|
|
55
|
+
<span className="rv-dim">{what ?? (app.sel?.t === 'trailer' ? 'trailer' : app.sel?.t === 'stores' ? 'stores' : app.sel?.t === 'veille' ? 'veille' : app.sel?.t === 'comms' ? 'communications' : app.sel?.t === 'social' ? 'social' : `review${app.review.pendingCount > 0 ? ` · ${app.review.pendingCount} waiting` : ''}`)}</span>
|
|
56
56
|
</div>
|
|
57
57
|
))
|
|
58
58
|
|
|
59
59
|
/** what the last copy put on the clipboard, a moment over the page */
|
|
60
60
|
const Toast = observer(({ rv }: { rv: ReviewSt }) => (rv.toast ? <div className="rv-toast" role="status">{rv.toast}</div> : null))
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
export const PANEL = { overflow: 'hidden' } as const
|
|
62
|
+
export { PANEL } from '../kept-cols.tsx'
|