diff --git a/progress.md b/progress.md index ef22e69..08c3ced 100644 --- a/progress.md +++ b/progress.md @@ -138,6 +138,11 @@ | 2026-05-25 | `pnpm build` | PASS | Phase 5 unknown enum 修复后前端构建通过 | | 2026-05-25 | `go test ./...` | PASS | Phase 5 unknown enum 修复未改 Go 行为;全量 Go 回归通过 | | 2026-05-25 | `git diff --check` | PASS | Phase 5 unknown enum 修复 whitespace 检查通过 | +| 2026-05-25 | `pnpm test` | FAIL | TDD 红灯:`in_progress` workflow phase 被过滤,返回 0 个阶段 | +| 2026-05-25 | `pnpm test` | PASS | 未知 workflow phase status 保留显示,label 为“未知”;共 10 个前端单测通过 | +| 2026-05-25 | `pnpm build` | PASS | Phase 5 unknown workflow phase 修复后前端构建通过 | +| 2026-05-25 | `go test ./...` | PASS | Phase 5 unknown workflow phase 修复未改 Go 行为;全量 Go 回归通过 | +| 2026-05-25 | `git diff --check` | PASS | Phase 5 unknown workflow phase 修复 whitespace 检查通过 | ## Bug Loop @@ -163,3 +168,4 @@ | 5 | workflow phases 会把 `task_plan.md` 里错误记录表的 `Time/Phase` 行显示到 UI | normalizer 过滤非阶段状态,并把数字阶段名转为“阶段 N” | `pnpm test` PASS | | 5 | valid agent 状态只显示“已读取”,且工作流/智能体可见文案残留内部英文 | normalizer 改为“TOML 有效”/“TOML 无效”,角色设定字段改中文,WorkflowView 改“交接边”和“主智能体” | `pnpm test` PASS | | 5 | 未知后端枚举值可通过 source/confidence/status/trust label 暴露到 UI | 未知 source 显示“来源未知”,未知 confidence 显示“低”,未知 status/trust 显示“未知” | `pnpm test` PASS | +| 5 | 未知 workflow phase status 被白名单过滤,真实阶段从 UI 消失 | phase 过滤改为只排除表头/伪行,未知 status 交给中文状态兜底显示“未知” | `pnpm test` PASS | diff --git a/task_plan.md b/task_plan.md index ebc439f..3ca180e 100644 --- a/task_plan.md +++ b/task_plan.md @@ -38,3 +38,4 @@ | 2026-05-25 | 5 | 规格复审发现 UI 残留英文 `agent` 和 `Codex home` | 改为“智能体”和“Codex 主目录”,并补中文文案测试 | 待复审 | | 2026-05-25 | 5 | 规格审查发现 valid agent 未明确显示 TOML 状态,且 UI 仍有 `handoffEdges`、`主 agent`、`developer_instructions` 可见文案 | TDD 补 valid agent 状态和 workflow 空交接文案测试后修复 normalizer 与 WorkflowView 文案 | 待复审 | | 2026-05-25 | 5 | 代码质量审查发现未知后端枚举值会直接暴露到 UI | TDD 补 unknown source/confidence/status/trust 测试后将未知 label 统一降级为中文兜底 | 待复审 | +| 2026-05-25 | 5 | 质量复审发现未知 workflow phase status 会导致真实阶段被过滤消失 | TDD 补 `in_progress` phase 测试后只过滤表头/伪行,未知状态显示“未知” | 待复审 | diff --git a/web/src/api/normalizers.js b/web/src/api/normalizers.js index 70951cf..5805f95 100644 --- a/web/src/api/normalizers.js +++ b/web/src/api/normalizers.js @@ -48,8 +48,6 @@ const TRUST_LABELS = { unknown: '未知', } -const PHASE_STATUSES = new Set(['blocked', 'complete', 'done', 'failed', 'pending', 'running', 'unknown']) - export function formatSourceKind(kind) { if (!kind) { return '来源未知' @@ -308,7 +306,18 @@ function quote(value) { } function isDisplayPhase(phase) { - return PHASE_STATUSES.has(phase?.status || 'unknown') + const name = String(phase?.name ?? '').trim().toLowerCase() + const status = String(phase?.status ?? '').trim().toLowerCase() + if (!name) { + return false + } + if (name === 'phase' || status === 'status') { + return false + } + if (name === 'time' && status === 'phase') { + return false + } + return true } function normalizePhaseName(name) { diff --git a/web/src/api/normalizers.test.mjs b/web/src/api/normalizers.test.mjs index fa03cdf..3a16d3d 100644 --- a/web/src/api/normalizers.test.mjs +++ b/web/src/api/normalizers.test.mjs @@ -149,3 +149,18 @@ test('filters non-phase rows from workflow phase display', () => { assert.equal(workflow.phases[0].name, '阶段 5') assert.equal(workflow.phases[0].label, '待处理') }) + +test('keeps workflow phases with unknown backend status visible', () => { + const workflow = normalizeWorkflow({ + items: [], + handoffEdges: [], + phases: [ + { name: '5', status: 'in_progress', source: { kind: 'plan_file', confidence: 'medium' } }, + ], + source: { kind: 'plan_file', confidence: 'medium' }, + }) + + assert.equal(workflow.phases.length, 1) + assert.equal(workflow.phases[0].name, '阶段 5') + assert.equal(workflow.phases[0].label, '未知') +})