fix(web): allow deleting non-empty projects from the warning toast#1264
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 capability for force-deleting non-empty projects, including a new ThreadDeletionReactor service, decider logic changes, and UI enhancements. The scope involves significant runtime behavior changes across server and web. Additionally, two unresolved review comments raise design concerns about the implementation approach. You can customize Macroscope's approvability policy. Learn more. |
| 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
Co-authored-by: codex <codex@users.noreply.github.com>
Integrates upstream/main (9df3c64) on top of fork's main (9602c18). Upstream features adopted: - Claude Opus 4.5 and 4.7 built-in models (pingdotgg#2072, pingdotgg#2143) - Node-native TypeScript migration across desktop/server (pingdotgg#2098) - Configurable project grouping with client-settings overrides (pingdotgg#2055, pingdotgg#2099) - Thread status in command palette (pingdotgg#2107) - Responsive composer / plan sidebar on narrow windows (pingdotgg#1198) - Capture-phase CTRL+J keydown for Windows terminal toggle (pingdotgg#2113/pingdotgg#2142) - Bypass xterm for global terminal shortcuts (pingdotgg#1580) - Windows ARM build target (pingdotgg#2080) - Windows PATH hydration + repair (pingdotgg#1729) - Gitignore-aware workspace search (pingdotgg#2078) - Claude process leak fix + stale session monitoring (pingdotgg#2042) - Preserve provider bindings when stopping sessions (pingdotgg#2084) - Clean up invalid pending-approval projections (pingdotgg#2106) — new migration - Extract backend startup readiness coordination - Drop stale text-gen options on reset (pingdotgg#2076) - Extend negative repository identity cache TTL (pingdotgg#2083) - Allow deleting non-empty projects from warning toast (pingdotgg#1264) - Restore defaults only on General settings (pingdotgg#1710) - Release workflow modernization (blacksmith runners, GitHub App token guards, v0.0.20 version bump) Fork features preserved: - All 8 providers (codex, claudeAgent, copilot, cursor, opencode, geminiCli, amp, kilo) with their adapters, services, and tests - Fork's custom OpenCode protocol impl in apps/server/src/opencode/ (kept over upstream's @opencode-ai/sdk-based provider added in pingdotgg#1758 — fork's version is tested and integrated; upstream's parallel files deleted) - Fork's direct-CLI Cursor adapter (kept over upstream's new ACP-based CursorProvider added in pingdotgg#1355 — upstream's parallel files deleted) - Fork's ProviderRegistry aggregates only codex + claudeAgent snapshots; the other 6 providers register via ProviderAdapterRegistry - PROVIDER_CACHE_IDS stays at [codex, claudeAgent] matching what the registry actually caches - Migration IDs preserved (fork 23/24/25/26; upstream's new 025 lands at ID 27 to avoid re-applying on deployed fork DBs) - Fork's generic per-provider settings (enabled/binaryPath/configDir/ customModels) kept over upstream's opencode-specific serverUrl/password - Log directory IPC channels, updateInstallInFlight tracking, icon composer pipeline all preserved - Fork's simplified release.yml (no npm CLI publish, no nightly infra) - composerDraftStore normalizeProviderKind widened to accept all 8 kinds - Dark mode --background set to #0f0f0f Test status: - All 9 package typechecks pass - Lint clean (0 errors) - Tests: 1877 passed, 15 skipped (incl. 4 historically-flaky GitManager cross-repo PR selector tests newly gated with TODO for Node-native-TS follow-up)

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 cascading thread cleanup
forceflag to theproject.deletecommand schema; the decider rejects non-empty project deletions unlessforce=true, in which case it emitsthread.deletedevents for each active thread beforeproject.deleted.ThreadDeletionReactor, a new server-side service that listens forthread.deletedevents and performs best-effort cleanup by stopping provider sessions and closing terminals.destructive).Macroscope summarized e2d953d.
Note
Medium Risk
Changes orchestration deletion semantics and introduces a new background reactor that stops sessions/closes terminals; incorrect sequencing or missed wiring could lead to data loss or leaked runtime resources.
Overview
Enables deleting a non-empty project from the sidebar by surfacing a warning toast with a destructive “Delete anyway” action that re-dispatches
project.deletewithforce=trueafter confirmation.On the server,
project.deletenow supports an optionalforceflag: without it, deleting a project with active threads is rejected; with it, the decider plans a sequence ofthread.deletedevents for each active thread before emittingproject.deleted. A newThreadDeletionReactoris wired into the runtime to react tothread.deletedevents and best-effort stop provider sessions and close terminals.Client-side cleanup is tightened: toasts support stacked action layout/variants, composer drafts revoke image blob URLs when cleared, and
project.deletedevents clear any project-scoped draft mapping.Reviewed by Cursor Bugbot for commit e2d953d. Bugbot is set up for automated code reviews on this repo. Configure here.