From f516163614f24c7e6a9c0036299852375ea463a1 Mon Sep 17 00:00:00 2001 From: Strycher Date: Sun, 19 Jul 2026 05:07:06 -0400 Subject: [PATCH] feat(#295): surface the active radio data scope in Device Info Stores are keyed by the first 10 hex of the connected radio's public key, so connecting a different radio silently swaps which contacts, channels, and history you are viewing with nothing in the UI saying so. Device Info showed the full public key but never tied it to storage. Adds a Data scope row with the key actually in effect, plus a one-line explanation. Co-Authored-By: Claude Opus 4.8 --- lib/l10n/app_en.arb | 2 ++ lib/l10n/app_localizations.dart | 12 +++++++++++ lib/l10n/app_localizations_bg.dart | 7 ++++++ lib/l10n/app_localizations_de.dart | 7 ++++++ lib/l10n/app_localizations_en.dart | 7 ++++++ lib/l10n/app_localizations_es.dart | 7 ++++++ lib/l10n/app_localizations_fr.dart | 7 ++++++ lib/l10n/app_localizations_hu.dart | 7 ++++++ lib/l10n/app_localizations_it.dart | 7 ++++++ lib/l10n/app_localizations_ja.dart | 7 ++++++ lib/l10n/app_localizations_ko.dart | 7 ++++++ lib/l10n/app_localizations_nl.dart | 7 ++++++ lib/l10n/app_localizations_pl.dart | 7 ++++++ lib/l10n/app_localizations_pt.dart | 7 ++++++ lib/l10n/app_localizations_ru.dart | 7 ++++++ lib/l10n/app_localizations_sk.dart | 7 ++++++ lib/l10n/app_localizations_sl.dart | 7 ++++++ lib/l10n/app_localizations_sv.dart | 7 ++++++ lib/l10n/app_localizations_uk.dart | 7 ++++++ lib/l10n/app_localizations_zh.dart | 7 ++++++ lib/screens/settings_screen.dart | 27 +++++++++++++++++++++++- untranslated.json | 34 ++++++++++++++++++++++++++++++ 22 files changed, 200 insertions(+), 1 deletion(-) diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index 2c3ba6a5..e27f1a88 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -239,6 +239,8 @@ "settings_infoOffbandCaps": "Offband capabilities", "settings_infoBattery": "Battery", "settings_infoPublicKey": "Public Key", + "settings_infoDataScope": "Data scope", + "settings_infoDataScopeSubtitle": "Messages, contacts, and channels are stored per radio under this key", "settings_publicKeyCopied": "Public key copied", "settings_infoContactsCount": "Contacts Count", "settings_infoChannelCount": "Channel Count", diff --git a/lib/l10n/app_localizations.dart b/lib/l10n/app_localizations.dart index dc5b2f54..c488d298 100644 --- a/lib/l10n/app_localizations.dart +++ b/lib/l10n/app_localizations.dart @@ -1192,6 +1192,18 @@ abstract class AppLocalizations { /// **'Public Key'** String get settings_infoPublicKey; + /// No description provided for @settings_infoDataScope. + /// + /// In en, this message translates to: + /// **'Data scope'** + String get settings_infoDataScope; + + /// No description provided for @settings_infoDataScopeSubtitle. + /// + /// In en, this message translates to: + /// **'Messages, contacts, and channels are stored per radio under this key'** + String get settings_infoDataScopeSubtitle; + /// No description provided for @settings_publicKeyCopied. /// /// In en, this message translates to: diff --git a/lib/l10n/app_localizations_bg.dart b/lib/l10n/app_localizations_bg.dart index 1947f9ac..074e4590 100644 --- a/lib/l10n/app_localizations_bg.dart +++ b/lib/l10n/app_localizations_bg.dart @@ -599,6 +599,13 @@ class AppLocalizationsBg extends AppLocalizations { @override String get settings_infoPublicKey => 'Общ публичен ключ'; + @override + String get settings_infoDataScope => 'Data scope'; + + @override + String get settings_infoDataScopeSubtitle => + 'Messages, contacts, and channels are stored per radio under this key'; + @override String get settings_publicKeyCopied => 'Public key copied'; diff --git a/lib/l10n/app_localizations_de.dart b/lib/l10n/app_localizations_de.dart index 78edf423..5c9c312d 100644 --- a/lib/l10n/app_localizations_de.dart +++ b/lib/l10n/app_localizations_de.dart @@ -594,6 +594,13 @@ class AppLocalizationsDe extends AppLocalizations { @override String get settings_infoPublicKey => 'Öffentlicher Schlüssel'; + @override + String get settings_infoDataScope => 'Data scope'; + + @override + String get settings_infoDataScopeSubtitle => + 'Messages, contacts, and channels are stored per radio under this key'; + @override String get settings_publicKeyCopied => 'Public key copied'; diff --git a/lib/l10n/app_localizations_en.dart b/lib/l10n/app_localizations_en.dart index de46a900..308645f2 100644 --- a/lib/l10n/app_localizations_en.dart +++ b/lib/l10n/app_localizations_en.dart @@ -584,6 +584,13 @@ class AppLocalizationsEn extends AppLocalizations { @override String get settings_infoPublicKey => 'Public Key'; + @override + String get settings_infoDataScope => 'Data scope'; + + @override + String get settings_infoDataScopeSubtitle => + 'Messages, contacts, and channels are stored per radio under this key'; + @override String get settings_publicKeyCopied => 'Public key copied'; diff --git a/lib/l10n/app_localizations_es.dart b/lib/l10n/app_localizations_es.dart index aecb9c45..8d5c34b2 100644 --- a/lib/l10n/app_localizations_es.dart +++ b/lib/l10n/app_localizations_es.dart @@ -595,6 +595,13 @@ class AppLocalizationsEs extends AppLocalizations { @override String get settings_infoPublicKey => 'Clave Pública'; + @override + String get settings_infoDataScope => 'Data scope'; + + @override + String get settings_infoDataScopeSubtitle => + 'Messages, contacts, and channels are stored per radio under this key'; + @override String get settings_publicKeyCopied => 'Public key copied'; diff --git a/lib/l10n/app_localizations_fr.dart b/lib/l10n/app_localizations_fr.dart index 5c0dc85e..89071b84 100644 --- a/lib/l10n/app_localizations_fr.dart +++ b/lib/l10n/app_localizations_fr.dart @@ -599,6 +599,13 @@ class AppLocalizationsFr extends AppLocalizations { @override String get settings_infoPublicKey => 'Clé Publique'; + @override + String get settings_infoDataScope => 'Data scope'; + + @override + String get settings_infoDataScopeSubtitle => + 'Messages, contacts, and channels are stored per radio under this key'; + @override String get settings_publicKeyCopied => 'Public key copied'; diff --git a/lib/l10n/app_localizations_hu.dart b/lib/l10n/app_localizations_hu.dart index 548c17e1..20569f8b 100644 --- a/lib/l10n/app_localizations_hu.dart +++ b/lib/l10n/app_localizations_hu.dart @@ -597,6 +597,13 @@ class AppLocalizationsHu extends AppLocalizations { @override String get settings_infoPublicKey => 'Nyelvkönyv'; + @override + String get settings_infoDataScope => 'Data scope'; + + @override + String get settings_infoDataScopeSubtitle => + 'Messages, contacts, and channels are stored per radio under this key'; + @override String get settings_publicKeyCopied => 'Public key copied'; diff --git a/lib/l10n/app_localizations_it.dart b/lib/l10n/app_localizations_it.dart index b095a574..09a3bac6 100644 --- a/lib/l10n/app_localizations_it.dart +++ b/lib/l10n/app_localizations_it.dart @@ -597,6 +597,13 @@ class AppLocalizationsIt extends AppLocalizations { @override String get settings_infoPublicKey => 'Chiave Pubblica'; + @override + String get settings_infoDataScope => 'Data scope'; + + @override + String get settings_infoDataScopeSubtitle => + 'Messages, contacts, and channels are stored per radio under this key'; + @override String get settings_publicKeyCopied => 'Public key copied'; diff --git a/lib/l10n/app_localizations_ja.dart b/lib/l10n/app_localizations_ja.dart index cd68df0d..8e0cedfe 100644 --- a/lib/l10n/app_localizations_ja.dart +++ b/lib/l10n/app_localizations_ja.dart @@ -570,6 +570,13 @@ class AppLocalizationsJa extends AppLocalizations { @override String get settings_infoPublicKey => '公開鍵'; + @override + String get settings_infoDataScope => 'Data scope'; + + @override + String get settings_infoDataScopeSubtitle => + 'Messages, contacts, and channels are stored per radio under this key'; + @override String get settings_publicKeyCopied => 'Public key copied'; diff --git a/lib/l10n/app_localizations_ko.dart b/lib/l10n/app_localizations_ko.dart index d1d87625..6600a527 100644 --- a/lib/l10n/app_localizations_ko.dart +++ b/lib/l10n/app_localizations_ko.dart @@ -570,6 +570,13 @@ class AppLocalizationsKo extends AppLocalizations { @override String get settings_infoPublicKey => '공개 키'; + @override + String get settings_infoDataScope => 'Data scope'; + + @override + String get settings_infoDataScopeSubtitle => + 'Messages, contacts, and channels are stored per radio under this key'; + @override String get settings_publicKeyCopied => 'Public key copied'; diff --git a/lib/l10n/app_localizations_nl.dart b/lib/l10n/app_localizations_nl.dart index 99ffb6e4..876564e2 100644 --- a/lib/l10n/app_localizations_nl.dart +++ b/lib/l10n/app_localizations_nl.dart @@ -591,6 +591,13 @@ class AppLocalizationsNl extends AppLocalizations { @override String get settings_infoPublicKey => 'Openbare Sleutel'; + @override + String get settings_infoDataScope => 'Data scope'; + + @override + String get settings_infoDataScopeSubtitle => + 'Messages, contacts, and channels are stored per radio under this key'; + @override String get settings_publicKeyCopied => 'Public key copied'; diff --git a/lib/l10n/app_localizations_pl.dart b/lib/l10n/app_localizations_pl.dart index 125f62ca..d2ab176f 100644 --- a/lib/l10n/app_localizations_pl.dart +++ b/lib/l10n/app_localizations_pl.dart @@ -599,6 +599,13 @@ class AppLocalizationsPl extends AppLocalizations { @override String get settings_infoPublicKey => 'Klucz Publiczny'; + @override + String get settings_infoDataScope => 'Data scope'; + + @override + String get settings_infoDataScopeSubtitle => + 'Messages, contacts, and channels are stored per radio under this key'; + @override String get settings_publicKeyCopied => 'Public key copied'; diff --git a/lib/l10n/app_localizations_pt.dart b/lib/l10n/app_localizations_pt.dart index 3d2a5ccd..fe03cdcc 100644 --- a/lib/l10n/app_localizations_pt.dart +++ b/lib/l10n/app_localizations_pt.dart @@ -597,6 +597,13 @@ class AppLocalizationsPt extends AppLocalizations { @override String get settings_infoPublicKey => 'Chave Pública'; + @override + String get settings_infoDataScope => 'Data scope'; + + @override + String get settings_infoDataScopeSubtitle => + 'Messages, contacts, and channels are stored per radio under this key'; + @override String get settings_publicKeyCopied => 'Public key copied'; diff --git a/lib/l10n/app_localizations_ru.dart b/lib/l10n/app_localizations_ru.dart index 262fec1d..7bb86181 100644 --- a/lib/l10n/app_localizations_ru.dart +++ b/lib/l10n/app_localizations_ru.dart @@ -596,6 +596,13 @@ class AppLocalizationsRu extends AppLocalizations { @override String get settings_infoPublicKey => 'Публичный ключ'; + @override + String get settings_infoDataScope => 'Data scope'; + + @override + String get settings_infoDataScopeSubtitle => + 'Messages, contacts, and channels are stored per radio under this key'; + @override String get settings_publicKeyCopied => 'Public key copied'; diff --git a/lib/l10n/app_localizations_sk.dart b/lib/l10n/app_localizations_sk.dart index c31de4c3..241d1ff9 100644 --- a/lib/l10n/app_localizations_sk.dart +++ b/lib/l10n/app_localizations_sk.dart @@ -591,6 +591,13 @@ class AppLocalizationsSk extends AppLocalizations { @override String get settings_infoPublicKey => 'Verejný kľúč'; + @override + String get settings_infoDataScope => 'Data scope'; + + @override + String get settings_infoDataScopeSubtitle => + 'Messages, contacts, and channels are stored per radio under this key'; + @override String get settings_publicKeyCopied => 'Public key copied'; diff --git a/lib/l10n/app_localizations_sl.dart b/lib/l10n/app_localizations_sl.dart index 41fd7644..663ee17f 100644 --- a/lib/l10n/app_localizations_sl.dart +++ b/lib/l10n/app_localizations_sl.dart @@ -588,6 +588,13 @@ class AppLocalizationsSl extends AppLocalizations { @override String get settings_infoPublicKey => 'Javni ključ'; + @override + String get settings_infoDataScope => 'Data scope'; + + @override + String get settings_infoDataScopeSubtitle => + 'Messages, contacts, and channels are stored per radio under this key'; + @override String get settings_publicKeyCopied => 'Public key copied'; diff --git a/lib/l10n/app_localizations_sv.dart b/lib/l10n/app_localizations_sv.dart index af3fc36f..8c1a8c12 100644 --- a/lib/l10n/app_localizations_sv.dart +++ b/lib/l10n/app_localizations_sv.dart @@ -586,6 +586,13 @@ class AppLocalizationsSv extends AppLocalizations { @override String get settings_infoPublicKey => 'Allmänt nyckel'; + @override + String get settings_infoDataScope => 'Data scope'; + + @override + String get settings_infoDataScopeSubtitle => + 'Messages, contacts, and channels are stored per radio under this key'; + @override String get settings_publicKeyCopied => 'Public key copied'; diff --git a/lib/l10n/app_localizations_uk.dart b/lib/l10n/app_localizations_uk.dart index fc9845a6..eed89948 100644 --- a/lib/l10n/app_localizations_uk.dart +++ b/lib/l10n/app_localizations_uk.dart @@ -594,6 +594,13 @@ class AppLocalizationsUk extends AppLocalizations { @override String get settings_infoPublicKey => 'Відкритий ключ'; + @override + String get settings_infoDataScope => 'Data scope'; + + @override + String get settings_infoDataScopeSubtitle => + 'Messages, contacts, and channels are stored per radio under this key'; + @override String get settings_publicKeyCopied => 'Public key copied'; diff --git a/lib/l10n/app_localizations_zh.dart b/lib/l10n/app_localizations_zh.dart index c1b4d100..2dd550c8 100644 --- a/lib/l10n/app_localizations_zh.dart +++ b/lib/l10n/app_localizations_zh.dart @@ -562,6 +562,13 @@ class AppLocalizationsZh extends AppLocalizations { @override String get settings_infoPublicKey => '公钥'; + @override + String get settings_infoDataScope => 'Data scope'; + + @override + String get settings_infoDataScopeSubtitle => + 'Messages, contacts, and channels are stored per radio under this key'; + @override String get settings_publicKeyCopied => 'Public key copied'; diff --git a/lib/screens/settings_screen.dart b/lib/screens/settings_screen.dart index 4eaebc12..75764e47 100644 --- a/lib/screens/settings_screen.dart +++ b/lib/screens/settings_screen.dart @@ -418,12 +418,37 @@ class _SettingsScreenState extends State { _buildBatteryInfoRow(context, connector), if (connector.selfName != null) _buildInfoRow(l10n.settings_nodeName, connector.selfName!), - if (connector.selfPublicKey != null) + if (connector.selfPublicKey != null) ...[ _buildInfoRow( l10n.settings_infoPublicKey, pubKeyToHex(connector.selfPublicKey!), copyValue: pubKeyToHex(connector.selfPublicKey!), ), + // #295: stores are keyed by the first 10 hex of the connected + // radio's public key, so switching radios silently swaps which + // history you are looking at. Surface the key that is in effect. + ...() { + final hex = pubKeyToHex(connector.selfPublicKey!); + final scope = hex.length > 10 ? hex.substring(0, 10) : hex; + if (scope.isEmpty) return []; + return [ + _buildInfoRow( + l10n.settings_infoDataScope, + scope, + copyValue: scope, + ), + Padding( + padding: const EdgeInsets.only(bottom: 4), + child: Text( + l10n.settings_infoDataScopeSubtitle, + style: Theme.of(context).textTheme.bodySmall?.copyWith( + color: Theme.of(context).colorScheme.onSurfaceVariant, + ), + ), + ), + ]; + }(), + ], _buildInfoRow( l10n.settings_infoContactsCount, '${connector.contacts.length}', diff --git a/untranslated.json b/untranslated.json index c6bcee5e..eb27db7b 100644 --- a/untranslated.json +++ b/untranslated.json @@ -15,6 +15,8 @@ "settings_infoFirmware", "settings_infoModel", "settings_infoOffbandCaps", + "settings_infoDataScope", + "settings_infoDataScopeSubtitle", "settings_publicKeyCopied", "settings_femLna", "settings_femLnaSubtitle", @@ -78,6 +80,8 @@ "settings_infoFirmware", "settings_infoModel", "settings_infoOffbandCaps", + "settings_infoDataScope", + "settings_infoDataScopeSubtitle", "settings_publicKeyCopied", "settings_femLna", "settings_femLnaSubtitle", @@ -141,6 +145,8 @@ "settings_infoFirmware", "settings_infoModel", "settings_infoOffbandCaps", + "settings_infoDataScope", + "settings_infoDataScopeSubtitle", "settings_publicKeyCopied", "settings_femLna", "settings_femLnaSubtitle", @@ -204,6 +210,8 @@ "settings_infoFirmware", "settings_infoModel", "settings_infoOffbandCaps", + "settings_infoDataScope", + "settings_infoDataScopeSubtitle", "settings_publicKeyCopied", "settings_femLna", "settings_femLnaSubtitle", @@ -267,6 +275,8 @@ "settings_infoFirmware", "settings_infoModel", "settings_infoOffbandCaps", + "settings_infoDataScope", + "settings_infoDataScopeSubtitle", "settings_publicKeyCopied", "settings_femLna", "settings_femLnaSubtitle", @@ -330,6 +340,8 @@ "settings_infoFirmware", "settings_infoModel", "settings_infoOffbandCaps", + "settings_infoDataScope", + "settings_infoDataScopeSubtitle", "settings_publicKeyCopied", "settings_femLna", "settings_femLnaSubtitle", @@ -393,6 +405,8 @@ "settings_infoFirmware", "settings_infoModel", "settings_infoOffbandCaps", + "settings_infoDataScope", + "settings_infoDataScopeSubtitle", "settings_publicKeyCopied", "settings_femLna", "settings_femLnaSubtitle", @@ -456,6 +470,8 @@ "settings_infoFirmware", "settings_infoModel", "settings_infoOffbandCaps", + "settings_infoDataScope", + "settings_infoDataScopeSubtitle", "settings_publicKeyCopied", "settings_femLna", "settings_femLnaSubtitle", @@ -519,6 +535,8 @@ "settings_infoFirmware", "settings_infoModel", "settings_infoOffbandCaps", + "settings_infoDataScope", + "settings_infoDataScopeSubtitle", "settings_publicKeyCopied", "settings_femLna", "settings_femLnaSubtitle", @@ -582,6 +600,8 @@ "settings_infoFirmware", "settings_infoModel", "settings_infoOffbandCaps", + "settings_infoDataScope", + "settings_infoDataScopeSubtitle", "settings_publicKeyCopied", "settings_femLna", "settings_femLnaSubtitle", @@ -645,6 +665,8 @@ "settings_infoFirmware", "settings_infoModel", "settings_infoOffbandCaps", + "settings_infoDataScope", + "settings_infoDataScopeSubtitle", "settings_publicKeyCopied", "settings_femLna", "settings_femLnaSubtitle", @@ -708,6 +730,8 @@ "settings_infoFirmware", "settings_infoModel", "settings_infoOffbandCaps", + "settings_infoDataScope", + "settings_infoDataScopeSubtitle", "settings_publicKeyCopied", "settings_femLna", "settings_femLnaSubtitle", @@ -771,6 +795,8 @@ "settings_infoFirmware", "settings_infoModel", "settings_infoOffbandCaps", + "settings_infoDataScope", + "settings_infoDataScopeSubtitle", "settings_publicKeyCopied", "settings_femLna", "settings_femLnaSubtitle", @@ -834,6 +860,8 @@ "settings_infoFirmware", "settings_infoModel", "settings_infoOffbandCaps", + "settings_infoDataScope", + "settings_infoDataScopeSubtitle", "settings_publicKeyCopied", "settings_femLna", "settings_femLnaSubtitle", @@ -897,6 +925,8 @@ "settings_infoFirmware", "settings_infoModel", "settings_infoOffbandCaps", + "settings_infoDataScope", + "settings_infoDataScopeSubtitle", "settings_publicKeyCopied", "settings_femLna", "settings_femLnaSubtitle", @@ -960,6 +990,8 @@ "settings_infoFirmware", "settings_infoModel", "settings_infoOffbandCaps", + "settings_infoDataScope", + "settings_infoDataScopeSubtitle", "settings_publicKeyCopied", "settings_femLna", "settings_femLnaSubtitle", @@ -1023,6 +1055,8 @@ "settings_infoFirmware", "settings_infoModel", "settings_infoOffbandCaps", + "settings_infoDataScope", + "settings_infoDataScopeSubtitle", "settings_publicKeyCopied", "settings_femLna", "settings_femLnaSubtitle",