Skip to content
TypeScript

revert: "fix(web): stop composer banner glass overlap" (#8034) (#22227)

Theo Browne818f09611d64
diff --git a/apps/web/src/components/ChatView.tsx b/apps/web/src/components/ChatView.tsx
index 8c12286a241..97032127660 100644
--- a/apps/web/src/components/ChatView.tsx
+++ b/apps/web/src/components/ChatView.tsx
@@ -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);
@@ -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,
@@ -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}
diff --git a/apps/web/src/components/chat/MessagesTimeline.tsx b/apps/web/src/components/chat/MessagesTimeline.tsx
index bb209924a1c..1e591b56836 100644
--- a/apps/web/src/components/chat/MessagesTimeline.tsx
+++ b/apps/web/src/components/chat/MessagesTimeline.tsx
@@ -84,7 +84,6 @@ import {
type KeyboardEvent,
type MouseEvent,
type ReactNode,
- type CSSProperties,
} from "react";
import {
LegendList,
@@ -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
@@ -609,7 +607,6 @@ const ConversationTimeline = memo(function ConversationTimeline({
onAnchorReady,
onAnchorSizeChanged,
contentInsetEndAdjustment,
- composerOverlayHeight = 0,
onIsAtEndChange,
onContentOverflowChange,
liveFollowEnabled,
@@ -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?.(), {
@@ -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}
diff --git a/apps/web/src/index.css b/apps/web/src/index.css
index e1096171a09..bd074ce2422 100644
--- a/apps/web/src/index.css
+++ b/apps/web/src/index.css
@@ -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 {