From b5c885bbd99bd028f72a6955685e79ccc05e5da8 Mon Sep 17 00:00:00 2001 From: Shivam Kumar Raut <110457469+shivamraut101@users.noreply.github.com> Date: Wed, 28 Jan 2026 02:35:56 +0530 Subject: [PATCH] fix(ui): auto-expand chat textarea on input (Fixes #2939) (#2950) --- ui/src/ui/views/chat.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/ui/src/ui/views/chat.ts b/ui/src/ui/views/chat.ts index a9b4da572b..f5fb6e80bb 100644 --- a/ui/src/ui/views/chat.ts +++ b/ui/src/ui/views/chat.ts @@ -1,4 +1,5 @@ import { html, nothing } from "lit"; +import { ref } from "lit/directives/ref.js"; import { repeat } from "lit/directives/repeat.js"; import type { SessionsListResult } from "../types"; import type { ChatAttachment, ChatQueueItem } from "../ui-types"; @@ -71,6 +72,11 @@ export type ChatProps = { const COMPACTION_TOAST_DURATION_MS = 5000; +function adjustTextareaHeight(el: HTMLTextAreaElement) { + el.style.height = "auto"; + el.style.height = `${el.scrollHeight}px`; +} + function renderCompactionIndicator(status: CompactionIndicatorStatus | null | undefined) { if (!status) return nothing; @@ -327,6 +333,7 @@ export function renderChat(props: ChatProps) {