rollback-pr review

This commit is contained in:
PacoX
2026-05-17 17:44:30 +02:00
parent d66b16a4e8
commit 23f29f2cda
6 changed files with 60 additions and 141 deletions
+13 -12
View File
@@ -45,16 +45,16 @@ class ChannelMessagePathScreen extends StatelessWidget {
final hasHopDetails = primaryPath.isNotEmpty;
// Convert path byte length to hop count based on device width
final width = primaryPath.isNotEmpty
? PathHelper.detectPathHashWidth(primaryPath, fallback: connector.pathHashByteWidth)
: connector.pathHashByteWidth.clamp(1, 4);
final width = connector.pathHashByteWidth.clamp(1, 4);
final observedHopCount = _hopCountFromBytes(primaryPath.length, width);
final reportedHopCount = message.pathLength == null
? null
: (message.pathLength! < 0
? message.pathLength
: _hopCountFromBytes(message.pathLength!, width));
final effectiveHopCount = observedHopCount > 0 ? observedHopCount : reportedHopCount;
? message.pathLength
: _hopCountFromBytes(message.pathLength!, width));
final effectiveHopCount = observedHopCount > 0
? observedHopCount
: reportedHopCount;
final observedLabel = _formatObservedHops(
observedHopCount,
@@ -76,11 +76,11 @@ class ChannelMessagePathScreen extends StatelessWidget {
title: context.l10n.contacts_repeaterPathTrace,
path: primaryPath,
flipPathAround: true,
reversePathAround: !(!channelMessage && !message.isOutgoing),
pathHashByteWidth: PathHelper.detectPathHashWidth(
primaryPath,
fallback: context.read<MeshCoreConnector>().pathHashByteWidth,
),
reversePathAround:
!(!channelMessage && !message.isOutgoing),
pathHashByteWidth: context
.read<MeshCoreConnector>()
.pathHashByteWidth,
),
),
),
@@ -951,7 +951,8 @@ List<_PathHop> _buildPathHops(
AppLocalizations l10n,
) {
if (pathBytes.isEmpty) return const [];
final width = PathHelper.detectPathHashWidth(pathBytes, fallback: connector.pathHashByteWidth);
final width = connector.pathHashByteWidth.clamp(1, 4);
final candidatesByHashBytes = <String, List<Contact>>{};
final allContacts = connector.allContacts;