Element-web: @-mention doesn't autocomplete display names

Created on 23 May 2018  路  14Comments  路  Source: vector-im/element-web

Description

Trying to autocomplete someone by the name "James" doesn't work because their username is "jchaulk".

image
image

Version information

  • Platform: web (in-browser)
  • Browser: Chrome 66
  • OS: Windows 10
  • URL: riot.im/develop
bug p1 major

All 14 comments

Definitely would be nice to have this feature.

As far as I can tell @-mentions _do_ complete display names - is this something specific to the 'ja' != 'jc' case?

I suspect it's related to the deviation happening too early in the string, so the autocomplete can't find a high-scoring match.

ie: autocompleting @travisr despite the username being travis is possible because the match score is high enough, however ja doesn't have enough characters to have a high scoring match on James.

fwiw @travisr TAB does not work for me to autocomplete you @turt2live

That's just mean of Riot then :(

It used to, so maybe one of the autocomplete fixes made it different?

autocomplete fixes (mine) haven't been released yet and I tested in /app :(

turt2live

@t3chguy this change will use display names for autocomplete even when the matrix_id doesn't match?

Use case is:

  • Matrix ID: @x12345678:matrixhomeserver.com
  • Display Name: John Smith

So typing @Joh will autocomplete this user?

No, joh<TAB> would though

Doesn't work for me either on Riot 0.16. I don't think it ever has. You need to remember the user ids of people if they diverge from their display name AFAIK.

From experimentation, it appears that autocompleting by typing '@' will only match user IDs. Typing part of the display hame and pressing tab works though (ie. in this case, typing @jame gives no matches, but jame<tab> will complete to that user.

This is probably where the confusion is coming from.

@dbkr right, but that still doesn't allow you to cycle through users, so it only works when the part you typed is the unambiguous start of a display name. When I try to complete t3chguy on riot-dev by typing "@ mi" (ignore the space) I can't get it to work for example.

@bwindels typing @mi into riot-dev doesn't give t3chguy as an option though, because it only matches usernames and his username doesn't match that query. It gives some people whose usernames do though, and you can cycle through them with tab / down arrow / cursor?

/me is @x:riot.ovh ftr

This shouldn't be too hard to fix: I suggest just stripping the @ from the start of the query in UserProvider.js if the query starts with @. (since it's only used for trigger the autocompletion) and then stripping the @ from the start of all the usernames we feed into the matcher to match. The kicker is that the matcher can only take keys from an object. I'm thinking the best thing would be to rewrite the matcher so you can just feed in search strings and matching objects, making it a lot simpler.

Leaving this for now as I was hoping it would be a quick fix.

Was this page helpful?
0 / 5 - 0 ratings