refactor(state): fix code quality findings for runtime and story log

This commit is contained in:
ginnoir
2026-06-11 21:20:52 -05:00
parent 239b2506ec
commit b29b17c6cb
3 changed files with 204 additions and 36 deletions
+9 -5
View File
@@ -40,10 +40,14 @@ export function processStoryTriggers(
const shouldOpenPanel =
enteredNodeIds.length > 0 &&
enteredNodeIds.some((id) => shouldAutoNavigateToStory(prefs, id, content));
const eventLogLines = logEntries.map((e) =>
e.choiceLabel
? `Story: ${e.choiceLabel}`
: `Story: ${content.storyNodesById[e.nodeId]?.prose.slice(0, 40)}`,
);
const customLogs = events.filter((e) => e.kind === 'log').map((e) => e.prose);
const eventLogLines = [
...customLogs,
...logEntries.map((e) =>
e.choiceLabel
? `Story: ${e.choiceLabel}`
: `Story: ${content.storyNodesById[e.nodeId]?.prose.slice(0, 40)}`,
),
];
return { enteredNodeIds, logEntries, shouldOpenPanel, eventLogLines };
}