Files
Mdeical_Sur_Report/工程分析/测试方案-2026-04-19-03-19-57.md
admin 854a00c2fa fix(editor): Checkbox点击失效 + AI全局上下文注入
- 将'允许修改正文'复选框从id/htmlFor绑定改为label直接包裹input,增加e.stopPropagation防止事件冒泡被拦截
- handleAIGenerate中新增editorRef.current.innerText作为全局上下文注入prompt
- currentHtml增加过滤​零宽字符
- 优化systemPrompt,明确告知大模型全局参考内容+目标区域源码的双信息源结构
2026-04-19 03:35:52 +08:00

35 lines
1.2 KiB
Markdown
Raw 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.
# 测试方案 — 2026-04-19-03-19-57
## 1. 测试范围
- chatInput 持久化(路由切换 + 页面刷新)
- API content 格式(纯文本 vs 带图片)
## 2. 测试步骤与预期结果
### 场景 1纯文本消息修复 400
1. 进入 ReportEditor切换到 AI撰写 Tab
2. **不上传任何图片,不勾选任何关键帧**
3. 输入 "你好",按 Enter
预期Network 面板中请求体 `messages[1].content` 为字符串 `"【医生指令】: 你好"`API 返回 200
### 场景 2带图片消息Vision 格式保留)
1. 勾选至少 1 个关键帧或上传 1 张本地图片
2. 输入 "描述这张图片",按 Enter
预期Network 面板中请求体 `messages[1].content` 为数组,包含 `type: 'image_url'``type: 'text'` 两项
### 场景 3chatInput 持久化
1. 在 AI 输入框中输入一段未发送的文字(不要按 Enter
2. 切换到 `/report-manage`,再返回 `/report-editor`
预期:输入框中文字仍然存在
3. 刷新浏览器
预期:输入框中文字仍然从 draft 恢复
### 场景 4类型检查与构建
1. `npm run lint`
预期0 errors
2. `npm run build`
预期:成功
## 3. 回滚检查
- 若测试失败,执行 `git checkout main` 恢复到上一个 commit