From 313ff2888463d5959668109a2fbbaf6c931e38a8 Mon Sep 17 00:00:00 2001 From: flamboh Date: Mon, 9 Nov 2026 09:24:26 +0000 Subject: [PATCH] fix(web): use consistent timeline fold disclosures --- apps/web/src/components/ChatView.tsx | 13 ++--- .../src/components/chat/MessagesTimeline.tsx | 43 ++++++-------- .../src/components/chat/TimelineOverlays.tsx | 56 ++++++++++--------- .../components/chat/TimelineWorkGroupRows.tsx | 41 ++++++++------ .../src/components/chat/V2ItemInspector.tsx | 3 - apps/web/src/components/chat/WorkLog.tsx | 2 +- apps/web/src/components/guest/GuestPage.tsx | 13 ++--- apps/web/src/index.css | 24 ++++++++ 8 files changed, 108 insertions(+), 87 deletions(-) diff --git a/apps/web/src/components/ChatView.tsx b/apps/web/src/components/ChatView.tsx index 92d96bac99a1..baad7dca6a25 100644 --- a/apps/web/src/components/ChatView.tsx +++ b/apps/web/src/components/ChatView.tsx @@ -3602,13 +3602,12 @@ export default function ChatView(props: ChatViewProps) { /> - {showScrollToBottom && !isThreadFindActive && ( - scrollToEnd(true)} - /> - )} + scrollToEnd(true)} + /> {/* Input bar — docked at the bottom; an empty draft centers its headline above it. */} diff --git a/apps/web/src/components/chat/MessagesTimeline.tsx b/apps/web/src/components/chat/MessagesTimeline.tsx index e1f74734c9f9..84b965523ec2 100644 --- a/apps/web/src/components/chat/MessagesTimeline.tsx +++ b/apps/web/src/components/chat/MessagesTimeline.tsx @@ -103,8 +103,6 @@ import { MessageSquareIcon, MessagesSquareIcon, } from "lucide-react"; -import { ChevronDown, ChevronRight } from "lucide"; -import { MorphIcon } from "~/components/MorphIcon"; import { Skeleton } from "../ui/skeleton"; import { ExpandedImagePreview } from "./ExpandedImagePreview"; import { @@ -676,8 +674,7 @@ const ConversationTimeline = memo(function ConversationTimeline({ }); const onToggleWorkGroup = useStableCallback((groupId: string, anchorKey: string) => { preserveDisclosurePosition(anchorKey); - const wakeUps = rows.find((row) => row.kind === "background-activity" && row.id === groupId); - if (wakeUps?.kind === "background-activity") revealFoldRows(!wakeUps.expanded); + revealFoldRows(!expandedWorkGroupIds.has(groupId)); setExpandedWorkGroupIds((existing) => { const next = new Set(existing); if (next.has(groupId)) { @@ -1641,8 +1638,8 @@ const TimelineRowContent = memo(function TimelineRowContent({ row }: { row: Time row.kind === "work-toggle" || row.kind === "thinking"; const isExpandedToolGroupHeader = - (row.kind === "work-toggle" || row.kind === "work-live" || row.kind === "thinking") && - row.expanded === true; + row.kind === "work-toggle" || + ((row.kind === "work-live" || row.kind === "thinking") && row.expanded === true); return (
- +
+ + + {row.label} + {error ? {error} : null} + + + Cut off by a steer +
{loading ? : null}
); diff --git a/apps/web/src/components/chat/TimelineOverlays.tsx b/apps/web/src/components/chat/TimelineOverlays.tsx index 90e739221120..97ca578fcf10 100644 --- a/apps/web/src/components/chat/TimelineOverlays.tsx +++ b/apps/web/src/components/chat/TimelineOverlays.tsx @@ -8,41 +8,45 @@ import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip"; * what waits at the end of the timeline, which is out of view while it shows. */ export function ScrollToEndButton(props: { + readonly visible: boolean; readonly bottom: number; readonly summary: ReadonlyArray; readonly onScrollToEnd: () => void; }) { + const button = ( + + ); return (
- - event.preventDefault()} - onClick={props.onScrollToEnd} - className="pointer-events-auto" - size="xs" - variant="floating" - /> - } - > - - Scroll to end - - - {props.summary.length - ? props.summary.map((part) => ( - - {part} - - )) - : "Scroll to end"} - - + {props.summary.length > 0 ? ( + + + + {props.summary.map((part) => ( + + {part} + + ))} + + + ) : ( + button + )}
); } diff --git a/apps/web/src/components/chat/TimelineWorkGroupRows.tsx b/apps/web/src/components/chat/TimelineWorkGroupRows.tsx index dc12eb892045..7668f3b239da 100644 --- a/apps/web/src/components/chat/TimelineWorkGroupRows.tsx +++ b/apps/web/src/components/chat/TimelineWorkGroupRows.tsx @@ -168,6 +168,7 @@ function WorkingTimer({ createdAt, clock = false }: { createdAt: string; clock?: } const compactWorkEntryHeight = 24; +const expandedWorkEntryHeight = 28; function ExpandedWorkGroupEntries({ anchorKey, @@ -259,7 +260,9 @@ function ExpandedWorkGroupEntries({ }, [updateScrollFades]); const renderEntry = ({ item }: { item: TimelineWorkEntry }) => ( - +
+ +
); const updateExpandedContentHeight = () => { @@ -269,7 +272,7 @@ function ExpandedWorkGroupEntries({ if (state?.indexByKey(entryId) === undefined) continue; height += Math.max( 0, - (state.sizes.get(entryId) ?? compactWorkEntryHeight) - compactWorkEntryHeight, + (state.sizes.get(entryId) ?? expandedWorkEntryHeight) - expandedWorkEntryHeight, ); } setExpandedContentHeight(height); @@ -287,7 +290,7 @@ function ExpandedWorkGroupEntries({ extraData={workspaceRoot} keyExtractor={workEntryKey} renderItem={renderEntry} - estimatedItemSize={compactWorkEntryHeight} + estimatedItemSize={expandedWorkEntryHeight} drawDistance={240} recycleItems {...(initialScrollIndex ? { initialScrollIndex } : {})} @@ -700,20 +703,22 @@ function WorkGroupHeader(props: { onToggle: () => void; }) { return ( - - } - label={{props.label}} - /> +
+ + } + label={{props.label}} + /> +
); } @@ -827,7 +832,7 @@ function WorkingWindowText({ const textRef = useCarriedTextFade(item.message.id); if (text.trim().length === 0) return null; return ( -
+
- - {formatWorkspaceRelativePath(item.fileName, props.workspaceRoot)} - {item.additions !== undefined || item.deletions !== undefined ? ( diff --git a/apps/web/src/components/chat/WorkLog.tsx b/apps/web/src/components/chat/WorkLog.tsx index 3983fe78de47..68aa46838564 100644 --- a/apps/web/src/components/chat/WorkLog.tsx +++ b/apps/web/src/components/chat/WorkLog.tsx @@ -27,7 +27,7 @@ export function WorkLogBlock({ } export function WorkLogList({ children }: { children: ReactNode }) { - return
{children}
; + return
{children}
; } type RowContent = { diff --git a/apps/web/src/components/guest/GuestPage.tsx b/apps/web/src/components/guest/GuestPage.tsx index 6dc884838312..2abc4832ee6d 100644 --- a/apps/web/src/components/guest/GuestPage.tsx +++ b/apps/web/src/components/guest/GuestPage.tsx @@ -527,13 +527,12 @@ function GuestThread({ } /> - {follow.showScrollToBottom ? ( - follow.scrollToEnd(true)} - /> - ) : null} + follow.scrollToEnd(true)} + />
follow.scrollToEnd(true)} /> diff --git a/apps/web/src/index.css b/apps/web/src/index.css index 20e8a0617e67..8a2eb33af3fd 100644 --- a/apps/web/src/index.css +++ b/apps/web/src/index.css @@ -5958,3 +5958,27 @@ body { [data-layout-strip] [data-layout-pane-id] :is(pre, .overflow-x-auto, .overflow-x-scroll) { overscroll-behavior-x: contain; } + +.chat-scroll-to-bottom { + opacity: 1; + transition: + opacity 150ms ease-out, + display 150ms allow-discrete; +} + +.chat-scroll-to-bottom[data-visible="false"] { + display: none; + opacity: 0; +} + +@starting-style { + .chat-scroll-to-bottom { + opacity: 0; + } +} + +@media (prefers-reduced-motion: reduce) { + .chat-scroll-to-bottom { + transition: none; + } +}