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

Make content warnings part of the default section #305

Merged

Conversation

askmeaboutlo0m
Copy link
Contributor

Because I'm getting tired of repeating it for a bunch of sites.

The content warning will automatically be applied to Itaku, Mastodon, Misskey, Pixelfed and Pleroma. They can also overwrite the default via toggle switch, similar to how it works for descriptions. Probably mostly necessary for Itaku with its dinky 30 character limit.

The content warning can be included into the description using the {cw} shortcut. This is mostly useful for sites like Bluesky and Telegram, which support spoilers, but don't have a dedicated content warning field.

Backward compatibility with existing posts should be preserved: if the overwrite option is undefined, it will be guessed by the presence of a non-empty content warning text.

This also now consistently presents the field as "content warning" to the user, rather than revealing the internal "spoiler text" name. I've seen confused users on Mastodon thinking that PostyBirb didn't support content warnings because of the misnomer.

@@ -7,6 +7,7 @@ export interface DefaultOptions {
tags: TagData;
description: DescriptionData;
rating?: SubmissionRating | string;
spoilerText?: string;
Copy link
Owner

Choose a reason for hiding this comment

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

I think this idea is fine. Though I see a lot of undefined checks for the existence of the overwrite field.
I think in this case, it might be better to create this as a object type similar to tags or description (i.e. TagData, DescriptionData) where we have an object that contains the override flag. This will avoid having to create optional and specifically named prop checks and keep things standardized across all websites.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The checks are required anyway, due to backward compatibility with existing submissions that will be in the old state. So wrapping it up in some kind of spoilerTextData field wouldn't let us get rid of the spoilerText field, meaning we'd keep lugging around that inert field forever. Having a useless field and writing extra code for the questionable gain of being able to name fields weirdly seemed like a worse tradeoff to me than just adding to what's there.

Copy link
Owner

Choose a reason for hiding this comment

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

Fair enough I guess.
Will test this after the next version is out and merge if no issues.

Because I'm getting tired of repeating it for a bunch of sites.

The content warning will automatically be applied to Itaku, Mastodon,
Misskey, Pixelfed and Pleroma. They can also overwrite the default via
toggle switch, similar to how it works for descriptions. Probably mostly
necessary for Itaku with its dinky 30 character limit.

The content warning can be included into the description using the {cw}
shortcut. This is mostly useful for sites like Bluesky and Telegram,
which support spoilers, but don't have a dedicated content warning
field.

Backward compatibility with existing posts should be preserved: if the
overwrite option is undefined, it will be guessed by the presence of a
non-empty content warning text.

This also now consistently presents the field as "content warning" to
the user, rather than revealing the internal "spoiler text" name. I've
seen confused users on Mastodon thinking that PostyBirb didn't support
content warnings because of the misnomer.
@askmeaboutlo0m askmeaboutlo0m force-pushed the default-content-warnings branch from 9a20b41 to c096b06 Compare July 22, 2024 09:07
@mvdicarlo mvdicarlo merged commit baee24d into mvdicarlo:develop Jul 24, 2024
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.

2 participants