From 89afd83f1aadbb50ade9ee0cc8717b2c1ad3d5fe Mon Sep 17 00:00:00 2001 From: Padreug Date: Tue, 9 Jun 2026 19:38:54 +0200 Subject: [PATCH] =?UTF-8?q?docs(events):=20update=20activities=E2=86=92eve?= =?UTF-8?q?nts=20references=20after=20module=20rename?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updates documentation that referenced the pre-rename `src/modules/ activities/` paths, useActivities composables, and ACTIVITIES_* SERVICE_TOKENS to match the new `src/modules/events/` layout. Touched: - docs/nostr-patterns/{README,publishing,subscriptions,replaceable-events}.md: the "Canonical: src/modules/activities/composables/useRSVP.ts" anchors used throughout these pattern docs now point at the renamed paths. - CLAUDE.md Payment Rails Pattern section: "Activities is the first consumer" / "Activities passes [...]" → "Events". The mobile-browser docs reference to "Activity Lifecycle Kills" (line 810) is left alone — that's Android browser terminology, not the events module. Co-Authored-By: Claude Opus 4.7 (1M context) --- CLAUDE.md | 4 ++-- docs/nostr-patterns/README.md | 2 +- docs/nostr-patterns/publishing.md | 8 ++++---- docs/nostr-patterns/replaceable-events.md | 8 ++++---- docs/nostr-patterns/subscriptions.md | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index b85fab5..5b890de 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -717,7 +717,7 @@ VITE_WEBSOCKET_ENABLED=true ## Payment Rails Pattern Shared primitives for modules that mix Lightning + fiat (and, future, -cash / internal-wallet) payment rails. Activities is the first +cash / internal-wallet) payment rails. Events is the first consumer; restaurant + marketplace will adopt the same primitives as their backends gain fiat support. @@ -784,7 +784,7 @@ type PaymentMethod = { ``` Module usage: -- **Activities** passes `[lightning, ...one entry per organizer provider]`. +- **Events** passes `[lightning, ...one entry per organizer provider]`. - **Restaurant** (future) passes the subset of `[lightning, cash, internal, ...fiat providers]` enabled by the restaurant's `accepts_*` flags. diff --git a/docs/nostr-patterns/README.md b/docs/nostr-patterns/README.md index b69da5a..237b681 100644 --- a/docs/nostr-patterns/README.md +++ b/docs/nostr-patterns/README.md @@ -1,7 +1,7 @@ # Nostr patterns Living reference for reusable Nostr patterns that show up across modules -(activities, forum, market, chat, tasks, base, nostr-feed). +(events, forum, market, chat, tasks, base, nostr-feed). **Read before writing any new Nostr code in this repo.** **Update whenever you introduce, refine, or correct a pattern.** Each section has a "Canonical diff --git a/docs/nostr-patterns/publishing.md b/docs/nostr-patterns/publishing.md index 3fa9f4a..b0dbccb 100644 --- a/docs/nostr-patterns/publishing.md +++ b/docs/nostr-patterns/publishing.md @@ -2,7 +2,7 @@ ## Treat `result.success === 0` as failure, not success -**Canonical:** `src/modules/activities/composables/useRSVP.ts` — +**Canonical:** `src/modules/events/composables/useRSVP.ts` — `if (!result || result.success <= 0) return null`. ```ts @@ -23,7 +23,7 @@ composable. Don't write code that silently treats both as success. ## Optimistic-on-success, not optimistic-on-click -**Canonical:** `src/modules/activities/composables/useRSVP.ts` — local +**Canonical:** `src/modules/events/composables/useRSVP.ts` — local cache update after the `await` resolves with `success > 0`, before the relay echoes the event back through the subscription. @@ -39,7 +39,7 @@ button flip twice. ## Pending-coord debounce: disable the button during in-flight publish -**Canonical:** `src/modules/activities/composables/useRSVP.ts` — +**Canonical:** `src/modules/events/composables/useRSVP.ts` — `pendingCoords: ref>` + `isPending(...)` predicate + `try { … } finally { pendingCoords.value.delete(coord) }`. @@ -66,7 +66,7 @@ while a previous publish on activity B is still flying. A global ## Sign with `nostr-tools.finalizeEvent`, take privkey as bytes -**Canonical:** `src/modules/activities/composables/useRSVP.ts` — +**Canonical:** `src/modules/events/composables/useRSVP.ts` — `hexToUint8Array` helper + `finalizeEvent(template, signingKey)`. `finalizeEvent` expects a `Uint8Array`, not a hex string. Several composables diff --git a/docs/nostr-patterns/replaceable-events.md b/docs/nostr-patterns/replaceable-events.md index 602a623..0cad379 100644 --- a/docs/nostr-patterns/replaceable-events.md +++ b/docs/nostr-patterns/replaceable-events.md @@ -7,7 +7,7 @@ in this file follows from that single fact. ## Strictly-monotonic `created_at` per coord -**Canonical:** `src/modules/activities/composables/useRSVP.ts` — +**Canonical:** `src/modules/events/composables/useRSVP.ts` — `lastPublishAt` map + the `Math.max(now, previous + 1)` line. ```ts @@ -31,7 +31,7 @@ than the last click on the same coord. ## Per-pubkey latest-wins state for derived counts -**Canonical:** `src/modules/activities/composables/useRSVP.ts` — +**Canonical:** `src/modules/events/composables/useRSVP.ts` — `rsvpStates: ref>>` + `upsertRSVPState` + `getRSVPCount` (count entries where status === 'accepted'). @@ -51,7 +51,7 @@ any "who's currently in state X" question. ## Replaceable list, full-rewrite on toggle -**Canonical:** `src/modules/activities/composables/useBookmarks.ts` — +**Canonical:** `src/modules/events/composables/useBookmarks.ts` — NIP-51 kind 10003 bookmark list. For replaceable lists (10003 bookmarks, 10000 mute list, 10006 communities, @@ -66,7 +66,7 @@ diverges on next refresh. ## Vue 3 reactivity for nested `ref` -**Canonical:** `src/modules/activities/composables/useRSVP.ts` — +**Canonical:** `src/modules/events/composables/useRSVP.ts` — `upsertRSVPState` (the `rsvpStates.value.set(coord, inner)` after mutating `inner`). diff --git a/docs/nostr-patterns/subscriptions.md b/docs/nostr-patterns/subscriptions.md index 5921351..3dcb1cd 100644 --- a/docs/nostr-patterns/subscriptions.md +++ b/docs/nostr-patterns/subscriptions.md @@ -2,7 +2,7 @@ ## Subscribe, store the unsubscribe handle, clean up on unmount -**Canonical:** `src/modules/activities/composables/useRSVP.ts` — +**Canonical:** `src/modules/events/composables/useRSVP.ts` — `loadRSVPs()` (subscribe block) + the matching `onUnmounted(() => unsubscribe?.())`. ```ts @@ -33,7 +33,7 @@ session-long vs view-long), not by accident. ## EOSE means "backfill done", not "all events delivered" -**Canonical:** `src/modules/activities/composables/useRSVP.ts` — +**Canonical:** `src/modules/events/composables/useRSVP.ts` — `onEose: () => { isLoaded.value = true }`. `onEose` fires once, after the relay flushes everything stored that matches