From 5b065395203b1192a2a463faa02793163f7c8e62 Mon Sep 17 00:00:00 2001 From: Strycher Date: Tue, 4 Aug 2026 01:46:57 -0400 Subject: [PATCH] fix(#513): "Send Again" resend for channel messages + relabel DM action Channel messages had no resend path: unlike DMs (auto-retried by MessageRetryService), a channel send that never gets its generic ack/repeat-back goes to failed with no recovery. Adds a "Send Again" action to the channel long-press sheet for outgoing messages that are not yet acked (status != sent, i.e. pending or failed), re-sending via sendChannelMessage. Also renames the existing direct-chat "Retry" action to "Send Again" (matching stock MeshCore's "Send Again" for cross-client familiarity); DM gating unchanged (offered at failed, after auto-retry is exhausted). New l10n strings message_sendAgain + chat_sendingAgain. Build of epic #256. --- lib/l10n/app_en.arb | 2 ++ lib/l10n/app_localizations.dart | 12 ++++++++++++ lib/l10n/app_localizations_bg.dart | 6 ++++++ lib/l10n/app_localizations_de.dart | 6 ++++++ lib/l10n/app_localizations_en.dart | 6 ++++++ lib/l10n/app_localizations_es.dart | 6 ++++++ lib/l10n/app_localizations_fr.dart | 6 ++++++ lib/l10n/app_localizations_hu.dart | 6 ++++++ lib/l10n/app_localizations_it.dart | 6 ++++++ lib/l10n/app_localizations_ja.dart | 6 ++++++ lib/l10n/app_localizations_ko.dart | 6 ++++++ lib/l10n/app_localizations_nl.dart | 6 ++++++ lib/l10n/app_localizations_pl.dart | 6 ++++++ lib/l10n/app_localizations_pt.dart | 6 ++++++ lib/l10n/app_localizations_ru.dart | 6 ++++++ lib/l10n/app_localizations_sk.dart | 6 ++++++ lib/l10n/app_localizations_sl.dart | 6 ++++++ lib/l10n/app_localizations_sv.dart | 6 ++++++ lib/l10n/app_localizations_uk.dart | 6 ++++++ lib/l10n/app_localizations_zh.dart | 6 ++++++ lib/screens/channel_chat_screen.dart | 24 ++++++++++++++++++++++++ lib/screens/chat_screen.dart | 4 ++-- 22 files changed, 148 insertions(+), 2 deletions(-) diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index 97c4383f..83b522ad 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -724,6 +724,8 @@ "chat_messageCopied": "Message copied", "chat_messageDeleted": "Message deleted", "chat_retryingMessage": "Retrying message", + "chat_sendingAgain": "Sending again", + "message_sendAgain": "Send Again", "chat_retryCount": "Retry {current}/{max}", "@chat_retryCount": { "placeholders": { diff --git a/lib/l10n/app_localizations.dart b/lib/l10n/app_localizations.dart index eda069c9..06b1299f 100644 --- a/lib/l10n/app_localizations.dart +++ b/lib/l10n/app_localizations.dart @@ -2668,6 +2668,18 @@ abstract class AppLocalizations { /// **'Retrying message'** String get chat_retryingMessage; + /// No description provided for @chat_sendingAgain. + /// + /// In en, this message translates to: + /// **'Sending again'** + String get chat_sendingAgain; + + /// No description provided for @message_sendAgain. + /// + /// In en, this message translates to: + /// **'Send Again'** + String get message_sendAgain; + /// No description provided for @chat_retryCount. /// /// In en, this message translates to: diff --git a/lib/l10n/app_localizations_bg.dart b/lib/l10n/app_localizations_bg.dart index a73400e1..7e27684f 100644 --- a/lib/l10n/app_localizations_bg.dart +++ b/lib/l10n/app_localizations_bg.dart @@ -1451,6 +1451,12 @@ class AppLocalizationsBg extends AppLocalizations { @override String get chat_retryingMessage => 'Опитваме се отново.'; + @override + String get chat_sendingAgain => 'Sending again'; + + @override + String get message_sendAgain => 'Send Again'; + @override String chat_retryCount(int current, int max) { return 'Опитай отново $current/$max'; diff --git a/lib/l10n/app_localizations_de.dart b/lib/l10n/app_localizations_de.dart index 1b209c52..ae9c2652 100644 --- a/lib/l10n/app_localizations_de.dart +++ b/lib/l10n/app_localizations_de.dart @@ -1449,6 +1449,12 @@ class AppLocalizationsDe extends AppLocalizations { @override String get chat_retryingMessage => 'Versuche es erneut.'; + @override + String get chat_sendingAgain => 'Sending again'; + + @override + String get message_sendAgain => 'Send Again'; + @override String chat_retryCount(int current, int max) { return 'Versuche $current/$max'; diff --git a/lib/l10n/app_localizations_en.dart b/lib/l10n/app_localizations_en.dart index 8ad3bf93..33597a4f 100644 --- a/lib/l10n/app_localizations_en.dart +++ b/lib/l10n/app_localizations_en.dart @@ -1421,6 +1421,12 @@ class AppLocalizationsEn extends AppLocalizations { @override String get chat_retryingMessage => 'Retrying message'; + @override + String get chat_sendingAgain => 'Sending again'; + + @override + String get message_sendAgain => 'Send Again'; + @override String chat_retryCount(int current, int max) { return 'Retry $current/$max'; diff --git a/lib/l10n/app_localizations_es.dart b/lib/l10n/app_localizations_es.dart index 9ba54d33..a3d52524 100644 --- a/lib/l10n/app_localizations_es.dart +++ b/lib/l10n/app_localizations_es.dart @@ -1448,6 +1448,12 @@ class AppLocalizationsEs extends AppLocalizations { @override String get chat_retryingMessage => 'Reintentando…'; + @override + String get chat_sendingAgain => 'Sending again'; + + @override + String get message_sendAgain => 'Send Again'; + @override String chat_retryCount(int current, int max) { return 'Reintentar $current/$max'; diff --git a/lib/l10n/app_localizations_fr.dart b/lib/l10n/app_localizations_fr.dart index 8ba78ec3..eba4521c 100644 --- a/lib/l10n/app_localizations_fr.dart +++ b/lib/l10n/app_localizations_fr.dart @@ -1453,6 +1453,12 @@ class AppLocalizationsFr extends AppLocalizations { @override String get chat_retryingMessage => 'Tentative de récupération.'; + @override + String get chat_sendingAgain => 'Sending again'; + + @override + String get message_sendAgain => 'Send Again'; + @override String chat_retryCount(int current, int max) { return 'Essai $current/$max'; diff --git a/lib/l10n/app_localizations_hu.dart b/lib/l10n/app_localizations_hu.dart index 8bab96a9..fb42803b 100644 --- a/lib/l10n/app_localizations_hu.dart +++ b/lib/l10n/app_localizations_hu.dart @@ -1456,6 +1456,12 @@ class AppLocalizationsHu extends AppLocalizations { @override String get chat_retryingMessage => 'Újrapróbálási üzenet'; + @override + String get chat_sendingAgain => 'Sending again'; + + @override + String get message_sendAgain => 'Send Again'; + @override String chat_retryCount(int current, int max) { return 'Újrapróbál $current/$max'; diff --git a/lib/l10n/app_localizations_it.dart b/lib/l10n/app_localizations_it.dart index e2b0d0de..5cd6761f 100644 --- a/lib/l10n/app_localizations_it.dart +++ b/lib/l10n/app_localizations_it.dart @@ -1450,6 +1450,12 @@ class AppLocalizationsIt extends AppLocalizations { @override String get chat_retryingMessage => 'Riprovo'; + @override + String get chat_sendingAgain => 'Sending again'; + + @override + String get message_sendAgain => 'Send Again'; + @override String chat_retryCount(int current, int max) { return 'Riprova $current/$max'; diff --git a/lib/l10n/app_localizations_ja.dart b/lib/l10n/app_localizations_ja.dart index 4065395a..4dd94a1b 100644 --- a/lib/l10n/app_localizations_ja.dart +++ b/lib/l10n/app_localizations_ja.dart @@ -1387,6 +1387,12 @@ class AppLocalizationsJa extends AppLocalizations { @override String get chat_retryingMessage => '再試行メッセージ'; + @override + String get chat_sendingAgain => 'Sending again'; + + @override + String get message_sendAgain => 'Send Again'; + @override String chat_retryCount(int current, int max) { return '$current / $max 回目'; diff --git a/lib/l10n/app_localizations_ko.dart b/lib/l10n/app_localizations_ko.dart index 2469343a..f9a1fec5 100644 --- a/lib/l10n/app_localizations_ko.dart +++ b/lib/l10n/app_localizations_ko.dart @@ -1382,6 +1382,12 @@ class AppLocalizationsKo extends AppLocalizations { @override String get chat_retryingMessage => '재시도 메시지'; + @override + String get chat_sendingAgain => 'Sending again'; + + @override + String get message_sendAgain => 'Send Again'; + @override String chat_retryCount(int current, int max) { return '$current/$max 시도'; diff --git a/lib/l10n/app_localizations_nl.dart b/lib/l10n/app_localizations_nl.dart index ebbe9aef..0dc6d77d 100644 --- a/lib/l10n/app_localizations_nl.dart +++ b/lib/l10n/app_localizations_nl.dart @@ -1438,6 +1438,12 @@ class AppLocalizationsNl extends AppLocalizations { @override String get chat_retryingMessage => 'Poging opnieuw.'; + @override + String get chat_sendingAgain => 'Sending again'; + + @override + String get message_sendAgain => 'Send Again'; + @override String chat_retryCount(int current, int max) { return 'Poging opnieuw $current/$max'; diff --git a/lib/l10n/app_localizations_pl.dart b/lib/l10n/app_localizations_pl.dart index 75b3befd..15d33586 100644 --- a/lib/l10n/app_localizations_pl.dart +++ b/lib/l10n/app_localizations_pl.dart @@ -1460,6 +1460,12 @@ class AppLocalizationsPl extends AppLocalizations { @override String get chat_retryingMessage => 'Ponawianie wiadomości'; + @override + String get chat_sendingAgain => 'Sending again'; + + @override + String get message_sendAgain => 'Send Again'; + @override String chat_retryCount(int current, int max) { return 'Próba $current/$max'; diff --git a/lib/l10n/app_localizations_pt.dart b/lib/l10n/app_localizations_pt.dart index 52cd3d31..ae4d686d 100644 --- a/lib/l10n/app_localizations_pt.dart +++ b/lib/l10n/app_localizations_pt.dart @@ -1447,6 +1447,12 @@ class AppLocalizationsPt extends AppLocalizations { @override String get chat_retryingMessage => 'Tentando novamente'; + @override + String get chat_sendingAgain => 'Sending again'; + + @override + String get message_sendAgain => 'Send Again'; + @override String chat_retryCount(int current, int max) { return 'Tentar $current/$max'; diff --git a/lib/l10n/app_localizations_ru.dart b/lib/l10n/app_localizations_ru.dart index ff617470..fd7434e1 100644 --- a/lib/l10n/app_localizations_ru.dart +++ b/lib/l10n/app_localizations_ru.dart @@ -1448,6 +1448,12 @@ class AppLocalizationsRu extends AppLocalizations { @override String get chat_retryingMessage => 'Повтор отправки сообщения'; + @override + String get chat_sendingAgain => 'Sending again'; + + @override + String get message_sendAgain => 'Send Again'; + @override String chat_retryCount(int current, int max) { return 'Попытка $current/$max'; diff --git a/lib/l10n/app_localizations_sk.dart b/lib/l10n/app_localizations_sk.dart index 479c060e..3e2938a3 100644 --- a/lib/l10n/app_localizations_sk.dart +++ b/lib/l10n/app_localizations_sk.dart @@ -1438,6 +1438,12 @@ class AppLocalizationsSk extends AppLocalizations { @override String get chat_retryingMessage => 'Pokus o obnovenie'; + @override + String get chat_sendingAgain => 'Sending again'; + + @override + String get message_sendAgain => 'Send Again'; + @override String chat_retryCount(int current, int max) { return 'Skúsiť $current/$max'; diff --git a/lib/l10n/app_localizations_sl.dart b/lib/l10n/app_localizations_sl.dart index 0942f71c..f46ad308 100644 --- a/lib/l10n/app_localizations_sl.dart +++ b/lib/l10n/app_localizations_sl.dart @@ -1436,6 +1436,12 @@ class AppLocalizationsSl extends AppLocalizations { @override String get chat_retryingMessage => 'Ponovni poskus.'; + @override + String get chat_sendingAgain => 'Sending again'; + + @override + String get message_sendAgain => 'Send Again'; + @override String chat_retryCount(int current, int max) { return 'Ponovit $current/$max'; diff --git a/lib/l10n/app_localizations_sv.dart b/lib/l10n/app_localizations_sv.dart index 7a79520f..232c592b 100644 --- a/lib/l10n/app_localizations_sv.dart +++ b/lib/l10n/app_localizations_sv.dart @@ -1430,6 +1430,12 @@ class AppLocalizationsSv extends AppLocalizations { @override String get chat_retryingMessage => 'Försöker igen'; + @override + String get chat_sendingAgain => 'Sending again'; + + @override + String get message_sendAgain => 'Send Again'; + @override String chat_retryCount(int current, int max) { return 'Försök igen $current/$max'; diff --git a/lib/l10n/app_localizations_uk.dart b/lib/l10n/app_localizations_uk.dart index 388858a0..a3f4b374 100644 --- a/lib/l10n/app_localizations_uk.dart +++ b/lib/l10n/app_localizations_uk.dart @@ -1442,6 +1442,12 @@ class AppLocalizationsUk extends AppLocalizations { @override String get chat_retryingMessage => 'Спроба відновлення.'; + @override + String get chat_sendingAgain => 'Sending again'; + + @override + String get message_sendAgain => 'Send Again'; + @override String chat_retryCount(int current, int max) { return 'Повторна спроба $current/$max'; diff --git a/lib/l10n/app_localizations_zh.dart b/lib/l10n/app_localizations_zh.dart index a1fea722..ab4a0533 100644 --- a/lib/l10n/app_localizations_zh.dart +++ b/lib/l10n/app_localizations_zh.dart @@ -1368,6 +1368,12 @@ class AppLocalizationsZh extends AppLocalizations { @override String get chat_retryingMessage => '正在重试消息'; + @override + String get chat_sendingAgain => 'Sending again'; + + @override + String get message_sendAgain => 'Send Again'; + @override String chat_retryCount(int current, int max) { return '重试 $current/$max'; diff --git a/lib/screens/channel_chat_screen.dart b/lib/screens/channel_chat_screen.dart index 9e2bcd27..87799a37 100644 --- a/lib/screens/channel_chat_screen.dart +++ b/lib/screens/channel_chat_screen.dart @@ -1613,6 +1613,17 @@ class _ChannelChatScreenState extends State { ); } + void _retryChannelMessage(ChannelMessage message) { + context.read().sendChannelMessage( + _currentChannel, + message.text, + ); + showDismissibleSnackBar( + context, + content: Text(context.l10n.chat_sendingAgain), + ); + } + void _showMessageActions(ChannelMessage message) { final translationService = context.read(); final canTranslateMessage = @@ -1655,6 +1666,19 @@ class _ChannelChatScreenState extends State { _showMessagePathInfo(message); }, ), + // Offer resend on an outgoing channel message until its + // ack/repeat-back arrives (status becomes sent). Channel sends are + // not auto-retried, so this is the only recovery path. (#256) + if (message.isOutgoing && + message.status != ChannelMessageStatus.sent) + ListTile( + leading: const Icon(Icons.refresh), + title: Text(context.l10n.message_sendAgain), + onTap: () { + Navigator.pop(sheetContext); + _retryChannelMessage(message); + }, + ), // Can't react to your own messages if (!message.isOutgoing) ListTile( diff --git a/lib/screens/chat_screen.dart b/lib/screens/chat_screen.dart index 791a24c1..768a54f8 100644 --- a/lib/screens/chat_screen.dart +++ b/lib/screens/chat_screen.dart @@ -1586,7 +1586,7 @@ class _ChatScreenState extends State { if (message.isOutgoing && message.status == MessageStatus.failed) ListTile( leading: const Icon(Icons.refresh), - title: Text(context.l10n.common_retry), + title: Text(context.l10n.message_sendAgain), onTap: () { Navigator.pop(sheetContext); _retryMessage(message); @@ -1643,7 +1643,7 @@ class _ChatScreenState extends State { connector.sendMessage(_resolveContact(connector), message.text); showDismissibleSnackBar( context, - content: Text(context.l10n.chat_retryingMessage), + content: Text(context.l10n.chat_sendingAgain), ); }