Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Be somewhat fuzzier when matching emojis to complete on space #3070

Merged
merged 2 commits into from
Jun 6, 2019

Conversation

t3chguy
Copy link
Member

@t3chguy t3chguy commented Jun 6, 2019

  1. If an emoji is not found in the json but matches the regex, don't remove what the user is typing.
  2. Case insensitive comparison to emoticons in json
  3. Strip - from emoticon matches, as the json contains 0 emoticons with - but some make sense, :-D -> :D

These may not be the most correct changes, but they seem to make the feature a lot more usable, and a lot more friendly so seem reasonable.

9910

Fixes element-hq/element-web#9910
Fixes element-hq/element-web#9945
Fixes element-hq/element-web#9921

Signed-off-by: Michael Telatynski 7t3chguy@gmail.com

t3chguy added 2 commits June 6, 2019 08:39
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
@t3chguy t3chguy requested a review from a team June 6, 2019 07:45
@lampholder
Copy link
Member

This seems sane to me.
Case-insensitve emojimatching doesn't appear to introduce any clashes:

root@matrix-riot:~/builds/develop/matrix-react-sdk/node_modules/emojibase-data# python -m json.tool en-gb/compact.json | grep emoticon | cut -d'"' -f4 | tr A-Z a-z | sort | uniq -c
      1 %(
      1 8#
      1 8)
      1 8d
      1 :#
      1 :$
      1 :&
      1 :'(
      1 :')
      1 :'d
      1 :'o
      1 :(
      1 :)
      1 :*
      1 :/
      1 :3
      1 :<
      1 :>
      1 :?
      1 :@
      1 :b
      1 :c
      1 :d
      1 :e
      1 :j
      1 :l
      1 :o
      1 :p
      1 :s
      1 :x
      1 :z
      1 :{>
      1 :|
      1 ;)
      1 ;p
      1 </3
      1 <3
      1 >0)
      1 >:(
      1 >:)
      1 >:/
      1 \\m/
      1 d:
      1 dx
      1 o:)
      1 x(
      1 xd
      1 xo
      1 xp

I think it's worth a shot to see how it feels. It might be that substitutions such as d: for 😩 end up feeling just too jarring, but I'd bet mostly nobody notices and it 'just works' more often.

Copy link
Collaborator

@jryans jryans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this! 😁 It looks reasonable to me, so let's give it a try.

@t3chguy t3chguy merged commit db495e7 into develop Jun 6, 2019
@progserega
Copy link
Contributor

Thank you very much!

@t3chguy t3chguy deleted the t3chguy/fuzzier-emojis branch May 25, 2020 18:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

emoticon -> emoji is broken in some instances Missing :P emoji some text emoji not converting to emoji
4 participants