feat(#764): short-sync banner gives the recovered count and contacts confirmed gone

The banner and the Keep / Use radio dialog now appear only after the
forced resync, so their numbers come from the whole recovery: how many
contacts the app has after checking again, and, when the radio answered
"not found" for any saved contact, how many are no longer on the radio.
That sentence is absent when there are none.

English strings only; other locales fall back, regenerated
untranslated.json lists them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
feat/703-forced-resync
diffwireauto 2 months ago
parent 1099dbb073
commit a252adb62d

@ -248,10 +248,14 @@ class ContactSyncShortfall {
final int received;
final int keptLocally;
/// Saved contacts the radio answered "not found" for (#764).
final int confirmedGone;
const ContactSyncShortfall({
required this.declared,
required this.received,
required this.keptLocally,
this.confirmedGone = 0,
});
}
@ -4057,6 +4061,7 @@ class MeshCoreConnector extends ChangeNotifier {
declared: declared,
received: accounted,
keptLocally: kept,
confirmedGone: _recoveryGone.length,
);
_contactSyncDecisionPending = true;
final message =

@ -3136,7 +3136,7 @@
"@contactSyncShortfallTitle": {
"description": "Persistent banner title when the radio sent fewer contacts than it reported (#668)."
},
"contactSyncShortfallBody": "The radio reported {declared} contacts but sent {received}. Your saved contacts were kept.",
"contactSyncShortfallBody": "The radio reported {declared} contacts; after checking again the app has {received}. Your saved contacts were kept.",
"@contactSyncShortfallBody": {
"description": "Persistent banner body for a short contact sync (#668).",
"placeholders": {
@ -3148,7 +3148,7 @@
}
}
},
"contactSyncShortfallBodyNoTotal": "The radio did not report how many contacts it holds and sent {received}. Your saved contacts were kept.",
"contactSyncShortfallBodyNoTotal": "The radio did not report how many contacts it holds; after checking again the app has {received}. Your saved contacts were kept.",
"@contactSyncShortfallBodyNoTotal": {
"description": "Persistent banner body for a contact sync whose total the radio did not report (#668).",
"placeholders": {
@ -3161,7 +3161,7 @@
"@contactSyncDecisionTitle": {
"description": "Dialog title after the automatic retry of a short contact sync was also short (#668)."
},
"contactSyncDecisionBody": "The radio sent only {received} contacts again. Keep your saved contacts, or use the radio's list? Using the radio's list removes {removed} contacts from this app.",
"contactSyncDecisionBody": "After checking again the app still has only {received} of the radio's contacts. Keep your saved contacts, or use the radio's list? Using the radio's list removes {removed} contacts from this app.",
"@contactSyncDecisionBody": {
"description": "Dialog body asking whether to keep saved contacts or accept the radio's shorter list (#668).",
"placeholders": {
@ -3180,5 +3180,14 @@
"contactSyncUseRadio": "Use the radio's list",
"@contactSyncUseRadio": {
"description": "Dialog action: replace the saved contacts with the radio's shorter list (#668)."
},
"contactSyncConfirmedGone": "{count, plural, =1{1 saved contact is no longer on the radio.} other{{count} saved contacts are no longer on the radio.}}",
"@contactSyncConfirmedGone": {
"description": "Extra sentence on the short-sync banner and dialog: saved contacts the radio answered 'not found' for (#764).",
"placeholders": {
"count": {
"type": "int"
}
}
}
}

@ -8941,13 +8941,13 @@ abstract class AppLocalizations {
/// Persistent banner body for a short contact sync (#668).
///
/// In en, this message translates to:
/// **'The radio reported {declared} contacts but sent {received}. Your saved contacts were kept.'**
/// **'The radio reported {declared} contacts; after checking again the app has {received}. Your saved contacts were kept.'**
String contactSyncShortfallBody(int declared, int received);
/// Persistent banner body for a contact sync whose total the radio did not report (#668).
///
/// In en, this message translates to:
/// **'The radio did not report how many contacts it holds and sent {received}. Your saved contacts were kept.'**
/// **'The radio did not report how many contacts it holds; after checking again the app has {received}. Your saved contacts were kept.'**
String contactSyncShortfallBodyNoTotal(int received);
/// Dialog title after the automatic retry of a short contact sync was also short (#668).
@ -8959,7 +8959,7 @@ abstract class AppLocalizations {
/// Dialog body asking whether to keep saved contacts or accept the radio's shorter list (#668).
///
/// In en, this message translates to:
/// **'The radio sent only {received} contacts again. Keep your saved contacts, or use the radio\'s list? Using the radio\'s list removes {removed} contacts from this app.'**
/// **'After checking again the app still has only {received} of the radio\'s contacts. Keep your saved contacts, or use the radio\'s list? Using the radio\'s list removes {removed} contacts from this app.'**
String contactSyncDecisionBody(int received, int removed);
/// Default dialog action: keep the saved contact list after a short sync (#668).
@ -8973,6 +8973,12 @@ abstract class AppLocalizations {
/// In en, this message translates to:
/// **'Use the radio\'s list'**
String get contactSyncUseRadio;
/// Extra sentence on the short-sync banner and dialog: saved contacts the radio answered 'not found' for (#764).
///
/// In en, this message translates to:
/// **'{count, plural, =1{1 saved contact is no longer on the radio.} other{{count} saved contacts are no longer on the radio.}}'**
String contactSyncConfirmedGone(int count);
}
class _AppLocalizationsDelegate

@ -5268,12 +5268,12 @@ class AppLocalizationsBg extends AppLocalizations {
@override
String contactSyncShortfallBody(int declared, int received) {
return 'The radio reported $declared contacts but sent $received. Your saved contacts were kept.';
return 'The radio reported $declared contacts; after checking again the app has $received. Your saved contacts were kept.';
}
@override
String contactSyncShortfallBodyNoTotal(int received) {
return 'The radio did not report how many contacts it holds and sent $received. Your saved contacts were kept.';
return 'The radio did not report how many contacts it holds; after checking again the app has $received. Your saved contacts were kept.';
}
@override
@ -5281,7 +5281,7 @@ class AppLocalizationsBg extends AppLocalizations {
@override
String contactSyncDecisionBody(int received, int removed) {
return 'The radio sent only $received contacts again. Keep your saved contacts, or use the radio\'s list? Using the radio\'s list removes $removed contacts from this app.';
return 'After checking again the app still has only $received of the radio\'s contacts. Keep your saved contacts, or use the radio\'s list? Using the radio\'s list removes $removed contacts from this app.';
}
@override
@ -5289,4 +5289,15 @@ class AppLocalizationsBg extends AppLocalizations {
@override
String get contactSyncUseRadio => 'Use the radio\'s list';
@override
String contactSyncConfirmedGone(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: '$count saved contacts are no longer on the radio.',
one: '1 saved contact is no longer on the radio.',
);
return '$_temp0';
}
}

@ -5285,12 +5285,12 @@ class AppLocalizationsDe extends AppLocalizations {
@override
String contactSyncShortfallBody(int declared, int received) {
return 'The radio reported $declared contacts but sent $received. Your saved contacts were kept.';
return 'The radio reported $declared contacts; after checking again the app has $received. Your saved contacts were kept.';
}
@override
String contactSyncShortfallBodyNoTotal(int received) {
return 'The radio did not report how many contacts it holds and sent $received. Your saved contacts were kept.';
return 'The radio did not report how many contacts it holds; after checking again the app has $received. Your saved contacts were kept.';
}
@override
@ -5298,7 +5298,7 @@ class AppLocalizationsDe extends AppLocalizations {
@override
String contactSyncDecisionBody(int received, int removed) {
return 'The radio sent only $received contacts again. Keep your saved contacts, or use the radio\'s list? Using the radio\'s list removes $removed contacts from this app.';
return 'After checking again the app still has only $received of the radio\'s contacts. Keep your saved contacts, or use the radio\'s list? Using the radio\'s list removes $removed contacts from this app.';
}
@override
@ -5306,4 +5306,15 @@ class AppLocalizationsDe extends AppLocalizations {
@override
String get contactSyncUseRadio => 'Use the radio\'s list';
@override
String contactSyncConfirmedGone(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: '$count saved contacts are no longer on the radio.',
one: '1 saved contact is no longer on the radio.',
);
return '$_temp0';
}
}

@ -5191,12 +5191,12 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String contactSyncShortfallBody(int declared, int received) {
return 'The radio reported $declared contacts but sent $received. Your saved contacts were kept.';
return 'The radio reported $declared contacts; after checking again the app has $received. Your saved contacts were kept.';
}
@override
String contactSyncShortfallBodyNoTotal(int received) {
return 'The radio did not report how many contacts it holds and sent $received. Your saved contacts were kept.';
return 'The radio did not report how many contacts it holds; after checking again the app has $received. Your saved contacts were kept.';
}
@override
@ -5204,7 +5204,7 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String contactSyncDecisionBody(int received, int removed) {
return 'The radio sent only $received contacts again. Keep your saved contacts, or use the radio\'s list? Using the radio\'s list removes $removed contacts from this app.';
return 'After checking again the app still has only $received of the radio\'s contacts. Keep your saved contacts, or use the radio\'s list? Using the radio\'s list removes $removed contacts from this app.';
}
@override
@ -5212,4 +5212,15 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get contactSyncUseRadio => 'Use the radio\'s list';
@override
String contactSyncConfirmedGone(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: '$count saved contacts are no longer on the radio.',
one: '1 saved contact is no longer on the radio.',
);
return '$_temp0';
}
}

@ -5273,12 +5273,12 @@ class AppLocalizationsEs extends AppLocalizations {
@override
String contactSyncShortfallBody(int declared, int received) {
return 'The radio reported $declared contacts but sent $received. Your saved contacts were kept.';
return 'The radio reported $declared contacts; after checking again the app has $received. Your saved contacts were kept.';
}
@override
String contactSyncShortfallBodyNoTotal(int received) {
return 'The radio did not report how many contacts it holds and sent $received. Your saved contacts were kept.';
return 'The radio did not report how many contacts it holds; after checking again the app has $received. Your saved contacts were kept.';
}
@override
@ -5286,7 +5286,7 @@ class AppLocalizationsEs extends AppLocalizations {
@override
String contactSyncDecisionBody(int received, int removed) {
return 'The radio sent only $received contacts again. Keep your saved contacts, or use the radio\'s list? Using the radio\'s list removes $removed contacts from this app.';
return 'After checking again the app still has only $received of the radio\'s contacts. Keep your saved contacts, or use the radio\'s list? Using the radio\'s list removes $removed contacts from this app.';
}
@override
@ -5294,4 +5294,15 @@ class AppLocalizationsEs extends AppLocalizations {
@override
String get contactSyncUseRadio => 'Use the radio\'s list';
@override
String contactSyncConfirmedGone(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: '$count saved contacts are no longer on the radio.',
one: '1 saved contact is no longer on the radio.',
);
return '$_temp0';
}
}

@ -5301,12 +5301,12 @@ class AppLocalizationsFr extends AppLocalizations {
@override
String contactSyncShortfallBody(int declared, int received) {
return 'The radio reported $declared contacts but sent $received. Your saved contacts were kept.';
return 'The radio reported $declared contacts; after checking again the app has $received. Your saved contacts were kept.';
}
@override
String contactSyncShortfallBodyNoTotal(int received) {
return 'The radio did not report how many contacts it holds and sent $received. Your saved contacts were kept.';
return 'The radio did not report how many contacts it holds; after checking again the app has $received. Your saved contacts were kept.';
}
@override
@ -5314,7 +5314,7 @@ class AppLocalizationsFr extends AppLocalizations {
@override
String contactSyncDecisionBody(int received, int removed) {
return 'The radio sent only $received contacts again. Keep your saved contacts, or use the radio\'s list? Using the radio\'s list removes $removed contacts from this app.';
return 'After checking again the app still has only $received of the radio\'s contacts. Keep your saved contacts, or use the radio\'s list? Using the radio\'s list removes $removed contacts from this app.';
}
@override
@ -5322,4 +5322,15 @@ class AppLocalizationsFr extends AppLocalizations {
@override
String get contactSyncUseRadio => 'Use the radio\'s list';
@override
String contactSyncConfirmedGone(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: '$count saved contacts are no longer on the radio.',
one: '1 saved contact is no longer on the radio.',
);
return '$_temp0';
}
}

@ -5290,12 +5290,12 @@ class AppLocalizationsHu extends AppLocalizations {
@override
String contactSyncShortfallBody(int declared, int received) {
return 'The radio reported $declared contacts but sent $received. Your saved contacts were kept.';
return 'The radio reported $declared contacts; after checking again the app has $received. Your saved contacts were kept.';
}
@override
String contactSyncShortfallBodyNoTotal(int received) {
return 'The radio did not report how many contacts it holds and sent $received. Your saved contacts were kept.';
return 'The radio did not report how many contacts it holds; after checking again the app has $received. Your saved contacts were kept.';
}
@override
@ -5303,7 +5303,7 @@ class AppLocalizationsHu extends AppLocalizations {
@override
String contactSyncDecisionBody(int received, int removed) {
return 'The radio sent only $received contacts again. Keep your saved contacts, or use the radio\'s list? Using the radio\'s list removes $removed contacts from this app.';
return 'After checking again the app still has only $received of the radio\'s contacts. Keep your saved contacts, or use the radio\'s list? Using the radio\'s list removes $removed contacts from this app.';
}
@override
@ -5311,4 +5311,15 @@ class AppLocalizationsHu extends AppLocalizations {
@override
String get contactSyncUseRadio => 'Use the radio\'s list';
@override
String contactSyncConfirmedGone(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: '$count saved contacts are no longer on the radio.',
one: '1 saved contact is no longer on the radio.',
);
return '$_temp0';
}
}

@ -5278,12 +5278,12 @@ class AppLocalizationsIt extends AppLocalizations {
@override
String contactSyncShortfallBody(int declared, int received) {
return 'The radio reported $declared contacts but sent $received. Your saved contacts were kept.';
return 'The radio reported $declared contacts; after checking again the app has $received. Your saved contacts were kept.';
}
@override
String contactSyncShortfallBodyNoTotal(int received) {
return 'The radio did not report how many contacts it holds and sent $received. Your saved contacts were kept.';
return 'The radio did not report how many contacts it holds; after checking again the app has $received. Your saved contacts were kept.';
}
@override
@ -5291,7 +5291,7 @@ class AppLocalizationsIt extends AppLocalizations {
@override
String contactSyncDecisionBody(int received, int removed) {
return 'The radio sent only $received contacts again. Keep your saved contacts, or use the radio\'s list? Using the radio\'s list removes $removed contacts from this app.';
return 'After checking again the app still has only $received of the radio\'s contacts. Keep your saved contacts, or use the radio\'s list? Using the radio\'s list removes $removed contacts from this app.';
}
@override
@ -5299,4 +5299,15 @@ class AppLocalizationsIt extends AppLocalizations {
@override
String get contactSyncUseRadio => 'Use the radio\'s list';
@override
String contactSyncConfirmedGone(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: '$count saved contacts are no longer on the radio.',
one: '1 saved contact is no longer on the radio.',
);
return '$_temp0';
}
}

@ -5044,12 +5044,12 @@ class AppLocalizationsJa extends AppLocalizations {
@override
String contactSyncShortfallBody(int declared, int received) {
return 'The radio reported $declared contacts but sent $received. Your saved contacts were kept.';
return 'The radio reported $declared contacts; after checking again the app has $received. Your saved contacts were kept.';
}
@override
String contactSyncShortfallBodyNoTotal(int received) {
return 'The radio did not report how many contacts it holds and sent $received. Your saved contacts were kept.';
return 'The radio did not report how many contacts it holds; after checking again the app has $received. Your saved contacts were kept.';
}
@override
@ -5057,7 +5057,7 @@ class AppLocalizationsJa extends AppLocalizations {
@override
String contactSyncDecisionBody(int received, int removed) {
return 'The radio sent only $received contacts again. Keep your saved contacts, or use the radio\'s list? Using the radio\'s list removes $removed contacts from this app.';
return 'After checking again the app still has only $received of the radio\'s contacts. Keep your saved contacts, or use the radio\'s list? Using the radio\'s list removes $removed contacts from this app.';
}
@override
@ -5065,4 +5065,15 @@ class AppLocalizationsJa extends AppLocalizations {
@override
String get contactSyncUseRadio => 'Use the radio\'s list';
@override
String contactSyncConfirmedGone(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: '$count saved contacts are no longer on the radio.',
one: '1 saved contact is no longer on the radio.',
);
return '$_temp0';
}
}

@ -5045,12 +5045,12 @@ class AppLocalizationsKo extends AppLocalizations {
@override
String contactSyncShortfallBody(int declared, int received) {
return 'The radio reported $declared contacts but sent $received. Your saved contacts were kept.';
return 'The radio reported $declared contacts; after checking again the app has $received. Your saved contacts were kept.';
}
@override
String contactSyncShortfallBodyNoTotal(int received) {
return 'The radio did not report how many contacts it holds and sent $received. Your saved contacts were kept.';
return 'The radio did not report how many contacts it holds; after checking again the app has $received. Your saved contacts were kept.';
}
@override
@ -5058,7 +5058,7 @@ class AppLocalizationsKo extends AppLocalizations {
@override
String contactSyncDecisionBody(int received, int removed) {
return 'The radio sent only $received contacts again. Keep your saved contacts, or use the radio\'s list? Using the radio\'s list removes $removed contacts from this app.';
return 'After checking again the app still has only $received of the radio\'s contacts. Keep your saved contacts, or use the radio\'s list? Using the radio\'s list removes $removed contacts from this app.';
}
@override
@ -5066,4 +5066,15 @@ class AppLocalizationsKo extends AppLocalizations {
@override
String get contactSyncUseRadio => 'Use the radio\'s list';
@override
String contactSyncConfirmedGone(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: '$count saved contacts are no longer on the radio.',
one: '1 saved contact is no longer on the radio.',
);
return '$_temp0';
}
}

@ -5253,12 +5253,12 @@ class AppLocalizationsNl extends AppLocalizations {
@override
String contactSyncShortfallBody(int declared, int received) {
return 'The radio reported $declared contacts but sent $received. Your saved contacts were kept.';
return 'The radio reported $declared contacts; after checking again the app has $received. Your saved contacts were kept.';
}
@override
String contactSyncShortfallBodyNoTotal(int received) {
return 'The radio did not report how many contacts it holds and sent $received. Your saved contacts were kept.';
return 'The radio did not report how many contacts it holds; after checking again the app has $received. Your saved contacts were kept.';
}
@override
@ -5266,7 +5266,7 @@ class AppLocalizationsNl extends AppLocalizations {
@override
String contactSyncDecisionBody(int received, int removed) {
return 'The radio sent only $received contacts again. Keep your saved contacts, or use the radio\'s list? Using the radio\'s list removes $removed contacts from this app.';
return 'After checking again the app still has only $received of the radio\'s contacts. Keep your saved contacts, or use the radio\'s list? Using the radio\'s list removes $removed contacts from this app.';
}
@override
@ -5274,4 +5274,15 @@ class AppLocalizationsNl extends AppLocalizations {
@override
String get contactSyncUseRadio => 'Use the radio\'s list';
@override
String contactSyncConfirmedGone(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: '$count saved contacts are no longer on the radio.',
one: '1 saved contact is no longer on the radio.',
);
return '$_temp0';
}
}

@ -5290,12 +5290,12 @@ class AppLocalizationsPl extends AppLocalizations {
@override
String contactSyncShortfallBody(int declared, int received) {
return 'The radio reported $declared contacts but sent $received. Your saved contacts were kept.';
return 'The radio reported $declared contacts; after checking again the app has $received. Your saved contacts were kept.';
}
@override
String contactSyncShortfallBodyNoTotal(int received) {
return 'The radio did not report how many contacts it holds and sent $received. Your saved contacts were kept.';
return 'The radio did not report how many contacts it holds; after checking again the app has $received. Your saved contacts were kept.';
}
@override
@ -5303,7 +5303,7 @@ class AppLocalizationsPl extends AppLocalizations {
@override
String contactSyncDecisionBody(int received, int removed) {
return 'The radio sent only $received contacts again. Keep your saved contacts, or use the radio\'s list? Using the radio\'s list removes $removed contacts from this app.';
return 'After checking again the app still has only $received of the radio\'s contacts. Keep your saved contacts, or use the radio\'s list? Using the radio\'s list removes $removed contacts from this app.';
}
@override
@ -5311,4 +5311,15 @@ class AppLocalizationsPl extends AppLocalizations {
@override
String get contactSyncUseRadio => 'Use the radio\'s list';
@override
String contactSyncConfirmedGone(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: '$count saved contacts are no longer on the radio.',
one: '1 saved contact is no longer on the radio.',
);
return '$_temp0';
}
}

@ -5266,12 +5266,12 @@ class AppLocalizationsPt extends AppLocalizations {
@override
String contactSyncShortfallBody(int declared, int received) {
return 'The radio reported $declared contacts but sent $received. Your saved contacts were kept.';
return 'The radio reported $declared contacts; after checking again the app has $received. Your saved contacts were kept.';
}
@override
String contactSyncShortfallBodyNoTotal(int received) {
return 'The radio did not report how many contacts it holds and sent $received. Your saved contacts were kept.';
return 'The radio did not report how many contacts it holds; after checking again the app has $received. Your saved contacts were kept.';
}
@override
@ -5279,7 +5279,7 @@ class AppLocalizationsPt extends AppLocalizations {
@override
String contactSyncDecisionBody(int received, int removed) {
return 'The radio sent only $received contacts again. Keep your saved contacts, or use the radio\'s list? Using the radio\'s list removes $removed contacts from this app.';
return 'After checking again the app still has only $received of the radio\'s contacts. Keep your saved contacts, or use the radio\'s list? Using the radio\'s list removes $removed contacts from this app.';
}
@override
@ -5287,4 +5287,15 @@ class AppLocalizationsPt extends AppLocalizations {
@override
String get contactSyncUseRadio => 'Use the radio\'s list';
@override
String contactSyncConfirmedGone(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: '$count saved contacts are no longer on the radio.',
one: '1 saved contact is no longer on the radio.',
);
return '$_temp0';
}
}

@ -5284,12 +5284,12 @@ class AppLocalizationsRu extends AppLocalizations {
@override
String contactSyncShortfallBody(int declared, int received) {
return 'The radio reported $declared contacts but sent $received. Your saved contacts were kept.';
return 'The radio reported $declared contacts; after checking again the app has $received. Your saved contacts were kept.';
}
@override
String contactSyncShortfallBodyNoTotal(int received) {
return 'The radio did not report how many contacts it holds and sent $received. Your saved contacts were kept.';
return 'The radio did not report how many contacts it holds; after checking again the app has $received. Your saved contacts were kept.';
}
@override
@ -5297,7 +5297,7 @@ class AppLocalizationsRu extends AppLocalizations {
@override
String contactSyncDecisionBody(int received, int removed) {
return 'The radio sent only $received contacts again. Keep your saved contacts, or use the radio\'s list? Using the radio\'s list removes $removed contacts from this app.';
return 'After checking again the app still has only $received of the radio\'s contacts. Keep your saved contacts, or use the radio\'s list? Using the radio\'s list removes $removed contacts from this app.';
}
@override
@ -5305,4 +5305,15 @@ class AppLocalizationsRu extends AppLocalizations {
@override
String get contactSyncUseRadio => 'Use the radio\'s list';
@override
String contactSyncConfirmedGone(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: '$count saved contacts are no longer on the radio.',
one: '1 saved contact is no longer on the radio.',
);
return '$_temp0';
}
}

@ -5250,12 +5250,12 @@ class AppLocalizationsSk extends AppLocalizations {
@override
String contactSyncShortfallBody(int declared, int received) {
return 'The radio reported $declared contacts but sent $received. Your saved contacts were kept.';
return 'The radio reported $declared contacts; after checking again the app has $received. Your saved contacts were kept.';
}
@override
String contactSyncShortfallBodyNoTotal(int received) {
return 'The radio did not report how many contacts it holds and sent $received. Your saved contacts were kept.';
return 'The radio did not report how many contacts it holds; after checking again the app has $received. Your saved contacts were kept.';
}
@override
@ -5263,7 +5263,7 @@ class AppLocalizationsSk extends AppLocalizations {
@override
String contactSyncDecisionBody(int received, int removed) {
return 'The radio sent only $received contacts again. Keep your saved contacts, or use the radio\'s list? Using the radio\'s list removes $removed contacts from this app.';
return 'After checking again the app still has only $received of the radio\'s contacts. Keep your saved contacts, or use the radio\'s list? Using the radio\'s list removes $removed contacts from this app.';
}
@override
@ -5271,4 +5271,15 @@ class AppLocalizationsSk extends AppLocalizations {
@override
String get contactSyncUseRadio => 'Use the radio\'s list';
@override
String contactSyncConfirmedGone(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: '$count saved contacts are no longer on the radio.',
one: '1 saved contact is no longer on the radio.',
);
return '$_temp0';
}
}

@ -5248,12 +5248,12 @@ class AppLocalizationsSl extends AppLocalizations {
@override
String contactSyncShortfallBody(int declared, int received) {
return 'The radio reported $declared contacts but sent $received. Your saved contacts were kept.';
return 'The radio reported $declared contacts; after checking again the app has $received. Your saved contacts were kept.';
}
@override
String contactSyncShortfallBodyNoTotal(int received) {
return 'The radio did not report how many contacts it holds and sent $received. Your saved contacts were kept.';
return 'The radio did not report how many contacts it holds; after checking again the app has $received. Your saved contacts were kept.';
}
@override
@ -5261,7 +5261,7 @@ class AppLocalizationsSl extends AppLocalizations {
@override
String contactSyncDecisionBody(int received, int removed) {
return 'The radio sent only $received contacts again. Keep your saved contacts, or use the radio\'s list? Using the radio\'s list removes $removed contacts from this app.';
return 'After checking again the app still has only $received of the radio\'s contacts. Keep your saved contacts, or use the radio\'s list? Using the radio\'s list removes $removed contacts from this app.';
}
@override
@ -5269,4 +5269,15 @@ class AppLocalizationsSl extends AppLocalizations {
@override
String get contactSyncUseRadio => 'Use the radio\'s list';
@override
String contactSyncConfirmedGone(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: '$count saved contacts are no longer on the radio.',
one: '1 saved contact is no longer on the radio.',
);
return '$_temp0';
}
}

@ -5223,12 +5223,12 @@ class AppLocalizationsSv extends AppLocalizations {
@override
String contactSyncShortfallBody(int declared, int received) {
return 'The radio reported $declared contacts but sent $received. Your saved contacts were kept.';
return 'The radio reported $declared contacts; after checking again the app has $received. Your saved contacts were kept.';
}
@override
String contactSyncShortfallBodyNoTotal(int received) {
return 'The radio did not report how many contacts it holds and sent $received. Your saved contacts were kept.';
return 'The radio did not report how many contacts it holds; after checking again the app has $received. Your saved contacts were kept.';
}
@override
@ -5236,7 +5236,7 @@ class AppLocalizationsSv extends AppLocalizations {
@override
String contactSyncDecisionBody(int received, int removed) {
return 'The radio sent only $received contacts again. Keep your saved contacts, or use the radio\'s list? Using the radio\'s list removes $removed contacts from this app.';
return 'After checking again the app still has only $received of the radio\'s contacts. Keep your saved contacts, or use the radio\'s list? Using the radio\'s list removes $removed contacts from this app.';
}
@override
@ -5244,4 +5244,15 @@ class AppLocalizationsSv extends AppLocalizations {
@override
String get contactSyncUseRadio => 'Use the radio\'s list';
@override
String contactSyncConfirmedGone(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: '$count saved contacts are no longer on the radio.',
one: '1 saved contact is no longer on the radio.',
);
return '$_temp0';
}
}

@ -5285,12 +5285,12 @@ class AppLocalizationsUk extends AppLocalizations {
@override
String contactSyncShortfallBody(int declared, int received) {
return 'The radio reported $declared contacts but sent $received. Your saved contacts were kept.';
return 'The radio reported $declared contacts; after checking again the app has $received. Your saved contacts were kept.';
}
@override
String contactSyncShortfallBodyNoTotal(int received) {
return 'The radio did not report how many contacts it holds and sent $received. Your saved contacts were kept.';
return 'The radio did not report how many contacts it holds; after checking again the app has $received. Your saved contacts were kept.';
}
@override
@ -5298,7 +5298,7 @@ class AppLocalizationsUk extends AppLocalizations {
@override
String contactSyncDecisionBody(int received, int removed) {
return 'The radio sent only $received contacts again. Keep your saved contacts, or use the radio\'s list? Using the radio\'s list removes $removed contacts from this app.';
return 'After checking again the app still has only $received of the radio\'s contacts. Keep your saved contacts, or use the radio\'s list? Using the radio\'s list removes $removed contacts from this app.';
}
@override
@ -5306,4 +5306,15 @@ class AppLocalizationsUk extends AppLocalizations {
@override
String get contactSyncUseRadio => 'Use the radio\'s list';
@override
String contactSyncConfirmedGone(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: '$count saved contacts are no longer on the radio.',
one: '1 saved contact is no longer on the radio.',
);
return '$_temp0';
}
}

@ -4918,12 +4918,12 @@ class AppLocalizationsZh extends AppLocalizations {
@override
String contactSyncShortfallBody(int declared, int received) {
return 'The radio reported $declared contacts but sent $received. Your saved contacts were kept.';
return 'The radio reported $declared contacts; after checking again the app has $received. Your saved contacts were kept.';
}
@override
String contactSyncShortfallBodyNoTotal(int received) {
return 'The radio did not report how many contacts it holds and sent $received. Your saved contacts were kept.';
return 'The radio did not report how many contacts it holds; after checking again the app has $received. Your saved contacts were kept.';
}
@override
@ -4931,7 +4931,7 @@ class AppLocalizationsZh extends AppLocalizations {
@override
String contactSyncDecisionBody(int received, int removed) {
return 'The radio sent only $received contacts again. Keep your saved contacts, or use the radio\'s list? Using the radio\'s list removes $removed contacts from this app.';
return 'After checking again the app still has only $received of the radio\'s contacts. Keep your saved contacts, or use the radio\'s list? Using the radio\'s list removes $removed contacts from this app.';
}
@override
@ -4939,4 +4939,15 @@ class AppLocalizationsZh extends AppLocalizations {
@override
String get contactSyncUseRadio => 'Use the radio\'s list';
@override
String contactSyncConfirmedGone(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: '$count saved contacts are no longer on the radio.',
one: '1 saved contact is no longer on the radio.',
);
return '$_temp0';
}
}

@ -4,9 +4,10 @@ import '../connector/meshcore_connector.dart';
import '../l10n/l10n.dart';
/// Shown above the whole app when a full contact sync delivered fewer contacts
/// than the radio reported (#668). The banner stays until dismissed. When the
/// automatic retry was also short, a modal asks whether to keep the saved
/// contacts (the default) or accept the radio's shorter list.
/// than the radio reported (#668), after the forced resync (#703) has tried
/// and is still short. The banner stays until dismissed, and a modal asks
/// whether to keep the saved contacts (the default) or accept the radio's
/// shorter list.
///
/// SAFELANE §6: the short sync that silently replaced 350 saved contacts with
/// 106 (#660) must now be loud. Sits in `MaterialApp.builder`, above the
@ -50,18 +51,31 @@ class ContactSyncShortfallBanner extends StatelessWidget {
children: [
content,
const ModalBarrier(dismissible: false, color: Colors.black54),
Center(child: _decision(context, current?.received ?? 0)),
Center(
child: _decision(
context,
current?.received ?? 0,
current?.confirmedGone ?? 0,
),
),
],
);
}
static String _withGone(String text, int gone, BuildContext context) =>
gone > 0 ? '$text ${context.l10n.contactSyncConfirmedGone(gone)}' : text;
Widget _banner(BuildContext context, ContactSyncShortfall current) {
final l10n = context.l10n;
final scheme = Theme.of(context).colorScheme;
final declared = current.declared;
final body = declared == null
? l10n.contactSyncShortfallBodyNoTotal(current.received)
: l10n.contactSyncShortfallBody(declared, current.received);
final body = _withGone(
declared == null
? l10n.contactSyncShortfallBodyNoTotal(current.received)
: l10n.contactSyncShortfallBody(declared, current.received),
current.confirmedGone,
context,
);
return Material(
color: scheme.errorContainer,
child: SafeArea(
@ -109,11 +123,17 @@ class ContactSyncShortfallBanner extends StatelessWidget {
);
}
Widget _decision(BuildContext context, int received) {
Widget _decision(BuildContext context, int received, int gone) {
final l10n = context.l10n;
return AlertDialog(
title: Text(l10n.contactSyncDecisionTitle),
content: Text(l10n.contactSyncDecisionBody(received, undeliveredCount)),
content: Text(
_withGone(
l10n.contactSyncDecisionBody(received, undeliveredCount),
gone,
context,
),
),
actions: [
TextButton(
onPressed: onUseRadio,

@ -53,13 +53,77 @@ void main() {
expect(find.text('Contact sync incomplete'), findsOneWidget);
expect(
find.textContaining('reported 350 contacts but sent 106'),
find.textContaining(
'reported 350 contacts; after checking again the app has 106',
),
findsOneWidget,
);
expect(find.text('APP'), findsOneWidget);
expect(find.byType(AlertDialog), findsNothing);
});
// #764: contacts the radio answered "not found" for are named, and only
// when there are any.
group('confirmed gone', () {
const withGone = ContactSyncShortfall(
declared: 350,
received: 340,
keptLocally: 10,
confirmedGone: 4,
);
testWidgets('banner names them when there are some', (tester) async {
await tester.pumpWidget(build(shortfall: withGone));
expect(
find.textContaining('4 saved contacts are no longer on the radio.'),
findsOneWidget,
);
});
testWidgets('one reads in the singular', (tester) async {
await tester.pumpWidget(
build(
shortfall: const ContactSyncShortfall(
declared: 350,
received: 349,
keptLocally: 1,
confirmedGone: 1,
),
),
);
expect(
find.textContaining('1 saved contact is no longer on the radio.'),
findsOneWidget,
);
});
testWidgets('banner says nothing about it when there are none', (
tester,
) async {
await tester.pumpWidget(build(shortfall: short));
expect(find.textContaining('no longer on the radio'), findsNothing);
});
testWidgets('the decision dialog names them too', (tester) async {
await tester.pumpWidget(
build(shortfall: withGone, decisionPending: true, undelivered: 10),
);
expect(
find.descendant(
of: find.byType(AlertDialog),
matching: find.textContaining(
'4 saved contacts are no longer on the radio.',
),
),
findsOneWidget,
);
});
});
testWidgets('no declared total uses its own wording', (tester) async {
await tester.pumpWidget(
build(

@ -230,7 +230,8 @@
"contactSyncDecisionTitle",
"contactSyncDecisionBody",
"contactSyncKeep",
"contactSyncUseRadio"
"contactSyncUseRadio",
"contactSyncConfirmedGone"
],
"de": [
@ -464,7 +465,8 @@
"contactSyncDecisionTitle",
"contactSyncDecisionBody",
"contactSyncKeep",
"contactSyncUseRadio"
"contactSyncUseRadio",
"contactSyncConfirmedGone"
],
"es": [
@ -698,7 +700,8 @@
"contactSyncDecisionTitle",
"contactSyncDecisionBody",
"contactSyncKeep",
"contactSyncUseRadio"
"contactSyncUseRadio",
"contactSyncConfirmedGone"
],
"fr": [
@ -932,7 +935,8 @@
"contactSyncDecisionTitle",
"contactSyncDecisionBody",
"contactSyncKeep",
"contactSyncUseRadio"
"contactSyncUseRadio",
"contactSyncConfirmedGone"
],
"hu": [
@ -1166,7 +1170,8 @@
"contactSyncDecisionTitle",
"contactSyncDecisionBody",
"contactSyncKeep",
"contactSyncUseRadio"
"contactSyncUseRadio",
"contactSyncConfirmedGone"
],
"it": [
@ -1400,7 +1405,8 @@
"contactSyncDecisionTitle",
"contactSyncDecisionBody",
"contactSyncKeep",
"contactSyncUseRadio"
"contactSyncUseRadio",
"contactSyncConfirmedGone"
],
"ja": [
@ -1634,7 +1640,8 @@
"contactSyncDecisionTitle",
"contactSyncDecisionBody",
"contactSyncKeep",
"contactSyncUseRadio"
"contactSyncUseRadio",
"contactSyncConfirmedGone"
],
"ko": [
@ -1868,7 +1875,8 @@
"contactSyncDecisionTitle",
"contactSyncDecisionBody",
"contactSyncKeep",
"contactSyncUseRadio"
"contactSyncUseRadio",
"contactSyncConfirmedGone"
],
"nl": [
@ -2102,7 +2110,8 @@
"contactSyncDecisionTitle",
"contactSyncDecisionBody",
"contactSyncKeep",
"contactSyncUseRadio"
"contactSyncUseRadio",
"contactSyncConfirmedGone"
],
"pl": [
@ -2336,7 +2345,8 @@
"contactSyncDecisionTitle",
"contactSyncDecisionBody",
"contactSyncKeep",
"contactSyncUseRadio"
"contactSyncUseRadio",
"contactSyncConfirmedGone"
],
"pt": [
@ -2570,7 +2580,8 @@
"contactSyncDecisionTitle",
"contactSyncDecisionBody",
"contactSyncKeep",
"contactSyncUseRadio"
"contactSyncUseRadio",
"contactSyncConfirmedGone"
],
"ru": [
@ -2804,7 +2815,8 @@
"contactSyncDecisionTitle",
"contactSyncDecisionBody",
"contactSyncKeep",
"contactSyncUseRadio"
"contactSyncUseRadio",
"contactSyncConfirmedGone"
],
"sk": [
@ -3038,7 +3050,8 @@
"contactSyncDecisionTitle",
"contactSyncDecisionBody",
"contactSyncKeep",
"contactSyncUseRadio"
"contactSyncUseRadio",
"contactSyncConfirmedGone"
],
"sl": [
@ -3272,7 +3285,8 @@
"contactSyncDecisionTitle",
"contactSyncDecisionBody",
"contactSyncKeep",
"contactSyncUseRadio"
"contactSyncUseRadio",
"contactSyncConfirmedGone"
],
"sv": [
@ -3506,7 +3520,8 @@
"contactSyncDecisionTitle",
"contactSyncDecisionBody",
"contactSyncKeep",
"contactSyncUseRadio"
"contactSyncUseRadio",
"contactSyncConfirmedGone"
],
"uk": [
@ -3740,7 +3755,8 @@
"contactSyncDecisionTitle",
"contactSyncDecisionBody",
"contactSyncKeep",
"contactSyncUseRadio"
"contactSyncUseRadio",
"contactSyncConfirmedGone"
],
"zh": [
@ -3974,6 +3990,7 @@
"contactSyncDecisionTitle",
"contactSyncDecisionBody",
"contactSyncKeep",
"contactSyncUseRadio"
"contactSyncUseRadio",
"contactSyncConfirmedGone"
]
}

Loading…
Cancel
Save

Powered by TurnKey Linux.