Skip to content

feat(sdk): project delete blockers UI - #2041

Merged
rohanchkrabrty merged 9 commits into
feat/workspace-delete-blockers-dialogfrom
feat/project-delete-blocked-dialog
Nov 5, 2026
Merged

rohanchkrabrty merged 9 commits into
feat/workspace-delete-blockers-dialogfrom
feat/project-delete-blocked-dialog

Conversation

@rohanchkrabrty

@rohanchkrabrty rohanchkrabrty commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • The project row menu in ProjectsView and the actions menu in ProjectDetailsView run CheckProjectDelete on click. The menu item shows a spinner while the check runs, then the menu closes and the confirmation or the blocked dialog opens.
  • A refused delete closes the confirmation and opens the blocked dialog.
  • Both menus use useDeleteCheck and the deleteBlockedDialog slot from feat(sdk): org delete blockers UI #2025, so a host app words the organization and project dialogs in one place. The slot gets entity: 'project' and the resource blockers.
  • The delete dialogs and the project menus are created per mount, so a check that returns after the user leaves, or browser Back, does not reopen them ([dialog] dialog with createHandle survives navigation and preserve pre-navigation store state mui/base-ui#4951).
  • Delete errors no longer show the server message in a toast.

Stacked on #2025.

Test plan

  • tsc --noEmit shows no new errors, eslint, pnpm build
  • Delete a project with resources that the deletion rules block: the blocked dialog opens from both menus
  • Delete a clean project: the confirmation opens and the delete goes through

@vercel

vercel Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
frontier Ready Ready Preview Nov 5, 2026 7:02am UTC

@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 6cb48ef and 68379ca.

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
Summary

Summary by CodeRabbit

  • New Features
    • Project deletion now checks for blocking resources before opening the confirmation flow. If deletion is blocked, a separate dialog explains that resources must be addressed first.
    • Deletion menus show a loading indicator and prevent starting another deletion check while one is in progress.
  • Bug Fixes
    • Errors encountered during project deletion checks are now passed to the deletion dialog for handling.

Project deletion checks now run from the projects list and project details views before the confirmation flow. Blocked deletions use a separate dialog, and the delete dialog forwards errors to a callback.

Changes: Project deletion flow

Layer / File(s) Summary
Shared blocked-delete contract and error handling
web/sdk/shared/types.ts, web/sdk/client/components/delete-blocked-dialog/delete-blocked-dialog.tsx, web/sdk/client/views/projects/components/delete-project-dialog.tsx
The blocked-delete payload accepts project, and the blocked dialog has project-specific copy. The delete dialog forwards caught errors to its onDeleteError callback instead of showing error-specific toasts.
Projects list deletion flow
web/sdk/client/views/projects/projects-view.tsx
ProjectsView creates menu and dialog handles per mount and checks deletion before opening the confirmation or blocked-deletion dialog. The menu shows a spinner and disables deletion while the check runs, then closes after the check resolves.
Project details deletion flow
web/sdk/client/views/projects/project-details-view.tsx
ProjectDetailsView creates menu and dialog handles per mount and checks deletion before opening the confirmation or blocked-deletion dialog. The menu shows a spinner and disables deletion while the check runs, then closes after the check resolves.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Possibly related PRs

  • raystack/frontier#2042: This stacked PR also updates DeleteBlockedPayload and the blocked-dialog copy.
  • raystack/frontier#2011: This PR adds the CheckProjectDelete RPC that the project views call before deletion.
  • raystack/frontier#2008: This PR changes refused project deletions to return FAILED_PRECONDITION, which relates to the delete error handling.

Suggested reviewers: rohilsurana

Merge Risk: Moderate · previous review 6cb48

A pending check can show a previous project’s deletion dialog after navigation or an organization switch. Resolve stale results before merging.

Pre-merge checks: Passed 2

Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@coveralls

coveralls commented Nov 3, 2026 •

Copy link
Copy Markdown

Coverage Report for CI Build 41984301251

Coverage remained the same at 56.053%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 42189
Covered Lines: 23648
Line Coverage: 56.05%
Coverage Strength: 19.7 hits per line

💛 - Coveralls

@rohanchkrabrty
rohanchkrabrty force-pushed the feat/project-delete-blocked-dialog branch from a36e1ba to 34d5be9 Compare November 3, 2026 23:12
@rohanchkrabrty rohanchkrabrty changed the title feat(sdk): check project delete blockers before the confirmation feat(sdk): project delete blockers UI Nov 4, 2026
@rohanchkrabrty
rohanchkrabrty force-pushed the feat/project-delete-blocked-dialog branch from 0d56ae4 to 825809c Compare November 4, 2026 05:57

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Additional comments: 1
web/sdk/client/views/projects/projects-view.tsx-340-344: 1

340-344: Minor · Potential issue · Quick win

Unverified finding
We couldn't verify this from the code. It is shown for review, not as a verified issue.

startDelete opens the confirmation or blocked dialog before the caller closes the still-open menu. If the menu's close/focus handling dismisses a newly opened dialog, the new flow loses its result.

The confirmation or blocker dialog may close immediately or fail to receive focus, preventing the intended deletion flow. The details view uses the same ordering.

This can occur when: A deletion check resolves while the project menu is open and opens a dialog, followed immediately by projectMenuHandle.close().

Review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 6277d9b and 825809c.

Files selected for processing: 6
  • web/sdk/client/components/delete-blocked-dialog/delete-blocked-dialog.tsx
  • web/sdk/client/views/projects/components/delete-project-dialog.tsx
  • web/sdk/client/views/projects/components/delete-project-menu-item.tsx
  • web/sdk/client/views/projects/project-details-view.tsx
  • web/sdk/client/views/projects/projects-view.tsx
  • web/sdk/shared/types.ts

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

Minor · Include the resource namespace in the default blocker line. · delete-blocked-dialog.tsx:26-29

web/sdk/client/components/delete-blocked-dialog/delete-blocked-dialog.tsx:26-29
Minor · Functional Correctness · Quick win

Include the resource namespace in the default blocker line.

CheckProjectDelete returns one RESOURCES_EXIST blocker per namespace, but the default formatter drops subject and renders only Existing resources: Delete the remaining resources, then try again. The new project deletion flow therefore does not identify the offending resources. Add the subject to the default fallback while preserving custom messages.

Suggested fix

-const DEFAULT_LINES: Record<string, (wording: BlockerWording) => string> = {
+const DEFAULT_LINES: Record<
+  string,
+  (wording: BlockerWording, subject?: string) => string
+> = {
...
-  RESOURCES_EXIST: () =>
-    'Existing resources: Delete the remaining resources, then try again.'
+  RESOURCES_EXIST: (_, subject) =>
+    subject
+      ? `Existing resources in ${subject}: Delete the remaining resources, then try again.`
+      : 'Existing resources: Delete the remaining resources, then try again.'
...
-      messages[subject] ?? messages[type] ?? DEFAULT_LINES[type]?.(wording);
+      messages[subject] ??
+      messages[type] ??
+      DEFAULT_LINES[type]?.(wording, subject);
Review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 825809c and 4a4c7e0.

Files selected for processing: 3

  • web/sdk/client/views/projects/components/delete-project-menu-item.tsx
  • web/sdk/client/views/projects/project-details-view.tsx
  • web/sdk/client/views/projects/projects-view.tsx

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 4a4c7e0 and 6cb48ef.

Files selected for processing: 2

  • web/sdk/client/views/projects/project-details-view.tsx
  • web/sdk/client/views/projects/projects-view.tsx

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

Both project menus now run CheckProjectDelete on click. The menu item
shows a spinner while the check runs, then the menu closes and the
confirmation or the blocked dialog opens. A refused delete closes the
confirmation and shows the blocked dialog.

The project flow uses the same useDeleteFlow hook and deleteBlockedDialog
slot as the organization flow, so a host app words both in one place.
The project delete now uses useDeleteCheck, the same as the
organization delete. Both views import DeleteBlockedPayload from
shared/types.
The same fix as the organization delete: a handle created at module
scope keeps its open state after the view unmounts, so a late delete
check or a dialog left open on browser Back showed the dialog again on
the next visit (mui/base-ui#4951).

The project menus are included. They stay open while the delete check
runs, and a menu handle's close() does nothing once the menu has
unmounted, so leaving during the check brought the menu back open.
Both project views call useDeleteCheck directly, the same as the
organization view. Each menu still stays open with the spinner while
the check runs and closes once the dialog opens.
The spinner used the neutral color. The menu leading icon slot sets a secondary color, so color="default" (currentColor) is grey there. color="danger" uses the same token as the Delete project label.
Both project views render their Delete project item in place again, with the spinner and the check state. Removes DeleteProjectMenuItem.
The Delete project and Remove items read as "Delete Delete project" and "Remove Remove" because the icon alt repeated the label. The icons now have an empty alt.
@rohanchkrabrty
rohanchkrabrty merged commit ce8294e into main Nov 5, 2026
8 checks passed
@rohanchkrabrty
rohanchkrabrty deleted the feat/project-delete-blocked-dialog branch November 5, 2026 08:43

This branch was successfully deployed

1 active deployment
Preview — 68379ca5 Deployed Nov 5, 2026 by vercel[bot]
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.

3 participants