@@ -628,7 +628,7 @@ export const MessagesTimeline = memo(function MessagesTimeline({
628628 const expandCitedRun = useCallback ( ( runId : RunId ) => {
629629 setExpandedRunIds ( ( current ) => ( current . has ( runId ) ? current : new Set ( [ ...current , runId ] ) ) ) ;
630630 } , [ ] ) ;
631- // Nested tool state shares the bounded thread-position cache.
631+ // Nested tool state shares the bounded disclosure cache.
632632 const workGroupViewState = useMemo < WorkGroupViewState > (
633633 ( ) =>
634634 rememberedDisclosures ?. workGroupState ?? {
@@ -948,12 +948,6 @@ export const MessagesTimeline = memo(function MessagesTimeline({
948948 const state = listRef . current ?. getState ?.( ) ;
949949 if ( state ?. data !== rows ) return ;
950950 const isAtEnd = resolveTimelineIsAtEnd ( state ) ;
951- rememberTimelineDisclosures ( listIdentityKey , {
952- runs : paintedExpandedRunIds ,
953- workGroups : paintedExpandedWorkGroupIds ,
954- attempts : paintedExpandedAttemptIds ,
955- workGroupState : workGroupViewState ,
956- } ) ;
957951 if ( isAtEnd !== undefined && ! citationPositioning ) {
958952 onIsAtEndChange ( isAtEnd ) ;
959953 }
@@ -997,12 +991,7 @@ export const MessagesTimeline = memo(function MessagesTimeline({
997991 ) ;
998992 } , [
999993 citationPositioning ,
1000- paintedExpandedRunIds ,
1001- paintedExpandedWorkGroupIds ,
1002- paintedExpandedAttemptIds ,
1003- workGroupViewState ,
1004994 rows ,
1005- listIdentityKey ,
1006995 listRef ,
1007996 minimapItems ,
1008997 minimapStripMap ,
@@ -1011,9 +1000,23 @@ export const MessagesTimeline = memo(function MessagesTimeline({
10111000 ] ) ;
10121001
10131002 useEffect ( ( ) => {
1003+ rememberTimelineDisclosures ( listIdentityKey , {
1004+ runs : paintedExpandedRunIds ,
1005+ workGroups : paintedExpandedWorkGroupIds ,
1006+ attempts : paintedExpandedAttemptIds ,
1007+ workGroupState : workGroupViewState ,
1008+ } ) ;
10141009 const frame = requestAnimationFrame ( handleScroll ) ;
10151010 return ( ) => cancelAnimationFrame ( frame ) ;
1016- } , [ handleScroll , rows . length ] ) ;
1011+ } , [
1012+ handleScroll ,
1013+ listIdentityKey ,
1014+ paintedExpandedRunIds ,
1015+ paintedExpandedWorkGroupIds ,
1016+ paintedExpandedAttemptIds ,
1017+ workGroupViewState ,
1018+ rows . length ,
1019+ ] ) ;
10171020
10181021 useEffect ( ( ) => {
10191022 if ( ! timelineViewportElement ) {
0 commit comments