TryQuiet / quiet

A private, p2p alternative to Slack and Discord built on Tor & IPFS
https://www.tryquiet.org
GNU General Public License v3.0
1.94k stars 85 forks source link

User should be able to write `:smile:` for šŸ˜„ and use other emoji codes #540

Open pdurbin opened 2 years ago

pdurbin commented 2 years ago

As a keyboard junkie, in Slack, GitHub, Zulip, and Element I very frequently write :smile: to get the šŸ˜„ emoji. I would prefer not to reach for the mouse to click the emoji button in Quiet:

Screen Shot 2022-05-27 at 9 31 57 AM

I'm aware that a workaround on Mac is to hit Ctrl-Cmd-Spacebar to bring up a native emoji picker...

Screen Shot 2022-05-27 at 9 35 14 AM

... but it's faster and easier for me to just type :smile: like I do in other places.

Tab completion and search/autocomplete would be nice (see https://github.blog/2012-10-12-emoji-autocomplete/ ). That is, here on GitHub I only have to type :smi and then hit the Tab key to select from a list. Element and Slack work the same way.

Screen Shot 2022-05-27 at 9 45 52 AM

Some places such as https://github.com/ikatyang/emoji-cheat-sheet seem to refer to these as emoji shortcodes for anyone searching issues for that term.

https://github.com/wooorm/gemoji maps GitHub emoji codes to emoji and back.

It looks like emoji were first added to Quiet it 654b3151e though the https://www.npmjs.com/package/emoji-picker-react / https://github.com/ealush/emoji-picker-react library. The data is available in https://github.com/ealush/emoji-picker-react/blob/4.0.0/src/data/emojis.json but not but with spaces rather than underscores, like this:

{
  "n": [
    "sweat smile",
    "smiling face with open mouth and cold sweat"
  ],
  "u": "1f605",
  "a": "0.6"
},

Here's a issue about exporting that data, which we would need to do lookup:

holmesworcester commented 2 years ago

Thanks for this!

Just noting for when we get to this that the visual autocomplete interacts with @ mentions, as the UI is similar, so we might want to tackle it at the same time. This library might work for both, or we could use the existing @ mention code: https://github.com/webscopeio/react-textarea-autocomplete.

We could also look at what other editors or open source chat apps use for this.

pdurbin commented 1 year ago

https://github.com/nolanlawson/emoji-picker-element seems promising. I heard about it at https://shoptalkshow.com/451/ when they interviewed @nolanlawson.

Here's me typing :rock for šŸš€

Screen Shot 2022-12-14 at 5 55 19 PM
holmesworcester commented 1 year ago

This seems like a good proposal! https://chat.openai.com/share/1491b99e-d50c-463f-af00-d8e389644bc1

holmesworcester commented 11 months ago

@pdurbin should we assign this to you?

pdurbin commented 11 months ago

@holmesworcester no, I'm not actively working on it. I just closed my draft pull request:

I'm also happy to close this issue if it helps keeps things tidy.

By the way, https://messages.google.com suffers from the same problem. Typing :smile: doesn't create an emoji:

Screenshot 2023-10-11 at 7 58 44 AM
agiledev24 commented 6 months ago

Implemented this feature and created a PR: https://github.com/TryQuiet/quiet/pull/2354

Followed discord design. @holmesworcester Image

holmesworcester commented 6 months ago

Thank you @agiledev24 !!!

holmesworcester commented 6 months ago

@leblowl how easy is it to make a build for kinda so that she can test this feature and provide feedback or approve quickly?

@jgaylor do you have any feedback on the design? We could have a look at this Friday too.

leblowl commented 6 months ago

@holmesworcester It's easy, but mobile is sort of broken at the moment for @kingalg due to the app crashing, I'm looking into it.

holmesworcester commented 6 months ago

What about starting a desktop-only release?

leblowl commented 6 months ago

Sure, we can

leblowl commented 6 months ago

We generally have been merging into develop before releasing, so I'd probably need to change some things if we want to release this and test before merging. Also we've generally been releasing one thing at a time and 2.1.2 is getting backed up due to some bugs that @kingalg found, so I'll have to think about how we can handle this.

kingalg commented 6 months ago

@holmesworcester In our current situation, I would advise waiting to fix mobiles before releasing. Normally, it wouldn't be a huge problem releasing only one feature for part of the platforms, but we bumped React Native in this version, and there was also some refactoring. It would be better to have it all checked together because there may be some unexpected things.