@@ -63,6 +63,7 @@ class _MessageListPageState extends State<MessageListPage> {
63
63
bool removeAppBarBottomBorder = false ;
64
64
switch (widget.narrow) {
65
65
case CombinedFeedNarrow ():
66
+ case MentionsNarrow ():
66
67
appBarBackgroundColor = null ; // i.e., inherit
67
68
68
69
case StreamNarrow (: final streamId):
@@ -109,7 +110,8 @@ class _MessageListPageState extends State<MessageListPage> {
109
110
// if those details get complicated, refactor to avoid copying.
110
111
// TODO(#311) If we have a bottom nav, it will pad the bottom
111
112
// inset, and this should always be true.
112
- removeBottom: widget.narrow is ! CombinedFeedNarrow ,
113
+ removeBottom: widget.narrow is ! CombinedFeedNarrow
114
+ && widget.narrow is ! MentionsNarrow ,
113
115
114
116
child: Expanded (
115
117
child: MessageList (narrow: widget.narrow))),
@@ -170,6 +172,9 @@ class MessageListAppBarTitle extends StatelessWidget {
170
172
final names = otherRecipientIds.map ((id) => store.users[id]? .fullName ?? '(unknown user)' );
171
173
return Text ("DMs with ${names .join (", " )}" ); // TODO show avatars
172
174
}
175
+
176
+ case MentionsNarrow ():
177
+ return Text (zulipLocalizations.mentionsPageTitle);
173
178
}
174
179
}
175
180
}
@@ -340,7 +345,7 @@ class _MessageListState extends State<MessageList> with PerAccountStoreAwareStat
340
345
return _buildItem (data, i);
341
346
}));
342
347
343
- if (widget.narrow is CombinedFeedNarrow ) {
348
+ if (widget.narrow is CombinedFeedNarrow || widget.narrow is MentionsNarrow ) {
344
349
// TODO(#311) If we have a bottom nav, it will pad the bottom
345
350
// inset, and this shouldn't be necessary
346
351
sliver = SliverSafeArea (sliver: sliver);
@@ -521,7 +526,7 @@ class RecipientHeader extends StatelessWidget {
521
526
final message = this .message;
522
527
return switch (message) {
523
528
StreamMessage () => StreamMessageRecipientHeader (message: message,
524
- showStream: narrow is CombinedFeedNarrow ),
529
+ showStream: narrow is CombinedFeedNarrow || narrow is MentionsNarrow ),
525
530
DmMessage () => DmRecipientHeader (message: message),
526
531
};
527
532
}
@@ -1111,5 +1116,12 @@ Future<void> _legacyMarkNarrowAsRead(BuildContext context, Narrow narrow) async
1111
1116
messages: unreadDms,
1112
1117
op: UpdateMessageFlagsOp .add,
1113
1118
flag: MessageFlag .read);
1119
+ case MentionsNarrow ():
1120
+ final unreadMentions = store.unreads.mentions.toList ();
1121
+ if (unreadMentions.isEmpty) return ;
1122
+ await updateMessageFlags (connection,
1123
+ messages: unreadMentions,
1124
+ op: UpdateMessageFlagsOp .add,
1125
+ flag: MessageFlag .read);
1114
1126
}
1115
1127
}
0 commit comments