-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce the Activity Type API and replace favorites with likes! #238
Conversation
Maybe if I explain it this way, you may gain a different perspective. Currently, I am a member of a site that has ability to Like activity posts in addition to being able to Favorite activity posts. As a matter of fact, the site admin has relabeled Favorites to read as Bookmark which allows members to have a list of activity posts that they can just refer to because:
Seems to me, you are creating an either this or either that situation by moving the Favorites functionality into BP Classic. I'm not sure why site admins can't have both as is currently possible now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @emaralive
Let's leave to the community owner to decide how they wanna use each feature. See Instagram for an example of a community where people can like an activity, but you can also bookmark/favorite a post/activity. Each serves different purposes.
I also think this is being attached to the Activity component, but a plugin developer could very well build a feature to like groups, messages, users, or posts. The BuddyPress Followers plugin has a nice API that allows for extension for different scenarios. Something we could use as an inspiration here.
I left a few notes to the code. :)
Thanks a lot for your feedbacks, I'm just following the consensus that was found about choosing both features, favorites or likes only: Moreover, Favorites are very buggy, we really should deprecate it. If there's a strong willing to absolutely keep the idea of Bookmarking I'll surrender but in this case it should be rebuilt as the Like feature using an activity type having a |
@imath I don't have a strong opinion about it. To be honest, I'm not sure if this feature is used a lot in communities. If we can deprecate it without any major issues to users, great. I do have a strong opinion that the API should be flexible enough that plugin developers can use it for other components, if desired. BuddyPress is very good at being extendable to developers. The current API in this pr could do with some improvements, getting the reactions is a bit burdensome, lots of PHP filtering. |
@renatonascalves thanks for your review by the way, I'll update the PR accordingly. This is still a WIP but I believe the Activity Type API combined with the reaction one will improve & simplify things. |
Seems to me the referenced comment was from 9 years ago, of which, that was the thought then (2015) and this is now (2024). AFAIK, things/thoughts/conditions change over time.
As to buggy, could you expand upon this notion, @imath? The last bug I remember is reconciling Activity IDs after an Activity/Comment was deleted. I'm trying to imagine how Slack would work without the ability to Save for later (bookmark); meaning, I can only react to a message. I suppose I could manually copy the message link and save it in a text file but, that would actually be archaic and I shudder at the thought. However, in all fairness, I've not checked out this PR to see how it actually works and when I get an opportunity, I will do so. If, by chance, there isn't the ability to bookmark then I would recommend the exploration of "it should be rebuilt as the Like feature using an activity type having a |
I agree that bookmarking/favoriting and liking posts are two different types of actions, and while adding reactions is a great improvement (and probably expected funtionality for most users), I'd hate to lose bookmarks, for those users who are bookmarkers. If bookmarks are buggy, we should fix them. I'm guessing that one of the issues is that the old code stored them in a serialized array (I'm guessing about this), so when an item is deleted, it's hard to remove them from all of the serialized arrays. Reactions are great! |
Ahaha thanks a lot 😍 for your reactions 😉 @dcavins & @emaralive. As David explained using serialized information into a user meta will always be a trouble and we need to avoid doing this as much as we can (we sometimes have no other choices). Favorites are already gone, reading your 2 comments: you're now talking about bookmarks so I think we can satisfy everyone's expectations:
Likes: will help make the most interesting activities to rise once we'll be able to sort activities according to the number of likes or comments. So that's the most interesting feature to me, it's a community feature in the sense that thanks to the public expression of the community members I can see the best of activities. Bookmarks are a "selfish" need, it's less interesting to me, but, I was actually using it on Twitter 😁 (I'm not saying the before last letter of the Alphabet, because I left Twitter before it was renamed). So "technically" speaking: to me, "Bookmarks" are hidden "likes" only visible to me. I can go to my list of bookmarks, read the activity, then remove the bookmark once I've read it. I agree it's interesting to build this feature using reactions and probably use this feature to eventually migrate the favorited activities that are still existing. But Favorites are different, it's more persistent. My favorite movie is Matrix, my favorite pizza is Pepperoni : it won't change... I think BP Favorites were used as bookmarks. In short can we agree on, let's build 2 Activity reactions in 14.0.0:
and keep Favorites, but, into the BP Classic Add-on 🧐 ? |
Technically speaking, will I be able to add Group reactions? Like a group? Bookmark a group? A blog post? Like a message? Bookmark a message (similar to Slack)? Let's not build the API attached to the Activity component since that's not the only one a site might need it. So naming Activity reactions might be the wrong start. Having a "Reactions API" might be better. |
💥 Thanks @renatonascalves for your feedback. I understand you expect something larger than Activity "Reactions". Maybe the "Reaction" word is a problem, btw. To me a comment is already an activity reaction, for example.
I'm not as ambitious as you seem to be. I'm suggesting to satisfy a need I often read on BuddyPress support or in reviews about it, find a way to:
But this ticket is not about building a central Reaction API (I'll edit the PR's title as I admit it was misleading), it's about improving favorites management. I'm now trying another alternative way using activity children to create likes or bookmarks just like we do for comments. So:
I begin to believe this ticket is cursed 😂 🧙♀️ At least, I've tried many ways to improve the current Favorites situation for 10 years! |
Agree! Let's move the convo for an extendable API for https://github.com/buddypress/bp-relationships or a related ticket. I mistakenly assumed that was the goal here.
I used it before to add a feature to a client site. It has a good database schema that made the job a breeze. |
This will be needed to use likes as activities having the 'reaction' role.
Improve the Activity Type API to include a callback to set the primary link.
Introduce the `BP_Activity_Activity::append_reactions()` as well as the `BP_Activity_Activity::get_activity_reactions()` methods to get Likes for activities.
This commit also tries to avoid querying for the same parent multiple time when adding a like.
Introduce the `bp_activity_get_user_reactions()` to fetch the activity IDs a user liked.
96648f0
to
36b6f46
Compare
I just refreshed the PR, but I won't work on improving the Activity Favorites / Likes (or eventually Activity Bookmarks) feature anymore (although "Likes" is one of the features users expect to finally get in BuddyPress just like it was the case for the private visibility). I understood you all disagree with my strong conviction that it has to be managed using Activity children just like Activity Comments. Let's wait for an hypothetical more global BP Reactions API to land one of these days in BuddyPress (eg: https://github.com/buddypress/bp-relationships)... The ironical part about it would probably be that users will want these reactions to generate activity entries (duplicate info we could have avoided with the way I'm convinced we should use). Nevermind. Instead I'll pick the part about the Activity Type "API" to clean the mess currently existing between Activity Actions & Activity Types from this ticket #6429. |
Just adding my two cents here that, I know you are unhappy with this outcome, and I totally understand the frustration. However, long term, I do think having a relationship API is the right approach to take, even if it takes longer to get there. I'm personally invested in this feature, so you can be sure we will make some progres in the next release.
^ here I think we will need to have better integration not only with the activity component, but also with the notifications component, the settings component (so that one can turn off notifications), etc. There is another ticket related to the notifications part somewhere. But the pieces are all connected. Your work on the Activity Type "API" will help with this task too. :) |
I'm back again with Favorites improvement. The story of this ticket highlighted the fact we should consider moving to Likes. I agree and now we have a Backward Compatibility Add-on (BP Classic). I believe we should move the Activity Favorites feature into this Add-on and finally have Likes instead into BuddyPress.
I've tested many ways to fix this ticket and I believe I finally have something solid to improve how we deal with Likes or more globally with Reactions to an activity. My reasoning to build the Activity Likes feature is Activity comments or Activity Likes are both reactions to an activity: I like what the activity says or I reply to it. So Activity Likes can be compared to Activity comments without content. If this PR is still a WIP, it already contains:
bp_activity_type_supports()
function.Next steps if we agree on this scenario:
More possible ambitious steps:
I really think we should go this road for Activity Reactions/Likes. What do you think? Should we make this the 14.0.0 release top feature?
Trac ticket: https://buddypress.trac.wordpress.org/ticket/5644
This Pull Request is for code review only. Please keep all other discussion in the BuddyPress Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the WordPress Core Handbook for more details.