Skip to content
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

CleanFeed: Add option to treat specified tags as mature #1185

Merged
merged 11 commits into from
Aug 20, 2023
Merged

CleanFeed: Add option to treat specified tags as mature #1185

merged 11 commits into from
Aug 20, 2023

Conversation

enchanted-sword
Copy link
Contributor

Description

Resolves #1178
Adds an option to treat specified tags as mature in the same way specified blogs can be treated as mature

Testing steps

Add a tag to the text field in the CleanFeed options and view a post with said tag

@enchanted-sword enchanted-sword changed the title Add option to treat specified tags as mature CleanFeed: Add option to treat specified tags as mature Aug 10, 2023
@marcustyphoon
Copy link
Collaborator

I don't think we can rename the localFlagging preference parameter without ensuring that the user's current preference is migrated by making use of the "inherit" preference key, as seen in the last few entries of no_recommended.json and in hide_mini_follow in tweaks.json.

@enchanted-sword
Copy link
Contributor Author

enchanted-sword commented Aug 10, 2023

I don't think we can rename the localFlagging preference parameter without ensuring that the user's current preference is migrated by making use of the "inherit" preference key, as seen in the last few entries of no_recommended.json and in hide_mini_follow in tweaks.json.

Ah, makes sense, I'll set it to inherit the value of cleanfeed.preferences.localFlagging.

@marcustyphoon
Copy link
Collaborator

Any opinions on, sort of related to #982, the idea of allowing both a tag and #a tag in the input box by stripping any leading hash characters when processing the preference input?

@enchanted-sword
Copy link
Contributor Author

I did think about that, and my reasoning for not adding it was that having the default values nsfw, nsft with no hash prefix would indicate that the values don't need to have a hash prefix, but I suppose it wouldn't hurt to include it anyways. In the same vein, it might be a good idea to set the preference value strings to lowercase.

marcustyphoon
marcustyphoon previously approved these changes Aug 19, 2023
Copy link
Collaborator

@marcustyphoon marcustyphoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functionality looks good to me! Not sure if anyone has opinions about the default contents of the tags field; I could imagine having one but I can't think of anything.

@marcustyphoon
Copy link
Collaborator

Did that commit change anything, out of curiosity? localBlogFlagging.split(',').toLowerCase() would have been a bug, calling toLowerCase on an array, but localBlogFlagging.toLowerCase().split(',') seems fine.

(Not that it matters if it didn't; whichever way feels more clear is better!)

@enchanted-sword
Copy link
Contributor Author

Did that commit change anything, out of curiosity? localBlogFlagging.split(',').toLowerCase() would have been a bug, calling toLowerCase on an array, but localBlogFlagging.toLowerCase().split(',') seems fine.

I think I spent too long looking at stylesheets yesterday lol, for some reason I looked at it again and thought I had tried to use toLowerCase() on an array so I changed it After this gets merged I was planning on working on #1188 so I can always just standardize it then.

@marcustyphoon
Copy link
Collaborator

Yeah, to be fair, the fact that the previous way made us both have to think about (I started thinking about implicit type coercion) s a good sign that the new way is a clarity improvement :D

Thanks for contributing!

@marcustyphoon marcustyphoon merged commit 17615a9 into AprilSylph:master Aug 20, 2023
2 checks passed
@enchanted-sword enchanted-sword deleted the cleanfeed-tags branch December 2, 2023 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cleanfeed: filter posts with specified tags
2 participants