Opened 10 years ago
Closed 9 years ago
#830 closed enhancement (fixed)
Add mentions to Trac
Reported by: | pento | Owned by: | ocean90 |
---|---|---|---|
Milestone: | Priority: | normal | |
Component: | Trac | Keywords: | |
Cc: |
Description
@nacin is working on this.
Attachments (1)
Change History (32)
#3
follow-up:
↓ 7
@
10 years ago
It works, but I've turned it off for the moment. Important stuff left to do:
- Avoid notifying mentions that are inside quoted content (replies)
- Apply it only to individuals who have posted to a Trac before (otherwise, at-since will be getting emails)
Also, available for core trac only:
- Subscribe you to all further emails for the thread
- Avoid sending you a mentions email if you've already specifically blocked the thread
Nice-to-haves, which are things that should be done entirely in JS (I will not be doing them):
- Link @{username} in Trac tickets/comments to profiles
- Highlight your own @{username} in Trac tickets/comments
- Autocomplete for those who have commented to the ticket already, as well as ever before on Trac (see above)
I'm unsure about:
- Usernames with spaces, capital letters, @-signs, etc. (I think we may just start renaming user logins to match their nicenames as needed)
#7
in reply to:
↑ 3
@
10 years ago
Replying to nacin:
It works, but I've turned it off for the moment. Important stuff left to do:
- Avoid notifying mentions that are inside quoted content (replies)
- Apply it only to individuals who have posted to a Trac before (otherwise, at-since will be getting emails)
Also, available for core trac only:
- Subscribe you to all further emails for the thread
- Avoid sending you a mentions email if you've already specifically blocked the thread
All of this is done.
Mentions are on and working for the following Tracs: Core, Meta, bbPress, BuddyPress, GlotPress. So, all of the ones that actually get used.
I'm unsure about:
- Usernames with spaces, capital letters, @-signs, etc. (I think we may just start renaming user logins to match their nicenames as needed)
Based on my reading of the .org mentions code, usernames with capital letters are OK. There have been 14 users with an '@' who have been active on Trac in the past 18 months, and another few dozen who have spaces in their names. Those users will have some problems, and already do elsewhere on .org.
#9
@
10 years ago
- Cc helen.y.hou@… added
What do we think of adding @ mention suggestions for the reporter and any other commenters on the ticket? Possibly also include any other committers in the result set but only shown when you've got more than "@" typed. GitHub does it kind of like this.
#10
@
10 years ago
I did this for a 10up internal thing recently using At.js, which I believe O2 and BuddyPress also use now, it's fairly quick and painless to implement if we do something like output a JS object with the relevant usernames.
This ticket was mentioned in Slack in #meta by helen. View the logs.
10 years ago
#12
@
10 years ago
Okay, for fun, run this in the console or as a user script on a ticket and then try an @ mention in the comment box:
(function($){ var atCss = document.createElement('link'), moreCss = document.createElement('style'); document.getElementsByTagName('head')[0].appendChild(atCss); document.getElementsByTagName('head')[0].appendChild(moreCss) atCss.rel = 'stylesheet'; atCss.type = 'text/css'; atCss.href = '//ichord.github.io/At.js/dist/css/jquery.atwho.css'; moreCss.innerHTML = '#atwho-container { font-size: 1.3em }'; $.getScript('//ichord.github.io/Caret.js/src/jquery.caret.js', function() { $.getScript('//ichord.github.io/At.js/dist/js/jquery.atwho.js', function() { var users = []; // Most recent should show up first $($('.change .username').get().reverse()).each(function () { var username = $(this).data('username'); // @todo: exclude self and bots, include reporter and other committers if (typeof username !== 'undefined' && -1 === $.inArray(username, users)) { users.push($(this).data('username')); } }); $('#comment').atwho({ at: "@", data: users }); }); }); })(jQuery);
#13
@
10 years ago
:thumbsup:
I'm surprised we don't have caret/atwho anywhere on W.org. We can dump them somewhere easily enough, though.
#14
@
10 years ago
I've been using this as a user script for the last few weeks and it's awesome - what can I do to help patch this in? There is a @todo
in the example above but it can be done later or we can add some more variables and/or data attributes.
#15
@
10 years ago
@helen That userscript causes me to get a 404 on https://ichord.github.io/Caret.js/src/jquery.caret.map .
It does appear to work regardless, albeit with a pretty awful font. Is there a version of this script somewhere that isn't missing files?
#16
@
10 years ago
@Otto42 Yeah, can use //ichord.github.io/Caret.js/dist/jquery.caret.min.js
it looks like (and the min version for atwho.js as well). I don't know why they have that there if there's no source map actually available. What's awful with the font - that it seems to have gone tiny again or is it ugly on Windows or something? I thought I fixed the tiny thing but maybe not. Edit: Oh, I see what I did - it's a class of .atwho-container
, not an ID like I have in my script.
#17
@
10 years ago
Put it in a Gist for easy updating: https://gist.github.com/helenhousandi/b7b44abe728f34fbc357
#18
@
9 years ago
- Owner set to ocean90
- Status changed from new to accepted
Have a patch ready to implement suggestions.
@nacin forgets to deploy things before testing.