Disable export until a system has components

The Overview share menu offered a wiring diagram and a full report even
for an empty system. Gate it on loads, batteries or chargers being
present (iOS + Android) and add UI tests for both states.
This commit is contained in:
2026-08-12 11:26:03 +02:00
parent 345c8b3ac7
commit ab50728f07
4 changed files with 80 additions and 1 deletions

View File

@@ -56,6 +56,10 @@ struct LoadsView: View {
allChargers.filter { $0.system == system }
}
private var hasComponents: Bool {
!savedLoads.isEmpty || !savedBatteries.isEmpty || !savedChargers.isEmpty
}
var body: some View {
VStack(spacing: 0) {
TabView(selection: $selectedComponentTab) {
@@ -174,6 +178,7 @@ struct LoadsView: View {
} label: {
Image(systemName: "square.and.arrow.up")
}
.disabled(!hasComponents)
.accessibilityIdentifier("system-overview-share-button")
}
} else if showPrimary || showEditLoads || showEditBatteries || showEditChargers {