Skip to content

完成任务系统重构的最后3个TODO:UI整合、实例日志区分、命令切换清空提醒 - #2

Draft
KiritoKing with Copilot wants to merge 4 commits into
mainfrom
copilot/complete-todos-in-md
Draft

完成任务系统重构的最后3个TODO:UI整合、实例日志区分、命令切换清空提醒#2
KiritoKing with Copilot wants to merge 4 commits into
mainfrom
copilot/complete-todos-in-md

Conversation

Copilot AI commented Nov 8, 2025

Copy link
Copy Markdown
Contributor

完成 TODOS.md 第12-18行"彻底重构进度/日志/任务调度系统"中的最后3个子任务:移除任务队列标签页、确保日志可区分实例来源、实现命令切换时的队列清空警告。

TODO 1: 移除标签页,整合任务面板

  • 移除 ExecutionPanel 中的 Tabs 组件
  • 任务队列直接显示在执行区域下方
  • 任务历史改为对话框,通过右上角按钮打开
  • 日志窗口保持在底部可见
// Before: Tabs with queue and history
<Tabs defaultValue="queue">
  <TabsList>
    <TabsTrigger value="queue">任务队列</TabsTrigger>
    <TabsTrigger value="history">任务历史</TabsTrigger>
  </TabsList>
  <TabsContent value="queue">...</TabsContent>
  <TabsContent value="history">...</TabsContent>
</Tabs>

// After: Direct display with history dialog
<Card>
  <Button onClick={() => setShowHistory(true)}>
    <History />任务历史
  </Button>
  {/* Queue content directly visible */}
</Card>
<Dialog open={showHistory}>
  <TaskHistoryViewer />
</Dialog>

TODO 2: 日志实例区分

现有实现已支持:

  • ProgressLogViewer 显示 instanceId(如 [worker-1][worker-2]
  • FFmpegWorkerPool 为每个实例分配唯一标识
  • 支持按实例ID搜索和筛选日志

TODO 3: 命令切换清空提醒

useFFmpegWeb 中添加检测逻辑:

const previousPresetIdRef = useRef<string | null>(null);

useEffect(() => {
  const currentId = selectedPreset?.id || null;
  const previousId = previousPresetIdRef.current;
  
  if (previousId && previousId !== currentId) {
    const hasContent = 
      queue.length > 0 || 
      executingTasks.length > 0 || 
      recentCompletedTasks.length > 0;
    
    if (hasContent) {
      setShowClearQueueConfirm(true);
    }
  }
  
  previousPresetIdRef.current = currentId;
}, [selectedPreset]);

新增 ClearQueueConfirmDialog 组件:

  • 显示等待、执行中、已完成任务的数量
  • 列出将被清空的输出文件(最多5个,超出显示省略)
  • 提供"取消切换"和"确认清空并继续"两个选项
  • 清空操作调用 taskManager.clearQueue()clearAllTaskResults()

修改的文件

  • app/components/ExecutionPanel.tsx - UI 重构
  • app/store/ffmpegWebStore.ts - 添加清空确认对话框状态
  • app/hooks/useFFmpegWeb.ts - 命令切换检测和清空逻辑
  • app/hooks/useTaskManager.ts - 导出 clearAllTaskResults
  • app/components/FFmpegDialogs.tsx - 新增 ClearQueueConfirmDialog
  • app/routes/ffmpeg-web.tsx - 集成清空确认对话框
  • TODOS.md - 标记完成状态
Original prompt

请你读取TODOS.md的内容,帮我完成下面3个todos:


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@vercel

vercel Bot commented Nov 8, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
yet-another-ffmpeg-webui Ready Ready Preview Comment Nov 8, 2025 6:41pm

- Removed Tabs component, display queue directly in execution panel
- Added "任务历史" button to open history in a dialog
- Kept ProgressLogViewer at the bottom
- Task history now opens in a modal dialog instead of a separate tab
- All type checks pass and code is properly formatted

Co-authored-by: KiritoKing <19513548+KiritoKing@users.noreply.github.com>
- Detect preset changes and check for pending tasks
- Show confirmation dialog if queue has items or completed results
- Dialog displays: waiting, executing, and completed tasks counts
- List output files that will be lost (up to 5, with "...and N more")
- Warn users to download files before clearing
- Clear queue and results only after user confirmation
- Cancel option reverts to previous preset selection
- All checks pass (type check, linting, formatting)

Co-authored-by: KiritoKing <19513548+KiritoKing@users.noreply.github.com>
Copilot AI changed the title [WIP] Complete todos from TODOS.md 完成任务系统重构的最后3个TODO:UI整合、实例日志区分、命令切换清空提醒 Nov 8, 2025
Copilot AI requested a review from KiritoKing November 8, 2025 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants