Skip to content

Commit 580eb4b

Browse files
fix: use consistent width measurement (clientWidth) for compact composer footer check
The initial compact-mode check used composerForm.clientWidth (includes padding) while the ResizeObserver callback used entry.contentRect.width (content-box only). This inconsistency could cause a flash near the breakpoint if the form element ever acquires padding. Use composerForm.clientWidth in both places for consistency. Co-authored-by: Julius Marminge <juliusmarminge@users.noreply.github.com>
1 parent b4d1a69 commit 580eb4b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

apps/web/src/components/ChatView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1928,7 +1928,7 @@ export default function ChatView({ threadId }: ChatViewProps) {
19281928
const [entry] = entries;
19291929
if (!entry) return;
19301930

1931-
const nextCompact = shouldUseCompactComposerFooter(entry.contentRect.width, {
1931+
const nextCompact = shouldUseCompactComposerFooter(composerForm.clientWidth, {
19321932
hasWideActions: composerFooterHasWideActions,
19331933
});
19341934
setIsComposerFooterCompact((previous) => (previous === nextCompact ? previous : nextCompact));

0 commit comments

Comments
 (0)