UI improvements for telemetry debugging

This commit is contained in:
Constantin Leue
2026-08-02 20:21:21 +02:00
parent 6cfb82bd77
commit f42d997d4c
7 changed files with 272 additions and 190 deletions
+1 -55
View File
@@ -62,7 +62,7 @@ class TopModeBar extends ConsumerWidget {
right: safeEdgeInset,
),
child: FractionallySizedBox(
widthFactor: 0.70,
widthFactor: 0.77,
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 5),
decoration: BoxDecoration(
@@ -87,8 +87,6 @@ class TopModeBar extends ConsumerWidget {
const SizedBox(width: 8),
const HeaderWindPill(),
const SizedBox(width: 8),
const _WifiConnectionProgressPill(),
const SizedBox(width: 8),
const Expanded(child: FlightModePill()),
const SizedBox(width: 8),
const FlyMapControls(),
@@ -151,58 +149,6 @@ Future<void> _maybeAutoConnectWifi(WidgetRef ref) async {
}
}
/// Kompakte Fortschrittsanzeige fuer den automatischen WLAN-Verbindungsaufbau
/// (siehe [_maybeAutoConnectWifi]) - nur sichtbar, solange die Verbindungsart
/// WLAN ist und gerade etwas passiert bzw. ein Fehler vorliegt. Bleibt im
/// Ruhezustand (disconnected, kein vorheriger Fehler) unsichtbar, damit die
/// Kopfleiste nicht dauerhaft mit einer Statuspille zugestellt ist.
class _WifiConnectionProgressPill extends ConsumerWidget {
const _WifiConnectionProgressPill();
@override
Widget build(BuildContext context, WidgetRef ref) {
final connectionType = ref.watch(connectionSettingsProvider).value?.connectionType;
final linkState = ref.watch(wifiLinkStateProvider).value;
if (connectionType != ConnectionType.wifi) return const SizedBox.shrink();
if (linkState == null || linkState == LinkState.disconnected) {
return const SizedBox.shrink();
}
final (label, color) = switch (linkState) {
LinkState.connecting => ('Connecting…', DmcColors.pafAmber),
LinkState.connected => ('WiFi connected', DmcColors.liveGreen),
LinkState.error => ('WiFi error', DmcColors.warnRed),
LinkState.disconnected => ('', Colors.grey),
};
return Padding(
padding: const EdgeInsets.only(right: 8),
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 4),
decoration: BoxDecoration(
color: color.withValues(alpha: 0.2),
borderRadius: BorderRadius.circular(12),
border: Border.all(color: color),
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
if (linkState == LinkState.connecting) ...[
SizedBox(
width: 10,
height: 10,
child: CircularProgressIndicator(strokeWidth: 1.5, color: color),
),
const SizedBox(width: 6),
],
Text(label, style: TextStyle(color: color, fontSize: 11)),
],
),
),
);
}
}
class _ModeButton extends StatelessWidget {
const _ModeButton({
required this.label,