fix: repair failed knowledge-base document UI

This commit is contained in:
Codex
2026-05-03 07:27:53 +08:00
parent b5e3527eb2
commit 0f2268155c
9 changed files with 459 additions and 15 deletions
@@ -0,0 +1,83 @@
# 完整自动化测试报告修复记录(2026-05-03)
## 对应报告
- `project-docs/完整自动化测试报告-2026-05-03.md`
## 已修复问题
### 1. 知识库 failed 文档未稳定暴露恢复入口
已修复:
- `frontend/src/app/knowledge-bases/page.tsx`
处理方式:
- 新增 failed 文档恢复区。
- 失败文档按优先级前置展示。
- `重试处理` 按失败态兜底渲染,不再只依赖 `retryable` 单字段。
### 2. failed 文档 Chat 入口禁用态不稳定
已修复:
- `frontend/src/app/knowledge-bases/page.tsx`
- `frontend/src/app/globals.css`
处理方式:
- 增加统一的 failed / retryable / ready 判断。
- failed 文档的 `审查要点` / `继续问答` 强制显示为禁用态。
- 点击禁用态时给出明确原因提示。
### 3. 自动化脚本默认健康检查口径不准确
已修复:
- `frontend/scripts/phase1-closed-loop-e2e.mjs`
- `frontend/scripts/phase2-closed-loop-e2e.mjs`
- `frontend/scripts/phase3-closed-loop-e2e.mjs`
处理方式:
- 不再从前端入口反推 `/health`
- 改为显式默认后端:
- API:`http://127.0.0.1:8000/api/v1`
- Health:`http://127.0.0.1:8000/health`
- Readiness:`http://127.0.0.1:8000/api/v1/system/readiness`
### 4. 缺少知识库 failed 文档专项前端回归
已新增:
- `frontend/scripts/knowledge-base-failed-document-ui-e2e.mjs`
- `frontend/package.json`
- `scripts/run-production-regression.ps1`
处理方式:
- 新增独立专项 E2E:
- 创建知识库
- 上传成功文档
- 上传 failed 文档
- 打开知识库页面
- 验证恢复区、重试按钮、Chat 禁用态
- 并接入 `run-production-regression.ps1`
## 验证结果
已完成:
- `frontend/npm.cmd run lint`
- `frontend/npm.cmd run build`
结果:
- `lint` 通过
- `build` 通过
说明:
- 本次修复已完成前端静态校验与生产构建校验。
- 未在本地再跑完整浏览器 E2E,因为当前回归脚本依赖目标环境与管理员口令。