diff --git a/gui/src/components/StyledMarkdownPreview/StepContainerPreToolbar/CollapsibleContainer.tsx b/gui/src/components/StyledMarkdownPreview/StepContainerPreToolbar/CollapsibleContainer.tsx
index fbc5f1366..464c4b4cf 100644
--- a/gui/src/components/StyledMarkdownPreview/StepContainerPreToolbar/CollapsibleContainer.tsx
+++ b/gui/src/components/StyledMarkdownPreview/StepContainerPreToolbar/CollapsibleContainer.tsx
@@ -5,15 +5,22 @@ interface CollapsibleContainerProps {
children: React.ReactNode;
maxHeight?: string;
className?: string;
+ collapsible?: boolean;
}
export function CollapsibleContainer({
children,
maxHeight = "max-h-40",
className = "",
+ collapsible = false,
}: CollapsibleContainerProps) {
const [isExpanded, setIsExpanded] = useState(false);
+ // If not collapsible, just render children without any collapsible behavior
+ if (!collapsible) {
+ return
{children}
;
+ }
+
return (
diff --git a/gui/src/components/StyledMarkdownPreview/StepContainerPreToolbar/index.tsx b/gui/src/components/StyledMarkdownPreview/StepContainerPreToolbar/index.tsx
index 0b564582f..1d252dbdb 100644
--- a/gui/src/components/StyledMarkdownPreview/StepContainerPreToolbar/index.tsx
+++ b/gui/src/components/StyledMarkdownPreview/StepContainerPreToolbar/index.tsx
@@ -33,6 +33,7 @@ export interface StepContainerPreToolbarProps {
children: any;
expanded?: boolean;
disableManualApply?: boolean;
+ collapsible?: boolean;
}
export function StepContainerPreToolbar({
@@ -48,6 +49,7 @@ export function StepContainerPreToolbar({
children,
expanded,
disableManualApply,
+ collapsible,
}: StepContainerPreToolbarProps) {
const ideMessenger = useContext(IdeMessengerContext);
const history = useAppSelector((state) => state.session.history);
@@ -299,8 +301,11 @@ export function StepContainerPreToolbar({
{renderActionButtons()}
-
- {isExpanded && {children}}
+ {isExpanded && (
+
+ {children}
+
+ )}
);
}
diff --git a/gui/src/components/StyledMarkdownPreview/index.tsx b/gui/src/components/StyledMarkdownPreview/index.tsx
index 0f2d1af0d..b01e49256 100644
--- a/gui/src/components/StyledMarkdownPreview/index.tsx
+++ b/gui/src/components/StyledMarkdownPreview/index.tsx
@@ -127,6 +127,7 @@ interface StyledMarkdownPreviewProps {
disableManualApply?: boolean;
toolCallId?: string;
expandCodeblocks?: boolean;
+ collapsible?: boolean;
}
const HLJS_LANGUAGE_CLASSNAME_PREFIX = "language-";
@@ -305,6 +306,7 @@ const StyledMarkdownPreview = memo(function StyledMarkdownPreview(
forceToolCallId={props.toolCallId}
expanded={props.expandCodeblocks}
disableManualApply={props.disableManualApply}
+ collapsible={props.collapsible}
>
diff --git a/gui/src/pages/gui/ToolCallDiv/EditFile.tsx b/gui/src/pages/gui/ToolCallDiv/EditFile.tsx
index 17d306374..27b093799 100644
--- a/gui/src/pages/gui/ToolCallDiv/EditFile.tsx
+++ b/gui/src/pages/gui/ToolCallDiv/EditFile.tsx
@@ -24,6 +24,7 @@ export function EditFile(props: EditToolCallProps) {
source={src}
toolCallId={props.toolCallId}
itemIndex={props.historyIndex}
+ collapsible={true}
/>
);
}