+
+
📦 批量处理进度
+ {batchId}
+
+
+
+
+
+
+
+
+
+
+
+ {progress.currentTasks.length > 0 && (
+
+ )}
+
+ {progress.failures.length > 0 && (
+
+ )}
+
+
+
+
+
+
+
+ {progress.estimatedTimeRemaining && (
+
预计剩余时间: {formatDuration(progress.estimatedTimeRemaining)}
+ )}
+
+ )
+}
+```
+
+### 4.2 通知设计
+
+#### 进度通知
+
+```typescript
+interface BatchNotification {
+ // 开始通知
+ onStart: () => {
+ title: "批量任务已开始"
+ message: `正在处理 ${totalFiles} 个文件`
+ buttons: ["查看进度", "后台运行"]
+ }
+
+ // 进度更新(每 N 个文件)
+ onProgress: (
+ completed: number,
+ total: number,
+ ) => {
+ title: "批量任务进度"
+ message: `已完成 ${completed}/${total} (${percentage}%)`
+ silent: true // 不打扰用户
+ }
+
+ // 完成通知
+ onComplete: (result: BatchResult) => {
+ title: "批量任务完成"
+ message: `成功: ${result.successCount}, 失败: ${result.failedCount}`
+ buttons: ["查看报告", "关闭"]
+ }
+
+ // 错误通知
+ onError: (error: string) => {
+ title: "批量任务失败"
+ message: error
+ buttons: ["查看详情", "重试"]
+ }
+}
+```
+
+#### VSCode 通知实现
+
+```typescript
+class BatchNotificationService {
+ async notifyStart(batchId: string, totalFiles: number): Promise