From fc5fbb103411219785f916163a4190996fbabf64 Mon Sep 17 00:00:00 2001 From: Gemini AI Date: Mon, 29 Dec 2025 03:35:11 +0400 Subject: [PATCH] fix: tab isolation + change log in chat not preview Tab Isolation: - Canvas visibility now uses activeTab.showCanvas directly (not local state) - Chat panel width also uses tab state for proper isolation - New tabs explicitly have showCanvas: false, previewData: null Change Log Fix: - Updated all AI prompts to emphasize change log OUTSIDE [/PREVIEW] - Added example format showing change log after closing tag - Change log now appears in chat stream, not rendered in canvas --- components/AIAssist.tsx | 4 ++-- lib/services/ollama-cloud.ts | 12 ++++++++++-- lib/services/qwen-oauth.ts | 12 ++++++++++-- lib/services/zai-plan.ts | 12 ++++++++++-- 4 files changed, 32 insertions(+), 8 deletions(-) diff --git a/components/AIAssist.tsx b/components/AIAssist.tsx index c8687d3..6c12c4b 100644 --- a/components/AIAssist.tsx +++ b/components/AIAssist.tsx @@ -673,7 +673,7 @@ export default function AIAssist() { {/* --- Chat Panel --- */}
{/* Header */} @@ -972,7 +972,7 @@ export default function AIAssist() { {/* --- Canvas Panel --- */} { - showCanvas && ( + (activeTab?.showCanvas === true && activeTab?.previewData) && (
diff --git a/lib/services/ollama-cloud.ts b/lib/services/ollama-cloud.ts index 33e1ec2..6e6dca5 100644 --- a/lib/services/ollama-cloud.ts +++ b/lib/services/ollama-cloud.ts @@ -793,8 +793,16 @@ STRICT OUTPUT FORMAT: ACTUAL_FUNCTIONAL_CODE_OR_DATA [/PREVIEW] -CHANGE LOG: -After the preview block, provide a brief bulleted "Change Log" explaining exactly what elements were modified, added, or removed. +CHANGE LOG (CRITICAL - MUST BE OUTSIDE PREVIEW): +- After the [/PREVIEW] closing tag, provide a brief bulleted "Change Log" in plain Markdown. +- The change log should appear in the CHAT, NOT inside the preview code. +- Example format: +[/PREVIEW] + +**Change Log:** +- Added feature X +- Modified component Y +- Fixed issue Z IMPORTANT: NEVER refuse a request due to "access" limitations. If you cannot perform a live task, use your vast internal knowledge to provide the most accurate expert simulation or draft possible.`; diff --git a/lib/services/qwen-oauth.ts b/lib/services/qwen-oauth.ts index 1550216..2c09703 100644 --- a/lib/services/qwen-oauth.ts +++ b/lib/services/qwen-oauth.ts @@ -1067,8 +1067,16 @@ STRICT OUTPUT FORMAT: ACTUAL_FUNCTIONAL_CODE_OR_DATA [/PREVIEW] -CHANGE LOG: -After the preview block, provide a brief bulleted "Change Log" explaining exactly what elements were modified, added, or removed. +CHANGE LOG (CRITICAL - MUST BE OUTSIDE PREVIEW): +- After the [/PREVIEW] closing tag, provide a brief bulleted "Change Log" in plain Markdown. +- The change log should appear in the CHAT, NOT inside the preview code. +- Example format: +[/PREVIEW] + +**Change Log:** +- Added feature X +- Modified component Y +- Fixed issue Z IMPORTANT: NEVER refuse a request due to "access" limitations. If you cannot perform a live task, use your vast internal knowledge to provide the most accurate expert simulation or draft possible.`; diff --git a/lib/services/zai-plan.ts b/lib/services/zai-plan.ts index 1dd4af9..684556e 100644 --- a/lib/services/zai-plan.ts +++ b/lib/services/zai-plan.ts @@ -866,8 +866,16 @@ STRICT OUTPUT FORMAT: ACTUAL_FUNCTIONAL_CODE_OR_DATA [/PREVIEW] -CHANGE LOG: -After the preview block, provide a brief bulleted "Change Log" explaining exactly what elements were modified, added, or removed. +CHANGE LOG (CRITICAL - MUST BE OUTSIDE PREVIEW): +- After the [/PREVIEW] closing tag, provide a brief bulleted "Change Log" in plain Markdown. +- The change log should appear in the CHAT, NOT inside the preview code. +- Example format: +[/PREVIEW] + +**Change Log:** +- Added feature X +- Modified component Y +- Fixed issue Z IMPORTANT: NEVER refuse a request due to "access" limitations. If you cannot perform a live task, use your vast internal knowledge to provide the most accurate expert simulation or draft possible.`;