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
|
@@ -126,7 +126,7 @@ export const ICON = {
|
|
|
126
126
|
restart: 'M15.5 10a5.5 5.5 0 1 1-1.6-3.9M14.2 3v3.3h-3.3',
|
|
127
127
|
back: 'M16 10H4M9 5l-5 5 5 5',
|
|
128
128
|
forward: 'M4 10h12M11 5l5 5-5 5',
|
|
129
|
-
// the four verbs of his turn (review/
|
|
129
|
+
// the four verbs of his turn (review/thread-state.ts), drawn by thread-row.tsx VerbGlyph only: a verdict's scales, a
|
|
130
130
|
// question's bubble, the action's bolt, a page to read
|
|
131
131
|
judge: 'M10 3.5v13M6 16.5h8M4 6h12M4 6l-2 5h4zM16 6l-2 5h4z',
|
|
132
132
|
answer: 'M3 4h14v9H8l-4 3.5V13H3zM8.3 7.2a1.8 1.8 0 1 1 2.5 1.6c-.5.3-.8.6-.8 1.1M10 11.3h.01',
|
|
@@ -10,8 +10,6 @@ import { ListFoldBar } from './kept-cols.tsx'
|
|
|
10
10
|
import { useLayoutEffect } from 'react'
|
|
11
11
|
import type { ReactNode } from 'react'
|
|
12
12
|
import { DEFAULT_STATE, INBOX_GROUPS, INBOX_LISTS, INBOX_PAGE, isReviewId, type InboxGroup, type InboxGroupNode, type InboxList, type InboxRow, type Wait } from '../../home/inbox-shape.ts'
|
|
13
|
-
import { BAND_WORDS } from '../../review/band.ts'
|
|
14
|
-
import { isOwnerWait } from '../../review/wait.ts'
|
|
15
13
|
import { waitGlyph } from './review/object-panel.tsx'
|
|
16
14
|
import { DeafMark, deafThread } from './deaf.tsx'
|
|
17
15
|
import { Pop } from './floating.tsx'
|
|
@@ -26,6 +24,7 @@ import { ThreadColumn } from './review/review-thread.tsx'
|
|
|
26
24
|
import { ThreadRow as ThreadRowView, VerbGlyph } from './thread-row.tsx'
|
|
27
25
|
import { SearchField, SearchResults } from './search-view.tsx'
|
|
28
26
|
import { tip } from './tips.ts'
|
|
27
|
+
import { BAND_WORDS, isOwnerWait } from '../../review/thread-state.ts'
|
|
29
28
|
|
|
30
29
|
/** what each verb asks of him, on its badge's tooltip and its toggle */
|
|
31
30
|
const WAIT_SAYS: Record<Wait, string> = {
|
|
@@ -8,14 +8,14 @@ import { createElement } from 'react'
|
|
|
8
8
|
import { ICON } from './icons.tsx'
|
|
9
9
|
import type { HomeSt } from './home-st.ts'
|
|
10
10
|
import type { PanelSource, RowAct, RowActs, SourceAction, SourceGroup, SourceRow } from './panel-source.ts'
|
|
11
|
-
import {
|
|
11
|
+
import { panelProfile, panelRepo, repoHref } from './panel-repo.ts'
|
|
12
12
|
import type { RepoSt } from './repo-st.ts'
|
|
13
13
|
import { UNIT_ICON } from './unit-icons.ts'
|
|
14
14
|
import { CodeForm, LoginForm, RemoveForm, UrlForm } from './url-forms.tsx'
|
|
15
15
|
import { letterOf, plateHue, urlFaces, type UrlFace } from './url-faces.ts'
|
|
16
16
|
import { frameRefusal } from './frame-refusal.ts'
|
|
17
17
|
import { opensOf, seatOf, sideWay, type Seat } from './urls-svc.ts'
|
|
18
|
-
import { appSide } from './app-bridge.ts'
|
|
18
|
+
import { appSide, openTab } from './app-bridge.ts'
|
|
19
19
|
import { hubProbe, sideFrame } from './side-frame.ts'
|
|
20
20
|
import { repoIdentity } from './side-frame-view.tsx'
|
|
21
21
|
import { isPlaceKey, placeUrlRows, type PlaceRow } from './places-svc.ts'
|
|
@@ -17,7 +17,8 @@ import { Icon, ICON } from './icons.tsx'
|
|
|
17
17
|
import { useInSight } from './in-sight.ts'
|
|
18
18
|
import { CLAUDE_KEY, ENTRY_KEY, FIND_KEY, nthKey, pageKeyLabel, PICKER_KEY, PLACE_KEY, ROW_ACTS_KEY, SECTION_KEY, sectionKeyLabel, TERMINAL_ENTRY_KEY } from './keys.ts'
|
|
19
19
|
import { PLACES, type HouseEntry } from './projects-svc.ts'
|
|
20
|
-
import {
|
|
20
|
+
import { openTab } from './app-bridge.ts'
|
|
21
|
+
import { houseHref, panelRepo, repoHref } from './panel-repo.ts'
|
|
21
22
|
import { panelHouse } from './panel-walk.ts'
|
|
22
23
|
import { PanelHead } from './panel-head.tsx'
|
|
23
24
|
import { HeadAction } from './panel-head-action.tsx'
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// the project the main panel is about, and the address of each of its entries: what a new tab opens (⌘ click, a middle
|
|
2
2
|
// click, the row's own button), the page alone with the main panel. A project's app keeps its shell in every address
|
|
3
|
-
import { appPost, type TabChips } from './app-bridge.ts'
|
|
4
3
|
import { hashFor, type HashSel } from './hash-route.ts'
|
|
5
4
|
import type { HomeSt } from './home-st.ts'
|
|
6
5
|
import { PLACE_PATH } from './place-path.ts'
|
|
@@ -32,11 +31,3 @@ export const sourceHref = (home: HomeSt, r: RepoSt, section: string, id: string)
|
|
|
32
31
|
|
|
33
32
|
/** a page of the home; the picker is a dialog, no page */
|
|
34
33
|
export const houseHref = (home: HomeSt, e: HouseEntry): string | null => (e === 'picker' ? null : kept(home, PLACE_PATH[e]))
|
|
35
|
-
|
|
36
|
-
/** an entry in a new tab: the app turns a new window into a tab of its own. `name`: the tab's title in the app, for a
|
|
37
|
-
* tab that is no page of the hub (a url's site), said to the app before the window is asked; `chips`: a url's
|
|
38
|
-
* logins, which that tab wears in its title bar */
|
|
39
|
-
export const openTab = (href: string, name?: string, chips?: TabChips): void => {
|
|
40
|
-
if (name != null) appPost()?.({ tabName: name, url: new URL(href, globalThis.location?.href).href, ...chips })
|
|
41
|
-
void globalThis.open?.(href, '_blank')
|
|
42
|
-
}
|
|
@@ -1,33 +1,50 @@
|
|
|
1
1
|
// every small image of the threads (a gallery tile, a list row's picture, a still, an option's thumb): its box holds a
|
|
2
2
|
// quiet shimmer at its final size while the image loads, the image fades in once decoded, and a box whose image failed
|
|
3
|
-
// says so with a retry. The look lives in controls.css (.pic) and nowhere else; the box is sized by its parent's class
|
|
3
|
+
// says so with a retry. The look lives in controls.css (.pic) and nowhere else; the box is sized by its parent's class.
|
|
4
|
+
// The one constraint a reader breaks first: a decoded image turns its box from `loading` to `shown` on the element
|
|
5
|
+
// itself, never through React state, so a scroll that loads a picture each frame commits nothing; a new src (or a
|
|
6
|
+
// retry) is a new box
|
|
4
7
|
import { useState, type CSSProperties, type SyntheticEvent } from 'react'
|
|
5
8
|
import { tip } from './tips.ts'
|
|
6
9
|
|
|
7
|
-
|
|
10
|
+
const shown = (img: HTMLImageElement): void => void img.parentElement?.classList.replace('loading', 'shown')
|
|
11
|
+
|
|
12
|
+
/** the boxes near the view: `data-near` on each, set by one observer for every picture (no render; an attribute React
|
|
13
|
+
* never writes, so a new class keeps it), so a lazy picture far out of view runs no shimmer while it waits (controls.css) */
|
|
14
|
+
const nearby = typeof IntersectionObserver === 'undefined' ? null : new IntersectionObserver((seen) => {
|
|
15
|
+
for (const e of seen) e.target.toggleAttribute('data-near', e.isIntersecting)
|
|
16
|
+
}, { rootMargin: '200px' })
|
|
17
|
+
|
|
18
|
+
const watchNear = (el: HTMLSpanElement | null): (() => void) | undefined => {
|
|
19
|
+
if (el === null || nearby === null) return undefined
|
|
20
|
+
nearby.observe(el)
|
|
21
|
+
return () => nearby.unobserve(el)
|
|
22
|
+
}
|
|
8
23
|
|
|
9
24
|
export function Pic({ src, className, style }: { src: string; className?: string; style?: CSSProperties }) {
|
|
10
|
-
const [s, set] = useState<{ src: string;
|
|
11
|
-
const cur = s.src === src ? s : { src,
|
|
25
|
+
const [s, set] = useState<{ src: string; failed: boolean; n: number }>({ src, failed: false, n: 0 })
|
|
26
|
+
const cur = s.src === src ? s : { src, failed: false, n: 0 }
|
|
12
27
|
if (cur !== s) set(cur)
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
28
|
+
const onLoad = (e: SyntheticEvent<HTMLImageElement>): void => {
|
|
29
|
+
const img = e.currentTarget
|
|
30
|
+
void img.decode().then(() => shown(img), () => shown(img))
|
|
31
|
+
}
|
|
32
|
+
const onError = (): void => set((x) => (x.src === src ? { ...x, failed: true } : x))
|
|
16
33
|
const retry = (e: SyntheticEvent): void => {
|
|
17
34
|
e.stopPropagation()
|
|
18
35
|
e.preventDefault()
|
|
19
|
-
set((x) => ({ ...x,
|
|
36
|
+
set((x) => ({ ...x, failed: false, n: x.n + 1 }))
|
|
20
37
|
}
|
|
21
38
|
const url = cur.n === 0 ? src : `${src}${src.includes('?') ? '&' : '?'}retry=${cur.n}`
|
|
22
39
|
return (
|
|
23
|
-
<span className={`pic ${cur.
|
|
40
|
+
<span key={url} ref={watchNear} className={`pic ${cur.failed ? 'failed' : 'loading'}${className ? ` ${className}` : ''}`} style={style} data-check="pic">
|
|
24
41
|
<img
|
|
25
42
|
ref={(el) => {
|
|
26
43
|
// a picture the browser holds already draws at once, with no fade
|
|
27
|
-
if (el && el.complete && el.naturalWidth > 0
|
|
44
|
+
if (el && el.complete && el.naturalWidth > 0) shown(el)
|
|
28
45
|
}}
|
|
29
|
-
|
|
30
|
-
{cur.
|
|
46
|
+
src={url} alt="" loading="lazy" decoding="async" draggable={false} onLoad={onLoad} onError={onError} />
|
|
47
|
+
{cur.failed ? (
|
|
31
48
|
<span className="picfail">
|
|
32
49
|
did not load · <span role="button" tabIndex={0} className="picretry" {...tip('ask for the image again')} onClick={retry} onMouseDown={(e) => e.stopPropagation()} onKeyDown={(e) => (e.key === 'Enter' || e.key === ' ' ? retry(e) : undefined)}>retry</span>
|
|
33
50
|
</span>
|
|
@@ -8,6 +8,17 @@
|
|
|
8
8
|
import { makeAutoObservable, observableRef, runInAction } from 'mobx'
|
|
9
9
|
import { reach } from './reach.ts'
|
|
10
10
|
|
|
11
|
+
/** two answers of a read are the same when their JSON is: a poll whose answer did not move keeps the value it holds,
|
|
12
|
+
* so the page draws nothing (a new object of the same words redrew every view that read it, at each poll) */
|
|
13
|
+
export function sameAnswer(a: unknown, b: unknown): boolean {
|
|
14
|
+
if (a === b) return true
|
|
15
|
+
try {
|
|
16
|
+
return JSON.stringify(a) === JSON.stringify(b)
|
|
17
|
+
} catch {
|
|
18
|
+
return false
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
11
22
|
/** where the value stands: no answer yet, the last answer, an answer a notice or a missed read made old, a read that failed */
|
|
12
23
|
export type Freshness = 'loading' | 'fresh' | 'stale' | 'error'
|
|
13
24
|
|
|
@@ -159,10 +170,13 @@ export class PolledResource<T> {
|
|
|
159
170
|
runInAction(() => {
|
|
160
171
|
if (!live()) return
|
|
161
172
|
const prev = this.value
|
|
162
|
-
|
|
173
|
+
// an answer the same as the one held keeps the held one: no observer of it redraws; `landed` still
|
|
174
|
+
// hears each read, given the value held
|
|
175
|
+
const same = prev !== undefined && sameAnswer(prev, v)
|
|
176
|
+
if (!same) this.value = v
|
|
163
177
|
this.error = ''
|
|
164
178
|
this.dirty = false
|
|
165
|
-
this.o.landed?.(v, prev)
|
|
179
|
+
this.o.landed?.(same ? prev! : v, prev)
|
|
166
180
|
})
|
|
167
181
|
} catch (e) {
|
|
168
182
|
runInAction(() => {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// stays with its capture while another is open. Reads when the page shows and after each action, never on a clock
|
|
6
6
|
import { makeAutoObservable, observableRef, runInAction } from 'mobx'
|
|
7
7
|
import { EMPTY_EDIT, parseEdit, pieces, printEdit, type Crop, type Edit, type Span } from '../../recordings/edit.ts'
|
|
8
|
-
import { moved, type Mark, type MarkColor, type Pt } from '../../recordings/marks.ts'
|
|
8
|
+
import { addArrowPoint, moved, moveArrowPoint, removeArrowPoint, type Mark, type MarkColor, type Pt } from '../../recordings/marks.ts'
|
|
9
9
|
import { fileUrl, parseRecordingHash, recordingAddress, type RecList, type RecView } from '../../recordings/view.ts'
|
|
10
10
|
import type { HomeSt } from './home-st.ts'
|
|
11
11
|
import { ownTrouble, reach } from './reach.ts'
|
|
@@ -101,7 +101,8 @@ export class EditorSt {
|
|
|
101
101
|
constructor(public rec: RecView, private page: RecordingsSt, draft: string | null = null) {
|
|
102
102
|
this.key = `${rec.repo}/${rec.id}`
|
|
103
103
|
this.text = draft ?? rec.edit
|
|
104
|
-
|
|
104
|
+
// the undo stacks are observed: the undo button enables from their length
|
|
105
|
+
makeAutoObservable<this, 'page' | 'raf' | 'wroteAt'>(this, { rec: observableRef, page: false, video: false, raf: false, wroteAt: false })
|
|
105
106
|
}
|
|
106
107
|
|
|
107
108
|
get cropping(): boolean {
|
|
@@ -287,6 +288,26 @@ export class EditorSt {
|
|
|
287
288
|
if (m && (dx !== 0 || dy !== 0)) this.updateMark(i, moved(m, dx, dy))
|
|
288
289
|
}
|
|
289
290
|
|
|
291
|
+
/** a point more on the arrow `i`, where its line passes nearest `p`: dragged, it bends the arrow there */
|
|
292
|
+
addArrowPoint(i: number, p: Pt): void {
|
|
293
|
+
const m = this.marks[i]
|
|
294
|
+
if (m?.kind !== 'arrow') return
|
|
295
|
+
this.updateMark(i, addArrowPoint(m, p))
|
|
296
|
+
this.selected = i
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
/** the arrow `i` with its point `k` (tail 0, then each bend, the tip last) at `p` */
|
|
300
|
+
moveArrowPoint(i: number, k: number, p: Pt): void {
|
|
301
|
+
const m = this.marks[i]
|
|
302
|
+
if (m?.kind === 'arrow') this.updateMark(i, moveArrowPoint(m, k, p))
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/** the arrow `i` without its bend `k`: the tail and the tip always stay */
|
|
306
|
+
removeArrowPoint(i: number, k: number): void {
|
|
307
|
+
const m = this.marks[i]
|
|
308
|
+
if (m?.kind === 'arrow' && k > 0 && k <= m.via.length) this.updateMark(i, removeArrowPoint(m, k))
|
|
309
|
+
}
|
|
310
|
+
|
|
290
311
|
removeSelected(): void {
|
|
291
312
|
const i = this.selected
|
|
292
313
|
if (i === null) return
|
|
@@ -9,7 +9,7 @@ import { observer } from 'mobx-react-lite'
|
|
|
9
9
|
import { useEffect, useRef, useState } from 'react'
|
|
10
10
|
import { canvasOf, printTime, type Crop } from '../../recordings/edit.ts'
|
|
11
11
|
import { drawMark, type Ctx2D } from '../../recordings/marks-draw.ts'
|
|
12
|
-
import { boundsOf, COLORS, HEX, moved, type Mark, type Pt } from '../../recordings/marks.ts'
|
|
12
|
+
import { arrowPointAt, arrowPoints, boundsOf, COLORS, HEX, moveArrowPoint, moved, nearestOnArrow, style, type Mark, type Pt } from '../../recordings/marks.ts'
|
|
13
13
|
import { ANIM_MAX_SECONDS, fileUrl, parseRecordingHash, type RecView } from '../../recordings/view.ts'
|
|
14
14
|
import type { HomeSt } from './home-st.ts'
|
|
15
15
|
import { COPY_MODES, TOOLS, type CopyMode, type EditorSt, type RecordingsSt, type Tool } from './recordings-st.ts'
|
|
@@ -24,7 +24,7 @@ const poster = (r: RecView): string => fileUrl(r, 'poster.webp', `${r.current}-$
|
|
|
24
24
|
* Crop ⌃C); ⌃1 to ⌃7 pick the tool at that place, as Snagit does on Windows */
|
|
25
25
|
const TOOL_WORDS: Record<Tool, { name: string; key: string; ctrl: string; title: string }> = {
|
|
26
26
|
select: { name: 'Move', key: 'v', ctrl: 'v', title: 'pick a mark, drag it, Delete removes it' },
|
|
27
|
-
arrow: { name: 'Arrow', key: 'a', ctrl: 'a', title: 'drag from the tail to the point' },
|
|
27
|
+
arrow: { name: 'Arrow', key: 'a', ctrl: 'a', title: 'drag from the tail to the point; double click its line to add a point, drag the point to bend it, double click the point to take it off' },
|
|
28
28
|
rect: { name: 'Shape', key: 'r', ctrl: 'u', title: 'drag a rectangle' },
|
|
29
29
|
text: { name: 'Text', key: 't', ctrl: 't', title: 'click where the words go, type, Enter' },
|
|
30
30
|
step: { name: 'Step', key: 'n', ctrl: 's', title: 'click: a numbered step, the next number each time' },
|
|
@@ -158,6 +158,10 @@ function useFit(w: number, h: number): [React.RefObject<HTMLDivElement | null>,
|
|
|
158
158
|
return [box, scale]
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
+
/** an arrow point's handle, across in screen px: what it draws and what a press on it takes */
|
|
162
|
+
const HANDLE_PX = 12
|
|
163
|
+
const inBox = (b: Crop, p: Pt): boolean => p.x >= b.x && p.x <= b.x + b.w && p.y >= b.y && p.y <= b.y + b.h
|
|
164
|
+
|
|
161
165
|
const norm = (a: Pt, b: Pt): Crop => ({ x: Math.round(Math.min(a.x, b.x)), y: Math.round(Math.min(a.y, b.y)), w: Math.round(Math.abs(b.x - a.x)), h: Math.round(Math.abs(b.y - a.y)) })
|
|
162
166
|
|
|
163
167
|
const Stage = observer(({ ed }: { ed: EditorSt }) => {
|
|
@@ -169,7 +173,8 @@ const Stage = observer(({ ed }: { ed: EditorSt }) => {
|
|
|
169
173
|
const [box, scale] = useFit(cv.w, cv.h)
|
|
170
174
|
const canvas = useRef<HTMLCanvasElement>(null)
|
|
171
175
|
const frameEl = useRef<HTMLDivElement>(null)
|
|
172
|
-
|
|
176
|
+
// `point`: the arrow point a drag holds (tail 0, each bend, the tip last), null when it holds the whole mark
|
|
177
|
+
const drag = useRef<{ from: Pt; moving: number | null; base: Mark | null; point?: number } | null>(null)
|
|
173
178
|
const [hidden, setHidden] = useState<number | null>(null)
|
|
174
179
|
|
|
175
180
|
// the overlay drawn again whenever the marks, the playhead, the draft or the pick move
|
|
@@ -200,36 +205,71 @@ const Stage = observer(({ ed }: { ed: EditorSt }) => {
|
|
|
200
205
|
ctx.strokeRect(crop.x, crop.y, crop.w, crop.h)
|
|
201
206
|
}
|
|
202
207
|
const sel = ed.selected
|
|
203
|
-
|
|
208
|
+
// an arrow picked shows its handles (below) in place of the frame: a bent one's frame would cross what it goes around
|
|
209
|
+
if (sel !== null && marks[sel] && sel !== hidden && marks[sel]!.kind !== 'arrow') {
|
|
204
210
|
const b = boundsOf(marks[sel]!, r)
|
|
205
211
|
ctx.setLineDash([6 / scale, 4 / scale])
|
|
206
212
|
ctx.strokeStyle = '#2f7ff0'
|
|
207
213
|
ctx.lineWidth = 1.5 / scale
|
|
208
214
|
ctx.strokeRect(b.x - 4 / scale, b.y - 4 / scale, b.w + 8 / scale, b.h + 8 / scale)
|
|
209
215
|
}
|
|
216
|
+
// the arrow picked shows its points as handles, the one a drag bends too: its ends hollow, its bends filled
|
|
217
|
+
const held = sel === null ? null : sel === hidden && ed.draft?.kind === 'arrow' ? ed.draft : marks[sel]
|
|
218
|
+
if (held?.kind === 'arrow') {
|
|
219
|
+
const ps = arrowPoints(held)
|
|
220
|
+
ctx.setLineDash([])
|
|
221
|
+
ctx.lineWidth = 1.5 / scale
|
|
222
|
+
ps.forEach((q, k) => {
|
|
223
|
+
const end = k === 0 || k === ps.length - 1
|
|
224
|
+
ctx.beginPath()
|
|
225
|
+
ctx.arc(q.x, q.y, HANDLE_PX / 2 / scale, 0, Math.PI * 2)
|
|
226
|
+
ctx.fillStyle = end ? '#ffffff' : '#2f7ff0'
|
|
227
|
+
ctx.strokeStyle = end ? '#2f7ff0' : '#ffffff'
|
|
228
|
+
ctx.fill()
|
|
229
|
+
ctx.stroke()
|
|
230
|
+
})
|
|
231
|
+
}
|
|
210
232
|
}),
|
|
211
233
|
[ed, scale, hidden, W, H, r],
|
|
212
234
|
)
|
|
213
235
|
|
|
214
236
|
/** the pointer in the take's pixels: past its edges too, a mark may start outside it */
|
|
215
|
-
const at = (e: React.
|
|
237
|
+
const at = (e: React.MouseEvent): Pt => {
|
|
216
238
|
const b = frameEl.current!.getBoundingClientRect()
|
|
217
239
|
return { x: Math.round((e.clientX - b.left) / scale), y: Math.round((e.clientY - b.top) / scale) }
|
|
218
240
|
}
|
|
219
|
-
|
|
241
|
+
/** how near an arrow's line a press must land, in the take's pixels */
|
|
242
|
+
const lineTol = (): number => Math.max(style(r).stroke * 2, 10 / Math.max(scale, 0.01))
|
|
243
|
+
const onLine = (m: Mark, p: Pt): boolean => m.kind === 'arrow' && nearestOnArrow(m, p).dist <= lineTol()
|
|
244
|
+
// an arrow is hit on its line, never in the box around it: a bent arrow leaves what it goes around to the pointer
|
|
245
|
+
const hit = (p: Pt, arrowsOnly = false): number | null => {
|
|
220
246
|
const shown = ed.marksNow
|
|
221
247
|
for (let k = shown.length - 1; k >= 0; k--) {
|
|
222
|
-
const
|
|
223
|
-
if (
|
|
248
|
+
const m = ed.marks[shown[k]!]!
|
|
249
|
+
if (m.kind === 'arrow' ? onLine(m, p) : !arrowsOnly && inBox(boundsOf(m, r), p)) return shown[k]!
|
|
224
250
|
}
|
|
225
251
|
return null
|
|
226
252
|
}
|
|
253
|
+
/** the point of the arrow picked under the pointer: its index, null when none is */
|
|
254
|
+
const handleAt = (p: Pt): number | null => {
|
|
255
|
+
const sel = ed.selected
|
|
256
|
+
const m = sel === null ? null : ed.marks[sel]
|
|
257
|
+
return m?.kind === 'arrow' ? arrowPointAt(m, p, HANDLE_PX / Math.max(scale, 0.01)) : null
|
|
258
|
+
}
|
|
227
259
|
const inside = (p: Pt): Pt => ({ x: Math.min(Math.max(0, p.x), W), y: Math.min(Math.max(0, p.y), H) })
|
|
228
260
|
const down = (e: React.PointerEvent): void => {
|
|
229
261
|
if ((e.target as HTMLElement).closest('input')) return
|
|
230
262
|
if (ed.typing) return ed.commitText()
|
|
231
263
|
const p = at(e)
|
|
232
264
|
;(e.currentTarget as HTMLElement).setPointerCapture(e.pointerId)
|
|
265
|
+
// a press on a point of the arrow picked drags that point, with the select tool and the arrow tool alike
|
|
266
|
+
const k = ed.tool === 'select' || ed.tool === 'arrow' ? handleAt(p) : null
|
|
267
|
+
if (k !== null) {
|
|
268
|
+
const i = ed.selected!
|
|
269
|
+
drag.current = { from: p, moving: i, base: ed.marks[i]!, point: k }
|
|
270
|
+
setHidden(i)
|
|
271
|
+
return
|
|
272
|
+
}
|
|
233
273
|
if (ed.tool === 'select') {
|
|
234
274
|
const i = hit(p)
|
|
235
275
|
ed.select(i)
|
|
@@ -252,12 +292,13 @@ const Stage = observer(({ ed }: { ed: EditorSt }) => {
|
|
|
252
292
|
const d = drag.current
|
|
253
293
|
if (!d) return
|
|
254
294
|
const p = at(e)
|
|
295
|
+
if (d.point !== undefined && d.base?.kind === 'arrow') return ed.setDraft(moveArrowPoint(d.base, d.point, p))
|
|
255
296
|
if (ed.tool === 'select') {
|
|
256
297
|
if (d.base) ed.setDraft(moved(d.base, p.x - d.from.x, p.y - d.from.y))
|
|
257
298
|
return
|
|
258
299
|
}
|
|
259
300
|
const b = norm(d.from, p)
|
|
260
|
-
if (ed.tool === 'arrow') ed.setDraft({ kind: 'arrow', from: d.from, to: p, color: ed.color, span: null })
|
|
301
|
+
if (ed.tool === 'arrow') ed.setDraft({ kind: 'arrow', from: d.from, via: [], to: p, color: ed.color, span: null })
|
|
261
302
|
else if (ed.tool === 'rect') ed.setDraft({ kind: 'rect', box: b, color: ed.color, span: null })
|
|
262
303
|
else if (ed.tool === 'blur') ed.setDraft({ kind: 'blur', box: norm(d.from, inside(p)), span: null })
|
|
263
304
|
else if (ed.tool === 'crop') ed.setCropDraft(norm(d.from, inside(p)))
|
|
@@ -268,6 +309,13 @@ const Stage = observer(({ ed }: { ed: EditorSt }) => {
|
|
|
268
309
|
if (!d) return
|
|
269
310
|
const p = at(e)
|
|
270
311
|
const far = Math.hypot(p.x - d.from.x, p.y - d.from.y) >= 8 / Math.max(scale, 0.01)
|
|
312
|
+
if (d.point !== undefined) {
|
|
313
|
+
setHidden(null)
|
|
314
|
+
ed.setDraft(null)
|
|
315
|
+
// a point lands where it is let go, the smallest move too: a bend is placed by eye
|
|
316
|
+
if (d.moving !== null && Math.hypot(p.x - d.from.x, p.y - d.from.y) >= 2 / Math.max(scale, 0.01)) ed.moveArrowPoint(d.moving, d.point, p)
|
|
317
|
+
return
|
|
318
|
+
}
|
|
271
319
|
if (ed.tool === 'select') {
|
|
272
320
|
setHidden(null)
|
|
273
321
|
ed.setDraft(null)
|
|
@@ -285,9 +333,19 @@ const Stage = observer(({ ed }: { ed: EditorSt }) => {
|
|
|
285
333
|
}
|
|
286
334
|
if (draft && far) ed.addMark(draft)
|
|
287
335
|
}
|
|
336
|
+
// a double click on an arrow's line adds a point there, on one of its bends takes that bend off (Snagit's way)
|
|
337
|
+
const dbl = (e: React.MouseEvent): void => {
|
|
338
|
+
if (ed.tool !== 'select' && ed.tool !== 'arrow') return
|
|
339
|
+
const p = at(e)
|
|
340
|
+
const k = handleAt(p)
|
|
341
|
+
if (k !== null) return ed.removeArrowPoint(ed.selected!, k)
|
|
342
|
+
const sel = ed.selected
|
|
343
|
+
const i = sel !== null && ed.marksNow.includes(sel) && onLine(ed.marks[sel]!, p) ? sel : hit(p, true)
|
|
344
|
+
if (i !== null) ed.addArrowPoint(i, p)
|
|
345
|
+
}
|
|
288
346
|
|
|
289
347
|
return (
|
|
290
|
-
<div ref={box} className={`rcstage t-${ed.tool}`} onPointerDown={down} onPointerMove={move} onPointerUp={up}>
|
|
348
|
+
<div ref={box} className={`rcstage t-${ed.tool}`} onPointerDown={down} onPointerMove={move} onPointerUp={up} onDoubleClick={dbl}>
|
|
291
349
|
<div className={`rccanvas${cv.w !== W || cv.h !== H ? ' grown' : ''}`} style={{ width: cv.w * scale, height: cv.h * scale }}>
|
|
292
350
|
<div ref={frameEl} className="rcframe" style={{ left: -cv.x * scale, top: -cv.y * scale, width: W * scale, height: H * scale }}>
|
|
293
351
|
{r.still ? (
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
// by its code, `#k7m2`, is a pill only where the page knows that thread (`look`): its code, its title, its band as a
|
|
4
4
|
// mark, and a click opens it (words.tsx). Put into a message's html after the allowlist (md.ts renderWords), never
|
|
5
5
|
// inside code or a link
|
|
6
|
-
import { BAND_WORDS, type Band } from '../../review/band.ts'
|
|
7
6
|
import { KIND_HUES } from '../../review/glyphs.ts'
|
|
8
7
|
import { HOUSE_KINDS } from '../../review/kinds.ts'
|
|
9
8
|
import { isCodeRef, REF_KINDS, refSpans } from '../../review/refs.ts'
|
|
10
9
|
import { kindOf } from './pick-kinds.ts'
|
|
10
|
+
import { BAND_WORDS, type Band } from '../../review/thread-state.ts'
|
|
11
11
|
|
|
12
12
|
/** a reference's kind as the picker names it, where the two words differ */
|
|
13
13
|
const PICK_WORD: Record<string, string> = { secret: 'secrets', check: 'gate checks', test: 'tests', wiki: 'wikis', asset: 'assets', ask: 'asks' }
|
|
@@ -48,8 +48,7 @@ import { WalkEntry } from './list-walk.ts'
|
|
|
48
48
|
import type { Resource } from './hub-types.ts'
|
|
49
49
|
import type { HomeSt } from './home-st.ts'
|
|
50
50
|
import type { Place } from './projects-svc.ts'
|
|
51
|
-
import { appPost } from './app-bridge.ts'
|
|
52
|
-
import { openTab } from './panel-repo.ts'
|
|
51
|
+
import { appPost, openTab } from './app-bridge.ts'
|
|
53
52
|
import { canOf, type ReviewAct, type ReviewHost } from './review/review-host.ts'
|
|
54
53
|
import { reach } from './reach.ts'
|
|
55
54
|
|
|
@@ -43,7 +43,7 @@ const Confirm = observer(({ p, bar, title, close }: { p: AdvisorPickSt; bar: Thr
|
|
|
43
43
|
</li>
|
|
44
44
|
<li>The share lasts {a?.days ?? DAYS} days. « unshare » ends it at any time.</li>
|
|
45
45
|
{bar.mine ? <li>The thread leaves your turn until {name} answers.</li> : null}
|
|
46
|
-
{bar.data?.
|
|
46
|
+
{bar.data?.setUp === false ? (
|
|
47
47
|
<li className="adv-warn">{name} can open it once your advisors page is set up: its line sits at the foot of the <a href="/advisors" {...tip('opens the advisors page: its foot says what the advisors page needs')}>advisors page</a>.</li>
|
|
48
48
|
) : (
|
|
49
49
|
<li>{name} can open it as soon as you share: their invite carries a code to sign in.</li>
|
|
@@ -30,7 +30,7 @@ const NoKey = observer(({ bar }: { bar: ThreadBarSt }) => (
|
|
|
30
30
|
export const InviteNext = observer(({ bar, a, email }: { bar: ThreadBarSt; a: KnownAdvisor | null; email: string }) => {
|
|
31
31
|
if (a !== null && !a.invite.due) return null
|
|
32
32
|
if (bar.data?.mail?.key === 'missing') return <li className="adv-dim"><NoKey bar={bar} /></li>
|
|
33
|
-
if (bar.data?.
|
|
33
|
+
if (bar.data?.setUp === false) return null
|
|
34
34
|
return <li>The invite goes to {email} by mail as you share: the advisors page's address and a one time code to sign in.</li>
|
|
35
35
|
})
|
|
36
36
|
|
|
@@ -20,7 +20,7 @@ import type { SocialSt } from '../social/social-st.ts'
|
|
|
20
20
|
import { GroupActs, groupsOf, PostActs, type GroupsSt } from './group-block.tsx'
|
|
21
21
|
import { versionActs } from '../../../review/settle.ts'
|
|
22
22
|
import { keepFocus } from './kit.tsx'
|
|
23
|
-
import {
|
|
23
|
+
import { SentReaction, takes, toneClass, type Ver } from './review-views.tsx'
|
|
24
24
|
import { postDom, viewDom } from './thread-st.ts'
|
|
25
25
|
import { tip } from '../tips.ts'
|
|
26
26
|
|
|
@@ -130,7 +130,7 @@ const PlaceActs = observer(({ ver, post, state }: { ver: Ver; post: SocialPost;
|
|
|
130
130
|
) : null}
|
|
131
131
|
{open ? (
|
|
132
132
|
<div className="dc-answerline dc-acts">
|
|
133
|
-
<button className={`ghost dc-act${asking ? ' on' : ''}`} data-act="change" {...tip(change.what)} onMouseDown={keepFocus} onClick={() =>
|
|
133
|
+
<button className={`ghost dc-act${asking ? ' on' : ''}`} data-act="change" {...tip(change.what)} onMouseDown={keepFocus} onClick={() => thread.askChange(post.key)}>
|
|
134
134
|
↻ {change.label}
|
|
135
135
|
</button>
|
|
136
136
|
</div>
|
|
@@ -27,6 +27,6 @@ export const HeardLine = observer(({ rv, at, heard, to }: { rv: ReviewSt; at: st
|
|
|
27
27
|
}
|
|
28
28
|
const waited = wait.get()
|
|
29
29
|
if (named !== '') return <div className="rv-heard wait" {...tip('the parties your word names hear it, and no other agent')}>{named}waiting {waited}</div>
|
|
30
|
-
const h = rv.hearingOf(rv.openRow?.holder)
|
|
30
|
+
const h = rv.hearingOf(rv.openRow?.state.holder)
|
|
31
31
|
return <div className={`rv-heard wait light-${h.light}`} {...tip('no agent marked it read yet')}>waiting {waited} · {h.light === 'nobody' ? 'nobody heard it yet' : h.words}</div>
|
|
32
32
|
})
|
|
@@ -22,18 +22,11 @@ type Line = { text: string; tick: boolean; pick?: number }
|
|
|
22
22
|
const linesOf = (thread: ThreadSt, c: ReplyCell): Line[] => (c.ask?.lines ?? []).map((l, i) => ({ ...l, tick: thread.ticking[`${c.id}#${i}`] ?? l.tick }))
|
|
23
23
|
|
|
24
24
|
/** the step he is on: the first one not ticked, null once every step is */
|
|
25
|
-
|
|
25
|
+
const currentStep = (thread: ThreadSt, c: ReplyCell): number | null => {
|
|
26
26
|
const i = linesOf(thread, c).findIndex((l) => !l.tick)
|
|
27
27
|
return i < 0 ? null : i
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
/** the dock line of the instructions: « step 2 of 3: Add three tiers », or « all 3 steps done » */
|
|
31
|
-
export const stepLine = (thread: ThreadSt, c: ReplyCell): { n: string; title: string } => {
|
|
32
|
-
const lines = linesOf(thread, c)
|
|
33
|
-
const i = currentStep(thread, c)
|
|
34
|
-
return i === null ? { n: `all ${lines.length} steps done`, title: '' } : { n: `step ${i + 1} of ${lines.length}`, title: lines[i]!.text }
|
|
35
|
-
}
|
|
36
|
-
|
|
37
30
|
/** a field at its place in a step: the question of that step it is (`step: { of, i }`, the k-th), drawn by the widget
|
|
38
31
|
* of its kind (the secret field, a link, a value); a secret's terminal way is its « via cli » button */
|
|
39
32
|
const Field = observer(({ rv, thread, c, i, k, field, live }: { rv: ReviewSt; thread: ThreadSt; c: ReplyCell; i: number; k: number; field: StepField; live: boolean }) => {
|
|
@@ -10,7 +10,7 @@ import { useEffect, useMemo, useRef } from 'react'
|
|
|
10
10
|
import { kindDraw, kindFrames, kindViewsOf } from '../../../review/kind-still.ts'
|
|
11
11
|
import { kindOf, valueKindOf } from '../../../review/kinds.ts'
|
|
12
12
|
import { isGallery, NO_SPEC, type Item, type StoredState } from '../../../review/model.ts'
|
|
13
|
-
import { cardOf } from '../../../review/object-card.ts'
|
|
13
|
+
import { cardOf, fillOf } from '../../../review/object-card.ts'
|
|
14
14
|
import { CodeHunk, Swatches, WordDiff } from './diff-view.tsx'
|
|
15
15
|
import { keepFocus } from './kit.tsx'
|
|
16
16
|
import { Lightbox } from './lightbox.tsx'
|
|
@@ -235,32 +235,37 @@ const FieldValue = ({ kind, before, after }: { kind: string | undefined; before?
|
|
|
235
235
|
/** the kind's actions: one click is a message the holder's watch prints; one that takes words names itself on the reply
|
|
236
236
|
* box's chip, and the owner's words there go with it. On item `id`; `re` the link in the thread it acts on (an object's box),
|
|
237
237
|
* `about` that object's address, said first in the words so the holder's watch line names it */
|
|
238
|
-
export const Actions = observer(({ thread, id, actions, re, about }: { thread: ThreadSt; id: string; actions: NonNullable<ReturnType<typeof kindOf>>['actions'] & object; re?: string; about?: string }) => {
|
|
239
|
-
const
|
|
238
|
+
export const Actions = observer(({ thread, id, actions, re, about, md, decided }: { thread: ThreadSt; id: string; actions: NonNullable<ReturnType<typeof kindOf>>['actions'] & object; re?: string; about?: string; /** the object's words, an action's `fill` reads its box's first words from them */ md?: string; /** the act he chose: drawn picked as an option he picked, in its tone, the others dimmed, no click left */ decided?: { name: string } }) => {
|
|
239
|
+
const local = thread.actOn(id, re)
|
|
240
|
+
const chosen = decided?.name ?? (local !== undefined && local.state !== 'failed' ? local.name : undefined)
|
|
240
241
|
const o = thread.replyOn
|
|
241
242
|
const asked = (name: string): boolean => o?.to === 'action' && o.on === id && o.name === name && o.re === re
|
|
243
|
+
const tone = (name: string, no: boolean | undefined): string => (chosen === name ? (no ? ' picked none' : ' picked') : decided !== undefined ? ' faded' : asked(name) ? ' on' : '')
|
|
242
244
|
return (
|
|
243
|
-
<div className="rv-kindactions">
|
|
245
|
+
<div className="rv-kindactions" data-check="kind-actions" data-decided={decided?.name} aria-busy={local?.state === 'sending'}>
|
|
244
246
|
<div className="rv-askopts">
|
|
245
247
|
{Object.entries(actions).map(([name, a]) => (
|
|
246
248
|
<button
|
|
247
249
|
key={name}
|
|
248
|
-
className={`rv-askopt${
|
|
249
|
-
{
|
|
250
|
-
|
|
250
|
+
className={`rv-askopt${tone(name, a.no)}`}
|
|
251
|
+
data-action={name}
|
|
252
|
+
{...tip(decided !== undefined ? (chosen === name ? 'your answer' : null) : a.words ? `${a.what ?? name}: say it in the reply box` : (a.what ?? name))}
|
|
253
|
+
disabled={thread.busy || decided !== undefined}
|
|
251
254
|
onMouseDown={keepFocus}
|
|
252
255
|
onClick={() =>
|
|
253
256
|
a.words
|
|
254
|
-
? thread.replyTo({ to: 'action', on: id, name, label: `« ${a.label} »`, ...(re !== undefined ? { re } : {}), ...(about !== undefined ? { about } : {}) })
|
|
257
|
+
? (thread.replyTo({ to: 'action', on: id, name, label: `« ${a.label} »`, ...(re !== undefined ? { re } : {}), ...(about !== undefined ? { about } : {}) }),
|
|
258
|
+
a.fill && md ? thread.setComment(fillOf(md, a.fill)) : undefined)
|
|
255
259
|
: void thread.act(id, name, about ?? '', re)
|
|
256
260
|
}
|
|
257
261
|
>
|
|
258
262
|
{a.icon ? `${a.icon} ` : ''}
|
|
259
263
|
{a.label}
|
|
260
|
-
{
|
|
264
|
+
{chosen === name ? decided !== undefined ? <span className="rv-yours">✓ yours</span> : <span className="rv-badge">{local?.state === 'sending' ? 'sending…' : '✓ sent'}</span> : null}
|
|
261
265
|
</button>
|
|
262
266
|
))}
|
|
263
267
|
</div>
|
|
268
|
+
{local?.state === 'failed' ? <div className="rv-pickstate err">✗ not sent: {local.why}</div> : null}
|
|
264
269
|
</div>
|
|
265
270
|
)
|
|
266
271
|
})
|
|
@@ -13,23 +13,16 @@ import { tip, type TipAttrs } from '../tips.ts'
|
|
|
13
13
|
/** a status's tone, as a class review.css colours: its tint, its line, its badge */
|
|
14
14
|
export const toneOf = (s: ShownStatus): string => `st-${s}`
|
|
15
15
|
|
|
16
|
-
/** the verdicts the owner gives, in the order of their buttons */
|
|
17
|
-
export const VERDICTS: { status: ReviewStatus; label: string; short: string; key: string; glyph: string }[] = [
|
|
18
|
-
{ status: 'approved', label: 'Approve', short: 'Approve', key: 'V', glyph: '✓' },
|
|
19
|
-
{ status: 'approved-with-fix', label: 'OK with a fix', short: 'Fix', key: 'F', glyph: '⚒' },
|
|
20
|
-
{ status: 'rejected', label: 'Reject', short: 'Reject', key: 'R', glyph: '✕' },
|
|
21
|
-
{ status: 'archived', label: 'Not doing it: closed, nothing owed', short: 'Not doing it', key: 'A', glyph: '▤' },
|
|
22
|
-
]
|
|
23
16
|
|
|
24
17
|
/** the owner's reaction to a view or a tile, in the order of the toggles */
|
|
25
18
|
export const REACTIONS: { status: ReviewStatus; label: string; tip: string; glyph: string; key: string }[] = [
|
|
26
19
|
{ status: 'approved', label: 'OK', tip: 'this image is right', glyph: '✓', key: 'V' },
|
|
27
20
|
{ status: 'approved-with-fix', label: 'Fix', tip: 'almost: a fix', glyph: '⚒', key: 'F' },
|
|
28
|
-
{ status: '
|
|
21
|
+
{ status: 'rework', label: 'No', tip: 'this image is wrong', glyph: '✕', key: 'R' },
|
|
29
22
|
]
|
|
30
23
|
|
|
31
24
|
/** the same three said of one message of a draft version: what each means for a text and its place */
|
|
32
|
-
export const PLACE_TIPS: Record<string, string> = { approved: 'this text is right for this place', 'approved-with-fix': 'almost: say what to change',
|
|
25
|
+
export const PLACE_TIPS: Record<string, string> = { approved: 'this text is right for this place', 'approved-with-fix': 'almost: say what to change', rework: 'not this text, or not this place' }
|
|
33
26
|
|
|
34
27
|
/** the lightbox's key for a word on the image shown: 1 2 3, or V F R (each reaction's `key`, the letters of the version's
|
|
35
28
|
* verdict), which there speak of the image in front of the reader. Null for any other key */
|
|
@@ -85,7 +78,7 @@ export function laneHue(lane: string): number {
|
|
|
85
78
|
}
|
|
86
79
|
|
|
87
80
|
/** a lane reworking the thread: a slow spinner and « L147 reworks it » in the lane's colour; nothing when nobody does */
|
|
88
|
-
export const Rework = ({ r }: { r:
|
|
81
|
+
export const Rework = ({ r }: { r: { lane: string; since: string; until: number } | null | undefined }) => {
|
|
89
82
|
const [, redraw] = useState(0)
|
|
90
83
|
const until = r?.until
|
|
91
84
|
useEffect(() => {
|
|
@@ -108,7 +101,7 @@ export const Rework = ({ r }: { r: ThreadRow['rework'] }) => {
|
|
|
108
101
|
* its holder hears, amber while its session hears for it, grey while nobody does; a click shows the tree it reads.
|
|
109
102
|
* `plain` is a list row's: the lane alone in muted words, the light a dot, nothing when nobody holds it. `hears` is the
|
|
110
103
|
* answer box's: the one who hears his answer now, never a lane that ended (its session, the orchestrator, « nobody ») */
|
|
111
|
-
export const HolderChip = observer(({ rv, holder, compact = false, plain = false, hears = false }: { rv: ReviewSt; holder: ThreadRow['holder'] |
|
|
104
|
+
export const HolderChip = observer(({ rv, holder, compact = false, plain = false, hears = false }: { rv: ReviewSt; holder: ThreadRow['state']['holder'] | undefined; compact?: boolean; plain?: boolean; hears?: boolean }) => {
|
|
112
105
|
const h = rv.hearingOf(holder)
|
|
113
106
|
const tree = rv.treeOf(holder)
|
|
114
107
|
const repo = rv.partiesRepo || rv.host.name
|
|
@@ -28,10 +28,10 @@ export const LaneBar = observer(({ rv, thread, menu }: { rv: ReviewSt; thread: T
|
|
|
28
28
|
const [err, setErr] = useState<string | null>(null)
|
|
29
29
|
if (!v) return null
|
|
30
30
|
const repo = rv.partiesRepo || rv.host.name
|
|
31
|
-
if (v.laneAsk)
|
|
31
|
+
if (v.state.laneAsk)
|
|
32
32
|
return (
|
|
33
|
-
<span className="rv-lanebar on" role="status" {...tip(v.laneAsk.words ? `your words: ${v.laneAsk.words}` : 'a lane, no words')}>
|
|
34
|
-
⇢ {laneAskWords(v.laneAsk, v.holder ? { ...v.holder, at: '' } : null, rv.parties, repo)}
|
|
33
|
+
<span className="rv-lanebar on" role="status" {...tip(v.state.laneAsk.words ? `your words: ${v.state.laneAsk.words}` : 'a lane, no words')}>
|
|
34
|
+
⇢ {laneAskWords(v.state.laneAsk, v.state.holder ? { ...v.state.holder, at: '' } : null, rv.parties, repo)}
|
|
35
35
|
</span>
|
|
36
36
|
)
|
|
37
37
|
const send = async (words: string): Promise<void> => {
|