refactor: chat composer new design

This commit is contained in:
simosmik
2026-04-20 14:47:49 +00:00
parent 7763e60fb3
commit 5758bee8a0
5 changed files with 392 additions and 243 deletions

View File

@@ -737,7 +737,7 @@ export function useChatComposerState({
}
// Re-run when input changes so restored drafts get the same autosize behavior as typed text.
textareaRef.current.style.height = 'auto';
textareaRef.current.style.height = `${textareaRef.current.scrollHeight}px`;
textareaRef.current.style.height = `${Math.max(22, textareaRef.current.scrollHeight)}px`;
const lineHeight = parseInt(window.getComputedStyle(textareaRef.current).lineHeight);
const expanded = textareaRef.current.scrollHeight > lineHeight * 2;
setIsTextareaExpanded(expanded);
@@ -824,7 +824,7 @@ export function useChatComposerState({
(event: FormEvent<HTMLTextAreaElement>) => {
const target = event.currentTarget;
target.style.height = 'auto';
target.style.height = `${target.scrollHeight}px`;
target.style.height = `${Math.max(22, target.scrollHeight)}px`;
setCursorPosition(target.selectionStart);
syncInputOverlayScroll(target);