diff --git a/components/pages/work-flow.tsx b/components/pages/work-flow.tsx index e76dfae..f090f8b 100644 --- a/components/pages/work-flow.tsx +++ b/components/pages/work-flow.tsx @@ -54,7 +54,6 @@ const WorkFlow = React.memo(function WorkFlow() { const [previewVideoId, setPreviewVideoId] = React.useState(null); const [isFocusChatInput, setIsFocusChatInput] = React.useState(false); const [selectedView, setSelectedView] = React.useState<'final' | 'video' | null>(null); - const [isFinalBarOpen, setIsFinalBarOpen] = React.useState(true); const [aiEditingResult, setAiEditingResult] = React.useState(null); // const aiEditingButtonRef = useRef<{ handleAIEditing: () => Promise }>(null); @@ -248,12 +247,12 @@ const WorkFlow = React.memo(function WorkFlow() { console.log('changedIndex_work-flow', currentSketchIndex, taskObject); }, [currentSketchIndex, taskObject]); - // 当最终视频出现时,默认选中最终视频 + // 当最终视频出现时,强制切换到最终视频 useEffect(() => { - if (taskObject?.final?.url && selectedView === null) { + if (taskObject?.final?.url) { setSelectedView('final'); } - }, [taskObject?.final?.url, selectedView]); + }, [taskObject?.final?.url]); // 监听粗剪是否完成 useEffect(() => { @@ -450,37 +449,6 @@ Please process this video editing request.`; > {isDesktop ? (
- {/* 左侧最终视频缩略图栏(仅桌面) */} - {taskObject?.final?.url && ( -
-
- {isFinalBarOpen && ( -
- {/* 预留历史列表,目前仅展示当前最终视频 */} - -
- )} -
-
- )} { - setSelectedView('video'); - setCurrentSketchIndex(index); + if (index === -1) { + // 点击最终视频 + setSelectedView('final'); + setCurrentSketchIndex(0); + } else { + // 点击普通视频 + setSelectedView('video'); + setCurrentSketchIndex(index); + } }} onRetryVideo={handleRetryVideo} className={isDesktop ? 'auto-cols-[20%]' : (isTablet ? 'auto-cols-[25%]' : 'auto-cols-[33%]')} diff --git a/components/pages/work-flow/H5MediaViewer.tsx b/components/pages/work-flow/H5MediaViewer.tsx index 6328577..f3756c6 100644 --- a/components/pages/work-flow/H5MediaViewer.tsx +++ b/components/pages/work-flow/H5MediaViewer.tsx @@ -84,7 +84,6 @@ export function H5MediaViewer({ const [activeIndex, setActiveIndex] = useState(0); const [isPlaying, setIsPlaying] = useState(false); const [isCatalogOpen, setIsCatalogOpen] = useState(false); - const [isFinalBarOpen, setIsFinalBarOpen] = useState(true); // 计算当前阶段类型 const stage = (selectedView === 'final' && taskObject.final?.url) @@ -372,26 +371,6 @@ export function H5MediaViewer({ // 其他阶段:使用 Carousel return (
- {/* 左侧最终视频缩略图栏(H5) 视频暂停时展示 */} - {taskObject?.final?.url && !isPlaying && ( -
-
- {isFinalBarOpen && ( -
- -
- )} -
-
- )} {stage === 'final_video' && videoUrls.length > 0 && renderVideoSlides()} {stage === 'video' && videoUrls.length > 0 && renderVideoSlides()} {(stage === 'scene' || stage === 'character') && imageUrls.length > 0 && renderImageSlides()} diff --git a/components/pages/work-flow/thumbnail-grid.tsx b/components/pages/work-flow/thumbnail-grid.tsx index 2a3ae94..df5f926 100644 --- a/components/pages/work-flow/thumbnail-grid.tsx +++ b/components/pages/work-flow/thumbnail-grid.tsx @@ -4,7 +4,7 @@ import React, { useRef, useEffect, useState, useCallback } from 'react'; import { motion } from 'framer-motion'; import { Skeleton } from '@/components/ui/skeleton'; import { ProgressiveReveal, presets } from '@/components/ui/progressive-reveal'; -import { Loader2, X, SquareUserRound, MapPinHouse, Clapperboard, Video, RotateCcw, CircleAlert } from 'lucide-react'; +import { Loader2, X, SquareUserRound, MapPinHouse, Clapperboard, Video, RotateCcw, CircleAlert, Film } from 'lucide-react'; import { TaskObject } from '@/api/DTO/movieEdit'; import { getFirstFrame } from '@/utils/tools'; import { AspectRatioValue } from '@/components/ChatInputBox/AspectRatioSelector'; @@ -187,18 +187,72 @@ export function ThumbnailGrid({ // 渲染视频阶段的缩略图 const renderVideoThumbnails = (disabled: boolean = false) => ( - taskObject.videos.data.map((video, index) => { - const urls: string = video.urls ? video.urls.join(',') : ''; - - return ( + <> + {/* 最终视频缩略图(排在第一位) */} + {taskObject?.final?.url && (
!isDragging && !disabled && onSketchSelect(index)} + onClick={() => !isDragging && !disabled && onSketchSelect(-1)} > + {/* 视频层 */} +
+
handleMouseEnter(-1)} + onMouseLeave={() => handleMouseLeave(-1)} + > + final video thumbnail + {hoveredIndex === -1 && ( +
+
+ + {/* 左上角三角标签 */} +
+
+ {/* 三角形背景 */} +
+ {/* 图标 */} +
+ +
+
+
+
+ )} + + {/* 普通视频缩略图 */} + {taskObject.videos.data.map((video, index) => { + const urls: string = video.urls ? video.urls.join(',') : ''; + + return ( +
!isDragging && !disabled && onSketchSelect(index)} + > {/* 视频层 */}
@@ -271,7 +325,8 @@ export function ThumbnailGrid({
*/}
); - }) + })} + ); // 渲染分镜草图阶段的缩略图