Skip to content

feat: add suspend/unsuspend user actions and clarify ban destructiveness#83

Merged
mbradley merged 1 commit into
mainfrom
feat/suspend-unsuspend-ui
May 21, 2026
Merged

feat: add suspend/unsuspend user actions and clarify ban destructiveness#83
mbradley merged 1 commit into
mainfrom
feat/suspend-unsuspend-ui

Conversation

@mbradley
Copy link
Copy Markdown
Member

@mbradley mbradley commented May 21, 2026

Summary

  • Wire up suspendpubkey/unsuspendpubkey/listsuspendedpubkeys NIP-86 RPC methods (from funnelcake PR #434) as general-purpose moderation actions, available from reports, user detail, and user management views
  • Add Suspend/Unsuspend buttons with amber/green styling distinct from destructive ban
  • Add "Suspended Users" tab to User Management page
  • Put Ban User behind a confirmation dialog that honestly describes the destructive purge cascade
  • Fix misleading "Can be reversed" ban tooltip and "They will be able to post again" unban tooltip

Motivation

Suspension was previously only available through the age review flow (PR #80). Moderators need it as a general tool — it hides content without purging, and unsuspend restores visibility. Ban triggers a purge cascade across 16+ funnelcake tables, and unban doesn't restore purged content. The UI should make this distinction clear.

Changes

File What
src/lib/adminApi.ts Add suspendPubkey, unsuspendPubkey, listSuspendedPubkeys
src/hooks/useAdminApi.ts Wire 3 new functions
src/hooks/useModerationStatus.ts Add isUserSuspended with suspended-pubkeys query
src/components/ConfirmDialog.tsx New generic dialog extracted from DeleteConfirmDialog
src/components/DeleteConfirmDialog.tsx Thin wrapper preserving delete-specific defaults
src/components/UserActions.tsx Suspend/unsuspend buttons, ban behind confirmation dialog
src/components/UserManagement.tsx Suspended Users tab, pass isSuspended prop
src/components/ReportDetail.tsx Pass isSuspended to UserActions

Validation

  • npx tsc --noEmit — clean
  • npx vitest run — 99 passed, 1 skipped, 0 failed (frontend)
  • npx vite build — clean
  • Deploy to staging and test suspend/unsuspend cycle
  • Verify ban confirmation dialog appears with destructive language

Relates to divinevideo/support-trust-safety#146

@mbradley mbradley marked this pull request as draft May 21, 2026 20:11
@mbradley mbradley self-assigned this May 21, 2026
@mbradley mbradley force-pushed the feat/suspend-unsuspend-ui branch 3 times, most recently from a21b95e to e57c717 Compare May 21, 2026 20:43
Wire up suspendpubkey/unsuspendpubkey/listsuspendedpubkeys NIP-86 RPC
methods as general-purpose moderation actions. Previously suspension was
only available through the age review flow.

- Add suspendPubkey, unsuspendPubkey, listSuspendedPubkeys to adminApi
- Add Suspend/Unsuspend buttons to UserActions (amber/green styling)
- Add Suspended Users tab to UserManagement page
- Track isSuspended state in useModerationStatus hook
- Put Ban User behind a confirmation dialog with honest destructive
  language (was "Can be reversed" — ban purges content from 16+ tables)
- Update Unban tooltip to note purged content is not restored
- Extract ConfirmDialog from DeleteConfirmDialog with configurable
  pendingLabel prop
- Document suspend_user exclusion from Zendesk resolutionActions
  (suspension is a holding action, not a final resolution)
@mbradley mbradley force-pushed the feat/suspend-unsuspend-ui branch from e57c717 to 8476b30 Compare May 21, 2026 20:53
@mbradley mbradley requested a review from dcadenas May 21, 2026 21:07
@mbradley mbradley marked this pull request as ready for review May 21, 2026 21:10
Copy link
Copy Markdown

@dcadenas dcadenas left a comment

Choose a reason for hiding this comment

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

✅ safer moderation controls, ship it

@mbradley mbradley merged commit 2a9a2d6 into main May 21, 2026
3 checks passed
@mbradley mbradley deleted the feat/suspend-unsuspend-ui branch May 21, 2026 21:39
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.

2 participants