From 8263b236fda75ac3fd8f5cf52a2927efc87148ea Mon Sep 17 00:00:00 2001 From: iven Date: Thu, 2 Apr 2026 01:32:58 +0800 Subject: [PATCH] refactor(desktop): wire PipelineResultPreview into PipelinesPanel Replace the inline ResultModal with the full-featured PipelineResultPreview component. This gives users JSON/Markdown/ Classroom mode switching, file download cards, and classroom export support instead of the previous basic PresentationContainer wrapper. Remove unused ResultModal component and PresentationContainer import. Co-Authored-By: Claude Opus 4.6 --- desktop/src/components/PipelinesPanel.tsx | 66 ++--------------------- 1 file changed, 4 insertions(+), 62 deletions(-) diff --git a/desktop/src/components/PipelinesPanel.tsx b/desktop/src/components/PipelinesPanel.tsx index 7419371..87b5ef8 100644 --- a/desktop/src/components/PipelinesPanel.tsx +++ b/desktop/src/components/PipelinesPanel.tsx @@ -18,6 +18,7 @@ import { Filter, X, } from 'lucide-react'; +import { PipelineResultPreview } from './PipelineResultPreview'; import { PipelineClient, PipelineInfo, @@ -28,7 +29,6 @@ import { formatInputType, } from '../lib/pipeline-client'; import { useToast } from './ui/Toast'; -import { PresentationContainer } from './presentation'; // === Category Badge Component === @@ -117,64 +117,6 @@ function PipelineCard({ pipeline, onRun }: PipelineCardProps) { ); } -// === Pipeline Result Modal === - -interface ResultModalProps { - result: PipelineRunResponse; - pipeline: PipelineInfo; - onClose: () => void; -} - -function ResultModal({ result, pipeline, onClose }: ResultModalProps) { - return ( -
-
- {/* Header */} -
-
- {pipeline.icon} -
-

- {pipeline.displayName} - 执行结果 -

-

- 状态: {result.status === 'completed' ? '已完成' : '失败'} -

-
-
- -
- - {/* Content */} -
- {result.outputs ? ( - - ) : result.error ? ( -
- -

{result.error}

-
- ) : ( -
- -

无输出结果

-
- )} -
-
-
- ); -} - // === Pipeline Run Modal === interface RunModalProps { @@ -602,11 +544,11 @@ export function PipelinesPanel() { /> )} - {/* Result Modal */} + {/* Result Preview */} {runResult && ( - setRunResult(null)} /> )}