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
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
// the lightbox over the whole window: one bar on top (where he is, what he does, then ✕), the stage that takes the room
|
|
2
2
|
// between (--fit-h, review.css), a slim bar under it. A view of a version (review-views.tsx BoxFrame) and a kind's page
|
|
3
3
|
// framed live (kind-states.tsx KindBox) draw in it; each keeps its own keys (review-views.tsx boxKey). `over` floats
|
|
4
|
-
// in a corner of the stage, over the view (the map of a picture larger than its room, box-zoom.tsx)
|
|
4
|
+
// in a corner of the stage, over the view (the map of a picture larger than its room, box-zoom.tsx). `side` stands on
|
|
5
|
+
// the stage's right, never over the view (an option's panel, review-views.tsx OptionSide)
|
|
5
6
|
import type { ReactNode, RefObject } from 'react'
|
|
6
7
|
import { tip } from '../tips.ts'
|
|
7
8
|
import { Key } from './kit.tsx'
|
|
8
9
|
|
|
9
|
-
export const Lightbox = ({ tone = '', label, top, foot, close, stage, over, children }: { tone?: string; label: string; top: ReactNode; foot?: ReactNode; close: () => void; stage?: RefObject<HTMLDivElement | null>; over?: ReactNode; children: ReactNode }) =>
|
|
10
|
-
<div
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
<
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
export const Lightbox = ({ tone = '', label, top, foot, close, stage, over, side, children }: { tone?: string; label: string; top: ReactNode; foot?: ReactNode; close: () => void; stage?: RefObject<HTMLDivElement | null>; over?: ReactNode; side?: ReactNode; children: ReactNode }) => {
|
|
11
|
+
const room = <div ref={stage} className="rv-boxstage rv-zoomstage">{children}{over}</div>
|
|
12
|
+
return (
|
|
13
|
+
<div className={`rv-viewbox${tone}`} data-check="lightbox" role="dialog" aria-modal="true" aria-label={label}>
|
|
14
|
+
<header className="rv-boxbar rv-boxtop">
|
|
15
|
+
{top}
|
|
16
|
+
<button className="ghost rv-boxclose" data-check="lightbox-close" {...tip('close', 'Escape')} aria-label="close" onClick={close}>✕<Key k="esc" /></button>
|
|
17
|
+
</header>
|
|
18
|
+
{side ? <div className="rv-boxbody">{room}{side}</div> : room}
|
|
19
|
+
{foot ? <footer className="rv-boxbar rv-boxfoot">{foot}</footer> : null}
|
|
20
|
+
</div>
|
|
21
|
+
)
|
|
22
|
+
}
|
|
@@ -61,6 +61,9 @@ export class LineWindow {
|
|
|
61
61
|
spread = 0
|
|
62
62
|
/** the column stands at its end: a line that lands after it is followed. Plain, it draws nothing */
|
|
63
63
|
atEnd = false
|
|
64
|
+
/** how far above its end the column stood at its last scroll: a follow of the end keeps it, so a line drawn again at
|
|
65
|
+
* its height moves nothing under his pointer. Plain, it draws nothing */
|
|
66
|
+
fromEnd = 0
|
|
64
67
|
/** the dom id a jump asked to draw, before the next scroll */
|
|
65
68
|
anchor: string | null = null
|
|
66
69
|
|
|
@@ -69,7 +72,7 @@ export class LineWindow {
|
|
|
69
72
|
/** where the thread lands, null for its end: the window stands there before the first scroll */
|
|
70
73
|
private readonly landing: () => string | null = () => null,
|
|
71
74
|
) {
|
|
72
|
-
makeAutoObservable<this, 'lines' | 'landing'>(this, { lines: false, landing: false, atEnd: false, heights: observableShallow, range: computedStruct })
|
|
75
|
+
makeAutoObservable<this, 'lines' | 'landing'>(this, { lines: false, landing: false, atEnd: false, fromEnd: false, heights: observableShallow, range: computedStruct })
|
|
73
76
|
}
|
|
74
77
|
|
|
75
78
|
get keys(): string[] {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// went; off it (his phone over the tailnet) the frame is the page itself, and the bar knows only what it was told to
|
|
4
4
|
// open. The one constraint a reader breaks first: a message counts only from the frame's own window, under a hop name
|
|
5
5
|
import { makeAutoObservable } from 'mobx'
|
|
6
|
-
import { LIVE_SAY, liveHopOrigin, liveHopTarget, liveHopUrl, liveLoopback, liveTargetUrl, liveUrlRefusal } from '../../../review/live-view.ts'
|
|
6
|
+
import { LIVE_SAY, liveHopOrigin, liveHopTarget, liveHopUrl, liveLoopback, liveTabHref, liveTargetUrl, liveUrlRefusal } from '../../../review/live-view.ts'
|
|
7
7
|
|
|
8
8
|
/** where the page that holds the bar sits: `location` in the browser */
|
|
9
9
|
export type LivePlace = { hostname: string; port: string; origin: string }
|
|
@@ -69,7 +69,7 @@ export class LiveBarSt {
|
|
|
69
69
|
|
|
70
70
|
/** the hub's own page that frames the page the frame is on now, full window */
|
|
71
71
|
get tabHref(): string {
|
|
72
|
-
return
|
|
72
|
+
return liveTabHref(this.url)
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
private wall(url: string): string | null {
|
|
@@ -4,7 +4,10 @@
|
|
|
4
4
|
// behind it. Only the owner's hub frames: an advisor's copy holds the shot alone
|
|
5
5
|
import { observer } from 'mobx-react-lite'
|
|
6
6
|
import { useEffect, useMemo, useRef, useState, type ReactNode } from 'react'
|
|
7
|
-
import { liveFace, liveOpenHref, type ViewLive } from '../../../review/live-view.ts'
|
|
7
|
+
import { liveFace, liveOpenHref, liveTabHref, type ViewLive } from '../../../review/live-view.ts'
|
|
8
|
+
import { besideKind, openBeside, openTab, type SideIdentity } from '../app-bridge.ts'
|
|
9
|
+
import { ICON, Icon } from '../icons.tsx'
|
|
10
|
+
import { hubProbe, sideFrame } from '../side-frame.ts'
|
|
8
11
|
import { Words } from '../words.tsx'
|
|
9
12
|
import { keepFocus } from './kit.tsx'
|
|
10
13
|
import { LiveBar, LiveFrame, LiveRefusal } from './live-bar.tsx'
|
|
@@ -103,3 +106,56 @@ export const LiveBody = observer(({ live, label, shotSrc, size, shot }: { live:
|
|
|
103
106
|
</div>
|
|
104
107
|
)
|
|
105
108
|
})
|
|
109
|
+
|
|
110
|
+
/** one way to open a live view's page from its tile: a button, or a link a plain click sends through `run` */
|
|
111
|
+
type TileAct = { id: string; icon: string; tip: string; run: () => void; href?: string }
|
|
112
|
+
|
|
113
|
+
/** a live view's tile in the thread: its shot inside a border of its own colour (--iframe), IFRAME on it, and down its
|
|
114
|
+
* right side every way to open the page this hub has: framed here in the lightbox, beside the page (the app's side
|
|
115
|
+
* panel, else the page's side frame), the page itself in a tab, the hub's tab with its bar, its address copied. A page
|
|
116
|
+
* that frames nothing (an advisor's) keeps the shot and the lightbox alone */
|
|
117
|
+
export const LiveTile = observer(({ live, label, still, open, framed, hub, identity }: { live: ViewLive; label: string; still: ReactNode; open: () => void; framed: boolean; hub: { url(path: string): string }; identity: () => SideIdentity | null }) => {
|
|
118
|
+
const [copied, setCopied] = useState(false)
|
|
119
|
+
useEffect(() => {
|
|
120
|
+
if (!copied) return
|
|
121
|
+
const t = setTimeout(() => setCopied(false), 1_500)
|
|
122
|
+
return () => clearTimeout(t)
|
|
123
|
+
}, [copied])
|
|
124
|
+
const href = liveOpenHref(live, location.origin)
|
|
125
|
+
const name = label || live.url
|
|
126
|
+
const beside = framed ? besideKind(globalThis, sideFrame) : null
|
|
127
|
+
const acts: TileAct[] = [
|
|
128
|
+
{ id: 'here', icon: ICON.play, tip: !framed ? 'open its shot large' : live.hub ? 'open its shot large: a page of this hub is never framed into it' : 'run the page here, framed in the lightbox with its address bar', run: open },
|
|
129
|
+
...(beside == null ? [] : [{
|
|
130
|
+
id: 'side', icon: ICON.sidepanel,
|
|
131
|
+
tip: beside === 'app' ? "open the page in this window's side panel, beside the thread" : 'open the page in a side frame at the right of this page, beside the thread',
|
|
132
|
+
run: () => void (openBeside(new URL(href), globalThis, sideFrame.at(hubProbe((p) => hub.url(p), location.origin)), identity()) || openTab(href, name)),
|
|
133
|
+
}]),
|
|
134
|
+
...(!framed ? [] : [
|
|
135
|
+
{ id: 'tab', icon: ICON.newtab, tip: `open the page itself in a new tab: ${href}`, href, run: () => openTab(href, name) },
|
|
136
|
+
...(live.hub ? [] : [{ id: 'hubtab', icon: ICON.window, tip: 'open it in a tab of the hub, full window, with back, forward and its address bar', href: liveTabHref(live.url), run: () => openTab(liveTabHref(live.url)) }]),
|
|
137
|
+
{ id: 'copy', icon: copied ? ICON.check : ICON.copy, tip: copied ? 'copied' : `copy its address: ${href}`, run: () => void navigator.clipboard.writeText(href).then(() => setCopied(true), () => undefined) },
|
|
138
|
+
]),
|
|
139
|
+
]
|
|
140
|
+
return (
|
|
141
|
+
<div className="rv-livetile" data-check="live-tile">
|
|
142
|
+
{still}
|
|
143
|
+
<span className="rv-iframetag" aria-hidden>{framed ? 'IFRAME' : 'SHOT'}</span>
|
|
144
|
+
<div className="rv-iframerail" role="toolbar" aria-label="open the page">
|
|
145
|
+
{acts.map((a) =>
|
|
146
|
+
a.href != null ? (
|
|
147
|
+
// a link, so the pointer shows where it goes and ⌘ click keeps the browser's way; a plain click is the hub's tab
|
|
148
|
+
<a key={a.id} href={a.href} target="_blank" rel="noopener noreferrer" data-check={`live-${a.id}`} aria-label={a.tip} {...tip(a.tip)}
|
|
149
|
+
onClickCapture={(e) => {
|
|
150
|
+
if (e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) return
|
|
151
|
+
e.preventDefault()
|
|
152
|
+
a.run()
|
|
153
|
+
}}><Icon d={a.icon} /></a>
|
|
154
|
+
) : (
|
|
155
|
+
<button key={a.id} type="button" data-check={`live-${a.id}`} aria-label={a.tip} {...tip(a.tip)} onMouseDown={keepFocus} onClick={a.run}><Icon d={a.icon} /></button>
|
|
156
|
+
),
|
|
157
|
+
)}
|
|
158
|
+
</div>
|
|
159
|
+
</div>
|
|
160
|
+
)
|
|
161
|
+
})
|
|
@@ -13,7 +13,6 @@ import { glyphOf, hueOf, MESSAGE_TYPES, type MessageType } from '../../../review
|
|
|
13
13
|
import { kindOf } from '../../../review/kinds.ts'
|
|
14
14
|
import { drawnBy } from '../../../review/one-block.ts'
|
|
15
15
|
import { NO_SPEC, type Item, type Spec } from '../../../review/model.ts'
|
|
16
|
-
import type { WaitsOn } from '../../../review/wait.ts'
|
|
17
16
|
import { Icon, ICON } from '../icons.tsx'
|
|
18
17
|
import { renderMd } from '../md.ts'
|
|
19
18
|
import { Actions, Frames } from './kind-states.tsx'
|
|
@@ -21,6 +20,8 @@ import { keepFocus } from './kit.tsx'
|
|
|
21
20
|
import type { ReviewSt } from './review-st.ts'
|
|
22
21
|
import type { ThreadSt } from './thread-st.ts'
|
|
23
22
|
import { tip } from '../tips.ts'
|
|
23
|
+
import { WordsInline } from '../words.tsx'
|
|
24
|
+
import { type WaitsOn } from '../../../review/thread-state.ts'
|
|
24
25
|
|
|
25
26
|
/** the type of one cell of a thread: a question by what it takes, a link, an update, the owner's note */
|
|
26
27
|
export function messageTypeOf(c: Cell): MessageType {
|
|
@@ -29,6 +30,7 @@ export function messageTypeOf(c: Cell): MessageType {
|
|
|
29
30
|
if (c.kind === 'verdict') return 'verdict'
|
|
30
31
|
if (c.kind === 'note') return 'note'
|
|
31
32
|
if (c.instructions) return 'instructions'
|
|
33
|
+
if (c.recap) return 'recap'
|
|
32
34
|
if (c.propose) return 'change'
|
|
33
35
|
if (c.ask) return c.ask.kind === 'secret' ? 'secret' : c.ask.kind === 'checklist' ? 'checklist' : 'question'
|
|
34
36
|
if (c.op === 'ask') return 'question'
|
|
@@ -92,7 +94,15 @@ const DrawnThere = observer(({ rv, thread, address }: { rv: ReviewSt; thread: Th
|
|
|
92
94
|
)
|
|
93
95
|
})
|
|
94
96
|
|
|
95
|
-
/**
|
|
97
|
+
/** the owner's act on a linked object, drawn on it: the act, the owner's words with it */
|
|
98
|
+
const Decided = ({ d, label, bare }: { d: NonNullable<Linked['decided']>; label: string | undefined; /** the act drawn picked above it: its words alone */ bare?: boolean }) => (
|
|
99
|
+
<span className="rv-linkeddecided" data-check="object-decided">
|
|
100
|
+
{bare ? null : <>you: {label ?? d.name}</>}
|
|
101
|
+
{d.text !== '' ? <>{bare ? '' : ' '}« <WordsInline text={d.text} /> »</> : null}
|
|
102
|
+
</span>
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
/** an object a message linked, drawn compact: its click opens the panel with the object whole; its kind's actions on
|
|
96
106
|
* it while it stands and its panel is shut (open, the panel holds them), the owner's answer once given, folded once its own
|
|
97
107
|
* thread is done */
|
|
98
108
|
export const ObjectCard = observer(({ rv, thread, c, l }: { rv: ReviewSt; thread: ThreadSt; c: ReplyCell; l: Linked }) => {
|
|
@@ -106,16 +116,18 @@ export const ObjectCard = observer(({ rv, thread, c, l }: { rv: ReviewSt; thread
|
|
|
106
116
|
<span className="rv-objglyph" {...tip(kind?.label ?? word)} {...hueProps(kind)}><Icon d={glyphOf(kind)} /></span>
|
|
107
117
|
<span className="rv-objtext">
|
|
108
118
|
<span className="rv-objhead"><span className="rv-linkedkind">{word}</span><b className="rv-objtitle">{l.title}</b></span>
|
|
109
|
-
{l.md.trim() !== '' ? <span className="rv-objline">{oneLine(l.md)}</span> : l.lost ? <span className="rv-objline rv-dim">its words are lost</span> : null}
|
|
119
|
+
{l.md.trim() !== '' && !kind?.whole ? <span className="rv-objline">{oneLine(l.md)}</span> : l.md.trim() === '' && l.lost ? <span className="rv-objline rv-dim">its words are lost</span> : null}
|
|
110
120
|
</span>
|
|
111
121
|
</button>
|
|
112
|
-
{l.
|
|
122
|
+
{kind?.whole && l.md.trim() !== '' ? <div className="md rv-what rv-objwhole" data-check="object-whole" dangerouslySetInnerHTML={{ __html: renderMd(l.md.replace(/^# .*\n+/, '')) }} /> : null}
|
|
123
|
+
{kind?.actions && l.decided && !open ? <Actions thread={thread} id={c.on} actions={kind.actions} re={c.id.slice(c.on.length + 1)} about={l.address} decided={l.decided} /> : null}
|
|
124
|
+
{(l.decided && (!kind?.actions || l.decided.text !== '')) || l.done ? (
|
|
113
125
|
<div className="rv-objstate">
|
|
114
|
-
{l.decided ? <
|
|
126
|
+
{l.decided ? <Decided d={l.decided} label={kind?.actions?.[l.decided.name]?.label} bare={kind?.actions !== undefined} /> : null}
|
|
115
127
|
{l.done ? <span className="rv-dim" {...tip(l.folded ?? 'folded')}>folded</span> : null}
|
|
116
128
|
</div>
|
|
117
129
|
) : null}
|
|
118
|
-
{kind?.actions && !l.done && !open ? <Actions thread={thread} id={c.on} actions={kind.actions} re={c.id.slice(c.on.length + 1)} about={l.address} /> : null}
|
|
130
|
+
{kind?.actions && !l.decided && !l.done && !open ? <Actions thread={thread} id={c.on} actions={kind.actions} re={c.id.slice(c.on.length + 1)} about={l.address} md={l.md} /> : null}
|
|
119
131
|
</section>
|
|
120
132
|
)
|
|
121
133
|
})
|
|
@@ -212,9 +224,9 @@ export const ObjectPanel = observer(({ rv, thread, whole }: { rv: ReviewSt; thre
|
|
|
212
224
|
</div>
|
|
213
225
|
{at?.l ? (
|
|
214
226
|
<footer className="rv-panelfoot">
|
|
215
|
-
{at.l.decided ? <
|
|
227
|
+
{at.l.decided && (!kind?.actions || at.l.decided.text !== '') ? <Decided d={at.l.decided} label={kind?.actions?.[at.l.decided.name]?.label} bare={kind?.actions !== undefined} /> : null}
|
|
216
228
|
{at.l.done ? <span className="rv-dim">folded: {at.l.folded ?? 'its own thread is done'}</span> : null}
|
|
217
|
-
{kind?.actions && !at.l.done ? <Actions thread={thread} id={at.c.on} actions={kind.actions} re={at.c.id.slice(at.c.on.length + 1)} about={at.l.address} /> : null}
|
|
229
|
+
{kind?.actions && (at.l.decided || !at.l.done) ? <Actions thread={thread} id={at.c.on} actions={kind.actions} re={at.c.id.slice(at.c.on.length + 1)} about={at.l.address} md={at.l.md} {...(at.l.decided ? { decided: at.l.decided } : {})} /> : null}
|
|
218
230
|
</footer>
|
|
219
231
|
) : null}
|
|
220
232
|
</aside>
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// what an agent asks of the owner in a thread, answered in one click (wiki tools/shipkit/threads.md, A question, A proposed
|
|
2
2
|
// change): a question's options, each words or a media drawn as a view, and a proposed change, each field drawn by its
|
|
3
|
-
// type and applied alone.
|
|
3
|
+
// type and applied alone. A choice answers in the five tones of a verdict (tones.ts): an option or the agent's pick (ok),
|
|
4
|
+
// one with the owner's remark (ok with a fix), none of them in the owner's words (rework, wrong direction), or your call; its bar is the
|
|
5
|
+
// verdict's (tone-bar.tsx)
|
|
4
6
|
import { observer } from 'mobx-react-lite'
|
|
5
7
|
import { useCallback, useEffect, useMemo, useRef, useState, type ReactNode } from 'react'
|
|
6
8
|
import type { PersonPick, ReplyCell } from '../../../review/cells.ts'
|
|
@@ -10,7 +12,9 @@ import { CodeHunk, Swatches, WordDiff } from './diff-view.tsx'
|
|
|
10
12
|
import { AutoText } from '../auto-text.tsx'
|
|
11
13
|
import { renderMdInline } from '../md.ts'
|
|
12
14
|
import { WordsInline } from '../words.tsx'
|
|
13
|
-
import { keepFocus } from './kit.tsx'
|
|
15
|
+
import { keepFocus, toneOf } from './kit.tsx'
|
|
16
|
+
import { ToneBar, ToneMark } from './tone-bar.tsx'
|
|
17
|
+
import { toneOfStatus } from './tones.ts'
|
|
14
18
|
import type { ReviewSt } from './review-st.ts'
|
|
15
19
|
import { secretFacts } from './secret-facts.ts'
|
|
16
20
|
import { ReadableLine } from '../secret-readable.tsx'
|
|
@@ -22,12 +26,13 @@ import { tip } from '../tips.ts'
|
|
|
22
26
|
|
|
23
27
|
type Field = NonNullable<ReplyCell['propose']>['fields'][number]
|
|
24
28
|
|
|
25
|
-
/** an option's or a field's media, a view of the item the message sits on, drawn read only
|
|
26
|
-
|
|
27
|
-
|
|
29
|
+
/** an option's or a field's media, a view of the item the message sits on, drawn read only; an option's name is its
|
|
30
|
+
* button's, so its view draws no caption of its own (`named`) */
|
|
31
|
+
const MessageView = observer(({ rv, thread, c, i, named = true }: { rv: ReviewSt; thread: ThreadSt; c: ReplyCell; i: number; named?: boolean }) => {
|
|
32
|
+
const version = thread.holderOf(c.on)
|
|
28
33
|
const v = version?.item.views[i]
|
|
29
34
|
if (!version || !v) return <div className="rv-dim">the media is gone from the store</div>
|
|
30
|
-
return <ViewCell ver={{ rv, thread, cell: version, live: false
|
|
35
|
+
return <ViewCell ver={{ rv, thread, cell: version, live: false }} v={v} i={i} noted={false} named={named} />
|
|
31
36
|
})
|
|
32
37
|
|
|
33
38
|
/** each person's pick on a choice question (their vote, or the answer their right « he picks for you » gave), with his
|
|
@@ -56,7 +61,7 @@ const PickLines = observer(({ rv, thread, c, ask }: { rv: ReviewSt; thread: Thre
|
|
|
56
61
|
<span className="rv-pickstate">sending…</span>
|
|
57
62
|
) : local.state === 'failed' ? (
|
|
58
63
|
<span className="rv-pickstate err">
|
|
59
|
-
✗ not sent: {local.why} <button className="ghost" {...tip('send this pick again')} onMouseDown={keepFocus} onClick={() => void thread.
|
|
64
|
+
✗ not sent: {local.why} <button className="ghost" {...tip('send this pick again')} onMouseDown={keepFocus} onClick={() => void thread.pickOption(c, local.option, local.remark)}>retry</button>
|
|
60
65
|
</span>
|
|
61
66
|
) : null
|
|
62
67
|
const picks = picksOf(rv, thread, c, ask)
|
|
@@ -114,10 +119,11 @@ const PickLines = observer(({ rv, thread, c, ask }: { rv: ReviewSt; thread: Thre
|
|
|
114
119
|
)
|
|
115
120
|
})
|
|
116
121
|
|
|
117
|
-
/** an agent's question
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
122
|
+
/** an agent's question, answered in the five tones of a verdict (tones.ts): a click on an option picks it (ok); its
|
|
123
|
+
* « pick with a remark » mark opens a box under it, the option and the owner's words sent together (ok with a fix); the
|
|
124
|
+
* bar under the options takes the agent's pick, answers none of them in the owner's words, or leaves it to the agent. Its media over each option, the agent's pick marked as
|
|
125
|
+
* a suggestion. Answered, his answer is the one lit in its tone, his remark under its option. A person's pick shows in
|
|
126
|
+
* the question's lines (PickLines), never above the thread */
|
|
121
127
|
export const AskBody = observer(({ rv, thread, c, ask }: { rv: ReviewSt; thread: ThreadSt; c: ReplyCell; ask: NonNullable<ReplyCell['ask']> }) => {
|
|
122
128
|
if (ask.kind !== undefined && ask.kind !== 'choice') return <KindAskBody rv={rv} thread={thread} c={c} ask={ask} />
|
|
123
129
|
const advisor = rv.host.role === 'advisor'
|
|
@@ -129,82 +135,173 @@ export const AskBody = observer(({ rv, thread, c, ask }: { rv: ReviewSt; thread:
|
|
|
129
135
|
const answered = his !== null
|
|
130
136
|
const media = ask.views?.some((v) => v !== null) === true
|
|
131
137
|
const words = (thread.hints[c.id] ?? '').trim() !== ''
|
|
132
|
-
const local = thread.picking[c.id]
|
|
133
138
|
// the option marked as the reader's: their click on its way, else their own pick (his, on his hub)
|
|
134
|
-
const yours =
|
|
139
|
+
const yours = thread.yours(c)
|
|
135
140
|
const mine = (i: number): boolean => yours === i
|
|
136
|
-
const
|
|
141
|
+
const remark = thread.yourRemark(c)
|
|
142
|
+
const tone = (i: number): string => (mine(i) ? (remark !== '' ? ' picked remark' : ' picked') : '')
|
|
143
|
+
const live = done === undefined && !c.superseded
|
|
144
|
+
const remarking = live ? thread.remarking[c.id] : undefined
|
|
145
|
+
// the agent's pick and the reader's own: in the option's button, or on its foot row under a picture
|
|
146
|
+
const pills = (i: number) => (
|
|
147
|
+
<>
|
|
148
|
+
{ask.pick === i ? <span className="rv-mypick" {...tip("the agent's suggestion, never your answer")}>my pick</span> : null}
|
|
149
|
+
{mine(i) ? <span className="rv-yours" {...tip(remark !== '' ? 'your pick, with your remark under it' : 'your pick')}>✓ yours</span> : null}
|
|
150
|
+
</>
|
|
151
|
+
)
|
|
152
|
+
const button = (o: string, i: number, withPills = true) => (
|
|
137
153
|
<button
|
|
138
154
|
key={i}
|
|
139
|
-
className={`rv-askopt${
|
|
155
|
+
className={`rv-askopt${tone(i)}${ask.pick === i && !answered ? ' pick' : ''}`}
|
|
140
156
|
// never disabled while a click is on its way: the next click waits its turn (thread-st.ts pickOption)
|
|
141
157
|
disabled={done !== undefined}
|
|
142
158
|
onMouseDown={keepFocus}
|
|
143
159
|
onClick={() => void thread.answer(c, { option: i })}
|
|
144
|
-
{...tip(done !== undefined ? null
|
|
160
|
+
{...tip(done !== undefined ? null : `pick this option${ask.pick === i ? "\nthe agent's own pick" : ''}`)}
|
|
145
161
|
>
|
|
146
162
|
<span className="rv-askn">{i + 1}</span>
|
|
147
163
|
<span className="rv-askoptlabel mdi" dangerouslySetInnerHTML={{ __html: renderMdInline(o) }} />
|
|
148
|
-
{
|
|
149
|
-
{mine(i) ? <span className="rv-yours">✓ yours</span> : null}
|
|
164
|
+
{withPills ? pills(i) : null}
|
|
150
165
|
</button>
|
|
151
166
|
)
|
|
167
|
+
// the orange face beside an option: « pick it, with my words », the box under it
|
|
168
|
+
const remarkFace = (i: number) =>
|
|
169
|
+
live ? (
|
|
170
|
+
<button type="button" className={`rv-askremark${remarking === i ? ' open' : ''}`} aria-label={`pick ${i + 1} with a remark`} aria-expanded={remarking === i} data-check="pick-remark"
|
|
171
|
+
{...tip(`pick ${i + 1} with a remark: a box opens for your words, and the agent reads the option and your words together`)} onMouseDown={keepFocus}
|
|
172
|
+
onClick={() => thread.setRemarking(c.id, remarking === i ? null : i)}>
|
|
173
|
+
<span className="st-approved-with-fix"><ToneMark t={toneOfStatus('approved-with-fix')!} /></span>
|
|
174
|
+
</button>
|
|
175
|
+
) : null
|
|
176
|
+
const choice = (o: string, i: number) => (
|
|
177
|
+
<span key={i} className={`rv-askchoice${tone(i)}`}>
|
|
178
|
+
{button(o, i)}
|
|
179
|
+
{remarkFace(i)}
|
|
180
|
+
</span>
|
|
181
|
+
)
|
|
182
|
+
const remarkBox = remarking !== undefined && remarking < ask.options.length ? <RemarkBox thread={thread} c={c} i={remarking} /> : null
|
|
183
|
+
const remarkSaid = (i: number) => (mine(i) && remark !== '' ? <div className="rv-askremarksaid" {...tip('your remark with this pick')}>« {remark} »</div> : null)
|
|
184
|
+
// his answer in words alone: a rework (none of these), a wrong direction or your call, in its tone
|
|
185
|
+
const given = toneOfStatus(ask.tone ?? 'rework')!
|
|
152
186
|
const said = his !== null && 'words' in his ? (
|
|
153
|
-
<button key="words" className=
|
|
154
|
-
<span className="rv-
|
|
187
|
+
<button key="words" className={`rv-askopt picked none words ${toneOf(given.status)}`} disabled {...tip(`your answer, ${given.word}: « ${his.words} »`)}>
|
|
188
|
+
<span className="rv-asknonelabel"><ToneMark t={given} /> {given.status === 'rework' ? 'none of these' : given.word}</span>
|
|
189
|
+
{his.words !== given.word ? <span className="rv-askoptlabel">« {his.words} »</span> : null}
|
|
155
190
|
<span className="rv-yours">✓ yours</span>
|
|
156
191
|
</button>
|
|
157
192
|
) : null
|
|
193
|
+
// the answer bar under the options (tone-bar.tsx): ok and a fix take the agent's pick, rework and wrong direction
|
|
194
|
+
// answer none of them in the owner's words, your call leaves it to the agent; a step of an ask's instructions keeps its words
|
|
195
|
+
const bar = c.step === undefined && !c.superseded ? <ToneBar thread={thread} on={c.id} question={c} pick={ask.pick !== undefined ? (ask.options[ask.pick] ?? `option ${ask.pick + 1}`) : null} /> : null
|
|
196
|
+
// a step's escape hatch: « none of these », the owner's words instead of an option. Answered in words, it holds the
|
|
197
|
+
// words, selected
|
|
198
|
+
const none = said ?? (answered || c.superseded || bar !== null ? null : (
|
|
199
|
+
<div key="none" className="rv-asknone">
|
|
200
|
+
<span className="rv-asknonelabel st-rework"><ToneMark t={toneOfStatus('rework')!} /> none of these</span>
|
|
201
|
+
<div className="rv-answerrow">
|
|
202
|
+
<AnswerWords thread={thread} c={c} placeholder="say why, or what to try instead" />
|
|
203
|
+
{!done && words ? (
|
|
204
|
+
<button className="primary rv-send rv-answersend" disabled={thread.busy} {...tip('send these words as your answer: none of these options')} onMouseDown={keepFocus} onClick={() => void thread.noneOf(c)}>
|
|
205
|
+
send
|
|
206
|
+
</button>
|
|
207
|
+
) : null}
|
|
208
|
+
</div>
|
|
209
|
+
</div>
|
|
210
|
+
))
|
|
158
211
|
return (
|
|
159
212
|
<div className="rv-ask">
|
|
160
|
-
{answered || c.superseded ? null : (
|
|
161
|
-
// the words and their own send on one row: words alone answer it, words then an option go with that option
|
|
162
|
-
<div className="rv-answerrow">
|
|
163
|
-
<AnswerWords thread={thread} c={c} placeholder="your answer in words, or a word, then an option below" />
|
|
164
|
-
{!done && words ? (
|
|
165
|
-
<button className="primary rv-send rv-answersend" disabled={thread.busy} {...tip('send these words as your answer, with no option picked; to go with an option, click the option instead')} onMouseDown={keepFocus} onClick={() => void thread.noneOf(c)}>
|
|
166
|
-
send
|
|
167
|
-
</button>
|
|
168
|
-
) : null}
|
|
169
|
-
</div>
|
|
170
|
-
)}
|
|
171
213
|
{media ? (
|
|
172
214
|
<div className="rv-askmedia">
|
|
173
215
|
{ask.options.map((o, i) => (
|
|
174
|
-
<div key={i} className={`rv-askoption${
|
|
175
|
-
{
|
|
176
|
-
|
|
216
|
+
<div key={i} className={`rv-askoption${tone(i)}${ask.pick === i && !answered ? ' pick' : ''}`}>
|
|
217
|
+
{/* a compact column: its picture (a click opens the lightbox on it, its side panel on this
|
|
218
|
+
option), its number and label, then « pick with a remark » and the pills on one row */}
|
|
219
|
+
{ask.views?.[i] != null ? <MessageView rv={rv} thread={thread} c={c} i={ask.views[i]!} named={false} /> : null}
|
|
220
|
+
{button(o, i, false)}
|
|
221
|
+
<div className="rv-askoptfoot">
|
|
222
|
+
{remarkFace(i)}
|
|
223
|
+
{pills(i)}
|
|
224
|
+
</div>
|
|
225
|
+
{remarking === i ? remarkBox : remarkSaid(i)}
|
|
177
226
|
</div>
|
|
178
227
|
))}
|
|
228
|
+
{none ? <div className={`rv-askoption rv-askoptnone${said ? ' picked none' : ''}`}>{none}</div> : null}
|
|
179
229
|
</div>
|
|
180
230
|
) : (
|
|
181
231
|
<div className="rv-askopts">
|
|
182
|
-
{ask.options.map(
|
|
183
|
-
{
|
|
232
|
+
{ask.options.map(choice)}
|
|
233
|
+
{remarkBox ?? (yours !== undefined ? remarkSaid(yours) : null)}
|
|
234
|
+
{none}
|
|
184
235
|
</div>
|
|
185
236
|
)}
|
|
186
|
-
{
|
|
237
|
+
{bar}
|
|
187
238
|
<PickLines rv={rv} thread={thread} c={c} ask={ask} />
|
|
188
239
|
</div>
|
|
189
240
|
)
|
|
190
241
|
})
|
|
191
242
|
|
|
243
|
+
/** the box of « pick with a remark » under option `i`: the owner's words, then « pick i with this remark » (or ⌘↵) sends the
|
|
244
|
+
* option and the words as one answer; Escape closes it, its words kept until sent */
|
|
245
|
+
const RemarkBox = observer(({ thread, c, i }: { thread: ThreadSt; c: ReplyCell; i: number }) => {
|
|
246
|
+
const box = thread.remarkBox(c)
|
|
247
|
+
const words = (thread.hints[box] ?? '').trim()
|
|
248
|
+
const send = (): void => {
|
|
249
|
+
if (words !== '') void thread.pickOption(c, i, words)
|
|
250
|
+
}
|
|
251
|
+
return (
|
|
252
|
+
<div className="rv-askremarkbox">
|
|
253
|
+
<AutoText className="rv-answerwords" autoFocus placeholder={`your remark with ${i + 1}: what to change, what to keep`} aria-label={`your remark with option ${i + 1}`} value={thread.hints[box] ?? ''} onText={(t) => thread.setHint(box, t)}
|
|
254
|
+
onKeyDown={answerKeys(send, () => thread.setRemarking(c.id, null))} />
|
|
255
|
+
<button type="button" className="rv-askremarksend" data-check="pick-remark-send" disabled={words === ''} {...tip(`pick ${i + 1}, with these words: the agent reads both`, '⌘↵')} onMouseDown={keepFocus} onClick={send}>
|
|
256
|
+
pick {i + 1} with this remark
|
|
257
|
+
</button>
|
|
258
|
+
</div>
|
|
259
|
+
)
|
|
260
|
+
})
|
|
261
|
+
|
|
262
|
+
/** a question with a row per thing (`sk thread ask --row`), drawn from its first row as one question: « 3 of 8 answered », then a row
|
|
263
|
+
* per thing, its name over its options side by side and « none of these », the agent's pick marked; one click or words
|
|
264
|
+
* answer that row alone */
|
|
265
|
+
export const RowsBody = observer(({ rv, thread, c }: { rv: ReviewSt; thread: ThreadSt; c: ReplyCell }) => {
|
|
266
|
+
const rows = thread.rowsOf(c)
|
|
267
|
+
const answered = (r: ReplyCell): boolean => r.ask?.answered !== undefined || r.ask?.none !== undefined
|
|
268
|
+
const done = rows.filter(answered).length
|
|
269
|
+
return (
|
|
270
|
+
<div className="rv-askrows">
|
|
271
|
+
<div className={`rv-checkcount${done === rows.length ? ' all' : ''}`}>{done === rows.length ? `✓ all ${rows.length} answered` : `${done} of ${rows.length} answered`}</div>
|
|
272
|
+
{rows.map((r) => (
|
|
273
|
+
<div key={r.id} className={`rv-askrow${answered(r) ? ' answered' : ''}`} id={`rv-row-${r.id.replace(/[^A-Za-z0-9-]/g, '_')}`}>
|
|
274
|
+
<div className="rv-askrowlabel mdi" dangerouslySetInnerHTML={{ __html: renderMdInline(r.ask!.row!.label) }} />
|
|
275
|
+
<AskBody rv={rv} thread={thread} c={r} ask={r.ask!} />
|
|
276
|
+
</div>
|
|
277
|
+
))}
|
|
278
|
+
</div>
|
|
279
|
+
)
|
|
280
|
+
})
|
|
281
|
+
|
|
192
282
|
type CellAsk = NonNullable<ReplyCell['ask']>
|
|
193
283
|
|
|
194
284
|
/** a question of another answer kind (wiki tools/shipkit/threads-asks.md, Answer kinds): a checklist's boxes, a confirm's
|
|
195
285
|
* « done », a text's or a url's field, a secret's place; the owner's words alone answer it as none, or ride on a checklist */
|
|
196
286
|
const KindAskBody = observer(({ rv, thread, c, ask }: { rv: ReviewSt; thread: ThreadSt; c: ReplyCell; ask: CellAsk }) => {
|
|
197
287
|
const words = (thread.hints[c.id] ?? '').trim() !== ''
|
|
288
|
+
// answered with the owner's words alone: they stand where its control stood, in green, never over the question
|
|
289
|
+
const inWords = ask.none !== undefined && ask.kind !== 'checklist' && !ask.open
|
|
198
290
|
return (
|
|
199
291
|
<div className={`rv-ask rv-ask-${ask.kind}`}>
|
|
200
292
|
{ask.kind === 'checklist' ? <Checklist thread={thread} c={c} ask={ask} /> : null}
|
|
201
|
-
{ask.kind === 'confirm' ? <Confirm thread={thread} c={c} ask={ask} /> : null}
|
|
202
|
-
{ask.kind === 'text' || ask.kind === 'url' ? <ValueField thread={thread} c={c} ask={ask} /> : null}
|
|
293
|
+
{ask.kind === 'confirm' && !inWords ? <Confirm thread={thread} c={c} ask={ask} /> : null}
|
|
294
|
+
{(ask.kind === 'text' || ask.kind === 'url') && !inWords ? <ValueField thread={thread} c={c} ask={ask} /> : null}
|
|
203
295
|
{ask.kind === 'secret' ? <SecretPlace rv={rv} thread={thread} c={c} ask={ask} /> : null}
|
|
204
|
-
{ask.kind === 'file' ? <div className="rv-dim">{ask.value ? `his file: view ${(ask.value.view ?? 0) + 1}` : 'a file he drops: not built in the hub yet'}</div> : null}
|
|
205
|
-
{
|
|
206
|
-
|
|
207
|
-
|
|
296
|
+
{ask.kind === 'file' && !inWords ? <div className="rv-dim">{ask.value ? `his file: view ${(ask.value.view ?? 0) + 1}` : 'a file he drops: not built in the hub yet'}</div> : null}
|
|
297
|
+
{inWords ? (
|
|
298
|
+
<div className="rv-askfield rv-askvalue given">
|
|
299
|
+
<AutoText className="rv-answerwords rv-askgiven" readOnly value={ask.none ?? ''} onText={() => undefined} />
|
|
300
|
+
<button className="rv-askopt pick picked" disabled {...tip('your answer, in your words')}>✓ in your words</button>
|
|
301
|
+
</div>
|
|
302
|
+
) : null}
|
|
303
|
+
{/* a text question's field already takes words: a second box would ask the same thing */}
|
|
304
|
+
{(ask.open || ask.kind === 'checklist') && ask.kind !== 'secret' && ask.kind !== 'text' && !c.superseded ? (
|
|
208
305
|
<div className="rv-askwords">
|
|
209
306
|
<AnswerWords thread={thread} c={c} placeholder={ask.kind === 'checklist' ? 'a word on these steps (optional)' : 'or answer with words alone'} />
|
|
210
307
|
{words ? (
|
|
@@ -253,26 +350,38 @@ const Confirm = observer(({ thread, c, ask }: { thread: ThreadSt; c: ReplyCell;
|
|
|
253
350
|
const ValueField = observer(({ thread, c, ask }: { thread: ThreadSt; c: ReplyCell; ask: CellAsk }) => {
|
|
254
351
|
const box = thread.fieldBox(c, 'value')
|
|
255
352
|
const value = thread.hints[box] ?? ''
|
|
256
|
-
|
|
353
|
+
const local = thread.giving[c.id]
|
|
354
|
+
// given, his value stands in the field's own frame, green, the button's place « ✓ given »: the question never moves.
|
|
355
|
+
// At his click it stands so already, the store's write behind it; a url's line says what the hub's try of it answered
|
|
356
|
+
const given = ask.value && !ask.open ? { text: ask.value.text, tip: `your answer, given ${new Date(ask.value.at).toLocaleString()}`, opens: ask.value.opens ? `opens (${ask.value.opens})` : 'did not open from this Mac' } : local?.state === 'sending' ? { text: local.value, tip: 'your answer, on its way', opens: 'trying it from this Mac…' } : null
|
|
357
|
+
if (given)
|
|
257
358
|
return (
|
|
258
|
-
<div className="rv-askvalue">
|
|
259
|
-
|
|
260
|
-
|
|
359
|
+
<div className="rv-askfield rv-askvalue given">
|
|
360
|
+
{ask.kind === 'url' ? (
|
|
361
|
+
<a className="rv-askgiven url" href={given.text} target="_blank" rel="noreferrer noopener">{given.text}</a>
|
|
362
|
+
) : (
|
|
363
|
+
<AutoText className="rv-answerwords rv-askgiven" readOnly value={given.text} onText={() => undefined} />
|
|
364
|
+
)}
|
|
365
|
+
<button className="rv-askopt pick picked" disabled {...tip(given.tip)}>✓ given</button>
|
|
366
|
+
{ask.kind === 'url' ? <span className="rv-dim rv-askopens">{given.opens}</span> : null}
|
|
261
367
|
</div>
|
|
262
368
|
)
|
|
263
|
-
const send = (): void => void thread.
|
|
369
|
+
const send = (): void => void thread.give(c, value)
|
|
264
370
|
const bad = ask.kind === 'url' && value.trim() !== '' && !/^https?:\/\/\S+$/.test(value.trim())
|
|
371
|
+
const ready = value.trim() !== '' && !bad
|
|
372
|
+
const keys = answerKeys(() => ready && send())
|
|
265
373
|
return (
|
|
266
374
|
<div className="rv-askfield">
|
|
267
375
|
{ask.kind === 'url' ? (
|
|
268
|
-
<input type="url" value={value} placeholder="https://…" spellCheck={false} onChange={(e) => thread.setHint(box, e.target.value)} onKeyDown={(e) =>
|
|
376
|
+
<input type="url" value={value} placeholder="https://…" spellCheck={false} onChange={(e) => thread.setHint(box, e.target.value)} onKeyDown={(e) => (e.key === 'Enter' && !e.metaKey && !e.ctrlKey ? ready && send() : keys(e))} />
|
|
269
377
|
) : (
|
|
270
|
-
<AutoText className="rv-answerwords" value={value} placeholder="your answer" onText={(t) => thread.setHint(box, t)} />
|
|
378
|
+
<AutoText className="rv-answerwords" value={value} placeholder="your answer" onText={(t) => thread.setHint(box, t)} onKeyDown={keys} />
|
|
271
379
|
)}
|
|
272
|
-
<button className="rv-askopt pick" disabled={
|
|
380
|
+
<button className="rv-askopt pick" disabled={!ready} {...tip(ask.kind === 'url' ? 'answer with this link: the hub opens it once to check that it loads' : 'answer with these words', ask.kind === 'url' ? '⏎' : '⌘↵')} onMouseDown={keepFocus} onClick={send}>
|
|
273
381
|
send
|
|
274
382
|
</button>
|
|
275
383
|
{bad ? <div className="rv-dim">a link starts with https:// or http://</div> : null}
|
|
384
|
+
{local?.state === 'failed' ? <div className="rv-pickstate err">✗ not sent: {local.why}</div> : null}
|
|
276
385
|
</div>
|
|
277
386
|
)
|
|
278
387
|
})
|
|
@@ -466,7 +575,7 @@ export const ProposeBody = observer(({ rv, thread, c, p }: { rv: ReviewSt; threa
|
|
|
466
575
|
<>
|
|
467
576
|
<FieldDiff rv={rv} thread={thread} c={c} f={one} />
|
|
468
577
|
{p.open && !one.applied && apply ? <FieldEdit thread={thread} c={c} f={one} /> : null}
|
|
469
|
-
<div className="rv-askopts">{p.open || one.applied ? (apply ? <ApplyButton thread={thread} c={c} f={one} /> : null) : <span className="rv-badge">answered in words</span>}</div>
|
|
578
|
+
<div className="rv-askopts">{p.open || one.applied ? (apply ? <ApplyButton thread={thread} c={c} f={one} /> : null) : p.none !== undefined ? <span className="rv-badge" {...tip(p.none)}>answered in words</span> : null}</div>
|
|
470
579
|
</>
|
|
471
580
|
) : (
|
|
472
581
|
<div className="rv-fieldtable">
|
|
@@ -514,7 +623,25 @@ const DiffPage = ({ rv, c, page, on }: { rv: ReviewSt; c: ReplyCell; page: strin
|
|
|
514
623
|
return <iframe ref={ref} className="rv-diffpage" title={`${page}: the change`} src={`${rv.url(`/page/${page}/`)}?${keys}`} />
|
|
515
624
|
}
|
|
516
625
|
|
|
517
|
-
/** the
|
|
626
|
+
/** the one key of every answer field of a question, as in the reply box: ⌘↵ (Ctrl+↵) sends what the field holds;
|
|
627
|
+
* Escape runs `close` where the field closes */
|
|
628
|
+
export const answerKeys =
|
|
629
|
+
(send: () => void, close?: () => void) =>
|
|
630
|
+
(e: React.KeyboardEvent): void => {
|
|
631
|
+
if (e.key === 'Enter' && (e.metaKey || e.ctrlKey) && !e.nativeEvent.isComposing) {
|
|
632
|
+
e.preventDefault()
|
|
633
|
+
e.stopPropagation()
|
|
634
|
+
send()
|
|
635
|
+
} else if (e.key === 'Escape' && close) {
|
|
636
|
+
e.preventDefault()
|
|
637
|
+
close()
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
/** the words that go with an answer: the hint box of the cell, kept per cell until sent; ⌘↵ sends them alone */
|
|
518
642
|
export const AnswerWords = observer(({ thread, c, placeholder }: { thread: ThreadSt; c: ReplyCell; placeholder: string }) => (
|
|
519
|
-
<AutoText className="rv-answerwords" placeholder={placeholder} value={thread.hints[c.id] ?? ''} onText={(t) => thread.setHint(c.id, t)}
|
|
643
|
+
<AutoText className="rv-answerwords" placeholder={placeholder} value={thread.hints[c.id] ?? ''} onText={(t) => thread.setHint(c.id, t)}
|
|
644
|
+
onKeyDown={answerKeys(() => {
|
|
645
|
+
if ((thread.hints[c.id] ?? '').trim() !== '' && !thread.busy) void thread.noneOf(c)
|
|
646
|
+
})} />
|
|
520
647
|
))
|