| ... | @@ -1904,10 +1904,11 @@ export default function ChatView({ threadId }: ChatViewProps) { | ... | @@ -1904,10 +1904,11 @@ export default function ChatView({ threadId }: ChatViewProps) { |
| 1904 | useLayoutEffect(() => { | 1904 | useLayoutEffect(() => { |
| 1905 | const composerForm = composerFormRef.current; | 1905 | const composerForm = composerFormRef.current; |
| 1906 | if (!composerForm) return; | 1906 | if (!composerForm) return; |
| | 1907 | const measureComposerFormWidth = () => composerForm.clientWidth; |
| 1907 | | 1908 | |
| 1908 | composerFormHeightRef.current = composerForm.getBoundingClientRect().height; | 1909 | composerFormHeightRef.current = composerForm.getBoundingClientRect().height; |
| 1909 | setIsComposerFooterCompact( | 1910 | setIsComposerFooterCompact( |
| 1910 | shouldUseCompactComposerFooter(composerForm.clientWidth, { | 1911 | shouldUseCompactComposerFooter(measureComposerFormWidth(), { |
| 1911 | hasWideActions: composerFooterHasWideActions, | 1912 | hasWideActions: composerFooterHasWideActions, |
| 1912 | }), | 1913 | }), |
| 1913 | ); | 1914 | ); |
| ... | @@ -1917,7 +1918,7 @@ export default function ChatView({ threadId }: ChatViewProps) { | ... | @@ -1917,7 +1918,7 @@ export default function ChatView({ threadId }: ChatViewProps) { |
| 1917 | const [entry] = entries; | 1918 | const [entry] = entries; |
| 1918 | if (!entry) return; | 1919 | if (!entry) return; |
| 1919 | | 1920 | |
| 1920 | const nextCompact = shouldUseCompactComposerFooter(entry.contentRect.width, { | 1921 | const nextCompact = shouldUseCompactComposerFooter(measureComposerFormWidth(), { |
| 1921 | hasWideActions: composerFooterHasWideActions, | 1922 | hasWideActions: composerFooterHasWideActions, |
| 1922 | }); | 1923 | }); |
| 1923 | setIsComposerFooterCompact((previous) => (previous === nextCompact ? previous : nextCompact)); | 1924 | setIsComposerFooterCompact((previous) => (previous === nextCompact ? previous : nextCompact)); |