新增: 父子任务支持(数据→后端→前端全链路,会话前基线收尾)

- df-nodes task_advance_node(父聚合推进)+ task.rs 命令(create parent_id 支持/delete 级联软删子任务)+ task_graph 工具

- 前端 Tasks 树形列表(折叠箭头/子进度徽章/缩进)+ 新建弹窗父任务下拉 + TaskDetail 父面包屑/子任务面板

- 设计文档: 父子任务支持设计-2026-08-04
This commit is contained in:
lxy
2026-08-05 22:15:01 +08:00
parent 71fdaac1b4
commit 28de5d6143
13 changed files with 1097 additions and 307 deletions
+14 -2
View File
@@ -22,7 +22,17 @@ export function createTasksStore() {
})
}
async function createTask(input: { project_id: ProjectId; title: string; description?: string; priority?: number; branch_name?: string; assignee?: string; idea_id?: string }) {
async function createTask(input: {
project_id: ProjectId
title: string
description?: string
priority?: number
branch_name?: string
assignee?: string
idea_id?: string
/** 父任务 ID(1 级嵌套,可空);传空串后端视为 None */
parent_id?: string | null
}) {
const record = await runWithCatch(state, t('tasks.err.createFailed'), async () => {
const r = await taskApi.create(input)
state.tasks.push(r)
@@ -43,8 +53,10 @@ export function createTasksStore() {
async function deleteTask(id: string) {
await runWithCatch(state, t('tasks.err.deleteFailed'), async () => {
// 后端已级联软删子任务(delete_task 返回 { ok, cascaded });
// 本地同步移除父任务 + 其直接子任务(1 级嵌套,防悬挂 parent_id)
await taskApi.delete(id)
state.tasks = state.tasks.filter(t => t.id !== id)
state.tasks = state.tasks.filter(t => t.id !== id && t.parent_id !== id)
})
}