Skip to content

feat(sdk): user delete blockers UI - #2042

Merged
rohanchkrabrty merged 12 commits into
feat/project-delete-blocked-dialogfrom
feat/account-delete-dialog
Nov 5, 2026
Merged

rohanchkrabrty merged 12 commits into
feat/project-delete-blocked-dialogfrom
feat/account-delete-dialog

Conversation

@rohanchkrabrty

@rohanchkrabrty rohanchkrabrty commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • DeleteUserDialog runs the whole account delete. A click runs CheckCurrentUserDelete first, then opens the matching dialog. The trigger slot gets { onClick, loading }, so the trigger button is disabled and shows a spinner, with its label unchanged, while the check runs. This matches the org and project delete buttons.
  • A host can also start the delete with handle.open(), using a handle from DeleteUserDialog.createHandle(). It runs the same check, so a menu item that has already closed can still start the delete. onDeleted is required: the SDK does not navigate.
  • When the user is the only owner of an organization with other members, the dialog asks for an ownership transfer. When an organization that would be deleted with the account is blocked, it lists the blockers for each one. Both go through the deleteBlockedDialog slot with entity: 'user'.
  • Otherwise it shows the Delete Account confirmation. Delete stays disabled until the user types their email and ticks the acknowledgement.
  • A refused delete checks again, because the refusal has no grouping by organization.
  • ProfileView takes enableUserDelete (off by default) and onAccountDeleted. With the flag on, the view shows a Delete Account section. A host app turns it on when it handles the delete.

Stacked on #2041.

Test plan

  • tsc --noEmit shows no new errors, eslint, pnpm build
  • Sole owner of a workspace with other members: the ownership dialog opens
  • Sole member of a workspace with an active paid subscription: the blocked dialog lists it under that workspace
  • Delete Account button: disabled with a spinner while the check runs, then the matching dialog opens
  • Clean account: the confirmation enables Delete only after the email and the tick, then onDeleted runs
  • ProfileView without enableUserDelete shows no Delete Account section

@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 8:20am UTC

@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Summary

Summary by CodeRabbit

  • New Features
    • Added an optional account-deletion section to the profile, disabled by default. Deletion requires confirming the account email and acknowledging the prompt.
    • Added guidance tailored to account, organization, and project deletion blockers, including ownership requirements and organization-specific details.
    • Added success and error notifications during deletion, with an eligibility recheck when deletion is blocked.
    • Redirects to the login page after successful account deletion.
  • Style
    • Preserved line breaks in deletion-blocker descriptions.

The SDK adds a user account-deletion dialog with eligibility checks, confirmation requirements, and user-specific blocker details. The profile view can optionally expose the dialog and receive a callback after deletion.

Changes: User deletion

Layer / File(s) Summary
User deletion blocker content
web/sdk/shared/types.ts, web/sdk/client/utils/delete-blockers.ts, web/sdk/client/hooks/useDeleteCheck.ts, web/sdk/client/components/delete-blocked-dialog/*
The blocked payload supports user outcomes. Conversion creates entries for organizations to delete and organizations where the user must transfer ownership. The dialog renders organization blockers and ownership-transfer guidance.
Deletion dialog and confirmation
web/sdk/client/components/delete-user-dialog/*, web/sdk/client/index.ts
The dialog checks eligibility before opening, renders blocker details or a confirmation form, and submits deletion when the normalized email matches and acknowledgment is checked. It exposes a trigger and external handle.
Profile view integration
web/sdk/client/views/profile/*, web/apps/client-demo/src/pages/settings/Profile.tsx
The profile view accepts optional deletion enablement and a completion callback. When enabled, it displays loading content or an account-deletion section with a dialog trigger. The demo enables deletion and redirects to /login after success.

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

Change: Feature

Possibly related PRs

Suggested reviewers: shreyag02, rohilsurana

Merge Risk: Moderate · up to bbb99

Account deletion can remove organizations without naming them, and blocker guidance can be incomplete. Resolve these issues 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 41993652621

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

@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: 4

Review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 825809c and 14323c2.

Files selected for processing: 12
  • web/sdk/client/components/delete-blocked-dialog/delete-blocked-dialog.module.css
  • web/sdk/client/components/delete-blocked-dialog/delete-blocked-dialog.tsx
  • web/sdk/client/components/delete-blocked-dialog/index.ts
  • web/sdk/client/components/delete-user-dialog/delete-user-dialog.module.css
  • web/sdk/client/components/delete-user-dialog/delete-user-dialog.tsx
  • web/sdk/client/components/delete-user-dialog/index.ts
  • web/sdk/client/hooks/useDeleteCheck.ts
  • web/sdk/client/index.ts
  • web/sdk/client/utils/delete-blockers.ts
  • web/sdk/client/views/profile/index.ts
  • web/sdk/client/views/profile/profile-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; 1 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: 3

Review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 14323c2 and 98b1e09.

Files selected for processing: 5
  • web/sdk/client/components/delete-blocked-dialog/delete-blocked-dialog.tsx
  • web/sdk/client/components/delete-blocked-dialog/index.ts
  • web/sdk/client/components/delete-user-dialog/delete-user-dialog.tsx
  • web/sdk/client/hooks/useDeleteCheck.ts
  • web/sdk/client/utils/delete-blockers.ts

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

@Shreyag02 Shreyag02 mentioned this pull request Nov 4, 2026
1 of 3 tasks
Comment thread web/sdk/client/utils/delete-blockers.ts Resolved

@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 98b1e09 and f8003ed.

Files selected for processing: 3

  • web/apps/client-demo/src/pages/settings/Profile.tsx
  • web/sdk/client/components/delete-blocked-dialog/delete-blocked-dialog.tsx
  • web/sdk/client/views/profile/profile-view.tsx

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

@rohanchkrabrty
rohanchkrabrty force-pushed the feat/account-delete-dialog branch from f8003ed to 13e9af8 Compare November 5, 2026 05:44
DeleteUserDialog runs the whole account delete. It opens first and runs
CheckCurrentUserDelete inside, so it works from any trigger, including a
menu item that has already closed. Open it with a trigger slot, or with a
handle from DeleteUserDialog.createHandle().

When the user is the only owner of an organization with other members,
it asks for an ownership transfer. When an organization that would be
deleted with the account is blocked, it lists the blockers for each
organization. Both go through the deleteBlockedDialog slot. Otherwise it
shows the Delete Account confirmation, which needs the user's email and
an acknowledgement. A refused delete checks again to show what blocks it.

ProfileView takes onAccountDeleted. When it is set, the view shows a
Delete account section. The SDK does not navigate after the delete.
ProfileView shows the Delete Account section only when enableUserDelete
is set. It is off by default, so a host app turns it on when it is ready
to handle the delete with onAccountDeleted.

The account delete dialogs follow the design: the ownership dialog has
two paragraphs and no list, and the confirmation has the new field label
and acknowledgement text.
A click on Delete Account now runs CheckCurrentUserDelete first. The
trigger slot gets loading, so the button is disabled and shows a spinner
with its label while the check runs. Then the ownership, blocked or
confirmation dialog opens. A failed check shows a toast.

The handle from DeleteUserDialog.createHandle() is now { open() }. It runs
the same check, so a menu item that has already closed can still start
the delete.
DeleteBlockedDialog now renders its own AlertDialog.Content, so the
blocked step renders it directly and only the confirmation form is
wrapped in AlertDialog.Content.
The blockers prop draws one list with no heading. An account delete can be blocked in more than one workspace, so a host that words its own lines needs a heading for each workspace. The groups prop takes a title and blockers for each group.
The account dialog no longer groups blockers by workspace. It shows one list, the same as the workspace dialog, and the description says the issues are in your workspaces. The ownership transfer dialog does not change. Removes the groups prop, which nothing uses now.
ProfileView now uses the same callback name as GeneralView and the detail views.
Passes enableUserDelete to ProfileView and goes to /login after the delete.
The dialog handle already types payload as DeleteUserPayload.
The checkbox row renders as a label, so screen readers read the acknowledgement as the checkbox name and clicking the text ticks the box.
The account dialog now lists workspace blockers before asking for an ownership transfer, so the transfer is the last step. When the account delete is blocked in more than one workspace, the default lines say "your workspaces" instead of "this workspace". The workspace and project dialogs are unchanged.

@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 f8003ed and bbb995d.

Files selected for processing: 4

  • web/sdk/client/components/delete-blocked-dialog/delete-blocked-dialog.tsx
  • web/sdk/client/components/delete-user-dialog/delete-user-dialog.tsx
  • web/sdk/client/hooks/useDeleteCheck.ts
  • web/sdk/client/utils/delete-blockers.ts

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

@rohanchkrabrty
rohanchkrabrty merged commit f38ac11 into main Nov 5, 2026
8 checks passed
@rohanchkrabrty
rohanchkrabrty deleted the feat/account-delete-dialog branch November 5, 2026 08:43

This branch was successfully deployed

1 active deployment
Preview — bbb995df 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