Repository navigation
feat(task): 多层嵌套子任务(v2.1 切片) - #17
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
为任务实现多层嵌套子任务(真·完整任务,非轻量检查项),对应路线图中的「多层子任务」方向(
docs/post-v1-iteration-design.md第 13 节)。数据模型(迁移 0022)
tasks.parent_id自引用(邻接表)+tasks.child_order同父兄弟排序 +idx_tasks_parent_active索引task_tree_expanded表:树形展开状态数据库持久化(默认展开)核心行为
list_id保持不变变更清单
后端(
src-tauri)0022_task_subtasks.sql;TASK_ROW_SELECT/map_task_row扩展两列;schema 断言 21→22TaskService:create_task(parent_id)、set_task_parent(循环/深度/活跃校验)、reorder_subtasks、query_tree(匹配集 + 祖先/后代闭包)、delete_task_tree、tree_expanded_list/set_tree_expanded、完成聚合与归档级联task_query_tree/task_set_parent/task_reorder_subtasks/task_delete_tree/task_tree_expanded_list/task_set_tree_expandedAppSettings新增subtaskAutoCompleteParent/subtaskCascadeChildren(serde 默认 true,旧数据兼容)CreateTaskInput调用点补充parent_id: None(机械改动)前端(
src)TasksPage:清单视图切树形渲染(缩进/chevron/进度徽标 x/y)、dnd 归巢与同父重排、展开状态读写taskTree.ts纯函数(buildForest/flattenVisible/siblingIds,孤儿根防御)+ 单测TaskDetailPanel+SubtaskSection:列表/添加/勾选/改名/上下移/删除处置/点开子任务详情;完成后冻结只读(与检查项一致)SettingsPage:子任务区块两个开关ipc/client.ts:类型与绑定同步验证
cargo test --lib:179 通过(新增 12 个子任务单测:创建继承/深度上限/循环防护/聚合默认/开关关闭/归档级联/删除处置/树闭包/兄弟排序/展开状态)pnpm typecheck/pnpm build:通过pnpm test:unit:46 通过(含 4 个树纯函数测试)eval_provider_key_stays_outside_database_and_settings(AI 探针网络可达性,main 上同样失败,与本 MR 无关)范围外(注记)