diff --git a/src/lib/components/InputBar.svelte b/src/lib/components/InputBar.svelte
index b19c8ba..86d417c 100644
--- a/src/lib/components/InputBar.svelte
+++ b/src/lib/components/InputBar.svelte
@@ -39,6 +39,37 @@
let historyIndex = $state(-1);
let tempInput = $state("");
+ // Textarea resize state
+ let textareaHeight = $state(48);
+ const MIN_HEIGHT = 48;
+ const MAX_HEIGHT = 200;
+ let isResizing = $state(false);
+ let startY = 0;
+ let startHeight = 0;
+
+ function handleResizeStart(event: MouseEvent) {
+ isResizing = true;
+ startY = event.clientY;
+ startHeight = textareaHeight;
+ document.addEventListener("mousemove", handleResizeMove);
+ document.addEventListener("mouseup", handleResizeEnd);
+ event.preventDefault();
+ }
+
+ function handleResizeMove(event: MouseEvent) {
+ if (!isResizing) return;
+ // Dragging up (negative deltaY) should increase height
+ const deltaY = startY - event.clientY;
+ const newHeight = Math.min(MAX_HEIGHT, Math.max(MIN_HEIGHT, startHeight + deltaY));
+ textareaHeight = newHeight;
+ }
+
+ function handleResizeEnd() {
+ isResizing = false;
+ document.removeEventListener("mousemove", handleResizeMove);
+ document.removeEventListener("mouseup", handleResizeEnd);
+ }
+
// Load history from localStorage on init
function loadHistory(): string[] {
try {
@@ -314,13 +345,19 @@ User: ${formattedMessage}`;