From dffcd0013c4c5ed578cc80cf5ea9bfcfe47445fe Mon Sep 17 00:00:00 2001 From: Z8MB1E Date: Fri, 9 Oct 2026 13:48:14 -0400 Subject: [PATCH] chore(chronicle): rename Story Beats to Chronicle Entries The Chronicle collections were auto-labeled from their slugs ("Story Beats"). Give them explicit Chronicle labels and adopt the word Chronicle in the surrounding titles, descriptions, and event text. - StoryBeats: labels Chronicle Entry/Entries, admin group Story -> Chronicle, descriptions updated - Voiceovers / StoryBeatStates: Chronicle labels, group, descriptions (including the "beat" field label) - GameEventLogs: event-log target labels -> Chronicle Entries / States - lib/story: event message text -> "chronicle entry" (internal event-type strings left intact so existing logs stay valid) - regenerate payload-types.ts Slugs are unchanged, so no migration is required. --- src/collections/game/GameEventLogs.ts | 4 ++-- src/collections/story/StoryBeatStates.ts | 13 +++++++++---- src/collections/story/StoryBeats.ts | 16 ++++++++++------ src/collections/story/Voiceovers.ts | 8 ++++++-- .../frontend/story/BeatVoiceover.tsx | 2 +- src/lib/story/index.ts | 16 ++++++++-------- src/payload-types.ts | 18 +++++++++--------- 7 files changed, 45 insertions(+), 32 deletions(-) diff --git a/src/collections/game/GameEventLogs.ts b/src/collections/game/GameEventLogs.ts index 52eeffa6..80405b1f 100644 --- a/src/collections/game/GameEventLogs.ts +++ b/src/collections/game/GameEventLogs.ts @@ -36,8 +36,8 @@ const TARGET_COLLECTIONS = [ { label: "Assignment Transfers", value: "assignment-transfers" }, { label: "Voice Scripts", value: "voice-scripts" }, { label: "Voice Submissions", value: "voice-submissions" }, - { label: "Story Beats", value: "story-beats" }, - { label: "Story Beat States", value: "story-beat-states" }, + { label: "Chronicle Entries", value: "story-beats" }, + { label: "Chronicle Entry States", value: "story-beat-states" }, { label: "Custom Minefields", value: "custom-minefields" }, { label: "Custom Minefield Scores", value: "custom-minefield-scores" }, { label: "Custom Radio Tests", value: "custom-radio-tests" }, diff --git a/src/collections/story/StoryBeatStates.ts b/src/collections/story/StoryBeatStates.ts index 4e4f28e3..93f7594f 100644 --- a/src/collections/story/StoryBeatStates.ts +++ b/src/collections/story/StoryBeatStates.ts @@ -9,11 +9,15 @@ const STAFF_ROLES = ["admin", "developer"]; export const StoryBeatStates: CollectionConfig = { slug: "story-beat-states", + labels: { + singular: "Chronicle Entry State", + plural: "Chronicle Entry States", + }, admin: { - group: "Story", + group: "Chronicle", useAsTitle: "beat", defaultColumns: ["user", "beat", "readAt", "reaction"], - description: "Per-user read markers and reactions for story beats.", + description: "Per-user read markers and reactions for chronicle entries.", // The admin-panel `user` is a client-side user type, so check its roles // structurally rather than through hasRoles. hidden: ({ user }) => @@ -47,6 +51,7 @@ export const StoryBeatStates: CollectionConfig = { name: "beat", type: "relationship", relationTo: "story-beats", + label: "Chronicle Entry", required: true, index: true, }, @@ -54,7 +59,7 @@ export const StoryBeatStates: CollectionConfig = { name: "readAt", type: "date", admin: { - description: "When the user first read the beat.", + description: "When the user first read the entry.", }, }, { @@ -66,7 +71,7 @@ export const StoryBeatStates: CollectionConfig = { { label: "Salute", value: "salute" }, ], admin: { - description: "The user's current reaction to the beat, if any.", + description: "The user's current reaction to the entry, if any.", }, }, ], diff --git a/src/collections/story/StoryBeats.ts b/src/collections/story/StoryBeats.ts index 0709651d..e4880f62 100644 --- a/src/collections/story/StoryBeats.ts +++ b/src/collections/story/StoryBeats.ts @@ -8,13 +8,17 @@ function isStoryAuthor(user: Parameters[1]): boolean { export const StoryBeats: CollectionConfig = { slug: "story-beats", + labels: { + singular: "Chronicle Entry", + plural: "Chronicle Entries", + }, admin: { - group: "Story", + group: "Chronicle", useAsTitle: "title", defaultColumns: ["title", "status", "occurredAt", "order", "mission"], listSearchableFields: ["title", "body"], description: - "Chronicle story beats. Drafts are visible to staff only; published beats are readable by any logged-in user on /story.", + "Chronicle entries. Drafts are visible to staff only; published entries are readable by any logged-in user on /story.", }, access: { // Guests see nothing; admin/developer see everything; any other logged-in @@ -47,7 +51,7 @@ export const StoryBeats: CollectionConfig = { type: "number", admin: { description: - "Manual chapter sequence: if any beat has an order, /story displays beats in that exact order (ascending, first at top). With no order values, the newest beat shows first and chapter numbers follow creation date.", + "Manual chapter sequence: if any entry has an order, /story displays entries in that exact order (ascending, first at top). With no order values, the newest entry shows first and chapter numbers follow creation date.", }, }, { @@ -69,7 +73,7 @@ export const StoryBeats: CollectionConfig = { features: ({ defaultFeatures }) => [...defaultFeatures, FixedToolbarFeature()], }), admin: { - description: "Rich text body of the beat, rendered on /story with the Lexical renderer.", + description: "Rich text body of the entry, rendered on /story with the Lexical renderer.", }, }, { @@ -77,7 +81,7 @@ export const StoryBeats: CollectionConfig = { type: "relationship", relationTo: "missions", admin: { - description: "Optional mission this beat is tied to. Beats may stand alone.", + description: "Optional mission this entry is tied to. Entries may stand alone.", }, }, { @@ -85,7 +89,7 @@ export const StoryBeats: CollectionConfig = { type: "relationship", relationTo: "story-voiceovers", admin: { - description: "Optional audio narration for this beat. Rendered as a player on /story.", + description: "Optional audio narration for this entry. Rendered as a player on /story.", }, }, ], diff --git a/src/collections/story/Voiceovers.ts b/src/collections/story/Voiceovers.ts index 9068dbbd..b6fe2a4f 100644 --- a/src/collections/story/Voiceovers.ts +++ b/src/collections/story/Voiceovers.ts @@ -8,12 +8,16 @@ function isStoryAuthor(user: Parameters[1]): boolean { export const Voiceovers: CollectionConfig = { slug: "story-voiceovers", + labels: { + singular: "Chronicle Voiceover", + plural: "Chronicle Voiceovers", + }, admin: { - group: "Story", + group: "Chronicle", useAsTitle: "filename", defaultColumns: ["filename", "mimeType", "updatedAt"], description: - "Audio narrations for Chronicle story beats. Attach to a beat via its Voiceover field.", + "Audio narrations for Chronicle entries. Attach to an entry via its Voiceover field.", }, access: { read: ({ req }) => Boolean(req.user), diff --git a/src/components/frontend/story/BeatVoiceover.tsx b/src/components/frontend/story/BeatVoiceover.tsx index a4c38042..72bb88b4 100644 --- a/src/components/frontend/story/BeatVoiceover.tsx +++ b/src/components/frontend/story/BeatVoiceover.tsx @@ -13,7 +13,7 @@ function formatTime(seconds: number): string { } /** - * Minimal audiobook-style player for a story beat narration. Play/pause plus + * Minimal audiobook-style player for a chronicle entry narration. Play/pause plus * a seek bar and time readout; ends back at zero (per-chapter playback, no * auto-advance to other chapters). AI-generated narrations get a small note. */ diff --git a/src/lib/story/index.ts b/src/lib/story/index.ts index 94f97fc6..8e6e4c04 100644 --- a/src/lib/story/index.ts +++ b/src/lib/story/index.ts @@ -45,9 +45,9 @@ async function findOrCreateBeatState( } /** - * Mark a story beat as read for the given user. The beat's read access gate - * (published only, staff see all) is enforced via overrideAccess: false, so - * marking a draft read as a normal user throws. + * Mark a chronicle entry as read for the given user. The entry's read access + * gate (published only, staff see all) is enforced via overrideAccess: false, + * so marking a draft read as a normal user throws. * * Idempotent: a second call returns the existing state without changing readAt. */ @@ -74,7 +74,7 @@ export async function markBeatRead( }); emitGameEvent(payload, { type: EventTypes.StoryBeatRead, - message: `${user.displayName || user.username} read the story beat "${beat.title}"`, + message: `${user.displayName || user.username} read the chronicle entry "${beat.title}"`, actor: user.id, targetCollection: "story-beats", targetId: beat.id, @@ -84,10 +84,10 @@ export async function markBeatRead( } /** - * Set (or toggle off) the user's reaction on a story beat. Passing the user's - * current reaction clears it; passing a different one replaces it. + * Set (or toggle off) the user's reaction on a chronicle entry. Passing the + * user's current reaction clears it; passing a different one replaces it. * - * The beat's read access gate is enforced via overrideAccess: false. + * The entry's read access gate is enforced via overrideAccess: false. */ export async function setBeatReaction( payload: Payload, @@ -119,7 +119,7 @@ export async function setBeatReaction( if (next !== null) { emitGameEvent(payload, { type: EventTypes.StoryBeatReact, - message: `${user.displayName || user.username} reacted ${next} to the story beat "${beat.title}"`, + message: `${user.displayName || user.username} reacted ${next} to the chronicle entry "${beat.title}"`, actor: user.id, targetCollection: "story-beats", targetId: beat.id, diff --git a/src/payload-types.ts b/src/payload-types.ts index 242a269d..a7715e2d 100644 --- a/src/payload-types.ts +++ b/src/payload-types.ts @@ -5184,7 +5184,7 @@ export interface NarrativeEvent { createdAt: string; } /** - * Chronicle story beats. Drafts are visible to staff only; published beats are readable by any logged-in user on /story. + * Chronicle entries. Drafts are visible to staff only; published entries are readable by any logged-in user on /story. * * This interface was referenced by `Config`'s JSON-Schema * via the `definition` "story-beats". @@ -5197,12 +5197,12 @@ export interface StoryBeat { */ occurredAt?: string | null; /** - * Manual chapter sequence: if any beat has an order, /story displays beats in that exact order (ascending, first at top). With no order values, the newest beat shows first and chapter numbers follow creation date. + * Manual chapter sequence: if any entry has an order, /story displays entries in that exact order (ascending, first at top). With no order values, the newest entry shows first and chapter numbers follow creation date. */ order?: number | null; status: 'draft' | 'published'; /** - * Rich text body of the beat, rendered on /story with the Lexical renderer. + * Rich text body of the entry, rendered on /story with the Lexical renderer. */ body: { root: { @@ -5220,18 +5220,18 @@ export interface StoryBeat { [k: string]: unknown; }; /** - * Optional mission this beat is tied to. Beats may stand alone. + * Optional mission this entry is tied to. Entries may stand alone. */ mission?: (number | null) | Mission; /** - * Optional audio narration for this beat. Rendered as a player on /story. + * Optional audio narration for this entry. Rendered as a player on /story. */ voiceover?: (number | null) | StoryVoiceover; updatedAt: string; createdAt: string; } /** - * Audio narrations for Chronicle story beats. Attach to a beat via its Voiceover field. + * Audio narrations for Chronicle entries. Attach to an entry via its Voiceover field. * * This interface was referenced by `Config`'s JSON-Schema * via the `definition` "story-voiceovers". @@ -5255,7 +5255,7 @@ export interface StoryVoiceover { focalY?: number | null; } /** - * Per-user read markers and reactions for story beats. + * Per-user read markers and reactions for chronicle entries. * * This interface was referenced by `Config`'s JSON-Schema * via the `definition` "story-beat-states". @@ -5265,11 +5265,11 @@ export interface StoryBeatState { user: number | User; beat: number | StoryBeat; /** - * When the user first read the beat. + * When the user first read the entry. */ readAt?: string | null; /** - * The user's current reaction to the beat, if any. + * The user's current reaction to the entry, if any. */ reaction?: ('like' | 'heart' | 'salute') | null; updatedAt: string;