-
Notifications
You must be signed in to change notification settings - Fork 310
msglist: Support @-mentions narrow #807
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
Changes from all commits
799162c
205a85a
147ea7e
8c07c48
028e2a7
3e5c438
71b23f5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -235,6 +235,7 @@ class _MessageListPageState extends State<MessageListPage> implements MessageLis | |
bool removeAppBarBottomBorder = false; | ||
switch(widget.narrow) { | ||
case CombinedFeedNarrow(): | ||
case MentionsNarrow(): | ||
appBarBackgroundColor = null; // i.e., inherit | ||
|
||
case ChannelNarrow(:final streamId): | ||
|
@@ -277,11 +278,9 @@ class _MessageListPageState extends State<MessageListPage> implements MessageLis | |
context: context, | ||
|
||
// The compose box, when present, pads the bottom inset. | ||
// TODO this copies the details of when the compose box is shown; | ||
// if those details get complicated, refactor to avoid copying. | ||
// TODO(#311) If we have a bottom nav, it will pad the bottom | ||
// inset, and this should always be true. | ||
removeBottom: widget.narrow is! CombinedFeedNarrow, | ||
removeBottom: ComposeBox.hasComposeBox(widget.narrow), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Happily I think we can now remove the TODO above this: // TODO this copies the details of when the compose box is shown;
// if those details get complicated, refactor to avoid copying. |
||
|
||
child: Expanded( | ||
child: MessageList(narrow: widget.narrow))), | ||
|
@@ -322,6 +321,9 @@ class MessageListAppBarTitle extends StatelessWidget { | |
case CombinedFeedNarrow(): | ||
return Text(zulipLocalizations.combinedFeedPageTitle); | ||
|
||
case MentionsNarrow(): | ||
return Text(zulipLocalizations.mentionsPageTitle); | ||
|
||
case ChannelNarrow(:var streamId): | ||
final store = PerAccountStoreWidget.of(context); | ||
final stream = store.streams[streamId]; | ||
|
@@ -514,7 +516,7 @@ class _MessageListState extends State<MessageList> with PerAccountStoreAwareStat | |
return _buildItem(data, i); | ||
})); | ||
|
||
if (widget.narrow is CombinedFeedNarrow) { | ||
if (!ComposeBox.hasComposeBox(widget.narrow)) { | ||
// TODO(#311) If we have a bottom nav, it will pad the bottom | ||
// inset, and this shouldn't be necessary | ||
sliver = SliverSafeArea(sliver: sliver); | ||
|
@@ -807,12 +809,25 @@ class RecipientHeader extends StatelessWidget { | |
final Message message; | ||
final Narrow narrow; | ||
|
||
static bool _containsDifferentChannels(Narrow narrow) { | ||
switch (narrow) { | ||
case CombinedFeedNarrow(): | ||
case MentionsNarrow(): | ||
return true; | ||
|
||
case ChannelNarrow(): | ||
case TopicNarrow(): | ||
case DmNarrow(): | ||
return false; | ||
} | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final message = this.message; | ||
return switch (message) { | ||
StreamMessage() => StreamMessageRecipientHeader(message: message, | ||
showStream: narrow is CombinedFeedNarrow), | ||
showStream: _containsDifferentChannels(narrow)), | ||
DmMessage() => DmRecipientHeader(message: message), | ||
}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doesn't seem like the right reasoning. We include the stream name in recipient headers just when the message list might include messages in different streams, so the user can know which stream each stream message belongs to. The presence/absence of the compose box isn't really part of that story. I see that we'd like there to be an exhaustive switch, though. We could do that inline, or perhaps out in a helper function. (Not on the compose box, though, since it's not really relevant, as mentioned.) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah. I prefer adding a helper with switch cases in this case. |
||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the copy (the
toList
call)?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updateMessageFlags
(which callsconnection.post
) expects a List of message ids.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see, and
Unreads.mentions
is a Set. Sounds good, then.