fix(web): allow deleting non-empty projects from the warning toast#1264
fix(web): allow deleting non-empty projects from the warning toast#1264maria-rcks wants to merge 6 commits intopingdotgg:mainfrom
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
f74b447 to
b3f029d
Compare
ApprovabilityVerdict: 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. |
apps/web/src/components/Sidebar.tsx
Outdated
| for (const threadId of projectThreadIds) { | ||
| await deleteThread(threadId, { deletedThreadIds }); | ||
| } | ||
| await removeProject(projectId); |
There was a problem hiding this comment.
will this slow down the frontend? should we do it server side with some force: true flag and then do the deletions from there?
| commandId: command.commandId, | ||
| }), | ||
| { | ||
| type: "thread.deleted" as const, |
There was a problem hiding this comment.
thread.deleted is emitted when the thread has been deleted. Shouldn't this emit a thread.delete command?
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ 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.
bc591c6 to
f171346
Compare
|
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 |
f171346 to
6c3dc9c
Compare
0aa5be3 to
4721345
Compare

What Changed
Adds a
Delete anywaybutton to theProject is not emptywarning 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
forceflag to theProjectDeleteCommandschema; deleting a non-empty project without it now returns an error.force=true.thread.deletedevents for each active thread beforeproject.deleted, and a newThreadDeletionReactorbackground worker stops provider sessions and closes terminals in response.stacked-endaction layout and adestructiveaction variant to render the new warning UI.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.deletewith an optionalforceflag and updating the serverdeciderto either reject non-empty deletes (withoutforce) or plan a sequence ofthread.deletedevents followed byproject.deleted.Adds a new
ThreadDeletionReactorthat listens forthread.deleteddomain 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.deletewithforce=true, adds toast action layout/variant support, and ensures client draft state is cleared onproject.deletedwhile 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.