fix(web): keep agent transcript pinned while typing

This commit is contained in:
2026-11-08 18:32:19 -08:00
parent e9967ddaf8
commit bb43b8beda
5 changed files with 173 additions and 1 deletions
@@ -288,7 +288,11 @@ export function AgentConversation({ room, onOpenSidebar, isVisible = true }: Pro
useLayoutEffect(() => {
const textarea = textareaRef.current;
if (!textarea) return;
textarea.style.height = "0px";
// scrollHeight reflects the full draft even when the textarea is already
// capped. Avoid collapsing a focused field to its minimum height while
// measuring: the browser may scroll the enclosing transcript to reveal its
// caret, and no ResizeObserver can correct that transient scroll once the
// field returns to the same capped height.
textarea.style.height = `${Math.min(156, Math.max(46, textarea.scrollHeight))}px`;
}, [draft]);