Auto-fetch wind, drop manual fetch/validate buttons, fix it in fly mode

Redesigns the waypoint list panel to match the drone-status/missions
panels: no title bar, close button floats over the tab row, tabs get
more vertical padding.

Removes the "Fetch wind" and "Validate" header buttons along with the
now-fully-orphaned WindValidatePanel screen and its WindService
support code (fetchValidation, WindValidationResult and friends) -
nothing else referenced them.

Wind is now fetched automatically instead: HeaderWindNotifier gains
ensurePerWaypointWind(), called when the waypoint list panel opens and
when the header pill's per-waypoint toggle switches on. A lat/lon
signature of the waypoint list tracks whether the fetched data is
still current, so a ref.listen(currentMissionProvider) in the same
notifier refetches only when the list itself changes (position added/
removed/moved) - not on every altitude/speed edit. Waypoints that
already carry wind data (e.g. loaded from a saved mission) short-
circuit the check instead of re-fetching pointlessly.

Also wires per-waypoint wind markers into the fly-mode map, which
never had them (plan_screen.dart built windMarkers; fly_screen.dart
just never did) - the reported "doesn't work in fly mode" bug.
windMarkerWidth() moved from a plan_screen.dart-private method to
wind_marker_pill.dart so both screens can share it.

Test containers in widget_test.dart now override windServiceProvider
with a MockClient so the new auto-fetch trigger can't reach the real
network during tests.
This commit is contained in:
Constantin Leue
2026-08-09 22:26:23 +02:00
parent 6b7977eca1
commit eca1c647b3
10 changed files with 368 additions and 570 deletions
+14
View File
@@ -2,6 +2,20 @@ import 'package:flutter/material.dart';
import 'wind_arrow_icon.dart';
/// Breite des Marker-Rahmens fuer [WindMarkerPill] bei gegebener
/// Windgeschwindigkeit - geteilt zwischen Plan- und Fly-Modus, die beide
/// eigene Wind-Marker auf der Karte platzieren (MissionMap.windMarkers).
/// Haengt von der Ziffernzahl der gerundeten Geschwindigkeit ab, damit z.B.
/// "12 m/s" genauso wenig abgeschnitten wird wie "5 m/s".
double windMarkerWidth(double speedMs) {
final digits = speedMs.round().abs().toString().length;
// +1px Puffer: MarkerLayer rendert ueber eine eigene Transform-/
// OverflowBox-Kette, die im echten Baum minimal (< 1px) anders rundet als
// eine isolierte Messung - ohne Puffer fuehrte das zu einem
// 0.25px-Overflow.
return 81.0 + digits * 11.0;
}
/// Kleine Wind-Anzeige direkt an einem Wegpunkt auf der Karte (HTML-
/// Demonstrator: divIcon in redrawMapLayers(), sichtbar wenn
/// showPerWaypointWind aktiv ist und fuer den Wegpunkt Wind geladen wurde).