diff --git a/packages/ui/src/components/prompt-input.tsx b/packages/ui/src/components/prompt-input.tsx index 00ea57a5..5a56c0ff 100644 --- a/packages/ui/src/components/prompt-input.tsx +++ b/packages/ui/src/components/prompt-input.tsx @@ -1,4 +1,4 @@ -import { createSignal, Show, onMount, For, onCleanup, createEffect, on, untrack, createMemo } from "solid-js" +import { createSignal, Show, onMount, For, onCleanup, createEffect, on, untrack } from "solid-js" import { ArrowBigUp, ArrowBigDown } from "lucide-solid" import UnifiedPicker from "./unified-picker" import ExpandButton from "./expand-button" @@ -50,45 +50,6 @@ export default function PromptInput(props: PromptInputProps) { const [expandState, setExpandState] = createSignal<"normal" | "expanded">("normal") const SELECTION_INSERT_MAX_LENGTH = 2000 let textareaRef: HTMLTextAreaElement | undefined - let containerRef: HTMLDivElement | undefined - - // Fixed line height for expanded state (15 lines as suggested by dev) - - // Fixed line height for web/mobile expanded state (15 lines as suggested) - const EXPANDED_LINES = 15 - const LINE_HEIGHT = 24 - const FIXED_EXPANDED_HEIGHT = EXPANDED_LINES * LINE_HEIGHT // 360px - - const calculateExpandedHeight = () => { - if (!containerRef) { - return 0 - } - - const root = containerRef.closest(".session-view") - if (!root) { - return 0 - } - const rootRect = root.getBoundingClientRect() - - // Reserve minimum space for message section - // Use larger reserve for landscape orientation (less vertical space) - const isLandscape = typeof window !== "undefined" && window.innerWidth > window.innerHeight - const MIN_MESSAGE_SPACE = isLandscape ? 150 : 200 - const availableForInput = rootRect.height - MIN_MESSAGE_SPACE - - return availableForInput - } - - const expandedHeight = createMemo(() => { - const state = expandState() - if (state === "normal") return "auto" - - // Use fixed height, but cap at available space - // This prevents overflow in landscape or small screens - const availableHeight = calculateExpandedHeight() - const maxHeight = Math.min(FIXED_EXPANDED_HEIGHT, availableHeight * 0.6) - return `${Math.max(maxHeight, 150)}px` // Minimum 150px to be useful - }) const getPlaceholder = () => { if (mode() === "shell") { @@ -1093,7 +1054,6 @@ export default function PromptInput(props: PromptInputProps) { return (