- Create .fixes/ directory structure for tracking repairs - Add FIX-001 to FIX-009 repair tasks based on Cursor review - Add automation scripts (start-fix.sh, complete-fix.sh) - Update HEARTBEAT.md with repair checklist - Create AUTOMATION_PLAN.md with workflow documentation Fixes address: - Remove fake initial data - Add clear chat button - Split oversized component - Optimize multi-image upload - Fix scroll behavior - Remove dead code - Extract hardcoded config
33 lines
748 B
Markdown
33 lines
748 B
Markdown
# FIX-003: 拆分单文件组件
|
|
|
|
**状态**: 待开始
|
|
**创建时间**: 2026-02-28
|
|
**优先级**: 高
|
|
**负责人**: msh-agent
|
|
|
|
---
|
|
|
|
## 问题描述
|
|
|
|
`ai-nutritionist.vue` 单文件超过 550 行,包含聊天、语音、图片、状态管理等多个功能模块,可维护性差。
|
|
|
|
---
|
|
|
|
## 修复方案
|
|
|
|
拆分为以下组件:
|
|
- `components/ai-chat/ChatMessage.vue` - 消息气泡
|
|
- `components/ai-chat/ChatInput.vue` - 输入框
|
|
- `components/ai-chat/VoiceRecorder.vue` - 语音录制
|
|
- `components/ai-chat/ImageUploader.vue` - 图片上传
|
|
|
|
---
|
|
|
|
## 实施步骤
|
|
|
|
- [ ] 1. 备份原文件
|
|
- [ ] 2. 创建 `components/ai-chat/` 目录
|
|
- [ ] 3. 逐个提取组件
|
|
- [ ] 4. 在主文件引入组件
|
|
- [ ] 5. 测试所有功能正常
|