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
|
@@ -51,11 +51,20 @@ const since = (at: string, now: number): string => {
|
|
|
51
51
|
return m < 1 ? 'just now' : m < 60 ? `${m} min ago` : m < 48 * 60 ? `${Math.round(m / 60)} h ago` : `${Math.round(m / 1440)} days ago`
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
/** a person on one thread
|
|
54
|
+
/** a person on one thread on the advisors page: on it now, or when they were last; null when never */
|
|
55
55
|
export const hereWords = (name: string, h: { on: boolean; at: string } | null, now: number): string | null =>
|
|
56
56
|
h === null ? null : h.on ? `${name} is on this thread now` : `${name} was here ${since(h.at, now)}`
|
|
57
57
|
|
|
58
|
-
/**
|
|
58
|
+
/** a password reset a person asked at the sign in, on their line for a week: « Ada asked for a password reset 5 min
|
|
59
|
+
* ago », and why the mail did not go; null for none. Nothing for him to do */
|
|
60
|
+
export function resetWords(name: string, resets: readonly { at: string; sent?: string; why?: string }[] | undefined, now: number): string | null {
|
|
61
|
+
const r = resets?.at(-1)
|
|
62
|
+
if (r === undefined || now - Date.parse(r.at) > 7 * 86_400_000) return null
|
|
63
|
+
const asked = `${name} asked for a password reset ${since(r.at, now)}`
|
|
64
|
+
return r.why !== undefined ? `${asked}: the mail did not go (${r.why})` : asked
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** where a person is on the advisors page, on their line of the hub's advisors page */
|
|
59
68
|
export const whereWords = (h: { on: boolean; at: string; title: string } | null, now: number): string => (h === null ? 'not seen on the advisors page yet' : h.on ? `on ${h.title}` : `last seen ${since(h.at, now)}`)
|
|
60
69
|
|
|
61
70
|
/** a row's faces in one tip: who can open the thread, then where each one is */
|
|
@@ -120,15 +129,15 @@ export interface RedAct {
|
|
|
120
129
|
lines: string[]
|
|
121
130
|
note: string
|
|
122
131
|
act: string
|
|
123
|
-
run: { all: true } | { ids: string[] } | {
|
|
132
|
+
run: { all: true } | { ids: string[] } | { setup: true }
|
|
124
133
|
}
|
|
125
134
|
|
|
126
|
-
/**
|
|
127
|
-
export function
|
|
128
|
-
const host = d.
|
|
135
|
+
/** the owner's « set the advisors page up now »: each step it takes at Cloudflare and on this Mac, the deletes named, who gets mail */
|
|
136
|
+
export function setupAct(d: Pick<AdvisorsPage, 'shares' | 'advisors' | 'access' | 'reach'>): RedAct {
|
|
137
|
+
const host = d.reach?.want ?? d.reach?.host ?? null
|
|
129
138
|
const people = new Set([...d.shares.filter((s) => s.live).map((s) => s.advisor), ...(d.access ?? []).filter((a) => a.live).map((a) => a.advisor)]).size
|
|
130
139
|
return {
|
|
131
|
-
key: '
|
|
140
|
+
key: 'setup',
|
|
132
141
|
question: 'Set the advisors page up now?',
|
|
133
142
|
lines: [
|
|
134
143
|
'makes the Cloudflare tunnel to this Mac, or finds it, and stores its token',
|
|
@@ -139,7 +148,7 @@ export function setupDoorAct(d: Pick<AdvisorsPage, 'shares' | 'advisors' | 'acce
|
|
|
139
148
|
],
|
|
140
149
|
note: 'It uses the setup token you stored in the ask that opens the advisors page. Each step\'s line shows here as it ends.',
|
|
141
150
|
act: 'set it up',
|
|
142
|
-
run: {
|
|
151
|
+
run: { setup: true },
|
|
143
152
|
}
|
|
144
153
|
}
|
|
145
154
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// the rights grid (wiki tools/shipkit/advisors.md,
|
|
1
|
+
// the rights grid (wiki tools/shipkit/advisors.md, The model: people, grants, rights): at one layer, each right as it resolves there, the layer it
|
|
2
2
|
// comes from, and his click that sets it at that layer (« ↺ » clears it there, the layer below decides). Drawn on a
|
|
3
3
|
// person's line, the page's defaults, and a face of a thread's head. Every write is his: the owner word gate holds it
|
|
4
4
|
import { observer } from 'mobx-react-lite'
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
// to an advisor for the rows, each thread's bar cached by its head, his acts, and the preview of what a person reads.
|
|
3
3
|
// The daemon's /api/home/advisors answers all of it
|
|
4
4
|
import { makeAutoObservable, observableRef, runInAction } from 'mobx'
|
|
5
|
-
import type {
|
|
5
|
+
import type { ReachFacts } from '../../advisors/reach.ts'
|
|
6
6
|
import type { AccessRow, AdviceRow, KnownRow, MailFacts, ProposalRow, ShareRow, ThreadPerson } from '../../advisors/routes.ts'
|
|
7
7
|
import type { InviteSent } from '../../advisors/invite-send.ts'
|
|
8
|
+
import type { ResetAsked } from '../../advisors/owner-store.ts'
|
|
8
9
|
import type { Rights, RightsLayer } from '../../advisors/rights.ts'
|
|
9
10
|
import type { Cursor } from '../../review/traces.ts'
|
|
10
11
|
import type { ShareEvent } from '../../advisors/share-trace.ts'
|
|
@@ -15,7 +16,7 @@ import { KeptFolds } from './kept-folds.ts'
|
|
|
15
16
|
import { postJson } from './review/review-kit.ts'
|
|
16
17
|
import { PollGate } from './push-svc.ts'
|
|
17
18
|
|
|
18
|
-
/** a person on a thread
|
|
19
|
+
/** a person on a thread on the advisors page (advisors/routes.ts `/here`): on it now, or their last beat there */
|
|
19
20
|
export interface HereSeen {
|
|
20
21
|
advisor: string
|
|
21
22
|
repo: string
|
|
@@ -30,7 +31,7 @@ export interface AdvisorsPage {
|
|
|
30
31
|
owner: string
|
|
31
32
|
host: string | null
|
|
32
33
|
/** the people: his profiles and the ones an agent prepared (`preparedBy`), each with their own rights' default */
|
|
33
|
-
advisors: { id: string; name: string; email: string; created: string; preparedBy?: string; source?: string; photo?: { sha: string; at: string; seen?: true }; rights?: Rights }[]
|
|
34
|
+
advisors: { id: string; name: string; email: string; created: string; preparedBy?: string; source?: string; photo?: { sha: string; at: string; seen?: true }; rights?: Rights; resets?: ResetAsked[] }[]
|
|
34
35
|
/** the live accesses to a project; absent from a daemon older than the people */
|
|
35
36
|
access?: AccessRow[]
|
|
36
37
|
/** the rights' layers as he wrote them, over the house's defaults; absent from a daemon older than the people */
|
|
@@ -43,8 +44,8 @@ export interface AdvisorsPage {
|
|
|
43
44
|
/** his name for advisors (advisors/owner-name.ts): the house identity's id, his layers, each project's name and
|
|
44
45
|
* identity as they resolve; absent from a daemon older than the setting */
|
|
45
46
|
names?: AdvisorNames
|
|
46
|
-
/** the
|
|
47
|
-
|
|
47
|
+
/** the advisors page's reach in one line, and the ask it needs while it does not work */
|
|
48
|
+
reach?: ReachFacts
|
|
48
49
|
}
|
|
49
50
|
|
|
50
51
|
export interface AdvisorNames {
|
|
@@ -86,8 +87,8 @@ export interface ThreadBar {
|
|
|
86
87
|
known?: KnownAdvisor[]
|
|
87
88
|
/** who has this thread now, for the faces on it; absent from a daemon older than the people */
|
|
88
89
|
people?: ThreadPerson[]
|
|
89
|
-
/** the
|
|
90
|
-
|
|
90
|
+
/** the advisors page is set up */
|
|
91
|
+
setUp?: boolean
|
|
91
92
|
/** whether a share mails the invite by itself; absent from a daemon older than the sent invite */
|
|
92
93
|
mail?: MailFacts
|
|
93
94
|
shares: ShareRow[]
|
|
@@ -95,8 +96,8 @@ export interface ThreadBar {
|
|
|
95
96
|
deferredTo: string | null
|
|
96
97
|
/** the thread's shares as lines of its timeline (advisors/share-trace.ts); absent from a daemon older than the trace */
|
|
97
98
|
trace?: ShareEvent[]
|
|
98
|
-
/** the
|
|
99
|
-
|
|
99
|
+
/** the advisors page's facts, as the page's foot reads them */
|
|
100
|
+
reach?: ReachFacts
|
|
100
101
|
}
|
|
101
102
|
|
|
102
103
|
/** a line of the « add advisor » list: a person with a grant on this project, another he knows, or the typed words as
|
|
@@ -340,7 +341,7 @@ export class AdvisorsSt {
|
|
|
340
341
|
seen = new Map<string, { name: string; at: string }[]>()
|
|
341
342
|
/** every person by id, for the faces a list draws from ids (a row's « who can open it ») */
|
|
342
343
|
people = new Map<string, { name: string; photo: string | null }>()
|
|
343
|
-
/** where each person is
|
|
344
|
+
/** where each person is on the advisors page: the thread their page has open now, or when they were last on each */
|
|
344
345
|
here: HereSeen[] = []
|
|
345
346
|
/** the share whose preview is open */
|
|
346
347
|
preview: ShareRow | null = null
|
|
@@ -363,7 +364,7 @@ export class AdvisorsSt {
|
|
|
363
364
|
defaultsAt = ''
|
|
364
365
|
/** the layer his name for advisors writes */
|
|
365
366
|
namesAt: NameAt = ''
|
|
366
|
-
/** what a red button asked to do (shares to end, the
|
|
367
|
+
/** what a red button asked to do (shares to end, the advisors page's setup), its confirm open; nothing runs until the owner
|
|
367
368
|
* confirms */
|
|
368
369
|
asking: RedAct | null = null
|
|
369
370
|
/** the photos an agent set, their faces shown, and the ones he skips in this OK */
|
|
@@ -387,14 +388,14 @@ export class AdvisorsSt {
|
|
|
387
388
|
}
|
|
388
389
|
|
|
389
390
|
/** his confirm: exactly what the popup named, through the acts his page has (every share, each share's
|
|
390
|
-
* « unshare », the
|
|
391
|
+
* « unshare », the advisors page's setup), then the page reads again */
|
|
391
392
|
async confirmAsked(): Promise<void> {
|
|
392
393
|
const e = this.asking
|
|
393
394
|
if (e === null) return
|
|
394
395
|
this.asking = null
|
|
395
396
|
const run = e.run
|
|
396
397
|
if ('all' in run) return this.post('/revoke', { all: true })
|
|
397
|
-
if ('
|
|
398
|
+
if ('setup' in run) return this.post('/setup')
|
|
398
399
|
await this.act(async () => {
|
|
399
400
|
for (const id of run.ids) await postJson(`${API}/share/${encodeURIComponent(id)}/unshare`, {})
|
|
400
401
|
})
|
|
@@ -409,7 +410,7 @@ export class AdvisorsSt {
|
|
|
409
410
|
this.skipped = v ? [...this.skipped, id] : this.skipped.filter((x) => x !== id)
|
|
410
411
|
}
|
|
411
412
|
|
|
412
|
-
/**
|
|
413
|
+
/** the owner's OK on the photos an agent set: each leaves for that person's own page on the advisors page */
|
|
413
414
|
async sendPhotos(ids: readonly string[]): Promise<void> {
|
|
414
415
|
await this.act(async () => {
|
|
415
416
|
for (const id of ids) await postJson(`${API}/advisor/${encodeURIComponent(id)}/photo/send`, {})
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
// `/advisors` (wiki tools/shipkit/advisors.md, What he does): the people he shares threads with, one line each (their
|
|
2
2
|
// face, what they read now, the projects they have, what waits for his confirm as one line that opens a compact list,
|
|
3
3
|
// their rights as a grid), the advice and threads they sent, the defaults for everyone, and at the foot the photos an
|
|
4
|
-
// agent set in one line and the
|
|
4
|
+
// agent set in one line and the advisors page's reach in one line, the ask it needs while it does not work. The preview
|
|
5
5
|
// dialog opens over any page: the person's own page as it reads.
|
|
6
6
|
// The constraint a reader breaks first: a person's words are drawn as plain text, never markup or a link (they come
|
|
7
7
|
// from outside the house)
|
|
8
8
|
import { observer } from 'mobx-react-lite'
|
|
9
9
|
import { useEffect, useRef, useState } from 'react'
|
|
10
|
-
import type {
|
|
10
|
+
import type { ReachFacts } from '../../advisors/reach.ts'
|
|
11
11
|
import type { ShareRow } from '../../advisors/routes.ts'
|
|
12
12
|
import { nameAt, nameBelow, type AdvisorNames, type AdvisorsPage, type AdvisorsSt } from './advisors-st.ts'
|
|
13
|
-
import { closedWords, DEFAULTS_TIP, whereWords, defaultsWords, endAll, endClosed, peopleOf,
|
|
13
|
+
import { closedWords, DEFAULTS_TIP, whereWords, defaultsWords, endAll, endClosed, peopleOf, resetWords, setupAct, sharedWords, shareWords, waitWords, type RedAct, type Person, type PersonLine } from './advisors-model.ts'
|
|
14
14
|
import { LayerTabs, RightsGrid } from './advisors-rights.tsx'
|
|
15
15
|
import type { HomeSt } from './home-st.ts'
|
|
16
16
|
import { AskLink, InviteCopy } from './review/share-lines.tsx'
|
|
@@ -39,7 +39,7 @@ export const PreviewDialog = observer(({ adv }: { adv: AdvisorsSt }) => {
|
|
|
39
39
|
<button className="ghost" {...tip('close the preview')} aria-label="close" onClick={() => adv.closePreview()}>✕</button>
|
|
40
40
|
</div>
|
|
41
41
|
{adv.copied !== null ? <div className="adv-dim">the thread's address on the advisors page is copied: {adv.copied}</div> : <div className="adv-dim">the advisors page is not set up yet: nothing leaves until it is (sk asks)</div>}
|
|
42
|
-
{/* the advisors' app itself, with no origin of its own:
|
|
42
|
+
{/* the advisors' app itself, with no origin of its own: every read answered as theirs, and it takes no answer */}
|
|
43
43
|
{adv.previewPath !== null ? <iframe key={stamp} className="adv-frame" title={`the page ${s.name} reads`} sandbox="allow-scripts" src={adv.previewPath} /> : null}
|
|
44
44
|
</div>
|
|
45
45
|
</div>
|
|
@@ -83,7 +83,7 @@ const LiveList = observer(({ adv, shares }: { adv: AdvisorsSt; shares: ShareRow[
|
|
|
83
83
|
{s.reach !== null && !s.reach.ok ? <span className="adv-dim" {...tip(s.reach.why)}>not reached</span> : null}
|
|
84
84
|
<span className="adv-dim adv-until" {...tip(`until ${day(s.expires)}`)}>until {until(s.expires)}</span>
|
|
85
85
|
{s.copy != null ? <InviteCopy name={s.name} invite={s.copy} /> : null}
|
|
86
|
-
<button className="ghost" {...tip('
|
|
86
|
+
<button className="ghost" {...tip('their page, read as they read this thread now: the same filter, nothing sent')} onClick={() => adv.openPreview(s)}>view as {s.name}</button>
|
|
87
87
|
<button className="ghost" {...tip('the share lasts their days again, counted from now')} onClick={() => void adv.post(`/share/${s.id}/renew`)}>renew</button>
|
|
88
88
|
<button className="ghost danger" {...tip('they stop reading this thread at their next request')} onClick={() => void adv.post(`/share/${s.id}/unshare`)}>unshare</button>
|
|
89
89
|
</div>
|
|
@@ -163,7 +163,7 @@ const RowMore = observer(({ adv, c, repos }: { adv: AdvisorsSt; c: PersonLine; r
|
|
|
163
163
|
)
|
|
164
164
|
})
|
|
165
165
|
|
|
166
|
-
/** where a person is
|
|
166
|
+
/** where a person is on the advisors page: the thread their page has open now, a link there with a live dot, else when they
|
|
167
167
|
* were last seen; nothing for someone never seen */
|
|
168
168
|
const WhereIs = observer(({ adv, id, name }: { adv: AdvisorsSt; id: string; name: string }) => {
|
|
169
169
|
const h = adv.whereIs(id)
|
|
@@ -186,6 +186,7 @@ const Row = observer(({ adv, c, d }: { adv: AdvisorsSt; c: PersonLine; d: Adviso
|
|
|
186
186
|
const layer = adv.layer[c.id] ?? ''
|
|
187
187
|
const projects = [...new Set([...c.projects.map((p) => p.repo), ...c.live.map((s) => s.repo), ...c.waiting.map((s) => s.repo)])]
|
|
188
188
|
const alarm = c.waiting.some((s) => sensitivePart(s.address) !== null)
|
|
189
|
+
const reset = resetWords(c.name, c.person.resets, Date.now())
|
|
189
190
|
return (
|
|
190
191
|
<article className="adv-person" data-person={c.name} data-state={c.state} data-open={panel ?? undefined}>
|
|
191
192
|
<div className="adv-prow">
|
|
@@ -195,6 +196,7 @@ const Row = observer(({ adv, c, d }: { adv: AdvisorsSt; c: PersonLine; d: Adviso
|
|
|
195
196
|
<span className="adv-dim adv-email">{c.person.email}</span>
|
|
196
197
|
{c.prepared !== null ? <span className="adv-note">{c.prepared}</span> : null}
|
|
197
198
|
<WhereIs adv={adv} id={c.id} name={c.name} />
|
|
199
|
+
{reset !== null ? <span className="adv-note" data-check="advisor-reset">{reset}</span> : null}
|
|
198
200
|
</span>
|
|
199
201
|
<span className="adv-sees">
|
|
200
202
|
{c.projects.map((p) => (
|
|
@@ -307,7 +309,7 @@ const NamesPanel = observer(({ adv, n }: { adv: AdvisorsSt; n: AdvisorNames }) =
|
|
|
307
309
|
})
|
|
308
310
|
|
|
309
311
|
/** the setup the daemon runs once his token landed: each step's line as it ends, then done or the failure in words */
|
|
310
|
-
const SetupLines = ({ run }: { run: NonNullable<
|
|
312
|
+
const SetupLines = ({ run }: { run: NonNullable<ReachFacts['run']> }) => (
|
|
311
313
|
<section className="adv-setup" data-check="setup-run" data-state={run.state} aria-live="polite">
|
|
312
314
|
{run.lines.map((l, i) => (
|
|
313
315
|
<div key={i} className={l.text.startsWith('WARN ') ? 'adv-warn' : 'adv-dim'}>{l.text.startsWith('WARN ') ? '!' : '✓'} {l.text.replace(/^WARN /, '')}</div>
|
|
@@ -317,11 +319,11 @@ const SetupLines = ({ run }: { run: NonNullable<DoorFacts['run']> }) => (
|
|
|
317
319
|
</section>
|
|
318
320
|
)
|
|
319
321
|
|
|
320
|
-
/** the
|
|
322
|
+
/** the advisors page's reach in one quiet line (whether advisors reach this Mac, else what it needs, its ask linked), the red acts
|
|
321
323
|
* that end shares, then his name and the default rights, each a box that folds */
|
|
322
324
|
const Foot = observer(({ app, d }: { app: HomeSt; d: AdvisorsPage }) => {
|
|
323
325
|
const st = app.advisors
|
|
324
|
-
const f = d.
|
|
326
|
+
const f = d.reach
|
|
325
327
|
const live = d.shares.some((s) => s.live || s.state === 'pending')
|
|
326
328
|
const closed = d.shares.filter((s) => s.live && s.closed === true).length
|
|
327
329
|
return (
|
|
@@ -329,13 +331,13 @@ const Foot = observer(({ app, d }: { app: HomeSt; d: AdvisorsPage }) => {
|
|
|
329
331
|
<PhotosLine adv={st} d={d} />
|
|
330
332
|
<footer className="adv-foot">
|
|
331
333
|
{f !== undefined ? (
|
|
332
|
-
<span className={f.ok ? 'adv-dim' : 'adv-warn'} data-check="
|
|
334
|
+
<span className={f.ok ? 'adv-dim' : 'adv-warn'} data-check="reach-line">
|
|
333
335
|
{f.ok ? f.words : <AskLink adv={st} ask={f.ask} says="opens the ask that sets the advisors page up">{f.words}</AskLink>}
|
|
334
336
|
</span>
|
|
335
337
|
) : null}
|
|
336
338
|
{f?.run != null ? <SetupLines run={f.run} /> : null}
|
|
337
339
|
<span className="sp" />
|
|
338
|
-
{f !== undefined && !f.ok && f.run?.state !== 'running' ? <RedButton adv={st} check="
|
|
340
|
+
{f !== undefined && !f.ok && f.run?.state !== 'running' ? <RedButton adv={st} check="setup-now" act={() => setupAct(d)} label="set the advisors page up now" tipText="runs the advisors page's setup now, with the setup token stored in its ask: it asks first, naming each step" /> : null}
|
|
339
341
|
{closed > 0 ? <RedButton adv={st} check="end-closed-all" act={() => endClosed(d, null)} label={closedWords(closed)} tipText="each person stops reading the threads that are closed; the active ones stay. It asks first" /> : null}
|
|
340
342
|
{live ? <RedButton adv={st} check="end-all" act={() => endAll(d)} label="end every share" tipText={`ends ${shareWords(d)}: each person reads nothing from their next request. It asks first`} /> : null}
|
|
341
343
|
</footer>
|
|
@@ -37,6 +37,14 @@ export function appPost(w: unknown = globalThis): Post | null {
|
|
|
37
37
|
return h == null ? null : (note) => h.postMessage(note)
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
/** 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
|
|
41
|
+
* 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
|
|
42
|
+
* logins, which that tab wears in its title bar */
|
|
43
|
+
export const openTab = (href: string, name?: string, chips?: TabChips): void => {
|
|
44
|
+
if (name != null) appPost()?.({ tabName: name, url: new URL(href, globalThis.location?.href).href, ...chips })
|
|
45
|
+
void globalThis.open?.(href, '_blank')
|
|
46
|
+
}
|
|
47
|
+
|
|
40
48
|
/** the app's side panel, or null: a browser tab, a process's app, an app built before the panel. The app marks each
|
|
41
49
|
* page it gives its bridge (`__skSidePanel`, ShipkitGui.swift webConfig) */
|
|
42
50
|
export function appSide(w: unknown = globalThis): ((url: string, identity?: SideIdentity | null) => void) | null {
|
|
@@ -95,12 +103,25 @@ export function openLink(e: MouseEvent, w: unknown = globalThis, frame: LinkFram
|
|
|
95
103
|
let url: URL
|
|
96
104
|
try { url = new URL(a.getAttribute('href') ?? '', here?.href) } catch { return false }
|
|
97
105
|
if ((url.protocol !== 'http:' && url.protocol !== 'https:') || url.origin === here?.origin) return false
|
|
106
|
+
return openBeside(url, w, frame, identity, () => e.preventDefault())
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/** whether this page opens a link beside itself: the app's side panel, else the page's side frame */
|
|
110
|
+
export const besideKind = (w: unknown = globalThis, frame: { live: boolean } | null = null): 'app' | 'frame' | null =>
|
|
111
|
+
appSide(w) != null ? 'app' : frame?.live === true ? 'frame' : null
|
|
112
|
+
|
|
113
|
+
/** `url` beside the page, where `sideChoice` says; false when its way is a tab (the frame said why) or the page has
|
|
114
|
+
* neither the app nor a side frame. `taken` runs before it opens */
|
|
115
|
+
export function openBeside(url: URL, w: unknown = globalThis, frame: LinkFrame | null = null, identity: SideIdentity | null = null, taken: () => void = () => {}): boolean {
|
|
116
|
+
const side = appSide(w)
|
|
117
|
+
if (side == null && frame?.live !== true) return false
|
|
118
|
+
const here = (w as { location?: { protocol: string; hostname: string } }).location
|
|
98
119
|
const c = sideChoice(url, { app: side != null, page: { protocol: here?.protocol ?? 'http:', hostname: here?.hostname ?? 'localhost' }, probe: frame?.probe(url) })
|
|
99
120
|
if (c.to === 'tab') {
|
|
100
121
|
frame?.refused(url.href, c.why)
|
|
101
122
|
return false
|
|
102
123
|
}
|
|
103
|
-
|
|
124
|
+
taken()
|
|
104
125
|
if (c.to === 'app') side!(url.href, identity)
|
|
105
126
|
else frame!.open(url.href)
|
|
106
127
|
return true
|
|
@@ -184,7 +205,6 @@ export function startAppBridge(o: { projects: { fresh: boolean; list: Project[]
|
|
|
184
205
|
const post = o.post === undefined ? appPost(w) : o.post
|
|
185
206
|
if (post == null) return () => {}
|
|
186
207
|
const bridge = new AppBridge(post, o.threadUrl)
|
|
187
|
-
|
|
188
|
-
;(w as { shipkitApp?: AppHooks & { openCard: AppHooks['openThread'] } }).shipkitApp = { openChrome: (repo, id, at) => openInChrome(repo, id, at), ...o.hooks, openCard: o.hooks.openThread }
|
|
208
|
+
;(w as { shipkitApp?: AppHooks }).shipkitApp = { openChrome: (repo, id, at) => openInChrome(repo, id, at), ...o.hooks }
|
|
189
209
|
return reaction(() => (o.projects.fresh ? o.projects.list : null), (list) => { if (list != null) bridge.update(list) }, { fireImmediately: true })
|
|
190
210
|
}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import { listRow } from './list-row.ts'
|
|
4
4
|
import { observer } from 'mobx-react-lite'
|
|
5
5
|
import { afterWords } from '../../asks/ask-after.ts'
|
|
6
|
-
import { BAND_WORDS } from '../../review/band.ts'
|
|
7
6
|
import { stepsWords } from './ask-steps.tsx'
|
|
8
7
|
import { askAt, askFactWords, isClosedAsk, isLaterAsk, type AskGroupKey } from './col-tables.ts'
|
|
9
8
|
import { ColListPage, type ColListWords } from './col-list-page.tsx'
|
|
@@ -14,6 +13,7 @@ import type { RepoSt } from './repo-st.ts'
|
|
|
14
13
|
import { Age, stampWords } from './time-ago.tsx'
|
|
15
14
|
import { useInSight } from './in-sight.ts'
|
|
16
15
|
import { tip } from './tips.ts'
|
|
16
|
+
import { BAND_WORDS } from '../../review/thread-state.ts'
|
|
17
17
|
|
|
18
18
|
/** a row of the list, the app's list row: its title, at its end an open ask's steps done (`3/8`, the next step on
|
|
19
19
|
* hover), else its age in short (`70d`, the full stamp on hover); a later ask the day it waits for; a closed ask dimmed */
|
|
@@ -86,40 +86,54 @@ export const AutoText = observer(function AutoText({ value, onText, rows = 2, el
|
|
|
86
86
|
}
|
|
87
87
|
onKeyDown?.(e)
|
|
88
88
|
}
|
|
89
|
+
const twin = useRef<Twin | null>(null)
|
|
89
90
|
const size = useCallback((): void => {
|
|
90
91
|
const t = ref.current
|
|
91
92
|
if (t == null) return
|
|
92
|
-
|
|
93
|
-
|
|
93
|
+
const tw = (twin.current ??= new Twin(t))
|
|
94
|
+
if (tw.rows !== rows) tw.fit(t, rows)
|
|
94
95
|
// an empty box is as tall as its placeholder: the hint reads whole, never cut by a scrollbar
|
|
95
96
|
const hint = !hintLine && t.value === '' && t.placeholder !== ''
|
|
96
|
-
|
|
97
|
-
const
|
|
98
|
-
if (
|
|
99
|
-
t.style.height = `${h + edge}px`
|
|
97
|
+
const h = tw.measure(hint ? t.placeholder : t.value) + tw.edge
|
|
98
|
+
const px = `${h}px`
|
|
99
|
+
if (t.style.height !== px) t.style.height = px
|
|
100
100
|
// a sheet's max-height stops it: only then may it scroll
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
const oy = h > tw.max + 1 ? 'auto' : 'hidden'
|
|
102
|
+
if (t.style.overflowY !== oy) t.style.overflowY = oy
|
|
103
|
+
}, [hintLine, rows])
|
|
103
104
|
useLayoutEffect(size, [value, size])
|
|
104
105
|
useLayoutEffect(() => {
|
|
105
106
|
const t = ref.current
|
|
106
107
|
if (t == null || typeof ResizeObserver === 'undefined') return
|
|
107
|
-
let w =
|
|
108
|
+
let w = -1
|
|
109
|
+
let hgt = -1
|
|
108
110
|
let raf = 0
|
|
109
|
-
//
|
|
110
|
-
//
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
111
|
+
// a new width wraps the words again, a new height may be a new cap (a vh max-height, a sheet): the twin takes
|
|
112
|
+
// the box's measures again and sizes it on the next frame; sized inside the callback, its scrollbar moves its
|
|
113
|
+
// width and the observer fires again in the same frame (the loop notice Bun's dev overlay paints over the page)
|
|
114
|
+
const ro = new ResizeObserver(([e]) => {
|
|
115
|
+
const r = e!.contentRect
|
|
116
|
+
if (r.width === w && r.height === hgt) return
|
|
117
|
+
const first = w === -1
|
|
118
|
+
w = r.width
|
|
119
|
+
hgt = r.height
|
|
120
|
+
if (first) return
|
|
114
121
|
cancelAnimationFrame(raf)
|
|
115
|
-
raf = requestAnimationFrame(
|
|
122
|
+
raf = requestAnimationFrame(() => {
|
|
123
|
+
twin.current?.fit(t, rows)
|
|
124
|
+
size()
|
|
125
|
+
})
|
|
116
126
|
})
|
|
117
127
|
ro.observe(t)
|
|
118
128
|
return () => {
|
|
119
129
|
cancelAnimationFrame(raf)
|
|
120
130
|
ro.disconnect()
|
|
121
131
|
}
|
|
122
|
-
}, [size])
|
|
132
|
+
}, [size, rows])
|
|
133
|
+
useLayoutEffect(() => () => {
|
|
134
|
+
twin.current?.el.remove()
|
|
135
|
+
twin.current = null
|
|
136
|
+
}, [])
|
|
123
137
|
return (
|
|
124
138
|
<>
|
|
125
139
|
<textarea
|
|
@@ -166,6 +180,47 @@ export const AutoText = observer(function AutoText({ value, onText, rows = 2, el
|
|
|
166
180
|
)
|
|
167
181
|
})
|
|
168
182
|
|
|
183
|
+
/** what wraps the words the same way in the twin as in the box */
|
|
184
|
+
const TWIN_COPIES = ['font-family', 'font-size', 'font-weight', 'font-style', 'font-stretch', 'font-variant', 'font-feature-settings', 'font-variation-settings', 'line-height', 'letter-spacing', 'word-spacing', 'text-transform', 'text-indent', 'tab-size', 'white-space', 'word-break', 'overflow-wrap', 'direction', 'padding-top', 'padding-right', 'padding-bottom', 'padding-left']
|
|
185
|
+
|
|
186
|
+
/** the box's words measured in a hidden twin, never in the box: the box at height 'auto' to read its scrollHeight
|
|
187
|
+
* shrank, so the composer shrank and the thread's column grew, then both came back, two layouts of the whole page a
|
|
188
|
+
* key (WebKit lays out each in full, a thread of picture galleries took 50 ms a key). The twin is out of the flow at a
|
|
189
|
+
* fixed size, its own layout root: a key lays out the twin alone and reads one height. Its measures (width, padding,
|
|
190
|
+
* font, the cap, `rows`) are taken again when the box's size or `rows` changes, never per key */
|
|
191
|
+
class Twin {
|
|
192
|
+
readonly el: HTMLTextAreaElement
|
|
193
|
+
rows = -1
|
|
194
|
+
/** the box's border and scrollbar height; its words' height at `rows` lines; its max-height in px */
|
|
195
|
+
edge = 0
|
|
196
|
+
min = 0
|
|
197
|
+
max = Infinity
|
|
198
|
+
constructor(t: HTMLTextAreaElement) {
|
|
199
|
+
const d = t.ownerDocument
|
|
200
|
+
this.el = d.createElement('textarea')
|
|
201
|
+
this.el.setAttribute('aria-hidden', 'true')
|
|
202
|
+
this.el.tabIndex = -1
|
|
203
|
+
this.el.style.cssText = 'position:fixed;left:-10000px;top:0;height:0;min-height:0;max-height:none;border:0;margin:0;overflow:hidden;visibility:hidden;pointer-events:none;resize:none;box-sizing:border-box;contain:layout paint style'
|
|
204
|
+
d.body.append(this.el)
|
|
205
|
+
}
|
|
206
|
+
fit(t: HTMLTextAreaElement, rows: number): void {
|
|
207
|
+
const cs = t.ownerDocument.defaultView?.getComputedStyle?.(t)
|
|
208
|
+
if (cs) for (const p of TWIN_COPIES) this.el.style.setProperty(p, cs.getPropertyValue(p))
|
|
209
|
+
this.el.style.width = `${t.clientWidth}px`
|
|
210
|
+
this.edge = t.offsetHeight - t.clientHeight
|
|
211
|
+
const max = parseFloat(cs?.maxHeight ?? '')
|
|
212
|
+
this.max = Number.isFinite(max) ? max : Infinity
|
|
213
|
+
this.rows = rows
|
|
214
|
+
this.el.value = '\n'.repeat(Math.max(0, rows - 1))
|
|
215
|
+
this.min = this.el.scrollHeight
|
|
216
|
+
}
|
|
217
|
+
/** the words' height, padding in, never under `rows` lines */
|
|
218
|
+
measure(text: string): number {
|
|
219
|
+
this.el.value = text
|
|
220
|
+
return Math.max(this.min, this.el.scrollHeight)
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
169
224
|
/** the emojis that match, hugging the caret: the list's top on the bottom of the caret's line, from the caret's x (its
|
|
170
225
|
* bottom on the line's top when the window has no room under it), each row its character and its name in plain words,
|
|
171
226
|
* the letters he typed marked; the focus stays in the box */
|
|
@@ -22,21 +22,13 @@ import { tip } from './tips.ts'
|
|
|
22
22
|
* something it did not. The CHIP is the short one, its help is the sentence */
|
|
23
23
|
const SOURCE_CHIP: Record<CheckFacts['whenSource'], string> = {
|
|
24
24
|
off: 'repo.config.ts',
|
|
25
|
-
when: 'when (retired)',
|
|
26
|
-
ruleExempt: 'ruleExempt (retired)',
|
|
27
|
-
'hooks.disable': 'hooks.disable (retired)',
|
|
28
25
|
'check-file': 'the check file',
|
|
29
|
-
defaults: 'defaults (retired)',
|
|
30
26
|
default: 'derived',
|
|
31
27
|
}
|
|
32
28
|
|
|
33
29
|
const SOURCE_WORD: Record<CheckFacts['whenSource'], string> = {
|
|
34
30
|
off: 'turned off in the `off` block of `repo.config.ts`, which this switch writes',
|
|
35
|
-
when: 'turned off by the retired `when` key, which `shipkit ci` ports to `off` (SK029)',
|
|
36
|
-
ruleExempt: 'turned off by the retired `ruleExempt` key, which `shipkit ci` ports to `off` (SK029)',
|
|
37
31
|
'check-file': 'declared by the check file itself: every context it runs in, no default',
|
|
38
|
-
'hooks.disable': 'turned off by the retired `hooks.disable` key, which `shipkit ci` ports to `off` (SK029)',
|
|
39
|
-
defaults: 'turned off by the retired `defaults: { <slot>: false }`, which `shipkit ci` ports to `off` (SK029)',
|
|
40
32
|
default: 'a row with no file of its own: the code that derives it writes every context',
|
|
41
33
|
}
|
|
42
34
|
|
|
@@ -187,12 +187,23 @@ button.sh:focus-visible{outline:1px solid var(--accent);outline-offset:-1px}
|
|
|
187
187
|
once decoded, small dim words with a retry when it failed */
|
|
188
188
|
/* no weight: a box that sizes its picture (.trthumb, 20 × 16) keeps its own size */
|
|
189
189
|
:where(.pic){position:relative;display:block;width:100%;height:100%;overflow:hidden}
|
|
190
|
+
/* `fills`: the box its positioned parent sizes (a gallery tile), the box and its image out of the flow. In flow, each
|
|
191
|
+
one is a percent height descendant WebKit lays out again at every layout of the column: 66 tiles held a scroll at
|
|
192
|
+
2 frames a second */
|
|
193
|
+
.pic.fills{position:absolute;inset:0;width:auto;height:auto}
|
|
194
|
+
.pic.fills > img{position:absolute;inset:0;width:100%;height:100%}
|
|
190
195
|
.pic > img{transition:opacity .18s ease-out}
|
|
191
196
|
.pic.loading > img,.pic.failed > img{opacity:0}
|
|
192
|
-
|
|
193
|
-
|
|
197
|
+
/* the shimmer is a transform, which the compositor runs: a background-position animation restyled and repainted
|
|
198
|
+
every box still loading, every frame. It runs near the view alone (pic.tsx `data-near`), so a lazy picture far
|
|
199
|
+
out of view waits without a frame of work, and passes 6 times there, then stays still: a picture near the view
|
|
200
|
+
that never answers costs no frame for as long as the page stays open */
|
|
201
|
+
.pic.loading{background:var(--panel2)}
|
|
202
|
+
.pic.loading::before{content:'';position:absolute;inset:0;background:linear-gradient(100deg,transparent 30%,color-mix(in srgb,var(--panel2) 82%,var(--ink)) 50%,transparent 70%);transform:translateX(-100%)}
|
|
203
|
+
.pic.loading[data-near]::before{animation:pic-shimmer 1.3s linear 6}
|
|
204
|
+
@keyframes pic-shimmer{to{transform:translateX(100%)}}
|
|
194
205
|
.pic.failed{background:var(--panel2)}
|
|
195
206
|
.picfail{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:2px;font-size:11px;line-height:1.2;color:var(--dim);text-align:center;overflow:hidden}
|
|
196
207
|
.picretry{text-decoration:underline;cursor:pointer}
|
|
197
208
|
.picretry:hover{color:var(--accent)}
|
|
198
|
-
@media (prefers-reduced-motion:reduce){.pic.loading{animation:none}.pic > img{transition:none}}
|
|
209
|
+
@media (prefers-reduced-motion:reduce){.pic.loading::before{animation:none}.pic > img{transition:none}}
|
|
@@ -9,7 +9,7 @@ import { listRow } from './list-row.ts'
|
|
|
9
9
|
import { observer } from 'mobx-react-lite'
|
|
10
10
|
import type { CSSProperties, ReactNode } from 'react'
|
|
11
11
|
import { Panel, Separator } from 'react-resizable-panels'
|
|
12
|
-
import { threadsWords, type ThreadsWhere } from '../../hq/
|
|
12
|
+
import { threadsWords, type ThreadsWhere } from '../../hq/threads-words.ts'
|
|
13
13
|
import { Tip } from './floating.tsx'
|
|
14
14
|
import { capWords, changedWords, COUNTED_HOW, count, countedWords, ESTIMATE, ESTIMATE_HOW, holdsHead, hqFacts, onDisk, pagesWords, partsOf, plural, ROLE_TITLE, ROLES, roleSplitWords, rowsOf, share, stateWords, totalWords, unsplitWords, used } from '../../home/database-words.ts'
|
|
15
15
|
import type { ProjectView } from '../../home/database-projects.ts'
|
|
@@ -120,7 +120,6 @@ const DbSubject = observer(({ st, e, v }: { st: DatabaseSt; e: DbEntry; v: DbVie
|
|
|
120
120
|
<li><span className="dbpath">{v.where}</span> <span className="rv-dim">{v.what}</span></li>
|
|
121
121
|
{missing || pages == null ? null : <li>{pages}</li>}
|
|
122
122
|
{missing ? null : v.copies.map((c) => <li key={c.name}>copy before a migration: <span className="dbpath">{c.name}</span> {bytesWords(c.bytes)}, {ageWords(c.at, st.now, { short: true })} old</li>)}
|
|
123
|
-
{v.kind !== 'machine' ? null : (d?.fold ?? []).map((t) => <li key={t} className={/half way|damaged|does not read|shape of before/.test(t) ? 't-red' : ''}>{t}</li>)}
|
|
124
123
|
</ul>
|
|
125
124
|
</KeptFold>
|
|
126
125
|
{d == null || h == null || missing ? null : (
|
|
@@ -9,6 +9,7 @@ import { isMainBranch, upstreamWords } from '../../home/activity-shape.ts'
|
|
|
9
9
|
import { Commit } from './activity-view.tsx'
|
|
10
10
|
import { Icon, ICON } from './icons.tsx'
|
|
11
11
|
import type { RepoSt } from './repo-st.ts'
|
|
12
|
+
import { minuteNow } from './time-ago.tsx'
|
|
12
13
|
import { tip } from './tips.ts'
|
|
13
14
|
|
|
14
15
|
const KIND_WORD = { staged: 'staged', modified: 'modified', untracked: 'new' } as const
|
|
@@ -21,7 +22,8 @@ export const GitPage = observer(({ app }: { app: RepoSt }) => {
|
|
|
21
22
|
}, [g])
|
|
22
23
|
const r = g.row
|
|
23
24
|
const m = app.home.machine
|
|
24
|
-
|
|
25
|
+
// the commits' ages in minutes and more: the page waits on the half minute, never redrawn each second
|
|
26
|
+
const now = minuteNow(app.clock)
|
|
25
27
|
const branch = r == null ? '' : r.branch ?? (r.detached == null ? '' : `detached ${r.detached}`)
|
|
26
28
|
return (
|
|
27
29
|
<div className="colcard checkcard">
|
|
@@ -20,8 +20,9 @@
|
|
|
20
20
|
/* where he types (his answer box): lifted off a dark page, white on a light one */
|
|
21
21
|
--field:#1d2025;
|
|
22
22
|
--accent:#6b8fb3;--sel:#1a2430;--chk1:#16181b;--chk2:#121417;
|
|
23
|
-
/* state, and nothing else: red broken · orange taste pending · green measured passing
|
|
24
|
-
|
|
23
|
+
/* state, and nothing else: red broken · orange taste pending · green measured passing · yellow ok with a fix; --agent the agents' mark (the
|
|
24
|
+
Claude spark), one colour for every lane, which a person's face never takes (advisor-face.tsx) */
|
|
25
|
+
--orange:#ec8a2e;--yellow:#d8bd3c;--red:#d2605c;--warn:#cf9a4e;--ok:#6faa86;--blue:#6f9bd1;--agent:#d97757;
|
|
25
26
|
/* the recorder tray's copy buttons: a blue, a green and a purple dark enough for white text on them (5 to 1 at
|
|
26
27
|
least), the same in the tray, so a copy mode reads the same in both */
|
|
27
28
|
--recfile:#0b63ce;--recwebp:#1a7f43;--reclink:#8a3fc4;--recink:#ffffff;
|
|
@@ -38,6 +39,9 @@
|
|
|
38
39
|
--viz1:#3987e5;--viz2:#d95926;--viz3:#199e70;--viz4:#9085e9;
|
|
39
40
|
/* the review section's own hue: the one row of the tree meant to be seen first */
|
|
40
41
|
--review:#e879d4;
|
|
42
|
+
/* a live page in a thread (a running page framed): its tile's border and its IFRAME tag, apart from the accent,
|
|
43
|
+
the verdict tones and the review hue; text in --bg on it */
|
|
44
|
+
--iframe:#3cc4d6;
|
|
41
45
|
/* a wiki page's refs (wikis-view.tsx): read on demand, loaded with the page */
|
|
42
46
|
--ref-lazy:#e8984a;--ref-eager:#6fa8f0;
|
|
43
47
|
--wash:rgba(107,143,179,.15);--wash2:rgba(107,143,179,.11);--hair:rgba(107,143,179,.5);
|
|
@@ -57,7 +61,7 @@
|
|
|
57
61
|
:root[data-theme=light]{--bg:#f1f3f6;--panel:#ffffff;
|
|
58
62
|
--bg-side:#e6e9ee;--bg-top:#eaedf1;--bg-dock:#e3e7ec;--bg-band:#cfd5dd;--panel2:#e3e7ec;--line:#bcc4ce;--ink:#16191d;--dim:#464b51;--field:#ffffff;
|
|
59
63
|
--accent:#355e87;--sel:#d2e0ef;--chk1:#e3e7ec;--chk2:#f7f8fa;
|
|
60
|
-
--orange:#cf6410;--red:#a83733;--warn:#86550b;--ok:#256e45;--blue:#275fa0;
|
|
64
|
+
--orange:#cf6410;--yellow:#8a6f00;--red:#a83733;--warn:#86550b;--ok:#256e45;--blue:#275fa0;--agent:#b8532f;
|
|
61
65
|
--recfile:#0b63ce;--recwebp:#1a7f43;--reclink:#8a3fc4;--recink:#ffffff;
|
|
62
66
|
--scrim:rgba(20,24,30,.35);--shadow:rgba(20,24,30,.16);--solid:#000;
|
|
63
67
|
--hi1:rgba(0,0,0,.2);--hi2:rgba(0,0,0,.11);--hi3:rgba(0,0,0,.045);
|
|
@@ -67,6 +71,7 @@
|
|
|
67
71
|
--kind-s:55%;--kind-l:38%;
|
|
68
72
|
--viz1:#2a78d6;--viz2:#eb6834;--viz3:#1baf7a;--viz4:#6250d6;
|
|
69
73
|
--review:#a72288;
|
|
74
|
+
--iframe:#08798a;
|
|
70
75
|
--ref-lazy:#944d0a;--ref-eager:#1d5abd;
|
|
71
76
|
--wash:rgba(59,104,150,.12);--wash2:rgba(59,104,150,.08);--hair:rgba(59,104,150,.45);
|
|
72
77
|
--errbg:#fbe9e8;--errline:#efc4c2;--errink:#8a2520;
|
|
@@ -77,7 +82,7 @@
|
|
|
77
82
|
:root[data-theme=dim]{--bg:#22262c;--panel:#2a2f36;
|
|
78
83
|
--bg-side:#272b32;--bg-top:#2c3138;--bg-dock:#252a31;--bg-band:#1a1d22;--panel2:#323840;--line:#454c56;--ink:#e4e7ea;--dim:#a8afb8;--field:#353b44;
|
|
79
84
|
--accent:#93b4d6;--sel:#2f4054;--chk1:#2c3138;--chk2:#262a30;
|
|
80
|
-
--orange:#f09a48;--red:#ec908c;--warn:#dba95e;--ok:#82bd99;--blue:#88b0e0;
|
|
85
|
+
--orange:#f09a48;--yellow:#e6cd5c;--red:#ec908c;--warn:#dba95e;--ok:#82bd99;--blue:#88b0e0;--agent:#e39278;
|
|
81
86
|
--recfile:#0b63ce;--recwebp:#1a7f43;--reclink:#8a3fc4;--recink:#ffffff;
|
|
82
87
|
--scrim:rgba(0,0,0,.5);--shadow:rgba(0,0,0,.45);--solid:#000;
|
|
83
88
|
--hi1:rgba(255,255,255,.28);--hi2:rgba(255,255,255,.16);--hi3:rgba(255,255,255,.07);
|
|
@@ -87,6 +92,7 @@
|
|
|
87
92
|
--kind-s:55%;--kind-l:68%;
|
|
88
93
|
--viz1:#3987e5;--viz2:#d95926;--viz3:#199e70;--viz4:#9085e9;
|
|
89
94
|
--review:#ee8fdc;
|
|
95
|
+
--iframe:#5fd0e0;
|
|
90
96
|
--ref-lazy:#eea65f;--ref-eager:#82b5f4;
|
|
91
97
|
--wash:rgba(132,168,204,.17);--wash2:rgba(132,168,204,.12);--hair:rgba(132,168,204,.5);
|
|
92
98
|
--errbg:#402c2c;--errline:#633f3f;--errink:#eecccc;
|
|
@@ -97,7 +103,7 @@
|
|
|
97
103
|
:root[data-theme=grey]{--bg:#cfd3d9;--panel:#dbdee3;
|
|
98
104
|
--bg-side:#c5cad1;--bg-top:#c9ced5;--bg-dock:#c2c7cf;--bg-band:#adb4be;--panel2:#c2c7cf;--line:#9aa2ad;--ink:#101317;--dim:#33383e;--field:#eceef1;
|
|
99
105
|
--accent:#274d74;--sel:#b1c4d9;--chk1:#c2c7cf;--chk2:#d5d9de;
|
|
100
|
-
--orange:#b85808;--red:#8a2622;--warn:#6b4204;--ok:#17532f;--blue:#1a4a82;
|
|
106
|
+
--orange:#b85808;--yellow:#6b5600;--red:#8a2622;--warn:#6b4204;--ok:#17532f;--blue:#1a4a82;--agent:#9a4022;
|
|
101
107
|
--recfile:#0b63ce;--recwebp:#1a7f43;--reclink:#8a3fc4;--recink:#ffffff;
|
|
102
108
|
--scrim:rgba(20,24,30,.4);--shadow:rgba(20,24,30,.2);--solid:#000;
|
|
103
109
|
--hi1:rgba(0,0,0,.22);--hi2:rgba(0,0,0,.13);--hi3:rgba(0,0,0,.06);
|
|
@@ -107,6 +113,7 @@
|
|
|
107
113
|
--kind-s:55%;--kind-l:30%;
|
|
108
114
|
--viz1:#2a78d6;--viz2:#eb6834;--viz3:#1baf7a;--viz4:#6250d6;
|
|
109
115
|
--review:#8a1570;
|
|
116
|
+
--iframe:#065f6c;
|
|
110
117
|
--ref-lazy:#7a3d04;--ref-eager:#14479c;
|
|
111
118
|
--wash:rgba(39,77,116,.14);--wash2:rgba(39,77,116,.09);--hair:rgba(39,77,116,.5);
|
|
112
119
|
--errbg:#e6cfcd;--errline:#d0a5a2;--errink:#7a1f1a;
|