Show only liked posts in a thread


#1

It would come handy if you want to get an overview of a topic with lots of posts if you could narrow down the view to only posts that have at least one like.

Alternatively It would already help if all posts withoul likes would be shown minimized somehow, (maybe only the first line and a more-button)

How could this be implemented?


#2

That’s basically the summarize thread feature which already exists :blush:


#3

But If I use Summarize it also hides some posts, that have a “like”.

What is the exact mechanism for “summarize”?


(Mittineague) #4

Good question. I looked a very little for the code that does the logic but didn’t find it.

Using the topic I used to answer your post in the other topic

It says there is a total of 116 Likes in the topic. If my math is correct, all of the posts in the Summary have Likes, but only add up to 78

So some posts that received Likes did get collapsed.

It seems that Frequent poster may be in play, and possibly OP.

Some of the Collapsed posts had from 1 to 4 Likes.
Some were shorter replies, some not so short.
Some were “infrequent” posters, some were not.
Some had cross-reference links, some did not.
And I’m guessing there may be some kind of “keyword” matching involved.

I can’t grasp the logic and would need to see the code involved.


#5

Which exact code is involved? (I could take a look at it)


(Mittineague) #6

That’s what I need to know, where is the code?


(Jeff Atwood) #8

No, that is not our repo.


#9

It could be in here: discourse/filter_best_posts.rb at master · discourse/discourse · GitHub


(Mittineague) #10

If that is the right file (and not used only for Digest inclusion or the Top pages) then it looks as though it uses Likes by Moderators and posts by a members Trust Level

  def filter
    @posts =  if @min_replies && @topic.posts_count < @min_replies + 1
                []
              else
                filter_posts_liked_by_moderators
                setup_posts
                filter_posts_based_on_trust_level
                filter_posts_based_on_score
                sort_posts
              end
  end

#11

is this documented somewhere?