circumflex icon indicating copy to clipboard operation
circumflex copied to clipboard

Add opt to mark as read when opening link

Open antznin opened this issue 1 year ago • 3 comments

Hi,

This PR adds the argument --mark-read-on-open to mark the items as read (write it in history) when opening a link.

Curious to have comments on this. On my side, it felt missing that the article was marked unread even though I did go through the article in my browser (not the comments, though).

antznin avatar May 12 '24 04:05 antznin

Hey @antznin and thanks for the PR! I think this behavior makes sense for sure.

There is currently one issue with the way I implemented the mark as read feature as it currently stands: it is tightly coupled with the feature where we mark new comments as read.

For example, if we mark the story as read, we both mark the story as read and add a timestamp to when the story was read. This means that a user who has opened a link and later want to read the comment section will have some comments marked as "new" even though the user hasn't read the comment section at all.

Maybe it isn't an issue at all (as it could be interesting to see "new" comments). I am leaning towards having opening an article in any capacity (reader mode, open link in browser, comment section) mark the story as read. What do you think?

bensadeh avatar May 14 '24 08:05 bensadeh

Hi @bensadeh,

I'm not sure I see the same behavior, or that I understand what you mean correctly. When passing --mark-read-on-open, if I open a link without opening the comments (with o) and go back to circumflex, the title is in italic and marked as read (that's what we want). Then, if I open the comment section for that same article the comments are not marked as new for me. Did you expect all the comments to be marked as new (with )?


To go further on the different modes when --mark-read-on-open is passed:

  • When opening an article in reader mode (Space), it is not marked as read when returning to the main menu.
  • When opening the comments in the browser (c), it is not marked as read when returning to the main menu.

So this change is just limited to keymap o if that makes sense.

I think that's what you're referring to: should we consider going beyond my change and have the possibilty to mark as read/mark as read by default for these two other keymaps (Space and c)?

I think it makes sense, yes. Having flexibility on what is configurable would be nice, but might add too many options.

antznin avatar May 14 '24 16:05 antznin

Just to clarify with an example:

  • At 10:00 a clx user opens an article with space or c
  • circumflex internally marks that the article is read at 10:00
  • A hacker news user comments on the same story at 10:01
  • The same clx user from before opens the comment section at 10:02
  • circumflex will mark the comment from 10:01 as new since it is newer than 10:00 even though this is the first time the clx user reads the comment section

However, I this might not be an issue in practice. I like your suggested change anyway.

Would you be able to update the PR to have this be the default behavior (i.e. no config)? Don't worry about space or c for now, just have it apply for opening the link using o like in your original PR.

bensadeh avatar May 20 '24 05:05 bensadeh

Hi @bensadeh,

Thanks for your comment!

I will get back to this in a couple of weeks, as I don't have access to my computer atm (vacationing 🌴)

antznin avatar May 28 '24 21:05 antznin

Enjoy your vacation, my friend 😎

bensadeh avatar May 29 '24 07:05 bensadeh

Hi @bensadeh,

Here it is, mark as read when opening a link and make it the default behavior. If this looks good to you, I could also try to add this behavior for space and c!

antznin avatar Jun 12 '24 03:06 antznin

Looks good to me! Thanks for putting this PR together.

I like this behavior, happy to accept PRs for space and c 😄

bensadeh avatar Jul 03 '24 14:07 bensadeh