Merge remote-tracking branch 'origin/dev' into fix/ui-issues
# Conflicts: # untranslated.json
This commit is contained in:
commit
7c2f481520
52 files changed
+1397
-111
No files matched your search
@@ -27,7 +27,8 @@ import '../l10n/l10n.dart';
|
||||
import '../models/channel.dart';
|
||||
import '../models/channel_message.dart';
|
||||
import '../models/image_codec_support.dart' show aeicRatePointForUi;
|
||||
import '../services/app_settings_service.dart';
|
||||
import '../services/app_settings_service.dart'
|
||||
show AppSettingsService, ChannelNotificationMode;
|
||||
import '../services/chat_text_scale_service.dart';
|
||||
import '../services/image_chunk_transport.dart';
|
||||
import '../services/image_codec_service.dart';
|
||||
@@ -37,6 +38,7 @@ import '../utils/image_save.dart';
|
||||
import '../utils/lora_airtime.dart';
|
||||
import '../widgets/marker_label_dialog.dart';
|
||||
import '../widgets/received_image_message.dart';
|
||||
import '../widgets/channel_notification_mode_sheet.dart';
|
||||
import '../widgets/chat_day_separator.dart';
|
||||
import '../widgets/empty_state.dart';
|
||||
|
||||
@@ -404,19 +406,22 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
|
||||
Consumer<AppSettingsService>(
|
||||
builder: (context, settings, _) {
|
||||
final muteKey = widget.channel.muteKey;
|
||||
final muted = settings.isChannelMuted(muteKey);
|
||||
final notificationMode = settings.getChannelNotificationMode(
|
||||
muteKey,
|
||||
);
|
||||
return IconButton(
|
||||
tooltip: muted
|
||||
? context.l10n.channels_unmuteChannel
|
||||
: context.l10n.channels_muteChannel,
|
||||
icon: Icon(
|
||||
muted
|
||||
? Icons.notifications_off_outlined
|
||||
: Icons.notifications_outlined,
|
||||
tooltip: context.l10n.channels_notificationModeTooltip(
|
||||
channelNotificationModeLabel(context, notificationMode),
|
||||
),
|
||||
onPressed: () => muted
|
||||
? settings.unmuteChannel(muteKey)
|
||||
: settings.muteChannel(muteKey),
|
||||
icon: Icon(
|
||||
notificationMode == ChannelNotificationMode.muted
|
||||
? Icons.notifications_off
|
||||
: notificationMode == ChannelNotificationMode.mentionsOnly
|
||||
? Icons.notification_important
|
||||
: Icons.notifications,
|
||||
),
|
||||
onPressed: () =>
|
||||
showChannelNotificationModeSheet(context, muteKey),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
@@ -10,7 +10,8 @@ import 'package:uuid/uuid.dart';
|
||||
|
||||
import '../connector/meshcore_connector.dart';
|
||||
import '../l10n/l10n.dart';
|
||||
import '../services/app_settings_service.dart';
|
||||
import '../services/app_settings_service.dart'
|
||||
show AppSettingsService, ChannelNotificationMode;
|
||||
import '../services/ui_view_state_service.dart';
|
||||
import '../models/channel.dart';
|
||||
import '../models/community.dart';
|
||||
@@ -19,6 +20,7 @@ import '../theme/mesh_theme.dart';
|
||||
import '../utils/dialog_utils.dart';
|
||||
import '../utils/disconnect_navigation_mixin.dart';
|
||||
import '../utils/route_transitions.dart';
|
||||
import '../widgets/channel_notification_mode_sheet.dart';
|
||||
import '../widgets/list_filter_widget.dart';
|
||||
import '../widgets/empty_state.dart';
|
||||
import '../widgets/mesh_ui.dart';
|
||||
@@ -372,9 +374,9 @@ class _ChannelsScreenState extends State<ChannelsScreen>
|
||||
int listIndex = 0,
|
||||
}) {
|
||||
final unreadCount = connector.getUnreadCountForChannel(channel);
|
||||
final isMuted = context.watch<AppSettingsService>().isChannelMuted(
|
||||
channel.muteKey,
|
||||
);
|
||||
final notificationMode = context
|
||||
.watch<AppSettingsService>()
|
||||
.getChannelNotificationMode(channel.muteKey);
|
||||
final scheme = Theme.of(context).colorScheme;
|
||||
|
||||
// Determine icon and colors based on channel type
|
||||
@@ -580,9 +582,9 @@ class _ChannelsScreenState extends State<ChannelsScreen>
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
if (isMuted) ...[
|
||||
if (notificationMode != ChannelNotificationMode.all) ...[
|
||||
Icon(
|
||||
Icons.notifications_off,
|
||||
channelNotificationModeIcon(notificationMode),
|
||||
size: 18,
|
||||
color: scheme.onSurfaceVariant,
|
||||
),
|
||||
@@ -625,8 +627,6 @@ class _ChannelsScreenState extends State<ChannelsScreen>
|
||||
Channel channel,
|
||||
) {
|
||||
final parentContext = context;
|
||||
final settingsService = context.read<AppSettingsService>();
|
||||
final isMuted = settingsService.isChannelMuted(channel.muteKey);
|
||||
|
||||
showMeshSheet(
|
||||
parentContext,
|
||||
@@ -645,23 +645,19 @@ class _ChannelsScreenState extends State<ChannelsScreen>
|
||||
}
|
||||
},
|
||||
),
|
||||
// Notification mode selection
|
||||
ListTile(
|
||||
leading: Icon(
|
||||
isMuted
|
||||
? Icons.notifications_outlined
|
||||
: Icons.notifications_off_outlined,
|
||||
),
|
||||
title: Text(
|
||||
isMuted
|
||||
? sheetContext.l10n.channels_unmuteChannel
|
||||
: sheetContext.l10n.channels_muteChannel,
|
||||
),
|
||||
leading: const Icon(Icons.notifications_outlined),
|
||||
title: Text(sheetContext.l10n.channels_notificationSettings),
|
||||
trailing: const Icon(Icons.chevron_right),
|
||||
onTap: () async {
|
||||
Navigator.pop(sheetContext);
|
||||
if (isMuted) {
|
||||
await settingsService.unmuteChannel(channel.muteKey);
|
||||
} else {
|
||||
await settingsService.muteChannel(channel.muteKey);
|
||||
await Future.delayed(const Duration(milliseconds: 100));
|
||||
if (parentContext.mounted) {
|
||||
showChannelNotificationModeSheet(
|
||||
parentContext,
|
||||
channel.muteKey,
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
|
||||
@@ -25,9 +25,6 @@ import '../widgets/sync_progress_overlay.dart';
|
||||
import 'region_management_screen.dart';
|
||||
import '../utils/share_origin.dart';
|
||||
|
||||
/// Companion firmware version that added CMD_SET_PATH_HASH_MODE (v1.14.0).
|
||||
const int _minFirmwareVerCodeForPathHashMode = 10;
|
||||
|
||||
class SettingsScreen extends StatefulWidget {
|
||||
const SettingsScreen({super.key});
|
||||
|
||||
@@ -566,14 +563,10 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
||||
title: l10n.repeater_pathHashMode,
|
||||
subtitle: !connected
|
||||
? offline
|
||||
: (connector.firmwareVerCode ?? 0) <
|
||||
_minFirmwareVerCodeForPathHashMode
|
||||
: !connector.supportsPathHashMode
|
||||
? l10n.settings_requiresFirmware('v1.14')
|
||||
: _pathHashModeSubtitle(context, connector.pathHashByteWidth),
|
||||
onTap:
|
||||
connector.isConnected &&
|
||||
(connector.firmwareVerCode ?? 0) >=
|
||||
_minFirmwareVerCodeForPathHashMode
|
||||
onTap: connector.isConnected && connector.supportsPathHashMode
|
||||
? () => _editPathHashMode(context, connector)
|
||||
: null,
|
||||
),
|
||||
|
||||
Reference in new issue
Block a user