rvlib-shipkit 2.12.0 → 2.14.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 +75 -21
- package/README.md +1 -1
- package/package.json +4 -2
- package/src/agent-time/store.ts +2 -2
- package/src/assets/run-assets.ts +2 -2
- package/src/assets/server/studio-server.ts +27 -23
- package/src/check.ts +4 -4
- package/src/checks/SK001-package-json-shape.check.ts +8 -4
- package/src/checks/SK002-contracts-fulfillness.check.ts +2 -2
- package/src/checks/SK003-claude-md-shape.check.ts +20 -13
- package/src/checks/SK004-gitignore-policy.check.ts +45 -6
- package/src/checks/SK005-rvlib-versions.check.ts +2 -2
- package/src/checks/SK006-npm-publish-safety.check.ts +3 -3
- package/src/checks/SK007-github-visibility.check.ts +2 -2
- package/src/checks/SK008-reviewer-agent.check.ts +3 -3
- package/src/checks/SK010-undeclared-unit.check.ts +2 -2
- package/src/checks/SK011-sibling-unit-ranges.check.ts +2 -2
- package/src/checks/SK012-config-barrel-import.check.ts +2 -2
- package/src/checks/SK013-one-way-in-policy.check.ts +2 -2
- package/src/checks/SK015-nested-repo.check.ts +3 -3
- package/src/checks/SK016-legacy-check-shapes.check.ts +2 -2
- package/src/checks/SK017-vscode-hub-task.check.ts +2 -2
- package/src/checks/SK018-test-files-run.check.ts +2 -2
- package/src/checks/SK019-tests-run-in-units.check.ts +2 -2
- package/src/checks/SK020-self-spawning-check.check.ts +2 -2
- package/src/checks/SK022-machine-runs-the-pin.check.ts +2 -2
- package/src/checks/SK024-identity-colors.check.ts +1 -1
- package/src/checks/SK025-release-drift.check.ts +2 -2
- package/src/checks/SK026-asks-autoclose.check.ts +2 -2
- package/src/checks/SK027-agent-wiki-links.check.ts +8 -2
- package/src/checks/SK028-readme.check.ts +2 -2
- package/src/checks/SK029-explicit-check-files.check.ts +3 -3
- package/src/checks/SK030-cache-audit.check.ts +7 -5
- package/src/checks/SK031-trace-audit.check.ts +7 -7
- package/src/checks/SK032-ignored-inputs.check.ts +3 -3
- package/src/checks/SK033-global-contribution.check.ts +11 -4
- package/src/checks/SK034-commit-gates-armed.check.ts +2 -2
- package/src/checks/SK035-public-clean.check.ts +46 -0
- package/src/checks/SK036-draft-media-size.check.ts +28 -0
- package/src/checks/SK037-keyword-additions.check.ts +43 -0
- package/src/cli/cmd_Backup.ts +152 -0
- package/src/cli/cmd_Ci.ts +8 -11
- package/src/cli/cmd_Commands.ts +4 -4
- package/src/cli/cmd_ConfigKeys.ts +2 -2
- package/src/cli/cmd_Drill.ts +145 -0
- package/src/cli/cmd_Home.ts +50 -3
- package/src/cli/cmd_Init.ts +1 -1
- package/src/cli/cmd_Media.ts +10 -8
- package/src/cli/cmd_Mv.ts +14 -7
- package/src/cli/cmd_Review.ts +6 -4
- package/src/cli/cmd_Shot.ts +5 -2
- package/src/cli/cmd_Smoke.ts +5 -2
- package/src/cli/cmd_Social.ts +226 -0
- package/src/cli/cmd_Sound.ts +1 -1
- package/src/cli/cmd_Start.ts +1 -1
- package/src/cli/cmd_Time.ts +1 -1
- package/src/cli/cmd_TraceAudit.ts +6 -6
- package/src/cli/cmd_Trailer.ts +7 -4
- package/src/cli/cmd_Veille.ts +173 -0
- package/src/cli/cmd_When.ts +2 -2
- package/src/cli/family-pages.ts +19 -16
- package/src/cli/registry.ts +13 -2
- package/src/cli.ts +5 -2
- package/src/collections/actions.ts +1 -49
- package/src/collections/checks.ts +2 -1
- package/src/collections/collection-types.ts +12 -3
- package/src/collections/providers.ts +4 -4
- package/src/collections/review.ts +3 -2
- package/src/collections/tests.ts +19 -8
- package/src/comfy/comfy-panel.ts +2 -2
- package/src/contracts/apply-contracts.ts +1 -3
- package/src/contracts/contract-manifests.ts +2 -3
- package/src/contracts/contract-types.ts +0 -1
- package/src/contracts/contracts-engine.ts +0 -3
- package/src/contracts/manifests/discord.contract.ts +1 -1
- package/src/contracts/manifests/identity.contract.ts +1 -1
- package/src/contracts/manifests/itch.contract.ts +1 -1
- package/src/contracts/manifests/steam.contract.ts +1 -1
- package/src/core/agent-dir-at.ts +12 -0
- package/src/core/agent-dir.ts +16 -0
- package/src/core/app-icon.ts +9 -3
- package/src/core/budget.ts +1 -1
- package/src/core/bun-builtins.ts +2 -2
- package/src/core/canonical-scripts.ts +2 -2
- package/src/core/discover-checks.ts +38 -6
- package/src/core/fix-scope.ts +4 -2
- package/src/core/floor-resolve.ts +68 -48
- package/src/core/floor.ts +9 -0
- package/src/core/git-root.ts +24 -0
- package/src/core/global-contribution.ts +4 -1
- package/src/core/ignored-block.ts +1 -1
- package/src/core/ignored-inputs.ts +3 -2
- package/src/core/last-good.ts +3 -1
- package/src/core/layout.ts +8 -0
- package/src/core/log-stamp.ts +36 -0
- package/src/core/loop-watch.ts +93 -0
- package/src/core/machine-link.ts +134 -0
- package/src/core/memory-watch.ts +41 -0
- package/src/core/motherhome.ts +2 -2
- package/src/core/one-way-in-policy.ts +34 -26
- package/src/core/run-ci.ts +9 -11
- package/src/core/run-fixers.ts +9 -9
- package/src/core/runs-matrix.ts +1 -1
- package/src/core/slots.ts +30 -0
- package/src/core/trace-audit.ts +50 -9
- package/src/core/tree-rev.ts +60 -0
- package/src/core/unit-files.ts +42 -0
- package/src/drill/render.ts +140 -0
- package/src/drill/run.ts +269 -0
- package/src/fleet/scan-fleet.ts +6 -5
- package/src/home/daemon-jobs.ts +201 -0
- package/src/home/global-context.ts +44 -8
- package/src/home/gui-app/ShipkitGui.swift +91 -2
- package/src/home/home-routes.ts +22 -15
- package/src/home/hubs.ts +10 -3
- package/src/home/inbox-shape.ts +54 -5
- package/src/home/inbox.ts +17 -2
- package/src/home/lib-watch.ts +10 -3
- package/src/home/machine-stores.ts +15 -29
- package/src/home/pm-config.ts +4 -1
- package/src/home/pm-inputs.ts +2 -0
- package/src/home/resources.ts +7 -2
- package/src/home/run-daemon.ts +15 -18
- package/src/home/run-pm.ts +3 -1
- package/src/home/serve-daemon.ts +4 -3
- package/src/home/serve-web.ts +104 -1
- package/src/hooks/commit-message.ts +29 -20
- package/src/hooks/hook-gates.ts +1 -1
- package/src/hooks/leak-guard.ts +69 -9
- package/src/hooks/run-hooks.ts +18 -22
- package/src/identities/identities.ts +334 -0
- package/src/identities/machine-route.ts +126 -0
- package/src/identities/machine.ts +62 -0
- package/src/init-repo.ts +3 -3
- package/src/ledger/check-stats.ts +10 -9
- package/src/ledger/gate-checks.ts +32 -1
- package/src/ledger/record-kept.ts +112 -0
- package/src/ledger/repo-view.ts +10 -0
- package/src/ledger/run-log.ts +17 -12
- package/src/ledger/run-timeline.ts +8 -4
- package/src/ledger/store.ts +7 -0
- package/src/ledger/suite-log.ts +17 -13
- package/src/media-kinds.ts +3 -2
- package/src/media-store/backup/daemon.ts +73 -0
- package/src/media-store/backup/keys.ts +25 -0
- package/src/media-store/backup/manifest.ts +193 -0
- package/src/media-store/backup/restore.ts +192 -0
- package/src/media-store/backup/run.ts +278 -0
- package/src/media-store/backup/secret.ts +86 -0
- package/src/media-store/backup/snapshot.ts +64 -0
- package/src/media-store/backup/sources.ts +199 -0
- package/src/media-store/content.ts +1 -1
- package/src/media-store/daemon.ts +56 -70
- package/src/media-store/db.ts +1 -1
- package/src/media-store/fact.ts +1 -1
- package/src/media-store/hand.ts +1 -1
- package/src/media-store/kind.ts +1 -1
- package/src/media-store/purge.ts +1 -1
- package/src/media-store/put.ts +5 -3
- package/src/media-store/remote.ts +1 -1
- package/src/media-store/space.ts +24 -5
- package/src/mv/mv-md.ts +63 -22
- package/src/pages/forward.ts +35 -0
- package/src/pages/frame-client.ts +118 -0
- package/src/pages/routes.ts +29 -0
- package/src/pages/unit.ts +92 -0
- package/src/plan/planner.ts +12 -0
- package/src/plan/repo-source.ts +19 -5
- package/src/reflect/transcript.ts +35 -10
- package/src/release/public-clean.ts +319 -0
- package/src/release/published-here.ts +22 -0
- package/src/release/run-bump.ts +3 -2
- package/src/release/run-release.ts +7 -4
- package/src/repo-config.ts +71 -13
- package/src/review/anim.ts +1 -1
- package/src/review/auto.ts +1 -1
- package/src/review/cells.ts +15 -1
- package/src/review/format.ts +2 -2
- package/src/review/http.ts +16 -2
- package/src/review/marks.ts +1 -1
- package/src/review/media-kind.ts +1 -1
- package/src/review/media-read.ts +1 -1
- package/src/review/model.ts +27 -6
- package/src/review/notes.ts +125 -0
- package/src/review/previews.ts +1 -1
- package/src/review/project.ts +7 -39
- package/src/review/role.ts +1 -1
- package/src/review/routes.ts +18 -14
- package/src/review/store.ts +42 -2
- package/src/review/threads.ts +1 -1
- package/src/review/trailer-desk.ts +3 -3
- package/src/review/trailer-media.ts +8 -5
- package/src/review/trailer-model.ts +1 -1
- package/src/review/trailer-routes.ts +1 -1
- package/src/review/trailer-shots.ts +22 -5
- package/src/review/unit.ts +2 -2
- package/src/scaffold/files/agent-handoff.md +3 -0
- package/src/scaffold/files/agent-index.md +4 -12
- package/src/scaffold/files/tsconfig.json +1 -1
- package/src/scaffold/project-scaffold.ts +6 -5
- package/src/serve/embed.ts +2 -2
- package/src/serve/hub-app/check-words.ts +1 -1
- package/src/serve/hub-app/col-card.tsx +3 -17
- package/src/serve/hub-app/col-tables-view.tsx +2 -1
- package/src/serve/hub-app/cols-svc.ts +0 -13
- package/src/serve/hub-app/dock-st.ts +4 -2
- package/src/serve/hub-app/dock-view.tsx +2 -0
- package/src/serve/hub-app/frames-st.ts +35 -0
- package/src/serve/hub-app/hash-route.ts +64 -1
- package/src/serve/hub-app/home-st.ts +32 -8
- package/src/serve/hub-app/home-strip.css +9 -1
- package/src/serve/hub-app/home-strip.tsx +7 -6
- package/src/serve/hub-app/home.html +5 -0
- package/src/serve/hub-app/hub-app.tsx +51 -7
- package/src/serve/hub-app/hub.css +29 -11
- package/src/serve/hub-app/icons.tsx +16 -1
- package/src/serve/hub-app/identities-st.ts +210 -0
- package/src/serve/hub-app/identities-view.tsx +353 -0
- package/src/serve/hub-app/identities.css +48 -0
- package/src/serve/hub-app/identity-address.ts +52 -0
- package/src/serve/hub-app/inbox-st.ts +60 -7
- package/src/serve/hub-app/inbox-view.tsx +49 -7
- package/src/serve/hub-app/inbox.css +12 -1
- package/src/serve/hub-app/index.html +3 -0
- package/src/serve/hub-app/kept-cols.tsx +30 -0
- package/src/serve/hub-app/keys.ts +10 -2
- package/src/serve/hub-app/list-walk.ts +89 -0
- package/src/serve/hub-app/machine-st.ts +12 -0
- package/src/serve/hub-app/media-svc.ts +1 -1
- package/src/serve/hub-app/media-view.tsx +2 -1
- package/src/serve/hub-app/pages-frames.tsx +134 -0
- package/src/serve/hub-app/pages-svc.ts +111 -0
- package/src/serve/hub-app/palette-st.ts +18 -3
- package/src/serve/hub-app/palette-view.tsx +9 -2
- package/src/serve/hub-app/planned-view.tsx +2 -1
- package/src/serve/hub-app/project-list.css +18 -14
- package/src/serve/hub-app/project-list.tsx +88 -49
- package/src/serve/hub-app/projects-svc.ts +33 -3
- package/src/serve/hub-app/repo-sections.ts +19 -2
- package/src/serve/hub-app/repo-st.ts +76 -20
- package/src/serve/hub-app/review/review-board.tsx +1 -1
- package/src/serve/hub-app/review/review-cells.tsx +6 -5
- package/src/serve/hub-app/review/review-kit.ts +30 -7
- package/src/serve/hub-app/review/review-page.tsx +6 -5
- package/src/serve/hub-app/review/review-st.ts +34 -15
- package/src/serve/hub-app/review/review-thread.tsx +63 -14
- package/src/serve/hub-app/review/review-views.tsx +133 -51
- package/src/serve/hub-app/review/thread-st.ts +80 -37
- package/src/serve/hub-app/review/trailer-page.tsx +7 -5
- package/src/serve/hub-app/review/trailer-st.ts +1 -1
- package/src/serve/hub-app/review.css +26 -9
- package/src/serve/hub-app/site/site-part.tsx +173 -0
- package/src/serve/hub-app/site/site-st.ts +157 -0
- package/src/serve/hub-app/site.css +35 -0
- package/src/serve/hub-app/social/calendar.tsx +182 -0
- package/src/serve/hub-app/social/comms-page.tsx +330 -0
- package/src/serve/hub-app/social/kit.tsx +244 -0
- package/src/serve/hub-app/social/post-card.tsx +456 -0
- package/src/serve/hub-app/social/problems.tsx +60 -0
- package/src/serve/hub-app/social/social-model.ts +154 -0
- package/src/serve/hub-app/social/social-page.tsx +681 -0
- package/src/serve/hub-app/social/social-st.ts +1014 -0
- package/src/serve/hub-app/social.css +289 -0
- package/src/serve/hub-app/stores/stores-page.tsx +312 -0
- package/src/serve/hub-app/stores/stores-st.ts +286 -0
- package/src/serve/hub-app/stores.css +54 -0
- package/src/serve/hub-app/timeline-geometry.ts +1 -1
- package/src/serve/hub-app/timeline-view.tsx +3 -2
- package/src/serve/hub-app/tree-build.ts +6 -0
- package/src/serve/hub-app/tree-row.tsx +27 -4
- package/src/serve/hub-app/tree-svc.ts +18 -49
- package/src/serve/hub-app/veille/veille-page.tsx +515 -0
- package/src/serve/hub-app/veille/veille-st.ts +443 -0
- package/src/serve/hub-app/veille.css +84 -0
- package/src/serve/hub-runtime.ts +20 -11
- package/src/serve/project-gutter-route.ts +44 -12
- package/src/serve/run-lanes.ts +7 -4
- package/src/serve/same-origin.ts +1 -1
- package/src/serve/serve-hub.ts +20 -12
- package/src/serve/tracked-watch.ts +24 -3
- package/src/serve/warm-cell.ts +5 -1
- package/src/shipkit-files.ts +15 -4
- package/src/shipkit.ts +0 -1
- package/src/shot/box.ts +160 -0
- package/src/shot/browser-slot.ts +74 -0
- package/src/shot/client.ts +42 -7
- package/src/shot/clip-encoder.ts +108 -24
- package/src/shot/film-box.ts +292 -0
- package/src/shot/shooter.ts +71 -17
- package/src/shot/shot-ask.ts +10 -2
- package/src/shot/stepped-clip.ts +5 -4
- package/src/site/desk.ts +242 -0
- package/src/site/routes.ts +66 -0
- package/src/site/unit.ts +62 -0
- package/src/social/brands.ts +22 -0
- package/src/social/card-drafts.ts +24 -0
- package/src/social/compose.ts +97 -0
- package/src/social/desk-index.ts +123 -0
- package/src/social/desk-wire.ts +64 -0
- package/src/social/drafts.ts +183 -0
- package/src/social/house.ts +24 -0
- package/src/social/load.ts +332 -0
- package/src/social/md.ts +70 -0
- package/src/social/media-facts.ts +53 -0
- package/src/social/media-kind.ts +189 -0
- package/src/social/media-limit.ts +42 -0
- package/src/social/media-of.ts +30 -0
- package/src/social/migrate.ts +123 -0
- package/src/social/open.ts +17 -0
- package/src/social/post-url.ts +158 -0
- package/src/social/presence.ts +332 -0
- package/src/social/public-read.ts +53 -0
- package/src/social/publish/bluesky.ts +168 -0
- package/src/social/publish/discord.ts +76 -0
- package/src/social/publish/index.ts +24 -0
- package/src/social/publish/secret.ts +13 -0
- package/src/social/push.ts +37 -0
- package/src/social/richtext.ts +37 -0
- package/src/social/routes.ts +186 -0
- package/src/social/stats.ts +134 -0
- package/src/social/text.ts +267 -0
- package/src/social/tracker-route.ts +39 -0
- package/src/social/tracker.ts +255 -0
- package/src/social/unit.ts +53 -0
- package/src/social/writes.ts +130 -0
- package/src/start-repo.ts +14 -9
- package/src/stores/collection.ts +27 -0
- package/src/stores/desk.ts +336 -0
- package/src/stores/model.ts +187 -0
- package/src/stores/routes.ts +126 -0
- package/src/stores/unit.ts +57 -0
- package/src/suite/calibrate.ts +127 -0
- package/src/suite/core-counters.ts +91 -0
- package/src/suite/judge-suites.ts +95 -35
- package/src/suite/suite-cli.ts +44 -10
- package/src/suite/suite-cpu-preload.ts +34 -9
- package/src/trace/tracer.ts +12 -5
- package/src/trailer/adapter.ts +5 -1
- package/src/trailer/build.ts +45 -12
- package/src/trailer/ffmpeg.ts +11 -0
- package/src/trailer/footage.ts +30 -13
- package/src/trailer/grammar.ts +18 -2
- package/src/trailer/graph.ts +28 -6
- package/src/trailer/holes.ts +1 -1
- package/src/trailer/passage.ts +18 -6
- package/src/trailer/plan.ts +74 -3
- package/src/trailer/prune.ts +1 -1
- package/src/trailer/states.ts +1 -1
- package/src/trailer/stitch.ts +67 -26
- package/src/trailer/url.ts +1 -1
- package/src/trailer/versions.ts +24 -0
- package/src/trailer/words.ts +1 -1
- package/src/ts/gate-typecheck.ts +32 -0
- package/src/ts/typecheck-cli.ts +9 -11
- package/src/tui/run-tui.ts +1 -1
- package/src/tui/tui-app.tsx +0 -1
- package/src/tui/tui-store.ts +1 -1
- package/src/veille/asks.ts +155 -0
- package/src/veille/auto.ts +31 -0
- package/src/veille/batch.ts +27 -0
- package/src/veille/chrome.ts +127 -0
- package/src/veille/collection.ts +28 -0
- package/src/veille/desk.ts +242 -0
- package/src/veille/identity.ts +80 -0
- package/src/veille/import.ts +68 -0
- package/src/veille/log.ts +183 -0
- package/src/veille/platforms.ts +118 -0
- package/src/veille/reads.ts +66 -0
- package/src/veille/replied.ts +110 -0
- package/src/veille/routes.ts +185 -0
- package/src/veille/service.ts +81 -0
- package/src/veille/watch.ts +116 -0
- package/src/veille/worth.ts +46 -0
- package/src/wiki/scan-md.ts +18 -0
- package/src/collections/posts.ts +0 -142
- package/src/contracts/manifests/social.contract.ts +0 -20
- package/src/scaffold/files/agent-coding.md +0 -35
- package/src/ts/typecheck-cache.ts +0 -11
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
// a repo's own pages (wiki tools/shipkit/project-pages.md), as the hub page holds them: the declared list, each
|
|
2
|
+
// page's badge (its declared route read through the proxy, else what its frame posted) and the words its frame
|
|
3
|
+
// gave. The frames themselves are the home's (FrameCache, pages-frames.tsx): they outlive a repo switch
|
|
4
|
+
import { makeAutoObservable, runInAction } from 'mobx'
|
|
5
|
+
import type { PageRow } from '../../pages/unit.ts'
|
|
6
|
+
import type { RepoSt } from './repo-st.ts'
|
|
7
|
+
|
|
8
|
+
export type PageBadge = { count: number; tone: 'red' | 'warn' | null; title?: string }
|
|
9
|
+
|
|
10
|
+
/** how often the declared badges are read again while the repo shows */
|
|
11
|
+
const BADGE_EVERY_MS = 30_000
|
|
12
|
+
const BADGE_WAIT_MS = 3_000
|
|
13
|
+
|
|
14
|
+
const badgeOf = (v: unknown): PageBadge | null => {
|
|
15
|
+
const b = v as { count?: unknown; tone?: unknown; title?: unknown } | null
|
|
16
|
+
if (b == null || typeof b.count !== 'number' || !Number.isFinite(b.count)) return null
|
|
17
|
+
const tone = b.tone === 'red' || b.tone === 'warn' ? b.tone : null
|
|
18
|
+
return { count: b.count, tone, ...(typeof b.title === 'string' ? { title: b.title } : {}) }
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export class PagesSvc {
|
|
22
|
+
list: PageRow[] = []
|
|
23
|
+
problem: string | null = null
|
|
24
|
+
loaded = false
|
|
25
|
+
/** by page: the badge its declared route answers */
|
|
26
|
+
declared = new Map<string, PageBadge>()
|
|
27
|
+
/** by page: the title and badge its frame posted, over the declared ones */
|
|
28
|
+
posted = new Map<string, { title?: string; badge?: PageBadge | null }>()
|
|
29
|
+
/** by page: the keys its frame posted last, so a row click opens it as it was left */
|
|
30
|
+
keys = new Map<string, string>()
|
|
31
|
+
private timer: ReturnType<typeof setInterval> | null = null
|
|
32
|
+
|
|
33
|
+
constructor(private st: RepoSt) {
|
|
34
|
+
makeAutoObservable<this, 'st' | 'timer'>(this, { st: false, timer: false })
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
find(id: string): PageRow | null {
|
|
38
|
+
return this.list.find((p) => p.id === id) ?? null
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** the page ⌥⇧ + this letter opens */
|
|
42
|
+
byKey(letter: string): PageRow | null {
|
|
43
|
+
return this.list.find((p) => p.key === letter) ?? null
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
badge(id: string): PageBadge | null {
|
|
47
|
+
const live = this.posted.get(id)
|
|
48
|
+
if (live?.badge !== undefined) return live.badge
|
|
49
|
+
return this.declared.get(id) ?? null
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
title(id: string): string {
|
|
53
|
+
return this.posted.get(id)?.title ?? this.find(id)?.title ?? id
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** where the page's frame loads: through the hub's proxy, on its origin */
|
|
57
|
+
src(id: string): string {
|
|
58
|
+
return this.st.url(`/page/${id}/`)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
post(id: string, m: { title?: unknown; badge?: unknown }): void {
|
|
62
|
+
const was = this.posted.get(id) ?? {}
|
|
63
|
+
const next = { ...was }
|
|
64
|
+
if (typeof m.title === 'string') next.title = m.title
|
|
65
|
+
if (m.badge !== undefined) next.badge = m.badge === null ? null : badgeOf(m.badge)
|
|
66
|
+
this.posted.set(id, next)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
async load(): Promise<void> {
|
|
70
|
+
try {
|
|
71
|
+
const r = await fetch(this.st.url('/api/pages.json'))
|
|
72
|
+
if (!r.ok) throw new Error(`${r.status} ${await r.text()}`)
|
|
73
|
+
const j = (await r.json()) as { pages: PageRow[]; problem: string | null }
|
|
74
|
+
runInAction(() => {
|
|
75
|
+
this.list = j.pages
|
|
76
|
+
this.problem = j.problem
|
|
77
|
+
this.loaded = true
|
|
78
|
+
})
|
|
79
|
+
} catch (e) {
|
|
80
|
+
runInAction(() => {
|
|
81
|
+
this.problem = `the pages list did not load: ${(e as Error).message}`
|
|
82
|
+
this.loaded = true
|
|
83
|
+
})
|
|
84
|
+
}
|
|
85
|
+
await this.readBadges()
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
private async readBadges(): Promise<void> {
|
|
89
|
+
await Promise.all(this.list.map(async (p) => {
|
|
90
|
+
if (p.badge == null) return
|
|
91
|
+
try {
|
|
92
|
+
const r = await fetch(`${this.src(p.id)}${p.badge}`, { signal: AbortSignal.timeout(BADGE_WAIT_MS) })
|
|
93
|
+
const b = r.ok ? badgeOf(await r.json()) : null
|
|
94
|
+
runInAction(() => { if (b == null) this.declared.delete(p.id); else this.declared.set(p.id, b) })
|
|
95
|
+
} catch {
|
|
96
|
+
// the page's process is down: its row says so through the process, never a stale number
|
|
97
|
+
runInAction(() => this.declared.delete(p.id))
|
|
98
|
+
}
|
|
99
|
+
}))
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
start(): void {
|
|
103
|
+
void this.load()
|
|
104
|
+
if (this.timer == null) this.timer = setInterval(() => void this.load(), BADGE_EVERY_MS)
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
stop(): void {
|
|
108
|
+
if (this.timer != null) clearInterval(this.timer)
|
|
109
|
+
this.timer = null
|
|
110
|
+
}
|
|
111
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// the one picker of the page (cmd+j, keys.ts), a node of the root: the
|
|
2
|
-
// home's places (inbox, home, activity, planned, insights, archived) first,
|
|
2
|
+
// home's places (inbox, home, activity, planned, insights, archived) first, the identities and each of their
|
|
3
|
+
// accounts (their view on the home), then the shown repo's own jump
|
|
3
4
|
// targets, then every other house repo as a place to go. Another repo's
|
|
4
5
|
// resources are never listed: a jump to a repo selects it in place, and its
|
|
5
6
|
// own targets are one more cmd+j away.
|
|
@@ -33,6 +34,18 @@ export class PaletteSt {
|
|
|
33
34
|
]
|
|
34
35
|
}
|
|
35
36
|
|
|
37
|
+
/** every identity, then each of its accounts: their view on the home. The accounts come once the identities answer */
|
|
38
|
+
get identities(): Jump[] {
|
|
39
|
+
const st = this.st
|
|
40
|
+
if (st.machine == null) return []
|
|
41
|
+
const full = st.identities.data?.identities
|
|
42
|
+
const rail = full ?? st.projects.identities.map((i) => ({ ...i, accounts: [] }))
|
|
43
|
+
return rail.flatMap((i) => [
|
|
44
|
+
{ id: `identity:${i.id}`, label: i.name, section: 'identity', face: { identity: i.id }, run: () => st.openIdentity({ id: i.id, part: null, place: null }) },
|
|
45
|
+
...i.accounts.map((a) => ({ id: `account:${i.id}/${a.id}`, label: `${i.name} · ${a.name}`, section: 'account', face: { identity: i.id, account: a.id }, run: () => st.openIdentity({ id: i.id, part: a.id, place: null }) })),
|
|
46
|
+
])
|
|
47
|
+
}
|
|
48
|
+
|
|
36
49
|
/** every house repo but the one on screen, as a place to go: on a
|
|
37
50
|
* global page that is every repo */
|
|
38
51
|
get others(): Jump[] {
|
|
@@ -43,7 +56,7 @@ export class PaletteSt {
|
|
|
43
56
|
}
|
|
44
57
|
|
|
45
58
|
get jumps(): Jump[] {
|
|
46
|
-
return [...this.places, ...(this.st.shown?.jumps ?? []), ...this.others]
|
|
59
|
+
return [...this.places, ...this.identities, ...(this.st.shown?.jumps ?? []), ...this.others]
|
|
47
60
|
}
|
|
48
61
|
|
|
49
62
|
/** ranked: prefix matches first, then substring. With no query, home,
|
|
@@ -54,8 +67,9 @@ export class PaletteSt {
|
|
|
54
67
|
if (q === '') {
|
|
55
68
|
const own = this.st.shown?.jumps ?? []
|
|
56
69
|
const places = this.places
|
|
70
|
+
const ids = this.identities.filter((j) => j.section === 'identity')
|
|
57
71
|
const others = this.others
|
|
58
|
-
return [...places, ...own.slice(0, Math.max(4, PAL_ROWS - places.length - others.length)), ...others]
|
|
72
|
+
return [...places, ...ids, ...own.slice(0, Math.max(4, PAL_ROWS - places.length - ids.length - others.length)), ...others]
|
|
59
73
|
}
|
|
60
74
|
const pre: Jump[] = []
|
|
61
75
|
const sub: Jump[] = []
|
|
@@ -69,6 +83,7 @@ export class PaletteSt {
|
|
|
69
83
|
|
|
70
84
|
toggle(): void {
|
|
71
85
|
this.open = !this.open
|
|
86
|
+
if (this.open) this.st.identities.ensure()
|
|
72
87
|
this.query = ''
|
|
73
88
|
this.idx = 0
|
|
74
89
|
}
|
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
// the one picker, cmd+j (palette-st.ts): home, activity, planned and
|
|
2
|
-
// archived, the shown repo's targets, then every other repo. A place wears
|
|
3
|
-
// its button's icon, a repo its own icon, as the project list shows them
|
|
2
|
+
// archived, the identities and their accounts, the shown repo's targets, then every other repo. A place wears
|
|
3
|
+
// its button's icon, a repo its own icon, as the project list shows them, an identity its avatar, an account its
|
|
4
|
+
// platform's logo.
|
|
4
5
|
import { observer } from 'mobx-react-lite'
|
|
5
6
|
import type { HomeSt } from './home-st.ts'
|
|
6
7
|
import { Icon, ICON } from './icons.tsx'
|
|
7
8
|
import { Face } from './project-list.tsx'
|
|
9
|
+
import { Logo } from './social/kit.tsx'
|
|
8
10
|
import type { JumpFace } from './repo-st.ts'
|
|
9
11
|
|
|
10
12
|
/** the icon a picker entry wears; an empty slot keeps the labels aligned */
|
|
11
13
|
const PalFace = observer(({ app, face }: { app: HomeSt; face: JumpFace | undefined }) => {
|
|
12
14
|
if (face != null && 'place' in face) return <span className="pface"><Icon d={ICON[face.place]} /></span>
|
|
15
|
+
if (face != null && 'identity' in face) {
|
|
16
|
+
if (face.account != null) return <span className="pface"><Logo id={face.account} name={face.account} size={16} /></span>
|
|
17
|
+
const i = app.projects.identities.find((x) => x.id === face.identity)
|
|
18
|
+
return <span className="pface">{i?.mark != null ? <img src={i.mark} alt="" width={16} height={16} style={{ borderRadius: '50%' }} /> : <span className="pgi h1">{(i?.name ?? face.identity).charAt(0).toUpperCase()}</span>}</span>
|
|
19
|
+
}
|
|
13
20
|
const p = face == null ? null : app.projects.list.find((x) => x.name === face.repo) ?? null
|
|
14
21
|
return <span className="pface">{p == null ? null : <Face p={p} px={16} />}</span>
|
|
15
22
|
})
|
|
@@ -15,6 +15,7 @@ import type { HomeSt } from './home-st.ts'
|
|
|
15
15
|
import { checkAddress, plainClick, repoPage } from './home-st.ts'
|
|
16
16
|
import { LAST_TONE, markOf, reasonWords, whenWords, type Section } from './planned-st.ts'
|
|
17
17
|
import { ageWords, stampWords } from './time-ago.tsx'
|
|
18
|
+
import { Caret } from './icons.tsx'
|
|
18
19
|
|
|
19
20
|
/** a link that works as one (a new tab on cmd+click) and moves in place on a plain click */
|
|
20
21
|
const InPlace = ({ href, className, go, children }: { href: string; className: string; go: () => void; children: ReactNode }) => (
|
|
@@ -105,7 +106,7 @@ export const PlannedView = observer(({ app }: { app: HomeSt }) => {
|
|
|
105
106
|
</div>
|
|
106
107
|
{st.waitingLine !== '' ? (
|
|
107
108
|
<div className="plwait">
|
|
108
|
-
<button className="plwaitline" aria-expanded={st.waitingOpen} onClick={() => st.toggleWaiting()}
|
|
109
|
+
<button className="plwaitline" aria-expanded={st.waitingOpen} onClick={() => st.toggleWaiting()}><Caret open={st.waitingOpen} /> {st.waitingLine}</button>
|
|
109
110
|
{st.waitingOpen ? <div className="pllist">{st.waiting.map((r) => <Row key={`${r.repo}\0${r.check}`} app={app} r={r} now={now} />)}</div> : null}
|
|
110
111
|
</div>
|
|
111
112
|
) : null}
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
here AND as attributes on the img (ROW_ICON), so a sheet that fails to
|
|
6
6
|
apply still draws a row, never a 512px icon. */
|
|
7
7
|
.pjlist{flex:1;width:100%;height:100%;display:flex;flex-direction:column;background:var(--bg-side);min-width:0}
|
|
8
|
-
/* the
|
|
9
|
-
a thin divider before the repos */
|
|
8
|
+
/* the list's trouble line, above the identities: the places are the top bar's (home-strip.tsx) */
|
|
10
9
|
.pjhead{flex:none;display:flex;flex-direction:column;padding:var(--s1) 0;border-bottom:1px solid var(--line)}
|
|
11
10
|
/* the rows scroll, the head does not, and no scrollbar draws a band beside
|
|
12
11
|
them: WebKit (the macOS app) ignores scrollbar-width, hence the pseudo */
|
|
13
|
-
.
|
|
12
|
+
/* the list's own controls, drawn in the dock's bar (dock-view.tsx ListFoot): one line, no rule of its own */
|
|
13
|
+
.pjfoot{flex:none;display:flex;align-items:center;gap:var(--s1);margin-left:auto}
|
|
14
14
|
/* the archived rows, just above the foot while its archived button is on:
|
|
15
15
|
the rows panel gives up the room, the foot stays put */
|
|
16
16
|
.pjarch{flex:none;border-top:1px solid var(--line);max-height:40%;overflow-y:auto;scrollbar-width:none;padding:var(--s1) 0}
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
color:var(--dim);font-size:11px;cursor:pointer}
|
|
27
27
|
.pgsort{flex:0 1 auto;min-width:0}
|
|
28
28
|
/* the step keys, a hint: the repo above or below */
|
|
29
|
-
.pjstep{flex:none;display:inline-flex;gap:var(--s0);
|
|
29
|
+
.pjstep{flex:none;display:inline-flex;gap:var(--s0);color:var(--dim);font-size:11px}
|
|
30
30
|
.pjstep kbd{padding:0 var(--s1);border:1px solid var(--line);border-radius:3px;font:inherit}
|
|
31
31
|
.pgsortl{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
32
32
|
.pgsort .hico,.pjarbtn .hico,.pjfold .hico{flex:none;width:14px;height:14px}
|
|
@@ -45,16 +45,15 @@
|
|
|
45
45
|
.pjrows{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;padding:var(--s1) 0;scrollbar-width:none}
|
|
46
46
|
.pjrows::-webkit-scrollbar{display:none}
|
|
47
47
|
.pjwait{display:flex;align-items:center;gap:var(--s2);padding:var(--s1) var(--s3);font-size:12px;color:var(--dim)}
|
|
48
|
-
.pjrow
|
|
48
|
+
.pjrow{position:relative;display:flex;align-items:center;gap:var(--s2);width:100%;height:28px;padding:0 var(--s3);
|
|
49
49
|
background:transparent;border:0;border-radius:0;text-align:left;color:var(--dim);font-size:13px;cursor:pointer}
|
|
50
|
-
.pjrow:hover
|
|
50
|
+
.pjrow:hover{background:var(--panel2);color:var(--ink)}
|
|
51
51
|
/* the shown repo: its row lit, marked on the left in its identity colour
|
|
52
52
|
(a global page's line: in the accent) */
|
|
53
53
|
/* the repo's colour for the theme: colorDark, or colorLight on a light page (projects-svc idVars) */
|
|
54
54
|
.pjrow{--pjc:var(--idd)}
|
|
55
55
|
:root[data-theme=light] .pjrow{--pjc:var(--idl)}
|
|
56
|
-
.pjrow.cur
|
|
57
|
-
.pjpl .hico{flex:none;width:18px;height:18px;color:inherit}
|
|
56
|
+
.pjrow.cur{background:var(--sel);color:var(--pjc,var(--ink));box-shadow:inset 3px 0 0 var(--pjc,var(--accent));font-weight:600}
|
|
58
57
|
/* the selected repo while a global page is up: still marked, dimmer */
|
|
59
58
|
.pjrow.cur.away{background:none;font-weight:500}
|
|
60
59
|
.pjrow img,.pjrow .pgi{flex:none;width:18px;height:18px;border-radius:4px;object-fit:contain;pointer-events:none}
|
|
@@ -73,7 +72,7 @@
|
|
|
73
72
|
.pjrow.dim .pjname{opacity:.5}
|
|
74
73
|
/* ⌘1 to ⌘9 select the first nine rows (keys.ts): the hint sits at the row's end */
|
|
75
74
|
.pjkey{flex:none;font:10px/1 ui-monospace,Menlo,monospace;color:var(--dim);opacity:.6;background:none;border:0;padding:0}
|
|
76
|
-
.pjrow:hover .pjkey,.pjrow.cur .pjkey
|
|
75
|
+
.pjrow:hover .pjkey,.pjrow.cur .pjkey{opacity:1}
|
|
77
76
|
/* what waits on the owner, at the end of the row: the review cards (a click opens them), then the open asks */
|
|
78
77
|
.pga,.pgr{flex:none;min-width:16px;height:16px;padding:0 var(--s1);border-radius:8px;
|
|
79
78
|
font-size:10px;font-weight:700;line-height:16px;text-align:center;color:var(--bg);background:var(--warn)}
|
|
@@ -129,18 +128,23 @@
|
|
|
129
128
|
⌘ hints and the step hint hide, every icon centres, the badge and the dots
|
|
130
129
|
ride the icon's corner, the foot stacks its buttons */
|
|
131
130
|
.pjlist.rail .pjname,.pjlist.rail .pjkey,.pjlist.rail .pjstep,.pjlist.rail .pgsortl,.pjlist.rail .pjarow span,.pjlist.rail .pgerr{display:none}
|
|
132
|
-
.pjlist.rail .pjrow,.pjlist.rail .
|
|
131
|
+
.pjlist.rail .pjrow,.pjlist.rail .pjarow{justify-content:center;padding:0}
|
|
133
132
|
/* the rail's icon size (layout-st RAIL_ICONS, the foot's S M L button): the repo icons and the row under them grow */
|
|
134
133
|
.pjlist.rail .pjrow{height:calc(var(--ri,24px) + 6px)}
|
|
135
134
|
.pjlist.rail .pjrow img,.pjlist.rail .pjrow .pgi{width:var(--ri,24px);height:var(--ri,24px);border-radius:6px}
|
|
136
135
|
.pjlist.rail .pjrow .pgi{font-size:calc(var(--ri,24px) * .5)}
|
|
137
136
|
/* the app icon is a rounded plate already (core/app-icon.ts) */
|
|
138
|
-
.pjlist.rail .pjrow
|
|
137
|
+
.pjlist.rail .pjrow .pjapp img{border-radius:0}
|
|
138
|
+
/* the plates are loud colours, so only the shown repo's is lit: a row not shown wears its faded plate
|
|
139
|
+
(core/app-icon.ts plateAlpha) at 70%, its mark still readable, hover lights it, the badges stay lit */
|
|
140
|
+
.pjapp{position:relative;flex:none;display:flex;pointer-events:none}
|
|
141
|
+
.pjapp .pjdim{position:absolute;inset:0;opacity:0}
|
|
142
|
+
.pjlist.rail .pjrow img,.pjlist.rail .pjrow .pgi{transition:opacity .12s,background .12s}
|
|
143
|
+
.pjlist.rail .pjrow:not(.cur):not(:hover) .pjapp img{opacity:0}
|
|
144
|
+
.pjlist.rail .pjrow:not(.cur):not(:hover) .pjapp .pjdim,.pjlist.rail .pjrow:not(.cur):not(:hover) > img{opacity:.7}
|
|
145
|
+
.pjlist.rail .pjrow:not(.cur):not(:hover) .pgi{opacity:.7;background:color-mix(in srgb,var(--c) 10%,transparent)}
|
|
139
146
|
.pjsize{font:600 10px/1 ui-monospace,Menlo,monospace}
|
|
140
147
|
.pjlist.rail .pga,.pjlist.rail .pgr{position:absolute;top:0;min-width:14px;height:14px;padding:0 var(--s0);border-radius:7px;font-size:9px;line-height:14px}
|
|
141
148
|
.pjlist.rail .pga{right:calc(50% - var(--ri,24px) / 2 - 4px)}
|
|
142
149
|
.pjlist.rail .pgr{left:calc(50% - var(--ri,24px) / 2 - 4px)}
|
|
143
150
|
.pjlist.rail .pgd,.pjlist.rail .pgw{position:absolute;bottom:var(--s0);right:calc(50% - var(--ri,24px) / 2 - 2px)}
|
|
144
|
-
.pjlist.rail .pjfoot{flex-direction:column;height:auto;padding:var(--s1) 0}
|
|
145
|
-
.pjlist.rail .pjfoot button{justify-content:center;width:28px;padding:0}
|
|
146
|
-
.pjlist.rail .pjarbtn span{display:none}
|
|
@@ -17,11 +17,9 @@
|
|
|
17
17
|
// the foot never moving. ⌘B (or the foot's fold button, or a drag of the
|
|
18
18
|
// separator below the list's min) folds the list to its icon rail: the
|
|
19
19
|
// names, the ⌘ hints and the step hint hide, the pills ride the icon's
|
|
20
|
-
// corners, the hover card still names the row; a phone width is always the rail.
|
|
21
|
-
//
|
|
22
|
-
//
|
|
23
|
-
// renders from the first paint with the list this browser kept, so a load
|
|
24
|
-
// moves nothing.
|
|
20
|
+
// corners, the hover card still names the row; a phone width is always the rail. The home's places and the identities
|
|
21
|
+
// ride the top bar (Places, Identities: home-strip.tsx), so the list holds only the repos. It renders from the first paint with the list this browser kept, so a
|
|
22
|
+
// load moves nothing.
|
|
25
23
|
import { autoUpdate, FloatingPortal, useDismiss, useFloating, useHover, useInteractions, useRole } from '@floating-ui/react'
|
|
26
24
|
import { observer } from 'mobx-react-lite'
|
|
27
25
|
import { useEffect, type CSSProperties } from 'react'
|
|
@@ -29,6 +27,7 @@ import { middleware, OPEN_MS } from './floating.tsx'
|
|
|
29
27
|
import { Icon, ICON } from './icons.tsx'
|
|
30
28
|
import { plainClick } from './home-st.ts'
|
|
31
29
|
import { PICKER_KEY, PLACE_KEY, RAIL_KEY, STEP_KEYS } from './keys.ts'
|
|
30
|
+
import type { RailIdentity } from '../../identities/machine.ts'
|
|
32
31
|
import { cardModel, faceOf, hueOf, idVars, SORTS, type Place, type Project, type ProjectsSvc } from './projects-svc.ts'
|
|
33
32
|
import { THEMES, type ThemePick } from './theme-st.ts'
|
|
34
33
|
import { RAIL_ICONS, type RailIcon } from './layout-st.ts'
|
|
@@ -99,7 +98,12 @@ export const Row = observer(({ app, p, i }: { app: ListHost; p: Project; i: numb
|
|
|
99
98
|
onDragEnd: () => s.dragEnd(),
|
|
100
99
|
})}>
|
|
101
100
|
{app.layout?.folded === true && p.appIcon != null
|
|
102
|
-
?
|
|
101
|
+
? (
|
|
102
|
+
<span className="pjapp">
|
|
103
|
+
<img src={p.appIcon} alt="" width={ROW_ICON} height={ROW_ICON} draggable={false} />
|
|
104
|
+
<img className="pjdim" src={p.appIconDim ?? p.appIcon} alt="" width={ROW_ICON} height={ROW_ICON} draggable={false} />
|
|
105
|
+
</span>
|
|
106
|
+
)
|
|
103
107
|
: <Face p={p} px={ROW_ICON} />}
|
|
104
108
|
<span className="pjname">{p.name}</span>
|
|
105
109
|
{face.cards != null ? (
|
|
@@ -123,6 +127,30 @@ export const Row = observer(({ app, p, i }: { app: ListHost; p: Project; i: numb
|
|
|
123
127
|
)
|
|
124
128
|
})
|
|
125
129
|
|
|
130
|
+
/** an identity in the top bar: its avatar, else its initial on its colour; lit in its colour while its view shows,
|
|
131
|
+
* its name in the hover, a click its view */
|
|
132
|
+
const IdentityFace = observer(({ s, i }: { s: ProjectsSvc; i: RailIdentity }) => {
|
|
133
|
+
const style = i.colour == null ? undefined : ({ '--idc': i.colour } as CSSProperties)
|
|
134
|
+
const on = s.identityLit() === i.id
|
|
135
|
+
const repos = s.list.filter((p) => p.speaksAs === i.id || (p.speaksAs == null && i.default)).length
|
|
136
|
+
return (
|
|
137
|
+
<button className={`hid${on ? ' cur' : ''}`} style={style} aria-label={`identity ${i.name}`}
|
|
138
|
+
title={`${i.name}${i.default ? ', the default identity' : ''}: its profile, its company, every account on its own page; ${repos} repo${repos === 1 ? '' : 's'} speak as it`}
|
|
139
|
+
onClick={() => s.onIdentity?.(i.id)}>
|
|
140
|
+
{i.mark != null ? <img className="hidm" src={i.mark} alt="" width={ID_ICON} height={ID_ICON} draggable={false} /> : <span className="hidm hidi">{i.name.charAt(0).toUpperCase()}</span>}
|
|
141
|
+
</button>
|
|
142
|
+
)
|
|
143
|
+
})
|
|
144
|
+
|
|
145
|
+
const ID_ICON = 28
|
|
146
|
+
|
|
147
|
+
/** the identities as avatars in the top bar, after the places (home-strip.tsx); nothing when the home has none */
|
|
148
|
+
export const Identities = observer(({ s }: { s: ProjectsSvc }) => (s.onIdentity == null || s.identities.length === 0 ? null : (
|
|
149
|
+
<span className="hids" aria-label="identities">
|
|
150
|
+
{s.identities.map((i) => <IdentityFace key={i.id} s={s} i={i} />)}
|
|
151
|
+
</span>
|
|
152
|
+
)))
|
|
153
|
+
|
|
126
154
|
// the img carries its size as attributes too: an icon file is 512px, and
|
|
127
155
|
// without them a sheet that fails to apply draws it at that size
|
|
128
156
|
export const Face = ({ p, px }: { p: Project; px: number }) => (p.icon != null
|
|
@@ -180,25 +208,7 @@ export const ProjectList = observer(({ app }: { app: ListHost }) => {
|
|
|
180
208
|
const rail = lay?.folded === true
|
|
181
209
|
return (
|
|
182
210
|
<nav className={`pjlist${rail ? ' rail' : ''}`} aria-label="projects" style={rail ? ({ '--ri': `${RAIL_ICONS[lay!.railIcon]}px` } as CSSProperties) : undefined}>
|
|
183
|
-
{s.
|
|
184
|
-
<div className="pjhead">
|
|
185
|
-
{PLACES.map((pl) => {
|
|
186
|
-
const id = pl.id
|
|
187
|
-
const run = id === 'picker' ? s.onPicker : s.onPlace == null ? null : () => s.onPlace?.(id)
|
|
188
|
-
if (run == null) return null
|
|
189
|
-
const on = id === 'picker' ? s.pickerOpen() : s.place === id
|
|
190
|
-
const key = id === 'picker' ? PICKER_KEY : PLACE_KEY[id]
|
|
191
|
-
return (
|
|
192
|
-
<button key={id} className={`pjpl${on ? ' cur' : ''}`} aria-label={pl.label} title={key == null ? pl.title : `${pl.title} (${key})`} onClick={run}>
|
|
193
|
-
<Icon d={ICON[id === 'picker' ? 'search' : id === 'overview' ? 'home' : id]} />
|
|
194
|
-
<span className="pjname">{pl.label}</span>
|
|
195
|
-
{key == null ? null : <kbd className="pjkey">{key}</kbd>}
|
|
196
|
-
</button>
|
|
197
|
-
)
|
|
198
|
-
})}
|
|
199
|
-
{s.error !== '' ? <span className="pgerr" title={s.error}>! {s.error}</span> : null}
|
|
200
|
-
</div>
|
|
201
|
-
)}
|
|
211
|
+
{s.error !== '' ? <div className="pjhead"><span className="pgerr" title={s.error}>! {s.error}</span></div> : null}
|
|
202
212
|
<div className="pjrows">
|
|
203
213
|
{s.list.length === 0 && s.error === '' ? <span className="pjwait"><span className="spin" />reading the repos…</span> : null}
|
|
204
214
|
{s.list.map((p, i) => <Row key={p.name} app={app} p={p} i={i} />)}
|
|
@@ -217,34 +227,63 @@ export const ProjectList = observer(({ app }: { app: ListHost }) => {
|
|
|
217
227
|
))}
|
|
218
228
|
</div>
|
|
219
229
|
) : null}
|
|
220
|
-
<div className="pjfoot">
|
|
221
|
-
{lay == null ? null : (
|
|
222
|
-
<button className="pjfold" aria-pressed={rail} title={`${rail ? 'show the names' : 'fold the list to its icons'} (${RAIL_KEY})`} onClick={() => lay.toggleRail()}>
|
|
223
|
-
<Icon d={ICON.rail} />
|
|
224
|
-
</button>
|
|
225
|
-
)}
|
|
226
|
-
{lay == null || !rail ? null : (
|
|
227
|
-
<button className="pjfold pjsize" aria-label={`icon size: ${lay.railIcon}`} title={`the icons: ${SIZE_WORDS[lay.railIcon]}; click for the next size`} onClick={() => lay.cycleRailIcon()}>
|
|
228
|
-
{lay.railIcon.toUpperCase()}
|
|
229
|
-
</button>
|
|
230
|
-
)}
|
|
231
|
-
{app.theme == null ? null : <ThemeButton t={app.theme} />}
|
|
232
|
-
<SortButton s={s} />
|
|
233
|
-
<span className="pjstep" title={`${STEP_KEYS[0]} and ${STEP_KEYS[1]} open the repo above or below, from any page`}>
|
|
234
|
-
{STEP_KEYS.map((k) => <kbd key={k}>{k}</kbd>)}
|
|
235
|
-
</span>
|
|
236
|
-
{s.archived.length === 0 || s.onArchived == null ? null : (
|
|
237
|
-
<button className={`pjarbtn${s.archivedOpen ? ' on' : ''}`} aria-pressed={s.archivedOpen}
|
|
238
|
-
title={`${s.archivedOpen ? 'hide' : 'show'} the ${s.archived.length} archived repos: nothing runs there, a row opens the archived page`}
|
|
239
|
-
onClick={() => s.toggleArchivedOpen()}>
|
|
240
|
-
<Icon d={ICON.archived} /><span>{s.archived.length}</span>
|
|
241
|
-
</button>
|
|
242
|
-
)}
|
|
243
|
-
</div>
|
|
244
230
|
</nav>
|
|
245
231
|
)
|
|
246
232
|
})
|
|
247
233
|
|
|
234
|
+
/** the home's places as icon buttons (the picker's ⌘J, then each place's key): the top bar draws them
|
|
235
|
+
* (home-strip.tsx), the list holds only the repos */
|
|
236
|
+
export const Places = observer(({ s }: { s: ProjectsSvc }) => (
|
|
237
|
+
<span className="hplaces" aria-label="the home's pages">
|
|
238
|
+
{PLACES.map((pl) => {
|
|
239
|
+
const id = pl.id
|
|
240
|
+
const run = id === 'picker' ? s.onPicker : s.onPlace == null ? null : () => s.onPlace?.(id)
|
|
241
|
+
if (run == null) return null
|
|
242
|
+
const on = id === 'picker' ? s.pickerOpen() : s.place === id
|
|
243
|
+
const key = id === 'picker' ? PICKER_KEY : PLACE_KEY[id]
|
|
244
|
+
return (
|
|
245
|
+
<button key={id} className={`hicon hpl${on ? ' cur' : ''}`} aria-label={pl.label} title={key == null ? pl.title : `${pl.title} (${key})`} onClick={run}>
|
|
246
|
+
<Icon d={ICON[id === 'picker' ? 'search' : id === 'overview' ? 'home' : id]} />
|
|
247
|
+
</button>
|
|
248
|
+
)
|
|
249
|
+
})}
|
|
250
|
+
</span>
|
|
251
|
+
))
|
|
252
|
+
|
|
253
|
+
/** the list's own controls (fold it to its rail, its icon size, the theme, the sort, the step keys, the archived
|
|
254
|
+
* repos): the dock's bar draws them (dock-view.tsx), so the rail's foot holds nothing */
|
|
255
|
+
export const ListFoot = observer(({ app }: { app: ListHost }) => {
|
|
256
|
+
const s = app.projects
|
|
257
|
+
const lay = app.layout
|
|
258
|
+
const rail = lay?.folded === true
|
|
259
|
+
return (
|
|
260
|
+
<span className="pjfoot">
|
|
261
|
+
{lay == null ? null : (
|
|
262
|
+
<button className="pjfold" aria-pressed={rail} title={`${rail ? 'show the names' : 'fold the list to its icons'} (${RAIL_KEY})`} onClick={() => lay.toggleRail()}>
|
|
263
|
+
<Icon d={ICON.rail} />
|
|
264
|
+
</button>
|
|
265
|
+
)}
|
|
266
|
+
{lay == null || !rail ? null : (
|
|
267
|
+
<button className="pjfold pjsize" aria-label={`icon size: ${lay.railIcon}`} title={`the icons: ${SIZE_WORDS[lay.railIcon]}; click for the next size`} onClick={() => lay.cycleRailIcon()}>
|
|
268
|
+
{lay.railIcon.toUpperCase()}
|
|
269
|
+
</button>
|
|
270
|
+
)}
|
|
271
|
+
{app.theme == null ? null : <ThemeButton t={app.theme} />}
|
|
272
|
+
<SortButton s={s} />
|
|
273
|
+
<span className="pjstep" title={`${STEP_KEYS[0]} and ${STEP_KEYS[1]} open the repo above or below, from any page`}>
|
|
274
|
+
{STEP_KEYS.map((k) => <kbd key={k}>{k}</kbd>)}
|
|
275
|
+
</span>
|
|
276
|
+
{s.archived.length === 0 || s.onArchived == null ? null : (
|
|
277
|
+
<button className={`pjarbtn${s.archivedOpen ? ' on' : ''}`} aria-pressed={s.archivedOpen}
|
|
278
|
+
title={`${s.archivedOpen ? 'hide' : 'show'} the ${s.archived.length} archived repos: nothing runs there, a row opens the archived page`}
|
|
279
|
+
onClick={() => s.toggleArchivedOpen()}>
|
|
280
|
+
<Icon d={ICON.archived} /><span>{s.archived.length}</span>
|
|
281
|
+
</button>
|
|
282
|
+
)}
|
|
283
|
+
</span>
|
|
284
|
+
)
|
|
285
|
+
})
|
|
286
|
+
|
|
248
287
|
const SIZE_WORDS: Record<RailIcon, string> = { s: 'small', m: 'medium', l: 'large' }
|
|
249
288
|
|
|
250
289
|
const THEME_ICON: Record<ThemePick, keyof typeof ICON> = { dark: 'moon', light: 'sun', auto: 'auto' }
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
// server measures at most once per 5s whatever the number of tabs, so this
|
|
4
4
|
// poll is cheap.
|
|
5
5
|
import { makeAutoObservable, observableRef, runInAction } from 'mobx'
|
|
6
|
-
import type { ArchivedRow, ProjectRow as Project
|
|
6
|
+
import type { ArchivedRow, ProjectRow as Project } from '../project-gutter-route.ts'
|
|
7
|
+
import type { RailIdentity } from '../../identities/machine.ts'
|
|
7
8
|
import { identityOfName, type Identity } from '../../core/identity-color.ts'
|
|
8
9
|
import { ownTrouble, reach } from './reach.ts'
|
|
9
10
|
|
|
@@ -69,6 +70,18 @@ export function loadList(): Project[] {
|
|
|
69
70
|
}
|
|
70
71
|
}
|
|
71
72
|
|
|
73
|
+
/** where this browser keeps the identities the rail's band draws */
|
|
74
|
+
export const IDENTITIES_KEY = 'hub:identities'
|
|
75
|
+
|
|
76
|
+
export function loadIdentityList(): RailIdentity[] {
|
|
77
|
+
try {
|
|
78
|
+
const v = JSON.parse(globalThis.localStorage?.getItem(IDENTITIES_KEY) ?? '[]') as unknown
|
|
79
|
+
return Array.isArray(v) && v.every((i) => typeof (i as RailIdentity)?.id === 'string') ? (v as RailIdentity[]) : []
|
|
80
|
+
} catch {
|
|
81
|
+
return []
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
72
85
|
/** keeps the list for the next load; false when storage refused it */
|
|
73
86
|
export function saveList(list: Project[]): boolean {
|
|
74
87
|
try {
|
|
@@ -198,6 +211,12 @@ export class ProjectsSvc {
|
|
|
198
211
|
/** the repos whose repo.config.ts says `archived: true`: never in `list`,
|
|
199
212
|
* only on the archived page */
|
|
200
213
|
archived: ArchivedRow[] = []
|
|
214
|
+
/** every identity of the machine, in their order: the rail's middle band (wiki tools/shipkit/social.md, Identities) */
|
|
215
|
+
identities: RailIdentity[] = loadIdentityList()
|
|
216
|
+
/** a click on an identity: the home opens its identity view; a hub of its own has none */
|
|
217
|
+
onIdentity: ((id: string) => void) | null = null
|
|
218
|
+
/** the identity whose view the home shows, lit in the band; null on any other page */
|
|
219
|
+
identityLit: () => string | null = () => null
|
|
201
220
|
/** the archived button at the foot of the rail is on, its rows shown, per browser */
|
|
202
221
|
archivedOpen = keptOpen()
|
|
203
222
|
/** the sort menu at the foot of the rail is open */
|
|
@@ -249,7 +268,7 @@ export class ProjectsSvc {
|
|
|
249
268
|
private orderGen = 0
|
|
250
269
|
|
|
251
270
|
constructor() {
|
|
252
|
-
makeAutoObservable<this, 'gen' | 'orderGen' | 'identitySaves' | 'saveIdentity' | 'kept' | 'keep'>(this, { gen: false, orderGen: false, identitySaves: false, saveIdentity: false, kept: false, keep: false, list: observableRef, onSelect: false, onPlace: false, onPicker: false, pickerOpen: false, onArchived: false, dotOf: false, warnOf: false })
|
|
271
|
+
makeAutoObservable<this, 'gen' | 'orderGen' | 'identitySaves' | 'saveIdentity' | 'kept' | 'keep' | 'keptIds'>(this, { gen: false, orderGen: false, identitySaves: false, saveIdentity: false, kept: false, keep: false, keptIds: false, list: observableRef, identities: observableRef, onIdentity: false, identityLit: false, onSelect: false, onPlace: false, onPicker: false, pickerOpen: false, onArchived: false, dotOf: false, warnOf: false })
|
|
253
272
|
}
|
|
254
273
|
|
|
255
274
|
toggleArchivedOpen(): void {
|
|
@@ -455,20 +474,31 @@ export class ProjectsSvc {
|
|
|
455
474
|
if (!this.fresh) return
|
|
456
475
|
const s = JSON.stringify(this.list)
|
|
457
476
|
if (s !== this.kept && saveList(this.list)) this.kept = s
|
|
477
|
+
const ids = JSON.stringify(this.identities)
|
|
478
|
+
if (ids !== this.keptIds) {
|
|
479
|
+
try {
|
|
480
|
+
globalThis.localStorage?.setItem(IDENTITIES_KEY, ids)
|
|
481
|
+
this.keptIds = ids
|
|
482
|
+
} catch {
|
|
483
|
+
// storage refused: the band paints once the poll answers
|
|
484
|
+
}
|
|
485
|
+
}
|
|
458
486
|
}
|
|
487
|
+
private keptIds = ''
|
|
459
488
|
|
|
460
489
|
async load(): Promise<void> {
|
|
461
490
|
const order = this.orderGen
|
|
462
491
|
try {
|
|
463
492
|
const r = await reach('/api/projects.json')
|
|
464
493
|
if (!r.ok) throw new Error(`${r.status} ${await r.text()}`)
|
|
465
|
-
const j = (await r.json()) as { projects: Project[]; archived?: ArchivedRow[] }
|
|
494
|
+
const j = (await r.json()) as { projects: Project[]; archived?: ArchivedRow[]; identities?: RailIdentity[] }
|
|
466
495
|
runInAction(() => {
|
|
467
496
|
// a reorder since this left, or a drag in flight: the next poll answers
|
|
468
497
|
if (order !== this.orderGen || this.drag != null) return
|
|
469
498
|
const mine = new Map(this.list.filter((p) => this.identitySaves.has(p.name)).map((p) => [p.name, p.identity]))
|
|
470
499
|
this.list = mine.size === 0 ? j.projects : j.projects.map((p) => (mine.has(p.name) ? { ...p, identity: mine.get(p.name)! } : p))
|
|
471
500
|
this.archived = j.archived ?? []
|
|
501
|
+
this.identities = j.identities ?? []
|
|
472
502
|
this.error = ''
|
|
473
503
|
this.fresh = true
|
|
474
504
|
})
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
// own has none of the three. The counts read the severity filter, like everything under them,
|
|
9
9
|
// and come from what the page already holds (the kept screen on a reload), so
|
|
10
10
|
// none arrives late and moves the tree.
|
|
11
|
-
import { REVIEW_COL, RUNS_ID, TRAILER_COL } from '../../collections/collection-types.ts'
|
|
11
|
+
import { REVIEW_COL, RUNS_ID, STORES_COL, TRAILER_COL, VEILLE_COL } from '../../collections/collection-types.ts'
|
|
12
12
|
import type { CheckOwner, HashSel } from './hash-route.ts'
|
|
13
13
|
import { sectionLabel, type SectionId } from './keys.ts'
|
|
14
14
|
import type { RepoSt } from './repo-st.ts'
|
|
@@ -47,9 +47,13 @@ export function sectionOfSel(sel: HashSel | null, ownerOf: (checkItemId: string)
|
|
|
47
47
|
case 'admin': return 'admin'
|
|
48
48
|
case 'review': return 'review'
|
|
49
49
|
case 'trailer': return 'trailer'
|
|
50
|
+
case 'stores': return 'stores'
|
|
51
|
+
case 'veille': return 'veille'
|
|
52
|
+
case 'comms': return 'comms'
|
|
53
|
+
case 'social': return 'social'
|
|
50
54
|
case 'tests': return 'tests'
|
|
51
55
|
case 'asset': case 'cat': return 'media'
|
|
52
|
-
case 'status': return null
|
|
56
|
+
case 'status': case 'page': return null
|
|
53
57
|
case 'col': case 'item': {
|
|
54
58
|
const col = sel.t === 'col' ? sel.id : sel.col
|
|
55
59
|
if (col === RUNS_ID) return 'runs'
|
|
@@ -58,6 +62,8 @@ export function sectionOfSel(sel: HashSel | null, ownerOf: (checkItemId: string)
|
|
|
58
62
|
if (col === 'creds') return 'secrets'
|
|
59
63
|
if (col === REVIEW_COL) return 'review'
|
|
60
64
|
if (col === TRAILER_COL) return 'trailer'
|
|
65
|
+
if (col === STORES_COL) return 'stores'
|
|
66
|
+
if (col === VEILLE_COL) return 'veille'
|
|
61
67
|
if (col === 'checks') return sel.t === 'item' ? ownerOf(sel.id) : null
|
|
62
68
|
return col === 'asks' || col === 'tests' || col === 'reflections' ? col : null
|
|
63
69
|
}
|
|
@@ -93,6 +99,10 @@ export function openSection(app: RepoSt, id: SectionId): void {
|
|
|
93
99
|
case 'admin': return app.showAdmin()
|
|
94
100
|
case 'review': return app.showReview(app.review.selectedId)
|
|
95
101
|
case 'trailer': return app.showTrailer(app.trailer.trailerId, app.trailer.cutId)
|
|
102
|
+
case 'stores': return app.showStores(app.stores.store)
|
|
103
|
+
case 'veille': return app.showVeille(app.veille.picked)
|
|
104
|
+
case 'comms': return app.showComms(app.social.draftSlug, app.social.draftPart)
|
|
105
|
+
case 'social': return app.showSocial(app.social.identity, app.social.account, app.social.place)
|
|
96
106
|
}
|
|
97
107
|
}
|
|
98
108
|
|
|
@@ -118,6 +128,13 @@ export function repoSections(app: RepoSt): RepoSection[] {
|
|
|
118
128
|
unless(has(REVIEW_COL), 'no review card yet: an agent sends one with sk review add')))
|
|
119
129
|
out.push(line('trailer', 'the trailer cuts: play one with its timeline, pin a note on any frame', none,
|
|
120
130
|
unless(has(TRAILER_COL), 'no trailer: write trailer/<name>/main.trailer, then sk trailer')))
|
|
131
|
+
out.push(line('stores', 'the store pages (Steam, itch): every text to paste, every picture to upload, a note on each', none,
|
|
132
|
+
unless(has(STORES_COL), 'no store page: write .shipkit/steam/store.md or .shipkit/itch/listing.md')))
|
|
133
|
+
out.push(line('veille', 'the posts its identity scrolls past, ranked by the worth of a reply, a reply drafted in its voice', none,
|
|
134
|
+
unless(has(VEILLE_COL), "no Veille: the identity this repo speaks as has no watch list (its veille.md)")))
|
|
135
|
+
// every repo has both: a repo with no draft yet still opens the page that says how a first one comes
|
|
136
|
+
out.push(line('comms', 'every draft of the repo, posted from one page: a card a platform, its link pasted back', none))
|
|
137
|
+
out.push(line('social', 'every identity side by side, its accounts and places, its setup and its messages', none))
|
|
121
138
|
out.push(line('contracts', 'what a release venue asks of this repo, and what it still lacks', counted(reds('contracts'), 'red'), unless(has('contracts'), 'no contract: no release venue applies to this repo')))
|
|
122
139
|
const noChecks = unless(has('checks'), 'no checks yet: its hub has not answered')
|
|
123
140
|
out.push(line('shipkit', 'the checks shipkit ships to every repo, one page each', counted(ownReds('shipkit'), 'red'), noChecks))
|