-
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
❇️ Language filter on moderation queue #25
Conversation
What we're going to want in the short-term is one "unreviewed" queue which is only Japanese (this PR makes this possible), and another "unreviewed" which is everything except Japanese. To support this, maybe we need backend support for "not" tag filtering? As a small UI tweak, I think we'll probably want the most common options at the top of the language drop-down menu: "everything", "english", "japanese", "portuguese", "german", "everything minus japanese" |
@bnewbold makes sense! I built the dropdown to be a bit more robust so that we can choose multiple language and exclude multiple languages from the queue. Of course, this also covers the use-case you drew out. |
Your Render PR Server URL is https://ozone-staging-pr-25.onrender.com. Follow its progress at https://dashboard.render.com/web/srv-cn9noeg21fec73e7cs5g. |
Your Render PR Server URL is https://ozone-sandbox-pr-25.onrender.com. Follow its progress at https://dashboard.render.com/web/srv-cn9nof821fec73e7csd0. |
components/common/LanguagePicker.tsx
Outdated
const excludedTags = excludeTagsParam?.split(',') || [] | ||
const includedLanguages = tags | ||
.filter((tag) => tag.includes('lang:')) | ||
.map((tag) => tag.split(':')[1]) |
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.
This little snippet tag.split(':')[1]
could be nicely self-documented by pulling it out into a function with a nice name.
components/common/LanguagePicker.tsx
Outdated
.filter((tag) => tag.includes('lang:')) | ||
.map((tag) => tag.split(':')[1]) | ||
const excludedLanguages = excludedTags | ||
.filter((tag) => tag.includes('lang:')) |
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.
Probably fine either way, but figure this is just as easy!
.filter((tag) => tag.includes('lang:')) | |
.filter((tag) => tag.startsWith('lang:')) |
onClick={() => !isDisabled && onSelect(code2)} | ||
key={code2} | ||
> | ||
{LANGUAGES_MAP_CODE2[code2].name} |
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.
Is there anything that guarantees that LANGUAGES_MAP_CODE2[code2]
will exist? Maybe we could just document near availableLanguageCodes
that it must be a subset of LANGUAGES_MAP_CODE2
. Alternately we could mark certain items in LANGUAGES_MAP_CODE2
as "available".
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.
yeah documenting availableLanguageCodes
should do the job because the languages I've added are the ones that bryan suggested and overtime we may add more but even then, the LANGUAGES_MAP_CODE2
is quite comprehensive so I don't see a lang code ever missing there.
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.
💎
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.
overall, this looks great!
I tested a bit in prod and excluding Japanese didn't seem to work. When toggling through "quick take action" (aka, left/right arrow keys), I came across japanese posts, and could see that they had been tagged lang:ja
, and I could confirm that language filter setting was just "not japanese" (no positive selection).
Depends on bluesky-social/atproto#2161
language_filter.mov
Updated look at the language picker 👇🏽
Notice that it allows moderators to select one or more languages and/or exclude one or more languages from the queue.