Replace "Always show content warning" option with Mastodon-styled content warning button #293

Closed
s0ulf3re wants to merge 12 commits from s0ulf3re/akkoma-fe:s0ulf3re/contentWarningRework into develop
First-time contributor

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.

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.
s0ulf3re added 11 commits 2023-03-22 23:52:19 +00:00
Merge pull request 'port MFM link into stable docs' (#38) from develop into stable
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
d03872d598
Reviewed-on: AkkomaGang/pleroma-fe#38
Merge pull request 'stable release' (#130) from develop into stable
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
5972d89117
Reviewed-on: AkkomaGang/pleroma-fe#130
Merge pull request '2022.09 stable' (#160) from develop into stable
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
d7499a1f91
Reviewed-on: AkkomaGang/pleroma-fe#160
Merge pull request '2022.10 stable' (#177) from develop into stable
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
c8c8d40827
Reviewed-on: AkkomaGang/pleroma-fe#177
Merge pull request '2022.11 stable release' (#202) from develop into stable
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
975f04bf5a
Reviewed-on: AkkomaGang/pleroma-fe#202
Merge pull request 'hotfix: translation' (#207) from develop into stable
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
80a519d7e4
Reviewed-on: AkkomaGang/pleroma-fe#207
Merge pull request 'hotfix: mfm mysteries' (#215) from develop into stable
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2c9b73646c
Reviewed-on: AkkomaGang/pleroma-fe#215
Merge branch 'develop' into stable
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
9c9b4cc07c
Merge branch 'develop' into stable
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
8569b5946e
Merge branch 'develop' into stable
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline was successful
85abc62213
Removed "Always show Content Warning" option
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
cd5a09935e
s0ulf3re added 1 commit 2023-03-26 23:54:19 +00:00
Merge branch 'develop' into s0ulf3re/contentWarningRework
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
2713ca0c3e
floatingghost reviewed 2023-03-30 10:11:58 +00:00
floatingghost left a comment
Owner

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 a cross, you might want to switch this to an eye to unify it with the icon chosen for the CW input itself

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 a `cross`, 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

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 anything

also, because you check the show condition before switching it, it'll try and focus when it's not visible

this.showingContentWarning = !this.showingContentWarning
if (this.showingContentWarning) {
  this.$nextTick(() => this.$refs['contentWarningField'].focus())
}

should solve this i think

due to the field being hidden under a v-if, we'll need to wait for the next rendering tick for `focus` to do anything also, because you check the show condition _before_ switching it, it'll try and focus when it's not visible ```javascript this.showingContentWarning = !this.showingContentWarning if (this.showingContentWarning) { this.$nextTick(() => this.$refs['contentWarningField'].focus()) } ``` 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 similar

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 similar
Contributor

this pull request removes the "always show content warning" option from settings

Can 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.

> this pull request removes the "always show content warning" option from settings Can 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.
Mergan added the
Feature
label 2023-04-12 00:32:57 +00:00

superceded by #362

superceded by #362
floatingghost closed this pull request 2023-12-20 18:50:02 +00:00
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful

Pull request closed

Sign in to join this conversation.
No description provided.