feat: cases (reports, rating reviews, removal and deletion requests, appeals) and notifications
Pull request / title (pull_request) Successful in 1s
CI / test (pull_request) Successful in 1m5s
CI / image (apps/api/Dockerfile, t5de-hub-api) (pull_request) Skipped
CI / image (apps/web/Dockerfile, t5de-hub-web) (pull_request) Skipped

Cases are one queue for what someone has to decide, each with a thread (internal notes for those deciding), an
assignee and a decision. Reports about a product go to the teams of the catalogs hosting it and to moderators, and
only the reporter and moderators know who reported. A creator lowering a rating opens a rating review; a catalog's
owner asking to delete it opens a deletion request; a catalog's team can ask for a product's removal everywhere; the
person an action affected can appeal it once, decided by another moderator (an admin may decide their own, flagged).
Resolving carries the case out: the rating is lowered, the product removed, the catalog deleted.

Notifications reach people on the website (a bell with the unread count) and their proxies (realtime): moderators'
edits to their products, removals and restores, decisions and replies on their cases, membership decisions.

Also: moderators can restore a removed product, and a product's creator and moderators can see it when it's adult
without an adult account (getting and wearing it still need one).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
dhkatzandClaude Opus 5.5 committed 2026-11-05 07:03:59 -08:00
1 parent e07a6c6dac
commit 8af4b7b6a9
33 files changed
+5228 -44

No files matched your search

@@ -14,6 +14,7 @@ import { NativeSelect, NativeSelectOption } from "@/components/ui/native-select"
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table";
import { api, unwrap, type CatalogMember, type CatalogPage } from "@/lib/api";
import { AuditTable } from "../../audit-table";
import { requestDeletion, requestRemoval } from "../../cases/actions";
import { ConsoleNav, requireConsole } from "../../console-nav";
import {
addOperator,
@@ -357,6 +358,21 @@ export default async function ManageCatalog({ params }: { params: Promise<{ id:
</SubmitButton>
</div>
</ActionForm>
{!p.removed && (
<details className="mt-1 text-left text-xs">
<summary className="cursor-pointer text-right text-muted-foreground hover:text-foreground">
Ask moderators to remove it everywhere
</summary>
<ActionForm action={requestRemoval} fields={{ catalog: id, product: p.id }} className="mt-2">
<div className="flex justify-end gap-2">
<Input name="reason" placeholder="Why" aria-label="Why" required maxLength={2000} className="h-8 w-48" />
<SubmitButton size="sm" variant="outline" pendingLabel="Asking…">
Ask
</SubmitButton>
</div>
</ActionForm>
</details>
)}
</TableCell>
)}
</TableRow>
@@ -394,6 +410,28 @@ export default async function ManageCatalog({ params }: { params: Promise<{ id:
</Card>
)}
{has("catalog:delete-request") && c.status !== "deleted" && (
<Card>
<CardHeader>
<CardTitle>Delete Catalog</CardTitle>
<CardDescription>
Moderators review deletions for now. Once deleted, nothing is available from it; people who got its products
keep them only where other catalogs host them.
</CardDescription>
</CardHeader>
<CardContent>
<ActionForm action={requestDeletion} fields={{ id }}>
<div className="flex max-w-xl gap-2">
<Input name="reason" placeholder="Why" aria-label="Why" required maxLength={2000} />
<SubmitButton variant="destructive" pendingLabel="Asking…" confirm={`Ask moderators to delete ${c.name}?`}>
Ask to delete
</SubmitButton>
</div>
</ActionForm>
</CardContent>
</Card>
)}
<Card>
<CardHeader>
<CardTitle>Recent Changes</CardTitle>