diff --git a/site/src/pages/AgentsPage/AgentChatPageView.tsx b/site/src/pages/AgentsPage/AgentChatPageView.tsx index fa22354f01..a739069a93 100644 --- a/site/src/pages/AgentsPage/AgentChatPageView.tsx +++ b/site/src/pages/AgentsPage/AgentChatPageView.tsx @@ -792,7 +792,16 @@ const ScrollAnchoredContainer: FC<{ }; const scheduleBottomPin = () => { - cancelPendingPins(); + // If a pin is already in-flight, let it complete. The + // inner RAF reads scrollHeight at execution time so it + // always targets the latest bottom. Cancelling and + // rescheduling on every ResizeObserver notification + // starves the pin on Safari, where sticky-element + // repositioning generates extra resize events that + // perpetually restart the double-RAF chain. + if (pinOuterRafId !== null || pinInnerRafId !== null) { + return; + } pendingWheelPinRef.current = false; isRestoringScrollRef.current = true; // Double-RAF lets React's commit phase and the browser's @@ -1149,7 +1158,7 @@ const ScrollAnchoredContainer: FC<{
{hasMoreMessages && (