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}`; -
-
+
+
+ +
- {#if isProcessing} - - {:else} - - {/if} +
+ {#if isProcessing} + + {:else} + + {/if} +
@@ -386,4 +421,61 @@ User: ${formattedMessage}`; gap: 12px; align-items: flex-end; } + + .textarea-wrapper { + flex: 1; + position: relative; + display: flex; + flex-direction: column; + } + + .resize-handle { + height: 6px; + cursor: ns-resize; + background: transparent; + border-radius: 3px; + margin-bottom: 2px; + display: flex; + justify-content: center; + align-items: center; + } + + .resize-handle::before { + content: ""; + width: 40px; + height: 3px; + background: var(--border-color); + border-radius: 2px; + opacity: 0.5; + transition: opacity 0.2s; + } + + .resize-handle:hover::before { + opacity: 1; + background: var(--accent-primary); + } + + .button-wrapper { + display: flex; + align-items: flex-end; + height: 100%; + } + + .send-button { + padding: 0 24px; + height: 48px; + color: white; + font-weight: 500; + border-radius: 8px; + transition: all 0.2s; + white-space: nowrap; + } + + .send-button:hover:not(:disabled) { + transform: scale(1.05); + } + + .send-button:active:not(:disabled) { + transform: scale(0.95); + }