@@ -84,6 +84,7 @@ import {
8484 type KeyboardEvent ,
8585 type MouseEvent ,
8686 type ReactNode ,
87+ type CSSProperties ,
8788} from "react" ;
8889import {
8990 LegendList ,
@@ -506,6 +507,7 @@ interface MessagesTimelineProps {
506507 onAnchorReady : ( messageId : MessageId , anchorIndex : number ) => void ;
507508 onAnchorSizeChanged : ( messageId : MessageId , size : number ) => void ;
508509 contentInsetEndAdjustment : number ;
510+ composerOverlayHeight ?: number ;
509511 onIsAtEndChange : ( isAtEnd : boolean ) => void ;
510512 /**
511513 * Off while the user is reading history; LegendList's own maintainScrollAtEnd
@@ -602,6 +604,7 @@ const ConversationTimeline = memo(function ConversationTimeline({
602604 onAnchorReady,
603605 onAnchorSizeChanged,
604606 contentInsetEndAdjustment,
607+ composerOverlayHeight = 0 ,
605608 onIsAtEndChange,
606609 onContentOverflowChange,
607610 liveFollowEnabled,
@@ -1090,6 +1093,12 @@ const ConversationTimeline = memo(function ConversationTimeline({
10901093 { footer }
10911094 </ TimelineListFooter >
10921095 ) ;
1096+ const timelineMaskStyle =
1097+ composerOverlayHeight === 0
1098+ ? undefined
1099+ : ( {
1100+ "--timeline-composer-overlay-height" : `${ composerOverlayHeight } px` ,
1101+ } as CSSProperties ) ;
10931102
10941103 const measureContentOverflow = ( ) =>
10951104 timelineContentOverflowsViewport ( listRef . current ?. getState ?.( ) , {
@@ -1471,52 +1480,60 @@ const ConversationTimeline = memo(function ConversationTimeline({
14711480 onCite = { onCiteAssistantText }
14721481 />
14731482 ) : null }
1474- < LegendList < MessagesTimelineRow >
1475- ref = { setTimelineList }
1476- data = { rows }
1477- extraData = { listExtraData }
1478- keyExtractor = { keyExtractor }
1479- getItemType = { getItemType }
1480- renderItem = { renderItem }
1481- estimatedItemSize = { 90 }
1482- initialScrollAtEnd = {
1483- ! findActive && citationRequest === null && rememberedPosition ?. atEnd !== false
1484- }
1485- // Legend needs a data refresh to mount new pins without a scroll event.
1486- dataVersion = { readyCitationRequest ?. key ?? listIdentityKey }
1487- { ...( alwaysRender ? { alwaysRender } : { } ) }
1488- onLoad = { handleListLoad }
1489- { ...( anchoredEndSpace ? { anchoredEndSpace } : { } ) }
1490- contentInsetEndAdjustment = { anchoredEndSpace ? contentInsetEndAdjustment : 0 }
1491- maintainScrollAtEnd = {
1492- citationPositioning ||
1493- ( restoringThreadPosition && rememberedPosition ?. atEnd === false ) ||
1494- anchoredEndSpace ||
1495- ! liveFollowEnabled ||
1496- fullscreenAppRowId !== null ||
1497- disclosureToggleSettling
1498- ? false
1499- : isWorking && ! prefersReducedMotion && settlingListIdentity === null
1500- ? TIMELINE_MAINTAIN_SCROLL_AT_END_SMOOTH
1501- : TIMELINE_MAINTAIN_SCROLL_AT_END
1502- }
1503- maintainVisibleContentPosition = {
1504- findActive ||
1505- citationPositioning ||
1506- ( restoringThreadPosition && rememberedPosition ?. atEnd === false )
1507- ? false
1508- : maintainVisibleContentPosition
1509- }
1510- maintainScrollAtEndThreshold = { 1 }
1511- onScroll = { handleScroll }
1512- onItemSizeChanged = { handleItemSizeChanged }
1483+ < div
15131484 className = { cn (
1514- "messages-timeline-scroll scrollbar-gutter-both h-full min-h-0 overflow-x-hidden overscroll-y-contain [overflow-anchor:none] " ,
1515- topFadeEnabled && "topbar -scroll-fade" ,
1485+ "h-full min-h-0" ,
1486+ composerOverlayHeight > 0 && "virtualized -scroll-fade timeline-scroll-bottom -fade" ,
15161487 ) }
1517- ListHeaderComponent = { listHeader }
1518- ListFooterComponent = { timelineListFooter }
1519- />
1488+ style = { timelineMaskStyle }
1489+ >
1490+ < LegendList < MessagesTimelineRow >
1491+ ref = { setTimelineList }
1492+ data = { rows }
1493+ extraData = { listExtraData }
1494+ keyExtractor = { keyExtractor }
1495+ getItemType = { getItemType }
1496+ renderItem = { renderItem }
1497+ estimatedItemSize = { 90 }
1498+ initialScrollAtEnd = {
1499+ ! findActive && citationRequest === null && rememberedPosition ?. atEnd !== false
1500+ }
1501+ // Legend needs a data refresh to mount new pins without a scroll event.
1502+ dataVersion = { readyCitationRequest ?. key ?? listIdentityKey }
1503+ { ...( alwaysRender ? { alwaysRender } : { } ) }
1504+ onLoad = { handleListLoad }
1505+ { ...( anchoredEndSpace ? { anchoredEndSpace } : { } ) }
1506+ contentInsetEndAdjustment = { anchoredEndSpace ? contentInsetEndAdjustment : 0 }
1507+ maintainScrollAtEnd = {
1508+ citationPositioning ||
1509+ ( restoringThreadPosition && rememberedPosition ?. atEnd === false ) ||
1510+ anchoredEndSpace ||
1511+ ! liveFollowEnabled ||
1512+ fullscreenAppRowId !== null ||
1513+ disclosureToggleSettling
1514+ ? false
1515+ : isWorking && ! prefersReducedMotion && settlingListIdentity === null
1516+ ? TIMELINE_MAINTAIN_SCROLL_AT_END_SMOOTH
1517+ : TIMELINE_MAINTAIN_SCROLL_AT_END
1518+ }
1519+ maintainVisibleContentPosition = {
1520+ findActive ||
1521+ citationPositioning ||
1522+ ( restoringThreadPosition && rememberedPosition ?. atEnd === false )
1523+ ? false
1524+ : maintainVisibleContentPosition
1525+ }
1526+ maintainScrollAtEndThreshold = { 1 }
1527+ onScroll = { handleScroll }
1528+ onItemSizeChanged = { handleItemSizeChanged }
1529+ className = { cn (
1530+ "messages-timeline-scroll scrollbar-gutter-both h-full min-h-0 overflow-x-hidden overscroll-y-contain [overflow-anchor:none]" ,
1531+ topFadeEnabled && "topbar-scroll-fade" ,
1532+ ) }
1533+ ListHeaderComponent = { listHeader }
1534+ ListFooterComponent = { timelineListFooter }
1535+ />
1536+ </ div >
15201537 < TimelineMinimap
15211538 items = { minimapItems }
15221539 hasPersistentGutter = { minimapHasPersistentGutter }
0 commit comments