diff --git a/src/lib/components/InputBar.svelte b/src/lib/components/InputBar.svelte index 29afd7c..7fc1334 100644 --- a/src/lib/components/InputBar.svelte +++ b/src/lib/components/InputBar.svelte @@ -175,6 +175,14 @@ } }); + function clearInput() { + inputValue = ""; + const activeId = get(claudeStore.activeConversationId); + if (activeId) { + claudeStore.setDraftText(activeId, ""); + } + } + function handleInputChange() { // If input is empty, allow history navigation again // Otherwise, mark that user has manually typed @@ -212,7 +220,7 @@ async function executeSlashCommand(): Promise { const { command, args } = parseSlashCommand(inputValue); if (command) { - inputValue = ""; + clearInput(); showCommandMenu = false; matchingCommands = []; await command.execute(args); @@ -245,7 +253,7 @@ "error", `Unknown command: ${message.split(" ")[0]}. Type /help for available commands.` ); - inputValue = ""; + clearInput(); return; } @@ -261,7 +269,7 @@ userHasTyped = false; isSubmitting = true; - inputValue = ""; + clearInput(); // Capture attachments before clearing const currentAttachments = [...attachments];