Feature/add sticker picker #2152

Closed
absturztaube wants to merge 25 commits from gitlab-mr-iid-885 into develop
Member

adds sticker picker to post status form as well as 2 stickerpacks

adds sticker picker to post status form as well as 2 stickerpacks
Member

use bare fetch. we have fetch in scope.

use bare fetch. we have fetch in scope.
Member

regarding the sticker packs, anything we distribute with Pleroma, we need to know what the copyright + redistribution terms are. can you get that information for us?

regarding the sticker packs, anything we distribute with Pleroma, we need to know what the copyright + redistribution terms are. can you get that information for us?
Member

Object.entries

Object.entries
Member
              :class="{ selected: stickerPickerVisible }"
```suggestion :class="{ selected: stickerPickerVisible }" ```
Member

or just use v-if?

or just use v-if?
Member

not sure, eslint might disallow this, we probably should allow it tho

not sure, eslint might disallow this, we probably should allow it tho
Member

i feel like this is a huge wraparound, if you already know the url you probably can already use it, no need to reupload it, just reference the url

i feel like this is a huge wraparound, if you already know the url you probably can already use it, no need to reupload it, just reference the url
Member

we already have a tab-switcher component for such things

we already have a tab-switcher component for such things
Member

icon is visible even if there are no stickers

icon is visible even if there are no stickers
Member

image

some UX/UI concerns:

  • de-saturating icons makes it harder to see and recognize them, glow would probably be better
  • no meaningful names or hover text for anything, filenames are garbage too
  • having stickers.json and other stuff in git makes it harder to customize it for admins.
  • a bit weird and not clear convention - list references tabs and it's assumes that there should be tab.png and pack.json, directly referencing pack.json and listing tab icon in pack.json would be better.
  • grid is somewhat ugly with that empty space on the right
![image](/attachments/969109de-dcbb-4bed-a5f8-2ae6212cef2e) some UX/UI concerns: * de-saturating icons makes it harder to see and recognize them, glow would probably be better * no meaningful names or hover text for anything, filenames are garbage too * having stickers.json and other stuff in git makes it harder to customize it for admins. * a bit weird and not clear convention - list references tabs and it's assumes that there should be tab.png and pack.json, directly referencing pack.json and listing tab icon in pack.json would be better. * grid is somewhat ugly with that empty space on the right
185 KiB
Member

also don't like including shitton of images in the repo without LFS, on top of that, as i mentioned before having stuff in git makes it harder to customize it for admins. and lastly - probably should be either in separate repo like our emojis pseudoAPT repo or probably even backend.

also don't like including shitton of images in the repo without LFS, on top of that, as i mentioned before having stuff in git makes it harder to customize it for admins. and lastly - probably should be either in separate repo like our emojis pseudoAPT repo or probably even backend.
Member

space after comma please

space after comma please
Member

also why not fetch everything at once like we do with emojis? this makes fetch every time you change tab.

also why not fetch everything at once like we do with emojis? this makes fetch every time you change tab.
Member

i don't think you actually need it, you're using arrow functions

i don't think you actually need it, you're using arrow functions
Member

this doesn't work very well with transparent-ish themes and also overall a bad choice

this doesn't work very well with transparent-ish themes and also overall a bad choice
Member

miko fox redistribution terms are 1 euro on line sticker store, lol https://store.line.me/stickershop/product/1259582

miko fox redistribution terms are 1 euro on line sticker store, lol https://store.line.me/stickershop/product/1259582
Member

the other one is 2 euros wwwwwwwwwwwwww https://store.line.me/stickershop/product/1333431/en

the other one is 2 euros wwwwwwwwwwwwww https://store.line.me/stickershop/product/1333431/en
Member

sounds like we probably shouldn't redistribute them then :)

maybe a pleroma-tan sticker pack would be best to include :)

sounds like we probably shouldn't redistribute them then :) maybe a pleroma-tan sticker pack would be best to include :)
Author
Member

this is a huge wraparound, yes. i did it this way because statusPosterService.postStatus just uses the ids of attachment and i couldn't think of another way to attach the sticker to the post.
am i missing something here?

this is a huge wraparound, yes. i did it this way because statusPosterService.postStatus just uses the ids of attachment and i couldn't think of another way to attach the sticker to the post. am i missing something here?
Author
Member

tab-switcher doesn't provide a possibility to use images as tab labels yet. should i add it?

edit: sorry, replied to the wrong comment

tab-switcher doesn't provide a possibility to use images as tab labels yet. should i add it? edit: sorry, replied to the wrong comment
Member

not entirely sure, but i'd mess around to see what could be done. otherwise leave a TODO there

not entirely sure, but i'd mess around to see what could be done. otherwise leave a TODO there
Member

yeah, that would be a nice option.

yeah, that would be a nice option.
Author
Member

i removed the sticker packs

i removed the sticker packs
Author
Member

filenames are garbage but we can't really control them because they are derived from the sticker packs.

filenames are garbage but we can't really control them because they are derived from the sticker packs.
Author
Member

@hj review please

@hj review please
Author
Member

i noticed that the tab-switcher loads the content of all its tabs at once. because i have many stickerpacks on my instance it produces tons of requests for fetching the images (which takes quite some time). does the tab-switcher support loading content only if tab is opened?

i noticed that the tab-switcher loads the content of all its tabs at once. because i have many stickerpacks on my instance it produces tons of requests for fetching the images (which takes quite some time). does the tab-switcher support loading content only if tab is opened?
Member

it does, but i'm not sure if i added tab-switch hooks as i wanted or not.

it does, but i'm not sure if i added tab-switch hooks as i wanted or not.
Member

we can enforce good practice of naming them correctly at least.

we can enforce good practice of naming them correctly at least.
Member

instead of having an array and pushing into it you can just do

const stickers = Object.entries(values).map(([key, value]) => {
  return {
    whatever: data.you.want
  }
})
instead of having an array and pushing into it you can just do ```js const stickers = Object.entries(values).map(([key, value]) => { return { whatever: data.you.want } }) ```
Member
          pack: name,
          path,
          meta
```suggestion:-2 pack: name, path, meta ```
Member

maybe add console.warn at least?

maybe add console.warn at least?
Member

image

stickers/poll icons look weird on mobile

![image](/attachments/e4a9875b-dc65-470d-835e-c431bf43092e) stickers/poll icons look weird on mobile
Member

i'd use just v-if here instead of inside the component

i'd use just v-if here instead of inside the component
Member

overall looks good, except for broken tab icons, but i just reused stickers from earlier commit, not sure if you changed format.

and yeah, format, we probably still need to discuss format and distribution and how backend gonna serve those, because backend doesn't like including stuff in frontend.

overall looks good, except for broken tab icons, but i just reused stickers from earlier commit, not sure if you changed format. and yeah, format, we probably still need to discuss format and distribution and how backend gonna serve those, because backend doesn't like including stuff in frontend.
Member

couldn't lazyloading everything fix this?

couldn't lazyloading everything fix this?
Member

not sure what you mean by that

not sure what you mean by that
Author
Member

@hj review please

some notes:

  • the render-only-focused attribute on the tab-switcher did the job to prevent loading all sticker images at once
  • had to move the sorting to after_store because it caused issues if 2 pickers are opened at once (pack() in sticker_picker.js got called endlessly in that case)
  • as for the broken tab icons, i changed the format a bit so pack.json references the tab icon
{
  "author": "absturztaube",
  "title": "Miko-san of foxes",
  "tabIcon": "tab.png",
  "stickers": [
@hj review please some notes: - the render-only-focused attribute on the tab-switcher did the job to prevent loading all sticker images at once - had to move the sorting to after_store because it caused issues if 2 pickers are opened at once (pack() in sticker_picker.js got called endlessly in that case) - as for the broken tab icons, i changed the format a bit so pack.json references the tab icon ``` { "author": "absturztaube", "title": "Miko-san of foxes", "tabIcon": "tab.png", "stickers": [ ```
Member

I've deployed this on pleroma.site and it seems to be working well. What blocks merging this?

I've deployed this on pleroma.site and it seems to be working well. What blocks merging this?
Member

gonna check it one more time today

gonna check it one more time today
Member

resolved

resolved
Member

remove the eslint-disable comment it should not be triggering now

remove the eslint-disable comment it should not be triggering now
Member

looks good, just need to remove that one eslint-disable line (dunno if it would still yell at you or not tho)

even if format isn't perfect we can always make a v2 of it in the future

looks good, just need to remove that one eslint-disable line (dunno if it would still yell at you or not tho) even if format isn't perfect we can always make a v2 of it in the future
Author
Member

it didn't yell at me.

it didn't yell at me.
Member

moce

moce

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
pleroma/pleroma-fe!2152
No description provided.