Skip to content

msglist: Softly override mark-read-on-scroll setting in starred/mentions #1659

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions lib/widgets/message_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ abstract class MessageListPageState {
///
/// For example, this is set to false after pressing
/// "Mark as unread from here" in the message action sheet.
// TODO(#1655) When this is false and
// [GlobalSettingsStore.markReadOnScrollForNarrow] gives true,
// show an alert and a button that lets you exit this temporary state.
bool? get markReadOnScroll;
set markReadOnScroll(bool? value);
}
Expand Down Expand Up @@ -235,6 +238,18 @@ class _MessageListPageState extends State<MessageListPage> implements MessageLis
void initState() {
super.initState();
narrow = widget.initNarrow;

switch (narrow) {
case CombinedFeedNarrow():
case ChannelNarrow():
case TopicNarrow():
case DmNarrow():
break;
case MentionsNarrow():
case StarredMessagesNarrow():
// TODO(#1583) write tests for this
_markReadOnScroll = false;
Comment on lines +248 to +251
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, is this really what web does? Even if you have the "Automatically mark messages as read" setting set to "Always"? (If that's either of the other values, then it's as if this were false anyway.)

As I said in the office earlier (probably a bit after you sent this PR), it seems fine to me if choosing "Always" for that setting means always. In particular that was the behavior Zulip web had, with no option to do something else, for a number of years.

In any event I think this isn't a blocker for search. With the default value of the auto-mark-read setting, at "conversations only", it'll have no effect.

}
}

void _narrowChanged(Narrow newNarrow) {
Expand Down