Tester feedback: routing, bulk select, notifications, map crash
Routing - Auto routing picks routes by Thompson sampling over faded delivery stats (24 h half-life, capped evidence), weighted by what the radio currently hears; retries prefer a different route; last attempt floods. - Route failures are held until a message's fate is known, so an offline contact no longer wrecks its route history; failing routes are only deleted after a week without a delivery. - Direct (zero-hop) path is a rotation candidate (#643) and a new Direct mode in the routing sheet; history routes are used for repeater logins. - Remove the route-weight sliders the new chooser no longer uses. Chats - Bulk selection in channel chats (spam / not spam / delete / copy) and in the Filtered messages list. - Tapping a search result jumps to the message. - Swipe-to-reply ignores vertical scrolls. - Active conversation follows route lifecycle, so covered chats count unread again. Notifications - Tapping a notification opens its conversation. - Per-conversation coalescing and one alert per queued-message sync. - Monochrome status-bar icon; background service stops when the app is swiped away; stale notifications cleared on radio or slot change. Other - Online map: opaque links and painted dots for dense areas to avoid an Impeller GPU crash; expandable hop list on path maps. - Contact share: clipboard import of shared contacts, "Add again". - Android: enableEdgeToEdge and scrolling-screenshot support. - Translations for all new strings; fix mistranslated routing labels.
This commit is contained in:
1 parent
f81f2686a7
commit
5ea44d6ce9
85 files changed
+6520
-1716
No files matched your search
@@ -8,6 +8,13 @@ class PathRecord {
|
||||
final int failureCount;
|
||||
final double routeWeight;
|
||||
|
||||
/// Deliveries and failures with older results faded out (see
|
||||
/// `routeDecayFactor`), as of [statsAt]. Auto routing samples from these so
|
||||
/// a route that worked last month but fails today loses its rank quickly.
|
||||
final double recentSuccess;
|
||||
final double recentFailure;
|
||||
final DateTime? statsAt;
|
||||
|
||||
PathRecord({
|
||||
required this.hopCount,
|
||||
required this.tripTimeMs,
|
||||
@@ -17,7 +24,21 @@ class PathRecord {
|
||||
required this.successCount,
|
||||
required this.failureCount,
|
||||
this.routeWeight = 1.0,
|
||||
});
|
||||
double? recentSuccess,
|
||||
double? recentFailure,
|
||||
DateTime? statsAt,
|
||||
}) : recentSuccess = recentSuccess ?? _seedRecent(successCount),
|
||||
recentFailure = recentFailure ?? _seedRecent(failureCount),
|
||||
statsAt = statsAt ?? timestamp;
|
||||
|
||||
/// History saved before faded stats existed: start from the lifetime
|
||||
/// counts, capped so years of old results can't outvote new ones.
|
||||
static double _seedRecent(int count) => count.clamp(0, 5).toDouble();
|
||||
|
||||
/// Bytes per hop, derived from the stored path.
|
||||
int get hashWidth => hopCount > 0 && pathBytes.length >= hopCount
|
||||
? (pathBytes.length ~/ hopCount).clamp(1, 4)
|
||||
: 1;
|
||||
|
||||
String get displayText =>
|
||||
'$hopCount ${hopCount == 1 ? 'hop' : 'hops'} - ${(tripTimeMs / 1000).toStringAsFixed(2)}s';
|
||||
@@ -32,6 +53,9 @@ class PathRecord {
|
||||
'success_count': successCount,
|
||||
'failure_count': failureCount,
|
||||
'route_weight': routeWeight,
|
||||
'recent_success': recentSuccess,
|
||||
'recent_failure': recentFailure,
|
||||
'stats_at': statsAt?.toIso8601String(),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -48,6 +72,11 @@ class PathRecord {
|
||||
successCount: json['success_count'] as int? ?? 0,
|
||||
failureCount: json['failure_count'] as int? ?? 0,
|
||||
routeWeight: (json['route_weight'] as num?)?.toDouble() ?? 1.0,
|
||||
recentSuccess: (json['recent_success'] as num?)?.toDouble(),
|
||||
recentFailure: (json['recent_failure'] as num?)?.toDouble(),
|
||||
statsAt: json['stats_at'] != null
|
||||
? DateTime.tryParse(json['stats_at'] as String)
|
||||
: null,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,44 @@ import 'contact.dart';
|
||||
|
||||
const int recentAttemptDiversityWindow = 2;
|
||||
|
||||
/// What the radio can hear right now, so auto routing can prefer routes that
|
||||
/// fit where the user currently is (e.g. home vs. work repeaters).
|
||||
///
|
||||
/// "Not heard" is weak evidence — repeaters advert rarely and the radio only
|
||||
/// reports what it hears — so routes that don't fit are deprioritised, never
|
||||
/// excluded.
|
||||
class RouteContext {
|
||||
/// Whether anything was heard recently. Without that, nothing is known
|
||||
/// about the surroundings and every route is treated alike.
|
||||
final bool hasNeighbourInfo;
|
||||
|
||||
/// Whether the contact itself was heard with no repeater in between.
|
||||
final bool contactHeardDirectly;
|
||||
|
||||
/// Whether the first hop of a route ([pathBytes], [hashWidth] bytes per
|
||||
/// hop) was heard directly recently.
|
||||
final bool Function(List<int> pathBytes, int hashWidth) firstHopHeard;
|
||||
|
||||
/// The path the radio currently holds for the contact, if any.
|
||||
final List<int>? radioPath;
|
||||
|
||||
const RouteContext({
|
||||
required this.hasNeighbourInfo,
|
||||
required this.contactHeardDirectly,
|
||||
required this.firstHopHeard,
|
||||
this.radioPath,
|
||||
});
|
||||
|
||||
static bool _never(List<int> pathBytes, int hashWidth) => false;
|
||||
|
||||
/// Nothing known: every route is treated alike.
|
||||
static const RouteContext unknown = RouteContext(
|
||||
hasNeighbourInfo: false,
|
||||
contactHeardDirectly: false,
|
||||
firstHopHeard: _never,
|
||||
);
|
||||
}
|
||||
|
||||
class PathSelection {
|
||||
final List<int> pathBytes;
|
||||
final int hopCount;
|
||||
@@ -32,11 +70,15 @@ PathSelection resolvePathSelection(
|
||||
);
|
||||
}
|
||||
|
||||
if (forceFlood || contact.pathLength < 0 || selection?.useFlood == true) {
|
||||
if (forceFlood || selection?.useFlood == true) {
|
||||
return const PathSelection(pathBytes: [], hopCount: -1, useFlood: true);
|
||||
}
|
||||
|
||||
if (selection != null && selection.pathBytes.isNotEmpty) {
|
||||
// A route picked from history wins even when the radio holds no path for
|
||||
// the contact: it is proven, and flooding would throw that away. A direct
|
||||
// (zero-hop) selection has no hop bytes but is still a real path.
|
||||
if (selection != null &&
|
||||
(selection.pathBytes.isNotEmpty || selection.hopCount == 0)) {
|
||||
return PathSelection(
|
||||
pathBytes: selection.pathBytes,
|
||||
hopCount: selection.hopCount,
|
||||
@@ -44,6 +86,10 @@ PathSelection resolvePathSelection(
|
||||
);
|
||||
}
|
||||
|
||||
if (contact.pathLength < 0) {
|
||||
return const PathSelection(pathBytes: [], hopCount: -1, useFlood: true);
|
||||
}
|
||||
|
||||
return PathSelection(
|
||||
pathBytes: contact.path,
|
||||
hopCount: contact.pathLength,
|
||||
|
||||
Reference in new issue
Block a user