Skip to content

Drop in a screenshot and convert it to clean code (HTML/Tailwind/React/Vue)

Python

Update Gemini variant messaging

Abi Rajadc67f6407688
diff --git a/backend/routes/model_choice_sets.py b/backend/routes/model_choice_sets.py
index 4a958b81..15cd952a 100644
--- a/backend/routes/model_choice_sets.py
+++ b/backend/routes/model_choice_sets.py
@@ -3,7 +3,7 @@ from llm import Llm
# Video variants always use Gemini.
VIDEO_VARIANT_MODELS = (
Llm.GEMINI_3_FLASH_PREVIEW_MINIMAL,
- Llm.GEMINI_3_PRO_PREVIEW_LOW,
+ Llm.GEMINI_3_1_PRO_PREVIEW_HIGH,
)
# All API keys available.
diff --git a/frontend/src/components/sidebar/Sidebar.tsx b/frontend/src/components/sidebar/Sidebar.tsx
index 52110822..c9de09e8 100644
--- a/frontend/src/components/sidebar/Sidebar.tsx
+++ b/frontend/src/components/sidebar/Sidebar.tsx
@@ -13,6 +13,7 @@ import WorkingPulse from "../core/WorkingPulse";
import ImageLightbox from "../ImageLightbox";
import { Commit } from "../commits/types";
import { removeHighlight } from "../select-and-edit/utils";
+import { CodeGenerationModel } from "../../lib/models";
interface SidebarProps {
showSelectAndEditFeature: boolean;
@@ -56,6 +57,13 @@ function getSelectedElementTag(commit: Commit | null): string | null {
return extractTagName(html);
}
+function isSlowGeminiModel(model?: string): boolean {
+ return (
+ model === CodeGenerationModel.GEMINI_3_1_PRO_PREVIEW_HIGH ||
+ model === CodeGenerationModel.GEMINI_3_1_PRO_PREVIEW_MEDIUM
+ );
+}
+
function Sidebar({
showSelectAndEditFeature,
doUpdate,
@@ -343,6 +351,12 @@ function Sidebar({
</div>
)}
+ {isSlowGeminiModel(selectedVariant?.model) && (
+ <div className="mb-3 rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-900 dark:border-amber-800 dark:bg-amber-900/20 dark:text-amber-200">
+ Slow, high quality model. May take 5-10 mins on some images/videos.
+ </div>
+ )}
+
{isViewingOlderVersion && currentVersionNumber !== null ? (
<div className="mb-4 flex flex-col items-center py-6">
<p className="text-2xl font-semibold text-gray-900 dark:text-zinc-100">
diff --git a/frontend/src/components/variants/Variants.tsx b/frontend/src/components/variants/Variants.tsx
index 957d333d..a8dd5ef6 100644
--- a/frontend/src/components/variants/Variants.tsx
+++ b/frontend/src/components/variants/Variants.tsx
@@ -1,11 +1,11 @@
import { useProjectStore } from "../../store/project-store";
-import Spinner from "../core/Spinner";
import { useEffect, useRef, useState } from "react";
import { useThrottle } from "../../hooks/useThrottle";
import {
CODE_GENERATION_MODEL_DESCRIPTIONS,
CodeGenerationModel,
} from "../../lib/models";
+import WorkingPulse from "../core/WorkingPulse";
const IFRAME_WIDTH = 1280;
const IFRAME_HEIGHT = 550;
@@ -140,8 +140,13 @@ function Variants() {
Option {index + 1}
</span>
{variant.status === "generating" && (
- <div className="ml-auto shrink-0 scale-75">
- <Spinner />
+ <div
+ className="ml-auto shrink-0 inline-flex items-center"
+ role="status"
+ aria-live="polite"
+ aria-label="Working"
+ >
+ <WorkingPulse />
</div>
)}
</div>