# 视频生成预检浮层重构 **日期**: 2026-02-03 **类型**: 功能优化 **影响范围**: 前端 - 分镜看板、预览面板 ## 变更概述 将视频生成预检功能从 Dialog 弹窗改造为浮层组件,在点击视频轨道未生成视频的元素块时,在中间预览区域上方显示定位浮层。 ## 主要变更 ### 1. GenerationPrecheck 组件重构 **文件**: `client/src/components/features/preview/GenerationPrecheck.tsx` - ✅ 移除 Dialog 和 DialogContent 依赖 - ✅ 改为使用固定定位的浮层 + 遮罩层实现 - ✅ 添加关闭按钮(X 图标) - ✅ 添加 `onClose` 回调属性 - ✅ 使用 `animate-in` 动画效果(fade-in + zoom-in-95) - ✅ 浮层居中显示,宽度 90vw(最大 4xl),高度 72vh **接口变更**: ```typescript // 旧接口 interface GenerationPrecheckProps { open?: boolean; onOpenChange?: (open: boolean) => void; // ... } // 新接口 interface GenerationPrecheckProps { open?: boolean; onClose?: () => void; // ... } ``` ### 2. EditorStore 状态管理 **文件**: `client/src/stores/editorStore.ts` 新增状态: - `videoGenerationPrecheckOpen: boolean` - 浮层显示状态 - `videoGenerationPrecheckStoryboardId: string | null` - 当前预检的分镜 ID 新增方法: - `openVideoGenerationPrecheck(storyboardId: string)` - 打开预检浮层 - `closeVideoGenerationPrecheck()` - 关闭预检浮层 ### 3. CenterArea 布局集成 **文件**: `client/src/components/layout/CenterArea.tsx` - ✅ 导入 GenerationPrecheck 组件 - ✅ 导入 useStoryboards 和 useResources hooks - ✅ 根据 `videoGenerationPrecheckStoryboardId` 查找对应分镜 - ✅ 在 PreviewPanel 同级渲染浮层组件 - ✅ 传递分镜数据、资源数据和关闭回调 ### 4. StoryboardBoardTrack 点击事件 **文件**: `client/src/components/features/storyboard-board/StoryboardBoardTrack.tsx` - ✅ 移除 VideoGenerationPopover 导入 - ✅ 导入 useEditorStore 获取 `openVideoGenerationPrecheck` 方法 - ✅ 为视频轨道占位块添加 `onClick` 事件 - ✅ 点击时调用 `openVideoGenerationPrecheck(storyboardId)` ### 5. 删除冗余组件 **删除文件**: `client/src/components/features/storyboard-board/VideoGenerationPopover.tsx` 原因:功能已被 GenerationPrecheck 浮层替代,避免代码重复。 ## 技术细节 ### 浮层定位方案 使用 CSS 固定定位实现全局浮层: ```tsx {/* 遮罩层 */}
{/* 浮层内容 */}