e161ca22c4
- 删除冗余的 chat_history_repository 和 home_mock_data - 简化 ag_ui_event fromJson 使用工厂映射表 - 提取 ChatBloc 事件处理方法,添加 loadHistory/loadMoreHistory - HomeScreen 集成 ChatBloc 实现历史消息加载和下拉刷新 - 更新 AGENTS.md 文档约束
75 lines
2.3 KiB
Markdown
75 lines
2.3 KiB
Markdown
# Backlog - Known Issues & Improvements
|
|
|
|
## Database Triggers
|
|
|
|
### [TRIGGER-001] user_agents 自动创建
|
|
|
|
**Status**: Pending
|
|
**Priority**: Medium
|
|
**Created**: 2026-02-27
|
|
|
|
**Description**:
|
|
当新用户注册时,`user_agents` 表未自动创建默认 Agent 配置记录。
|
|
|
|
**Current Behavior**:
|
|
- `auth.users` → `profiles` 已有 trigger 自动创建
|
|
- `user_agents` 无自动创建机制
|
|
|
|
**Expected Behavior**:
|
|
新用户注册后,应有默认的 Agent 配置(如 INTENT_RECOGNITION、TASK_EXECUTION、RESULT_REPORTING 三种类型)。
|
|
|
|
**Impact**:
|
|
- 用户首次使用 Agent Chat 功能时可能失败
|
|
- 需要应用层手动初始化或前端引导配置
|
|
|
|
**Implementation Notes**:
|
|
- 需要先确定 `user_agents` 的默认配置设计
|
|
- 可通过 `on_auth_user_created` trigger 扩展
|
|
- 或在 `profiles` trigger 中调用
|
|
|
|
**Related Files**:
|
|
- `backend/alembic/versions/20260226_0001_initial_schema.py` (现有 trigger)
|
|
- `backend/src/models/user_agents.py`
|
|
- `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 页面
|