사용자로서 이모지 자동 완성 비활성화

Hi :slight_smile:

I would like to be able to disable emoji auto-complete as an user, please. :slight_smile:

Please see Disabling emoji auto-complete and Disabling smileys (on discourse.gnome.org).

OP에도 현재 겪고 있는 문제의 간단한 요약이나 이 사용자 설정이 왜 유용한지 설명을 포함해 주실 수 있을까요? 이렇게 하면 훨씬 더 잘 정리된 Contribute > Feature 요청이 되며, 링크를 통해 정보를 찾아봐야 하는 수고를 줄여줍니다 :slight_smile:

(OP가 무엇인가요?)

알겠습니다, 시도해 보겠습니다.

  • 저는 프랑스인이라 가끔 <space>:<return> 순서로 입력합니다. (<return>은 이모지 제안을 확정하는 것이 아니라 새 줄을 만드는 역할을 해야 합니다.)
  • 또한 줄의 끝에 위치하더라도 이모티콘, 특히 “:-)”을 자주 입력합니다. 이것이 ":slight_smile: "로 변환됩니다. 저는 이것이 싫습니다. 결과가 같더라도, 게시하기 전 메시지를 검토하기가 더 어려워지거든요.
  • 저는 discourse.gnome.org의 사용자입니다. 그곳에서는 사이트 전체 설정이기 때문에 도움을 줄 수 없다고 합니다. 그래서 사용자별 설정으로 만들어 주셨으면 합니다. :slight_smile:

대안: 자동 완성 기능에서 제안된 이모지를 확정하는 다른 방법을 찾아낼 수 있습니다 (예를 들어 <tab> 키?). 그러면 <return>은 제안을 무시하고 타이핑을 계속하는 것으로 처리되며, <space>와 같은 역할을 하게 됩니다.

1개의 좋아요

Original Post = the first post in the topic, the one that sets the topic title like yours that started this one

so why not just hit :spacereturn?

If you put a space after the colon the auto-complete emoji pop-up should close immediately.

4개의 좋아요

Sorry, does that mean I should edit the 1st post instead of put it below it?

As a dev, I hate to let lost spaces where they are useless. I find it’s dirty work.
So I have the habit to type <space>:<return>, and I wouldn’t very much like to acquire the reflex of <space>:<space><return>.

<space>:<space><backspace><return> doesn’t work, too, since it opens the auto-complete box again.


The point is: I have the habit to type <space>:<return> in any plain text editor, and I would like very much it gives the same result in Discourse. That is, all these keys would be considered as typing flow / text flow (not only <space>), so auto-complete suggestions would have to be ignored.

Why not use <enter> instead of <return> (the one on the numeric part of the keyboard)?
Since it uses <arrow-up> / <arrow-down> to choose the emoji, it could also use <arrow-right> to validate it, given that <arrow-left><arrow-right> does not open the auto-complete box again.

hmmm, sorry, I am not following your argument. Just to clarify - I gave you a simple solution, but you are saying it is not good enough because you have habit of using :return; so you feel that we should introduce a new functionality to user preferences for this? FWIW, I don’t believe I’ve seen this particular feature request yet. :thinking:

Thanks for the workaround. :slight_smile:

  • and :<space><backspace><return> is not a workaround,
  • and I wouldn’t like to acquire the reflex of :<space><return> and type it in any plain text editor, because it would make dirty work, particularly in code and official doc.

What’s the new functionality?

What I understood is: There is already a site-wide setting, and I suggest to make this setting user-wide.


I just discovered that GitLab also has an auto-complete feature, similar to Discourse one, except that there is no selected emoji when it opens the auto-complete box, so the user has to type <arrow-down> to choose the 1st suggested emoji.

Then, :<return> is considered as typing flow / text flow, and auto-complete suggestions are ignored.
It opens the auto-complete box even when : is typed after letters, and I don’t think it bothers anyone. :slight_smile:

Users have to type <arrow-down><return> instead of <return> to get the 1st suggested emoji.

Would you find this change acceptable?

What about space : escape return as a workaround? It seems to work for me in testing, but it might be easy to accidently minimize the composer.

1개의 좋아요

Thank you very much, it seems to be a great workaround. :slight_smile:

Please keep in mind either the GitLab solution or user-wide disabling, so I would no longer need to insert <escape> in my typing flow. :slight_smile:

1개의 좋아요

I’d like to +1 on this request, I’ve had users request that smilies are disabled for them because they want to type the old fashioned ones instead like : )

Do your users want Discourse to display :-) instead of :slight_smile: ?

In that case, if you are an admin, you can already disable smileys for the whole server (site-wide disabling).

if you want a user-wide disabling, could you precise if you want for a given user to have smileys disabled for all posts he reads, or only for his own posts?

In the 1st case, be careful, I don’t think Discourse would translate :slight_smile: in :-) when it has been written by an user who didn’t disable smileys.


For me, I asked for disabling only emoji auto-complete, because it bothers me only while writing posts, seeing :slight_smile: instead of :-). But it doesn’t bother me to see :slight_smile: either in the preview pane or while reading posts.

I have a user who doesn’t mind seeing emojis but wants to show them as :-) themself.

So they want other people to not see emojis from their posts.

Bit of an odd request. I’ll let them know about these backticks though as they might do the job!

저도 이 관련해서 사용자 요청을 몇 건 받고 있습니다. 특히 채팅 플러그인에 대한 것이었죠(다만 이 설정은 두 플러그인 간에 공유할 수도 있습니다).

테마 컴포넌트에서 이모지 추천 기능을 비활성화하는 로직이 필요하다면, 아래와 같은 코드가 작동합니다. (개념 증명을 시작했지만, 이 경우에도 이모지는 렌더링되지만 컴포저에서 추천만 되지 않습니다.)

추천기를 우회하는 조건을 직접 코드로 구현해야 합니다. 참고로 이 방법은 추천기만 끕니다. 사용자가 :persevering_face:와 같은 이모지 코드를 직접 입력하면 여전히 이모지가 렌더링됩니다.

import { withPluginApi } from "discourse/lib/plugin-api";

export default {
  name: "disable-emoji-autocomplete-non-staff",

  initialize() {
    withPluginApi("0.8.12", (api) => {
      api.modifyClass("component:d-editor", {
        _applyEmojiAutocomplete() {
          let isGroupMember = ...멤버를 가져오는 로직...
            });
          // 스태프에게만 이모지 자동완성 적용
          if (!isGroupMember) {
            // 또는 hate_emoji 그룹의 멤버에게는 이모지를 추천하지 않도록 하려는 경우
            return; // 비스태프 사용자의 자동완성 비활성화
          }
          // 그 외에는 원래 동작으로 폴백
          this._super(...arguments);
        },
      });
    });
  },
};

그룹(또는 다른 조건?)에 따라 이모지 추천기를 비활성화/활성화하는 제대로 작동하는 테마 컴포넌트를 원한다면, Marketplace 토픽에서 이 코드를 참고할 수 있습니다.