Drop in a screenshot and convert it to clean code (HTML/Tailwind/React/Vue)
Python
Label variant tiles with a model badge (Flash/Max/…)
Abi Rajac7e7e2066df7
diff --git a/frontend/src/components/variants/Variants.tsx b/frontend/src/components/variants/Variants.tsxindex 5a5ebc5b..d63fb0d6 100644--- a/frontend/src/components/variants/Variants.tsx+++ b/frontend/src/components/variants/Variants.tsx@@ -4,12 +4,23 @@ import { useThrottle } from "../../hooks/useThrottle";import {CODE_GENERATION_MODEL_DESCRIPTIONS,CodeGenerationModel,+ getVariantLabel,+ VariantLabelTone,} from "../../lib/models";import WorkingPulse from "../core/WorkingPulse";const IFRAME_WIDTH = 1280;const IFRAME_HEIGHT = 550;+// Color-coded badge shown in the corner of each variant thumbnail.+const BADGE_TONE: Record<VariantLabelTone, string> = {+ flash: "bg-sky-500/90 text-white",+ max: "bg-amber-500/90 text-white",+ pro: "bg-violet-500/90 text-white",+ code: "bg-emerald-500/90 text-white",+ neutral: "bg-zinc-700/90 text-white",+};+interface VariantThumbnailProps {code: string;isSelected: boolean;@@ -119,10 +130,12 @@ function Variants() {if (variant.status === "complete") statusColor = "bg-green-500";else if (variant.status === "error" || variant.status === "cancelled") statusColor = "bg-red-500";+ const label = getVariantLabel(variant.model);+return (<divkey={index}- className={`w-full rounded cursor-pointer overflow-hidden ${+ className={`relative w-full rounded cursor-pointer overflow-hidden ${index === selectedVariantIndex? "ring-2 ring-blue-400 dark:ring-blue-500": "ring-1 ring-gray-200 dark:ring-gray-700 hover:ring-gray-300 dark:hover:ring-gray-600"@@ -130,6 +143,14 @@ function Variants() {title={variant.model ? (CODE_GENERATION_MODEL_DESCRIPTIONS[variant.model as CodeGenerationModel]?.name || variant.model) : undefined}onClick={() => handleVariantClick(index)}>+ {/* Color-coded model badge in the thumbnail corner */}+ {label && (+ <span+ className={`absolute top-1.5 right-1.5 z-10 rounded px-1.5 py-0.5 text-[10px] font-semibold leading-none shadow-sm ${BADGE_TONE[label.tone]}`}+ >+ {label.text}+ </span>+ )}<VariantThumbnailcode={variant.code}isSelected={index === selectedVariantIndex}diff --git a/frontend/src/lib/models.ts b/frontend/src/lib/models.tsindex 5fa690eb..f4f82c35 100644--- a/frontend/src/lib/models.ts+++ b/frontend/src/lib/models.ts@@ -29,6 +29,40 @@ export enum CodeGenerationModel {GEMINI_3_5_FLASH_MINIMAL = "gemini-3.5-flash (minimal thinking)",}+export type VariantLabelTone = "flash" | "max" | "pro" | "code" | "neutral";++export interface VariantLabel {+ text: string;+ tone: VariantLabelTone;+}++// Short, friendly badge shown on each variant tile, derived from the model.+// Anchors requested by product: Gemini 3 Flash (minimal) -> "Flash",+// Gemini 3.1 Pro (high) -> "Max".+const VARIANT_LABELS: Partial<Record<CodeGenerationModel, VariantLabel>> = {+ [CodeGenerationModel.GEMINI_3_FLASH_PREVIEW_MINIMAL]: { text: "Flash", tone: "flash" },+ [CodeGenerationModel.GEMINI_3_FLASH_PREVIEW_HIGH]: { text: "Flash+", tone: "flash" },+ [CodeGenerationModel.GEMINI_3_1_PRO_PREVIEW_HIGH]: { text: "Max", tone: "max" },+ [CodeGenerationModel.GEMINI_3_1_PRO_PREVIEW_MEDIUM]: { text: "Pro", tone: "pro" },+ [CodeGenerationModel.GEMINI_3_1_PRO_PREVIEW_LOW]: { text: "Pro", tone: "pro" },+ [CodeGenerationModel.GPT_5_2_CODEX_HIGH]: { text: "Codex", tone: "code" },+};++export function getVariantLabel(model?: string): VariantLabel | null {+ if (!model) return null;+ const exact = VARIANT_LABELS[model as CodeGenerationModel];+ if (exact) return exact;+ // Family fallback so any model still gets a sensible badge.+ if (model.includes("gemini-3.1-pro")) return { text: "Pro", tone: "pro" };+ if (model.includes("flash")) return { text: "Flash", tone: "flash" };+ if (model.includes("codex")) return { text: "Codex", tone: "code" };+ if (model.includes("gpt")) return { text: "GPT", tone: "code" };+ if (model.includes("opus")) return { text: "Opus", tone: "max" };+ if (model.includes("sonnet")) return { text: "Sonnet", tone: "pro" };+ if (model.includes("fable")) return { text: "Fable", tone: "max" };+ return null;+}+// Will generate a static error if a model in the enum above is not in the descriptionsexport const CODE_GENERATION_MODEL_DESCRIPTIONS: {[key in CodeGenerationModel]: { name: string };