Replace "Always show content warning" option with Mastodon-styled content warning button #293
No reviewers
Labels
No labels
a11y
Bug
Bug fix
Critical Priority
Documentation
Feature
Feature request
Held for next release cycle
High Priority
Low Priority
Medium Priority
Minor change
Translation/Locale
WIP
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: AkkomaGang/akkoma-fe#293
Loading…
Reference in a new issue
No description provided.
Delete branch "s0ulf3re/akkoma-fe:s0ulf3re/contentWarningRework"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
So I decided to rewrite a little bit of the Akkoma Frontend to include an actual content warning button much like on Mastodon. I thought it looked a little odd to have the content warning out all the time. I'm sorry if this isn't something that's wanted. I just decided to work on it to learn the code a little bit and figured that since it seems to be working so far (tested with the main panel), I would at least upload it here.
Basically, this pull request removes the "always show content warning" option from settings. And in it's place, a content warning button is added directly under the post field. When it's clicked, the field then appears and can have a warning typed in. When it isn't shown, nothing is sent.
i actually like the general style of this
i've got some feedback on the code itself, but there's also the question of how to make it consistent within the application - the
hide image
icon that appears over content-warning images is currently across
, you might want to switch this to an eye to unify it with the icon chosen for the CW input itself@ -100,6 +100,7 @@ const PostStatusForm = {
'isRedraft'
],
emits: [
'contentWarningFieldVisible',
i don't think you're actually emitting this event anywhere, so you can probably remove this
@ -679,0 +689,4 @@
showContentWarningField() {
if (this.showingContentWarning === true) {
console.log(this.showingContentWarning)
this.$refs['contentWarningField'].focus()
due to the field being hidden under a v-if, we'll need to wait for the next rendering tick for
focus
to do anythingalso, because you check the show condition before switching it, it'll try and focus when it's not visible
should solve this i think
@ -263,0 +272,4 @@
<!-- Content Warning Button -->
<button
class="emoji-icon button-unstyled"
:title="$t('Add content warning')"
translated strings are done via keys into the i18n json - see src/i18n/en.json
so you'd probably want this to be
$('post_status.add_content_warning_button')
or similarCan we keep both? We can have "always show content warning" on -> the field always shows, no button and "always show content warning" off -> the field is hidden until you click the button.
One of the things I like about Pleroma/Akkoma FE is its customizability; I don't find it necessary to remove this option.
superceded by #362
Pull request closed