refactor(admin): use AlertDialog for destructive confirmation dialogs - #1752
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughSummary by CodeRabbit
WalkthroughChangesThe PR updates five administrative confirmation interfaces from Confirmation dialog migration
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
web/sdk/admin/views/users/details/layout/suspend-user.tsx (1)
32-43: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider moving
AlertDialog.Titleinto anAlertDialog.Headerfor consistency.
AlertDialog.Titleis placed insideAlertDialog.Bodywithin aFlexcontainer, while the sibling migration inremove-member.tsx(lines 65–67) and the reference AlertDialog implementation both place the title insideAlertDialog.Header. This is likely pre-existing structure rather than a regression, but aligning the two migrated dialogs would improve maintainability. If the currentFlexgap spacing between title and description is intentional, the header approach can still preserve it with minor styling adjustments.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 21a9456d-b14d-457f-8035-f70ec26d09ff
📒 Files selected for processing (5)
web/sdk/admin/views/organizations/details/members/remove-member.tsxweb/sdk/admin/views/users/details/layout/suspend-user.tsxweb/sdk/admin/views/users/details/security/sessions/revoke-session-confirm.tsxweb/sdk/admin/views/users/details/security/sessions/revoke-session-final-confirm.tsxweb/sdk/admin/views/webhooks/webhooks/delete/index.tsx
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: c7aaa486-cf69-4d10-99ba-4befeb6d6b22
📒 Files selected for processing (6)
web/sdk/admin/views/organizations/details/members/remove-member.tsxweb/sdk/admin/views/users/details/layout/suspend-user.tsxweb/sdk/admin/views/users/details/security/sessions/revoke-session-confirm.tsxweb/sdk/admin/views/users/details/security/sessions/revoke-session-final-confirm.tsxweb/sdk/admin/views/users/details/security/sessions/sessions.module.cssweb/sdk/admin/views/webhooks/webhooks/delete/index.tsx
💤 Files with no reviewable changes (1)
- web/sdk/admin/views/users/details/security/sessions/sessions.module.css
🚧 Files skipped from review as they are similar to previous changes (4)
- web/sdk/admin/views/webhooks/webhooks/delete/index.tsx
- web/sdk/admin/views/organizations/details/members/remove-member.tsx
- web/sdk/admin/views/users/details/security/sessions/revoke-session-final-confirm.tsx
- web/sdk/admin/views/users/details/layout/suspend-user.tsx
Coverage Report for CI Build 29314332976Coverage remained the same at 44.876%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
Summary
Destructive confirmation dialogs (delete, remove, revoke, etc.) should use Apsara v1's
AlertDialoginstead of the genericDialog, so they behave like true "are you sure?" prompts. Most dialogs across the client SDK were already migrated — this PR converts the remaining admin dialogs that were still onDialog.Changes
Dialog→AlertDialog:organizations/details/members/remove-member.tsx)users/details/layout/suspend-user.tsx)users/details/security/sessions/)webhooks/webhooks/delete/index.tsx)✕close button on these dialogs so users must make an explicit Cancel/confirm choice.regenerate-pat-dialog.tsxonDialogon purpose — it's a form (expiry select), not a plain destructive confirm.Technical Details
open/onOpenChangeAPI. Apsara'sAlertDialogroot is built on@base-ui/reactand supports these props directly, so no rewrite to the handle-based API was needed — the swap is essentially component names + closing the Cancel button overonClose.data-test-ids, and mutation/error-handling logic are unchanged.AlertDialogdoes not dismiss on outside/backdrop click (this is the intended improvement).Escapeand the Cancel button still close it.suspend-user.tsxis currently unreachable stub code (its trigger is commented out and it runs no mutation); it was migrated for consistency. Cleanup is tracked separately and is out of scope here.Test Plan
tscclean on all changed files, no new lint diagnostics.SQL Safety (if your PR touches
*_repository.goorgoqu.*)N/A