From 3506156464cb52d8920e89466a207acde8091f39 Mon Sep 17 00:00:00 2001 From: oneishaansharma Date: Wed, 14 Jan 2026 00:21:43 -0800 Subject: [PATCH 1/2] chore: make File Changes section collapsible --- frontend/src/components/message/PatchPart.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/message/PatchPart.tsx b/frontend/src/components/message/PatchPart.tsx index 0d5df52..4792965 100644 --- a/frontend/src/components/message/PatchPart.tsx +++ b/frontend/src/components/message/PatchPart.tsx @@ -10,14 +10,14 @@ interface PatchPartProps { export function PatchPart({ part, onFileClick }: PatchPartProps) { return ( -
-
+
+ File Changes ({part.files.length} file{part.files.length !== 1 ? 's' : ''}) {part.hash.slice(0, 8)} -
- + +
{part.files.map((file, index) => (
))}
-
+ ) } \ No newline at end of file From 5bd987a9aa3267acbabb0690ba737b48b0764c45 Mon Sep 17 00:00:00 2001 From: oneishaansharma Date: Thu, 15 Jan 2026 13:19:13 -0800 Subject: [PATCH 2/2] enhacement: PatchPart component with collapsible file list with preview, and chevron to match others --- frontend/src/components/message/PatchPart.tsx | 48 ++++++++++++++++--- 1 file changed, 42 insertions(+), 6 deletions(-) diff --git a/frontend/src/components/message/PatchPart.tsx b/frontend/src/components/message/PatchPart.tsx index 4792965..725a763 100644 --- a/frontend/src/components/message/PatchPart.tsx +++ b/frontend/src/components/message/PatchPart.tsx @@ -1,5 +1,7 @@ +import { useState } from 'react' import type { components } from '@/api/opencode-types' import { getRelativePath } from './FileToolRender' +import { ChevronDown, ChevronUp } from 'lucide-react' type PatchPartType = components['schemas']['PatchPart'] @@ -8,18 +10,32 @@ interface PatchPartProps { onFileClick?: (filePath: string) => void } +const INITIAL_FILES_SHOWN = 3 + export function PatchPart({ part, onFileClick }: PatchPartProps) { + const [expanded, setExpanded] = useState(false) + + const hasMoreFiles = part.files.length > INITIAL_FILES_SHOWN + const displayedFiles = expanded ? part.files : part.files.slice(0, INITIAL_FILES_SHOWN) + const hiddenCount = part.files.length - INITIAL_FILES_SHOWN + return ( -
- +
+
+
+ {part.hash.slice(0, 8)} + {expanded ? : } +
+
- {part.files.map((file, index) => ( + {displayedFiles.map((file, index) => (
))} + + {!expanded && hasMoreFiles && ( + + )} + + {expanded && hasMoreFiles && ( + + )}
-
+
) } \ No newline at end of file