Add optional SMAZ compression indicator icon on messages

This commit is contained in:
zjs81 committed 2026-11-21 04:10:43 -07:00
1 parent ae967ec21f
commit d76d488e45
36 files changed
+1321 -38

No files matched your search

+14
View File
@@ -488,6 +488,20 @@ class AppSettingsScreen extends StatelessWidget {
value: settingsService.settings.regionOnHopsLine,
onChanged: settingsService.setRegionOnHopsLine,
),
const Divider(height: 1, indent: 16),
SwitchListTile(
contentPadding: const EdgeInsets.symmetric(
horizontal: 16,
vertical: 4,
),
secondary: const Icon(Icons.compress, size: 24),
title: Text(context.l10n.appSettings_showCompressionIndicator),
subtitle: Text(
context.l10n.appSettings_showCompressionIndicatorSubtitle,
),
value: settingsService.settings.showCompressionIndicator,
onChanged: settingsService.setShowCompressionIndicator,
),
],
);
}
+15 -10
View File
@@ -1109,6 +1109,8 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
final publicIpfsGateway = settingsService.settings.publicIpfsGateway;
final enableTracing = settingsService.settings.enableMessageTracing;
final regionOnHopsLine = settingsService.settings.regionOnHopsLine;
final showCompressionIndicator =
settingsService.settings.showCompressionIndicator;
final isOutgoing = message.isOutgoing;
final scheme = Theme.of(context).colorScheme;
final gifId = GifHelper.parseGif(message.text);
@@ -1423,8 +1425,10 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
bottom: 4,
)
: EdgeInsets.zero,
child: Row(
mainAxisSize: MainAxisSize.min,
child: Wrap(
spacing: 4,
runSpacing: 2,
crossAxisAlignment: WrapCrossAlignment.center,
children: [
Text(
formatChatTime(context, message.timestamp),
@@ -1433,20 +1437,23 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
color: metaColor,
),
),
if (message.hasFutureTimestamp) ...[
const SizedBox(width: 4),
if (message.hasFutureTimestamp)
FutureTimestampIndicator(size: 16 * textScale),
],
if (showCompressionIndicator &&
message.isSmazCompressed)
CompressionIndicator(
size: 14 * textScale,
color: metaColor,
),
if (enableTracing &&
!isOutgoing &&
message.repeatCount > 0) ...[
const SizedBox(width: 6),
const SizedBox(width: 2),
Icon(
Icons.repeat,
size: 14 * textScale,
color: metaColor,
),
const SizedBox(width: 2),
Text(
'${message.repeatCount}',
style: MeshTheme.mono(
@@ -1455,8 +1462,7 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
),
),
],
if (isOutgoing) ...[
const SizedBox(width: 4),
if (isOutgoing)
MessageStatusIcon(
size: 16 * textScale,
isAcked: false,
@@ -1476,7 +1482,6 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
ChannelMessageStatus.failed,
onColor: metaColor,
),
],
],
),
),
+8
View File
@@ -1574,6 +1574,8 @@ class _MessageBubble extends StatelessWidget {
Widget build(BuildContext context) {
final settingsService = context.watch<AppSettingsService>();
final enableTracing = settingsService.settings.enableMessageTracing;
final showCompressionIndicator =
settingsService.settings.showCompressionIndicator;
final isOutgoing = message.isOutgoing;
final scheme = Theme.of(context).colorScheme;
final gifId = GifHelper.parseGif(message.text);
@@ -1838,6 +1840,12 @@ class _MessageBubble extends StatelessWidget {
FutureTimestampIndicator(
size: 16 * textScale,
),
if (showCompressionIndicator &&
message.isSmazCompressed)
CompressionIndicator(
size: 14 * textScale,
color: metaColor,
),
if (isOutgoing) ...[
const SizedBox(width: 2),
MessageStatusIcon(