Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

address review (codex): keep a written character bible when the brief writer returns none

[._.]/ Adam Eivy70d16796299e
diff --git a/client/src/pages/CodeAnimation.jsx b/client/src/pages/CodeAnimation.jsx
index d8307514cc..d01e002cc6 100644
--- a/client/src/pages/CodeAnimation.jsx
+++ b/client/src/pages/CodeAnimation.jsx
@@ -49,6 +49,10 @@ const DEFAULT_DRAFT = {
interactive: false,
};
+// Brief fields where a blank from the brief writer means "nothing to add"
+// rather than "clear it" (on-screen text, by contrast, can be deliberately none).
+const KEEP_ON_BLANK = new Set(['styleNotes', 'cast']);
+
const isRecord = (value) => value !== null && typeof value === 'object' && !Array.isArray(value);
const loadDraft = () => {
@@ -430,9 +434,9 @@ export default function CodeAnimation() {
for (const [key, before] of Object.entries(startingBrief)) {
const written = result.brief[key];
if (typeof written !== 'string' || previous[key] !== before) continue;
- // Style refinements live in the Style section, not the brief — only replace
- // the artist's own notes when the writer actually asked for a refinement.
- if (key === 'styleNotes' && !written) continue;
+ // A blank refinement or character bible means the writer had nothing to
+ // add — never let it wipe what the artist already wrote there.
+ if (KEEP_ON_BLANK.has(key) && !written) continue;
next[key] = written;
}
return next;
diff --git a/client/src/pages/CodeAnimation.test.jsx b/client/src/pages/CodeAnimation.test.jsx
index 9bdfdb4d5c..5b531c4824 100644
--- a/client/src/pages/CodeAnimation.test.jsx
+++ b/client/src/pages/CodeAnimation.test.jsx
@@ -163,20 +163,22 @@ describe('Code Animation page', () => {
expect(screen.getByLabelText(/style refinements/i)).toHaveValue('colder blues at the climax');
});
- it('keeps the artist\'s own style refinements when the writer asks for none', async () => {
+ it('keeps the artist\'s own style refinements and characters when the writer adds none', async () => {
const user = userEvent.setup();
generateCodeAnimationBrief.mockResolvedValue({
- brief: { title: '', concept: 'Fireflies gather over the water.', onScreenText: '', styleNotes: '' },
+ brief: { title: '', concept: 'Fireflies gather over the water.', cast: '', onScreenText: '', styleNotes: '' },
moodBoardId: null,
llm: { provider: 'api-1', model: null, runId: null },
});
await renderPage();
await user.type(screen.getByLabelText(/style refinements/i), 'more fog');
+ await user.type(screen.getByLabelText(/^characters/i), 'Wick, a paper lantern');
await user.type(screen.getByLabelText(/starting idea/i), 'fireflies');
await user.click(screen.getByRole('button', { name: /write brief/i }));
await waitFor(() => expect(generateCodeAnimationBrief).toHaveBeenCalled());
expect(await screen.findByLabelText(/what happens/i)).toHaveValue('Fireflies gather over the water.');
expect(screen.getByLabelText(/style refinements/i)).toHaveValue('more fog');
+ expect(screen.getByLabelText(/^characters/i)).toHaveValue('Wick, a paper lantern');
});
it('preserves brief fields edited while Write Brief is in flight', async () => {