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

Make emote completion a lot smarter #4987

Merged

Conversation

Mm2PL
Copy link
Collaborator

@Mm2PL Mm2PL commented Nov 27, 2023

Description

I've updated emote completion to be smarter.

Changes:

  • It now has vim-like smartcase. That is given pajaW and PAJAW, if you search for PA you'll only get PAJAW.
  • If smartcase search fails, the fallback is suggesting more uppercase emotes. That is if you search Pa, you'll get PAJAW, then pajaW.
  • If all lowercase: you will get case insensitive matching, preferring lowercase emotes
  • The emote sorting order is now well-defined: count missing characters then case difference then ASCII-betically.
  • Sorting with :-completion and tab-completion is now identical.

To test you will need to actually toggle it on.
Closes #4944.

@Mm2PL Mm2PL requested a review from pajlada November 27, 2023 21:24
@karl-police
Copy link
Contributor

It works.

But there's something questionable that I don't know.

By default, the original version does this when starting the message with a :

image

while the smarter completion one does this:
image

otherwise, the feature seems to work

image

happy smiley gets turned into the sad one Hmmmmmmmm

This setting is not expected to stay in its current form after we've
tried it out.
Copy link
Member

@pajlada pajlada left a comment

Choose a reason for hiding this comment

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

LGTM 👍
Merging this in as-is without really testing its behaviour to allow more people to try it out

@pajlada pajlada enabled auto-merge (squash) November 28, 2023 09:50
@pajlada pajlada merged commit 6d02bb7 into master Nov 28, 2023
19 checks passed
@pajlada pajlada deleted the feature/add_smartcase_for_tab_completion_and_COLON-completion branch November 28, 2023 10:06
@karl-police
Copy link
Contributor

This is fixed now.

image

along with this
image

still wondering though how the original one prioritized the emotes when just typing :, it feels like that it gave a more interesting selection of emotes

@karl-police
Copy link
Contributor

karl-police commented Nov 28, 2023

What's also a bit to experiment with, is

should it show Rime or rime

when one types rIme 🤷

@karl-police
Copy link
Contributor

Then how much should it even change?

Comparison:

Old one:
image

New one:
image

@Mm2PL
Copy link
Collaborator Author

Mm2PL commented Nov 28, 2023

With my logic, as outlined in the description, it should be: {"Rime", "rime"} when you search for "rIme" because:

  • it tries a case sensitive search (query has an uppercase letter)
  • no results
  • it tries case insensitive and since the query has an uppercase letter it prioritizes more uppercase emotes but returns all results

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Emote sorting, what I type, is not what I get
3 participants