-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ Show subject stats/summary #279
Conversation
@@ -81,6 +91,55 @@ export function SubjectTable( | |||
) | |||
} | |||
|
|||
const SubjectSummaryColumn = ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for now, we don't want to expose all stats we have. chatted with mod team and agreed that these stats may impact decisions in unwanted ways.
const setMinAccountSuspendCount = (minAccountSuspendCount?: number) => { | ||
updateFilters({ minAccountSuspendCount }) | ||
} | ||
|
||
const setMinReportedRecordsCount = (minReportedRecordsCount?: number) => { | ||
updateFilters({ minReportedRecordsCount }) | ||
} | ||
|
||
const setMinTakendownRecordsCount = (minTakendownRecordsCount?: number) => { | ||
updateFilters({ minTakendownRecordsCount }) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: It feels like exposing both updateFilters
and a helper that wraps updateFilters
can be confusing when using the API. Couldn't we just require users of this hook to do:
const { updateFilters } = useQuereFilter()
updateFilters({ minTakendownRecordsCount: value })
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed but we are not really using the updateFilters
anywhere outside of the hook so I'll just remove it from the returned object.
const { takedownCount, suspendCount, appealCount, reportCount } = stats | ||
// Dont want to make the UI noisy with appeal count if we're in summary mode and already showing takedown and suspension | ||
const shouldShowAppeal = | ||
appealCount && (showAll || !takedownCount || !suspendCount) | ||
// Dont want to make the UI noisy with report count if we're in summary mode and we have both takedown and suspension count | ||
const shouldShowReport = | ||
reportCount && (showAll || (!takedownCount && !suspendCount)) | ||
const hasStats = takedownCount || suspendCount || appealCount || reportCount |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO A zero
should count as "has stats". But if that's really not what you want, this could should explicitly account for 0
vs undefined
.
const { takedownCount, suspendCount, appealCount, reportCount } = stats | |
// Dont want to make the UI noisy with appeal count if we're in summary mode and already showing takedown and suspension | |
const shouldShowAppeal = | |
appealCount && (showAll || !takedownCount || !suspendCount) | |
// Dont want to make the UI noisy with report count if we're in summary mode and we have both takedown and suspension count | |
const shouldShowReport = | |
reportCount && (showAll || (!takedownCount && !suspendCount)) | |
const hasStats = takedownCount || suspendCount || appealCount || reportCount | |
const { takedownCount, suspendCount, appealCount, reportCount } = stats | |
// Dont want to make the UI noisy with appeal count if we're in summary mode and already showing takedown and suspension | |
const shouldShowAppeal = appealCount == null | |
? true // No data <== I suggest we *do* show that we don't have data | |
: showAll || | |
!takedownCount || // No data or zero | |
!suspendCount // No data or zero | |
// Dont want to make the UI noisy with report count if we're in summary mode and we have both takedown and suspension count | |
const shouldShowReport = reportCount == null | |
? true // no data <== | |
: showAll || (!takedownCount && !suspendCount) | |
const hasStats = | |
takedownCount != null || | |
suspendCount != null || | |
appealCount != null || | |
reportCount != null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
generally agreed but I don't think it impacts mod decisions to know that "we don't have stats" vs. the stats is 0 and I'm trying to be cautious about making the UI too noisy with stats.
at least to start with, I see these as additional metadata to help enforce decisions made from other factors already rather than a primary factor for making decision.
) | ||
} | ||
|
||
export const RecordsStats = ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, I suggest we
- make a clear distinction between
0
andundefined
, to make the business logic clearer in the code - that we do not use
undefined
as a reason not to show something (using a question mark in that case)
Depends on bluesky-social/atproto#3236
This PR shows moderation stats/summary for subjects/accounts.