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));