fix(ui): restore Alerts sidebar row selection (Issue #34) #38
@@ -87,9 +87,25 @@ public struct ContentView: View {
|
||||
}
|
||||
|
||||
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")
|
||||
.badge(store.alertEngine.activeAlerts.isEmpty ? nil : Text("\(store.alertEngine.activeAlerts.count)"))
|
||||
}
|
||||
}
|
||||
.listStyle(.sidebar)
|
||||
|
||||
Reference in New Issue
Block a user