mlem icon indicating copy to clipboard operation
mlem copied to clipboard

[tentative] [2.0] highlight new comments

Open EricBAndrews opened this issue 1 year ago • 1 comments

We currently show the number of new comments, but do not highlight them when entering the expanded post view. The API doesn't tell us which comments are new, but we may be able to handle it client-side.

This would require caching some data locally, so we would have to impose some sort of eviction policy. If we wish to support remembering collapse state (#529), we can handle this case for free by checking whether a comment exists in the cache. A more data-efficient approach would be to simply cache the read time of each expanded post and highlight comments published after that time.

Either way we will need to implement an efficient local cache to handle this data. I'm flagging this as something to investigate for 2.0, since such a system would likely hook into the caching layer of the API client.

EricBAndrews avatar Mar 05 '24 16:03 EricBAndrews

It might be easier to put up an issue for Lemmy to include the last read time in ApiPostView. It should be relatively simple on their end, assuming that they're using the last read time to calculate the number of new comments.

We'd need to have some sort of local caching system if we wanted to remember collapse state though, yeah. We'd also need it for #929, if that's something we want to look into at some point.

Sjmarf avatar Mar 05 '24 18:03 Sjmarf