-
Notifications
You must be signed in to change notification settings - Fork 355
home: Show unread counts in main menu #1997
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
base: main
Are you sure you want to change the base?
Conversation
|
cc @alya |
109e8dc to
b33421b
Compare
rajveermalviya
left a comment
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.
Thanks @chrisbobbe! LGTM, moving over to Greg's review.
gnprice
left a comment
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.
Thanks! Small comments.
| // One is muted, one isn't: don't exclude | ||
| eg.dmMessage(from: eg.thirdUser, to: [eg.selfUser, eg.otherUser], flags: []), | ||
| ]); | ||
| check(model.countInCombinedFeedNarrow()).equals(2); |
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.
Given the name of the test case, this should be calling countInAllDms, right?
| int countInAllDms() { | ||
| int c = 0; | ||
| for (final MapEntry(key: narrow, value: messageIds) in dms.entries) { | ||
| if (channelStore.shouldMuteDmConversation(narrow)) continue; | ||
| c += messageIds.length; |
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.
The name feels misleading, given that this isn't actually all DMs. 🙂 A bit like how we moved away from "All messages" to "Combined feed".
How about just countInDms? And maybe dartdoc mentioning it excludes muted DM conversations.
| // Exclude because user is muted | ||
| eg.dmMessage(from: eg.thirdUser, to: [eg.selfUser], flags: []), |
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.
nit: the muted channel and topic just above don't have comments, so seems clearest not to add one only here
| @override | ||
| Widget? buildTrailing(BuildContext context) { | ||
| final store = PerAccountStoreWidget.of(context); | ||
| final unreadCount = store.unreads.countInCombinedFeedNarrow(); |
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.
Hmm, I worry a bit about adding this call site given this TODO for #370:
// TODO(#370): maintain this count incrementally, rather than recomputing from scratch
int countInCombinedFeedNarrow() {
Do you have any timings on how long this takes with lots of unreads?
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, this is only in the main-menu bottom sheet, not the bottom tabs. In that case I guess it doesn't make the impact any worse than it is now with the mark-as-read button in the message list.
Fixes-partly: #1088
A follow-up to #1959, clearing one of the TODOs on the
UnreadCountBadgewidget.Screenshots: