@@ -470,13 +470,6 @@ const ConversationTimeline = memo(function ConversationTimeline({
470470 const normalizedFindQuery = findQuery . trim ( ) ;
471471 const findActive = findExpanded ;
472472
473- const disclosurePinsEndRef = useRef ( false ) ;
474- const pinDisclosureToEnd = ( ) => {
475- if ( ! disclosurePinsEndRef . current ) return ;
476- const element = listRef . current ?. getScrollableNode ( ) ;
477- if ( element ) element . scrollTop = element . scrollHeight ;
478- } ;
479-
480473 const scheduleDisclosureSettle = ( ) => {
481474 if ( disclosureSettleFrameRef . current !== null ) {
482475 cancelAnimationFrame ( disclosureSettleFrameRef . current ) ;
@@ -485,10 +478,7 @@ const ConversationTimeline = memo(function ConversationTimeline({
485478 cancelAnimationFrame ( disclosureSettleSecondFrameRef . current ) ;
486479 }
487480 disclosureSettleFrameRef . current = requestAnimationFrame ( ( ) => {
488- pinDisclosureToEnd ( ) ;
489481 disclosureSettleSecondFrameRef . current = requestAnimationFrame ( ( ) => {
490- pinDisclosureToEnd ( ) ;
491- disclosurePinsEndRef . current = false ;
492482 disclosureAnchorKeyRef . current = null ;
493483 setDisclosureToggleSettling ( false ) ;
494484 disclosureSettleFrameRef . current = null ;
@@ -499,13 +489,11 @@ const ConversationTimeline = memo(function ConversationTimeline({
499489
500490 const suspendEndScrollMaintenanceForDisclosure = ( anchorKey : string ) => {
501491 disclosureAnchorKeyRef . current = anchorKey ;
502- disclosurePinsEndRef . current = resolveTimelineIsAtEnd ( listRef . current ?. getState ( ) ) === true ;
503492 setDisclosureToggleSettling ( true ) ;
504493 scheduleDisclosureSettle ( ) ;
505494 } ;
506495
507496 const shouldRestoreVisibleContentPosition = ( row : MessagesTimelineRow ) => {
508- if ( disclosurePinsEndRef . current ) return false ;
509497 const disclosureAnchorKey = disclosureAnchorKeyRef . current ;
510498 return disclosureAnchorKey === null || row . id === disclosureAnchorKey ;
511499 } ;
@@ -955,8 +943,7 @@ const ConversationTimeline = memo(function ConversationTimeline({
955943 } ;
956944
957945 const handleItemSizeChanged = ( ) => {
958- if ( disclosurePinsEndRef . current ) {
959- queueMicrotask ( pinDisclosureToEnd ) ;
946+ if ( disclosureAnchorKeyRef . current !== null ) {
960947 scheduleDisclosureSettle ( ) ;
961948 }
962949 scheduleMinimapRefresh ( ) ;
0 commit comments