Add missing SwiftUI #Preview blocks across 65 views (#1649)

* Add SwiftUI previews for simple helper views

Agent-Logs-Url: https://github.com/meshtastic/Meshtastic-Apple/sessions/a2a43e8c-24fd-443a-8a98-13b678770edd

Co-authored-by: garthvh <1795163+garthvh@users.noreply.github.com>

* Add previews for action buttons, ChannelForm, MetricsColumnDetail, and DeviceOnboarding

Agent-Logs-Url: https://github.com/meshtastic/Meshtastic-Apple/sessions/a2a43e8c-24fd-443a-8a98-13b678770edd

Co-authored-by: garthvh <1795163+garthvh@users.noreply.github.com>

* Add previews for config views, log views, AppLog, Firmware, AppData, and UserConfig

Agent-Logs-Url: https://github.com/meshtastic/Meshtastic-Apple/sessions/a2a43e8c-24fd-443a-8a98-13b678770edd

Co-authored-by: garthvh <1795163+garthvh@users.noreply.github.com>

* Add preview for PositionConfig

Agent-Logs-Url: https://github.com/meshtastic/Meshtastic-Apple/sessions/a2a43e8c-24fd-443a-8a98-13b678770edd

Co-authored-by: garthvh <1795163+garthvh@users.noreply.github.com>

* Fix formatting bugs in #Preview blocks: restore missing .environmentObject/.environment modifiers and add proper tab indentation

Agent-Logs-Url: https://github.com/meshtastic/Meshtastic-Apple/sessions/7eeb7a54-7928-466f-8e39-b00d0012a09d

Co-authored-by: garthvh <1795163+garthvh@users.noreply.github.com>

* Linting fixes

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: garthvh <1795163+garthvh@users.noreply.github.com>
Co-authored-by: Garth Vander Houwen <garthvh@yahoo.com>
This commit is contained in:
Copilot 2026-04-04 18:02:32 -07:00 committed by GitHub
parent f5afce2d0f
commit 894e9382d8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
76 changed files with 567 additions and 41 deletions

View file

@ -134,3 +134,10 @@ struct AmbientLightingConfig: View {
self.hasChanges = false
}
}
#Preview {
let context = PersistenceController.preview.container.viewContext
return AmbientLightingConfig(node: nil)
.environmentObject(AccessoryManager.shared)
.environment(\.managedObjectContext, context)
}

View file

@ -355,3 +355,10 @@ struct CannedMessagesConfig: View {
self.hasMessagesChanges = false
}
}
#Preview {
let context = PersistenceController.preview.container.viewContext
return CannedMessagesConfig(node: nil)
.environmentObject(AccessoryManager.shared)
.environment(\.managedObjectContext, context)
}

View file

@ -261,3 +261,10 @@ struct DetectionSensorConfig: View {
self.hasChanges = false
}
}
#Preview {
let context = PersistenceController.preview.container.viewContext
return DetectionSensorConfig(node: nil)
.environmentObject(AccessoryManager.shared)
.environment(\.managedObjectContext, context)
}

View file

@ -283,3 +283,9 @@ struct ExternalNotificationConfig: View {
}
}
#Preview {
let context = PersistenceController.preview.container.viewContext
return ExternalNotificationConfig(node: nil)
.environmentObject(AccessoryManager.shared)
.environment(\.managedObjectContext, context)
}

View file

@ -464,3 +464,10 @@ struct MQTTConfig: View {
}
}
}
#Preview {
let context = PersistenceController.preview.container.viewContext
return MQTTConfig(node: nil)
.environmentObject(AccessoryManager.shared)
.environment(\.managedObjectContext, context)
}

View file

@ -123,3 +123,10 @@ struct PaxCounterConfig: View {
paxcounterUpdateInterval = UpdateInterval(from: Int(node?.paxCounterConfig?.updateInterval ?? 1800))
}
}
#Preview {
let context = PersistenceController.preview.container.viewContext
return PaxCounterConfig(node: nil)
.environmentObject(AccessoryManager.shared)
.environment(\.managedObjectContext, context)
}

View file

@ -143,3 +143,10 @@ struct RangeTestConfig: View {
self.hasChanges = false
}
}
#Preview {
let context = PersistenceController.preview.container.viewContext
return RangeTestConfig(node: nil)
.environmentObject(AccessoryManager.shared)
.environment(\.managedObjectContext, context)
}

View file

@ -114,3 +114,10 @@ struct RtttlConfig: View {
self.hasChanges = false
}
}
#Preview {
let context = PersistenceController.preview.container.viewContext
return RtttlConfig(node: nil)
.environmentObject(AccessoryManager.shared)
.environment(\.managedObjectContext, context)
}

View file

@ -205,3 +205,10 @@ struct SerialConfig: View {
self.hasChanges = false
}
}
#Preview {
let context = PersistenceController.preview.container.viewContext
return SerialConfig(node: nil)
.environmentObject(AccessoryManager.shared)
.environment(\.managedObjectContext, context)
}

View file

@ -197,3 +197,10 @@ struct StoreForwardConfig: View {
self.hasChanges = false
}
}
#Preview {
let context = PersistenceController.preview.container.viewContext
return StoreForwardConfig(node: nil)
.environmentObject(AccessoryManager.shared)
.environment(\.managedObjectContext, context)
}

View file

@ -241,3 +241,10 @@ struct TelemetryConfig: View {
self.hasChanges = false
}
}
#Preview {
let context = PersistenceController.preview.container.viewContext
return TelemetryConfig(node: nil)
.environmentObject(AccessoryManager.shared)
.environment(\.managedObjectContext, context)
}