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: gate apply-candidate success on persist result (#904)

Adam Eivya027e4dbe68c
diff --git a/client/src/components/pipeline/stages/ComicPagesStage.jsx b/client/src/components/pipeline/stages/ComicPagesStage.jsx
index bef2e857b1..b12af98c6a 100644
--- a/client/src/components/pipeline/stages/ComicPagesStage.jsx
+++ b/client/src/components/pipeline/stages/ComicPagesStage.jsx
@@ -55,6 +55,7 @@ export default function ComicPagesStage({ issue, onStageUpdate, actionsGated = f
return null;
});
if (updated) onStageUpdate?.('comicPages', updated.stages.comicPages, updated);
+ return !!updated;
};
const addPage = () => persist([...pages, { panels: [{ description: '', imageJobId: null }] }]);
@@ -188,8 +189,11 @@ export default function ComicPagesStage({ issue, onStageUpdate, actionsGated = f
const next = pages.map((p, i) => i === pi
? { ...p, panels: (p.panels || []).map((q, j) => j === ni ? { ...q, description: prompt } : q) }
: p);
- await persist(next);
+ const ok = await persist(next);
setApplyingCandidate(null);
+ // Keep the candidates list up on a save failure so the user can retry —
+ // persist already toasted the error.
+ if (!ok) return;
setPanelCandidates((prev) => {
const rest = { ...prev };
delete rest[key];
diff --git a/client/src/components/pipeline/stages/StoryboardsStage.jsx b/client/src/components/pipeline/stages/StoryboardsStage.jsx
index f2195e51bd..64444982d2 100644
--- a/client/src/components/pipeline/stages/StoryboardsStage.jsx
+++ b/client/src/components/pipeline/stages/StoryboardsStage.jsx
@@ -87,6 +87,7 @@ export default function StoryboardsStage({ issue, series, onStageUpdate, actions
return null;
});
if (updated) onStageUpdate?.('storyboards', updated.stages.storyboards, updated);
+ return !!updated;
};
const addScene = () => persist([...scenes, { slugline: '', description: '', imageJobId: null }]);
@@ -277,8 +278,11 @@ export default function StoryboardsStage({ issue, series, onStageUpdate, actions
// path — copy stays clipboard-only). Persists via the shared write queue.
const handleApplyCandidate = async (i, prompt, candidateIndex) => {
setApplyingCandidate(`${i}:${candidateIndex}`);
- await persist(scenes.map((s, j) => j === i ? { ...s, description: prompt } : s));
+ const ok = await persist(scenes.map((s, j) => j === i ? { ...s, description: prompt } : s));
setApplyingCandidate(null);
+ // Leave the candidates list up on a save failure so the user can retry —
+ // persist already toasted the error.
+ if (!ok) return;
setSceneCandidates((prev) => {
const next = { ...prev };
delete next[i];