feat: allow deleting tasks from sidebar without archiving first#3568
feat: allow deleting tasks from sidebar without archiving first#3568charanjot27 wants to merge 1 commit into
Conversation
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
|
@charanjot27 Can you share a quick video of how delete works after this? Also: removing the inline confirm here looks right if confirmation is now in TaskDeletionService, but I don’t think this PR is enough on its own. Deleting from the context menu still won’t remove the row from the sidebar immediately — the sidebar is driven by workspace/query cache, and that doesn’t get updated optimistically on delete. Can you also fix the sidebar so the task disappears right away (optimistic update / invalidate the right query keys), not only after a refetch? |
Problem
Closes #3555
Deleting an active task from the sidebar currently requires archiving it first (right-click → Archive → open Archived → right-click → Delete). For a "I'm done, get this out of my list" cleanup flow, the archive detour is unnecessary friction. Tools like Cursor expose Delete directly in the sidebar context menu.
Changes
Adds a Delete item to the task sidebar right-click menu, placed after "Archive prior tasks".
The diff is only +15 lines because the delete pipeline already exists end-to-end: the
taskActionschema includes"delete",resolveTaskContextMenuIntentmaps it,useTaskContextMenuhandles it viadeleteWithConfirm, andTaskDeletionService.confirmAndDeleteshows a worktree-aware confirmation dialog, unpins the task, navigates away if the task is open, deletes the worktree when present, and removes the task. This PR just exposes the menu item.Design note: the item deliberately has no inline
confirmoption (unlike the archived-task menu's Delete), because confirmation is handled downstream byconfirmDeleteTask— an inline confirm would double-prompt the user. The added test uses a cancelling dialog to lock in this behavior.How did you test this?
packages/core/src/context-menu/context-menu.test.tsverifying the Delete item appears for active tasks and resolves{ type: "delete" }without triggering an inline confirm dialog.pnpm vitest run src/context-menu/context-menu.test.tsinpackages/core— 11/11 tests pass (10 existing + 1 new).Automatic notifications