feat(reads): block NSFW/spam articles with updatable lists - #740
Merged
Merged
Conversation
Seed-block known spam pubkeys and naddrs, filter keyword matches from feeds and direct links, and let admins update KV lists without a redeploy. Co-authored-by: Cursor <cursoragent@cursor.com>
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ❌ Deployment failed View logs |
zapcooking-frontend | d10f4e4 | Sep 19 2026, 04:20 PM |
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Critical authorization and concurrent-write issues, plus moderation reset and UI accessibility/loading defects, remain unresolved.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 2
Open (5)
What changed in this PR
Adds configurable Reads moderation with blocklists, keyword filtering, reporting, admin controls, and blocked-content fallbacks.
Changes:
- Filters moderated content across feeds, search, profiles, and direct routes.
- Adds Cloudflare KV list management, reports, hit logging, and admin tooling.
- Provides unavailable states and generic OG metadata for blocked content.
| File | Summary |
|---|---|
src/routes/user/[slug]/+page.svelte |
Filters profile Reads; refreshes needed when moderation data changes. |
src/routes/search/+page.svelte |
Filters search results. |
src/routes/recipes/+page.svelte |
Filters recipe feeds. |
src/routes/reads/[naddr]/+page.svelte |
Handles blocked Reads routes. |
src/routes/r/[naddr]/+page.svelte |
Handles blocked article routes. |
src/routes/api/reads/moderation/report/+server.ts |
Accepts moderation reports. |
src/routes/api/reads/moderation/hit/+server.ts |
Records keyword hits; unauthenticated auto-blocking requires verification. |
src/routes/api/reads/moderation/+server.ts |
Serves moderation lists. |
src/routes/api/admin/reads-moderation/+server.ts |
Provides authenticated list management. |
src/routes/admin/reads-moderation/+page.svelte |
Provides moderation administration; initial loading can remain stuck. |
src/routes/admin/+page.svelte |
Adds moderation navigation. |
src/lib/recipeOgHtml.server.ts |
Provides generic OG metadata for blocked content. |
src/lib/reads/moderationConfig.ts |
Defines seed moderation lists. |
src/lib/reads/moderationClient.ts |
Implements client filtering and reporting. |
src/lib/reads/moderation.ts |
Implements moderation logic; empty denylist overlays must override seeds. |
src/lib/reads/moderation.test.ts |
Tests moderation behavior. |
src/lib/reads/moderation.server.ts |
Persists lists and logs; concurrent auto-block updates need merge-safe writes. |
src/lib/articleUtils.ts |
Applies moderation to article filtering. |
src/lib/articleStore.ts |
Reacts to moderation updates. |
src/hooks.server.ts |
Loads moderation lists for server rendering. |
src/components/TagsSearchAutocomplete.svelte |
Filters autocomplete results. |
src/components/table/FeedSection.svelte |
Filters feed sections. |
src/components/Recipe/Recipe.svelte |
Adds report actions. |
src/components/reads/ReportArticleModal.svelte |
Adds report dialog; heading needs an accessible label ID. |
src/components/reads/ContentUnavailable.svelte |
Displays blocked-content fallback. |
src/components/LongformFoodFeed.svelte |
Filters explore content. |
package.json |
Bumps application version. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Deploying frontend with
|
| Latest commit: |
d10f4e4
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://202a3792.frontend-hvd.pages.dev |
| Branch Preview URL: | https://feat-reads-nsfw-blocklist.frontend-hvd.pages.dev |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ❌ Deployment failed View logs |
frontend | d10f4e4 | Sep 19 2026, 04:23 PM |
Co-authored-by: Cursor <cursoragent@cursor.com>
Verify signed events before auto-blocking, persist each auto-block as its own KV key, and treat an empty denylist overlay as a deliberate clear. 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
16c0ebba…79992plus the Mila / dasha naddrs) and overlay updates from Cloudflare KV so lists can change without a redeploy/r//readsnaddr routes; hits are logged and the author pubkey is auto-blocked/admin/reads-moderation(NIP-98) edits lists and reviews reportsTest plan
/reads/naddr1qvzqq…//r/…) and confirm “Content unavailable”, no article body/admin/reads-moderationpnpm exec vitest run src/lib/reads/moderation.test.ts src/lib/recipeOgHtml.server.test.tsMade with Cursor