diff --git a/src/lib/components/InputBar.svelte b/src/lib/components/InputBar.svelte index c057439..5167c32 100644 --- a/src/lib/components/InputBar.svelte +++ b/src/lib/components/InputBar.svelte @@ -11,6 +11,9 @@ getSavedHistory, clearHistoryRestore } from "$lib/stores/historyRestore"; + import MessageModeSelector from "$lib/components/MessageModeSelector.svelte"; + import { getCurrentMode } from "$lib/stores/messageMode"; + import { formatMessageWithMode } from "$lib/types/messageMode"; let inputValue = $state(""); let isSubmitting = $state(false); @@ -34,8 +37,12 @@ isSubmitting = true; inputValue = ""; + // Apply mode prefix if needed + const currentMode = getCurrentMode(); + const formattedMessage = formatMessageWithMode(message, currentMode); + // Check if we need to restore conversation history - let messageToSend = message; + let messageToSend = formattedMessage; if (getShouldRestoreHistory()) { const savedHistory = getSavedHistory(); console.log("Should restore history:", true); @@ -47,7 +54,7 @@ ${savedHistory} [Continuing conversation after reconnection:] -User: ${message}`; +User: ${formattedMessage}`; console.log("Message with history:", messageToSend); @@ -61,7 +68,7 @@ User: ${message}`; // Reset notification state for new user message handleNewUserMessage(); - claudeStore.addLine("user", message); + claudeStore.addLine("user", formattedMessage); characterState.setState("thinking"); try { @@ -131,8 +138,13 @@ User: ${message}`; } -