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:
parent
a696a864ca
commit
dffcd0013c
7 changed files with 45 additions and 32 deletions
|
|
@ -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" },
|
||||
|
|
|
|||
|
|
@ -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.",
|
||||
},
|
||||
},
|
||||
],
|
||||
|
|
|
|||
|
|
@ -8,13 +8,17 @@ function isStoryAuthor(user: Parameters<typeof hasRoles>[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.",
|
||||
},
|
||||
},
|
||||
],
|
||||
|
|
|
|||
|
|
@ -8,12 +8,16 @@ function isStoryAuthor(user: Parameters<typeof hasRoles>[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),
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue