docs: 添加 ag-ui 和 crewai 项目 skills 及更新文档

This commit is contained in:
qzl
2026-03-02 17:02:09 +08:00
parent 6fdbc34526
commit ca1ce3d84a
43 changed files with 56074 additions and 3 deletions
+127
View File
@@ -0,0 +1,127 @@
# 日历功能新增 Bug 记录
**Created**: 2026-03-02
**Feature**: 日历事件创建功能
**Status**: Partial (Bug 5, 7 pending)
---
## Bug 1: 日视图时间范围不完整
**Severity**: High
**Status**: Fixed
**修复内容**:
- 修改循环范围从 `for (var hour = 7; hour <= 22; hour++)` 改为 `for (var hour = 0; hour <= 23; hour++)`
- 现在日视图显示完整的 00:00-24:00 时间线
---
## Bug 2: 日历事件保存后视图不刷新
**Severity**: High
**Status**: Fixed
**修复内容**:
-`CreateEventSheet` 添加 `onSaved` 回调参数
- 在月视图和日视图中使用 `setState` + `UniqueKey` 强制刷新事件列表
- 保存后自动刷新,无需手动切换页面
---
## Bug 3: 日视图事件高度未按时间范围渲染
**Severity**: Medium
**Status**: Fixed
**修复内容**:
- 使用 `Positioned` + `Stack` 替代原来的 `Wrap` 布局
- 根据事件实际持续时间计算高度:`持续分钟数 / 60 * _hourHeight`
- 事件垂直位置根据开始时间计算:`开始分钟数 / 60 * _hourHeight`
---
## Bug 4: 月视图事件超过3个后无法显示
**Severity**: Medium
**Status**: Fixed
**修复内容**:
- 显示前 2 个事件
- 超过 2 个时显示 `+N` 按钮
- 点击 `+N` 跳转到日视图
---
## Bug 5: 日视图点击事件跳转到错误页面
**Severity**: High
**Status**: Pending
**现象描述**:
- 在日视图中点击日历事件
- 跳转到的页面不是日历详情页,而是显示了类似首页的聊天输入框
- 页面显示"输入消息..."和麦克风图标
- 路由应该是 `/calendar/events/evt_xxx` 但显示的是首页布局
**已尝试的修复**:
-`/calendar/events/:id` 路由移到最前面优先匹配
- 调试日志显示 eventId 正确传递
- 添加了 `clipBehavior: Clip.none``Material + InkWell`
**可能原因**:
- 路由配置问题,可能被其他路由或 Shell 组件影响
- 页面布局问题导致显示异常
**修复建议**:
- 检查路由配置,确认 CalendarEventDetailScreen 正确加载
- 检查页面布局是否正确渲染
---
## Bug 6: 日视图多事件重叠时布局错乱
**Severity**: Medium
**Status**: Fixed
**修复内容**:
- 使用 `_calculateEventColumns` 方法计算事件列位置
- 最早开始的事件放在最左边
- 其余事件依次向右排列,每个事件宽度 = 总宽度 / 列数
- 使用 `Positioned` 绝对定位控制事件位置
---
## Bug 7: 日历详情页布局错误
**Severity**: High
**Status**: Pending
**现象描述**:
- 点击跳转到的页面显示异常
- 页面顶部显示聊天输入框("输入消息..."和麦克风图标)
- 应该是日历详情页但显示了类似首页的布局
- 渲染错误:RenderFlex children have non-zero flex but incoming width constraints are unbounded
**已尝试的修复**:
-`_buildInputContainer` 中的 Container 添加 `width: double.infinity`
- 修改内部的 Row 使用 const
**修复建议**:
- 需要重新设计详情页布局
- 确认底部输入框组件是否需要(可能复制自其他页面)
---
## 相关文件清单
### 新增文件
- `apps/lib/features/calendar/data/models/schedule_item_model.dart` - 日历事件数据模型
- `apps/lib/features/calendar/data/services/mock_calendar_service.dart` - Mock 服务
- `apps/lib/features/calendar/ui/widgets/create_event_sheet.dart` - 创建事件底部弹窗
### 修改文件
- `apps/lib/features/calendar/ui/screens/calendar_month_screen.dart` - 月视图
- `apps/lib/features/calendar/ui/screens/calendar_dayweek_screen.dart` - 日视图
- `apps/lib/features/calendar/ui/screens/calendar_event_detail_screen.dart` - 事件详情页
- `apps/lib/core/router/app_router.dart` - 路由配置
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,100 @@
# 日历事件创建功能设计
**Date:** 2026-03-02
**Status:** Approved
---
## 1. UI 架构
### 入口
- 位置:月视图和日视图右上角
- 图标:LucideIcons.plus
- 点击后从底部弹出创建表单(showModalBottomSheet
### 底部弹窗表单
- 高度:约占屏幕 80%
- 顶部有关闭按钮和"新建日程"标题
- 内含两个可切换的 TabBar(类似苹果日历)
### 两个 Tab
| Tab | 字段 |
|-----|------|
| 基础 | 标题、开始日期/时间、结束日期/时间 |
| 进阶 | 描述、地点、颜色、备注 |
---
## 2. 数据模型
```dart
class ScheduleItemModel {
String id; // UUID
String title; // 标题(必填)
String? description; // 描述
DateTime startAt; // 开始时间(必填)
DateTime? endAt; // 结束时间
String timezone; // 时区,默认 "Asia/Shanghai"
ScheduleMetadata? metadata; // 扩展字段
String sourceType; // 来源,默认 "manual"
String status; // 状态,默认 "active"
}
class ScheduleMetadata {
String? color; // 颜色,如 "#3B82F6"
String? location; // 地点
String? notes; // 备注
List<Attachment>? attachments;
}
```
---
## 3. Mock 服务设计
参考 `mock_history_service.dart` 模式,创建 `mock_calendar_service.dart`
- 使用 `Env.isMockApi` 开关
- 内存中存储事件列表
- 支持 CRUD 操作
---
## 4. 日历视图集成
### 月视图
- `_buildWeekEvents` 遍历当天事件,显示最多 2-3 个事件标题
- 点击日期跳转到日视图
### 日视图
- `_buildTimelineBoard` 在对应时间位置显示事件块
- 点击事件进入详情页
---
## 5. 路由
现有路由已支持:
- `/calendar/month` - 月视图
- `/calendar/dayweek` - 日视图
- `/calendar/events/:id` - 事件详情页
底部弹窗使用 showModalBottomSheet,无需新路由。
---
## 6. 实现步骤
1. 创建数据模型 `schedule_item_model.dart`
2. 创建 Mock Calendar Service
3. 创建底部弹窗创建表单组件
4. 在月视图添加 + 号图标
5. 在日视图添加 + 号图标
6. 集成事件显示到月视图
7. 集成事件显示到日视图
8. 更新事件详情页支持编辑
File diff suppressed because it is too large Load Diff