-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
FIX: show urgent badge for mentions in DM threads #29821
base: main
Are you sure you want to change the base?
Conversation
03ca2bc
to
5aa7170
Compare
return this.chatTrackingStateManager.directMessageUnreadCount; | ||
return ( | ||
this.chatTrackingStateManager.directMessageUnreadCount + | ||
this.chatTrackingStateManager.directMessageMentionCount |
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.
Adds mention count to DMs tab on chat footer for mobile/drawer
this.args.channel.tracking.unreadCount + | ||
this.args.channel.tracking.mentionCount + | ||
this.args.channel.tracking.watchedThreadsUnreadCount |
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.
Adds the mention count for DM threads to the channel list indicator on mobile/drawer
return this.channel.tracking.unreadCount > 0 || | ||
this.channel.tracking.mentionCount > 0 || | ||
this.channel.tracking.watchedThreadsUnreadCount > 0 | ||
? "urgent" | ||
: "unread"; |
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.
Adds DM mention count to the sidebar as part of the urgent badge.
@@ -424,7 +423,18 @@ export default { | |||
} | |||
|
|||
get suffixValue() { | |||
return this.channel.tracking.unreadCount > 0 ? "circle" : ""; | |||
return this.channel.tracking.unreadCount > 0 || | |||
this.channel.unreadThreadsCountSinceLastViewed > 0 |
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.
We now show thread state for DM channels in the sidebar.
@@ -76,7 +76,7 @@ export default class ChatTrackingStateManager extends Service { | |||
|
|||
get allChannelUrgentCount() { | |||
return ( | |||
this.publicChannelMentionCount + | |||
this.allChannelMentionCount + |
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.
This allows us to show the urgent badge on the chat header icon when a user is mentioned within a thread in a DM channel.
const { allChannels } = this.chatChannelsManager; | ||
if (chatable.type === "user") { | ||
return allChannels.find( | ||
({ chatable: { users } }) => | ||
users?.length === 1 && users[0].id === chatable.model.id | ||
); |
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.
Since chatable type for 1-1 DMs is user
when searching within message creator, we need to get the channel so that we can access tracking data.
const aUrgent = | ||
a.tracking.unreadCount + | ||
a.tracking.mentionCount + | ||
a.tracking.watchedThreadsUnreadCount; |
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.
Adds mention count as part of the sorting logic for DM channels.
When thread tracking level is Normal in a DM channel, we should still show notification badges to the mentioned user.
This change means that:
When a user is @ mentioned in a thread that they’ve set to Normal tracking:
I've included some additional changes that we are missing:
Mention within a DM thread (header):
Mention within a DM thread (channel list):
Mention within a DM thread (chat footer badge):
Mention within a DM thread (sidebar):
Mention within a DM thread (unread tracked thread):