MemeLabs / chat-gui

Strims.gg chat front-end
Other
18 stars 30 forks source link

tabcomplete: emotes vs usernames #62

Open xDashh opened 5 years ago

xDashh commented 5 years ago

emote(s) always take preference (even if not used lately) before users (even if recently tabbed) currently. Expected: tabbed users should be before un-tabbed emotes. Making tabbed users a preference before tabbed emotes might also be worth considering since you probably care more about the user once you talk, but it's an inconsistency vs. the un-tabbed case...

In the new dev-chat this can be seen by tabbing "pepo" (there are various emotes, and 2 users by that prefix).

SmCTwelve commented 5 years ago

I can fix this to satisfy the following conditions:

Is that what you're looking for? The sort function already contains the logic for this but it just places emotes first regardless of usage because of an early return.

I'm wondering what CUSTOM_AUTOCOMPLETE_ORDER is used for? Is it a dev thing? Or is there a command people can use to control it? Currently it overrides any other sorting which seems to be expected behaviour. ['smctwelve', 'SMOrc'] for example 😏.

xDashh commented 5 years ago

The CUSTOM_AUTOCOMPLETE_ORDER is used to preserved order for things that many people are used to, e.g. REE existed for years, while RedCard is pretty new, so people were used to re+tab completing to REE first. After some time some custom orders are removed as they become less necessary.

Otherwise I'm not sure atm, but this should be good https://github.com/MemeLabs/Rustla2/wiki/Chat-Autocomplete

xDashh commented 5 years ago

While you are looking at this code, maybe https://github.com/MemeLabs/chat-gui/issues/109 could be done too?

SmCTwelve commented 5 years ago

I have a fix for that already I'll post it soon 👍. I tried looking into #19 too but I can't track that behaviour down.

The custom order thing makes sense. So with that wiki description I think the 2nd, 3rd and 4th conditions posted above satisfy. So in the case of both a user and emote being untabbed, is it expected for the emote to come first rather than a user?

xDashh commented 5 years ago

I think so, yeah. Because you don't know an unknown user, but you probably know a lot of emotes you haven't tabbed recently. There might be something about giving a user that wrote in chat recently preference over an unused emote but that might've caused trouble, don't remember. The Wiki should have everything I knew when I was thinking about this a lot