feat(desktop): warn that deleting a parent keeps and archives its subtasks - #3781
Open
liuxiaocs7 wants to merge 1 commit into
Open
feat(desktop): warn that deleting a parent keeps and archives its subtasks#3781liuxiaocs7 wants to merge 1 commit into
liuxiaocs7 wants to merge 1 commit into
Conversation
…tasks Deleting a parent task permanently removes it but intentionally archives its ordinary linked subagent subtasks rather than cascade-deleting them (apache#1467 / apache#3151). The confirm said nothing about this, so the archived rows that appeared afterwards read as tasks from nowhere. The delete confirm now names how many subtasks will be kept and moved to the archive, and the completion toast reports how many moved. The count is a renderer estimate off the live catalog, matching the Host's removal plan: ordinary subagents count, Agent Graph operators do not, already archived children do not, and revisions of one child count once. Deletion semantics are unchanged. Generated-by: Claude Code
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.
Summary
Deleting a parent task permanently removes it, but its ordinary linked subagent subtasks are intentionally kept and moved to the archive rather than cascade-deleted (#1467 / #3151 — each subtask owns its own transcript, artifacts, and outputs). The delete confirm never said so and the completion gave no feedback, so the archived rows that appeared next — labelled
原父任务已删除on Settings › 活动 › 已归档任务 — read as tasks from nowhere.This adds two notices, without touching deletion semantics:
The count is a renderer estimate off the live catalog in
countArchivableSubtasks(app-shell-session-row-actions.ts), matching the Host's removal plan (session-retirement-coordinator.ts#readRemovalPlanSessionIds): ordinary subagents count, Agent Graph operators (subagentParent.graph) do not, already archived children do not, and revisions of one child count once (deduped bysessionRevisionFamilyId). Copy lives inshell-copy.ts(zh + en). A restore that calls the delete off shows no subtask notice, since nothing moved.Fixes #3780
Verification
npx biome linton the four changed files — clean.tsc -p tsconfig.main.json --noEmitandtsc -p tsconfig.renderer.json --noEmit— both pass.app-shell-session-row-actions-revisions.test.ts— 4/4 pass, including new cases: count excludes graph operators / archived / other parents and dedupes revisions; no notice when there are no subtasks; no notice when a concurrent restore calls the delete off.parent-session-deletion.spec.ts— extended to assert the confirm names the subtask; not run in this environment (needs the Electron build + Playwright). Run withnpm --workspace @maka/desktop run e2e -- parent-session-deletion.Screenshots
Delete confirm — now warns the linked subtasks are kept and archived:
Completion toast — reports how many subtasks moved to Archived:
AI use
Select exactly one:
Tool(s) and scope: Claude Code — traced the delete/archive path, wrote the copy, the
countArchivableSubtaskshelper, the wiring indeleteSession, and the unit/e2e coverage. Commit carries aGenerated-by: Claude Codetrailer.Checklist
Does this PR entail a change in behavior?