[buddypress-trac] [BuddyPress Trac] #3278: @mentions autosuggest support

buddypress-trac noreply at wordpress.org
Sun Jun 22 19:49:13 UTC 2014


#3278: @mentions autosuggest support
----------------------+-----------------------------
 Reporter:  DJPaul    |       Owner:
     Type:  task      |      Status:  assigned
 Priority:  normal    |   Milestone:  Future Release
Component:  Activity  |     Version:
 Severity:  normal    |  Resolution:
 Keywords:            |
----------------------+-----------------------------

Comment (by DJPaul):

 I've finished creating the beginning of a new Suggestions API backend.
 Backpat is mostly* maintained, and there are more unit tests than you can
 shake a stick at.  Check it out here
 https://github.com/paulgibbs/BuddyPress/compare/master...suggestions, and
 I'll also upload a patch version of that to this ticket.

 The basic idea is the data for any current/future @mentions/auto-suggest
 style lookups comes from the new `bp_core_get_suggestions()` function.
 It's been built to be easily extendable by other plugins or components to
 implement their own kinds of automatically suggested content -- for
 example, #hashtags, or cross-posts -- and hopefully be more flexible for
 core development in the future (specifically, the other things I want to
 do in this ticket, and eventual integration as its own REST API endpoint).

 Currently, Messages and Groups (wp-admin) have user auto-suggests. The PHP
 callbacks for the AJAX handlers for those methods have been rewritten to
 use `bp_core_get_suggestions`; the CSS/JS for those things remain
 untouched.

 I say that backpat is "mostly" maintained, and it is. Here are the
 differences, which I don't think are worth supporting:

 * Messages: the `bp_core_autocomplete_ids` and
 `bp_friends_autocomplete_ids` filters have been removed (they were
 introduced in v1.5). See
 [https://github.com/paulgibbs/BuddyPress/commit/a8b48961249f8d0eb760ccd29d9d7d84b77317c2
 this commit] for the relevant change. They were much too challenging to
 implement elegantly, for little gain.
 * Messages: the HTML elements added by the JS include the user's avatar,
 which linked back to their BP profile. The change is that the link back to
 the profile has been removed. I couldn't find a good way to re-implement,
 and at any rate, it seemed like an odd UI element to include a link on.
 * Groups: the HTML elements added by the JS used to show the user_login
 (if username compat mode enabled) or user_nicename, and always the
 user_email. They now only display the user_nicename and their display
 name. This was inconsistent with Messages.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/3278#comment:21>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list