From a322852257ac80d429720f64d780ebc073502e71 Mon Sep 17 00:00:00 2001 From: Monster <389264167@qq.com> Date: Wed, 18 Mar 2026 17:33:50 +0800 Subject: [PATCH] =?UTF-8?q?fix(task-detail):=20=E7=BB=9F=E4=B8=80=E6=B8=B2?= =?UTF-8?q?=E6=9F=93=E7=BB=93=E6=9E=84=EF=BC=8C=E5=88=87=E6=8D=A2=E5=8F=B3?= =?UTF-8?q?=E4=BE=A7=E9=9D=A2=E6=9D=BF=E6=97=B6=E4=BF=9D=E7=95=99=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 合并条件渲染分支,chatSection 始终在 ResizablePanelGroup 内 - 条件渲染 Handle 和右侧 Panel,避免 chatSection unmount - 为条件面板添加 id/order 以符合 react-resizable-panels 规范 Made-with: Cursor --- .../pages/console/user/task/task-detail.tsx | 129 +++++++++--------- 1 file changed, 61 insertions(+), 68 deletions(-) diff --git a/frontend/src/pages/console/user/task/task-detail.tsx b/frontend/src/pages/console/user/task/task-detail.tsx index 9878f0c5..ebea05b4 100644 --- a/frontend/src/pages/console/user/task/task-detail.tsx +++ b/frontend/src/pages/console/user/task/task-detail.tsx @@ -347,77 +347,70 @@ export default function TaskDetailPage() { ) - if (!hasPanel || showPreparing) { - return ( -
- {showPreparing ? : chatSection} - -
- ) - } - return (
- - - {chatSection} - - - -
- {activePanel === "files" && ( -
- setActivePanel(null)} - envid={envid} - /> -
- )} - {activePanel === "terminal" && ( -
-
- setActivePanel(null)} /> + {showPreparing ? ( + + ) : ( + + + {chatSection} + + {hasPanel && ( + <> + + +
+ {activePanel === "files" && ( +
+ setActivePanel(null)} + envid={envid} + /> +
+ )} + {activePanel === "terminal" && ( +
+
+ setActivePanel(null)} /> +
+
+ )} + {activePanel === "changes" && ( +
+ setActivePanel(null)} + /> +
+ )} + {activePanel === "preview" && ( +
+ setActivePanel(null)} + /> +
+ )}
-
- )} - {activePanel === "changes" && ( -
- setActivePanel(null)} - /> -
- )} - {activePanel === "preview" && ( -
- setActivePanel(null)} - /> -
- )} -
- - + + + )} + + )}