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
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
feat: add Remix on video cards so a clip's prompt and settings refill the form
[._.]/ Adam Eivy27180135f7c4
diff --git a/.changelog/next/added-main.md b/.changelog/next/added-main.mdnew file mode 100644index 0000000000..dc70a92d2e--- /dev/null+++ b/.changelog/next/added-main.md@@ -0,0 +1 @@+- Video recent-render and history cards now have a Remix button that loads the clip's prompt and settings back into the form.diff --git a/client/src/components/media/MediaCard.jsx b/client/src/components/media/MediaCard.jsxindex 98d5256dd9..fba1b06f7c 100644--- a/client/src/components/media/MediaCard.jsx+++ b/client/src/components/media/MediaCard.jsx@@ -9,7 +9,8 @@ import { loraDisplayName } from './normalize';// Single card used everywhere a generated image/video appears in a grid:// the Image Gen page's recent gallery, the Video Gen page's recent renders,// and the Media History tab. Action visibility is opt-in — pass only the-// callbacks you want rendered. Image-only actions (remix, send-to-video) and+// callbacks you want rendered. Remix is offered for both kinds (callers+// dispatch by `item.kind`). Image-only actions (send-to-video, i2i, 3d) and// video-only actions (continue, finish) are auto-hidden when the kind doesn't// match. `onFinish` is passed only for a draft the caller already resolved a// delivery model for (see client/src/lib/videoFinish.js) — an image-conditioned@@ -142,12 +143,12 @@ export default function MediaCard({)}{!hideActions && !confirmingDelete && (<div className="flex flex-wrap gap-1">- {!isVideo && onRemix && (+ {onRemix && (<buttontype="button"onClick={() => onRemix(item)}className="flex-1 min-w-0 px-1.5 py-1 bg-port-accent/20 hover:bg-port-accent/40 text-port-accent text-[10px] rounded flex items-center justify-center gap-1"- title="Reuse settings"+ title="Reuse prompt and settings"><Sparkles className="w-3 h-3 shrink-0" /> <span className="truncate">Remix</span></button>diff --git a/client/src/components/media/MediaCard.test.jsx b/client/src/components/media/MediaCard.test.jsxindex 094b9feba6..3c8e785e99 100644--- a/client/src/components/media/MediaCard.test.jsx+++ b/client/src/components/media/MediaCard.test.jsx@@ -76,6 +76,33 @@ describe('MediaCard', () => {expect(screen.getByTitle('Delete')).toBeInTheDocument();});+ it('offers Remix for videos when the handler is provided', () => {+ const onRemix = vi.fn();+ const videoItem = { ...imageItem, kind: 'video', key: 'video:clip-1', id: 'clip-1', filename: 'clip.mp4' };+ render(+ <MediaCard+ item={videoItem}+ onRemix={onRemix}+ showCollectionMenu={false}+ showMoodBoardMenu={false}+ />+ );++ fireEvent.click(screen.getByRole('button', { name: /Remix/i }));+ expect(onRemix).toHaveBeenCalledWith(videoItem);+ });++ it('omits Remix when no handler is provided — including for videos', () => {+ render(+ <MediaCard+ item={{ ...imageItem, kind: 'video' }}+ showCollectionMenu={false}+ showMoodBoardMenu={false}+ />+ );+ expect(screen.queryByRole('button', { name: /Remix/i })).toBeNull();+ });+it('offers the image-to-Three.js handoff only when its handler is provided', () => {const onSendTo3d = vi.fn();const { rerender } = render(diff --git a/client/src/components/videoGen/VideoGenGallery.jsx b/client/src/components/videoGen/VideoGenGallery.jsxindex 3e6336d42c..4bfc827c35 100644--- a/client/src/components/videoGen/VideoGenGallery.jsx+++ b/client/src/components/videoGen/VideoGenGallery.jsx@@ -10,7 +10,7 @@ import { normalizeVideo } from '../media/normalize';export default function VideoGenGallery({galleryVisible, galleryHidden, favoritesOnly, showHidden,onToggleFavorites, onToggleShowHidden,- onPreview, onContinue, onUpscale, onDelete, onToggleHidden, getCardProps,+ onPreview, onRemix, onContinue, onUpscale, onDelete, onToggleHidden, getCardProps,finishTargetFor, onFinish,}) {// Finish (#3696) is offered per-card, and only when the stored record is a@@ -50,6 +50,7 @@ export default function VideoGenGallery({key={item.key}item={item}onPreview={() => onPreview(item)}+ onRemix={onRemix ? () => onRemix(v) : undefined}onContinue={() => onContinue(v)}{...finishProps(v)}onUpscale={() => onUpscale(v)}@@ -83,6 +84,7 @@ export default function VideoGenGallery({key={item.key}item={item}onPreview={() => onPreview(item)}+ onRemix={onRemix ? () => onRemix(v) : undefined}onContinue={() => onContinue(v)}{...finishProps(v)}onDelete={() => onDelete(v)}diff --git a/client/src/components/videoGen/VideoGenGallery.test.jsx b/client/src/components/videoGen/VideoGenGallery.test.jsxindex a9a3741355..86984b0e77 100644--- a/client/src/components/videoGen/VideoGenGallery.test.jsx+++ b/client/src/components/videoGen/VideoGenGallery.test.jsx@@ -23,7 +23,7 @@ const videoRecord = (over = {}) => ({...over,});-const renderGallery = ({ records, models, hidden = [], showHidden = false, onFinish = vi.fn() }) => {+const renderGallery = ({ records, models, hidden = [], showHidden = false, onFinish = vi.fn(), onRemix } = {}) => {render(<MemoryRouter><VideoGenGallery@@ -34,6 +34,7 @@ const renderGallery = ({ records, models, hidden = [], showHidden = false, onFinonToggleFavorites={vi.fn()}onToggleShowHidden={vi.fn()}onPreview={vi.fn()}+ onRemix={onRemix}onContinue={vi.fn()}onUpscale={vi.fn()}onDelete={vi.fn()}@@ -123,3 +124,32 @@ describe('VideoGenGallery — Finish action (#3696)', () => {expect(screen.getByRole('button', { name: /Continue/i })).toBeInTheDocument();});});++describe('VideoGenGallery — Remix action', () => {+ it('offers Remix and hands the raw record to the handler', () => {+ const onRemix = vi.fn();+ renderGallery({ records: [videoRecord()], models: [DRAFT_MODEL, DELIVERY_MODEL], onRemix });+ fireEvent.click(screen.getByRole('button', { name: /Remix/i }));+ expect(onRemix).toHaveBeenCalledTimes(1);+ expect(onRemix.mock.calls[0][0].id).toBe('rec-1');+ expect(onRemix.mock.calls[0][0].prompt).toBe('a quiet street at dusk');+ });++ it('offers Remix in the expanded hidden section too', () => {+ const onRemix = vi.fn();+ renderGallery({+ records: [],+ hidden: [videoRecord({ id: 'rec-hidden', hidden: true })],+ showHidden: true,+ models: [DRAFT_MODEL, DELIVERY_MODEL],+ onRemix,+ });+ fireEvent.click(screen.getByRole('button', { name: /Remix/i }));+ expect(onRemix.mock.calls[0][0].id).toBe('rec-hidden');+ });++ it('omits Remix when no handler is supplied', () => {+ renderGallery({ records: [videoRecord()], models: [DRAFT_MODEL, DELIVERY_MODEL] });+ expect(screen.queryByRole('button', { name: /Remix/i })).toBeNull();+ });+});diff --git a/client/src/hooks/useMediaPreviewActions.test.jsx b/client/src/hooks/useMediaPreviewActions.test.jsxindex af92c8866c..49b939ba11 100644--- a/client/src/hooks/useMediaPreviewActions.test.jsx+++ b/client/src/hooks/useMediaPreviewActions.test.jsx@@ -19,6 +19,46 @@ const parseNav = () => {return { path, params: new URLSearchParams(qs) };};+describe('useMediaPreviewActions.handleRemix', () => {+ beforeEach(() => navigate.mockReset());++ it('sends a video back to /media/video with prompt and render settings', () => {+ const { result } = renderHook(() => useMediaPreviewActions());+ result.current.handleRemix({+ kind: 'video',+ prompt: 'a fox in rain',+ negativePrompt: 'blurry',+ modelId: 'ltx2-dev',+ width: 768,+ height: 512,+ numFrames: 121,+ fps: 24,+ raw: { seed: 42, steps: 8, guidanceScale: 3, tiling: 'none', disableAudio: true },+ });+ const { path, params } = parseNav();+ expect(path).toBe('/media/video');+ expect(params.get('prompt')).toBe('a fox in rain');+ expect(params.get('negativePrompt')).toBe('blurry');+ expect(params.get('modelId')).toBe('ltx2-dev');+ expect(params.get('w')).toBe('768');+ expect(params.get('h')).toBe('512');+ expect(params.get('numFrames')).toBe('121');+ expect(params.get('fps')).toBe('24');+ expect(params.get('seed')).toBe('42');+ expect(params.get('steps')).toBe('8');+ expect(params.get('guidanceScale')).toBe('3');+ expect(params.get('tiling')).toBe('none');+ expect(params.get('disableAudio')).toBe('1');+ });++ it('skips the (no prompt) placeholder so a remixed clip does not seed that literal', () => {+ const { result } = renderHook(() => useMediaPreviewActions());+ result.current.handleRemix({ kind: 'video', prompt: '(no prompt)', width: 512, height: 512 });+ const { params } = parseNav();+ expect(params.get('prompt')).toBeNull();+ });+});+describe('useMediaPreviewActions.handleSendToImage', () => {beforeEach(() => navigate.mockReset());diff --git a/client/src/pages/MediaCollectionDetail.jsx b/client/src/pages/MediaCollectionDetail.jsxindex e848f6d35d..457ae83e7c 100644--- a/client/src/pages/MediaCollectionDetail.jsx+++ b/client/src/pages/MediaCollectionDetail.jsx@@ -524,7 +524,7 @@ export default function MediaCollectionDetail() {item={item}onPreview={selectMode ? undefined : setPreview}onClick={selectMode ? () => toggleSelect(key) : undefined}- onRemix={!selectMode && item.kind === 'image' ? handleRemix : undefined}+ onRemix={!selectMode ? handleRemix : undefined}onSendToImage={!selectMode && item.kind === 'image' ? handleSendToImage : undefined}onSendToVideo={!selectMode && item.kind === 'image' ? handleSendToVideo : undefined}onContinue={!selectMode && item.kind === 'video' ? handleContinue : undefined}diff --git a/client/src/pages/MediaHistory.jsx b/client/src/pages/MediaHistory.jsxindex e22ca733e1..0f659ade3d 100644--- a/client/src/pages/MediaHistory.jsx+++ b/client/src/pages/MediaHistory.jsx@@ -1,7 +1,8 @@/*** Media History — unified timeline of generated images + videos with filter- * chips, ffmpeg stitching (videos only), Remix + Send-to-Video for images,- * and "continue from last frame" piping back into Image Gen.+ * chips, ffmpeg stitching (videos only), Remix for images and videos,+ * Send-to-Video for images, and "continue from last frame" piping back+ * into Video Gen.*/import { useState, useEffect, useCallback, useMemo } from 'react';diff --git a/client/src/pages/VideoGen.jsx b/client/src/pages/VideoGen.jsxindex 5620c59d06..3878aa71e0 100644--- a/client/src/pages/VideoGen.jsx+++ b/client/src/pages/VideoGen.jsx@@ -1321,6 +1321,7 @@ export default function VideoGen() {onToggleFavorites={() => setFavoritesOnly((v) => !v)}onToggleShowHidden={() => setShowHidden((s) => !s)}onPreview={setPreview}+ onRemix={handleRemixVideo}onContinue={(v) => handleContinue(normalizeVideo(v))}onUpscale={handleUpscaleHistory}onDelete={handleDeleteHistory}