Browse Source

fix: swap primary/hover thumbnails - content images as primary, workflow screenshots as hover

- Primary thumbnail: first image from template content (product, model, etc.)
- Hover thumbnail: workflow screenshot showing node layout
- Remove unused hover variant images

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
handoff-20260429-1057
shrimbly 6 months ago
parent
commit
4a9f7e284f
  1. BIN
      public/template-thumbnails/model-product-hover.png
  2. BIN
      public/template-thumbnails/style-transfer-hover.png
  3. 41
      src/components/quickstart/TemplateExplorerView.tsx

BIN
public/template-thumbnails/model-product-hover.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 759 KiB

BIN
public/template-thumbnails/style-transfer-hover.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 MiB

41
src/components/quickstart/TemplateExplorerView.tsx

@ -2,7 +2,7 @@
import { useState, useEffect, useCallback, useMemo, useRef } from "react";
import { WorkflowFile } from "@/store/workflowStore";
import { getAllPresets, PRESET_TEMPLATES } from "@/lib/quickstart/templates";
import { getAllPresets, PRESET_TEMPLATES, getTemplateContent } from "@/lib/quickstart/templates";
import { QuickstartBackButton } from "./QuickstartBackButton";
import { TemplateCard } from "./TemplateCard";
import { CommunityWorkflowMeta, TemplateCategory, TemplateMetadata } from "@/types/quickstart";
@ -69,20 +69,27 @@ export function TemplateExplorerView({
return metadata;
}, []);
// Template thumbnail images (static paths)
const templateThumbnails: Record<string, { primary: string; hover?: string }> = {
"product-shot": { primary: "/template-thumbnails/product-shot.png" },
"model-product": {
primary: "/template-thumbnails/model-product.png",
hover: "/template-thumbnails/model-product-hover.png"
},
"color-variations": { primary: "/template-thumbnails/color-variations.png" },
"background-swap": { primary: "/template-thumbnails/background-swap.png" },
"style-transfer": {
primary: "/template-thumbnails/style-transfer.png",
hover: "/template-thumbnails/style-transfer-hover.png"
},
"scene-composite": { primary: "/template-thumbnails/scene-composite.png" },
// Get primary thumbnail from template content (first image)
const primaryThumbnails = useMemo(() => {
const images: Record<string, string | undefined> = {};
PRESET_TEMPLATES.forEach((template) => {
const content = getTemplateContent(template.id, "full");
if (content?.images) {
const imageUrls = Object.values(content.images).map((img) => img.url);
images[template.id] = imageUrls[0];
}
});
return images;
}, []);
// Hover thumbnails (workflow screenshots)
const hoverThumbnails: Record<string, string> = {
"product-shot": "/template-thumbnails/product-shot.png",
"model-product": "/template-thumbnails/model-product.png",
"color-variations": "/template-thumbnails/color-variations.png",
"background-swap": "/template-thumbnails/background-swap.png",
"style-transfer": "/template-thumbnails/style-transfer.png",
"scene-composite": "/template-thumbnails/scene-composite.png",
};
// Filter presets based on search, category, and tags
@ -408,8 +415,8 @@ export function TemplateExplorerView({
key={preset.id}
template={preset}
nodeCount={presetMetadata[preset.id]?.nodeCount ?? 0}
previewImage={templateThumbnails[preset.id]?.primary}
hoverImage={templateThumbnails[preset.id]?.hover}
previewImage={primaryThumbnails[preset.id]}
hoverImage={hoverThumbnails[preset.id]}
isLoading={loadingWorkflowId === preset.id}
onUseWorkflow={() => handlePresetSelect(preset.id)}
disabled={isLoading && loadingWorkflowId !== preset.id}

Loading…
Cancel
Save