fix(ui): restore Alerts sidebar row selection (Issue #34) #38

Merged
gronod merged 1 commits from fix/34-alerts-sidebar-badge into milestone/m6-bugfix-stability 2026-09-08 15:18:26 +01:00
+18 -2
View File
@@ -87,9 +87,25 @@ public struct ContentView: View {
} }
Section("Intelligence") { Section("Intelligence") {
Label("Alerts & Notifications", systemImage: "bell.badge") // Custom row instead of .badge() a badge applied after .tag
// detaches the tag from the list row and makes it unselectable.
Label {
HStack {
Text("Alerts & Notifications")
Spacer()
if !store.alertEngine.activeAlerts.isEmpty {
Text("\(store.alertEngine.activeAlerts.count)")
.font(.caption2.weight(.semibold))
.padding(.horizontal, 6)
.padding(.vertical, 2)
.background(Color.red.opacity(0.85), in: Capsule())
.foregroundStyle(.white)
}
}
} icon: {
Image(systemName: "bell.badge")
}
.tag("Alerts") .tag("Alerts")
.badge(store.alertEngine.activeAlerts.isEmpty ? nil : Text("\(store.alertEngine.activeAlerts.count)"))
} }
} }
.listStyle(.sidebar) .listStyle(.sidebar)