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 <noreply@anthropic.com>
pull/419/head
Strycher 5 months ago
parent 4fd5f76a13
commit f516163614

@ -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",

@ -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:

@ -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';

@ -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';

@ -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';

@ -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';

@ -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';

@ -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';

@ -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';

@ -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';

@ -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';

@ -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';

@ -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';

@ -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';

@ -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';

@ -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';

@ -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';

@ -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';

@ -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';

@ -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';

@ -418,12 +418,37 @@ class _SettingsScreenState extends State<SettingsScreen> {
_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 <Widget>[];
return <Widget>[
_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}',

@ -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",

Loading…
Cancel
Save

Powered by TurnKey Linux.