Skip to content

feat(desktop): warn that deleting a parent keeps and archives its subtasks - #3781

Open
liuxiaocs7 wants to merge 1 commit into
apache:mainfrom
liuxiaocs7:feat/delete-confirm-subtask-notice
Open

feat(desktop): warn that deleting a parent keeps and archives its subtasks#3781
liuxiaocs7 wants to merge 1 commit into
apache:mainfrom
liuxiaocs7:feat/delete-confirm-subtask-notice

Conversation

@liuxiaocs7

@liuxiaocs7 liuxiaocs7 commented Aug 25, 2026

Copy link
Copy Markdown
Member

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 delete confirm now appends how many subtasks will be kept and moved to Archived when the count is non-zero.
  • The completion toast reports how many subtasks were moved.

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 by sessionRevisionFamilyId). Copy lives in shell-copy.ts (zh + en). A restore that calls the delete off shows no subtask notice, since nothing moved.

Fixes #3780

Verification

  • npx biome lint on the four changed files — clean.
  • tsc -p tsconfig.main.json --noEmit and tsc -p tsconfig.renderer.json --noEmit — both pass.
  • Unit 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.
  • e2e parent-session-deletion.spec.ts — extended to assert the confirm names the subtask; not run in this environment (needs the Electron build + Playwright). Run with npm --workspace @maka/desktop run e2e -- parent-session-deletion.

Screenshots

Delete confirm — now warns the linked subtasks are kept and archived:

01-delete-confirm-dialog

Completion toast — reports how many subtasks moved to Archived:

02-deleted-toast

AI use

Select exactly one:

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: Claude Code — traced the delete/archive path, wrote the copy, the countArchivableSubtasks helper, the wiring in deleteSession, and the unit/e2e coverage. Commit carries a Generated-by: Claude Code trailer.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deleting a parent task gives no warning that its subtasks are kept and archived

1 participant