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

fix: force the local backend when finishing a draft, and offer Finish on hidden renders (#3696)

[._.]/ Adam Eivydb432ebe64ae
diff --git a/client/src/components/videoGen/VideoGenGallery.jsx b/client/src/components/videoGen/VideoGenGallery.jsx
index 6e4504f01d..3e6336d42c 100644
--- a/client/src/components/videoGen/VideoGenGallery.jsx
+++ b/client/src/components/videoGen/VideoGenGallery.jsx
@@ -84,6 +84,7 @@ export default function VideoGenGallery({
item={item}
onPreview={() => onPreview(item)}
onContinue={() => onContinue(v)}
+ {...finishProps(v)}
onDelete={() => onDelete(v)}
onToggleHidden={() => onToggleHidden(v)}
{...getCardProps(item.key)}
diff --git a/client/src/components/videoGen/VideoGenGallery.test.jsx b/client/src/components/videoGen/VideoGenGallery.test.jsx
index 0b28ef5db5..a9a3741355 100644
--- a/client/src/components/videoGen/VideoGenGallery.test.jsx
+++ b/client/src/components/videoGen/VideoGenGallery.test.jsx
@@ -23,14 +23,14 @@ const videoRecord = (over = {}) => ({
...over,
});
-const renderGallery = ({ records, models, onFinish = vi.fn() }) => {
+const renderGallery = ({ records, models, hidden = [], showHidden = false, onFinish = vi.fn() }) => {
render(
<MemoryRouter>
<VideoGenGallery
galleryVisible={records}
- galleryHidden={[]}
+ galleryHidden={hidden}
favoritesOnly={false}
- showHidden={false}
+ showHidden={showHidden}
onToggleFavorites={vi.fn()}
onToggleShowHidden={vi.fn()}
onPreview={vi.fn()}
@@ -89,6 +89,17 @@ describe('VideoGenGallery — Finish action (#3696)', () => {
expect(screen.queryByRole('button', { name: /Finish/i })).toBeNull();
});
+ it('offers Finish in the expanded hidden section too — a chain\'s first chunk is a real draft', () => {
+ const { onFinish } = renderGallery({
+ records: [],
+ hidden: [videoRecord({ id: 'rec-hidden', hidden: true })],
+ showHidden: true,
+ models: [DRAFT_MODEL, DELIVERY_MODEL],
+ });
+ fireEvent.click(screen.getByRole('button', { name: /Finish/i }));
+ expect(onFinish.mock.calls[0][0].id).toBe('rec-hidden');
+ });
+
it('renders the gallery unchanged when no finish wiring is supplied at all', () => {
render(
<MemoryRouter>
diff --git a/client/src/hooks/useVideoGenForm.js b/client/src/hooks/useVideoGenForm.js
index 869fa9470a..f91d94528e 100644
--- a/client/src/hooks/useVideoGenForm.js
+++ b/client/src/hooks/useVideoGenForm.js
@@ -859,6 +859,10 @@ export function useVideoGenForm({ models, status, availableLoras, grokEnabled })
const applyFinish = (item, deliveryModelId) => {
if (!item || !deliveryModelId) return;
applyRemix(item);
+ // Force the local backend: the delivery model is a local registry entry, so
+ // finishing while the form happens to be on the Grok backend would leave
+ // `isGrok` true and submit a Grok payload that ignores the model entirely.
+ setBackend('local');
setModelId(deliveryModelId);
setSteps('');
setGuidanceScale('');
diff --git a/client/src/hooks/useVideoGenForm.test.jsx b/client/src/hooks/useVideoGenForm.test.jsx
index 074ee02254..432977c161 100644
--- a/client/src/hooks/useVideoGenForm.test.jsx
+++ b/client/src/hooks/useVideoGenForm.test.jsx
@@ -441,6 +441,21 @@ describe('useVideoGenForm', () => {
expect(result.current.mode).toBe('text');
});
+ it('applyFinish switches off the grok backend so the delivery model is what actually renders', async () => {
+ const { result } = render({ grokEnabled: true });
+ act(() => result.current.handleBackendChange('grok'));
+ expect(result.current.isGrok).toBe(true);
+
+ act(() => result.current.applyFinish({
+ prompt: 'a quiet street at dusk', modelId: MLX.id, seed: 424242, mode: 'text',
+ }, LTX2.id));
+
+ // Leaving the form on grok would submit a grok payload that ignores the
+ // local delivery model entirely.
+ expect(result.current.isGrok).toBe(false);
+ expect(result.current.modelId).toBe(LTX2.id);
+ });
+
it('applyFinish is inert without a record or a delivery model — it never starts a render', async () => {
const { result } = render();
await waitFor(() => expect(result.current.modelId).toBe(MLX.id));