The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.
TypeScript agentai-chatai-studioall-in-onecoding-agentdesktop-appfluximage-generationlinuxllmlocal-ailocal-llmopen-sourceprivacyself-hostedstable-diffusionuncensoreduncensored-aivideo-generationwindows
fix(create): C1 - add Animate this image to the result toolbar (web parity)
purple25d920db078f
diff --git a/src/components/create/experimental/CreateExperimental.tsx b/src/components/create/experimental/CreateExperimental.tsxindex 8d8222b5..52409b2d 100644--- a/src/components/create/experimental/CreateExperimental.tsx+++ b/src/components/create/experimental/CreateExperimental.tsx@@ -188,6 +188,7 @@ function CreateExperimentalInner() {// text-to-image instead of an edit). Hide the action where the lane can't// run, using the same rule the IntentBar renders from.const editAvailable = isIntentAvailable('edit', backend, isMlxImageHost())+ const animateAvailable = isIntentAvailable('animate', backend, isMlxImageHost())// Pull a finished result back in as the working source (ImageRef). Needed// because a text-to-image run leaves `source` empty — without this, "Edit@@ -209,6 +210,21 @@ function CreateExperimentalInner() {}}, [adoptResult, setError])+ // C1: "Animate this image" on a finished result (web parity, createStore's+ // animateFrom / OutputView.tsx). setIntent('animate') already keeps the+ // current source in place (see createStore.ts's 'animate' case, which+ // deliberately skips ...dropAll) — but a fresh t2i result was never adopted+ // as `source` in the first place, so setSource still has to run after it,+ // exactly like editResultWithMask does for 'edit'. No mask step needed here.+ const animateResult = useCallback(async (item: GalleryItem) => {+ useCreateStore.getState().setIntent('animate')+ try {+ useCreateStore.getState().setSource(await adoptResult(item))+ } catch (err) {+ setError(`Could not load the result for animating: ${err instanceof Error ? err.message : String(err)}`)+ }+ }, [adoptResult, setError])+// David 2026-07-10: source-needing ops must start EMPTY — never silently// adopt a gallery image as the input. Adoption is always explicit: the// InputSlot's "pick from gallery" strip, drag&drop, the file picker, or a@@ -345,6 +361,7 @@ function CreateExperimentalInner() {displayed={displayed}onOpenMaskEditor={() => setMaskOpen(true)}onEditResult={editAvailable ? (it) => { void editResultWithMask(it) } : undefined}+ onAnimateResult={animateAvailable ? (it) => { void animateResult(it) } : undefined}onFullscreen={(it) => setLightbox(it)}/><CreatePanel open={panelOpen} onOpenChange={setPanelOpen} activeId={shownId} onSelect={openGalleryItem} />diff --git a/src/components/create/experimental/OutputView.tsx b/src/components/create/experimental/OutputView.tsxindex 826d76f4..57cd84a6 100644--- a/src/components/create/experimental/OutputView.tsx+++ b/src/components/create/experimental/OutputView.tsx@@ -1,6 +1,6 @@import { useEffect, useState } from 'react'import { motion } from 'framer-motion'-import { Cpu, Sparkles, ImageDown, Maximize2, Download, Wand2, MonitorOff, AudioLines } from 'lucide-react'+import { Cpu, Sparkles, ImageDown, Maximize2, Download, Wand2, MonitorOff, AudioLines, Film } from 'lucide-react'import { coldLoadHint } from '../../../lib/cold-load-notice'import { useCreateStore, type GalleryItem, type ProgressPhase } from '../../../stores/createStore'import { backendCall, downloadComfyFile, isTauri } from '../../../api/backend'@@ -104,6 +104,12 @@ interface ResultProps {item: GalleryItemonFullscreen: () => voidonSendToEditor?: () => void+ /** C1: adopt this finished image as the Animate intent's source, matching+ * web's OutputView (apps/web/components/create/experimental/OutputView.tsx,+ * createStore.animateFrom). Absent where the Animate lane cannot actually+ * run (see isIntentAvailable('animate', ...) in Stage's caller), same gating+ * pattern as onSendToEditor above it. */+ onAnimate?: () => void}function extFor(contentType: string, kind: 'image' | 'video' | 'audio'): string {@@ -217,7 +223,7 @@ function reconcileDims(item: GalleryItem, w: number, h: number) {}}-export function ResultView({ item, onFullscreen, onSendToEditor }: ResultProps) {+export function ResultView({ item, onFullscreen, onSendToEditor, onAnimate }: ResultProps) {const { src: url, onError } = useComfyMedia(item)const download = () => void downloadGalleryItem(item)const isVideo = item.type === 'video'@@ -264,6 +270,9 @@ export function ResultView({ item, onFullscreen, onSendToEditor }: ResultProps){onSendToEditor && item.type === 'image' && !item.unavailable && (<IconBtn title="Edit with mask" onClick={onSendToEditor}><Wand2 size={14} /></IconBtn>)}+ {onAnimate && item.type === 'image' && !item.unavailable && (+ <IconBtn title="Animate this image" onClick={onAnimate}><Film size={14} /></IconBtn>+ )}<IconBtntitle={item.unavailable ? 'Download needs the local engine' : 'Download'}disabled={item.unavailable}diff --git a/src/components/create/experimental/Stage.tsx b/src/components/create/experimental/Stage.tsxindex 9c78aa2e..c7cd1a83 100644--- a/src/components/create/experimental/Stage.tsx+++ b/src/components/create/experimental/Stage.tsx@@ -30,10 +30,14 @@ interface Props {* Absent where the Edit intent has no working local lane (the MLX Mac),* so the button only shows where inpainting actually runs. */onEditResult?: (item: GalleryItem) => void+ /** C1: adopt a finished image as the Animate intent's source. Absent where+ * the Animate lane has no working local pipeline (MLX Mac), same reasoning+ * as onEditResult above. */+ onAnimateResult?: (item: GalleryItem) => voidonFullscreen: (item: GalleryItem) => void}-export function Stage({ displayed, onOpenMaskEditor, onEditResult, onFullscreen }: Props) {+export function Stage({ displayed, onOpenMaskEditor, onEditResult, onAnimateResult, onFullscreen }: Props) {const intent = useCreateStore((s) => s.intent())const meta = INTENT_MAP[intent]const isGenerating = useCreateStore((s) => s.isGenerating)@@ -119,6 +123,7 @@ export function Stage({ displayed, onOpenMaskEditor, onEditResult, onFullscreenitem={displayed}onFullscreen={() => onFullscreen(displayed)}onSendToEditor={displayed.type === 'image' && onEditResult ? () => onEditResult(displayed) : undefined}+ onAnimate={displayed.type === 'image' && onAnimateResult ? () => onAnimateResult(displayed) : undefined}/>)} else {diff --git a/src/components/create/experimental/__tests__/animate-button-on-result.test.tsx b/src/components/create/experimental/__tests__/animate-button-on-result.test.tsxnew file mode 100644index 00000000..47313516--- /dev/null+++ b/src/components/create/experimental/__tests__/animate-button-on-result.test.tsx@@ -0,0 +1,76 @@+// @vitest-environment jsdom+/**+ * C1 (Desktop Create parity, web reference:+ * apps/web/components/create/experimental/OutputView.tsx ++ * createStore.animateFrom in lu-300-web): a finished image's result view had+ * no "Animate this image" affordance on Desktop — Edit-with-mask, Download+ * and Fullscreen were the only hover actions. Desktop's own createStore+ * already carries a correct `case 'animate':` in setIntent() (keeps+ * `source` — no ...dropAll) and a working setSource(), so the missing piece+ * was purely the button + its onClick wiring through ResultView.+ *+ * This test is scoped to ResultView itself (OutputView.tsx), the component+ * that actually renders the hover toolbar — it is the smallest unit where+ * "the button exists, is gated like Edit, and calls back" is observable+ * without standing up the whole CreateExperimental store wiring.+ *+ * Run: npx vitest run src/components/create/experimental/__tests__/animate-button-on-result.test.tsx+ */+import { describe, expect, it, vi, beforeEach } from 'vitest'+import { cleanup, fireEvent, render, screen } from '@testing-library/react'+import { ResultView } from '../OutputView'+import type { GalleryItem } from '../../../../stores/createStore'++beforeEach(() => {+ cleanup()+})++function makeItem(overrides: Partial<GalleryItem> = {}): GalleryItem {+ return {+ id: 'g1',+ type: 'image',+ filename: 'lu_00001_.png',+ subfolder: '',+ prompt: 'a lighthouse at dusk',+ negativePrompt: '',+ model: 'sdxl.safetensors',+ modelType: 'sdxl',+ seed: 42,+ steps: 20,+ cfgScale: 5,+ sampler: 'euler',+ scheduler: 'normal',+ width: 1024,+ height: 1024,+ batchSize: 1,+ createdAt: Date.now(),+ ...overrides,+ }+}++describe('ResultView "Animate this image" action', () => {+ it('renders and fires onAnimate when the caller supplies it for a finished image', () => {+ const onAnimate = vi.fn()+ render(<ResultView item={makeItem()} onFullscreen={() => {}} onAnimate={onAnimate} />)+ const btn = screen.getByTitle('Animate this image')+ fireEvent.click(btn)+ expect(onAnimate).toHaveBeenCalledTimes(1)+ })++ it('is absent when the caller omits onAnimate (Animate lane unavailable — MLX Mac / locked intent)', () => {+ render(<ResultView item={makeItem()} onFullscreen={() => {}} />)+ expect(screen.queryByTitle('Animate this image')).toBeNull()+ })++ it('is absent on a video result even when onAnimate is supplied (nothing to animate FROM a video)', () => {+ const onAnimate = vi.fn()+ render(<ResultView item={makeItem({ type: 'video' })} onFullscreen={() => {}} onAnimate={onAnimate} />)+ expect(screen.queryByTitle('Animate this image')).toBeNull()+ })++ it('is absent while the render is unavailable (local engine unreachable), matching Edit-with-mask\'s own gate', () => {+ const onAnimate = vi.fn()+ render(<ResultView item={makeItem({ unavailable: true })} onFullscreen={() => {}} onAnimate={onAnimate} />)+ expect(screen.queryByTitle('Animate this image')).toBeNull()+ })+})