Page 1 of 1

@mention autocomplete is overenthusiastic

Posted: Thu Jun 11, 2020 8:27 am
by spacemonaut
The autocomplete for mentions is creating a bit of a problem. It will follow my text cursor around anytime as long as there's something resembling an @ mention anywhere earlier in the post. Note for example down here my text cursor is right at the end of the post and the autocomplete is still offered.
2020-06-11_09-22-14_firefox.png
(I got here by using the text-highlight quote on someone's post rather than hitting the quote button on the post.)

This is kind of a problem because I can't hit enter at all or else it tries to autocomplete that mention, but starting from where my cursor is at the time rather than where the mention is:
2020-06-11_09-22-23_firefox.png
But since the @ is still there, the autocomplete will still be following me around, meaning if I try to hit enter again, it just autocompletes yet again.
2020-06-11_09-22-30_firefox.png



Suggestion: The @ mention autocomplete should only be present while my cursor is inside the word following the @.

Re: @mention autocomplete is overenthusiastic

Posted: Thu Jun 11, 2020 12:24 pm
by Feyd_Ruin
Eee.
I fixed it for regular quote, but it looks like I need a more substantial fix to hit all the corner cases. I'll look into it this afternoon. Apologies for the issues

Re: @mention autocomplete is overenthusiastic

Posted: Sat Jun 20, 2020 2:52 pm
by spacemonaut
No problem, and thanks for working on it!!

Re: @mention autocomplete is overenthusiastic

Posted: Thu Jun 25, 2020 2:15 am
by Feyd_Ruin
@spacemonaut I think we're good to go.
Updated mentions to using tribute.js instead of atwho.js, which has eased quite a few things.

[card] is still using atwho, and thus still a bit overzealous, but it's on my list to redo a bit as well.

Re: @mention autocomplete is overenthusiastic

Posted: Thu Jun 25, 2020 10:25 am
by spacemonaut
@Feyd_Ruin

This is definitely not following me around anymore. : )

There's an issue to check out though:

1. Quote that post you wrote just above. Or this one, since I've put a mention at the top.
2. Type out a mention beneath it.
3. Hit TAB to autocomplete it. (Don't click the autocomplete menu, just hit tab.)

Expected: That mention gets autocompleted.
Actual: The post gets wiped starting at the first @ symbol and gets replaced with the mention you just autocompleted.

Try moving the mention around in order to test that it definitely wipes from wherever the first @ mention is.
Screenshot 2020-06-25 at 11.21.00.png
Screenshot 2020-06-25 at 11.21.02.png

Curiously as mentioned clicking in the autocomplete is just fine, so maybe the tab behaviour should do whatever that's doing.
Screenshot 2020-06-25 at 11.24.10.png

Re: @mention autocomplete is overenthusiastic

Posted: Thu Jun 25, 2020 12:42 pm
by Feyd_Ruin
Meh. Silly whackamole.
I'll have to read the quote back from before.

Re: @mention autocomplete is overenthusiastic

Posted: Fri May 07, 2021 1:19 pm
by WizardMN
@Feyd_Ruin

It looks like this latest issue is still an issue. Not sure if it was fixed and now is broken again but since you are generally on the ball with things like this, and this one is nearly a year old, I figured maybe you did something but it was undone later. So, I guess I am just bumping the topic as I just had it occur to me when replying to a thread and wiping out everything I typed :(

Re: @mention autocomplete is overenthusiastic

Posted: Fri May 07, 2021 1:21 pm
by Feyd_Ruin
WizardMN wrote:
3 years ago
@Feyd_Ruin

It looks like this latest issue is still an issue. Not sure if it was fixed and now is broken again but since you are generally on the ball with things like this, and this one is nearly a year old, I figured maybe you did something but it was undone later. So, I guess I am just bumping the topic as I just had it occur to me when replying to a thread and wiping out everything I typed :(
ugh. I don't even know what changed, I was sure I had this fixed.
I'll look at it again, apologies

Re: @mention autocomplete is overenthusiastic

Posted: Sat May 08, 2021 5:01 pm
by Feyd_Ruin
OK. So this time it was somehow loading the tribute/mention system twice.
This means it did two replacements (so if there was a previous @ it went there).
Fixed.
Apologies.