1
0
Fork 0

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.
This commit is contained in:
Jason Fraley 2026-10-09 13:48:14 -04:00
parent a696a864ca
commit dffcd0013c
7 changed files with 45 additions and 32 deletions

View file

@ -36,8 +36,8 @@ const TARGET_COLLECTIONS = [
{ label: "Assignment Transfers", value: "assignment-transfers" }, { label: "Assignment Transfers", value: "assignment-transfers" },
{ label: "Voice Scripts", value: "voice-scripts" }, { label: "Voice Scripts", value: "voice-scripts" },
{ label: "Voice Submissions", value: "voice-submissions" }, { label: "Voice Submissions", value: "voice-submissions" },
{ label: "Story Beats", value: "story-beats" }, { label: "Chronicle Entries", value: "story-beats" },
{ label: "Story Beat States", value: "story-beat-states" }, { label: "Chronicle Entry States", value: "story-beat-states" },
{ label: "Custom Minefields", value: "custom-minefields" }, { label: "Custom Minefields", value: "custom-minefields" },
{ label: "Custom Minefield Scores", value: "custom-minefield-scores" }, { label: "Custom Minefield Scores", value: "custom-minefield-scores" },
{ label: "Custom Radio Tests", value: "custom-radio-tests" }, { label: "Custom Radio Tests", value: "custom-radio-tests" },

View file

@ -9,11 +9,15 @@ const STAFF_ROLES = ["admin", "developer"];
export const StoryBeatStates: CollectionConfig = { export const StoryBeatStates: CollectionConfig = {
slug: "story-beat-states", slug: "story-beat-states",
labels: {
singular: "Chronicle Entry State",
plural: "Chronicle Entry States",
},
admin: { admin: {
group: "Story", group: "Chronicle",
useAsTitle: "beat", useAsTitle: "beat",
defaultColumns: ["user", "beat", "readAt", "reaction"], 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 // The admin-panel `user` is a client-side user type, so check its roles
// structurally rather than through hasRoles. // structurally rather than through hasRoles.
hidden: ({ user }) => hidden: ({ user }) =>
@ -47,6 +51,7 @@ export const StoryBeatStates: CollectionConfig = {
name: "beat", name: "beat",
type: "relationship", type: "relationship",
relationTo: "story-beats", relationTo: "story-beats",
label: "Chronicle Entry",
required: true, required: true,
index: true, index: true,
}, },
@ -54,7 +59,7 @@ export const StoryBeatStates: CollectionConfig = {
name: "readAt", name: "readAt",
type: "date", type: "date",
admin: { 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" }, { label: "Salute", value: "salute" },
], ],
admin: { admin: {
description: "The user's current reaction to the beat, if any.", description: "The user's current reaction to the entry, if any.",
}, },
}, },
], ],

View file

@ -8,13 +8,17 @@ function isStoryAuthor(user: Parameters<typeof hasRoles>[1]): boolean {
export const StoryBeats: CollectionConfig = { export const StoryBeats: CollectionConfig = {
slug: "story-beats", slug: "story-beats",
labels: {
singular: "Chronicle Entry",
plural: "Chronicle Entries",
},
admin: { admin: {
group: "Story", group: "Chronicle",
useAsTitle: "title", useAsTitle: "title",
defaultColumns: ["title", "status", "occurredAt", "order", "mission"], defaultColumns: ["title", "status", "occurredAt", "order", "mission"],
listSearchableFields: ["title", "body"], listSearchableFields: ["title", "body"],
description: 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: { access: {
// Guests see nothing; admin/developer see everything; any other logged-in // Guests see nothing; admin/developer see everything; any other logged-in
@ -47,7 +51,7 @@ export const StoryBeats: CollectionConfig = {
type: "number", type: "number",
admin: { admin: {
description: 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()], features: ({ defaultFeatures }) => [...defaultFeatures, FixedToolbarFeature()],
}), }),
admin: { 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", type: "relationship",
relationTo: "missions", relationTo: "missions",
admin: { 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", type: "relationship",
relationTo: "story-voiceovers", relationTo: "story-voiceovers",
admin: { 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.",
}, },
}, },
], ],

View file

@ -8,12 +8,16 @@ function isStoryAuthor(user: Parameters<typeof hasRoles>[1]): boolean {
export const Voiceovers: CollectionConfig = { export const Voiceovers: CollectionConfig = {
slug: "story-voiceovers", slug: "story-voiceovers",
labels: {
singular: "Chronicle Voiceover",
plural: "Chronicle Voiceovers",
},
admin: { admin: {
group: "Story", group: "Chronicle",
useAsTitle: "filename", useAsTitle: "filename",
defaultColumns: ["filename", "mimeType", "updatedAt"], defaultColumns: ["filename", "mimeType", "updatedAt"],
description: 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: { access: {
read: ({ req }) => Boolean(req.user), read: ({ req }) => Boolean(req.user),

View file

@ -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 * 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. * auto-advance to other chapters). AI-generated narrations get a small note.
*/ */

View file

@ -45,9 +45,9 @@ async function findOrCreateBeatState(
} }
/** /**
* Mark a story beat as read for the given user. The beat's read access gate * Mark a chronicle entry as read for the given user. The entry's read access
* (published only, staff see all) is enforced via overrideAccess: false, so * gate (published only, staff see all) is enforced via overrideAccess: false,
* marking a draft read as a normal user throws. * so marking a draft read as a normal user throws.
* *
* Idempotent: a second call returns the existing state without changing readAt. * Idempotent: a second call returns the existing state without changing readAt.
*/ */
@ -74,7 +74,7 @@ export async function markBeatRead(
}); });
emitGameEvent(payload, { emitGameEvent(payload, {
type: EventTypes.StoryBeatRead, 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, actor: user.id,
targetCollection: "story-beats", targetCollection: "story-beats",
targetId: beat.id, 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 * Set (or toggle off) the user's reaction on a chronicle entry. Passing the
* current reaction clears it; passing a different one replaces it. * 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( export async function setBeatReaction(
payload: Payload, payload: Payload,
@ -119,7 +119,7 @@ export async function setBeatReaction(
if (next !== null) { if (next !== null) {
emitGameEvent(payload, { emitGameEvent(payload, {
type: EventTypes.StoryBeatReact, 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, actor: user.id,
targetCollection: "story-beats", targetCollection: "story-beats",
targetId: beat.id, targetId: beat.id,

View file

@ -5184,7 +5184,7 @@ export interface NarrativeEvent {
createdAt: string; 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 * This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "story-beats". * via the `definition` "story-beats".
@ -5197,12 +5197,12 @@ export interface StoryBeat {
*/ */
occurredAt?: string | null; 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; order?: number | null;
status: 'draft' | 'published'; 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: { body: {
root: { root: {
@ -5220,18 +5220,18 @@ export interface StoryBeat {
[k: string]: unknown; [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; 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; voiceover?: (number | null) | StoryVoiceover;
updatedAt: string; updatedAt: string;
createdAt: 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 * This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "story-voiceovers". * via the `definition` "story-voiceovers".
@ -5255,7 +5255,7 @@ export interface StoryVoiceover {
focalY?: number | null; 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 * This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "story-beat-states". * via the `definition` "story-beat-states".
@ -5265,11 +5265,11 @@ export interface StoryBeatState {
user: number | User; user: number | User;
beat: number | StoryBeat; beat: number | StoryBeat;
/** /**
* When the user first read the beat. * When the user first read the entry.
*/ */
readAt?: string | null; 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; reaction?: ('like' | 'heart' | 'salute') | null;
updatedAt: string; updatedAt: string;