diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index c2247d19f3..ea40f2ffe6 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -2788,7 +2788,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(); @@ -2860,6 +2861,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)