Users with same display name breaks @-mention #374

Open
dbiollo opened this Issue Dec 14, 2015 · 12 comments

Projects

None yet

4 participants

@dbiollo
dbiollo commented Dec 14, 2015

It's possible for people to have the same display name, while having different email addresses. This becomes more likely in larger companies.

For example:

@-mentioning @John Doe has unpredictable results. This is because display name is used to match the name:

https://github.com/zulip/zulip/blob/e95739961f28916011d36fe58cc4eb45a20e20a3/zerver/lib/bugdown/__init__.py#L794

        user = db_data['full_names'].get(name.lower(), None)
        if user is None:
            user = db_data['short_names'].get(name.lower(), None)

Since display name is not a unique attribute it would be much better to use the email address to identify the user as part of the send_message UI & API.

@timabbott
Member

Agreed! I've for a long time wanted to change the way the display works for @-mentions to use either the email address or perhaps better the user ID.

Probably the email address is a much simpler option since user IDs are not always available in the frontend right now. The main constraint in doing this is to try to make sure that we still display @-mentions nicely.

@wdaher wdaher referenced this issue in timabbott/zulip Apr 10, 2016
@timabbott timabbott Add a draft roadmap doc. ec34f29
@timabbott timabbott added this to the 2016 roadmap milestone Apr 29, 2016
@ragsagar
Contributor

I am working on this.

@timabbott
Member

Cool, @ragsagar, which implementation approach are your attempting?

@ragsagar
Contributor
ragsagar commented Aug 20, 2016 edited

We show the same autocomplete prompt, when user selects Iago, instead of @**Iago** we will fill @**iago@zulip.com**. What do you think?

@ragsagar
Contributor
ragsagar commented Aug 21, 2016 edited

@timabbott Rough implementation of what I have in mind.

@timabbott
Member

Cool. Haven't tested that, but is the idea that it would still display the same way, just you'd and/or the autocomplete would type different syntax? I think that makes sense.

One change that it might make sense to do while we're at it is moving to identifying the user by user ID, rather than email, so that we can better support users changing email addresses. To support that, some options for this would be:

  • do some fancier syntax like @<1235415=Tim Abbott> that encodes the user ID but also has the display name handy in it.
  • Make our editor a rich text editor so we can just have the thing you see look like the pretty bubble you'll get out the other end (e.g. #595)
  • Something else
@ragsagar
Contributor
ragsagar commented Aug 23, 2016 edited

One change that it might make sense to do while we're at it is moving to identifying the user by user ID, rather than email, so that we can better support users changing email addresses.

I didn't consider that scenario. Is there a way for an user to change his email id now?

do some fancier syntax like @<1235415=Tim Abbott> that encodes the user ID but also has the display name handy in it.
Make our editor a rich text editor so we can just have the thing you see look like the pretty bubble you'll get out the other end

I feel we should go with rich text editor, After filling in, user should only see @TimAbott and should be able to remove whole @TimAbott we filled in with a single backspace.
@<1235415=Tim Abbott> will look like gibberish to a non technical person. Changing the user also will be not very user friendly.

@timabbott
Member

Is there a good rich text editor library we can use for this?

@ragsagar
Contributor

I went through some examples of jquery TextExt plugin. But doesn't look like it is exclusively for our purpose (tag between texts). Were you able to find any similar examples?

@timabbott timabbott modified the milestone: Zulip roadmap, Old roadmap Nov 18, 2016
@vabs22
Contributor
vabs22 commented Jan 17, 2017

There is another thing to fix as well. Suppose i want to @-mention a person with name 'Vaibhav' and say there exist 6-7 people with name vaibhav but different surnames. Since we display only 5 results, there is possibility of missing out the name of required person from the list. I can also use email of the person for the same but usually people find it easier to remember names over email ids.
To solve this, instead of stopping the search by name at whitespace, we can continue it and start searching on surname after name. We can use special characters (like underscore) to indicate this.
Ex: Vaibhav_Singhal would indicate search for user with name Vaibhav Singhal.

I have also tried to find a rich text editor plugin for our case but couldn't. Maybe we can try other approach, like the fancier syntax. If we find one later, we can modify our code then.

@timabbott
Member
timabbott commented Jan 18, 2017 edited

@vabs22, yeah, that @-mention autocomplete problem annoys me as well. I worry a bit about the whitespace approach, because if for whatever reason you don't want to @-mention someone, it's pretty annoying to have to use escape to get out of autocomplete.

One reasonable option would be to see if there's a way we can make it show more than 5 options if there are several exact matches (or scroll through them, or something). Another would be to ignore whitespace in full names when matching (so typing e.g. vaibhavSing would let one filter to just you, even if that didn't happen to be part of your email address).

Assuming those sound reasonable, can you open new GitHub issues for those 2 approaches? I think ideally we'd do both.

@vabs22
Contributor
vabs22 commented Jan 19, 2017

Sure! both of these approaches are a better solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment