Drop in a screenshot and convert it to clean code (HTML/Tailwind/React/Vue)
Python
bunch of visual fixes
Abi Rajab8a3f5352370
diff --git a/frontend/src/App.tsx b/frontend/src/App.tsxindex 28a73d25..a1322393 100644--- a/frontend/src/App.tsx+++ b/frontend/src/App.tsx@@ -672,9 +672,7 @@ function App() {Back to editor</button></div>- <HistoryDisplay- shouldDisableReverts={appState === AppState.CODING}- />+ <HistoryDisplay /></div></div>) : (diff --git a/frontend/src/components/agent/AgentActivity.tsx b/frontend/src/components/agent/AgentActivity.tsxindex 6f7c5195..a0a20fc1 100644--- a/frontend/src/components/agent/AgentActivity.tsx+++ b/frontend/src/components/agent/AgentActivity.tsx@@ -379,7 +379,21 @@ function AgentEventCard({if (!event.content) return null;return (<div className="py-1 text-sm text-gray-700 dark:text-gray-300 prose prose-sm dark:prose-invert max-w-none">- <ReactMarkdown>{event.content}</ReactMarkdown>+ <ReactMarkdown+ components={{+ img: ({ ...props }) => (+ <div className="my-2 flex justify-start max-w-full">+ <img+ {...props}+ className="max-h-60 max-w-full object-contain rounded-lg border border-gray-200 dark:border-gray-700"+ loading="lazy"+ />+ </div>+ ),+ }}+ >+ {event.content}+ </ReactMarkdown></div>);}@@ -404,7 +418,21 @@ function AgentEventCard({<div className="pb-2">{event.type === "thinking" && event.content && (<div className="prose prose-sm dark:prose-invert max-w-none">- <ReactMarkdown>{event.content}</ReactMarkdown>+ <ReactMarkdown+ components={{+ img: ({ ...props }) => (+ <div className="my-2 flex justify-start max-w-full">+ <img+ {...props}+ className="max-h-60 max-w-full object-contain rounded-lg border border-gray-200 dark:border-gray-700"+ loading="lazy"+ />+ </div>+ ),+ }}+ >+ {event.content}+ </ReactMarkdown></div>)}{event.type === "tool" && renderToolDetails(event, variantCode)}@@ -509,7 +537,7 @@ function AgentActivity() {</>) : (<>- <div className="flex items-center justify-between rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-900/60 px-3 py-2">+ <div className="flex items-center justify-between rounded-xl border border-violet-200 dark:border-violet-800 bg-gradient-to-r from-violet-50 to-white dark:from-violet-900/20 dark:to-zinc-900 px-3 py-2 shadow-[0_0_15px_-3px_rgba(139,92,246,0.3)] dark:shadow-[0_0_15px_-3px_rgba(139,92,246,0.4)] transition-all duration-500"><div className="flex items-center gap-2 text-sm text-gray-600 dark:text-gray-300"><WorkingPulse /><span>Working...</span>diff --git a/frontend/src/components/core/WorkingPulse.tsx b/frontend/src/components/core/WorkingPulse.tsxindex 861cfdcf..ea18247e 100644--- a/frontend/src/components/core/WorkingPulse.tsx+++ b/frontend/src/components/core/WorkingPulse.tsx@@ -1,9 +1,9 @@function WorkingPulse() {return (<span className="inline-flex items-end gap-0.5" aria-hidden="true">- <span className="h-1.5 w-1.5 rounded-full bg-sky-500/90 dark:bg-sky-400/90 animate-bounce [animation-duration:900ms]" />- <span className="h-1.5 w-1.5 rounded-full bg-sky-500/80 dark:bg-sky-400/80 animate-bounce [animation-duration:900ms] [animation-delay:150ms]" />- <span className="h-1.5 w-1.5 rounded-full bg-sky-500/70 dark:bg-sky-400/70 animate-bounce [animation-duration:900ms] [animation-delay:300ms]" />+ <span className="h-1.5 w-1.5 rounded-full bg-violet-500/90 dark:bg-violet-400/90 animate-bounce [animation-duration:900ms]" />+ <span className="h-1.5 w-1.5 rounded-full bg-violet-500/80 dark:bg-violet-400/80 animate-bounce [animation-duration:900ms] [animation-delay:150ms]" />+ <span className="h-1.5 w-1.5 rounded-full bg-violet-500/70 dark:bg-violet-400/70 animate-bounce [animation-duration:900ms] [animation-delay:300ms]" /></span>);}diff --git a/frontend/src/components/history/HistoryDisplay.tsx b/frontend/src/components/history/HistoryDisplay.tsxindex 65a3275f..1f83cc2a 100644--- a/frontend/src/components/history/HistoryDisplay.tsx+++ b/frontend/src/components/history/HistoryDisplay.tsx@@ -1,14 +1,9 @@-import toast from "react-hot-toast";import { renderHistory } from "./utils";import { useProjectStore } from "../../store/project-store";import { BsChevronDown, BsChevronRight } from "react-icons/bs";import { useState } from "react";-interface Props {- shouldDisableReverts: boolean;-}--export default function HistoryDisplay({ shouldDisableReverts }: Props) {+export default function HistoryDisplay() {const { commits, head, setHead } = useProjectStore();const [expandedHash, setExpandedHash] = useState<string | null>(null);@@ -42,11 +37,7 @@ export default function HistoryDisplay({ shouldDisableReverts }: Props) {<divclassName="flex items-center gap-3 px-3 py-2.5 cursor-pointer"onClick={() =>- shouldDisableReverts- ? toast.error(- "Please wait for code generation to complete before viewing an older version."- )- : setHead(item.hash)+ setHead(item.hash)}>{/* Version number badge */}diff --git a/frontend/src/components/preview/PreviewPane.tsx b/frontend/src/components/preview/PreviewPane.tsxindex 437b0886..19453ad0 100644--- a/frontend/src/components/preview/PreviewPane.tsx+++ b/frontend/src/components/preview/PreviewPane.tsx@@ -59,6 +59,12 @@ function PreviewPane({ doUpdate, settings, onOpenVersions }: Props) {? currentCommit.variants[currentCommit.selectedVariantIndex].code: "";+ const isSelectedVariantComplete =+ head &&+ commits[head] &&+ commits[head].variants[commits[head].selectedVariantIndex].status ===+ "complete";+const previewCode =inputMode === "video" && appState === AppState.CODING? extractHtml(currentCode)@@ -150,11 +156,11 @@ function PreviewPane({ doUpdate, settings, onOpenVersions }: Props) {className="flex items-center justify-center gap-2 px-1 cursor-pointer hover:opacity-70 transition-opacity w-32"title="View all versions">- <span className="text-xs font-semibold text-gray-700 dark:text-gray-200">+ <span className="text-xs font-semibold text-gray-700 dark:text-gray-200 leading-none">Version {currentVersionIndex + 1}</span>{currentVersionIndex === totalVersions - 1 && (- <span className="rounded-full bg-blue-100 px-2 py-0.5 text-[10px] font-medium text-blue-700 dark:bg-blue-900/30 dark:text-blue-300">+ <span className="rounded-full bg-gray-100 px-2 py-0.5 text-[10px] font-medium text-gray-700 dark:bg-gray-800 dark:text-gray-300 leading-none flex items-center h-4">Latest</span>)}@@ -173,7 +179,7 @@ function PreviewPane({ doUpdate, settings, onOpenVersions }: Props) {)}<div className="flex items-center gap-1">- {appState === AppState.CODE_READY && (+ {(appState === AppState.CODE_READY || isSelectedVariantComplete) && (<ButtononClick={() => downloadCode(previewCode)}variant="ghost"diff --git a/frontend/src/components/sidebar/IconStrip.tsx b/frontend/src/components/sidebar/IconStrip.tsxindex a037d71a..4c15725b 100644--- a/frontend/src/components/sidebar/IconStrip.tsx+++ b/frontend/src/components/sidebar/IconStrip.tsx@@ -76,11 +76,11 @@ function IconStrip({<buttononClick={onNewProject}- className="flex items-center justify-center rounded-lg p-2 transition-colors text-gray-400 hover:text-gray-600 dark:text-gray-500 dark:hover:text-gray-300 lg:flex-col lg:gap-1 lg:px-2 lg:py-1.5"+ className="flex items-center justify-center rounded-lg p-2 transition-colors bg-violet-100 text-violet-700 hover:bg-violet-200 lg:flex-col lg:gap-1 lg:px-2 lg:py-1.5 dark:bg-violet-900/40 dark:text-violet-200 dark:hover:bg-violet-900/60"title="Start a new project"><LuPlus className="w-[18px] h-[18px]" />- <span className="hidden text-[10px] leading-none lg:block">New</span>+ <span className="hidden text-[10px] leading-none lg:block font-medium">New</span></button></div>diff --git a/frontend/src/components/sidebar/Sidebar.tsx b/frontend/src/components/sidebar/Sidebar.tsxindex b8e8a8fb..553ce9ee 100644--- a/frontend/src/components/sidebar/Sidebar.tsx+++ b/frontend/src/components/sidebar/Sidebar.tsx@@ -125,7 +125,9 @@ function Sidebar({const selectedVariant = currentCommit?.variants[selectedVariantIndex];const selectedVariantEvents = selectedVariant?.agentEvents ?? [];const showWorkingIndicator =- appState === AppState.CODING && selectedVariantEvents.length === 0;+ appState === AppState.CODING &&+ selectedVariantEvents.length === 0 &&+ head === latestCommitHash;const requestStartMs =selectedVariant?.requestStartedAt ??(currentCommit?.dateCreated@@ -231,7 +233,7 @@ function Sidebar({</p></div>{latestChangeImages.length > 0 && (- <div className="mt-2 flex gap-2 overflow-x-auto">+ <div className="mt-2 flex gap-2 flex-wrap justify-end">{latestChangeImages.map((image, index) => (<buttonkey={`${image.slice(0, 40)}-${index}`}@@ -265,7 +267,7 @@ function Sidebar({)}{showWorkingIndicator && (- <div className="mb-3 rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-900/60 px-3 py-2">+ <div className="mb-3 rounded-xl border border-violet-200 dark:border-violet-800 bg-gradient-to-r from-violet-50 to-white dark:from-violet-900/20 dark:to-zinc-900 px-3 py-2 shadow-[0_0_15px_-3px_rgba(139,92,246,0.3)] dark:shadow-[0_0_15px_-3px_rgba(139,92,246,0.4)] transition-all duration-500"><div className="flex items-center justify-between"><div className="flex items-center gap-2 text-sm text-gray-600 dark:text-gray-300"><WorkingPulse />