lemmy-ui icon indicating copy to clipboard operation
lemmy-ui copied to clipboard

Color highlighting of new comments

Open SNAFU-DE opened this issue 2 years ago • 6 comments

Requirements

  • [X] This is a feature request and not a bug report. Otherwise, please create a new bug report instead.
  • [X] Please check to see if this request (or a similar one) already exists.
  • [X] It's a single feature. Please don't request multiple features in one issue.

Describe the feature you'd like

Reddit has a feature (for premium users) that when you reopen a thread you've already visited, all new comments are highlighted in a different color. So you can see easily which comments you haven't read yet. I would find this feature very handy in Feddit as well.

As far as I know, this option does not exist in the Lemmy UI, but some external apps offer it via the GetReplies.html#unread_only api.

SNAFU-DE avatar Sep 18 '23 07:09 SNAFU-DE

Hmm, I wonder why this issue is still open. I joined Lemmy a year ago and even back then I recall there was some highlighting of certain comments, but it wasn't clear why certain comments were highlighted. It didn't appear to be "only new comments since the last time you refreshed the thread"; but sometimes it did... Recently, I haven't noticed any highlighting at all.

When I searched the github issues I see that it appears to exist: https://github.com/LemmyNet/lemmy-ui/issues/2264

The light grey color shown in the first screenshot here https://github.com/LemmyNet/lemmy-ui/issues/1531 is how the highlight has appeared for me, when it used to appear.

Besides Reddit's premium feature, this feature is also a default saidit.net feature. Saidit is open-source https://github.com/libertysoft3/saidit.

Oh, I just refreshed a lemmy.world post, and the only highlighted comment was 8 minutes ago. So I guess this comment from the other issue is correct:

As it currently stands, a comment that's newer than 10 minutes will be highlighted.

That's not very useful.

In case any devs find it useful, here's a script that can be used to highlight new reddit comments without paying for premium: https://gist.github.com/NathanSweet/de43d5b2cb0c0836763b

MaximilianKohler avatar Sep 14 '24 20:09 MaximilianKohler

We have:

  • a time based new comment highlight.
  • An aggregate for total unread comments, that compares the totals from the last time you read them, with new comments. That's how it shows (4 new comments).

But we don't have a comment_read table that stores every single comment you read, in order to compare with the ones you haven't. I'm also not sure that'd be a good idea, as it'd balloon the size of the database, storing every single comment every local user has read. Either way this would be a back-end issue first.

dessalines avatar Sep 16 '24 14:09 dessalines

So you think it would be best to do it locally in each user's browser, like this script does? https://gist.github.com/NathanSweet/de43d5b2cb0c0836763b

If so, I'll post on Lemmy about that. I expect someone should be able to make something like that for lemmy. Though it might be difficult due to the fact that there are so many different lemmy URLs. IE: for reddit, there's old.reddit and www.reddit, but for lemmy there are dozens/hundreds of lemmy.world, lemm.ee, lemmy.ml, etc.

But I think this kind of feature is essential for being able to follow threads/discussions.

Reddit premium, and saidit both store it in their database?

But we don't have a comment_read table that stores every single comment you read, in order to compare with the ones you haven't. I'm also not sure that'd be a good idea, as it'd balloon the size of the database, storing every single comment every local user has read.

How about, instead of storing every read comment, you just store a timestamp, and then compare the timestamps of the comments when someone refreshes the thread? It seems similar to how you're showing 4 new comments.

I see an existing backend issue for this: https://github.com/LemmyNet/lemmy/issues/2352. I'll comment there.

As it currently stands, a comment that's newer than 10 minutes will be highlighted

I would probably just disable this, since I don't think it's useful, and is a bit confusing.

MaximilianKohler avatar Sep 16 '24 22:09 MaximilianKohler

It would be best to change the logic in lemmy-ui, so that comments are highlighted if they are newer than the last_read time (instead of highlighting comments that are newer than 10 minutes).

Nutomic avatar Sep 17 '24 09:09 Nutomic

But we don't have a comment_read table that stores every single comment you read, in order to compare with the ones you haven't. I'm also not sure that'd be a good idea, as it'd balloon the size of the database, storing every single comment every local user has read. Either way this would be a back-end issue first.

the approach that phiresky mentioned (save to local storage, delete information of older posts) is what RES uses and seems to work well.

wiki-me avatar Sep 17 '24 13:09 wiki-me

It would be best to change the logic in lemmy-ui, so that comments are highlighted if they are newer than the last_read time (instead of highlighting comments that are newer than 10 minutes).

I checked and it looks like the back-end doesn't store a last_read time on the person_post_aggregates table (it compares a read_comment count with the current comment count. We could add an updated column to that tho, and it would serve that purpose.

dessalines avatar Sep 18 '24 13:09 dessalines

Can re-open if someone wants to take this on.

dessalines avatar Jul 30 '25 11:07 dessalines

Lemmy already highlights comments which are newer than 10 minutes with a brighter background.

Nutomic avatar Jul 30 '25 12:07 Nutomic

newer than 10 minutes

This is not sufficient when a user returns to a previously viewed post, for example, a day or two later

andreymal avatar Jul 30 '25 12:07 andreymal

That would be https://github.com/LemmyNet/lemmy-ui/issues/3216

Nutomic avatar Aug 01 '25 19:08 Nutomic