Skip to content

feat: Allow communities to request approval for not-spam#3595

Merged
isTravis merged 9 commits intomainfrom
tr/community-spam-requests
Apr 21, 2026
Merged

feat: Allow communities to request approval for not-spam#3595
isTravis merged 9 commits intomainfrom
tr/community-spam-requests

Conversation

@isTravis
Copy link
Copy Markdown
Member

Replaces the passive "we'll review your community within 5 days" model with an explicit Request Approval flow. Community admins now decide when they're ready for their community to be reviewed, and actively request it via a dialog. Also replaces the broken infinite scroll on the superadmin spam dashboard with proper pagination.

Motivation

  • Communities often weren't ready to evaluate within 5 days because admins hadn't finished setting them up yet — nothing to judge.
  • The infinite scroll on the superadmin spam tab stopped working at some point.

What changed

New "Request Approval" flow

  • Banner (SpamBanner): When a community is unreviewed and hasn't requested approval, the banner says the community isn't publicly visible yet and shows a "Request Approval" button.
  • Dialog: Clicking the button opens a dialog explaining the process and inviting the admin to describe their community's purpose (optional). Has loading, error, and confirmation states.
  • After submission: The banner changes to confirm the request was submitted and that the team will review it.
  • Notifications on request:
    • Email sent to help@pubpub.org with community details, requester info, spam score, and a link to the superadmin dashboard.
    • Slack notification posted with the same info.
  • No email on community creation — the notification now fires when the admin explicitly requests approval, not on create.

Superadmin dashboard

  • Pagination: Replaced infinite scroll with page-based navigation (100 communities per page) with Prev/Next controls and page indicator.
  • "Approval Requested" filter tab: New tab showing only communities that have requested approval, so the team can prioritize those.
  • Request details on entries: Each community entry shows when approval was requested, who requested it, and any message they included.

Database

  • New migration (2026_04_21_addReviewRequestToSpamTag.js): Adds approvalRequestedAt, approvalRequestMessage, approvalRequestedByUserId columns to SpamTag.
  • New API endpoint: POST /api/spamTags/requestCommunityReview — validates the user is a community admin, records the request, and fires notifications.

Copy updates

  • All user-facing text updated to use "Request Approval" terminology (not "request review").
  • Banner, dialog, CommunityCreate cards, emails, Slack messages all use consistent language.
  • Removed "5-day review" promises everywhere.

Files changed (19 files)

Area Files
Frontend - Banner & Dialog client/containers/App/SpamBanner.tsx, spamBanner.scss, App.tsx
Frontend - Community Create client/containers/CommunityCreate/CommunityCreate.tsx
Frontend - Superadmin Dashboard CommunitySpam.tsx, CommunitySpamEntry.tsx, useSpamCommunities.ts, filters.ts, communitySpam.scss, communitySpamEntry.scss
Backend - API & Queries server/spamTag/api.ts, server/spamTag/communityDashboard.ts, server/spamTag/model.ts
Backend - SSR server/routes/superAdminDashboard.tsx
Backend - Emails server/utils/email/communitySpam.ts, server/community/queries.ts
Migration tools/migrations/2026_04_21_addReviewRequestToSpamTag.js
Types types/spam.ts
Tests server/community/__tests__/api.test.ts

Email behavior (current state)

Event Recipient Email?
Community created No
Admin clicks "Request Approval" help@pubpub.org Yes
Superadmin approves community Community admin(s) Yes
Superadmin rejects as spam Community admin(s) Yes

Migration notes

Run the migration 2026_04_21_addReviewRequestToSpamTag.js to add the three new columns to SpamTag. All columns are nullable — no data backfill needed.

@isTravis isTravis requested a review from tefkah April 21, 2026 01:25
Copy link
Copy Markdown
Member

@tefkah tefkah left a comment

Choose a reason for hiding this comment

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

great!!

@isTravis isTravis merged commit dc0a9bb into main Apr 21, 2026
1 check passed
@isTravis isTravis deleted the tr/community-spam-requests branch April 21, 2026 14:34
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