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

@@ -0,0 +1,37 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:meshcore_open/models/app_settings.dart';
void main() {
test('channel notification modes round-trip by name', () {
final settings = AppSettings(
channelNotificationModes: {
'a': ChannelNotificationMode.mentionsOnly,
'b': ChannelNotificationMode.muted,
},
);
final json = settings.toJson();
expect(json['channel_notification_modes'], {
'a': 'mentionsOnly',
'b': 'muted',
});
expect(json['muted_channels'], ['b']);
expect(
AppSettings.fromJson(json).channelNotificationModes,
settings.channelNotificationModes,
);
});
test('invalid channel notification mode entries are skipped', () {
final settings = AppSettings.fromJson({
'channel_notification_modes': {
'ok': 'muted',
'unknown': 'loud',
'int': 2,
'null': null,
},
});
expect(settings.channelNotificationModes, {
'ok': ChannelNotificationMode.muted,
});
});
}