Skip to content

[HOLD for payment 2023-03-21] [$1000] [Feature] Create autosuggestion UI for :emoji_codes: #12188

Description

@roryabraham

Let's add an auto-suggestion UI for emojis so that they can be added inline in messages. Right now, typing :smile: works, but only if you know that it works. Let's make it easier to add emojis to messages using an inline emoji selector.

image

It will work like this:

  1. As soon as you type colon and two more characters without a space (e.g. :sm) we start searching (using the suggestEmojis function)
  2. We display the matches in the auto-suggestion modal, in the order returned by the function, with the closest match at the top
    a. We display the top suggestion highlighted.
    b. Pressing enter or tab selects the highlighted option.
    c. The arrow keys allow you to cycle through the options. The list should “wrap”, such that if you have the first element in the list highlighted and you press ArrowUp, then you are taken to the last element to the list. Similarly, if you have the last element in the list highlighted and you press ArrowDown, then you are taken back up to the first element in the list
    d. Every time your search query updates (i.e: you type another letter), then the first item is refocused. The reason for this is that when you update the search query we should assume that the “best result” is the one displayed first in the list, so that’s the one you’re most likely to want
  3. If there are no matches, we don't display the auto-suggestion modal
  4. If the user types a space or a colon (e.g. :smi or :smi:) we stop searching and don't show the auto-suggestion modal
  5. If they tap, click, press enter, or press tab on one of the emoji options then we finish the text (e.g. :smi becomes :smile: ) and add a space so that the user can continue typing
    a. When we finish the text, we should just replace it with the actual emoji code from emoji.js (which is returned by the search method) instead of the :<name>: since that would then need to be converted again

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionDailyKSv2DesignEngineeringInternalRequires API changes or must be handled by Expensify staffNewFeatureSomething to build that is a new item.

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions