Add admin moderation actions to the plugin detail page - #434
Merged
leerob merged 3 commits intoSep 11, 2026
Conversation
Admins can now approve, re-scan, confirm a flag, unpublish, or delete a plugin directly from /plugins/[slug] instead of going through /admin/plugins. The panel mirrors the queue's actions and picks the right one for the plugin's state (hidden vs live, flagged, blocked, scan error) and surfaces the scanner's summary and reasons, which the public banner hides from non-owners. Adds an admin-gated unpublishPluginAction so a live plugin can be taken down without permanently blocking or deleting it. Co-authored-by: Cursor <cursoragent@cursor.com>
|
@ericzakariasson is attempting to deploy a commit to the Anysphere Team on Vercel. A member of the Team first needs to authorize it. |
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Admins can now moderate a plugin directly from its public page (e.g.
/plugins/bulkpublish) instead of round-tripping through/admin/plugins.A
PluginAdminPanelcard renders at the top ofPluginDetailViewfor admins only. It shows the plugin's moderation state (Live/Hidden,scan: <status>, flag severity, verdict,Blocked), surfaces the scanner'sflag_summaryand reasons (which the public banner hides from non-owners), links to the queue, and offers the same actions as the queue, picked for the plugin's state:Delete goes through an
AlertDialogconfirmation and then redirects to/admin/plugins. The other actions toast androuter.refresh()inside a transition so the buttons stay disabled until the fresh row has rendered.Changes
apps/cursor/src/components/plugins/plugin-admin-panel.tsx— the panel. Rendering is gated client-side viaisAdminClient(same pattern asVerifyControls); every action is enforced server-side byadminActionClient.apps/cursor/src/actions/review-plugin.ts— addsunpublishPluginAction(admin-gated,active: false, same revalidation as its siblings). Previously an admin had no way to take a live plugin down short of permanently blocking (confirmFlagAction) or deleting it.apps/cursor/src/components/plugins/plugin-detail.tsx— mounts the panel aboveScanStatusBanner.Flagged/blocked plugins route through
approveFlaggedPluginActionrather thanapprovePluginAction, so approving also clearspermanently_blocked; plain approve would leave the block in place and the next scan's short-circuit would hide the plugin again.Notes
NEXT_PUBLIC_ADMIN_USER_IDSmust mirrorADMIN_USER_IDSfor the panel to appear (existing requirement forVerifyControls).null.Verification
bunx biome ci .andtsc --noEmitpass.declinePluginAction, then navigates to/admin/plugins). Harness not committed.Note
Medium Risk
Adds admin-only moderation paths on public pages (unpublish, approve, delete); server enforcement via
adminActionClientlimits exposure, but mistakes affect directory visibility and plugin records.Overview
Adds in-context admin moderation on public plugin detail pages so reviewers don’t have to use
/admin/pluginsfor every action.A new
PluginAdminPanel(admin-only viaisAdminClient, actions viaadminActionClient) sits at the top ofPluginDetailView. It shows live/hidden, scan status, flag severity, blocked state, and admin-visibleflag_summary/reasons, with state-dependent actions: approve, unpublish, re-scan, confirm flag, and delete (with confirmation + redirect to the queue).Introduces
unpublishPluginAction, which setsactive: falsewithout permanent block or delete—distinct from confirm-flag/delete. Flagged or permanently blocked plugins useapproveFlaggedPluginActionso approval clears the block; successful actions toast androuter.refresh()in a transition until fresh data loads.Reviewed by Cursor Bugbot for commit fc456ef. Bugbot is set up for automated code reviews on this repo. Configure here.