fix(chat): muted chats stay in the chat list and stay out of Activity
- Muted section is off until the user turns it on (Teams default for this tenant) - Muted chat row: bell-off icon replaces the avatar, like Teams - Unread muted chats stay bold without a count, in every section - Activity skips muted chats unless they mention me Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@@ -9,7 +9,7 @@ use super::reactions::reacted_messages;
9
9
use crate::app_state::{AppEvent, AppState};
10
10
use crate::call::MissedCall;
11
11
use crate::demo;
12
use crate::notify::{IncomingTracker, channel_alerts};
12
use crate::notify::{IncomingTracker, alerts};
13
13
use crate::people::resolve_names;
14
14
15
15
const WATERMARK_KEY: &str = "activity_watermark";
@@ -142,6 +142,7 @@ impl ActivityCenter {
142
142
let from_me =
143
143
my_user_id.is_some() && chat.last_message_sender_id.as_deref() == my_user_id;
144
144
if at <= self.cutoff
145
|| chat.muted
145
146
|| from_me
146
147
|| chat.last_message_deleted
147
148
|| selected == Some(chat.id.as_str())
@@ -173,7 +174,7 @@ impl ActivityCenter {
173
174
.unwrap_or_default();
174
175
let _ = state.store.set_meta_time(WATERMARK_KEY, Utc::now());
175
176
if !foreground {
176
for incoming in found.iter().filter(|incoming| channel_alerts(incoming)) {
177
for incoming in found.iter().filter(|incoming| alerts(incoming)) {
177
178
self.feed
178
179
.record_message(incoming, preview_label(&incoming.preview));
179
180
}
@@ -9,7 +9,7 @@ use super::reactions::reacted_messages;9
use crate::app_state::{AppEvent, AppState};9
use crate::app_state::{AppEvent, AppState};10
use crate::call::MissedCall;10
use crate::call::MissedCall;11
use crate::demo;11
use crate::demo;12
use crate::notify::{IncomingTracker, channel_alerts};12
use crate::notify::{IncomingTracker, alerts};13
use crate::people::resolve_names;13
use crate::people::resolve_names;14
14
15
const WATERMARK_KEY: &str = "activity_watermark";15
const WATERMARK_KEY: &str = "activity_watermark";@@ -142,6 +142,7 @@ impl ActivityCenter {142
let from_me =142
let from_me =143
my_user_id.is_some() && chat.last_message_sender_id.as_deref() == my_user_id;143
my_user_id.is_some() && chat.last_message_sender_id.as_deref() == my_user_id;144
if at <= self.cutoff144
if at <= self.cutoff145
|| chat.muted145
|| from_me146
|| from_me146
|| chat.last_message_deleted147
|| chat.last_message_deleted147
|| selected == Some(chat.id.as_str())148
|| selected == Some(chat.id.as_str())@@ -173,7 +174,7 @@ impl ActivityCenter {173
.unwrap_or_default();174
.unwrap_or_default();174
let _ = state.store.set_meta_time(WATERMARK_KEY, Utc::now());175
let _ = state.store.set_meta_time(WATERMARK_KEY, Utc::now());175
if !foreground {176
if !foreground {176
for incoming in found.iter().filter(|incoming| channel_alerts(incoming)) {177
for incoming in found.iter().filter(|incoming| alerts(incoming)) {177
self.feed178
self.feed178
.record_message(incoming, preview_label(&incoming.preview));179
.record_message(incoming, preview_label(&incoming.preview));179
}180
}@@ -9,4 +9,4 @@ pub use app_base::notify::{badge, platform, ring_tone};
9
9
pub use incoming::{IncomingTracker, preview_of};
10
10
#[cfg(windows)]
11
11
pub use platform::native_handle;
12
pub use rules::{ChatKind, Incoming, Preview, channel_alerts};
12
pub use rules::{ChatKind, Incoming, Preview, alerts};
@@ -9,4 +9,4 @@ pub use app_base::notify::{badge, platform, ring_tone};9
pub use incoming::{IncomingTracker, preview_of};9
pub use incoming::{IncomingTracker, preview_of};10
#[cfg(windows)]10
#[cfg(windows)]11
pub use platform::native_handle;11
pub use platform::native_handle;12
pub use rules::{ChatKind, Incoming, Preview, channel_alerts};12
pub use rules::{ChatKind, Incoming, Preview, alerts};@@ -165,7 +165,11 @@ pub struct Decision {
165
165
pub sound: bool,
166
166
}
167
167
168
pub fn channel_alerts(incoming: &Incoming) -> bool {
168
pub fn alerts(incoming: &Incoming) -> bool {
169
channel_alerts(incoming) && (!incoming.muted || incoming.mentions_me)
170
}
171
172
fn channel_alerts(incoming: &Incoming) -> bool {
169
173
if !matches!(incoming.kind, ChatKind::Channel { .. }) || incoming.mentions_me {
170
174
return true;
171
175
}
@@ -197,14 +201,13 @@ const SILENT: Decision = Decision {
197
201
};
198
202
199
203
pub fn decide(settings: &Settings, incoming: &Incoming, environment: Environment) -> Decision {
200
let suppressed = !channel_alerts(incoming)
204
let suppressed = !alerts(incoming)
201
205
|| !channel_toasts(incoming)
202
206
|| environment.chat_in_foreground
203
207
|| environment.system_quiet
204
208
|| environment.own_do_not_disturb
205
209
|| settings.do_not_disturb
206
210
|| (settings.mute_in_calls && environment.in_call)
207
|| (incoming.muted && !incoming.mentions_me)
208
211
|| (settings.mentions_only && !incoming.mentions_me && !incoming.is_direct());
209
212
if suppressed {
210
213
return SILENT;
@@ -410,14 +413,16 @@ mod tests {
410
413
}
411
414
412
415
#[test]
413
fn muted_chat_only_notifies_for_mentions() {
416
fn muted_chat_only_alerts_and_notifies_for_mentions() {
414
417
let mut muted = group();
415
418
muted.muted = true;
419
assert!(!alerts(&muted));
416
420
assert_eq!(
417
421
decide(&Settings::default(), &muted, Environment::default()),
418
422
SILENT
419
423
);
420
424
muted.mentions_me = true;
425
assert!(alerts(&muted));
421
426
assert!(decide(&Settings::default(), &muted, Environment::default()).toast);
422
427
}
423
428
@@ -165,7 +165,11 @@ pub struct Decision {165
pub sound: bool,165
pub sound: bool,166
}166
}167
167
168
pub fn channel_alerts(incoming: &Incoming) -> bool {168
pub fn alerts(incoming: &Incoming) -> bool {169
channel_alerts(incoming) && (!incoming.muted || incoming.mentions_me)170
}171
172
fn channel_alerts(incoming: &Incoming) -> bool {169
if !matches!(incoming.kind, ChatKind::Channel { .. }) || incoming.mentions_me {173
if !matches!(incoming.kind, ChatKind::Channel { .. }) || incoming.mentions_me {170
return true;174
return true;171
}175
}@@ -197,14 +201,13 @@ const SILENT: Decision = Decision {197
};201
};198
202
199
pub fn decide(settings: &Settings, incoming: &Incoming, environment: Environment) -> Decision {203
pub fn decide(settings: &Settings, incoming: &Incoming, environment: Environment) -> Decision {200
let suppressed = !channel_alerts(incoming)204
let suppressed = !alerts(incoming)201
|| !channel_toasts(incoming)205
|| !channel_toasts(incoming)202
|| environment.chat_in_foreground206
|| environment.chat_in_foreground203
|| environment.system_quiet207
|| environment.system_quiet204
|| environment.own_do_not_disturb208
|| environment.own_do_not_disturb205
|| settings.do_not_disturb209
|| settings.do_not_disturb206
|| (settings.mute_in_calls && environment.in_call)210
|| (settings.mute_in_calls && environment.in_call)207
|| (incoming.muted && !incoming.mentions_me)208
|| (settings.mentions_only && !incoming.mentions_me && !incoming.is_direct());211
|| (settings.mentions_only && !incoming.mentions_me && !incoming.is_direct());209
if suppressed {212
if suppressed {210
return SILENT;213
return SILENT;@@ -410,14 +413,16 @@ mod tests {410
}413
}411
414
412
#[test]415
#[test]413
fn muted_chat_only_notifies_for_mentions() {416
fn muted_chat_only_alerts_and_notifies_for_mentions() {414
let mut muted = group();417
let mut muted = group();415
muted.muted = true;418
muted.muted = true;419
assert!(!alerts(&muted));416
assert_eq!(420
assert_eq!(417
decide(&Settings::default(), &muted, Environment::default()),421
decide(&Settings::default(), &muted, Environment::default()),418
SILENT422
SILENT419
);423
);420
muted.mentions_me = true;424
muted.mentions_me = true;425
assert!(alerts(&muted));421
assert!(decide(&Settings::default(), &muted, Environment::default()).toast);426
assert!(decide(&Settings::default(), &muted, Environment::default()).toast);422
}427
}423
428
@@ -45,6 +45,7 @@ pub enum AvatarSpec {
45
45
Single(Face),
46
46
Pair(Face, Face),
47
47
Meeting,
48
Muted,
48
49
}
49
50
50
51
#[derive(Debug, Clone, PartialEq, Eq)]
@@ -161,7 +162,7 @@ pub fn chat_item(chat: &ChatRecord, input: &SectionInput<'_>, folder_id: Option<
161
162
} else {
162
163
Unread::None
163
164
};
164
let presence_user = is_one_on_one(chat)
165
let presence_user = (is_one_on_one(chat) && !chat.muted)
165
166
.then(|| {
166
167
others(chat, me)
167
168
.into_iter()
@@ -192,7 +193,11 @@ pub fn chat_item(chat: &ChatRecord, input: &SectionInput<'_>, folder_id: Option<
192
193
muted: chat.muted,
193
194
is_group: chat.kind == GROUP_KIND,
194
195
member_count: chat.members.len(),
195
avatar: avatar_for(chat, me),
196
avatar: if chat.muted {
197
AvatarSpec::Muted
198
} else {
199
avatar_for(chat, me)
200
},
196
201
presence_user,
197
202
folder_id: folder_id.map(str::to_owned),
198
203
}
@@ -446,11 +451,9 @@ fn section(
446
451
0
447
452
};
448
453
items.truncate(count - hidden_count);
449
if kind == SectionKind::Muted {
450
for item in &mut items {
451
if item.unread.is_unread() {
452
item.unread = Unread::Silent;
453
}
454
for item in items.iter_mut().filter(|item| item.muted) {
455
if item.unread.is_unread() {
456
item.unread = Unread::Silent;
454
457
}
455
458
}
456
459
Section {
@@ -724,7 +727,7 @@ mod tests {
724
727
quiet.muted = true;
725
728
let chats = [quiet, chat("b", "group", true)];
726
729
assert_eq!(unread_chat_count(&chats), 1);
727
let directory = Directory::default();
730
let directory = sectioned_directory(true, Vec::new());
728
731
let collapsed = HashSet::new();
729
732
let sections = build_sections(&input(&chats, &directory, &collapsed));
730
733
assert_eq!(sections[0].unread_chats, 1);
@@ -985,12 +988,28 @@ mod tests {
985
988
}
986
989
987
990
#[test]
988
fn muted_is_on_until_the_user_chooses_and_meeting_chats_stay_in_others() {
991
fn muted_chats_stay_in_others_until_the_user_turns_the_section_on() {
989
992
let chats = vec![muted_chat("quiet"), meeting_chat("sync")];
990
993
let directory = Directory::default();
991
994
let sections = build_sections(&input(&chats, &directory, &HashSet::new()));
992
assert_eq!(section_ids(§ions), vec![OTHERS_ID, MUTED_ID]);
993
assert_eq!(item_ids(§ions[0]), vec!["sync"]);
995
assert_eq!(section_ids(§ions), vec![OTHERS_ID]);
996
assert_eq!(item_ids(§ions[0]), vec!["quiet", "sync"]);
997
assert!(sections[0].items[0].muted);
998
assert_eq!(sections[0].items[0].avatar, AvatarSpec::Muted);
999
assert_eq!(sections[0].items[1].avatar, AvatarSpec::Meeting);
1000
}
1001
1002
#[test]
1003
fn a_muted_chat_in_others_stays_bold_without_a_count() {
1004
let mut quiet = muted_chat("quiet");
1005
quiet.unread = true;
1006
let chats = vec![quiet];
1007
let mut directory = Directory::default();
1008
directory.unread_counts.insert("quiet".into(), 4);
1009
let sections = build_sections(&input(&chats, &directory, &HashSet::new()));
1010
assert_eq!(sections[0].kind, SectionKind::Others);
1011
assert_eq!(sections[0].items[0].unread, Unread::Silent);
1012
assert_eq!(sections[0].unread_chats, 0);
994
1013
}
995
1014
996
1015
#[test]
@@ -1054,7 +1073,7 @@ mod tests {
1054
1073
let chats: Vec<ChatRecord> = (0..8)
1055
1074
.map(|index| muted_chat(&format!("m{index}")))
1056
1075
.collect();
1057
let directory = Directory::default();
1076
let directory = sectioned_directory(true, Vec::new());
1058
1077
let collapsed = HashSet::new();
1059
1078
let sections = build_sections(&input(&chats, &directory, &collapsed));
1060
1079
let muted = §ions[1];
@@ -1078,7 +1097,7 @@ mod tests {
1078
1097
let chats: Vec<ChatRecord> = (0..5)
1079
1098
.map(|index| muted_chat(&format!("m{index}")))
1080
1099
.collect();
1081
let directory = Directory::default();
1100
let directory = sectioned_directory(true, Vec::new());
1082
1101
let collapsed = HashSet::new();
1083
1102
let expanded: HashSet<String> = [MUTED_ID.to_owned()].into();
1084
1103
let mut context = input(&chats, &directory, &collapsed);
@@ -1099,7 +1118,7 @@ mod tests {
1099
1118
..meeting_chat("x")
1100
1119
},
1101
1120
];
1102
let mut directory = Directory::default();
1121
let mut directory = sectioned_directory(true, Vec::new());
1103
1122
directory.unread_counts.insert("quiet".into(), 4);
1104
1123
let sections = build_sections(&input(&chats, &directory, &HashSet::new()));
1105
1124
let muted = §ions[1];
@@ -45,6 +45,7 @@ pub enum AvatarSpec {45
Single(Face),45
Single(Face),46
Pair(Face, Face),46
Pair(Face, Face),47
Meeting,47
Meeting,48
Muted,48
}49
}49
50
50
#[derive(Debug, Clone, PartialEq, Eq)]51
#[derive(Debug, Clone, PartialEq, Eq)]@@ -161,7 +162,7 @@ pub fn chat_item(chat: &ChatRecord, input: &SectionInput<'_>, folder_id: Option<161
} else {162
} else {162
Unread::None163
Unread::None163
};164
};164
let presence_user = is_one_on_one(chat)165
let presence_user = (is_one_on_one(chat) && !chat.muted)165
.then(|| {166
.then(|| {166
others(chat, me)167
others(chat, me)167
.into_iter()168
.into_iter()@@ -192,7 +193,11 @@ pub fn chat_item(chat: &ChatRecord, input: &SectionInput<'_>, folder_id: Option<192
muted: chat.muted,193
muted: chat.muted,193
is_group: chat.kind == GROUP_KIND,194
is_group: chat.kind == GROUP_KIND,194
member_count: chat.members.len(),195
member_count: chat.members.len(),195
avatar: avatar_for(chat, me),196
avatar: if chat.muted {197
AvatarSpec::Muted198
} else {199
avatar_for(chat, me)200
},196
presence_user,201
presence_user,197
folder_id: folder_id.map(str::to_owned),202
folder_id: folder_id.map(str::to_owned),198
}203
}@@ -446,11 +451,9 @@ fn section(446
0451
0447
};452
};448
items.truncate(count - hidden_count);453
items.truncate(count - hidden_count);449
if kind == SectionKind::Muted {454
for item in items.iter_mut().filter(|item| item.muted) {450
for item in &mut items {455
if item.unread.is_unread() {451
if item.unread.is_unread() {456
item.unread = Unread::Silent;452
item.unread = Unread::Silent;453
}454
}457
}455
}458
}456
Section {459
Section {@@ -724,7 +727,7 @@ mod tests {724
quiet.muted = true;727
quiet.muted = true;725
let chats = [quiet, chat("b", "group", true)];728
let chats = [quiet, chat("b", "group", true)];726
assert_eq!(unread_chat_count(&chats), 1);729
assert_eq!(unread_chat_count(&chats), 1);727
let directory = Directory::default();730
let directory = sectioned_directory(true, Vec::new());728
let collapsed = HashSet::new();731
let collapsed = HashSet::new();729
let sections = build_sections(&input(&chats, &directory, &collapsed));732
let sections = build_sections(&input(&chats, &directory, &collapsed));730
assert_eq!(sections[0].unread_chats, 1);733
assert_eq!(sections[0].unread_chats, 1);@@ -985,12 +988,28 @@ mod tests {985
}988
}986
989
987
#[test]990
#[test]988
fn muted_is_on_until_the_user_chooses_and_meeting_chats_stay_in_others() {991
fn muted_chats_stay_in_others_until_the_user_turns_the_section_on() {989
let chats = vec![muted_chat("quiet"), meeting_chat("sync")];992
let chats = vec![muted_chat("quiet"), meeting_chat("sync")];990
let directory = Directory::default();993
let directory = Directory::default();991
let sections = build_sections(&input(&chats, &directory, &HashSet::new()));994
let sections = build_sections(&input(&chats, &directory, &HashSet::new()));992
assert_eq!(section_ids(§ions), vec![OTHERS_ID, MUTED_ID]);995
assert_eq!(section_ids(§ions), vec![OTHERS_ID]);993
assert_eq!(item_ids(§ions[0]), vec!["sync"]);996
assert_eq!(item_ids(§ions[0]), vec!["quiet", "sync"]);997
assert!(sections[0].items[0].muted);998
assert_eq!(sections[0].items[0].avatar, AvatarSpec::Muted);999
assert_eq!(sections[0].items[1].avatar, AvatarSpec::Meeting);1000
}1001
1002
#[test]1003
fn a_muted_chat_in_others_stays_bold_without_a_count() {1004
let mut quiet = muted_chat("quiet");1005
quiet.unread = true;1006
let chats = vec![quiet];1007
let mut directory = Directory::default();1008
directory.unread_counts.insert("quiet".into(), 4);1009
let sections = build_sections(&input(&chats, &directory, &HashSet::new()));1010
assert_eq!(sections[0].kind, SectionKind::Others);1011
assert_eq!(sections[0].items[0].unread, Unread::Silent);1012
assert_eq!(sections[0].unread_chats, 0);994
}1013
}995
1014
996
#[test]1015
#[test]@@ -1054,7 +1073,7 @@ mod tests {1054
let chats: Vec<ChatRecord> = (0..8)1073
let chats: Vec<ChatRecord> = (0..8)1055
.map(|index| muted_chat(&format!("m{index}")))1074
.map(|index| muted_chat(&format!("m{index}")))1056
.collect();1075
.collect();1057
let directory = Directory::default();1076
let directory = sectioned_directory(true, Vec::new());1058
let collapsed = HashSet::new();1077
let collapsed = HashSet::new();1059
let sections = build_sections(&input(&chats, &directory, &collapsed));1078
let sections = build_sections(&input(&chats, &directory, &collapsed));1060
let muted = §ions[1];1079
let muted = §ions[1];@@ -1078,7 +1097,7 @@ mod tests {1078
let chats: Vec<ChatRecord> = (0..5)1097
let chats: Vec<ChatRecord> = (0..5)1079
.map(|index| muted_chat(&format!("m{index}")))1098
.map(|index| muted_chat(&format!("m{index}")))1080
.collect();1099
.collect();1081
let directory = Directory::default();1100
let directory = sectioned_directory(true, Vec::new());1082
let collapsed = HashSet::new();1101
let collapsed = HashSet::new();1083
let expanded: HashSet<String> = [MUTED_ID.to_owned()].into();1102
let expanded: HashSet<String> = [MUTED_ID.to_owned()].into();1084
let mut context = input(&chats, &directory, &collapsed);1103
let mut context = input(&chats, &directory, &collapsed);@@ -1099,7 +1118,7 @@ mod tests {1099
..meeting_chat("x")1118
..meeting_chat("x")1100
},1119
},1101
];1120
];1102
let mut directory = Directory::default();1121
let mut directory = sectioned_directory(true, Vec::new());1103
directory.unread_counts.insert("quiet".into(), 4);1122
directory.unread_counts.insert("quiet".into(), 4);1104
let sections = build_sections(&input(&chats, &directory, &HashSet::new()));1123
let sections = build_sections(&input(&chats, &directory, &HashSet::new()));1105
let muted = §ions[1];1124
let muted = §ions[1];@@ -199,6 +199,16 @@ pub fn spec_avatar(directory: &Directory, spec: &AvatarSpec, size: f32, ring: Hs
199
199
.justify_center()
200
200
.child(icon(IconName::Calendar, (size * MEETING_ICON_RATIO).round(), theme::white()))
201
201
.into_any_element(),
202
AvatarSpec::Muted => div()
203
.size(px(size))
204
.flex_none()
205
.rounded_full()
206
.bg(theme::popup_hover())
207
.flex()
208
.items_center()
209
.justify_center()
210
.child(icon(IconName::BellOff, (size * MEETING_ICON_RATIO).round(), theme::text_muted()))
211
.into_any_element(),
202
212
AvatarSpec::Pair(first, second) => {
203
213
let small = (size * PAIR_RATIO).round();
204
214
div()
@@ -199,6 +199,16 @@ pub fn spec_avatar(directory: &Directory, spec: &AvatarSpec, size: f32, ring: Hs199
.justify_center()199
.justify_center()200
.child(icon(IconName::Calendar, (size * MEETING_ICON_RATIO).round(), theme::white()))200
.child(icon(IconName::Calendar, (size * MEETING_ICON_RATIO).round(), theme::white()))201
.into_any_element(),201
.into_any_element(),202
AvatarSpec::Muted => div()203
.size(px(size))204
.flex_none()205
.rounded_full()206
.bg(theme::popup_hover())207
.flex()208
.items_center()209
.justify_center()210
.child(icon(IconName::BellOff, (size * MEETING_ICON_RATIO).round(), theme::text_muted()))211
.into_any_element(),202
AvatarSpec::Pair(first, second) => {212
AvatarSpec::Pair(first, second) => {203
let small = (size * PAIR_RATIO).round();213
let small = (size * PAIR_RATIO).round();204
div()214
div()@@ -54,7 +54,6 @@ const TEAM_ROW_HEIGHT: f32 = 40.;
54
54
const REVEAL_ROW_HEIGHT: f32 = 32.;
55
55
const NEW_CHAT_BUTTON_SIZE: f32 = 32.;
56
56
const MENU_ICON_SIZE: f32 = 15.;
57
const MUTED_ICON_SIZE: f32 = 13.;
58
57
const NOTIFICATION_ICON_SIZE: f32 = 13.;
59
58
60
59
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
@@ -911,18 +910,9 @@ impl SidebarView {
911
910
} else {
912
911
theme::text_muted()
913
912
})
914
.when(item.muted, |time| {
915
time.child(icon(
916
IconName::BellOff,
917
MUTED_ICON_SIZE,
918
theme::text_faint(),
919
))
920
})
921
913
.child(item.time_label.clone());
922
914
let preview_color = if matches!(item.preview, Preview::Typing(_)) {
923
915
theme::accent_text()
924
} else if item.muted {
925
theme::text_faint()
926
916
} else if unread {
927
917
theme::text_strong()
928
918
} else {
@@ -1711,7 +1701,7 @@ fn collect_faces(spec: &AvatarSpec, faces: &mut Vec<String>) {
1711
1701
faces.extend(first.user_id.clone());
1712
1702
faces.extend(second.user_id.clone());
1713
1703
}
1714
AvatarSpec::Meeting => {}
1704
AvatarSpec::Meeting | AvatarSpec::Muted => {}
1715
1705
}
1716
1706
}
1717
1707
@@ -54,7 +54,6 @@ const TEAM_ROW_HEIGHT: f32 = 40.;54
const REVEAL_ROW_HEIGHT: f32 = 32.;54
const REVEAL_ROW_HEIGHT: f32 = 32.;55
const NEW_CHAT_BUTTON_SIZE: f32 = 32.;55
const NEW_CHAT_BUTTON_SIZE: f32 = 32.;56
const MENU_ICON_SIZE: f32 = 15.;56
const MENU_ICON_SIZE: f32 = 15.;57
const MUTED_ICON_SIZE: f32 = 13.;58
const NOTIFICATION_ICON_SIZE: f32 = 13.;57
const NOTIFICATION_ICON_SIZE: f32 = 13.;59
58
60
#[derive(Debug, Clone, Copy, PartialEq, Eq)]59
#[derive(Debug, Clone, Copy, PartialEq, Eq)]@@ -911,18 +910,9 @@ impl SidebarView {911
} else {910
} else {912
theme::text_muted()911
theme::text_muted()913
})912
})914
.when(item.muted, |time| {915
time.child(icon(916
IconName::BellOff,917
MUTED_ICON_SIZE,918
theme::text_faint(),919
))920
})921
.child(item.time_label.clone());913
.child(item.time_label.clone());922
let preview_color = if matches!(item.preview, Preview::Typing(_)) {914
let preview_color = if matches!(item.preview, Preview::Typing(_)) {923
theme::accent_text()915
theme::accent_text()924
} else if item.muted {925
theme::text_faint()926
} else if unread {916
} else if unread {927
theme::text_strong()917
theme::text_strong()928
} else {918
} else {@@ -1711,7 +1701,7 @@ fn collect_faces(spec: &AvatarSpec, faces: &mut Vec<String>) {1711
faces.extend(first.user_id.clone());1701
faces.extend(first.user_id.clone());1712
faces.extend(second.user_id.clone());1702
faces.extend(second.user_id.clone());1713
}1703
}1714
AvatarSpec::Meeting => {}1704
AvatarSpec::Meeting | AvatarSpec::Muted => {}1715
}1705
}1716
}1706
}1717
1707
@@ -10,7 +10,7 @@ const SETTINGS_ID: &str = "simpleCollabUserSettingsId";
10
10
const TEAMS_ORDER_KEY: &str = "teamsOrder";
11
11
const MUTED_FIELD: &str = "hasUserEnabledMutedChatSection";
12
12
const MEETING_FIELD: &str = "hasUserEnabledMeetingChatSection";
13
const MUTED_DEFAULT: bool = true;
13
const MUTED_DEFAULT: bool = false;
14
14
const MEETING_DEFAULT: bool = false;
15
15
16
16
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
@@ -190,7 +190,7 @@ mod tests {
190
190
fn unset_fields_use_the_teams_defaults() {
191
191
let parsed = parse_chat_sections(&json!({}));
192
192
assert_eq!(parsed, ChatSectionSettings::default());
193
assert!(parsed.enabled(ChatSection::Muted));
193
assert!(!parsed.enabled(ChatSection::Muted));
194
194
assert!(!parsed.enabled(ChatSection::Meeting));
195
195
}
196
196
@@ -10,7 +10,7 @@ const SETTINGS_ID: &str = "simpleCollabUserSettingsId";10
const TEAMS_ORDER_KEY: &str = "teamsOrder";10
const TEAMS_ORDER_KEY: &str = "teamsOrder";11
const MUTED_FIELD: &str = "hasUserEnabledMutedChatSection";11
const MUTED_FIELD: &str = "hasUserEnabledMutedChatSection";12
const MEETING_FIELD: &str = "hasUserEnabledMeetingChatSection";12
const MEETING_FIELD: &str = "hasUserEnabledMeetingChatSection";13
const MUTED_DEFAULT: bool = true;13
const MUTED_DEFAULT: bool = false;14
const MEETING_DEFAULT: bool = false;14
const MEETING_DEFAULT: bool = false;15
15
16
#[derive(Debug, Clone, Copy, PartialEq, Eq)]16
#[derive(Debug, Clone, Copy, PartialEq, Eq)]@@ -190,7 +190,7 @@ mod tests {190
fn unset_fields_use_the_teams_defaults() {190
fn unset_fields_use_the_teams_defaults() {191
let parsed = parse_chat_sections(&json!({}));191
let parsed = parse_chat_sections(&json!({}));192
assert_eq!(parsed, ChatSectionSettings::default());192
assert_eq!(parsed, ChatSectionSettings::default());193
assert!(parsed.enabled(ChatSection::Muted));193
assert!(!parsed.enabled(ChatSection::Muted));194
assert!(!parsed.enabled(ChatSection::Meeting));194
assert!(!parsed.enabled(ChatSection::Meeting));195
}195
}196
196