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
|
@@ -5,15 +5,12 @@ import { Fragment, useEffect, useRef, type ReactNode } from 'react'
|
|
|
5
5
|
import type { StartSt } from './start-st.ts'
|
|
6
6
|
import type { ThreadRow } from '../../../review/cells.ts'
|
|
7
7
|
import { MOVE_LABEL, STATUS_LABEL, subjectLabel, UPDATE_WORDS, type Move, type ShownStatus } from '../../../review/model.ts'
|
|
8
|
-
import { isOwnerWait, OWNER_WAITS, type OwnerWait } from '../../../review/wait.ts'
|
|
9
8
|
import { waitGlyph } from './object-panel.tsx'
|
|
10
|
-
import { staleWorkingOf, waitingWords, type Band } from '../../../review/band.ts'
|
|
11
9
|
import { cursorWords } from '../../../review/traces.ts'
|
|
12
10
|
import { actorName } from '../../../review/parties.ts'
|
|
13
11
|
import { DeafMark, deafThread, rowMarks } from '../deaf.tsx'
|
|
14
12
|
import { laneAskWords } from '../../../review/lane-ask.ts'
|
|
15
13
|
import { HeadPop, HolderChip, laneColor } from './kit.tsx'
|
|
16
|
-
import { ReviewBoard } from './review-board.tsx'
|
|
17
14
|
import type { ReviewSt } from './review-st.ts'
|
|
18
15
|
import type { ListPlace } from '../layout-st.ts'
|
|
19
16
|
import { ListFilter } from '../list-filter.tsx'
|
|
@@ -22,6 +19,7 @@ import { Icon, ICON } from '../icons.tsx'
|
|
|
22
19
|
import { SectionHead } from '../section-head.tsx'
|
|
23
20
|
import { ThreadRow as ThreadRowView, VerbGlyph } from '../thread-row.tsx'
|
|
24
21
|
import { tip } from '../tips.ts'
|
|
22
|
+
import { staleWorkingOf, waitingWords, type Band, isOwnerWait, OWNER_WAITS, type OwnerWait } from '../../../review/thread-state.ts'
|
|
25
23
|
|
|
26
24
|
const ALL = ''
|
|
27
25
|
|
|
@@ -57,7 +55,7 @@ export const ReviewList = observer(({ rv, place = 'left', tools, top }: { rv: Re
|
|
|
57
55
|
{rv.can('start') && rv.newThread !== null && rv.newThread.starts.length > 0 ? <StartThread rv={rv} st={rv.newThread} /> : null}
|
|
58
56
|
{rv.since && rv.since.moved > 0 ? <div className="rv-since" {...tip(`${sinceWords(rv.since)}\nsince your last act here, ${new Date(rv.since.at).toLocaleString()}`)}><span className="sincelead">since you left: </span>{rv.since.moved}<span className="sincew"> moved</span>, <b>{rv.since.yours}<span className="sincew"> yours</span></b></div> : null}
|
|
59
57
|
</div>
|
|
60
|
-
|
|
58
|
+
<Rows rv={rv} />
|
|
61
59
|
</div>
|
|
62
60
|
))
|
|
63
61
|
|
|
@@ -135,9 +133,9 @@ const ListToggle = ({ on, set, icon, label, says }: { on: boolean; set: (v: bool
|
|
|
135
133
|
/** what each « whose move » choice keeps */
|
|
136
134
|
const MOVE_SAYS: Record<Move, string> = { owner: 'only the threads where your move is next', agents: 'only the threads where an agent moves next', none: 'only the threads where nobody owes a move' }
|
|
137
135
|
|
|
138
|
-
/** how many filters behind the button differ from the list as it opens: a subject, a state, whose move
|
|
136
|
+
/** how many filters behind the button differ from the list as it opens: a subject, a state, whose move */
|
|
139
137
|
const changed = (rv: ReviewSt): number =>
|
|
140
|
-
[rv.subject != null, rv.status != null, rv.whose != null
|
|
138
|
+
[rv.subject != null, rv.status != null, rv.whose != null].filter(Boolean).length
|
|
141
139
|
|
|
142
140
|
/** the filters behind the button beside the search: they are rarely touched, so the list keeps its height. The two
|
|
143
141
|
* switches he flips often (hide handled, by lane) sit in the row itself */
|
|
@@ -158,22 +156,18 @@ const Filters = observer(({ rv }: { rv: ReviewSt }) => (
|
|
|
158
156
|
<button key={m} className={rv.whose === m ? 'on' : ''} {...tip(MOVE_SAYS[m])} onClick={() => rv.setFilter({ whose: m })}>{MOVE_LABEL[m]}</button>
|
|
159
157
|
))}
|
|
160
158
|
</span>
|
|
161
|
-
{rv
|
|
162
|
-
{changed(rv) > 0 ? <button className="ghost" {...tip('subject, state and whose move back to every thread, and the list in place of the board')} onClick={() => {
|
|
163
|
-
rv.setFilter({ subject: null, status: null, whose: null })
|
|
164
|
-
rv.setBoard(false)
|
|
165
|
-
}}>reset the filters</button> : null}
|
|
159
|
+
{changed(rv) > 0 ? <button className="ghost" {...tip('subject, state and whose move back to every thread')} onClick={() => rv.setFilter({ subject: null, status: null, whose: null })}>reset the filters</button> : null}
|
|
166
160
|
</div>
|
|
167
161
|
))
|
|
168
162
|
|
|
169
163
|
/** a row of his turn that nobody hears: a word he writes there reaches no agent */
|
|
170
|
-
const deafRow = (rv: ReviewSt, r: ThreadRow): boolean => isOwnerWait(r.wait) && !r.aside && rv.can('lane') && rv.hearingOf(r.holder).light === 'nobody'
|
|
164
|
+
const deafRow = (rv: ReviewSt, r: ThreadRow): boolean => isOwnerWait(r.state.wait) && !r.state.aside && rv.can('lane') && rv.hearingOf(r.state.holder).light === 'nobody'
|
|
171
165
|
|
|
172
166
|
/** the heads that wear the deaf mark (deaf.tsx rowMarks): each row of his turn nobody hears, unless every such row is
|
|
173
167
|
* deaf and the head line over the list wears the mark, which says it once. The host says so (review-host.ts
|
|
174
168
|
* headSaysDeaf), and is asked only when every row is deaf: a reader with no deaf row needs nothing of it */
|
|
175
169
|
function deafMarks(rv: ReviewSt): Set<string> {
|
|
176
|
-
const his = rv.rows.filter((r) => isOwnerWait(r.wait) && !r.aside)
|
|
170
|
+
const his = rv.rows.filter((r) => isOwnerWait(r.state.wait) && !r.state.aside)
|
|
177
171
|
const deaf = his.map((r) => deafRow(rv, r))
|
|
178
172
|
if (!deaf.some(Boolean)) return new Set()
|
|
179
173
|
const marks = rowMarks(deaf, deaf.every(Boolean) && (rv.host.headSaysDeaf ?? false))
|
|
@@ -242,7 +236,7 @@ const More = observer(({ rv }: { rv: ReviewSt }) => {
|
|
|
242
236
|
return <button ref={el} className="ghost rv-more" {...tip('read the next page of threads; it comes on its own as the list end scrolls into view')} onClick={() => rv.showMore()}>{rv.more} more</button>
|
|
243
237
|
})
|
|
244
238
|
|
|
245
|
-
/** a row's band with the parties the page polls (review/
|
|
239
|
+
/** a row's band with the parties the page polls (review/thread-state.ts): an agent's move splits by whether a live agent works it */
|
|
246
240
|
const bandOfRow = (rv: ReviewSt, r: ThreadRow): Band => rv.bandOfRow(r)
|
|
247
241
|
|
|
248
242
|
const laneBand = (lane: string | null): string => `lane:${lane ?? ''}`
|
|
@@ -278,28 +272,26 @@ const Row = observer(({ rv, r, on, deaf }: { rv: ReviewSt; r: ThreadRow; on: boo
|
|
|
278
272
|
useEffect(() => {
|
|
279
273
|
if (on) ref.current?.scrollIntoView({ block: 'nearest' })
|
|
280
274
|
}, [on])
|
|
281
|
-
const deferred = r.aside ? (rv.host.owner?.home.advisors.deferredName(rv.host.name, r.head) ?? null) : null
|
|
282
|
-
const cursors = rv.cursorsOf(r.head, r.cursor)
|
|
283
|
-
const stale = staleWorkingOf(r, rv.bandNow)
|
|
284
|
-
// he just settled it: its place held, drawn done (dim, its check) until he opens another thread
|
|
285
|
-
const settled = rv.staying?.head === r.head
|
|
275
|
+
const deferred = r.state.aside ? (rv.host.owner?.home.advisors.deferredName(rv.host.name, r.head) ?? null) : null
|
|
276
|
+
const cursors = rv.cursorsOf(r.head, r.state.cursor ?? undefined)
|
|
277
|
+
const stale = staleWorkingOf(r.state, rv.bandNow)
|
|
286
278
|
const words = [
|
|
287
279
|
r.versions > 1 ? <span className="rv-rowv" {...tip(`${r.versions} versions in this thread`)}>v{r.versions}</span> : null,
|
|
288
280
|
r.rule ? <span {...tip(`raised by the auto rule ${r.rule}`)}>auto</span> : null,
|
|
289
|
-
r.aside ? <span className="rv-rowaside" {...tip(`${deferred !== null ? `deferred to ${deferred}` : `back ${BACK(r.aside.until)}`}${r.aside.moved ? ', an agent wrote since' : ''}`)}>{deferred !== null ? `deferred to ${deferred}` : `back ${backShort(r.aside.until, rv.now)}`}{r.aside.moved ? ', moved' : ''}</span> : null,
|
|
290
|
-
r.laneAsk ? <span className="rv-rowlane">{laneAskWords(r.laneAsk, r.
|
|
291
|
-
r.update?.state === 'broken' && !isOwnerWait(r.wait) ? <span className="rv-rowstate" {...tip(`${UPDATE_WORDS.broken}: ${r.update.text}`)}>broken</span> : null,
|
|
281
|
+
r.state.aside ? <span className="rv-rowaside" {...tip(`${deferred !== null ? `deferred to ${deferred}` : `back ${BACK(r.state.aside.until)}`}${r.state.aside.moved ? ', an agent wrote since' : ''}`)}>{deferred !== null ? `deferred to ${deferred}` : `back ${backShort(r.state.aside.until, rv.now)}`}{r.state.aside.moved ? ', moved' : ''}</span> : null,
|
|
282
|
+
r.state.laneAsk ? <span className="rv-rowlane">{laneAskWords(r.state.laneAsk, r.state.holder, rv.parties, rv.partiesRepo || rv.host.name)}</span> : null,
|
|
283
|
+
r.update?.state === 'broken' && !isOwnerWait(r.state.wait) ? <span className="rv-rowstate" {...tip(`${UPDATE_WORDS.broken}: ${r.update.text}`)}>broken</span> : null,
|
|
292
284
|
stale ? <span className="rv-rowstate" {...tip(`${stale}: nobody works on it now`)}>{stale}</span> : null,
|
|
293
|
-
deaf ? <DeafMark why={deafThread(r.holder ? rv.hearingOf(r.holder).chip : null)} /> : null,
|
|
285
|
+
deaf ? <DeafMark why={deafThread(r.state.holder ? rv.hearingOf(r.state.holder).chip : null)} /> : null,
|
|
294
286
|
r.advisors !== undefined && r.advisors.length > 0 ? (rv.host.rowFaces?.(r.head, r.advisors) ?? null) : null,
|
|
295
287
|
].filter((w) => w !== null)
|
|
296
288
|
const hint = [
|
|
297
|
-
r.holder ? `held by ${r.holder.lane ?? rv.hearingOf(r.holder).chip}` : null,
|
|
289
|
+
r.state.holder ? `held by ${r.state.holder.lane ?? rv.hearingOf(r.state.holder).chip}` : null,
|
|
298
290
|
// who read his word or is on it reads here only: the row's one meta line keeps what he acts on
|
|
299
291
|
...cursors.map((c) => `${cursorWords(c, actorName(c.who, c.session, rv.parties))}${c.working ? `: ${c.working}` : ''}`),
|
|
300
292
|
r.versions > 1 ? `v${r.versions}` : null,
|
|
301
293
|
r.rule ? 'auto' : null,
|
|
302
|
-
r.aside ? (deferred !== null ? `deferred to ${deferred}` : `back ${BACK(r.aside.until)}`) : null,
|
|
294
|
+
r.state.aside ? (deferred !== null ? `deferred to ${deferred}` : `back ${BACK(r.state.aside.until)}`) : null,
|
|
303
295
|
].filter((w) => w !== null).join(' · ')
|
|
304
296
|
return (
|
|
305
297
|
<ThreadRowView
|
|
@@ -308,21 +300,21 @@ const Row = observer(({ rv, r, on, deaf }: { rv: ReviewSt; r: ThreadRow; on: boo
|
|
|
308
300
|
row={r.head}
|
|
309
301
|
title={r.title}
|
|
310
302
|
on={on}
|
|
311
|
-
muted={
|
|
303
|
+
muted={!on && !r.state.active && !isOwnerWait(r.state.wait)}
|
|
312
304
|
unread={r.unread}
|
|
313
|
-
validated={
|
|
305
|
+
validated={r.state.validated}
|
|
314
306
|
thumb={r.thumb ? rv.tileUrl(r.head, r.thumb) : null}
|
|
315
307
|
{...(rv.byLane ? { turn: bandOfRow(rv, r), turnSays: rv.bandWord(bandOfRow(rv, r)) } : {})}
|
|
316
|
-
{...(
|
|
317
|
-
glyph={
|
|
318
|
-
holder={<HolderChip rv={rv} holder={r.holder} plain />}
|
|
308
|
+
{...(isOwnerWait(r.state.wait) ? { need: r.state.wait, needSays: MUST_SAYS[r.state.wait] } : r.state.owed ? { owed: r.state.owed } : {})}
|
|
309
|
+
glyph={r.state.waitsOn && isOwnerWait(r.state.wait) ? waitGlyph(r.state.waitsOn, rv.spec) : null}
|
|
310
|
+
holder={<HolderChip rv={rv} holder={r.state.holder} plain />}
|
|
319
311
|
words={words}
|
|
320
312
|
{...(r.code ? { code: r.code, onCode: () => void rv.copyCode(r.code) } : {})}
|
|
321
313
|
{...(r.tags?.length ? { tags: r.tags } : {})}
|
|
322
314
|
{...(hint ? { hint } : {})}
|
|
323
315
|
at={Date.parse(r.updated)}
|
|
324
316
|
clock={rv}
|
|
325
|
-
pill={r.update?.state === 'broken' && isOwnerWait(r.wait) ? { words: 'broken', tone: 'red', title: `${UPDATE_WORDS.broken}: ${r.update.text}` } : null}
|
|
317
|
+
pill={r.update?.state === 'broken' && isOwnerWait(r.state.wait) ? { words: 'broken', tone: 'red', title: `${UPDATE_WORDS.broken}: ${r.update.text}` } : null}
|
|
326
318
|
{...(r.update ? { tip: `${UPDATE_WORDS[r.update.state]}: ${r.update.text}` } : {})}
|
|
327
319
|
onClick={() => rv.pick(r.head)}
|
|
328
320
|
onPointerEnter={() => rv.views.warm(r.head, r.updated)}
|
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
// a repo's review page as state (wiki tools/shipkit/threads.md, The review page): the list as pages of threads
|
|
2
2
|
// (`GET /api/review/threads`, the filters and the search asked of the server), the open thread
|
|
3
|
-
// (thread-st.ts), the watches,
|
|
3
|
+
// (thread-st.ts), the watches, his prefs. Every read is polled every 2 s while the page shows and answered
|
|
4
4
|
// 304 when the store did not move. His drafts are kept in the browser until they are sent
|
|
5
5
|
import { makeAutoObservable, observableRef, reaction, runInAction } from 'mobx'
|
|
6
|
-
import { PAGE, type
|
|
6
|
+
import { PAGE, type RefThread, type ThreadPage, type ThreadRow } from '../../../review/cells.ts'
|
|
7
7
|
import type { RefBox } from '../auto-text.tsx'
|
|
8
8
|
import type { Cursor } from '../../../review/traces.ts'
|
|
9
9
|
import { MOVE_LABEL, pasteBase, pasteBlock, STATUS_LABEL, type Move, type ReviewStatus, type ShownStatus, type Spec } from '../../../review/model.ts'
|
|
10
10
|
import { cellCopy, type CopyCell } from '../../../review/cell-copy.ts'
|
|
11
11
|
import type { PasteHosts } from '../../../review/paste.ts'
|
|
12
|
-
import { OWNER_WAITS, waitsOfParam, type OwnerWait } from '../../../review/wait.ts'
|
|
13
|
-
import type { Role } from '../../../review/role.ts'
|
|
14
12
|
import type { RepoSt } from '../repo-st.ts'
|
|
15
13
|
import { ADVISOR_WHO, type ReviewHost } from './review-host.ts'
|
|
16
|
-
import { BAND_WORDS, BANDS, bandOf, type Band } from '../../../review/band.ts'
|
|
17
14
|
import { answeredAs, copyText, etagLoader, READ_MS, StoreWait, kept, threadPageLoader, postJson, TILE_H, ZOOMS, boxScale, isBoxZoom, type BoxZoom, type EtagLoader, type Zoom } from './review-kit.ts'
|
|
18
15
|
import { ThreadSt, type Draft } from './thread-st.ts'
|
|
19
16
|
import { HELD_THREADS, ThreadViews } from './thread-views.ts'
|
|
@@ -26,6 +23,8 @@ import { sideOf, type SideList } from '../list-walk.ts'
|
|
|
26
23
|
import { hearingOf, NO_PARTIES, treeOf, type Hearing, type Holder, type Parties, type TreeRow } from '../../../review/parties.ts'
|
|
27
24
|
import { reach } from '../reach.ts'
|
|
28
25
|
import { StartSt } from './start-st.ts'
|
|
26
|
+
import { toneKey } from './tones.ts'
|
|
27
|
+
import { BAND_WORDS, BANDS, bandOf, type Band, OWNER_WAITS, waitsOfParam, type OwnerWait } from '../../../review/thread-state.ts'
|
|
29
28
|
|
|
30
29
|
/** how a pair of images shows: side by side, the curtain, one over the other, the after alone */
|
|
31
30
|
/** side by side, the curtain, the onion skin, the after alone, or only what changed (the after's changed pixels) */
|
|
@@ -34,8 +33,8 @@ export const COMPARE_MODES: readonly CompareMode[] = ['side', 'swipe', 'onion',
|
|
|
34
33
|
/** the side a rectangle lands on: the after alone and the changes draw on the after */
|
|
35
34
|
export const drawnSide = (mode: CompareMode, drawn: 'before' | 'after'): 'before' | 'after' => (mode === 'mod' || mode === 'diff' ? 'after' : drawn)
|
|
36
35
|
|
|
37
|
-
/** a repo's review unit as the page reads it: the words of its kinds and topics, its
|
|
38
|
-
export type RepoSpec = Spec & {
|
|
36
|
+
/** a repo's review unit as the page reads it: the words of its kinds and topics, its sources and auto rules */
|
|
37
|
+
export type RepoSpec = Spec & { sources: string[]; auto: { id: string; every: string }[]; where?: PasteHosts | null }
|
|
39
38
|
|
|
40
39
|
/** below this width the page is the phone's: one pane at a time, the verdicts in a bar under the thumb */
|
|
41
40
|
export const PHONE_PX = 768
|
|
@@ -160,9 +159,6 @@ export class ReviewSt {
|
|
|
160
159
|
shown = PAGE
|
|
161
160
|
/** the repo's review unit in words, read when the page starts */
|
|
162
161
|
spec: RepoSpec | null = null
|
|
163
|
-
/** the dispatcher's board in place of the threads */
|
|
164
|
-
board = false
|
|
165
|
-
boardRows: BoardRow[] | null = null
|
|
166
162
|
/** who holds each thread and who hears it: the sessions and lanes its holders name (review/parties.ts) */
|
|
167
163
|
parties: Parties = NO_PARTIES
|
|
168
164
|
/** the repo's name as the registry says it, for « the next session in <repo> » */
|
|
@@ -180,7 +176,7 @@ export class ReviewSt {
|
|
|
180
176
|
subject: string | null = null
|
|
181
177
|
whose: Move | null = null
|
|
182
178
|
status: ShownStatus | null = null
|
|
183
|
-
/** « what I must do »: these verbs of his (review/
|
|
179
|
+
/** « what I must do »: these verbs of his (review/thread-state.ts), null every thread */
|
|
184
180
|
waits: OwnerWait[] | null = null
|
|
185
181
|
/** « hide handled »: only the active threads in the list */
|
|
186
182
|
hideHandled = true
|
|
@@ -232,7 +228,6 @@ export class ReviewSt {
|
|
|
232
228
|
private readonly loadParties: () => Promise<{ repo: string; parties: Parties }>
|
|
233
229
|
/** the last answer compared: a 304 hands it again, and a 315 KB compare every 2 s is not free */
|
|
234
230
|
private partiesRead: Parties | null = null
|
|
235
|
-
private readonly loadBoard: () => Promise<{ role: Role | null; rows: BoardRow[] }>
|
|
236
231
|
/** every thread of the repo by its code and title, closed ones too: what the `@` and `#` lists of a box find; read
|
|
237
232
|
* when one opens (palette-st.ts), null before */
|
|
238
233
|
codes: RefThread[] | null = null
|
|
@@ -252,7 +247,6 @@ export class ReviewSt {
|
|
|
252
247
|
this.loadPage = threadPageLoader(() => st.url(`/api/review/threads?${this.listQuery}`), st.key, deadlineMs)
|
|
253
248
|
this.loadParties = etagLoader(() => st.url('/api/review/parties'), { deadlineMs })
|
|
254
249
|
this.views = new ThreadViews((id) => st.url(`/api/review/threads/${encodeURIComponent(id)}`), HELD_THREADS, deadlineMs)
|
|
255
|
-
this.loadBoard = etagLoader(() => st.url('/api/review/board'), { deadlineMs })
|
|
256
250
|
this.loadCodes = etagLoader(() => st.url('/api/review/codes'), { deadlineMs })
|
|
257
251
|
this.compare = new CompareSt(`${this.prefix}compare`)
|
|
258
252
|
this.newThread = st.start !== undefined ? new StartSt(st, () => this.rows) : null
|
|
@@ -275,7 +269,7 @@ export class ReviewSt {
|
|
|
275
269
|
}
|
|
276
270
|
// the last list drawn in the first frame: the daemon answers after, and only what moved draws again
|
|
277
271
|
this.page = this.loadPage.held()
|
|
278
|
-
makeAutoObservable<this, 'st' | 'toastTimer' | 'searchTimer' | 'timer' | 'pushing' | 'pushAgain' | 'starting' | 'specRead' | 'loadPage' | 'loadParties' | 'partiesRead' | '
|
|
272
|
+
makeAutoObservable<this, 'st' | 'toastTimer' | 'searchTimer' | 'timer' | 'pushing' | 'pushAgain' | 'starting' | 'specRead' | 'loadPage' | 'loadParties' | 'partiesRead' | 'prefix'>(this, {
|
|
279
273
|
st: false,
|
|
280
274
|
toastTimer: false,
|
|
281
275
|
searchTimer: false,
|
|
@@ -289,7 +283,6 @@ export class ReviewSt {
|
|
|
289
283
|
loadParties: false,
|
|
290
284
|
partiesRead: false,
|
|
291
285
|
views: false,
|
|
292
|
-
loadBoard: false,
|
|
293
286
|
prefix: false,
|
|
294
287
|
searchEl: false,
|
|
295
288
|
compare: false,
|
|
@@ -299,7 +292,6 @@ export class ReviewSt {
|
|
|
299
292
|
parties: observableRef,
|
|
300
293
|
stage: observableRef,
|
|
301
294
|
page: observableRef,
|
|
302
|
-
boardRows: observableRef,
|
|
303
295
|
})
|
|
304
296
|
reaction(
|
|
305
297
|
() => JSON.stringify({ hideHandled: this.hideHandled, byLane: this.byLane, fold: this.fold, mediaZoom: this.zoom, boxZoom: this.boxZoom, marks: this.marksOn, rail: this.railOn, tileH: this.tileH, tileSmall: this.tileSmall }),
|
|
@@ -432,12 +424,11 @@ export class ReviewSt {
|
|
|
432
424
|
}),
|
|
433
425
|
(e: Error) =>
|
|
434
426
|
runInAction(() => {
|
|
435
|
-
if (e instanceof StoreWait) this.listWait =
|
|
427
|
+
if (e instanceof StoreWait) this.listWait = `a repair of the threads' database runs: the list is the last one read, back in about ${e.retryS} s`
|
|
436
428
|
else this.listError = e.message
|
|
437
429
|
}),
|
|
438
430
|
),
|
|
439
431
|
this.readParties(),
|
|
440
|
-
this.board ? this.loadBoard().then((b) => runInAction(() => b.rows !== this.boardRows && (this.boardRows = b.rows)), () => undefined) : null,
|
|
441
432
|
thread?.refresh(),
|
|
442
433
|
])
|
|
443
434
|
}
|
|
@@ -497,7 +488,7 @@ export class ReviewSt {
|
|
|
497
488
|
|
|
498
489
|
/** what still waits on him that the list's filters hide, the empty panel says it */
|
|
499
490
|
get waitingElsewhere(): number {
|
|
500
|
-
return this.listFilters === '' ? 0 : Math.max(0, this.pendingCount - this.drawn.filter((r) => r.
|
|
491
|
+
return this.listFilters === '' ? 0 : Math.max(0, this.pendingCount - this.drawn.filter((r) => r.state.headWaits).length)
|
|
501
492
|
}
|
|
502
493
|
|
|
503
494
|
private openThread(id: string | null): void {
|
|
@@ -553,13 +544,15 @@ export class ReviewSt {
|
|
|
553
544
|
const s = this.staying
|
|
554
545
|
if (s === null) return answered
|
|
555
546
|
const rest = answered.filter((r) => r.head !== s.head)
|
|
556
|
-
|
|
547
|
+
// a row the list left (hide handled) keeps its place with the open thread's state, the server's
|
|
548
|
+
const open = this.thread?.data
|
|
549
|
+
rest.splice(Math.min(s.at, rest.length), 0, answered.find((r) => r.head === s.head) ?? (open?.head === s.head ? { ...s.row, state: open.state } : s.row))
|
|
557
550
|
return rest
|
|
558
551
|
}
|
|
559
552
|
|
|
560
|
-
/** the open thread he just settled (a verdict, close as done, set aside, not doing it): its row keeps its place
|
|
561
|
-
*
|
|
562
|
-
*
|
|
553
|
+
/** the open thread he just settled (a verdict, close as done, set aside, not doing it): its row keeps its place
|
|
554
|
+
* until he opens another thread, its band group the one it sat in, so ⇧↑ ⇧↓ step to its real neighbours; what it
|
|
555
|
+
* draws is the server's state */
|
|
563
556
|
stay: { head: string; at: number; band: Band; row: ThreadRow } | null = null
|
|
564
557
|
|
|
565
558
|
/** the stay while its thread is the open one */
|
|
@@ -577,10 +570,15 @@ export class ReviewSt {
|
|
|
577
570
|
this.stay = { head, at, band: this.bandOfRow(rows[at]!), row: rows[at]! }
|
|
578
571
|
}
|
|
579
572
|
|
|
580
|
-
/** the band a row draws
|
|
573
|
+
/** the band a row draws, from its state and who lives now */
|
|
581
574
|
bandOfRow(r: ThreadRow): Band {
|
|
575
|
+
return bandOf(r.state, this.parties, this.bandNow)
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
/** the band group a row sits in: a settled row's own until he opens another thread, its place */
|
|
579
|
+
placeOf(r: ThreadRow): Band {
|
|
582
580
|
const s = this.staying
|
|
583
|
-
return s !== null && s.head === r.head ? s.band :
|
|
581
|
+
return s !== null && s.head === r.head ? s.band : this.bandOfRow(r)
|
|
584
582
|
}
|
|
585
583
|
|
|
586
584
|
/** the time a band reads a `working` line's age at, on the half minute clock: a line past its time moves its row */
|
|
@@ -634,7 +632,7 @@ export class ReviewSt {
|
|
|
634
632
|
get bandGroups(): { band: Band; rows: ThreadRow[] }[] {
|
|
635
633
|
const by = new Map<Band, ThreadRow[]>()
|
|
636
634
|
for (const r of this.rows) {
|
|
637
|
-
const b = this.
|
|
635
|
+
const b = this.placeOf(r)
|
|
638
636
|
;(by.get(b) ?? by.set(b, []).get(b))?.push(r)
|
|
639
637
|
}
|
|
640
638
|
return BANDS.flatMap((band) => (by.has(band) ? [{ band, rows: by.get(band)! }] : []))
|
|
@@ -666,7 +664,7 @@ export class ReviewSt {
|
|
|
666
664
|
const rows = this.drawn
|
|
667
665
|
const at = from === null ? -1 : rows.findIndex((r) => r.head === from || r.ids.includes(from))
|
|
668
666
|
const order = at === -1 ? rows : [...rows.slice(at + 1), ...rows.slice(0, at)]
|
|
669
|
-
return order.find((r) => r.
|
|
667
|
+
return order.find((r) => r.state.headWaits && r.head !== from)?.head ?? null
|
|
670
668
|
}
|
|
671
669
|
|
|
672
670
|
/** the list's row of the open thread: the one whose thread holds its id */
|
|
@@ -702,11 +700,6 @@ export class ReviewSt {
|
|
|
702
700
|
this.fold = this.folded(band) ? this.fold.filter((k) => k !== band) : [...this.fold, band]
|
|
703
701
|
}
|
|
704
702
|
|
|
705
|
-
setBoard(on: boolean): void {
|
|
706
|
-
this.board = on
|
|
707
|
-
if (on) void this.refresh()
|
|
708
|
-
}
|
|
709
|
-
|
|
710
703
|
/** the search box: the server is asked once he stops typing */
|
|
711
704
|
setQuery(q: string): void {
|
|
712
705
|
this.query = q
|
|
@@ -977,7 +970,7 @@ export class ReviewSt {
|
|
|
977
970
|
if (!v || !item) return
|
|
978
971
|
const w = this.spec?.where
|
|
979
972
|
const here = typeof location === 'undefined' ? (w?.open ?? '') : pasteBase(location.origin, location.pathname, location.search)
|
|
980
|
-
const text = pasteBlock(item, STATUS_LABEL[v.status], {
|
|
973
|
+
const text = pasteBlock(item, STATUS_LABEL[v.state.status], {
|
|
981
974
|
root: w?.root ?? '<the repo>',
|
|
982
975
|
open: `${here}#page:review:${v.head}`,
|
|
983
976
|
phone: w?.phone ? `${w.phone}#page:review:${v.head}` : null,
|
|
@@ -1041,8 +1034,8 @@ export class ReviewSt {
|
|
|
1041
1034
|
this.toastTimer = setTimeout(() => runInAction(() => (this.toast = null)), 2600)
|
|
1042
1035
|
}
|
|
1043
1036
|
|
|
1044
|
-
/** the page's keys, as the atelier takes its own: true when it used the key.
|
|
1045
|
-
*
|
|
1037
|
+
/** the page's keys, as the atelier takes its own: true when it used the key. 1 to 6 or V F R X Y U, the five tones or no answer (tones.ts),
|
|
1038
|
+
* (each opens that tone's box, Enter sends) the newest open item that asks the owner's verdict (ThreadSt.judgeKey), N the next waiting thread, C copies the thread for an agent, M the rings, T the contents, D the next
|
|
1046
1039
|
* compare mode of every pair (⇧D the one before); ⇧↑ ⇧↓ the list are the hub's (columns.ts), so is W the thread wide (kept-cols.tsx); the thread takes
|
|
1047
1040
|
* the rest (ThreadSt.key). A digit is read from its physical key (`code`), so ⇧ and an AZERTY keyboard read the same */
|
|
1048
1041
|
key(e: Pick<KeyboardEvent, 'key' | 'shiftKey'> & { code?: string }): boolean {
|
|
@@ -1051,11 +1044,8 @@ export class ReviewSt {
|
|
|
1051
1044
|
const thread = this.thread
|
|
1052
1045
|
if (thread?.key(e)) return true
|
|
1053
1046
|
const k = e.key.toLowerCase()
|
|
1054
|
-
const
|
|
1055
|
-
if (
|
|
1056
|
-
else if (k === 'v') void thread?.judgeKey('approved')
|
|
1057
|
-
else if (k === 'f') void thread?.judgeKey('approved-with-fix')
|
|
1058
|
-
else if (k === 'r') void thread?.judgeKey('rejected')
|
|
1047
|
+
const tone = e.shiftKey ? null : toneKey(e.key, /^Digit([1-6])$/.exec(e.code ?? '')?.[1])
|
|
1048
|
+
if (tone !== null) void thread?.judgeKey(tone)
|
|
1059
1049
|
else if (k === 'n') this.nextPending()
|
|
1060
1050
|
else if (k === 'c') void this.copyThread()
|
|
1061
1051
|
else if (k === 'm') this.toggleMarks()
|