refactor(chat): 重构聊天模块并集成历史消息加载功能
- 删除冗余的 chat_history_repository 和 home_mock_data - 简化 ag_ui_event fromJson 使用工厂映射表 - 提取 ChatBloc 事件处理方法,添加 loadHistory/loadMoreHistory - HomeScreen 集成 ChatBloc 实现历史消息加载和下拉刷新 - 更新 AGENTS.md 文档约束
This commit is contained in:
@@ -33,3 +33,42 @@
|
||||
- `backend/src/models/profile.py`
|
||||
|
||||
---
|
||||
|
||||
## Flutter Design Tokens
|
||||
|
||||
### [TOKEN-001] 大量硬编码颜色违反 AGENTS.md 规则
|
||||
|
||||
**Status**: Pending
|
||||
**Priority**: Medium
|
||||
**Created**: 2026-03-02
|
||||
|
||||
**Description**:
|
||||
`apps/AGENTS.md` 规则要求禁止硬编码颜色,必须使用 `design_tokens.dart` 中的 `AppColors`。但实际代码中存在大量硬编码。
|
||||
|
||||
**Current Behavior**:
|
||||
- `apps/AGENTS.md` 规定:"NEVER hardcode colors, sizes, or spacing values"
|
||||
- 代码中有 **109 处**硬编码 `Color(0xFF...)` 分布在:
|
||||
- `register_screen.dart`, `register_verification_screen.dart`
|
||||
- `settings_screen.dart`, `account_screen.dart`
|
||||
- `contacts_screen.dart`, `calendar_event_detail_screen.dart`
|
||||
- `add_contact_screen.dart`, `features_screen.dart`
|
||||
- `memory_screen.dart`, `home_screen.dart`
|
||||
- `todo_detail_screen.dart`
|
||||
|
||||
**Expected Behavior**:
|
||||
所有颜色应使用 `AppColors` 中定义的值。
|
||||
|
||||
**Impact**:
|
||||
- 与项目规范不一致
|
||||
- 后续 theme 统一修改困难
|
||||
- 代码审查难以发现
|
||||
|
||||
**Implementation Options****:
|
||||
1. **保守方案**:将常用硬编码颜色添加到 `AppColors`,逐步迁移
|
||||
2. **激进方案**:重构所有页面使用 tokens
|
||||
3. **规则调整**:如果某些场景确实需要硬编码(如动态颜色),修改 AGENTS.md 明确允许场景
|
||||
|
||||
**Related Files**:
|
||||
- `apps/lib/core/theme/design_tokens.dart`
|
||||
- `apps/AGENTS.md`
|
||||
- 各 feature 页面
|
||||
|
||||
Reference in New Issue
Block a user