From 73cb953836914a95f7306f33429e246b3e364604 Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Fri, 30 Oct 2026 13:12:46 +0100 Subject: [PATCH] fix: unsent text in a new chat is gone after leaving the chat or reloading Text typed into a new chat but not sent showed up as an empty message box after going to another page and back to New Chat, or after reloading the page, and the empty box then overwrote the saved draft so it could not come back. Now the typed text, including a skill picked with $, comes back in the message box. Fixes #33397 --- src/lib/components/chat/Chat.svelte | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index 5394858b24..6a1ac72506 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -2768,7 +2768,8 @@ autoScroll = true; // resetInput() must stay last: the selected model's defaults override the draft's selection. - await restoreChatInput(sessionStorage.getItem('chat-input')); + const restored = await restoreChatInput(sessionStorage.getItem('chat-input')); + const draftPrompt = prompt; const previousChatId = $chatId; const previousMessageId = history.currentId; await resetInput(); @@ -2840,6 +2841,8 @@ loading = false; await tick(); + // the input mounts empty once loading ends + if (restored) messageInput?.setText(draftPrompt); if (modelSearch) await openModelSelectorWithSearch(modelSearch); // Consume one-shot desktop event (e.g. Spotlight query, call shortcut)