Skip to content

Conversation

@chungwwei
Copy link
Contributor

@chungwwei chungwwei commented Nov 25, 2025

Fixes: #1858

Still picture
narrow tap when long press
Screenshot_1765549260 Screenshot_1765549453
Screencasts

combined feed narrow

combined_feed_sc.mp4

channel narrow

channel_sc.mp4

mentions narrow

mention_sc.mp4
@gnprice gnprice added the maintainer review PR ready for review by Zulip maintainers label Nov 25, 2025
Copy link
Collaborator

@chrisbobbe chrisbobbe left a comment

Choose a reason for hiding this comment

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

Thanks! Comments below.

@chungwwei chungwwei force-pushed the read-confirm-dialog branch from 1de2a51 to 970aee6 Compare December 2, 2025 21:19
@chungwwei
Copy link
Contributor Author

@chrisbobbe Thanks for reviewing!

Squash the 4 commits into one.

KeywordSearchNarrow was the other narrow. Was not looking at the code, but when i tested in the app, the Mark all messages as read button didn't appear in the search view when searched. Would you be okay with me filing a follow up issue for KeywordSearchNarrow?

@chungwwei chungwwei requested a review from chrisbobbe December 2, 2025 21:33
@chrisbobbe
Copy link
Collaborator

chrisbobbe commented Dec 2, 2025

KeywordSearchNarrow was the other narrow.

That's not accurate. We should show the dialog when the narrow is not a conversation narrow. A "conversation narrow" is a topic narrow or a DM narrow; see e.g. the top of the Zulip Help Center "Reading conversations" article. These details are provided for you in the issue description and discussions linked from there.

In the zulip-flutter codebase, there are multiple kinds of Narrow other than TopicNarrow and DmNarrow. CombinedFeedNarrow and KeywordSearchNarrow are just two of those.

Copy link
Collaborator

@chrisbobbe chrisbobbe left a comment

Choose a reason for hiding this comment

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

Thanks! Comments below.

Since the issue is about the mark-as-read button at the bottom of the message list, I'd like to have some tests in the 'MarkAsReadWidget' group in test/widgets/message_list_test.dart that explicitly target the behavior. (I see you've already made some changes to existing tests there, basically as needed to make them pass.)

How about a new group('confirmation dialog', () {}); inside the 'MarkAsReadWidget' group, with tests like these:

  • test('CombinedFeedNarrow: show dialog', () {});
  • test('MentionsNarrow: show dialog', () {});
  • test('ChannelNarrow: show dialog', () {});
  • test('DmNarrow: do not show dialog', () {});
  • test('TopicNarrow: do not show dialog', () {});

For the 'do not show dialog' tests, you should be able to use the checkNoDialog helper in test/widgets/dialog_checks.dart.

return checkSuggestedActionDialog(tester,
expectedTitle: zulipLocalizations.markAllAsReadConfirmationDialogTitle,
expectedMessage: zulipLocalizations.markAllAsReadConfirmationDialogMessage(unreadCount),
expectDestructiveActionButton: true,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why expectDestructiveActionButton: true?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Set to false. Read can be reverted.

@chrisbobbe
Copy link
Collaborator

(I've also just filed #2030 and #2031 for future work, but those are out of scope for this PR; I don't expect them to require changes here. 🙂)

@chungwwei chungwwei force-pushed the read-confirm-dialog branch 6 times, most recently from 1f1b5ab to a595644 Compare December 12, 2025 09:24
A confirm ActionDialog is added to prevent accidentally marking many messages as read outside conversation views. Also, adjust existing MarkAsReadWidget tests and MarkChannelAsReadButton tests to account for the added confirmation dialog. Fixes: zulip#1858.
@chungwwei
Copy link
Contributor Author

Thanks @chrisbobbe! it's ready for another review.

@chungwwei chungwwei requested a review from chrisbobbe December 12, 2025 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer review PR ready for review by Zulip maintainers

3 participants