Skip to content
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

WIP:Bring back likes on comments #7918

Closed
wants to merge 2 commits into from

Conversation

Flaburgan
Copy link
Member

@Flaburgan Flaburgan commented Oct 31, 2018

I started to work on that task. @denschub asked me how I was seeing the UI. Quite frankly, I thought about going with the exact same design than the like for posts in the stream. So, I move the timestamp of comment from the bottom of the comment to the top on the right of the author in #7905 and display a "like" link at the bottom of the comment. The avatar of the other likers will go there too, like for posts. This UI works well for the users at the moment so I didn't see need for changes, at least for now. This fits OK in the SPV too. I wanted to open this PR to have feedback about that before going too far, so please share your opinion 😄

@Flaburgan Flaburgan force-pushed the 2999-likes-comment branch 2 times, most recently from bd0df93 to e60cfd5 Compare January 9, 2019 22:44
},

toggleLike: function(evt) {
if(evt) { evt.preventDefault(); }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected space(s) after "if".

@@ -10,6 +10,11 @@ def create(post_id, text)
user.comment!(post, text)
end

def find!(comment_id)
#TODO check that the user has access to that comment first

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Layout/LeadingCommentSpace: Missing space after #.
  • Style/CommentAnnotation: Annotation keywords like TODO should be all upper case, followed by a colon, and a space, then a note describing the problem.

urlRoot: "/comments",

initialize: function() {
this.likeInteractions = new app.models.Post.LikeInteractions(_.extend({comment: this}, this.get("likeInteractions")));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 7 exceeds the maximum line length of 120.

@@ -1,19 +1,15 @@
// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3-or-Later

//require ../post
//require like-interactions

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected space or tab after '//' in comment.

@@ -0,0 +1,53 @@
// This class contains code extracted from interactions.js to factorize likes management between posts and comments
app.models.Post.LikeInteractions = Backbone.Model.extend({
initialize : function(options){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Extra space after key 'initialize'.
  • Missing space before opening brace.

this.likes = new app.collections.Likes(this.get("likes"), options);
},

likesCount : function(){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Extra space after key 'likesCount'.
  • Missing space before opening brace.

return this.get("likes_count");
},

userLike : function(){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Extra space after key 'userLike'.
  • Missing space before opening brace.

success: function() {
self.post.set({participation: false});
self.trigger('change');
self.set({"likes_count" : self.get("likes_count") - 1});

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra space after key 'likes_count'.

@@ -6,10 +6,15 @@ app.views.Comment = app.views.Content.extend({
className : "comment media",
tooltipSelector: "time",

subviews : {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra space after key 'subviews'.

this.model.toggleLike();
},

likesInfoView : function(){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Extra space after key 'likesInfoView'.
  • Missing space before opening brace.

},

likesInfoView : function(){
return new app.views.LikesInfo({model : this.model});

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra space after key 'model'.


likesInfoView : function(){
return new app.views.LikesInfo({model : this.model});
},

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unexpected trailing comma.

@@ -0,0 +1,53 @@
// This class contains code extracted from interactions.js to factorize likes management between posts and comments
app.models.Post.LikeInteractions = Backbone.Model.extend({
initialize : function(options){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Extra space after key 'initialize'.
  • Missing space before opening brace.

this.likes = new app.collections.Likes(this.get("likes"), options);
},

likesCount : function(){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Extra space after key 'likesCount'.
  • Missing space before opening brace.

return this.get("likes_count");
},

userLike : function(){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Extra space after key 'userLike'.
  • Missing space before opening brace.

},

userLike : function(){
return this.likes.select(function(like){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space before opening brace.

})[0];
},

toggleLike : function() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra space after key 'toggleLike'.

}
},

like : function() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra space after key 'like'.

success: function() {
self.post.set({participation: true});
self.trigger("change");
self.set({"likes_count" : self.get("likes_count") + 1});

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra space after key 'likes_count'.

});
},

unlike : function() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra space after key 'unlike'.

this.userLike().destroy({
success: function() {
self.post.set({participation: false});
self.trigger('change');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strings must use doublequote.

success: function() {
self.post.set({participation: false});
self.trigger('change');
self.set({"likes_count" : self.get("likes_count") - 1});

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra space after key 'likes_count'.

initialize : function(options){
app.models.Post.LikeInteractions.prototype.initialize({post : this.post}); // I don't know how to call the super method yet

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Line 7 exceeds the maximum line length of 120.
  • Extra space after key 'post'.

initialize : function(options){
app.models.Post.Interactions = app.models.Post.LikeInteractions.extend({
initialize: function(options) {
app.models.Post.LikeInteractions.prototype.initialize({post: this.post}); // I don't know how to call the super method yet

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 7 exceeds the maximum line length of 120.

@LorenzoAncora

This comment has been minimized.

@Flaburgan
Copy link
Member Author

Hi @LorenzoAncora and thank you for taking time to share you thoughts about diaspora*. These worries about users using only likes instead of writing actual content are something often brought since I started working on reviving likes on comment. Despite this risk exists, I don't think this is going to happen. Likes mainly mean "I agree". It is a way to give importance to a comment. This can be achieve by posting another comment saying exactly that, but this doesn't work well at the moment because diaspora* doesn't have (yet?) threaded comments. That means if someone comments saying something you agree, but you arrive 1 hour after the comment has been written and 20 others comments have been posted since then, possibly driving the discussion in another direction, then writing another comment at the very bottom saying "I agree with comment 1" is not nice. So many users block themselves and don't do that. So instead of removing interaction because of less complete like instead of detailed comment, I think likes on comment will bring more interactions than before, make diaspora* a more alive place.

So we're going to add likes on comment. If we do see some "bad" behaviors coming from that, we could remove the feature again. Future will tell us. And btw, if you really don't want to see likes on comment, just remove that commit from your pod. That's the power of free software ;)

@LorenzoAncora

This comment has been minimized.

@denschub
Copy link
Member

denschub commented May 2, 2019

This is a pull request, and as such, is a place to discuss nuances about the technical side of the code submitted here. This is not the place to have philosophical discussions, and this is not the place to question the opinion of a majority of users. If anything, this place would be here.

@LorenzoAncora

This comment has been minimized.

@tclaus
Copy link
Member

tclaus commented Feb 1, 2021

@Flaburgan @denschub Any Progress here?
Will this be merged for the 8?

@Flaburgan
Copy link
Member Author

@tclaus unfortunately I switched my main focus of contribution to another project. I don't think I will continue to work on this. Feel free to follow up if you want to.

@tclaus
Copy link
Member

tclaus commented Feb 1, 2021

@tclaus unfortunately I switched my main focus of contribution to another project. I don't think I will continue to work on this. Feel free to follow up if you want to.

Is there anything left over I can help with?

@Flaburgan
Copy link
Member Author

My current work is pushed here. Honestly I don't remember exactly where I stopped, it was 2 years ago...

@denschub
Copy link
Member

denschub commented Feb 1, 2021

I don't think I'm blocking this PR, but just in case

@denschub asked me how I was seeing the UI [...] I wanted to open this PR to have feedback about that before going too far, so please share your opinion 😄

is a direct request to me: I really have no opinion here. This feature is one of those things that I don't like (pun intended), and if it would be completely up to me, we'd have no "likes" at all, not even for posts. Luckily, it's not up to me, and since people really want this, I'll not get in anyone's way.

@tclaus
Copy link
Member

tclaus commented Feb 1, 2021

See the like? 😉
So let me see if I can contribute something to close this issue.

@denschub
Copy link
Member

Obsoleted by #8203

@denschub denschub closed this Feb 22, 2021
@Flaburgan Flaburgan deleted the 2999-likes-comment branch February 23, 2021 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants