From a8e7bc34b697acb3f8c2ac343d7dfcbb1bae9c8f Mon Sep 17 00:00:00 2001 From: diffwireauto <330573775+diffwireauto@users.noreply.github.com> Date: Sat, 28 Nov 2026 03:52:25 -0500 Subject: [PATCH 1/3] fix(#1256): key region scope by channel PSK, not slot index A sync reshuffle moved a channel's region scope to the wrong slot occupant (Dot). Key the scope by the channel PSK like channel_message_store (#194), fall back to the index key only while the PSK is unknown (logged, never silent), and best-effort migrate existing index-keyed scopes on first read. Regression test: indices swap, PSKs stable, each scope stays on its own channel. --- lib/connector/meshcore_connector.dart | 4 + lib/storage/channel_region_scope_store.dart | 84 +++++++++++++++++-- .../channel_region_scope_store_test.dart | 39 +++++++++ 3 files changed, 119 insertions(+), 8 deletions(-) diff --git a/lib/connector/meshcore_connector.dart b/lib/connector/meshcore_connector.dart index 332b40a9..c18c20b7 100644 --- a/lib/connector/meshcore_connector.dart +++ b/lib/connector/meshcore_connector.dart @@ -9727,6 +9727,10 @@ class MeshCoreConnector extends ChangeNotifier { _channelOrderStore.setPublicKeyHex = selfPublicKeyHex; _channelSettingsStore.setPublicKeyHex = selfPublicKeyHex; _channelRegionScopeStore.setPublicKeyHex = selfPublicKeyHex; + // Key region scope by the channel's PSK identity (not its reusable slot + // index) so a sync reshuffle can't move a scope to the wrong channel. (#1256) + _channelRegionScopeStore.channelPskResolver = (index) => + _findChannelByIndex(index)?.pskHex; _contactSettingsStore.setPublicKeyHex = selfPublicKeyHex; _contactStore.setPublicKeyHex = selfPublicKeyHex; _channelStore.setPublicKeyHex = selfPublicKeyHex; diff --git a/lib/storage/channel_region_scope_store.dart b/lib/storage/channel_region_scope_store.dart index 89995266..de9aa6da 100644 --- a/lib/storage/channel_region_scope_store.dart +++ b/lib/storage/channel_region_scope_store.dart @@ -3,23 +3,83 @@ import 'prefs_manager.dart'; /// Per-channel region scope, persisted per device (Feature #812, Epic #815). /// -/// Stores the region name a channel's outgoing messages should ride, keyed by -/// the first 10 hex chars of the connected device's public key (the same -/// scoping the other channel stores use). The name is the `#`-stripped region -/// name from discovery; null/absent means the channel is unscoped. +/// Keyed by the channel **PSK** (the channel's identity), scoped per device by +/// the first 10 hex chars of the connected device's public key. A slot +/// reshuffle on sync cannot move a scope to the wrong channel, because the key +/// is the PSK, not the slot index (#1256). Falls back to the slot-index key +/// only while the PSK is unknown (channel list not yet loaded), mirroring +/// `channel_message_store` (#194). The name is the `#`-stripped region name +/// from discovery; null/absent means the channel is unscoped. class ChannelRegionScopeStore { static const String _keyPrefix = 'channel_region_scope_'; + static const String _pskMarker = 'psk_'; String publicKeyHex = ''; set setPublicKeyHex(String value) => publicKeyHex = value.length > 10 ? value.substring(0, 10) : ''; - String _key(int channelIndex) => '$_keyPrefix${publicKeyHex}_$channelIndex'; + /// Resolves a slot index to the channel's PSK hex, or null while unknown. + /// Mirrors `channel_message_store.channelPskResolver` (#194/#1062). + String? Function(int index)? channelPskResolver; + + String _indexKey(int channelIndex) => + '$_keyPrefix${publicKeyHex}_$channelIndex'; + String _pskKey(String pskHex) => + '$_keyPrefix${publicKeyHex}_$_pskMarker$pskHex'; + + /// Active key: the PSK identity when known, else the slot index. A fallback + /// to the index key while a resolver exists means the channel list was not + /// loaded first; it reads a DIFFERENT key, so it is logged, never silent + /// (SAFELANE 6). + String _activeKey(int channelIndex, {bool forWrite = false}) { + final pskHex = channelPskResolver?.call(channelIndex); + if (pskHex != null && pskHex.isNotEmpty) { + return _pskKey(pskHex); + } + if (channelPskResolver != null) { + if (forWrite) { + appLogger.error( + 'Region-scope WRITE for channel $channelIndex fell back to the ' + 'slot-index key: the slot did not resolve to a PSK. (#1256)', + tag: 'Storage', + ); + } else { + appLogger.warn( + 'Region scope for channel $channelIndex has no PSK yet; falling ' + 'back to the slot-index key. The channel list was not loaded first. ' + '(#1256)', + tag: 'Storage', + ); + } + } + return _indexKey(channelIndex); + } /// The region name scoping [channelIndex], or null when unscoped. Future scopeFor(int channelIndex) async { if (publicKeyHex.isEmpty) return null; - return PrefsManager.instance.getString(_key(channelIndex)); + final key = _activeKey(channelIndex); + final value = PrefsManager.instance.getString(key); + if (value != null && value.isNotEmpty) return value; + + // One-time best-effort migration into the PSK-identity key: when the PSK is + // known and the PSK key is empty, adopt a pre-#1256 slot-index value and + // drop the source. Maps the current index to the PSK (owner: best-effort; + // an already-reshuffled scope binds to the current occupant once). + final indexKey = _indexKey(channelIndex); + if (key != indexKey) { + final legacy = PrefsManager.instance.getString(indexKey); + if (legacy != null && legacy.isNotEmpty) { + appLogger.info( + 'Migrating region scope $indexKey -> $key (PSK-keyed, #1256)', + tag: 'Storage', + ); + await PrefsManager.instance.setString(key, legacy); + await PrefsManager.instance.remove(indexKey); + return legacy; + } + } + return null; } /// Scope [channelIndex] to [regionName]. @@ -28,12 +88,20 @@ class ChannelRegionScopeStore { appLogger.warn('No device key set; cannot save channel region scope.'); return; } - await PrefsManager.instance.setString(_key(channelIndex), regionName); + final key = _activeKey(channelIndex, forWrite: true); + await PrefsManager.instance.setString(key, regionName); + // Kill any stale pre-#1256 index-keyed value so it can never be re-adopted + // after this PSK scope is later cleared. + final indexKey = _indexKey(channelIndex); + if (key != indexKey) await PrefsManager.instance.remove(indexKey); } /// Remove the region scope on [channelIndex] (back to unscoped). Future clearScope(int channelIndex) async { if (publicKeyHex.isEmpty) return; - await PrefsManager.instance.remove(_key(channelIndex)); + final key = _activeKey(channelIndex, forWrite: true); + await PrefsManager.instance.remove(key); + final indexKey = _indexKey(channelIndex); + if (key != indexKey) await PrefsManager.instance.remove(indexKey); } } diff --git a/test/storage/channel_region_scope_store_test.dart b/test/storage/channel_region_scope_store_test.dart index 9ca28c8a..939fb405 100644 --- a/test/storage/channel_region_scope_store_test.dart +++ b/test/storage/channel_region_scope_store_test.dart @@ -57,4 +57,43 @@ void main() { await store.setScope(0, 'oki'); expect(await store.scopeFor(0), isNull); }); + + group('PSK identity keying (#1256)', () { + test('scope follows the channel PSK across a slot reshuffle', () async { + final store = storeFor(_devA); + final slots = {0: 'pskaaaa', 1: 'pskbbbb'}; + store.channelPskResolver = (i) => slots[i]; + await store.setScope(0, 'oki'); // channel pskaaaa at slot 0 + + // A sync reshuffles the slots: pskaaaa moves to slot 1, pskbbbb to slot 0. + slots[0] = 'pskbbbb'; + slots[1] = 'pskaaaa'; + + expect(await store.scopeFor(1), 'oki'); // scope followed pskaaaa + expect(await store.scopeFor(0), isNull); // pskbbbb has no scope + }); + + test('keys by PSK, not index, when the resolver is set', () async { + final store = storeFor(_devA); + store.channelPskResolver = (i) => 'pskzzzz'; + await store.setScope(0, 'day'); + // A different slot index resolving to the same PSK sees the same scope. + expect(await store.scopeFor(9), 'day'); + }); + + test('adopts a legacy index-keyed scope once the PSK is known', () async { + // Pre-fix value: written with no resolver, so it lives on the index key. + await storeFor(_devA).setScope(2, 'cvg'); + + final store = storeFor(_devA); + store.channelPskResolver = (i) => i == 2 ? 'pskcccc' : null; + expect(await store.scopeFor(2), 'cvg'); // migrated off the index key + + // Migration is sticky: now reachable by PSK even if the slot moves, and + // the old index key is gone. + store.channelPskResolver = (i) => i == 5 ? 'pskcccc' : null; + expect(await store.scopeFor(5), 'cvg'); + expect(await store.scopeFor(2), isNull); + }); + }); } From 28b7f36c699eb5e30152cbe0e2fca613f71ed4c1 Mon Sep 17 00:00:00 2001 From: diffwireauto <330573775+diffwireauto@users.noreply.github.com> Date: Sat, 28 Nov 2026 03:54:50 -0500 Subject: [PATCH 2/3] fix(#1257): key Cyr2Lat channel settings by PSK, not slot index Same slot-index misbind as region scope (#1256): a sync reshuffle carried the Cyr2Lat enabled flag and profile to the wrong channel. Key both by the channel PSK with index fallback (logged) and best-effort migration. Reshuffle regression tests for enabled and profile. --- lib/connector/meshcore_connector.dart | 4 + lib/storage/channel_settings_store.dart | 91 +++++++++++++++++-- test/storage/channel_settings_store_test.dart | 84 +++++++++++++++++ 3 files changed, 173 insertions(+), 6 deletions(-) create mode 100644 test/storage/channel_settings_store_test.dart diff --git a/lib/connector/meshcore_connector.dart b/lib/connector/meshcore_connector.dart index c18c20b7..58219ea4 100644 --- a/lib/connector/meshcore_connector.dart +++ b/lib/connector/meshcore_connector.dart @@ -9726,6 +9726,10 @@ class MeshCoreConnector extends ChangeNotifier { _messageStore.setPublicKeyHex = selfPublicKeyHex; _channelOrderStore.setPublicKeyHex = selfPublicKeyHex; _channelSettingsStore.setPublicKeyHex = selfPublicKeyHex; + // Key Cyr2Lat by the channel's PSK identity so a sync reshuffle can't carry + // the setting to the wrong channel. (#1257) + _channelSettingsStore.channelPskResolver = (index) => + _findChannelByIndex(index)?.pskHex; _channelRegionScopeStore.setPublicKeyHex = selfPublicKeyHex; // Key region scope by the channel's PSK identity (not its reusable slot // index) so a sync reshuffle can't move a scope to the wrong channel. (#1256) diff --git a/lib/storage/channel_settings_store.dart b/lib/storage/channel_settings_store.dart index 6c3c39c4..7aaf6142 100644 --- a/lib/storage/channel_settings_store.dart +++ b/lib/storage/channel_settings_store.dart @@ -1,15 +1,48 @@ import '../utils/app_logger.dart'; import 'prefs_manager.dart'; +/// Per-channel Cyr2Lat settings, keyed by the channel **PSK** identity so a +/// slot reshuffle on sync cannot carry a setting to the wrong channel (#1257, +/// same fix as the region-scope store #1256). Falls back to the slot-index key +/// only while the PSK is unknown (channel list not yet loaded), mirroring +/// `channel_message_store` (#194), and best-effort migrates existing +/// index-keyed values on first read. class ChannelSettingsStore { static const String _cyr2latKeyPrefix = 'channel_cyr2lat_'; + static const String _pskMarker = 'psk_'; String publicKeyHex = ''; set setPublicKeyHex(String value) => publicKeyHex = value.length > 10 ? value.substring(0, 10) : ''; + /// Resolves a slot index to the channel's PSK hex, or null while unknown. + String? Function(int index)? channelPskResolver; + String get keyForCyr2Lat => '$_cyr2latKeyPrefix$publicKeyHex'; + String _enabledIndexKey(int i) => '$keyForCyr2Lat$i'; + String _enabledPskKey(String psk) => '$keyForCyr2Lat$_pskMarker$psk'; + String _profileIndexKey(int i) => '${keyForCyr2Lat}profile_$i'; + String _profilePskKey(String psk) => + '${keyForCyr2Lat}profile_$_pskMarker$psk'; + + /// Active key: PSK identity when known, else the slot index (logged when a + /// resolver exists but the slot has no PSK yet, so the fallback is never + /// silent). + String? _psk(int channelIndex, {bool forWrite = false}) { + final pskHex = channelPskResolver?.call(channelIndex); + if (pskHex != null && pskHex.isNotEmpty) return pskHex; + if (channelPskResolver != null) { + final verb = forWrite ? 'WRITE' : 'read'; + appLogger.warn( + 'Cyr2Lat $verb for channel $channelIndex has no PSK yet; falling back ' + 'to the slot-index key. The channel list was not loaded first. (#1257)', + tag: 'Storage', + ); + } + return null; + } + Future loadCyr2LatEnabled(int channelIndex) async { if (publicKeyHex.isEmpty) { appLogger.warn( @@ -18,8 +51,26 @@ class ChannelSettingsStore { return false; } final prefs = PrefsManager.instance; - final key = '$keyForCyr2Lat$channelIndex'; - return prefs.getBool(key) ?? false; + final psk = _psk(channelIndex); + final key = psk != null + ? _enabledPskKey(psk) + : _enabledIndexKey(channelIndex); + final value = prefs.getBool(key); + if (value != null) return value; + final indexKey = _enabledIndexKey(channelIndex); + if (key != indexKey) { + final legacy = prefs.getBool(indexKey); + if (legacy != null) { + appLogger.info( + 'Migrating Cyr2Lat enabled $indexKey -> $key (PSK-keyed, #1257)', + tag: 'Storage', + ); + await prefs.setBool(key, legacy); + await prefs.remove(indexKey); + return legacy; + } + } + return false; } Future saveCyr2LatEnabled(int channelIndex, bool enabled) async { @@ -30,8 +81,13 @@ class ChannelSettingsStore { return; } final prefs = PrefsManager.instance; - final key = '$keyForCyr2Lat$channelIndex'; + final psk = _psk(channelIndex, forWrite: true); + final key = psk != null + ? _enabledPskKey(psk) + : _enabledIndexKey(channelIndex); await prefs.setBool(key, enabled); + final indexKey = _enabledIndexKey(channelIndex); + if (key != indexKey) await prefs.remove(indexKey); } Future loadCyr2LatProfileId(int channelIndex) async { @@ -42,8 +98,26 @@ class ChannelSettingsStore { return null; } final prefs = PrefsManager.instance; - final key = '${keyForCyr2Lat}profile_$channelIndex'; - return prefs.getString(key); + final psk = _psk(channelIndex); + final key = psk != null + ? _profilePskKey(psk) + : _profileIndexKey(channelIndex); + final value = prefs.getString(key); + if (value != null && value.isNotEmpty) return value; + final indexKey = _profileIndexKey(channelIndex); + if (key != indexKey) { + final legacy = prefs.getString(indexKey); + if (legacy != null && legacy.isNotEmpty) { + appLogger.info( + 'Migrating Cyr2Lat profile $indexKey -> $key (PSK-keyed, #1257)', + tag: 'Storage', + ); + await prefs.setString(key, legacy); + await prefs.remove(indexKey); + return legacy; + } + } + return null; } Future saveCyr2LatProfileId(int channelIndex, String? profileId) async { @@ -54,11 +128,16 @@ class ChannelSettingsStore { return; } final prefs = PrefsManager.instance; - final key = '${keyForCyr2Lat}profile_$channelIndex'; + final psk = _psk(channelIndex, forWrite: true); + final key = psk != null + ? _profilePskKey(psk) + : _profileIndexKey(channelIndex); + final indexKey = _profileIndexKey(channelIndex); if (profileId == null) { await prefs.remove(key); } else { await prefs.setString(key, profileId); } + if (key != indexKey) await prefs.remove(indexKey); } } diff --git a/test/storage/channel_settings_store_test.dart b/test/storage/channel_settings_store_test.dart new file mode 100644 index 00000000..8cbd3e59 --- /dev/null +++ b/test/storage/channel_settings_store_test.dart @@ -0,0 +1,84 @@ +// Cyr2Lat per-channel settings, keyed by channel PSK identity (#1257). + +import 'package:flutter_test/flutter_test.dart'; +import 'package:meshcore_open/storage/channel_settings_store.dart'; +import 'package:meshcore_open/storage/prefs_manager.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + +const _devA = 'aabbccddee0011223344'; + +void main() { + TestWidgetsFlutterBinding.ensureInitialized(); + + setUp(() async { + SharedPreferences.setMockInitialValues({}); + PrefsManager.reset(); + await PrefsManager.initialize(); + }); + + ChannelSettingsStore storeFor(String deviceKeyHex) { + final s = ChannelSettingsStore(); + s.setPublicKeyHex = deviceKeyHex; + return s; + } + + test( + 'enabled + profile round-trip without a resolver (index fallback)', + () async { + final store = storeFor(_devA); + expect(await store.loadCyr2LatEnabled(0), isFalse); + await store.saveCyr2LatEnabled(0, true); + expect(await store.loadCyr2LatEnabled(0), isTrue); + await store.saveCyr2LatProfileId(0, 'ru'); + expect(await store.loadCyr2LatProfileId(0), 'ru'); + }, + ); + + group('PSK identity keying (#1257)', () { + test('enabled follows the channel PSK across a slot reshuffle', () async { + final store = storeFor(_devA); + final slots = {0: 'pskaaaa', 1: 'pskbbbb'}; + store.channelPskResolver = (i) => slots[i]; + await store.saveCyr2LatEnabled(0, true); // channel pskaaaa at slot 0 + + slots[0] = 'pskbbbb'; + slots[1] = 'pskaaaa'; + + expect(await store.loadCyr2LatEnabled(1), isTrue); // followed pskaaaa + expect(await store.loadCyr2LatEnabled(0), isFalse); // pskbbbb unset + }); + + test( + 'profile id follows the channel PSK across a slot reshuffle', + () async { + final store = storeFor(_devA); + final slots = {0: 'pskaaaa', 1: 'pskbbbb'}; + store.channelPskResolver = (i) => slots[i]; + await store.saveCyr2LatProfileId(0, 'ru'); + + slots[0] = 'pskbbbb'; + slots[1] = 'pskaaaa'; + + expect(await store.loadCyr2LatProfileId(1), 'ru'); + expect(await store.loadCyr2LatProfileId(0), isNull); + }, + ); + + test( + 'adopts a legacy index-keyed enabled flag once the PSK is known', + () async { + await storeFor( + _devA, + ).saveCyr2LatEnabled(2, true); // index-keyed (no resolver) + + final store = storeFor(_devA); + store.channelPskResolver = (i) => i == 2 ? 'pskcccc' : null; + expect(await store.loadCyr2LatEnabled(2), isTrue); // migrated + + store.channelPskResolver = (i) => i == 5 ? 'pskcccc' : null; + expect(await store.loadCyr2LatEnabled(5), isTrue); // sticky by PSK + expect(await store.loadCyr2LatEnabled(2), isFalse); // index key gone + }, + ); + }); +} From 2e5930f5b091da5e160d8db6f313285873f97774 Mon Sep 17 00:00:00 2001 From: diffwireauto <330573775+diffwireauto@users.noreply.github.com> Date: Sat, 28 Nov 2026 04:10:10 -0500 Subject: [PATCH 3/3] feat(#1258): region-scope banner on the channel chat A bar at the top of a region-scoped channel reminds the user which region its messages ride and opens Set Region Scope on tap. Dismissible for the session (in-memory, keyed by channel PSK), returns on a fresh app open. Service + widget tests; the nav test gains the new provider. --- lib/l10n/app_en.arb | 8 +++ lib/l10n/app_localizations.dart | 12 ++++ lib/l10n/app_localizations_bg.dart | 8 +++ lib/l10n/app_localizations_de.dart | 8 +++ lib/l10n/app_localizations_en.dart | 8 +++ lib/l10n/app_localizations_es.dart | 8 +++ lib/l10n/app_localizations_fr.dart | 8 +++ lib/l10n/app_localizations_hu.dart | 8 +++ lib/l10n/app_localizations_it.dart | 8 +++ lib/l10n/app_localizations_ja.dart | 8 +++ lib/l10n/app_localizations_ko.dart | 8 +++ lib/l10n/app_localizations_nl.dart | 8 +++ lib/l10n/app_localizations_pl.dart | 8 +++ lib/l10n/app_localizations_pt.dart | 8 +++ lib/l10n/app_localizations_ru.dart | 8 +++ lib/l10n/app_localizations_sk.dart | 8 +++ lib/l10n/app_localizations_sl.dart | 8 +++ lib/l10n/app_localizations_sv.dart | 8 +++ lib/l10n/app_localizations_uk.dart | 8 +++ lib/l10n/app_localizations_zh.dart | 8 +++ lib/main.dart | 2 + lib/screens/channel_chat_screen.dart | 35 +++++++++++ lib/services/region_scope_banner_service.dart | 15 +++++ lib/widgets/region_scope_banner.dart | 62 +++++++++++++++++++ .../screens/channel_chat_navigation_test.dart | 2 + .../region_scope_banner_service_test.dart | 22 +++++++ test/widgets/region_scope_banner_test.dart | 56 +++++++++++++++++ untranslated.json | 34 ++++++++++ 28 files changed, 392 insertions(+) create mode 100644 lib/services/region_scope_banner_service.dart create mode 100644 lib/widgets/region_scope_banner.dart create mode 100644 test/services/region_scope_banner_service_test.dart create mode 100644 test/widgets/region_scope_banner_test.dart diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index 856369c4..49b03953 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -3874,6 +3874,14 @@ "setRegionScope_searchRepeaters": "Search repeaters", "setRegionScope_pathNote": "You can only discover regions from a repeater you have a stored path to.", "setRegionScope_noPath": "No stored path", + "setRegionScope_banner": "Messages ride region {name}", + "@setRegionScope_banner": { + "description": "Banner on a region-scoped channel; tapping it opens Set Region Scope (#1258).", + "placeholders": { + "name": { "type": "String" } + } + }, + "setRegionScope_bannerDismiss": "Dismiss", "storage_title": "Storage", "storage_databaseSize": "Message database: {size}", "@storage_databaseSize": { diff --git a/lib/l10n/app_localizations.dart b/lib/l10n/app_localizations.dart index bdb7c498..dd4adc19 100644 --- a/lib/l10n/app_localizations.dart +++ b/lib/l10n/app_localizations.dart @@ -10282,6 +10282,18 @@ abstract class AppLocalizations { /// **'No stored path'** String get setRegionScope_noPath; + /// Banner on a region-scoped channel; tapping it opens Set Region Scope (#1258). + /// + /// In en, this message translates to: + /// **'Messages ride region {name}'** + String setRegionScope_banner(String name); + + /// No description provided for @setRegionScope_bannerDismiss. + /// + /// In en, this message translates to: + /// **'Dismiss'** + String get setRegionScope_bannerDismiss; + /// No description provided for @storage_title. /// /// In en, this message translates to: diff --git a/lib/l10n/app_localizations_bg.dart b/lib/l10n/app_localizations_bg.dart index 81761892..7093a400 100644 --- a/lib/l10n/app_localizations_bg.dart +++ b/lib/l10n/app_localizations_bg.dart @@ -6166,6 +6166,14 @@ class AppLocalizationsBg extends AppLocalizations { @override String get setRegionScope_noPath => 'No stored path'; + @override + String setRegionScope_banner(String name) { + return 'Messages ride region $name'; + } + + @override + String get setRegionScope_bannerDismiss => 'Dismiss'; + @override String get storage_title => 'Storage'; diff --git a/lib/l10n/app_localizations_de.dart b/lib/l10n/app_localizations_de.dart index 120d4dc7..756e6f48 100644 --- a/lib/l10n/app_localizations_de.dart +++ b/lib/l10n/app_localizations_de.dart @@ -6183,6 +6183,14 @@ class AppLocalizationsDe extends AppLocalizations { @override String get setRegionScope_noPath => 'No stored path'; + @override + String setRegionScope_banner(String name) { + return 'Messages ride region $name'; + } + + @override + String get setRegionScope_bannerDismiss => 'Dismiss'; + @override String get storage_title => 'Storage'; diff --git a/lib/l10n/app_localizations_en.dart b/lib/l10n/app_localizations_en.dart index 54adcf25..c48a6919 100644 --- a/lib/l10n/app_localizations_en.dart +++ b/lib/l10n/app_localizations_en.dart @@ -6089,6 +6089,14 @@ class AppLocalizationsEn extends AppLocalizations { @override String get setRegionScope_noPath => 'No stored path'; + @override + String setRegionScope_banner(String name) { + return 'Messages ride region $name'; + } + + @override + String get setRegionScope_bannerDismiss => 'Dismiss'; + @override String get storage_title => 'Storage'; diff --git a/lib/l10n/app_localizations_es.dart b/lib/l10n/app_localizations_es.dart index 8fb118fe..d21093f6 100644 --- a/lib/l10n/app_localizations_es.dart +++ b/lib/l10n/app_localizations_es.dart @@ -6171,6 +6171,14 @@ class AppLocalizationsEs extends AppLocalizations { @override String get setRegionScope_noPath => 'No stored path'; + @override + String setRegionScope_banner(String name) { + return 'Messages ride region $name'; + } + + @override + String get setRegionScope_bannerDismiss => 'Dismiss'; + @override String get storage_title => 'Storage'; diff --git a/lib/l10n/app_localizations_fr.dart b/lib/l10n/app_localizations_fr.dart index b75f967e..60243406 100644 --- a/lib/l10n/app_localizations_fr.dart +++ b/lib/l10n/app_localizations_fr.dart @@ -6199,6 +6199,14 @@ class AppLocalizationsFr extends AppLocalizations { @override String get setRegionScope_noPath => 'No stored path'; + @override + String setRegionScope_banner(String name) { + return 'Messages ride region $name'; + } + + @override + String get setRegionScope_bannerDismiss => 'Dismiss'; + @override String get storage_title => 'Storage'; diff --git a/lib/l10n/app_localizations_hu.dart b/lib/l10n/app_localizations_hu.dart index 69c78590..16b86c41 100644 --- a/lib/l10n/app_localizations_hu.dart +++ b/lib/l10n/app_localizations_hu.dart @@ -6188,6 +6188,14 @@ class AppLocalizationsHu extends AppLocalizations { @override String get setRegionScope_noPath => 'No stored path'; + @override + String setRegionScope_banner(String name) { + return 'Messages ride region $name'; + } + + @override + String get setRegionScope_bannerDismiss => 'Dismiss'; + @override String get storage_title => 'Storage'; diff --git a/lib/l10n/app_localizations_it.dart b/lib/l10n/app_localizations_it.dart index 25085cd6..67d9fce8 100644 --- a/lib/l10n/app_localizations_it.dart +++ b/lib/l10n/app_localizations_it.dart @@ -6176,6 +6176,14 @@ class AppLocalizationsIt extends AppLocalizations { @override String get setRegionScope_noPath => 'No stored path'; + @override + String setRegionScope_banner(String name) { + return 'Messages ride region $name'; + } + + @override + String get setRegionScope_bannerDismiss => 'Dismiss'; + @override String get storage_title => 'Storage'; diff --git a/lib/l10n/app_localizations_ja.dart b/lib/l10n/app_localizations_ja.dart index 4f53da4d..5cf7e921 100644 --- a/lib/l10n/app_localizations_ja.dart +++ b/lib/l10n/app_localizations_ja.dart @@ -5942,6 +5942,14 @@ class AppLocalizationsJa extends AppLocalizations { @override String get setRegionScope_noPath => 'No stored path'; + @override + String setRegionScope_banner(String name) { + return 'Messages ride region $name'; + } + + @override + String get setRegionScope_bannerDismiss => 'Dismiss'; + @override String get storage_title => 'Storage'; diff --git a/lib/l10n/app_localizations_ko.dart b/lib/l10n/app_localizations_ko.dart index dc0db894..92df42e1 100644 --- a/lib/l10n/app_localizations_ko.dart +++ b/lib/l10n/app_localizations_ko.dart @@ -5943,6 +5943,14 @@ class AppLocalizationsKo extends AppLocalizations { @override String get setRegionScope_noPath => 'No stored path'; + @override + String setRegionScope_banner(String name) { + return 'Messages ride region $name'; + } + + @override + String get setRegionScope_bannerDismiss => 'Dismiss'; + @override String get storage_title => 'Storage'; diff --git a/lib/l10n/app_localizations_nl.dart b/lib/l10n/app_localizations_nl.dart index e4951959..bc23f68b 100644 --- a/lib/l10n/app_localizations_nl.dart +++ b/lib/l10n/app_localizations_nl.dart @@ -6151,6 +6151,14 @@ class AppLocalizationsNl extends AppLocalizations { @override String get setRegionScope_noPath => 'No stored path'; + @override + String setRegionScope_banner(String name) { + return 'Messages ride region $name'; + } + + @override + String get setRegionScope_bannerDismiss => 'Dismiss'; + @override String get storage_title => 'Storage'; diff --git a/lib/l10n/app_localizations_pl.dart b/lib/l10n/app_localizations_pl.dart index 6ec02985..bf3fcad3 100644 --- a/lib/l10n/app_localizations_pl.dart +++ b/lib/l10n/app_localizations_pl.dart @@ -6188,6 +6188,14 @@ class AppLocalizationsPl extends AppLocalizations { @override String get setRegionScope_noPath => 'No stored path'; + @override + String setRegionScope_banner(String name) { + return 'Messages ride region $name'; + } + + @override + String get setRegionScope_bannerDismiss => 'Dismiss'; + @override String get storage_title => 'Storage'; diff --git a/lib/l10n/app_localizations_pt.dart b/lib/l10n/app_localizations_pt.dart index dc035a5e..ea6e17fe 100644 --- a/lib/l10n/app_localizations_pt.dart +++ b/lib/l10n/app_localizations_pt.dart @@ -6164,6 +6164,14 @@ class AppLocalizationsPt extends AppLocalizations { @override String get setRegionScope_noPath => 'No stored path'; + @override + String setRegionScope_banner(String name) { + return 'Messages ride region $name'; + } + + @override + String get setRegionScope_bannerDismiss => 'Dismiss'; + @override String get storage_title => 'Storage'; diff --git a/lib/l10n/app_localizations_ru.dart b/lib/l10n/app_localizations_ru.dart index b21c70a2..a784f57e 100644 --- a/lib/l10n/app_localizations_ru.dart +++ b/lib/l10n/app_localizations_ru.dart @@ -6182,6 +6182,14 @@ class AppLocalizationsRu extends AppLocalizations { @override String get setRegionScope_noPath => 'No stored path'; + @override + String setRegionScope_banner(String name) { + return 'Messages ride region $name'; + } + + @override + String get setRegionScope_bannerDismiss => 'Dismiss'; + @override String get storage_title => 'Storage'; diff --git a/lib/l10n/app_localizations_sk.dart b/lib/l10n/app_localizations_sk.dart index d00f0676..ce471d75 100644 --- a/lib/l10n/app_localizations_sk.dart +++ b/lib/l10n/app_localizations_sk.dart @@ -6148,6 +6148,14 @@ class AppLocalizationsSk extends AppLocalizations { @override String get setRegionScope_noPath => 'No stored path'; + @override + String setRegionScope_banner(String name) { + return 'Messages ride region $name'; + } + + @override + String get setRegionScope_bannerDismiss => 'Dismiss'; + @override String get storage_title => 'Storage'; diff --git a/lib/l10n/app_localizations_sl.dart b/lib/l10n/app_localizations_sl.dart index cd9a894c..e76cc7e6 100644 --- a/lib/l10n/app_localizations_sl.dart +++ b/lib/l10n/app_localizations_sl.dart @@ -6146,6 +6146,14 @@ class AppLocalizationsSl extends AppLocalizations { @override String get setRegionScope_noPath => 'No stored path'; + @override + String setRegionScope_banner(String name) { + return 'Messages ride region $name'; + } + + @override + String get setRegionScope_bannerDismiss => 'Dismiss'; + @override String get storage_title => 'Storage'; diff --git a/lib/l10n/app_localizations_sv.dart b/lib/l10n/app_localizations_sv.dart index ce3fa467..34a51612 100644 --- a/lib/l10n/app_localizations_sv.dart +++ b/lib/l10n/app_localizations_sv.dart @@ -6121,6 +6121,14 @@ class AppLocalizationsSv extends AppLocalizations { @override String get setRegionScope_noPath => 'No stored path'; + @override + String setRegionScope_banner(String name) { + return 'Messages ride region $name'; + } + + @override + String get setRegionScope_bannerDismiss => 'Dismiss'; + @override String get storage_title => 'Storage'; diff --git a/lib/l10n/app_localizations_uk.dart b/lib/l10n/app_localizations_uk.dart index c1a47733..a53b70cf 100644 --- a/lib/l10n/app_localizations_uk.dart +++ b/lib/l10n/app_localizations_uk.dart @@ -6183,6 +6183,14 @@ class AppLocalizationsUk extends AppLocalizations { @override String get setRegionScope_noPath => 'No stored path'; + @override + String setRegionScope_banner(String name) { + return 'Messages ride region $name'; + } + + @override + String get setRegionScope_bannerDismiss => 'Dismiss'; + @override String get storage_title => 'Storage'; diff --git a/lib/l10n/app_localizations_zh.dart b/lib/l10n/app_localizations_zh.dart index 49704140..c1ac45a0 100644 --- a/lib/l10n/app_localizations_zh.dart +++ b/lib/l10n/app_localizations_zh.dart @@ -5816,6 +5816,14 @@ class AppLocalizationsZh extends AppLocalizations { @override String get setRegionScope_noPath => 'No stored path'; + @override + String setRegionScope_banner(String name) { + return 'Messages ride region $name'; + } + + @override + String get setRegionScope_bannerDismiss => 'Dismiss'; + @override String get storage_title => 'Storage'; diff --git a/lib/main.dart b/lib/main.dart index 3e1e0191..177a5878 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -22,6 +22,7 @@ import 'services/notification_service.dart'; import 'services/ble_debug_log_service.dart'; import 'services/app_debug_log_service.dart'; import 'services/app_exit_info_service.dart'; +import 'services/region_scope_banner_service.dart'; import 'services/failure_monitor.dart'; import 'services/file_log_service.dart'; import 'services/background_service.dart'; @@ -352,6 +353,7 @@ class MeshCoreApp extends StatelessWidget { ChangeNotifierProvider.value(value: blockService), ChangeNotifierProvider.value(value: radioPresetService), ChangeNotifierProvider(create: (_) => ObserverConfigService(connector)), + ChangeNotifierProvider(create: (_) => RegionScopeBannerService()), ], child: Consumer( builder: (context, settingsService, child) { diff --git a/lib/screens/channel_chat_screen.dart b/lib/screens/channel_chat_screen.dart index 0740de3c..e88bf0c0 100644 --- a/lib/screens/channel_chat_screen.dart +++ b/lib/screens/channel_chat_screen.dart @@ -30,7 +30,9 @@ import '../models/app_settings.dart'; import '../services/app_settings_service.dart'; import '../services/corescope_service.dart'; import '../services/region_discovery_service.dart'; +import '../services/region_scope_banner_service.dart'; import '../widgets/channel_region_scope_dialog.dart'; +import '../widgets/region_scope_banner.dart'; import '../widgets/channel_notify_mode.dart'; import '../widgets/contact_add_feedback.dart'; import '../widgets/radio_channel_notify.dart'; @@ -97,6 +99,11 @@ class _ChannelChatScreenState extends State { bool _channelSkipNextBottomSnap = false; String? _unreadDividerMessageId; + /// The current channel's region scope name (#1258), null when unscoped or the + /// firmware does not support region scope. Loaded on activate and after the + /// Set Region Scope dialog. + String? _regionScope; + String? _cachedFormatLocale; late DateFormat _hmFormat; late DateFormat _mdFormat; @@ -131,6 +138,7 @@ class _ChannelChatScreenState extends State { }); connector.setActiveChannel(_currentChannel.index); _connector = connector; + _loadRegionScope(); if (anchor != null && settings.jumpToOldestUnread) { _channelSkipNextBottomSnap = true; @@ -148,6 +156,20 @@ class _ChannelChatScreenState extends State { } } + /// Load the current channel's region scope for the banner (#1258). Null when + /// the firmware does not support region scope, so the banner stays hidden. + Future _loadRegionScope() async { + final connector = context.read(); + if (!connector.supportsRegionScope) { + if (mounted && _regionScope != null) { + setState(() => _regionScope = null); + } + return; + } + final scope = await connector.channelRegionScope(_currentChannel.index); + if (mounted) setState(() => _regionScope = scope); + } + // TODO: Reload communities when returning from another screen Future _loadCommunities() async { final connector = context.read(); @@ -383,6 +405,7 @@ class _ChannelChatScreenState extends State { ), ); service.dispose(); + _loadRegionScope(); // the scope may have changed; refresh the banner (#1258) } /// Switch to another channel picked from the nav panel. @@ -587,6 +610,18 @@ class _ChannelChatScreenState extends State { top: false, child: Column( children: [ + Consumer( + builder: (context, bannerSvc, _) { + final scope = _regionScope; + final pskHex = _currentChannel.pskHex; + final show = scope != null && !bannerSvc.isDismissed(pskHex); + return RegionScopeBanner( + regionName: show ? scope : null, + onTap: _openRegionScopeDialog, + onDismiss: () => bannerSvc.dismiss(pskHex), + ); + }, + ), Expanded( // A touch outside a text field does not dismiss the keyboard on // mobile, and the keyboard hides the bottom bar (#1052). diff --git a/lib/services/region_scope_banner_service.dart b/lib/services/region_scope_banner_service.dart new file mode 100644 index 00000000..48faf38b --- /dev/null +++ b/lib/services/region_scope_banner_service.dart @@ -0,0 +1,15 @@ +import 'package:flutter/foundation.dart'; + +/// Tracks which region-scoped channels have had their banner dismissed, for the +/// current app session only. Keyed by channel PSK hex, held in memory, so a +/// dismissal lasts until the app is closed and the banner returns on a fresh +/// open (#1258). Not persisted. +class RegionScopeBannerService extends ChangeNotifier { + final Set _dismissed = {}; + + bool isDismissed(String channelPskHex) => _dismissed.contains(channelPskHex); + + void dismiss(String channelPskHex) { + if (_dismissed.add(channelPskHex)) notifyListeners(); + } +} diff --git a/lib/widgets/region_scope_banner.dart b/lib/widgets/region_scope_banner.dart new file mode 100644 index 00000000..0499b092 --- /dev/null +++ b/lib/widgets/region_scope_banner.dart @@ -0,0 +1,62 @@ +import 'package:flutter/material.dart'; + +import '../l10n/l10n.dart'; + +/// A banner at the top of a region-scoped channel chat reminding the user that +/// the channel's messages ride a region. Tapping it opens Set Region Scope so +/// the user can change or clear the scope; the close button dismisses it for the +/// session. Renders nothing when [regionName] is null (unscoped or dismissed). +/// (#1258) +class RegionScopeBanner extends StatelessWidget { + const RegionScopeBanner({ + super.key, + required this.regionName, + required this.onTap, + required this.onDismiss, + }); + + final String? regionName; + final VoidCallback onTap; + final VoidCallback onDismiss; + + @override + Widget build(BuildContext context) { + final name = regionName; + if (name == null) return const SizedBox.shrink(); + final l10n = context.l10n; + final scheme = Theme.of(context).colorScheme; + return Material( + color: scheme.secondaryContainer, + child: InkWell( + key: const Key('regionScopeBannerBody'), + onTap: onTap, + child: Padding( + padding: const EdgeInsets.fromLTRB(16, 8, 8, 8), + child: Row( + children: [ + Icon( + Icons.travel_explore, + size: 20, + color: scheme.onSecondaryContainer, + ), + const SizedBox(width: 12), + Expanded( + child: Text( + l10n.setRegionScope_banner(name), + style: TextStyle(color: scheme.onSecondaryContainer), + ), + ), + IconButton( + key: const Key('regionScopeBannerDismiss'), + icon: const Icon(Icons.close, size: 20), + color: scheme.onSecondaryContainer, + tooltip: l10n.setRegionScope_bannerDismiss, + onPressed: onDismiss, + ), + ], + ), + ), + ), + ); + } +} diff --git a/test/screens/channel_chat_navigation_test.dart b/test/screens/channel_chat_navigation_test.dart index 1ed8d7da..a04a43e1 100644 --- a/test/screens/channel_chat_navigation_test.dart +++ b/test/screens/channel_chat_navigation_test.dart @@ -10,6 +10,7 @@ import 'package:meshcore_open/screens/channel_chat_screen.dart'; import 'package:meshcore_open/services/app_settings_service.dart'; import 'package:meshcore_open/services/block_service.dart'; import 'package:meshcore_open/services/chat_text_scale_service.dart'; +import 'package:meshcore_open/services/region_scope_banner_service.dart'; import 'package:meshcore_open/services/translation_service.dart'; import 'package:meshcore_open/services/ui_view_state_service.dart'; import 'package:meshcore_open/storage/drift/blob_store.dart'; @@ -54,6 +55,7 @@ void main() { ChangeNotifierProvider(create: (_) => ChatTextScaleService()), ChangeNotifierProvider(create: (_) => TranslationService(settings)), ChangeNotifierProvider(create: (_) => UiViewStateService()), + ChangeNotifierProvider(create: (_) => RegionScopeBannerService()), ], child: MaterialApp( navigatorKey: navKey, diff --git a/test/services/region_scope_banner_service_test.dart b/test/services/region_scope_banner_service_test.dart new file mode 100644 index 00000000..871c87bb --- /dev/null +++ b/test/services/region_scope_banner_service_test.dart @@ -0,0 +1,22 @@ +// Per-session dismissal of the region-scope banner, keyed by channel PSK (#1258). + +import 'package:flutter_test/flutter_test.dart'; +import 'package:meshcore_open/services/region_scope_banner_service.dart'; + +void main() { + test('a channel banner is not dismissed until dismissed', () { + final s = RegionScopeBannerService(); + expect(s.isDismissed('pska'), isFalse); + s.dismiss('pska'); + expect(s.isDismissed('pska'), isTrue); + expect(s.isDismissed('pskb'), isFalse); // other channels unaffected + }); + + test('dismiss notifies listeners so the banner can hide', () { + final s = RegionScopeBannerService(); + var notified = 0; + s.addListener(() => notified++); + s.dismiss('pska'); + expect(notified, 1); + }); +} diff --git a/test/widgets/region_scope_banner_test.dart b/test/widgets/region_scope_banner_test.dart new file mode 100644 index 00000000..cc7907d9 --- /dev/null +++ b/test/widgets/region_scope_banner_test.dart @@ -0,0 +1,56 @@ +// Region-scope banner on the channel chat (#1258). + +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:meshcore_open/l10n/app_localizations.dart'; +import 'package:meshcore_open/widgets/region_scope_banner.dart'; + +void main() { + Future pump( + WidgetTester tester, { + required String? regionName, + VoidCallback? onTap, + VoidCallback? onDismiss, + }) async { + await tester.pumpWidget( + MaterialApp( + localizationsDelegates: AppLocalizations.localizationsDelegates, + supportedLocales: AppLocalizations.supportedLocales, + home: Scaffold( + body: RegionScopeBanner( + regionName: regionName, + onTap: onTap ?? () {}, + onDismiss: onDismiss ?? () {}, + ), + ), + ), + ); + await tester.pumpAndSettle(); + } + + testWidgets('shows the scoped region name', (tester) async { + await pump(tester, regionName: 'cvg'); + expect(find.textContaining('cvg'), findsOneWidget); + }); + + testWidgets('tapping the banner opens Set Region Scope (onTap)', ( + tester, + ) async { + var taps = 0; + await pump(tester, regionName: 'cvg', onTap: () => taps++); + await tester.tap(find.byKey(const Key('regionScopeBannerBody'))); + expect(taps, 1); + }); + + testWidgets('tapping dismiss fires onDismiss', (tester) async { + var dismissed = 0; + await pump(tester, regionName: 'cvg', onDismiss: () => dismissed++); + await tester.tap(find.byKey(const Key('regionScopeBannerDismiss'))); + expect(dismissed, 1); + }); + + testWidgets('renders nothing when the channel is not scoped', (tester) async { + await pump(tester, regionName: null); + expect(find.byKey(const Key('regionScopeBannerBody')), findsNothing); + }); +} diff --git a/untranslated.json b/untranslated.json index 47cfb36d..782589fc 100644 --- a/untranslated.json +++ b/untranslated.json @@ -449,6 +449,8 @@ "setRegionScope_searchRepeaters", "setRegionScope_pathNote", "setRegionScope_noPath", + "setRegionScope_banner", + "setRegionScope_bannerDismiss", "storage_title", "storage_databaseSize", "storage_staleHint", @@ -916,6 +918,8 @@ "setRegionScope_searchRepeaters", "setRegionScope_pathNote", "setRegionScope_noPath", + "setRegionScope_banner", + "setRegionScope_bannerDismiss", "storage_title", "storage_databaseSize", "storage_staleHint", @@ -1383,6 +1387,8 @@ "setRegionScope_searchRepeaters", "setRegionScope_pathNote", "setRegionScope_noPath", + "setRegionScope_banner", + "setRegionScope_bannerDismiss", "storage_title", "storage_databaseSize", "storage_staleHint", @@ -1850,6 +1856,8 @@ "setRegionScope_searchRepeaters", "setRegionScope_pathNote", "setRegionScope_noPath", + "setRegionScope_banner", + "setRegionScope_bannerDismiss", "storage_title", "storage_databaseSize", "storage_staleHint", @@ -2317,6 +2325,8 @@ "setRegionScope_searchRepeaters", "setRegionScope_pathNote", "setRegionScope_noPath", + "setRegionScope_banner", + "setRegionScope_bannerDismiss", "storage_title", "storage_databaseSize", "storage_staleHint", @@ -2784,6 +2794,8 @@ "setRegionScope_searchRepeaters", "setRegionScope_pathNote", "setRegionScope_noPath", + "setRegionScope_banner", + "setRegionScope_bannerDismiss", "storage_title", "storage_databaseSize", "storage_staleHint", @@ -3251,6 +3263,8 @@ "setRegionScope_searchRepeaters", "setRegionScope_pathNote", "setRegionScope_noPath", + "setRegionScope_banner", + "setRegionScope_bannerDismiss", "storage_title", "storage_databaseSize", "storage_staleHint", @@ -3718,6 +3732,8 @@ "setRegionScope_searchRepeaters", "setRegionScope_pathNote", "setRegionScope_noPath", + "setRegionScope_banner", + "setRegionScope_bannerDismiss", "storage_title", "storage_databaseSize", "storage_staleHint", @@ -4185,6 +4201,8 @@ "setRegionScope_searchRepeaters", "setRegionScope_pathNote", "setRegionScope_noPath", + "setRegionScope_banner", + "setRegionScope_bannerDismiss", "storage_title", "storage_databaseSize", "storage_staleHint", @@ -4652,6 +4670,8 @@ "setRegionScope_searchRepeaters", "setRegionScope_pathNote", "setRegionScope_noPath", + "setRegionScope_banner", + "setRegionScope_bannerDismiss", "storage_title", "storage_databaseSize", "storage_staleHint", @@ -5119,6 +5139,8 @@ "setRegionScope_searchRepeaters", "setRegionScope_pathNote", "setRegionScope_noPath", + "setRegionScope_banner", + "setRegionScope_bannerDismiss", "storage_title", "storage_databaseSize", "storage_staleHint", @@ -5586,6 +5608,8 @@ "setRegionScope_searchRepeaters", "setRegionScope_pathNote", "setRegionScope_noPath", + "setRegionScope_banner", + "setRegionScope_bannerDismiss", "storage_title", "storage_databaseSize", "storage_staleHint", @@ -6053,6 +6077,8 @@ "setRegionScope_searchRepeaters", "setRegionScope_pathNote", "setRegionScope_noPath", + "setRegionScope_banner", + "setRegionScope_bannerDismiss", "storage_title", "storage_databaseSize", "storage_staleHint", @@ -6520,6 +6546,8 @@ "setRegionScope_searchRepeaters", "setRegionScope_pathNote", "setRegionScope_noPath", + "setRegionScope_banner", + "setRegionScope_bannerDismiss", "storage_title", "storage_databaseSize", "storage_staleHint", @@ -6987,6 +7015,8 @@ "setRegionScope_searchRepeaters", "setRegionScope_pathNote", "setRegionScope_noPath", + "setRegionScope_banner", + "setRegionScope_bannerDismiss", "storage_title", "storage_databaseSize", "storage_staleHint", @@ -7454,6 +7484,8 @@ "setRegionScope_searchRepeaters", "setRegionScope_pathNote", "setRegionScope_noPath", + "setRegionScope_banner", + "setRegionScope_bannerDismiss", "storage_title", "storage_databaseSize", "storage_staleHint", @@ -7921,6 +7953,8 @@ "setRegionScope_searchRepeaters", "setRegionScope_pathNote", "setRegionScope_noPath", + "setRegionScope_banner", + "setRegionScope_bannerDismiss", "storage_title", "storage_databaseSize", "storage_staleHint",