Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Messages are never marked as read when following near: link. #14169

Closed
whoodes opened this issue Mar 11, 2020 · 6 comments
Closed

Messages are never marked as read when following near: link. #14169

whoodes opened this issue Mar 11, 2020 · 6 comments

Comments

@whoodes
Copy link
Collaborator

whoodes commented Mar 11, 2020

If one is to follow a link in the form of:

https://chat.zulip.org/#narrow/stream/49-development-help/topic/%28no.20topic%29/near/829218

This will drop you at a point within a topic that is possibly well beyond your last read message, as such any messages viewed here are not marked as read.

This, of course, is the desired behavior to avoid marking messages as read all willy-nilly. However, this can have the counter-intuitive effect of not marking messages read when you are dropped at a point that places your oldest unread message in view (eg the link is to the very first message of a topic).

Say I'm dropped in at the * from following a near link (R = read and UR = unread)

...
R
R
R
UR
UR 
UR *
UR
...

In this case as well, I probably want to be able to mark messages as read.

A quote from Tim Abbott in this topic.

The problem is that thenear: link could go to a message that's far ahead of where you've read, and in that case we don't want to mass-mark things as read above where you've been. We probably need to change the logic to, for near,stream,topic narrows, set can_mark_messages_read if the oldest unread message in the topic is ever onscreen.

We would need to figure the right details for how to go about this, but in any case it might make for a more natural experience.

@hashirsarwar
Copy link
Collaborator

@zulipbot claim

@chrisbobbe
Copy link
Contributor

chrisbobbe commented Mar 11, 2020

This behavior came up in conversation yesterday; @gnprice mentions that the behavior of never marking messages as read when you follow a near: link is fairly recent, so here's a bit of archeology (thanks, Greg!).

That recent change was a0c11b6, on PR #12849. This was a follow-up to PR #12747, for issue #12556, which was for not marking messages as read in a search narrow. And that was done for issue #10886.

hashirsarwar added a commit to hashirsarwar/zulip that referenced this issue Mar 12, 2020
These changes add a new setting in `can_mark_messages_as_read()` to
mark messages as read if they are followed from the near link and
the oldest unread message in the topic is onscreen.

Fixes zulip#14169.
hashirsarwar added a commit to hashirsarwar/zulip that referenced this issue Mar 12, 2020
These changes add a new setting in `can_mark_messages_as_read()` to
mark messages as read if they are followed from the near link and
the oldest unread message in the topic is onscreen.

Fixes zulip#14169.
hashirsarwar added a commit to hashirsarwar/zulip that referenced this issue Mar 12, 2020
These changes add a new setting in `can_mark_messages_as_read()`
to mark messages as read if they are followed from the near link
and the oldest unread message in the topic is onscreen.

Fixes zulip#14169.
hashirsarwar added a commit to hashirsarwar/zulip that referenced this issue Mar 12, 2020
These changes add a new setting in `can_mark_messages_as_read()`
to mark messages as read if they are followed from the near link
and the oldest unread message in the topic is onscreen.

Fixes zulip#14169.
hashirsarwar added a commit to hashirsarwar/zulip that referenced this issue Mar 12, 2020
These changes add a new setting in `can_mark_messages_as_read()`
to mark messages as read if they are followed from the near link
and the oldest unread message in the topic is onscreen.

Fixes zulip#14169.
hashirsarwar added a commit to hashirsarwar/zulip that referenced this issue Mar 12, 2020
These changes add a new setting in `can_mark_messages_as_read()`
to mark messages as read if they are followed from the near link
and the oldest unread message in the topic is onscreen.

Fixes zulip#14169.
hashirsarwar added a commit to hashirsarwar/zulip that referenced this issue Mar 19, 2020
These changes add a new setting in `can_mark_messages_as_read()`
to mark messages as read if they are followed from the near link
and the oldest unread message in the topic is onscreen.

Fixes zulip#14169.
hashirsarwar added a commit to hashirsarwar/zulip that referenced this issue Mar 23, 2020
These changes add a new setting in `can_mark_messages_as_read()`
to mark messages as read if they are followed from the near link
and the oldest unread message in the topic is onscreen.

Fixes zulip#14169.
hashirsarwar added a commit to hashirsarwar/zulip that referenced this issue Mar 23, 2020
These changes add a new setting in `can_mark_messages_as_read()`
to mark messages as read if they are followed from the near link
and the oldest unread message in the topic is onscreen.

Fixes zulip#14169.
@zulipbot
Copy link
Member

zulipbot commented Apr 3, 2020

Hello @hashirsarwar, you have been unassigned from this issue because you have not updated this issue or any referenced pull requests for over 14 days.

You can reclaim this issue or claim any other issue by commenting @zulipbot claim on that issue.

Thanks for your contributions, and hope to see you again soon!

@timabbott
Copy link
Sponsor Member

So, after reflecting on this issue some more, here's how I think it should work. Fundamentally, the reason we disable marking messages as read in near: narrows is because you might click a link from the issue tracker to a thread you haven't read, and we don't want to have that lose your state if it's 100 messages past where you're caught up to. The right trigger for enabling marking messages as read is your having the opportunity to see all the messages. So here's a proposed algorithm:

  • If at some point the cursor is above the top unread message in a near: version of a can_mark_messages_read narrow, we flip a flag to set can_mark_message_read for the view (which means scrolling down will start marking messages as read)
  • If you're in a state of such a narrow where all unread messages in the view are onscreen, we mark them as read (basically, the existing bottom_whitespace handler would, before checking can_mark_messages_read, check if all unreads are in view, and if so, enable marking messages as read in the narrow).

The other solution I can imagine is more explicit; having a "Mark topic as read" button at the bottom, if we think this approach would feel too magical.

@timabbott
Copy link
Sponsor Member

@alya should we close this? I think the new banners communicate clearly what's going on in such a view, and I'm not sure whether or not there's something further to do here. If there is, we should probably open a new focused issue, since I think the current writeup doesn't feel actionable given the changes we've made in this space in the last year.

@alya
Copy link
Contributor

alya commented Nov 16, 2022

Yes, that's right. I think the banner resolves this general issue, and any further improvements can be filed as separate issues.

@alya alya closed this as completed Nov 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants