rvlib-shipkit 2.27.0 → 2.28.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 +16 -0
- package/package.json +1 -1
- package/src/agent-time/hooks.ts +10 -3
- package/src/agent-time/live.ts +11 -5
- package/src/agent-time/registry.ts +289 -0
- package/src/agent-time/store.ts +2 -2
- package/src/annex/born.ts +2 -2
- package/src/annex/offload.ts +12 -11
- package/src/asks/ask-after.ts +6 -2
- package/src/asks/ask-bar-fold.ts +57 -0
- package/src/asks/ask-migrate.ts +280 -0
- package/src/asks/ask-steps-fold.ts +166 -0
- package/src/asks/ask-store.ts +586 -0
- package/src/assets/kits/identity-kit.ts +106 -38
- package/src/assets/kits/poster-thumbnail.ts +282 -0
- package/src/checks/SK003-claude-md-shape.check.ts +92 -25
- package/src/checks/SK004-gitignore-policy.check.ts +8 -4
- package/src/checks/SK013-one-way-in-policy.check.ts +10 -0
- package/src/checks/SK026-asks-autoclose.check.ts +9 -23
- package/src/checks/SK038-speaks-as.check.ts +3 -3
- package/src/checks/SK042-post-kinds.check.ts +26 -24
- package/src/checks/SK049-thread-answers-hook.check.ts +81 -0
- package/src/checks/SK050-retired-commands.check.ts +127 -0
- package/src/cli/cmd_Asks.ts +204 -53
- package/src/cli/cmd_Backup.ts +151 -8
- package/src/cli/cmd_Calls.ts +1 -0
- package/src/cli/cmd_Commands.ts +140 -34
- package/src/cli/cmd_Contracts.ts +1 -0
- package/src/cli/cmd_Keys.ts +1 -0
- package/src/cli/cmd_Lanes.ts +15 -4
- package/src/cli/cmd_Messages.ts +152 -1
- package/src/cli/cmd_Needs.ts +1 -0
- package/src/cli/cmd_Review.ts +931 -229
- package/src/cli/cmd_Secret.ts +255 -34
- package/src/cli/cmd_Social.ts +36 -33
- package/src/cli/cmd_SocialDrafts.ts +235 -0
- package/src/cli/cmd_Sound.ts +22 -1
- package/src/cli/cmd_Start.ts +3 -2
- package/src/cli/cmd_ThreadHolds.ts +34 -0
- package/src/cli/cmd_ThreadKinds.ts +146 -0
- package/src/cli/cmd_ThreadReflect.ts +83 -0
- package/src/cli/cmd_ThreadSyncNeeds.ts +62 -0
- package/src/cli/cmd_Vault.ts +1 -1
- package/src/cli/cmd_When.ts +1 -0
- package/src/cli/family-help.ts +2 -2
- package/src/cli/family-pages.ts +1 -1
- package/src/cli/kit/builtins.ts +1 -0
- package/src/cli/kit/verb.ts +6 -2
- package/src/cli/registry.ts +21 -2
- package/src/cli.ts +5 -2
- package/src/collections/actions.ts +25 -74
- package/src/collections/collection-types.ts +9 -5
- package/src/collections/md-body.ts +5 -3
- package/src/collections/pings.ts +13 -6
- package/src/collections/providers.ts +53 -61
- package/src/collections/reflections.ts +9 -4
- package/src/core/discover-checks.ts +18 -3
- package/src/core/git.ts +31 -0
- package/src/core/house-layout.ts +17 -0
- package/src/core/layout.ts +10 -5
- package/src/core/locked-write.ts +4 -1
- package/src/core/machine-db.ts +5 -3
- package/src/core/migrate-layout.ts +8 -10
- package/src/home/activity.ts +8 -15
- package/src/home/daemon-jobs.ts +13 -1
- package/src/home/home-paths.ts +6 -3
- package/src/home/home-routes.ts +8 -0
- package/src/home/inbox-shape.ts +233 -100
- package/src/home/inbox.ts +26 -71
- package/src/home/machine-fold.ts +10 -15
- package/src/home/machine-host.ts +19 -1
- package/src/home/other-macs.ts +2 -2
- package/src/home/serve-web.ts +6 -5
- package/src/home/space-page.ts +1 -1
- package/src/home/vault-page.ts +51 -17
- package/src/home/vault-words.ts +2 -2
- package/src/hooks/one-way-in-guard.ts +24 -2
- package/src/hq/files-send.ts +27 -28
- package/src/hq/hq-db.ts +4 -1
- package/src/hq/hq-local.ts +37 -4
- package/src/hq/hq-routes.ts +10 -2
- package/src/hq/hq-store.ts +6 -2
- package/src/hq/kinds/ask.ts +6 -6
- package/src/hq/outbox.ts +5 -3
- package/src/hq/replica.ts +1 -2
- package/src/hq/vault-route.ts +112 -0
- package/src/identities/collection.ts +2 -2
- package/src/identities/identities.ts +9 -8
- package/src/identities/machine-route.ts +8 -3
- package/src/ledger/db.ts +8 -1
- package/src/media-store/backup/daemon.ts +48 -8
- package/src/media-store/backup/keys.ts +1 -1
- package/src/media-store/backup/manifest.ts +20 -2
- package/src/media-store/backup/prune.ts +365 -0
- package/src/media-store/backup/retention.ts +122 -0
- package/src/media-store/backup/run.ts +14 -8
- package/src/media-store/backup/sources.ts +18 -17
- package/src/media-store/backup/thread-copy.ts +340 -0
- package/src/media-store/copy/config.ts +3 -4
- package/src/media-store/copy/store.ts +2 -2
- package/src/media-store/db.ts +2 -2
- package/src/media-store/forget.ts +118 -0
- package/src/media-store/purge.ts +3 -2
- package/src/media-store/space-listing.ts +20 -4
- package/src/media-store/space.ts +6 -5
- package/src/messages/guard.ts +49 -0
- package/src/messages/model.ts +1 -1
- package/src/messages/objects.ts +201 -0
- package/src/messages/routes.ts +2 -2
- package/src/messages/score.ts +1 -1
- package/src/messages/write.ts +285 -0
- package/src/pages/frame-client.ts +181 -4
- package/src/reflections/reflections-queue.ts +1 -1
- package/src/release/gate-checkout.ts +2 -1
- package/src/release/git-facts.ts +3 -2
- package/src/release/public-clean.ts +3 -2
- package/src/repo-config.ts +40 -18
- package/src/review/anim.ts +1 -1
- package/src/review/answer-kinds.ts +131 -0
- package/src/review/band.ts +53 -0
- package/src/review/branch-hold.ts +84 -0
- package/src/review/card-db.ts +16 -6
- package/src/review/card-rows.ts +4 -3
- package/src/review/cells.ts +297 -65
- package/src/review/close.ts +92 -0
- package/src/review/draft-card.ts +8 -16
- package/src/review/draft-model.ts +2 -2
- package/src/review/events.ts +171 -0
- package/src/review/format.ts +128 -14
- package/src/review/glyphs.ts +63 -0
- package/src/review/gone.ts +1 -1
- package/src/review/holds-sync.ts +62 -0
- package/src/review/holds.ts +85 -0
- package/src/review/house-kind-defs.ts +41 -0
- package/src/review/inbox-hook.ts +22 -9
- package/src/review/inbox-read.ts +201 -0
- package/src/review/instructions.ts +199 -0
- package/src/review/kind-apply.ts +61 -0
- package/src/review/kind-catalog.ts +96 -0
- package/src/review/kinds.ts +278 -0
- package/src/review/lane-ask.ts +109 -0
- package/src/review/model.ts +396 -86
- package/src/review/move.ts +3 -3
- package/src/review/need-address.ts +15 -0
- package/src/review/need-threads.ts +93 -0
- package/src/review/object-card.ts +48 -0
- package/src/review/object-read.ts +31 -0
- package/src/review/owner-verdict.ts +36 -0
- package/src/review/parties.ts +182 -0
- package/src/review/previews.ts +3 -1
- package/src/review/projections.ts +235 -0
- package/src/review/referring.ts +54 -0
- package/src/review/reflection-object.ts +195 -0
- package/src/review/routes.ts +137 -32
- package/src/review/secret-route.ts +80 -0
- package/src/review/snooze.ts +38 -0
- package/src/review/stage-card.ts +4 -4
- package/src/review/store.ts +366 -85
- package/src/review/supersede.ts +116 -0
- package/src/review/take-back.ts +52 -0
- package/src/review/thread-fold.ts +20 -7
- package/src/review/threads.ts +236 -39
- package/src/review/traces.ts +218 -0
- package/src/review/trailer-card.ts +2 -2
- package/src/review/unit.ts +71 -5
- package/src/review/verdict-items.ts +73 -0
- package/src/review/verdict-write.ts +15 -0
- package/src/review/wait.ts +85 -0
- package/src/review/watchers.ts +22 -9
- package/src/scaffold/files/claude-settings-local.json +2 -0
- package/src/secrets/archive-mark.ts +52 -0
- package/src/secrets/archive.ts +83 -0
- package/src/secrets/copy.ts +14 -14
- package/src/secrets/keychain-write.ts +48 -0
- package/src/secrets/keychain.ts +8 -5
- package/src/secrets/lapse-mark.ts +33 -0
- package/src/secrets/lapse.ts +60 -0
- package/src/secrets/list.ts +16 -22
- package/src/secrets/manager.ts +31 -16
- package/src/secrets/read.ts +161 -33
- package/src/secrets/tail.ts +31 -0
- package/src/serve/hub-app/asks-page.tsx +2 -1
- package/src/serve/hub-app/auto-text.tsx +14 -6
- package/src/serve/hub-app/benign-errors.ts +15 -1
- package/src/serve/hub-app/card-head.tsx +49 -0
- package/src/serve/hub-app/check-view.tsx +3 -2
- package/src/serve/hub-app/code-copy.ts +35 -0
- package/src/serve/hub-app/col-card.tsx +31 -40
- package/src/serve/hub-app/col-list-page.tsx +5 -2
- package/src/serve/hub-app/col-tables-view.tsx +7 -4
- package/src/serve/hub-app/col-tables.ts +5 -5
- package/src/serve/hub-app/cols-svc.ts +4 -79
- package/src/serve/hub-app/commands/commands-page.tsx +2 -1
- package/src/serve/hub-app/controls.css +83 -0
- package/src/serve/hub-app/frames-st.ts +17 -1
- package/src/serve/hub-app/git-view.tsx +3 -2
- package/src/serve/hub-app/home-st.ts +57 -6
- package/src/serve/hub-app/home-strip.css +1 -6
- package/src/serve/hub-app/home-strip.tsx +2 -1
- package/src/serve/hub-app/home.html +3 -0
- package/src/serve/hub-app/house-wiki-view.tsx +20 -0
- package/src/serve/hub-app/hub-app.tsx +48 -32
- package/src/serve/hub-app/hub-types.ts +2 -0
- package/src/serve/hub-app/hub.css +50 -61
- package/src/serve/hub-app/icons.tsx +14 -4
- package/src/serve/hub-app/identities-view.tsx +4 -3
- package/src/serve/hub-app/inbox-st.ts +203 -42
- package/src/serve/hub-app/inbox-view.tsx +189 -101
- package/src/serve/hub-app/inbox.css +47 -44
- package/src/serve/hub-app/index.html +3 -0
- package/src/serve/hub-app/instructions.css +30 -0
- package/src/serve/hub-app/keys.ts +5 -3
- package/src/serve/hub-app/machine-st.ts +2 -2
- package/src/serve/hub-app/machines-view.tsx +4 -11
- package/src/serve/hub-app/machines.css +0 -9
- package/src/serve/hub-app/markdown.css +51 -0
- package/src/serve/hub-app/md-copy.tsx +18 -40
- package/src/serve/hub-app/md.ts +25 -9
- package/src/serve/hub-app/media-view.tsx +2 -2
- package/src/serve/hub-app/messages/messages-page.tsx +2 -1
- package/src/serve/hub-app/messages/messages-st.ts +1 -1
- package/src/serve/hub-app/messages.css +0 -1
- package/src/serve/hub-app/objects.css +51 -0
- package/src/serve/hub-app/page-keys.ts +1 -1
- package/src/serve/hub-app/pages-frames.tsx +11 -1
- package/src/serve/hub-app/palette-st.ts +4 -4
- package/src/serve/hub-app/pane-boundary.tsx +72 -0
- package/src/serve/hub-app/pane-errors.ts +54 -0
- package/src/serve/hub-app/plan-view.tsx +3 -2
- package/src/serve/hub-app/planned-view.tsx +3 -3
- package/src/serve/hub-app/planned.css +0 -4
- package/src/serve/hub-app/processes-view.tsx +3 -2
- package/src/serve/hub-app/project-list.css +5 -13
- package/src/serve/hub-app/project-list.tsx +3 -6
- package/src/serve/hub-app/projects-svc.ts +6 -2
- package/src/serve/hub-app/readme.css +9 -15
- package/src/serve/hub-app/reflections-page.tsx +54 -1
- package/src/serve/hub-app/releases/releases-page.tsx +3 -2
- package/src/serve/hub-app/releases.css +0 -1
- package/src/serve/hub-app/review/code-colors.ts +30 -0
- package/src/serve/hub-app/review/diff-view.tsx +75 -0
- package/src/serve/hub-app/review/dock.tsx +104 -0
- package/src/serve/hub-app/review/draft-card.tsx +2 -2
- package/src/serve/hub-app/review/group-block.tsx +209 -0
- package/src/serve/hub-app/review/instructions-view.tsx +116 -0
- package/src/serve/hub-app/review/item-verdict.tsx +38 -0
- package/src/serve/hub-app/review/kind-states.tsx +193 -0
- package/src/serve/hub-app/review/kind-view.tsx +1 -37
- package/src/serve/hub-app/review/kit.tsx +57 -54
- package/src/serve/hub-app/review/lane-bar.tsx +64 -0
- package/src/serve/hub-app/review/object-card.tsx +62 -0
- package/src/serve/hub-app/review/object-panel.tsx +179 -0
- package/src/serve/hub-app/review/question-views.tsx +385 -0
- package/src/serve/hub-app/review/review-cells.tsx +86 -105
- package/src/serve/hub-app/review/review-list.tsx +104 -47
- package/src/serve/hub-app/review/review-page.tsx +5 -4
- package/src/serve/hub-app/review/review-st.ts +68 -28
- package/src/serve/hub-app/review/review-thread.tsx +171 -40
- package/src/serve/hub-app/review/review-views.tsx +35 -31
- package/src/serve/hub-app/review/thread-close.tsx +124 -0
- package/src/serve/hub-app/review/thread-control.tsx +4 -4
- package/src/serve/hub-app/review/thread-st.ts +222 -22
- package/src/serve/hub-app/review/trailer-card.tsx +1 -1
- package/src/serve/hub-app/review/trailer-timeline.tsx +2 -2
- package/src/serve/hub-app/review.css +216 -57
- package/src/serve/hub-app/section-head.tsx +51 -0
- package/src/serve/hub-app/social/calendar.tsx +5 -11
- package/src/serve/hub-app/social/comms-page.tsx +23 -10
- package/src/serve/hub-app/social/kit.tsx +8 -15
- package/src/serve/hub-app/social/next-release.tsx +3 -5
- package/src/serve/hub-app/social/post-card.tsx +3 -0
- package/src/serve/hub-app/social/post-page.tsx +80 -0
- package/src/serve/hub-app/social/problems.tsx +5 -9
- package/src/serve/hub-app/social/social-model.ts +13 -5
- package/src/serve/hub-app/social/social-page.tsx +1 -1
- package/src/serve/hub-app/social/social-st.ts +42 -5
- package/src/serve/hub-app/social.css +7 -17
- package/src/serve/hub-app/space.css +1 -1
- package/src/serve/hub-app/stores/stores-page.tsx +6 -2
- package/src/serve/hub-app/thread-row.tsx +101 -0
- package/src/serve/hub-app/time-ago.tsx +3 -2
- package/src/serve/hub-app/time-view.tsx +2 -1
- package/src/serve/hub-app/time.css +2 -5
- package/src/serve/hub-app/tree-row.tsx +1 -9
- package/src/serve/hub-app/vault-view.tsx +4 -4
- package/src/serve/hub-app/veille/veille-page.tsx +2 -11
- package/src/serve/hub-app/veille.css +0 -1
- package/src/serve/hub-app/waiting-svc.ts +4 -4
- package/src/serve/hub-app/when-view.tsx +6 -3
- package/src/serve/hub-app/wiki-st.ts +30 -4
- package/src/serve/hub-app/wikis-view.tsx +4 -3
- package/src/serve/hub-runtime.ts +20 -6
- package/src/serve/project-gutter-route.ts +16 -6
- package/src/serve/project-gutter.ts +6 -53
- package/src/serve/same-origin.ts +3 -0
- package/src/serve/secret-gate.ts +21 -0
- package/src/serve/serve-hub.ts +29 -20
- package/src/serve/tailnet-caller.ts +117 -0
- package/src/shipkit.ts +2 -2
- package/src/site/desk.ts +2 -2
- package/src/smoke/run-smoke.ts +3 -4
- package/src/social/brands.ts +4 -0
- package/src/social/card-drafts.ts +11 -19
- package/src/social/desk-index.ts +34 -13
- package/src/social/drafts.ts +4 -4
- package/src/social/import-drafts.ts +244 -0
- package/src/social/kind-pages.ts +3 -3
- package/src/social/kinds.ts +1 -1
- package/src/social/load.ts +89 -64
- package/src/social/media-kind.ts +68 -161
- package/src/social/media-of.ts +5 -4
- package/src/social/open.ts +3 -2
- package/src/social/post-object.ts +120 -0
- package/src/social/post-sources.ts +136 -0
- package/src/social/post-text.ts +103 -0
- package/src/social/posts.ts +378 -0
- package/src/social/presence.ts +7 -5
- package/src/social/publish/index.ts +17 -5
- package/src/social/publish/secret.ts +2 -2
- package/src/social/release-stage.ts +58 -57
- package/src/social/routes.ts +64 -24
- package/src/social/stage.ts +42 -57
- package/src/social/text.ts +4 -3
- package/src/social/thumbnail.ts +135 -43
- package/src/social/tracker.ts +1 -1
- package/src/social/writes.ts +12 -29
- package/src/stores/desk.ts +16 -11
- package/src/stores/unit.ts +2 -2
- package/src/trailer/sound/eleven.ts +33 -3
- package/src/urls/rows.ts +1 -1
- package/src/vault/vault-http.ts +11 -3
- package/src/vault/vault-import.ts +6 -1
- package/src/veille/identity.ts +2 -2
- package/src/wiki/graph-pages.ts +13 -1
- package/src/wiki/scan-md.ts +1 -1
- package/src/asks/asks-queue.ts +0 -424
- package/src/messages/suggest.ts +0 -96
- package/src/social/migrate.ts +0 -123
|
@@ -47,12 +47,7 @@
|
|
|
47
47
|
/* the home's three groups, global, identities, projects: a header each that folds its group (projects-svc folds),
|
|
48
48
|
kept per browser; folded, it sums what waits on the owner inside it */
|
|
49
49
|
.pjgroup + .pjgroup{margin-top:var(--s2)}
|
|
50
|
-
/* a group's header is
|
|
51
|
-
.pjgh{display:flex;align-items:center;gap:var(--s1);width:100%;height:26px;padding:0 var(--s1);border:0;border-radius:0;background:var(--bg-band);color:var(--ink);
|
|
52
|
-
font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;text-align:left;cursor:pointer}
|
|
53
|
-
.pjgh:hover{background:var(--bg-band);color:var(--accent)}
|
|
54
|
-
.pjgh .cvt{color:var(--dim)}
|
|
55
|
-
.pjghn{color:var(--dim)}
|
|
50
|
+
/* a group's header is the hub's one head (section-head.tsx, controls.css .sh) */
|
|
56
51
|
/* a folded group of pages or identities: its icons and avatars in wrapped rows under its band, a click each, the
|
|
57
52
|
name on hover, the one shown ringed or lit, the inbox's count on its corner */
|
|
58
53
|
.pjwrap{display:flex;flex-wrap:wrap;gap:var(--s0);padding:var(--s1) var(--s2)}
|
|
@@ -61,10 +56,7 @@
|
|
|
61
56
|
.pjrow.pjmini.cur{box-shadow:inset 0 -2px 0 var(--pjc,var(--accent))}
|
|
62
57
|
.pjrow.pjmini.pjid.cur{box-shadow:none}
|
|
63
58
|
.pjrow.pjmini .pgr{position:absolute;top:0;right:0;min-width:14px;height:14px;padding:0 var(--s0);border-radius:7px;font-size:9px;line-height:14px}
|
|
64
|
-
.
|
|
65
|
-
.pjghl{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
66
|
-
.pjghn{flex:1;font-weight:400;letter-spacing:0;font-variant-numeric:tabular-nums}
|
|
67
|
-
.pjgh .pgr,.pjgh .pga{letter-spacing:0;cursor:default}
|
|
59
|
+
.sh .pgr,.sh .pga{cursor:default}
|
|
68
60
|
/* a global page's row: the page's icon in the repo icons' place; lit in the accent while it shows */
|
|
69
61
|
.pjglobal .hico{flex:none;width:18px;height:16px}
|
|
70
62
|
.pjglobal.cur{color:var(--accent)}
|
|
@@ -182,10 +174,10 @@
|
|
|
182
174
|
.pjlist.rail .pgr{left:calc(50% - var(--ri,24px) / 2 - 4px)}
|
|
183
175
|
/* the rail: a header is its caret alone over a rule, its name and count in its title; a global row its icon, an
|
|
184
176
|
identity its avatar, each at the rail's icon size, the name in its title */
|
|
185
|
-
.pjlist.rail .
|
|
186
|
-
.pjlist.rail .
|
|
177
|
+
.pjlist.rail .sh .shl,.pjlist.rail .sh .shn{display:none}
|
|
178
|
+
.pjlist.rail .sh{justify-content:center;padding:0;min-height:16px}
|
|
187
179
|
.pjlist.rail .pjwrap{justify-content:center;padding:var(--s1) 0}
|
|
188
|
-
.pjlist.rail .
|
|
180
|
+
.pjlist.rail .sh .pgr,.pjlist.rail .sh .pga{position:static;margin-left:var(--s0)}
|
|
189
181
|
.pjlist.rail .pjglobal .hico{width:calc(var(--ri,24px) * .75);height:calc(var(--ri,24px) * .75)}
|
|
190
182
|
.pjlist.rail .pjrow img.pjav,.pjlist.rail .pjrow .pjav{width:var(--ri,24px);height:var(--ri,24px);border-radius:50%}
|
|
191
183
|
.pjlist.rail .pjavi{font-size:calc(var(--ri,24px) * .45)}
|
|
@@ -28,7 +28,7 @@ import { observer } from 'mobx-react-lite'
|
|
|
28
28
|
import { useEffect, type CSSProperties } from 'react'
|
|
29
29
|
import { middleware, OPEN_MS } from './floating.tsx'
|
|
30
30
|
import { Icon, ICON } from './icons.tsx'
|
|
31
|
-
import {
|
|
31
|
+
import { SectionHead } from './section-head.tsx'
|
|
32
32
|
import { plainClick } from './home-st.ts'
|
|
33
33
|
import { FIND_KEY, PICKER_KEY, PLACE_KEY, RAIL_KEY, STEP_KEYS } from './keys.ts'
|
|
34
34
|
import type { RailIdentity } from '../../identities/machine.ts'
|
|
@@ -176,13 +176,10 @@ export const GroupHead = observer(({ s, g, n, cards = 0, asks = 0 }: { s: Projec
|
|
|
176
176
|
const w = GROUP_WORDS[g]
|
|
177
177
|
const what = `${w.label}, ${n} ${n === 1 ? w.one : w.many}`
|
|
178
178
|
return (
|
|
179
|
-
<
|
|
180
|
-
<Caret open={open} />
|
|
181
|
-
<span className="pjghl">{w.label}</span>
|
|
182
|
-
<span className="pjghn">{n}</span>
|
|
179
|
+
<SectionHead label={w.label} n={n} open={open} aria-label={what} title={`${what}: a click ${open ? 'folds' : 'shows'} them`} onFold={() => s.toggleFold(g)}>
|
|
183
180
|
{open || cards === 0 ? null : <b className="pgr" aria-label={`${cards} thread${cards === 1 ? '' : 's'} wait on you inside`}>{cards}</b>}
|
|
184
181
|
{open || asks === 0 ? null : <b className="pga" aria-label={`${asks} ask${asks === 1 ? '' : 's'} inside`}>{asks}</b>}
|
|
185
|
-
</
|
|
182
|
+
</SectionHead>
|
|
186
183
|
)
|
|
187
184
|
})
|
|
188
185
|
|
|
@@ -217,12 +217,13 @@ export function cardModel(p: Project, now: number): CardModel {
|
|
|
217
217
|
}
|
|
218
218
|
|
|
219
219
|
/** a page of the home that is no repo's */
|
|
220
|
-
export type Place = 'overview' | 'inbox' | 'machines' | 'database' | 'vault' | 'space' | 'planned' | 'activity' | 'insights' | 'time' | 'recordings'
|
|
220
|
+
export type Place = 'wiki' | 'overview' | 'inbox' | 'machines' | 'database' | 'vault' | 'space' | 'planned' | 'activity' | 'insights' | 'time' | 'recordings'
|
|
221
221
|
|
|
222
222
|
/** the global group's rows, in their order: the picker, the inbox, the overview, then the places, each with its
|
|
223
223
|
* shortcut (keys.ts); ⌘↑ ⌘↓ walk them in this order, the picker aside (ProjectsSvc.step) */
|
|
224
224
|
export const PLACES: { id: Place | 'picker'; label: string; title: string }[] = [
|
|
225
225
|
{ id: 'picker', label: 'jump to…', title: 'jump to a page, a repo or one of its resources' },
|
|
226
|
+
{ id: 'wiki', label: 'wiki', title: 'the house wiki: its pages as a link graph, searched, a page opened beside it' },
|
|
226
227
|
{ id: 'inbox', label: 'inbox', title: 'everything that waits on you in every repo: cards, questions, asks and what is red' },
|
|
227
228
|
{ id: 'overview', label: 'overview', title: 'the overview: shipkit, every global process and every repo on this machine' },
|
|
228
229
|
{ id: 'machines', label: 'machines', title: 'every machine that reports to the hq: on or silent, its shipkit, its free disk, its repos, and what to look at' },
|
|
@@ -250,6 +251,8 @@ export class ProjectsSvc {
|
|
|
250
251
|
archived: ArchivedRow[] = []
|
|
251
252
|
/** every identity of the machine, in their order: the rail's middle band (wiki tools/shipkit/social.md, Identities) */
|
|
252
253
|
identities: RailIdentity[] = loadIdentityList()
|
|
254
|
+
/** the repo that holds the house wiki, as the daemon measured it; the home's wiki page shows its wikis */
|
|
255
|
+
house: string | null = null
|
|
253
256
|
/** a click on an identity: the home opens its identity view; a hub of its own has none */
|
|
254
257
|
onIdentity: ((id: string) => void) | null = null
|
|
255
258
|
/** the identity whose view the home shows, lit in the band; null on any other page */
|
|
@@ -572,7 +575,7 @@ export class ProjectsSvc {
|
|
|
572
575
|
try {
|
|
573
576
|
const r = await reach('/api/projects.json')
|
|
574
577
|
if (!r.ok) throw new Error(`${r.status} ${await r.text()}`)
|
|
575
|
-
const j = (await r.json()) as { projects: Project[]; archived?: ArchivedRow[]; identities?: RailIdentity[] }
|
|
578
|
+
const j = (await r.json()) as { projects: Project[]; archived?: ArchivedRow[]; identities?: RailIdentity[]; house?: string | null }
|
|
576
579
|
runInAction(() => {
|
|
577
580
|
// a reorder since this left, or a drag in flight: the next poll answers
|
|
578
581
|
if (order !== this.orderGen || this.drag != null) return
|
|
@@ -580,6 +583,7 @@ export class ProjectsSvc {
|
|
|
580
583
|
this.list = mine.size === 0 ? j.projects : j.projects.map((p) => (mine.has(p.name) ? { ...p, identity: mine.get(p.name)! } : p))
|
|
581
584
|
this.archived = j.archived ?? []
|
|
582
585
|
this.identities = j.identities ?? []
|
|
586
|
+
this.house = j.house ?? null
|
|
583
587
|
this.error = ''
|
|
584
588
|
this.fresh = true
|
|
585
589
|
})
|
|
@@ -3,31 +3,25 @@
|
|
|
3
3
|
.readme{width:100%;max-width:860px;margin:0 auto 0 var(--s3);padding:var(--s1) var(--s4) var(--s4)}
|
|
4
4
|
.stagewrap:has(> .readme){padding-top:var(--s2)}
|
|
5
5
|
.readme-body{font-size:13.5px;line-height:1.6}
|
|
6
|
-
.readme .readme-body h1{font-size:22px;line-height:1.25
|
|
6
|
+
.readme .readme-body h1{font-size:22px;line-height:1.25}
|
|
7
7
|
.readme .readme-body > :first-child{margin-top:0}
|
|
8
|
-
.readme .readme-body h2{font-size:17px;
|
|
8
|
+
.readme .readme-body h2{font-size:17px;border-bottom:1px solid var(--line);padding-bottom:var(--s1)}
|
|
9
9
|
.readme .readme-body h3{font-size:14px}
|
|
10
|
-
.readme .readme-body table{margin:var(--s3) 0 var(--s4)}
|
|
11
10
|
.readme-body img{max-width:100%;height:auto;border-radius:4px}
|
|
12
|
-
.readme-body pre{overflow-x:auto;padding:var(--s2);background:var(--hi3);border-radius:4px}
|
|
13
11
|
/* a link reads blue, a code span inside it too, underlined on hover */
|
|
14
12
|
.readme-body a,.readme-body a code{color:var(--blue);text-decoration:none}
|
|
15
13
|
.readme-body a code{border-color:color-mix(in srgb,var(--blue) 40%,var(--line))}
|
|
16
14
|
.readme-body a:hover{text-decoration:underline;text-underline-offset:2px}
|
|
17
15
|
.readme-body a:hover code{background:color-mix(in srgb,var(--blue) 14%,var(--bg))}
|
|
18
16
|
|
|
19
|
-
/* markdown a human copies values out of (md-copy.tsx, an ask): the readme's scale, a value a click copies
|
|
20
|
-
|
|
21
|
-
Code reads on the dark panel: a cool tint and a clear border, never the page's own background */
|
|
17
|
+
/* markdown a human copies values out of (md-copy.tsx, an ask): the readme's scale, a value a click copies (a block
|
|
18
|
+
copies from its button, markdown.css). A copy tints what was copied and says so in a toast: nothing moves */
|
|
22
19
|
.md.mdcopyable{font-size:13.5px;line-height:1.6}
|
|
23
20
|
.md.mdcopyable h1{font-size:16px}
|
|
24
|
-
.md.mdcopyable h2{font-size:14.5px
|
|
25
|
-
.md.mdcopyable table{
|
|
21
|
+
.md.mdcopyable h2{font-size:14.5px}
|
|
22
|
+
.md.mdcopyable table{font-size:13px}
|
|
26
23
|
.md.mdcopyable th,.md.mdcopyable td{padding:var(--s1) var(--s2);vertical-align:middle}
|
|
27
|
-
.md.mdcopyable code{color:var(--ink);background:color-mix(in srgb,var(--accent) 16%,var(--panel));border-color:color-mix(in srgb,var(--accent) 45%,var(--line))}
|
|
28
24
|
.md.mdcopyable :not(pre) > code{font-size:12.5px;padding:var(--s0) var(--s1);cursor:copy;transition:border-color .1s,background .1s}
|
|
29
|
-
.md.mdcopyable :not(pre) > code:hover{border-color:var(--
|
|
30
|
-
.md.mdcopyable code.copied
|
|
31
|
-
.md.mdcopyable pre{
|
|
32
|
-
.md.mdcopyable pre code{font-size:12.5px;line-height:1.6;background:none;border:0}
|
|
33
|
-
.mdcopy{position:absolute;top:var(--s1);right:var(--s1);height:22px;padding:0 var(--s2);font-size:11.5px}
|
|
25
|
+
.md.mdcopyable :not(pre) > code:hover{border-color:var(--code);background:color-mix(in srgb,var(--code) 24%,transparent)}
|
|
26
|
+
.md.mdcopyable code.copied{border-color:var(--ok);background:color-mix(in srgb,var(--ok) 22%,var(--panel))}
|
|
27
|
+
.md.mdcopyable pre code{font-size:12.5px;line-height:1.6}
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
// (col-list-page.tsx draws both). This file holds what is the reflections' own: the row, the bands' names and the
|
|
3
3
|
// page's words
|
|
4
4
|
import { observer } from 'mobx-react-lite'
|
|
5
|
+
import { useState } from 'react'
|
|
6
|
+
import { HOUSE_KINDS } from '../../review/kinds.ts'
|
|
5
7
|
import { reflectionAt, type ReflectionGroupKey } from './col-tables.ts'
|
|
6
8
|
import { ColListPage, type ColListWords } from './col-list-page.tsx'
|
|
7
9
|
import type { Resource } from './hub-types.ts'
|
|
@@ -37,6 +39,57 @@ const WORDS: ColListWords<ReflectionGroupKey> = {
|
|
|
37
39
|
}
|
|
38
40
|
const PANELS = { cols: 'reflections', list: 'reflections-list', shown: 'reflections-one' }
|
|
39
41
|
|
|
42
|
+
/** the reflection as an object (wiki tools/shipkit/threads-how-it-fits.md, The model): the owner's three actions, heard in the
|
|
43
|
+
* thread that refers to it (opened by the owner's click when none does), and every thread that refers to it */
|
|
44
|
+
const ReflectionObject = observer(({ app, r }: { app: RepoSt; r: Resource }) => {
|
|
45
|
+
const [text, setText] = useState('')
|
|
46
|
+
const [busy, setBusy] = useState(false)
|
|
47
|
+
const [sent, setSent] = useState<{ name: string; thread: string; opened: boolean } | null>(null)
|
|
48
|
+
const file = (r.file ?? '').split('/').at(-1) ?? ''
|
|
49
|
+
const actions = HOUSE_KINDS.reflection?.actions ?? {}
|
|
50
|
+
const send = async (name: string): Promise<void> => {
|
|
51
|
+
setBusy(true)
|
|
52
|
+
try {
|
|
53
|
+
const done = await app.cols.reflectionAct(file, name, text)
|
|
54
|
+
if (done != null) {
|
|
55
|
+
setSent({ name, ...done })
|
|
56
|
+
setText('')
|
|
57
|
+
}
|
|
58
|
+
} finally {
|
|
59
|
+
setBusy(false)
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
const threads = r.threads ?? []
|
|
63
|
+
return (
|
|
64
|
+
<section className="rv-reflectionobj" aria-label="this reflection">
|
|
65
|
+
<div className="rv-hint">
|
|
66
|
+
<input type="text" placeholder="your words on it (any action carries them; rework needs them)" value={text} onChange={(e) => setText(e.target.value)} />
|
|
67
|
+
</div>
|
|
68
|
+
<div className="rv-askopts">
|
|
69
|
+
{Object.entries(actions).map(([name, a]) => (
|
|
70
|
+
<button key={name} type="button" className={`rv-askopt${sent?.name === name ? ' picked' : ''}`} title={a.what ?? name} disabled={busy || file === '' || (a.words === true && text.trim() === '')} onClick={() => void send(name)}>
|
|
71
|
+
{a.icon ? `${a.icon} ` : ''}
|
|
72
|
+
{a.label}
|
|
73
|
+
</button>
|
|
74
|
+
))}
|
|
75
|
+
</div>
|
|
76
|
+
{app.cols.actErr !== '' ? <div className="rv-dim">{app.cols.actErr}</div> : null}
|
|
77
|
+
{sent ? (
|
|
78
|
+
<div className="rv-dim">
|
|
79
|
+
sent: {actions[sent.name]?.label ?? sent.name}, {sent.opened ? 'in its own thread, opened for it' : 'in the thread that refers to it'}{' '}
|
|
80
|
+
<button type="button" className="ghost" onClick={() => app.setSel({ t: 'review', id: sent.thread })}>open it ↗</button>
|
|
81
|
+
</div>
|
|
82
|
+
) : null}
|
|
83
|
+
<div className="rv-dim">{threads.length === 0 ? 'no thread refers to it: it shows here alone' : `${threads.length} thread${threads.length > 1 ? 's' : ''} refer${threads.length > 1 ? '' : 's'} to it`}</div>
|
|
84
|
+
{threads.map((t) => (
|
|
85
|
+
<div key={t.id} className="rv-dim">
|
|
86
|
+
<button type="button" className="ghost" onClick={() => app.setSel({ t: 'review', id: t.id })}>{t.title} ↗</button> {t.how === 'own' ? 'its own thread' : 'linked there'}{t.done ? ', done' : ''}
|
|
87
|
+
</div>
|
|
88
|
+
))}
|
|
89
|
+
</section>
|
|
90
|
+
)
|
|
91
|
+
})
|
|
92
|
+
|
|
40
93
|
export const ReflectionsPage = observer(({ app }: { app: RepoSt }) => (
|
|
41
|
-
<ColListPage app={app} st={app.reflections} words={WORDS} panels={PANELS} row={(r, on) => <ReflectionRow app={app} r={r} on={on} />} />
|
|
94
|
+
<ColListPage app={app} st={app.reflections} words={WORDS} panels={PANELS} row={(r, on) => <ReflectionRow app={app} r={r} on={on} />} foot={(r) => <ReflectionObject app={app} r={r} />} />
|
|
42
95
|
))
|
|
@@ -14,6 +14,7 @@ import type { RepoSt } from '../repo-st.ts'
|
|
|
14
14
|
import { NEXT_PICK } from '../social/social-model.ts'
|
|
15
15
|
import type { ReleasesSt } from './releases-st.ts'
|
|
16
16
|
import { ThreadControl } from '../review/thread-control.tsx'
|
|
17
|
+
import { SectionHead } from '../section-head.tsx'
|
|
17
18
|
|
|
18
19
|
|
|
19
20
|
const TABS: [ReleasesTab, string][] = [
|
|
@@ -63,7 +64,7 @@ const ChangePicture = observer(({ rs, ch }: { rs: ReleasesSt; ch: Change }) => {
|
|
|
63
64
|
})
|
|
64
65
|
|
|
65
66
|
/** a change's description: markdown, through the hub's safe renderer */
|
|
66
|
-
const ChangeText = ({ ch }: { ch: Change }) => (ch.text ? <div className="rel-text" dangerouslySetInnerHTML={{ __html: renderMd(ch.text) }} /> : null)
|
|
67
|
+
const ChangeText = ({ ch }: { ch: Change }) => (ch.text ? <div className="md mdflow rel-text" dangerouslySetInnerHTML={{ __html: renderMd(ch.text) }} /> : null)
|
|
67
68
|
|
|
68
69
|
const Bullets = ({ ch }: { ch: Change }) =>
|
|
69
70
|
ch.bullets.length > 0 ? (
|
|
@@ -105,7 +106,7 @@ const Cards = observer(({ rs, r }: { rs: ReleasesSt; r: Release }) => (
|
|
|
105
106
|
<>
|
|
106
107
|
{r.categories.map((c) => (
|
|
107
108
|
<div key={c.name} className="rel-category">
|
|
108
|
-
<
|
|
109
|
+
<SectionHead label={c.name} n={c.changes.length} />
|
|
109
110
|
<div className="rel-grid">
|
|
110
111
|
{c.changes.map((ch) => (
|
|
111
112
|
<ChangeCard key={`${ch.card ?? ''}${ch.title}`} rs={rs} ch={ch} />
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
.rel-page nav button.on{background:var(--accent);border-color:var(--accent);color:var(--panel)}
|
|
9
9
|
.rel-release h2{font-size:18px;margin:0}
|
|
10
10
|
.rel-category{display:grid;gap:var(--s3);margin-top:var(--s4)}
|
|
11
|
-
.rel-cat{font-size:13px;text-transform:uppercase;letter-spacing:.08em;color:var(--dim);margin:0}
|
|
12
11
|
.rel-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:var(--s3)}
|
|
13
12
|
.rel-card{background:var(--panel);border:1px solid var(--line);border-radius:10px;overflow:hidden;display:flex;flex-direction:column;min-width:0}
|
|
14
13
|
.rel-pic{background:var(--line);aspect-ratio:16/10;display:flex;align-items:center;justify-content:center;position:relative}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// syntax colours for a hunk of code in a thread, line by line: comments, strings, numbers, keywords, nothing else. No
|
|
2
|
+
// dependency: a hunk is a few lines he reads, not an editor. A language it does not know draws plain
|
|
3
|
+
export type Token = { s: string; c?: 'com' | 'str' | 'num' | 'kw' }
|
|
4
|
+
|
|
5
|
+
const C_LIKE = 'break case catch class const continue default do else enum export extends false finally for from function if import in instanceof interface let new null return static super switch this throw true try type typeof undefined var void while yield async await of as uniform varying attribute precision float int vec2 vec3 vec4 mat3 mat4 sampler2D bool in out struct'
|
|
6
|
+
const LANGS: Record<string, { kw: Set<string>; line?: RegExp }> = {
|
|
7
|
+
ts: { kw: new Set(C_LIKE.split(' ')), line: /\/\/.*$/ },
|
|
8
|
+
css: { kw: new Set('important media keyframes from to and not only screen'.split(' ')), line: /\/\*.*?\*\/|\/\*.*$/ },
|
|
9
|
+
json: { kw: new Set(['true', 'false', 'null']) },
|
|
10
|
+
py: { kw: new Set('and as assert break class continue def del elif else except False finally for from global if import in is lambda None nonlocal not or pass raise return True try while with yield async await'.split(' ')), line: /#.*$/ },
|
|
11
|
+
sh: { kw: new Set('if then else elif fi for in do done case esac while until function return export local'.split(' ')), line: /#.*$/ },
|
|
12
|
+
}
|
|
13
|
+
const ALIAS: Record<string, string> = { js: 'ts', tsx: 'ts', jsx: 'ts', javascript: 'ts', typescript: 'ts', glsl: 'ts', wgsl: 'ts', c: 'ts', cpp: 'ts', go: 'ts', rust: 'ts', rs: 'ts', java: 'ts', python: 'py', bash: 'sh', shell: 'sh', zsh: 'sh', scss: 'css', jsonc: 'json' }
|
|
14
|
+
|
|
15
|
+
const TOKEN_RE = /("(?:[^"\\]|\\.)*"?|'(?:[^'\\]|\\.)*'?|`(?:[^`\\]|\\.)*`?)|(\b\d[\d_.]*(?:e[+-]?\d+)?[a-z]*\b)|([A-Za-z_$@][\w$-]*)|(\s+|.)/gi
|
|
16
|
+
|
|
17
|
+
/** one line as tokens, each with its colour class */
|
|
18
|
+
export function codeTokens(line: string, lang?: string): Token[] {
|
|
19
|
+
const l = lang === undefined ? undefined : LANGS[ALIAS[lang.toLowerCase()] ?? lang.toLowerCase()]
|
|
20
|
+
if (!l) return [{ s: line }]
|
|
21
|
+
const com = l.line?.exec(line)
|
|
22
|
+
const code = com ? line.slice(0, com.index) : line
|
|
23
|
+
const out: Token[] = []
|
|
24
|
+
for (const m of code.matchAll(TOKEN_RE)) {
|
|
25
|
+
const [s, str, num, word] = m
|
|
26
|
+
out.push(str ? { s, c: 'str' } : num ? { s, c: 'num' } : word && l.kw.has(word) ? { s, c: 'kw' } : { s })
|
|
27
|
+
}
|
|
28
|
+
if (com) out.push({ s: com[0], c: 'com' })
|
|
29
|
+
return out
|
|
30
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// a change drawn by its kind (wiki tools/shipkit/threads.md, A proposed change): words as a word diff, a colour as its
|
|
2
|
+
// swatch beside the old one, code as a unified hunk in syntax colours; the kind's data view draws its text change here too
|
|
3
|
+
import { codeTokens } from './code-colors.ts'
|
|
4
|
+
|
|
5
|
+
/** a diff of two token lists: each token kept, gone or new */
|
|
6
|
+
export function diffSeq(a: readonly string[], b: readonly string[]): { t: ' ' | '-' | '+'; line: string }[] {
|
|
7
|
+
const n = a.length
|
|
8
|
+
const m = b.length
|
|
9
|
+
const lcs: number[][] = Array.from({ length: n + 1 }, () => new Array<number>(m + 1).fill(0))
|
|
10
|
+
for (let i = n - 1; i >= 0; i--) for (let j = m - 1; j >= 0; j--) lcs[i]![j] = a[i] === b[j] ? lcs[i + 1]![j + 1]! + 1 : Math.max(lcs[i + 1]![j]!, lcs[i]![j + 1]!)
|
|
11
|
+
const out: { t: ' ' | '-' | '+'; line: string }[] = []
|
|
12
|
+
let i = 0
|
|
13
|
+
let j = 0
|
|
14
|
+
while (i < n && j < m) {
|
|
15
|
+
if (a[i] === b[j]) out.push({ t: ' ', line: a[i++]! }), j++
|
|
16
|
+
else if (lcs[i + 1]![j]! >= lcs[i]![j + 1]!) out.push({ t: '-', line: a[i++]! })
|
|
17
|
+
else out.push({ t: '+', line: b[j++]! })
|
|
18
|
+
}
|
|
19
|
+
while (i < n) out.push({ t: '-', line: a[i++]! })
|
|
20
|
+
while (j < m) out.push({ t: '+', line: b[j++]! })
|
|
21
|
+
return out
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** a line diff of two texts: each line kept, gone or new */
|
|
25
|
+
export const diffLines = (before: string, after: string) => diffSeq(before.split('\n'), after.split('\n'))
|
|
26
|
+
|
|
27
|
+
/** a word diff of two texts, the spaces kept as tokens so each side reads as written */
|
|
28
|
+
export const diffWords = (before: string, after: string) => diffSeq(before.split(/(\s+)/), after.split(/(\s+)/))
|
|
29
|
+
|
|
30
|
+
const GONE = { background: 'color-mix(in srgb, var(--red, #e5484d) 18%, transparent)', textDecoration: 'line-through' }
|
|
31
|
+
const ADDED = { background: 'color-mix(in srgb, var(--green, #46a758) 20%, transparent)' }
|
|
32
|
+
|
|
33
|
+
/** one side of a word diff: what stayed and what that side alone has, marked */
|
|
34
|
+
export const WordSide = ({ before, after, side }: { before: string; after: string; side: '-' | '+' }) => (
|
|
35
|
+
<div className="rv-pre rv-parttext">
|
|
36
|
+
{diffWords(before, after)
|
|
37
|
+
.filter((d) => d.t === ' ' || d.t === side)
|
|
38
|
+
.map((d, i) => <span key={i} style={d.t === ' ' ? undefined : side === '-' ? GONE : ADDED}>{d.line}</span>)}
|
|
39
|
+
</div>
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
/** words: one text with what goes struck and what comes marked, read in one pass */
|
|
43
|
+
export const WordDiff = ({ before, after }: { before?: string; after: string }) =>
|
|
44
|
+
before === undefined ? (
|
|
45
|
+
<div className="rv-pre rv-parttext">{after}</div>
|
|
46
|
+
) : (
|
|
47
|
+
<div className="rv-pre rv-parttext rv-worddiff">
|
|
48
|
+
{diffWords(before, after).map((d, i) => <span key={i} style={d.t === ' ' ? undefined : d.t === '-' ? GONE : ADDED}>{d.line}</span>)}
|
|
49
|
+
</div>
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
/** a colour: the old swatch, an arrow, the new one, each with its value */
|
|
53
|
+
export const Swatches = ({ before, after }: { before?: string; after: string }) => (
|
|
54
|
+
<div className="rv-swatches">
|
|
55
|
+
{before !== undefined ? (
|
|
56
|
+
<>
|
|
57
|
+
<span className="rv-swatch" title={before}><i style={{ background: before }} />{before}</span>
|
|
58
|
+
<span className="rv-dim">→</span>
|
|
59
|
+
</>
|
|
60
|
+
) : null}
|
|
61
|
+
<span className="rv-swatch" title={after}><i style={{ background: after }} />{after}</span>
|
|
62
|
+
</div>
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
/** code: a unified hunk, each line its sign and its tokens in syntax colours (none for a language it does not know) */
|
|
66
|
+
export const CodeHunk = ({ before, after, lang }: { before?: string; after: string; lang?: string }) => (
|
|
67
|
+
<pre className="rv-hunk">
|
|
68
|
+
{(before === undefined ? after.split('\n').map((line) => ({ t: '+' as const, line })) : diffLines(before, after)).map((d, i) => (
|
|
69
|
+
<div key={i} className={`rv-hunkl ${d.t === '-' ? 'gone' : d.t === '+' ? 'new' : ''}`}>
|
|
70
|
+
<span className="rv-hunks">{d.t}</span>
|
|
71
|
+
{codeTokens(d.line, lang).map((k, j) => (k.c ? <span key={j} className={`rv-tk-${k.c}`}>{k.s}</span> : k.s))}
|
|
72
|
+
</div>
|
|
73
|
+
))}
|
|
74
|
+
</pre>
|
|
75
|
+
)
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
// the timeline and the dock (wiki tools/shipkit/threads-page.md, The dock): every item lives whole in the timeline, its
|
|
2
|
+
// words wrapped and its controls under them (a question's options with the agent's pick, an ask's instructions with
|
|
3
|
+
// their boxes, a checklist, a field, a secret, a verdict's buttons). The dock above his reply box holds no content and
|
|
4
|
+
// no control: a stack of one line reminders of what waits on him (its glyph, a short title, « jump ↑ »), each a click
|
|
5
|
+
// that scrolls the timeline to the item and lights it; the ask's bar sits on top
|
|
6
|
+
import { observer } from 'mobx-react-lite'
|
|
7
|
+
import type { ReactNode } from 'react'
|
|
8
|
+
import type { ReplyCell } from '../../../review/cells.ts'
|
|
9
|
+
import { CellGlyph } from './object-panel.tsx'
|
|
10
|
+
import { ageWords, stampWords } from '../time-ago.tsx'
|
|
11
|
+
import { keepFocus } from './kit.tsx'
|
|
12
|
+
import { AskBody, ProposeBody } from './question-views.tsx'
|
|
13
|
+
import { currentStep, InstructionsBody, stepLine } from './instructions-view.tsx'
|
|
14
|
+
import { renderMdInline } from '../md.ts'
|
|
15
|
+
import type { ReviewSt } from './review-st.ts'
|
|
16
|
+
import { answeredWords, dockDom, requestWord, type ThreadSt } from './thread-st.ts'
|
|
17
|
+
|
|
18
|
+
const firstLine = (t: string): string => t.split('\n').find((l) => l.trim() !== '')?.trim() ?? ''
|
|
19
|
+
|
|
20
|
+
/** where a checklist stands, on its reminder: « 2 of 5 » */
|
|
21
|
+
const progressOf = (c: ReplyCell): string | null => {
|
|
22
|
+
const lines = c.ask?.lines
|
|
23
|
+
return c.ask?.kind === 'checklist' && lines ? `${lines.filter((l) => l.tick).length} of ${lines.length}` : null
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** the question or the change itself, as it answers */
|
|
27
|
+
const RequestBody = observer(({ rv, card, c }: { rv: ReviewSt; card: ThreadSt; c: ReplyCell }) =>
|
|
28
|
+
c.ask ? <AskBody rv={rv} card={card} c={c} ask={c.ask} /> : c.propose ? <ProposeBody rv={rv} card={card} c={c} p={c.propose} /> : null,
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
/** `top`: the ask's own record while it is open (its proof url and « done »), above the reminders */
|
|
32
|
+
export const Dock = observer(({ rv, card, top }: { rv: ReviewSt; card: ThreadSt; top?: ReactNode }) => {
|
|
33
|
+
const asks = card.openRequests
|
|
34
|
+
const verdict = card.verdictAbove
|
|
35
|
+
if (asks.length === 0 && !top && !verdict) return null
|
|
36
|
+
return (
|
|
37
|
+
<section className="rv-dock" aria-label="what waits on your answer">
|
|
38
|
+
{top}
|
|
39
|
+
{asks.length > 0 || verdict ? (
|
|
40
|
+
<div className="rv-dockentries">
|
|
41
|
+
{asks.map((c) => (c.instructions && c.ask ? <StepsReminder key={c.id} rv={rv} card={card} c={c} /> : <Reminder key={c.id} rv={rv} card={card} c={c} />))}
|
|
42
|
+
{verdict ? (
|
|
43
|
+
<Line id={dockDom(verdict.id)} cls="rv-dockverdict" go={() => card.reveal(verdict.id)} kind="your verdict" title={`v${verdict.n} waits for your verdict${card.waitingViews ? ` · ${card.waitingViews.waiting} of ${card.waitingViews.of} views` : ''}`} />
|
|
44
|
+
) : null}
|
|
45
|
+
</div>
|
|
46
|
+
) : null}
|
|
47
|
+
</section>
|
|
48
|
+
)
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
/** one reminder: a click anywhere on it scrolls the timeline to its item and lights it */
|
|
52
|
+
const Line = ({ id, go, glyph, kind, title, count, when, cls = '' }: { id: string; go: () => void; glyph?: ReactNode; kind: string; title: string; count?: string | null; when?: ReactNode; cls?: string }) => (
|
|
53
|
+
<button id={id} className={`rv-dockentry rv-reminder ghost ${cls}`} title={`${title}: jump to it`} onMouseDown={keepFocus} onClick={go}>
|
|
54
|
+
{glyph}
|
|
55
|
+
<span className="rv-dockkind">{kind}</span>
|
|
56
|
+
<b className="rv-dockq mdi" dangerouslySetInnerHTML={{ __html: renderMdInline(title) }} />
|
|
57
|
+
{count ? <span className="rv-dockcount">{count}</span> : null}
|
|
58
|
+
{when}
|
|
59
|
+
<span className="rv-dockplace">jump ↑</span>
|
|
60
|
+
</button>
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
const When = observer(({ rv, at }: { rv: ReviewSt; at: string }) => {
|
|
64
|
+
const t = Date.parse(at)
|
|
65
|
+
return <time className="rv-when" dateTime={at} title={stampWords(t)}>{ageWords(t, rv.now)}</time>
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
/** an open question, change or item that waits for a verdict: its first line, a reminder */
|
|
69
|
+
const Reminder = observer(({ rv, card, c }: { rv: ReviewSt; card: ThreadSt; c: ReplyCell }) => (
|
|
70
|
+
<Line id={dockDom(c.id)} go={() => card.reveal(c.id)} glyph={<CellGlyph rv={rv} c={c} />} kind={requestWord(c)} title={firstLine(c.text) || requestWord(c)} count={progressOf(c)} when={<When rv={rv} at={c.at} />} />
|
|
71
|
+
))
|
|
72
|
+
|
|
73
|
+
/** an ask's instructions: « step 2 of 3: <title> », a click jumps to that step in the timeline */
|
|
74
|
+
const StepsReminder = observer(({ rv, card, c }: { rv: ReviewSt; card: ThreadSt; c: ReplyCell }) => {
|
|
75
|
+
const line = stepLine(card, c)
|
|
76
|
+
const at = currentStep(card, c)
|
|
77
|
+
return <Line id={dockDom(c.id)} go={() => (at === null ? card.reveal(c.id) : card.revealStep(c.id, at))} glyph={<CellGlyph rv={rv} c={c} />} kind={line.n} title={line.title} when={<When rv={rv} at={c.at} />} cls="rv-docksteps" />
|
|
78
|
+
})
|
|
79
|
+
|
|
80
|
+
/** a question or a change at its place in the timeline, where he answers it: whole, its words wrapped and its controls
|
|
81
|
+
* under them; an ask's instructions with a box on each step; once answered, his answer said over it. Superseded: read
|
|
82
|
+
* only. Its words go read by sight, as every cell's (review-thread.tsx), never from its reminder in the dock */
|
|
83
|
+
export const RequestCell = observer(({ rv, card, c }: { rv: ReviewSt; card: ThreadSt; c: ReplyCell }) => {
|
|
84
|
+
if (c.instructions && c.ask) return <InstructionsBody rv={rv} card={card} c={c} live={!c.superseded} />
|
|
85
|
+
const waiting = card.waitsNow(c.id)
|
|
86
|
+
return (
|
|
87
|
+
<div className={`rv-requestcell${c.superseded ? ' superseded' : waiting ? ' waiting' : ' answered'}`}>
|
|
88
|
+
{!c.superseded && !waiting ? (
|
|
89
|
+
// asked before his close and never answered: it waits on nobody (review/threads.ts closedAt)
|
|
90
|
+
<div className="rv-requestline">
|
|
91
|
+
<span className="rv-requestanswer">{c.moot ? 'closed, not answered' : `answered: ${answeredWords(c)}`}</span>
|
|
92
|
+
</div>
|
|
93
|
+
) : null}
|
|
94
|
+
{c.text.trim() !== '' ? <div className="rv-pre rv-words">{c.text}</div> : null}
|
|
95
|
+
{c.superseded ? (
|
|
96
|
+
<fieldset disabled className="rv-readonly">
|
|
97
|
+
<RequestBody rv={rv} card={card} c={c} />
|
|
98
|
+
</fieldset>
|
|
99
|
+
) : (
|
|
100
|
+
<RequestBody rv={rv} card={card} c={c} />
|
|
101
|
+
)}
|
|
102
|
+
</div>
|
|
103
|
+
)
|
|
104
|
+
})
|
|
@@ -36,7 +36,7 @@ export const DraftCardBody = observer(({ ver, item }: { ver: Ver; item: DraftIte
|
|
|
36
36
|
return (
|
|
37
37
|
<div className="dc-card past" id={viewDom(item.id, 0)}>
|
|
38
38
|
<span className="dc-name">📝 {pinned.slug}</span>
|
|
39
|
-
<span className="rv-dim">an older version of this
|
|
39
|
+
<span className="rv-dim">an older version of this thread: the draft is read live, so its words now are on the newest version</span>
|
|
40
40
|
</div>
|
|
41
41
|
)
|
|
42
42
|
const d = so.draftOf(pinned.slug)
|
|
@@ -86,7 +86,7 @@ const PlaceBlock = observer(({ ver, so, post, change }: { ver: Ver; so: SocialSt
|
|
|
86
86
|
<section id={postDom(cell.id, post.key)} className={`dc-place so-post${toneClass(shown?.status)}`} aria-label={postLabel(cell.item.draft, post.key)}>
|
|
87
87
|
<header className="dc-placehead so-posthead">
|
|
88
88
|
<PostName so={so} a={a} post={post} />
|
|
89
|
-
{moved ? <span className="dc-moved">{moved === 'new' ? 'new since this
|
|
89
|
+
{moved ? <span className="dc-moved">{moved === 'new' ? 'new since this version' : 'changed since this version'}</span> : null}
|
|
90
90
|
<Length so={so} a={a} post={post} />
|
|
91
91
|
</header>
|
|
92
92
|
<PostFields so={so} a={a} post={post} place={place} head read />
|