phibr0 / obsidian-emoji-shortcodes

Emoji Shortcodes - Obsidian Plugin | Adds Support for Emoji Shortcodes to Obsidian
MIT License
178 stars 15 forks source link

Better ordering of Emoji suggestions #34

Closed GollyTicker closed 1 year ago

GollyTicker commented 2 years ago

First of all, I and very thankful for this plugin :star: . I enjoy using emojis in my notes as the small images make some content more easily communicated.

However, during usage of the plugin, I noticed, that the order of the suggesting emojis when starting a shoartcode : is sub-optimal.

Consider these shortcodes: star, heart, x and right When using the first three, I expect, that after typing it out, the top-most suggestion is the most specific one corresponding to it. e.g. for star I expect the star :star: suggestion to be top-most. However, we see a different list: image

The same problem also appears with the other shortcodes.

image

image

This is less helpful, as sometimes we need to scroll down a lot to see the right emoji.

For the prefix right, we get these suggestions: image

However, I think it's better, when shorter completions such as arrow_right, fist_right and copyright are higher prioritised than the other ones. Generally, if the suffix needed to complete the shortcode is short, then the emoji should be higher on the list.

And for the case of x, if the emoji is short alltogether and has a relatively large matching with the prefix shortcode, then it should be also higher on the list.

Most other existing emoji shortcode suggestion lists seem to return, what I would intuitively expect. For instance, when writing an issue comment, the github emojis suggest this:

Screenshot from 2022-05-08 17-06-08

Screenshot from 2022-05-08 17-07-37

Screenshot from 2022-05-08 17-06-52

Could we have the shortcodes prioritised differently?

What do you think? :star:

If there is need, I could provide some help.

This issue relates to: https://github.com/phibr0/obsidian-emoji-shortcodes/issues/31

GollyTicker commented 2 years ago

Also relates to https://github.com/phibr0/obsidian-emoji-shortcodes/issues/33, as one could also potentially list recently used emojis first.

KraXen72 commented 1 year ago

i agree with this! image image image

i think it should order the suggestions based on how close to start of the string is the query: (example)
query => :sta star custard eight_pointedblackstar

GollyTicker commented 1 year ago

@phibr0 What do you think about all of this?