Skip to content

AI media harness for planning, generating, and editing locally

TypeScript

Polish Video cards and popout dismissal

Bitticb5eca512537
diff --git a/src/components/workspace/VideoLibraryView.tsx b/src/components/workspace/VideoLibraryView.tsx
index 2ff4d3d..8822656 100644
--- a/src/components/workspace/VideoLibraryView.tsx
+++ b/src/components/workspace/VideoLibraryView.tsx
@@ -130,8 +130,8 @@ export function VideoLibraryView(props: ComponentProps<typeof GeneratorView> & {
<PropSection title="References">
<PropRow label="Music"><ComboBox aria-label="Background music" value={sourceValue(selected.musicSource)} options={sourceOptions("audio")} placeholder="Reference unavailable" onChange={(value) => edit({ musicSource: parseSource(value) })} /></PropRow>
<PropRow label="Video"><ComboBox aria-label="Reference video" value={sourceValue(selected.videoSource)} options={sourceOptions("video")} placeholder="Reference unavailable" onChange={(value) => edit({ videoSource: parseSource(value) })} /></PropRow>
- <p className="video-reference-help">Each scene uses the matching time range of these references. Import media in Timeline or choose a generated song. Reference entries use their saved trim range.</p>
- {selected.musicSource && <p className="video-reference-help">Music needs a visual reference: add an image to the shared prompt or select a reference video. Use a References or Singularity generator.</p>}
+ <p className="video-reference-help">Each scene uses its matching time range. Choose generated media, Timeline imports or a saved reference range.</p>
+ {selected.musicSource && <p className="video-reference-help">Music needs an image in the shared prompt or a reference video, and a References/Singularity generator.</p>}
{selected.musicSource && !selected.sceneIds.length && (resolveVideoSource(selected.musicSource, config, "audio")?.durationSeconds ?? 0) >= 2 && <button type="button" className="secondary-button" onClick={() => {
const scenes = songScenes(selected, latest.current); if (!scenes.length) return;
update((current) => ({ ...current, generationJobs: [...current.generationJobs, ...scenes], videos: current.videos!.map((video) => video.id === selected.id ? { ...video, sceneIds: scenes.map((scene) => scene.id) } : video) })); openVideo(selected);
diff --git a/src/components/workspace/VideoPlayback.tsx b/src/components/workspace/VideoPlayback.tsx
index e00607f..f6ff293 100644
--- a/src/components/workspace/VideoPlayback.tsx
+++ b/src/components/workspace/VideoPlayback.tsx
@@ -56,13 +56,22 @@ export function VideoPlayback({ video: item, config, folderPath, popout, onClose
owned = value; setUrl(value); if (!value) setError("This scene's video is unavailable.");
}).catch((reason) => { if (!disposed) setError(String(reason)); });
return () => { disposed = true; epoch.current++; clearTimeout(timer.current); player?.pause(); if (owned) URL.revokeObjectURL(owned); };
- }, [folderPath, current?.sceneId, current?.asset.relativePath]);
+ }, [folderPath, current?.sceneId, current?.asset.relativePath, current?.start, current?.end]);
useEffect(() => {
const focused = document.activeElement as HTMLElement | null;
+ const library = popout ? frame.current?.closest(".video-library-stage")?.querySelector<HTMLElement>(".music-library") : null;
+ const wasInert = library?.hasAttribute("inert");
+ library?.setAttribute("inert", "");
if (popout) frame.current?.focus();
+ const outside = (event: PointerEvent) => { if (popout && !frame.current?.contains(event.target as Node)) close.current(); };
const escape = (event: KeyboardEvent) => { if (event.key === "Escape") { event.preventDefault(); close.current(); } };
+ document.addEventListener("pointerdown", outside, true);
document.addEventListener("keydown", escape);
- return () => { document.removeEventListener("keydown", escape); if (popout && focused?.isConnected) focused.focus(); };
+ return () => {
+ document.removeEventListener("pointerdown", outside, true); document.removeEventListener("keydown", escape);
+ if (library && !wasInert) library.removeAttribute("inert");
+ if (popout && focused?.isConnected) focused.focus();
+ };
}, [popout]);
const player = <div className={popout ? "shot-popout__frame" : "video-card__player"} ref={frame} tabIndex={-1}
role={popout ? "dialog" : "group"} aria-label={`${item.title} preview`} style={{ "--shot-aspect": aspect } as CSSProperties}>
@@ -77,5 +86,5 @@ export function VideoPlayback({ video: item, config, folderPath, popout, onClose
{error && <p className="shot-popout__message" role="alert">{error}</p>}
<span className="video-card__position">{index + 1} / {playlist.length} · {current?.title}</span>
</div>;
- return popout ? <div className="shot-popout" onPointerDown={(event) => { if (event.target === event.currentTarget) onClose(); }}>{player}</div> : player;
+ return popout ? <div className="shot-popout">{player}</div> : player;
}
diff --git a/src/styles/video-library.css b/src/styles/video-library.css
index aa3d18a..c08df35 100644
--- a/src/styles/video-library.css
+++ b/src/styles/video-library.css
@@ -13,6 +13,7 @@
.video-card { overflow: hidden; }
.video-card > .music-song__select { height: auto; padding-bottom: 44px; }
.video-card .music-song__art { aspect-ratio: 16 / 9; }
+.video-library-stage .music-folder .music-song__art { aspect-ratio: 16 / 9; }
.video-card__open { position: absolute; bottom: var(--space-2); right: var(--space-2); }
.video-card__controls { position: absolute; top: 30%; left: 50%; transform: translate(-50%, -50%); display: flex; gap: var(--space-2); }
.video-card__controls button { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid #ffffff80; border-radius: 50%; background: #15191fe6; color: #fff; box-shadow: 0 1px 6px #0008; }