From 993b5785121765a56628bfd4852591f672b743af Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Mon, 9 Mar 2026 11:13:09 -0700 Subject: [PATCH] Use form clientWidth for composer compact footer checks - Measure composer width from the form element in initial and resize paths - Avoid relying on ResizeObserver contentRect width for compact footer layout decisions --- apps/web/src/components/ChatView.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/web/src/components/ChatView.tsx b/apps/web/src/components/ChatView.tsx index 3a0b616cdf165c31dc0d23aa585bdc7593ebd775..4ce3398aa0ef22fd0d7aa4b6be8946c9ff55f06f 100644 --- a/apps/web/src/components/ChatView.tsx +++ b/apps/web/src/components/ChatView.tsx @@ -1904,10 +1904,11 @@ export default function ChatView({ threadId }: ChatViewProps) { useLayoutEffect(() => { const composerForm = composerFormRef.current; if (!composerForm) return; + const measureComposerFormWidth = () => composerForm.clientWidth; composerFormHeightRef.current = composerForm.getBoundingClientRect().height; setIsComposerFooterCompact( - shouldUseCompactComposerFooter(composerForm.clientWidth, { + shouldUseCompactComposerFooter(measureComposerFormWidth(), { hasWideActions: composerFooterHasWideActions, }), ); @@ -1917,7 +1918,7 @@ export default function ChatView({ threadId }: ChatViewProps) { const [entry] = entries; if (!entry) return; - const nextCompact = shouldUseCompactComposerFooter(entry.contentRect.width, { + const nextCompact = shouldUseCompactComposerFooter(measureComposerFormWidth(), { hasWideActions: composerFooterHasWideActions, }); setIsComposerFooterCompact((previous) => (previous === nextCompact ? previous : nextCompact)); -- 2.54.0