#2488 closed enhancement (fixed)
Add Twitter/Github style username autocomplete/linking to support forums.
Reported by: | danieliser | Owned by: | |
---|---|---|---|
Milestone: | Q1 | Priority: | normal |
Component: | Support Forums | Keywords: | |
Cc: |
Description
The aim here is so that you can quickly tag another user just by typing @username in the TinyMCE editor.
As you type characters after the @ symbol it will begin suggesting usernames. Hitting enter, space or selecting one of the suggestions will autocomplete the username as well as wrapping it with a link to the users profiles.wordpress.org page.
Though this is currently limited in scope to @usernames, it can easily be used to handle other automated content linking such as trac tickets via hash (#) or similar.
I have code for this already that I will be porting to work for bbPress 2.
The code currently can support templates for the returned result to pull from the theme but is written to send back json and render simple link via JavaScript.
Considerations to be made:
- Minimum number of characters before api requests are made.
- Number of results
- Caching mechanisms for results
- Should there any limitations on who can use this beyond being logged in?
Attachments (1)
Change History (30)
#2
@
8 years ago
Does it scale? There are 10+ million user accounts, all of them through the forums. There has to be a load issue somewhere.
#3
@
8 years ago
@Otto42 If we preload a set of suggestions based on all users who have already left a reply on the current topic that would solve the issue for most users without any extra hits to the server, pure JS at that point.
I'm not sure what type of caching is set up for the forums currently but the queries could be stored in cache.
I have even considered doing something along the lines of as they type and the second query fires off since its a narrowing of the results in the previous set, if they were cached we could strip off the last letter of the search query string repeatedly until to a cached match is found, then loop those results looking for further matches.
That would make it a 0 query hit potentially after caches build up.
For example when typing @Otto42 it may run a query for Ot
, which would obviously include Otto42. So when the next api request hits with query of Otto
it could strip off the last to
and pull the cached results for Ot
. Then loop those results for ones that match the new query using string match or similar. Since Otto42 was already in that first cached query it will show for Otto without another query.
#4
@
8 years ago
A similar autocomplete feature was implemented in #830 for Trac, makes sense to do the same on the forums.
Pre-populating the list of usernames with users who have replied on the topic should resolve scalability concerns.
#5
follow-up:
↓ 6
@
8 years ago
@SergeyBiryukov - Awesome, I have this partially working locally. Just haven't had time these past few weeks to polish it off and get a patch uploaded.
#6
in reply to:
↑ 5
@
7 years ago
Replying to danieliser:
@SergeyBiryukov - Awesome, I have this partially working locally. Just haven't had time these past few weeks to polish it off and get a patch uploaded.
@danieliser could you share the status of this feature with regards to bbPress? It is functionality that I've been investigating and thought I might implement myself as a separate plugin, but if it's coming soon to bbPress itself, obviously I would hold off. Do you know when it might ship/you might have a patch available for others to use?
My interest is solely in having it in bbPress; sorry in advance if that is considered off-topic here.
This ticket was mentioned in Slack in #forums by jcastaneda. View the logs.
7 years ago
This ticket was mentioned in Slack in #forums by clorith. View the logs.
7 years ago
#9
@
7 years ago
The simple approach, that also addresses the scaling concerns, is to make this a purely JS driven feature.
You rarely, if ever, need to at-mention users outside a topic, so making this build up the names list after the DOM is loaded and you know the available usernames (or just having the names pre-loaded in a JS variable) and limiting it purely to those entries inside that topic would contain things and not be a concern with regard to the system in general.
#10
@
7 years ago
You rarely, if ever, need to at-mention users outside a topic
This is what we do on WordPress core trac - We pre-load anyone with a role (ie. committers, etc) but all other at-mentions are based on those participating in the current ticket.
#11
@
7 years ago
Perfect solution @dd32. Likely means the code is already tested and reliable as well meaning it can be implemented 10x faster ;)
#12
@
6 years ago
Hi @danieliser
Do you have news about the autocomplete feature for bbpress forums?
Thanks in advance for your reply!
Regards,
Jose
#15
in reply to:
↑ 14
@
6 years ago
Replying to dd32:
In 8064:
This initial version only supports autocompletion of Thread participants, it doesn't do any Ajax lookups or autocompletion of moderators/plugin reps/theme reps who have not commented.
It's not yet deployed or activated, but works the same as Trac, see the above screenshot for an example of it's use on the Master 5.0 thread.
This ticket was mentioned in Slack in #forums by dd32. View the logs.
6 years ago
#17
follow-up:
↓ 18
@
6 years ago
In my (humble) opinion, this is a bad idea. We have too much @-pinging in forums. The @ is not useful -- if I'm subscribed to a topic, then I get notifications. If not, then being pinged is just spam. It will lead to increased abuse.
#18
in reply to:
↑ 17
@
6 years ago
Replying to sterndata:
In my (humble) opinion, this is a bad idea. We have too much @-pinging in forums. The @ is not useful -- if I'm subscribed to a topic, then I get notifications. If not, then being pinged is just spam. It will lead to increased abuse.
I think that can be defended with the fact that if someone is going to @mention someone they're going to do it regardless. This just simplifies the process for those who use it legitimately.
There's an argument to be made that you should only get 1 subscription notification though (ie. you shouldn't get a ping notification AND a subscribed notification) but that needs it's own ticket.
#19
@
6 years ago
- Resolution set to fixed
- Status changed from new to closed
This has been implemented and deployed to all forums, let's see how this goes, if we need to alter it in any way feel free to re-open or create new tickets for the issues.
#20
@
6 years ago
@dd32 - Ohhhh, just tried it on a forum topic just now. Love it. Perfect for my initial requests needs.
For those interested in the bbPress stuff. I have just added it to my list of things to complete first half this year, message me on twitter if you want info on that (@daniel_iser)
#22
follow-up:
↓ 24
@
6 years ago
the autosuggestion works when you are in the "text" tab but in the "visual" tab, it doesn't work.
Do you have any ideas?
#24
in reply to:
↑ 22
;
follow-up:
↓ 25
@
6 years ago
Replying to gduquerroy:
the autosuggestion works when you are in the "text" tab but in the "visual" tab, it doesn't work.
We don't have Text/Visual selection on the forums, so if you've got one you've probably got a browser extension adding it.
If you let me know what tool that is, I can see if it's easy to add it there too.
#25
in reply to:
↑ 24
;
follow-up:
↓ 26
@
6 years ago
Replying to dd32:
Okay, so we're actually using bbpress-enable-tinymce-visual-tab
https://fr.wordpress.org/plugins/bbpress-enable-tinymce-visual-tab/
Thanks !
#26
in reply to:
↑ 25
@
6 years ago
Replying to gduquerroy:
Replying to dd32:
Okay, so we're actually using bbpress-enable-tinymce-visual-tab
https://fr.wordpress.org/plugins/bbpress-enable-tinymce-visual-tab/
Ah :)
Since this was written primarily for the WordPress.org support forums, which doesn't have that functionality I'm not going to be able to test with random plugins on a self-hosted site.
If you'd like to submit a patch to make it work with those plugins in mind, sure, I suspect the change is Line 16 in this file change it so something like $( 'textarea.bbp-the-content.wp-editor-area, textarea.<ClassNameHereforTinyMCE>' ).atwho({
Related: #bbpress2409