feat(qml): task #17 任务队列 sidebar 接 taskQueue.model
MainWindow.qml sidebar 改造: - header: 加 "N 进行中" 计数(绑定 taskQueue.runningCount + pendingCount,0 时隐藏) - ListView model: 硬编码 ListModel → taskQueue.model(_TaskListModel QAbstractListModel) - 空态占位: "暂无任务"(visible: count === 0) - delegate 改造,56px 高 ColumnLayout 三行: 1. prompt 摘要(>14 字省略) 2. 状态彩色文字(pending=橙 / running=蓝 / completed=绿 / failed=红) + 耗时 3. 进行中任务的细进度条(高 2px,绑 progress 0-1) - delegate 用 required property 声明 6 个 role:taskId / prompt / status / progress / statusText / elapsed - 右键点击 pending/running 任务 → taskQueue.cancelTask(taskId) 至此 生成 → sidebar → 历史 闭环完整: - 用户在图片生成 tab 点 "生成图片" → ImageGenBridge.submitTask - TaskQueueManager 信号 → TaskQueueBridge._on_task_added → upsert 进 model - sidebar ListView 自动渲染新行,状态文字 + 进度条同步 - 完成后 ImageGenBridge → HistoryBridge.addNew,历史 tab 也会增量 视觉验证:QML_AUTO_LOGIN=1 启动主窗口,空态正确显示"暂无任务",UI 无回归。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Showing
1 changed file
with
104 additions
and
20 deletions
-
Please register or sign in to post a comment