feat: 增强任务进度透明化
This commit is contained in:
@@ -1130,6 +1130,29 @@ feat: 增强任务进度和运行阶段展示
|
||||
|
||||
- 是否需要显示“预计剩余时间”。如果需要,建议第一版只显示粗略区间,不做精确倒计时,避免误导。
|
||||
|
||||
完成记录:
|
||||
|
||||
- 完成日期:2026-07-03
|
||||
- 相关改动:
|
||||
- 任务详情页新增运行时长、最近进度相对时间、热点 / 评论 / 报告数量和默认规模耗时提示。
|
||||
- `GET /api/tasks/{task_id}` 新增运行秒数、最近进度秒数、中文时长文案、长时间无进度布尔值和 10 分钟阈值。
|
||||
- running 任务超过 10 分钟无进度更新时,页面展示“可能仍在等待外部接口或 AI 响应”的提示。
|
||||
- 兼容 SQLite 读出的无时区 datetime,避免运行时长计算因 naive / aware datetime 混用报错。
|
||||
- 验证命令:
|
||||
- `docker cp app/. hot-comments-tool-app-1:/app/app/`
|
||||
- `docker cp tests/. hot-comments-tool-app-1:/app/tests/`
|
||||
- `docker exec hot-comments-tool-app-1 sh -lc 'python -m pytest /app/tests/integration/test_routes.py::test_running_task_detail_page_shows_stage_runtime_and_stale_progress_warning /app/tests/integration/test_routes.py::test_task_api_includes_runtime_and_stale_progress_fields -q'`
|
||||
- `docker exec hot-comments-tool-app-1 sh -lc 'python -m pytest /app/tests/integration/test_routes.py -q'`
|
||||
- 验证结果:
|
||||
- WO-13 聚焦测试:`2 passed, 1 warning`
|
||||
- 路由集成测试:`21 passed, 1 warning`
|
||||
- 验收结论:
|
||||
- 用户无需打开日志即可看到任务当前阶段、运行时长、最近进度、热点 / 评论 / 报告数量和长时间无更新提示。
|
||||
- 本轮不显示精确预计剩余时间,只显示非承诺式耗时说明,避免误导。
|
||||
- 遗留问题:
|
||||
- 轮询接口失败时的前端可见同步失败提示仍归入 WO-19。
|
||||
- 当前仍通过运行容器执行测试,本机 `.venv` 依赖未恢复。
|
||||
|
||||
### WO-14 Demo 数据保留与新任务并存体验
|
||||
|
||||
优先级:P0
|
||||
|
||||
Reference in New Issue
Block a user