When you have a threaded comment system, how do you decide whether you collapse replies to top level comments or no?
vs some kind of collapsed threads (sometimes they show 1 or 2 of second-level replies)
Is there any sort of guidelines when it’s better to collapse thread vs to leave it fully open? Does it depends on the site type, e.g. news sites seem to show all threads open, and social media like Facebook or Instagram mostly collapse?
I don't think there is an exact algorithm, but I think (if you must have comment sub-threads) it should be that they are visible by default, but hideable when you've read them.
In those heady days before Facebook, I used to use phpBB, where there was no subthreading, though you could (iirc) mention someone (tag them) and quote a snippet of their post. People used to actually read all the posts on a thread before commenting, and actually post well-thought-out answers to questions.
With Facebook sub-threading (and the fact that they hide many of the previous comments on a post), one often ends up replying with the same comment over and over again, especially if the comments get heated.
Disqus subthreading seems a lot better, in that they don't hide comments (but subthreads do sometimes end up in the wrong order).
WordPress comments seem to only go to two levels of replies (probably wise).
So, my advice, don't hide any comments; don't have too many nested levels of subthreading; and moderate comments to avoid trolls and derailers.
This is based on my experience of discussions in comments, and the following articles:
If you're building software with social components, plan for the worst kinds of behavior from your users from the start. At least lay the groundwork for technological and social controls to handle those inevitable issues, or you'll eventually regret it. -- Jeff Atwood
When to collapse
If under the content, which contains all the comments, follows other content. So the user can either read the comments if he's interested or scroll to the next content.
Facebook collapses the comments on the timeline. This is because the user usually scrolls through all the posts and only read the comments of those posts where he's interested in.
When to show it all
If there is no relevant content that follows the comments. This is mostly the case when you are in a detail view of a post or article.
Example News Site:
In an article on a news site, at the bottom is mostly the comment section where all the comments are shown. This is because after an article, mostly you go back to the overview, unless you're interested in the comments. So they display all comments expanded, in order to let the user scan through the comments and maybe step in to the conversation.
Don't forget the quantity
Maybe you think "but there are websites which collapse comments on the detail page", like quora.
Here you need to think about what kind of comment the user will post. Do the comments itself represent something worth knowing? If yes, the comments on this comment are a conversation about the answer and not primarily interesting for the user. So collapse it and set the focus on the important comment.
On reddit or also Medium, the answers aren't collapsed, because those are more of a conversation between users about the topic of the content. So it could be more interesting for the user to read all comments without the extra click to expand.
mobile / desktop
A more obvious point is the mobile / desktop talk:
You have more space on the desktop to scroll through a collapsed conversation. On mobile, the site could get extremely long to scroll through, so maybe collapse the comments there.
Think about what you want to achieve. Then look up similar applications to yours and see how they've done it. And think about why they done it that way and what the users want to achieve.
There is, as always, no "one fits all" solution.