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

feat(mood-boards): use the analysis prompt as the item caption when none is set

[._.]/ Adam Eivydcb959b25c6e
diff --git a/client/src/pages/MoodBoardDetail.jsx b/client/src/pages/MoodBoardDetail.jsx
index ca0bc1bd40..cc04db449f 100644
--- a/client/src/pages/MoodBoardDetail.jsx
+++ b/client/src/pages/MoodBoardDetail.jsx
@@ -223,7 +223,12 @@ function MoodBoardEditor({ id }) {
if (!mountedRef.current) return;
const analysis = moodBoardAnalysisFromResult(item, result);
if (!analysis) return;
- const updated = await updateMoodBoardItem(id, item.id, { analysis }, { silent: true }).catch(() => null);
+ // The caption mirrors the prompt: fill it when empty or when it still holds
+ // the previous analysis prompt, but never overwrite a caption the user wrote.
+ const prevCaption = (item.caption || '').trim();
+ const captionFollows = !prevCaption || prevCaption === (item.analysis?.prompt || '').trim();
+ const patch = captionFollows ? { analysis, caption: analysis.prompt.slice(0, 2000) } : { analysis };
+ const updated = await updateMoodBoardItem(id, item.id, patch, { silent: true }).catch(() => null);
if (!mountedRef.current) return;
if (!updated) { toast.error('Analysis ran but could not be saved to the item'); return; }
setBoard((prev) => (prev
@@ -517,6 +522,7 @@ function MoodBoardEditor({ id }) {
<div className="p-2 flex flex-col gap-1">
<input
type="text"
+ key={item.caption || ""}
aria-label="Item caption"
defaultValue={item.caption || ''}
placeholder="Add a caption…"
diff --git a/client/src/pages/MoodBoardDetail.test.jsx b/client/src/pages/MoodBoardDetail.test.jsx
index eb088a237b..1676af5779 100644
--- a/client/src/pages/MoodBoardDetail.test.jsx
+++ b/client/src/pages/MoodBoardDetail.test.jsx
@@ -476,6 +476,8 @@ describe('MoodBoardDetail item analysis (#4188 Phase 3)', () => {
providerId: 'openai',
model: 'gpt-4o',
},
+ // The caption mirrors the analysis prompt when the item had none.
+ caption: 'a moody castle at dusk',
}, { silent: true });
});