Skip to content

feat: allow deleting tasks from sidebar without archiving first#3568

Open
charanjot27 wants to merge 1 commit into
PostHog:mainfrom
charanjot27:feat/delete-task-from-sidebar
Open

feat: allow deleting tasks from sidebar without archiving first#3568
charanjot27 wants to merge 1 commit into
PostHog:mainfrom
charanjot27:feat/delete-task-from-sidebar

Conversation

@charanjot27

@charanjot27 charanjot27 commented Jul 19, 2026

Copy link
Copy Markdown

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 taskAction schema includes "delete", resolveTaskContextMenuIntent maps it, useTaskContextMenu handles it via deleteWithConfirm, and TaskDeletionService.confirmAndDelete shows 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 confirm option (unlike the archived-task menu's Delete), because confirmation is handled downstream by confirmDeleteTask — 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?

  • Added a unit test in packages/core/src/context-menu/context-menu.test.ts verifying the Delete item appears for active tasks and resolves { type: "delete" } without triggering an inline confirm dialog.
  • Ran pnpm vitest run src/context-menu/context-menu.test.ts in packages/core — 11/11 tests pass (10 existing + 1 new).

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

@trunk-io

trunk-io Bot commented Jul 19, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

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

@igennova

Copy link
Copy Markdown
Contributor

@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?

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.

Allow deleting tasks from the sidebar without archiving first

2 participants