AgentEvalTool/.scratch/v0.8/issues/03-report-drawer-comparison-section.md
sinohqb dd3b9a5e91 refactor(comparison): 评审修复 — 共享 gateway_chat_client、指标元表、对比区块组件化
- analysis/comparison 重复的 _gateway_chat_client 提取为共享 gateway_chat_client
- Campaigns.tsx 周期对比区块抽为 PeriodComparisonSection 组件,指标格式化
  收敛为单一 METRICS 元表(消除三处 metric 分支级联)
- 基线下拉排除无 completed_at 的终态活动(选中必 400)
- spec/issue 03 追认 delta 按好坏着色口径与 GET 生效基线合并口径
2026-08-03 14:26:20 +08:00

17 lines
1.7 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 03 — 报告抽屉「周期对比」区块
**What to build:** 报告抽屉在「智能分析」之下新增「周期对比」区块。状态行生成中spinner + 5s 轮询)、失败(错误原因 + 重试、未生成「生成对比」按钮无自动基线时显示基线选择器——同对象历史终态活动下拉选定后生成。已生成依次渲染趋势徽章improving 绿 / stable 蓝 / regressing 红)+ 总结 → 指标变化表(整窗行 + 分场景行delta 按好坏着色——比率升为绿、时延降为绿反之红、None 显示 —)→ 问题演化列表(新增红 / 持续橙 / 消解绿 Tag + 标题 + 说明 + 场景 Tag→ 建议追踪(已落实绿 / 部分橙 / 未落实灰 / 新增蓝)。展示基线活动名与完成时间、所用分析模型名与生成时间。生成按钮仅终态活动可用。
**Blocked by:** 02API 与结果结构)
**Status:** done
- [x] `api.ts`:对比类型 + `getComparison` / `generateComparison(id, baselineId?)`
- [x] 区块按状态渲染(生成中轮询复用 `usePolling`
- [x] 已生成渲染:趋势徽章 + 总结 / 指标 delta 表(按好坏着色)/ 问题演化 Tag / 建议追踪状态
- [x] 无自动基线时的基线选择器(同对象终态活动下拉)
- [x] 基线活动名 + 完成时间 + 模型名 + 生成时间展示;按钮终态门控
- [x] `npx tsc --noEmit` + `npm run build` 通过;浏览器实操验证
(注:本会话无浏览器工具,以 `curl` 对 8010 端口本地后端做了 GET 端点冒烟:
无基线活动返回 `{"status":"none",...}`、未知活动 404交互式浏览器验证待用户本地确认