diff --git a/src/lib/components/chat/Messages.svelte b/src/lib/components/chat/Messages.svelte index 36fc6ce3..dc454550 100644 --- a/src/lib/components/chat/Messages.svelte +++ b/src/lib/components/chat/Messages.svelte @@ -163,6 +163,13 @@ // let editMessage = history.messages[messageId]; history.messages[messageId].edit = true; history.messages[messageId].editedContent = history.messages[messageId].content; + + await tick(); + + const editElement = document.getElementById(`message-edit-${messageId}`); + + editElement.style.height = ''; + editElement.style.height = `${editElement.scrollHeight}px`; }; const confirmEditMessage = async (messageId) => { @@ -195,6 +202,11 @@ await sendPrompt(userPrompt, userMessageId, $chatId); }; + const confirmEditResponseMessage = async (messageId) => { + history.messages[messageId].edit = false; + history.messages[messageId].content = history.messages[messageId].editedContent; + }; + const cancelEditMessage = (messageId) => { history.messages[messageId].edit = false; history.messages[messageId].editedContent = undefined; @@ -415,6 +427,7 @@ {#if message?.edit === true}