Fix review findings in channel notification modes

- Detect mentions on the original text, as @[name] or a whole-word @name
- Save and restore the full mode map in review mode
- Open the mode picker from the chat bell and show the mode in its tooltip
- Share one mode picker sheet; fix the stale sheet context
- Persist modes by name and skip unknown entries
- Keep writing muted_channels so older builds keep the user's mutes
- Remove the muteChannel/unmuteChannel/isChannelMuted shims
- Update notifications docs to match the behaviour
This commit is contained in:
zjs81 committed 2026-10-24 20:46:49 -07:00
1 parent 705bff2f15
commit f667320608
32 files changed
+502 -196

No files matched your search

+5 -17
View File
@@ -288,11 +288,6 @@ class AppSettingsService extends ChangeNotifier {
await updateSettings(_settings.copyWith(unitSystem: value));
}
// Backward compatibility: delegates to AppSettings.isChannelMuted
bool isChannelMuted(String channelName) {
return _settings.isChannelMuted(channelName);
}
ChannelNotificationMode getChannelNotificationMode(String channelName) {
return _settings.channelNotificationModes[channelName] ??
ChannelNotificationMode.all;
@@ -305,21 +300,14 @@ class AppSettingsService extends ChangeNotifier {
final updated = Map<String, ChannelNotificationMode>.from(
_settings.channelNotificationModes,
);
updated[channelName] = mode;
if (mode == ChannelNotificationMode.all) {
updated.remove(channelName);
} else {
updated[channelName] = mode;
}
await updateSettings(_settings.copyWith(channelNotificationModes: updated));
}
Future<void> muteChannel(String channelName) async {
await setChannelNotificationMode(
channelName,
ChannelNotificationMode.muted,
);
}
Future<void> unmuteChannel(String channelName) async {
await setChannelNotificationMode(channelName, ChannelNotificationMode.all);
}
Future<void> setTcpServerAddress(String value) async {
await updateSettings(_settings.copyWith(tcpServerAddress: value));
}