From 820e740b9d99de53d239f00de3e738553e54063d Mon Sep 17 00:00:00 2001 From: Gemini AI Date: Sun, 28 Dec 2025 03:48:12 +0400 Subject: [PATCH] feat: AI Assist improvements - Enhanced web/app preview with live iframe - Added structured SEO preview with metrics - Implemented undo and revision (edit user message) capabilities - Fixed undoLast function scope issue --- components/AIAssist.tsx | 133 +++++++++++++++++++++++++++++++++------- 1 file changed, 112 insertions(+), 21 deletions(-) diff --git a/components/AIAssist.tsx b/components/AIAssist.tsx index eb73028..10c8304 100644 --- a/components/AIAssist.tsx +++ b/components/AIAssist.tsx @@ -13,7 +13,8 @@ import modelAdapter from "@/lib/services/adapter-instance"; import { MessageSquare, Send, Sparkles, Brain, Cpu, Code2, Palette, FileText, Search, BarChart, Rocket, Terminal, Eye, History, Trash2, Loader2, Bot, User, - Settings, Layers, AppWindow, Smartphone, Monitor, X + Settings, Layers, AppWindow, Smartphone, Monitor, X, ArrowLeftRight, RotateCcw, + CheckCircle2 } from "lucide-react"; import { cn } from "@/lib/utils"; import { AIAssistMessage } from "@/types"; @@ -153,6 +154,11 @@ const AIAssist = () => { setCurrentAgent("general"); }; + const undoLast = () => { + if (aiAssistHistory.length === 0) return; + setAIAssistHistory(prev => prev.slice(0, -2)); + }; + const renderPreview = () => { if (!previewData) return (
@@ -162,42 +168,110 @@ const AIAssist = () => { ); switch (previewData.type) { - case "code": case "web": case "app": + return ( +
+
+
+ + Live Runtime Sandbox +
+
+
+
+
+
+
+
+