Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions apps/web/src/components/ChatView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1423,7 +1423,6 @@ export default function ChatView(props: ChatViewProps) {
const getTimelineScrollableNodeStable = useStableCallback(getTimelineScrollableNode);
const [composerOverlayElement, setComposerOverlayElement] = useState<HTMLDivElement | null>(null);
const [composerTimelineInset, setComposerTimelineInset] = useState(0);
const [composerOverlayHeight, setComposerOverlayHeight] = useState(0);
const composerTimelineInsetRef = useRef(0);
const [composerReservedHeight, setComposerReservedHeight] = useState(0);
const composerReservedHeightRef = useRef(0);
Expand Down Expand Up @@ -4800,7 +4799,6 @@ export default function ChatView(props: ChatViewProps) {
const publishComposerOverlayHeight = (height: number) => {
const nextHeight = Math.ceil(height);
if (nextHeight <= 0) return;
setComposerOverlayHeight(isDraftHeroState ? 0 : nextHeight);
const isResting = overlayComposerIsResting({
composerMounted: composerMountedRef.current,
composerReportedResting: composerRestingRef.current,
Expand Down Expand Up @@ -8284,7 +8282,6 @@ export default function ChatView(props: ChatViewProps) {
onAnchorReady={onTimelineAnchorReadyStable}
onAnchorSizeChanged={onTimelineAnchorSizeChangedStable}
contentInsetEndAdjustment={composerTimelineInset}
composerOverlayHeight={isDraftHeroState ? 0 : composerOverlayHeight}
liveFollowEnabled={!paintOnlyDisplayedTimeline && timelineLiveFollowEnabled}
onIsAtEndChange={onIsAtEndChangeStable}
onContentOverflowChange={setTimelineOverflows}
Expand Down
105 changes: 44 additions & 61 deletions apps/web/src/components/chat/MessagesTimeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ import {
type KeyboardEvent,
type MouseEvent,
type ReactNode,
type CSSProperties,
} from "react";
import {
LegendList,
Expand Down Expand Up @@ -508,7 +507,6 @@ interface MessagesTimelineProps {
onAnchorReady: (messageId: MessageId, anchorIndex: number) => void;
onAnchorSizeChanged: (messageId: MessageId, size: number) => void;
contentInsetEndAdjustment: number;
composerOverlayHeight?: number;
onIsAtEndChange: (isAtEnd: boolean) => void;
/**
* Off while the user is reading history; LegendList's own maintainScrollAtEnd
Expand Down Expand Up @@ -609,7 +607,6 @@ const ConversationTimeline = memo(function ConversationTimeline({
onAnchorReady,
onAnchorSizeChanged,
contentInsetEndAdjustment,
composerOverlayHeight = 0,
onIsAtEndChange,
onContentOverflowChange,
liveFollowEnabled,
Expand Down Expand Up @@ -1102,12 +1099,6 @@ const ConversationTimeline = memo(function ConversationTimeline({
{footer}
</TimelineListFooter>
);
const timelineMaskStyle =
composerOverlayHeight === 0
? undefined
: ({
"--timeline-composer-overlay-height": `${composerOverlayHeight}px`,
} as CSSProperties);

const measureContentOverflow = () =>
timelineContentOverflowsViewport(listRef.current?.getState?.(), {
Expand Down Expand Up @@ -1522,60 +1513,52 @@ const ConversationTimeline = memo(function ConversationTimeline({
onCite={onCiteAssistantText}
/>
) : null}
<div
<LegendList<MessagesTimelineRow>
ref={setTimelineList}
data={rows}
extraData={listExtraData}
keyExtractor={keyExtractor}
getItemType={getItemType}
renderItem={renderItem}
estimatedItemSize={90}
initialScrollAtEnd={
!findActive && citationRequest === null && rememberedPosition?.atEnd !== false
}
// Legend needs a data refresh to mount new pins without a scroll event.
dataVersion={readyCitationRequest?.key ?? listIdentityKey}
{...(alwaysRender ? { alwaysRender } : {})}
onLoad={handleListLoad}
{...(anchoredEndSpace ? { anchoredEndSpace } : {})}
contentInsetEndAdjustment={anchoredEndSpace ? contentInsetEndAdjustment : 0}
maintainScrollAtEnd={
citationPositioning ||
(restoringThreadPosition && rememberedPosition?.atEnd === false) ||
anchoredEndSpace ||
!liveFollowEnabled ||
fullscreenAppRowId !== null ||
disclosureToggleSettling
? false
: isWorking && !prefersReducedMotion && settlingListIdentity === null
? TIMELINE_MAINTAIN_SCROLL_AT_END_SMOOTH
: TIMELINE_MAINTAIN_SCROLL_AT_END
}
maintainVisibleContentPosition={
findActive ||
citationPositioning ||
(restoringThreadPosition && rememberedPosition?.atEnd === false)
? false
: maintainVisibleContentPosition
}
maintainScrollAtEndThreshold={1}
onScroll={handleScroll}
onItemSizeChanged={handleItemSizeChanged}
className={cn(
"h-full min-h-0",
composerOverlayHeight > 0 && "virtualized-scroll-fade timeline-scroll-bottom-fade",
"messages-timeline-scroll scrollbar-gutter-both h-full min-h-0 overflow-x-hidden overscroll-y-contain [overflow-anchor:none]",
topFadeEnabled && "topbar-scroll-fade",
)}
style={timelineMaskStyle}
>
<LegendList<MessagesTimelineRow>
ref={setTimelineList}
data={rows}
extraData={listExtraData}
keyExtractor={keyExtractor}
getItemType={getItemType}
renderItem={renderItem}
estimatedItemSize={90}
initialScrollAtEnd={
!findActive && citationRequest === null && rememberedPosition?.atEnd !== false
}
// Legend needs a data refresh to mount new pins without a scroll event.
dataVersion={readyCitationRequest?.key ?? listIdentityKey}
{...(alwaysRender ? { alwaysRender } : {})}
onLoad={handleListLoad}
{...(anchoredEndSpace ? { anchoredEndSpace } : {})}
contentInsetEndAdjustment={anchoredEndSpace ? contentInsetEndAdjustment : 0}
maintainScrollAtEnd={
citationPositioning ||
(restoringThreadPosition && rememberedPosition?.atEnd === false) ||
anchoredEndSpace ||
!liveFollowEnabled ||
fullscreenAppRowId !== null ||
disclosureToggleSettling
? false
: isWorking && !prefersReducedMotion && settlingListIdentity === null
? TIMELINE_MAINTAIN_SCROLL_AT_END_SMOOTH
: TIMELINE_MAINTAIN_SCROLL_AT_END
}
maintainVisibleContentPosition={
findActive ||
citationPositioning ||
(restoringThreadPosition && rememberedPosition?.atEnd === false)
? false
: maintainVisibleContentPosition
}
maintainScrollAtEndThreshold={1}
onScroll={handleScroll}
onItemSizeChanged={handleItemSizeChanged}
className={cn(
"messages-timeline-scroll scrollbar-gutter-both h-full min-h-0 overflow-x-hidden overscroll-y-contain [overflow-anchor:none]",
topFadeEnabled && "topbar-scroll-fade",
)}
ListHeaderComponent={listHeader}
ListFooterComponent={timelineListFooter}
/>
</div>
ListHeaderComponent={listHeader}
ListFooterComponent={timelineListFooter}
/>
<TimelineMinimap
items={minimapItems}
hasPersistentGutter={minimapHasPersistentGutter}
Expand Down
10 changes: 0 additions & 10 deletions apps/web/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -497,16 +497,6 @@ html[data-mobile-composer-route-transition="true"]::view-transition-old(t3-mobil
var(--app-scrollbar-width) 100%;
}

@utility timeline-scroll-bottom-fade {
--virtualized-scroll-fade-mask: linear-gradient(
to bottom,
black 0,
black calc(100% - var(--timeline-composer-overlay-height) - 0.75rem),
transparent calc(100% - var(--timeline-composer-overlay-height)),
transparent 100%
);
}

/* Stage-channel art needs a mask and pseudo-element gradient, so keep the
behavior composable without tying it to the global components layer. */
@utility sidebar-stage-backdrop {
Expand Down
Loading