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

render mp4 animation clips inline in the Sprite Manager Animations group

[._.]/ Adam Eivy57810a2ab134
diff --git a/client/src/components/sprites/AssetCollection.jsx b/client/src/components/sprites/AssetCollection.jsx
index 8a179f5a81..1d65138904 100644
--- a/client/src/components/sprites/AssetCollection.jsx
+++ b/client/src/components/sprites/AssetCollection.jsx
@@ -20,7 +20,7 @@ import { FolderOpen, RefreshCw, Scissors, Sparkles, Film, FileJson, NotebookPen
import AssetInspector from './AssetInspector.jsx';
import CorrectionNote from './CorrectionNote.jsx';
import SpritePreview from './SpritePreview.jsx';
-import { hasSpritePreview, assetVersionToken } from './spriteAssets.js';
+import { hasSpritePreview, isVideoAsset, assetVersionToken, spriteAssetUrl } from './spriteAssets.js';
import { groupSpriteAssetsByRole } from '../../lib/spriteFacets.js';
import { formatBytes } from '../../utils/formatters.js';
@@ -71,8 +71,20 @@ function AssetCard({ recordId, asset, actions, corrections, onCorrectionChange,
className="block w-full text-left rounded hover:opacity-80"
title={asset.path}
>
- {hasSpritePreview(asset) && (
+ {hasSpritePreview(asset) ? (
<SpritePreview recordId={recordId} path={asset.path} version={assetVersionToken(asset)} className="h-20 rounded" />
+ ) : isVideoAsset(asset) && (
+ // A raw grok clip carries its own magenta matte (not transparent),
+ // so no checkerboard behind it, matching WalkWorkflow's inline clip.
+ <video
+ src={spriteAssetUrl(recordId, asset.path, assetVersionToken(asset))}
+ className="w-full h-20 object-cover rounded bg-port-bg"
+ autoPlay
+ loop
+ muted
+ playsInline
+ aria-label={`preview of ${name}`}
+ />
)}
<span className="block text-[10px] text-gray-500 truncate">{name}</span>
<span className="flex items-center gap-1 text-[10px] text-gray-600">
diff --git a/client/src/components/sprites/AssetCollection.test.jsx b/client/src/components/sprites/AssetCollection.test.jsx
index 6ef267457f..c4c15e7929 100644
--- a/client/src/components/sprites/AssetCollection.test.jsx
+++ b/client/src/components/sprites/AssetCollection.test.jsx
@@ -82,6 +82,19 @@ describe('AssetCollection grouping', () => {
expect(screen.queryAllByRole('heading', { level: 4 })).toHaveLength(0);
});
+ it('plays an mp4 animation asset inline as an autoplay/loop/muted video', () => {
+ const CLIP = 'grok/walk-east-abc12345/generated/source-video.mp4';
+ render(<AssetCollection recordId="example-walker" assets={[asset(CLIP)]} />);
+ expect(groupHeadings()).toEqual(['Animations(1)']);
+ const video = screen.getByTitle(CLIP).querySelector('video');
+ expect(video).toBeTruthy();
+ expect(video).toHaveAttribute('src', expect.stringContaining(encodeURIComponent(CLIP.split('/').pop())));
+ expect(video).toHaveAttribute('autoplay');
+ expect(video).toHaveAttribute('loop');
+ // React reflects `muted` as a DOM property, not an HTML attribute.
+ expect(video.muted).toBe(true);
+ });
+
it('keeps an unapproved run\'s strip badged `candidate` (#2938)', () => {
render(<AssetCollection recordId="example-walker" assets={ASSETS} />);
const stripGroup = screen.getByRole('heading', { name: /Strips/ }).parentElement;