From 3ff3354168110e269c839ce89d5f0c3dd5c6e825 Mon Sep 17 00:00:00 2001 From: Bohdan Triapitsyn Date: Tue, 25 Aug 2026 11:20:52 +0300 Subject: [PATCH] =?UTF-8?q?fix(chat):=20completion=20is=20a=20pure=20visib?= =?UTF-8?q?ility=20change=20=E2=80=94=20status=20inset=20never=20collapses?= =?UTF-8?q?=20mid-session?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The barely-visible shift at end-of-stream was the reserved status-row inset being released when the row unmounted. The measured overlay height now only grows during a session and resets on session switch, so the finished message's metadata footer appears exactly where the status row was, with zero layout movement. --- packages/ui/src/components/chat/ChatContainer.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/ui/src/components/chat/ChatContainer.tsx b/packages/ui/src/components/chat/ChatContainer.tsx index bcb57d2d..22432e68 100644 --- a/packages/ui/src/components/chat/ChatContainer.tsx +++ b/packages/ui/src/components/chat/ChatContainer.tsx @@ -932,6 +932,9 @@ export const ChatContainer: React.FC = ({ const [statusOverlayHeight, setStatusOverlayHeight] = React.useState(0); const composerOverlayHeight = statusOverlayHeight; const statusOverlayObserverRef = React.useRef(null); + React.useEffect(() => { + setStatusOverlayHeight(0); + }, [currentSessionKey]); const onStatusOverlayNode = React.useCallback((node: HTMLDivElement | null) => { statusOverlayObserverRef.current?.disconnect(); statusOverlayObserverRef.current = null; @@ -941,7 +944,10 @@ export const ChatContainer: React.FC = ({ } const update = () => { const height = node.getBoundingClientRect().height; - setStatusOverlayHeight((prev) => (Math.abs(prev - height) < 1 ? prev : height)); + // Hold the reserved height when the status row empties: collapsing + // it at end-of-stream shifts the settled content. It resets only + // on session change. + setStatusOverlayHeight((prev) => (height > prev + 1 ? height : prev)); }; const observer = new ResizeObserver(update); observer.observe(node);