rvlib-shipkit 2.26.0 → 2.27.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 +20 -0
- package/package.json +1 -1
- package/src/agent-time/diet.ts +77 -0
- package/src/agent-time/family.ts +72 -0
- package/src/agent-time/hooks.ts +6 -4
- package/src/agent-time/limits.ts +44 -0
- package/src/agent-time/live.ts +1 -3
- package/src/agent-time/mask.ts +96 -18
- package/src/agent-time/refused.ts +45 -0
- package/src/agent-time/render.ts +122 -21
- package/src/agent-time/report-cache.ts +57 -0
- package/src/agent-time/report.ts +314 -40
- package/src/agent-time/shape.ts +50 -3
- package/src/agent-time/store.ts +320 -99
- package/src/agent-time/timeline.ts +140 -21
- package/src/agent-time/turns.ts +18 -8
- package/src/annex/offload.ts +17 -6
- package/src/annex/tidy.ts +70 -10
- package/src/asks/ask-after.ts +40 -0
- package/src/asks/asks-queue.ts +205 -47
- package/src/assets/kit-config.ts +7 -3
- package/src/assets/kits/identity-kit.ts +289 -10
- package/src/check.ts +3 -1
- package/src/checks/SK004-gitignore-policy.check.ts +12 -5
- package/src/checks/SK013-one-way-in-policy.check.ts +8 -3
- package/src/checks/SK026-asks-autoclose.check.ts +5 -5
- package/src/checks/SK028-readme.check.ts +7 -66
- package/src/checks/SK030-cache-audit.check.ts +6 -1
- package/src/checks/SK031-trace-audit.check.ts +2 -0
- package/src/checks/SK033-global-contribution.check.ts +3 -1
- package/src/checks/SK035-public-clean.check.ts +2 -2
- package/src/checks/SK043-scratch-on-the-mac.check.ts +59 -4
- package/src/checks/SK047-login-in-description.check.ts +36 -0
- package/src/checks/SK048-one-local-file.check.ts +36 -0
- package/src/cli/cmd_Asks.ts +71 -5
- package/src/cli/cmd_Backup.ts +2 -2
- package/src/cli/cmd_Capacity.ts +2 -2
- package/src/cli/cmd_CrossRepoActivity.ts +5 -4
- package/src/cli/cmd_Db.ts +253 -0
- package/src/cli/cmd_History.ts +212 -0
- package/src/cli/cmd_Home.ts +31 -3
- package/src/cli/cmd_Hq.ts +516 -0
- package/src/cli/cmd_Machines.ts +36 -0
- package/src/cli/cmd_Media.ts +38 -6
- package/src/cli/cmd_Reflect.ts +23 -2
- package/src/cli/cmd_Review.ts +548 -116
- package/src/cli/cmd_Secret.ts +62 -12
- package/src/cli/cmd_Social.ts +83 -1
- package/src/cli/cmd_Space.ts +324 -0
- package/src/cli/cmd_Time.ts +76 -5
- package/src/cli/cmd_Tmp.ts +28 -4
- package/src/cli/cmd_Trailer.ts +14 -10
- package/src/cli/cmd_Urls.ts +56 -0
- package/src/cli/cmd_Vault.ts +583 -0
- package/src/cli/family-help.ts +4 -2
- package/src/cli/family-pages.ts +1 -1
- package/src/cli/registry.ts +24 -3
- package/src/collections/actions.ts +63 -13
- package/src/collections/collection-types.ts +23 -1
- package/src/collections/providers.ts +117 -23
- package/src/collections/review.ts +4 -4
- package/src/contracts/contract-manifests.ts +6 -5
- package/src/contracts/contract-types.ts +6 -4
- package/src/contracts/contracts-engine.ts +11 -0
- package/src/contracts/manifests/chrome-web-store.contract.ts +31 -0
- package/src/core/budget.ts +12 -17
- package/src/core/capacity.ts +27 -18
- package/src/core/check-runner.ts +7 -4
- package/src/core/layout.ts +3 -0
- package/src/core/machine-busy.ts +127 -0
- package/src/core/machine-commit.ts +6 -1
- package/src/core/machine-db.ts +368 -20
- package/src/core/machine-layout.ts +137 -0
- package/src/core/machine-read.ts +81 -0
- package/src/core/migrate-layout.ts +1 -1
- package/src/core/one-way-in-policy.ts +64 -7
- package/src/core/polling-policy.ts +27 -0
- package/src/core/retention.ts +16 -2
- package/src/core/scope.ts +107 -14
- package/src/core/slots.ts +5 -4
- package/src/drill/clean.ts +25 -1
- package/src/drill/run.ts +1 -1
- package/src/drill/seal.ts +27 -4
- package/src/home/activity-shape.ts +2 -0
- package/src/home/activity.ts +66 -3
- package/src/home/app-sign.ts +15 -4
- package/src/home/daemon-jobs.ts +149 -7
- package/src/home/database-projects.ts +111 -0
- package/src/home/database-words.ts +203 -0
- package/src/home/databases.ts +460 -0
- package/src/home/global-units.ts +6 -0
- package/src/home/gui-app/ShipkitGui.swift +122 -1
- package/src/home/gui-app.ts +6 -3
- package/src/home/home-move.ts +514 -0
- package/src/home/home-paths.ts +12 -3
- package/src/home/home-routes.ts +68 -0
- package/src/home/inbox-shape.ts +24 -14
- package/src/home/machine-fold.ts +820 -0
- package/src/home/machine-host.ts +20 -5
- package/src/home/machine-repair.ts +503 -0
- package/src/home/machine-stores.ts +66 -15
- package/src/home/machine-temp.ts +547 -86
- package/src/home/resume.ts +79 -0
- package/src/home/run-daemon.ts +25 -4
- package/src/home/run-pm.ts +18 -5
- package/src/home/serve-daemon.ts +18 -3
- package/src/home/serve-web.ts +175 -7
- package/src/home/space-job.ts +115 -0
- package/src/home/space-page.ts +257 -0
- package/src/home/space-route.ts +167 -0
- package/src/home/space-words.ts +103 -0
- package/src/home/time-page-shape.ts +202 -0
- package/src/home/time-page.ts +64 -0
- package/src/home/vault-page.ts +482 -0
- package/src/home/vault-words.ts +132 -0
- package/src/hooks/leak-guard.ts +40 -13
- package/src/hooks/one-way-in-guard.ts +17 -4
- package/src/hq/cards.ts +581 -0
- package/src/hq/door-route.ts +43 -0
- package/src/hq/door.ts +163 -0
- package/src/hq/files-send.ts +348 -0
- package/src/hq/forgotten-log.ts +35 -0
- package/src/hq/history-check.ts +255 -0
- package/src/hq/history-place.ts +146 -0
- package/src/hq/history-send.ts +487 -0
- package/src/hq/hq-db.ts +99 -0
- package/src/hq/hq-local.ts +469 -0
- package/src/hq/hq-routes.ts +196 -0
- package/src/hq/hq-store.ts +599 -0
- package/src/hq/kinds/ask.ts +147 -0
- package/src/hq/kinds/card-gone.ts +83 -0
- package/src/hq/kinds/card-msg.ts +66 -0
- package/src/hq/kinds/card.ts +99 -0
- package/src/hq/kinds/index.ts +21 -0
- package/src/hq/kinds/kind.ts +126 -0
- package/src/hq/kinds/media.ts +125 -0
- package/src/hq/kinds/prompt.ts +219 -0
- package/src/hq/kinds/reflection.ts +128 -0
- package/src/hq/kinds/report.ts +55 -0
- package/src/hq/kinds/time-day.ts +236 -0
- package/src/hq/ledger.ts +473 -0
- package/src/hq/machine-key.ts +44 -0
- package/src/hq/machine-notes.ts +131 -0
- package/src/hq/outbox.ts +372 -0
- package/src/hq/replica.ts +168 -0
- package/src/hq/repo-id.ts +4 -0
- package/src/hq/report-facts.ts +117 -0
- package/src/hq/report.ts +274 -0
- package/src/hq/switch.ts +151 -0
- package/src/hq/vault-grant.ts +92 -0
- package/src/identities/identities.ts +15 -3
- package/src/identities/steps.ts +31 -0
- package/src/ledger/db.ts +73 -26
- package/src/ledger/gate-checks.ts +6 -2
- package/src/ledger/run-log.ts +11 -3
- package/src/ledger/store.ts +26 -4
- package/src/media-store/backup/daemon.ts +25 -17
- package/src/media-store/backup/kept.ts +241 -0
- package/src/media-store/backup/restore.ts +14 -4
- package/src/media-store/backup/run.ts +11 -11
- package/src/media-store/backup/secret.ts +6 -4
- package/src/media-store/backup/snapshot.ts +4 -2
- package/src/media-store/backup/sources.ts +67 -16
- package/src/media-store/copy/config.ts +77 -0
- package/src/media-store/copy/copy.ts +194 -0
- package/src/media-store/copy/lifecycle.ts +43 -0
- package/src/media-store/copy/night.ts +90 -0
- package/src/media-store/copy/proof.ts +151 -0
- package/src/media-store/copy/snapshot.ts +152 -0
- package/src/media-store/copy/store.ts +62 -0
- package/src/media-store/copy/stream.ts +176 -0
- package/src/media-store/daemon.ts +66 -16
- package/src/media-store/db.ts +22 -11
- package/src/media-store/forget.ts +23 -3
- package/src/media-store/hand.ts +4 -3
- package/src/media-store/hq-find.ts +75 -0
- package/src/media-store/hq-send.ts +277 -0
- package/src/media-store/kind.ts +2 -0
- package/src/media-store/purge.ts +18 -15
- package/src/media-store/put.ts +24 -8
- package/src/media-store/remote.ts +16 -7
- package/src/media-store/space-listing.ts +240 -0
- package/src/media-store/space.ts +40 -21
- package/src/media-store/sync.ts +5 -5
- package/src/media-store/tidy.ts +98 -0
- package/src/media-store/upload.ts +3 -3
- package/src/media-store/webp.ts +66 -0
- package/src/messages/model.ts +16 -7
- package/src/messages/routes.ts +14 -4
- package/src/messages/score.ts +2 -2
- package/src/messages/suggest.ts +96 -0
- package/src/pages/frame-client.ts +10 -0
- package/src/plan/planner.ts +28 -17
- package/src/recordings/media-kind.ts +1 -0
- package/src/recordings/model.ts +1 -1
- package/src/recordings/recorder-app/Capture.swift +9 -7
- package/src/reflect/hq-corpus.ts +56 -0
- package/src/reflect/prompt-corpus.ts +3 -1
- package/src/reflect/transcript.ts +129 -37
- package/src/release/machine-words.ts +67 -0
- package/src/release/public-clean.ts +8 -3
- package/src/releases/from-card.ts +1 -1
- package/src/releases/routes.ts +10 -5
- package/src/releases/store.ts +10 -1
- package/src/repo-config.ts +32 -2
- package/src/review/anim.ts +2 -2
- package/src/review/auto.ts +2 -2
- package/src/review/card-db.ts +244 -0
- package/src/review/card-rows.ts +266 -0
- package/src/review/cells.ts +76 -5
- package/src/review/draft-card.ts +41 -0
- package/src/review/draft-model.ts +78 -0
- package/src/review/format.ts +29 -10
- package/src/review/gone.ts +98 -0
- package/src/review/inbox-hook.ts +4 -4
- package/src/review/marks.ts +1 -1
- package/src/review/media-kind.ts +7 -5
- package/src/review/media-read.ts +9 -7
- package/src/review/media.ts +32 -5
- package/src/review/model.ts +202 -39
- package/src/review/move.ts +491 -0
- package/src/review/notes.ts +12 -20
- package/src/review/previews.ts +15 -19
- package/src/review/project.ts +1 -1
- package/src/review/rev.ts +8 -0
- package/src/review/role.ts +1 -1
- package/src/review/routes.ts +64 -13
- package/src/review/stage-card.ts +8 -4
- package/src/review/stage-routes.ts +1 -1
- package/src/review/store.ts +529 -83
- package/src/review/thread-fold.ts +51 -0
- package/src/review/threads.ts +147 -9
- package/src/review/trailer-auto-mock.ts +63 -0
- package/src/review/trailer-card.ts +4 -4
- package/src/review/trailer-desk.ts +41 -7
- package/src/review/trailer-media.ts +1 -0
- package/src/review/trailer-model.ts +8 -0
- package/src/review/trailer-notes.ts +1 -1
- package/src/review/trailer-routes.ts +9 -1
- package/src/review/unit.ts +6 -6
- package/src/review/watchers.ts +1 -1
- package/src/rules/untrack-generated.ts +92 -8
- package/src/secrets/held.ts +16 -0
- package/src/secrets/keychain.ts +113 -0
- package/src/secrets/list.ts +16 -6
- package/src/secrets/manager.ts +24 -10
- package/src/secrets/read.ts +257 -0
- package/src/secrets/who-reads.ts +49 -0
- package/src/serve/door-forward.ts +268 -0
- package/src/serve/door-names.ts +47 -0
- package/src/serve/embed.ts +1 -1
- package/src/serve/hub-app/activity-view.tsx +56 -32
- package/src/serve/hub-app/activity.css +7 -1
- package/src/serve/hub-app/asks-page.tsx +48 -0
- package/src/serve/hub-app/asks-st.ts +25 -0
- package/src/serve/hub-app/clock-svc.ts +1 -2
- package/src/serve/hub-app/col-card.tsx +64 -13
- package/src/serve/hub-app/col-list-page.tsx +122 -0
- package/src/serve/hub-app/col-list-st.ts +103 -0
- package/src/serve/hub-app/col-tables-view.tsx +10 -41
- package/src/serve/hub-app/col-tables.ts +76 -8
- package/src/serve/hub-app/cols-svc.ts +70 -16
- package/src/serve/hub-app/database-st.ts +260 -0
- package/src/serve/hub-app/database-view.tsx +289 -0
- package/src/serve/hub-app/database.css +32 -0
- package/src/serve/hub-app/entry-bar.css +14 -0
- package/src/serve/hub-app/entry-bar.tsx +33 -0
- package/src/serve/hub-app/entry-pick.ts +31 -0
- package/src/serve/hub-app/floating.tsx +1 -0
- package/src/serve/hub-app/hash-route.ts +11 -1
- package/src/serve/hub-app/header-bar.tsx +14 -18
- package/src/serve/hub-app/home-st.ts +89 -9
- package/src/serve/hub-app/home-strip.css +5 -19
- package/src/serve/hub-app/home-strip.tsx +58 -92
- package/src/serve/hub-app/home.html +7 -0
- package/src/serve/hub-app/hub-app.tsx +31 -142
- package/src/serve/hub-app/hub-types.ts +3 -1
- package/src/serve/hub-app/hub.css +109 -23
- package/src/serve/hub-app/icons.tsx +18 -1
- package/src/serve/hub-app/identities-st.ts +56 -6
- package/src/serve/hub-app/identities-view.tsx +100 -58
- package/src/serve/hub-app/identities.css +17 -15
- package/src/serve/hub-app/identity-address.ts +5 -0
- package/src/serve/hub-app/inbox-st.ts +41 -24
- package/src/serve/hub-app/inbox-view.tsx +37 -41
- package/src/serve/hub-app/inbox.css +2 -5
- package/src/serve/hub-app/index.html +7 -0
- package/src/serve/hub-app/kept-cols.tsx +7 -0
- package/src/serve/hub-app/keys.ts +28 -15
- package/src/serve/hub-app/later.tsx +26 -0
- package/src/serve/hub-app/list-filter.tsx +14 -0
- package/src/serve/hub-app/list-walk.ts +72 -3
- package/src/serve/hub-app/machines-st.ts +251 -0
- package/src/serve/hub-app/machines-view.tsx +224 -0
- package/src/serve/hub-app/machines.css +76 -0
- package/src/serve/hub-app/md-copy.tsx +79 -0
- package/src/serve/hub-app/media-view.tsx +2 -0
- package/src/serve/hub-app/messages/messages-page.tsx +79 -7
- package/src/serve/hub-app/messages/messages-st.ts +99 -3
- package/src/serve/hub-app/messages.css +14 -0
- package/src/serve/hub-app/page-keys.ts +175 -0
- package/src/serve/hub-app/pages-frames.tsx +11 -3
- package/src/serve/hub-app/palette-st.ts +58 -11
- package/src/serve/hub-app/palette-view.tsx +3 -1
- package/src/serve/hub-app/project-list.css +54 -8
- package/src/serve/hub-app/project-list.tsx +128 -59
- package/src/serve/hub-app/projects-svc.ts +78 -7
- package/src/serve/hub-app/reader-chips.tsx +13 -0
- package/src/serve/hub-app/readme-view.tsx +2 -3
- package/src/serve/hub-app/readme.css +27 -5
- package/src/serve/hub-app/reflections-page.tsx +42 -0
- package/src/serve/hub-app/reflections-st.ts +17 -0
- package/src/serve/hub-app/releases/releases-page.tsx +25 -2
- package/src/serve/hub-app/releases/releases-st.ts +1 -1
- package/src/serve/hub-app/repo-sections.ts +9 -5
- package/src/serve/hub-app/repo-st.ts +35 -8
- package/src/serve/hub-app/review/draft-card.tsx +163 -0
- package/src/serve/hub-app/review/kit.tsx +50 -7
- package/src/serve/hub-app/review/note-place.ts +1 -1
- package/src/serve/hub-app/review/review-board.tsx +2 -2
- package/src/serve/hub-app/review/review-cells.tsx +145 -65
- package/src/serve/hub-app/review/review-kit.ts +27 -1
- package/src/serve/hub-app/review/review-list.tsx +68 -30
- package/src/serve/hub-app/review/review-page.tsx +7 -8
- package/src/serve/hub-app/review/review-st.ts +111 -24
- package/src/serve/hub-app/review/review-thread.tsx +49 -19
- package/src/serve/hub-app/review/review-views.tsx +475 -144
- package/src/serve/hub-app/review/thread-control-st.ts +115 -0
- package/src/serve/hub-app/review/thread-control.tsx +74 -0
- package/src/serve/hub-app/review/thread-st.ts +73 -26
- package/src/serve/hub-app/review/trailer-card.tsx +1 -1
- package/src/serve/hub-app/review/trailer-page.tsx +37 -16
- package/src/serve/hub-app/review/trailer-st.ts +41 -7
- package/src/serve/hub-app/review.css +267 -61
- package/src/serve/hub-app/side-lists.ts +72 -0
- package/src/serve/hub-app/sidebar.tsx +6 -3
- package/src/serve/hub-app/site/site-part.tsx +2 -8
- package/src/serve/hub-app/site/site-st.ts +4 -4
- package/src/serve/hub-app/social/comms-page.tsx +20 -5
- package/src/serve/hub-app/social/kit.tsx +30 -4
- package/src/serve/hub-app/social/post-card.tsx +139 -49
- package/src/serve/hub-app/social/serial-writes.ts +13 -0
- package/src/serve/hub-app/social/social-model.ts +11 -0
- package/src/serve/hub-app/social/social-page.tsx +94 -35
- package/src/serve/hub-app/social/social-st.ts +120 -36
- package/src/serve/hub-app/social/stage-popup.tsx +1 -1
- package/src/serve/hub-app/social/stage-st.ts +1 -1
- package/src/serve/hub-app/social/step-layout.ts +1 -1
- package/src/serve/hub-app/social.css +3 -0
- package/src/serve/hub-app/space-st.ts +209 -0
- package/src/serve/hub-app/space-view.tsx +196 -0
- package/src/serve/hub-app/space.css +27 -0
- package/src/serve/hub-app/stores/stores-page.tsx +91 -23
- package/src/serve/hub-app/stores/stores-st.ts +44 -19
- package/src/serve/hub-app/stores.css +6 -1
- package/src/serve/hub-app/theme-st.ts +22 -9
- package/src/serve/hub-app/time-charts.tsx +291 -0
- package/src/serve/hub-app/time-pages.tsx +749 -0
- package/src/serve/hub-app/time-st.ts +162 -0
- package/src/serve/hub-app/time-view.tsx +76 -0
- package/src/serve/hub-app/time.css +138 -0
- package/src/serve/hub-app/tree-build.ts +52 -42
- package/src/serve/hub-app/tree-row.tsx +4 -4
- package/src/serve/hub-app/tree-svc.ts +18 -9
- package/src/serve/hub-app/urls-svc.ts +154 -0
- package/src/serve/hub-app/urls-view.tsx +117 -0
- package/src/serve/hub-app/urls.css +30 -0
- package/src/serve/hub-app/vault-st.ts +127 -0
- package/src/serve/hub-app/vault-view.tsx +154 -0
- package/src/serve/hub-app/vault.css +38 -0
- package/src/serve/hub-app/veille/veille-st.ts +12 -10
- package/src/serve/hub-app/waiting-svc.ts +29 -0
- package/src/serve/hub-app/wikis-view.tsx +2 -2
- package/src/serve/hub-runtime.ts +15 -2
- package/src/serve/project-gutter-route.ts +27 -14
- package/src/serve/project-gutter.ts +25 -12
- package/src/serve/same-origin.ts +10 -0
- package/src/serve/serve-hub.ts +13 -4
- package/src/shipkit-files.ts +16 -2
- package/src/shipkit.ts +1 -1
- package/src/shot/shooter.ts +616 -420
- package/src/shot/shot-ask.ts +246 -155
- package/src/site/desk.ts +2 -2
- package/src/smoke/run-smoke.ts +3 -2
- package/src/social/cover.ts +202 -0
- package/src/social/discord-layout.ts +37 -13
- package/src/social/drafts.ts +3 -0
- package/src/social/load.ts +23 -2
- package/src/social/media-kind.ts +2 -1
- package/src/social/publish/discord.ts +5 -2
- package/src/social/publish/secret.ts +2 -2
- package/src/social/release-stage.ts +28 -13
- package/src/social/routes.ts +26 -1
- package/src/social/stage.ts +1 -1
- package/src/social/stats.ts +12 -9
- package/src/social/strip.ts +4 -1
- package/src/social/thumbnail.ts +255 -0
- package/src/stores/collection.ts +15 -11
- package/src/stores/desk.ts +236 -42
- package/src/stores/model.ts +72 -6
- package/src/stores/routes.ts +37 -12
- package/src/stores/unit.ts +14 -8
- package/src/suite/judge-suites.ts +41 -11
- package/src/suite/select.ts +45 -3
- package/src/suite/suite-cli.ts +16 -10
- package/src/trailer/bed.ts +1 -1
- package/src/trailer/build.ts +134 -21
- package/src/trailer/ffmpeg.ts +7 -0
- package/src/trailer/fonts.ts +3 -2
- package/src/trailer/grammar.ts +201 -2
- package/src/trailer/graph.ts +42 -5
- package/src/trailer/look.ts +21 -0
- package/src/trailer/mock.ts +154 -0
- package/src/trailer/passage.ts +65 -26
- package/src/trailer/score/heard.ts +89 -0
- package/src/trailer/score/sound.ts +14 -8
- package/src/trailer/sound/run.ts +16 -6
- package/src/trailer/stitch.ts +26 -5
- package/src/trailer/titles.ts +82 -19
- package/src/trailer/versions.ts +1 -3
- package/src/trailer/vertical.ts +3 -1
- package/src/urls/frame.ts +195 -0
- package/src/urls/routes.ts +43 -0
- package/src/urls/rows.ts +171 -0
- package/src/urls/unit.ts +73 -0
- package/src/vault/house-keys.ts +42 -0
- package/src/vault/layout.ts +50 -0
- package/src/vault/policy.ts +165 -0
- package/src/vault/vault-audit.ts +276 -0
- package/src/vault/vault-client.ts +40 -0
- package/src/vault/vault-config.ts +159 -0
- package/src/vault/vault-destroy.ts +78 -0
- package/src/vault/vault-handover.ts +305 -0
- package/src/vault/vault-http.ts +352 -0
- package/src/vault/vault-import.ts +208 -0
- package/src/vault/vault-init.ts +328 -0
- package/src/vault/vault-minter.ts +271 -0
- package/src/vault/vault-restore.ts +333 -0
- package/src/vault/vault-serve.ts +342 -0
- package/src/vault/vault-snapshot.ts +281 -0
- package/src/veille/asks.ts +1 -1
- package/src/veille/desk.ts +2 -2
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
// its accounts, setup and messages come from. The desk is a repo's Social desk read again: its identities are the
|
|
4
4
|
// machine's whatever the repo, its drafts that repo's, so an identity reads the desk of the repo that speaks as it
|
|
5
5
|
// with the most drafts
|
|
6
|
-
import { makeAutoObservable, observableRef, runInAction } from 'mobx'
|
|
6
|
+
import { computed, makeAutoObservable, observableRef, runInAction, type IComputedValue } from 'mobx'
|
|
7
7
|
import type { DataPlace, IdentitiesAnswer, MachineIdentity } from '../../identities/machine-route.ts'
|
|
8
8
|
import type { HomeSt } from './home-st.ts'
|
|
9
|
-
import { identityRows, isSection, type IdentityRow, type IdentitySel } from './identity-address.ts'
|
|
10
|
-
import { walkKey, WalkEntry, type WalkHost } from './list-walk.ts'
|
|
9
|
+
import { ACCOUNT_TABS, identityRows, isAccountTab, isSection, type AccountTab, type IdentityRow, type IdentitySel } from './identity-address.ts'
|
|
10
|
+
import { sideOf, walkKey, WalkEntry, type SideList, type WalkHost } from './list-walk.ts'
|
|
11
11
|
import { ownTrouble, reach } from './reach.ts'
|
|
12
|
-
import { LEGAL } from './social/social-model.ts'
|
|
12
|
+
import { LEGAL, type DeskAccount } from './social/social-model.ts'
|
|
13
13
|
import { SocialSt } from './social/social-st.ts'
|
|
14
14
|
|
|
15
15
|
export class IdentitiesSt implements WalkHost<IdentityRow> {
|
|
@@ -18,6 +18,8 @@ export class IdentitiesSt implements WalkHost<IdentityRow> {
|
|
|
18
18
|
loading = false
|
|
19
19
|
/** what the address picked */
|
|
20
20
|
sel: IdentitySel = { id: null, part: null, place: null }
|
|
21
|
+
/** the account section picked last: a step to the next account keeps it (identities-view.tsx tabOf) */
|
|
22
|
+
lastTab: AccountTab | null = null
|
|
21
23
|
/** what the last open said, or why it failed */
|
|
22
24
|
note = ''
|
|
23
25
|
/** the desk the shown identity reads (applyDesk) */
|
|
@@ -32,9 +34,11 @@ export class IdentitiesSt implements WalkHost<IdentityRow> {
|
|
|
32
34
|
cursor: string | null = null
|
|
33
35
|
/** a walk with the arrows is one history entry (HomeSt.show asks it) */
|
|
34
36
|
readonly entry = new WalkEntry()
|
|
37
|
+
/** each row's own « lit », so a step draws again the two rows it moves between, never the whole list */
|
|
38
|
+
private litOf = new Map<string, IComputedValue<boolean>>()
|
|
35
39
|
|
|
36
40
|
constructor(private readonly st: HomeSt) {
|
|
37
|
-
makeAutoObservable<this, 'st' | 'gen' | 'desks'>(this, { st: false, gen: false, desks: false, entry: false, searchEl: false, data: observableRef, desk: observableRef })
|
|
41
|
+
makeAutoObservable<this, 'st' | 'gen' | 'desks' | 'litOf'>(this, { st: false, gen: false, desks: false, litOf: false, entry: false, searchEl: false, data: observableRef, desk: observableRef })
|
|
38
42
|
}
|
|
39
43
|
|
|
40
44
|
start(): void {
|
|
@@ -48,6 +52,7 @@ export class IdentitiesSt implements WalkHost<IdentityRow> {
|
|
|
48
52
|
|
|
49
53
|
select(sel: IdentitySel): void {
|
|
50
54
|
this.sel = sel
|
|
55
|
+
if (isAccountTab(sel.place)) this.lastTab = sel.place
|
|
51
56
|
this.cursor = null
|
|
52
57
|
this.applyDesk()
|
|
53
58
|
}
|
|
@@ -76,6 +81,16 @@ export class IdentitiesSt implements WalkHost<IdentityRow> {
|
|
|
76
81
|
return this.cursor ?? rows[this.home(rows)]?.key ?? null
|
|
77
82
|
}
|
|
78
83
|
|
|
84
|
+
/** whether a row is lit, read by that row alone */
|
|
85
|
+
isLit(key: string): boolean {
|
|
86
|
+
let c = this.litOf.get(key)
|
|
87
|
+
if (c == null) {
|
|
88
|
+
c = computed(() => this.lit === key)
|
|
89
|
+
this.litOf.set(key, c)
|
|
90
|
+
}
|
|
91
|
+
return c.get()
|
|
92
|
+
}
|
|
93
|
+
|
|
79
94
|
inert(): boolean {
|
|
80
95
|
return false
|
|
81
96
|
}
|
|
@@ -114,6 +129,40 @@ export class IdentitiesSt implements WalkHost<IdentityRow> {
|
|
|
114
129
|
return this.shown?.id ?? this.sel.id
|
|
115
130
|
}
|
|
116
131
|
|
|
132
|
+
/** the account the address shows, as the desk reads it; null on the profile, a section, or before the desk answers */
|
|
133
|
+
get shownAccount(): DeskAccount | null {
|
|
134
|
+
const part = this.sel.part
|
|
135
|
+
const id = this.shownId
|
|
136
|
+
if (part == null || isSection(part) || id == null) return null
|
|
137
|
+
return this.desk?.identityOf(id)?.accounts.find((x) => x.id === part) ?? null
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/** the sections an account has, in the order its list draws them and the arrows walk them */
|
|
141
|
+
accountTabs(a: DeskAccount): AccountTab[] {
|
|
142
|
+
return ACCOUNT_TABS.filter((t) => (t === '@setup' ? a.steps.length > 0 : t === '@places' ? a.places.length > 0 : true))
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/** the section an account page shows: the one the address names, a place's own page under Places, else the section
|
|
146
|
+
* picked last while this account has it (a walk over the accounts stays on Messages), else the setup while a step
|
|
147
|
+
* is left, the profile once it is done */
|
|
148
|
+
tabOf(a: DeskAccount): AccountTab {
|
|
149
|
+
const place = this.sel.place
|
|
150
|
+
if (isAccountTab(place)) return place
|
|
151
|
+
if (place != null) return '@places'
|
|
152
|
+
if (this.lastTab != null && this.accountTabs(a).includes(this.lastTab)) return this.lastTab
|
|
153
|
+
return a.steps.some((x) => !x.done) ? '@setup' : '@profile'
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/** the page's C list on an account: its sections, ↑ ↓ step them (hub.md, Keys) */
|
|
157
|
+
get tabSide(): SideList | null {
|
|
158
|
+
if (this.shownAccount == null) return null
|
|
159
|
+
return sideOf({
|
|
160
|
+
ids: () => (this.shownAccount == null ? [] : this.accountTabs(this.shownAccount)),
|
|
161
|
+
current: () => (this.shownAccount == null ? null : this.tabOf(this.shownAccount)),
|
|
162
|
+
open: (tab) => this.entry.run(() => this.st.openIdentity({ id: this.shownId, part: this.sel.part, place: tab })),
|
|
163
|
+
})
|
|
164
|
+
}
|
|
165
|
+
|
|
117
166
|
/** the repo whose desk the identity reads: the one speaking as it with the most drafts, else the first speaking as
|
|
118
167
|
* it, else the first repo of the list (an identity no repo speaks as has no drafts, its accounts are the same) */
|
|
119
168
|
deskRepo(i: MachineIdentity): string | null {
|
|
@@ -153,7 +202,8 @@ export class IdentitiesSt implements WalkHost<IdentityRow> {
|
|
|
153
202
|
const part = this.sel.part
|
|
154
203
|
if (part === LEGAL) d.selectSocial(i.id, LEGAL, null)
|
|
155
204
|
else if (part == null || isSection(part)) d.selectSocial(i.id, null, null)
|
|
156
|
-
|
|
205
|
+
// an account's section is not a place: the desk shows the account, every place
|
|
206
|
+
else d.selectSocial(i.id, part, isAccountTab(this.sel.place) ? null : this.sel.place)
|
|
157
207
|
}
|
|
158
208
|
|
|
159
209
|
/** the hub of the desk's repo, started when it is down */
|
|
@@ -6,20 +6,21 @@
|
|
|
6
6
|
import { observer } from 'mobx-react-lite'
|
|
7
7
|
import { useEffect, type CSSProperties, type ReactNode } from 'react'
|
|
8
8
|
import { Panel, Separator } from 'react-resizable-panels'
|
|
9
|
-
import { KeptCols } from './kept-cols.tsx'
|
|
9
|
+
import { KeptCols, LIST_COL } from './kept-cols.tsx'
|
|
10
10
|
import type { DataPlace, MachineIdentity } from '../../identities/machine-route.ts'
|
|
11
11
|
import type { HomeSt } from './home-st.ts'
|
|
12
12
|
import { plainClick, repoPage } from './home-st.ts'
|
|
13
13
|
import type { IdentitiesSt } from './identities-st.ts'
|
|
14
|
-
import { identityAddress, isSection, type IdentityRow } from './identity-address.ts'
|
|
15
|
-
import {
|
|
14
|
+
import { identityAddress, isSection, type AccountTab, type IdentityRow } from './identity-address.ts'
|
|
15
|
+
import { SEARCH_B_KEY } from './keys.ts'
|
|
16
|
+
import { filterKey, walkSide } from './list-walk.ts'
|
|
16
17
|
import { useInSight } from './tree-row.tsx'
|
|
17
18
|
import { PANEL } from './review/review-page.tsx'
|
|
18
19
|
import { SitePart } from './site/site-part.tsx'
|
|
19
20
|
import { Icon, ICON } from './icons.tsx'
|
|
20
|
-
import { ErrorLine,
|
|
21
|
+
import { ErrorLine, Lightbox, Logo, Toast } from './social/kit.tsx'
|
|
21
22
|
import { Problems } from './social/problems.tsx'
|
|
22
|
-
import { AccountProfile, IdentityMedia, IdentityPage, LegalPage, LegalPlatforms, Messages, PlacePane,
|
|
23
|
+
import { AccountAutomation, AccountProfile, AccountSetup, automationOf, IdentityMedia, IdentityPage, LegalPage, LegalPlatforms, Messages, PlacePane, PlatformBanner } from './social/social-page.tsx'
|
|
23
24
|
import { LEGAL, ME, type DeskAccount, type DeskIdentity } from './social/social-model.ts'
|
|
24
25
|
import { staleBadge } from './social/identity-pictures.ts'
|
|
25
26
|
import type { SocialSt } from './social/social-st.ts'
|
|
@@ -72,7 +73,7 @@ export const IdentitiesView = observer(({ app }: { app: HomeSt }) => {
|
|
|
72
73
|
return (
|
|
73
74
|
<div className="so-page idview">
|
|
74
75
|
<KeptCols id="identities" folds={{ left: 'identity-list' }} layout={app.layout}>
|
|
75
|
-
<Panel id="identity-list"
|
|
76
|
+
<Panel id="identity-list" {...LIST_COL} className="rv-pane" style={PANEL}>
|
|
76
77
|
<IdentityList app={app} i={i} />
|
|
77
78
|
</Panel>
|
|
78
79
|
<Separator className="rsep" />
|
|
@@ -124,8 +125,8 @@ const IdentityList = observer(({ app, i }: { app: HomeSt; i: MachineIdentity })
|
|
|
124
125
|
<span className="sfield">
|
|
125
126
|
<input ref={(el) => { st.searchEl = el }} placeholder="filter" aria-label="filter the accounts, sections and repos by name or handle" value={st.query}
|
|
126
127
|
onChange={(e) => st.setQuery(e.target.value)}
|
|
127
|
-
onKeyDown={(e) =>
|
|
128
|
-
<kbd className="skey">{
|
|
128
|
+
onKeyDown={(e) => filterKey(walkSide(st, () => st.searchEl), () => st.setQuery(''), e)} />
|
|
129
|
+
<kbd className="skey" title="⇧/ focuses the filter from anywhere on the page">{SEARCH_B_KEY}</kbd>
|
|
129
130
|
</span>
|
|
130
131
|
</div>
|
|
131
132
|
<div className="rv-scroll idlist">
|
|
@@ -147,11 +148,11 @@ const IdentityList = observer(({ app, i }: { app: HomeSt; i: MachineIdentity })
|
|
|
147
148
|
)
|
|
148
149
|
})
|
|
149
150
|
|
|
150
|
-
const rowCls = (app: HomeSt, r: IdentityRow, more = ''): string => `idrow${app.identities.
|
|
151
|
+
const rowCls = (app: HomeSt, r: IdentityRow, more = ''): string => `idrow${app.identities.isLit(r.key) ? ' on' : ''}${more}`
|
|
151
152
|
|
|
152
153
|
const SectionRow = observer(({ app, i, d, r }: { app: HomeSt; i: MachineIdentity; d: DeskIdentity | null; r: IdentityRow }) => {
|
|
153
154
|
const so = app.identities.desk
|
|
154
|
-
const lit = app.identities.
|
|
155
|
+
const lit = app.identities.isLit(r.key)
|
|
155
156
|
if (r.part == null)
|
|
156
157
|
return (
|
|
157
158
|
<Go app={app} to={{ part: null }} cls={rowCls(app, r)} lit={lit} title="its profile rows, its brand, its links and pictures, where its data lives">
|
|
@@ -189,12 +190,12 @@ const AccountRow = observer(({ app, i, d, r }: { app: HomeSt; i: MachineIdentity
|
|
|
189
190
|
const live = m.live !== ''
|
|
190
191
|
const stale = a == null ? null : staleBadge(a)
|
|
191
192
|
return (
|
|
192
|
-
<Go app={app} to={{ part: m.id }} cls={rowCls(app, r, live ? '' : ' off')} lit={app.identities.
|
|
193
|
+
<Go app={app} to={{ part: m.id }} cls={rowCls(app, r, live ? '' : ' off')} lit={app.identities.isLit(r.key)}
|
|
193
194
|
title={[`${m.name}${m.handle === '' ? '' : ` ${m.handle}`}`, live ? 'online' : 'still to create', stale == null ? '' : `${a!.uploads.filter((u) => u.stale).map((u) => u.field).join(', ')}: out of date on ${m.name}, the folder holds them changed`, stat, c != null && c.waiting > 0 ? `${c.waiting} messages to post` : ''].filter(Boolean).join(' · ')}>
|
|
194
195
|
<Logo id={m.id} name={m.name} size={16} muted={!live} />
|
|
195
196
|
<span className="idname">{m.name}</span>
|
|
196
197
|
<span className="iddim idgrow so-ellip">{m.handle}</span>
|
|
197
|
-
{stale == null ? null : <span className="so-badge solid t-warn idstale"
|
|
198
|
+
{stale == null ? null : <span className="so-badge solid t-warn idstale" title={stale}>↻ {a!.uploads.filter((u) => u.stale).length}</span>}
|
|
198
199
|
{c != null && c.waiting > 0 ? <b className="idnum">{c.waiting}</b> : null}
|
|
199
200
|
<i className={`iddot${live ? ' live' : ''}`} />
|
|
200
201
|
</Go>
|
|
@@ -205,7 +206,7 @@ const AccountRow = observer(({ app, i, d, r }: { app: HomeSt; i: MachineIdentity
|
|
|
205
206
|
const RepoRow = observer(({ app, i, r }: { app: HomeSt; i: MachineIdentity; r: IdentityRow }) => {
|
|
206
207
|
const st = app.identities
|
|
207
208
|
const repo = r.repo!
|
|
208
|
-
const el = useInSight<HTMLAnchorElement>(st.
|
|
209
|
+
const el = useInSight<HTMLAnchorElement>(st.isLit(r.key))
|
|
209
210
|
return (
|
|
210
211
|
<a ref={el} className={rowCls(app, r)} href={`${repoPage(repo)}#page:social:${i.id}`} title={`${repo}: its Social page (Enter)`} onClick={inPlace(() => st.openRepo(repo, i.id))}>
|
|
211
212
|
<Icon d={ICON.repo} />
|
|
@@ -250,57 +251,98 @@ const PartPage = observer(({ app, i }: { app: HomeSt; i: MachineIdentity }) => {
|
|
|
250
251
|
return <AccountPart app={app} i={i} so={so} a={a} />
|
|
251
252
|
})
|
|
252
253
|
|
|
253
|
-
/** an account's
|
|
254
|
+
/** an account's page: its band on top, then its sections as a list on the left (setup, profile, places, messages,
|
|
255
|
+
* automation), the one picked on the right */
|
|
254
256
|
const AccountPart = observer(({ app, i, so, a }: { app: HomeSt; i: MachineIdentity; so: SocialSt; a: DeskAccount }) => {
|
|
255
|
-
const
|
|
256
|
-
const
|
|
257
|
-
const
|
|
257
|
+
const tab = app.identities.tabOf(a)
|
|
258
|
+
const done = a.steps.filter((x) => x.done).length
|
|
259
|
+
const stale = a.uploads.filter((u) => u.stale && u.kind === 'picture').length
|
|
260
|
+
const waiting = so.counts(a, null).waiting
|
|
261
|
+
const auto = automationOf(a)
|
|
262
|
+
const Row = ({ to, icon, label, right }: { to: AccountTab; icon: string; label: string; right?: ReactNode }) => (
|
|
263
|
+
<Go app={app} to={{ part: a.id, place: to }} cls={`idrow${tab === to ? ' on' : ''}`} lit={tab === to}>
|
|
264
|
+
<Icon d={icon} />
|
|
265
|
+
<span className="idgrow">{label}</span>
|
|
266
|
+
{right}
|
|
267
|
+
</Go>
|
|
268
|
+
)
|
|
258
269
|
return (
|
|
259
|
-
<div className="idpage">
|
|
270
|
+
<div className="idpage idacct">
|
|
260
271
|
<div className="so-colin">
|
|
261
272
|
<ErrorLine so={so} />
|
|
262
|
-
<
|
|
263
|
-
{a.id === 'site' ? (
|
|
264
|
-
<Go app={app} to={{ part: '@site' }} cls="idrow" title="the site section: its pages live from the local preview, what changed since the deploy, the deploy">
|
|
265
|
-
<Icon d={ICON.browser} /><span className="idgrow">its pages, preview and deploy: the site section</span>
|
|
266
|
-
</Go>
|
|
267
|
-
) : null}
|
|
268
|
-
{a.places.length > 0 ? (
|
|
269
|
-
<KeptFold so={so} card={`places/${a.identity}/${a.id}`} title="Places" flush right={<span className="rv-dim rv-small">{a.places.length}</span>}>
|
|
270
|
-
{[{ id: ME, name: 'my profile', when: '' }, ...a.places].map((x) => {
|
|
271
|
-
const c = so.counts(a, x.id)
|
|
272
|
-
return (
|
|
273
|
-
<Go key={x.id} app={app} to={{ part: a.id, place: so.place === x.id ? null : x.id }} cls={`so-placerow${so.place === x.id ? ' on' : ''}`}>
|
|
274
|
-
<span className={`so-pdot${so.placeDone(a, x.id) ? ' done' : ''}`} />
|
|
275
|
-
<b className="so-ellip so-pname">{x.name}</b>
|
|
276
|
-
<span className="rv-dim so-ellip so-grow">{x.when}</span>
|
|
277
|
-
{c.waiting > 0 || c.posted > 0 ? <span className="rv-dim">{c.waiting > 0 ? `${c.waiting} to post` : `${c.posted} posted`}</span> : null}
|
|
278
|
-
</Go>
|
|
279
|
-
)
|
|
280
|
-
})}
|
|
281
|
-
</KeptFold>
|
|
282
|
-
) : null}
|
|
283
|
-
{place != null ? <PlacePane so={so} a={a} place={place} /> : null}
|
|
273
|
+
<PlatformBanner so={so} a={a} />
|
|
284
274
|
</div>
|
|
285
|
-
<
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
{
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
275
|
+
<div className="idacctbody">
|
|
276
|
+
<nav className="idtabs" aria-label="the sections of the account">
|
|
277
|
+
{a.steps.length > 0 ? <Row to="@setup" icon={ICON.checks} label="Setup" right={<span className={done === a.steps.length ? 'so-good rv-small' : 'iddim'}>{done}/{a.steps.length}</span>} /> : null}
|
|
278
|
+
<Row to="@profile" icon={ICON.social} label="Profile" right={stale > 0 ? <span className="so-badge solid t-warn idstale">{stale} to update</span> : null} />
|
|
279
|
+
{a.places.length > 0 ? <Row to="@places" icon={ICON.urls} label="Places" right={<span className="idnum">{a.places.length}</span>} /> : null}
|
|
280
|
+
<Row to="@messages" icon={ICON.messages} label="Messages" right={waiting > 0 ? <span className="idnum">{waiting}</span> : null} />
|
|
281
|
+
<Row to="@automation" icon={ICON.runs} label="Automation" right={<span className={`so-badge t-${auto.tone}`}>{auto.label}</span>} />
|
|
282
|
+
{a.id === 'site' ? (
|
|
283
|
+
<Go app={app} to={{ part: '@site' }} cls="idrow" title="the site section: its pages live from the local preview, what changed since the deploy, the deploy">
|
|
284
|
+
<Icon d={ICON.browser} /><span className="idgrow">pages and deploy ↗</span>
|
|
285
|
+
</Go>
|
|
286
|
+
) : null}
|
|
287
|
+
</nav>
|
|
288
|
+
<div className="idtab">
|
|
289
|
+
{tab === '@setup' ? <div className="so-colin"><AccountSetup so={so} a={a} /></div>
|
|
290
|
+
: tab === '@profile' ? <AccountProfile so={so} a={a} />
|
|
291
|
+
: tab === '@places' ? <PlacesTab app={app} so={so} a={a} />
|
|
292
|
+
: tab === '@messages' ? <MessagesTab app={app} i={i} so={so} a={a} />
|
|
293
|
+
: <div className="so-colin"><AccountAutomation so={so} a={a} open /></div>}
|
|
294
|
+
</div>
|
|
295
|
+
</div>
|
|
296
|
+
</div>
|
|
297
|
+
)
|
|
298
|
+
})
|
|
299
|
+
|
|
300
|
+
/** the account's places, the one picked under them with its rules and the messages waiting for it */
|
|
301
|
+
const PlacesTab = observer(({ app, so, a }: { app: HomeSt; so: SocialSt; a: DeskAccount }) => {
|
|
302
|
+
const place = so.currentPlace
|
|
303
|
+
return (
|
|
304
|
+
<div className="so-colin">
|
|
305
|
+
<div className="so-rows">
|
|
306
|
+
{[{ id: ME, name: 'my profile', when: '' }, ...a.places].map((x) => {
|
|
307
|
+
const c = so.counts(a, x.id)
|
|
308
|
+
return (
|
|
309
|
+
<Go key={x.id} app={app} to={{ part: a.id, place: so.place === x.id ? '@places' : x.id }} cls={`so-placerow${so.place === x.id ? ' on' : ''}`}>
|
|
310
|
+
<span className={`so-pdot${so.placeDone(a, x.id) ? ' done' : ''}`} />
|
|
311
|
+
<b className="so-ellip so-pname">{x.name}</b>
|
|
312
|
+
<span className="rv-dim so-ellip so-grow">{x.when}</span>
|
|
313
|
+
{c.waiting > 0 || c.posted > 0 ? <span className="rv-dim">{c.waiting > 0 ? `${c.waiting} to post` : `${c.posted} posted`}</span> : null}
|
|
314
|
+
</Go>
|
|
315
|
+
)
|
|
316
|
+
})}
|
|
303
317
|
</div>
|
|
318
|
+
{place != null ? <PlacePane so={so} a={a} place={place} /> : <span className="rv-dim rv-small">pick a place: its rules and the messages waiting for it</span>}
|
|
319
|
+
{place != null ? <Messages so={so} a={a} /> : null}
|
|
320
|
+
</div>
|
|
321
|
+
)
|
|
322
|
+
})
|
|
323
|
+
|
|
324
|
+
/** the drafts waiting for the account, and where the drafts of the other repos that speak as the identity are */
|
|
325
|
+
const MessagesTab = observer(({ app, i, so, a }: { app: HomeSt; i: MachineIdentity; so: SocialSt; a: DeskAccount }) => {
|
|
326
|
+
const st = app.identities
|
|
327
|
+
const others = st.otherDrafts(i)
|
|
328
|
+
return (
|
|
329
|
+
<div className="so-colin">
|
|
330
|
+
<Messages so={so} a={a} />
|
|
331
|
+
<span className="rv-dim rv-small">
|
|
332
|
+
the drafts of {so.repoName}
|
|
333
|
+
{others.length === 0 ? null : (
|
|
334
|
+
<>
|
|
335
|
+
; the drafts of{' '}
|
|
336
|
+
{others.map((p, n) => (
|
|
337
|
+
<span key={p.repo}>
|
|
338
|
+
{n > 0 ? ', ' : ''}
|
|
339
|
+
<a href={`${repoPage(p.repo!)}#page:comms`} onClick={inPlace(() => st.openRepoPage(p.repo!, 'comms'))}>{p.repo}</a> ({p.count})
|
|
340
|
+
</span>
|
|
341
|
+
))}{' '}
|
|
342
|
+
are in their Communications
|
|
343
|
+
</>
|
|
344
|
+
)}
|
|
345
|
+
</span>
|
|
304
346
|
</div>
|
|
305
347
|
)
|
|
306
348
|
})
|
|
@@ -17,24 +17,10 @@
|
|
|
17
17
|
.idtitle .iddim{font-size:11.5px;line-height:1.35;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
|
|
18
18
|
.iddim{color:var(--dim)}
|
|
19
19
|
.idnote{margin-bottom:var(--s2);font-size:12px}
|
|
20
|
-
/* a band's title over its rows, the tree's rule between them */
|
|
21
|
-
.idband{display:flex;align-items:center;gap:var(--s1);height:24px;margin-top:var(--s2);padding:0 var(--s3);font-size:11px;color:var(--dim);box-shadow:inset 0 1px 0 var(--line)}
|
|
22
|
-
.idband span{margin-left:auto;font-variant-numeric:tabular-nums}
|
|
23
|
-
/* every row in the tree's shape (hub.css .tsec): 26px, its 16px icon, the name, what it carries at its end */
|
|
24
|
-
.idrows{display:flex;flex-direction:column;padding-top:var(--s1)}
|
|
25
|
-
.idrow{display:flex;align-items:center;gap:var(--s2);height:26px;padding:0 var(--s3);color:var(--dim);font-size:13px;text-decoration:none;white-space:nowrap;min-width:0;cursor:pointer}
|
|
26
|
-
.idrow .hico{flex:none;width:16px;height:16px}
|
|
27
|
-
.idrow:hover{background:var(--panel2);color:var(--ink)}
|
|
28
|
-
.idrow.on{background:var(--sel);color:var(--ink);box-shadow:inset 3px 0 0 var(--idc,var(--accent));font-weight:600}
|
|
29
|
-
.idrow.off .idname{opacity:.6}
|
|
30
20
|
.idname{flex:none;max-width:50%;overflow:hidden;text-overflow:ellipsis}
|
|
31
|
-
|
|
32
|
-
.idgrow{flex:1;min-width:0}
|
|
33
|
-
/* an account's messages to post, the tree's count badge; its state a dot: green online, a ring still to create */
|
|
21
|
+
/* an account's messages to post, the tree's count badge; its state a dot (hub.css): green online, a ring still to create */
|
|
34
22
|
.idnum{flex:none;min-width:16px;height:16px;padding:0 var(--s1);border-radius:8px;font-size:10px;line-height:16px;text-align:center;color:var(--dim);background:var(--panel2)}
|
|
35
23
|
.idstale{flex:none;white-space:nowrap;text-transform:none;letter-spacing:0}
|
|
36
|
-
.iddot{flex:none;width:7px;height:7px;border-radius:50%;box-shadow:inset 0 0 0 1px var(--dim)}
|
|
37
|
-
.iddot.live{background:var(--ok);box-shadow:none}
|
|
38
24
|
.idpage{display:flex;flex-direction:column;gap:var(--s3)}
|
|
39
25
|
.idfacts{display:grid;grid-template-columns:72px 1fr;gap:var(--s1) var(--s3);margin:var(--s3) 0;font-size:12.5px}
|
|
40
26
|
.idfacts dt{color:var(--dim)}
|
|
@@ -47,3 +33,19 @@
|
|
|
47
33
|
.idopen{width:132px;text-align:right;white-space:nowrap}
|
|
48
34
|
.idopen button{height:20px;padding:0 var(--s2);font-size:11px}
|
|
49
35
|
.idpage a.so-placerow{color:var(--ink);text-decoration:none}
|
|
36
|
+
/* an account's page: its band on top, then its sections as a list on the left (the third level under the identity's
|
|
37
|
+
list), the section picked beside it; a narrow pane lays the list as one row over the section */
|
|
38
|
+
.idpage.idacct{gap:0;container-type:inline-size}
|
|
39
|
+
.idacct > .so-colin{padding-bottom:var(--s2)}
|
|
40
|
+
.idacctbody{display:grid;grid-template-columns:200px minmax(0,1fr);align-items:start;border-top:1px solid var(--line)}
|
|
41
|
+
.idtabs{position:sticky;top:0;display:flex;flex-direction:column;padding:var(--s2) 0;min-height:240px;border-right:1px solid var(--line)}
|
|
42
|
+
.idpage .idtabs .idrow{color:var(--dim);height:30px}
|
|
43
|
+
.idpage .idtabs .idrow:hover{color:var(--ink)}
|
|
44
|
+
.idpage .idtabs .idrow.on{color:var(--ink)}
|
|
45
|
+
.idtabs .so-badge{flex:none}
|
|
46
|
+
.idtab{min-width:0}
|
|
47
|
+
@container (max-width:560px){
|
|
48
|
+
.idacctbody{grid-template-columns:minmax(0,1fr)}
|
|
49
|
+
.idtabs{position:static;flex-direction:row;flex-wrap:wrap;min-height:0;padding:var(--s1) var(--s2);border-right:0;border-bottom:1px solid var(--line)}
|
|
50
|
+
.idpage .idtabs .idrow{height:26px;padding:0 var(--s2)}
|
|
51
|
+
}
|
|
@@ -12,6 +12,11 @@ const LEGAL_PART: Section = '@legal'
|
|
|
12
12
|
|
|
13
13
|
export type IdentitySel = { id: string | null; part: string | null; place: string | null }
|
|
14
14
|
|
|
15
|
+
/** the sections of an account page, in the place slot of the address beside its places' ids: `#<id>/bluesky/@setup` */
|
|
16
|
+
export const ACCOUNT_TABS = ['@setup', '@profile', '@places', '@messages', '@automation'] as const
|
|
17
|
+
export type AccountTab = (typeof ACCOUNT_TABS)[number]
|
|
18
|
+
export const isAccountTab = (place: string | null): place is AccountTab => ACCOUNT_TABS.includes(place as AccountTab)
|
|
19
|
+
|
|
15
20
|
export const isSection = (part: string | null): part is Section => SECTIONS.includes(part as Section)
|
|
16
21
|
|
|
17
22
|
/** the hash of a pick, empty for the view with nothing picked */
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
// the inbox page as state (wiki tools/shipkit/home.md, The inbox), a node of the root (home-st.ts): the main list in
|
|
2
|
-
// pages of `GET /api/inbox`, the folded
|
|
2
|
+
// pages of `GET /api/inbox`, the folded lists (what can wait, the asks waiting for their day) each read once it unfolds,
|
|
3
|
+
// and the item open in place. Polled every few
|
|
3
4
|
// seconds while the page shows and the tab is visible, 304 when nothing moved. An item opens in its repo's own state
|
|
4
5
|
// (RepoSt): a card in that repo's review thread, an ask or a need in its item view, the same components as its hub
|
|
5
6
|
//
|
|
6
7
|
// the one constraint a reader breaks first: the address and the open item move together, through HomeSt.show; `open`
|
|
7
8
|
// only says which item the address names
|
|
8
9
|
import { makeAutoObservable, observableRef, runInAction } from 'mobx'
|
|
9
|
-
import { groupRows, INBOX_GROUPS, INBOX_PAGE, openOf, type InboxAnswer, type InboxGroup, type InboxGroupNode, type InboxRow, type InboxShow } from '../../home/inbox-shape.ts'
|
|
10
|
+
import { groupRows, INBOX_GROUPS, INBOX_PAGE, isReviewId, openOf, type InboxAnswer, type InboxGroup, type InboxGroupNode, type InboxList, type InboxRow, type InboxShow } from '../../home/inbox-shape.ts'
|
|
10
11
|
import { etagLoader, kept, type EtagLoader } from './review/review-kit.ts'
|
|
11
12
|
import { ownTrouble } from './reach.ts'
|
|
12
13
|
import { ClockSvc } from './clock-svc.ts'
|
|
@@ -18,9 +19,14 @@ const PREFS = 'shipkit.inbox.prefs'
|
|
|
18
19
|
/** below this width the inbox is the phone's: one pane at a time, the list or the item */
|
|
19
20
|
export const INBOX_PHONE_PX = 768
|
|
20
21
|
|
|
22
|
+
/** the lists folded under the main one, in the order drawn */
|
|
23
|
+
export const FOLDS = ['yellow', 'later'] as const satisfies readonly InboxList[]
|
|
24
|
+
export type FoldList = (typeof FOLDS)[number]
|
|
25
|
+
|
|
21
26
|
export class InboxSt {
|
|
22
27
|
page: InboxAnswer | null = null
|
|
23
|
-
|
|
28
|
+
/** each folded list's last answer, read while it is unfolded */
|
|
29
|
+
foldPages: Record<FoldList, InboxAnswer | null> = { yellow: null, later: null }
|
|
24
30
|
error = ''
|
|
25
31
|
/** the rows asked of the main list: a page more on « more » */
|
|
26
32
|
shown = INBOX_PAGE
|
|
@@ -28,8 +34,8 @@ export class InboxSt {
|
|
|
28
34
|
show: InboxShow = 'cards'
|
|
29
35
|
/** what the rows group by, each on its own */
|
|
30
36
|
groupBy: InboxGroup[] = []
|
|
31
|
-
/** the folded
|
|
32
|
-
|
|
37
|
+
/** the folded lists unfolded: each read while it is */
|
|
38
|
+
foldOpen: Record<FoldList, boolean> = { yellow: false, later: false }
|
|
33
39
|
/** the item the address names */
|
|
34
40
|
open: { repo: string; id: string } | null = null
|
|
35
41
|
/** on a phone the list or the item, one at a time */
|
|
@@ -38,7 +44,7 @@ export class InboxSt {
|
|
|
38
44
|
readonly clock = new ClockSvc()
|
|
39
45
|
private timer: ReturnType<typeof setInterval> | null = null
|
|
40
46
|
private readonly loadMain: EtagLoader<InboxAnswer>
|
|
41
|
-
private readonly
|
|
47
|
+
private readonly loadFold: Record<FoldList, EtagLoader<InboxAnswer>>
|
|
42
48
|
private readonly onVisible = (): void => {
|
|
43
49
|
if (document.visibilityState === 'visible' && this.timer != null) void this.poll()
|
|
44
50
|
}
|
|
@@ -53,10 +59,11 @@ export class InboxSt {
|
|
|
53
59
|
}
|
|
54
60
|
// the last lists drawn in the first frame: the daemon answers after, and only what moved draws again
|
|
55
61
|
this.loadMain = etagLoader(() => `/api/inbox?show=${this.show}&limit=${this.shown}`, { keep: 'inbox.main' })
|
|
56
|
-
|
|
62
|
+
const fold = (l: FoldList): EtagLoader<InboxAnswer> => etagLoader(() => `/api/inbox?show=${this.show}&list=${l}&limit=500`, { keep: `inbox.${l}` })
|
|
63
|
+
this.loadFold = { yellow: fold('yellow'), later: fold('later') }
|
|
57
64
|
this.page = this.loadMain.held()
|
|
58
|
-
this.
|
|
59
|
-
makeAutoObservable<this, 'home' | 'timer' | 'loadMain' | '
|
|
65
|
+
this.foldPages = { yellow: this.loadFold.yellow.held(), later: this.loadFold.later.held() }
|
|
66
|
+
makeAutoObservable<this, 'home' | 'timer' | 'loadMain' | 'loadFold' | 'onVisible'>(this, { home: false, timer: false, loadMain: false, loadFold: false, onVisible: false, clock: false, page: observableRef })
|
|
60
67
|
if (typeof window !== 'undefined' && typeof window.matchMedia === 'function') {
|
|
61
68
|
const mq = window.matchMedia(`(max-width: ${INBOX_PHONE_PX - 1}px)`)
|
|
62
69
|
this.phone = mq.matches
|
|
@@ -68,8 +75,8 @@ export class InboxSt {
|
|
|
68
75
|
return this.page?.rows ?? []
|
|
69
76
|
}
|
|
70
77
|
|
|
71
|
-
|
|
72
|
-
return this.
|
|
78
|
+
foldRows(l: FoldList): InboxRow[] {
|
|
79
|
+
return this.foldPages[l]?.rows ?? []
|
|
73
80
|
}
|
|
74
81
|
|
|
75
82
|
/** the main list as it draws: one group of every row, or nested by what is on */
|
|
@@ -77,25 +84,25 @@ export class InboxSt {
|
|
|
77
84
|
return groupRows(this.rows, this.groupBy)
|
|
78
85
|
}
|
|
79
86
|
|
|
80
|
-
|
|
81
|
-
return groupRows(this.
|
|
87
|
+
foldGroups(l: FoldList): InboxGroupNode[] {
|
|
88
|
+
return groupRows(this.foldRows(l), this.groupBy)
|
|
82
89
|
}
|
|
83
90
|
|
|
84
|
-
/** what « all » would show beside the cards,
|
|
91
|
+
/** what « all » would show beside the cards, every list */
|
|
85
92
|
get allCount(): number {
|
|
86
|
-
return (this.page?.all?.main ?? 0) + (this.page?.all?.
|
|
93
|
+
return (this.page?.all?.main ?? 0) + FOLDS.reduce((n, l) => n + (this.page?.all?.[l] ?? 0), 0)
|
|
87
94
|
}
|
|
88
95
|
|
|
89
96
|
get cardCount(): number {
|
|
90
|
-
return this.show === 'cards' ? this.count + this.
|
|
97
|
+
return this.show === 'cards' ? this.count + FOLDS.reduce((n, l) => n + this.foldCount(l), 0) : 0
|
|
91
98
|
}
|
|
92
99
|
|
|
93
100
|
get count(): number {
|
|
94
101
|
return this.page?.counts.main ?? 0
|
|
95
102
|
}
|
|
96
103
|
|
|
97
|
-
|
|
98
|
-
return this.page?.counts
|
|
104
|
+
foldCount(l: FoldList): number {
|
|
105
|
+
return this.page?.counts[l] ?? 0
|
|
99
106
|
}
|
|
100
107
|
|
|
101
108
|
get more(): number {
|
|
@@ -107,7 +114,7 @@ export class InboxSt {
|
|
|
107
114
|
const o = this.open
|
|
108
115
|
if (o == null) return null
|
|
109
116
|
const key = `${o.repo}/${o.id}`
|
|
110
|
-
return this.rows.find((r) => r.key === key) ?? this.
|
|
117
|
+
return this.rows.find((r) => r.key === key) ?? FOLDS.flatMap((l) => this.foldRows(l)).find((r) => r.key === key) ?? null
|
|
111
118
|
}
|
|
112
119
|
|
|
113
120
|
/** the address's part after /inbox */
|
|
@@ -149,7 +156,7 @@ export class InboxSt {
|
|
|
149
156
|
}),
|
|
150
157
|
(e: Error) => runInAction(() => (this.error = ownTrouble(e, this.home.machine, (m) => `the inbox cannot be read: ${m}`))),
|
|
151
158
|
),
|
|
152
|
-
this.
|
|
159
|
+
...FOLDS.map((l) => (this.foldOpen[l] ? this.loadFold[l]().then((p) => runInAction(() => p !== this.foldPages[l] && (this.foldPages[l] = p)), () => undefined) : null)),
|
|
153
160
|
])
|
|
154
161
|
}
|
|
155
162
|
|
|
@@ -159,7 +166,7 @@ export class InboxSt {
|
|
|
159
166
|
this.shown = INBOX_PAGE
|
|
160
167
|
// the kept answer of the other mode, if any, draws at once
|
|
161
168
|
this.page = this.loadMain.held()
|
|
162
|
-
this.
|
|
169
|
+
this.foldPages = { yellow: this.loadFold.yellow.held(), later: this.loadFold.later.held() }
|
|
163
170
|
this.save()
|
|
164
171
|
void this.poll()
|
|
165
172
|
}
|
|
@@ -179,9 +186,9 @@ export class InboxSt {
|
|
|
179
186
|
void this.poll()
|
|
180
187
|
}
|
|
181
188
|
|
|
182
|
-
|
|
183
|
-
this.
|
|
184
|
-
if (this.
|
|
189
|
+
toggleFold(l: FoldList): void {
|
|
190
|
+
this.foldOpen[l] = !this.foldOpen[l]
|
|
191
|
+
if (this.foldOpen[l]) void this.poll()
|
|
185
192
|
}
|
|
186
193
|
|
|
187
194
|
/** a row tapped: the item in place, as a history entry */
|
|
@@ -189,6 +196,16 @@ export class InboxSt {
|
|
|
189
196
|
this.home.openInbox({ repo: row.repo, id: row.id })
|
|
190
197
|
}
|
|
191
198
|
|
|
199
|
+
/** the next review card of the list after the open one, round to the first: the card's own « next » would step
|
|
200
|
+
* its repo's review and leave this list's row behind */
|
|
201
|
+
nextCard(): void {
|
|
202
|
+
const o = this.open
|
|
203
|
+
const cards = this.rows.filter((r) => isReviewId(r.id))
|
|
204
|
+
if (o == null || cards.length === 0) return
|
|
205
|
+
const next = cards[(cards.findIndex((r) => r.repo === o.repo && r.id === o.id) + 1) % cards.length]!
|
|
206
|
+
if (next.repo !== o.repo || next.id !== o.id) this.pick(next)
|
|
207
|
+
}
|
|
208
|
+
|
|
192
209
|
/** back to the list: the entry the item pushed, else the list's own address */
|
|
193
210
|
back(): void {
|
|
194
211
|
if (history.state?.inbox === 'item') history.back()
|