The best way to control Claude Code, Codex and more from any computer or phone
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
Julius Marminge committed
Mar 9, 2026 at 11:13 UTC
993b5785121765a56628bfd4852591f672b743af
1 file changed
+3
-2
apps/web/src/components/ChatView.tsx
+3
-2
@@ -1904,10 +1904,11 @@ export default function ChatView({ threadId }: ChatViewProps) {
1904
useLayoutEffect(() => {
1905
const composerForm = composerFormRef.current;
1906
if (!composerForm) return;
1907
+ const measureComposerFormWidth = () => composerForm.clientWidth;
1908
1909
composerFormHeightRef.current = composerForm.getBoundingClientRect().height;
1910
setIsComposerFooterCompact(
1910
- shouldUseCompactComposerFooter(composerForm.clientWidth, {
1911
+ shouldUseCompactComposerFooter(measureComposerFormWidth(), {
1912
hasWideActions: composerFooterHasWideActions,
1913
}),
1914
);
@@ -1917,7 +1918,7 @@ export default function ChatView({ threadId }: ChatViewProps) {
1918
const [entry] = entries;
1919
if (!entry) return;
1920
1920
- const nextCompact = shouldUseCompactComposerFooter(entry.contentRect.width, {
1921
+ const nextCompact = shouldUseCompactComposerFooter(measureComposerFormWidth(), {
1922
hasWideActions: composerFooterHasWideActions,
1923
});
1924
setIsComposerFooterCompact((previous) => (previous === nextCompact ? previous : nextCompact));