counterparts 0.3.2 → 0.3.4
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 +153 -0
- package/docs/module-map.md +3 -2
- package/package.json +1 -1
- package/src/adapters/claude-code/NOTES.md +28 -0
- package/src/adapters/claude-code/bin/hook.ts +85 -22
- package/src/adapters/claude-code/config.ts +7 -0
- package/src/adapters/claude-code/doctor.ts +166 -4
- package/src/adapters/claude-code/hooks.ts +185 -6
- package/src/adapters/claude-code/index.ts +3 -0
- package/src/adapters/claude-code/transcript.ts +7 -0
- package/src/adapters/cli/CONTRACT.md +11 -0
- package/src/adapters/cli/INTERFACE-GAPS.md +16 -0
- package/src/adapters/cli/NOTES.md +25 -0
- package/src/adapters/cli/commands.ts +184 -4
- package/src/adapters/cli/dream-core.ts +126 -0
- package/src/adapters/cli/help.ts +17 -0
- package/src/adapters/cli/mechanisms.ts +199 -106
- package/src/adapters/dashboard/CONTRACT.md +5 -0
- package/src/adapters/dashboard/INTERFACE-GAPS.md +12 -0
- package/src/adapters/dashboard/NOTES.md +38 -0
- package/src/adapters/dashboard/registries.ts +35 -1
- package/src/adapters/dashboard/web/README.md +63 -26
- package/src/adapters/dashboard/web/app.html +2 -0
- package/src/adapters/dashboard/web/flow.ts +14 -0
- package/src/adapters/dashboard/web/lanes.ts +141 -0
- package/src/adapters/dashboard/web/mechanisms/association/index.js +1 -2
- package/src/adapters/dashboard/web/mechanisms/consolidation/index.js +8 -5
- package/src/adapters/dashboard/web/mechanisms/consolidation/panel.js +7 -7
- package/src/adapters/dashboard/web/mechanisms/decay/index.js +1 -2
- package/src/adapters/dashboard/web/mechanisms/dreaming/index.js +19 -0
- package/src/adapters/dashboard/web/mechanisms/emotional/index.js +9 -6
- package/src/adapters/dashboard/web/mechanisms/episodic-semantic/index.js +4 -5
- package/src/adapters/dashboard/web/mechanisms/index.js +5 -3
- package/src/adapters/dashboard/web/mechanisms/interference/index.js +1 -2
- package/src/adapters/dashboard/web/mechanisms/prospective/index.js +7 -5
- package/src/adapters/dashboard/web/mechanisms/reconsolidation/index.js +1 -2
- package/src/adapters/dashboard/web/mechanisms/regions.js +1 -1
- package/src/adapters/dashboard/web/mechanisms/retrieval/index.js +1 -2
- package/src/adapters/dashboard/web/mechanisms/salience/index.js +1 -2
- package/src/adapters/dashboard/web/mechanisms/schema/index.js +1 -2
- package/src/adapters/dashboard/web/narrate.ts +76 -13
- package/src/adapters/dashboard/web/pages/health/sections/checks.js +17 -1
- package/src/adapters/dashboard/web/pages/home/home.css +29 -13
- package/src/adapters/dashboard/web/pages/home/index.js +2 -0
- package/src/adapters/dashboard/web/pages/home/sections/explorer.js +22 -7
- package/src/adapters/dashboard/web/pages/home/sections/hero.js +15 -3
- package/src/adapters/dashboard/web/pages/home/sections/live-activity.js +15 -9
- package/src/adapters/dashboard/web/pages/home/sections/recent-chapters.js +6 -2
- package/src/adapters/dashboard/web/pages/home/sections/tiles.js +35 -18
- package/src/adapters/dashboard/web/pages/memories/index.js +30 -36
- package/src/adapters/dashboard/web/pages/memories/memories.css +97 -72
- package/src/adapters/dashboard/web/pages/memories/row.js +51 -0
- package/src/adapters/dashboard/web/pages/memories/sections/feel.js +176 -0
- package/src/adapters/dashboard/web/pages/memories/sections/hold.js +67 -0
- package/src/adapters/dashboard/web/pages/memories/sections/list.js +65 -43
- package/src/adapters/dashboard/web/pages/memories/sections/search.js +26 -23
- package/src/adapters/dashboard/web/pages/memories/state.js +12 -5
- package/src/adapters/dashboard/web/pages/self/index.js +57 -16
- package/src/adapters/dashboard/web/pages/self/sections/dreams.js +76 -0
- package/src/adapters/dashboard/web/pages/self/sections/journal.js +75 -19
- package/src/adapters/dashboard/web/pages/self/sections/page.js +108 -65
- package/src/adapters/dashboard/web/pages/self/sections/settling.js +129 -104
- package/src/adapters/dashboard/web/pages/self/sections/wake.js +31 -15
- package/src/adapters/dashboard/web/pages/self/self.css +122 -59
- package/src/adapters/dashboard/web/pages/self/state.js +21 -0
- package/src/adapters/dashboard/web/server.ts +9 -0
- package/src/adapters/dashboard/web/shared/memory-marks.css +17 -0
- package/src/adapters/dashboard/web/shared/memory-marks.js +81 -0
- package/src/adapters/dashboard/web/shared/memory-modal.js +240 -53
- package/src/adapters/dashboard/web/shared/modal.css +67 -0
- package/src/adapters/dashboard/web/shared/tip.js +1 -1
- package/src/adapters/dashboard/web/shared/widgets/feed.css +4 -0
- package/src/adapters/dashboard/web/shared/widgets/feed.js +56 -14
- package/src/adapters/dashboard/web/shared/widgets/light.css +1 -0
- package/src/adapters/dashboard/web/shared/widgets/light.js +7 -5
- package/src/adapters/dashboard/web/shared/widgets/tips.css +19 -0
- package/src/adapters/dashboard/web/shared/widgets/tips.js +56 -0
- package/src/adapters/dashboard/web/views/activity.ts +18 -2
- package/src/adapters/dashboard/web/views/archive-words.ts +27 -10
- package/src/adapters/dashboard/web/views/dreams.ts +199 -0
- package/src/adapters/dashboard/web/views/mechanism-panel.ts +116 -35
- package/src/adapters/dashboard/web/views/mechanisms.ts +81 -255
- package/src/adapters/dashboard/web/views/memories.ts +245 -43
- package/src/adapters/dashboard/web/views/memory-words.ts +133 -0
- package/src/adapters/dashboard/web/views/memory.ts +226 -4
- package/src/adapters/dashboard/web/views/mind.ts +261 -61
- package/src/adapters/dashboard/web/views/overview.ts +80 -42
- package/src/adapters/dashboard/web/views/search.ts +35 -1
- package/src/adapters/dashboard/web/views/shared.ts +14 -0
- package/src/adapters/dashboard/web/views.ts +2 -0
- package/src/adapters/feelings-line.ts +74 -0
- package/src/adapters/fired.ts +163 -23
- package/src/adapters/mcp/CONTRACT.md +8 -0
- package/src/adapters/mcp/NOTES.md +56 -0
- package/src/adapters/mcp/server.ts +254 -6
- package/src/adapters/mcp/tools.ts +180 -5
- package/src/adapters/mechanism-evidence.ts +465 -0
- package/src/core/bridge.ts +21 -16
- package/src/core/counterpart.ts +422 -10
- package/src/core/dream/CONTRACT.md +143 -0
- package/src/core/dream/INTERFACE-GAPS.md +24 -0
- package/src/core/dream/NOTES.md +84 -0
- package/src/core/dream/index.ts +1067 -0
- package/src/core/dream/mark.ts +14 -0
- package/src/core/dream/tunables.ts +56 -0
- package/src/core/encode/CONTRACT.md +7 -1
- package/src/core/feelings-wheel.ts +171 -13
- package/src/core/mint.ts +9 -0
- package/src/core/physics/CONTRACT.md +132 -21
- package/src/core/physics/NOTES.md +233 -0
- package/src/core/physics/index.ts +419 -50
- package/src/core/prospective/CONTRACT.md +35 -6
- package/src/core/prospective/INTERFACE-GAPS.md +10 -5
- package/src/core/prospective/NOTES.md +175 -4
- package/src/core/prospective/derive.ts +32 -3
- package/src/core/prospective/index.ts +362 -39
- package/src/core/prospective/tunables.ts +18 -1
- package/src/core/prospective/windows.ts +104 -46
- package/src/core/recall/CONTRACT.md +28 -0
- package/src/core/recall/NOTES.md +55 -0
- package/src/core/recall/activate.ts +32 -5
- package/src/core/recall/gate.ts +7 -1
- package/src/core/recall/index.ts +28 -2
- package/src/core/recall/mood.ts +106 -0
- package/src/core/recall/tunables.ts +26 -0
- package/src/core/remember/CONTRACT.md +5 -0
- package/src/core/remember/index.ts +1 -0
- package/src/core/remember/proposals.ts +86 -3
- package/src/core/remember/spans.ts +11 -1
- package/src/core/self/CONTRACT.md +3 -0
- package/src/core/self/INTERFACE-GAPS.md +7 -0
- package/src/core/self/NOTES.md +30 -0
- package/src/core/self/identity.ts +115 -6
- package/src/core/self/index.ts +17 -0
- package/src/core/self/tunables.ts +17 -0
- package/src/core/sleep/CONTRACT.md +17 -1
- package/src/core/sleep/INTERFACE-GAPS.md +19 -0
- package/src/core/sleep/NOTES.md +36 -0
- package/src/core/sleep/consolidate.ts +149 -96
- package/src/core/sleep/decay.ts +11 -0
- package/src/core/sleep/index.ts +4 -1
- package/src/core/sleep/tunables.ts +9 -0
- package/src/core/sleep/types.ts +17 -0
- package/src/core/sleep/upgrade.ts +168 -0
- package/src/core/store/CONTRACT.md +21 -2
- package/src/core/store/NOTES.md +68 -0
- package/src/core/store/feelings.ts +23 -6
- package/src/core/store/index.ts +716 -17
- package/src/core/store/operational.ts +329 -4
- package/src/core/store/owner-op-seam.ts +79 -1
- package/src/core/types.ts +37 -0
- package/src/adapters/dashboard/web/pages/memories/sections/constellation.js +0 -178
- package/src/adapters/dashboard/web/pages/memories/sections/kinds.js +0 -42
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* Schema & assimilation. `explainer` is what Counterparts actually does, checked against
|
|
2
2
|
docs/research/mechanism-audit-2026-09-24.md; `built` / `inDevelopment` are the
|
|
3
|
-
audit plus #215/#218/#220, in plain words; `tagline`
|
|
3
|
+
audit plus #215/#218/#220, in plain words; `tagline` is the
|
|
4
4
|
site's (regions.ts). Its light comes from `/api/mechanisms`. */
|
|
5
5
|
export default {
|
|
6
6
|
id: "schema",
|
|
@@ -8,7 +8,6 @@ export default {
|
|
|
8
8
|
name: "Schema & assimilation",
|
|
9
9
|
short: "Schemas",
|
|
10
10
|
tagline: "New facts don’t land on blank ground. They’re folded into what you already believe.",
|
|
11
|
-
inDev: true,
|
|
12
11
|
explainer: "Not built yet. It keeps cards for the people and projects it knows, but does not form beliefs about them from many memories.",
|
|
13
12
|
built: ["Cards for the people, projects and places it knows, which fade and come back with use."],
|
|
14
13
|
inDevelopment: ["Beliefs about them, weighed against new evidence, have no live producer yet."],
|
|
@@ -40,6 +40,8 @@ import type { EventRow, ReadOnlyStore } from "../../../core/store/index.js";
|
|
|
40
40
|
import { num } from "../layout.js";
|
|
41
41
|
import type { DurableEventName } from "../registries.js";
|
|
42
42
|
import { nodeOf } from "./flow.js";
|
|
43
|
+
import { iconOf, laneOf } from "./lanes.js";
|
|
44
|
+
import type { Icon, Lane } from "./lanes.js";
|
|
43
45
|
import type { NodeKey } from "./flow.js";
|
|
44
46
|
import { reveal, revealHere, revealPayload, shortOf } from "./reveal.js";
|
|
45
47
|
|
|
@@ -173,10 +175,45 @@ function nameSome(t: Told, ids: readonly string[], cap = 2): string {
|
|
|
173
175
|
|
|
174
176
|
export const NARRATORS = {
|
|
175
177
|
// ── the sleep cycle ────────────────────────────────────────────────────────
|
|
176
|
-
"band.promoted": (t) =>
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
178
|
+
"band.promoted": (t) => {
|
|
179
|
+
// Since 2026-09-26 a crossing names its LANE: strongly felt and back after
|
|
180
|
+
// a gap (fast), or back on several separate days over weeks (slow). A row
|
|
181
|
+
// written before then has no lane and reads as it always did.
|
|
182
|
+
const lane = s(t, "lane");
|
|
183
|
+
const days = n(t, "returnDays") ?? n(t, "reinforcedDays") ?? 0;
|
|
184
|
+
return notable(
|
|
185
|
+
lane === "fast"
|
|
186
|
+
? `${subject(t)} became core — it was strongly felt, and it came back after a gap.`
|
|
187
|
+
: lane === "slow"
|
|
188
|
+
? `${subject(t)} became core — it kept coming back, on ${days} separate days over weeks.`
|
|
189
|
+
: `${subject(t)} crossed into identity — it had been in real use on ${days} separate days.`,
|
|
190
|
+
);
|
|
191
|
+
},
|
|
192
|
+
"band.demoted": (t) =>
|
|
193
|
+
notable(`The owner sent ${subject(t)} back out of the core, to fade like any other memory from today.`),
|
|
194
|
+
"physics.upgrade.census": (t) => {
|
|
195
|
+
const down = n(t, "bandDown") ?? 0;
|
|
196
|
+
const sooner = n(t, "pruneSooner") ?? 0;
|
|
197
|
+
const checked = n(t, "checked") ?? 0;
|
|
198
|
+
const line = `After the v8 upgrade I measured ${checked} memories by the old arithmetic and the new: ${down} moved down a band, ${sooner} would be let go sooner.`;
|
|
199
|
+
return down + sooner === 0 ? calm(line) : amber(line);
|
|
200
|
+
},
|
|
201
|
+
// ── dreaming (2026-09-26) ──────────────────────────────────────────────────
|
|
202
|
+
"dream.begun": (t) =>
|
|
203
|
+
calm(`I began to dream, over ${n(t, "fresh") ?? 0} new memories and ${n(t, "shown") ?? 0} in all.`),
|
|
204
|
+
"dream.changed": (t) => {
|
|
205
|
+
const kinds = ["merge", "link", "replayed", "gist", "contradiction", "feeling-now", "nominate-core"]
|
|
206
|
+
.map((k) => [k, n(t, k) ?? 0] as const)
|
|
207
|
+
.filter(([, v]) => v > 0)
|
|
208
|
+
.map(([k, v]) => `${v} ${k}`);
|
|
209
|
+
return calm(
|
|
210
|
+
`In a dream I changed ${n(t, "applied") ?? 0} things${kinds.length > 0 ? ` (${kinds.join(", ")})` : ""}${(n(t, "refused") ?? 0) > 0 ? `; ${n(t, "refused") ?? 0} were refused` : ""}.`,
|
|
211
|
+
);
|
|
212
|
+
},
|
|
213
|
+
"dream.journaled": () => notable("I woke from a dream and wrote it in the dream journal."),
|
|
214
|
+
"dream.undone": (t) => notable(`The owner undid a dream — ${n(t, "reversed") ?? 0} of its changes were put back.`),
|
|
215
|
+
"dream.ask": (t) =>
|
|
216
|
+
calm(s(t, "state") === "declined" ? "The owner said not today to a dream." : "I asked whether I could dream."),
|
|
180
217
|
"band.transition": (t) => {
|
|
181
218
|
// The payload's key names are TAKEN FROM the core's own pinned field tuple
|
|
182
219
|
// rather than retyped as literals — the same rule `registries.ts` keeps for
|
|
@@ -492,13 +529,10 @@ export const NARRATORS = {
|
|
|
492
529
|
const pruned = n(t, "pruned") ?? 0;
|
|
493
530
|
const merged = n(t, "merged") ?? 0;
|
|
494
531
|
if (promoted + pruned + merged === 0) {
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
);
|
|
532
|
+
// One short line (2026-09-26): the quiet night is still said, so the quiet is known to be real.
|
|
533
|
+
return calm("I slept: nothing to promote, let go or merge.");
|
|
498
534
|
}
|
|
499
|
-
return notable(
|
|
500
|
-
`My nightly cycle ran: ${promoted} promoted, ${pruned} let go, ${merged} merged.`,
|
|
501
|
-
);
|
|
535
|
+
return notable(`I slept: ${promoted} promoted, ${pruned} let go, ${merged} merged.`);
|
|
502
536
|
},
|
|
503
537
|
/**
|
|
504
538
|
* THE WAKE RENDER'S ROW (U9). Neutral by rule: a trim is the budget working,
|
|
@@ -643,10 +677,16 @@ export const NARRATORS = {
|
|
|
643
677
|
"adapter.semantic.lag": (t) => {
|
|
644
678
|
const reason = s(t, "reason");
|
|
645
679
|
const hits = n(t, "hits");
|
|
646
|
-
|
|
647
|
-
|
|
680
|
+
// The writer ALWAYS sets `reason`, and "ok" is the normal case — reading
|
|
681
|
+
// only a missing reason as success painted every healthy turn orange
|
|
682
|
+
// (2026-09-26). Orange is for the one real failure: an embed that broke.
|
|
683
|
+
if (reason === null || reason === "ok") {
|
|
684
|
+
return calm(`I left next turn's semantic cue ready — ${hits ?? 0} neighbours precomputed.`);
|
|
648
685
|
}
|
|
649
|
-
return
|
|
686
|
+
if (reason === "embedder-off") return calm("No semantic cue for next turn: the embedder is off, by choice.");
|
|
687
|
+
if (reason === "no-text") return calm("No semantic cue for next turn: the turn had no words to look up.");
|
|
688
|
+
if (reason === "no-credentials") return calm("No semantic cue for next turn: this embedder needs a key, and none is set.");
|
|
689
|
+
return amber(`I could not leave next turn's semantic cue: ${reason}.`);
|
|
650
690
|
},
|
|
651
691
|
|
|
652
692
|
// ── waking ─────────────────────────────────────────────────────────────────
|
|
@@ -773,6 +813,13 @@ export const NARRATORS = {
|
|
|
773
813
|
calm(
|
|
774
814
|
`I held back a reminder about ${subject(t)} (${s(t, "reason") ?? "no reason recorded"}). Holding debts and losing deadlines is the whole of the tact rule; this is it working.`,
|
|
775
815
|
),
|
|
816
|
+
// A plain reminder (2026-09-26): the one kind that is SAID, because its
|
|
817
|
+
// author asked for exactly that.
|
|
818
|
+
"prospective.plain": (t) => {
|
|
819
|
+
const beat = s(t, "beat");
|
|
820
|
+
const when = beat === "last-day" ? "on its last day" : beat === "opens" ? "as its dates opened" : "on the day";
|
|
821
|
+
return notable(`I told you plainly about ${subject(t)} ${when}, as it was asked to be.`);
|
|
822
|
+
},
|
|
776
823
|
|
|
777
824
|
// ── the worker that did start ──────────────────────────────────────────────
|
|
778
825
|
//
|
|
@@ -945,6 +992,7 @@ export const REF_KIND = {
|
|
|
945
992
|
// key is a derived address on that row, not an entity of its own.
|
|
946
993
|
"prospective.fire": "memory",
|
|
947
994
|
"prospective.fire.refused": "memory",
|
|
995
|
+
"prospective.plain": "memory",
|
|
948
996
|
"adapter.checkout": "none",
|
|
949
997
|
"adapter.wake.delivered": "none",
|
|
950
998
|
"adapter.wake.injected": "none",
|
|
@@ -1010,6 +1058,15 @@ export const REF_KIND = {
|
|
|
1010
1058
|
// A flush describes a SET of pairs, not one memory. The ids stay in the edge
|
|
1011
1059
|
// rows, where they are the record; the row carries counts.
|
|
1012
1060
|
"associate.flush": "none",
|
|
1061
|
+
// A dream's rows point at the DREAM, which is not a memory and never becomes
|
|
1062
|
+
// one; its id prints as the raw address, and the journal view opens it.
|
|
1063
|
+
"dream.begun": "none",
|
|
1064
|
+
"dream.changed": "none",
|
|
1065
|
+
"dream.journaled": "none",
|
|
1066
|
+
"dream.undone": "none",
|
|
1067
|
+
"dream.ask": "none",
|
|
1068
|
+
"band.demoted": "memory",
|
|
1069
|
+
"physics.upgrade.census": "none",
|
|
1013
1070
|
} as const satisfies Record<
|
|
1014
1071
|
DurableEventName,
|
|
1015
1072
|
"memory" | "session" | "chunk" | "proposal" | "handoff" | "none"
|
|
@@ -1045,6 +1102,10 @@ export interface NarratedEvent {
|
|
|
1045
1102
|
readonly text: string;
|
|
1046
1103
|
readonly tone: Tone;
|
|
1047
1104
|
readonly node: NodeKey | null;
|
|
1105
|
+
/** Which feed it belongs in: home (memory events) or flow (housekeeping). `lanes.ts`. */
|
|
1106
|
+
readonly lane: Lane;
|
|
1107
|
+
/** The small icon a home line carries, or null. `lanes.ts`. */
|
|
1108
|
+
readonly icon: Icon | null;
|
|
1048
1109
|
/** The stored ref, resolved now — or null when the row named nothing. */
|
|
1049
1110
|
readonly subject: string | null;
|
|
1050
1111
|
/** The payload, every id in it resolved. Ids and counts only, never text. */
|
|
@@ -1087,6 +1148,8 @@ export function narrate(store: ReadOnlyStore, row: EventRow): NarratedEvent {
|
|
|
1087
1148
|
text: line.text,
|
|
1088
1149
|
tone: line.tone,
|
|
1089
1150
|
node: nodeOf(row.name),
|
|
1151
|
+
lane: laneOf(row.name, p),
|
|
1152
|
+
icon: iconOf(row.name, p),
|
|
1090
1153
|
// Resolved BY EVENT NAME — see `REF_KIND`.
|
|
1091
1154
|
subject: subjectOf(store, row),
|
|
1092
1155
|
detail: revealPayload(store, p, 40),
|
|
@@ -67,6 +67,22 @@ function plain(detail) {
|
|
|
67
67
|
return String(detail || "").replace(/^\/\S+ — /, "").replace(/^\/\S+ /, "");
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
+
/** A line doctor's facts can say in plain words, by key; null keeps the detail. */
|
|
71
|
+
export const PLAIN = {
|
|
72
|
+
// The self page: how long since its last rewrite, and — once that passes
|
|
73
|
+
// doctor's own limit, which is what turns the row amber — that it has.
|
|
74
|
+
"self-page": (d) => {
|
|
75
|
+
if (!d || d.present !== true || typeof d.daysSince !== "number") return null;
|
|
76
|
+
const n = d.daysSince;
|
|
77
|
+
if (d.stale) {
|
|
78
|
+
return "not rewritten in " + n + (n === 1 ? " day" : " days") +
|
|
79
|
+
(typeof d.staleAfter === "number" ? "; this turns amber after " + d.staleAfter : "");
|
|
80
|
+
}
|
|
81
|
+
return "rewritten " + (n <= 0 ? "today" : n === 1 ? "yesterday" : n + " days ago") +
|
|
82
|
+
(typeof d.version === "number" ? " · version " + d.version : "");
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
|
|
70
86
|
function gradeOf(f) {
|
|
71
87
|
if (f.key === "config" && f.data && f.data.reason === "not-read") return "grey";
|
|
72
88
|
if (f.optional) return "off";
|
|
@@ -100,7 +116,7 @@ function paintFindings(report, when) {
|
|
|
100
116
|
const name = NAMES[f.key] || f.title;
|
|
101
117
|
const line = grade === "grey"
|
|
102
118
|
? "not checked — this dashboard was opened on a store, not through its settings file"
|
|
103
|
-
: plain(f.detail);
|
|
119
|
+
: (PLAIN[f.key] && PLAIN[f.key](f.data)) || plain(f.detail);
|
|
104
120
|
details.push(f);
|
|
105
121
|
rows.push({ grade, name, line, f, order: HEADLINE.indexOf(f.key) });
|
|
106
122
|
}
|
|
@@ -7,17 +7,27 @@
|
|
|
7
7
|
min-height:min(500px,calc(100vh - 150px));margin:0 0 8px}
|
|
8
8
|
.home-copy{position:relative;z-index:5;max-width:36rem}
|
|
9
9
|
.home-eyebrow{font-size:12.5px;font-weight:500;letter-spacing:.3px;color:var(--dim);margin:0 0 10px}
|
|
10
|
-
.home-headline{font-family:var(--sans);font-weight:700;font-size:clamp(
|
|
11
|
-
letter-spacing:-.3px;color:#e8eef5;margin:0 0
|
|
12
|
-
.home-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
.home-counts
|
|
16
|
-
.home-counts
|
|
17
|
-
.home-counts .
|
|
18
|
-
.home-counts .
|
|
19
|
-
.home-counts .
|
|
20
|
-
.home-counts .
|
|
10
|
+
.home-headline{font-family:var(--sans);font-weight:700;font-size:clamp(24px,2.6vw,36px);line-height:1.25;
|
|
11
|
+
letter-spacing:-.3px;color:#e8eef5;margin:0 0 22px}
|
|
12
|
+
.home-headline .hh-part{display:inline-block;white-space:nowrap}
|
|
13
|
+
|
|
14
|
+
/* four small tiles: the number is the link; its words sit behind the `?` */
|
|
15
|
+
.home-counts{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;max-width:34rem}
|
|
16
|
+
.home-counts .ht{position:relative;padding:11px 12px 10px;display:flex;flex-direction:column;gap:2px;min-width:0}
|
|
17
|
+
.home-counts .ht-link{display:flex;flex-direction:column;min-height:44px;color:inherit;text-decoration:none;cursor:pointer}
|
|
18
|
+
.home-counts .ht-link:focus-visible{outline:2px solid var(--cyan);outline-offset:2px;border-radius:4px}
|
|
19
|
+
.home-counts .ht:hover{border-color:var(--glow)}
|
|
20
|
+
.home-counts .ht .n{font-family:var(--mono);font-size:26px;font-weight:700;line-height:1.15}
|
|
21
|
+
.home-counts .ht .l{font-size:13px;color:var(--ink);text-transform:none;letter-spacing:0;margin-top:1px}
|
|
22
|
+
.home-counts .ht .q-wrap{position:absolute;top:8px;right:8px}
|
|
23
|
+
.home-counts .ht .q-wrap.open{position:static;display:block}
|
|
24
|
+
.home-counts .ht .s{font-size:12px;color:var(--dim);margin-top:4px;line-height:1.4}
|
|
25
|
+
.home-counts .ht.quiet .n{color:var(--dim);text-shadow:none}
|
|
26
|
+
.ht-pips{display:inline-flex;gap:3px;margin-right:6px;vertical-align:1px}
|
|
27
|
+
.ht-pip{width:7px;height:7px;border-radius:50%;border:1px solid rgba(179,136,255,.6)}
|
|
28
|
+
.ht-pip.on{background:var(--purple);border-color:var(--purple);box-shadow:0 0 6px rgba(179,136,255,.5)}
|
|
29
|
+
.ht-core .n{color:var(--purple);text-shadow:0 0 15px rgba(179,136,255,.2)}
|
|
30
|
+
.ht-replaced .n{color:var(--teal);text-shadow:0 0 15px rgba(0,191,165,.2)}
|
|
21
31
|
|
|
22
32
|
/* ── the brain ────────────────────────────────────────── */
|
|
23
33
|
.home-brain{position:relative;height:min(540px,calc(100vh - 150px));min-height:360px;width:100%}
|
|
@@ -42,7 +52,12 @@
|
|
|
42
52
|
.home-panel{--reg:var(--cyan);border:1px solid var(--border);border-top:2px solid var(--reg);border-radius:6px;background:var(--card);
|
|
43
53
|
padding:18px clamp(14px,2.2vw,28px) 24px;box-shadow:0 -20px 60px -30px var(--reg);transition:border-color .3s,box-shadow .3s;
|
|
44
54
|
scroll-margin-top:12px}
|
|
55
|
+
.mech-top{display:flex;gap:12px;align-items:flex-start;margin:0 0 20px}
|
|
56
|
+
.mech-top .mechs{flex:1;min-width:0;margin:0}
|
|
57
|
+
.mech-legend{flex:none;padding-top:2px}
|
|
58
|
+
.mech-legend .q-wrap.open .q-pop{position:absolute;right:0;left:auto;top:calc(100% + 8px);width:min(22rem,calc(100vw - 48px));max-width:none}
|
|
45
59
|
.mechs{display:flex;flex-wrap:wrap;gap:14px 22px;margin:0 0 20px}
|
|
60
|
+
.mech-pill.is-notbuilt{color:var(--dim);border-style:dashed}
|
|
46
61
|
.mech-group{display:flex;flex-direction:column;gap:6px;flex:none;max-width:100%}
|
|
47
62
|
.mech-fam{font-size:12.5px;font-weight:600;letter-spacing:.3px;color:var(--pin);padding-left:4px}
|
|
48
63
|
.mech-row{display:flex;gap:5px;flex-wrap:wrap}
|
|
@@ -124,8 +139,9 @@
|
|
|
124
139
|
}
|
|
125
140
|
@media(max-width:560px){
|
|
126
141
|
.home-brain{height:320px}
|
|
127
|
-
.home-headline{font-size:
|
|
128
|
-
.home-counts
|
|
142
|
+
.home-headline{font-size:22px;margin-bottom:18px}
|
|
143
|
+
.home-counts{grid-template-columns:repeat(2,minmax(0,1fr))}
|
|
144
|
+
.home-counts .ht .n{font-size:22px}
|
|
129
145
|
}
|
|
130
146
|
@media(max-width:720px),(pointer:coarse){
|
|
131
147
|
.mech-pill{min-height:44px;padding:0 14px}
|
|
@@ -66,7 +66,9 @@ export default {
|
|
|
66
66
|
mount(section) {
|
|
67
67
|
section.innerHTML = markup;
|
|
68
68
|
hero.mount();
|
|
69
|
+
explorer.mount();
|
|
69
70
|
liveActivity.mount();
|
|
71
|
+
recentChapters.mount();
|
|
70
72
|
// The brain is built once and kept; a failure to start is a calm sentence
|
|
71
73
|
// in its place, never an error on the page.
|
|
72
74
|
try {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* The mechanism panel, under the hero — the site's Explorer, with this store in
|
|
2
2
|
it. Eleven pills in the site's four families, each with its light (from
|
|
3
|
-
`/api/mechanisms
|
|
3
|
+
`/api/mechanisms`: fired lately, waiting, quiet, not built) and, when only
|
|
4
|
+
some of it is built, a "partly built" tag (the view's `build`). Picking
|
|
4
5
|
one (here, or on the brain) shows it INLINE: what it is, what the store says
|
|
5
6
|
it did, a small picture of this store's own data where one exists
|
|
6
7
|
(`mechanisms/<id>/panel.js`, fed by `/api/mechanism?id=`), what is built and
|
|
@@ -15,13 +16,24 @@ import { $, esc } from "../../../shared/dom.js";
|
|
|
15
16
|
import "../../../shared/memory-modal.js"; // window.openMemory, for the pictures' rows
|
|
16
17
|
import { renderFeed } from "../../../shared/widgets/feed.js";
|
|
17
18
|
import { LIGHT_WORD, light } from "../../../shared/widgets/light.js";
|
|
19
|
+
import { q, wireTips } from "../../../shared/widgets/tips.js";
|
|
20
|
+
|
|
21
|
+
const LEGEND =
|
|
22
|
+
"A green light fired in the last 7 lived days. A ring is waiting: its next run is ahead, or it has nothing to act on yet. " +
|
|
23
|
+
"Amber is built but quiet. Grey is not built yet. \"Partly built\" means some of it works and some is still to come.";
|
|
18
24
|
|
|
19
25
|
export const markup = `
|
|
20
26
|
<section class="home-panel" id="mech-panel" aria-labelledby="mech-title">
|
|
21
|
-
<div class="
|
|
27
|
+
<div class="mech-top">
|
|
28
|
+
<div class="mechs" id="mech-strip" role="group" aria-label="Memory mechanisms, by stage"></div>
|
|
29
|
+
<span class="mech-legend">${q("home-lights", LEGEND)}</span>
|
|
30
|
+
</div>
|
|
22
31
|
<div class="mech-body" id="mech-body"></div>
|
|
23
32
|
</section>`;
|
|
24
33
|
|
|
34
|
+
/** Wire the legend's `?` once the markup is in the page. */
|
|
35
|
+
export function mount() { wireTips($("mech-panel")); }
|
|
36
|
+
|
|
25
37
|
const ORDER = MECHANISMS.map((m) => m.id);
|
|
26
38
|
const byIdStatic = Object.fromEntries(MECHANISMS.map((m) => [m.id, m]));
|
|
27
39
|
const familyOf = (m) => FAMILIES.find((f) => f.key === m.family) || FAMILIES[0];
|
|
@@ -34,7 +46,9 @@ let selected = null;
|
|
|
34
46
|
let panelData = {}; // id → the /api/mechanism payload last read
|
|
35
47
|
let asked = 0;
|
|
36
48
|
|
|
37
|
-
const lightOf = (id) => lights[id] || { status: "grey", evidence: "", events: [] };
|
|
49
|
+
const lightOf = (id) => lights[id] || { status: "grey", build: "not", evidence: "", events: [] };
|
|
50
|
+
/** A pill's tag: only the partly built say so. Built needs no tag; grey is not built. */
|
|
51
|
+
const tagOf = (id) => lightOf(id).build === "partly" ? '<span class="mech-tag">partly built</span>' : "";
|
|
38
52
|
|
|
39
53
|
/** Hand the explorer the brain it drives (and that drives it). */
|
|
40
54
|
export function attachBrain(b) {
|
|
@@ -64,9 +78,10 @@ function paintStrip() {
|
|
|
64
78
|
'<span class="mech-fam">' + esc(f.label) + "</span>" +
|
|
65
79
|
'<div class="mech-row">' +
|
|
66
80
|
MECHANISMS.filter((m) => m.family === f.key).map((m) =>
|
|
67
|
-
'<button type="button" class="mech-pill' + (m.id === selected ? " is-on" : "") +
|
|
81
|
+
'<button type="button" class="mech-pill' + (m.id === selected ? " is-on" : "") +
|
|
82
|
+
(lightOf(m.id).build === "not" ? " is-notbuilt" : "") + '" data-id="' + esc(m.id) + '"' +
|
|
68
83
|
' aria-pressed="' + (m.id === selected ? "true" : "false") + '" title="' + esc(m.name) + '">' +
|
|
69
|
-
light(lightOf(m.id).status) + esc(m.short) + (m.
|
|
84
|
+
light(lightOf(m.id).status) + esc(m.short) + tagOf(m.id) + "</button>"
|
|
70
85
|
).join("") +
|
|
71
86
|
"</div></div>"
|
|
72
87
|
).join("");
|
|
@@ -100,7 +115,7 @@ function paintBody() {
|
|
|
100
115
|
$("mech-body").innerHTML =
|
|
101
116
|
'<div class="mech-grid">' +
|
|
102
117
|
'<div class="mech-text">' +
|
|
103
|
-
'<p class="mech-eyebrow">' + esc(m.name) + (
|
|
118
|
+
'<p class="mech-eyebrow">' + esc(m.name) + (l.build === "partly" ? ' <span class="mech-dev">partly built</span>' : "") + "</p>" +
|
|
104
119
|
'<h2 class="mech-title" id="mech-title">' + esc(m.tagline) + "</h2>" +
|
|
105
120
|
'<p class="mech-explainer">' + esc(m.explainer) + "</p>" +
|
|
106
121
|
'<p class="mech-evidence">' + light(l.status) + " <b>" + esc(LIGHT_WORD[l.status] || "") + "</b> — " + esc(l.evidence) + "</p>" +
|
|
@@ -164,7 +179,7 @@ function paint(view) {
|
|
|
164
179
|
for (const r of REGIONS) {
|
|
165
180
|
levels[r.key] = Math.max(0, ...r.mechanisms.map((id) => {
|
|
166
181
|
const s = lightOf(id).status;
|
|
167
|
-
return s === "green" ? 1 : s === "amber" ? 0.25 : 0;
|
|
182
|
+
return s === "green" ? 1 : s === "waiting" ? 0.45 : s === "amber" ? 0.25 : 0;
|
|
168
183
|
}));
|
|
169
184
|
}
|
|
170
185
|
brain.levels(levels);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/* The hero: one
|
|
2
|
-
|
|
1
|
+
/* The hero: one short headline and four small tiles on the left, the brain on
|
|
2
|
+
the right (`../brain.js`). The brain is mounted once; the words are
|
|
3
3
|
repainted whenever the store moves. */
|
|
4
4
|
import { $ } from "../../../shared/dom.js";
|
|
5
5
|
import * as tiles from "./tiles.js";
|
|
@@ -16,7 +16,19 @@ export const markup = `
|
|
|
16
16
|
|
|
17
17
|
export function mount() { tiles.mount(); }
|
|
18
18
|
|
|
19
|
+
/** "Day 30 · 145 memories · 8 of 11 built · 6 active this week": each part is
|
|
20
|
+
* its own span, so a narrow screen breaks between parts, never inside one. */
|
|
19
21
|
export function paint(d) {
|
|
20
|
-
$("home-headline")
|
|
22
|
+
const el = $("home-headline");
|
|
23
|
+
const parts = d.hero.headline.split(" · ");
|
|
24
|
+
const nodes = [];
|
|
25
|
+
parts.forEach((part, i) => {
|
|
26
|
+
if (i > 0) nodes.push(document.createTextNode(" "));
|
|
27
|
+
const s = document.createElement("span");
|
|
28
|
+
s.className = "hh-part";
|
|
29
|
+
s.textContent = part + (i < parts.length - 1 ? " ·" : "");
|
|
30
|
+
nodes.push(s);
|
|
31
|
+
});
|
|
32
|
+
el.replaceChildren(...nodes);
|
|
21
33
|
tiles.paint(d);
|
|
22
34
|
}
|
|
@@ -1,20 +1,26 @@
|
|
|
1
|
-
/* Live activity —
|
|
2
|
-
|
|
1
|
+
/* Live activity — memory events only, in my own words (2026-09-26, an
|
|
2
|
+
experiment): something remembered, a memory stronger, replaced or let go, a
|
|
3
|
+
chapter, a handoff, the night's sleep, a reminder. Housekeeping lines go to
|
|
4
|
+
the flow tab's feed (`web/lanes.ts` is the split). The one home panel the
|
|
5
|
+
pulse owns: it is registered as a live feed that takes only home rows. */
|
|
3
6
|
import { $ } from "../../../shared/dom.js";
|
|
4
7
|
import { registerLiveFeed, renderFeed } from "../../../shared/widgets/feed.js";
|
|
8
|
+
import { q, wireTips } from "../../../shared/widgets/tips.js";
|
|
5
9
|
|
|
6
10
|
export const markup = `
|
|
7
|
-
<h2>Live activity
|
|
8
|
-
|
|
9
|
-
|
|
11
|
+
<h2 id="ov-feed-h">Live activity ${q("home-feed",
|
|
12
|
+
"What happened to my memories, newest first: what I wrote down, what got stronger, what was replaced or let go, " +
|
|
13
|
+
"chapters, handoffs, each night's sleep and reminders. The plumbing is on the flow tab. Click a line for the record behind it. " +
|
|
14
|
+
"Records hold ids, counts and bytes, never a memory's words or a turn of yours; names are filled in as the page is drawn.")}</h2>
|
|
15
|
+
<div class="card feed" id="ov-feed"></div>`;
|
|
10
16
|
|
|
11
|
-
export function mount() {
|
|
17
|
+
export function mount() {
|
|
18
|
+
registerLiveFeed("ov-feed", (e) => e.lane === "home");
|
|
19
|
+
wireTips($("ov-feed-h"));
|
|
20
|
+
}
|
|
12
21
|
|
|
13
22
|
export function paint(d) {
|
|
14
23
|
renderFeed($("ov-feed"), d.feed, d);
|
|
15
|
-
$("ov-feednote").textContent =
|
|
16
|
-
"Payloads are ids, counts and bytes — never a memory's words, and never a turn of yours. " +
|
|
17
|
-
"The names above are resolved at the moment this page was drawn.";
|
|
18
24
|
}
|
|
19
25
|
|
|
20
26
|
/** True while the feed still shows its absence line — nothing of the pulse's
|
|
@@ -2,11 +2,15 @@
|
|
|
2
2
|
on the self tab. */
|
|
3
3
|
import { $ } from "../../../shared/dom.js";
|
|
4
4
|
import { chapterRows } from "../../../shared/widgets/chapters.js";
|
|
5
|
+
import { q, wireTips } from "../../../shared/widgets/tips.js";
|
|
5
6
|
|
|
6
7
|
export const markup = `
|
|
7
|
-
<h2>Latest chapters
|
|
8
|
+
<h2 id="ov-chapters-h">Latest chapters ${q("home-chapters",
|
|
9
|
+
"My journal, written in the first person at the end of a session. Chapters do not fade.")}</h2>
|
|
8
10
|
<div class="card rows" id="ov-chapters"></div>
|
|
9
|
-
<p class="foot"><a href="#self" class="home-more">every chapter
|
|
11
|
+
<p class="foot"><a href="#self/journal" class="home-more">every chapter →</a></p>`;
|
|
12
|
+
|
|
13
|
+
export function mount() { wireTips($("ov-chapters-h")); }
|
|
10
14
|
|
|
11
15
|
export function paint(d) {
|
|
12
16
|
$("ov-chapters").innerHTML = chapterRows((d.chapters || []).slice(0, 3), d.chaptersAbsent);
|
|
@@ -1,35 +1,52 @@
|
|
|
1
|
-
/* The
|
|
2
|
-
`hero.counts
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/* The four small tiles under the home page's headline (`/api/overview`'s
|
|
2
|
+
`hero.counts`, 2026-09-26, an experiment): memories, core, chapters,
|
|
3
|
+
replaced. Each number is a link to where it is shown in full (a hash route:
|
|
4
|
+
`shell/tabs.js#parseRoute`); the words that explain it sit behind its `?`. */
|
|
5
5
|
import { $, esc } from "../../../shared/dom.js";
|
|
6
|
+
import { q, wireTips } from "../../../shared/widgets/tips.js";
|
|
6
7
|
|
|
7
8
|
const GOES_TO = {
|
|
8
|
-
"memories
|
|
9
|
-
"core
|
|
10
|
-
"chapters
|
|
11
|
-
"
|
|
9
|
+
"memories": "memories?state=live",
|
|
10
|
+
"core": "self/settling",
|
|
11
|
+
"chapters": "self/journal",
|
|
12
|
+
"replaced": "memories?state=archived",
|
|
12
13
|
};
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
const TIPS = {
|
|
16
|
+
memories: "Everything I hold right now: memories, and the cards for the people and projects I know. The journal's chapters are counted apart.",
|
|
17
|
+
core: "Core memories don't fade. A memory gets there by being used on separate days with a high enough score. \"Closest\" is the one nearest to making it.",
|
|
18
|
+
chapters: "My journal, written in the first person at the end of a session. Chapters don't fade.",
|
|
19
|
+
replaced: "Older readings replaced by newer ones — nothing forgotten; the old version is kept. \"Let go\" is different: memories that faded until they were set aside.",
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const markup = `<div class="home-counts" id="ov-tiles"></div>`;
|
|
23
|
+
|
|
24
|
+
/** Filled pips for the closest candidate's days: a small picture of "1 of 3". */
|
|
25
|
+
function pips(p) {
|
|
26
|
+
if (!p || !p.of) return "";
|
|
27
|
+
let out = '<span class="ht-pips" aria-hidden="true">';
|
|
28
|
+
for (let i = 0; i < p.of; i++) out += '<span class="ht-pip' + (i < p.days ? " on" : "") + '"></span>';
|
|
29
|
+
return out + "</span>";
|
|
30
|
+
}
|
|
15
31
|
|
|
16
32
|
export function paint(d) {
|
|
17
33
|
$("ov-tiles").innerHTML = d.hero.counts.map((t) => {
|
|
18
|
-
const to = GOES_TO[t.
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
34
|
+
const to = GOES_TO[t.key];
|
|
35
|
+
const note = t.note ? '<div class="s">' + pips(t.progress) + esc(t.note) + "</div>" : "";
|
|
36
|
+
return '<div class="tile ht ht-' + esc(t.key) + (t.absent ? " quiet" : "") + '">' +
|
|
37
|
+
'<a class="ht-link" href="#' + esc(to) + '">' +
|
|
38
|
+
'<span class="n">' + esc(t.value) + "</span>" +
|
|
39
|
+
'<span class="l">' + esc(t.label) + "</span>" +
|
|
40
|
+
"</a>" + q("home-tile-" + t.key, TIPS[t.key] || "") + note + "</div>";
|
|
25
41
|
}).join("");
|
|
42
|
+
wireTips($("ov-tiles"));
|
|
26
43
|
}
|
|
27
44
|
|
|
28
45
|
/** A link changes the hash and the nav follows it (`shell/tabs.js`). A second
|
|
29
|
-
* click on the same
|
|
46
|
+
* click on the same tile changes nothing, so it re-announces the hash itself. */
|
|
30
47
|
export function mount() {
|
|
31
48
|
$("ov-tiles").addEventListener("click", (e) => {
|
|
32
|
-
const a = e.target.closest("a.
|
|
49
|
+
const a = e.target.closest("a.ht-link");
|
|
33
50
|
if (!a || location.hash !== a.getAttribute("href")) return;
|
|
34
51
|
e.preventDefault();
|
|
35
52
|
dispatchEvent(new HashChangeEvent("hashchange"));
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
/* The memories tab: find (search + ask),
|
|
2
|
-
|
|
3
|
-
memory as a paged list. `/api/memories` feeds the
|
|
4
|
-
the list fetches its own page (`/api/memories/list`).
|
|
1
|
+
/* The memories tab: everything it holds — find it (search + ask), see it (two
|
|
2
|
+
small pictures: how firmly it's held, and how it feels), read and manage it
|
|
3
|
+
(every memory as a paged list, the page's buttons). `/api/memories` feeds the
|
|
4
|
+
pictures; the list fetches its own page (`/api/memories/list`).
|
|
5
|
+
|
|
6
|
+
LIVE. The pulse calls `refresh()` when the store moves. Everything is re-read
|
|
7
|
+
and redrawn from `state.js`, so the chosen filters, sort and page (and any
|
|
8
|
+
pinned `?`, kept by the shared tip widget) come back as they were; an open memory card lives in the overlay
|
|
9
|
+
and is left alone; the scroll position is put back. */
|
|
5
10
|
import { api, fail } from "../../shared/api.js";
|
|
6
|
-
import
|
|
7
|
-
import * as
|
|
11
|
+
import { $ } from "../../shared/dom.js";
|
|
12
|
+
import * as feel from "./sections/feel.js";
|
|
13
|
+
import * as hold from "./sections/hold.js";
|
|
8
14
|
import * as list from "./sections/list.js";
|
|
9
15
|
import * as search from "./sections/search.js";
|
|
10
16
|
import * as tools from "./sections/tools.js";
|
|
@@ -12,45 +18,38 @@ import { setFilter } from "./state.js";
|
|
|
12
18
|
|
|
13
19
|
const markup = `
|
|
14
20
|
<div class="mem-top">
|
|
15
|
-
<p class="mem-
|
|
21
|
+
<p class="mem-count" id="mem-lede"></p>${tools.markup}
|
|
16
22
|
</div>${tools.notePanel}${search.markup}
|
|
17
|
-
${
|
|
18
|
-
|
|
23
|
+
<div class="glance2">${hold.markup}${feel.markup}
|
|
24
|
+
</div>
|
|
19
25
|
${list.markup}
|
|
20
26
|
`;
|
|
21
27
|
|
|
22
|
-
let MEM = null;
|
|
23
|
-
|
|
24
28
|
async function render() {
|
|
25
29
|
let d;
|
|
26
30
|
try { d = await api("/api/memories"); } catch (e) { return fail("The memories page", e); }
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
constellation.draw();
|
|
31
|
+
const x = scrollX, y = scrollY;
|
|
32
|
+
$("mem-lede").textContent = count(d);
|
|
33
|
+
hold.paint(d);
|
|
34
|
+
feel.paint(d);
|
|
32
35
|
await list.render();
|
|
36
|
+
if (scrollX !== x || scrollY !== y) scrollTo(x, y);
|
|
33
37
|
}
|
|
34
38
|
|
|
35
|
-
/** "
|
|
36
|
-
*
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
function lede(d) {
|
|
43
|
-
if (d.total === 0) return "Nothing held yet. Write a note, or just talk — what matters settles here.";
|
|
44
|
-
if (d.total < 20) return "A young memory: " + heldWords(d) + " so far. Every one is below, with its words; it fills in as we talk.";
|
|
45
|
-
return heldWords(d) + ". Search by words, ask a question, or browse every one below, newest first.";
|
|
39
|
+
/** "145 memories" — the dashboard's one count (2026-09-26): every live row but
|
|
40
|
+
* the journal's, people and project cards included, the same number the
|
|
41
|
+
* list's "live" chip and the home page say. */
|
|
42
|
+
function count(d) {
|
|
43
|
+
if (d.total === 0) return "Nothing held yet. Write a note, or just talk.";
|
|
44
|
+
return d.total + (d.total === 1 ? " memory" : " memories");
|
|
46
45
|
}
|
|
47
46
|
|
|
48
47
|
export default {
|
|
49
48
|
name: "memories",
|
|
50
49
|
mount(section) {
|
|
51
50
|
section.innerHTML = markup;
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
hold.mount();
|
|
52
|
+
feel.mount();
|
|
54
53
|
list.mount();
|
|
55
54
|
search.mount();
|
|
56
55
|
tools.mount();
|
|
@@ -60,16 +59,11 @@ export default {
|
|
|
60
59
|
render,
|
|
61
60
|
/** The store moved (the pulse): re-read everything this page shows. */
|
|
62
61
|
refresh: render,
|
|
63
|
-
/** Coming back to the tab: the canvas may have been laid out at zero width. */
|
|
64
|
-
show() { constellation.draw(); },
|
|
65
|
-
resize() { if (MEM) constellation.draw(); },
|
|
66
62
|
/** `#memories?state=archived` (or live/all): open the list at that filter. */
|
|
67
63
|
route({ params }) {
|
|
68
64
|
const state = params.get("state");
|
|
69
65
|
if (!["live", "archived", "all"].includes(state)) return;
|
|
70
|
-
setFilter({ state, kind: null,
|
|
71
|
-
|
|
66
|
+
setFilter({ state, kind: null, core: false, journal: false, hold: null, feeling: null, feelingCore: null });
|
|
67
|
+
$("mlist-h").scrollIntoView({ block: "start" });
|
|
72
68
|
},
|
|
73
|
-
/** After boot, when this is the tab showing. */
|
|
74
|
-
redraw() { constellation.draw(); },
|
|
75
69
|
};
|