Skip to content

Commit 13cc74f

Browse files
committed
fix(task-file-explorer): preserve file tree expand state when opening/closing file detail
1 parent 927f017 commit 13cc74f

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

frontend/src/components/console/task/task-file-explorer.tsx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -600,19 +600,19 @@ export const TaskFileExplorer = ({
600600

601601
return (
602602
<div className={cn("flex flex-col h-full min-h-0", className)}>
603-
{currentFile ? (
604-
<ResizablePanelGroup direction="vertical" className="flex-1 min-h-0 gap-2">
605-
<ResizablePanel defaultSize={50} minSize={20} className="min-h-0 flex flex-col overflow-hidden">
606-
{fileTreePanel}
607-
</ResizablePanel>
608-
<ResizableHandle withHandle className="shrink-0" />
609-
<ResizablePanel defaultSize={50} minSize={20} className="min-h-0 flex flex-col overflow-hidden">
610-
{previewPanel}
611-
</ResizablePanel>
612-
</ResizablePanelGroup>
613-
) : (
614-
<div className="flex-1 min-h-0 flex flex-col overflow-hidden">{fileTreePanel}</div>
615-
)}
603+
<ResizablePanelGroup direction="vertical" className="flex-1 min-h-0 gap-2">
604+
<ResizablePanel defaultSize={currentFile ? 50 : 100} minSize={20} className="min-h-0 flex flex-col overflow-hidden">
605+
{fileTreePanel}
606+
</ResizablePanel>
607+
{currentFile && (
608+
<>
609+
<ResizableHandle withHandle className="shrink-0" />
610+
<ResizablePanel defaultSize={50} minSize={20} className="min-h-0 flex flex-col overflow-hidden">
611+
{previewPanel}
612+
</ResizablePanel>
613+
</>
614+
)}
615+
</ResizablePanelGroup>
616616
</div>
617617
)
618618
}

0 commit comments

Comments
 (0)