feat: Vibe Architect dedicated mode, SEO follow-up fix (v1.8.0)
This commit is contained in:
@@ -477,7 +477,7 @@ function parsePlanFromResponse(text: string): { plan: Record<string, any> | null
|
||||
|
||||
// --- Main Component ---
|
||||
|
||||
export default function AIAssist() {
|
||||
export default function AIAssist({ vibeMode = false }: { vibeMode?: boolean } = {}) {
|
||||
const {
|
||||
language,
|
||||
aiAssistTabs,
|
||||
@@ -496,6 +496,8 @@ export default function AIAssist() {
|
||||
} = useStore();
|
||||
const t = translations[language].aiAssist;
|
||||
const common = translations[language].common;
|
||||
// Vibe mode: override labels
|
||||
const _vibe = vibeMode ? { studioTitle: "Vibe Architect", studioDesc: "Describe your vision. Get plans, code, and live previews." } : {};
|
||||
|
||||
const activeTab = aiAssistTabs?.find(tab => tab.id === activeTabId) || aiAssistTabs?.[0] || {
|
||||
id: 'default',
|
||||
@@ -642,8 +644,9 @@ export default function AIAssist() {
|
||||
// SEO, content, smm, design, web, app agents go straight to preview
|
||||
const isCodeAgent = currentAgent === "code" || currentAgent === "general";
|
||||
const wasIdle = !isApproval && isCodeAgent && (assistStep === "idle" || assistStep === "plan");
|
||||
// Detect if user is modifying existing code
|
||||
if (assistStep === "preview") setIsModifying(true);
|
||||
// Detect if user is modifying an existing visual artifact (not text-only agents like SEO/content)
|
||||
const isVisualAgent = currentAgent === "code" || currentAgent === "web" || currentAgent === "app" || currentAgent === "design" || currentAgent === "general";
|
||||
if (assistStep === "preview" && isVisualAgent) setIsModifying(true);
|
||||
setIsProcessing(true);
|
||||
if (assistStep === "idle" && isCodeAgent) setAssistStep("plan");
|
||||
|
||||
@@ -866,15 +869,20 @@ export default function AIAssist() {
|
||||
setShowCanvas(true);
|
||||
if (isPreviewRenderable(lastParsedPreview)) setViewMode("preview");
|
||||
} else if (!isCodeAgent && !wasIdle) {
|
||||
// Non-code agent without preview: just return to idle
|
||||
setAssistStep("idle");
|
||||
// Non-code agent follow-up without new preview:
|
||||
// Keep existing canvas if we had one, otherwise go idle
|
||||
if (previewData?.data) {
|
||||
setAssistStep("preview");
|
||||
} else {
|
||||
setAssistStep("idle");
|
||||
}
|
||||
} else {
|
||||
setAssistStep("idle");
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
console.error("Assist error:", error);
|
||||
const message = error instanceof Error ? error.message : "AI Assist failed";
|
||||
const message = error instanceof Error ? error.message : "Vibe Architect failed";
|
||||
const errorMsg: AIAssistMessage = { role: "assistant", content: message, timestamp: new Date() };
|
||||
updateTabById(requestTabId, { history: [...aiAssistHistory, errorMsg] });
|
||||
} finally {
|
||||
@@ -1159,7 +1167,7 @@ export default function AIAssist() {
|
||||
</div>
|
||||
<div className="flex-1">
|
||||
<h4 className="text-sm font-black text-amber-600 dark:text-amber-400">Qwen Authentication Required</h4>
|
||||
<p className="text-xs text-amber-700/70 dark:text-amber-300/70 mt-0.5">Sign in with Qwen to use AI Assist with this provider</p>
|
||||
<p className="text-xs text-amber-700/70 dark:text-amber-300/70 mt-0.5">Sign in with Qwen to use Vibe Architect with this provider</p>
|
||||
{qwenAuthError && (
|
||||
<p className="text-xs text-red-500 mt-1">{qwenAuthError}</p>
|
||||
)}
|
||||
@@ -1181,9 +1189,9 @@ export default function AIAssist() {
|
||||
<Ghost className="h-20 w-20 text-blue-400/40 animate-bounce duration-[3s]" />
|
||||
<div className="absolute inset-0 bg-blue-500/10 blur-3xl rounded-full" />
|
||||
</div>
|
||||
<h3 className="text-3xl font-black text-slate-900 dark:text-blue-50 mb-3 tracking-tighter">{t.studioTitle}</h3>
|
||||
<h3 className="text-3xl font-black text-slate-900 dark:text-blue-50 mb-3 tracking-tighter">{(_vibe as any).studioTitle || t.studioTitle}</h3>
|
||||
<p className="max-w-xs text-sm font-medium text-slate-600 dark:text-blue-100/70 leading-relaxed">
|
||||
{t.studioDesc}
|
||||
{(_vibe as any).studioDesc || t.studioDesc}
|
||||
</p>
|
||||
<div className="mt-10 flex flex-wrap justify-center gap-3">
|
||||
{t.suggestions.map((chip: any) => (
|
||||
|
||||
Reference in New Issue
Block a user