Add in-app demo mode toggle, enable alignment assistant in demo data

CAMPER_DEMO=1 only works when Xcode or simctl launches the process, so
a build installed locally and opened from the home screen had no way
to enable demo mode at all. Demo mode is now also a persisted toggle
under Settings > Entwicklung (Debug builds only), checked alongside the
environment variable. Takes effect after an app restart since
DeviceStore/BluetoothManager only read it at init.

Also mark the demo leveling sensor as live-connected - it had a level
reading but never a live link state, which left the Ausrichtungs-
Assistent button (and Live Activity toggle) disabled in demo mode.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
fototeddy
2026-09-05 14:55:47 +02:00
co-authored by Claude Sonnet 5
parent 8d975d2c4d
commit 7fc9442aeb
3 changed files with 37 additions and 5 deletions
+16
View File
@@ -4,12 +4,28 @@ import SwiftUI
/// betrifft, steht bei diesem Gerät.
struct SettingsView: View {
@AppStorage(AppSettings.showDiagnosticsKey) private var showDiagnostics = false
#if DEBUG
@AppStorage(DemoData.enabledKey) private var demoModeEnabled = false
#endif
@Environment(PhoneWatchLink.self) private var watch
@Environment(\.dismiss) private var dismiss
var body: some View {
NavigationStack {
List {
#if DEBUG
Section {
Toggle("Demo-Modus", isOn: $demoModeEnabled)
} header: {
Text("Entwicklung")
} footer: {
Text("Füllt die App mit erfundenen Fahrzeugen und Messwerten, um "
+ "Ansichten ohne echte Sensoren zu prüfen. Wirkt erst nach "
+ "einem Neustart der App einmal beenden (im App-Umschalter "
+ "nach oben wischen) und wieder öffnen.")
}
#endif
Section {
Toggle("Diagnose anzeigen", isOn: $showDiagnostics)
} header: {