Skip to content

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

Merged
juliusmarminge merged 7 commits intopingdotgg:mainfrom
maria-rcks:fix/web-project-delete-anyway
Apr 17, 2026
Merged

fix(web): allow deleting non-empty projects from the warning toast#1264
juliusmarminge merged 7 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 cascading thread cleanup

  • Adds a force flag to the project.delete command schema; the decider rejects non-empty project deletions unless force=true, in which case it emits thread.deleted events for each active thread before project.deleted.
  • The sidebar now shows a warning toast with a destructive 'Delete anyway' action for non-empty projects, triggering a confirmation dialog before dispatching a forced delete.
  • Introduces ThreadDeletionReactor, a new server-side service that listens for thread.deleted events and performs best-effort cleanup by stopping provider sessions and closing terminals.
  • Draft thread state and image blob URLs associated with the project are cleared when the project is deleted.
  • Toast UI is extended to support stacked action layout and configurable button variants (e.g. 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.delete with force=true after confirmation.

On the server, project.delete now supports an optional force flag: without it, deleting a project with active threads is rejected; with it, the decider plans a sequence of thread.deleted events for each active thread before emitting project.deleted. A new ThreadDeletionReactor is wired into the runtime to react to thread.deleted events 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.deleted events 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.

@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: 3e901cfb-413f-4746-b5ce-a2af44454c2a

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
Comment thread apps/web/src/components/Sidebar.tsx Outdated
@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp bot commented Apr 6, 2026

Approvability

Verdict: 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.

Comment thread apps/web/src/components/Sidebar.tsx Outdated
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?

Comment thread apps/web/src/components/Sidebar.tsx
@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.

Comment thread apps/web/src/routes/__root.tsx Outdated
@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
Comment thread apps/web/src/components/Sidebar.tsx Outdated
Comment thread apps/server/src/orchestration/Layers/ThreadDeletionReactor.ts Outdated
@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
Co-authored-by: codex <codex@users.noreply.github.com>
@juliusmarminge juliusmarminge merged commit 4e0c003 into pingdotgg:main Apr 17, 2026
12 checks passed
aaditagrawal added a commit to aaditagrawal/t3code that referenced this pull request Apr 18, 2026
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)
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