Admin emoji pack settings #3153

Closed
vaartis wants to merge 0 commits from gitlab-mr-iid-1886 into develop
Member

Changes

  • Added emoji pack management to the pleroma-fe admin panel
    • Creating and deleting packs
    • Viewing and downloading remote packs
    • Editing pack metadata, when changed it shows the wrench icon
    • Uploading and editing individual files. Files that are edited but not saved are highlighted.
  • Added a button to reload and import emojis from the filesystem
  • Not directly emoji related, but also made frontend management not break completely if there is no config in DB
  • New localization included, hopefully I didn't miss any

Currently it loads pack information every time it's mounted, not sure where else to put that. Could maybe somehow be unified with the emoji list used for posting? That can be done later, though.

Does not have any pagination support for packs, so first 25 packs only both locally and remotely. Something that can also be dealt with later, I think.
Added pagination. There's still a way to paginate emojis themselves but that requires a significant amount of work to make usable I think.

Old admin fe also had support for downloading emojis from URLs, which would be useful but can probably also be added later.

Local pack

image

Remote pack

image

# Changes * Added emoji pack management to the pleroma-fe admin panel * Creating and deleting packs * Viewing and downloading remote packs * Editing pack metadata, when changed it shows the wrench icon * Uploading and editing individual files. Files that are edited but not saved are highlighted. * Added a button to reload and import emojis from the filesystem * *Not directly emoji related, but also* made frontend management not break completely if there is no config in DB * New localization included, hopefully I didn't miss any Currently it loads pack information every time it's mounted, not sure where else to put that. Could maybe somehow be unified with the emoji list used for posting? That can be done later, though. ~~Does not have any pagination support for packs, so first 25 packs only both locally and remotely. Something that can also be dealt with later, I think.~~ Added pagination. There's still a way to paginate _emojis themselves_ but that requires a significant amount of work to make usable I think. Old admin fe also had support for downloading emojis from URLs, which would be useful but can probably also be added later. Local pack ![image](/attachments/28f8a96b-c924-40df-bb33-b98f8190689f) Remote pack ![image](/attachments/05964ae3-7f20-48aa-a293-b6aca4779b78) <!-- List what your merge request changes and how --> <!-- Try to not to break existing behavior, if your changes do break existing behavior make it configurable to toggle between old behavior and new. Which one should be default is up to discussion. --> <!-- If your merge request resolves some issue link it like so: "Closes #99999" --> <!-- If merge request adds some new feature that depends on backend: 1. Make sure it gracefully degrades if backend hasn't been updated to support the feature, we try to make PleromaFE compatible with older versions of BE so that people can still update frontend safely without updating backend since it's costly and much riskier. 2. Link related BE merge request here --> <!-- Screenshots are welcome -->
Author
Member

Okay, BE needs some changes to work with akkoma (pleroma/pleroma#7405). Not a big deal, but still.
Might also implelent pagination after all because at the very least outerheaven has more than 25 packs.

Okay, BE needs some changes to work with akkoma (https://git.pleroma.social/pleroma/pleroma/pulls/7405). Not a big deal, but still. Might also implelent pagination after all because at the very least outerheaven has more than 25 packs.
Owner

Clicking emoji in the grid gives them a highlight that never goes away
image

Classname seem to indicate that it's meant for unsaved changes but

  • It's not obvious that it is, having an alert that says "unsaved changes" or something would improve situation a bit
  • Clicking "save" doesn't reset this state
  • No way to revert changes
Clicking emoji in the grid gives them a highlight that never goes away ![image](/attachments/47553540-cce9-4b6e-86e6-f02ceecd47ec) Classname seem to indicate that it's meant for unsaved changes but - It's not obvious that it is, having an alert that says "unsaved changes" or something would improve situation a bit - Clicking "save" doesn't reset this state - No way to revert changes
Owner

Layout could use some improvements
image

Ideally save/reset should be integrated into reset/apply all buttons but we can do it later.

Layout could use some improvements ![image](/attachments/4bb0c880-721d-462a-b916-2cf9da748e79) Ideally save/reset should be integrated into reset/apply all buttons but we can do it later.
141 KiB
Owner

Emoji editing popover also needs improvements

  • input fields should have labels
  • fields should be all vertically stacked
  • should include the image of the emoji being edited/uploaded.
  • probably should be a modal since it's way too easy to accidentally close the popover while editing, losing your changes
  • being able to update the emoji file by uploading it would be very nice
Emoji editing popover also needs improvements - input fields should have labels - fields should be all vertically stacked - should include the image of the emoji being edited/uploaded. - probably should be a modal since it's way too easy to accidentally close the popover while editing, losing your changes - being able to update the emoji file by uploading it would be very nice
Owner

Form elements must be labelled.

Form elements must be labelled.
Owner

There is a bit of lag when switching to a new emoji pack that has not been loaded. I think there should be some kind of loading indicator.

There is a bit of lag when switching to a new emoji pack that has not been loaded. I think there should be some kind of loading indicator.
Owner

This should be a <label> that contains the input element. Same for the next few entries.

This should be a `<label>` that contains the input element. Same for the next few entries.
Owner

This no longer indicates that the entry is different from default, but rather it has been changed from the old value. We can make a prop in ModifiedIndicator for it to display different messages based on this.

This no longer indicates that the entry is different from default, but rather it has been changed from the old value. We can make a prop in ModifiedIndicator for it to display different messages based on this.
Owner

There does not seem to be a "Reset" button to clear the locally-modified pack settings.

There does not seem to be a "Reset" button to clear the locally-modified pack settings.
Owner

Form elements must have text labels.

Form elements must have text labels.
Owner

There is no way to switch from remote packs back to local packs currently.

There is no way to switch from remote packs back to local packs currently.
Owner

the headers should be all a level deeper (h2 -> h3, h3 -> h4) but that's minor. Layout looks good now.

the headers should be all a level deeper (h2 -> h3, h3 -> h4) but that's minor. Layout looks good now.
Owner

resolved

resolved
Owner
        <h3>{{ $t('admin_dash.emoji.global_actions') }}</h3>
```suggestion:-0+0 <h3>{{ $t('admin_dash.emoji.global_actions') }}</h3> ```
Owner
        <h3>{{ $t('admin_dash.emoji.emoji_packs') }}</h3>
```suggestion:-0+0 <h3>{{ $t('admin_dash.emoji.emoji_packs') }}</h3> ```
Owner
          <h4>
            {{ $t('admin_dash.emoji.files') }}

            <ModifiedIndicator v-if="pack"
              :changed="editedParts[packName] && Object.keys(editedParts[packName]).length > 0"
              message-key="admin_dash.emoji.emoji_changed"/>
          </h4>
```suggestion:-6+0 <h4> {{ $t('admin_dash.emoji.files') }} <ModifiedIndicator v-if="pack" :changed="editedParts[packName] && Object.keys(editedParts[packName]).length > 0" message-key="admin_dash.emoji.emoji_changed"/> </h4> ```
Owner

this.$refs.addEmojiPopover is undefined, looks like a missing ref.

probably should hide popover once the upload is done (or failed, display error message then)

also would really love to see it unified with edit emoji popover not only for sake of code simplifiation but also to be able to update file of existing emoji

`this.$refs.addEmojiPopover` is undefined, looks like a missing ref. probably should hide popover once the upload is done (or failed, display error message then) also would really love to see it unified with edit emoji popover not only for sake of code simplifiation but also to be able to update file of existing emoji
Author
Member

I don't think this specific one needs a label, as it's right below "Emoji packs" now

I don't think this specific one needs a label, as it's right below "Emoji packs" now
Author
Member

Remote packs get added to the list, you just choose from the list. No need to switch anywhere.

Remote packs get added to the list, you just choose from the list. No need to switch anywhere.
Owner

injecting emojiAddr is good but for displayError there should be an emit instead IMO, or given that what displayError actually does you can just use this.$store.dispatch('pushGlobalNotice',...) directly instead

injecting `emojiAddr` is good but for `displayError` there should be an emit instead IMO, or given that what `displayError` actually does you can just use `this.$store.dispatch('pushGlobalNotice',...)` directly instead
Owner

there should also be an emits for events this component can emit

there should also be an `emits` for events this component can emit
Owner

"Edit pack" would be nice nonetheless imo

"Edit pack" would be nice nonetheless imo
Owner
  emits: ['updatePackFiles', 'displayError'],
```suggestion:-0+0 emits: ['updatePackFiles', 'displayError'], ```
Owner

can't edit an emoji, save button just doesn't become active.

can't edit an emoji, save button just doesn't become active.
Owner

if you change shortcode of an emoji (but don't save it), delete button breaks as it tries to delete new shortcode which doesn't (yet) exist

if you change shortcode of an emoji (but don't save it), delete button breaks as it tries to delete new shortcode which doesn't (yet) exist

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 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!3153
No description provided.