You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Project deletion now checks whether the project can be deleted before opening the confirmation dialog.
While the check is running, the delete action shows a loading indicator and is unavailable.
If deletion is blocked, a message explains that the project contains resources that must be addressed first.
Project deletion in both project views now runs a deletion check before confirmation. The views show a blocked-deletion dialog when resources prevent deletion and pass deletion errors to a callback.
Changes: Project deletion flow
Layer / File(s)
Summary
Deletion contracts and shared UI 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, web/sdk/client/views/projects/components/delete-project-menu-item.tsx
The blocked-deletion payload accepts projects, and the dialog has project-specific copy. The delete dialog forwards errors to a callback. The project delete menu item displays a spinner and is disabled while checking.
Projects list deletion flow web/sdk/client/views/projects/projects-view.tsx
The view creates mount-scoped handles and checks for deletion blockers before opening the confirmation or blocked-deletion dialog. The menu closes after the check completes.
The view creates mount-scoped handles and checks for deletion blockers before opening the confirmation or blocked-deletion dialog. The menu closes after the check completes.
raystack/frontier#2025: Adds the blocked-deletion dialog contract used by this project deletion flow.
raystack/frontier#2011: Adds the project deletion check called before the dialogs are shown.
raystack/frontier#2008: Adds project deletion blocker errors handled by the delete dialog callback.
Suggested reviewers:rohilsurana
Merge Risk: Moderate · previous review 82580
Pending deletion checks can show confirmations for a previous project after navigation, and completing a check can close another project's menu. Resolve these stale-operation behaviors before merging.
Pre-merge checks: 2
Check name
Status
Explanation
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
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.
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().
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.
Key the details view by projectId so stale delete checks cannot reach a new project.
ProjectDetailsView keeps its state when projectId changes. If a check for project A resolves after navigation to project B, the confirm dialog opens with A's payload. Confirming from B's page deletes A. Remount the view when projectId changes, for example by keying it by projectId inside the SDK export.
Discard late delete checks after the active organization changes.
If the active organization changes while a project delete check is pending, the late result still opens the delete confirmation in the current organization's view. The confirmation names the project from the previous organization and can delete it. Compare the organization ID when the check starts with the ID when it resolves, and skip the confirmation on a mismatch.
set -e
nl -ba web/sdk/client/hooks/useDeleteCheck.ts
Repository: raystack/frontier
Length of output: 3046
Close the project menu only when it still shows the project whose delete check finished.
The delete action calls projectMenuHandle.close() after startDelete resolves. The handle is shared by all rows, so this closes whichever project menu is open at that moment. If a user closes the menu for project A during its check and opens project B's menu, A's check completion closes B's menu. The same shared isChecking state also disables B's delete item while A is being checked.
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 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ProjectsViewand the actions menu inProjectDetailsViewrunCheckProjectDeleteon click. The menu item shows a spinner while the check runs, then the menu closes and the confirmation or the blocked dialog opens.useDeleteCheckand thedeleteBlockedDialogslot from feat(sdk): org delete blockers UI #2025, so a host app words the organization and project dialogs in one place. The slot getsentity: 'project'and the resource blockers.Stacked on #2025.
Test plan
tsc --noEmitshows no new errors, eslint,pnpm build