Rename the Fly-mode Warnings tab to System Messages, log connection/upload events

Renames DroneEvent/DroneEventSeverity/droneEventLogProvider/
DroneStatusWarningsPanel to SystemMessage/SystemMessageSeverity/
systemMessageLogProvider/DroneStatusMessagesPanel throughout, matching
what the tab now actually shows - general system messages, not just
drone-health warnings.

Adds a new SystemMessageSeverity.info level (blue) for messages that
aren't a warning/error, and three new message sources on top of the
existing battery/failsafe detection:
- "Connected", logged the first time telemetryProvider produces a frame
  after having none - the mirror image of the existing "Connection lost"
  detection (which already fires on the first stream error after having
  had data), so no new transport-specific dependency was needed.
- "Connection type changed to X", from watching connectionSettingsProvider
  (skips the initial load so it doesn't fire on every app start).
- "Mission sent (N waypoints)" / "Mission upload failed: ...", logged
  from FlyScreen's send handler via a new public log() method on the
  notifier, alongside the existing snackbar.

Verified on the Pixel_10a emulator: entering Fly mode logs "Connected"
once the mock telemetry starts, and tapping the send button logs
"Mission sent (3 waypoints)" right after the snackbar.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Constantin Leue
2026-08-06 10:47:38 +02:00
co-authored by Claude Sonnet 5
parent 13475cc4f3
commit b09d00ab9f
10 changed files with 386 additions and 144 deletions
+38
View File
@@ -33,6 +33,7 @@ import 'package:dmc_app/ui/widgets/header_wind_pill.dart';
import 'package:dmc_app/ui/widgets/map_search_controls.dart';
import 'package:dmc_app/ui/providers/map_controller_provider.dart';
import 'package:dmc_app/ui/widgets/missions_drones_panel.dart';
import 'package:dmc_app/ui/widgets/paper_plane_icon.dart';
import 'package:dmc_app/ui/widgets/reticle_button.dart';
import 'package:dmc_app/ui/widgets/waypoint_chip.dart';
import 'package:dmc_app/ui/widgets/waypoint_list_panel.dart';
@@ -1001,6 +1002,43 @@ void main() {
await _stopTelemetry(container);
});
testWidgets(
'Drohnen-Status-Pille oeffnet "Drone Status & System Messages", '
'System-Messages-Tab zeigt "Connected" nach der ersten Telemetrie',
(tester) async {
final container = _testContainer();
addTearDown(container.dispose);
await tester.pumpWidget(
UncontrolledProviderScope(
container: container,
child: BlocProvider(
create: (_) => AppModeCubit(),
child: const MaterialApp(home: AppShell()),
),
),
);
await tester.pump();
await tester.tap(find.text('Fly'));
await tester.pump();
// MockFlightControllerLink tickt erst nach 1s (siehe oben).
await tester.pump(const Duration(seconds: 1, milliseconds: 100));
// Zwei PaperPlaneIcon-Instanzen im Fly-Fusszeile (Drohnen-Status-Pille
// UND der pinke Sende-Knopf, siehe bottom_stats_bar.dart) - die Pille
// steht im Widget-Baum zuerst.
await tester.tap(find.byType(PaperPlaneIcon).first);
await tester.pumpAndSettle();
expect(find.text('Drone Status & System Messages'), findsOneWidget);
await tester.tap(find.text('System Messages'));
await tester.pumpAndSettle();
expect(find.text('Connected'), findsOneWidget);
await _stopTelemetry(container);
});
testWidgets('Fit-Button im Fly-Modus ohne Wegpunkte zeigt Hinweis statt Absturz',
(tester) async {
final container = _testContainer();