Skip to content

AI media harness for planning, generating, and editing locally

TypeScript

Give each reference kind a true icon and stop claiming previews are impossible

Bitti1ca51b0d27ee
diff --git a/src/components/workspace/GeneratorView.tsx b/src/components/workspace/GeneratorView.tsx
index 132ff96..fec5702 100644
--- a/src/components/workspace/GeneratorView.tsx
+++ b/src/components/workspace/GeneratorView.tsx
@@ -1,5 +1,5 @@
import { listen } from "@tauri-apps/api/event";
-import { AlertCircle, Ban, Check, ChevronRight, Clock3, FileText, Image as ImageIcon, Info, LoaderCircle, Play, Plus, RefreshCw, Sparkles, Square, WandSparkles, X } from "lucide-react";
+import { AlertCircle, Ban, Check, ChevronRight, Clock3, FileText, Image as ImageIcon, Info, LoaderCircle, Music2, Play, Plus, RefreshCw, Sparkles, Square, Video, WandSparkles, X } from "lucide-react";
import { useEffect, useMemo, useRef, useState } from "react";
import { isTauri } from "../../lib/persistence";
import { actionReferenceIds, compileGenerationJobPrompt, compileGenerationJobSegments, compileMiniMaxH3PromptSegments, createDraftGenerationJob, danglingReferenceTokens, sceneDurationSeconds, sceneShots, STORY_TRACK_ID, isReferenceDescribed, isReferenceUsable, isVisualReference, projectItemPath, usableImageReferences, type GenerationJob, type ProjectAsset, type ProjectConfig, type ProjectReference, type PromptSegment, type TimelineClip, type TimelineTrack } from "../../lib/project";
@@ -365,7 +365,7 @@ export function GeneratorView({ config, folderPath, runtime = null, onChange, on
<span className="ref-mini" aria-hidden="true">
{picture
? <ReferenceImage folderPath={folderPath} relativePath={ref.relativePath} sourcePath={ref.sourcePath} alt="" />
- : ref.kind === "image" ? <ImageIcon size={16} /> : <FileText size={16} />}
+ : referenceKindIcon(ref.kind)}
</span>
<b>{ref.name}</b>
{skipped
@@ -591,6 +591,22 @@ const skipReason = (reference: ProjectReference): string | null => {
return null;
};
+/* The stand-in for a reference whose own picture is not being shown. The four
+ kinds get four icons, which they did not before: an `image` arm sat here that
+ nothing could reach — referenceSchema refuses an image with no file, so a
+ parsed image reference always has one and always renders the real picture —
+ while `video` and `audio`, which DO reach here (they are pointed at rather
+ than copied, and ReferenceImage cannot show a frame of either), fell through
+ to the same page icon a written definition gets. Same icons as
+ MediaThumbnail, so a clip and the reference it came from read alike. */
+const referenceKindIcon = (kind: ProjectReference["kind"]) =>
+ kind === "video" ? <Video size={16} />
+ : kind === "audio" ? <Music2 size={16} />
+ /* Unreachable for anything zod parsed; kept so a future kind that can
+ legitimately arrive without a file is not silently called a document. */
+ : kind === "image" ? <ImageIcon size={16} />
+ : <FileText size={16} />;
+
const STAGES: Array<{ label: string; at: number }> = [
{ label: "Prepare", at: 0.01 },
{ label: "Render", at: 0.5 },
diff --git a/src/styles/references.css b/src/styles/references.css
index face184..fb8403d 100644
--- a/src/styles/references.css
+++ b/src/styles/references.css
@@ -131,8 +131,13 @@
box-shadow: 0 0 0 2px var(--accent-soft);
}
-/* PolStudio cannot render image previews yet, so a reference shows a labelled
- placeholder rather than a stand-in picture of someone else's subject. */
+/* The plate a reference sits on: a hatched panel with its kind lettered on it.
+ It was once the whole story — "PolStudio cannot render image previews yet",
+ which stopped being true when `.reference-art--photo` below started painting
+ the user's own picture, and stayed in the file for a while afterwards. What
+ it is now is the BACKDROP: it shows through a transparent PNG, and it is all
+ there is for a reference with no picture to show — one still being described,
+ or a written definition, which has no file at all. */
.reference-art,
.reference-copy-art {
position: relative;