Changesets · Branches · Tags · Compare
| Changeset | 757036cb67e52e2c430396420969192a490c7a0815525fea0094a041e6e6bd3e |
|---|---|
| Author | Nate <sestinj@gmail.com> · 2025-07-04 22:50 -07:00 |
| Committer | Nate <sestinj@gmail.com> · 2025-07-04 22:50 -07:00 |
| Parents | 0cdb3e901c09 |
4 files changed
modified gui/src/components/StyledMarkdownPreview/StepContainerPreToolbar/CollapsibleContainer.tsx +7 −0
| @@ -5,15 +5,22 @@ | ||
| 5 | 5 | children: React.ReactNode; |
| 6 | 6 | maxHeight?: string; |
| 7 | 7 | className?: string; |
| 8 | + collapsible?: boolean; | |
| 8 | 9 | } |
| 9 | 10 | |
| 10 | 11 | export function CollapsibleContainer({ |
| 11 | 12 | children, |
| 12 | 13 | maxHeight = "max-h-40", |
| 13 | 14 | className = "", |
| 15 | + collapsible = false, | |
| 14 | 16 | }: CollapsibleContainerProps) { |
| 15 | 17 | const [isExpanded, setIsExpanded] = useState(false); |
| 16 | 18 | |
| 19 | + // If not collapsible, just render children without any collapsible behavior | |
| 20 | + if (!collapsible) { | |
| 21 | + return <div className={className}>{children}</div>; | |
| 22 | + } | |
| 23 | + | |
| 17 | 24 | return ( |
| 18 | 25 | <div className={`relative ${className}`}> |
| 19 | 26 | <div className={`overflow-hidden ${isExpanded ? "" : maxHeight}`}> |
modified gui/src/components/StyledMarkdownPreview/StepContainerPreToolbar/index.tsx +7 −2
| @@ -33,6 +33,7 @@ | ||
| 33 | 33 | children: any; |
| 34 | 34 | expanded?: boolean; |
| 35 | 35 | disableManualApply?: boolean; |
| 36 | + collapsible?: boolean; | |
| 36 | 37 | } |
| 37 | 38 | |
| 38 | 39 | export function StepContainerPreToolbar({ |
| @@ -48,6 +49,7 @@ | ||
| 48 | 49 | children, |
| 49 | 50 | expanded, |
| 50 | 51 | disableManualApply, |
| 52 | + collapsible, | |
| 51 | 53 | }: StepContainerPreToolbarProps) { |
| 52 | 54 | const ideMessenger = useContext(IdeMessengerContext); |
| 53 | 55 | const history = useAppSelector((state) => state.session.history); |
| @@ -299,8 +301,11 @@ | ||
| 299 | 301 | {renderActionButtons()} |
| 300 | 302 | </div> |
| 301 | 303 | </div> |
| 302 | - | |
| 303 | - {isExpanded && <CollapsibleContainer>{children}</CollapsibleContainer>} | |
| 304 | + {isExpanded && ( | |
| 305 | + <CollapsibleContainer collapsible={collapsible}> | |
| 306 | + {children} | |
| 307 | + </CollapsibleContainer> | |
| 308 | + )} | |
| 304 | 309 | </div> |
| 305 | 310 | ); |
| 306 | 311 | } |
modified gui/src/components/StyledMarkdownPreview/index.tsx +2 −0
| @@ -127,6 +127,7 @@ | ||
| 127 | 127 | disableManualApply?: boolean; |
| 128 | 128 | toolCallId?: string; |
| 129 | 129 | expandCodeblocks?: boolean; |
| 130 | + collapsible?: boolean; | |
| 130 | 131 | } |
| 131 | 132 | |
| 132 | 133 | const HLJS_LANGUAGE_CLASSNAME_PREFIX = "language-"; |
| @@ -305,6 +306,7 @@ | ||
| 305 | 306 | forceToolCallId={props.toolCallId} |
| 306 | 307 | expanded={props.expandCodeblocks} |
| 307 | 308 | disableManualApply={props.disableManualApply} |
| 309 | + collapsible={props.collapsible} | |
| 308 | 310 | > |
| 309 | 311 | <SyntaxHighlightedPre {...preProps} /> |
| 310 | 312 | </StepContainerPreToolbar> |
modified gui/src/pages/gui/ToolCallDiv/EditFile.tsx +1 −0
| @@ -24,6 +24,7 @@ | ||
| 24 | 24 | source={src} |
| 25 | 25 | toolCallId={props.toolCallId} |
| 26 | 26 | itemIndex={props.historyIndex} |
| 27 | + collapsible={true} | |
| 27 | 28 | /> |
| 28 | 29 | ); |
| 29 | 30 | } |