ooodc a7883dbed9 refactor(todo): 重构待办事项管理逻辑及更新状态规则
- 移除 TodoItem 中的 priority、created_at 和 updated_at 字段
- 强制每个任务都必须有唯一 id,且由用户负责生成
- 修改合并模式逻辑,merge=true 下保留未提及的旧任务
- 支持已完成和已取消任务重新激活(状态改回 pending 或 in_progress)
- 禁止 in_progress 状态退回到 pending,必须标记为 completed 或 cancelled
- 优化状态转换校验,允许特定状态间合法切换
- 简化任务变更消息,移除详细的新增/更新/移除统计
- 更新文档和示例,明确 id 必须由用户生成和使用
- 修复和补充测试,增强状态转换和合并模式验证
- 调整任务时间戳生成逻辑,统一使用当前时间及索引
- 该变更提供更合理的任务状态机械及管理模式,提升稳定性和易用性
2026-06-13 09:22:33 +08:00

74 lines
2.1 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.

# 排版规则
## 字号层级表
| 层级 | 字号 | 用途 | 对齐 |
|------|------|------|------|
| H1 | 24-28 | 图表标题(每图一个) | center |
| H2 | 18-20 | 分区/层标签 | right侧标签或 center顶部标签 |
| H3 | 15-16 | 分组标题、卡片标题 | center 或 left |
| Body | 14 | 正文、节点文字 | center短标签或 left长文本 |
| Caption | 13 | 辅助说明、注解 | left |
规则:
- 同张图不超过 3 个字号层级
- 同级节点 fontSize 必须完全相同
- 相邻层级字号差 >= 4px
---
## 对齐规则
Shape 节点默认 `textAlign: 'center'` + `verticalAlign: 'middle'`(与 CSS 相反)。如需左对齐须显式声明。
| 内容类型 | 对齐方式 |
|---------|---------|
| 短文本(<=15 字) | center |
| 长文本(>15 字) | left |
| 侧标签(层名、分区名) | right |
| 图表标题 | center |
| 多行描述/段落 | left |
---
## 图表标题
用独立 text 节点,不要用 frame 的 `title` 属性。
- Flex 布局:放在最外层 frame 的第一个 child`width: "fill-container"`
- 绝对定位width 设为图表整体宽度,`textAlign: "center"`
---
## 标题和描述拆成两个节点
一个卡片内展示名称和描述时,用 frame 包两个 text 节点,不要塞进同一个 shape
```json
{
"type": "frame", "layout": "vertical", "gap": 4, "padding": 12,
"width": "fill-container", "height": "fit-content",
"borderWidth": 2, "borderRadius": 8,
"children": [
{ "type": "text", "width": "fill-container", "height": "fit-content",
"text": "用户服务", "fontSize": 16 },
{ "type": "text", "width": "fill-container", "height": "fit-content",
"text": "处理注册登录和个人信息管理", "fontSize": 13 }
]
}
```
---
## 图标+文字组合
icon + text 纵向排列时icon 宽高 36-48px下方文字 fontSize 12-13外层 frame gap 4-8。icon 比文字大 2-3 倍时视觉比例最佳。
---
## 尺寸规则
含文字节点 `height` 必须用 `'fit-content'`。写死高度会截断文字。
所有节点必须显式声明 `width``height`