Bluesky app fork with some witchin' additions ๐Ÿ’ซ
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

[๐Ÿด] Switch back to encouraging users to report messages (#4117)

* Swap prompt back in

* Remove unused convoAccount affordances

authored by

Eric Bailey and committed by
GitHub
d0bfe703 cc7a0da1

+39 -63
-3
src/components/ReportDialog/SelectReportOptionView.tsx
··· 58 58 } else if (props.params.type === 'convoMessage') { 59 59 title = _(msg`Report this message`) 60 60 description = _(msg`Why should this message be reviewed?`) 61 - } else if (props.params.type === 'convoAccount') { 62 - title = _(msg`Report this account`) 63 - description = _(msg`Why should this account be reviewed?`) 64 61 } 65 62 66 63 return {
-1
src/components/ReportDialog/types.ts
··· 13 13 did: string 14 14 } 15 15 | {type: 'convoMessage'} 16 - | {type: 'convoAccount'} 17 16 }
+2 -5
src/components/dms/ConvoMenu.tsx
··· 21 21 import {atoms as a, useTheme} from '#/alf' 22 22 import {BlockedByListDialog} from '#/components/dms/BlockedByListDialog' 23 23 import {LeaveConvoPrompt} from '#/components/dms/LeaveConvoPrompt' 24 - import {ReportDialog} from '#/components/dms/ReportDialog' 24 + import {ReportConversationPrompt} from '#/components/dms/ReportConversationPrompt' 25 25 import {ArrowBoxLeft_Stroke2_Corner0_Rounded as ArrowBoxLeft} from '#/components/icons/ArrowBoxLeft' 26 26 import {DotGrid_Stroke2_Corner0_Rounded as DotsHorizontal} from '#/components/icons/DotGrid' 27 27 import {Flag_Stroke2_Corner0_Rounded as Flag} from '#/components/icons/Flag' ··· 205 205 convoId={convo.id} 206 206 currentScreen={currentScreen} 207 207 /> 208 - <ReportDialog 209 - control={reportControl} 210 - params={{type: 'convoAccount', did: profile.did, convoId: convo.id}} 211 - /> 208 + <ReportConversationPrompt control={reportControl} /> 212 209 <BlockedByListDialog 213 210 control={blockedByListControl} 214 211 listBlocks={listBlocks}
+2 -5
src/components/dms/MessagesListBlockedFooter.tsx
··· 12 12 import {Divider} from '#/components/Divider' 13 13 import {BlockedByListDialog} from '#/components/dms/BlockedByListDialog' 14 14 import {LeaveConvoPrompt} from '#/components/dms/LeaveConvoPrompt' 15 - import {ReportDialog} from '#/components/dms/ReportDialog' 15 + import {ReportConversationPrompt} from '#/components/dms/ReportConversationPrompt' 16 16 import {Text} from '#/components/Typography' 17 17 18 18 export function MessagesListBlockedFooter({ ··· 120 120 convoId={convoId} 121 121 /> 122 122 123 - <ReportDialog 124 - control={reportControl} 125 - params={{type: 'convoAccount', did: recipient.did, convoId}} 126 - /> 123 + <ReportConversationPrompt control={reportControl} /> 127 124 128 125 <BlockedByListDialog 129 126 control={blockedByListControl}
+27
src/components/dms/ReportConversationPrompt.tsx
··· 1 + import React from 'react' 2 + import {msg} from '@lingui/macro' 3 + import {useLingui} from '@lingui/react' 4 + 5 + import {DialogControlProps} from '#/components/Dialog' 6 + import * as Prompt from '#/components/Prompt' 7 + 8 + export function ReportConversationPrompt({ 9 + control, 10 + }: { 11 + control: DialogControlProps 12 + }) { 13 + const {_} = useLingui() 14 + 15 + return ( 16 + <Prompt.Basic 17 + control={control} 18 + title={_(msg`Report conversation`)} 19 + description={_( 20 + msg`To report a conversation, please report one of its messages via the conversation screen. This lets our moderators understand the context of your issue.`, 21 + )} 22 + confirmButtonCta={_(msg`I understand`)} 23 + onConfirm={() => {}} 24 + showCancel={false} 25 + /> 26 + ) 27 + }
+8 -35
src/components/dms/ReportDialog.tsx
··· 25 25 import {Text} from '../Typography' 26 26 import {MessageItemMetadata} from './MessageItem' 27 27 28 - type ReportDialogParams = 29 - | { 30 - type: 'convoAccount' 31 - did: string 32 - convoId: string 33 - } 34 - | { 35 - type: 'convoMessage' 36 - convoId: string 37 - message: ChatBskyConvoDefs.MessageView 38 - } 28 + type ReportDialogParams = { 29 + type: 'convoMessage' 30 + convoId: string 31 + message: ChatBskyConvoDefs.MessageView 32 + } 39 33 40 34 let ReportDialog = ({ 41 35 control, ··· 76 70 77 71 function ReasonStep({ 78 72 setReportOption, 79 - params, 80 73 }: { 81 74 setReportOption: (reportOption: ReportOption) => void 82 75 params: ReportDialogParams ··· 87 80 <SelectReportOptionView 88 81 labelers={[]} 89 82 goBack={control.close} 90 - params={ 91 - params.type === 'convoMessage' 92 - ? { 93 - type: 'convoMessage', 94 - } 95 - : { 96 - type: 'convoAccount', 97 - } 98 - } 83 + params={{ 84 + type: 'convoMessage', 85 + }} 99 86 onSelectReportOption={setReportOption} 100 87 /> 101 88 ) ··· 138 125 } satisfies ComAtprotoModerationCreateReport.InputSchema 139 126 140 127 await getAgent().createModerationReport(report) 141 - } else if (params.type === 'convoAccount') { 142 - const {convoId, did} = params 143 - 144 - await getAgent().createModerationReport({ 145 - reasonType: reportOption.reason, 146 - subject: { 147 - $type: 'com.atproto.admin.defs#repoRef', 148 - did, 149 - }, 150 - reason: details + ` โ€”ย from:dms:${convoId}`, 151 - }) 152 128 } 153 129 }, 154 130 onSuccess: () => { ··· 162 138 return { 163 139 convoMessage: { 164 140 title: _(msg`Report this message`), 165 - }, 166 - convoAccount: { 167 - title: _(msg`Report this account`), 168 141 }, 169 142 }[params.type] 170 143 }, [_, params])
-14
src/lib/moderation/useReportOptions.ts
··· 16 16 feedgen: ReportOption[] 17 17 other: ReportOption[] 18 18 convoMessage: ReportOption[] 19 - convoAccount: ReportOption[] 20 19 } 21 20 22 21 export function useReportOptions(): ReportOptions { ··· 75 74 ...common, 76 75 ], 77 76 convoMessage: [ 78 - { 79 - reason: ComAtprotoModerationDefs.REASONSPAM, 80 - title: _(msg`Spam`), 81 - description: _(msg`Excessive or unwanted messages`), 82 - }, 83 - { 84 - reason: ComAtprotoModerationDefs.REASONSEXUAL, 85 - title: _(msg`Unwanted Sexual Content`), 86 - description: _(msg`Inappropriate messages or explicit links`), 87 - }, 88 - ...common, 89 - ], 90 - convoAccount: [ 91 77 { 92 78 reason: ComAtprotoModerationDefs.REASONSPAM, 93 79 title: _(msg`Spam`),