Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add emojis to autosuggestions #51

Closed
2 tasks done
andrewtavis opened this issue Nov 24, 2021 · 16 comments
Closed
2 tasks done

Add emojis to autosuggestions #51

andrewtavis opened this issue Nov 24, 2021 · 16 comments
Assignees
Labels
feature New feature or request help wanted Extra attention is needed

Comments

@andrewtavis
Copy link
Member

andrewtavis commented Nov 24, 2021

Terms

Description

This issue is to discuss and eventually implement the addition of emojis to autosuggestions. This would likely necessitate the addition of emojis as lexemes to Wikidata along with the words that represent them in each language. Typing any of these words would then replace the last autosuggestions with emoji options. Whether Scribe should have a dedicated emoji button and an emoji search could be covered in another issue, but the Scribe UI could lend itself to making this a more seamless process.

@andrewtavis andrewtavis added feature New feature or request question Further information is requested data Relates to data or Wikidata blocked Another issue is blocking labels Nov 24, 2021
@andrewtavis
Copy link
Member Author

andrewtavis commented Jan 25, 2022

A way that Scribe could improve on the performance of the system keyboard in this regard would be to offer suggestions even after the text has been broken by punctuation. So for example you could still suggest emojis after "Thank you!!!!" with 🙏 being the logical suggestion.

@andrewtavis
Copy link
Member Author

andrewtavis commented Aug 18, 2022

Creating arrays of words and their emoji equivalents might be something that could also be be done in Python within Scribe-Data using emoji. From there autosuggest could check if the word is in the emoji array, and then two emojis from the associated list could be suggested and put in to two buttons that would replace the third. At this time the emoji suggestions would definitely be two instead of three as sometimes can be the case, as the Scribe key restricts the available space too much.

@andrewtavis andrewtavis changed the title Add emojis to autocomplete Add emojis to autosuggest and autocomplete Aug 18, 2022
@andrewtavis andrewtavis added help wanted Extra attention is needed and removed data Relates to data or Wikidata question Further information is requested labels Sep 5, 2022
@andrewtavis andrewtavis removed the blocked Another issue is blocking label Oct 8, 2022
@andrewtavis
Copy link
Member Author

@SaurabhJamadagni, FYI we have the data for emoji autosuggestions now via 1cc1ea5 🥳🙌

@andrewtavis andrewtavis changed the title Add emojis to autosuggest and autocomplete Add emojis to autosuggest Dec 1, 2022
@andrewtavis andrewtavis changed the title Add emojis to autosuggest Add emojis to autosuggestions Dec 1, 2022
@andrewtavis
Copy link
Member Author

@SaurabhJamadagni, we're now at a point where we can work on this 😊 5f1f44f restricted the number of emoji suggestions per word as seen in the new version of the German word-emoji mappings here :)

What do you want the plan on this to be? Anything that I can do to set the ground work for you?

@SaurabhJamadagni
Copy link
Collaborator

That's awesome @andrewtavis. Thank you. I haven't checked the code yet. I'll get to it by tomorrow. Will let you know if there's anything I need help with. Just to confirm, we just want to add an emoji as the 3rd suggestion in the auto-suggestions if the last word is part of the emoji suggestions json for that language right?

I am a bit unclear on how to handle the rank. Do we suggest the emoji with the highest rank everytime for a certain word?

@andrewtavis
Copy link
Member Author

Just to confirm, we just want to add an emoji as the 3rd suggestion in the auto-suggestions if the last word is part of the emoji suggestions json for that language right?

Yes, exactly, @SaurabhJamadagni 😊 Generally I'm thinking that we can do two suggestions for iPhones and three for iPads, but maybe we can even stretch it to four (I can edit the output in that case). We'll need to have the positioning of the suggestions be responsive to the number that are being shown, so if there's just one it should be centered, two are centered together, etc.

The rank is just the means for determining the order of the emojis we're displaying :)

@SaurabhJamadagni
Copy link
Collaborator

So @andrewtavis the third word suggestion key turns into two (or more) smaller keys with emojis right? Else If we suggest two or more emojis in the same key is there any different selection mechanism that we are looking for? I am sorry, it's been so long with this issue that I faintly recall what we had discussed.

@andrewtavis
Copy link
Member Author

Ya I was working on remembering too, @SaurabhJamadagni :) No other selection method. The third option becomes the two or three emojis based on the available options for the typed word 😊

@andrewtavis
Copy link
Member Author

Based on a conversation with @SaurabhJamadagni, I might to do an initial part of this issue where I will deactivate the third autoaction button so that the emoji suggestions can be displayed and testing of solutions can begin :)

@andrewtavis
Copy link
Member Author

@SaurabhJamadagni, 8ab0292 adds the codes to hide the third auto action button when a word that would trigger an emoji suggestion is typed. This line needs to be uncommented to make it all work :)

Let's discuss this at the end of the week and you can let me know if you need more support 😊

@andrewtavis
Copy link
Member Author

andrewtavis commented Apr 2, 2023

@SaurabhJamadagni, some thoughts I've been having in playing around with the emoji suggestions:

  • Firstly I think we're not really using the is_base or rank values, so maybe those should just be used in Scribe-Data and removed from the exports?
    • I'm thinking in terms of app size
  • I'm also considering that we might want to lower case all the emoji keys 🤔
  • Another thing we can now do is emoji autocompletions 🙌
    • Checking if the current word being typed is in the dictionary, and if so trigger the "completions" and in this case replace the entire word with the emoji
    • Edit: this is covered by Add emoji autocompletions #277
  • With autocompletions we can also consider whether we want to export more emojis for cases where there aren't enough autocompletions/suggestions to fill up the first two
    • A situation like typing the word Kuss (kiss in German) where there would doubtless be a bunch of emoji options, but then there's no second autocompletion that would thus be blank
    • We could just do more emojis in this case via a check of if AutoAction2 is used
    • Edit: this is covered by Expand emoji completions in case of few autocompletions #281
  • Also for cases where there are no more possible words like in Kuss the word is actually being replaced rather than the emoji being put after a space, which is likely a conflict with the highlight autosuggestion stuff :)
  • I'm noticing that there's also a bug as we haven't covered the case where only a single emoji is present
    • The for i in 0..<2 for the selection is breaking it all
    • We can just use the plural button in this case, I think :)

@andrewtavis
Copy link
Member Author

andrewtavis commented Apr 2, 2023

@SaurabhJamadagni, 1300b22 allows for cases where there is only one emoji suggestion like Krokodil (Crocodile) 😊 We just use the plural key in this case, and there's now a condition for else if autoAction3Visible == true && emojiSuggestVisible == true. There's also some minor styling — specifically that the emoji divider is now 80% the height of the Scribe key as the auto action partitions are :)

On the above points, let me know what you think on it all! To me the first two points can be made into a Scribe-Data issue and then we can do minor edits to the code here to use the new format. Emoji autocompletions would be an issue in and of itself here, but should be very easy. After that we can talk about if we want to do extra emojis in cases where there aren't other word options — the fourth point above, which would also be a separate issue. The fifth point should also get a bug fix issue made for it :)

Thanks for all your work on this! 🚀

@andrewtavis
Copy link
Member Author

Will close this and we can make other issues for the rest 😊

@andrewtavis
Copy link
Member Author

Added #277 and #278 given my thoughts on the above. Will add in the other two discussed issues for Scribe-Data and adding more emojis if you think they’re good ideas, @SaurabhJamadagni :)

@SaurabhJamadagni
Copy link
Collaborator

Hey @andrewtavis!

I'm also considering that we might want to lower case all the emoji keys

Yes absolutely! I did face that problem when trying to implement the emoji autosuggest. An example is 'Lol' and 'lol' that I was using to test out. Checking multiple cases in the if condition was I think too intensive of a task and I encountered some crashes. So I just left it out for now. We should definitely look into this.

We could just do more emojis

That could be a good idea. We will have to test out the implementation though. I think UI wise it might look too spam-y if almost the entire autosuggest bar starts suggesting emojis. In that case we could maybe try to show one emoji per key so the second autoAction key isn't empty.

Also for cases where there are no more possible words like in Kuss the word is actually being replaced rather than the emoji being put after a space, which is likely a conflict with the highlight autosuggestion stuff :)

Ahhh that's a good point. But this might be tricky to solve for. Kiss would be one of the edge cases here. What if there are single suggestion words that don't necessarily need to be replaced by an emoji, or even Kiss itself. So are you suggesting that if for such words, the user chooses the emoji we will replace the word?

we haven't covered the case where only a single emoji is present

Sorry, should have tested for that. Completely slipped out of my mind.

Thanks for your commits too! 🚀

@andrewtavis
Copy link
Member Author

Yes absolutely! I did face that problem when trying to implement the emoji autosuggest. An example is 'Lol' and 'lol' that I was using to test out. Checking multiple cases in the if condition was I think too intensive of a task and I encountered some crashes. So I just left it out for now. We should definitely look into this.

I’ll make an issue to remove the unneeded keys and lower case it all then :) Thanks for confirming, @SaurabhJamadagni!

That could be a good idea. We will have to test out the implementation though. I think UI wise it might look too spam-y if almost the entire autosuggest bar starts suggesting emojis.

Let me make a version of it in the designs that we could check before implementing it in code 😊 Big thing on this is that I’d say it’s best to show too many emojis than to have the auto action UI be empty. Really the only time that it should be empty to me is when someone’s typing a weird word :)

So are you suggesting that if for such words, the user chooses the emoji we will replace the word?

No, it should not be replaced :) This is covered in #278 where I’ll prevent it from being deleted. More details in the issue :)

Thanks for your comments, @SaurabhJamadagni! 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request help wanted Extra attention is needed
Projects
Archived in project
Development

No branches or pull requests

2 participants