diff --git a/components/AIAssist.tsx b/components/AIAssist.tsx index 6c12c4b..62f2428 100644 --- a/components/AIAssist.tsx +++ b/components/AIAssist.tsx @@ -386,6 +386,17 @@ function parseStreamingContent(text: string, currentAgent: string) { if (isHtmlLike) { preview.data = decodeHtml(stripFences(preview.data)); } + + // CRITICAL: Strip any change log that leaked into preview data + // The change log should be in chat, not rendered in canvas + preview.data = preview.data + .replace(/\[\/[a-z]+:[a-z]+\]\s*\*?\*?Change\s*Log:?\*?\*?[\s\S]*$/i, '') + .replace(/\*?\*?Change\s*Log:?\*?\*?[\s\S]*$/i, function (match) { + // Only strip if it's at the end and looks like a change log section + if (match.length > 500) return match; // Probably part of the app, not a log + return ''; + }) + .trim(); } if (!preview && !text.includes("[PREVIEW")) { @@ -1022,18 +1033,18 @@ export default function AIAssist() {
-{previewData?.data}+{activeTab?.previewData?.data}