19
votes
How does the "collapse old comments when I return to a topic" feature work?
I have the "collapse old comments when I return to a topic" setting turned on, but I can't quite figure out how it works. For example, when open a new topic for the first time and scroll through the comments, the next time I open the topic, they're all still open.
Does anyone have more details about how this feature works or how I should be using it?
Thank you!
Only when there are new comments will it collapse any old comments, so if you refresh and no new comments have happened, nothing will be collapsed.
Aaah. That explains it. Thank you!
To be honest I find this behavior a little confusing. I think I’d prefer if it always collapsed comments that were previously seen, regardless of if there are new comments.
Haven't poked at the code yet, but at a guess, user clicks thread -> timestamp set -> user opens thread again -> collapse any comments with a timestamp < user visit timestamp.
It also has a neat little bit where it'll keep the parent comment of any new comment open, so that's not all of it :)
For those who want to dig into it:
https://gitlab.com/tildes/tildes/-/blob/master/tildes/tildes/views/topic.py#L471-475
https://gitlab.com/tildes/tildes/-/blob/master/tildes/tildes/models/comment/comment_tree.py#L224-261
Perfect. Thank you.
Yeah, this is likely what is happening here. In my comment that I accidentally deleted, I compared it to the common feature on other platforms that marks new posts in a thread since your last view of it with a "New" badge or a colored border to make it easier to see that these are the new ones. Except in this case, the comments older than last_view_date are modified to be collapsed (And only if the topic has new comments since last_view_date).
Damn, I accidentally deleted my comment to this post after I sent it 😭