diff --git a/apps/web/components/task/changes-panel-timeline.tsx b/apps/web/components/task/changes-panel-timeline.tsx index b0f562d484..9b01c0cb65 100644 --- a/apps/web/components/task/changes-panel-timeline.tsx +++ b/apps/web/components/task/changes-panel-timeline.tsx @@ -1,10 +1,12 @@ "use client"; +import { useState } from "react"; import { IconGitCommit, IconGitPullRequest, IconCloudUpload, IconChevronDown, + IconChevronRight, IconLoader2, } from "@tabler/icons-react"; @@ -54,6 +56,7 @@ function TimelineSection({ action, isLast, children, + collapsible = true, "data-testid": testId, }: { dotColor: string; @@ -62,8 +65,12 @@ function TimelineSection({ action?: React.ReactNode; isLast?: boolean; children?: React.ReactNode; + collapsible?: boolean; "data-testid"?: string; }) { + const [collapsed, setCollapsed] = useState(false); + const canCollapse = collapsible && !!label; + return (
{/* Vertical line + dot */} @@ -77,18 +84,38 @@ function TimelineSection({ {/* Header */} {label && (
- - {label} - {typeof count === "number" && ( - ({count}) - )} - + {canCollapse ? ( + + ) : ( + + {label} + {typeof count === "number" && ( + ({count}) + )} + + )} {action}
)} {/* Children (file list, buttons, etc.) */} - {children} + {!collapsed && children}
); @@ -359,6 +386,7 @@ export function PRFilesSection({ files, isLast, onOpenDiff }: PRFilesSectionProp label="PR Changes" count={files.length} isLast={isLast} + data-testid="pr-changes-section" > {files.length > 0 && (