From 82e6f5e947a42544ef0ebcfdbb184d25d141f822 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 22 Feb 2026 13:12:30 +0800 Subject: [PATCH] fix(canvas): restore home prompt in editor and preserve launch auto-send payload --- components/canvas/CanvasChatPanel.tsx | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/components/canvas/CanvasChatPanel.tsx b/components/canvas/CanvasChatPanel.tsx index e969f0949..c8bb4f972 100644 --- a/components/canvas/CanvasChatPanel.tsx +++ b/components/canvas/CanvasChatPanel.tsx @@ -1621,8 +1621,6 @@ export function CanvasChatPanel({ chatId, initialMessages = [], onClose, onOpenF }, []); useEffect(() => { - pendingLaunchRef.current = null; - if (typeof window === "undefined") return; try { @@ -1666,6 +1664,22 @@ export function CanvasChatPanel({ chatId, initialMessages = [], onClose, onOpenF } setTimeout(() => { + const editableDiv = textareaRef.current as HTMLDivElement | null; + if (editableDiv) { + editableDiv.innerHTML = ""; + if (normalizedPrompt) { + editableDiv.appendChild(document.createTextNode(normalizedPrompt)); + const selection = window.getSelection(); + if (selection) { + const range = document.createRange(); + range.selectNodeContents(editableDiv); + range.collapse(false); + selection.removeAllRanges(); + selection.addRange(range); + } + } + } + normalizedAttachments.forEach((attachment, index) => { insertImageTagInEditor(attachment.url, attachment.name, index); });