From 711f0b58144cc44daf1ee8430fab16f16ccac556 Mon Sep 17 00:00:00 2001 From: Strycher Date: Mon, 29 Jun 2026 12:10:38 -0400 Subject: [PATCH] fix(#150): repeater trace adapts to its route (Path Trace when routed, Ping when direct) The repeater contact menu hardcoded "Ping" and always sent a target-only (direct) trace, so a multi-hop repeater offered a "Ping" that could never return. Mirror the room behavior: a repeater with a known route is labelled "Path Trace" and traced along that route (round-trip); only a direct neighbour (no path) shows "Ping" and pings directly. Bumps build to +48 for the b48 test binary. Co-Authored-By: Claude Opus 4.8 --- lib/screens/contacts_screen.dart | 25 +++++++++++++++++-------- pubspec.yaml | 2 +- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/lib/screens/contacts_screen.dart b/lib/screens/contacts_screen.dart index cf65969..97e47b1 100644 --- a/lib/screens/contacts_screen.dart +++ b/lib/screens/contacts_screen.dart @@ -1266,7 +1266,11 @@ class _ContactsScreenState extends State if (isRepeater) ...[ ListTile( leading: const Icon(Icons.radar, color: Colors.green), - title: Text(context.l10n.contacts_ping), + title: Text( + contact.pathBytesForDisplay.isNotEmpty + ? context.l10n.contacts_pathTrace + : context.l10n.contacts_ping, + ), onTap: () { final hw = context .read() @@ -1275,13 +1279,18 @@ class _ContactsScreenState extends State context, MaterialPageRoute( builder: (context) => PathTraceMapScreen( - title: context.l10n.contacts_repeaterPing, - path: Uint8List.fromList( - contact.publicKey.sublist( - 0, - PathHelper.traceHopBytes(hw), - ), - ), + title: contact.pathBytesForDisplay.isNotEmpty + ? context.l10n.contacts_repeaterPathTrace + : context.l10n.contacts_repeaterPing, + path: contact.pathBytesForDisplay.isNotEmpty + ? contact.pathBytesForDisplay + : Uint8List.fromList( + contact.publicKey.sublist( + 0, + PathHelper.traceHopBytes(hw), + ), + ), + flipPathAround: contact.pathBytesForDisplay.isNotEmpty, targetContact: contact, pathHashByteWidth: hw, ), diff --git a/pubspec.yaml b/pubspec.yaml index 29411b9..7df36fd 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 1.1.2-rc.1+47 +version: 1.1.2-rc.1+48 environment: sdk: ^3.9.2