Skip to content

fix(web): allow deleting non-empty projects from the warning toast#1264

Open
maria-rcks wants to merge 6 commits intopingdotgg:mainfrom
maria-rcks:fix/web-project-delete-anyway
Open

fix(web): allow deleting non-empty projects from the warning toast#1264
maria-rcks wants to merge 6 commits intopingdotgg:mainfrom
maria-rcks:fix/web-project-delete-anyway

Conversation

@maria-rcks
Copy link
Copy Markdown
Collaborator

@maria-rcks maria-rcks commented Mar 21, 2026

What Changed

Adds a Delete anyway button to the Project is not empty warning toast.

Clicking it closes the toast, asks for confirmation, then deletes the project's threads and removes the project.

closes #665

Why

Right now the warning blocks project deletion without giving you a way to continue.

This keeps the fix small and makes the warning actionable.

Video

Screen.Recording.2026-03-20.at.9.56.38.PM.mov

Note

Allow force-deleting non-empty projects from the sidebar with a warning toast

  • Adds a force flag to the ProjectDeleteCommand schema; deleting a non-empty project without it now returns an error.
  • When a user tries to delete a project with threads, the sidebar shows a warning toast with a 'Delete anyway' destructive action that re-dispatches with force=true.
  • On force-delete, the server plans thread.deleted events for each active thread before project.deleted, and a new ThreadDeletionReactor background worker stops provider sessions and closes terminals in response.
  • Toasts gain support for stacked-end action layout and a destructive action variant to render the new warning UI.
  • On project.deleted, the client's composer draft store clears any draft thread associated with the deleted project and revokes image preview blob URLs.

Macroscope summarized 4721345.


Note

Medium Risk
Touches orchestration deletion semantics and adds a new background reactor that performs best-effort runtime cleanup on thread.deleted, which could impact data consistency and shutdown behavior if incorrect. Changes are scoped and covered by new unit tests, but affect core lifecycle flows for projects/threads.

Overview
Enables force-deleting non-empty projects by extending project.delete with an optional force flag and updating the server decider to either reject non-empty deletes (without force) or plan a sequence of thread.deleted events followed by project.deleted.

Adds a new ThreadDeletionReactor that listens for thread.deleted domain events and performs best-effort cleanup (stop provider sessions, close/delete terminals), and wires it into the server runtime and orchestration reactor startup (with updated tests/harness stubs).

Updates the web sidebar delete flow to show a warning toast with a destructive "Delete anyway" action that re-dispatches project.delete with force=true, adds toast action layout/variant support, and ensures client draft state is cleared on project.deleted while revoking draft image blob URLs.

Reviewed by Cursor Bugbot for commit 4721345. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 21, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: ed56c844-c8ff-4e98-99cb-d216ce4cd1ff

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Mar 21, 2026
@maria-rcks maria-rcks force-pushed the fix/web-project-delete-anyway branch from f74b447 to b3f029d Compare April 6, 2026 19:17
@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp bot commented Apr 6, 2026

Approvability

Verdict: Needs human review

This PR introduces a new feature for force-deleting non-empty projects, including a new ThreadDeletionReactor service, cascade deletion logic, and UI workflow changes. Two unresolved review comments question the architectural approach and event semantics, requiring human review to resolve design concerns.

You can customize Macroscope's approvability policy. Learn more.

Comment on lines +1279 to +1282
for (const threadId of projectThreadIds) {
await deleteThread(threadId, { deletedThreadIds });
}
await removeProject(projectId);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will this slow down the frontend? should we do it server side with some force: true flag and then do the deletions from there?

@maria-rcks
Copy link
Copy Markdown
Collaborator Author

@juliusmarminge

commandId: command.commandId,
}),
{
type: "thread.deleted" as const,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thread.deleted is emitted when the thread has been deleted. Shouldn't this emit a thread.delete command?

Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 526ca72. Configure here.

@maria-rcks maria-rcks force-pushed the fix/web-project-delete-anyway branch from bc591c6 to f171346 Compare April 7, 2026 00:00
@rookmate
Copy link
Copy Markdown

rookmate commented Apr 9, 2026

Would love to get this in the next version. My current work involves going into multiple projects to do multiple one-of tasks in each project and this would help me clean the project tree easily of older projects

@maria-rcks maria-rcks force-pushed the fix/web-project-delete-anyway branch from f171346 to 6c3dc9c Compare April 10, 2026 01:53
@maria-rcks maria-rcks force-pushed the fix/web-project-delete-anyway branch from 0aa5be3 to 4721345 Compare April 10, 2026 17:09
@github-actions github-actions bot added size:XXL 1,000+ changed lines (additions + deletions). size:L 100-499 changed lines (additions + deletions). and removed size:L 100-499 changed lines (additions + deletions). size:XXL 1,000+ changed lines (additions + deletions). labels Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Option to delete non-empty Project

3 participants