diff --git a/site/src/pages/AIBridgePage/SessionThreadsPage/SessionTimeline/SessionTimeline.tsx b/site/src/pages/AIBridgePage/SessionThreadsPage/SessionTimeline/SessionTimeline.tsx index 2cbb9747d6..8cb91b1a15 100644 --- a/site/src/pages/AIBridgePage/SessionThreadsPage/SessionTimeline/SessionTimeline.tsx +++ b/site/src/pages/AIBridgePage/SessionThreadsPage/SessionTimeline/SessionTimeline.tsx @@ -48,7 +48,18 @@ const ExpandableText: FC = ({ useEffect(() => { const el = contentRef.current; if (!el) return; - setIsExpandable(el.scrollHeight > maxHeight); + + const checkIsExpandable = () => { + setIsExpandable(el.scrollHeight > maxHeight); + }; + + checkIsExpandable(); + + const observer = new ResizeObserver(checkIsExpandable); + + observer.observe(el); + + return () => observer.disconnect(); }, [maxHeight]); return (