#1085 Adds @ mentions to issues and PR comments
Merged by pingou. Opened by atelic.
atelic/pagure feature/at-mentions  into  master

Download 1085.patch

Adds visual feedback for @ mentions similar to that of GitHub and other places. Pagure already implements notifications for mentioning users (https://pagure.io/pagure/pull-request/735) so this just taps into that and adds a nice UI :)

Looks like:
http://paste.opensuse.org/images/5538694.png

Indentation change?

Unintentional :/

rebased

Looks good to me, I'll try to test it a little, I'm kinda curious how it behaves if you have lots of users (say 200+)

I tested 200 names with this:

function randomString(length) { return Math.round((Math.pow(36, length + 1) - Math.random() * Math.pow(36, length))).toString(36).slice(1); }

var data = [];

for(var i = 0; i < 200; i++) { data[i] = randomString(10) }

$("#comment").atwho({at: "@", data: data})

And how does it scale? Does it look good? Is the list infinite?

It handled it really well. Here is a gif with 200 random strings.

This looks really good. For all practical purposes, this should work very well. Just curious, will that be difficult to show the avatar and/or name as well along with the usernames ? Because, that would turn this into awesome. :) :thumbsup:

This is indeed looking really nice :)

Btw, mind rebasing the PR on the top of master? I try to keep the history linear :)

Okay, I've got the username and full name showing side by side picture. I would like to add the avatar too but can't find a way to get that from a User instance. Any suggestion?

Using this. But, you should have asked @pingou first. He wanted to merge :stuck_out_tongue:

rebased

Now it has avatar, username, and full name. pic.

I rebased on master. Hopefully this clears things up.

rebased

rebased

rebased

I thought I had commented but, now I am not seeing it.

I was asking if there would be any way to keep the suggestion list below the cursor as you had in the first implementation? I think I like it better there than below the input field.

I've gotten it a bit better. How does this look: http://i.imgur.com/mDRXxGw.png

Looks good to me! :)

rebased

rebased

Pull-Request has been merged by pingou

While trying out few things on stg: when you want to mention let's @pingou, then after typing 'pi', the only user left is pingou, if you don't select the option at that moment and write 'n' after that, the option is gone.

^ and it's different for each username like while tagging @vivekanand1101, if i write 'a' after 'vivek', then it's gone.

@vivekanand1101 : https://pagure.io/pagure/pull-request/1122

@atelic it's not working while editing comment. #s also not working

@vivekanand1101 it's the wrong place for such report (that should be a new ticket) and it has already been fixed in PR #1130 :)

sorry again :/ @pingou and @atelic

Metadata