[Reporting] Add new reporting categories and reasons (#9079)

* start adding new report reasons

* cleanup

* use updated types

* cleanup open/closed logic

* other fix

* state fix

* rename type

* Update src/components/moderation/ReportDialog/utils/useReportOptions.ts

Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com>

* Update src/components/moderation/ReportDialog/utils/useReportOptions.ts

Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com>

* Update src/components/moderation/ReportDialog/utils/useReportOptions.ts

Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com>

* Update src/components/moderation/ReportDialog/index.tsx

Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com>

* Update src/components/moderation/ReportDialog/utils/useReportOptions.ts

Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com>

* Update src/components/moderation/ReportDialog/utils/useReportOptions.ts

Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com>

* Update src/components/moderation/ReportDialog/utils/useReportOptions.ts

Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com>

* Update src/components/moderation/ReportDialog/utils/useReportOptions.ts

Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com>

* Update src/components/moderation/ReportDialog/utils/useReportOptions.ts

Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com>

* Update src/components/moderation/ReportDialog/utils/useReportOptions.ts

Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com>

* Update src/components/moderation/ReportDialog/utils/useReportOptions.ts

Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com>

* Update src/components/moderation/ReportDialog/utils/useReportOptions.ts

Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com>

* Update src/components/moderation/ReportDialog/utils/useReportOptions.ts

Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com>

* Update src/components/moderation/ReportDialog/utils/useReportOptions.ts

Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com>

* Update src/components/moderation/ReportDialog/utils/useReportOptions.ts

Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com>

* add mapping

* Replace consts and maps using exported values

* Map to deprecated reason if necessary, send some reports only to Bluesky

* Use only new report reason types

* Cleanup

* Bump package, integrate new reasons

* Adjust sorting, return type, integrate feedback

* Just remove sort

* Finish 'other' handling

* Update descriptions

* Just invert filter logic, no functional change but feels more correct

* Clarify handling

* fix deep imports

* fix type error

* [Reporting] Integrate new `ReportDialog` into DMs (#9213)

* Update types, fork copy for convo vs message

* Integrate in remaining spots

* Replace DoneStep with separate dialog that opens after reporting

* Handle profile error state by just showing a success message

* Delete old dms ReportDialog

* Chats only go to bsky

* Only open block or delete dialog if submitted successfully

* make close button always large

* prevent expansion of blockordelete dialog

* Delete old report dialog (#9214)e

* Skip labeler selection for Bluesky-only cases

* Rename AfterReportDialog

---------

Co-authored-by: Samuel Newman <mozzius@protonmail.com>

---------

Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com>
Co-authored-by: Eric Bailey <git@esb.lol>
Co-authored-by: Samuel Newman <mozzius@protonmail.com>
This commit is contained in:
hailey
2025-11-06 13:40:13 -08:00
committed by GitHub
parent fd14bbfef9
commit d6ca9e6b41
20 changed files with 985 additions and 1369 deletions
@@ -18,7 +18,7 @@ export function parseReportSubject(
if ('convoId' in subject) {
return {
type: 'chatMessage',
type: 'convoMessage',
...subject,
}
}
@@ -1,121 +1,256 @@
import {useMemo} from 'react'
import {ComAtprotoModerationDefs} from '@atproto/api'
import {ToolsOzoneReportDefs as OzoneReportDefs} from '@atproto/api'
import {msg} from '@lingui/macro'
import {useLingui} from '@lingui/react'
export interface ReportOption {
reason: string
export type ReportCategory =
| 'childSafety'
| 'violencePhysicalHarm'
| 'sexualAdultContent'
| 'harassmentHate'
| 'misleading'
| 'ruleBreaking'
| 'selfHarm'
| 'other'
export type ReportCategoryConfig = {
key: ReportCategory
title: string
description: string
options: ReportOption[]
}
interface ReportOptions {
account: ReportOption[]
post: ReportOption[]
list: ReportOption[]
starterPack: ReportOption[]
feed: ReportOption[]
chatMessage: ReportOption[]
export type ReportOption = {
title: string
reason: OzoneReportDefs.ReasonType
}
export function useReportOptions(): ReportOptions {
export function useReportOptions() {
const {_} = useLingui()
return useMemo(() => {
const other = {
reason: ComAtprotoModerationDefs.REASONOTHER,
title: _(msg`Other`),
description: _(msg`An issue not included in these options`),
const categories: Record<ReportCategory, ReportCategoryConfig> = {
misleading: {
key: 'misleading',
title: _(msg`Misleading`),
description: _(msg`Spam or other inauthentic behavior or deception`),
options: [
{
title: _(msg`Spam`),
reason: OzoneReportDefs.REASONMISLEADINGSPAM,
},
{
title: _(msg`Scam`),
reason: OzoneReportDefs.REASONMISLEADINGSCAM,
},
{
title: _(msg`Fake account or bot`),
reason: OzoneReportDefs.REASONMISLEADINGBOT,
},
{
title: _(msg`Impersonation`),
reason: OzoneReportDefs.REASONMISLEADINGIMPERSONATION,
},
{
title: _(msg`False information about elections`),
reason: OzoneReportDefs.REASONMISLEADINGELECTIONS,
},
{
title: _(msg`Other misleading content`),
reason: OzoneReportDefs.REASONMISLEADINGOTHER,
},
],
},
sexualAdultContent: {
key: 'sexualAdultContent',
title: _(msg`Adult content`),
description: _(
msg`Unlabeled, abusive, or non-consensual adult content`,
),
options: [
{
title: _(msg`Unlabeled adult content`),
reason: OzoneReportDefs.REASONSEXUALUNLABELED,
},
{
title: _(msg`Adult sexual abuse content`),
reason: OzoneReportDefs.REASONSEXUALABUSECONTENT,
},
{
title: _(msg`Non-consensual intimate imagery`),
reason: OzoneReportDefs.REASONSEXUALNCII,
},
{
title: _(msg`Deepfake adult content`),
reason: OzoneReportDefs.REASONSEXUALDEEPFAKE,
},
{
title: _(msg`Animal sexual abuse`),
reason: OzoneReportDefs.REASONSEXUALANIMAL,
},
{
title: _(msg`Other sexual violence content`),
reason: OzoneReportDefs.REASONSEXUALOTHER,
},
],
},
harassmentHate: {
key: 'harassmentHate',
title: _(msg`Harassment or hate`),
description: _(msg`Abusive or discriminatory behavior`),
options: [
{
title: _(msg`Trolling`),
reason: OzoneReportDefs.REASONHARASSMENTTROLL,
},
{
title: _(msg`Targeted harassment`),
reason: OzoneReportDefs.REASONHARASSMENTTARGETED,
},
{
title: _(msg`Hate speech`),
reason: OzoneReportDefs.REASONHARASSMENTHATESPEECH,
},
{
title: _(msg`Doxxing`),
reason: OzoneReportDefs.REASONHARASSMENTDOXXING,
},
{
title: _(msg`Other harassing or hateful content`),
reason: OzoneReportDefs.REASONHARASSMENTOTHER,
},
],
},
violencePhysicalHarm: {
key: 'violencePhysicalHarm',
title: _(msg`Violence`),
description: _(msg`Violent or threatening content`),
options: [
{
title: _(msg`Animal welfare`),
reason: OzoneReportDefs.REASONVIOLENCEANIMAL,
},
{
title: _(msg`Threats or incitement`),
reason: OzoneReportDefs.REASONVIOLENCETHREATS,
},
{
title: _(msg`Graphic violent content`),
reason: OzoneReportDefs.REASONVIOLENCEGRAPHICCONTENT,
},
{
title: _(msg`Glorification of violence`),
reason: OzoneReportDefs.REASONVIOLENCEGLORIFICATION,
},
{
title: _(msg`Extremist content`),
reason: OzoneReportDefs.REASONVIOLENCEEXTREMISTCONTENT,
},
{
title: _(msg`Human trafficking`),
reason: OzoneReportDefs.REASONVIOLENCETRAFFICKING,
},
{
title: _(msg`Other violent content`),
reason: OzoneReportDefs.REASONVIOLENCEOTHER,
},
],
},
childSafety: {
key: 'childSafety',
title: _(msg`Child safety`),
description: _(msg`Harming or endangering minors`),
options: [
{
title: _(msg`Child Sexual Abuse Material (CSAM)`),
reason: OzoneReportDefs.REASONCHILDSAFETYCSAM,
},
{
title: _(msg`Grooming or predatory behavior`),
reason: OzoneReportDefs.REASONCHILDSAFETYGROOM,
},
{
title: _(msg`Privacy violation of a minor`),
reason: OzoneReportDefs.REASONCHILDSAFETYPRIVACY,
},
{
title: _(msg`Minor harassment or bullying`),
reason: OzoneReportDefs.REASONCHILDSAFETYHARASSMENT,
},
{
title: _(msg`Other child safety issue`),
reason: OzoneReportDefs.REASONCHILDSAFETYOTHER,
},
],
},
selfHarm: {
key: 'selfHarm',
title: _(msg`Self-harm or dangerous behaviors`),
description: _(msg`Harmful or high-risk activities`),
options: [
{
title: _(msg`Content promoting or depicting self-harm`),
reason: OzoneReportDefs.REASONSELFHARMCONTENT,
},
{
title: _(msg`Eating disorders`),
reason: OzoneReportDefs.REASONSELFHARMED,
},
{
title: _(msg`Dangerous challenges or activities`),
reason: OzoneReportDefs.REASONSELFHARMSTUNTS,
},
{
title: _(msg`Dangerous substances or drug abuse`),
reason: OzoneReportDefs.REASONSELFHARMSUBSTANCES,
},
{
title: _(msg`Other dangerous content`),
reason: OzoneReportDefs.REASONSELFHARMOTHER,
},
],
},
ruleBreaking: {
key: 'ruleBreaking',
title: _(msg`Breaking site rules`),
description: _(msg`Banned activities or security violations`),
options: [
{
title: _(msg`Hacking or system attacks`),
reason: OzoneReportDefs.REASONRULESITESECURITY,
},
{
title: _(msg`Promoting or selling prohibited items or services`),
reason: OzoneReportDefs.REASONRULEPROHIBITEDSALES,
},
{
title: _(msg`Banned user returning`),
reason: OzoneReportDefs.REASONRULEBANEVASION,
},
{
title: _(msg`Other network rule-breaking`),
reason: OzoneReportDefs.REASONRULEOTHER,
},
],
},
other: {
key: 'other',
title: _(msg`Other`),
description: _(msg`An issue not included in these options`),
options: [
{
title: _(msg`Other`),
reason: OzoneReportDefs.REASONOTHER,
},
],
},
}
const common = [
{
reason: ComAtprotoModerationDefs.REASONRUDE,
title: _(msg`Anti-Social Behavior`),
description: _(msg`Harassment, trolling, or intolerance`),
},
{
reason: ComAtprotoModerationDefs.REASONVIOLATION,
title: _(msg`Illegal and Urgent`),
description: _(msg`Glaring violations of law or terms of service`),
},
other,
]
return {
account: [
{
reason: ComAtprotoModerationDefs.REASONMISLEADING,
title: _(msg`Misleading Account`),
description: _(
msg`Impersonation or false claims about identity or affiliation`,
),
},
{
reason: ComAtprotoModerationDefs.REASONSPAM,
title: _(msg`Frequently Posts Unwanted Content`),
description: _(msg`Spam; excessive mentions or replies`),
},
{
reason: ComAtprotoModerationDefs.REASONVIOLATION,
title: _(msg`Name or Description Violates Community Standards`),
description: _(msg`Terms used violate community standards`),
},
other,
],
post: [
{
reason: ComAtprotoModerationDefs.REASONMISLEADING,
title: _(msg`Misleading Post`),
description: _(msg`Impersonation, misinformation, or false claims`),
},
{
reason: ComAtprotoModerationDefs.REASONSPAM,
title: _(msg`Spam`),
description: _(msg`Excessive mentions or replies`),
},
{
reason: ComAtprotoModerationDefs.REASONSEXUAL,
title: _(msg`Unwanted Sexual Content`),
description: _(msg`Nudity or adult content not labeled as such`),
},
...common,
],
chatMessage: [
{
reason: ComAtprotoModerationDefs.REASONSPAM,
title: _(msg`Spam`),
description: _(msg`Excessive or unwanted messages`),
},
{
reason: ComAtprotoModerationDefs.REASONSEXUAL,
title: _(msg`Unwanted Sexual Content`),
description: _(msg`Inappropriate messages or explicit links`),
},
...common,
],
list: [
{
reason: ComAtprotoModerationDefs.REASONVIOLATION,
title: _(msg`Name or Description Violates Community Standards`),
description: _(msg`Terms used violate community standards`),
},
...common,
],
starterPack: [
{
reason: ComAtprotoModerationDefs.REASONVIOLATION,
title: _(msg`Name or Description Violates Community Standards`),
description: _(msg`Terms used violate community standards`),
},
...common,
],
feed: [
{
reason: ComAtprotoModerationDefs.REASONVIOLATION,
title: _(msg`Name or Description Violates Community Standards`),
description: _(msg`Terms used violate community standards`),
},
...common,
],
categories: Object.values(categories) as ReportCategoryConfig[],
getCategory(reasonName: ReportCategory) {
return categories[reasonName]
},
}
}, [_])
}