🌐 US-Proxy
class="logged-out env-production page-responsive" style="word-wrap: break-word;" >
Skip to content

refactor(admin): use AlertDialog for destructive confirmation dialogs - #1752

Merged
Shreyag02 merged 2 commits into
mainfrom
feature/destructive-dialogs-use-alertdialog
Jul 14, 2026
Merged

refactor(admin): use AlertDialog for destructive confirmation dialogs#1752
Shreyag02 merged 2 commits into
mainfrom
feature/destructive-dialogs-use-alertdialog

Conversation

@Shreyag02

Copy link
Copy Markdown
Contributor

Summary

Destructive confirmation dialogs (delete, remove, revoke, etc.) should use Apsara v1's AlertDialog instead of the generic Dialog, 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 on Dialog.

Changes

  • Migrated 5 admin destructive dialogs from DialogAlertDialog:
    • Remove org member (organizations/details/members/remove-member.tsx)
    • Suspend user (users/details/layout/suspend-user.tsx)
    • Revoke session — first + final confirm (users/details/security/sessions/)
    • Delete webhook (webhooks/webhooks/delete/index.tsx)
  • Dropped the header close button on these dialogs so users must make an explicit Cancel/confirm choice.
  • Left regenerate-pat-dialog.tsx on Dialog on purpose — it's a form (expiry select), not a plain destructive confirm.

Technical Details

  • Each dialog keeps its existing controlled open / onOpenChange API. Apsara's AlertDialog root is built on @base-ui/react and supports these props directly, so no rewrite to the handle-based API was needed — the swap is essentially component names + closing the Cancel button over onClose.
  • Styling, data-test-ids, and mutation/error-handling logic are unchanged.
  • Behavioral difference to be aware of: AlertDialog does not dismiss on outside/backdrop click (this is the intended improvement). Escape and the Cancel button still close it.
  • Note: suspend-user.tsx is 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

  • Manual testing completed — opened each dialog, confirmed Cancel/confirm buttons work, backdrop no longer dismisses, and the underlying action (remove member, revoke session, delete webhook) still fires with correct toasts.
  • Build and type checking passes — tsc clean on all changed files, no new lint diagnostics.

SQL Safety (if your PR touches *_repository.go or goqu.*)

N/A

@Shreyag02
Shreyag02 requested a review from rohanchkrabrty July 13, 2026 14:32
@vercel

vercel Bot commented Jul 13, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
frontier Ready Ready Preview, Comment Jul 14, 2026 7:22am

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • UI Improvements
    • Updated member removal, user suspension, session revocation, and webhook deletion confirmations to use clearer alert-style dialogs.
    • Standardized modal structure across confirmations with consistent headers, descriptive text, and footer actions.
    • Ensured cancel/close wiring matches the alert dialog behavior while preserving existing loading, disabled, and confirmation behavior.
  • Style
    • Refined revoke-session confirmation body spacing in the session views for a cleaner layout.

Walkthrough

Changes

The PR updates five administrative confirmation interfaces from Dialog to AlertDialog or revises existing Dialog close controls, while preserving action handlers and mutation state behavior.

Confirmation dialog migration

Layer / File(s) Summary
Organization and user confirmations
web/sdk/admin/views/organizations/details/members/remove-member.tsx, web/sdk/admin/views/users/details/layout/suspend-user.tsx
Member removal and user suspension confirmations use AlertDialog structures with footer cancel controls.
Session revocation confirmations
web/sdk/admin/views/users/details/security/sessions/revoke-session-*.tsx, web/sdk/admin/views/users/details/security/sessions/sessions.module.css
Session revoke confirmations update modal structure, close handling, action layout, and confirmation body styling.
Webhook deletion confirmation
web/sdk/admin/views/webhooks/webhooks/delete/index.tsx
Webhook deletion uses AlertDialog content and wrapped cancellation without changing deletion logic.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: paansinghcoder, rohilsurana

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
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.

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.

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

🧹 Nitpick comments (1)
web/sdk/admin/views/users/details/layout/suspend-user.tsx (1)

32-43: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider moving AlertDialog.Title into an AlertDialog.Header for consistency.

AlertDialog.Title is placed inside AlertDialog.Body within a Flex container, while the sibling migration in remove-member.tsx (lines 65–67) and the reference AlertDialog implementation both place the title inside AlertDialog.Header. This is likely pre-existing structure rather than a regression, but aligning the two migrated dialogs would improve maintainability. If the current Flex gap 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

📥 Commits

Reviewing files that changed from the base of the PR and between cd6b070 and 30c537f.

📒 Files selected for processing (5)
  • web/sdk/admin/views/organizations/details/members/remove-member.tsx
  • web/sdk/admin/views/users/details/layout/suspend-user.tsx
  • web/sdk/admin/views/users/details/security/sessions/revoke-session-confirm.tsx
  • web/sdk/admin/views/users/details/security/sessions/revoke-session-final-confirm.tsx
  • web/sdk/admin/views/webhooks/webhooks/delete/index.tsx

Comment thread web/sdk/admin/views/users/details/security/sessions/revoke-session-confirm.tsx Outdated
Comment thread web/sdk/admin/views/users/details/layout/suspend-user.tsx Outdated
Comment thread web/sdk/admin/views/users/details/layout/suspend-user.tsx Outdated
Comment thread web/sdk/admin/views/users/details/layout/suspend-user.tsx Outdated
Comment thread web/sdk/admin/views/users/details/security/sessions/revoke-session-confirm.tsx Outdated
Comment thread web/sdk/admin/views/webhooks/webhooks/delete/index.tsx Outdated
Comment thread web/sdk/admin/views/webhooks/webhooks/delete/index.tsx Outdated
Comment thread web/sdk/admin/views/webhooks/webhooks/delete/index.tsx Outdated
Comment thread web/sdk/admin/views/organizations/details/members/remove-member.tsx Outdated

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


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c7aaa486-cf69-4d10-99ba-4befeb6d6b22

📥 Commits

Reviewing files that changed from the base of the PR and between 30c537f and 5ee3a73.

📒 Files selected for processing (6)
  • web/sdk/admin/views/organizations/details/members/remove-member.tsx
  • web/sdk/admin/views/users/details/layout/suspend-user.tsx
  • web/sdk/admin/views/users/details/security/sessions/revoke-session-confirm.tsx
  • web/sdk/admin/views/users/details/security/sessions/revoke-session-final-confirm.tsx
  • web/sdk/admin/views/users/details/security/sessions/sessions.module.css
  • web/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

@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 29314332976

Coverage remained the same at 44.876%

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: 37644
Covered Lines: 16893
Line Coverage: 44.88%
Coverage Strength: 12.54 hits per line

💛 - Coveralls

@Shreyag02
Shreyag02 merged commit 390b967 into main Jul 14, 2026
8 checks passed
@Shreyag02
Shreyag02 deleted the feature/destructive-dialogs-use-alertdialog branch July 14, 2026 08:13
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